summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatth?us G. Chajdas <dev@anteru.net>2019-11-10 13:56:53 +0100
committerMatth?us G. Chajdas <dev@anteru.net>2019-11-10 13:56:53 +0100
commit1dd3124a9770e11b6684e5dd1e6bc15a0aa3bc67 (patch)
tree87a171383266dd1f64196589af081bc2f8e497c3
parentf1c080e184dc1bbc36eaa7cd729ff3a499de568a (diff)
downloadpygments-1dd3124a9770e11b6684e5dd1e6bc15a0aa3bc67.tar.gz
Remove all files, redirect to GitHub.HEADmaster
-rw-r--r--AUTHORS228
-rw-r--r--CHANGES1325
-rw-r--r--LICENSE25
-rw-r--r--MANIFEST.in6
-rw-r--r--Makefile71
-rw-r--r--README3
-rw-r--r--README.rst39
-rw-r--r--TODO12
-rw-r--r--bitbucket-pipelines.yml34
-rw-r--r--doc/Makefile153
-rw-r--r--doc/_static/favicon.icobin16958 -> 0 bytes
-rw-r--r--doc/_static/logo_new.pngbin40944 -> 0 bytes
-rw-r--r--doc/_static/logo_only.pngbin16424 -> 0 bytes
-rw-r--r--doc/_templates/docssidebar.html3
-rw-r--r--doc/_templates/indexsidebar.html25
-rw-r--r--doc/_themes/pygments14/layout.html98
-rw-r--r--doc/_themes/pygments14/static/bodybg.pngbin51903 -> 0 bytes
-rw-r--r--doc/_themes/pygments14/static/docbg.pngbin61296 -> 0 bytes
-rw-r--r--doc/_themes/pygments14/static/listitem.pngbin207 -> 0 bytes
-rw-r--r--doc/_themes/pygments14/static/logo.pngbin26933 -> 0 bytes
-rw-r--r--doc/_themes/pygments14/static/pocoo.pngbin2154 -> 0 bytes
-rw-r--r--doc/_themes/pygments14/static/pygments14.css_t401
-rw-r--r--doc/_themes/pygments14/theme.conf15
-rw-r--r--doc/conf.py241
-rw-r--r--doc/docs/api.rst354
-rw-r--r--doc/docs/authors.rst4
-rw-r--r--doc/docs/changelog.rst1
-rw-r--r--doc/docs/cmdline.rst166
-rw-r--r--doc/docs/filterdevelopment.rst71
-rw-r--r--doc/docs/filters.rst41
-rw-r--r--doc/docs/formatterdevelopment.rst169
-rw-r--r--doc/docs/formatters.rst48
-rw-r--r--doc/docs/index.rst66
-rw-r--r--doc/docs/integrate.rst40
-rw-r--r--doc/docs/java.rst70
-rw-r--r--doc/docs/lexerdevelopment.rst728
-rw-r--r--doc/docs/lexers.rst69
-rw-r--r--doc/docs/moinmoin.rst39
-rw-r--r--doc/docs/plugins.rst93
-rw-r--r--doc/docs/quickstart.rst205
-rw-r--r--doc/docs/rstdirective.rst22
-rw-r--r--doc/docs/styles.rst232
-rw-r--r--doc/docs/tokens.rst372
-rw-r--r--doc/docs/unicode.rst58
-rw-r--r--doc/download.rst41
-rw-r--r--doc/faq.rst139
-rw-r--r--doc/index.rst54
-rw-r--r--doc/languages.rst170
-rw-r--r--doc/make.bat190
-rw-r--r--doc/pygmentize.194
-rwxr-xr-xexternal/autopygmentize101
-rwxr-xr-xexternal/lasso-builtins-generator-9.lasso162
-rw-r--r--external/markdown-processor.py67
-rw-r--r--external/moin-parser.py112
-rw-r--r--external/pygments.bashcomp38
-rw-r--r--external/rst-directive.py82
-rwxr-xr-xpygmentize8
-rw-r--r--pygments/__init__.py90
-rw-r--r--pygments/cmdline.py573
-rw-r--r--pygments/console.py71
-rw-r--r--pygments/filter.py74
-rw-r--r--pygments/filters/__init__.py350
-rw-r--r--pygments/formatter.py95
-rw-r--r--pygments/formatters/__init__.py154
-rwxr-xr-xpygments/formatters/_mapping.py85
-rw-r--r--pygments/formatters/bbcode.py109
-rw-r--r--pygments/formatters/html.py880
-rw-r--r--pygments/formatters/img.py600
-rw-r--r--pygments/formatters/irc.py182
-rw-r--r--pygments/formatters/latex.py482
-rw-r--r--pygments/formatters/other.py160
-rw-r--r--pygments/formatters/rtf.py147
-rw-r--r--pygments/formatters/svg.py153
-rw-r--r--pygments/formatters/terminal.py136
-rw-r--r--pygments/formatters/terminal256.py315
-rw-r--r--pygments/lexer.py881
-rw-r--r--pygments/lexers/__init__.py337
-rw-r--r--pygments/lexers/_asy_builtins.py1645
-rw-r--r--pygments/lexers/_cl_builtins.py232
-rw-r--r--pygments/lexers/_cocoa_builtins.py73
-rw-r--r--pygments/lexers/_csound_builtins.py1660
-rw-r--r--pygments/lexers/_lasso_builtins.py5327
-rw-r--r--pygments/lexers/_lua_builtins.py295
-rw-r--r--pygments/lexers/_mapping.py524
-rw-r--r--pygments/lexers/_mql_builtins.py1172
-rw-r--r--pygments/lexers/_openedge_builtins.py2547
-rw-r--r--pygments/lexers/_php_builtins.py4756
-rw-r--r--pygments/lexers/_postgres_builtins.py621
-rw-r--r--pygments/lexers/_scilab_builtins.py3094
-rw-r--r--pygments/lexers/_sourcemod_builtins.py1163
-rw-r--r--pygments/lexers/_stan_builtins.py558
-rw-r--r--pygments/lexers/_stata_builtins.py421
-rw-r--r--pygments/lexers/_tsql_builtins.py1004
-rw-r--r--pygments/lexers/_vbscript_builtins.py280
-rw-r--r--pygments/lexers/_vim_builtins.py1939
-rw-r--r--pygments/lexers/actionscript.py240
-rw-r--r--pygments/lexers/agile.py24
-rw-r--r--pygments/lexers/algebra.py221
-rw-r--r--pygments/lexers/ambient.py76
-rw-r--r--pygments/lexers/ampl.py87
-rw-r--r--pygments/lexers/apl.py101
-rw-r--r--pygments/lexers/archetype.py318
-rw-r--r--pygments/lexers/asm.py774
-rw-r--r--pygments/lexers/automation.py374
-rw-r--r--pygments/lexers/basic.py659
-rw-r--r--pygments/lexers/bibtex.py160
-rw-r--r--pygments/lexers/boa.py102
-rw-r--r--pygments/lexers/business.py612
-rw-r--r--pygments/lexers/c_cpp.py252
-rw-r--r--pygments/lexers/c_like.py571
-rw-r--r--pygments/lexers/capnproto.py78
-rw-r--r--pygments/lexers/chapel.py112
-rw-r--r--pygments/lexers/clean.py178
-rw-r--r--pygments/lexers/compiled.py34
-rw-r--r--pygments/lexers/configs.py934
-rw-r--r--pygments/lexers/console.py114
-rw-r--r--pygments/lexers/crystal.py393
-rw-r--r--pygments/lexers/csound.py460
-rw-r--r--pygments/lexers/css.py692
-rw-r--r--pygments/lexers/d.py251
-rw-r--r--pygments/lexers/dalvik.py125
-rw-r--r--pygments/lexers/data.py561
-rw-r--r--pygments/lexers/diff.py165
-rw-r--r--pygments/lexers/dotnet.py688
-rw-r--r--pygments/lexers/dsls.py878
-rw-r--r--pygments/lexers/dylan.py289
-rw-r--r--pygments/lexers/ecl.py125
-rw-r--r--pygments/lexers/eiffel.py65
-rw-r--r--pygments/lexers/elm.py121
-rw-r--r--pygments/lexers/erlang.py533
-rw-r--r--pygments/lexers/esoteric.py277
-rw-r--r--pygments/lexers/ezhil.py69
-rw-r--r--pygments/lexers/factor.py344
-rw-r--r--pygments/lexers/fantom.py250
-rw-r--r--pygments/lexers/felix.py273
-rw-r--r--pygments/lexers/floscript.py83
-rw-r--r--pygments/lexers/forth.py179
-rw-r--r--pygments/lexers/fortran.py206
-rw-r--r--pygments/lexers/foxpro.py428
-rw-r--r--pygments/lexers/freefem.py898
-rw-r--r--pygments/lexers/functional.py21
-rw-r--r--pygments/lexers/go.py101
-rw-r--r--pygments/lexers/grammar_notation.py213
-rw-r--r--pygments/lexers/graph.py85
-rw-r--r--pygments/lexers/graphics.py781
-rw-r--r--pygments/lexers/haskell.py869
-rw-r--r--pygments/lexers/haxe.py936
-rw-r--r--pygments/lexers/hdl.py382
-rw-r--r--pygments/lexers/hexdump.py103
-rw-r--r--pygments/lexers/html.py602
-rw-r--r--pygments/lexers/idl.py270
-rw-r--r--pygments/lexers/igor.py425
-rw-r--r--pygments/lexers/inferno.py96
-rw-r--r--pygments/lexers/installers.py322
-rw-r--r--pygments/lexers/int_fiction.py1343
-rw-r--r--pygments/lexers/iolang.py63
-rw-r--r--pygments/lexers/j.py146
-rw-r--r--pygments/lexers/javascript.py1525
-rw-r--r--pygments/lexers/julia.py335
-rw-r--r--pygments/lexers/jvm.py1654
-rw-r--r--pygments/lexers/lisp.py2693
-rw-r--r--pygments/lexers/make.py202
-rw-r--r--pygments/lexers/markup.py599
-rw-r--r--pygments/lexers/math.py21
-rw-r--r--pygments/lexers/matlab.py663
-rw-r--r--pygments/lexers/ml.py769
-rw-r--r--pygments/lexers/modeling.py366
-rw-r--r--pygments/lexers/modula2.py1561
-rw-r--r--pygments/lexers/monte.py204
-rw-r--r--pygments/lexers/ncl.py894
-rw-r--r--pygments/lexers/nimrod.py159
-rw-r--r--pygments/lexers/nit.py64
-rw-r--r--pygments/lexers/nix.py136
-rw-r--r--pygments/lexers/oberon.py105
-rw-r--r--pygments/lexers/objective.py504
-rw-r--r--pygments/lexers/ooc.py85
-rw-r--r--pygments/lexers/other.py41
-rw-r--r--pygments/lexers/parasail.py79
-rw-r--r--pygments/lexers/parsers.py835
-rw-r--r--pygments/lexers/pascal.py644
-rw-r--r--pygments/lexers/pawn.py199
-rw-r--r--pygments/lexers/perl.py620
-rw-r--r--pygments/lexers/php.py270
-rw-r--r--pygments/lexers/pony.py94
-rw-r--r--pygments/lexers/praat.py294
-rw-r--r--pygments/lexers/prolog.py305
-rw-r--r--pygments/lexers/python.py941
-rw-r--r--pygments/lexers/qvt.py152
-rw-r--r--pygments/lexers/r.py193
-rw-r--r--pygments/lexers/rdf.py423
-rw-r--r--pygments/lexers/rebol.py431
-rw-r--r--pygments/lexers/resource.py85
-rw-r--r--pygments/lexers/rnc.py67
-rw-r--r--pygments/lexers/roboconf.py82
-rw-r--r--pygments/lexers/robotframework.py560
-rw-r--r--pygments/lexers/ruby.py519
-rw-r--r--pygments/lexers/rust.py220
-rw-r--r--pygments/lexers/sas.py228
-rw-r--r--pygments/lexers/scripting.py1222
-rw-r--r--pygments/lexers/sgf.py61
-rw-r--r--pygments/lexers/shell.py833
-rw-r--r--pygments/lexers/slash.py185
-rw-r--r--pygments/lexers/smalltalk.py195
-rw-r--r--pygments/lexers/smv.py79
-rw-r--r--pygments/lexers/snobol.py83
-rw-r--r--pygments/lexers/special.py103
-rw-r--r--pygments/lexers/sql.py729
-rw-r--r--pygments/lexers/stata.py171
-rw-r--r--pygments/lexers/supercollider.py90
-rw-r--r--pygments/lexers/tcl.py145
-rw-r--r--pygments/lexers/templates.py2282
-rw-r--r--pygments/lexers/teraterm.py158
-rw-r--r--pygments/lexers/testing.py207
-rw-r--r--pygments/lexers/text.py26
-rw-r--r--pygments/lexers/textedit.py169
-rw-r--r--pygments/lexers/textfmts.py297
-rw-r--r--pygments/lexers/theorem.py456
-rw-r--r--pygments/lexers/trafficscript.py54
-rw-r--r--pygments/lexers/typoscript.py219
-rw-r--r--pygments/lexers/unicon.py390
-rw-r--r--pygments/lexers/urbi.py133
-rw-r--r--pygments/lexers/varnish.py190
-rw-r--r--pygments/lexers/verification.py111
-rw-r--r--pygments/lexers/web.py24
-rw-r--r--pygments/lexers/webmisc.py989
-rw-r--r--pygments/lexers/whiley.py116
-rw-r--r--pygments/lexers/x10.py69
-rw-r--r--pygments/lexers/xorg.py37
-rw-r--r--pygments/lexers/zig.py126
-rw-r--r--pygments/modeline.py44
-rw-r--r--pygments/plugin.py70
-rw-r--r--pygments/regexopt.py92
-rw-r--r--pygments/scanner.py105
-rw-r--r--pygments/sphinxext.py158
-rw-r--r--pygments/style.py182
-rw-r--r--pygments/styles/__init__.py86
-rw-r--r--pygments/styles/abap.py29
-rw-r--r--pygments/styles/algol.py63
-rw-r--r--pygments/styles/algol_nu.py63
-rw-r--r--pygments/styles/arduino.py98
-rw-r--r--pygments/styles/autumn.py65
-rw-r--r--pygments/styles/borland.py51
-rw-r--r--pygments/styles/bw.py49
-rw-r--r--pygments/styles/colorful.py81
-rw-r--r--pygments/styles/default.py73
-rw-r--r--pygments/styles/emacs.py72
-rw-r--r--pygments/styles/friendly.py72
-rw-r--r--pygments/styles/fruity.py42
-rw-r--r--pygments/styles/igor.py29
-rw-r--r--pygments/styles/lovelace.py97
-rw-r--r--pygments/styles/manni.py75
-rw-r--r--pygments/styles/monokai.py106
-rw-r--r--pygments/styles/murphy.py80
-rw-r--r--pygments/styles/native.py65
-rw-r--r--pygments/styles/paraiso_dark.py125
-rw-r--r--pygments/styles/paraiso_light.py125
-rw-r--r--pygments/styles/pastie.py75
-rw-r--r--pygments/styles/perldoc.py69
-rw-r--r--pygments/styles/rainbow_dash.py89
-rw-r--r--pygments/styles/rrt.py33
-rw-r--r--pygments/styles/sas.py44
-rw-r--r--pygments/styles/solarized.py130
-rw-r--r--pygments/styles/stata_dark.py41
-rw-r--r--pygments/styles/stata_light.py39
-rw-r--r--pygments/styles/tango.py141
-rw-r--r--pygments/styles/trac.py63
-rw-r--r--pygments/styles/vim.py63
-rw-r--r--pygments/styles/vs.py38
-rw-r--r--pygments/styles/xcode.py51
-rw-r--r--pygments/token.py213
-rw-r--r--pygments/unistring.py221
-rw-r--r--pygments/util.py388
-rw-r--r--requirements.txt5
-rwxr-xr-xscripts/check_sources.py212
-rwxr-xr-xscripts/debug_lexer.py246
-rw-r--r--scripts/detect_missing_analyse_text.py33
-rw-r--r--scripts/epydoc.css280
l---------scripts/find_error.py1
-rw-r--r--scripts/get_vimkw.py74
-rw-r--r--scripts/pylintrc301
-rw-r--r--scripts/release-checklist24
-rwxr-xr-xscripts/vim2pygments.py935
-rw-r--r--setup.cfg10
-rwxr-xr-xsetup.py83
-rw-r--r--tests/dtds/HTML4-f.dtd37
-rw-r--r--tests/dtds/HTML4-s.dtd869
-rw-r--r--tests/dtds/HTML4.dcl88
-rw-r--r--tests/dtds/HTML4.dtd1092
-rw-r--r--tests/dtds/HTML4.soc9
-rw-r--r--tests/dtds/HTMLlat1.ent195
-rw-r--r--tests/dtds/HTMLspec.ent77
-rw-r--r--tests/dtds/HTMLsym.ent241
-rw-r--r--tests/examplefiles/99_bottles_of_beer.chpl206
-rw-r--r--tests/examplefiles/AcidStateAdvanced.hs209
-rw-r--r--tests/examplefiles/AlternatingGroup.mu102
-rw-r--r--tests/examplefiles/BOM.js1
-rw-r--r--tests/examplefiles/Blink.ino24
-rwxr-xr-xtests/examplefiles/CPDictionary.j611
-rw-r--r--tests/examplefiles/Charmci.ci20
-rw-r--r--tests/examplefiles/Config.in.cache1973
-rw-r--r--tests/examplefiles/Constants.mo158
-rw-r--r--tests/examplefiles/DancingSudoku.lhs411
-rwxr-xr-xtests/examplefiles/Deflate.fs578
-rw-r--r--tests/examplefiles/Error.pmod38
-rw-r--r--tests/examplefiles/Errors.scala23
-rw-r--r--tests/examplefiles/FakeFile.pike360
-rw-r--r--tests/examplefiles/Get-CommandDefinitionHtml.ps166
-rw-r--r--tests/examplefiles/IPDispatchC.nc104
-rw-r--r--tests/examplefiles/IPDispatchP.nc671
-rw-r--r--tests/examplefiles/Intro.java1660
-rw-r--r--tests/examplefiles/Makefile1131
-rw-r--r--tests/examplefiles/Object.st4394
-rw-r--r--tests/examplefiles/OrderedMap.hx584
-rw-r--r--tests/examplefiles/RoleQ.pm623
-rw-r--r--tests/examplefiles/SmallCheck.hs378
-rw-r--r--tests/examplefiles/Sorting.mod470
-rw-r--r--tests/examplefiles/StdGeneric.icl134
-rw-r--r--tests/examplefiles/Sudoku.lhs382
-rw-r--r--tests/examplefiles/abnf_example1.abnf22
-rw-r--r--tests/examplefiles/abnf_example2.abnf9
-rw-r--r--tests/examplefiles/addressbook.proto30
-rw-r--r--tests/examplefiles/ahcon.f340
-rw-r--r--tests/examplefiles/all.nit1986
-rw-r--r--tests/examplefiles/antlr_ANTLRv3.g608
-rw-r--r--tests/examplefiles/antlr_throws1
-rw-r--r--tests/examplefiles/apache2.conf398
-rw-r--r--tests/examplefiles/as3_test.as143
-rw-r--r--tests/examplefiles/as3_test2.as46
-rw-r--r--tests/examplefiles/as3_test3.as3
-rw-r--r--tests/examplefiles/aspx-cs_example27
-rw-r--r--tests/examplefiles/autoit_submit.au327
-rw-r--r--tests/examplefiles/automake.mk7
-rw-r--r--tests/examplefiles/badcase.java2
-rw-r--r--tests/examplefiles/bigtest.nsi308
-rw-r--r--tests/examplefiles/bnf_example1.bnf15
-rw-r--r--tests/examplefiles/boot-9.scm1557
-rw-r--r--tests/examplefiles/ca65_example284
-rw-r--r--tests/examplefiles/capdl_example.cdl64
-rw-r--r--tests/examplefiles/cbmbas_example9
-rw-r--r--tests/examplefiles/cells.ps515
-rw-r--r--tests/examplefiles/ceval.c2604
-rw-r--r--tests/examplefiles/char.scala4
-rw-r--r--tests/examplefiles/cheetah_example.html13
-rw-r--r--tests/examplefiles/classes.dylan125
-rw-r--r--tests/examplefiles/clojure-weird-keywords.clj5
-rw-r--r--tests/examplefiles/condensed_ruby.rb10
-rw-r--r--tests/examplefiles/coq_RelationClasses447
-rw-r--r--tests/examplefiles/core.cljs52
-rw-r--r--tests/examplefiles/database.pytb20
-rw-r--r--tests/examplefiles/de.MoinMoin.po2461
-rw-r--r--tests/examplefiles/demo.ahk181
-rw-r--r--tests/examplefiles/demo.cfm50
-rw-r--r--tests/examplefiles/demo.css.in6
-rw-r--r--tests/examplefiles/demo.frt3
-rw-r--r--tests/examplefiles/demo.hbs34
-rw-r--r--tests/examplefiles/demo.js.in6
-rw-r--r--tests/examplefiles/demo.thrift14
-rw-r--r--tests/examplefiles/demo.xul.in7
-rw-r--r--tests/examplefiles/django_sample.html+django68
-rw-r--r--tests/examplefiles/docker.docker34
-rw-r--r--tests/examplefiles/durexmania.aheui4
-rw-r--r--tests/examplefiles/dwarf.cw17
-rw-r--r--tests/examplefiles/eg_example1.eg155
-rw-r--r--tests/examplefiles/ember.handlebars33
-rw-r--r--tests/examplefiles/erl_session10
-rw-r--r--tests/examplefiles/es6.js46
-rw-r--r--tests/examplefiles/escape_semicolon.clj1
-rw-r--r--tests/examplefiles/eval.rs606
-rw-r--r--tests/examplefiles/evil_regex.js48
-rw-r--r--tests/examplefiles/example.Rd78
-rw-r--r--tests/examplefiles/example.als217
-rw-r--r--tests/examplefiles/example.bat211
-rw-r--r--tests/examplefiles/example.bbc156
-rw-r--r--tests/examplefiles/example.bc53
-rw-r--r--tests/examplefiles/example.boa18
-rw-r--r--tests/examplefiles/example.bug54
-rw-r--r--tests/examplefiles/example.c2080
-rw-r--r--tests/examplefiles/example.ceylon52
-rw-r--r--tests/examplefiles/example.chai6
-rw-r--r--tests/examplefiles/example.clay33
-rw-r--r--tests/examplefiles/example.cls15
-rw-r--r--tests/examplefiles/example.cob2620
-rw-r--r--tests/examplefiles/example.coffee27
-rw-r--r--tests/examplefiles/example.cpp2363
-rw-r--r--tests/examplefiles/example.e124
-rw-r--r--tests/examplefiles/example.elm58
-rw-r--r--tests/examplefiles/example.ezt32
-rw-r--r--tests/examplefiles/example.f908
-rw-r--r--tests/examplefiles/example.feature16
-rw-r--r--tests/examplefiles/example.fish580
-rw-r--r--tests/examplefiles/example.flo40
-rw-r--r--tests/examplefiles/example.gd23
-rw-r--r--tests/examplefiles/example.gi64
-rw-r--r--tests/examplefiles/example.golo113
-rwxr-xr-xtests/examplefiles/example.groovy2
-rw-r--r--tests/examplefiles/example.gs106
-rw-r--r--tests/examplefiles/example.gst7
-rw-r--r--tests/examplefiles/example.hlsl168
-rw-r--r--tests/examplefiles/example.hs41
-rw-r--r--tests/examplefiles/example.hx192
-rw-r--r--tests/examplefiles/example.i6t32
-rw-r--r--tests/examplefiles/example.i7x45
-rw-r--r--tests/examplefiles/example.icn283
-rw-r--r--tests/examplefiles/example.icon381
-rw-r--r--tests/examplefiles/example.j564
-rw-r--r--tests/examplefiles/example.jag48
-rw-r--r--tests/examplefiles/example.java16
-rw-r--r--tests/examplefiles/example.jcl31
-rw-r--r--tests/examplefiles/example.jsgf28
-rw-r--r--tests/examplefiles/example.jsonld27
-rw-r--r--tests/examplefiles/example.juttle110
-rw-r--r--tests/examplefiles/example.kal75
-rw-r--r--tests/examplefiles/example.kt47
-rw-r--r--tests/examplefiles/example.lagda19
-rw-r--r--tests/examplefiles/example.liquid42
-rw-r--r--tests/examplefiles/example.lua274
-rw-r--r--tests/examplefiles/example.ma8
-rw-r--r--tests/examplefiles/example.mac6
-rw-r--r--tests/examplefiles/example.md64
-rw-r--r--tests/examplefiles/example.monkey152
-rw-r--r--tests/examplefiles/example.moo26
-rw-r--r--tests/examplefiles/example.moon629
-rw-r--r--tests/examplefiles/example.mq4187
-rw-r--r--tests/examplefiles/example.mqh123
-rw-r--r--tests/examplefiles/example.msc43
-rw-r--r--tests/examplefiles/example.ng211
-rw-r--r--tests/examplefiles/example.ni57
-rw-r--r--tests/examplefiles/example.nim1010
-rw-r--r--tests/examplefiles/example.nix80
-rw-r--r--tests/examplefiles/example.ns269
-rw-r--r--tests/examplefiles/example.pas2708
-rw-r--r--tests/examplefiles/example.pcmk115
-rw-r--r--tests/examplefiles/example.pony18
-rw-r--r--tests/examplefiles/example.pp8
-rw-r--r--tests/examplefiles/example.praat280
-rw-r--r--tests/examplefiles/example.prg161
-rw-r--r--tests/examplefiles/example.rb1852
-rw-r--r--tests/examplefiles/example.red257
-rw-r--r--tests/examplefiles/example.reds150
-rw-r--r--tests/examplefiles/example.reg19
-rw-r--r--tests/examplefiles/example.rexx50
-rw-r--r--tests/examplefiles/example.rhtml561
-rw-r--r--tests/examplefiles/example.rkt743
-rw-r--r--tests/examplefiles/example.rpf4
-rw-r--r--tests/examplefiles/example.rts118
-rw-r--r--tests/examplefiles/example.sbl109
-rw-r--r--tests/examplefiles/example.scd76
-rw-r--r--tests/examplefiles/example.sgf35
-rw-r--r--tests/examplefiles/example.sh22
-rw-r--r--tests/examplefiles/example.sh-session19
-rw-r--r--tests/examplefiles/example.shell-session45
-rw-r--r--tests/examplefiles/example.shex20
-rw-r--r--tests/examplefiles/example.sl6
-rw-r--r--tests/examplefiles/example.slim31
-rw-r--r--tests/examplefiles/example.sls51
-rw-r--r--tests/examplefiles/example.sml156
-rw-r--r--tests/examplefiles/example.snobol15
-rw-r--r--tests/examplefiles/example.stan122
-rw-r--r--tests/examplefiles/example.tap37
-rw-r--r--tests/examplefiles/example.tasm527
-rw-r--r--tests/examplefiles/example.tea34
-rw-r--r--tests/examplefiles/example.tf208
-rw-r--r--tests/examplefiles/example.thy751
-rw-r--r--tests/examplefiles/example.todotxt9
-rw-r--r--tests/examplefiles/example.toml181
-rw-r--r--tests/examplefiles/example.ttl43
-rw-r--r--tests/examplefiles/example.u547
-rw-r--r--tests/examplefiles/example.u1111
-rw-r--r--tests/examplefiles/example.vbs55
-rw-r--r--tests/examplefiles/example.weechatlog11
-rw-r--r--tests/examplefiles/example.whiley296
-rw-r--r--tests/examplefiles/example.x109
-rw-r--r--tests/examplefiles/example.xhtml376
-rw-r--r--tests/examplefiles/example.xtend34
-rw-r--r--tests/examplefiles/example.xtm1101
-rw-r--r--tests/examplefiles/example.yaml311
-rw-r--r--tests/examplefiles/example.zig263
-rw-r--r--tests/examplefiles/example1.cadl149
-rw-r--r--tests/examplefiles/example2.aspx29
-rw-r--r--tests/examplefiles/example2.cpp20
-rw-r--r--tests/examplefiles/example2.msc79
-rw-r--r--tests/examplefiles/exampleScript.cfc241
-rw-r--r--tests/examplefiles/exampleTag.cfc18
-rw-r--r--tests/examplefiles/example_coq.v4
-rw-r--r--tests/examplefiles/example_elixir.ex233
-rw-r--r--tests/examplefiles/example_file.fy128
-rw-r--r--tests/examplefiles/ezhil_primefactors.n152
-rw-r--r--tests/examplefiles/fennelview.fnl156
-rw-r--r--tests/examplefiles/fibonacci.tokigun.aheui4
-rw-r--r--tests/examplefiles/firefox.mak586
-rw-r--r--tests/examplefiles/flatline_example186
-rw-r--r--tests/examplefiles/flipflop.sv19
-rw-r--r--tests/examplefiles/foo.sce6
-rw-r--r--tests/examplefiles/format.ml1213
-rw-r--r--tests/examplefiles/freefem.edp94
-rw-r--r--tests/examplefiles/fucked_up.rb77
-rw-r--r--tests/examplefiles/function.mu1
-rw-r--r--tests/examplefiles/functional.rst1472
-rw-r--r--tests/examplefiles/garcia-wachs.kk133
-rw-r--r--tests/examplefiles/genclass.clj510
-rw-r--r--tests/examplefiles/genshi_example.xml+genshi193
-rw-r--r--tests/examplefiles/genshitext_example.genshitext33
-rw-r--r--tests/examplefiles/glsl.frag7
-rw-r--r--tests/examplefiles/glsl.vert13
-rw-r--r--tests/examplefiles/grammar-test.p622
-rw-r--r--tests/examplefiles/guidance.smv1124
-rw-r--r--tests/examplefiles/hash_syntax.rb5
-rw-r--r--tests/examplefiles/hello-world.puzzlet.aheui10
-rw-r--r--tests/examplefiles/hello.at6
-rw-r--r--tests/examplefiles/hello.golo5
-rw-r--r--tests/examplefiles/hello.lsl12
-rw-r--r--tests/examplefiles/hello.smali40
-rw-r--r--tests/examplefiles/hello.sp9
-rw-r--r--tests/examplefiles/hexdump_debugexe309
-rw-r--r--tests/examplefiles/hexdump_hd310
-rw-r--r--tests/examplefiles/hexdump_hexcat247
-rw-r--r--tests/examplefiles/hexdump_hexdump310
-rw-r--r--tests/examplefiles/hexdump_od310
-rw-r--r--tests/examplefiles/hexdump_xxd309
-rw-r--r--tests/examplefiles/html+php_faulty.php1
-rw-r--r--tests/examplefiles/http_request_example15
-rw-r--r--tests/examplefiles/http_response_example29
-rw-r--r--tests/examplefiles/hybris_File.hy174
-rw-r--r--tests/examplefiles/idl_sample.pro73
-rw-r--r--tests/examplefiles/iex_example23
-rw-r--r--tests/examplefiles/inet_pton6.dg71
-rw-r--r--tests/examplefiles/inform6_example375
-rw-r--r--tests/examplefiles/interp.scala10
-rw-r--r--tests/examplefiles/intro.ik24
-rw-r--r--tests/examplefiles/ints.php10
-rw-r--r--tests/examplefiles/intsyn.fun675
-rw-r--r--tests/examplefiles/intsyn.sig286
-rw-r--r--tests/examplefiles/irb_heredoc8
-rwxr-xr-xtests/examplefiles/irc.lsp214
-rw-r--r--tests/examplefiles/java.properties16
-rw-r--r--tests/examplefiles/jbst_example1.jbst28
-rw-r--r--tests/examplefiles/jbst_example2.jbst45
-rw-r--r--tests/examplefiles/jinjadesignerdoc.rst713
-rw-r--r--tests/examplefiles/json.lasso301
-rw-r--r--tests/examplefiles/json.lasso9213
-rw-r--r--tests/examplefiles/language.hy165
-rw-r--r--tests/examplefiles/lighttpd_config.conf13
-rw-r--r--tests/examplefiles/limbo.b456
-rw-r--r--tests/examplefiles/linecontinuation.py47
-rw-r--r--tests/examplefiles/livescript-demo.ls43
-rw-r--r--tests/examplefiles/logos_example.xm28
-rw-r--r--tests/examplefiles/ltmain.sh2849
-rw-r--r--tests/examplefiles/main.cmake45
-rwxr-xr-xtests/examplefiles/markdown.lsp679
-rw-r--r--tests/examplefiles/matlab_noreturn3
-rw-r--r--tests/examplefiles/matlab_sample34
-rw-r--r--tests/examplefiles/matlabsession_sample.txt37
-rw-r--r--tests/examplefiles/metagrammar.treetop455
-rw-r--r--tests/examplefiles/minehunt.qml112
-rw-r--r--tests/examplefiles/minimal.ns24
-rw-r--r--tests/examplefiles/modula2_test_cases.def354
-rw-r--r--tests/examplefiles/moin_SyntaxReference.txt340
-rw-r--r--tests/examplefiles/multiline_regexes.rb38
-rw-r--r--tests/examplefiles/nanomsg.intr95
-rw-r--r--tests/examplefiles/nasm_aoutso.asm96
-rw-r--r--tests/examplefiles/nasm_objexe.asm30
-rw-r--r--tests/examplefiles/nemerle_sample.n87
-rw-r--r--tests/examplefiles/nginx_nginx.conf118
-rw-r--r--tests/examplefiles/noexcept.cpp8
-rw-r--r--tests/examplefiles/numbers.c12
-rw-r--r--tests/examplefiles/objc_example.m179
-rw-r--r--tests/examplefiles/openedge_example34
-rw-r--r--tests/examplefiles/pacman.conf49
-rw-r--r--tests/examplefiles/pacman.ijs1107
-rw-r--r--tests/examplefiles/pawn_example25
-rw-r--r--tests/examplefiles/perl_misc62
-rw-r--r--tests/examplefiles/perl_perl5db998
-rw-r--r--tests/examplefiles/perl_regex-delims120
-rw-r--r--tests/examplefiles/perlfunc.1856
-rw-r--r--tests/examplefiles/phpMyAdmin.spec163
-rw-r--r--tests/examplefiles/phpcomplete.vim567
-rw-r--r--tests/examplefiles/pkgconfig_example.pc18
-rw-r--r--tests/examplefiles/plain.bst1097
-rw-r--r--tests/examplefiles/pleac.in.rb1223
-rw-r--r--tests/examplefiles/postgresql_test.txt81
-rw-r--r--tests/examplefiles/pppoe.applescript10
-rw-r--r--tests/examplefiles/psql_session.txt122
-rw-r--r--tests/examplefiles/py3_test.txt2
-rw-r--r--tests/examplefiles/py3tb_test.py3tb4
-rw-r--r--tests/examplefiles/pycon_ctrlc_traceback118
-rw-r--r--tests/examplefiles/pycon_test.pycon17
-rw-r--r--tests/examplefiles/pytb_test2.pytb2
-rw-r--r--tests/examplefiles/pytb_test3.pytb4
-rw-r--r--tests/examplefiles/python25-bsd.mak234
-rw-r--r--tests/examplefiles/qbasic_example2
-rw-r--r--tests/examplefiles/qsort.prolog13
-rw-r--r--tests/examplefiles/r-console-transcript.Rout38
-rw-r--r--tests/examplefiles/r6rs-comments.scm23
-rw-r--r--tests/examplefiles/ragel-cpp_rlscan280
-rw-r--r--tests/examplefiles/ragel-cpp_snippet2
-rw-r--r--tests/examplefiles/regex.js22
-rw-r--r--tests/examplefiles/resourcebundle_demo9
-rw-r--r--tests/examplefiles/reversi.lsp427
-rw-r--r--tests/examplefiles/rnc_example.rnc33
-rw-r--r--tests/examplefiles/roboconf.graph40
-rw-r--r--tests/examplefiles/roboconf.instances24
-rw-r--r--tests/examplefiles/robotframework_test.txt40
-rw-r--r--tests/examplefiles/rql-queries.rql34
-rw-r--r--tests/examplefiles/ruby_func_def.rb11
-rw-r--r--tests/examplefiles/sample.qvto4
-rw-r--r--tests/examplefiles/scilab.sci30
-rw-r--r--tests/examplefiles/scope.cirru237
-rw-r--r--tests/examplefiles/session.dylan-console9
-rw-r--r--tests/examplefiles/sibling.prolog19
-rw-r--r--tests/examplefiles/simple.camkes38
-rw-r--r--tests/examplefiles/simple.croc747
-rw-r--r--tests/examplefiles/smarty_example.html209
-rw-r--r--tests/examplefiles/source.lgt343
-rw-r--r--tests/examplefiles/sources.list62
-rw-r--r--tests/examplefiles/sparql.rq48
-rw-r--r--tests/examplefiles/sphere.pov18
-rw-r--r--tests/examplefiles/sqlite3.sqlite3-console27
-rw-r--r--tests/examplefiles/squid.conf30
-rw-r--r--tests/examplefiles/string.jl1031
-rw-r--r--tests/examplefiles/string_delimiters.d21
-rw-r--r--tests/examplefiles/stripheredoc.sh3
-rw-r--r--tests/examplefiles/subr.el4868
-rw-r--r--tests/examplefiles/swig_java.swg1329
-rw-r--r--tests/examplefiles/swig_std_vector.i225
-rw-r--r--tests/examplefiles/tads3_example.t1248
-rw-r--r--tests/examplefiles/teraterm.ttl34
-rw-r--r--tests/examplefiles/termcap1340
-rw-r--r--tests/examplefiles/terminfo1445
-rw-r--r--tests/examplefiles/test-3.0.xq185
-rw-r--r--tests/examplefiles/test-exist-update.xq75
-rw-r--r--tests/examplefiles/test.R185
-rw-r--r--tests/examplefiles/test.adb211
-rw-r--r--tests/examplefiles/test.adls313
-rw-r--r--tests/examplefiles/test.agda109
-rw-r--r--tests/examplefiles/test.apl26
-rw-r--r--tests/examplefiles/test.asy131
-rw-r--r--tests/examplefiles/test.awk121
-rw-r--r--tests/examplefiles/test.bb95
-rw-r--r--tests/examplefiles/test.bib77
-rw-r--r--tests/examplefiles/test.bmx145
-rw-r--r--tests/examplefiles/test.boo39
-rw-r--r--tests/examplefiles/test.bpl140
-rw-r--r--tests/examplefiles/test.bro250
-rw-r--r--tests/examplefiles/test.cadl32
-rw-r--r--tests/examplefiles/test.cr2871
-rw-r--r--tests/examplefiles/test.cs374
-rw-r--r--tests/examplefiles/test.csd18
-rw-r--r--tests/examplefiles/test.css54
-rw-r--r--tests/examplefiles/test.cu36
-rw-r--r--tests/examplefiles/test.cyp123
-rw-r--r--tests/examplefiles/test.d135
-rw-r--r--tests/examplefiles/test.dart23
-rw-r--r--tests/examplefiles/test.dtd89
-rw-r--r--tests/examplefiles/test.ebnf31
-rw-r--r--tests/examplefiles/test.ec605
-rw-r--r--tests/examplefiles/test.eh315
-rw-r--r--tests/examplefiles/test.erl181
-rw-r--r--tests/examplefiles/test.escript4
-rw-r--r--tests/examplefiles/test.evoque33
-rwxr-xr-xtests/examplefiles/test.fan818
-rw-r--r--tests/examplefiles/test.flx57
-rw-r--r--tests/examplefiles/test.gdc13
-rw-r--r--tests/examplefiles/test.gradle20
-rw-r--r--tests/examplefiles/test.groovy97
-rw-r--r--tests/examplefiles/test.hsail62
-rw-r--r--tests/examplefiles/test.html339
-rw-r--r--tests/examplefiles/test.idr101
-rw-r--r--tests/examplefiles/test.ini10
-rw-r--r--tests/examplefiles/test.java653
-rw-r--r--tests/examplefiles/test.jsp24
-rw-r--r--tests/examplefiles/test.lean217
-rw-r--r--tests/examplefiles/test.maql45
-rw-r--r--tests/examplefiles/test.mask41
-rw-r--r--tests/examplefiles/test.mod374
-rw-r--r--tests/examplefiles/test.moo51
-rw-r--r--tests/examplefiles/test.mt7
-rw-r--r--tests/examplefiles/test.myt166
-rw-r--r--tests/examplefiles/test.ncl20
-rw-r--r--tests/examplefiles/test.nim93
-rw-r--r--tests/examplefiles/test.odin43
-rw-r--r--tests/examplefiles/test.opa10
-rw-r--r--tests/examplefiles/test.orc81
-rw-r--r--tests/examplefiles/test.p6252
-rw-r--r--tests/examplefiles/test.pan54
-rw-r--r--tests/examplefiles/test.pas743
-rw-r--r--tests/examplefiles/test.php544
-rw-r--r--tests/examplefiles/test.pig148
-rw-r--r--tests/examplefiles/test.plot333
-rw-r--r--tests/examplefiles/test.ps1108
-rw-r--r--tests/examplefiles/test.psl182
-rw-r--r--tests/examplefiles/test.pwn253
-rw-r--r--tests/examplefiles/test.pypylog1000
-rw-r--r--tests/examplefiles/test.r3114
-rw-r--r--tests/examplefiles/test.rb177
-rw-r--r--tests/examplefiles/test.rhtml43
-rw-r--r--tests/examplefiles/test.rsl111
-rw-r--r--tests/examplefiles/test.scaml8
-rw-r--r--tests/examplefiles/test.sco22
-rw-r--r--tests/examplefiles/test.shen137
-rw-r--r--tests/examplefiles/test.sil206
-rw-r--r--tests/examplefiles/test.ssp12
-rw-r--r--tests/examplefiles/test.swift65
-rw-r--r--tests/examplefiles/test.tcsh830
-rw-r--r--tests/examplefiles/test.vb407
-rw-r--r--tests/examplefiles/test.vhdl161
-rw-r--r--tests/examplefiles/test.xqy138
-rw-r--r--tests/examplefiles/test.xsl23
-rw-r--r--tests/examplefiles/test.zep33
-rw-r--r--tests/examplefiles/test2.odin30
-rw-r--r--tests/examplefiles/test2.pypylog120
-rw-r--r--tests/examplefiles/test_basic.adls28
-rw-r--r--tests/examplefiles/truncated.pytb15
-rw-r--r--tests/examplefiles/tsql_example.sql72
-rw-r--r--tests/examplefiles/twig_test4612
-rw-r--r--tests/examplefiles/type.lisp1218
-rw-r--r--tests/examplefiles/typescript_example39
-rw-r--r--tests/examplefiles/typoscript_example1930
-rw-r--r--tests/examplefiles/underscore.coffee603
-rw-r--r--tests/examplefiles/unicode.applescript5
-rw-r--r--tests/examplefiles/unicode.go10
-rw-r--r--tests/examplefiles/unicode.js6
-rw-r--r--tests/examplefiles/unicodedoc.py11
-rw-r--r--tests/examplefiles/unix-io.lid37
-rw-r--r--tests/examplefiles/varnish.vcl187
-rw-r--r--tests/examplefiles/vbnet_test.bas29
-rw-r--r--tests/examplefiles/vctreestatus_hg4
-rw-r--r--tests/examplefiles/vimrc21
-rw-r--r--tests/examplefiles/vpath.mk16
-rw-r--r--tests/examplefiles/wdiff_example1.wdiff731
-rw-r--r--tests/examplefiles/wdiff_example3.wdiff10
-rw-r--r--tests/examplefiles/webkit-transition.css3
-rw-r--r--tests/examplefiles/while.pov13
-rw-r--r--tests/examplefiles/wiki.factor384
-rw-r--r--tests/examplefiles/xml_example1897
-rw-r--r--tests/examplefiles/xorg.conf48
-rw-r--r--tests/examplefiles/yahalom.cpsa34
-rw-r--r--tests/examplefiles/zmlrpc.f90798
-rw-r--r--tests/run.py58
-rw-r--r--tests/string_asserts.py22
-rw-r--r--tests/support.py17
-rw-r--r--tests/support/empty.py1
-rw-r--r--tests/support/html_formatter.py6
-rw-r--r--tests/support/python_lexer.py12
-rw-r--r--tests/support/tags36
-rw-r--r--tests/test_asm.py30
-rw-r--r--tests/test_basic.py74
-rw-r--r--tests/test_basic_api.py334
-rw-r--r--tests/test_bibtex.py236
-rw-r--r--tests/test_cfm.py46
-rw-r--r--tests/test_clexer.py259
-rw-r--r--tests/test_cmdline.py313
-rw-r--r--tests/test_cpp.py33
-rw-r--r--tests/test_crystal.py308
-rw-r--r--tests/test_csound.py491
-rw-r--r--tests/test_data.py117
-rw-r--r--tests/test_examplefiles.py138
-rw-r--r--tests/test_ezhil.py183
-rw-r--r--tests/test_html_formatter.py200
-rw-r--r--tests/test_inherit.py94
-rw-r--r--tests/test_irc_formatter.py30
-rw-r--r--tests/test_java.py78
-rw-r--r--tests/test_javascript.py84
-rw-r--r--tests/test_julia.py58
-rw-r--r--tests/test_kotlin.py131
-rw-r--r--tests/test_latex_formatter.py54
-rw-r--r--tests/test_lexers_other.py80
-rw-r--r--tests/test_markdown_lexer.py31
-rw-r--r--tests/test_modeline.py26
-rw-r--r--tests/test_objectiveclexer.py92
-rw-r--r--tests/test_perllexer.py157
-rw-r--r--tests/test_php.py36
-rw-r--r--tests/test_praat.py130
-rw-r--r--tests/test_properties.py89
-rw-r--r--tests/test_python.py133
-rw-r--r--tests/test_qbasiclexer.py43
-rw-r--r--tests/test_r.py70
-rw-r--r--tests/test_regexlexer.py66
-rw-r--r--tests/test_regexopt.py110
-rw-r--r--tests/test_rtf_formatter.py109
-rw-r--r--tests/test_ruby.py145
-rw-r--r--tests/test_shell.py159
-rw-r--r--tests/test_smarty.py40
-rw-r--r--tests/test_sql.py118
-rw-r--r--tests/test_string_asserts.py35
-rw-r--r--tests/test_terminal_formatter.py102
-rw-r--r--tests/test_textfmts.py41
-rw-r--r--tests/test_token.py54
-rw-r--r--tests/test_unistring.py48
-rw-r--r--tests/test_using_api.py40
-rw-r--r--tests/test_util.py213
-rw-r--r--tests/test_whiley.py30
-rw-r--r--tox.ini7
792 files changed, 3 insertions, 229172 deletions
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index f7a7acad..00000000
--- a/AUTHORS
+++ /dev/null
@@ -1,228 +0,0 @@
-Pygments is written and maintained by Georg Brandl <georg@python.org>.
-
-Major developers are Tim Hatch <tim@timhatch.com> and Armin Ronacher
-<armin.ronacher@active-4.com>.
-
-Other contributors, listed alphabetically, are:
-
-* Sam Aaron -- Ioke lexer
-* Ali Afshar -- image formatter
-* Thomas Aglassinger -- Easytrieve, JCL, Rexx, Transact-SQL and VBScript
- lexers
-* Muthiah Annamalai -- Ezhil lexer
-* Kumar Appaiah -- Debian control lexer
-* Andreas Amann -- AppleScript lexer
-* Timothy Armstrong -- Dart lexer fixes
-* Jeffrey Arnold -- R/S, Rd, BUGS, Jags, and Stan lexers
-* Jeremy Ashkenas -- CoffeeScript lexer
-* José Joaquín Atria -- Praat lexer
-* Stefan Matthias Aust -- Smalltalk lexer
-* Lucas Bajolet -- Nit lexer
-* Ben Bangert -- Mako lexers
-* Max Battcher -- Darcs patch lexer
-* Thomas Baruchel -- APL lexer
-* Tim Baumann -- (Literate) Agda lexer
-* Paul Baumgart, 280 North, Inc. -- Objective-J lexer
-* Michael Bayer -- Myghty lexers
-* Thomas Beale -- Archetype lexers
-* John Benediktsson -- Factor lexer
-* Trevor Bergeron -- mIRC formatter
-* Vincent Bernat -- LessCSS lexer
-* Christopher Bertels -- Fancy lexer
-* Sébastien Bigaret -- QVT Operational lexer
-* Jarrett Billingsley -- MiniD lexer
-* Adam Blinkinsop -- Haskell, Redcode lexers
-* Stéphane Blondon -- SGF lexer
-* Frits van Bommel -- assembler lexers
-* Pierre Bourdon -- bugfixes
-* Matthias Bussonnier -- ANSI style handling for terminal-256 formatter
-* chebee7i -- Python traceback lexer improvements
-* Hiram Chirino -- Scaml and Jade lexers
-* Mauricio Caceres -- SAS and Stata lexers.
-* Ian Cooper -- VGL lexer
-* David Corbett -- Inform, Jasmin, JSGF, Snowball, and TADS 3 lexers
-* Leaf Corcoran -- MoonScript lexer
-* Christopher Creutzig -- MuPAD lexer
-* Daniël W. Crompton -- Pike lexer
-* Pete Curry -- bugfixes
-* Bryan Davis -- EBNF lexer
-* Bruno Deferrari -- Shen lexer
-* Giedrius Dubinskas -- HTML formatter improvements
-* Owen Durni -- Haxe lexer
-* Alexander Dutton, Oxford University Computing Services -- SPARQL lexer
-* James Edwards -- Terraform lexer
-* Nick Efford -- Python 3 lexer
-* Sven Efftinge -- Xtend lexer
-* Artem Egorkine -- terminal256 formatter
-* Matthew Fernandez -- CAmkES lexer
-* Michael Ficarra -- CPSA lexer
-* James H. Fisher -- PostScript lexer
-* William S. Fulton -- SWIG lexer
-* Carlos Galdino -- Elixir and Elixir Console lexers
-* Michael Galloy -- IDL lexer
-* Naveen Garg -- Autohotkey lexer
-* Laurent Gautier -- R/S lexer
-* Alex Gaynor -- PyPy log lexer
-* Richard Gerkin -- Igor Pro lexer
-* Alain Gilbert -- TypeScript lexer
-* Alex Gilding -- BlitzBasic lexer
-* Bertrand Goetzmann -- Groovy lexer
-* Krzysiek Goj -- Scala lexer
-* Andrey Golovizin -- BibTeX lexers
-* Matt Good -- Genshi, Cheetah lexers
-* Michał Górny -- vim modeline support
-* Alex Gosse -- TrafficScript lexer
-* Patrick Gotthardt -- PHP namespaces support
-* Olivier Guibe -- Asymptote lexer
-* Phil Hagelberg -- Fennel lexer
-* Florian Hahn -- Boogie lexer
-* Martin Harriman -- SNOBOL lexer
-* Matthew Harrison -- SVG formatter
-* Steven Hazel -- Tcl lexer
-* Dan Michael Heggø -- Turtle lexer
-* Aslak Hellesøy -- Gherkin lexer
-* Greg Hendershott -- Racket lexer
-* Justin Hendrick -- ParaSail lexer
-* Jordi Gutiérrez Hermoso -- Octave lexer
-* David Hess, Fish Software, Inc. -- Objective-J lexer
-* Varun Hiremath -- Debian control lexer
-* Rob Hoelz -- Perl 6 lexer
-* Doug Hogan -- Mscgen lexer
-* Ben Hollis -- Mason lexer
-* Max Horn -- GAP lexer
-* Alastair Houghton -- Lexer inheritance facility
-* Tim Howard -- BlitzMax lexer
-* Dustin Howett -- Logos lexer
-* Ivan Inozemtsev -- Fantom lexer
-* Hiroaki Itoh -- Shell console rewrite, Lexers for PowerShell session,
- MSDOS session, BC, WDiff
-* Brian R. Jackson -- Tea lexer
-* Christian Jann -- ShellSession lexer
-* Dennis Kaarsemaker -- sources.list lexer
-* Dmitri Kabak -- Inferno Limbo lexer
-* Igor Kalnitsky -- vhdl lexer
-* Alexander Kit -- MaskJS lexer
-* Pekka Klärck -- Robot Framework lexer
-* Gerwin Klein -- Isabelle lexer
-* Eric Knibbe -- Lasso lexer
-* Stepan Koltsov -- Clay lexer
-* Adam Koprowski -- Opa lexer
-* Benjamin Kowarsch -- Modula-2 lexer
-* Domen Kožar -- Nix lexer
-* Oleh Krekel -- Emacs Lisp lexer
-* Alexander Kriegisch -- Kconfig and AspectJ lexers
-* Marek Kubica -- Scheme lexer
-* Jochen Kupperschmidt -- Markdown processor
-* Gerd Kurzbach -- Modelica lexer
-* Jon Larimer, Google Inc. -- Smali lexer
-* Olov Lassus -- Dart lexer
-* Matt Layman -- TAP lexer
-* Kristian Lyngstøl -- Varnish lexers
-* Sylvestre Ledru -- Scilab lexer
-* Chee Sing Lee -- Flatline lexer
-* Mark Lee -- Vala lexer
-* Valentin Lorentz -- C++ lexer improvements
-* Ben Mabey -- Gherkin lexer
-* Angus MacArthur -- QML lexer
-* Louis Mandel -- X10 lexer
-* Louis Marchand -- Eiffel lexer
-* Simone Margaritelli -- Hybris lexer
-* Kirk McDonald -- D lexer
-* Gordon McGregor -- SystemVerilog lexer
-* Stephen McKamey -- Duel/JBST lexer
-* Brian McKenna -- F# lexer
-* Charles McLaughlin -- Puppet lexer
-* Kurt McKee -- Tera Term macro lexer
-* Lukas Meuser -- BBCode formatter, Lua lexer
-* Cat Miller -- Pig lexer
-* Paul Miller -- LiveScript lexer
-* Hong Minhee -- HTTP lexer
-* Michael Mior -- Awk lexer
-* Bruce Mitchener -- Dylan lexer rewrite
-* Reuben Morais -- SourcePawn lexer
-* Jon Morton -- Rust lexer
-* Paulo Moura -- Logtalk lexer
-* Mher Movsisyan -- DTD lexer
-* Dejan Muhamedagic -- Crmsh lexer
-* Ana Nelson -- Ragel, ANTLR, R console lexers
-* Kurt Neufeld -- Markdown lexer
-* Nam T. Nguyen -- Monokai style
-* Jesper Noehr -- HTML formatter "anchorlinenos"
-* Mike Nolta -- Julia lexer
-* Jonas Obrist -- BBCode lexer
-* Edward O'Callaghan -- Cryptol lexer
-* David Oliva -- Rebol lexer
-* Pat Pannuto -- nesC lexer
-* Jon Parise -- Protocol buffers and Thrift lexers
-* Benjamin Peterson -- Test suite refactoring
-* Ronny Pfannschmidt -- BBCode lexer
-* Dominik Picheta -- Nimrod lexer
-* Andrew Pinkham -- RTF Formatter Refactoring
-* Clément Prévost -- UrbiScript lexer
-* Tanner Prynn -- cmdline -x option and loading lexers from files
-* Oleh Prypin -- Crystal lexer (based on Ruby lexer)
-* Elias Rabel -- Fortran fixed form lexer
-* raichoo -- Idris lexer
-* Kashif Rasul -- CUDA lexer
-* Nathan Reed -- HLSL lexer
-* Justin Reidy -- MXML lexer
-* Norman Richards -- JSON lexer
-* Corey Richardson -- Rust lexer updates
-* Lubomir Rintel -- GoodData MAQL and CL lexers
-* Andre Roberge -- Tango style
-* Georg Rollinger -- HSAIL lexer
-* Michiel Roos -- TypoScript lexer
-* Konrad Rudolph -- LaTeX formatter enhancements
-* Mario Ruggier -- Evoque lexers
-* Miikka Salminen -- Lovelace style, Hexdump lexer, lexer enhancements
-* Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers
-* Matteo Sasso -- Common Lisp lexer
-* Joe Schafer -- Ada lexer
-* Ken Schutte -- Matlab lexers
-* René Schwaiger -- Rainbow Dash style
-* Sebastian Schweizer -- Whiley lexer
-* Tassilo Schweyer -- Io, MOOCode lexers
-* Ted Shaw -- AutoIt lexer
-* Joerg Sieker -- ABAP lexer
-* Robert Simmons -- Standard ML lexer
-* Kirill Simonov -- YAML lexer
-* Corbin Simpson -- Monte lexer
-* Alexander Smishlajev -- Visual FoxPro lexer
-* Steve Spigarelli -- XQuery lexer
-* Jerome St-Louis -- eC lexer
-* Camil Staps -- Clean and NuSMV lexers; Solarized style
-* James Strachan -- Kotlin lexer
-* Tom Stuart -- Treetop lexer
-* Colin Sullivan -- SuperCollider lexer
-* Ben Swift -- Extempore lexer
-* Edoardo Tenani -- Arduino lexer
-* Tiberius Teng -- default style overhaul
-* Jeremy Thurgood -- Erlang, Squid config lexers
-* Brian Tiffin -- OpenCOBOL lexer
-* Bob Tolbert -- Hy lexer
-* Matthias Trute -- Forth lexer
-* Erick Tryzelaar -- Felix lexer
-* Alexander Udalov -- Kotlin lexer improvements
-* Thomas Van Doren -- Chapel lexer
-* Daniele Varrazzo -- PostgreSQL lexers
-* Abe Voelker -- OpenEdge ABL lexer
-* Pepijn de Vos -- HTML formatter CTags support
-* Matthias Vallentin -- Bro lexer
-* Benoît Vinot -- AMPL lexer
-* Linh Vu Hong -- RSL lexer
-* Nathan Weizenbaum -- Haml and Sass lexers
-* Nathan Whetsell -- Csound lexers
-* Dietmar Winkler -- Modelica lexer
-* Nils Winter -- Smalltalk lexer
-* Davy Wybiral -- Clojure lexer
-* Whitney Young -- ObjectiveC lexer
-* Diego Zamboni -- CFengine3 lexer
-* Enrique Zamudio -- Ceylon lexer
-* Alex Zimin -- Nemerle lexer
-* Rob Zimmerman -- Kal lexer
-* Vincent Zurczak -- Roboconf lexer
-* Rostyslav Golda -- FloScript lexer
-* GitHub, Inc -- DASM16, Augeas, TOML, and Slash lexers
-* Simon Garnotel -- FreeFem++ lexer
-
-Many thanks for all contributions!
diff --git a/CHANGES b/CHANGES
deleted file mode 100644
index 4d87e121..00000000
--- a/CHANGES
+++ /dev/null
@@ -1,1325 +0,0 @@
-Pygments changelog
-==================
-
-Issue numbers refer to the tracker at
-<https://bitbucket.org/birkenfeld/pygments-main/issues>,
-pull request numbers to the requests at
-<https://bitbucket.org/birkenfeld/pygments-main/pull-requests/merged>.
-
-Version 2.5.0
--------------
-
-- Added lexers:
-
- * Erlang, Elxir shells (PR#823, #1521)
- * Zig (PR#820)
-
-- Updated lexers:
-
- * Handlebars (PR#773)
- * YAML (#1528)
-
-- Bump ``NasmLexer`` priority over ``TasmLexer`` for ``.asm`` files
- (fixes #1326)
-
-
-Version 2.4.2
--------------
-(released May 28, 2019)
-
-- Fix encoding error when guessing lexer with given ``encoding`` option
- (#1438)
-
-
-Version 2.4.1
--------------
-(released May 24, 2019)
-
-- Updated lexers:
-
- * Coq (#1430)
- * MSDOS Session (PR#734)
- * NASM (#1517)
- * Objective-C (PR#813, #1508)
- * Prolog (#1511)
- * TypeScript (#1515)
-
-- Support CSS variables in stylesheets (PR#814, #1356)
-- Fix F# lexer name (PR#709)
-- Fix ``TerminalFormatter`` using bold for bright text (#1480)
-
-
-Version 2.4.0
--------------
-(released May 8, 2019)
-
-- Added lexers:
-
- * Augeas (PR#807)
- * BBC Basic (PR#806)
- * Boa (PR#756)
- * Charm++ CI (PR#788)
- * DASM16 (PR#807)
- * FloScript (PR#750)
- * FreeFem++ (PR#785)
- * Hspec (PR#790)
- * Pony (PR#627)
- * SGF (PR#780)
- * Slash (PR#807)
- * Slurm (PR#760)
- * Tera Term Language (PR#749)
- * TOML (PR#807)
- * Unicon (PR#731)
- * VBScript (PR#673)
-
-- Updated lexers:
-
- * Apache2 (PR#766)
- * Cypher (PR#746)
- * LLVM (PR#792)
- * Makefiles (PR#766)
- * PHP (#1482)
- * Rust
- * SQL (PR#672)
- * Stan (PR#774)
- * Stata (PR#800)
- * Terraform (PR#787)
- * YAML
-
-- Add solarized style (PR#708)
-- Add support for Markdown reference-style links (PR#753)
-- Add license information to generated HTML/CSS files (#1496)
-- Change ANSI color names (PR#777)
-- Fix catastrophic backtracking in the bash lexer (#1494)
-- Fix documentation failing to build using Sphinx 2.0 (#1501)
-- Fix incorrect links in the Lisp and R lexer documentation (PR#775)
-- Fix rare unicode errors on Python 2.7 (PR#798, #1492)
-- Fix lexers popping from an empty stack (#1506)
-- TypoScript uses ``.typoscript`` now (#1498)
-- Updated Trove classifiers and ``pip`` requirements (PR#799)
-
-
-Version 2.3.1
--------------
-(released Dec 16, 2018)
-
-- Updated lexers:
-
- * ASM (PR#784)
- * Chapel (PR#735)
- * Clean (PR#621)
- * CSound (PR#684)
- * Elm (PR#744)
- * Fortran (PR#747)
- * GLSL (PR#740)
- * Haskell (PR#745)
- * Hy (PR#754)
- * Igor Pro (PR#764)
- * PowerShell (PR#705)
- * Python (PR#720, #1299, PR#715)
- * SLexer (PR#680)
- * YAML (PR#762, PR#724)
-
-- Fix invalid string escape sequences
-- Fix `FutureWarning` introduced by regex changes in Python 3.7
-
-
-Version 2.3.0
--------------
-(released Nov 25, 2018)
-
-- Added lexers:
-
- * Fennel (PR#783)
- * HLSL (PR#675)
-
-- Updated lexers:
-
- * Dockerfile (PR#714)
-
-- Minimum Python versions changed to 2.7 and 3.5
-- Added support for Python 3.7 generator changes (PR#772)
-- Fix incorrect token type in SCSS for single-quote strings (#1322)
-- Use `terminal256` formatter if `TERM` contains `256` (PR#666)
-- Fix incorrect handling of GitHub style fences in Markdown (PR#741, #1389)
-- Fix `%a` not being highlighted in Python3 strings (PR#727)
-
-
-Version 2.2.0
--------------
-(released Jan 22, 2017)
-
-- Added lexers:
-
- * AMPL
- * TypoScript (#1173)
- * Varnish config (PR#554)
- * Clean (PR#503)
- * WDiff (PR#513)
- * Flatline (PR#551)
- * Silver (PR#537)
- * HSAIL (PR#518)
- * JSGF (PR#546)
- * NCAR command language (PR#536)
- * Extempore (PR#530)
- * Cap'n Proto (PR#595)
- * Whiley (PR#573)
- * Monte (PR#592)
- * Crystal (PR#576)
- * Snowball (PR#589)
- * CapDL (PR#579)
- * NuSMV (PR#564)
- * SAS, Stata (PR#593)
-
-- Added the ability to load lexer and formatter classes directly from files
- with the `-x` command line option and the `lexers.load_lexer_from_file()`
- and `formatters.load_formatter_from_file()` functions. (PR#559)
-
-- Added `lexers.find_lexer_class_by_name()`. (#1203)
-
-- Added new token types and lexing for magic methods and variables in Python
- and PHP.
-
-- Added a new token type for string affixes and lexing for them in Python, C++
- and Postgresql lexers.
-
-- Added a new token type for heredoc (and similar) string delimiters and
- lexing for them in C++, Perl, PHP, Postgresql and Ruby lexers.
-
-- Styles can now define colors with ANSI colors for use in the 256-color
- terminal formatter. (PR#531)
-
-- Improved the CSS lexer. (#1083, #1130)
-
-- Added "Rainbow Dash" style. (PR#623)
-
-- Delay loading `pkg_resources`, which takes a long while to import. (PR#690)
-
-
-Version 2.1.3
--------------
-(released Mar 2, 2016)
-
-- Fixed regression in Bash lexer (PR#563)
-
-
-Version 2.1.2
--------------
-(released Feb 29, 2016)
-
-- Fixed Python 3 regression in image formatter (#1215)
-- Fixed regression in Bash lexer (PR#562)
-
-
-Version 2.1.1
--------------
-(relased Feb 14, 2016)
-
-- Fixed Jython compatibility (#1205)
-- Fixed HTML formatter output with leading empty lines (#1111)
-- Added a mapping table for LaTeX encodings and added utf8 (#1152)
-- Fixed image formatter font searching on Macs (#1188)
-- Fixed deepcopy-ing of Token instances (#1168)
-- Fixed Julia string interpolation (#1170)
-- Fixed statefulness of HttpLexer between get_tokens calls
-- Many smaller fixes to various lexers
-
-
-Version 2.1
------------
-(released Jan 17, 2016)
-
-- Added lexers:
-
- * Emacs Lisp (PR#431)
- * Arduino (PR#442)
- * Modula-2 with multi-dialect support (#1090)
- * Fortran fixed format (PR#213)
- * Archetype Definition language (PR#483)
- * Terraform (PR#432)
- * Jcl, Easytrieve (PR#208)
- * ParaSail (PR#381)
- * Boogie (PR#420)
- * Turtle (PR#425)
- * Fish Shell (PR#422)
- * Roboconf (PR#449)
- * Test Anything Protocol (PR#428)
- * Shen (PR#385)
- * Component Pascal (PR#437)
- * SuperCollider (PR#472)
- * Shell consoles (Tcsh, PowerShell, MSDOS) (PR#479)
- * Elm and J (PR#452)
- * Crmsh (PR#440)
- * Praat (PR#492)
- * CSound (PR#494)
- * Ezhil (PR#443)
- * Thrift (PR#469)
- * QVT Operational (PR#204)
- * Hexdump (PR#508)
- * CAmkES Configuration (PR#462)
-
-- Added styles:
-
- * Lovelace (PR#456)
- * Algol and Algol-nu (#1090)
-
-- Added formatters:
-
- * IRC (PR#458)
- * True color (24-bit) terminal ANSI sequences (#1142)
- (formatter alias: "16m")
-
-- New "filename" option for HTML formatter (PR#527).
-
-- Improved performance of the HTML formatter for long lines (PR#504).
-
-- Updated autopygmentize script (PR#445).
-
-- Fixed style inheritance for non-standard token types in HTML output.
-
-- Added support for async/await to Python 3 lexer.
-
-- Rewrote linenos option for TerminalFormatter (it's better, but slightly
- different output than before) (#1147).
-
-- Javascript lexer now supports most of ES6 (#1100).
-
-- Cocoa builtins updated for iOS 8.1 (PR#433).
-
-- Combined BashSessionLexer and ShellSessionLexer, new version should support
- the prompt styles of either.
-
-- Added option to pygmentize to show a full traceback on exceptions.
-
-- Fixed incomplete output on Windows and Python 3 (e.g. when using iPython
- Notebook) (#1153).
-
-- Allowed more traceback styles in Python console lexer (PR#253).
-
-- Added decorators to TypeScript (PR#509).
-
-- Fix highlighting of certain IRC logs formats (#1076).
-
-
-Version 2.0.2
--------------
-(released Jan 20, 2015)
-
-- Fix Python tracebacks getting duplicated in the console lexer (#1068).
-
-- Backquote-delimited identifiers are now recognized in F# (#1062).
-
-
-Version 2.0.1
--------------
-(released Nov 10, 2014)
-
-- Fix an encoding issue when using ``pygmentize`` with the ``-o`` option.
-
-
-Version 2.0
------------
-(released Nov 9, 2014)
-
-- Default lexer encoding is now "guess", i.e. UTF-8 / Locale / Latin1 is
- tried in that order.
-
-- Major update to Swift lexer (PR#410).
-
-- Multiple fixes to lexer guessing in conflicting cases:
-
- * recognize HTML5 by doctype
- * recognize XML by XML declaration
- * don't recognize C/C++ as SystemVerilog
-
-- Simplified regexes and builtin lists.
-
-
-Version 2.0rc1
---------------
-(released Oct 16, 2014)
-
-- Dropped Python 2.4 and 2.5 compatibility. This is in favor of single-source
- compatibility between Python 2.6, 2.7 and 3.3+.
-
-- New website and documentation based on Sphinx (finally!)
-
-- Lexers added:
-
- * APL (#969)
- * Agda and Literate Agda (PR#203)
- * Alloy (PR#355)
- * AmbientTalk
- * BlitzBasic (PR#197)
- * ChaiScript (PR#24)
- * Chapel (PR#256)
- * Cirru (PR#275)
- * Clay (PR#184)
- * ColdFusion CFC (PR#283)
- * Cryptol and Literate Cryptol (PR#344)
- * Cypher (PR#257)
- * Docker config files
- * EBNF (PR#193)
- * Eiffel (PR#273)
- * GAP (PR#311)
- * Golo (PR#309)
- * Handlebars (PR#186)
- * Hy (PR#238)
- * Idris and Literate Idris (PR#210)
- * Igor Pro (PR#172)
- * Inform 6/7 (PR#281)
- * Intel objdump (PR#279)
- * Isabelle (PR#386)
- * Jasmin (PR#349)
- * JSON-LD (PR#289)
- * Kal (PR#233)
- * Lean (PR#399)
- * LSL (PR#296)
- * Limbo (PR#291)
- * Liquid (#977)
- * MQL (PR#285)
- * MaskJS (PR#280)
- * Mozilla preprocessors
- * Mathematica (PR#245)
- * NesC (PR#166)
- * Nit (PR#375)
- * Nix (PR#267)
- * Pan
- * Pawn (PR#211)
- * Perl 6 (PR#181)
- * Pig (PR#304)
- * Pike (PR#237)
- * QBasic (PR#182)
- * Red (PR#341)
- * ResourceBundle (#1038)
- * Rexx (PR#199)
- * Rql (PR#251)
- * Rsl
- * SPARQL (PR#78)
- * Slim (PR#366)
- * Swift (PR#371)
- * Swig (PR#168)
- * TADS 3 (PR#407)
- * Todo.txt todo lists
- * Twig (PR#404)
-
-- Added a helper to "optimize" regular expressions that match one of many
- literal words; this can save 20% and more lexing time with lexers that
- highlight many keywords or builtins.
-
-- New styles: "xcode" and "igor", similar to the default highlighting of
- the respective IDEs.
-
-- The command-line "pygmentize" tool now tries a little harder to find the
- correct encoding for files and the terminal (#979).
-
-- Added "inencoding" option for lexers to override "encoding" analogous
- to "outencoding" (#800).
-
-- Added line-by-line "streaming" mode for pygmentize with the "-s" option.
- (PR#165) Only fully works for lexers that have no constructs spanning
- lines!
-
-- Added an "envname" option to the LaTeX formatter to select a replacement
- verbatim environment (PR#235).
-
-- Updated the Makefile lexer to yield a little more useful highlighting.
-
-- Lexer aliases passed to ``get_lexer_by_name()`` are now case-insensitive.
-
-- File name matching in lexers and formatters will now use a regex cache
- for speed (PR#205).
-
-- Pygments will now recognize "vim" modelines when guessing the lexer for
- a file based on content (PR#118).
-
-- Major restructure of the ``pygments.lexers`` module namespace. There are now
- many more modules with less lexers per module. Old modules are still around
- and re-export the lexers they previously contained.
-
-- The NameHighlightFilter now works with any Name.* token type (#790).
-
-- Python 3 lexer: add new exceptions from PEP 3151.
-
-- Opa lexer: add new keywords (PR#170).
-
-- Julia lexer: add keywords and underscore-separated number
- literals (PR#176).
-
-- Lasso lexer: fix method highlighting, update builtins. Fix
- guessing so that plain XML isn't always taken as Lasso (PR#163).
-
-- Objective C/C++ lexers: allow "@" prefixing any expression (#871).
-
-- Ruby lexer: fix lexing of Name::Space tokens (#860) and of symbols
- in hashes (#873).
-
-- Stan lexer: update for version 2.4.0 of the language (PR#162, PR#255, PR#377).
-
-- JavaScript lexer: add the "yield" keyword (PR#196).
-
-- HTTP lexer: support for PATCH method (PR#190).
-
-- Koka lexer: update to newest language spec (PR#201).
-
-- Haxe lexer: rewrite and support for Haxe 3 (PR#174).
-
-- Prolog lexer: add different kinds of numeric literals (#864).
-
-- F# lexer: rewrite with newest spec for F# 3.0 (#842), fix a bug with
- dotted chains (#948).
-
-- Kotlin lexer: general update (PR#271).
-
-- Rebol lexer: fix comment detection and analyse_text (PR#261).
-
-- LLVM lexer: update keywords to v3.4 (PR#258).
-
-- PHP lexer: add new keywords and binary literals (PR#222).
-
-- external/markdown-processor.py updated to newest python-markdown (PR#221).
-
-- CSS lexer: some highlighting order fixes (PR#231).
-
-- Ceylon lexer: fix parsing of nested multiline comments (#915).
-
-- C family lexers: fix parsing of indented preprocessor directives (#944).
-
-- Rust lexer: update to 0.9 language version (PR#270, PR#388).
-
-- Elixir lexer: update to 0.15 language version (PR#392).
-
-- Fix swallowing incomplete tracebacks in Python console lexer (#874).
-
-
-Version 1.6
------------
-(released Feb 3, 2013)
-
-- Lexers added:
-
- * Dylan console (PR#149)
- * Logos (PR#150)
- * Shell sessions (PR#158)
-
-- Fix guessed lexers not receiving lexer options (#838).
-
-- Fix unquoted HTML attribute lexing in Opa (#841).
-
-- Fixes to the Dart lexer (PR#160).
-
-
-Version 1.6rc1
---------------
-(released Jan 9, 2013)
-
-- Lexers added:
-
- * AspectJ (PR#90)
- * AutoIt (PR#122)
- * BUGS-like languages (PR#89)
- * Ceylon (PR#86)
- * Croc (new name for MiniD)
- * CUDA (PR#75)
- * Dg (PR#116)
- * IDL (PR#115)
- * Jags (PR#89)
- * Julia (PR#61)
- * Kconfig (#711)
- * Lasso (PR#95, PR#113)
- * LiveScript (PR#84)
- * Monkey (PR#117)
- * Mscgen (PR#80)
- * NSIS scripts (PR#136)
- * OpenCOBOL (PR#72)
- * QML (PR#123)
- * Puppet (PR#133)
- * Racket (PR#94)
- * Rdoc (PR#99)
- * Robot Framework (PR#137)
- * RPM spec files (PR#124)
- * Rust (PR#67)
- * Smali (Dalvik assembly)
- * SourcePawn (PR#39)
- * Stan (PR#89)
- * Treetop (PR#125)
- * TypeScript (PR#114)
- * VGL (PR#12)
- * Visual FoxPro (#762)
- * Windows Registry (#819)
- * Xtend (PR#68)
-
-- The HTML formatter now supports linking to tags using CTags files, when the
- python-ctags package is installed (PR#87).
-
-- The HTML formatter now has a "linespans" option that wraps every line in a
- <span> tag with a specific id (PR#82).
-
-- When deriving a lexer from another lexer with token definitions, definitions
- for states not in the child lexer are now inherited. If you override a state
- in the child lexer, an "inherit" keyword has been added to insert the base
- state at that position (PR#141).
-
-- The C family lexers now inherit token definitions from a common base class,
- removing code duplication (PR#141).
-
-- Use "colorama" on Windows for console color output (PR#142).
-
-- Fix Template Haskell highlighting (PR#63).
-
-- Fix some S/R lexer errors (PR#91).
-
-- Fix a bug in the Prolog lexer with names that start with 'is' (#810).
-
-- Rewrite Dylan lexer, add Dylan LID lexer (PR#147).
-
-- Add a Java quickstart document (PR#146).
-
-- Add a "external/autopygmentize" file that can be used as .lessfilter (#802).
-
-
-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, 2011)
-
-- Lexers added:
-
- * Factor (#520)
- * PostScript (#486)
- * Verilog (#491)
- * BlitzMax Basic (#478)
- * Ioke (#465)
- * Java properties, split out of the INI lexer (#445)
- * Scss (#509)
- * Duel/JBST
- * XQuery (#617)
- * Mason (#615)
- * GoodData (#609)
- * SSP (#473)
- * Autohotkey (#417)
- * Google Protocol Buffers
- * Hybris (#506)
-
-- Do not fail in analyse_text methods (#618).
-
-- Performance improvements in the HTML formatter (#523).
-
-- With the ``noclasses`` option in the HTML formatter, some styles
- present in the stylesheet were not added as inline styles.
-
-- Four fixes to the Lua lexer (#480, #481, #482, #497).
-
-- More context-sensitive Gherkin lexer with support for more i18n translations.
-
-- Support new OO keywords in Matlab lexer (#521).
-
-- Small fix in the CoffeeScript lexer (#519).
-
-- A bugfix for backslashes in ocaml strings (#499).
-
-- Fix unicode/raw docstrings in the Python lexer (#489).
-
-- Allow PIL to work without PIL.pth (#502).
-
-- Allow seconds as a unit in CSS (#496).
-
-- Support ``application/javascript`` as a JavaScript mime type (#504).
-
-- Support `Offload <http://offload.codeplay.com>`_ C++ Extensions as
- keywords in the C++ lexer (#484).
-
-- Escape more characters in LaTeX output (#505).
-
-- Update Haml/Sass lexers to version 3 (#509).
-
-- Small PHP lexer string escaping fix (#515).
-
-- Support comments before preprocessor directives, and unsigned/
- long long literals in C/C++ (#613, #616).
-
-- Support line continuations in the INI lexer (#494).
-
-- Fix lexing of Dylan string and char literals (#628).
-
-- Fix class/procedure name highlighting in VB.NET lexer (#624).
-
-
-Version 1.3.1
--------------
-(bugfix release, released Mar 05, 2010)
-
-- The ``pygmentize`` script was missing from the distribution.
-
-
-Version 1.3
------------
-(codename Schneeglöckchen, released Mar 01, 2010)
-
-- Added the ``ensurenl`` lexer option, which can be used to suppress the
- automatic addition of a newline to the lexer input.
-
-- Lexers added:
-
- * Ada
- * Coldfusion
- * Modula-2
- * Haxe
- * R console
- * Objective-J
- * Haml and Sass
- * CoffeeScript
-
-- Enhanced reStructuredText highlighting.
-
-- Added support for PHP 5.3 namespaces in the PHP lexer.
-
-- Added a bash completion script for `pygmentize`, to the external/
- directory (#466).
-
-- Fixed a bug in `do_insertions()` used for multi-lexer languages.
-
-- Fixed a Ruby regex highlighting bug (#476).
-
-- Fixed regex highlighting bugs in Perl lexer (#258).
-
-- Add small enhancements to the C lexer (#467) and Bash lexer (#469).
-
-- Small fixes for the Tcl, Debian control file, Nginx config,
- Smalltalk, Objective-C, Clojure, Lua lexers.
-
-- Gherkin lexer: Fixed single apostrophe bug and added new i18n keywords.
-
-
-Version 1.2.2
--------------
-(bugfix release, released Jan 02, 2010)
-
-* Removed a backwards incompatibility in the LaTeX formatter that caused
- Sphinx to produce invalid commands when writing LaTeX output (#463).
-
-* Fixed a forever-backtracking regex in the BashLexer (#462).
-
-
-Version 1.2.1
--------------
-(bugfix release, released Jan 02, 2010)
-
-* Fixed mishandling of an ellipsis in place of the frames in a Python
- console traceback, resulting in clobbered output.
-
-
-Version 1.2
------------
-(codename Neujahr, released Jan 01, 2010)
-
-- Dropped Python 2.3 compatibility.
-
-- Lexers added:
-
- * Asymptote
- * Go
- * Gherkin (Cucumber)
- * CMake
- * Ooc
- * Coldfusion
- * Haxe
- * R console
-
-- Added options for rendering LaTeX in source code comments in the
- LaTeX formatter (#461).
-
-- Updated the Logtalk lexer.
-
-- Added `line_number_start` option to image formatter (#456).
-
-- Added `hl_lines` and `hl_color` options to image formatter (#457).
-
-- Fixed the HtmlFormatter's handling of noclasses=True to not output any
- classes (#427).
-
-- Added the Monokai style (#453).
-
-- Fixed LLVM lexer identifier syntax and added new keywords (#442).
-
-- Fixed the PythonTracebackLexer to handle non-traceback data in header or
- trailer, and support more partial tracebacks that start on line 2 (#437).
-
-- Fixed the CLexer to not highlight ternary statements as labels.
-
-- Fixed lexing of some Ruby quoting peculiarities (#460).
-
-- A few ASM lexer fixes (#450).
-
-
-Version 1.1.1
--------------
-(bugfix release, released Sep 15, 2009)
-
-- Fixed the BBCode lexer (#435).
-
-- Added support for new Jinja2 keywords.
-
-- Fixed test suite failures.
-
-- Added Gentoo-specific suffixes to Bash lexer.
-
-
-Version 1.1
------------
-(codename Brillouin, released Sep 11, 2009)
-
-- Ported Pygments to Python 3. This needed a few changes in the way
- encodings are handled; they may affect corner cases when used with
- Python 2 as well.
-
-- Lexers added:
-
- * Antlr/Ragel, thanks to Ana Nelson
- * (Ba)sh shell
- * Erlang shell
- * GLSL
- * Prolog
- * Evoque
- * Modelica
- * Rebol
- * MXML
- * Cython
- * ABAP
- * ASP.net (VB/C#)
- * Vala
- * Newspeak
-
-- Fixed the LaTeX formatter's output so that output generated for one style
- can be used with the style definitions of another (#384).
-
-- Added "anchorlinenos" and "noclobber_cssfile" (#396) options to HTML
- formatter.
-
-- Support multiline strings in Lua lexer.
-
-- Rewrite of the JavaScript lexer by Pumbaa80 to better support regular
- expression literals (#403).
-
-- When pygmentize is asked to highlight a file for which multiple lexers
- match the filename, use the analyse_text guessing engine to determine the
- winner (#355).
-
-- Fixed minor bugs in the JavaScript lexer (#383), the Matlab lexer (#378),
- the Scala lexer (#392), the INI lexer (#391), the Clojure lexer (#387)
- and the AS3 lexer (#389).
-
-- Fixed three Perl heredoc lexing bugs (#379, #400, #422).
-
-- Fixed a bug in the image formatter which misdetected lines (#380).
-
-- Fixed bugs lexing extended Ruby strings and regexes.
-
-- Fixed a bug when lexing git diffs.
-
-- Fixed a bug lexing the empty commit in the PHP lexer (#405).
-
-- Fixed a bug causing Python numbers to be mishighlighted as floats (#397).
-
-- Fixed a bug when backslashes are used in odd locations in Python (#395).
-
-- Fixed various bugs in Matlab and S-Plus lexers, thanks to Winston Chang (#410,
- #411, #413, #414) and fmarc (#419).
-
-- Fixed a bug in Haskell single-line comment detection (#426).
-
-- Added new-style reStructuredText directive for docutils 0.5+ (#428).
-
-
-Version 1.0
------------
-(codename Dreiundzwanzig, released Nov 23, 2008)
-
-- Don't use join(splitlines()) when converting newlines to ``\n``,
- because that doesn't keep all newlines at the end when the
- ``stripnl`` lexer option is False.
-
-- Added ``-N`` option to command-line interface to get a lexer name
- for a given filename.
-
-- Added Tango style, written by Andre Roberge for the Crunchy project.
-
-- Added Python3TracebackLexer and ``python3`` option to
- PythonConsoleLexer.
-
-- Fixed a few bugs in the Haskell lexer.
-
-- Fixed PythonTracebackLexer to be able to recognize SyntaxError and
- KeyboardInterrupt (#360).
-
-- Provide one formatter class per image format, so that surprises like::
-
- pygmentize -f gif -o foo.gif foo.py
-
- creating a PNG file are avoided.
-
-- Actually use the `font_size` option of the image formatter.
-
-- Fixed numpy lexer that it doesn't listen for `*.py` any longer.
-
-- Fixed HTML formatter so that text options can be Unicode
- strings (#371).
-
-- Unified Diff lexer supports the "udiff" alias now.
-
-- Fixed a few issues in Scala lexer (#367).
-
-- RubyConsoleLexer now supports simple prompt mode (#363).
-
-- JavascriptLexer is smarter about what constitutes a regex (#356).
-
-- Add Applescript lexer, thanks to Andreas Amann (#330).
-
-- Make the codetags more strict about matching words (#368).
-
-- NginxConfLexer is a little more accurate on mimetypes and
- variables (#370).
-
-
-Version 0.11.1
---------------
-(released Aug 24, 2008)
-
-- Fixed a Jython compatibility issue in pygments.unistring (#358).
-
-
-Version 0.11
-------------
-(codename Straußenei, released Aug 23, 2008)
-
-Many thanks go to Tim Hatch for writing or integrating most of the bug
-fixes and new features.
-
-- Lexers added:
-
- * Nasm-style assembly language, thanks to delroth
- * YAML, thanks to Kirill Simonov
- * ActionScript 3, thanks to Pierre Bourdon
- * Cheetah/Spitfire templates, thanks to Matt Good
- * Lighttpd config files
- * Nginx config files
- * Gnuplot plotting scripts
- * Clojure
- * POV-Ray scene files
- * Sqlite3 interactive console sessions
- * Scala source files, thanks to Krzysiek Goj
-
-- Lexers improved:
-
- * C lexer highlights standard library functions now and supports C99
- types.
- * Bash lexer now correctly highlights heredocs without preceding
- whitespace.
- * Vim lexer now highlights hex colors properly and knows a couple
- more keywords.
- * Irc logs lexer now handles xchat's default time format (#340) and
- correctly highlights lines ending in ``>``.
- * Support more delimiters for perl regular expressions (#258).
- * ObjectiveC lexer now supports 2.0 features.
-
-- Added "Visual Studio" style.
-
-- Updated markdown processor to Markdown 1.7.
-
-- Support roman/sans/mono style defs and use them in the LaTeX
- formatter.
-
-- The RawTokenFormatter is no longer registered to ``*.raw`` and it's
- documented that tokenization with this lexer may raise exceptions.
-
-- New option ``hl_lines`` to HTML formatter, to highlight certain
- lines.
-
-- New option ``prestyles`` to HTML formatter.
-
-- New option *-g* to pygmentize, to allow lexer guessing based on
- filetext (can be slowish, so file extensions are still checked
- first).
-
-- ``guess_lexer()`` now makes its decision much faster due to a cache
- of whether data is xml-like (a check which is used in several
- versions of ``analyse_text()``. Several lexers also have more
- accurate ``analyse_text()`` now.
-
-
-Version 0.10
-------------
-(codename Malzeug, released May 06, 2008)
-
-- Lexers added:
-
- * Io
- * Smalltalk
- * Darcs patches
- * Tcl
- * Matlab
- * Matlab sessions
- * FORTRAN
- * XSLT
- * tcsh
- * NumPy
- * Python 3
- * S, S-plus, R statistics languages
- * Logtalk
-
-- In the LatexFormatter, the *commandprefix* option is now by default
- 'PY' instead of 'C', since the latter resulted in several collisions
- with other packages. Also, the special meaning of the *arg*
- argument to ``get_style_defs()`` was removed.
-
-- Added ImageFormatter, to format code as PNG, JPG, GIF or BMP.
- (Needs the Python Imaging Library.)
-
-- Support doc comments in the PHP lexer.
-
-- Handle format specifications in the Perl lexer.
-
-- Fix comment handling in the Batch lexer.
-
-- Add more file name extensions for the C++, INI and XML lexers.
-
-- Fixes in the IRC and MuPad lexers.
-
-- Fix function and interface name highlighting in the Java lexer.
-
-- Fix at-rule handling in the CSS lexer.
-
-- Handle KeyboardInterrupts gracefully in pygmentize.
-
-- Added BlackWhiteStyle.
-
-- Bash lexer now correctly highlights math, does not require
- whitespace after semicolons, and correctly highlights boolean
- operators.
-
-- Makefile lexer is now capable of handling BSD and GNU make syntax.
-
-
-Version 0.9
------------
-(codename Herbstzeitlose, released Oct 14, 2007)
-
-- Lexers added:
-
- * Erlang
- * ActionScript
- * Literate Haskell
- * Common Lisp
- * Various assembly languages
- * Gettext catalogs
- * Squid configuration
- * Debian control files
- * MySQL-style SQL
- * MOOCode
-
-- Lexers improved:
-
- * Greatly improved the Haskell and OCaml lexers.
- * Improved the Bash lexer's handling of nested constructs.
- * The C# and Java lexers exhibited abysmal performance with some
- input code; this should now be fixed.
- * The IRC logs lexer is now able to colorize weechat logs too.
- * The Lua lexer now recognizes multi-line comments.
- * Fixed bugs in the D and MiniD lexer.
-
-- The encoding handling of the command line mode (pygmentize) was
- enhanced. You shouldn't get UnicodeErrors from it anymore if you
- don't give an encoding option.
-
-- Added a ``-P`` option to the command line mode which can be used to
- give options whose values contain commas or equals signs.
-
-- Added 256-color terminal formatter.
-
-- Added an experimental SVG formatter.
-
-- Added the ``lineanchors`` option to the HTML formatter, thanks to
- Ian Charnas for the idea.
-
-- Gave the line numbers table a CSS class in the HTML formatter.
-
-- Added a Vim 7-like style.
-
-
-Version 0.8.1
--------------
-(released Jun 27, 2007)
-
-- Fixed POD highlighting in the Ruby lexer.
-
-- Fixed Unicode class and namespace name highlighting in the C# lexer.
-
-- Fixed Unicode string prefix highlighting in the Python lexer.
-
-- Fixed a bug in the D and MiniD lexers.
-
-- Fixed the included MoinMoin parser.
-
-
-Version 0.8
------------
-(codename Maikäfer, released May 30, 2007)
-
-- Lexers added:
-
- * Haskell, thanks to Adam Blinkinsop
- * Redcode, thanks to Adam Blinkinsop
- * D, thanks to Kirk McDonald
- * MuPad, thanks to Christopher Creutzig
- * MiniD, thanks to Jarrett Billingsley
- * Vim Script, by Tim Hatch
-
-- The HTML formatter now has a second line-numbers mode in which it
- will just integrate the numbers in the same ``<pre>`` tag as the
- code.
-
-- The `CSharpLexer` now is Unicode-aware, which means that it has an
- option that can be set so that it correctly lexes Unicode
- identifiers allowed by the C# specs.
-
-- Added a `RaiseOnErrorTokenFilter` that raises an exception when the
- lexer generates an error token, and a `VisibleWhitespaceFilter` that
- converts whitespace (spaces, tabs, newlines) into visible
- characters.
-
-- Fixed the `do_insertions()` helper function to yield correct
- indices.
-
-- The ReST lexer now automatically highlights source code blocks in
- ".. sourcecode:: language" and ".. code:: language" directive
- blocks.
-
-- Improved the default style (thanks to Tiberius Teng). The old
- default is still available as the "emacs" style (which was an alias
- before).
-
-- The `get_style_defs` method of HTML formatters now uses the
- `cssclass` option as the default selector if it was given.
-
-- Improved the ReST and Bash lexers a bit.
-
-- Fixed a few bugs in the Makefile and Bash lexers, thanks to Tim
- Hatch.
-
-- Fixed a bug in the command line code that disallowed ``-O`` options
- when using the ``-S`` option.
-
-- Fixed a bug in the `RawTokenFormatter`.
-
-
-Version 0.7.1
--------------
-(released Feb 15, 2007)
-
-- Fixed little highlighting bugs in the Python, Java, Scheme and
- Apache Config lexers.
-
-- Updated the included manpage.
-
-- Included a built version of the documentation in the source tarball.
-
-
-Version 0.7
------------
-(codename Faschingskrapfn, released Feb 14, 2007)
-
-- Added a MoinMoin parser that uses Pygments. With it, you get
- Pygments highlighting in Moin Wiki pages.
-
-- Changed the exception raised if no suitable lexer, formatter etc. is
- found in one of the `get_*_by_*` functions to a custom exception,
- `pygments.util.ClassNotFound`. It is, however, a subclass of
- `ValueError` in order to retain backwards compatibility.
-
-- Added a `-H` command line option which can be used to get the
- docstring of a lexer, formatter or filter.
-
-- Made the handling of lexers and formatters more consistent. The
- aliases and filename patterns of formatters are now attributes on
- them.
-
-- Added an OCaml lexer, thanks to Adam Blinkinsop.
-
-- Made the HTML formatter more flexible, and easily subclassable in
- order to make it easy to implement custom wrappers, e.g. alternate
- line number markup. See the documentation.
-
-- Added an `outencoding` option to all formatters, making it possible
- to override the `encoding` (which is used by lexers and formatters)
- when using the command line interface. Also, if using the terminal
- formatter and the output file is a terminal and has an encoding
- attribute, use it if no encoding is given.
-
-- Made it possible to just drop style modules into the `styles`
- subpackage of the Pygments installation.
-
-- Added a "state" keyword argument to the `using` helper.
-
-- Added a `commandprefix` option to the `LatexFormatter` which allows
- to control how the command names are constructed.
-
-- Added quite a few new lexers, thanks to Tim Hatch:
-
- * Java Server Pages
- * Windows batch files
- * Trac Wiki markup
- * Python tracebacks
- * ReStructuredText
- * Dylan
- * and the Befunge esoteric programming language (yay!)
-
-- Added Mako lexers by Ben Bangert.
-
-- Added "fruity" style, another dark background originally vim-based
- theme.
-
-- Added sources.list lexer by Dennis Kaarsemaker.
-
-- Added token stream filters, and a pygmentize option to use them.
-
-- Changed behavior of `in` Operator for tokens.
-
-- Added mimetypes for all lexers.
-
-- Fixed some problems lexing Python strings.
-
-- Fixed tickets: #167, #178, #179, #180, #185, #201.
-
-
-Version 0.6
------------
-(codename Zimtstern, released Dec 20, 2006)
-
-- Added option for the HTML formatter to write the CSS to an external
- file in "full document" mode.
-
-- Added RTF formatter.
-
-- Added Bash and Apache configuration lexers (thanks to Tim Hatch).
-
-- Improved guessing methods for various lexers.
-
-- Added `@media` support to CSS lexer (thanks to Tim Hatch).
-
-- Added a Groff lexer (thanks to Tim Hatch).
-
-- License change to BSD.
-
-- Added lexers for the Myghty template language.
-
-- Added a Scheme lexer (thanks to Marek Kubica).
-
-- Added some functions to iterate over existing lexers, formatters and
- lexers.
-
-- The HtmlFormatter's `get_style_defs()` can now take a list as an
- argument to generate CSS with multiple prefixes.
-
-- Support for guessing input encoding added.
-
-- Encoding support added: all processing is now done with Unicode
- strings, input and output are converted from and optionally to byte
- strings (see the ``encoding`` option of lexers and formatters).
-
-- Some improvements in the C(++) lexers handling comments and line
- continuations.
-
-
-Version 0.5.1
--------------
-(released Oct 30, 2006)
-
-- Fixed traceback in ``pygmentize -L`` (thanks to Piotr Ozarowski).
-
-
-Version 0.5
------------
-(codename PyKleur, released Oct 30, 2006)
-
-- Initial public release.
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 13d1c74b..00000000
--- a/LICENSE
+++ /dev/null
@@ -1,25 +0,0 @@
-Copyright (c) 2006-2019 by the respective authors (see AUTHORS file).
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index 7e1d320d..00000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,6 +0,0 @@
-include pygmentize
-include external/*
-include Makefile CHANGES LICENSE AUTHORS TODO
-recursive-include tests *
-recursive-include doc *
-recursive-include scripts *
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 2fcb832f..00000000
--- a/Makefile
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Makefile for Pygments
-# ~~~~~~~~~~~~~~~~~~~~~
-#
-# Combines scripts for common tasks.
-#
-# :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
-# :license: BSD, see LICENSE for details.
-#
-
-PYTHON ?= python
-
-export PYTHONPATH = $(shell echo "$$PYTHONPATH"):$(shell python -c 'import os; print ":".join(os.path.abspath(line.strip()) for line in file("PYTHONPATH"))' 2>/dev/null)
-
-.PHONY: all check clean clean-pyc codetags docs mapfiles \
- pylint reindent test test-coverage
-
-all: clean-pyc check test
-
-check:
- @$(PYTHON) scripts/detect_missing_analyse_text.py || true
- @pyflakes pygments | grep -v 'but unused' || true
- @$(PYTHON) scripts/check_sources.py -i build -i dist -i pygments/lexers/_mapping.py \
- -i docs/build -i pygments/formatters/_mapping.py -i pygments/unistring.py
-
-clean: clean-pyc
- -rm -rf build
- -rm -f codetags.html
-
-clean-pyc:
- find . -name '*.pyc' -exec rm -f {} +
- find . -name '*.pyo' -exec rm -f {} +
- find . -name '*~' -exec rm -f {} +
-
-codetags:
- @$(PYTHON) scripts/find_codetags.py -i tests/examplefiles -i scripts/pylintrc \
- -i scripts/find_codetags.py -o codetags.html .
-
-docs:
- make -C doc html
-
-mapfiles:
- (cd pygments/formatters; $(PYTHON) _mapping.py)
- (cd pygments/lexers; $(PYTHON) _mapping.py)
-
-pylint:
- @pylint --rcfile scripts/pylintrc pygments
-
-reindent:
- @$(PYTHON) scripts/reindent.py -r -B .
-
-test:
- @$(PYTHON) tests/run.py -d $(TEST)
-
-test-coverage:
- @$(PYTHON) tests/run.py -d --with-coverage --cover-package=pygments --cover-erase $(TEST)
-
-test-examplefiles:
- nosetests tests/test_examplefiles.py
-
-tox-test:
- @tox -- $(TEST)
-
-tox-test-coverage:
- @tox -- --with-coverage --cover-package=pygments --cover-erase $(TEST)
-
-RLMODULES = pygments.lexers
-
-regexlint:
- @if [ -z "$(REGEXLINT)" ]; then echo "Please set REGEXLINT=checkout path"; exit 1; fi
- PYTHONPATH=`pwd`:$(REGEXLINT) $(REGEXLINT)/regexlint/cmdline.py $(RLMODULES)
diff --git a/README b/README
new file mode 100644
index 00000000..1583c6b0
--- /dev/null
+++ b/README
@@ -0,0 +1,3 @@
+This repository has been moved to GitHub: https://github.com/pygments/pygments
+
+Please do not file new PRs and issues here.
diff --git a/README.rst b/README.rst
deleted file mode 100644
index 350e242e..00000000
--- a/README.rst
+++ /dev/null
@@ -1,39 +0,0 @@
-README for Pygments
-===================
-
-This is the source of Pygments. It is a generic syntax highlighter that
-supports over 300 languages and text formats, for use in code hosting, forums,
-wikis or other applications that need to prettify source code.
-
-Installing
-----------
-
-... works as usual, use ``python setup.py install``.
-
-Documentation
--------------
-
-... can be found online at http://pygments.org/ or created by ::
-
- cd doc
- make html
-
-Development
------------
-
-... takes place on `Bitbucket
-<https://bitbucket.org/birkenfeld/pygments-main>`_, where the Mercurial
-repository, tickets and pull requests can be viewed.
-
-Continuous testing runs on drone.io:
-
-.. image:: https://drone.io/bitbucket.org/birkenfeld/pygments-main/status.png
- :target: https://drone.io/bitbucket.org/birkenfeld/pygments-main
-
-The authors
------------
-
-Pygments is maintained by **Georg Brandl**, e-mail address *georg*\ *@*\ *python.org*.
-
-Many lexers and fixes have been contributed by **Armin Ronacher**, the rest of
-the `Pocoo <http://dev.pocoo.org/>`_ team and **Tim Hatch**.
diff --git a/TODO b/TODO
deleted file mode 100644
index 88076f3d..00000000
--- a/TODO
+++ /dev/null
@@ -1,12 +0,0 @@
-Todo
-====
-
-- lexers that need work:
- * review perl lexer (numerous bugs, but so far no one had complaints ;)
- * readd property support for C# lexer? that is, find a regex that doesn't
- backtrack to death...
- * add support for function name highlighting to C++ lexer
-
-- allow "overlay" token types to highlight specials: nth line, a word etc.
-
-- pygmentize option presets, more sophisticated method to output styles?
diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml
deleted file mode 100644
index 4a9f1b6d..00000000
--- a/bitbucket-pipelines.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-pipelines:
- default:
- - step:
- name: Test on Python 2.7
- image: python:2.7
- caches:
- - pip
- script:
- - pip install -r requirements.txt
- - tox -e py27
- - step:
- name: Test on Python 3.5
- image: python:3.5
- caches:
- - pip
- script:
- - pip install -r requirements.txt
- - tox -e py35
- - step:
- name: Test on Python 3.6
- image: python:3.6
- caches:
- - pip
- script:
- - pip install -r requirements.txt
- - tox -e py36
- - step:
- name: Test on Python 3.7
- image: python:3.7
- caches:
- - pip
- script:
- - pip install -r requirements.txt
- - tox -e py37
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644
index 7fb75411..00000000
--- a/doc/Makefile
+++ /dev/null
@@ -1,153 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = PYTHONPATH=.. sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Pygments.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Pygments.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/Pygments"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Pygments"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/doc/_static/favicon.ico b/doc/_static/favicon.ico
deleted file mode 100644
index 777f617d..00000000
--- a/doc/_static/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/doc/_static/logo_new.png b/doc/_static/logo_new.png
deleted file mode 100644
index 0ae4b209..00000000
--- a/doc/_static/logo_new.png
+++ /dev/null
Binary files differ
diff --git a/doc/_static/logo_only.png b/doc/_static/logo_only.png
deleted file mode 100644
index fdebcc47..00000000
--- a/doc/_static/logo_only.png
+++ /dev/null
Binary files differ
diff --git a/doc/_templates/docssidebar.html b/doc/_templates/docssidebar.html
deleted file mode 100644
index 913acaaf..00000000
--- a/doc/_templates/docssidebar.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{% if pagename != 'docs/index' %}
-<strong>&laquo; <a href="{{ pathto('docs/index') }}">Back to docs index</a></strong>
-{% endif %}
diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html
deleted file mode 100644
index 29954554..00000000
--- a/doc/_templates/indexsidebar.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<h3>Download</h3>
-{% if version.endswith('(hg)') %}
-<p>This documentation is for version <b>{{ version }}</b>, which is
- not released yet.</p>
-<p>You can use it from the
- <a href="http://bitbucket.org/birkenfeld/sphinx/">Mercurial repo</a> or look for
- released versions in the <a href="http://pypi.python.org/pypi/Sphinx">Python
- Package Index</a>.</p>
-{% else %}
-<p>Current version: <b>{{ version }}</b></p>
-<p>Get Pygments from the <a href="http://pypi.python.org/pypi/Pygments">Python Package
-Index</a>, or install it with:</p>
-<pre>pip install Pygments</pre>
-{% endif %}
-
-<h3>Questions? Suggestions?</h3>
-
-<p>Clone at <a href="https://bitbucket.org/birkenfeld/pygments-main">Bitbucket</a>
-or come to the <tt>#pocoo</tt> channel on FreeNode.</p>
-<p>You can also open an issue at the
- <a href="https://www.bitbucket.org/birkenfeld/pygments-main/issues/">tracker</a>.</p>
-
-<p class="logo">A <a href="http://pocoo.org/">
- <img src="{{ pathto("_static/pocoo.png", 1) }}" /></a> project</a></p>
-
diff --git a/doc/_themes/pygments14/layout.html b/doc/_themes/pygments14/layout.html
deleted file mode 100644
index 53f8f37f..00000000
--- a/doc/_themes/pygments14/layout.html
+++ /dev/null
@@ -1,98 +0,0 @@
-{#
- sphinxdoc/layout.html
- ~~~~~~~~~~~~~~~~~~~~~
-
- Sphinx layout template for the sphinxdoc theme.
-
- :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-#}
-{%- extends "basic/layout.html" %}
-
-{# put the sidebar before the body #}
-{% block sidebar1 %}{{ sidebar() }}{% endblock %}
-{% block sidebar2 %}{% endblock %}
-
-{% block relbar1 %}{% endblock %}
-{% block relbar2 %}{% endblock %}
-
-{% block extrahead %}
- <link href='http://fonts.googleapis.com/css?family={{ theme_font|replace(' ', '+') }}:300,400,700'
- rel='stylesheet' type='text/css'>
-{{ super() }}
-{%- if not embedded %}
- <style type="text/css">
- table.right { float: right; margin-left: 20px; }
- table.right td { border: 1px solid #ccc; }
- {% if pagename == 'index' %}
- .related { display: none; }
- {% endif %}
- </style>
- <script type="text/javascript">
- // intelligent scrolling of the sidebar content
- $(window).scroll(function() {
- var sb = $('.sphinxsidebarwrapper');
- var win = $(window);
- var sbh = sb.height();
- var offset = $('.sphinxsidebar').position()['top'];
- var wintop = win.scrollTop();
- var winbot = wintop + win.innerHeight();
- var curtop = sb.position()['top'];
- var curbot = curtop + sbh;
- // does sidebar fit in window?
- if (sbh < win.innerHeight()) {
- // yes: easy case -- always keep at the top
- sb.css('top', $u.min([$u.max([0, wintop - offset - 10]),
- $(document).height() - sbh - 200]));
- } else {
- // no: only scroll if top/bottom edge of sidebar is at
- // top/bottom edge of window
- if (curtop > wintop && curbot > winbot) {
- sb.css('top', $u.max([wintop - offset - 10, 0]));
- } else if (curtop < wintop && curbot < winbot) {
- sb.css('top', $u.min([winbot - sbh - offset - 20,
- $(document).height() - sbh - 200]));
- }
- }
- });
- </script>
-{%- endif %}
-{% endblock %}
-
-{% block header %}
-<div class="outerwrapper">
-<div class="pageheader">
- <ul>
- <li><a href="{{ pathto('index') }}">Home</a></li>
- {% if demo_active %}
- <li><a href="{{ pathto('demo') }}">Demo</a></li>
- {% endif %}
- <li><a href="{{ pathto('languages') }}">Languages</a></li>
- <li><a href="{{ pathto('faq') }}">FAQ</a></li>
- <li><a href="{{ pathto('download') }}">Get it</a></li>
- <li><a href="{{ pathto('docs/index') }}">Docs</a></li>
- </ul>
- <div>
- <a href="{{ pathto('index') }}">
- <img src="{{ pathto('_static/logo.png', 1) }}" alt="Pygments logo" />
- </a>
- </div>
-</div>
-{% endblock %}
-
-{% block footer %}
- <div class="footer" role="contentinfo">
- &copy; Copyright 2006-2019, Georg Brandl and Pygments contributors.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{
- sphinx_version }}. <br/>
- Pygments logo created by <a href="http://joelunger.com">Joel Unger</a>.
- Backgrounds from <a href="http://subtlepatterns.com">subtlepatterns.com</a>.
- </div>
- </div> {# closes "outerwrapper" div #}
-{% endblock %}
-
-{% block sidebarrel %}
-{% endblock %}
-
-{% block sidebarsourcelink %}
-{% endblock %}
diff --git a/doc/_themes/pygments14/static/bodybg.png b/doc/_themes/pygments14/static/bodybg.png
deleted file mode 100644
index 46892b80..00000000
--- a/doc/_themes/pygments14/static/bodybg.png
+++ /dev/null
Binary files differ
diff --git a/doc/_themes/pygments14/static/docbg.png b/doc/_themes/pygments14/static/docbg.png
deleted file mode 100644
index 13e61f32..00000000
--- a/doc/_themes/pygments14/static/docbg.png
+++ /dev/null
Binary files differ
diff --git a/doc/_themes/pygments14/static/listitem.png b/doc/_themes/pygments14/static/listitem.png
deleted file mode 100644
index e45715f9..00000000
--- a/doc/_themes/pygments14/static/listitem.png
+++ /dev/null
Binary files differ
diff --git a/doc/_themes/pygments14/static/logo.png b/doc/_themes/pygments14/static/logo.png
deleted file mode 100644
index 2c1a24dc..00000000
--- a/doc/_themes/pygments14/static/logo.png
+++ /dev/null
Binary files differ
diff --git a/doc/_themes/pygments14/static/pocoo.png b/doc/_themes/pygments14/static/pocoo.png
deleted file mode 100644
index 41741494..00000000
--- a/doc/_themes/pygments14/static/pocoo.png
+++ /dev/null
Binary files differ
diff --git a/doc/_themes/pygments14/static/pygments14.css_t b/doc/_themes/pygments14/static/pygments14.css_t
deleted file mode 100644
index 72ca942e..00000000
--- a/doc/_themes/pygments14/static/pygments14.css_t
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * pygments14.css
- * ~~~~~~~~~~~~~~
- *
- * Sphinx stylesheet -- pygments14 theme. Heavily copied from sphinx13.
- *
- * :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
- */
-
-@import url("basic.css");
-
-/* -- page layout ----------------------------------------------------------- */
-
-body {
- font-family: {{ theme_font }}, 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
- 'Verdana', sans-serif;
- font-size: 14px;
- text-align: center;
- background-image: url(bodybg.png);
- background-color: {{ theme_background }};
- color: black;
- padding: 0;
- /*
- border-right: 1px solid {{ theme_border }};
- border-left: 1px solid {{ theme_border }};
- */
-
- margin: 0 auto;
- min-width: 780px;
- max-width: 1080px;
-}
-
-.outerwrapper {
- background-image: url(docbg.png);
- background-attachment: fixed;
-}
-
-.pageheader {
- text-align: left;
- padding: 10px 15px;
-}
-
-.pageheader ul {
- float: right;
- color: white;
- list-style-type: none;
- padding-left: 0;
- margin-top: 40px;
- margin-right: 10px;
-}
-
-.pageheader li {
- float: left;
- margin: 0 0 0 10px;
-}
-
-.pageheader li a {
- border-radius: 3px;
- padding: 8px 12px;
- color: {{ theme_darkgray }};
- text-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
-}
-
-.pageheader li a:hover {
- background-color: {{ theme_yellow }};
- color: black;
- text-shadow: none;
-}
-
-div.document {
- text-align: left;
- /*border-left: 1em solid {{ theme_lightyellow }};*/
-}
-
-div.bodywrapper {
- margin: 0 12px 0 240px;
- background-color: white;
-/* border-right: 1px solid {{ theme_border }}; */
-}
-
-div.body {
- margin: 0;
- padding: 0.5em 20px 20px 20px;
-}
-
-div.related {
- font-size: 1em;
- color: {{ theme_darkgray }};
-}
-
-div.related ul {
- background-image: url(relbg.png);
- background-repeat: repeat-y;
- background-color: {{ theme_yellow }};
- height: 1.9em;
- /*
- border-top: 1px solid {{ theme_border }};
- border-bottom: 1px solid {{ theme_border }};
- */
-}
-
-div.related ul li {
- margin: 0 5px 0 0;
- padding: 0;
- float: left;
-}
-
-div.related ul li.right {
- float: right;
- margin-right: 5px;
-}
-
-div.related ul li a {
- margin: 0;
- padding: 0 5px 0 5px;
- line-height: 1.75em;
- color: {{ theme_darkgray }};
- /*text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.5);*/
-}
-
-div.related ul li a:hover {
- text-decoration: underline;
- text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.5);
-}
-
-div.sphinxsidebarwrapper {
- position: relative;
- top: 0px;
- padding: 0;
-}
-
-div.sphinxsidebar {
- margin: 0;
- padding: 0 0px 15px 15px;
- width: 210px;
- float: left;
- font-size: 1em;
- text-align: left;
-}
-
-div.sphinxsidebar .logo {
- font-size: 1.8em;
- color: #666;
- font-weight: 300;
- text-align: center;
-}
-
-div.sphinxsidebar .logo img {
- vertical-align: middle;
-}
-
-div.sphinxsidebar input {
- border: 1px solid #aaa;
- font-family: {{ theme_font }}, 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
- 'Verdana', sans-serif;
- font-size: 1em;
-}
-
-div.sphinxsidebar h3 {
- font-size: 1.5em;
- /* border-top: 1px solid {{ theme_border }}; */
- margin-top: 1em;
- margin-bottom: 0.5em;
- padding-top: 0.5em;
-}
-
-div.sphinxsidebar h4 {
- font-size: 1.2em;
- margin-bottom: 0;
-}
-
-div.sphinxsidebar h3, div.sphinxsidebar h4 {
- margin-right: -15px;
- margin-left: -15px;
- padding-right: 14px;
- padding-left: 14px;
- color: #333;
- font-weight: 300;
- /*text-shadow: 0px 0px 0.5px rgba(0, 0, 0, 0.4);*/
-}
-
-div.sphinxsidebarwrapper > h3:first-child {
- margin-top: 0.5em;
- border: none;
-}
-
-div.sphinxsidebar h3 a {
- color: #333;
-}
-
-div.sphinxsidebar ul {
- color: #444;
- margin-top: 7px;
- padding: 0;
- line-height: 130%;
-}
-
-div.sphinxsidebar ul ul {
- margin-left: 20px;
- list-style-image: url(listitem.png);
-}
-
-div.footer {
- color: {{ theme_darkgray }};
- text-shadow: 0 0 .2px rgba(255, 255, 255, 0.8);
- padding: 2em;
- text-align: center;
- clear: both;
- font-size: 0.8em;
-}
-
-/* -- body styles ----------------------------------------------------------- */
-
-p {
- margin: 0.8em 0 0.5em 0;
-}
-
-a {
- color: {{ theme_darkgreen }};
- text-decoration: none;
-}
-
-a:hover {
- color: {{ theme_darkyellow }};
-}
-
-div.body a {
- text-decoration: underline;
-}
-
-h1 {
- margin: 10px 0 0 0;
- font-size: 2.4em;
- color: {{ theme_darkgray }};
- font-weight: 300;
-}
-
-h2 {
- margin: 1.em 0 0.2em 0;
- font-size: 1.5em;
- font-weight: 300;
- padding: 0;
- color: {{ theme_darkgreen }};
-}
-
-h3 {
- margin: 1em 0 -0.3em 0;
- font-size: 1.3em;
- font-weight: 300;
-}
-
-div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a {
- text-decoration: none;
-}
-
-div.body h1 a tt, div.body h2 a tt, div.body h3 a tt, div.body h4 a tt, div.body h5 a tt, div.body h6 a tt {
- color: {{ theme_darkgreen }} !important;
- font-size: inherit !important;
-}
-
-a.headerlink {
- color: {{ theme_green }} !important;
- font-size: 12px;
- margin-left: 6px;
- padding: 0 4px 0 4px;
- text-decoration: none !important;
- float: right;
-}
-
-a.headerlink:hover {
- background-color: #ccc;
- color: white!important;
-}
-
-cite, code, tt {
- font-family: 'Consolas', 'DejaVu Sans Mono',
- 'Bitstream Vera Sans Mono', monospace;
- font-size: 14px;
- letter-spacing: -0.02em;
-}
-
-tt {
- background-color: #f2f2f2;
- border: 1px solid #ddd;
- border-radius: 2px;
- color: #333;
- padding: 1px;
-}
-
-tt.descname, tt.descclassname, tt.xref {
- border: 0;
-}
-
-hr {
- border: 1px solid #abc;
- margin: 2em;
-}
-
-a tt {
- border: 0;
- color: {{ theme_darkgreen }};
-}
-
-a tt:hover {
- color: {{ theme_darkyellow }};
-}
-
-pre {
- font-family: 'Consolas', 'DejaVu Sans Mono',
- 'Bitstream Vera Sans Mono', monospace;
- font-size: 13px;
- letter-spacing: 0.015em;
- line-height: 120%;
- padding: 0.5em;
- border: 1px solid #ccc;
- border-radius: 2px;
- background-color: #f8f8f8;
-}
-
-pre a {
- color: inherit;
- text-decoration: underline;
-}
-
-td.linenos pre {
- padding: 0.5em 0;
-}
-
-div.quotebar {
- background-color: #f8f8f8;
- max-width: 250px;
- float: right;
- padding: 0px 7px;
- border: 1px solid #ccc;
- margin-left: 1em;
-}
-
-div.topic {
- background-color: #f8f8f8;
-}
-
-table {
- border-collapse: collapse;
- margin: 0 -0.5em 0 -0.5em;
-}
-
-table td, table th {
- padding: 0.2em 0.5em 0.2em 0.5em;
-}
-
-div.admonition, div.warning {
- font-size: 0.9em;
- margin: 1em 0 1em 0;
- border: 1px solid #86989B;
- border-radius: 2px;
- background-color: #f7f7f7;
- padding: 0;
-}
-
-div.admonition p, div.warning p {
- margin: 0.5em 1em 0.5em 1em;
- padding: 0;
-}
-
-div.admonition pre, div.warning pre {
- margin: 0.4em 1em 0.4em 1em;
-}
-
-div.admonition p.admonition-title,
-div.warning p.admonition-title {
- margin-top: 1em;
- padding-top: 0.5em;
- font-weight: bold;
-}
-
-div.warning {
- border: 1px solid #940000;
-/* background-color: #FFCCCF;*/
-}
-
-div.warning p.admonition-title {
-}
-
-div.admonition ul, div.admonition ol,
-div.warning ul, div.warning ol {
- margin: 0.1em 0.5em 0.5em 3em;
- padding: 0;
-}
-
-.viewcode-back {
- font-family: {{ theme_font }}, 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
- 'Verdana', sans-serif;
-}
-
-div.viewcode-block:target {
- background-color: #f4debf;
- border-top: 1px solid #ac9;
- border-bottom: 1px solid #ac9;
-}
diff --git a/doc/_themes/pygments14/theme.conf b/doc/_themes/pygments14/theme.conf
deleted file mode 100644
index fffe66d6..00000000
--- a/doc/_themes/pygments14/theme.conf
+++ /dev/null
@@ -1,15 +0,0 @@
-[theme]
-inherit = basic
-stylesheet = pygments14.css
-pygments_style = friendly
-
-[options]
-green = #66b55e
-darkgreen = #36852e
-darkgray = #666666
-border = #66b55e
-yellow = #f4cd00
-darkyellow = #d4ad00
-lightyellow = #fffbe3
-background = #f9f9f9
-font = PT Sans
diff --git a/doc/conf.py b/doc/conf.py
deleted file mode 100644
index 00db7d9b..00000000
--- a/doc/conf.py
+++ /dev/null
@@ -1,241 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Pygments documentation build configuration file
-#
-
-import sys, os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('..'))
-
-import pygments
-
-# -- General configuration -----------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'pygments.sphinxext']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'Pygments'
-copyright = u'2015, Georg Brandl'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = pygments.__version__
-# The full version, including alpha/beta/rc tags.
-release = version
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-#pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-html_theme = 'pygments14'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = ['_themes']
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-html_favicon = '_static/favicon.ico'
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-html_sidebars = {'index': ['indexsidebar.html'],
- 'docs/*': ['docssidebar.html']}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'Pygmentsdoc'
-
-
-# -- Options for LaTeX output --------------------------------------------------
-
-latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'Pygments.tex', u'Pygments Documentation',
- u'Georg Brandl', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output --------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'pygments', u'Pygments Documentation',
- [u'Georg Brandl'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-
-# -- Options for Texinfo output ------------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- ('index', 'Pygments', u'Pygments Documentation',
- u'Georg Brandl', 'Pygments', 'One line description of project.',
- 'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-
-# Example configuration for intersphinx: refer to the Python standard library.
-#intersphinx_mapping = {'http://docs.python.org/': None}
diff --git a/doc/docs/api.rst b/doc/docs/api.rst
deleted file mode 100644
index a6b242dd..00000000
--- a/doc/docs/api.rst
+++ /dev/null
@@ -1,354 +0,0 @@
-.. -*- mode: rst -*-
-
-=====================
-The full Pygments API
-=====================
-
-This page describes the Pygments API.
-
-High-level API
-==============
-
-.. module:: pygments
-
-Functions from the :mod:`pygments` module:
-
-.. function:: lex(code, lexer)
-
- Lex `code` with the `lexer` (must be a `Lexer` instance)
- and return an iterable of tokens. Currently, this only calls
- `lexer.get_tokens()`.
-
-.. function:: format(tokens, formatter, outfile=None)
-
- Format a token stream (iterable of tokens) `tokens` with the
- `formatter` (must be a `Formatter` instance). The result is
- written to `outfile`, or if that is ``None``, returned as a
- string.
-
-.. function:: highlight(code, lexer, formatter, outfile=None)
-
- This is the most high-level highlighting function.
- It combines `lex` and `format` in one function.
-
-
-.. module:: pygments.lexers
-
-Functions from :mod:`pygments.lexers`:
-
-.. function:: get_lexer_by_name(alias, **options)
-
- Return an instance of a `Lexer` subclass that has `alias` in its
- aliases list. The lexer is given the `options` at its
- instantiation.
-
- Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
- found.
-
-.. function:: get_lexer_for_filename(fn, **options)
-
- Return a `Lexer` subclass instance that has a filename pattern
- matching `fn`. The lexer is given the `options` at its
- instantiation.
-
- Will raise :exc:`pygments.util.ClassNotFound` if no lexer for that filename
- is found.
-
-.. function:: get_lexer_for_mimetype(mime, **options)
-
- Return a `Lexer` subclass instance that has `mime` in its mimetype
- list. The lexer is given the `options` at its instantiation.
-
- Will raise :exc:`pygments.util.ClassNotFound` if not lexer for that mimetype
- is found.
-
-.. function:: load_lexer_from_file(filename, lexername="CustomLexer", **options)
-
- Return a `Lexer` subclass instance loaded from the provided file, relative
- to the current directory. The file is expected to contain a Lexer class
- named `lexername` (by default, CustomLexer). Users should be very careful with
- the input, because this method is equivalent to running eval on the input file.
- The lexer is given the `options` at its instantiation.
-
- :exc:`ClassNotFound` is raised if there are any errors loading the Lexer
-
- .. versionadded:: 2.2
-
-.. function:: guess_lexer(text, **options)
-
- Return a `Lexer` subclass instance that's guessed from the text in
- `text`. For that, the :meth:`.analyse_text()` method of every known lexer
- class is called with the text as argument, and the lexer which returned the
- highest value will be instantiated and returned.
-
- :exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
- handle the content.
-
-.. function:: guess_lexer_for_filename(filename, text, **options)
-
- As :func:`guess_lexer()`, but only lexers which have a pattern in `filenames`
- or `alias_filenames` that matches `filename` are taken into consideration.
-
- :exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
- handle the content.
-
-.. function:: get_all_lexers()
-
- Return an iterable over all registered lexers, yielding tuples in the
- format::
-
- (longname, tuple of aliases, tuple of filename patterns, tuple of mimetypes)
-
- .. versionadded:: 0.6
-
-.. function:: find_lexer_class_by_name(alias)
-
- Return the `Lexer` subclass that has `alias` in its aliases list, without
- instantiating it.
-
- Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
- found.
-
- .. versionadded:: 2.2
-
-.. function:: find_lexer_class(name)
-
- Return the `Lexer` subclass that with the *name* attribute as given by
- the *name* argument.
-
-
-.. module:: pygments.formatters
-
-Functions from :mod:`pygments.formatters`:
-
-.. function:: get_formatter_by_name(alias, **options)
-
- Return an instance of a :class:`.Formatter` subclass that has `alias` in its
- aliases list. The formatter is given the `options` at its instantiation.
-
- Will raise :exc:`pygments.util.ClassNotFound` if no formatter with that
- alias is found.
-
-.. function:: get_formatter_for_filename(fn, **options)
-
- Return a :class:`.Formatter` subclass instance that has a filename pattern
- matching `fn`. The formatter is given the `options` at its instantiation.
-
- Will raise :exc:`pygments.util.ClassNotFound` if no formatter for that filename
- is found.
-
-.. function:: load_formatter_from_file(filename, formattername="CustomFormatter", **options)
-
- Return a `Formatter` subclass instance loaded from the provided file, relative
- to the current directory. The file is expected to contain a Formatter class
- named ``formattername`` (by default, CustomFormatter). Users should be very
- careful with the input, because this method is equivalent to running eval
- on the input file. The formatter is given the `options` at its instantiation.
-
- :exc:`ClassNotFound` is raised if there are any errors loading the Formatter
-
- .. versionadded:: 2.2
-
-.. module:: pygments.styles
-
-Functions from :mod:`pygments.styles`:
-
-.. function:: get_style_by_name(name)
-
- Return a style class by its short name. The names of the builtin styles
- are listed in :data:`pygments.styles.STYLE_MAP`.
-
- Will raise :exc:`pygments.util.ClassNotFound` if no style of that name is
- found.
-
-.. function:: get_all_styles()
-
- Return an iterable over all registered styles, yielding their names.
-
- .. versionadded:: 0.6
-
-
-.. module:: pygments.lexer
-
-Lexers
-======
-
-The base lexer class from which all lexers are derived is:
-
-.. class:: Lexer(**options)
-
- The constructor takes a \*\*keywords dictionary of options.
- Every subclass must first process its own options and then call
- the `Lexer` constructor, since it processes the `stripnl`,
- `stripall` and `tabsize` options.
-
- An example looks like this:
-
- .. sourcecode:: python
-
- def __init__(self, **options):
- self.compress = options.get('compress', '')
- Lexer.__init__(self, **options)
-
- As these options must all be specifiable as strings (due to the
- command line usage), there are various utility functions
- available to help with that, see `Option processing`_.
-
- .. method:: get_tokens(text)
-
- This method is the basic interface of a lexer. It is called by
- the `highlight()` function. It must process the text and return an
- iterable of ``(tokentype, value)`` pairs from `text`.
-
- Normally, you don't need to override this method. The default
- implementation processes the `stripnl`, `stripall` and `tabsize`
- options and then yields all tokens from `get_tokens_unprocessed()`,
- with the ``index`` dropped.
-
- .. method:: get_tokens_unprocessed(text)
-
- This method should process the text and return an iterable of
- ``(index, tokentype, value)`` tuples where ``index`` is the starting
- position of the token within the input text.
-
- This method must be overridden by subclasses.
-
- .. staticmethod:: analyse_text(text)
-
- A static method which is called for lexer guessing. It should analyse
- the text and return a float in the range from ``0.0`` to ``1.0``.
- If it returns ``0.0``, the lexer will not be selected as the most
- probable one, if it returns ``1.0``, it will be selected immediately.
-
- .. note:: You don't have to add ``@staticmethod`` to the definition of
- this method, this will be taken care of by the Lexer's metaclass.
-
- For a list of known tokens have a look at the :doc:`tokens` page.
-
- A lexer also can have the following attributes (in fact, they are mandatory
- except `alias_filenames`) that are used by the builtin lookup mechanism.
-
- .. attribute:: name
-
- Full name for the lexer, in human-readable form.
-
- .. attribute:: aliases
-
- A list of short, unique identifiers that can be used to lookup
- the lexer from a list, e.g. using `get_lexer_by_name()`.
-
- .. attribute:: filenames
-
- A list of `fnmatch` patterns that match filenames which contain
- content for this lexer. The patterns in this list should be unique among
- all lexers.
-
- .. attribute:: alias_filenames
-
- A list of `fnmatch` patterns that match filenames which may or may not
- contain content for this lexer. This list is used by the
- :func:`.guess_lexer_for_filename()` function, to determine which lexers
- are then included in guessing the correct one. That means that
- e.g. every lexer for HTML and a template language should include
- ``\*.html`` in this list.
-
- .. attribute:: mimetypes
-
- A list of MIME types for content that can be lexed with this
- lexer.
-
-
-.. module:: pygments.formatter
-
-Formatters
-==========
-
-A formatter is derived from this class:
-
-
-.. class:: Formatter(**options)
-
- As with lexers, this constructor processes options and then must call the
- base class :meth:`__init__`.
-
- The :class:`Formatter` class recognizes the options `style`, `full` and
- `title`. It is up to the formatter class whether it uses them.
-
- .. method:: get_style_defs(arg='')
-
- This method must return statements or declarations suitable to define
- the current style for subsequent highlighted text (e.g. CSS classes
- in the `HTMLFormatter`).
-
- The optional argument `arg` can be used to modify the generation and
- is formatter dependent (it is standardized because it can be given on
- the command line).
-
- This method is called by the ``-S`` :doc:`command-line option <cmdline>`,
- the `arg` is then given by the ``-a`` option.
-
- .. method:: format(tokensource, outfile)
-
- This method must format the tokens from the `tokensource` iterable and
- write the formatted version to the file object `outfile`.
-
- Formatter options can control how exactly the tokens are converted.
-
- .. versionadded:: 0.7
- A formatter must have the following attributes that are used by the
- builtin lookup mechanism.
-
- .. attribute:: name
-
- Full name for the formatter, in human-readable form.
-
- .. attribute:: aliases
-
- A list of short, unique identifiers that can be used to lookup
- the formatter from a list, e.g. using :func:`.get_formatter_by_name()`.
-
- .. attribute:: filenames
-
- A list of :mod:`fnmatch` patterns that match filenames for which this
- formatter can produce output. The patterns in this list should be unique
- among all formatters.
-
-
-.. module:: pygments.util
-
-Option processing
-=================
-
-The :mod:`pygments.util` module has some utility functions usable for option
-processing:
-
-.. exception:: OptionError
-
- This exception will be raised by all option processing functions if
- the type or value of the argument is not correct.
-
-.. function:: get_bool_opt(options, optname, default=None)
-
- Interpret the key `optname` from the dictionary `options` as a boolean and
- return it. Return `default` if `optname` is not in `options`.
-
- The valid string values for ``True`` are ``1``, ``yes``, ``true`` and
- ``on``, the ones for ``False`` are ``0``, ``no``, ``false`` and ``off``
- (matched case-insensitively).
-
-.. function:: get_int_opt(options, optname, default=None)
-
- As :func:`get_bool_opt`, but interpret the value as an integer.
-
-.. function:: get_list_opt(options, optname, default=None)
-
- If the key `optname` from the dictionary `options` is a string,
- split it at whitespace and return it. If it is already a list
- or a tuple, it is returned as a list.
-
-.. function:: get_choice_opt(options, optname, allowed, default=None)
-
- If the key `optname` from the dictionary is not in the sequence
- `allowed`, raise an error, otherwise return it.
-
- .. versionadded:: 0.8
diff --git a/doc/docs/authors.rst b/doc/docs/authors.rst
deleted file mode 100644
index f8373f0a..00000000
--- a/doc/docs/authors.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Full contributor list
-=====================
-
-.. include:: ../../AUTHORS
diff --git a/doc/docs/changelog.rst b/doc/docs/changelog.rst
deleted file mode 100644
index f264cab0..00000000
--- a/doc/docs/changelog.rst
+++ /dev/null
@@ -1 +0,0 @@
-.. include:: ../../CHANGES
diff --git a/doc/docs/cmdline.rst b/doc/docs/cmdline.rst
deleted file mode 100644
index e4f94ea5..00000000
--- a/doc/docs/cmdline.rst
+++ /dev/null
@@ -1,166 +0,0 @@
-.. -*- mode: rst -*-
-
-======================
-Command Line Interface
-======================
-
-You can use Pygments from the shell, provided you installed the
-:program:`pygmentize` script::
-
- $ pygmentize test.py
- print "Hello World"
-
-will print the file test.py to standard output, using the Python lexer
-(inferred from the file name extension) and the terminal formatter (because
-you didn't give an explicit formatter name).
-
-If you want HTML output::
-
- $ pygmentize -f html -l python -o test.html test.py
-
-As you can see, the -l option explicitly selects a lexer. As seen above, if you
-give an input file name and it has an extension that Pygments recognizes, you can
-omit this option.
-
-The ``-o`` option gives an output file name. If it is not given, output is
-written to stdout.
-
-The ``-f`` option selects a formatter (as with ``-l``, it can also be omitted
-if an output file name is given and has a supported extension).
-If no output file name is given and ``-f`` is omitted, the
-:class:`.TerminalFormatter` is used.
-
-The above command could therefore also be given as::
-
- $ pygmentize -o test.html test.py
-
-To create a full HTML document, including line numbers and stylesheet (using the
-"emacs" style), highlighting the Python file ``test.py`` to ``test.html``::
-
- $ pygmentize -O full,style=emacs -o test.html test.py
-
-
-Options and filters
--------------------
-
-Lexer and formatter options can be given using the ``-O`` option::
-
- $ pygmentize -f html -O style=colorful,linenos=1 -l python test.py
-
-Be sure to enclose the option string in quotes if it contains any special shell
-characters, such as spaces or expansion wildcards like ``*``. If an option
-expects a list value, separate the list entries with spaces (you'll have to
-quote the option value in this case too, so that the shell doesn't split it).
-
-Since the ``-O`` option argument is split at commas and expects the split values
-to be of the form ``name=value``, you can't give an option value that contains
-commas or equals signs. Therefore, an option ``-P`` is provided (as of Pygments
-0.9) that works like ``-O`` but can only pass one option per ``-P``. Its value
-can then contain all characters::
-
- $ pygmentize -P "heading=Pygments, the Python highlighter" ...
-
-Filters are added to the token stream using the ``-F`` option::
-
- $ pygmentize -f html -l pascal -F keywordcase:case=upper main.pas
-
-As you see, options for the filter are given after a colon. As for ``-O``, the
-filter name and options must be one shell word, so there may not be any spaces
-around the colon.
-
-
-Generating styles
------------------
-
-Formatters normally don't output full style information. For example, the HTML
-formatter by default only outputs ``<span>`` tags with ``class`` attributes.
-Therefore, there's a special ``-S`` option for generating style definitions.
-Usage is as follows::
-
- $ pygmentize -f html -S colorful -a .syntax
-
-generates a CSS style sheet (because you selected the HTML formatter) for
-the "colorful" style prepending a ".syntax" selector to all style rules.
-
-For an explanation what ``-a`` means for :doc:`a particular formatter
-<formatters>`, look for the `arg` argument for the formatter's
-:meth:`.get_style_defs()` method.
-
-
-Getting lexer names
--------------------
-
-.. versionadded:: 1.0
-
-The ``-N`` option guesses a lexer name for a given filename, so that ::
-
- $ pygmentize -N setup.py
-
-will print out ``python``. It won't highlight anything yet. If no specific
-lexer is known for that filename, ``text`` is printed.
-
-Custom Lexers and Formatters
-----------------------------
-
-.. versionadded:: 2.2
-
-The ``-x`` flag enables custom lexers and formatters to be loaded
-from files relative to the current directory. Create a file with a class named
-CustomLexer or CustomFormatter, then specify it on the command line::
-
- $ pygmentize -l your_lexer.py -f your_formatter.py -x
-
-You can also specify the name of your class with a colon::
-
- $ pygmentize -l your_lexer.py:SomeLexer -x
-
-For more information, see :doc:`the Pygments documentation on Lexer development
-<lexerdevelopment>`.
-
-Getting help
-------------
-
-The ``-L`` option lists lexers, formatters, along with their short
-names and supported file name extensions, styles and filters. If you want to see
-only one category, give it as an argument::
-
- $ pygmentize -L filters
-
-will list only all installed filters.
-
-The ``-H`` option will give you detailed information (the same that can be found
-in this documentation) about a lexer, formatter or filter. Usage is as follows::
-
- $ pygmentize -H formatter html
-
-will print the help for the HTML formatter, while ::
-
- $ pygmentize -H lexer python
-
-will print the help for the Python lexer, etc.
-
-
-A note on encodings
--------------------
-
-.. versionadded:: 0.9
-
-Pygments tries to be smart regarding encodings in the formatting process:
-
-* If you give an ``encoding`` option, it will be used as the input and
- output encoding.
-
-* If you give an ``outencoding`` option, it will override ``encoding``
- as the output encoding.
-
-* If you give an ``inencoding`` option, it will override ``encoding``
- as the input encoding.
-
-* If you don't give an encoding and have given an output file, the default
- encoding for lexer and formatter is the terminal encoding or the default
- locale encoding of the system. As a last resort, ``latin1`` is used (which
- will pass through all non-ASCII characters).
-
-* If you don't give an encoding and haven't given an output file (that means
- output is written to the console), the default encoding for lexer and
- formatter is the terminal encoding (``sys.stdout.encoding``).
diff --git a/doc/docs/filterdevelopment.rst b/doc/docs/filterdevelopment.rst
deleted file mode 100644
index fbcd0a09..00000000
--- a/doc/docs/filterdevelopment.rst
+++ /dev/null
@@ -1,71 +0,0 @@
-.. -*- mode: rst -*-
-
-=====================
-Write your own filter
-=====================
-
-.. versionadded:: 0.7
-
-Writing own filters is very easy. All you have to do is to subclass
-the `Filter` class and override the `filter` method. Additionally a
-filter is instantiated with some keyword arguments you can use to
-adjust the behavior of your filter.
-
-
-Subclassing Filters
-===================
-
-As an example, we write a filter that converts all `Name.Function` tokens
-to normal `Name` tokens to make the output less colorful.
-
-.. sourcecode:: python
-
- from pygments.util import get_bool_opt
- from pygments.token import Name
- from pygments.filter import Filter
-
- class UncolorFilter(Filter):
-
- def __init__(self, **options):
- Filter.__init__(self, **options)
- self.class_too = get_bool_opt(options, 'classtoo')
-
- def filter(self, lexer, stream):
- for ttype, value in stream:
- if ttype is Name.Function or (self.class_too and
- ttype is Name.Class):
- ttype = Name
- yield ttype, value
-
-Some notes on the `lexer` argument: that can be quite confusing since it doesn't
-need to be a lexer instance. If a filter was added by using the `add_filter()`
-function of lexers, that lexer is registered for the filter. In that case
-`lexer` will refer to the lexer that has registered the filter. It *can* be used
-to access options passed to a lexer. Because it could be `None` you always have
-to check for that case if you access it.
-
-
-Using a decorator
-=================
-
-You can also use the `simplefilter` decorator from the `pygments.filter` module:
-
-.. sourcecode:: python
-
- from pygments.util import get_bool_opt
- from pygments.token import Name
- from pygments.filter import simplefilter
-
-
- @simplefilter
- def uncolor(self, lexer, stream, options):
- class_too = get_bool_opt(options, 'classtoo')
- for ttype, value in stream:
- if ttype is Name.Function or (class_too and
- ttype is Name.Class):
- ttype = Name
- yield ttype, value
-
-The decorator automatically subclasses an internal filter class and uses the
-decorated function as a method for filtering. (That's why there is a `self`
-argument that you probably won't end up using in the method.)
diff --git a/doc/docs/filters.rst b/doc/docs/filters.rst
deleted file mode 100644
index ff2519a3..00000000
--- a/doc/docs/filters.rst
+++ /dev/null
@@ -1,41 +0,0 @@
-.. -*- mode: rst -*-
-
-=======
-Filters
-=======
-
-.. versionadded:: 0.7
-
-You can filter token streams coming from lexers to improve or annotate the
-output. For example, you can highlight special words in comments, convert
-keywords to upper or lowercase to enforce a style guide etc.
-
-To apply a filter, you can use the `add_filter()` method of a lexer:
-
-.. sourcecode:: pycon
-
- >>> from pygments.lexers import PythonLexer
- >>> l = PythonLexer()
- >>> # add a filter given by a string and options
- >>> l.add_filter('codetagify', case='lower')
- >>> l.filters
- [<pygments.filters.CodeTagFilter object at 0xb785decc>]
- >>> from pygments.filters import KeywordCaseFilter
- >>> # or give an instance
- >>> l.add_filter(KeywordCaseFilter(case='lower'))
-
-The `add_filter()` method takes keyword arguments which are forwarded to
-the constructor of the filter.
-
-To get a list of all registered filters by name, you can use the
-`get_all_filters()` function from the `pygments.filters` module that returns an
-iterable for all known filters.
-
-If you want to write your own filter, have a look at :doc:`Write your own filter
-<filterdevelopment>`.
-
-
-Builtin Filters
-===============
-
-.. pygmentsdoc:: filters
diff --git a/doc/docs/formatterdevelopment.rst b/doc/docs/formatterdevelopment.rst
deleted file mode 100644
index 2bfac05c..00000000
--- a/doc/docs/formatterdevelopment.rst
+++ /dev/null
@@ -1,169 +0,0 @@
-.. -*- mode: rst -*-
-
-========================
-Write your own formatter
-========================
-
-As well as creating :doc:`your own lexer <lexerdevelopment>`, writing a new
-formatter for Pygments is easy and straightforward.
-
-A formatter is a class that is initialized with some keyword arguments (the
-formatter options) and that must provides a `format()` method.
-Additionally a formatter should provide a `get_style_defs()` method that
-returns the style definitions from the style in a form usable for the
-formatter's output format.
-
-
-Quickstart
-==========
-
-The most basic formatter shipped with Pygments is the `NullFormatter`. It just
-sends the value of a token to the output stream:
-
-.. sourcecode:: python
-
- from pygments.formatter import Formatter
-
- class NullFormatter(Formatter):
- def format(self, tokensource, outfile):
- for ttype, value in tokensource:
- outfile.write(value)
-
-As you can see, the `format()` method is passed two parameters: `tokensource`
-and `outfile`. The first is an iterable of ``(token_type, value)`` tuples,
-the latter a file like object with a `write()` method.
-
-Because the formatter is that basic it doesn't overwrite the `get_style_defs()`
-method.
-
-
-Styles
-======
-
-Styles aren't instantiated but their metaclass provides some class functions
-so that you can access the style definitions easily.
-
-Styles are iterable and yield tuples in the form ``(ttype, d)`` where `ttype`
-is a token and `d` is a dict with the following keys:
-
-``'color'``
- Hexadecimal color value (eg: ``'ff0000'`` for red) or `None` if not
- defined.
-
-``'bold'``
- `True` if the value should be bold
-
-``'italic'``
- `True` if the value should be italic
-
-``'underline'``
- `True` if the value should be underlined
-
-``'bgcolor'``
- Hexadecimal color value for the background (eg: ``'eeeeeee'`` for light
- gray) or `None` if not defined.
-
-``'border'``
- Hexadecimal color value for the border (eg: ``'0000aa'`` for a dark
- blue) or `None` for no border.
-
-Additional keys might appear in the future, formatters should ignore all keys
-they don't support.
-
-
-HTML 3.2 Formatter
-==================
-
-For an more complex example, let's implement a HTML 3.2 Formatter. We don't
-use CSS but inline markup (``<u>``, ``<font>``, etc). Because this isn't good
-style this formatter isn't in the standard library ;-)
-
-.. sourcecode:: python
-
- from pygments.formatter import Formatter
-
- class OldHtmlFormatter(Formatter):
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
-
- # create a dict of (start, end) tuples that wrap the
- # value of a token so that we can use it in the format
- # method later
- self.styles = {}
-
- # we iterate over the `_styles` attribute of a style item
- # that contains the parsed style values.
- for token, style in self.style:
- start = end = ''
- # a style item is a tuple in the following form:
- # colors are readily specified in hex: 'RRGGBB'
- if style['color']:
- start += '<font color="#%s">' % style['color']
- end = '</font>' + end
- if style['bold']:
- start += '<b>'
- end = '</b>' + end
- if style['italic']:
- start += '<i>'
- end = '</i>' + end
- if style['underline']:
- start += '<u>'
- end = '</u>' + end
- self.styles[token] = (start, end)
-
- def format(self, tokensource, outfile):
- # lastval is a string we use for caching
- # because it's possible that an lexer yields a number
- # of consecutive tokens with the same token type.
- # to minimize the size of the generated html markup we
- # try to join the values of same-type tokens here
- lastval = ''
- lasttype = None
-
- # wrap the whole output with <pre>
- outfile.write('<pre>')
-
- for ttype, value in tokensource:
- # if the token type doesn't exist in the stylemap
- # we try it with the parent of the token type
- # eg: parent of Token.Literal.String.Double is
- # Token.Literal.String
- while ttype not in self.styles:
- ttype = ttype.parent
- if ttype == lasttype:
- # the current token type is the same of the last
- # iteration. cache it
- lastval += value
- else:
- # not the same token as last iteration, but we
- # have some data in the buffer. wrap it with the
- # defined style and write it to the output file
- if lastval:
- stylebegin, styleend = self.styles[lasttype]
- outfile.write(stylebegin + lastval + styleend)
- # set lastval/lasttype to current values
- lastval = value
- lasttype = ttype
-
- # if something is left in the buffer, write it to the
- # output file, then close the opened <pre> tag
- if lastval:
- stylebegin, styleend = self.styles[lasttype]
- outfile.write(stylebegin + lastval + styleend)
- outfile.write('</pre>\n')
-
-The comments should explain it. Again, this formatter doesn't override the
-`get_style_defs()` method. If we would have used CSS classes instead of
-inline HTML markup, we would need to generate the CSS first. For that
-purpose the `get_style_defs()` method exists:
-
-
-Generating Style Definitions
-============================
-
-Some formatters like the `LatexFormatter` and the `HtmlFormatter` don't
-output inline markup but reference either macros or css classes. Because
-the definitions of those are not part of the output, the `get_style_defs()`
-method exists. It is passed one parameter (if it's used and how it's used
-is up to the formatter) and has to return a string or ``None``.
diff --git a/doc/docs/formatters.rst b/doc/docs/formatters.rst
deleted file mode 100644
index 9e7074e8..00000000
--- a/doc/docs/formatters.rst
+++ /dev/null
@@ -1,48 +0,0 @@
-.. -*- mode: rst -*-
-
-====================
-Available formatters
-====================
-
-This page lists all builtin formatters.
-
-Common options
-==============
-
-All formatters support these options:
-
-`encoding`
- If given, must be an encoding name (such as ``"utf-8"``). This will
- be used to convert the token strings (which are Unicode strings)
- to byte strings in the output (default: ``None``).
- It will also be written in an encoding declaration suitable for the
- document format if the `full` option is given (e.g. a ``meta
- content-type`` directive in HTML or an invocation of the `inputenc`
- package in LaTeX).
-
- If this is ``""`` or ``None``, Unicode strings will be written
- to the output file, which most file-like objects do not support.
- For example, `pygments.highlight()` will return a Unicode string if
- called with no `outfile` argument and a formatter that has `encoding`
- set to ``None`` because it uses a `StringIO.StringIO` object that
- supports Unicode arguments to `write()`. Using a regular file object
- wouldn't work.
-
- .. versionadded:: 0.6
-
-`outencoding`
- When using Pygments from the command line, any `encoding` option given is
- passed to the lexer and the formatter. This is sometimes not desirable,
- for example if you want to set the input encoding to ``"guess"``.
- Therefore, `outencoding` has been introduced which overrides `encoding`
- for the formatter if given.
-
- .. versionadded:: 0.7
-
-
-Formatter classes
-=================
-
-All these classes are importable from :mod:`pygments.formatters`.
-
-.. pygmentsdoc:: formatters
diff --git a/doc/docs/index.rst b/doc/docs/index.rst
deleted file mode 100644
index 30d5c085..00000000
--- a/doc/docs/index.rst
+++ /dev/null
@@ -1,66 +0,0 @@
-Pygments documentation
-======================
-
-**Starting with Pygments**
-
-.. toctree::
- :maxdepth: 1
-
- ../download
- quickstart
- cmdline
-
-**Builtin components**
-
-.. toctree::
- :maxdepth: 1
-
- lexers
- filters
- formatters
- styles
-
-**Reference**
-
-.. toctree::
- :maxdepth: 1
-
- unicode
- tokens
- api
-
-**Hacking for Pygments**
-
-.. toctree::
- :maxdepth: 1
-
- lexerdevelopment
- formatterdevelopment
- filterdevelopment
- plugins
-
-**Hints and tricks**
-
-.. toctree::
- :maxdepth: 1
-
- rstdirective
- moinmoin
- java
- integrate
-
-**About Pygments**
-
-.. toctree::
- :maxdepth: 1
-
- changelog
- authors
-
-
-If you find bugs or have suggestions for the documentation, please look
-:ref:`here <contribute>` for info on how to contact the team.
-
-.. XXX You can download an offline version of this documentation from the
- :doc:`download page </download>`.
-
diff --git a/doc/docs/integrate.rst b/doc/docs/integrate.rst
deleted file mode 100644
index 77daaa43..00000000
--- a/doc/docs/integrate.rst
+++ /dev/null
@@ -1,40 +0,0 @@
-.. -*- mode: rst -*-
-
-===================================
-Using Pygments in various scenarios
-===================================
-
-Markdown
---------
-
-Since Pygments 0.9, the distribution ships Markdown_ preprocessor sample code
-that uses Pygments to render source code in
-:file:`external/markdown-processor.py`. You can copy and adapt it to your
-liking.
-
-.. _Markdown: http://www.freewisdom.org/projects/python-markdown/
-
-TextMate
---------
-
-Antonio Cangiano has created a Pygments bundle for TextMate that allows to
-colorize code via a simple menu option. It can be found here_.
-
-.. _here: http://antoniocangiano.com/2008/10/28/pygments-textmate-bundle/
-
-Bash completion
----------------
-
-The source distribution contains a file ``external/pygments.bashcomp`` that
-sets up completion for the ``pygmentize`` command in bash.
-
-Wrappers for other languages
-----------------------------
-
-These libraries provide Pygments highlighting for users of other languages
-than Python:
-
-* `pygments.rb <https://github.com/tmm1/pygments.rb>`_, a pygments wrapper for Ruby
-* `Clygments <https://github.com/bfontaine/clygments>`_, a pygments wrapper for
- Clojure
-* `PHPygments <https://github.com/capynet/PHPygments>`_, a pygments wrapper for PHP
diff --git a/doc/docs/java.rst b/doc/docs/java.rst
deleted file mode 100644
index f553463c..00000000
--- a/doc/docs/java.rst
+++ /dev/null
@@ -1,70 +0,0 @@
-=====================
-Use Pygments in Java
-=====================
-
-Thanks to `Jython <http://www.jython.org>`_ it is possible to use Pygments in
-Java.
-
-This page is a simple tutorial to get an idea of how this works. You can
-then look at the `Jython documentation <http://www.jython.org/docs/>`_ for more
-advanced uses.
-
-Since version 1.5, Pygments is deployed on `Maven Central
-<http://repo1.maven.org/maven2/org/pygments/pygments/>`_ as a JAR, as is Jython
-which makes it a lot easier to create a Java project.
-
-Here is an example of a `Maven <http://www.maven.org>`_ ``pom.xml`` file for a
-project running Pygments:
-
-.. sourcecode:: xml
-
- <?xml version="1.0" encoding="UTF-8"?>
-
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
- http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>example</groupId>
- <artifactId>example</artifactId>
- <version>1.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>org.python</groupId>
- <artifactId>jython-standalone</artifactId>
- <version>2.5.3</version>
- </dependency>
- <dependency>
- <groupId>org.pygments</groupId>
- <artifactId>pygments</artifactId>
- <version>1.5</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </project>
-
-The following Java example:
-
-.. sourcecode:: java
-
- PythonInterpreter interpreter = new PythonInterpreter();
-
- // Set a variable with the content you want to work with
- interpreter.set("code", code);
-
- // Simple use Pygments as you would in Python
- interpreter.exec("from pygments import highlight\n"
- + "from pygments.lexers import PythonLexer\n"
- + "from pygments.formatters import HtmlFormatter\n"
- + "\nresult = highlight(code, PythonLexer(), HtmlFormatter())");
-
- // Get the result that has been set in a variable
- System.out.println(interpreter.get("result", String.class));
-
-will print something like:
-
-.. sourcecode:: html
-
- <div class="highlight">
- <pre><span class="k">print</span> <span class="s">&quot;Hello World&quot;</span></pre>
- </div>
diff --git a/doc/docs/lexerdevelopment.rst b/doc/docs/lexerdevelopment.rst
deleted file mode 100644
index 63bd01a3..00000000
--- a/doc/docs/lexerdevelopment.rst
+++ /dev/null
@@ -1,728 +0,0 @@
-.. -*- mode: rst -*-
-
-.. highlight:: python
-
-====================
-Write your own lexer
-====================
-
-If a lexer for your favorite language is missing in the Pygments package, you
-can easily write your own and extend Pygments.
-
-All you need can be found inside the :mod:`pygments.lexer` module. As you can
-read in the :doc:`API documentation <api>`, a lexer is a class that is
-initialized with some keyword arguments (the lexer options) and that provides a
-:meth:`.get_tokens_unprocessed()` method which is given a string or unicode
-object with the data to lex.
-
-The :meth:`.get_tokens_unprocessed()` method must return an iterator or iterable
-containing tuples in the form ``(index, token, value)``. Normally you don't
-need to do this since there are base lexers that do most of the work and that
-you can subclass.
-
-
-RegexLexer
-==========
-
-The lexer base class used by almost all of Pygments' lexers is the
-:class:`RegexLexer`. This class allows you to define lexing rules in terms of
-*regular expressions* for different *states*.
-
-States are groups of regular expressions that are matched against the input
-string at the *current position*. If one of these expressions matches, a
-corresponding action is performed (such as yielding a token with a specific
-type, or changing state), the current position is set to where the last match
-ended and the matching process continues with the first regex of the current
-state.
-
-Lexer states are kept on a stack: each time a new state is entered, the new
-state is pushed onto the stack. The most basic lexers (like the `DiffLexer`)
-just need one state.
-
-Each state is defined as a list of tuples in the form (`regex`, `action`,
-`new_state`) where the last item is optional. In the most basic form, `action`
-is a token type (like `Name.Builtin`). That means: When `regex` matches, emit a
-token with the match text and type `tokentype` and push `new_state` on the state
-stack. If the new state is ``'#pop'``, the topmost state is popped from the
-stack instead. To pop more than one state, use ``'#pop:2'`` and so on.
-``'#push'`` is a synonym for pushing the current state on the stack.
-
-The following example shows the `DiffLexer` from the builtin lexers. Note that
-it contains some additional attributes `name`, `aliases` and `filenames` which
-aren't required for a lexer. They are used by the builtin lexer lookup
-functions. ::
-
- from pygments.lexer import RegexLexer
- from pygments.token import *
-
- class DiffLexer(RegexLexer):
- name = 'Diff'
- aliases = ['diff']
- filenames = ['*.diff']
-
- tokens = {
- 'root': [
- (r' .*\n', Text),
- (r'\+.*\n', Generic.Inserted),
- (r'-.*\n', Generic.Deleted),
- (r'@.*\n', Generic.Subheading),
- (r'Index.*\n', Generic.Heading),
- (r'=.*\n', Generic.Heading),
- (r'.*\n', Text),
- ]
- }
-
-As you can see this lexer only uses one state. When the lexer starts scanning
-the text, it first checks if the current character is a space. If this is true
-it scans everything until newline and returns the data as a `Text` token (which
-is the "no special highlighting" token).
-
-If this rule doesn't match, it checks if the current char is a plus sign. And
-so on.
-
-If no rule matches at the current position, the current char is emitted as an
-`Error` token that indicates a lexing error, and the position is increased by
-one.
-
-
-Adding and testing a new lexer
-==============================
-
-The easiest way to use a new lexer is to use Pygments' support for loading
-the lexer from a file relative to your current directory.
-
-First, change the name of your lexer class to CustomLexer:
-
-.. code-block:: python
-
- from pygments.lexer import RegexLexer
- from pygments.token import *
-
- class CustomLexer(RegexLexer):
- """All your lexer code goes here!"""
-
-Then you can load the lexer from the command line with the additional
-flag ``-x``:
-
-.. code-block:: console
-
- $ pygmentize -l your_lexer_file.py -x
-
-To specify a class name other than CustomLexer, append it with a colon:
-
-.. code-block:: console
-
- $ pygmentize -l your_lexer.py:SomeLexer -x
-
-Or, using the Python API:
-
-.. code-block:: python
-
- # For a lexer named CustomLexer
- your_lexer = load_lexer_from_file(filename, **options)
-
- # For a lexer named MyNewLexer
- your_named_lexer = load_lexer_from_file(filename, "MyNewLexer", **options)
-
-When loading custom lexers and formatters, be extremely careful to use only
-trusted files; Pygments will perform the equivalent of ``eval`` on them.
-
-If you only want to use your lexer with the Pygments API, you can import and
-instantiate the lexer yourself, then pass it to :func:`pygments.highlight`.
-
-To prepare your new lexer for inclusion in the Pygments distribution, so that it
-will be found when passing filenames or lexer aliases from the command line, you
-have to perform the following steps.
-
-First, change to the current directory containing the Pygments source code. You
-will need to have either an unpacked source tarball, or (preferably) a copy
-cloned from BitBucket.
-
-.. code-block:: console
-
- $ cd .../pygments-main
-
-Select a matching module under ``pygments/lexers``, or create a new module for
-your lexer class.
-
-Next, make sure the lexer is known from outside of the module. All modules in
-the ``pygments.lexers`` package specify ``__all__``. For example,
-``esoteric.py`` sets::
-
- __all__ = ['BrainfuckLexer', 'BefungeLexer', ...]
-
-Add the name of your lexer class to this list (or create the list if your lexer
-is the only class in the module).
-
-Finally the lexer can be made publicly known by rebuilding the lexer mapping:
-
-.. code-block:: console
-
- $ make mapfiles
-
-To test the new lexer, store an example file with the proper extension in
-``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
-``tests/examplefiles/example.diff`` containing a sample diff output.
-
-Now you can use pygmentize to render your example to HTML:
-
-.. code-block:: console
-
- $ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
-
-Note that this explicitly calls the ``pygmentize`` in the current directory
-by preceding it with ``./``. This ensures your modifications are used.
-Otherwise a possibly already installed, unmodified version without your new
-lexer would have been called from the system search path (``$PATH``).
-
-To view the result, open ``/tmp/example.html`` in your browser.
-
-Once the example renders as expected, you should run the complete test suite:
-
-.. code-block:: console
-
- $ make test
-
-It also tests that your lexer fulfills the lexer API and certain invariants,
-such as that the concatenation of all token text is the same as the input text.
-
-
-Regex Flags
-===========
-
-You can either define regex flags locally in the regex (``r'(?x)foo bar'``) or
-globally by adding a `flags` attribute to your lexer class. If no attribute is
-defined, it defaults to `re.MULTILINE`. For more information about regular
-expression flags see the page about `regular expressions`_ in the Python
-documentation.
-
-.. _regular expressions: http://docs.python.org/library/re.html#regular-expression-syntax
-
-
-Scanning multiple tokens at once
-================================
-
-So far, the `action` element in the rule tuple of regex, action and state has
-been a single token type. Now we look at the first of several other possible
-values.
-
-Here is a more complex lexer that highlights INI files. INI files consist of
-sections, comments and ``key = value`` pairs::
-
- from pygments.lexer import RegexLexer, bygroups
- from pygments.token import *
-
- class IniLexer(RegexLexer):
- name = 'INI'
- aliases = ['ini', 'cfg']
- filenames = ['*.ini', '*.cfg']
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r';.*?$', Comment),
- (r'\[.*?\]$', Keyword),
- (r'(.*?)(\s*)(=)(\s*)(.*?)$',
- bygroups(Name.Attribute, Text, Operator, Text, String))
- ]
- }
-
-The lexer first looks for whitespace, comments and section names. Later it
-looks for a line that looks like a key, value pair, separated by an ``'='``
-sign, and optional whitespace.
-
-The `bygroups` helper yields each capturing group in the regex with a different
-token type. First the `Name.Attribute` token, then a `Text` token for the
-optional whitespace, after that a `Operator` token for the equals sign. Then a
-`Text` token for the whitespace again. The rest of the line is returned as
-`String`.
-
-Note that for this to work, every part of the match must be inside a capturing
-group (a ``(...)``), and there must not be any nested capturing groups. If you
-nevertheless need a group, use a non-capturing group defined using this syntax:
-``(?:some|words|here)`` (note the ``?:`` after the beginning parenthesis).
-
-If you find yourself needing a capturing group inside the regex which shouldn't
-be part of the output but is used in the regular expressions for backreferencing
-(eg: ``r'(<(foo|bar)>)(.*?)(</\2>)'``), you can pass `None` to the bygroups
-function and that group will be skipped in the output.
-
-
-Changing states
-===============
-
-Many lexers need multiple states to work as expected. For example, some
-languages allow multiline comments to be nested. Since this is a recursive
-pattern it's impossible to lex just using regular expressions.
-
-Here is a lexer that recognizes C++ style comments (multi-line with ``/* */``
-and single-line with ``//`` until end of line)::
-
- from pygments.lexer import RegexLexer
- from pygments.token import *
-
- class CppCommentLexer(RegexLexer):
- name = 'Example Lexer with states'
-
- tokens = {
- 'root': [
- (r'[^/]+', Text),
- (r'/\*', Comment.Multiline, 'comment'),
- (r'//.*?$', Comment.Singleline),
- (r'/', Text)
- ],
- 'comment': [
- (r'[^*/]', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ]
- }
-
-This lexer starts lexing in the ``'root'`` state. It tries to match as much as
-possible until it finds a slash (``'/'``). If the next character after the slash
-is an asterisk (``'*'``) the `RegexLexer` sends those two characters to the
-output stream marked as `Comment.Multiline` and continues lexing with the rules
-defined in the ``'comment'`` state.
-
-If there wasn't an asterisk after the slash, the `RegexLexer` checks if it's a
-Singleline comment (i.e. followed by a second slash). If this also wasn't the
-case it must be a single slash, which is not a comment starter (the separate
-regex for a single slash must also be given, else the slash would be marked as
-an error token).
-
-Inside the ``'comment'`` state, we do the same thing again. Scan until the
-lexer finds a star or slash. If it's the opening of a multiline comment, push
-the ``'comment'`` state on the stack and continue scanning, again in the
-``'comment'`` state. Else, check if it's the end of the multiline comment. If
-yes, pop one state from the stack.
-
-Note: If you pop from an empty stack you'll get an `IndexError`. (There is an
-easy way to prevent this from happening: don't ``'#pop'`` in the root state).
-
-If the `RegexLexer` encounters a newline that is flagged as an error token, the
-stack is emptied and the lexer continues scanning in the ``'root'`` state. This
-can help producing error-tolerant highlighting for erroneous input, e.g. when a
-single-line string is not closed.
-
-
-Advanced state tricks
-=====================
-
-There are a few more things you can do with states:
-
-- You can push multiple states onto the stack if you give a tuple instead of a
- simple string as the third item in a rule tuple. For example, if you want to
- match a comment containing a directive, something like:
-
- .. code-block:: text
-
- /* <processing directive> rest of comment */
-
- you can use this rule::
-
- tokens = {
- 'root': [
- (r'/\* <', Comment, ('comment', 'directive')),
- ...
- ],
- 'directive': [
- (r'[^>]*', Comment.Directive),
- (r'>', Comment, '#pop'),
- ],
- 'comment': [
- (r'[^*]+', Comment),
- (r'\*/', Comment, '#pop'),
- (r'\*', Comment),
- ]
- }
-
- When this encounters the above sample, first ``'comment'`` and ``'directive'``
- are pushed onto the stack, then the lexer continues in the directive state
- until it finds the closing ``>``, then it continues in the comment state until
- the closing ``*/``. Then, both states are popped from the stack again and
- lexing continues in the root state.
-
- .. versionadded:: 0.9
- The tuple can contain the special ``'#push'`` and ``'#pop'`` (but not
- ``'#pop:n'``) directives.
-
-
-- You can include the rules of a state in the definition of another. This is
- done by using `include` from `pygments.lexer`::
-
- from pygments.lexer import RegexLexer, bygroups, include
- from pygments.token import *
-
- class ExampleLexer(RegexLexer):
- tokens = {
- 'comments': [
- (r'/\*.*?\*/', Comment),
- (r'//.*?\n', Comment),
- ],
- 'root': [
- include('comments'),
- (r'(function )(\w+)( {)',
- bygroups(Keyword, Name, Keyword), 'function'),
- (r'.', Text),
- ],
- 'function': [
- (r'[^}/]+', Text),
- include('comments'),
- (r'/', Text),
- (r'\}', Keyword, '#pop'),
- ]
- }
-
- This is a hypothetical lexer for a language that consist of functions and
- comments. Because comments can occur at toplevel and in functions, we need
- rules for comments in both states. As you can see, the `include` helper saves
- repeating rules that occur more than once (in this example, the state
- ``'comment'`` will never be entered by the lexer, as it's only there to be
- included in ``'root'`` and ``'function'``).
-
-- Sometimes, you may want to "combine" a state from existing ones. This is
- possible with the `combined` helper from `pygments.lexer`.
-
- If you, instead of a new state, write ``combined('state1', 'state2')`` as the
- third item of a rule tuple, a new anonymous state will be formed from state1
- and state2 and if the rule matches, the lexer will enter this state.
-
- This is not used very often, but can be helpful in some cases, such as the
- `PythonLexer`'s string literal processing.
-
-- If you want your lexer to start lexing in a different state you can modify the
- stack by overriding the `get_tokens_unprocessed()` method::
-
- from pygments.lexer import RegexLexer
-
- class ExampleLexer(RegexLexer):
- tokens = {...}
-
- def get_tokens_unprocessed(self, text, stack=('root', 'otherstate')):
- for item in RegexLexer.get_tokens_unprocessed(self, text, stack):
- yield item
-
- Some lexers like the `PhpLexer` use this to make the leading ``<?php``
- preprocessor comments optional. Note that you can crash the lexer easily by
- putting values into the stack that don't exist in the token map. Also
- removing ``'root'`` from the stack can result in strange errors!
-
-- In some lexers, a state should be popped if anything is encountered that isn't
- matched by a rule in the state. You could use an empty regex at the end of
- the state list, but Pygments provides a more obvious way of spelling that:
- ``default('#pop')`` is equivalent to ``('', Text, '#pop')``.
-
- .. versionadded:: 2.0
-
-
-Subclassing lexers derived from RegexLexer
-==========================================
-
-.. versionadded:: 1.6
-
-Sometimes multiple languages are very similar, but should still be lexed by
-different lexer classes.
-
-When subclassing a lexer derived from RegexLexer, the ``tokens`` dictionaries
-defined in the parent and child class are merged. For example::
-
- from pygments.lexer import RegexLexer, inherit
- from pygments.token import *
-
- class BaseLexer(RegexLexer):
- tokens = {
- 'root': [
- ('[a-z]+', Name),
- (r'/\*', Comment, 'comment'),
- ('"', String, 'string'),
- ('\s+', Text),
- ],
- 'string': [
- ('[^"]+', String),
- ('"', String, '#pop'),
- ],
- 'comment': [
- ...
- ],
- }
-
- class DerivedLexer(BaseLexer):
- tokens = {
- 'root': [
- ('[0-9]+', Number),
- inherit,
- ],
- 'string': [
- (r'[^"\\]+', String),
- (r'\\.', String.Escape),
- ('"', String, '#pop'),
- ],
- }
-
-The `BaseLexer` defines two states, lexing names and strings. The
-`DerivedLexer` defines its own tokens dictionary, which extends the definitions
-of the base lexer:
-
-* The "root" state has an additional rule and then the special object `inherit`,
- which tells Pygments to insert the token definitions of the parent class at
- that point.
-
-* The "string" state is replaced entirely, since there is not `inherit` rule.
-
-* The "comment" state is inherited entirely.
-
-
-Using multiple lexers
-=====================
-
-Using multiple lexers for the same input can be tricky. One of the easiest
-combination techniques is shown here: You can replace the action entry in a rule
-tuple with a lexer class. The matched text will then be lexed with that lexer,
-and the resulting tokens will be yielded.
-
-For example, look at this stripped-down HTML lexer::
-
- from pygments.lexer import RegexLexer, bygroups, using
- from pygments.token import *
- from pygments.lexers.javascript import JavascriptLexer
-
- class HtmlLexer(RegexLexer):
- name = 'HTML'
- aliases = ['html']
- filenames = ['*.html', '*.htm']
-
- flags = re.IGNORECASE | re.DOTALL
- tokens = {
- 'root': [
- ('[^<&]+', Text),
- ('&.*?;', Name.Entity),
- (r'<\s*script\s*', Name.Tag, ('script-content', 'tag')),
- (r'<\s*[a-zA-Z0-9:]+', Name.Tag, 'tag'),
- (r'<\s*/\s*[a-zA-Z0-9:]+\s*>', Name.Tag),
- ],
- 'script-content': [
- (r'(.+?)(<\s*/\s*script\s*>)',
- bygroups(using(JavascriptLexer), Name.Tag),
- '#pop'),
- ]
- }
-
-Here the content of a ``<script>`` tag is passed to a newly created instance of
-a `JavascriptLexer` and not processed by the `HtmlLexer`. This is done using
-the `using` helper that takes the other lexer class as its parameter.
-
-Note the combination of `bygroups` and `using`. This makes sure that the
-content up to the ``</script>`` end tag is processed by the `JavascriptLexer`,
-while the end tag is yielded as a normal token with the `Name.Tag` type.
-
-Also note the ``(r'<\s*script\s*', Name.Tag, ('script-content', 'tag'))`` rule.
-Here, two states are pushed onto the state stack, ``'script-content'`` and
-``'tag'``. That means that first ``'tag'`` is processed, which will lex
-attributes and the closing ``>``, then the ``'tag'`` state is popped and the
-next state on top of the stack will be ``'script-content'``.
-
-Since you cannot refer to the class currently being defined, use `this`
-(imported from `pygments.lexer`) to refer to the current lexer class, i.e.
-``using(this)``. This construct may seem unnecessary, but this is often the
-most obvious way of lexing arbitrary syntax between fixed delimiters without
-introducing deeply nested states.
-
-The `using()` helper has a special keyword argument, `state`, which works as
-follows: if given, the lexer to use initially is not in the ``"root"`` state,
-but in the state given by this argument. This does not work with advanced
-`RegexLexer` subclasses such as `ExtendedRegexLexer` (see below).
-
-Any other keywords arguments passed to `using()` are added to the keyword
-arguments used to create the lexer.
-
-
-Delegating Lexer
-================
-
-Another approach for nested lexers is the `DelegatingLexer` which is for example
-used for the template engine lexers. It takes two lexers as arguments on
-initialisation: a `root_lexer` and a `language_lexer`.
-
-The input is processed as follows: First, the whole text is lexed with the
-`language_lexer`. All tokens yielded with the special type of ``Other`` are
-then concatenated and given to the `root_lexer`. The language tokens of the
-`language_lexer` are then inserted into the `root_lexer`'s token stream at the
-appropriate positions. ::
-
- from pygments.lexer import DelegatingLexer
- from pygments.lexers.web import HtmlLexer, PhpLexer
-
- class HtmlPhpLexer(DelegatingLexer):
- def __init__(self, **options):
- super(HtmlPhpLexer, self).__init__(HtmlLexer, PhpLexer, **options)
-
-This procedure ensures that e.g. HTML with template tags in it is highlighted
-correctly even if the template tags are put into HTML tags or attributes.
-
-If you want to change the needle token ``Other`` to something else, you can give
-the lexer another token type as the third parameter::
-
- DelegatingLexer.__init__(MyLexer, OtherLexer, Text, **options)
-
-
-Callbacks
-=========
-
-Sometimes the grammar of a language is so complex that a lexer would be unable
-to process it just by using regular expressions and stacks.
-
-For this, the `RegexLexer` allows callbacks to be given in rule tuples, instead
-of token types (`bygroups` and `using` are nothing else but preimplemented
-callbacks). The callback must be a function taking two arguments:
-
-* the lexer itself
-* the match object for the last matched rule
-
-The callback must then return an iterable of (or simply yield) ``(index,
-tokentype, value)`` tuples, which are then just passed through by
-`get_tokens_unprocessed()`. The ``index`` here is the position of the token in
-the input string, ``tokentype`` is the normal token type (like `Name.Builtin`),
-and ``value`` the associated part of the input string.
-
-You can see an example here::
-
- from pygments.lexer import RegexLexer
- from pygments.token import Generic
-
- class HypotheticLexer(RegexLexer):
-
- def headline_callback(lexer, match):
- equal_signs = match.group(1)
- text = match.group(2)
- yield match.start(), Generic.Headline, equal_signs + text + equal_signs
-
- tokens = {
- 'root': [
- (r'(=+)(.*?)(\1)', headline_callback)
- ]
- }
-
-If the regex for the `headline_callback` matches, the function is called with
-the match object. Note that after the callback is done, processing continues
-normally, that is, after the end of the previous match. The callback has no
-possibility to influence the position.
-
-There are not really any simple examples for lexer callbacks, but you can see
-them in action e.g. in the `SMLLexer` class in `ml.py`_.
-
-.. _ml.py: http://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/ml.py
-
-
-The ExtendedRegexLexer class
-============================
-
-The `RegexLexer`, even with callbacks, unfortunately isn't powerful enough for
-the funky syntax rules of languages such as Ruby.
-
-But fear not; even then you don't have to abandon the regular expression
-approach: Pygments has a subclass of `RegexLexer`, the `ExtendedRegexLexer`.
-All features known from RegexLexers are available here too, and the tokens are
-specified in exactly the same way, *except* for one detail:
-
-The `get_tokens_unprocessed()` method holds its internal state data not as local
-variables, but in an instance of the `pygments.lexer.LexerContext` class, and
-that instance is passed to callbacks as a third argument. This means that you
-can modify the lexer state in callbacks.
-
-The `LexerContext` class has the following members:
-
-* `text` -- the input text
-* `pos` -- the current starting position that is used for matching regexes
-* `stack` -- a list containing the state stack
-* `end` -- the maximum position to which regexes are matched, this defaults to
- the length of `text`
-
-Additionally, the `get_tokens_unprocessed()` method can be given a
-`LexerContext` instead of a string and will then process this context instead of
-creating a new one for the string argument.
-
-Note that because you can set the current position to anything in the callback,
-it won't be automatically be set by the caller after the callback is finished.
-For example, this is how the hypothetical lexer above would be written with the
-`ExtendedRegexLexer`::
-
- from pygments.lexer import ExtendedRegexLexer
- from pygments.token import Generic
-
- class ExHypotheticLexer(ExtendedRegexLexer):
-
- def headline_callback(lexer, match, ctx):
- equal_signs = match.group(1)
- text = match.group(2)
- yield match.start(), Generic.Headline, equal_signs + text + equal_signs
- ctx.pos = match.end()
-
- tokens = {
- 'root': [
- (r'(=+)(.*?)(\1)', headline_callback)
- ]
- }
-
-This might sound confusing (and it can really be). But it is needed, and for an
-example look at the Ruby lexer in `ruby.py`_.
-
-.. _ruby.py: https://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/ruby.py
-
-
-Handling Lists of Keywords
-==========================
-
-For a relatively short list (hundreds) you can construct an optimized regular
-expression directly using ``words()`` (longer lists, see next section). This
-function handles a few things for you automatically, including escaping
-metacharacters and Python's first-match rather than longest-match in
-alternations. Feel free to put the lists themselves in
-``pygments/lexers/_$lang_builtins.py`` (see examples there), and generated by
-code if possible.
-
-An example of using ``words()`` is something like::
-
- from pygments.lexer import RegexLexer, words, Name
-
- class MyLexer(RegexLexer):
-
- tokens = {
- 'root': [
- (words(('else', 'elseif'), suffix=r'\b'), Name.Builtin),
- (r'\w+', Name),
- ],
- }
-
-As you can see, you can add ``prefix`` and ``suffix`` parts to the constructed
-regex.
-
-
-Modifying Token Streams
-=======================
-
-Some languages ship a lot of builtin functions (for example PHP). The total
-amount of those functions differs from system to system because not everybody
-has every extension installed. In the case of PHP there are over 3000 builtin
-functions. That's an incredibly huge amount of functions, much more than you
-want to put into a regular expression.
-
-But because only `Name` tokens can be function names this is solvable by
-overriding the ``get_tokens_unprocessed()`` method. The following lexer
-subclasses the `PythonLexer` so that it highlights some additional names as
-pseudo keywords::
-
- from pygments.lexers.python import PythonLexer
- from pygments.token import Name, Keyword
-
- class MyPythonLexer(PythonLexer):
- EXTRA_KEYWORDS = set(('foo', 'bar', 'foobar', 'barfoo', 'spam', 'eggs'))
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in PythonLexer.get_tokens_unprocessed(self, text):
- if token is Name and value in self.EXTRA_KEYWORDS:
- yield index, Keyword.Pseudo, value
- else:
- yield index, token, value
-
-The `PhpLexer` and `LuaLexer` use this method to resolve builtin functions.
diff --git a/doc/docs/lexers.rst b/doc/docs/lexers.rst
deleted file mode 100644
index ef40f140..00000000
--- a/doc/docs/lexers.rst
+++ /dev/null
@@ -1,69 +0,0 @@
-.. -*- mode: rst -*-
-
-================
-Available lexers
-================
-
-This page lists all available builtin lexers and the options they take.
-
-Currently, **all lexers** support these options:
-
-`stripnl`
- Strip leading and trailing newlines from the input (default: ``True``)
-
-`stripall`
- Strip all leading and trailing whitespace from the input (default:
- ``False``).
-
-`ensurenl`
- Make sure that the input ends with a newline (default: ``True``). This
- is required for some lexers that consume input linewise.
-
- .. versionadded:: 1.3
-
-`tabsize`
- If given and greater than 0, expand tabs in the input (default: ``0``).
-
-`encoding`
- If given, must be an encoding name (such as ``"utf-8"``). This encoding
- will be used to convert the input string to Unicode (if it is not already
- a Unicode string). The default is ``"guess"``.
-
- If this option is set to ``"guess"``, a simple UTF-8 vs. Latin-1
- detection is used, if it is set to ``"chardet"``, the
- `chardet library <https://chardet.github.io/>`_ is used to
- guess the encoding of the input.
-
- .. versionadded:: 0.6
-
-
-The "Short Names" field lists the identifiers that can be used with the
-`get_lexer_by_name()` function.
-
-These lexers are builtin and can be imported from `pygments.lexers`:
-
-.. pygmentsdoc:: lexers
-
-
-Iterating over all lexers
--------------------------
-
-.. versionadded:: 0.6
-
-To get all lexers (both the builtin and the plugin ones), you can
-use the `get_all_lexers()` function from the `pygments.lexers`
-module:
-
-.. sourcecode:: pycon
-
- >>> from pygments.lexers import get_all_lexers
- >>> i = get_all_lexers()
- >>> i.next()
- ('Diff', ('diff',), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch'))
- >>> i.next()
- ('Delphi', ('delphi', 'objectpascal', 'pas', 'pascal'), ('*.pas',), ('text/x-pascal',))
- >>> i.next()
- ('XML+Ruby', ('xml+erb', 'xml+ruby'), (), ())
-
-As you can see, the return value is an iterator which yields tuples
-in the form ``(name, aliases, filetypes, mimetypes)``.
diff --git a/doc/docs/moinmoin.rst b/doc/docs/moinmoin.rst
deleted file mode 100644
index 8b2216b3..00000000
--- a/doc/docs/moinmoin.rst
+++ /dev/null
@@ -1,39 +0,0 @@
-.. -*- mode: rst -*-
-
-============================
-Using Pygments with MoinMoin
-============================
-
-From Pygments 0.7, the source distribution ships a `Moin`_ parser plugin that
-can be used to get Pygments highlighting in Moin wiki pages.
-
-To use it, copy the file `external/moin-parser.py` from the Pygments
-distribution to the `data/plugin/parser` subdirectory of your Moin instance.
-Edit the options at the top of the file (currently ``ATTACHMENTS`` and
-``INLINESTYLES``) and rename the file to the name that the parser directive
-should have. For example, if you name the file ``code.py``, you can get a
-highlighted Python code sample with this Wiki markup::
-
- {{{
- #!code python
- [...]
- }}}
-
-where ``python`` is the Pygments name of the lexer to use.
-
-Additionally, if you set the ``ATTACHMENTS`` option to True, Pygments will also
-be called for all attachments for whose filenames there is no other parser
-registered.
-
-You are responsible for including CSS rules that will map the Pygments CSS
-classes to colors. You can output a stylesheet file with `pygmentize`, put it
-into the `htdocs` directory of your Moin instance and then include it in the
-`stylesheets` configuration option in the Moin config, e.g.::
-
- stylesheets = [('screen', '/htdocs/pygments.css')]
-
-If you do not want to do that and are willing to accept larger HTML output, you
-can set the ``INLINESTYLES`` option to True.
-
-
-.. _Moin: http://moinmoin.wikiwikiweb.de/
diff --git a/doc/docs/plugins.rst b/doc/docs/plugins.rst
deleted file mode 100644
index a6f8d7b0..00000000
--- a/doc/docs/plugins.rst
+++ /dev/null
@@ -1,93 +0,0 @@
-================
-Register Plugins
-================
-
-If you want to extend Pygments without hacking the sources, but want to
-use the lexer/formatter/style/filter lookup functions (`lexers.get_lexer_by_name`
-et al.), you can use `setuptools`_ entrypoints to add new lexers, formatters
-or styles as if they were in the Pygments core.
-
-.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
-
-That means you can use your highlighter modules with the `pygmentize` script,
-which relies on the mentioned functions.
-
-
-Entrypoints
-===========
-
-Here is a list of setuptools entrypoints that Pygments understands:
-
-`pygments.lexers`
-
- This entrypoint is used for adding new lexers to the Pygments core.
- The name of the entrypoint values doesn't really matter, Pygments extracts
- required metadata from the class definition:
-
- .. sourcecode:: ini
-
- [pygments.lexers]
- yourlexer = yourmodule:YourLexer
-
- Note that you have to define ``name``, ``aliases`` and ``filename``
- attributes so that you can use the highlighter from the command line:
-
- .. sourcecode:: python
-
- class YourLexer(...):
- name = 'Name Of Your Lexer'
- aliases = ['alias']
- filenames = ['*.ext']
-
-
-`pygments.formatters`
-
- You can use this entrypoint to add new formatters to Pygments. The
- name of an entrypoint item is the name of the formatter. If you
- prefix the name with a slash it's used as a filename pattern:
-
- .. sourcecode:: ini
-
- [pygments.formatters]
- yourformatter = yourmodule:YourFormatter
- /.ext = yourmodule:YourFormatter
-
-
-`pygments.styles`
-
- To add a new style you can use this entrypoint. The name of the entrypoint
- is the name of the style:
-
- .. sourcecode:: ini
-
- [pygments.styles]
- yourstyle = yourmodule:YourStyle
-
-
-`pygments.filters`
-
- Use this entrypoint to register a new filter. The name of the
- entrypoint is the name of the filter:
-
- .. sourcecode:: ini
-
- [pygments.filters]
- yourfilter = yourmodule:YourFilter
-
-
-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.
-
-.. _setuptools documentation: http://peak.telecommunity.com/DevCenter/setuptools
-
-
-Extending The Core
-==================
-
-If you have written a Pygments plugin that is open source, please inform us
-about that. There is a high chance that we'll add it to the Pygments
-distribution.
diff --git a/doc/docs/quickstart.rst b/doc/docs/quickstart.rst
deleted file mode 100644
index 3a823e7f..00000000
--- a/doc/docs/quickstart.rst
+++ /dev/null
@@ -1,205 +0,0 @@
-.. -*- mode: rst -*-
-
-===========================
-Introduction and Quickstart
-===========================
-
-
-Welcome to Pygments! This document explains the basic concepts and terms and
-gives a few examples of how to use the library.
-
-
-Architecture
-============
-
-There are four types of components that work together highlighting a piece of
-code:
-
-* A **lexer** splits the source into tokens, fragments of the source that
- have a token type that determines what the text represents semantically
- (e.g., keyword, string, or comment). There is a lexer for every language
- or markup format that Pygments supports.
-* The token stream can be piped through **filters**, which usually modify
- the token types or text fragments, e.g. uppercasing all keywords.
-* A **formatter** then takes the token stream and writes it to an output
- file, in a format such as HTML, LaTeX or RTF.
-* While writing the output, a **style** determines how to highlight all the
- different token types. It maps them to attributes like "red and bold".
-
-
-Example
-=======
-
-Here is a small example for highlighting Python code:
-
-.. sourcecode:: python
-
- from pygments import highlight
- from pygments.lexers import PythonLexer
- from pygments.formatters import HtmlFormatter
-
- code = 'print "Hello World"'
- print(highlight(code, PythonLexer(), HtmlFormatter()))
-
-which prints something like this:
-
-.. sourcecode:: html
-
- <div class="highlight">
- <pre><span class="k">print</span> <span class="s">&quot;Hello World&quot;</span></pre>
- </div>
-
-As you can see, Pygments uses CSS classes (by default, but you can change that)
-instead of inline styles in order to avoid outputting redundant style information over
-and over. A CSS stylesheet that contains all CSS classes possibly used in the output
-can be produced by:
-
-.. sourcecode:: python
-
- print(HtmlFormatter().get_style_defs('.highlight'))
-
-The argument to :func:`get_style_defs` is used as an additional CSS selector:
-the output may look like this:
-
-.. sourcecode:: css
-
- .highlight .k { color: #AA22FF; font-weight: bold }
- .highlight .s { color: #BB4444 }
- ...
-
-
-Options
-=======
-
-The :func:`highlight()` function supports a fourth argument called *outfile*, it
-must be a file object if given. The formatted output will then be written to
-this file instead of being returned as a string.
-
-Lexers and formatters both support options. They are given to them as keyword
-arguments either to the class or to the lookup method:
-
-.. sourcecode:: python
-
- from pygments import highlight
- from pygments.lexers import get_lexer_by_name
- from pygments.formatters import HtmlFormatter
-
- lexer = get_lexer_by_name("python", stripall=True)
- formatter = HtmlFormatter(linenos=True, cssclass="source")
- result = highlight(code, lexer, formatter)
-
-This makes the lexer strip all leading and trailing whitespace from the input
-(`stripall` option), lets the formatter output line numbers (`linenos` option),
-and sets the wrapping ``<div>``'s class to ``source`` (instead of
-``highlight``).
-
-Important options include:
-
-`encoding` : for lexers and formatters
- Since Pygments uses Unicode strings internally, this determines which
- encoding will be used to convert to or from byte strings.
-`style` : for formatters
- The name of the style to use when writing the output.
-
-
-For an overview of builtin lexers and formatters and their options, visit the
-:doc:`lexer <lexers>` and :doc:`formatters <formatters>` lists.
-
-For a documentation on filters, see :doc:`this page <filters>`.
-
-
-Lexer and formatter lookup
-==========================
-
-If you want to lookup a built-in lexer by its alias or a filename, you can use
-one of the following methods:
-
-.. sourcecode:: pycon
-
- >>> from pygments.lexers import (get_lexer_by_name,
- ... get_lexer_for_filename, get_lexer_for_mimetype)
-
- >>> get_lexer_by_name('python')
- <pygments.lexers.PythonLexer>
-
- >>> get_lexer_for_filename('spam.rb')
- <pygments.lexers.RubyLexer>
-
- >>> get_lexer_for_mimetype('text/x-perl')
- <pygments.lexers.PerlLexer>
-
-All these functions accept keyword arguments; they will be passed to the lexer
-as options.
-
-A similar API is available for formatters: use :func:`.get_formatter_by_name()`
-and :func:`.get_formatter_for_filename()` from the :mod:`pygments.formatters`
-module for this purpose.
-
-
-Guessing lexers
-===============
-
-If you don't know the content of the file, or you want to highlight a file
-whose extension is ambiguous, such as ``.html`` (which could contain plain HTML
-or some template tags), use these functions:
-
-.. sourcecode:: pycon
-
- >>> from pygments.lexers import guess_lexer, guess_lexer_for_filename
-
- >>> guess_lexer('#!/usr/bin/python\nprint "Hello World!"')
- <pygments.lexers.PythonLexer>
-
- >>> guess_lexer_for_filename('test.py', 'print "Hello World!"')
- <pygments.lexers.PythonLexer>
-
-:func:`.guess_lexer()` passes the given content to the lexer classes'
-:meth:`analyse_text()` method and returns the one for which it returns the
-highest number.
-
-All lexers have two different filename pattern lists: the primary and the
-secondary one. The :func:`.get_lexer_for_filename()` function only uses the
-primary list, whose entries are supposed to be unique among all lexers.
-:func:`.guess_lexer_for_filename()`, however, will first loop through all lexers
-and look at the primary and secondary filename patterns if the filename matches.
-If only one lexer matches, it is returned, else the guessing mechanism of
-:func:`.guess_lexer()` is used with the matching lexers.
-
-As usual, keyword arguments to these functions are given to the created lexer
-as options.
-
-
-Command line usage
-==================
-
-You can use Pygments from the command line, using the :program:`pygmentize`
-script::
-
- $ pygmentize test.py
-
-will highlight the Python file test.py using ANSI escape sequences
-(a.k.a. terminal colors) and print the result to standard output.
-
-To output HTML, use the ``-f`` option::
-
- $ pygmentize -f html -o test.html test.py
-
-to write an HTML-highlighted version of test.py to the file test.html.
-Note that it will only be a snippet of HTML, if you want a full HTML document,
-use the "full" option::
-
- $ pygmentize -f html -O full -o test.html test.py
-
-This will produce a full HTML document with included stylesheet.
-
-A style can be selected with ``-O style=<name>``.
-
-If you need a stylesheet for an existing HTML file using Pygments CSS classes,
-it can be created with::
-
- $ pygmentize -S default -f html > style.css
-
-where ``default`` is the style name.
-
-More options and tricks and be found in the :doc:`command line reference
-<cmdline>`.
diff --git a/doc/docs/rstdirective.rst b/doc/docs/rstdirective.rst
deleted file mode 100644
index c0d503b3..00000000
--- a/doc/docs/rstdirective.rst
+++ /dev/null
@@ -1,22 +0,0 @@
-.. -*- mode: rst -*-
-
-================================
-Using Pygments in ReST documents
-================================
-
-Many Python people use `ReST`_ for documentation their sourcecode, programs,
-scripts et cetera. This also means that documentation often includes sourcecode
-samples or snippets.
-
-You can easily enable Pygments support for your ReST texts using a custom
-directive -- this is also how this documentation displays source code.
-
-From Pygments 0.9, the directive is shipped in the distribution as
-`external/rst-directive.py`. You can copy and adapt this code to your liking.
-
-.. removed -- too confusing
- *Loosely related note:* The ReST lexer now recognizes ``.. sourcecode::`` and
- ``.. code::`` directives and highlights the contents in the specified language
- if the `handlecodeblocks` option is true.
-
-.. _ReST: http://docutils.sf.net/rst.html
diff --git a/doc/docs/styles.rst b/doc/docs/styles.rst
deleted file mode 100644
index 570293a5..00000000
--- a/doc/docs/styles.rst
+++ /dev/null
@@ -1,232 +0,0 @@
-.. -*- mode: rst -*-
-
-======
-Styles
-======
-
-Pygments comes with some builtin styles that work for both the HTML and
-LaTeX formatter.
-
-The builtin styles can be looked up with the `get_style_by_name` function:
-
-.. sourcecode:: pycon
-
- >>> from pygments.styles import get_style_by_name
- >>> get_style_by_name('colorful')
- <class 'pygments.styles.colorful.ColorfulStyle'>
-
-You can pass a instance of a `Style` class to a formatter as the `style`
-option in form of a string:
-
-.. sourcecode:: pycon
-
- >>> from pygments.styles import get_style_by_name
- >>> from pygments.formatters import HtmlFormatter
- >>> HtmlFormatter(style='colorful').style
- <class 'pygments.styles.colorful.ColorfulStyle'>
-
-Or you can also import your own style (which must be a subclass of
-`pygments.style.Style`) and pass it to the formatter:
-
-.. sourcecode:: pycon
-
- >>> from yourapp.yourmodule import YourStyle
- >>> from pygments.formatters import HtmlFormatter
- >>> HtmlFormatter(style=YourStyle).style
- <class 'yourapp.yourmodule.YourStyle'>
-
-
-Creating Own Styles
-===================
-
-So, how to create a style? All you have to do is to subclass `Style` and
-define some styles:
-
-.. sourcecode:: python
-
- from pygments.style import Style
- from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic
-
- class YourStyle(Style):
- default_style = ""
- styles = {
- Comment: 'italic #888',
- Keyword: 'bold #005',
- Name: '#f00',
- Name.Function: '#0f0',
- Name.Class: 'bold #0f0',
- String: 'bg:#eee #111'
- }
-
-That's it. There are just a few rules. When you define a style for `Name`
-the style automatically also affects `Name.Function` and so on. If you
-defined ``'bold'`` and you don't want boldface for a subtoken use ``'nobold'``.
-
-(Philosophy: the styles aren't written in CSS syntax since this way
-they can be used for a variety of formatters.)
-
-`default_style` is the style inherited by all token types.
-
-To make the style usable for Pygments, you must
-
-* either register it as a plugin (see :doc:`the plugin docs <plugins>`)
-* or drop it into the `styles` subpackage of your Pygments distribution one style
- class per style, where the file name is the style name and the class name is
- `StylenameClass`. For example, if your style should be called
- ``"mondrian"``, name the class `MondrianStyle`, put it into the file
- ``mondrian.py`` and this file into the ``pygments.styles`` subpackage
- directory.
-
-
-Style Rules
-===========
-
-Here a small overview of all allowed styles:
-
-``bold``
- render text as bold
-``nobold``
- don't render text as bold (to prevent subtokens being highlighted bold)
-``italic``
- render text italic
-``noitalic``
- don't render text as italic
-``underline``
- render text underlined
-``nounderline``
- don't render text underlined
-``bg:``
- transparent background
-``bg:#000000``
- background color (black)
-``border:``
- no border
-``border:#ffffff``
- border color (white)
-``#ff0000``
- text color (red)
-``noinherit``
- don't inherit styles from supertoken
-
-Note that there may not be a space between ``bg:`` and the color value
-since the style definition string is split at whitespace.
-Also, using named colors is not allowed since the supported color names
-vary for different formatters.
-
-Furthermore, not all lexers might support every style.
-
-
-Builtin Styles
-==============
-
-Pygments ships some builtin styles which are maintained by the Pygments team.
-
-To get a list of known styles you can use this snippet:
-
-.. sourcecode:: pycon
-
- >>> from pygments.styles import STYLE_MAP
- >>> STYLE_MAP.keys()
- ['default', 'emacs', 'friendly', 'colorful']
-
-
-Getting a list of available styles
-==================================
-
-.. versionadded:: 0.6
-
-Because it could be that a plugin registered a style, there is
-a way to iterate over all styles:
-
-.. sourcecode:: pycon
-
- >>> from pygments.styles import get_all_styles
- >>> styles = list(get_all_styles())
-
-
-.. _AnsiTerminalStyle:
-
-Terminal Styles
-===============
-
-.. versionadded:: 2.2
-
-Custom styles used with the 256-color terminal formatter can also map colors to
-use the 8 default ANSI colors. To do so, use ``ansigreen``, ``ansibrightred`` or
-any other colors defined in :attr:`pygments.style.ansicolors`. Foreground ANSI
-colors will be mapped to the corresponding `escape codes 30 to 37
-<https://en.wikipedia.org/wiki/ANSI_escape_code#Colors>`_ thus respecting any
-custom color mapping and themes provided by many terminal emulators. Light
-variants are treated as foreground color with and an added bold flag.
-``bg:ansi<color>`` will also be respected, except the light variant will be the
-same shade as their dark variant.
-
-See the following example where the color of the string ``"hello world"`` is
-governed by the escape sequence ``\x1b[34;01m`` (Ansi bright blue, Bold, 41 being red
-background) instead of an extended foreground & background color.
-
-.. sourcecode:: pycon
-
- >>> from pygments import highlight
- >>> from pygments.style import Style
- >>> from pygments.token import Token
- >>> from pygments.lexers import Python3Lexer
- >>> from pygments.formatters import Terminal256Formatter
-
- >>> class MyStyle(Style):
- styles = {
- Token.String: 'ansibrightblue bg:ansibrightred',
- }
-
- >>> code = 'print("Hello World")'
- >>> result = highlight(code, Python3Lexer(), Terminal256Formatter(style=MyStyle))
- >>> print(result.encode())
- b'\x1b[34;41;01m"\x1b[39;49;00m\x1b[34;41;01mHello World\x1b[39;49;00m\x1b[34;41;01m"\x1b[39;49;00m'
-
-Colors specified using ``ansi*`` are converted to a default set of RGB colors
-when used with formatters other than the terminal-256 formatter.
-
-By definition of ANSI, the following colors are considered "light" colors, and
-will be rendered by most terminals as bold:
-
-- "brightblack" (darkgrey), "brightred", "brightgreen", "brightyellow", "brightblue",
- "brightmagenta", "brightcyan", "white"
-
-The following are considered "dark" colors and will be rendered as non-bold:
-
-- "black", "red", "green", "yellow", "blue", "magenta", "cyan",
- "gray"
-
-Exact behavior might depends on the terminal emulator you are using, and its
-settings.
-
-.. _new-ansi-color-names:
-
-.. versionchanged:: 2.4
-
-The definition of the ANSI color names has changed.
-New names are easier to understand and align to the colors used in other projects.
-
-===================== ====================
-New names Pygments up to 2.3
-===================== ====================
-``ansiblack`` ``#ansiblack``
-``ansired`` ``#ansidarkred``
-``ansigreen`` ``#ansidarkgreen``
-``ansiyellow`` ``#ansibrown``
-``ansiblue`` ``#ansidarkblue``
-``ansimagenta`` ``#ansipurple``
-``ansicyan`` ``#ansiteal``
-``ansigray`` ``#ansilightgray``
-``ansibrightblack`` ``#ansidarkgray``
-``ansibrightred`` ``#ansired``
-``ansibrightgreen`` ``#ansigreen``
-``ansibrightyellow`` ``#ansiyellow``
-``ansibrightblue`` ``#ansiblue``
-``ansibrightmagenta`` ``#ansifuchsia``
-``ansibrightcyan`` ``#ansiturquoise``
-``ansiwhite`` ``#ansiwhite``
-===================== ====================
-
-Old ANSI color names are deprecated but will still work.
diff --git a/doc/docs/tokens.rst b/doc/docs/tokens.rst
deleted file mode 100644
index 801fc638..00000000
--- a/doc/docs/tokens.rst
+++ /dev/null
@@ -1,372 +0,0 @@
-.. -*- mode: rst -*-
-
-==============
-Builtin Tokens
-==============
-
-.. module:: pygments.token
-
-In the :mod:`pygments.token` module, there is a special object called `Token`
-that is used to create token types.
-
-You can create a new token type by accessing an attribute of `Token`:
-
-.. sourcecode:: pycon
-
- >>> from pygments.token import Token
- >>> Token.String
- Token.String
- >>> Token.String is Token.String
- True
-
-Note that tokens are singletons so you can use the ``is`` operator for comparing
-token types.
-
-As of Pygments 0.7 you can also use the ``in`` operator to perform set tests:
-
-.. sourcecode:: pycon
-
- >>> from pygments.token import Comment
- >>> Comment.Single in Comment
- True
- >>> Comment in Comment.Multi
- False
-
-This can be useful in :doc:`filters <filters>` and if you write lexers on your
-own without using the base lexers.
-
-You can also split a token type into a hierarchy, and get the parent of it:
-
-.. sourcecode:: pycon
-
- >>> String.split()
- [Token, Token.Literal, Token.Literal.String]
- >>> String.parent
- Token.Literal
-
-In principle, you can create an unlimited number of token types but nobody can
-guarantee that a style would define style rules for a token type. Because of
-that, Pygments proposes some global token types defined in the
-`pygments.token.STANDARD_TYPES` dict.
-
-For some tokens aliases are already defined:
-
-.. sourcecode:: pycon
-
- >>> from pygments.token import String
- >>> String
- Token.Literal.String
-
-Inside the :mod:`pygments.token` module the following aliases are defined:
-
-============= ============================ ====================================
-`Text` `Token.Text` for any type of text data
-`Whitespace` `Token.Text.Whitespace` for specially highlighted whitespace
-`Error` `Token.Error` represents lexer errors
-`Other` `Token.Other` special token for data not
- matched by a parser (e.g. HTML
- markup in PHP code)
-`Keyword` `Token.Keyword` any kind of keywords
-`Name` `Token.Name` variable/function names
-`Literal` `Token.Literal` Any literals
-`String` `Token.Literal.String` string literals
-`Number` `Token.Literal.Number` number literals
-`Operator` `Token.Operator` operators (``+``, ``not``...)
-`Punctuation` `Token.Punctuation` punctuation (``[``, ``(``...)
-`Comment` `Token.Comment` any kind of comments
-`Generic` `Token.Generic` generic tokens (have a look at
- the explanation below)
-============= ============================ ====================================
-
-The `Whitespace` token type is new in Pygments 0.8. It is used only by the
-`VisibleWhitespaceFilter` currently.
-
-Normally you just create token types using the already defined aliases. For each
-of those token aliases, a number of subtypes exists (excluding the special tokens
-`Token.Text`, `Token.Error` and `Token.Other`)
-
-The `is_token_subtype()` function in the `pygments.token` module can be used to
-test if a token type is a subtype of another (such as `Name.Tag` and `Name`).
-(This is the same as ``Name.Tag in Name``. The overloaded `in` operator was newly
-introduced in Pygments 0.7, the function still exists for backwards
-compatibility.)
-
-With Pygments 0.7, it's also possible to convert strings to token types (for example
-if you want to supply a token from the command line):
-
-.. sourcecode:: pycon
-
- >>> from pygments.token import String, string_to_tokentype
- >>> string_to_tokentype("String")
- Token.Literal.String
- >>> string_to_tokentype("Token.Literal.String")
- Token.Literal.String
- >>> string_to_tokentype(String)
- Token.Literal.String
-
-
-Keyword Tokens
-==============
-
-`Keyword`
- For any kind of keyword (especially if it doesn't match any of the
- subtypes of course).
-
-`Keyword.Constant`
- For keywords that are constants (e.g. ``None`` in future Python versions).
-
-`Keyword.Declaration`
- For keywords used for variable declaration (e.g. ``var`` in some programming
- languages like JavaScript).
-
-`Keyword.Namespace`
- For keywords used for namespace declarations (e.g. ``import`` in Python and
- Java and ``package`` in Java).
-
-`Keyword.Pseudo`
- For keywords that aren't really keywords (e.g. ``None`` in old Python
- versions).
-
-`Keyword.Reserved`
- For reserved keywords.
-
-`Keyword.Type`
- For builtin types that can't be used as identifiers (e.g. ``int``,
- ``char`` etc. in C).
-
-
-Name Tokens
-===========
-
-`Name`
- For any name (variable names, function names, classes).
-
-`Name.Attribute`
- For all attributes (e.g. in HTML tags).
-
-`Name.Builtin`
- Builtin names; names that are available in the global namespace.
-
-`Name.Builtin.Pseudo`
- Builtin names that are implicit (e.g. ``self`` in Ruby, ``this`` in Java).
-
-`Name.Class`
- Class names. Because no lexer can know if a name is a class or a function
- or something else this token is meant for class declarations.
-
-`Name.Constant`
- Token type for constants. In some languages you can recognise a token by the
- way it's defined (the value after a ``const`` keyword for example). In
- other languages constants are uppercase by definition (Ruby).
-
-`Name.Decorator`
- Token type for decorators. Decorators are syntactic elements in the Python
- language. Similar syntax elements exist in C# and Java.
-
-`Name.Entity`
- Token type for special entities. (e.g. ``&nbsp;`` in HTML).
-
-`Name.Exception`
- Token type for exception names (e.g. ``RuntimeError`` in Python). Some languages
- define exceptions in the function signature (Java). You can highlight
- the name of that exception using this token then.
-
-`Name.Function`
- Token type for function names.
-
-`Name.Function.Magic`
- same as `Name.Function` but for special function names that have an implicit use
- in a language (e.g. ``__init__`` method in Python).
-
-`Name.Label`
- Token type for label names (e.g. in languages that support ``goto``).
-
-`Name.Namespace`
- Token type for namespaces. (e.g. import paths in Java/Python), names following
- the ``module``/``namespace`` keyword in other languages.
-
-`Name.Other`
- Other names. Normally unused.
-
-`Name.Tag`
- Tag names (in HTML/XML markup or configuration files).
-
-`Name.Variable`
- Token type for variables. Some languages have prefixes for variable names
- (PHP, Ruby, Perl). You can highlight them using this token.
-
-`Name.Variable.Class`
- same as `Name.Variable` but for class variables (also static variables).
-
-`Name.Variable.Global`
- same as `Name.Variable` but for global variables (used in Ruby, for
- example).
-
-`Name.Variable.Instance`
- same as `Name.Variable` but for instance variables.
-
-`Name.Variable.Magic`
- same as `Name.Variable` but for special variable names that have an implicit use
- in a language (e.g. ``__doc__`` in Python).
-
-
-Literals
-========
-
-`Literal`
- For any literal (if not further defined).
-
-`Literal.Date`
- for date literals (e.g. ``42d`` in Boo).
-
-
-`String`
- For any string literal.
-
-`String.Affix`
- Token type for affixes that further specify the type of the string they're
- attached to (e.g. the prefixes ``r`` and ``u8`` in ``r"foo"`` and ``u8"foo"``).
-
-`String.Backtick`
- Token type for strings enclosed in backticks.
-
-`String.Char`
- Token type for single characters (e.g. Java, C).
-
-`String.Delimiter`
- Token type for delimiting identifiers in "heredoc", raw and other similar
- strings (e.g. the word ``END`` in Perl code ``print <<'END';``).
-
-`String.Doc`
- Token type for documentation strings (for example Python).
-
-`String.Double`
- Double quoted strings.
-
-`String.Escape`
- Token type for escape sequences in strings.
-
-`String.Heredoc`
- Token type for "heredoc" strings (e.g. in Ruby or Perl).
-
-`String.Interpol`
- Token type for interpolated parts in strings (e.g. ``#{foo}`` in Ruby).
-
-`String.Other`
- Token type for any other strings (for example ``%q{foo}`` string constructs
- in Ruby).
-
-`String.Regex`
- Token type for regular expression literals (e.g. ``/foo/`` in JavaScript).
-
-`String.Single`
- Token type for single quoted strings.
-
-`String.Symbol`
- Token type for symbols (e.g. ``:foo`` in LISP or Ruby).
-
-
-`Number`
- Token type for any number literal.
-
-`Number.Bin`
- Token type for binary literals (e.g. ``0b101010``).
-
-`Number.Float`
- Token type for float literals (e.g. ``42.0``).
-
-`Number.Hex`
- Token type for hexadecimal number literals (e.g. ``0xdeadbeef``).
-
-`Number.Integer`
- Token type for integer literals (e.g. ``42``).
-
-`Number.Integer.Long`
- Token type for long integer literals (e.g. ``42L`` in Python).
-
-`Number.Oct`
- Token type for octal literals.
-
-
-Operators
-=========
-
-`Operator`
- For any punctuation operator (e.g. ``+``, ``-``).
-
-`Operator.Word`
- For any operator that is a word (e.g. ``not``).
-
-
-Punctuation
-===========
-
-.. versionadded:: 0.7
-
-`Punctuation`
- For any punctuation which is not an operator (e.g. ``[``, ``(``...)
-
-
-Comments
-========
-
-`Comment`
- Token type for any comment.
-
-`Comment.Hashbang`
- Token type for hashbang comments (i.e. first lines of files that start with
- ``#!``).
-
-`Comment.Multiline`
- Token type for multiline comments.
-
-`Comment.Preproc`
- Token type for preprocessor comments (also ``<?php``/``<%`` constructs).
-
-`Comment.Single`
- Token type for comments that end at the end of a line (e.g. ``# foo``).
-
-`Comment.Special`
- Special data in comments. For example code tags, author and license
- information, etc.
-
-
-Generic Tokens
-==============
-
-Generic tokens are for special lexers like the `DiffLexer` that doesn't really
-highlight a programming language but a patch file.
-
-
-`Generic`
- A generic, unstyled token. Normally you don't use this token type.
-
-`Generic.Deleted`
- Marks the token value as deleted.
-
-`Generic.Emph`
- Marks the token value as emphasized.
-
-`Generic.Error`
- Marks the token value as an error message.
-
-`Generic.Heading`
- Marks the token value as headline.
-
-`Generic.Inserted`
- Marks the token value as inserted.
-
-`Generic.Output`
- Marks the token value as program output (e.g. for python cli lexer).
-
-`Generic.Prompt`
- Marks the token value as command prompt (e.g. bash lexer).
-
-`Generic.Strong`
- Marks the token value as bold (e.g. for rst lexer).
-
-`Generic.Subheading`
- Marks the token value as subheadline.
-
-`Generic.Traceback`
- Marks the token value as a part of an error traceback.
diff --git a/doc/docs/unicode.rst b/doc/docs/unicode.rst
deleted file mode 100644
index dca91116..00000000
--- a/doc/docs/unicode.rst
+++ /dev/null
@@ -1,58 +0,0 @@
-=====================
-Unicode and Encodings
-=====================
-
-Since Pygments 0.6, all lexers use unicode strings internally. Because of that
-you might encounter the occasional :exc:`UnicodeDecodeError` if you pass strings
-with the wrong encoding.
-
-Per default all lexers have their input encoding set to `guess`. This means
-that the following encodings are tried:
-
-* UTF-8 (including BOM handling)
-* The locale encoding (i.e. the result of `locale.getpreferredencoding()`)
-* As a last resort, `latin1`
-
-If you pass a lexer a byte string object (not unicode), it tries to decode the
-data using this encoding.
-
-You can override the encoding using the `encoding` or `inencoding` lexer
-options. If you have the `chardet`_ library installed and set the encoding to
-``chardet`` if will analyse the text and use the encoding it thinks is the
-right one automatically:
-
-.. sourcecode:: python
-
- from pygments.lexers import PythonLexer
- lexer = PythonLexer(encoding='chardet')
-
-The best way is to pass Pygments unicode objects. In that case you can't get
-unexpected output.
-
-The formatters now send Unicode objects to the stream if you don't set the
-output encoding. You can do so by passing the formatters an `encoding` option:
-
-.. sourcecode:: python
-
- from pygments.formatters import HtmlFormatter
- f = HtmlFormatter(encoding='utf-8')
-
-**You will have to set this option if you have non-ASCII characters in the
-source and the output stream does not accept Unicode written to it!**
-This is the case for all regular files and for terminals.
-
-Note: The Terminal formatter tries to be smart: if its output stream has an
-`encoding` attribute, and you haven't set the option, it will encode any
-Unicode string with this encoding before writing it. This is the case for
-`sys.stdout`, for example. The other formatters don't have that behavior.
-
-Another note: If you call Pygments via the command line (`pygmentize`),
-encoding is handled differently, see :doc:`the command line docs <cmdline>`.
-
-.. versionadded:: 0.7
- The formatters now also accept an `outencoding` option which will override
- the `encoding` option if given. This makes it possible to use a single
- options dict with lexers and formatters, and still have different input and
- output encodings.
-
-.. _chardet: https://chardet.github.io/
diff --git a/doc/download.rst b/doc/download.rst
deleted file mode 100644
index cf32f481..00000000
--- a/doc/download.rst
+++ /dev/null
@@ -1,41 +0,0 @@
-Download and installation
-=========================
-
-The current release is version |version|.
-
-Packaged versions
------------------
-
-You can download it `from the Python Package Index
-<http://pypi.python.org/pypi/Pygments>`_. For installation of packages from
-PyPI, we recommend `Pip <http://www.pip-installer.org>`_, which works on all
-major platforms.
-
-Under Linux, most distributions include a package for Pygments, usually called
-``pygments`` or ``python-pygments``. You can install it with the package
-manager as usual.
-
-Development sources
--------------------
-
-We're using the `Mercurial <http://selenic.com/mercurial>`_ version control
-system. You can get the development source using this command::
-
- hg clone http://bitbucket.org/birkenfeld/pygments-main pygments
-
-Development takes place at `Bitbucket
-<http://bitbucket.org/birkenfeld/pygments-main>`_, you can browse the source
-online `here <http://bitbucket.org/birkenfeld/pygments-main/src>`_.
-
-The latest changes in the development source code are listed in the `changelog
-<http://bitbucket.org/birkenfeld/pygments-main/src/tip/CHANGES>`_.
-
-.. Documentation
- -------------
-
-.. XXX todo
-
- You can download the <a href="/docs/">documentation</a> either as
- a bunch of rst files from the Mercurial repository, see above, or
- as a tar.gz containing rendered HTML files:</p>
- <p><a href="/docs/download/pygmentsdocs.tar.gz">pygmentsdocs.tar.gz</a></p>
diff --git a/doc/faq.rst b/doc/faq.rst
deleted file mode 100644
index 172929e0..00000000
--- a/doc/faq.rst
+++ /dev/null
@@ -1,139 +0,0 @@
-:orphan:
-
-Pygments FAQ
-=============
-
-What is Pygments?
------------------
-
-Pygments is a syntax highlighting engine written in Python. That means, it will
-take source code (or other markup) in a supported language and output a
-processed version (in different formats) containing syntax highlighting markup.
-
-Its features include:
-
-* a wide range of common :doc:`languages and markup formats <languages>` is supported
-* new languages and formats are added easily
-* a number of output formats is available, including:
-
- - HTML
- - ANSI sequences (console output)
- - LaTeX
- - RTF
-
-* it is usable as a command-line tool and as a library
-* parsing and formatting is fast
-
-Pygments is licensed under the BSD license.
-
-Where does the name Pygments come from?
----------------------------------------
-
-*Py* of course stands for Python, while *pigments* are used for coloring paint,
-and in this case, source code!
-
-What are the system requirements?
----------------------------------
-
-Pygments only needs a standard Python install, version 2.7 or higher or version
-3.5 or higher for Python 3. No additional libraries are needed.
-
-How can I use Pygments?
------------------------
-
-Pygments is usable as a command-line tool as well as a library.
-
-From the command-line, usage looks like this (assuming the pygmentize script is
-properly installed)::
-
- pygmentize -f html /path/to/file.py
-
-This will print a HTML-highlighted version of /path/to/file.py to standard output.
-
-For a complete help, please run ``pygmentize -h``.
-
-Usage as a library is thoroughly demonstrated in the Documentation section.
-
-How do I make a new style?
---------------------------
-
-Please see the :doc:`documentation on styles <docs/styles>`.
-
-How can I report a bug or suggest a feature?
---------------------------------------------
-
-Please report bugs and feature wishes in the tracker at Bitbucket.
-
-You can also e-mail the author or use IRC, see the contact details.
-
-I want this support for this language!
---------------------------------------
-
-Instead of waiting for others to include language support, why not write it
-yourself? All you have to know is :doc:`outlined in the docs
-<docs/lexerdevelopment>`.
-
-Can I use Pygments for programming language processing?
--------------------------------------------------------
-
-The Pygments lexing machinery is quite powerful can be used to build lexers for
-basically all languages. However, parsing them is not possible, though some
-lexers go some steps in this direction in order to e.g. highlight function names
-differently.
-
-Also, error reporting is not the scope of Pygments. It focuses on correctly
-highlighting syntactically valid documents, not finding and compensating errors.
-
-Who uses Pygments?
-------------------
-
-This is an (incomplete) list of projects and sites known to use the Pygments highlighter.
-
-* `Wikipedia <http://en.wikipedia.org>`_
-* `BitBucket <http://bitbucket.org/>`_, a Mercurial and Git hosting site
-* `The Sphinx documentation builder <http://sphinx.pocoo.org/>`_, for embedded source examples
-* `rst2pdf <http://code.google.com/p/rst2pdf/>`_, a reStructuredText to PDF converter
-* `Codecov <http://codecov.io/>`_, a code coverage CI service
-* `Trac <http://trac.edgewall.org/>`_, the universal project management tool
-* `AsciiDoc <http://www.methods.co.nz/asciidoc/>`_, a text-based documentation generator
-* `ActiveState Code <http://code.activestate.com/>`_, the Python Cookbook successor
-* `ViewVC <http://viewvc.org/>`_, a web-based version control repository browser
-* `BzrFruit <http://repo.or.cz/w/bzrfruit.git>`_, a Bazaar branch viewer
-* `QBzr <http://bazaar-vcs.org/QBzr>`_, a cross-platform Qt-based GUI front end for Bazaar
-* `Review Board <http://www.review-board.org/>`_, a collaborative code reviewing tool
-* `Diamanda <http://code.google.com/p/diamanda/>`_, a Django powered wiki system with support for Pygments
-* `Progopedia <http://progopedia.ru/>`_ (`English <http://progopedia.com/>`_),
- an encyclopedia of programming languages
-* `Bruce <http://r1chardj0n3s.googlepages.com/bruce>`_, a reStructuredText presentation tool
-* `PIDA <http://pida.co.uk/>`_, a universal IDE written in Python
-* `BPython <http://www.noiseforfree.com/bpython/>`_, a curses-based intelligent Python shell
-* `PuDB <http://pypi.python.org/pypi/pudb>`_, a console Python debugger
-* `XWiki <http://www.xwiki.org/>`_, a wiki-based development framework in Java, using Jython
-* `roux <http://ananelson.com/software/roux/>`_, a script for running R scripts
- and creating beautiful output including graphs
-* `hurl <http://hurl.it/>`_, a web service for making HTTP requests
-* `wxHTMLPygmentizer <http://colinbarnette.net/projects/wxHTMLPygmentizer>`_ is
- a GUI utility, used to make code-colorization easier
-* `Postmarkup <http://code.google.com/p/postmarkup/>`_, a BBCode to XHTML generator
-* `WpPygments <http://blog.mirotin.net/?page_id=49>`_, and `WPygments
- <https://github.com/capynet/WPygments>`_, highlighter plugins for WordPress
-* `Siafoo <http://siafoo.net>`_, a tool for sharing and storing useful code and programming experience
-* `D source <http://www.dsource.org/>`_, a community for the D programming language
-* `dpaste.com <http://dpaste.com/>`_, another Django pastebin
-* `Django snippets <http://www.djangosnippets.org/>`_, a pastebin for Django code
-* `Fayaa <http://www.fayaa.com/code/>`_, a Chinese pastebin
-* `Incollo.com <http://incollo.com>`_, a free collaborative debugging tool
-* `PasteBox <http://p.boxnet.eu/>`_, a pastebin focused on privacy
-* `hilite.me <http://www.hilite.me/>`_, a site to highlight code snippets
-* `patx.me <http://patx.me/paste>`_, a pastebin
-* `Fluidic <https://github.com/richsmith/fluidic>`_, an experiment in
- integrating shells with a GUI
-* `pygments.rb <https://github.com/tmm1/pygments.rb>`_, a pygments wrapper for Ruby
-* `Clygments <https://github.com/bfontaine/clygments>`_, a pygments wrapper for
- Clojure
-* `PHPygments <https://github.com/capynet/PHPygments>`_, a pygments wrapper for PHP
-
-
-If you have a project or web site using Pygments, drop me a line, and I'll add a
-link here.
-
diff --git a/doc/index.rst b/doc/index.rst
deleted file mode 100644
index 26114045..00000000
--- a/doc/index.rst
+++ /dev/null
@@ -1,54 +0,0 @@
-Welcome!
-========
-
-This is the home of Pygments. It is a generic syntax highlighter suitable for
-use in code hosting, forums, wikis or other applications that need to prettify
-source code. Highlights are:
-
-* a wide range of over 300 languages and other text formats is supported
-* special attention is paid to details that increase highlighting quality
-* support for new languages and formats are added easily; most languages use a
- simple regex-based lexing mechanism
-* a number of output formats is available, among them HTML, RTF, LaTeX and ANSI
- sequences
-* it is usable as a command-line tool and as a library
-* ... and it highlights even Perl 6!
-
-Read more in the :doc:`FAQ list <faq>` or the :doc:`documentation <docs/index>`,
-or `download the latest release <http://pypi.python.org/pypi/Pygments>`_.
-
-.. _contribute:
-
-Contribute
-----------
-
-Like every open-source project, we are always looking for volunteers to help us
-with programming. Python knowledge is required, but don't fear: Python is a very
-clear and easy to learn language.
-
-Development takes place on `Bitbucket
-<https://bitbucket.org/birkenfeld/pygments-main>`_, where the Mercurial
-repository, tickets and pull requests can be viewed.
-
-Our primary communication instrument is the IRC channel **#pocoo** on the
-Freenode network. To join it, let your IRC client connect to
-``irc.freenode.net`` and do ``/join #pocoo``.
-
-If you found a bug, just open a ticket in the Bitbucket tracker. Be sure to log
-in to be notified when the issue is fixed -- development is not fast-paced as
-the library is quite stable. You can also send an e-mail to the developers, see
-below.
-
-The authors
------------
-
-Pygments is maintained by **Georg Brandl**, e-mail address *georg*\ *@*\ *python.org*.
-
-Many lexers and fixes have been contributed by **Armin Ronacher**, the rest of
-the `Pocoo <http://dev.pocoo.org/>`_ team and **Tim Hatch**.
-
-.. toctree::
- :maxdepth: 1
- :hidden:
-
- docs/index
diff --git a/doc/languages.rst b/doc/languages.rst
deleted file mode 100644
index b06ccc55..00000000
--- a/doc/languages.rst
+++ /dev/null
@@ -1,170 +0,0 @@
-:orphan:
-
-Supported languages
-===================
-
-Pygments supports an ever-growing range of languages. Watch this space...
-
-Programming languages
----------------------
-
-* ActionScript
-* Ada
-* ANTLR
-* AppleScript
-* Assembly (various)
-* Asymptote
-* `Augeas <http://augeas.net>`_
-* Awk
-* BBC Basic
-* Befunge
-* `Boa <http://boa.cs.iastate.edu/docs/index.php>`_
-* Boo
-* BrainFuck
-* C, C++
-* C#
-* `Charm++ CI <http://charmplusplus.org/>`_
-* Clojure
-* CoffeeScript
-* ColdFusion
-* Common Lisp
-* Coq
-* Cryptol (incl. Literate Cryptol)
-* `Crystal <http://crystal-lang.org>`_
-* `Cython <http://cython.org>`_
-* `D <http://dlang.org>`_
-* Dart
-* DCPU-16
-* Delphi
-* Dylan
-* `Elm <http://elm-lang.org/>`_
-* Erlang
-* `Ezhil <http://ezhillang.org>`_ Ezhil - A Tamil programming language
-* Factor
-* Fancy
-* `Fennel <https://fennel-lang.org/>`_
-* `FloScript <http://ioflo.com/>`_
-* Fortran
-* `FreeFEM++ <https://freefem.org/>`_
-* F#
-* GAP
-* Gherkin (Cucumber)
-* GL shaders
-* Groovy
-* `Haskell <http://www.haskell.org>`_ (incl. Literate Haskell)
-* HLSL
-* `HSpec <http://hackage.haskell.org/package/hspec>`_
-* IDL
-* Io
-* Java
-* JavaScript
-* Lasso
-* LLVM
-* Logtalk
-* `Lua <http://www.lua.org>`_
-* Matlab
-* MiniD
-* Modelica
-* Modula-2
-* MuPad
-* Nemerle
-* Nimrod
-* Objective-C
-* Objective-J
-* Octave
-* OCaml
-* PHP
-* `Perl 5 <http://perl.org>`_ and `Perl 6 <https://perl6.org>`_
-* `Pony <https://www.ponylang.io/>`_
-* PovRay
-* PostScript
-* PowerShell
-* Prolog
-* `Python <http://www.python.org>`_ 2.x and 3.x (incl. console sessions and tracebacks)
-* `REBOL <http://www.rebol.com>`_
-* `Red <http://www.red-lang.org>`_
-* Redcode
-* `Ruby <http://www.ruby-lang.org>`_ (incl. irb sessions)
-* Rust
-* S, S-Plus, R
-* Scala
-* Scheme
-* Scilab
-* `SGF <https://www.red-bean.com/sgf/>`_
-* `Slash <https://github.com/arturadib/Slash-A>`_
-* `Slurm <https://slurm.schedmd.com/overview.html>`_
-* Smalltalk
-* SNOBOL
-* Tcl
-* `Tera Term language <https://ttssh2.osdn.jp/>`_
-* `TOML <https://github.com/toml-lang/toml>`_
-* Vala
-* Verilog
-* VHDL
-* Visual Basic.NET
-* Visual FoxPro
-* XQuery
-* Zephir
-
-Template languages
-------------------
-
-* Cheetah templates
-* `Django <http://www.djangoproject.com>`_ / `Jinja
- <http://jinja.pocoo.org/jinja>`_ templates
-* ERB (Ruby templating)
-* `Genshi <http://genshi.edgewall.org>`_ (the Trac template language)
-* JSP (Java Server Pages)
-* `Myghty <http://www.myghty.org>`_ (the HTML::Mason based framework)
-* `Mako <http://www.makotemplates.org>`_ (the Myghty successor)
-* `Smarty <http://www.smarty.net>`_ templates (PHP templating)
-* Tea
-
-Other markup
-------------
-
-* Apache config files
-* Bash shell scripts
-* BBCode
-* CMake
-* CSS
-* Debian control files
-* Diff files
-* DTD
-* Gettext catalogs
-* Gnuplot script
-* Groff markup
-* HTML
-* HTTP sessions
-* INI-style config files
-* IRC logs (irssi style)
-* Lighttpd config files
-* Makefiles
-* MoinMoin/Trac Wiki markup
-* MySQL
-* Nginx config files
-* POV-Ray scenes
-* Ragel
-* Redcode
-* ReST
-* Robot Framework
-* RPM spec files
-* SQL, also MySQL, SQLite
-* Squid configuration
-* TeX
-* tcsh
-* Vim Script
-* Windows batch files
-* XML
-* XSLT
-* YAML
-
-... that's all?
----------------
-
-Well, why not write your own? Contributing to Pygments is easy and fun. Take a look at the
-:doc:`docs on lexer development <docs/lexerdevelopment>` and
-:ref:`contact details <contribute>`.
-
-Note: the languages listed here are supported in the development version. The
-latest release may lack a few of them.
diff --git a/doc/make.bat b/doc/make.bat
deleted file mode 100644
index 8803c985..00000000
--- a/doc/make.bat
+++ /dev/null
@@ -1,190 +0,0 @@
-@ECHO OFF
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
- set SPHINXBUILD=sphinx-build
-)
-set BUILDDIR=_build
-set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
-set I18NSPHINXOPTS=%SPHINXOPTS% .
-if NOT "%PAPER%" == "" (
- set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
- set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
-)
-
-if "%1" == "" goto help
-
-if "%1" == "help" (
- :help
- echo.Please use `make ^<target^>` where ^<target^> is one of
- echo. html to make standalone HTML files
- echo. dirhtml to make HTML files named index.html in directories
- echo. singlehtml to make a single large HTML file
- echo. pickle to make pickle files
- echo. json to make JSON files
- echo. htmlhelp to make HTML files and a HTML help project
- echo. qthelp to make HTML files and a qthelp project
- echo. devhelp to make HTML files and a Devhelp project
- echo. epub to make an epub
- echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
- echo. text to make text files
- echo. man to make manual pages
- echo. texinfo to make Texinfo files
- echo. gettext to make PO message catalogs
- echo. changes to make an overview over all changed/added/deprecated items
- echo. linkcheck to check all external links for integrity
- echo. doctest to run all doctests embedded in the documentation if enabled
- goto end
-)
-
-if "%1" == "clean" (
- for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
- del /q /s %BUILDDIR%\*
- goto end
-)
-
-if "%1" == "html" (
- %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The HTML pages are in %BUILDDIR%/html.
- goto end
-)
-
-if "%1" == "dirhtml" (
- %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
- goto end
-)
-
-if "%1" == "singlehtml" (
- %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
- goto end
-)
-
-if "%1" == "pickle" (
- %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can process the pickle files.
- goto end
-)
-
-if "%1" == "json" (
- %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can process the JSON files.
- goto end
-)
-
-if "%1" == "htmlhelp" (
- %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can run HTML Help Workshop with the ^
-.hhp project file in %BUILDDIR%/htmlhelp.
- goto end
-)
-
-if "%1" == "qthelp" (
- %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can run "qcollectiongenerator" with the ^
-.qhcp project file in %BUILDDIR%/qthelp, like this:
- echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Pygments.qhcp
- echo.To view the help file:
- echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Pygments.ghc
- goto end
-)
-
-if "%1" == "devhelp" (
- %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished.
- goto end
-)
-
-if "%1" == "epub" (
- %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The epub file is in %BUILDDIR%/epub.
- goto end
-)
-
-if "%1" == "latex" (
- %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
- goto end
-)
-
-if "%1" == "text" (
- %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The text files are in %BUILDDIR%/text.
- goto end
-)
-
-if "%1" == "man" (
- %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The manual pages are in %BUILDDIR%/man.
- goto end
-)
-
-if "%1" == "texinfo" (
- %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
- goto end
-)
-
-if "%1" == "gettext" (
- %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
- goto end
-)
-
-if "%1" == "changes" (
- %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
- if errorlevel 1 exit /b 1
- echo.
- echo.The overview file is in %BUILDDIR%/changes.
- goto end
-)
-
-if "%1" == "linkcheck" (
- %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
- if errorlevel 1 exit /b 1
- echo.
- echo.Link check complete; look for any errors in the above output ^
-or in %BUILDDIR%/linkcheck/output.txt.
- goto end
-)
-
-if "%1" == "doctest" (
- %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
- if errorlevel 1 exit /b 1
- echo.
- echo.Testing of doctests in the sources finished, look at the ^
-results in %BUILDDIR%/doctest/output.txt.
- goto end
-)
-
-:end
diff --git a/doc/pygmentize.1 b/doc/pygmentize.1
deleted file mode 100644
index 71bb6f9c..00000000
--- a/doc/pygmentize.1
+++ /dev/null
@@ -1,94 +0,0 @@
-.TH PYGMENTIZE 1 "February 15, 2007"
-
-.SH NAME
-pygmentize \- highlights the input file
-
-.SH SYNOPSIS
-.B \fBpygmentize\fP
-.RI [-l\ \fI<lexer>\fP]\ [-F\ \fI<filter>\fP[:\fI<options>\fP]]\ [-f\ \fI<formatter>\fP]
-.RI [-O\ \fI<options>\fP]\ [-P\ \fI<option=value>\fP]\ [-o\ \fI<outfile>\fP]\ [\fI<infile>\fP]
-.br
-.B \fBpygmentize\fP
-.RI -S\ \fI<style>\fP\ -f\ \fI<formatter>\fP\ [-a\ \fI<arg>\fP]\ [-O\ \fI<options>\fP]\ [-P\ \fI<option=value>\fP]
-.br
-.B \fBpygmentize\fP
-.RI -L\ [\fI<which>\fP\ ...]
-.br
-.B \fBpygmentize\fP
-.RI -H\ \fI<type>\fP\ \fI<name>\fP
-.br
-.B \fBpygmentize\fP
-.RI -h\ |\ -V
-
-.SH DESCRIPTION
-Pygments is a generic syntax highlighter for general use in all kinds
-of software such as forum systems, wikis or other applications that need to
-prettify source code.
-.PP
-Its highlights are:
- * a wide range of common languages and markup formats is supported
- * special attention is paid to details, increasing quality by a fair amount
- * support for new languages and formats are added easily
- * a number of output formats, presently HTML, LaTeX and ANSI sequences
- * it is usable as a command-line tool and as a library
- * ... and it highlights even Brainfuck!
-.PP
-\fBpygmentize\fP is a command that uses Pygments to highlight the input file and
-write the result to \fI<outfile>\fP. If no \fI<infile>\fP is given, stdin is used.
-.SH OPTIONS
-A summary of options is included below.
-.TP
-.B \-l \fI<lexer>\fP
-Set the lexer name. If not given, the lexer is guessed from the extension of the
-input file name (this obviously doesn't work if the input is stdin).
-.TP
-.B \-F \fI<filter>\fP[:\fI<options>\fP]
-Add a filter to the token stream. You can give options in the same way as for
--O after a colon (note: there must not be spaces around the colon).
-This option can be given multiple times.
-.TP
-.B \-f \fI<formatter>\fP
-Set the formatter name. If not given, it will be guessed from the extension of
-the output file name. If no output file is given, the terminal formatter will be
-used by default.
-.TP
-.B \-o \fI<outfile>\fP
-Set output file. If not given, stdout is used.
-.TP
-.B \-O \fI<options>\fP
-With this option, you can give the lexer and formatter a comma-separated list of
-options, e.g. "-O bg=light,python=cool". Which options are valid for which
-lexers and formatters can be found in the documentation.
-This option can be given multiple times.
-.TP
-.B \-P \fI<option=value>\fP
-This option adds lexer and formatter options like the -O option, but
-you can only give one option per -P. That way, the option value may contain
-commas and equals signs, which it can't with -O.
-.TP
-.B \-S \fI<style>\fP
-Print out style definitions for style \fI<style>\fP and for formatter \fI<formatter>\fP.
-The meaning of the argument given by
-.B \-a \fI<arg>\fP
-is formatter dependent and can be found in the documentation.
-.TP
-.B \-L [\fI<which>\fP ...]
-List lexers, formatters, styles or filters. Set \fI<which>\fP to the thing you want
-to list (e.g. "styles"), or omit it to list everything.
-.TP
-.B \-H \fI<type>\fP \fI<name>\fP
-Print detailed help for the object \fI<name>\fP of type \fI<type>\fP, where \fI<type>\fP is one
-of "lexer", "formatter" or "filter".
-.TP
-.B \-h
-Show help screen.
-.TP
-.B \-V
-Show version of the Pygments package.
-.SH SEE ALSO
-/usr/share/doc/python-pygments/index.html
-.SH AUTHOR
-pygmentize was written by Georg Brandl <g.brandl@gmx.net>.
-.PP
-This manual page was written by Piotr Ozarowski <ozarow@gmail.com>,
-for the Debian project (but may be used by others).
diff --git a/external/autopygmentize b/external/autopygmentize
deleted file mode 100755
index d2d05970..00000000
--- a/external/autopygmentize
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/bash
-# Best effort auto-pygmentization with transparent decompression
-# by Reuben Thomas 2008-2016
-# This program is in the public domain.
-
-# Strategy: first see if pygmentize can find a lexer; if not, ask file; if that finds nothing, fail
-# Set the environment variable PYGMENTIZE_OPTS or pass options before the file path to configure pygments.
-
-# This program can be used as a .lessfilter for the less pager to auto-color less's output
-
-file="${!#}" # last argument
-options=${@:1:$(($#-1))} # handle others args as options to pass to pygmentize
-
-file_common_opts="--brief --dereference"
-
-lexer=$(pygmentize -N "$file")
-if [[ "$lexer" == text ]]; then
- unset lexer
- case $(file --mime-type --uncompress $file_common_opts "$file") in
- application/xml|image/svg+xml) lexer=xml;;
- application/javascript) lexer=javascript;;
- text/html) lexer=html;;
- text/troff) lexer=nroff;;
- text/x-asm) lexer=nasm;;
- text/x-awk) lexer=awk;;
- text/x-c) lexer=c;;
- text/x-c++) lexer=cpp;;
- text/x-crystal) lexer=crystal;;
- text/x-diff) lexer=diff;;
- text/x-fortran) lexer=fortran;;
- text/x-gawk) lexer=gawk;;
- text/x-java) lexer=java;;
- text/x-lisp) lexer=common-lisp;;
- text/x-lua) lexer=lua;;
- text/x-makefile) lexer=make;;
- text/x-msdos-batch) lexer=bat;;
- text/x-nawk) lexer=nawk;;
- text/x-pascal) lexer=pascal;;
- text/x-perl) lexer=perl;;
- text/x-php) lexer=php;;
- text/x-po) lexer=po;;
- text/x-python) lexer=python;;
- text/x-ruby) lexer=ruby;;
- text/x-shellscript) lexer=sh;;
- text/x-tcl) lexer=tcl;;
- text/x-tex|text/x-texinfo) lexer=latex;; # FIXME: texinfo really needs its own lexer
-
- # Types that file outputs which pygmentize didn't support as of file 5.20, pygments 2.0
- # text/calendar
- # text/inf
- # text/PGP
- # text/rtf
- # text/texmacs
- # text/vnd.graphviz
- # text/x-bcpl
- # text/x-info
- # text/x-m4
- # text/x-vcard
- # text/x-xmcd
-
- text/plain) # special filenames. TODO: insert more
- case $(basename "$file") in
- .zshrc) lexer=sh;;
- esac
- ;;
- esac
-fi
-
-# Find a preprocessor for compressed files
-concat=cat
-case $(file $file_common_opts --mime-type "$file") in
- application/x-gzip) concat=zcat;;
- application/x-bzip2) concat=bzcat;;
- application/x-xz) concat=xzcat;;
-esac
-
-# Find a suitable lexer, preceded by a hex dump for binary files
-prereader=""
-encoding=$(file --mime-encoding --uncompress $file_common_opts "$file")
-if [[ $encoding == "binary" ]]; then
- prereader="od -x" # POSIX fallback
- if [[ -n $(which hd) ]]; then
- prereader="hd" # preferred
- fi
- lexer=hexdump
- encoding=latin1
-fi
-if [[ -n "$lexer" ]]; then
- reader="pygmentize -O inencoding=$encoding $PYGMENTIZE_OPTS $options -l $lexer"
-fi
-
-# If we found a reader, run it
-if [[ -n "$reader" ]]; then
- if [[ -n "$prereader" ]]; then
- exec $concat "$file" | $prereader | $reader
- else
- exec $concat "$file" | $reader
- fi
-fi
-
-exit 1
diff --git a/external/lasso-builtins-generator-9.lasso b/external/lasso-builtins-generator-9.lasso
deleted file mode 100755
index 01562995..00000000
--- a/external/lasso-builtins-generator-9.lasso
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/lasso9
-
-/*
- Builtins Generator for Lasso 9
-
- This is the shell script that was used to extract Lasso 9's built-in keywords
- and generate most of the _lasso_builtins.py file. When run, it creates a file
- containing the types, traits, methods, and members of the currently-installed
- version of Lasso 9.
-
- A list of tags in Lasso 8 can be generated with this code:
-
- <?LassoScript
- local('l8tags' = list,
- 'l8libs' = array('Cache','ChartFX','Client','Database','File','HTTP',
- 'iCal','Lasso','Link','List','PDF','Response','Stock','String',
- 'Thread','Valid','WAP','XML'));
- iterate(#l8libs, local('library'));
- local('result' = namespace_load(#library));
- /iterate;
- iterate(tags_list, local('i'));
- #l8tags->insert(string_removeleading(#i, -pattern='_global_'));
- /iterate;
- #l8tags->sort;
- iterate(#l8tags, local('i'));
- string_lowercase(#i)+"<br>";
- /iterate;
-
-*/
-
-output("This output statement is required for a complete list of methods.")
-local(f) = file("_lasso_builtins-9.py")
-#f->doWithClose => {
-
-#f->openTruncate
-#f->writeString('# -*- coding: utf-8 -*-
-"""
- pygments.lexers._lasso_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Built-in Lasso types, traits, methods, and members.
-
- :copyright: Copyright 2006-'+date->year+' by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-')
-
-// Load and register contents of $LASSO9_MASTER_HOME/LassoModules/
-database_initialize
-
-// Load all of the libraries from builtins and lassoserver
-// This forces all possible available types and methods to be registered
-local(srcs =
- (:
- dir(sys_masterHomePath + '/LassoLibraries/builtins/')->eachFilePath,
- dir(sys_masterHomePath + '/LassoLibraries/lassoserver/')->eachFilePath
- )
-)
-
-with topLevelDir in delve(#srcs)
-where not #topLevelDir->lastComponent->beginsWith('.')
-do protect => {
- handle_error => {
- stdoutnl('Unable to load: ' + #topLevelDir + ' ' + error_msg)
- }
- library_thread_loader->loadLibrary(#topLevelDir)
- stdoutnl('Loaded: ' + #topLevelDir)
-}
-
-email_initialize
-log_initialize
-session_initialize
-
-local(
- typesList = set(),
- traitsList = set(),
- unboundMethodsList = set(),
- memberMethodsList = set()
-)
-
-// types
-with type in sys_listTypes
-where not #type->asString->endsWith('$') // skip threads
-do {
- #typesList->insert(#type)
-}
-
-// traits
-with trait in sys_listTraits
-where not #trait->asString->beginsWith('$') // skip combined traits
-do {
- #traitsList->insert(#trait)
-}
-
-// member methods
-with type in #typesList
-do {
- with method in #type->getType->listMethods
- where #method->typeName == #type // skip inherited methods
- let name = #method->methodName
- where not #name->asString->endsWith('=') // skip setter methods
- where #name->asString->isAlpha(1) // skip unpublished methods
- do {
- #memberMethodsList->insert(#name)
- }
-}
-with trait in #traitsList
-do {
- with method in #trait->getType->provides
- where #method->typeName == #trait // skip inherited methods
- let name = #method->methodName
- where not #name->asString->endsWith('=') // skip setter methods
- where #name->asString->isAlpha(1) // skip unpublished methods
- do {
- #memberMethodsList->insert(#name)
- }
-}
-
-// unbound methods
-with method in sys_listUnboundMethods
-let name = #method->methodName
-where not #name->asString->endsWith('=') // skip setter methods
-where #name->asString->isAlpha(1) // skip unpublished methods
-where #typesList !>> #name
-where #traitsList !>> #name
-do {
- #unboundMethodsList->insert(#name)
-}
-
-// write to file
-with i in (:
- pair(#typesList, "BUILTINS = {
- 'Types': (
-"),
- pair(#traitsList, " ),
- 'Traits': (
-"),
- pair(#unboundMethodsList, " ),
- 'Unbound Methods': (
-"),
- pair(#memberMethodsList, " )
-}
-MEMBERS = {
- 'Member Methods': (
-")
-)
-do {
- #f->writeString(#i->second)
- with t in (#i->first)
- let ts = #t->asString
- order by #ts
- do {
- #f->writeString(" '"+#ts->lowercase&asString+"',\n")
- }
-}
-
-#f->writeString(" )
-}
-")
-
-}
diff --git a/external/markdown-processor.py b/external/markdown-processor.py
deleted file mode 100644
index 3a7bca4c..00000000
--- a/external/markdown-processor.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- The Pygments Markdown Preprocessor
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This fragment is a Markdown_ preprocessor that renders source code
- to HTML via Pygments. To use it, invoke Markdown like so::
-
- import markdown
-
- html = markdown.markdown(someText, extensions=[CodeBlockExtension()])
-
- This uses CSS classes by default, so use
- ``pygmentize -S <some style> -f html > pygments.css``
- to create a stylesheet to be added to the website.
-
- You can then highlight source code in your markdown markup::
-
- [sourcecode:lexer]
- some code
- [/sourcecode]
-
- .. _Markdown: https://pypi.python.org/pypi/Markdown
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# Options
-# ~~~~~~~
-
-# Set to True if you want inline CSS styles instead of classes
-INLINESTYLES = False
-
-
-import re
-
-from markdown.preprocessors import Preprocessor
-from markdown.extensions import Extension
-
-from pygments import highlight
-from pygments.formatters import HtmlFormatter
-from pygments.lexers import get_lexer_by_name, TextLexer
-
-
-class CodeBlockPreprocessor(Preprocessor):
-
- pattern = re.compile(r'\[sourcecode:(.+?)\](.+?)\[/sourcecode\]', re.S)
-
- formatter = HtmlFormatter(noclasses=INLINESTYLES)
-
- def run(self, lines):
- def repl(m):
- try:
- lexer = get_lexer_by_name(m.group(1))
- except ValueError:
- lexer = TextLexer()
- code = highlight(m.group(2), lexer, self.formatter)
- code = code.replace('\n\n', '\n&nbsp;\n').replace('\n', '<br />')
- return '\n\n<div class="code">%s</div>\n\n' % code
- joined_lines = "\n".join(lines)
- joined_lines = self.pattern.sub(repl, joined_lines)
- return joined_lines.split("\n")
-
-class CodeBlockExtension(Extension):
- def extendMarkdown(self, md, md_globals):
- md.preprocessors.add('CodeBlockPreprocessor', CodeBlockPreprocessor(), '_begin')
diff --git a/external/moin-parser.py b/external/moin-parser.py
deleted file mode 100644
index 4e74447f..00000000
--- a/external/moin-parser.py
+++ /dev/null
@@ -1,112 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- The Pygments MoinMoin Parser
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This is a MoinMoin parser plugin that renders source code to HTML via
- Pygments; you need Pygments 0.7 or newer for this parser to work.
-
- To use it, set the options below to match your setup and put this file in
- the data/plugin/parser subdirectory of your Moin instance, and give it the
- name that the parser directive should have. For example, if you name the
- file ``code.py``, you can get a highlighted Python code sample with this
- Wiki markup::
-
- {{{
- #!code python
- [...]
- }}}
-
- Additionally, if you set ATTACHMENTS below to True, Pygments will also be
- called for all attachments for whose filenames there is no other parser
- registered.
-
- You are responsible for including CSS rules that will map the Pygments CSS
- classes to colors. You can output a stylesheet file with `pygmentize`, put
- it into the `htdocs` directory of your Moin instance and then include it in
- the `stylesheets` configuration option in the Moin config, e.g.::
-
- stylesheets = [('screen', '/htdocs/pygments.css')]
-
- 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-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# Options
-# ~~~~~~~
-
-# Set to True if you want to highlight attachments, in addition to
-# {{{ }}} blocks.
-ATTACHMENTS = True
-
-# Set to True if you want inline CSS styles instead of classes
-INLINESTYLES = False
-
-
-import sys
-
-from pygments import highlight
-from pygments.lexers import get_lexer_by_name, get_lexer_for_filename, TextLexer
-from pygments.formatters import HtmlFormatter
-from pygments.util import ClassNotFound
-
-
-# wrap lines in <span>s so that the Moin-generated line numbers work
-class MoinHtmlFormatter(HtmlFormatter):
- def wrap(self, source, outfile):
- for line in source:
- yield 1, '<span class="line">' + line[1] + '</span>'
-
-htmlformatter = MoinHtmlFormatter(noclasses=INLINESTYLES)
-textlexer = TextLexer()
-codeid = [0]
-
-
-class Parser:
- """
- MoinMoin Pygments parser.
- """
- if ATTACHMENTS:
- extensions = '*'
- else:
- extensions = []
-
- Dependencies = []
-
- def __init__(self, raw, request, **kw):
- self.raw = raw
- self.req = request
- if "format_args" in kw:
- # called from a {{{ }}} block
- try:
- self.lexer = get_lexer_by_name(kw['format_args'].strip())
- except ClassNotFound:
- self.lexer = textlexer
- return
- if "filename" in kw:
- # called for an attachment
- filename = kw['filename']
- else:
- # called for an attachment by an older moin
- # HACK: find out the filename by peeking into the execution
- # frame which might not always work
- try:
- frame = sys._getframe(1)
- filename = frame.f_locals['filename']
- except:
- filename = 'x.txt'
- try:
- self.lexer = get_lexer_for_filename(filename)
- except ClassNotFound:
- self.lexer = textlexer
-
- def format(self, formatter):
- codeid[0] += 1
- id = "pygments_%s" % codeid[0]
- w = self.req.write
- w(formatter.code_area(1, id, start=1, step=1))
- w(formatter.rawHTML(highlight(self.raw, self.lexer, htmlformatter)))
- w(formatter.code_area(0, id))
diff --git a/external/pygments.bashcomp b/external/pygments.bashcomp
deleted file mode 100644
index 1299fdb9..00000000
--- a/external/pygments.bashcomp
+++ /dev/null
@@ -1,38 +0,0 @@
-#!bash
-#
-# Bash completion support for Pygments (the 'pygmentize' command).
-#
-
-_pygmentize()
-{
- local cur prev
-
- COMPREPLY=()
- cur=`_get_cword`
- prev=${COMP_WORDS[COMP_CWORD-1]}
-
- case "$prev" in
- -f)
- FORMATTERS=`pygmentize -L formatters | grep '* ' | cut -c3- | sed -e 's/,//g' -e 's/:$//'`
- COMPREPLY=( $( compgen -W '$FORMATTERS' -- "$cur" ) )
- return 0
- ;;
- -l)
- LEXERS=`pygmentize -L lexers | grep '* ' | cut -c3- | sed -e 's/,//g' -e 's/:$//'`
- COMPREPLY=( $( compgen -W '$LEXERS' -- "$cur" ) )
- return 0
- ;;
- -S)
- STYLES=`pygmentize -L styles | grep '* ' | cut -c3- | sed s/:$//`
- COMPREPLY=( $( compgen -W '$STYLES' -- "$cur" ) )
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-f -l -S -L -g -O -P -F \
- -N -H -h -V -o' -- "$cur" ) )
- return 0
- fi
-}
-complete -F _pygmentize -o default pygmentize
diff --git a/external/rst-directive.py b/external/rst-directive.py
deleted file mode 100644
index 0b7831f7..00000000
--- a/external/rst-directive.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- The Pygments reStructuredText directive
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This fragment is a Docutils_ 0.5 directive that renders source code
- (to HTML only, currently) via Pygments.
-
- To use it, adjust the options below and copy the code into a module
- that you import on initialization. The code then automatically
- registers a ``sourcecode`` directive that you can use instead of
- normal code blocks like this::
-
- .. sourcecode:: python
-
- My code goes here.
-
- If you want to have different code styles, e.g. one with line numbers
- and one without, add formatters with their names in the VARIANTS dict
- below. You can invoke them instead of the DEFAULT one by using a
- directive option::
-
- .. sourcecode:: python
- :linenos:
-
- My code goes here.
-
- Look at the `directive documentation`_ to get all the gory details.
-
- .. _Docutils: http://docutils.sf.net/
- .. _directive documentation:
- http://docutils.sourceforge.net/docs/howto/rst-directives.html
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# Options
-# ~~~~~~~
-
-# Set to True if you want inline CSS styles instead of classes
-INLINESTYLES = False
-
-from pygments.formatters import HtmlFormatter
-
-# The default formatter
-DEFAULT = HtmlFormatter(noclasses=INLINESTYLES)
-
-# Add name -> formatter pairs for every variant you want to use
-VARIANTS = {
- # 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True),
-}
-
-
-from docutils import nodes
-from docutils.parsers.rst import directives, Directive
-
-from pygments import highlight
-from pygments.lexers import get_lexer_by_name, TextLexer
-
-class Pygments(Directive):
- """ Source code syntax hightlighting.
- """
- required_arguments = 1
- optional_arguments = 0
- final_argument_whitespace = True
- option_spec = dict([(key, directives.flag) for key in VARIANTS])
- has_content = True
-
- def run(self):
- self.assert_has_content()
- try:
- lexer = get_lexer_by_name(self.arguments[0])
- except ValueError:
- # no lexer found - use the text one instead of an exception
- lexer = TextLexer()
- # take an arbitrary option if more than one is given
- formatter = self.options and VARIANTS[list(self.options)[0]] or DEFAULT
- parsed = highlight(u'\n'.join(self.content), lexer, formatter)
- return [nodes.raw('', parsed, format='html')]
-
-directives.register_directive('sourcecode', Pygments)
diff --git a/pygmentize b/pygmentize
deleted file mode 100755
index aea38727..00000000
--- a/pygmentize
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env python2
-
-import sys
-import pygments.cmdline
-try:
- sys.exit(pygments.cmdline.main(sys.argv))
-except KeyboardInterrupt:
- sys.exit(1)
diff --git a/pygments/__init__.py b/pygments/__init__.py
deleted file mode 100644
index 15c226a3..00000000
--- a/pygments/__init__.py
+++ /dev/null
@@ -1,90 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments
- ~~~~~~~~
-
- Pygments is a syntax highlighting package written in Python.
-
- It is a generic syntax highlighter for general use in all kinds of software
- such as forum systems, wikis or other applications that need to prettify
- source code. Highlights are:
-
- * a wide range of common languages and markup formats is supported
- * special attention is paid to details, increasing quality by a fair amount
- * support for new languages and formats are added easily
- * a number of output formats, presently HTML, LaTeX, RTF, SVG, all image
- formats that PIL supports, and ANSI sequences
- * it is usable as a command-line tool and as a library
- * ... and it highlights even Brainfuck!
-
- The `Pygments tip`_ is installable with ``easy_install Pygments==dev``.
-
- .. _Pygments tip:
- http://bitbucket.org/birkenfeld/pygments-main/get/tip.zip#egg=Pygments-dev
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-import sys
-
-from pygments.util import StringIO, BytesIO
-
-__version__ = '2.4.2'
-__docformat__ = 'restructuredtext'
-
-__all__ = ['lex', 'format', 'highlight']
-
-
-def lex(code, lexer):
- """
- Lex ``code`` with ``lexer`` and return an iterable of tokens.
- """
- try:
- return lexer.get_tokens(code)
- except TypeError as err:
- if (isinstance(err.args[0], str) and
- ('unbound method get_tokens' in err.args[0] or
- 'missing 1 required positional argument' in err.args[0])):
- raise TypeError('lex() argument must be a lexer instance, '
- 'not a class')
- raise
-
-
-def format(tokens, formatter, outfile=None): # pylint: disable=redefined-builtin
- """
- Format a tokenlist ``tokens`` with the formatter ``formatter``.
-
- If ``outfile`` is given and a valid file object (an object
- with a ``write`` method), the result will be written to it, otherwise
- it is returned as a string.
- """
- try:
- if not outfile:
- realoutfile = getattr(formatter, 'encoding', None) and BytesIO() or StringIO()
- formatter.format(tokens, realoutfile)
- return realoutfile.getvalue()
- else:
- formatter.format(tokens, outfile)
- except TypeError as err:
- if (isinstance(err.args[0], str) and
- ('unbound method format' in err.args[0] or
- 'missing 1 required positional argument' in err.args[0])):
- raise TypeError('format() argument must be a formatter instance, '
- 'not a class')
- raise
-
-
-def highlight(code, lexer, formatter, outfile=None):
- """
- Lex ``code`` with ``lexer`` and format it with the formatter ``formatter``.
-
- If ``outfile`` is given and a valid file object (an object
- with a ``write`` method), the result will be written to it, otherwise
- it is returned as a string.
- """
- return format(lex(code, lexer), formatter, outfile)
-
-
-if __name__ == '__main__': # pragma: no cover
- from pygments.cmdline import main
- sys.exit(main(sys.argv))
diff --git a/pygments/cmdline.py b/pygments/cmdline.py
deleted file mode 100644
index 292cb870..00000000
--- a/pygments/cmdline.py
+++ /dev/null
@@ -1,573 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.cmdline
- ~~~~~~~~~~~~~~~~
-
- Command line interface.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import os
-import sys
-import getopt
-from textwrap import dedent
-
-from pygments import __version__, highlight
-from pygments.util import ClassNotFound, OptionError, docstring_headline, \
- guess_decode, guess_decode_from_terminal, terminal_encoding
-from pygments.lexers import get_all_lexers, get_lexer_by_name, guess_lexer, \
- load_lexer_from_file, get_lexer_for_filename, find_lexer_class_for_filename
-from pygments.lexers.special import TextLexer
-from pygments.formatters.latex import LatexEmbeddedLexer, LatexFormatter
-from pygments.formatters import get_all_formatters, get_formatter_by_name, \
- load_formatter_from_file, get_formatter_for_filename, find_formatter_class
-from pygments.formatters.terminal import TerminalFormatter
-from pygments.formatters.terminal256 import Terminal256Formatter
-from pygments.filters import get_all_filters, find_filter_class
-from pygments.styles import get_all_styles, get_style_by_name
-
-
-USAGE = """\
-Usage: %s [-l <lexer> | -g] [-F <filter>[:<options>]] [-f <formatter>]
- [-O <options>] [-P <option=value>] [-s] [-v] [-x] [-o <outfile>] [<infile>]
-
- %s -S <style> -f <formatter> [-a <arg>] [-O <options>] [-P <option=value>]
- %s -L [<which> ...]
- %s -N <filename>
- %s -H <type> <name>
- %s -h | -V
-
-Highlight the input file and write the result to <outfile>.
-
-If no input file is given, use stdin, if -o is not given, use stdout.
-
-If -s is passed, lexing will be done in "streaming" mode, reading and
-highlighting one line at a time. This will only work properly with
-lexers that have no constructs spanning multiple lines!
-
-<lexer> is a lexer name (query all lexer names with -L). If -l is not
-given, the lexer is guessed from the extension of the input file name
-(this obviously doesn't work if the input is stdin). If -g is passed,
-attempt to guess the lexer from the file contents, or pass through as
-plain text if this fails (this can work for stdin).
-
-Likewise, <formatter> is a formatter name, and will be guessed from
-the extension of the output file name. If no output file is given,
-the terminal formatter will be used by default.
-
-The additional option -x allows custom lexers and formatters to be
-loaded from a .py file relative to the current working directory. For
-example, ``-l ./customlexer.py -x``. By default, this option expects a
-file with a class named CustomLexer or CustomFormatter; you can also
-specify your own class name with a colon (``-l ./lexer.py:MyLexer``).
-Users should be very careful not to use this option with untrusted files,
-because it will import and run them.
-
-With the -O option, you can give the lexer and formatter a comma-
-separated list of options, e.g. ``-O bg=light,python=cool``.
-
-The -P option adds lexer and formatter options like the -O option, but
-you can only give one option per -P. That way, the option value may
-contain commas and equals signs, which it can't with -O, e.g.
-``-P "heading=Pygments, the Python highlighter".
-
-With the -F option, you can add filters to the token stream, you can
-give options in the same way as for -O after a colon (note: there must
-not be spaces around the colon).
-
-The -O, -P and -F options can be given multiple times.
-
-With the -S option, print out style definitions for style <style>
-for formatter <formatter>. The argument given by -a is formatter
-dependent.
-
-The -L option lists lexers, formatters, styles or filters -- set
-`which` to the thing you want to list (e.g. "styles"), or omit it to
-list everything.
-
-The -N option guesses and prints out a lexer name based solely on
-the given filename. It does not take input or highlight anything.
-If no specific lexer can be determined "text" is returned.
-
-The -H option prints detailed help for the object <name> of type <type>,
-where <type> is one of "lexer", "formatter" or "filter".
-
-The -s option processes lines one at a time until EOF, rather than
-waiting to process the entire file. This only works for stdin, and
-is intended for streaming input such as you get from 'tail -f'.
-Example usage: "tail -f sql.log | pygmentize -s -l sql"
-
-The -v option prints a detailed traceback on unhandled exceptions,
-which is useful for debugging and bug reports.
-
-The -h option prints this help.
-The -V option prints the package version.
-"""
-
-
-def _parse_options(o_strs):
- opts = {}
- if not o_strs:
- return opts
- for o_str in o_strs:
- if not o_str.strip():
- continue
- o_args = o_str.split(',')
- for o_arg in o_args:
- o_arg = o_arg.strip()
- try:
- o_key, o_val = o_arg.split('=', 1)
- o_key = o_key.strip()
- o_val = o_val.strip()
- except ValueError:
- opts[o_arg] = True
- else:
- opts[o_key] = o_val
- return opts
-
-
-def _parse_filters(f_strs):
- filters = []
- if not f_strs:
- return filters
- for f_str in f_strs:
- if ':' in f_str:
- fname, fopts = f_str.split(':', 1)
- filters.append((fname, _parse_options([fopts])))
- else:
- filters.append((f_str, {}))
- return filters
-
-
-def _print_help(what, name):
- try:
- if what == 'lexer':
- cls = get_lexer_by_name(name)
- print("Help on the %s lexer:" % cls.name)
- print(dedent(cls.__doc__))
- elif what == 'formatter':
- cls = find_formatter_class(name)
- print("Help on the %s formatter:" % cls.name)
- print(dedent(cls.__doc__))
- elif what == 'filter':
- cls = find_filter_class(name)
- print("Help on the %s filter:" % name)
- print(dedent(cls.__doc__))
- return 0
- except (AttributeError, ValueError):
- print("%s not found!" % what, file=sys.stderr)
- return 1
-
-
-def _print_list(what):
- if what == 'lexer':
- print()
- print("Lexers:")
- print("~~~~~~~")
-
- info = []
- for fullname, names, exts, _ in get_all_lexers():
- tup = (', '.join(names)+':', fullname,
- exts and '(filenames ' + ', '.join(exts) + ')' or '')
- info.append(tup)
- info.sort()
- for i in info:
- print(('* %s\n %s %s') % i)
-
- elif what == 'formatter':
- print()
- print("Formatters:")
- print("~~~~~~~~~~~")
-
- info = []
- for cls in get_all_formatters():
- doc = docstring_headline(cls)
- tup = (', '.join(cls.aliases) + ':', doc, cls.filenames and
- '(filenames ' + ', '.join(cls.filenames) + ')' or '')
- info.append(tup)
- info.sort()
- for i in info:
- print(('* %s\n %s %s') % i)
-
- elif what == 'filter':
- print()
- print("Filters:")
- print("~~~~~~~~")
-
- for name in get_all_filters():
- cls = find_filter_class(name)
- print("* " + name + ':')
- print(" %s" % docstring_headline(cls))
-
- elif what == 'style':
- print()
- print("Styles:")
- print("~~~~~~~")
-
- for name in get_all_styles():
- cls = get_style_by_name(name)
- print("* " + name + ':')
- print(" %s" % docstring_headline(cls))
-
-
-def main_inner(popts, args, usage):
- opts = {}
- O_opts = []
- P_opts = []
- F_opts = []
- for opt, arg in popts:
- if opt == '-O':
- O_opts.append(arg)
- elif opt == '-P':
- P_opts.append(arg)
- elif opt == '-F':
- F_opts.append(arg)
- opts[opt] = arg
-
- if opts.pop('-h', None) is not None:
- print(usage)
- return 0
-
- if opts.pop('-V', None) is not None:
- print('Pygments version %s, (c) 2006-2019 by Georg Brandl.' % __version__)
- return 0
-
- # handle ``pygmentize -L``
- L_opt = opts.pop('-L', None)
- if L_opt is not None:
- if opts:
- print(usage, file=sys.stderr)
- return 2
-
- # print version
- main(['', '-V'])
- if not args:
- args = ['lexer', 'formatter', 'filter', 'style']
- for arg in args:
- _print_list(arg.rstrip('s'))
- return 0
-
- # handle ``pygmentize -H``
- H_opt = opts.pop('-H', None)
- if H_opt is not None:
- if opts or len(args) != 2:
- print(usage, file=sys.stderr)
- return 2
-
- what, name = args # pylint: disable=unbalanced-tuple-unpacking
- if what not in ('lexer', 'formatter', 'filter'):
- print(usage, file=sys.stderr)
- return 2
-
- return _print_help(what, name)
-
- # parse -O options
- parsed_opts = _parse_options(O_opts)
- opts.pop('-O', None)
-
- # parse -P options
- for p_opt in P_opts:
- try:
- name, value = p_opt.split('=', 1)
- except ValueError:
- parsed_opts[p_opt] = True
- else:
- parsed_opts[name] = value
- opts.pop('-P', None)
-
- # encodings
- inencoding = parsed_opts.get('inencoding', parsed_opts.get('encoding'))
- outencoding = parsed_opts.get('outencoding', parsed_opts.get('encoding'))
-
- # handle ``pygmentize -N``
- infn = opts.pop('-N', None)
- if infn is not None:
- lexer = find_lexer_class_for_filename(infn)
- if lexer is None:
- lexer = TextLexer
-
- print(lexer.aliases[0])
- return 0
-
- # handle ``pygmentize -S``
- S_opt = opts.pop('-S', None)
- a_opt = opts.pop('-a', None)
- if S_opt is not None:
- f_opt = opts.pop('-f', None)
- if not f_opt:
- print(usage, file=sys.stderr)
- return 2
- if opts or args:
- print(usage, file=sys.stderr)
- return 2
-
- try:
- parsed_opts['style'] = S_opt
- fmter = get_formatter_by_name(f_opt, **parsed_opts)
- except ClassNotFound as err:
- print(err, file=sys.stderr)
- return 1
-
- print(fmter.get_style_defs(a_opt or ''))
- return 0
-
- # if no -S is given, -a is not allowed
- if a_opt is not None:
- print(usage, file=sys.stderr)
- return 2
-
- # parse -F options
- F_opts = _parse_filters(F_opts)
- opts.pop('-F', None)
-
- allow_custom_lexer_formatter = False
- # -x: allow custom (eXternal) lexers and formatters
- if opts.pop('-x', None) is not None:
- allow_custom_lexer_formatter = True
-
- # select lexer
- lexer = None
-
- # given by name?
- lexername = opts.pop('-l', None)
- if lexername:
- # custom lexer, located relative to user's cwd
- if allow_custom_lexer_formatter and '.py' in lexername:
- try:
- if ':' in lexername:
- filename, name = lexername.rsplit(':', 1)
- lexer = load_lexer_from_file(filename, name,
- **parsed_opts)
- else:
- lexer = load_lexer_from_file(lexername, **parsed_opts)
- except ClassNotFound as err:
- print('Error:', err, file=sys.stderr)
- return 1
- else:
- try:
- lexer = get_lexer_by_name(lexername, **parsed_opts)
- except (OptionError, ClassNotFound) as err:
- print('Error:', err, file=sys.stderr)
- return 1
-
- # read input code
- code = None
-
- if args:
- if len(args) > 1:
- print(usage, file=sys.stderr)
- return 2
-
- if '-s' in opts:
- print('Error: -s option not usable when input file specified',
- file=sys.stderr)
- return 2
-
- infn = args[0]
- try:
- with open(infn, 'rb') as infp:
- code = infp.read()
- except Exception as err:
- print('Error: cannot read infile:', err, file=sys.stderr)
- return 1
- if not inencoding:
- code, inencoding = guess_decode(code)
-
- # do we have to guess the lexer?
- if not lexer:
- try:
- lexer = get_lexer_for_filename(infn, code, **parsed_opts)
- except ClassNotFound as err:
- if '-g' in opts:
- try:
- lexer = guess_lexer(code, **parsed_opts)
- except ClassNotFound:
- lexer = TextLexer(**parsed_opts)
- else:
- print('Error:', err, file=sys.stderr)
- return 1
- except OptionError as err:
- print('Error:', err, file=sys.stderr)
- return 1
-
- elif '-s' not in opts: # treat stdin as full file (-s support is later)
- # read code from terminal, always in binary mode since we want to
- # decode ourselves and be tolerant with it
- if sys.version_info > (3,):
- # Python 3: we have to use .buffer to get a binary stream
- code = sys.stdin.buffer.read()
- else:
- code = sys.stdin.read()
- if not inencoding:
- code, inencoding = guess_decode_from_terminal(code, sys.stdin)
- # else the lexer will do the decoding
- if not lexer:
- try:
- lexer = guess_lexer(code, **parsed_opts)
- except ClassNotFound:
- lexer = TextLexer(**parsed_opts)
-
- else: # -s option needs a lexer with -l
- if not lexer:
- print('Error: when using -s a lexer has to be selected with -l',
- file=sys.stderr)
- return 2
-
- # process filters
- for fname, fopts in F_opts:
- try:
- lexer.add_filter(fname, **fopts)
- except ClassNotFound as err:
- print('Error:', err, file=sys.stderr)
- return 1
-
- # select formatter
- outfn = opts.pop('-o', None)
- fmter = opts.pop('-f', None)
- if fmter:
- # custom formatter, located relative to user's cwd
- if allow_custom_lexer_formatter and '.py' in fmter:
- try:
- if ':' in fmter:
- file, fmtername = fmter.rsplit(':', 1)
- fmter = load_formatter_from_file(file, fmtername,
- **parsed_opts)
- else:
- fmter = load_formatter_from_file(fmter, **parsed_opts)
- except ClassNotFound as err:
- print('Error:', err, file=sys.stderr)
- return 1
- else:
- try:
- fmter = get_formatter_by_name(fmter, **parsed_opts)
- except (OptionError, ClassNotFound) as err:
- print('Error:', err, file=sys.stderr)
- return 1
-
- if outfn:
- if not fmter:
- try:
- fmter = get_formatter_for_filename(outfn, **parsed_opts)
- except (OptionError, ClassNotFound) as err:
- print('Error:', err, file=sys.stderr)
- return 1
- try:
- outfile = open(outfn, 'wb')
- except Exception as err:
- print('Error: cannot open outfile:', err, file=sys.stderr)
- return 1
- else:
- if not fmter:
- if '256' in os.environ.get('TERM', ''):
- fmter = Terminal256Formatter(**parsed_opts)
- else:
- fmter = TerminalFormatter(**parsed_opts)
- if sys.version_info > (3,):
- # Python 3: we have to use .buffer to get a binary stream
- outfile = sys.stdout.buffer
- else:
- outfile = sys.stdout
-
- # determine output encoding if not explicitly selected
- if not outencoding:
- if outfn:
- # output file? use lexer encoding for now (can still be None)
- fmter.encoding = inencoding
- else:
- # else use terminal encoding
- fmter.encoding = terminal_encoding(sys.stdout)
-
- # provide coloring under Windows, if possible
- if not outfn and sys.platform in ('win32', 'cygwin') and \
- fmter.name in ('Terminal', 'Terminal256'): # pragma: no cover
- # unfortunately colorama doesn't support binary streams on Py3
- if sys.version_info > (3,):
- from pygments.util import UnclosingTextIOWrapper
- outfile = UnclosingTextIOWrapper(outfile, encoding=fmter.encoding)
- fmter.encoding = None
- try:
- import colorama.initialise
- except ImportError:
- pass
- else:
- outfile = colorama.initialise.wrap_stream(
- outfile, convert=None, strip=None, autoreset=False, wrap=True)
-
- # When using the LaTeX formatter and the option `escapeinside` is
- # specified, we need a special lexer which collects escaped text
- # before running the chosen language lexer.
- escapeinside = parsed_opts.get('escapeinside', '')
- if len(escapeinside) == 2 and isinstance(fmter, LatexFormatter):
- left = escapeinside[0]
- right = escapeinside[1]
- lexer = LatexEmbeddedLexer(left, right, lexer)
-
- # ... and do it!
- if '-s' not in opts:
- # process whole input as per normal...
- highlight(code, lexer, fmter, outfile)
- return 0
- else:
- # line by line processing of stdin (eg: for 'tail -f')...
- try:
- while 1:
- if sys.version_info > (3,):
- # Python 3: we have to use .buffer to get a binary stream
- line = sys.stdin.buffer.readline()
- else:
- line = sys.stdin.readline()
- if not line:
- break
- if not inencoding:
- line = guess_decode_from_terminal(line, sys.stdin)[0]
- highlight(line, lexer, fmter, outfile)
- if hasattr(outfile, 'flush'):
- outfile.flush()
- return 0
- except KeyboardInterrupt: # pragma: no cover
- return 0
-
-
-def main(args=sys.argv):
- """
- Main command line entry point.
- """
- usage = USAGE % ((args[0],) * 6)
-
- try:
- popts, args = getopt.getopt(args[1:], "l:f:F:o:O:P:LS:a:N:vhVHgsx")
- except getopt.GetoptError:
- print(usage, file=sys.stderr)
- return 2
-
- try:
- return main_inner(popts, args, usage)
- except Exception:
- if '-v' in dict(popts):
- print(file=sys.stderr)
- print('*' * 65, file=sys.stderr)
- print('An unhandled exception occurred while highlighting.',
- file=sys.stderr)
- print('Please report the whole traceback to the issue tracker at',
- file=sys.stderr)
- print('<https://bitbucket.org/birkenfeld/pygments-main/issues>.',
- file=sys.stderr)
- print('*' * 65, file=sys.stderr)
- print(file=sys.stderr)
- raise
- import traceback
- info = traceback.format_exception(*sys.exc_info())
- msg = info[-1].strip()
- if len(info) >= 3:
- # extract relevant file and position info
- msg += '\n (f%s)' % info[-2].split('\n')[0].strip()[1:]
- print(file=sys.stderr)
- print('*** Error while highlighting:', file=sys.stderr)
- print(msg, file=sys.stderr)
- print('*** If this is a bug you want to report, please rerun with -v.',
- file=sys.stderr)
- return 1
diff --git a/pygments/console.py b/pygments/console.py
deleted file mode 100644
index a05b256e..00000000
--- a/pygments/console.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.console
- ~~~~~~~~~~~~~~~~
-
- Format colored console output.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-esc = "\x1b["
-
-codes = {}
-codes[""] = ""
-codes["reset"] = esc + "39;49;00m"
-
-codes["bold"] = esc + "01m"
-codes["faint"] = esc + "02m"
-codes["standout"] = esc + "03m"
-codes["underline"] = esc + "04m"
-codes["blink"] = esc + "05m"
-codes["overline"] = esc + "06m"
-
-dark_colors = ["black", "red", "green", "yellow", "blue",
- "magenta", "cyan", "gray"]
-light_colors = ["brightblack", "brightred", "brightgreen", "brightyellow", "brightblue",
- "brightmagenta", "brightcyan", "white"]
-
-x = 30
-for d, l in zip(dark_colors, light_colors):
- codes[d] = esc + "%im" % x
- codes[l] = esc + "%im" % (60 + x)
- x += 1
-
-del d, l, x
-
-codes["white"] = codes["bold"]
-
-
-def reset_color():
- return codes["reset"]
-
-
-def colorize(color_key, text):
- return codes[color_key] + text + codes["reset"]
-
-
-def ansiformat(attr, text):
- """
- Format ``text`` with a color and/or some attributes::
-
- color normal color
- *color* bold color
- _color_ underlined color
- +color+ blinking color
- """
- result = []
- if attr[:1] == attr[-1:] == '+':
- result.append(codes['blink'])
- attr = attr[1:-1]
- if attr[:1] == attr[-1:] == '*':
- result.append(codes['bold'])
- attr = attr[1:-1]
- if attr[:1] == attr[-1:] == '_':
- result.append(codes['underline'])
- attr = attr[1:-1]
- result.append(codes[attr])
- result.append(text)
- result.append(codes['reset'])
- return ''.join(result)
diff --git a/pygments/filter.py b/pygments/filter.py
deleted file mode 100644
index 7f81920b..00000000
--- a/pygments/filter.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.filter
- ~~~~~~~~~~~~~~~
-
- Module that implements the default filter.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-
-def apply_filters(stream, filters, lexer=None):
- """
- Use this method to apply an iterable of filters to
- a stream. If lexer is given it's forwarded to the
- filter, otherwise the filter receives `None`.
- """
- def _apply(filter_, stream):
- for token in filter_.filter(lexer, stream):
- yield token
- for filter_ in filters:
- stream = _apply(filter_, stream)
- return stream
-
-
-def simplefilter(f):
- """
- Decorator that converts a function into a filter::
-
- @simplefilter
- def lowercase(self, lexer, stream, options):
- for ttype, value in stream:
- yield ttype, value.lower()
- """
- return type(f.__name__, (FunctionFilter,), {
- '__module__': getattr(f, '__module__'),
- '__doc__': f.__doc__,
- 'function': f,
- })
-
-
-class Filter(object):
- """
- Default filter. Subclass this class or use the `simplefilter`
- decorator to create own filters.
- """
-
- def __init__(self, **options):
- self.options = options
-
- def filter(self, lexer, stream):
- raise NotImplementedError()
-
-
-class FunctionFilter(Filter):
- """
- Abstract class used by `simplefilter` to create simple
- function filters on the fly. The `simplefilter` decorator
- automatically creates subclasses of this class for
- functions passed to it.
- """
- function = None
-
- def __init__(self, **options):
- if not hasattr(self, 'function'):
- raise TypeError('%r used without bound function' %
- self.__class__.__name__)
- Filter.__init__(self, **options)
-
- def filter(self, lexer, stream):
- # pylint: disable=not-callable
- for ttype, value in self.function(lexer, stream, self.options):
- yield ttype, value
diff --git a/pygments/filters/__init__.py b/pygments/filters/__init__.py
deleted file mode 100644
index 3fe6caa7..00000000
--- a/pygments/filters/__init__.py
+++ /dev/null
@@ -1,350 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.filters
- ~~~~~~~~~~~~~~~~
-
- Module containing filter lookup functions and default
- filters.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.token import String, Comment, Keyword, Name, Error, Whitespace, \
- string_to_tokentype
-from pygments.filter import Filter
-from pygments.util import get_list_opt, get_int_opt, get_bool_opt, \
- get_choice_opt, ClassNotFound, OptionError, text_type, string_types
-from pygments.plugin import find_plugin_filters
-
-
-def find_filter_class(filtername):
- """Lookup a filter by name. Return None if not found."""
- if filtername in FILTERS:
- return FILTERS[filtername]
- for name, cls in find_plugin_filters():
- if name == filtername:
- return cls
- return None
-
-
-def get_filter_by_name(filtername, **options):
- """Return an instantiated filter.
-
- Options are passed to the filter initializer if wanted.
- Raise a ClassNotFound if not found.
- """
- cls = find_filter_class(filtername)
- if cls:
- return cls(**options)
- else:
- raise ClassNotFound('filter %r not found' % filtername)
-
-
-def get_all_filters():
- """Return a generator of all filter names."""
- for name in FILTERS:
- yield name
- for name, _ in find_plugin_filters():
- yield name
-
-
-def _replace_special(ttype, value, regex, specialttype,
- replacefunc=lambda x: x):
- last = 0
- for match in regex.finditer(value):
- start, end = match.start(), match.end()
- if start != last:
- yield ttype, value[last:start]
- yield specialttype, replacefunc(value[start:end])
- last = end
- if last != len(value):
- yield ttype, value[last:]
-
-
-class CodeTagFilter(Filter):
- """Highlight special code tags in comments and docstrings.
-
- Options accepted:
-
- `codetags` : list of strings
- A list of strings that are flagged as code tags. The default is to
- highlight ``XXX``, ``TODO``, ``BUG`` and ``NOTE``.
- """
-
- def __init__(self, **options):
- Filter.__init__(self, **options)
- tags = get_list_opt(options, 'codetags',
- ['XXX', 'TODO', 'BUG', 'NOTE'])
- self.tag_re = re.compile(r'\b(%s)\b' % '|'.join([
- re.escape(tag) for tag in tags if tag
- ]))
-
- def filter(self, lexer, stream):
- regex = self.tag_re
- for ttype, value in stream:
- if ttype in String.Doc or \
- ttype in Comment and \
- ttype not in Comment.Preproc:
- for sttype, svalue in _replace_special(ttype, value, regex,
- Comment.Special):
- yield sttype, svalue
- else:
- yield ttype, value
-
-
-class KeywordCaseFilter(Filter):
- """Convert keywords to lowercase or uppercase or capitalize them, which
- means first letter uppercase, rest lowercase.
-
- This can be useful e.g. if you highlight Pascal code and want to adapt the
- code to your styleguide.
-
- Options accepted:
-
- `case` : string
- The casing to convert keywords to. Must be one of ``'lower'``,
- ``'upper'`` or ``'capitalize'``. The default is ``'lower'``.
- """
-
- def __init__(self, **options):
- Filter.__init__(self, **options)
- case = get_choice_opt(options, 'case',
- ['lower', 'upper', 'capitalize'], 'lower')
- self.convert = getattr(text_type, case)
-
- def filter(self, lexer, stream):
- for ttype, value in stream:
- if ttype in Keyword:
- yield ttype, self.convert(value)
- else:
- yield ttype, value
-
-
-class NameHighlightFilter(Filter):
- """Highlight a normal Name (and Name.*) token with a different token type.
-
- Example::
-
- filter = NameHighlightFilter(
- names=['foo', 'bar', 'baz'],
- tokentype=Name.Function,
- )
-
- This would highlight the names "foo", "bar" and "baz"
- as functions. `Name.Function` is the default token type.
-
- Options accepted:
-
- `names` : list of strings
- A list of names that should be given the different token type.
- There is no default.
- `tokentype` : TokenType or string
- A token type or a string containing a token type name that is
- used for highlighting the strings in `names`. The default is
- `Name.Function`.
- """
-
- def __init__(self, **options):
- Filter.__init__(self, **options)
- self.names = set(get_list_opt(options, 'names', []))
- tokentype = options.get('tokentype')
- if tokentype:
- self.tokentype = string_to_tokentype(tokentype)
- else:
- self.tokentype = Name.Function
-
- def filter(self, lexer, stream):
- for ttype, value in stream:
- if ttype in Name and value in self.names:
- yield self.tokentype, value
- else:
- yield ttype, value
-
-
-class ErrorToken(Exception):
- pass
-
-
-class RaiseOnErrorTokenFilter(Filter):
- """Raise an exception when the lexer generates an error token.
-
- Options accepted:
-
- `excclass` : Exception class
- The exception class to raise.
- The default is `pygments.filters.ErrorToken`.
-
- .. versionadded:: 0.8
- """
-
- def __init__(self, **options):
- Filter.__init__(self, **options)
- self.exception = options.get('excclass', ErrorToken)
- try:
- # issubclass() will raise TypeError if first argument is not a class
- if not issubclass(self.exception, Exception):
- raise TypeError
- except TypeError:
- raise OptionError('excclass option is not an exception class')
-
- def filter(self, lexer, stream):
- for ttype, value in stream:
- if ttype is Error:
- raise self.exception(value)
- yield ttype, value
-
-
-class VisibleWhitespaceFilter(Filter):
- """Convert tabs, newlines and/or spaces to visible characters.
-
- Options accepted:
-
- `spaces` : string or bool
- If this is a one-character string, spaces will be replaces by this string.
- If it is another true value, spaces will be replaced by ``·`` (unicode
- MIDDLE DOT). If it is a false value, spaces will not be replaced. The
- default is ``False``.
- `tabs` : string or bool
- The same as for `spaces`, but the default replacement character is ``»``
- (unicode RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK). The default value
- is ``False``. Note: this will not work if the `tabsize` option for the
- lexer is nonzero, as tabs will already have been expanded then.
- `tabsize` : int
- If tabs are to be replaced by this filter (see the `tabs` option), this
- is the total number of characters that a tab should be expanded to.
- The default is ``8``.
- `newlines` : string or bool
- The same as for `spaces`, but the default replacement character is ``¶``
- (unicode PILCROW SIGN). The default value is ``False``.
- `wstokentype` : bool
- If true, give whitespace the special `Whitespace` token type. This allows
- styling the visible whitespace differently (e.g. greyed out), but it can
- disrupt background colors. The default is ``True``.
-
- .. versionadded:: 0.8
- """
-
- def __init__(self, **options):
- Filter.__init__(self, **options)
- for name, default in [('spaces', u'·'),
- ('tabs', u'»'),
- ('newlines', u'¶')]:
- opt = options.get(name, False)
- if isinstance(opt, string_types) and len(opt) == 1:
- setattr(self, name, opt)
- else:
- setattr(self, name, (opt and default or ''))
- tabsize = get_int_opt(options, 'tabsize', 8)
- if self.tabs:
- self.tabs += ' ' * (tabsize - 1)
- if self.newlines:
- self.newlines += '\n'
- self.wstt = get_bool_opt(options, 'wstokentype', True)
-
- def filter(self, lexer, stream):
- if self.wstt:
- spaces = self.spaces or u' '
- tabs = self.tabs or u'\t'
- newlines = self.newlines or u'\n'
- regex = re.compile(r'\s')
- def replacefunc(wschar):
- if wschar == ' ':
- return spaces
- elif wschar == '\t':
- return tabs
- elif wschar == '\n':
- return newlines
- return wschar
-
- for ttype, value in stream:
- for sttype, svalue in _replace_special(ttype, value, regex,
- Whitespace, replacefunc):
- yield sttype, svalue
- else:
- spaces, tabs, newlines = self.spaces, self.tabs, self.newlines
- # simpler processing
- for ttype, value in stream:
- if spaces:
- value = value.replace(' ', spaces)
- if tabs:
- value = value.replace('\t', tabs)
- if newlines:
- value = value.replace('\n', newlines)
- yield ttype, value
-
-
-class GobbleFilter(Filter):
- """Gobbles source code lines (eats initial characters).
-
- This filter drops the first ``n`` characters off every line of code. This
- may be useful when the source code fed to the lexer is indented by a fixed
- amount of space that isn't desired in the output.
-
- Options accepted:
-
- `n` : int
- The number of characters to gobble.
-
- .. versionadded:: 1.2
- """
- def __init__(self, **options):
- Filter.__init__(self, **options)
- self.n = get_int_opt(options, 'n', 0)
-
- def gobble(self, value, left):
- if left < len(value):
- return value[left:], 0
- else:
- return u'', left - len(value)
-
- def filter(self, lexer, stream):
- n = self.n
- left = n # How many characters left to gobble.
- for ttype, value in stream:
- # Remove ``left`` tokens from first line, ``n`` from all others.
- parts = value.split('\n')
- (parts[0], left) = self.gobble(parts[0], left)
- for i in range(1, len(parts)):
- (parts[i], left) = self.gobble(parts[i], n)
- value = u'\n'.join(parts)
-
- if value != '':
- yield ttype, value
-
-
-class TokenMergeFilter(Filter):
- """Merges consecutive tokens with the same token type in the output
- stream of a lexer.
-
- .. versionadded:: 1.2
- """
- def __init__(self, **options):
- Filter.__init__(self, **options)
-
- def filter(self, lexer, stream):
- current_type = None
- current_value = None
- for ttype, value in stream:
- if ttype is current_type:
- current_value += value
- else:
- if current_type is not None:
- yield current_type, current_value
- current_type = ttype
- current_value = value
- if current_type is not None:
- yield current_type, current_value
-
-
-FILTERS = {
- 'codetagify': CodeTagFilter,
- 'keywordcase': KeywordCaseFilter,
- 'highlight': NameHighlightFilter,
- 'raiseonerror': RaiseOnErrorTokenFilter,
- 'whitespace': VisibleWhitespaceFilter,
- 'gobble': GobbleFilter,
- 'tokenmerge': TokenMergeFilter,
-}
diff --git a/pygments/formatter.py b/pygments/formatter.py
deleted file mode 100644
index f09f6e3c..00000000
--- a/pygments/formatter.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatter
- ~~~~~~~~~~~~~~~~~~
-
- Base formatter class.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import codecs
-
-from pygments.util import get_bool_opt, string_types
-from pygments.styles import get_style_by_name
-
-__all__ = ['Formatter']
-
-
-def _lookup_style(style):
- if isinstance(style, string_types):
- return get_style_by_name(style)
- return style
-
-
-class Formatter(object):
- """
- Converts a token stream to text.
-
- Options accepted:
-
- ``style``
- The style to use, can be a string or a Style subclass
- (default: "default"). Not used by e.g. the
- TerminalFormatter.
- ``full``
- Tells the formatter to output a "full" document, i.e.
- a complete self-contained document. This doesn't have
- any effect for some formatters (default: false).
- ``title``
- If ``full`` is true, the title that should be used to
- caption the document (default: '').
- ``encoding``
- If given, must be an encoding name. This will be used to
- convert the Unicode token strings to byte strings in the
- output. If it is "" or None, Unicode strings will be written
- to the output file, which most file-like objects do not
- support (default: None).
- ``outencoding``
- Overrides ``encoding`` if given.
- """
-
- #: Name of the formatter
- name = None
-
- #: Shortcuts for the formatter
- aliases = []
-
- #: fn match rules
- filenames = []
-
- #: If True, this formatter outputs Unicode strings when no encoding
- #: option is given.
- unicodeoutput = True
-
- def __init__(self, **options):
- self.style = _lookup_style(options.get('style', 'default'))
- self.full = get_bool_opt(options, 'full', False)
- self.title = options.get('title', '')
- self.encoding = options.get('encoding', None) or None
- if self.encoding in ('guess', 'chardet'):
- # can happen for e.g. pygmentize -O encoding=guess
- self.encoding = 'utf-8'
- self.encoding = options.get('outencoding') or self.encoding
- self.options = options
-
- def get_style_defs(self, arg=''):
- """
- Return the style definitions for the current style as a string.
-
- ``arg`` is an additional argument whose meaning depends on the
- formatter used. Note that ``arg`` can also be a list or tuple
- for some formatters like the html formatter.
- """
- return ''
-
- def format(self, tokensource, outfile):
- """
- Format ``tokensource``, an iterable of ``(tokentype, tokenstring)``
- tuples and write it into ``outfile``.
- """
- if self.encoding:
- # wrap the outfile in a StreamWriter
- outfile = codecs.lookup(self.encoding)[3](outfile)
- return self.format_unencoded(tokensource, outfile)
diff --git a/pygments/formatters/__init__.py b/pygments/formatters/__init__.py
deleted file mode 100644
index 4fa4178e..00000000
--- a/pygments/formatters/__init__.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters
- ~~~~~~~~~~~~~~~~~~~
-
- Pygments formatters.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-import sys
-import types
-import fnmatch
-from os.path import basename
-
-from pygments.formatters._mapping import FORMATTERS
-from pygments.plugin import find_plugin_formatters
-from pygments.util import ClassNotFound, itervalues
-
-__all__ = ['get_formatter_by_name', 'get_formatter_for_filename',
- 'get_all_formatters', 'load_formatter_from_file'] + list(FORMATTERS)
-
-_formatter_cache = {} # classes by name
-_pattern_cache = {}
-
-
-def _fn_matches(fn, glob):
- """Return whether the supplied file name fn matches pattern filename."""
- if glob not in _pattern_cache:
- pattern = _pattern_cache[glob] = re.compile(fnmatch.translate(glob))
- return pattern.match(fn)
- return _pattern_cache[glob].match(fn)
-
-
-def _load_formatters(module_name):
- """Load a formatter (and all others in the module too)."""
- mod = __import__(module_name, None, None, ['__all__'])
- for formatter_name in mod.__all__:
- cls = getattr(mod, formatter_name)
- _formatter_cache[cls.name] = cls
-
-
-def get_all_formatters():
- """Return a generator for all formatter classes."""
- # NB: this returns formatter classes, not info like get_all_lexers().
- for info in itervalues(FORMATTERS):
- if info[1] not in _formatter_cache:
- _load_formatters(info[0])
- yield _formatter_cache[info[1]]
- for _, formatter in find_plugin_formatters():
- yield formatter
-
-
-def find_formatter_class(alias):
- """Lookup a formatter by alias.
-
- Returns None if not found.
- """
- for module_name, name, aliases, _, _ in itervalues(FORMATTERS):
- if alias in aliases:
- if name not in _formatter_cache:
- _load_formatters(module_name)
- return _formatter_cache[name]
- for _, cls in find_plugin_formatters():
- if alias in cls.aliases:
- return cls
-
-
-def get_formatter_by_name(_alias, **options):
- """Lookup and instantiate a formatter by alias.
-
- Raises ClassNotFound if not found.
- """
- cls = find_formatter_class(_alias)
- if cls is None:
- raise ClassNotFound("no formatter found for name %r" % _alias)
- return cls(**options)
-
-
-def load_formatter_from_file(filename, formattername="CustomFormatter",
- **options):
- """Load a formatter from a file.
-
- This method expects a file located relative to the current working
- directory, which contains a class named CustomFormatter. By default,
- it expects the Formatter to be named CustomFormatter; you can specify
- your own class name as the second argument to this function.
-
- Users should be very careful with the input, because this method
- is equivalent to running eval on the input file.
-
- Raises ClassNotFound if there are any problems importing the Formatter.
-
- .. versionadded:: 2.2
- """
- try:
- # This empty dict will contain the namespace for the exec'd file
- custom_namespace = {}
- with open(filename, 'rb') as f:
- exec(f.read(), custom_namespace)
- # Retrieve the class `formattername` from that namespace
- if formattername not in custom_namespace:
- raise ClassNotFound('no valid %s class found in %s' %
- (formattername, filename))
- formatter_class = custom_namespace[formattername]
- # And finally instantiate it with the options
- return formatter_class(**options)
- except IOError as err:
- raise ClassNotFound('cannot read %s' % filename)
- except ClassNotFound as err:
- raise
- except Exception as err:
- raise ClassNotFound('error when loading custom formatter: %s' % err)
-
-
-def get_formatter_for_filename(fn, **options):
- """Lookup and instantiate a formatter by filename pattern.
-
- Raises ClassNotFound if not found.
- """
- fn = basename(fn)
- for modname, name, _, filenames, _ in itervalues(FORMATTERS):
- for filename in filenames:
- if _fn_matches(fn, filename):
- if name not in _formatter_cache:
- _load_formatters(modname)
- return _formatter_cache[name](**options)
- for cls in find_plugin_formatters():
- for filename in cls.filenames:
- if _fn_matches(fn, filename):
- return cls(**options)
- raise ClassNotFound("no formatter found for file name %r" % fn)
-
-
-class _automodule(types.ModuleType):
- """Automatically import formatters."""
-
- def __getattr__(self, name):
- info = FORMATTERS.get(name)
- if info:
- _load_formatters(info[0])
- cls = _formatter_cache[info[1]]
- setattr(self, name, cls)
- return cls
- raise AttributeError(name)
-
-
-oldmod = sys.modules[__name__]
-newmod = _automodule(__name__)
-newmod.__dict__.update(oldmod.__dict__)
-sys.modules[__name__] = newmod
-del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types
diff --git a/pygments/formatters/_mapping.py b/pygments/formatters/_mapping.py
deleted file mode 100755
index 5086e519..00000000
--- a/pygments/formatters/_mapping.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters._mapping
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Formatter mapping definitions. This file is generated by itself. Everytime
- you change something on a builtin formatter definition, run this script from
- the formatters folder to update it.
-
- Do not alter the FORMATTERS dictionary by hand.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-FORMATTERS = {
- 'BBCodeFormatter': ('pygments.formatters.bbcode', 'BBCode', ('bbcode', 'bb'), (), 'Format tokens with BBcodes. These formatting codes are used by many bulletin boards, so you can highlight your sourcecode with pygments before posting it there.'),
- 'BmpImageFormatter': ('pygments.formatters.img', 'img_bmp', ('bmp', 'bitmap'), ('*.bmp',), 'Create a bitmap image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),
- 'GifImageFormatter': ('pygments.formatters.img', 'img_gif', ('gif',), ('*.gif',), 'Create a GIF image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),
- 'HtmlFormatter': ('pygments.formatters.html', 'HTML', ('html',), ('*.html', '*.htm'), "Format tokens as HTML 4 ``<span>`` tags within a ``<pre>`` tag, wrapped in a ``<div>`` tag. The ``<div>``'s CSS class can be set by the `cssclass` option."),
- 'IRCFormatter': ('pygments.formatters.irc', 'IRC', ('irc', 'IRC'), (), 'Format tokens with IRC color sequences'),
- 'ImageFormatter': ('pygments.formatters.img', 'img', ('img', 'IMG', 'png'), ('*.png',), 'Create a PNG image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),
- 'JpgImageFormatter': ('pygments.formatters.img', 'img_jpg', ('jpg', 'jpeg'), ('*.jpg',), 'Create a JPEG image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),
- 'LatexFormatter': ('pygments.formatters.latex', 'LaTeX', ('latex', 'tex'), ('*.tex',), 'Format tokens as LaTeX code. This needs the `fancyvrb` and `color` standard packages.'),
- 'NullFormatter': ('pygments.formatters.other', 'Text only', ('text', 'null'), ('*.txt',), 'Output the text unchanged without any formatting.'),
- 'RawTokenFormatter': ('pygments.formatters.other', 'Raw tokens', ('raw', 'tokens'), ('*.raw',), 'Format tokens as a raw representation for storing token streams.'),
- 'RtfFormatter': ('pygments.formatters.rtf', 'RTF', ('rtf',), ('*.rtf',), 'Format tokens as RTF markup. This formatter automatically outputs full RTF documents with color information and other useful stuff. Perfect for Copy and Paste into Microsoft(R) Word(R) documents.'),
- 'SvgFormatter': ('pygments.formatters.svg', 'SVG', ('svg',), ('*.svg',), 'Format tokens as an SVG graphics file. This formatter is still experimental. Each line of code is a ``<text>`` element with explicit ``x`` and ``y`` coordinates containing ``<tspan>`` elements with the individual token styles.'),
- 'Terminal256Formatter': ('pygments.formatters.terminal256', 'Terminal256', ('terminal256', 'console256', '256'), (), 'Format tokens with ANSI color sequences, for output in a 256-color terminal or console. Like in `TerminalFormatter` color sequences are terminated at newlines, so that paging the output works correctly.'),
- 'TerminalFormatter': ('pygments.formatters.terminal', 'Terminal', ('terminal', 'console'), (), 'Format tokens with ANSI color sequences, for output in a text console. Color sequences are terminated at newlines, so that paging the output works correctly.'),
- 'TerminalTrueColorFormatter': ('pygments.formatters.terminal256', 'TerminalTrueColor', ('terminal16m', 'console16m', '16m'), (), 'Format tokens with ANSI color sequences, for output in a true-color terminal or console. Like in `TerminalFormatter` color sequences are terminated at newlines, so that paging the output works correctly.'),
- 'TestcaseFormatter': ('pygments.formatters.other', 'Testcase', ('testcase',), (), 'Format tokens as appropriate for a new testcase.')
-}
-
-if __name__ == '__main__': # pragma: no cover
- import sys
- import os
-
- # lookup formatters
- found_formatters = []
- imports = []
- sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
- from pygments.util import docstring_headline
-
- for root, dirs, files in os.walk('.'):
- for filename in files:
- if filename.endswith('.py') and not filename.startswith('_'):
- module_name = 'pygments.formatters%s.%s' % (
- root[1:].replace('/', '.'), filename[:-3])
- print(module_name)
- module = __import__(module_name, None, None, [''])
- for formatter_name in module.__all__:
- formatter = getattr(module, formatter_name)
- found_formatters.append(
- '%r: %r' % (formatter_name,
- (module_name,
- formatter.name,
- tuple(formatter.aliases),
- tuple(formatter.filenames),
- docstring_headline(formatter))))
- # sort them to make the diff minimal
- found_formatters.sort()
-
- # extract useful sourcecode from this file
- with open(__file__) as fp:
- content = fp.read()
- # replace crnl to nl for Windows.
- #
- # Note that, originally, contributers should keep nl of master
- # repository, for example by using some kind of automatic
- # management EOL, like `EolExtension
- # <https://www.mercurial-scm.org/wiki/EolExtension>`.
- content = content.replace("\r\n", "\n")
- header = content[:content.find('FORMATTERS = {')]
- footer = content[content.find("if __name__ == '__main__':"):]
-
- # write new file
- with open(__file__, 'w') as fp:
- fp.write(header)
- fp.write('FORMATTERS = {\n %s\n}\n\n' % ',\n '.join(found_formatters))
- fp.write(footer)
-
- print ('=== %d formatters processed.' % len(found_formatters))
diff --git a/pygments/formatters/bbcode.py b/pygments/formatters/bbcode.py
deleted file mode 100644
index 784aee3a..00000000
--- a/pygments/formatters/bbcode.py
+++ /dev/null
@@ -1,109 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.bbcode
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- BBcode formatter.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-
-from pygments.formatter import Formatter
-from pygments.util import get_bool_opt
-
-__all__ = ['BBCodeFormatter']
-
-
-class BBCodeFormatter(Formatter):
- """
- Format tokens with BBcodes. These formatting codes are used by many
- bulletin boards, so you can highlight your sourcecode with pygments before
- posting it there.
-
- This formatter has no support for background colors and borders, as there
- are no common BBcode tags for that.
-
- Some board systems (e.g. phpBB) don't support colors in their [code] tag,
- so you can't use the highlighting together with that tag.
- Text in a [code] tag usually is shown with a monospace font (which this
- formatter can do with the ``monofont`` option) and no spaces (which you
- need for indentation) are removed.
-
- Additional options accepted:
-
- `style`
- The style to use, can be a string or a Style subclass (default:
- ``'default'``).
-
- `codetag`
- If set to true, put the output into ``[code]`` tags (default:
- ``false``)
-
- `monofont`
- If set to true, add a tag to show the code with a monospace font
- (default: ``false``).
- """
- name = 'BBCode'
- aliases = ['bbcode', 'bb']
- filenames = []
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
- self._code = get_bool_opt(options, 'codetag', False)
- self._mono = get_bool_opt(options, 'monofont', False)
-
- self.styles = {}
- self._make_styles()
-
- def _make_styles(self):
- for ttype, ndef in self.style:
- start = end = ''
- if ndef['color']:
- start += '[color=#%s]' % ndef['color']
- end = '[/color]' + end
- if ndef['bold']:
- start += '[b]'
- end = '[/b]' + end
- if ndef['italic']:
- start += '[i]'
- end = '[/i]' + end
- if ndef['underline']:
- start += '[u]'
- end = '[/u]' + end
- # there are no common BBcodes for background-color and border
-
- self.styles[ttype] = start, end
-
- def format_unencoded(self, tokensource, outfile):
- if self._code:
- outfile.write('[code]')
- if self._mono:
- outfile.write('[font=monospace]')
-
- lastval = ''
- lasttype = None
-
- for ttype, value in tokensource:
- while ttype not in self.styles:
- ttype = ttype.parent
- if ttype == lasttype:
- lastval += value
- else:
- if lastval:
- start, end = self.styles[lasttype]
- outfile.write(''.join((start, lastval, end)))
- lastval = value
- lasttype = ttype
-
- if lastval:
- start, end = self.styles[lasttype]
- outfile.write(''.join((start, lastval, end)))
-
- if self._mono:
- outfile.write('[/font]')
- if self._code:
- outfile.write('[/code]')
- if self._code or self._mono:
- outfile.write('\n')
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py
deleted file mode 100644
index d65c09ce..00000000
--- a/pygments/formatters/html.py
+++ /dev/null
@@ -1,880 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.html
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Formatter for HTML output.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import os
-import sys
-import os.path
-
-from pygments.formatter import Formatter
-from pygments.token import Token, Text, STANDARD_TYPES
-from pygments.util import get_bool_opt, get_int_opt, get_list_opt, \
- StringIO, string_types, iteritems
-
-try:
- import ctags
-except ImportError:
- ctags = None
-
-__all__ = ['HtmlFormatter']
-
-
-_escape_html_table = {
- ord('&'): u'&amp;',
- ord('<'): u'&lt;',
- ord('>'): u'&gt;',
- ord('"'): u'&quot;',
- ord("'"): u'&#39;',
-}
-
-
-def escape_html(text, table=_escape_html_table):
- """Escape &, <, > as well as single and double quotes for HTML."""
- return text.translate(table)
-
-def webify(color):
- if color.startswith('calc') or color.startswith('var'):
- return color
- else:
- return '#' + color
-
-def _get_ttype_class(ttype):
- fname = STANDARD_TYPES.get(ttype)
- if fname:
- return fname
- aname = ''
- while fname is None:
- aname = '-' + ttype[-1] + aname
- ttype = ttype.parent
- fname = STANDARD_TYPES.get(ttype)
- return fname + aname
-
-
-CSSFILE_TEMPLATE = '''\
-/*
-generated by Pygments <http://pygments.org>
-Copyright 2006-2019 by the Pygments team.
-Licensed under the BSD license, see LICENSE for details.
-*/
-td.linenos { background-color: #f0f0f0; padding-right: 10px; }
-span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
-pre { line-height: 125%%; }
-%(styledefs)s
-'''
-
-DOC_HEADER = '''\
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<!--
-generated by Pygments <http://pygments.org>
-Copyright 2006-2019 by the Pygments team.
-Licensed under the BSD license, see LICENSE for details.
--->
-<html>
-<head>
- <title>%(title)s</title>
- <meta http-equiv="content-type" content="text/html; charset=%(encoding)s">
- <style type="text/css">
-''' + CSSFILE_TEMPLATE + '''
- </style>
-</head>
-<body>
-<h2>%(title)s</h2>
-
-'''
-
-DOC_HEADER_EXTERNALCSS = '''\
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
- <title>%(title)s</title>
- <meta http-equiv="content-type" content="text/html; charset=%(encoding)s">
- <link rel="stylesheet" href="%(cssfile)s" type="text/css">
-</head>
-<body>
-<h2>%(title)s</h2>
-
-'''
-
-DOC_FOOTER = '''\
-</body>
-</html>
-'''
-
-
-class HtmlFormatter(Formatter):
- r"""
- Format tokens as HTML 4 ``<span>`` tags within a ``<pre>`` tag, wrapped
- in a ``<div>`` tag. The ``<div>``'s CSS class can be set by the `cssclass`
- option.
-
- If the `linenos` option is set to ``"table"``, the ``<pre>`` is
- additionally wrapped inside a ``<table>`` which has one row and two
- cells: one containing the line numbers and one containing the code.
- Example:
-
- .. sourcecode:: html
-
- <div class="highlight" >
- <table><tr>
- <td class="linenos" title="click to toggle"
- onclick="with (this.firstChild.style)
- { display = (display == '') ? 'none' : '' }">
- <pre>1
- 2</pre>
- </td>
- <td class="code">
- <pre><span class="Ke">def </span><span class="NaFu">foo</span>(bar):
- <span class="Ke">pass</span>
- </pre>
- </td>
- </tr></table></div>
-
- (whitespace added to improve clarity).
-
- Wrapping can be disabled using the `nowrap` option.
-
- A list of lines can be specified using the `hl_lines` option to make these
- lines highlighted (as of Pygments 0.11).
-
- With the `full` option, a complete HTML 4 document is output, including
- the style definitions inside a ``<style>`` tag, or in a separate file if
- the `cssfile` option is given.
-
- When `tagsfile` is set to the path of a ctags index file, it is used to
- generate hyperlinks from names to their definition. You must enable
- `lineanchors` and run ctags with the `-n` option for this to work. The
- `python-ctags` module from PyPI must be installed to use this feature;
- otherwise a `RuntimeError` will be raised.
-
- The `get_style_defs(arg='')` method of a `HtmlFormatter` returns a string
- containing CSS rules for the CSS classes used by the formatter. The
- argument `arg` can be used to specify additional CSS selectors that
- are prepended to the classes. A call `fmter.get_style_defs('td .code')`
- would result in the following CSS classes:
-
- .. sourcecode:: css
-
- td .code .kw { font-weight: bold; color: #00FF00 }
- td .code .cm { color: #999999 }
- ...
-
- If you have Pygments 0.6 or higher, you can also pass a list or tuple to the
- `get_style_defs()` method to request multiple prefixes for the tokens:
-
- .. sourcecode:: python
-
- formatter.get_style_defs(['div.syntax pre', 'pre.syntax'])
-
- The output would then look like this:
-
- .. sourcecode:: css
-
- div.syntax pre .kw,
- pre.syntax .kw { font-weight: bold; color: #00FF00 }
- div.syntax pre .cm,
- pre.syntax .cm { color: #999999 }
- ...
-
- Additional options accepted:
-
- `nowrap`
- If set to ``True``, don't wrap the tokens at all, not even inside a ``<pre>``
- tag. This disables most other options (default: ``False``).
-
- `full`
- Tells the formatter to output a "full" document, i.e. a complete
- self-contained document (default: ``False``).
-
- `title`
- If `full` is true, the title that should be used to caption the
- document (default: ``''``).
-
- `style`
- The style to use, can be a string or a Style subclass (default:
- ``'default'``). This option has no effect if the `cssfile`
- and `noclobber_cssfile` option are given and the file specified in
- `cssfile` exists.
-
- `noclasses`
- If set to true, token ``<span>`` tags will not use CSS classes, but
- inline styles. This is not recommended for larger pieces of code since
- it increases output size by quite a bit (default: ``False``).
-
- `classprefix`
- Since the token types use relatively short class names, they may clash
- with some of your own class names. In this case you can use the
- `classprefix` option to give a string to prepend to all Pygments-generated
- CSS class names for token types.
- Note that this option also affects the output of `get_style_defs()`.
-
- `cssclass`
- CSS class for the wrapping ``<div>`` tag (default: ``'highlight'``).
- If you set this option, the default selector for `get_style_defs()`
- will be this class.
-
- .. versionadded:: 0.9
- If you select the ``'table'`` line numbers, the wrapping table will
- have a CSS class of this string plus ``'table'``, the default is
- accordingly ``'highlighttable'``.
-
- `cssstyles`
- Inline CSS styles for the wrapping ``<div>`` tag (default: ``''``).
-
- `prestyles`
- Inline CSS styles for the ``<pre>`` tag (default: ``''``).
-
- .. versionadded:: 0.11
-
- `cssfile`
- If the `full` option is true and this option is given, it must be the
- name of an external file. If the filename does not include an absolute
- path, the file's path will be assumed to be relative to the main output
- file's path, if the latter can be found. The stylesheet is then written
- to this file instead of the HTML file.
-
- .. versionadded:: 0.6
-
- `noclobber_cssfile`
- If `cssfile` is given and the specified file exists, the css file will
- not be overwritten. This allows the use of the `full` option in
- combination with a user specified css file. Default is ``False``.
-
- .. versionadded:: 1.1
-
- `linenos`
- If set to ``'table'``, output line numbers as a table with two cells,
- one containing the line numbers, the other the whole code. This is
- copy-and-paste-friendly, but may cause alignment problems with some
- browsers or fonts. If set to ``'inline'``, the line numbers will be
- integrated in the ``<pre>`` tag that contains the code (that setting
- is *new in Pygments 0.8*).
-
- For compatibility with Pygments 0.7 and earlier, every true value
- except ``'inline'`` means the same as ``'table'`` (in particular, that
- means also ``True``).
-
- The default value is ``False``, which means no line numbers at all.
-
- **Note:** with the default ("table") line number mechanism, the line
- numbers and code can have different line heights in Internet Explorer
- unless you give the enclosing ``<pre>`` tags an explicit ``line-height``
- CSS property (you get the default line spacing with ``line-height:
- 125%``).
-
- `hl_lines`
- Specify a list of lines to be highlighted.
-
- .. versionadded:: 0.11
-
- `linenostart`
- The line number for the first line (default: ``1``).
-
- `linenostep`
- If set to a number n > 1, only every nth line number is printed.
-
- `linenospecial`
- If set to a number n > 0, every nth line number is given the CSS
- class ``"special"`` (default: ``0``).
-
- `nobackground`
- If set to ``True``, the formatter won't output the background color
- for the wrapping element (this automatically defaults to ``False``
- when there is no wrapping element [eg: no argument for the
- `get_syntax_defs` method given]) (default: ``False``).
-
- .. versionadded:: 0.6
-
- `lineseparator`
- This string is output between lines of code. It defaults to ``"\n"``,
- which is enough to break a line inside ``<pre>`` tags, but you can
- e.g. set it to ``"<br>"`` to get HTML line breaks.
-
- .. versionadded:: 0.7
-
- `lineanchors`
- If set to a nonempty string, e.g. ``foo``, the formatter will wrap each
- output line in an anchor tag with a ``name`` of ``foo-linenumber``.
- This allows easy linking to certain lines.
-
- .. versionadded:: 0.9
-
- `linespans`
- If set to a nonempty string, e.g. ``foo``, the formatter will wrap each
- output line in a span tag with an ``id`` of ``foo-linenumber``.
- This allows easy access to lines via javascript.
-
- .. versionadded:: 1.6
-
- `anchorlinenos`
- If set to `True`, will wrap line numbers in <a> tags. Used in
- combination with `linenos` and `lineanchors`.
-
- `tagsfile`
- If set to the path of a ctags file, wrap names in anchor tags that
- link to their definitions. `lineanchors` should be used, and the
- tags file should specify line numbers (see the `-n` option to ctags).
-
- .. versionadded:: 1.6
-
- `tagurlformat`
- A string formatting pattern used to generate links to ctags definitions.
- Available variables are `%(path)s`, `%(fname)s` and `%(fext)s`.
- Defaults to an empty string, resulting in just `#prefix-number` links.
-
- .. versionadded:: 1.6
-
- `filename`
- A string used to generate a filename when rendering ``<pre>`` blocks,
- for example if displaying source code.
-
- .. versionadded:: 2.1
-
- `wrapcode`
- Wrap the code inside ``<pre>`` blocks using ``<code>``, as recommended
- by the HTML5 specification.
-
- .. versionadded:: 2.4
-
-
- **Subclassing the HTML formatter**
-
- .. versionadded:: 0.7
-
- The HTML formatter is now built in a way that allows easy subclassing, thus
- customizing the output HTML code. The `format()` method calls
- `self._format_lines()` which returns a generator that yields tuples of ``(1,
- line)``, where the ``1`` indicates that the ``line`` is a line of the
- formatted source code.
-
- If the `nowrap` option is set, the generator is the iterated over and the
- resulting HTML is output.
-
- Otherwise, `format()` calls `self.wrap()`, which wraps the generator with
- other generators. These may add some HTML code to the one generated by
- `_format_lines()`, either by modifying the lines generated by the latter,
- then yielding them again with ``(1, line)``, and/or by yielding other HTML
- code before or after the lines, with ``(0, html)``. The distinction between
- source lines and other code makes it possible to wrap the generator multiple
- times.
-
- The default `wrap()` implementation adds a ``<div>`` and a ``<pre>`` tag.
-
- A custom `HtmlFormatter` subclass could look like this:
-
- .. sourcecode:: python
-
- class CodeHtmlFormatter(HtmlFormatter):
-
- def wrap(self, source, outfile):
- return self._wrap_code(source)
-
- def _wrap_code(self, source):
- yield 0, '<code>'
- for i, t in source:
- if i == 1:
- # it's a line of formatted code
- t += '<br>'
- yield i, t
- yield 0, '</code>'
-
- This results in wrapping the formatted lines with a ``<code>`` tag, where the
- source lines are broken using ``<br>`` tags.
-
- After calling `wrap()`, the `format()` method also adds the "line numbers"
- and/or "full document" wrappers if the respective options are set. Then, all
- HTML yielded by the wrapped generator is output.
- """
-
- name = 'HTML'
- aliases = ['html']
- filenames = ['*.html', '*.htm']
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
- self.title = self._decodeifneeded(self.title)
- self.nowrap = get_bool_opt(options, 'nowrap', False)
- self.noclasses = get_bool_opt(options, 'noclasses', False)
- self.classprefix = options.get('classprefix', '')
- self.cssclass = self._decodeifneeded(options.get('cssclass', 'highlight'))
- self.cssstyles = self._decodeifneeded(options.get('cssstyles', ''))
- self.prestyles = self._decodeifneeded(options.get('prestyles', ''))
- self.cssfile = self._decodeifneeded(options.get('cssfile', ''))
- self.noclobber_cssfile = get_bool_opt(options, 'noclobber_cssfile', False)
- self.tagsfile = self._decodeifneeded(options.get('tagsfile', ''))
- self.tagurlformat = self._decodeifneeded(options.get('tagurlformat', ''))
- self.filename = self._decodeifneeded(options.get('filename', ''))
- self.wrapcode = get_bool_opt(options, 'wrapcode', False)
-
- if self.tagsfile:
- if not ctags:
- raise RuntimeError('The "ctags" package must to be installed '
- 'to be able to use the "tagsfile" feature.')
- self._ctags = ctags.CTags(self.tagsfile)
-
- linenos = options.get('linenos', False)
- if linenos == 'inline':
- self.linenos = 2
- elif linenos:
- # compatibility with <= 0.7
- self.linenos = 1
- else:
- self.linenos = 0
- self.linenostart = abs(get_int_opt(options, 'linenostart', 1))
- self.linenostep = abs(get_int_opt(options, 'linenostep', 1))
- self.linenospecial = abs(get_int_opt(options, 'linenospecial', 0))
- self.nobackground = get_bool_opt(options, 'nobackground', False)
- self.lineseparator = options.get('lineseparator', '\n')
- self.lineanchors = options.get('lineanchors', '')
- self.linespans = options.get('linespans', '')
- self.anchorlinenos = options.get('anchorlinenos', False)
- self.hl_lines = set()
- for lineno in get_list_opt(options, 'hl_lines', []):
- try:
- self.hl_lines.add(int(lineno))
- except ValueError:
- pass
-
- self._create_stylesheet()
-
- def _get_css_class(self, ttype):
- """Return the css class of this token type prefixed with
- the classprefix option."""
- ttypeclass = _get_ttype_class(ttype)
- if ttypeclass:
- return self.classprefix + ttypeclass
- return ''
-
- def _get_css_classes(self, ttype):
- """Return the css classes of this token type prefixed with
- the classprefix option."""
- cls = self._get_css_class(ttype)
- while ttype not in STANDARD_TYPES:
- ttype = ttype.parent
- cls = self._get_css_class(ttype) + ' ' + cls
- return cls
-
- def _create_stylesheet(self):
- t2c = self.ttype2class = {Token: ''}
- c2s = self.class2style = {}
- for ttype, ndef in self.style:
- name = self._get_css_class(ttype)
- style = ''
- if ndef['color']:
- style += 'color: %s; ' % webify(ndef['color'])
- if ndef['bold']:
- style += 'font-weight: bold; '
- if ndef['italic']:
- style += 'font-style: italic; '
- if ndef['underline']:
- style += 'text-decoration: underline; '
- if ndef['bgcolor']:
- style += 'background-color: %s; ' % webify(ndef['bgcolor'])
- if ndef['border']:
- style += 'border: 1px solid %s; ' % webify(ndef['border'])
- if style:
- t2c[ttype] = name
- # save len(ttype) to enable ordering the styles by
- # hierarchy (necessary for CSS cascading rules!)
- c2s[name] = (style[:-2], ttype, len(ttype))
-
- def get_style_defs(self, arg=None):
- """
- Return CSS style definitions for the classes produced by the current
- highlighting style. ``arg`` can be a string or list of selectors to
- insert before the token type classes.
- """
- if arg is None:
- arg = ('cssclass' in self.options and '.'+self.cssclass or '')
- if isinstance(arg, string_types):
- args = [arg]
- else:
- args = list(arg)
-
- def prefix(cls):
- if cls:
- cls = '.' + cls
- tmp = []
- for arg in args:
- tmp.append((arg and arg + ' ' or '') + cls)
- return ', '.join(tmp)
-
- styles = [(level, ttype, cls, style)
- for cls, (style, ttype, level) in iteritems(self.class2style)
- if cls and style]
- styles.sort()
- lines = ['%s { %s } /* %s */' % (prefix(cls), style, repr(ttype)[6:])
- for (level, ttype, cls, style) in styles]
- if arg and not self.nobackground and \
- self.style.background_color is not None:
- text_style = ''
- if Text in self.ttype2class:
- text_style = ' ' + self.class2style[self.ttype2class[Text]][0]
- lines.insert(0, '%s { background: %s;%s }' %
- (prefix(''), self.style.background_color, text_style))
- if self.style.highlight_color is not None:
- lines.insert(0, '%s.hll { background-color: %s }' %
- (prefix(''), self.style.highlight_color))
- return '\n'.join(lines)
-
- def _decodeifneeded(self, value):
- if isinstance(value, bytes):
- if self.encoding:
- return value.decode(self.encoding)
- return value.decode()
- return value
-
- def _wrap_full(self, inner, outfile):
- if self.cssfile:
- if os.path.isabs(self.cssfile):
- # it's an absolute filename
- cssfilename = self.cssfile
- else:
- try:
- filename = outfile.name
- if not filename or filename[0] == '<':
- # pseudo files, e.g. name == '<fdopen>'
- raise AttributeError
- cssfilename = os.path.join(os.path.dirname(filename),
- self.cssfile)
- except AttributeError:
- print('Note: Cannot determine output file name, '
- 'using current directory as base for the CSS file name',
- file=sys.stderr)
- cssfilename = self.cssfile
- # write CSS file only if noclobber_cssfile isn't given as an option.
- try:
- if not os.path.exists(cssfilename) or not self.noclobber_cssfile:
- with open(cssfilename, "w") as cf:
- cf.write(CSSFILE_TEMPLATE %
- {'styledefs': self.get_style_defs('body')})
- except IOError as err:
- err.strerror = 'Error writing CSS file: ' + err.strerror
- raise
-
- yield 0, (DOC_HEADER_EXTERNALCSS %
- dict(title=self.title,
- cssfile=self.cssfile,
- encoding=self.encoding))
- else:
- yield 0, (DOC_HEADER %
- dict(title=self.title,
- styledefs=self.get_style_defs('body'),
- encoding=self.encoding))
-
- for t, line in inner:
- yield t, line
- yield 0, DOC_FOOTER
-
- def _wrap_tablelinenos(self, inner):
- dummyoutfile = StringIO()
- lncount = 0
- for t, line in inner:
- if t:
- lncount += 1
- dummyoutfile.write(line)
-
- fl = self.linenostart
- mw = len(str(lncount + fl - 1))
- sp = self.linenospecial
- st = self.linenostep
- la = self.lineanchors
- aln = self.anchorlinenos
- nocls = self.noclasses
- if sp:
- lines = []
-
- for i in range(fl, fl+lncount):
- if i % st == 0:
- if i % sp == 0:
- if aln:
- lines.append('<a href="#%s-%d" class="special">%*d</a>' %
- (la, i, mw, i))
- else:
- lines.append('<span class="special">%*d</span>' % (mw, i))
- else:
- if aln:
- lines.append('<a href="#%s-%d">%*d</a>' % (la, i, mw, i))
- else:
- lines.append('%*d' % (mw, i))
- else:
- lines.append('')
- ls = '\n'.join(lines)
- else:
- lines = []
- for i in range(fl, fl+lncount):
- if i % st == 0:
- if aln:
- lines.append('<a href="#%s-%d">%*d</a>' % (la, i, mw, i))
- else:
- lines.append('%*d' % (mw, i))
- else:
- lines.append('')
- ls = '\n'.join(lines)
-
- # in case you wonder about the seemingly redundant <div> here: since the
- # content in the other cell also is wrapped in a div, some browsers in
- # some configurations seem to mess up the formatting...
- if nocls:
- yield 0, ('<table class="%stable">' % self.cssclass +
- '<tr><td><div class="linenodiv" '
- 'style="background-color: #f0f0f0; padding-right: 10px">'
- '<pre style="line-height: 125%">' +
- ls + '</pre></div></td><td class="code">')
- else:
- yield 0, ('<table class="%stable">' % self.cssclass +
- '<tr><td class="linenos"><div class="linenodiv"><pre>' +
- ls + '</pre></div></td><td class="code">')
- yield 0, dummyoutfile.getvalue()
- yield 0, '</td></tr></table>'
-
- def _wrap_inlinelinenos(self, inner):
- # need a list of lines since we need the width of a single number :(
- lines = list(inner)
- sp = self.linenospecial
- st = self.linenostep
- num = self.linenostart
- mw = len(str(len(lines) + num - 1))
-
- if self.noclasses:
- if sp:
- for t, line in lines:
- if num % sp == 0:
- style = 'background-color: #ffffc0; padding: 0 5px 0 5px'
- else:
- style = 'background-color: #f0f0f0; padding: 0 5px 0 5px'
- yield 1, '<span style="%s">%*s </span>' % (
- style, mw, (num % st and ' ' or num)) + line
- num += 1
- else:
- for t, line in lines:
- yield 1, ('<span style="background-color: #f0f0f0; '
- 'padding: 0 5px 0 5px">%*s </span>' % (
- mw, (num % st and ' ' or num)) + line)
- num += 1
- elif sp:
- for t, line in lines:
- yield 1, '<span class="lineno%s">%*s </span>' % (
- num % sp == 0 and ' special' or '', mw,
- (num % st and ' ' or num)) + line
- num += 1
- else:
- for t, line in lines:
- yield 1, '<span class="lineno">%*s </span>' % (
- mw, (num % st and ' ' or num)) + line
- num += 1
-
- def _wrap_lineanchors(self, inner):
- s = self.lineanchors
- # subtract 1 since we have to increment i *before* yielding
- i = self.linenostart - 1
- for t, line in inner:
- if t:
- i += 1
- yield 1, '<a name="%s-%d"></a>' % (s, i) + line
- else:
- yield 0, line
-
- def _wrap_linespans(self, inner):
- s = self.linespans
- i = self.linenostart - 1
- for t, line in inner:
- if t:
- i += 1
- yield 1, '<span id="%s-%d">%s</span>' % (s, i, line)
- else:
- yield 0, line
-
- def _wrap_div(self, inner):
- style = []
- if (self.noclasses and not self.nobackground and
- self.style.background_color is not None):
- style.append('background: %s' % (self.style.background_color,))
- if self.cssstyles:
- style.append(self.cssstyles)
- style = '; '.join(style)
-
- yield 0, ('<div' + (self.cssclass and ' class="%s"' % self.cssclass) +
- (style and (' style="%s"' % style)) + '>')
- for tup in inner:
- yield tup
- yield 0, '</div>\n'
-
- def _wrap_pre(self, inner):
- style = []
- if self.prestyles:
- style.append(self.prestyles)
- if self.noclasses:
- style.append('line-height: 125%')
- style = '; '.join(style)
-
- if self.filename:
- yield 0, ('<span class="filename">' + self.filename + '</span>')
-
- # the empty span here is to keep leading empty lines from being
- # ignored by HTML parsers
- yield 0, ('<pre' + (style and ' style="%s"' % style) + '><span></span>')
- for tup in inner:
- yield tup
- yield 0, '</pre>'
-
- def _wrap_code(self, inner):
- yield 0, '<code>'
- for tup in inner:
- yield tup
- yield 0, '</code>'
-
- def _format_lines(self, tokensource):
- """
- Just format the tokens, without any wrapping tags.
- Yield individual lines.
- """
- nocls = self.noclasses
- lsep = self.lineseparator
- # for <span style=""> lookup only
- getcls = self.ttype2class.get
- c2s = self.class2style
- escape_table = _escape_html_table
- tagsfile = self.tagsfile
-
- lspan = ''
- line = []
- for ttype, value in tokensource:
- if nocls:
- cclass = getcls(ttype)
- while cclass is None:
- ttype = ttype.parent
- cclass = getcls(ttype)
- cspan = cclass and '<span style="%s">' % c2s[cclass][0] or ''
- else:
- cls = self._get_css_classes(ttype)
- cspan = cls and '<span class="%s">' % cls or ''
-
- parts = value.translate(escape_table).split('\n')
-
- if tagsfile and ttype in Token.Name:
- filename, linenumber = self._lookup_ctag(value)
- if linenumber:
- base, filename = os.path.split(filename)
- if base:
- base += '/'
- filename, extension = os.path.splitext(filename)
- url = self.tagurlformat % {'path': base, 'fname': filename,
- 'fext': extension}
- parts[0] = "<a href=\"%s#%s-%d\">%s" % \
- (url, self.lineanchors, linenumber, parts[0])
- parts[-1] = parts[-1] + "</a>"
-
- # for all but the last line
- for part in parts[:-1]:
- if line:
- if lspan != cspan:
- line.extend(((lspan and '</span>'), cspan, part,
- (cspan and '</span>'), lsep))
- else: # both are the same
- line.extend((part, (lspan and '</span>'), lsep))
- yield 1, ''.join(line)
- line = []
- elif part:
- yield 1, ''.join((cspan, part, (cspan and '</span>'), lsep))
- else:
- yield 1, lsep
- # for the last line
- if line and parts[-1]:
- if lspan != cspan:
- line.extend(((lspan and '</span>'), cspan, parts[-1]))
- lspan = cspan
- else:
- line.append(parts[-1])
- elif parts[-1]:
- line = [cspan, parts[-1]]
- lspan = cspan
- # else we neither have to open a new span nor set lspan
-
- if line:
- line.extend(((lspan and '</span>'), lsep))
- yield 1, ''.join(line)
-
- def _lookup_ctag(self, token):
- entry = ctags.TagEntry()
- if self._ctags.find(entry, token, 0):
- return entry['file'], entry['lineNumber']
- else:
- return None, None
-
- def _highlight_lines(self, tokensource):
- """
- Highlighted the lines specified in the `hl_lines` option by
- post-processing the token stream coming from `_format_lines`.
- """
- hls = self.hl_lines
-
- for i, (t, value) in enumerate(tokensource):
- if t != 1:
- yield t, value
- if i + 1 in hls: # i + 1 because Python indexes start at 0
- if self.noclasses:
- style = ''
- if self.style.highlight_color is not None:
- style = (' style="background-color: %s"' %
- (self.style.highlight_color,))
- yield 1, '<span%s>%s</span>' % (style, value)
- else:
- yield 1, '<span class="hll">%s</span>' % value
- else:
- yield 1, value
-
- def wrap(self, source, outfile):
- """
- Wrap the ``source``, which is a generator yielding
- individual lines, in custom generators. See docstring
- for `format`. Can be overridden.
- """
- if self.wrapcode:
- return self._wrap_div(self._wrap_pre(self._wrap_code(source)))
- else:
- return self._wrap_div(self._wrap_pre(source))
-
- def format_unencoded(self, tokensource, outfile):
- """
- The formatting process uses several nested generators; which of
- them are used is determined by the user's options.
-
- Each generator should take at least one argument, ``inner``,
- and wrap the pieces of text generated by this.
-
- Always yield 2-tuples: (code, text). If "code" is 1, the text
- is part of the original tokensource being highlighted, if it's
- 0, the text is some piece of wrapping. This makes it possible to
- use several different wrappers that process the original source
- linewise, e.g. line number generators.
- """
- source = self._format_lines(tokensource)
- if self.hl_lines:
- source = self._highlight_lines(source)
- if not self.nowrap:
- if self.linenos == 2:
- source = self._wrap_inlinelinenos(source)
- if self.lineanchors:
- source = self._wrap_lineanchors(source)
- if self.linespans:
- source = self._wrap_linespans(source)
- source = self.wrap(source, outfile)
- if self.linenos == 1:
- source = self._wrap_tablelinenos(source)
- if self.full:
- source = self._wrap_full(source, outfile)
-
- for t, piece in source:
- outfile.write(piece)
diff --git a/pygments/formatters/img.py b/pygments/formatters/img.py
deleted file mode 100644
index de0ea0a4..00000000
--- a/pygments/formatters/img.py
+++ /dev/null
@@ -1,600 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.img
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Formatter for Pixmap output.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import os
-import sys
-
-from pygments.formatter import Formatter
-from pygments.util import get_bool_opt, get_int_opt, get_list_opt, \
- get_choice_opt, xrange
-
-import subprocess
-
-# Import this carefully
-try:
- from PIL import Image, ImageDraw, ImageFont
- pil_available = True
-except ImportError:
- pil_available = False
-
-try:
- import _winreg
-except ImportError:
- try:
- import winreg as _winreg
- except ImportError:
- _winreg = None
-
-__all__ = ['ImageFormatter', 'GifImageFormatter', 'JpgImageFormatter',
- 'BmpImageFormatter']
-
-
-# For some unknown reason every font calls it something different
-STYLES = {
- 'NORMAL': ['', 'Roman', 'Book', 'Normal', 'Regular', 'Medium'],
- 'ITALIC': ['Oblique', 'Italic'],
- 'BOLD': ['Bold'],
- 'BOLDITALIC': ['Bold Oblique', 'Bold Italic'],
-}
-
-# A sane default for modern systems
-DEFAULT_FONT_NAME_NIX = 'Bitstream Vera Sans Mono'
-DEFAULT_FONT_NAME_WIN = 'Courier New'
-DEFAULT_FONT_NAME_MAC = 'Courier New'
-
-
-class PilNotAvailable(ImportError):
- """When Python imaging library is not available"""
-
-
-class FontNotFound(Exception):
- """When there are no usable fonts specified"""
-
-
-class FontManager(object):
- """
- Manages a set of fonts: normal, italic, bold, etc...
- """
-
- def __init__(self, font_name, font_size=14):
- self.font_name = font_name
- self.font_size = font_size
- self.fonts = {}
- self.encoding = None
- if sys.platform.startswith('win'):
- if not font_name:
- self.font_name = DEFAULT_FONT_NAME_WIN
- self._create_win()
- elif sys.platform.startswith('darwin'):
- if not font_name:
- self.font_name = DEFAULT_FONT_NAME_MAC
- self._create_mac()
- else:
- if not font_name:
- self.font_name = DEFAULT_FONT_NAME_NIX
- self._create_nix()
-
- def _get_nix_font_path(self, name, style):
- proc = subprocess.Popen(['fc-list', "%s:style=%s" % (name, style), 'file'],
- stdout=subprocess.PIPE, stderr=None)
- stdout, _ = proc.communicate()
- if proc.returncode == 0:
- lines = stdout.splitlines()
- for line in lines:
- if line.startswith(b'Fontconfig warning:'):
- continue
- path = line.decode().strip().strip(':')
- if path:
- return path
- return None
-
- def _create_nix(self):
- for name in STYLES['NORMAL']:
- path = self._get_nix_font_path(self.font_name, name)
- if path is not None:
- self.fonts['NORMAL'] = ImageFont.truetype(path, self.font_size)
- break
- else:
- raise FontNotFound('No usable fonts named: "%s"' %
- self.font_name)
- for style in ('ITALIC', 'BOLD', 'BOLDITALIC'):
- for stylename in STYLES[style]:
- path = self._get_nix_font_path(self.font_name, stylename)
- if path is not None:
- self.fonts[style] = ImageFont.truetype(path, self.font_size)
- break
- else:
- if style == 'BOLDITALIC':
- self.fonts[style] = self.fonts['BOLD']
- else:
- self.fonts[style] = self.fonts['NORMAL']
-
- def _get_mac_font_path(self, font_map, name, style):
- return font_map.get((name + ' ' + style).strip().lower())
-
- def _create_mac(self):
- font_map = {}
- for font_dir in (os.path.join(os.getenv("HOME"), 'Library/Fonts/'),
- '/Library/Fonts/', '/System/Library/Fonts/'):
- font_map.update(
- ((os.path.splitext(f)[0].lower(), os.path.join(font_dir, f))
- for f in os.listdir(font_dir) if f.lower().endswith('ttf')))
-
- for name in STYLES['NORMAL']:
- path = self._get_mac_font_path(font_map, self.font_name, name)
- if path is not None:
- self.fonts['NORMAL'] = ImageFont.truetype(path, self.font_size)
- break
- else:
- raise FontNotFound('No usable fonts named: "%s"' %
- self.font_name)
- for style in ('ITALIC', 'BOLD', 'BOLDITALIC'):
- for stylename in STYLES[style]:
- path = self._get_mac_font_path(font_map, self.font_name, stylename)
- if path is not None:
- self.fonts[style] = ImageFont.truetype(path, self.font_size)
- break
- else:
- if style == 'BOLDITALIC':
- self.fonts[style] = self.fonts['BOLD']
- else:
- self.fonts[style] = self.fonts['NORMAL']
-
- def _lookup_win(self, key, basename, styles, fail=False):
- for suffix in ('', ' (TrueType)'):
- for style in styles:
- try:
- valname = '%s%s%s' % (basename, style and ' '+style, suffix)
- val, _ = _winreg.QueryValueEx(key, valname)
- return val
- except EnvironmentError:
- continue
- else:
- if fail:
- raise FontNotFound('Font %s (%s) not found in registry' %
- (basename, styles[0]))
- return None
-
- def _create_win(self):
- try:
- key = _winreg.OpenKey(
- _winreg.HKEY_LOCAL_MACHINE,
- r'Software\Microsoft\Windows NT\CurrentVersion\Fonts')
- except EnvironmentError:
- try:
- key = _winreg.OpenKey(
- _winreg.HKEY_LOCAL_MACHINE,
- r'Software\Microsoft\Windows\CurrentVersion\Fonts')
- except EnvironmentError:
- raise FontNotFound('Can\'t open Windows font registry key')
- try:
- path = self._lookup_win(key, self.font_name, STYLES['NORMAL'], True)
- self.fonts['NORMAL'] = ImageFont.truetype(path, self.font_size)
- for style in ('ITALIC', 'BOLD', 'BOLDITALIC'):
- path = self._lookup_win(key, self.font_name, STYLES[style])
- if path:
- self.fonts[style] = ImageFont.truetype(path, self.font_size)
- else:
- if style == 'BOLDITALIC':
- self.fonts[style] = self.fonts['BOLD']
- else:
- self.fonts[style] = self.fonts['NORMAL']
- finally:
- _winreg.CloseKey(key)
-
- def get_char_size(self):
- """
- Get the character size.
- """
- return self.fonts['NORMAL'].getsize('M')
-
- def get_font(self, bold, oblique):
- """
- Get the font based on bold and italic flags.
- """
- if bold and oblique:
- return self.fonts['BOLDITALIC']
- elif bold:
- return self.fonts['BOLD']
- elif oblique:
- return self.fonts['ITALIC']
- else:
- return self.fonts['NORMAL']
-
-
-class ImageFormatter(Formatter):
- """
- Create a PNG image from source code. This uses the Python Imaging Library to
- generate a pixmap from the source code.
-
- .. versionadded:: 0.10
-
- Additional options accepted:
-
- `image_format`
- An image format to output to that is recognised by PIL, these include:
-
- * "PNG" (default)
- * "JPEG"
- * "BMP"
- * "GIF"
-
- `line_pad`
- The extra spacing (in pixels) between each line of text.
-
- Default: 2
-
- `font_name`
- The font name to be used as the base font from which others, such as
- bold and italic fonts will be generated. This really should be a
- monospace font to look sane.
-
- Default: "Bitstream Vera Sans Mono" on Windows, Courier New on \\*nix
-
- `font_size`
- The font size in points to be used.
-
- Default: 14
-
- `image_pad`
- The padding, in pixels to be used at each edge of the resulting image.
-
- Default: 10
-
- `line_numbers`
- Whether line numbers should be shown: True/False
-
- Default: True
-
- `line_number_start`
- The line number of the first line.
-
- Default: 1
-
- `line_number_step`
- The step used when printing line numbers.
-
- Default: 1
-
- `line_number_bg`
- The background colour (in "#123456" format) of the line number bar, or
- None to use the style background color.
-
- Default: "#eed"
-
- `line_number_fg`
- The text color of the line numbers (in "#123456"-like format).
-
- Default: "#886"
-
- `line_number_chars`
- The number of columns of line numbers allowable in the line number
- margin.
-
- Default: 2
-
- `line_number_bold`
- Whether line numbers will be bold: True/False
-
- Default: False
-
- `line_number_italic`
- Whether line numbers will be italicized: True/False
-
- Default: False
-
- `line_number_separator`
- Whether a line will be drawn between the line number area and the
- source code area: True/False
-
- Default: True
-
- `line_number_pad`
- The horizontal padding (in pixels) between the line number margin, and
- the source code area.
-
- Default: 6
-
- `hl_lines`
- Specify a list of lines to be highlighted.
-
- .. versionadded:: 1.2
-
- Default: empty list
-
- `hl_color`
- Specify the color for highlighting lines.
-
- .. versionadded:: 1.2
-
- Default: highlight color of the selected style
- """
-
- # Required by the pygments mapper
- name = 'img'
- aliases = ['img', 'IMG', 'png']
- filenames = ['*.png']
-
- unicodeoutput = False
-
- default_image_format = 'png'
-
- def __init__(self, **options):
- """
- See the class docstring for explanation of options.
- """
- if not pil_available:
- raise PilNotAvailable(
- 'Python Imaging Library is required for this formatter')
- Formatter.__init__(self, **options)
- self.encoding = 'latin1' # let pygments.format() do the right thing
- # Read the style
- self.styles = dict(self.style)
- if self.style.background_color is None:
- self.background_color = '#fff'
- else:
- self.background_color = self.style.background_color
- # Image options
- self.image_format = get_choice_opt(
- options, 'image_format', ['png', 'jpeg', 'gif', 'bmp'],
- self.default_image_format, normcase=True)
- self.image_pad = get_int_opt(options, 'image_pad', 10)
- self.line_pad = get_int_opt(options, 'line_pad', 2)
- # The fonts
- fontsize = get_int_opt(options, 'font_size', 14)
- self.fonts = FontManager(options.get('font_name', ''), fontsize)
- self.fontw, self.fonth = self.fonts.get_char_size()
- # Line number options
- self.line_number_fg = options.get('line_number_fg', '#886')
- self.line_number_bg = options.get('line_number_bg', '#eed')
- self.line_number_chars = get_int_opt(options,
- 'line_number_chars', 2)
- self.line_number_bold = get_bool_opt(options,
- 'line_number_bold', False)
- self.line_number_italic = get_bool_opt(options,
- 'line_number_italic', False)
- self.line_number_pad = get_int_opt(options, 'line_number_pad', 6)
- self.line_numbers = get_bool_opt(options, 'line_numbers', True)
- self.line_number_separator = get_bool_opt(options,
- 'line_number_separator', True)
- self.line_number_step = get_int_opt(options, 'line_number_step', 1)
- self.line_number_start = get_int_opt(options, 'line_number_start', 1)
- if self.line_numbers:
- self.line_number_width = (self.fontw * self.line_number_chars +
- self.line_number_pad * 2)
- else:
- self.line_number_width = 0
- self.hl_lines = []
- hl_lines_str = get_list_opt(options, 'hl_lines', [])
- for line in hl_lines_str:
- try:
- self.hl_lines.append(int(line))
- except ValueError:
- pass
- self.hl_color = options.get('hl_color',
- self.style.highlight_color) or '#f90'
- self.drawables = []
-
- def get_style_defs(self, arg=''):
- raise NotImplementedError('The -S option is meaningless for the image '
- 'formatter. Use -O style=<stylename> instead.')
-
- def _get_line_height(self):
- """
- Get the height of a line.
- """
- return self.fonth + self.line_pad
-
- def _get_line_y(self, lineno):
- """
- Get the Y coordinate of a line number.
- """
- return lineno * self._get_line_height() + self.image_pad
-
- def _get_char_width(self):
- """
- Get the width of a character.
- """
- return self.fontw
-
- def _get_char_x(self, charno):
- """
- Get the X coordinate of a character position.
- """
- return charno * self.fontw + self.image_pad + self.line_number_width
-
- def _get_text_pos(self, charno, lineno):
- """
- Get the actual position for a character and line position.
- """
- return self._get_char_x(charno), self._get_line_y(lineno)
-
- def _get_linenumber_pos(self, lineno):
- """
- Get the actual position for the start of a line number.
- """
- return (self.image_pad, self._get_line_y(lineno))
-
- def _get_text_color(self, style):
- """
- Get the correct color for the token from the style.
- """
- if style['color'] is not None:
- fill = '#' + style['color']
- else:
- fill = '#000'
- return fill
-
- def _get_style_font(self, style):
- """
- Get the correct font for the style.
- """
- return self.fonts.get_font(style['bold'], style['italic'])
-
- def _get_image_size(self, maxcharno, maxlineno):
- """
- Get the required image size.
- """
- return (self._get_char_x(maxcharno) + self.image_pad,
- self._get_line_y(maxlineno + 0) + self.image_pad)
-
- def _draw_linenumber(self, posno, lineno):
- """
- Remember a line number drawable to paint later.
- """
- self._draw_text(
- self._get_linenumber_pos(posno),
- str(lineno).rjust(self.line_number_chars),
- font=self.fonts.get_font(self.line_number_bold,
- self.line_number_italic),
- fill=self.line_number_fg,
- )
-
- def _draw_text(self, pos, text, font, **kw):
- """
- Remember a single drawable tuple to paint later.
- """
- self.drawables.append((pos, text, font, kw))
-
- def _create_drawables(self, tokensource):
- """
- Create drawables for the token content.
- """
- lineno = charno = maxcharno = 0
- for ttype, value in tokensource:
- while ttype not in self.styles:
- ttype = ttype.parent
- style = self.styles[ttype]
- # TODO: make sure tab expansion happens earlier in the chain. It
- # really ought to be done on the input, as to do it right here is
- # quite complex.
- value = value.expandtabs(4)
- lines = value.splitlines(True)
- # print lines
- for i, line in enumerate(lines):
- temp = line.rstrip('\n')
- if temp:
- self._draw_text(
- self._get_text_pos(charno, lineno),
- temp,
- font = self._get_style_font(style),
- fill = self._get_text_color(style)
- )
- charno += len(temp)
- maxcharno = max(maxcharno, charno)
- if line.endswith('\n'):
- # add a line for each extra line in the value
- charno = 0
- lineno += 1
- self.maxcharno = maxcharno
- self.maxlineno = lineno
-
- def _draw_line_numbers(self):
- """
- Create drawables for the line numbers.
- """
- if not self.line_numbers:
- return
- for p in xrange(self.maxlineno):
- n = p + self.line_number_start
- if (n % self.line_number_step) == 0:
- self._draw_linenumber(p, n)
-
- def _paint_line_number_bg(self, im):
- """
- Paint the line number background on the image.
- """
- if not self.line_numbers:
- return
- if self.line_number_fg is None:
- return
- draw = ImageDraw.Draw(im)
- recth = im.size[-1]
- rectw = self.image_pad + self.line_number_width - self.line_number_pad
- draw.rectangle([(0, 0), (rectw, recth)],
- fill=self.line_number_bg)
- draw.line([(rectw, 0), (rectw, recth)], fill=self.line_number_fg)
- del draw
-
- def format(self, tokensource, outfile):
- """
- Format ``tokensource``, an iterable of ``(tokentype, tokenstring)``
- tuples and write it into ``outfile``.
-
- This implementation calculates where it should draw each token on the
- pixmap, then calculates the required pixmap size and draws the items.
- """
- self._create_drawables(tokensource)
- self._draw_line_numbers()
- im = Image.new(
- 'RGB',
- self._get_image_size(self.maxcharno, self.maxlineno),
- self.background_color
- )
- self._paint_line_number_bg(im)
- draw = ImageDraw.Draw(im)
- # Highlight
- if self.hl_lines:
- x = self.image_pad + self.line_number_width - self.line_number_pad + 1
- recth = self._get_line_height()
- rectw = im.size[0] - x
- for linenumber in self.hl_lines:
- y = self._get_line_y(linenumber - 1)
- draw.rectangle([(x, y), (x + rectw, y + recth)],
- fill=self.hl_color)
- for pos, value, font, kw in self.drawables:
- draw.text(pos, value, font=font, **kw)
- im.save(outfile, self.image_format.upper())
-
-
-# Add one formatter per format, so that the "-f gif" option gives the correct result
-# when used in pygmentize.
-
-class GifImageFormatter(ImageFormatter):
- """
- Create a GIF image from source code. This uses the Python Imaging Library to
- generate a pixmap from the source code.
-
- .. versionadded:: 1.0
- """
-
- name = 'img_gif'
- aliases = ['gif']
- filenames = ['*.gif']
- default_image_format = 'gif'
-
-
-class JpgImageFormatter(ImageFormatter):
- """
- Create a JPEG image from source code. This uses the Python Imaging Library to
- generate a pixmap from the source code.
-
- .. versionadded:: 1.0
- """
-
- name = 'img_jpg'
- aliases = ['jpg', 'jpeg']
- filenames = ['*.jpg']
- default_image_format = 'jpeg'
-
-
-class BmpImageFormatter(ImageFormatter):
- """
- Create a bitmap image from source code. This uses the Python Imaging Library to
- generate a pixmap from the source code.
-
- .. versionadded:: 1.0
- """
-
- name = 'img_bmp'
- aliases = ['bmp', 'bitmap']
- filenames = ['*.bmp']
- default_image_format = 'bmp'
diff --git a/pygments/formatters/irc.py b/pygments/formatters/irc.py
deleted file mode 100644
index 0650492a..00000000
--- a/pygments/formatters/irc.py
+++ /dev/null
@@ -1,182 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.irc
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Formatter for IRC output
-
- :copyright: Copyright 2006-2019 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
-from pygments.util import get_choice_opt
-
-
-__all__ = ['IRCFormatter']
-
-
-#: Map token types to a tuple of color values for light and dark
-#: backgrounds.
-IRC_COLORS = {
- Token: ('', ''),
-
- Whitespace: ('gray', 'brightblack'),
- Comment: ('gray', 'brightblack'),
- Comment.Preproc: ('cyan', 'brightcyan'),
- Keyword: ('blue', 'brightblue'),
- Keyword.Type: ('cyan', 'brightcyan'),
- Operator.Word: ('magenta', 'brightcyan'),
- Name.Builtin: ('cyan', 'brightcyan'),
- Name.Function: ('green', 'brightgreen'),
- Name.Namespace: ('_cyan_', '_brightcyan_'),
- Name.Class: ('_green_', '_brightgreen_'),
- Name.Exception: ('cyan', 'brightcyan'),
- Name.Decorator: ('brightblack', 'gray'),
- Name.Variable: ('red', 'brightred'),
- Name.Constant: ('red', 'brightred'),
- Name.Attribute: ('cyan', 'brightcyan'),
- Name.Tag: ('brightblue', 'brightblue'),
- String: ('yellow', 'yellow'),
- Number: ('blue', 'brightblue'),
-
- Generic.Deleted: ('brightred', 'brightred'),
- Generic.Inserted: ('green', 'brightgreen'),
- Generic.Heading: ('**', '**'),
- Generic.Subheading: ('*magenta*', '*brightmagenta*'),
- Generic.Error: ('brightred', 'brightred'),
-
- Error: ('_brightred_', '_brightred_'),
-}
-
-
-IRC_COLOR_MAP = {
- 'white': 0,
- 'black': 1,
- 'blue': 2,
- 'brightgreen': 3,
- 'brightred': 4,
- 'yellow': 5,
- 'magenta': 6,
- 'orange': 7,
- 'green': 7, #compat w/ ansi
- 'brightyellow': 8,
- 'lightgreen': 9,
- 'brightcyan': 9, # compat w/ ansi
- 'cyan': 10,
- 'lightblue': 11,
- 'red': 11, # compat w/ ansi
- 'brightblue': 12,
- 'brightmagenta': 13,
- 'brightblack': 14,
- 'gray': 15,
-}
-
-def ircformat(color, text):
- if len(color) < 1:
- return text
- add = sub = ''
- if '_' in color: # italic
- add += '\x1D'
- sub = '\x1D' + sub
- color = color.strip('_')
- if '*' in color: # bold
- add += '\x02'
- sub = '\x02' + sub
- color = color.strip('*')
- # underline (\x1F) not supported
- # backgrounds (\x03FF,BB) not supported
- if len(color) > 0: # actual color - may have issues with ircformat("red", "blah")+"10" type stuff
- add += '\x03' + str(IRC_COLOR_MAP[color]).zfill(2)
- sub = '\x03' + sub
- return add + text + sub
- return '<'+add+'>'+text+'</'+sub+'>'
-
-
-class IRCFormatter(Formatter):
- r"""
- Format tokens with IRC color sequences
-
- The `get_style_defs()` method doesn't do anything special since there is
- no support for common styles.
-
- Options accepted:
-
- `bg`
- Set to ``"light"`` or ``"dark"`` depending on the terminal's background
- (default: ``"light"``).
-
- `colorscheme`
- A dictionary mapping token types to (lightbg, darkbg) color names or
- ``None`` (default: ``None`` = use builtin colorscheme).
-
- `linenos`
- Set to ``True`` to have line numbers in the output as well
- (default: ``False`` = no line numbers).
- """
- name = 'IRC'
- aliases = ['irc', 'IRC']
- filenames = []
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
- self.darkbg = get_choice_opt(options, 'bg',
- ['light', 'dark'], 'light') == 'dark'
- self.colorscheme = options.get('colorscheme', None) or IRC_COLORS
- self.linenos = options.get('linenos', False)
- self._lineno = 0
-
- def _write_lineno(self, outfile):
- self._lineno += 1
- outfile.write("\n%04d: " % self._lineno)
-
- def _format_unencoded_with_lineno(self, tokensource, outfile):
- self._write_lineno(outfile)
-
- for ttype, value in tokensource:
- if value.endswith("\n"):
- self._write_lineno(outfile)
- value = value[:-1]
- color = self.colorscheme.get(ttype)
- while color is None:
- ttype = ttype[:-1]
- color = self.colorscheme.get(ttype)
- if color:
- color = color[self.darkbg]
- spl = value.split('\n')
- for line in spl[:-1]:
- self._write_lineno(outfile)
- if line:
- outfile.write(ircformat(color, line[:-1]))
- if spl[-1]:
- outfile.write(ircformat(color, spl[-1]))
- else:
- outfile.write(value)
-
- outfile.write("\n")
-
- def format_unencoded(self, tokensource, outfile):
- if self.linenos:
- self._format_unencoded_with_lineno(tokensource, outfile)
- return
-
- for ttype, value in tokensource:
- color = self.colorscheme.get(ttype)
- while color is None:
- ttype = ttype[:-1]
- color = self.colorscheme.get(ttype)
- if color:
- color = color[self.darkbg]
- spl = value.split('\n')
- for line in spl[:-1]:
- if line:
- outfile.write(ircformat(color, line))
- outfile.write('\n')
- if spl[-1]:
- outfile.write(ircformat(color, spl[-1]))
- else:
- outfile.write(value)
diff --git a/pygments/formatters/latex.py b/pygments/formatters/latex.py
deleted file mode 100644
index 7f6aa9e3..00000000
--- a/pygments/formatters/latex.py
+++ /dev/null
@@ -1,482 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.latex
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Formatter for LaTeX fancyvrb output.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import division
-
-from pygments.formatter import Formatter
-from pygments.lexer import Lexer
-from pygments.token import Token, STANDARD_TYPES
-from pygments.util import get_bool_opt, get_int_opt, StringIO, xrange, \
- iteritems
-
-
-__all__ = ['LatexFormatter']
-
-
-def escape_tex(text, commandprefix):
- return text.replace('\\', '\x00'). \
- replace('{', '\x01'). \
- replace('}', '\x02'). \
- replace('\x00', r'\%sZbs{}' % commandprefix). \
- replace('\x01', r'\%sZob{}' % 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). \
- replace('-', r'\%sZhy{}' % commandprefix). \
- replace("'", r'\%sZsq{}' % commandprefix). \
- replace('"', r'\%sZdq{}' % commandprefix). \
- replace('~', r'\%sZti{}' % commandprefix)
-
-
-DOC_TEMPLATE = r'''
-\documentclass{%(docclass)s}
-\usepackage{fancyvrb}
-\usepackage{color}
-\usepackage[%(encoding)s]{inputenc}
-%(preamble)s
-
-%(styledefs)s
-
-\begin{document}
-
-\section*{%(title)s}
-
-%(code)s
-\end{document}
-'''
-
-## Small explanation of the mess below :)
-#
-# The previous version of the LaTeX formatter just assigned a command to
-# each token type defined in the current style. That obviously is
-# problematic if the highlighted code is produced for a different style
-# than the style commands themselves.
-#
-# This version works much like the HTML formatter which assigns multiple
-# CSS classes to each <span> tag, from the most specific to the least
-# specific token type, thus falling back to the parent token type if one
-# is not defined. Here, the classes are there too and use the same short
-# forms given in token.STANDARD_TYPES.
-#
-# Highlighted code now only uses one custom command, which by default is
-# \PY and selectable by the commandprefix option (and in addition the
-# escapes \PYZat, \PYZlb and \PYZrb which haven't been renamed for
-# backwards compatibility purposes).
-#
-# \PY has two arguments: the classes, separated by +, and the text to
-# render in that style. The classes are resolved into the respective
-# style commands by magic, which serves to ignore unknown classes.
-#
-# The magic macros are:
-# * \PY@it, \PY@bf, etc. are unconditionally wrapped around the text
-# to render in \PY@do. Their definition determines the style.
-# * \PY@reset resets \PY@it etc. to do nothing.
-# * \PY@toks parses the list of classes, using magic inspired by the
-# keyval package (but modified to use plusses instead of commas
-# because fancyvrb redefines commas inside its environments).
-# * \PY@tok processes one class, calling the \PY@tok@classname command
-# if it exists.
-# * \PY@tok@classname sets the \PY@it etc. to reflect the chosen style
-# for its class.
-# * \PY resets the style, parses the classnames and then calls \PY@do.
-#
-# Tip: to read this code, print it out in substituted form using e.g.
-# >>> print STYLE_TEMPLATE % {'cp': 'PY'}
-
-STYLE_TEMPLATE = r'''
-\makeatletter
-\def\%(cp)s@reset{\let\%(cp)s@it=\relax \let\%(cp)s@bf=\relax%%
- \let\%(cp)s@ul=\relax \let\%(cp)s@tc=\relax%%
- \let\%(cp)s@bc=\relax \let\%(cp)s@ff=\relax}
-\def\%(cp)s@tok#1{\csname %(cp)s@tok@#1\endcsname}
-\def\%(cp)s@toks#1+{\ifx\relax#1\empty\else%%
- \%(cp)s@tok{#1}\expandafter\%(cp)s@toks\fi}
-\def\%(cp)s@do#1{\%(cp)s@bc{\%(cp)s@tc{\%(cp)s@ul{%%
- \%(cp)s@it{\%(cp)s@bf{\%(cp)s@ff{#1}}}}}}}
-\def\%(cp)s#1#2{\%(cp)s@reset\%(cp)s@toks#1+\relax+\%(cp)s@do{#2}}
-
-%(styles)s
-
-\def\%(cp)sZbs{\char`\\}
-\def\%(cp)sZus{\char`\_}
-\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`\$}
-\def\%(cp)sZhy{\char`\-}
-\def\%(cp)sZsq{\char`\'}
-\def\%(cp)sZdq{\char`\"}
-\def\%(cp)sZti{\char`\~}
-%% for compatibility with earlier versions
-\def\%(cp)sZat{@}
-\def\%(cp)sZlb{[}
-\def\%(cp)sZrb{]}
-\makeatother
-'''
-
-
-def _get_ttype_name(ttype):
- fname = STANDARD_TYPES.get(ttype)
- if fname:
- return fname
- aname = ''
- while fname is None:
- aname = ttype[-1] + aname
- ttype = ttype.parent
- fname = STANDARD_TYPES.get(ttype)
- return fname + aname
-
-
-class LatexFormatter(Formatter):
- r"""
- Format tokens as LaTeX code. This needs the `fancyvrb` and `color`
- standard packages.
-
- Without the `full` option, code is formatted as one ``Verbatim``
- environment, like this:
-
- .. sourcecode:: latex
-
- \begin{Verbatim}[commandchars=\\\{\}]
- \PY{k}{def }\PY{n+nf}{foo}(\PY{n}{bar}):
- \PY{k}{pass}
- \end{Verbatim}
-
- The special command used here (``\PY``) and all the other macros it needs
- are output by the `get_style_defs` method.
-
- With the `full` option, a complete LaTeX document is output, including
- the command definitions in the preamble.
-
- The `get_style_defs()` method of a `LatexFormatter` returns a string
- containing ``\def`` commands defining the macros needed inside the
- ``Verbatim`` environments.
-
- Additional options accepted:
-
- `style`
- The style to use, can be a string or a Style subclass (default:
- ``'default'``).
-
- `full`
- Tells the formatter to output a "full" document, i.e. a complete
- self-contained document (default: ``False``).
-
- `title`
- If `full` is true, the title that should be used to caption the
- document (default: ``''``).
-
- `docclass`
- If the `full` option is enabled, this is the document class to use
- (default: ``'article'``).
-
- `preamble`
- If the `full` option is enabled, this can be further preamble commands,
- e.g. ``\usepackage`` (default: ``''``).
-
- `linenos`
- If set to ``True``, output line numbers (default: ``False``).
-
- `linenostart`
- The line number for the first line (default: ``1``).
-
- `linenostep`
- If set to a number n > 1, only every nth line number is printed.
-
- `verboptions`
- Additional options given to the Verbatim environment (see the *fancyvrb*
- docs for possible values) (default: ``''``).
-
- `commandprefix`
- The LaTeX commands used to produce colored output are constructed
- using this prefix and some letters (default: ``'PY'``).
-
- .. versionadded:: 0.7
- .. versionchanged:: 0.10
- The default is now ``'PY'`` instead of ``'C'``.
-
- `texcomments`
- If set to ``True``, enables LaTeX comment lines. That is, LaTex markup
- in comment tokens is not escaped so that LaTeX can render it (default:
- ``False``).
-
- .. versionadded:: 1.2
-
- `mathescape`
- If set to ``True``, enables LaTeX math mode escape in comments. That
- is, ``'$...$'`` inside a comment will trigger math mode (default:
- ``False``).
-
- .. versionadded:: 1.2
-
- `escapeinside`
- If set to a string of length 2, enables escaping to LaTeX. Text
- delimited by these 2 characters is read as LaTeX code and
- typeset accordingly. It has no effect in string literals. It has
- no effect in comments if `texcomments` or `mathescape` is
- set. (default: ``''``).
-
- .. versionadded:: 2.0
-
- `envname`
- Allows you to pick an alternative environment name replacing Verbatim.
- The alternate environment still has to support Verbatim's option syntax.
- (default: ``'Verbatim'``).
-
- .. versionadded:: 2.0
- """
- name = 'LaTeX'
- aliases = ['latex', 'tex']
- filenames = ['*.tex']
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
- self.docclass = options.get('docclass', 'article')
- self.preamble = options.get('preamble', '')
- self.linenos = get_bool_opt(options, 'linenos', False)
- self.linenostart = abs(get_int_opt(options, 'linenostart', 1))
- self.linenostep = abs(get_int_opt(options, 'linenostep', 1))
- self.verboptions = options.get('verboptions', '')
- self.nobackground = get_bool_opt(options, 'nobackground', False)
- self.commandprefix = options.get('commandprefix', 'PY')
- self.texcomments = get_bool_opt(options, 'texcomments', False)
- self.mathescape = get_bool_opt(options, 'mathescape', False)
- self.escapeinside = options.get('escapeinside', '')
- if len(self.escapeinside) == 2:
- self.left = self.escapeinside[0]
- self.right = self.escapeinside[1]
- else:
- self.escapeinside = ''
- self.envname = options.get('envname', u'Verbatim')
-
- self._create_stylesheet()
-
- def _create_stylesheet(self):
- t2n = self.ttype2name = {Token: ''}
- c2d = self.cmd2def = {}
- cp = self.commandprefix
-
- def rgbcolor(col):
- if col:
- return ','.join(['%.2f' % (int(col[i] + col[i + 1], 16) / 255.0)
- for i in (0, 2, 4)])
- else:
- return '1,1,1'
-
- for ttype, ndef in self.style:
- name = _get_ttype_name(ttype)
- cmndef = ''
- if ndef['bold']:
- cmndef += r'\let\$$@bf=\textbf'
- if ndef['italic']:
- cmndef += r'\let\$$@it=\textit'
- if ndef['underline']:
- cmndef += r'\let\$$@ul=\underline'
- if ndef['roman']:
- cmndef += r'\let\$$@ff=\textrm'
- if ndef['sans']:
- cmndef += r'\let\$$@ff=\textsf'
- if ndef['mono']:
- cmndef += r'\let\$$@ff=\textsf'
- if ndef['color']:
- cmndef += (r'\def\$$@tc##1{\textcolor[rgb]{%s}{##1}}' %
- rgbcolor(ndef['color']))
- if ndef['border']:
- 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{\setlength{\fboxsep}{0pt}'
- r'\colorbox[rgb]{%s}{\strut ##1}}' %
- rgbcolor(ndef['bgcolor']))
- if cmndef == '':
- continue
- cmndef = cmndef.replace('$$', cp)
- t2n[ttype] = name
- c2d[name] = cmndef
-
- def get_style_defs(self, arg=''):
- """
- Return the command sequences needed to define the commands
- used to format text in the verbatim environment. ``arg`` is ignored.
- """
- cp = self.commandprefix
- styles = []
- for name, definition in iteritems(self.cmd2def):
- styles.append(r'\expandafter\def\csname %s@tok@%s\endcsname{%s}' %
- (cp, name, definition))
- return STYLE_TEMPLATE % {'cp': self.commandprefix,
- 'styles': '\n'.join(styles)}
-
- def format_unencoded(self, tokensource, outfile):
- # TODO: add support for background colors
- t2n = self.ttype2name
- cp = self.commandprefix
-
- if self.full:
- realoutfile = outfile
- outfile = StringIO()
-
- outfile.write(u'\\begin{' + self.envname + u'}[commandchars=\\\\\\{\\}')
- if self.linenos:
- start, step = self.linenostart, self.linenostep
- outfile.write(u',numbers=left' +
- (start and u',firstnumber=%d' % start or u'') +
- (step and u',stepnumber=%d' % step or u''))
- if self.mathescape or self.texcomments or self.escapeinside:
- outfile.write(u',codes={\\catcode`\\$=3\\catcode`\\^=7\\catcode`\\_=8}')
- if self.verboptions:
- outfile.write(u',' + self.verboptions)
- outfile.write(u']\n')
-
- for ttype, value in tokensource:
- if ttype in Token.Comment:
- if self.texcomments:
- # Try to guess comment starting lexeme and escape it ...
- start = value[0:1]
- for i in xrange(1, len(value)):
- if start[0] != value[i]:
- break
- start += value[i]
-
- value = value[len(start):]
- start = escape_tex(start, cp)
-
- # ... but do not escape inside comment.
- value = start + value
- elif self.mathescape:
- # Only escape parts not inside a math environment.
- parts = value.split('$')
- in_math = False
- for i, part in enumerate(parts):
- if not in_math:
- parts[i] = escape_tex(part, cp)
- in_math = not in_math
- value = '$'.join(parts)
- elif self.escapeinside:
- text = value
- value = ''
- while text:
- a, sep1, text = text.partition(self.left)
- if sep1:
- b, sep2, text = text.partition(self.right)
- if sep2:
- value += escape_tex(a, cp) + b
- else:
- value += escape_tex(a + sep1 + b, cp)
- else:
- value += escape_tex(a, cp)
- else:
- value = escape_tex(value, cp)
- elif ttype not in Token.Escape:
- value = escape_tex(value, cp)
- styles = []
- while ttype is not Token:
- try:
- styles.append(t2n[ttype])
- except KeyError:
- # not in current style
- styles.append(_get_ttype_name(ttype))
- ttype = ttype.parent
- styleval = '+'.join(reversed(styles))
- if styleval:
- spl = value.split('\n')
- for line in spl[:-1]:
- if line:
- outfile.write("\\%s{%s}{%s}" % (cp, styleval, line))
- outfile.write('\n')
- if spl[-1]:
- outfile.write("\\%s{%s}{%s}" % (cp, styleval, spl[-1]))
- else:
- outfile.write(value)
-
- outfile.write(u'\\end{' + self.envname + u'}\n')
-
- if self.full:
- encoding = self.encoding or 'utf8'
- # map known existings encodings from LaTeX distribution
- encoding = {
- 'utf_8': 'utf8',
- 'latin_1': 'latin1',
- 'iso_8859_1': 'latin1',
- }.get(encoding.replace('-', '_'), encoding)
- realoutfile.write(DOC_TEMPLATE %
- dict(docclass = self.docclass,
- preamble = self.preamble,
- title = self.title,
- encoding = encoding,
- styledefs = self.get_style_defs(),
- code = outfile.getvalue()))
-
-
-class LatexEmbeddedLexer(Lexer):
- """
- This lexer takes one lexer as argument, the lexer for the language
- being formatted, and the left and right delimiters for escaped text.
-
- First everything is scanned using the language lexer to obtain
- strings and comments. All other consecutive tokens are merged and
- the resulting text is scanned for escaped segments, which are given
- the Token.Escape type. Finally text that is not escaped is scanned
- again with the language lexer.
- """
- def __init__(self, left, right, lang, **options):
- self.left = left
- self.right = right
- self.lang = lang
- Lexer.__init__(self, **options)
-
- def get_tokens_unprocessed(self, text):
- buf = ''
- idx = 0
- for i, t, v in self.lang.get_tokens_unprocessed(text):
- if t in Token.Comment or t in Token.String:
- if buf:
- for x in self.get_tokens_aux(idx, buf):
- yield x
- buf = ''
- yield i, t, v
- else:
- if not buf:
- idx = i
- buf += v
- if buf:
- for x in self.get_tokens_aux(idx, buf):
- yield x
-
- def get_tokens_aux(self, index, text):
- while text:
- a, sep1, text = text.partition(self.left)
- if a:
- for i, t, v in self.lang.get_tokens_unprocessed(a):
- yield index + i, t, v
- index += len(a)
- if sep1:
- b, sep2, text = text.partition(self.right)
- if sep2:
- yield index + len(sep1), Token.Escape, b
- index += len(sep1) + len(b) + len(sep2)
- else:
- yield index, Token.Error, sep1
- index += len(sep1)
- text = b
diff --git a/pygments/formatters/other.py b/pygments/formatters/other.py
deleted file mode 100644
index a2eca91a..00000000
--- a/pygments/formatters/other.py
+++ /dev/null
@@ -1,160 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.other
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Other formatters: NullFormatter, RawTokenFormatter.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.formatter import Formatter
-from pygments.util import OptionError, get_choice_opt
-from pygments.token import Token
-from pygments.console import colorize
-
-__all__ = ['NullFormatter', 'RawTokenFormatter', 'TestcaseFormatter']
-
-
-class NullFormatter(Formatter):
- """
- Output the text unchanged without any formatting.
- """
- name = 'Text only'
- aliases = ['text', 'null']
- filenames = ['*.txt']
-
- def format(self, tokensource, outfile):
- enc = self.encoding
- for ttype, value in tokensource:
- if enc:
- outfile.write(value.encode(enc))
- else:
- outfile.write(value)
-
-
-class RawTokenFormatter(Formatter):
- r"""
- Format tokens as a raw representation for storing token streams.
-
- The format is ``tokentype<TAB>repr(tokenstring)\n``. The output can later
- be converted to a token stream with the `RawTokenLexer`, described in the
- :doc:`lexer list <lexers>`.
-
- Only two options are accepted:
-
- `compress`
- If set to ``'gz'`` or ``'bz2'``, compress the output with the given
- compression algorithm after encoding (default: ``''``).
- `error_color`
- If set to a color name, highlight error tokens using that color. If
- set but with no value, defaults to ``'red'``.
-
- .. versionadded:: 0.11
-
- """
- name = 'Raw tokens'
- aliases = ['raw', 'tokens']
- filenames = ['*.raw']
-
- unicodeoutput = False
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
- # We ignore self.encoding if it is set, since it gets set for lexer
- # and formatter if given with -Oencoding on the command line.
- # The RawTokenFormatter outputs only ASCII. Override here.
- self.encoding = 'ascii' # let pygments.format() do the right thing
- self.compress = get_choice_opt(options, 'compress',
- ['', 'none', 'gz', 'bz2'], '')
- self.error_color = options.get('error_color', None)
- if self.error_color is True:
- self.error_color = 'red'
- if self.error_color is not None:
- try:
- colorize(self.error_color, '')
- except KeyError:
- raise ValueError("Invalid color %r specified" %
- self.error_color)
-
- def format(self, tokensource, outfile):
- try:
- outfile.write(b'')
- except TypeError:
- raise TypeError('The raw tokens formatter needs a binary '
- 'output file')
- if self.compress == 'gz':
- import gzip
- outfile = gzip.GzipFile('', 'wb', 9, outfile)
- def write(text):
- outfile.write(text.encode())
- flush = outfile.flush
- elif self.compress == 'bz2':
- import bz2
- compressor = bz2.BZ2Compressor(9)
- def write(text):
- outfile.write(compressor.compress(text.encode()))
- def flush():
- outfile.write(compressor.flush())
- outfile.flush()
- else:
- def write(text):
- outfile.write(text.encode())
- flush = outfile.flush
-
- if self.error_color:
- for ttype, value in tokensource:
- line = "%s\t%r\n" % (ttype, value)
- if ttype is Token.Error:
- write(colorize(self.error_color, line))
- else:
- write(line)
- else:
- for ttype, value in tokensource:
- write("%s\t%r\n" % (ttype, value))
- flush()
-
-TESTCASE_BEFORE = u'''\
- def testNeedsName(self):
- fragment = %r
- tokens = [
-'''
-TESTCASE_AFTER = u'''\
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-'''
-
-
-class TestcaseFormatter(Formatter):
- """
- Format tokens as appropriate for a new testcase.
-
- .. versionadded:: 2.0
- """
- name = 'Testcase'
- aliases = ['testcase']
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
- if self.encoding is not None and self.encoding != 'utf-8':
- raise ValueError("Only None and utf-8 are allowed encodings.")
-
- def format(self, tokensource, outfile):
- indentation = ' ' * 12
- rawbuf = []
- outbuf = []
- for ttype, value in tokensource:
- rawbuf.append(value)
- outbuf.append('%s(%s, %r),\n' % (indentation, ttype, value))
-
- before = TESTCASE_BEFORE % (u''.join(rawbuf),)
- during = u''.join(outbuf)
- after = TESTCASE_AFTER
- if self.encoding is None:
- outfile.write(before + during + after)
- else:
- outfile.write(before.encode('utf-8'))
- outfile.write(during.encode('utf-8'))
- outfile.write(after.encode('utf-8'))
- outfile.flush()
diff --git a/pygments/formatters/rtf.py b/pygments/formatters/rtf.py
deleted file mode 100644
index 1246db2a..00000000
--- a/pygments/formatters/rtf.py
+++ /dev/null
@@ -1,147 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.rtf
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- A formatter that generates RTF files.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.formatter import Formatter
-from pygments.util import get_int_opt, _surrogatepair
-
-
-__all__ = ['RtfFormatter']
-
-
-class RtfFormatter(Formatter):
- """
- Format tokens as RTF markup. This formatter automatically outputs full RTF
- documents with color information and other useful stuff. Perfect for Copy and
- Paste into Microsoft(R) Word(R) documents.
-
- Please note that ``encoding`` and ``outencoding`` options are ignored.
- The RTF format is ASCII natively, but handles unicode characters correctly
- thanks to escape sequences.
-
- .. versionadded:: 0.6
-
- Additional options accepted:
-
- `style`
- The style to use, can be a string or a Style subclass (default:
- ``'default'``).
-
- `fontface`
- The used font family, for example ``Bitstream Vera Sans``. Defaults to
- some generic font which is supposed to have fixed width.
-
- `fontsize`
- Size of the font used. Size is specified in half points. The
- default is 24 half-points, giving a size 12 font.
-
- .. versionadded:: 2.0
- """
- name = 'RTF'
- aliases = ['rtf']
- filenames = ['*.rtf']
-
- def __init__(self, **options):
- r"""
- Additional options accepted:
-
- ``fontface``
- Name of the font used. Could for example be ``'Courier New'``
- to further specify the default which is ``'\fmodern'``. The RTF
- specification claims that ``\fmodern`` are "Fixed-pitch serif
- and sans serif fonts". Hope every RTF implementation thinks
- the same about modern...
-
- """
- Formatter.__init__(self, **options)
- self.fontface = options.get('fontface') or ''
- self.fontsize = get_int_opt(options, 'fontsize', 0)
-
- def _escape(self, text):
- return text.replace(u'\\', u'\\\\') \
- .replace(u'{', u'\\{') \
- .replace(u'}', u'\\}')
-
- def _escape_text(self, text):
- # empty strings, should give a small performance improvement
- if not text:
- return u''
-
- # escape text
- text = self._escape(text)
-
- buf = []
- for c in text:
- cn = ord(c)
- if cn < (2**7):
- # ASCII character
- buf.append(str(c))
- elif (2**7) <= cn < (2**16):
- # single unicode escape sequence
- buf.append(u'{\\u%d}' % cn)
- elif (2**16) <= cn:
- # RTF limits unicode to 16 bits.
- # Force surrogate pairs
- buf.append(u'{\\u%d}{\\u%d}' % _surrogatepair(cn))
-
- return u''.join(buf).replace(u'\n', u'\\par\n')
-
- def format_unencoded(self, tokensource, outfile):
- # rtf 1.8 header
- outfile.write(u'{\\rtf1\\ansi\\uc0\\deff0'
- u'{\\fonttbl{\\f0\\fmodern\\fprq1\\fcharset0%s;}}'
- u'{\\colortbl;' % (self.fontface and
- u' ' + self._escape(self.fontface) or
- u''))
-
- # convert colors and save them in a mapping to access them later.
- color_mapping = {}
- offset = 1
- for _, style in self.style:
- for color in style['color'], style['bgcolor'], style['border']:
- if color and color not in color_mapping:
- color_mapping[color] = offset
- outfile.write(u'\\red%d\\green%d\\blue%d;' % (
- int(color[0:2], 16),
- int(color[2:4], 16),
- int(color[4:6], 16)
- ))
- offset += 1
- outfile.write(u'}\\f0 ')
- if self.fontsize:
- outfile.write(u'\\fs%d' % (self.fontsize))
-
- # highlight stream
- for ttype, value in tokensource:
- while not self.style.styles_token(ttype) and ttype.parent:
- ttype = ttype.parent
- style = self.style.style_for_token(ttype)
- buf = []
- if style['bgcolor']:
- buf.append(u'\\cb%d' % color_mapping[style['bgcolor']])
- if style['color']:
- buf.append(u'\\cf%d' % color_mapping[style['color']])
- if style['bold']:
- buf.append(u'\\b')
- if style['italic']:
- buf.append(u'\\i')
- if style['underline']:
- buf.append(u'\\ul')
- if style['border']:
- buf.append(u'\\chbrdr\\chcfpat%d' %
- color_mapping[style['border']])
- start = u''.join(buf)
- if start:
- outfile.write(u'{%s ' % start)
- outfile.write(self._escape_text(value))
- if start:
- outfile.write(u'}')
-
- outfile.write(u'}')
diff --git a/pygments/formatters/svg.py b/pygments/formatters/svg.py
deleted file mode 100644
index ccfd2b3f..00000000
--- a/pygments/formatters/svg.py
+++ /dev/null
@@ -1,153 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.svg
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Formatter for SVG output.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.formatter import Formatter
-from pygments.util import get_bool_opt, get_int_opt
-
-__all__ = ['SvgFormatter']
-
-
-def escape_html(text):
- """Escape &, <, > as well as single and double quotes for HTML."""
- return text.replace('&', '&amp;'). \
- replace('<', '&lt;'). \
- replace('>', '&gt;'). \
- replace('"', '&quot;'). \
- replace("'", '&#39;')
-
-
-class2style = {}
-
-class SvgFormatter(Formatter):
- """
- Format tokens as an SVG graphics file. This formatter is still experimental.
- Each line of code is a ``<text>`` element with explicit ``x`` and ``y``
- coordinates containing ``<tspan>`` elements with the individual token styles.
-
- By default, this formatter outputs a full SVG document including doctype
- declaration and the ``<svg>`` root element.
-
- .. versionadded:: 0.9
-
- Additional options accepted:
-
- `nowrap`
- Don't wrap the SVG ``<text>`` elements in ``<svg><g>`` elements and
- don't add a XML declaration and a doctype. If true, the `fontfamily`
- and `fontsize` options are ignored. Defaults to ``False``.
-
- `fontfamily`
- The value to give the wrapping ``<g>`` element's ``font-family``
- attribute, defaults to ``"monospace"``.
-
- `fontsize`
- The value to give the wrapping ``<g>`` element's ``font-size``
- attribute, defaults to ``"14px"``.
-
- `xoffset`
- Starting offset in X direction, defaults to ``0``.
-
- `yoffset`
- Starting offset in Y direction, defaults to the font size if it is given
- in pixels, or ``20`` else. (This is necessary since text coordinates
- refer to the text baseline, not the top edge.)
-
- `ystep`
- Offset to add to the Y coordinate for each subsequent line. This should
- roughly be the text size plus 5. It defaults to that value if the text
- size is given in pixels, or ``25`` else.
-
- `spacehack`
- Convert spaces in the source to ``&#160;``, which are non-breaking
- spaces. SVG provides the ``xml:space`` attribute to control how
- whitespace inside tags is handled, in theory, the ``preserve`` value
- could be used to keep all whitespace as-is. However, many current SVG
- viewers don't obey that rule, so this option is provided as a workaround
- and defaults to ``True``.
- """
- name = 'SVG'
- aliases = ['svg']
- filenames = ['*.svg']
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
- self.nowrap = get_bool_opt(options, 'nowrap', False)
- self.fontfamily = options.get('fontfamily', 'monospace')
- self.fontsize = options.get('fontsize', '14px')
- self.xoffset = get_int_opt(options, 'xoffset', 0)
- fs = self.fontsize.strip()
- if fs.endswith('px'): fs = fs[:-2].strip()
- try:
- int_fs = int(fs)
- except:
- int_fs = 20
- self.yoffset = get_int_opt(options, 'yoffset', int_fs)
- self.ystep = get_int_opt(options, 'ystep', int_fs + 5)
- self.spacehack = get_bool_opt(options, 'spacehack', True)
- self._stylecache = {}
-
- def format_unencoded(self, tokensource, outfile):
- """
- Format ``tokensource``, an iterable of ``(tokentype, tokenstring)``
- tuples and write it into ``outfile``.
-
- For our implementation we put all lines in their own 'line group'.
- """
- x = self.xoffset
- y = self.yoffset
- if not self.nowrap:
- if self.encoding:
- outfile.write('<?xml version="1.0" encoding="%s"?>\n' %
- self.encoding)
- else:
- outfile.write('<?xml version="1.0"?>\n')
- outfile.write('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" '
- '"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/'
- 'svg10.dtd">\n')
- outfile.write('<svg xmlns="http://www.w3.org/2000/svg">\n')
- outfile.write('<g font-family="%s" font-size="%s">\n' %
- (self.fontfamily, self.fontsize))
- outfile.write('<text x="%s" y="%s" xml:space="preserve">' % (x, y))
- for ttype, value in tokensource:
- style = self._get_style(ttype)
- tspan = style and '<tspan' + style + '>' or ''
- tspanend = tspan and '</tspan>' or ''
- value = escape_html(value)
- if self.spacehack:
- value = value.expandtabs().replace(' ', '&#160;')
- parts = value.split('\n')
- for part in parts[:-1]:
- outfile.write(tspan + part + tspanend)
- y += self.ystep
- outfile.write('</text>\n<text x="%s" y="%s" '
- 'xml:space="preserve">' % (x, y))
- outfile.write(tspan + parts[-1] + tspanend)
- outfile.write('</text>')
-
- if not self.nowrap:
- outfile.write('</g></svg>\n')
-
- def _get_style(self, tokentype):
- if tokentype in self._stylecache:
- return self._stylecache[tokentype]
- otokentype = tokentype
- while not self.style.styles_token(tokentype):
- tokentype = tokentype.parent
- value = self.style.style_for_token(tokentype)
- result = ''
- if value['color']:
- result = ' fill="#' + value['color'] + '"'
- if value['bold']:
- result += ' font-weight="bold"'
- if value['italic']:
- result += ' font-style="italic"'
- self._stylecache[otokentype] = result
- return result
diff --git a/pygments/formatters/terminal.py b/pygments/formatters/terminal.py
deleted file mode 100644
index e60bde91..00000000
--- a/pygments/formatters/terminal.py
+++ /dev/null
@@ -1,136 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.terminal
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Formatter for terminal output with ANSI sequences.
-
- :copyright: Copyright 2006-2019 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
-from pygments.console import ansiformat
-from pygments.util import get_choice_opt
-
-
-__all__ = ['TerminalFormatter']
-
-
-#: Map token types to a tuple of color values for light and dark
-#: backgrounds.
-TERMINAL_COLORS = {
- Token: ('', ''),
-
- Whitespace: ('gray', 'brightblack'),
- Comment: ('gray', 'brightblack'),
- Comment.Preproc: ('cyan', 'brightcyan'),
- Keyword: ('blue', 'brightblue'),
- Keyword.Type: ('cyan', 'brightcyan'),
- Operator.Word: ('magenta', 'brightmagenta'),
- Name.Builtin: ('cyan', 'brightcyan'),
- Name.Function: ('green', 'brightgreen'),
- Name.Namespace: ('_cyan_', '_brightcyan_'),
- Name.Class: ('_green_', '_brightgreen_'),
- Name.Exception: ('cyan', 'brightcyan'),
- Name.Decorator: ('brightblack', 'gray'),
- Name.Variable: ('red', 'brightred'),
- Name.Constant: ('red', 'brightred'),
- Name.Attribute: ('cyan', 'brightcyan'),
- Name.Tag: ('brightblue', 'brightblue'),
- String: ('yellow', 'yellow'),
- Number: ('blue', 'brightblue'),
-
- Generic.Deleted: ('brightred', 'brightred'),
- Generic.Inserted: ('green', 'brightgreen'),
- Generic.Heading: ('**', '**'),
- Generic.Subheading: ('*magenta*', '*brightmagenta*'),
- Generic.Prompt: ('**', '**'),
- Generic.Error: ('brightred', 'brightred'),
-
- Error: ('_brightred_', '_brightred_'),
-}
-
-
-class TerminalFormatter(Formatter):
- r"""
- Format tokens with ANSI color sequences, for output in a text console.
- Color sequences are terminated at newlines, so that paging the output
- works correctly.
-
- The `get_style_defs()` method doesn't do anything special since there is
- no support for common styles.
-
- Options accepted:
-
- `bg`
- Set to ``"light"`` or ``"dark"`` depending on the terminal's background
- (default: ``"light"``).
-
- `colorscheme`
- A dictionary mapping token types to (lightbg, darkbg) color names or
- ``None`` (default: ``None`` = use builtin colorscheme).
-
- `linenos`
- Set to ``True`` to have line numbers on the terminal output as well
- (default: ``False`` = no line numbers).
- """
- name = 'Terminal'
- aliases = ['terminal', 'console']
- filenames = []
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
- self.darkbg = get_choice_opt(options, 'bg',
- ['light', 'dark'], 'light') == 'dark'
- self.colorscheme = options.get('colorscheme', None) or TERMINAL_COLORS
- self.linenos = options.get('linenos', False)
- self._lineno = 0
-
- def format(self, tokensource, outfile):
- # 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() and \
- sys.version_info < (3,):
- self.encoding = outfile.encoding
- return Formatter.format(self, tokensource, outfile)
-
- def _write_lineno(self, outfile):
- self._lineno += 1
- outfile.write("%s%04d: " % (self._lineno != 1 and '\n' or '', self._lineno))
-
- def _get_color(self, ttype):
- # self.colorscheme is a dict containing usually generic types, so we
- # have to walk the tree of dots. The base Token type must be a key,
- # even if it's empty string, as in the default above.
- colors = self.colorscheme.get(ttype)
- while colors is None:
- ttype = ttype.parent
- colors = self.colorscheme.get(ttype)
- return colors[self.darkbg]
-
- def format_unencoded(self, tokensource, outfile):
- if self.linenos:
- self._write_lineno(outfile)
-
- for ttype, value in tokensource:
- color = self._get_color(ttype)
-
- for line in value.splitlines(True):
- if color:
- outfile.write(ansiformat(color, line.rstrip('\n')))
- else:
- outfile.write(line.rstrip('\n'))
- if line.endswith('\n'):
- if self.linenos:
- self._write_lineno(outfile)
- else:
- outfile.write('\n')
-
- if self.linenos:
- outfile.write("\n")
diff --git a/pygments/formatters/terminal256.py b/pygments/formatters/terminal256.py
deleted file mode 100644
index 43ec01c2..00000000
--- a/pygments/formatters/terminal256.py
+++ /dev/null
@@ -1,315 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.formatters.terminal256
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Formatter for 256-color terminal output with ANSI sequences.
-
- RGB-to-XTERM color conversion routines adapted from xterm256-conv
- tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
- by Wolfgang Frisch.
-
- Formatter version 1.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# TODO:
-# - Options to map style's bold/underline/italic/border attributes
-# to some ANSI attrbutes (something like 'italic=underline')
-# - An option to output "style RGB to xterm RGB/index" conversion table
-# - An option to indicate that we are running in "reverse background"
-# xterm. This means that default colors are white-on-black, not
-# 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
-from pygments.console import codes
-from pygments.style import ansicolors
-
-
-__all__ = ['Terminal256Formatter', 'TerminalTrueColorFormatter']
-
-
-class EscapeSequence:
- def __init__(self, fg=None, bg=None, bold=False, underline=False):
- self.fg = fg
- self.bg = bg
- self.bold = bold
- self.underline = underline
-
- def escape(self, attrs):
- if len(attrs):
- return "\x1b[" + ";".join(attrs) + "m"
- return ""
-
- def color_string(self):
- attrs = []
- if self.fg is not None:
- if self.fg in ansicolors:
- esc = codes[self.fg.replace('ansi','')]
- if ';01m' in esc:
- self.bold = True
- # extract fg color code.
- attrs.append(esc[2:4])
- else:
- attrs.extend(("38", "5", "%i" % self.fg))
- if self.bg is not None:
- if self.bg in ansicolors:
- esc = codes[self.bg.replace('ansi','')]
- # extract fg color code, add 10 for bg.
- attrs.append(str(int(esc[2:4])+10))
- else:
- attrs.extend(("48", "5", "%i" % self.bg))
- if self.bold:
- attrs.append("01")
- if self.underline:
- attrs.append("04")
- return self.escape(attrs)
-
- def true_color_string(self):
- attrs = []
- if self.fg:
- attrs.extend(("38", "2", str(self.fg[0]), str(self.fg[1]), str(self.fg[2])))
- if self.bg:
- attrs.extend(("48", "2", str(self.bg[0]), str(self.bg[1]), str(self.bg[2])))
- if self.bold:
- attrs.append("01")
- if self.underline:
- attrs.append("04")
- return self.escape(attrs)
-
- def reset_string(self):
- attrs = []
- if self.fg is not None:
- attrs.append("39")
- if self.bg is not None:
- attrs.append("49")
- if self.bold or self.underline:
- attrs.append("00")
- return self.escape(attrs)
-
-
-class Terminal256Formatter(Formatter):
- """
- Format tokens with ANSI color sequences, for output in a 256-color
- terminal or console. Like in `TerminalFormatter` color sequences
- are terminated at newlines, so that paging the output works correctly.
-
- The formatter takes colors from a style defined by the `style` option
- and converts them to nearest ANSI 256-color escape sequences. Bold and
- underline attributes from the style are preserved (and displayed).
-
- .. versionadded:: 0.9
-
- .. versionchanged:: 2.2
- If the used style defines foreground colors in the form ``#ansi*``, then
- `Terminal256Formatter` will map these to non extended foreground color.
- See :ref:`AnsiTerminalStyle` for more information.
-
- .. versionchanged:: 2.4
- The ANSI color names have been updated with names that are easier to
- understand and align with colornames of other projects and terminals.
- See :ref:`this table <new-ansi-color-names>` for more information.
-
-
- Options accepted:
-
- `style`
- The style to use, can be a string or a Style subclass (default:
- ``'default'``).
- """
- name = 'Terminal256'
- aliases = ['terminal256', 'console256', '256']
- filenames = []
-
- def __init__(self, **options):
- Formatter.__init__(self, **options)
-
- self.xterm_colors = []
- self.best_match = {}
- self.style_string = {}
-
- self.usebold = 'nobold' not in options
- self.useunderline = 'nounderline' not in options
-
- self._build_color_table() # build an RGB-to-256 color conversion table
- self._setup_styles() # convert selected style's colors to term. colors
-
- def _build_color_table(self):
- # colors 0..15: 16 basic colors
-
- self.xterm_colors.append((0x00, 0x00, 0x00)) # 0
- self.xterm_colors.append((0xcd, 0x00, 0x00)) # 1
- self.xterm_colors.append((0x00, 0xcd, 0x00)) # 2
- self.xterm_colors.append((0xcd, 0xcd, 0x00)) # 3
- self.xterm_colors.append((0x00, 0x00, 0xee)) # 4
- self.xterm_colors.append((0xcd, 0x00, 0xcd)) # 5
- self.xterm_colors.append((0x00, 0xcd, 0xcd)) # 6
- self.xterm_colors.append((0xe5, 0xe5, 0xe5)) # 7
- self.xterm_colors.append((0x7f, 0x7f, 0x7f)) # 8
- self.xterm_colors.append((0xff, 0x00, 0x00)) # 9
- self.xterm_colors.append((0x00, 0xff, 0x00)) # 10
- self.xterm_colors.append((0xff, 0xff, 0x00)) # 11
- self.xterm_colors.append((0x5c, 0x5c, 0xff)) # 12
- self.xterm_colors.append((0xff, 0x00, 0xff)) # 13
- self.xterm_colors.append((0x00, 0xff, 0xff)) # 14
- self.xterm_colors.append((0xff, 0xff, 0xff)) # 15
-
- # colors 16..232: the 6x6x6 color cube
-
- valuerange = (0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff)
-
- for i in range(217):
- r = valuerange[(i // 36) % 6]
- g = valuerange[(i // 6) % 6]
- b = valuerange[i % 6]
- self.xterm_colors.append((r, g, b))
-
- # colors 233..253: grayscale
-
- for i in range(1, 22):
- v = 8 + i * 10
- self.xterm_colors.append((v, v, v))
-
- def _closest_color(self, r, g, b):
- distance = 257*257*3 # "infinity" (>distance from #000000 to #ffffff)
- match = 0
-
- for i in range(0, 254):
- values = self.xterm_colors[i]
-
- rd = r - values[0]
- gd = g - values[1]
- bd = b - values[2]
- d = rd*rd + gd*gd + bd*bd
-
- if d < distance:
- match = i
- distance = d
- return match
-
- def _color_index(self, color):
- index = self.best_match.get(color, None)
- if color in ansicolors:
- # strip the `ansi/#ansi` part and look up code
- index = color
- self.best_match[color] = index
- if index is None:
- try:
- rgb = int(str(color), 16)
- except ValueError:
- rgb = 0
-
- r = (rgb >> 16) & 0xff
- g = (rgb >> 8) & 0xff
- b = rgb & 0xff
- index = self._closest_color(r, g, b)
- self.best_match[color] = index
- return index
-
- def _setup_styles(self):
- for ttype, ndef in self.style:
- escape = EscapeSequence()
- # get foreground from ansicolor if set
- if ndef['ansicolor']:
- escape.fg = self._color_index(ndef['ansicolor'])
- elif ndef['color']:
- escape.fg = self._color_index(ndef['color'])
- if ndef['bgansicolor']:
- escape.bg = self._color_index(ndef['bgansicolor'])
- elif ndef['bgcolor']:
- escape.bg = self._color_index(ndef['bgcolor'])
- if self.usebold and ndef['bold']:
- escape.bold = True
- if self.useunderline and ndef['underline']:
- escape.underline = True
- self.style_string[str(ttype)] = (escape.color_string(),
- escape.reset_string())
-
- def format(self, tokensource, outfile):
- # 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() and \
- sys.version_info < (3,):
- self.encoding = outfile.encoding
- return Formatter.format(self, tokensource, outfile)
-
- def format_unencoded(self, tokensource, outfile):
- for ttype, value in tokensource:
- not_found = True
- while ttype and not_found:
- try:
- # outfile.write( "<" + str(ttype) + ">" )
- on, off = self.style_string[str(ttype)]
-
- # Like TerminalFormatter, add "reset colors" escape sequence
- # on newline.
- spl = value.split('\n')
- for line in spl[:-1]:
- if line:
- outfile.write(on + line + off)
- outfile.write('\n')
- if spl[-1]:
- outfile.write(on + spl[-1] + off)
-
- not_found = False
- # outfile.write( '#' + str(ttype) + '#' )
-
- except KeyError:
- # ottype = ttype
- ttype = ttype[:-1]
- # outfile.write( '!' + str(ottype) + '->' + str(ttype) + '!' )
-
- if not_found:
- outfile.write(value)
-
-
-class TerminalTrueColorFormatter(Terminal256Formatter):
- r"""
- Format tokens with ANSI color sequences, for output in a true-color
- terminal or console. Like in `TerminalFormatter` color sequences
- are terminated at newlines, so that paging the output works correctly.
-
- .. versionadded:: 2.1
-
- Options accepted:
-
- `style`
- The style to use, can be a string or a Style subclass (default:
- ``'default'``).
- """
- name = 'TerminalTrueColor'
- aliases = ['terminal16m', 'console16m', '16m']
- filenames = []
-
- def _build_color_table(self):
- pass
-
- def _color_tuple(self, color):
- try:
- rgb = int(str(color), 16)
- except ValueError:
- return None
- r = (rgb >> 16) & 0xff
- g = (rgb >> 8) & 0xff
- b = rgb & 0xff
- return (r, g, b)
-
- def _setup_styles(self):
- for ttype, ndef in self.style:
- escape = EscapeSequence()
- if ndef['color']:
- escape.fg = self._color_tuple(ndef['color'])
- if ndef['bgcolor']:
- escape.bg = self._color_tuple(ndef['bgcolor'])
- if self.usebold and ndef['bold']:
- escape.bold = True
- if self.useunderline and ndef['underline']:
- escape.underline = True
- self.style_string[str(ttype)] = (escape.true_color_string(),
- escape.reset_string())
diff --git a/pygments/lexer.py b/pygments/lexer.py
deleted file mode 100644
index 56a7e1e8..00000000
--- a/pygments/lexer.py
+++ /dev/null
@@ -1,881 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexer
- ~~~~~~~~~~~~~~
-
- Base lexer classes.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import re
-import sys
-import time
-
-from pygments.filter import apply_filters, Filter
-from pygments.filters import get_filter_by_name
-from pygments.token import Error, Text, Other, _TokenType
-from pygments.util import get_bool_opt, get_int_opt, get_list_opt, \
- make_analysator, text_type, add_metaclass, iteritems, Future, guess_decode
-from pygments.regexopt import regex_opt
-
-__all__ = ['Lexer', 'RegexLexer', 'ExtendedRegexLexer', 'DelegatingLexer',
- 'LexerContext', 'include', 'inherit', 'bygroups', 'using', 'this',
- 'default', 'words']
-
-
-_encoding_map = [(b'\xef\xbb\xbf', 'utf-8'),
- (b'\xff\xfe\0\0', 'utf-32'),
- (b'\0\0\xfe\xff', 'utf-32be'),
- (b'\xff\xfe', 'utf-16'),
- (b'\xfe\xff', 'utf-16be')]
-
-_default_analyse = staticmethod(lambda x: 0.0)
-
-
-class LexerMeta(type):
- """
- This metaclass automagically converts ``analyse_text`` methods into
- static methods which always return float values.
- """
-
- def __new__(mcs, name, bases, d):
- if 'analyse_text' in d:
- d['analyse_text'] = make_analysator(d['analyse_text'])
- return type.__new__(mcs, name, bases, d)
-
-
-@add_metaclass(LexerMeta)
-class Lexer(object):
- """
- Lexer for a specific language.
-
- Basic options recognized:
- ``stripnl``
- Strip leading and trailing newlines from the input (default: True).
- ``stripall``
- Strip all leading and trailing whitespace from the input
- (default: False).
- ``ensurenl``
- Make sure that the input ends with a newline (default: True). This
- is required for some lexers that consume input linewise.
-
- .. versionadded:: 1.3
-
- ``tabsize``
- If given and greater than 0, expand tabs in the input (default: 0).
- ``encoding``
- If given, must be an encoding name. This encoding will be used to
- convert the input string to Unicode, if it is not already a Unicode
- string (default: ``'guess'``, which uses a simple UTF-8 / Locale /
- Latin1 detection. Can also be ``'chardet'`` to use the chardet
- library, if it is installed.
- ``inencoding``
- Overrides the ``encoding`` if given.
- """
-
- #: Name of the lexer
- name = None
-
- #: Shortcuts for the lexer
- aliases = []
-
- #: File name globs
- filenames = []
-
- #: Secondary file name globs
- alias_filenames = []
-
- #: MIME types
- mimetypes = []
-
- #: Priority, should multiple lexers match and no content is provided
- priority = 0
-
- def __init__(self, **options):
- self.options = options
- self.stripnl = get_bool_opt(options, 'stripnl', True)
- self.stripall = get_bool_opt(options, 'stripall', False)
- self.ensurenl = get_bool_opt(options, 'ensurenl', True)
- self.tabsize = get_int_opt(options, 'tabsize', 0)
- self.encoding = options.get('encoding', 'guess')
- self.encoding = options.get('inencoding') or self.encoding
- self.filters = []
- for filter_ in get_list_opt(options, 'filters', ()):
- self.add_filter(filter_)
-
- def __repr__(self):
- if self.options:
- return '<pygments.lexers.%s with %r>' % (self.__class__.__name__,
- self.options)
- else:
- return '<pygments.lexers.%s>' % self.__class__.__name__
-
- def add_filter(self, filter_, **options):
- """
- Add a new stream filter to this lexer.
- """
- if not isinstance(filter_, Filter):
- filter_ = get_filter_by_name(filter_, **options)
- self.filters.append(filter_)
-
- def analyse_text(text):
- """
- Has to return a float between ``0`` and ``1`` that indicates
- if a lexer wants to highlight this text. Used by ``guess_lexer``.
- If this method returns ``0`` it won't highlight it in any case, if
- it returns ``1`` highlighting with this lexer is guaranteed.
-
- The `LexerMeta` metaclass automatically wraps this function so
- that it works like a static method (no ``self`` or ``cls``
- parameter) and the return value is automatically converted to
- `float`. If the return value is an object that is boolean `False`
- it's the same as if the return values was ``0.0``.
- """
-
- def get_tokens(self, text, unfiltered=False):
- """
- Return an iterable of (tokentype, value) pairs generated from
- `text`. If `unfiltered` is set to `True`, the filtering mechanism
- is bypassed even if filters are defined.
-
- Also preprocess the text, i.e. expand tabs and strip it if
- wanted and applies registered filters.
- """
- if not isinstance(text, text_type):
- if self.encoding == 'guess':
- text, _ = guess_decode(text)
- elif self.encoding == 'chardet':
- try:
- import chardet
- except ImportError:
- raise ImportError('To enable chardet encoding guessing, '
- 'please install the chardet library '
- 'from http://chardet.feedparser.org/')
- # check for BOM first
- decoded = None
- for bom, encoding in _encoding_map:
- if text.startswith(bom):
- decoded = text[len(bom):].decode(encoding, 'replace')
- break
- # no BOM found, so use chardet
- if decoded is None:
- enc = chardet.detect(text[:1024]) # Guess using first 1KB
- decoded = text.decode(enc.get('encoding') or 'utf-8',
- 'replace')
- text = decoded
- else:
- text = text.decode(self.encoding)
- if text.startswith(u'\ufeff'):
- text = text[len(u'\ufeff'):]
- else:
- if text.startswith(u'\ufeff'):
- text = text[len(u'\ufeff'):]
-
- # text now *is* a unicode string
- text = text.replace('\r\n', '\n')
- text = text.replace('\r', '\n')
- if self.stripall:
- text = text.strip()
- elif self.stripnl:
- text = text.strip('\n')
- if self.tabsize > 0:
- text = text.expandtabs(self.tabsize)
- if self.ensurenl and not text.endswith('\n'):
- text += '\n'
-
- def streamer():
- for _, t, v in self.get_tokens_unprocessed(text):
- yield t, v
- stream = streamer()
- if not unfiltered:
- stream = apply_filters(stream, self.filters, self)
- return stream
-
- def get_tokens_unprocessed(self, text):
- """
- Return an iterable of (index, tokentype, value) pairs where "index"
- is the starting position of the token within the input text.
-
- In subclasses, implement this method as a generator to
- maximize effectiveness.
- """
- raise NotImplementedError
-
-
-class DelegatingLexer(Lexer):
- """
- This lexer takes two lexer as arguments. A root lexer and
- a language lexer. First everything is scanned using the language
- lexer, afterwards all ``Other`` tokens are lexed using the root
- lexer.
-
- The lexers from the ``template`` lexer package use this base lexer.
- """
-
- def __init__(self, _root_lexer, _language_lexer, _needle=Other, **options):
- self.root_lexer = _root_lexer(**options)
- self.language_lexer = _language_lexer(**options)
- self.needle = _needle
- Lexer.__init__(self, **options)
-
- def get_tokens_unprocessed(self, text):
- buffered = ''
- insertions = []
- lng_buffer = []
- for i, t, v in self.language_lexer.get_tokens_unprocessed(text):
- if t is self.needle:
- if lng_buffer:
- insertions.append((len(buffered), lng_buffer))
- lng_buffer = []
- buffered += v
- else:
- lng_buffer.append((i, t, v))
- if lng_buffer:
- insertions.append((len(buffered), lng_buffer))
- return do_insertions(insertions,
- self.root_lexer.get_tokens_unprocessed(buffered))
-
-
-# ------------------------------------------------------------------------------
-# RegexLexer and ExtendedRegexLexer
-#
-
-
-class include(str): # pylint: disable=invalid-name
- """
- Indicates that a state should include rules from another state.
- """
- pass
-
-
-class _inherit(object):
- """
- Indicates the a state should inherit from its superclass.
- """
- def __repr__(self):
- return 'inherit'
-
-inherit = _inherit() # pylint: disable=invalid-name
-
-
-class combined(tuple): # pylint: disable=invalid-name
- """
- Indicates a state combined from multiple states.
- """
-
- def __new__(cls, *args):
- return tuple.__new__(cls, args)
-
- def __init__(self, *args):
- # tuple.__init__ doesn't do anything
- pass
-
-
-class _PseudoMatch(object):
- """
- A pseudo match object constructed from a string.
- """
-
- def __init__(self, start, text):
- self._text = text
- self._start = start
-
- def start(self, arg=None):
- return self._start
-
- def end(self, arg=None):
- return self._start + len(self._text)
-
- def group(self, arg=None):
- if arg:
- raise IndexError('No such group')
- return self._text
-
- def groups(self):
- return (self._text,)
-
- def groupdict(self):
- return {}
-
-
-def bygroups(*args):
- """
- Callback that yields multiple actions for each group in the match.
- """
- def callback(lexer, match, ctx=None):
- for i, action in enumerate(args):
- if action is None:
- continue
- elif type(action) is _TokenType:
- data = match.group(i + 1)
- if data:
- yield match.start(i + 1), action, data
- else:
- 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
-
-
-class _This(object):
- """
- Special singleton used for indicating the caller class.
- Used by ``using``.
- """
-this = _This()
-
-
-def using(_other, **kwargs):
- """
- Callback that processes the match with a different lexer.
-
- The keyword arguments are forwarded to the lexer, except `state` which
- is handled separately.
-
- `state` specifies the state that the new lexer will start in, and can
- be an enumerable such as ('root', 'inline', 'string') or a simple
- string which is assumed to be on top of the root state.
-
- Note: For that to work, `_other` must not be an `ExtendedRegexLexer`.
- """
- gt_kwargs = {}
- if 'state' in kwargs:
- s = kwargs.pop('state')
- if isinstance(s, (list, tuple)):
- gt_kwargs['stack'] = s
- else:
- gt_kwargs['stack'] = ('root', s)
-
- if _other is this:
- def callback(lexer, match, ctx=None):
- # if keyword arguments are given the callback
- # function has to create a new lexer instance
- if kwargs:
- # XXX: cache that somehow
- kwargs.update(lexer.options)
- lx = lexer.__class__(**kwargs)
- else:
- lx = lexer
- s = match.start()
- for i, t, v in lx.get_tokens_unprocessed(match.group(), **gt_kwargs):
- yield i + s, t, v
- if ctx:
- ctx.pos = match.end()
- else:
- def callback(lexer, match, ctx=None):
- # XXX: cache that somehow
- kwargs.update(lexer.options)
- lx = _other(**kwargs)
-
- s = match.start()
- for i, t, v in lx.get_tokens_unprocessed(match.group(), **gt_kwargs):
- yield i + s, t, v
- if ctx:
- ctx.pos = match.end()
- return callback
-
-
-class default:
- """
- Indicates a state or state action (e.g. #pop) to apply.
- For example default('#pop') is equivalent to ('', Token, '#pop')
- Note that state tuples may be used as well.
-
- .. versionadded:: 2.0
- """
- def __init__(self, state):
- self.state = state
-
-
-class words(Future):
- """
- Indicates a list of literal words that is transformed into an optimized
- regex that matches any of the words.
-
- .. versionadded:: 2.0
- """
- def __init__(self, words, prefix='', suffix=''):
- self.words = words
- self.prefix = prefix
- self.suffix = suffix
-
- def get(self):
- return regex_opt(self.words, prefix=self.prefix, suffix=self.suffix)
-
-
-class RegexLexerMeta(LexerMeta):
- """
- Metaclass for RegexLexer, creates the self._tokens attribute from
- self.tokens on the first instantiation.
- """
-
- def _process_regex(cls, regex, rflags, state):
- """Preprocess the regular expression component of a token definition."""
- if isinstance(regex, Future):
- regex = regex.get()
- return re.compile(regex, rflags).match
-
- def _process_token(cls, token):
- """Preprocess the token component of a token definition."""
- assert type(token) is _TokenType or callable(token), \
- 'token type must be simple type or callable, not %r' % (token,)
- return token
-
- def _process_new_state(cls, new_state, unprocessed, processed):
- """Preprocess the state transition action of a token definition."""
- if isinstance(new_state, str):
- # an existing state
- if new_state == '#pop':
- return -1
- elif new_state in unprocessed:
- return (new_state,)
- elif new_state == '#push':
- return new_state
- elif new_state[:5] == '#pop:':
- return -int(new_state[5:])
- else:
- assert False, 'unknown new state %r' % new_state
- elif isinstance(new_state, combined):
- # combine a new state from existing ones
- tmp_state = '_tmp_%d' % cls._tmpname
- cls._tmpname += 1
- itokens = []
- for istate in new_state:
- assert istate != new_state, 'circular state ref %r' % istate
- itokens.extend(cls._process_state(unprocessed,
- processed, istate))
- processed[tmp_state] = itokens
- return (tmp_state,)
- elif isinstance(new_state, tuple):
- # push more than one state
- for istate in new_state:
- assert (istate in unprocessed or
- istate in ('#pop', '#push')), \
- 'unknown new state ' + istate
- return new_state
- else:
- assert False, 'unknown new state def %r' % new_state
-
- def _process_state(cls, unprocessed, processed, state):
- """Preprocess a single state definition."""
- assert type(state) is str, "wrong state name %r" % state
- assert state[0] != '#', "invalid state name %r" % state
- if state in processed:
- return processed[state]
- tokens = processed[state] = []
- rflags = cls.flags
- for tdef in unprocessed[state]:
- if isinstance(tdef, include):
- # it's a state reference
- assert tdef != state, "circular state reference %r" % state
- tokens.extend(cls._process_state(unprocessed, processed,
- str(tdef)))
- continue
- if isinstance(tdef, _inherit):
- # should be processed already, but may not in the case of:
- # 1. the state has no counterpart in any parent
- # 2. the state includes more than one 'inherit'
- continue
- if isinstance(tdef, default):
- new_state = cls._process_new_state(tdef.state, unprocessed, processed)
- tokens.append((re.compile('').match, None, new_state))
- continue
-
- assert type(tdef) is tuple, "wrong rule def %r" % tdef
-
- try:
- rex = cls._process_regex(tdef[0], rflags, state)
- except Exception as err:
- raise ValueError("uncompilable regex %r in state %r of %r: %s" %
- (tdef[0], state, cls, err))
-
- token = cls._process_token(tdef[1])
-
- if len(tdef) == 2:
- new_state = None
- else:
- new_state = cls._process_new_state(tdef[2],
- unprocessed, processed)
-
- tokens.append((rex, token, new_state))
- return tokens
-
- def process_tokendef(cls, name, tokendefs=None):
- """Preprocess a dictionary of token definitions."""
- processed = cls._all_tokens[name] = {}
- tokendefs = tokendefs or cls.tokens[name]
- for state in list(tokendefs):
- cls._process_state(tokendefs, processed, state)
- return processed
-
- def get_tokendefs(cls):
- """
- Merge tokens from superclasses in MRO order, returning a single tokendef
- dictionary.
-
- Any state that is not defined by a subclass will be inherited
- automatically. States that *are* defined by subclasses will, by
- default, override that state in the superclass. If a subclass wishes to
- inherit definitions from a superclass, it can use the special value
- "inherit", which will cause the superclass' state definition to be
- included at that point in the state.
- """
- tokens = {}
- inheritable = {}
- for c in cls.__mro__:
- toks = c.__dict__.get('tokens', {})
-
- for state, items in iteritems(toks):
- curitems = tokens.get(state)
- if curitems is None:
- # N.b. because this is assigned by reference, sufficiently
- # deep hierarchies are processed incrementally (e.g. for
- # A(B), B(C), C(RegexLexer), B will be premodified so X(B)
- # will not see any inherits in B).
- tokens[state] = items
- try:
- inherit_ndx = items.index(inherit)
- except ValueError:
- continue
- inheritable[state] = inherit_ndx
- continue
-
- inherit_ndx = inheritable.pop(state, None)
- if inherit_ndx is None:
- continue
-
- # Replace the "inherit" value with the items
- curitems[inherit_ndx:inherit_ndx+1] = items
- try:
- # N.b. this is the index in items (that is, the superclass
- # copy), so offset required when storing below.
- new_inh_ndx = items.index(inherit)
- except ValueError:
- pass
- else:
- inheritable[state] = inherit_ndx + new_inh_ndx
-
- return tokens
-
- def __call__(cls, *args, **kwds):
- """Instantiate cls after preprocessing its token definitions."""
- if '_tokens' not in cls.__dict__:
- cls._all_tokens = {}
- cls._tmpname = 0
- if hasattr(cls, 'token_variants') and cls.token_variants:
- # don't process yet
- pass
- else:
- cls._tokens = cls.process_tokendef('', cls.get_tokendefs())
-
- return type.__call__(cls, *args, **kwds)
-
-
-@add_metaclass(RegexLexerMeta)
-class RegexLexer(Lexer):
- """
- Base for simple stateful regular expression-based lexers.
- Simplifies the lexing process so that you need only
- provide a list of states and regular expressions.
- """
-
- #: Flags for compiling the regular expressions.
- #: Defaults to MULTILINE.
- flags = re.MULTILINE
-
- #: Dict of ``{'state': [(regex, tokentype, new_state), ...], ...}``
- #:
- #: The initial state is 'root'.
- #: ``new_state`` can be omitted to signify no state transition.
- #: If it is a string, the state is pushed on the stack and changed.
- #: If it is a tuple of strings, all states are pushed on the stack and
- #: the current state will be the topmost.
- #: It can also be ``combined('state1', 'state2', ...)``
- #: to signify a new, anonymous state combined from the rules of two
- #: or more existing ones.
- #: Furthermore, it can be '#pop' to signify going back one step in
- #: the state stack, or '#push' to push the current state on the stack
- #: again.
- #:
- #: The tuple can also be replaced with ``include('state')``, in which
- #: case the rules from the state named by the string are included in the
- #: current one.
- tokens = {}
-
- def get_tokens_unprocessed(self, text, stack=('root',)):
- """
- Split ``text`` into (tokentype, text) pairs.
-
- ``stack`` is the inital stack (default: ``['root']``)
- """
- pos = 0
- tokendefs = self._tokens
- statestack = list(stack)
- statetokens = tokendefs[statestack[-1]]
- while 1:
- for rexmatch, action, new_state in statetokens:
- m = rexmatch(text, pos)
- if m:
- if action is not None:
- if type(action) is _TokenType:
- yield pos, action, m.group()
- else:
- for item in action(self, m):
- yield item
- pos = m.end()
- if new_state is not None:
- # state transition
- if isinstance(new_state, tuple):
- for state in new_state:
- if state == '#pop':
- if len(statestack) > 1:
- statestack.pop()
- elif state == '#push':
- statestack.append(statestack[-1])
- else:
- statestack.append(state)
- elif isinstance(new_state, int):
- # pop, but keep at least one state on the stack
- # (random code leading to unexpected pops should
- # not allow exceptions)
- if abs(new_state) >= len(statestack):
- del statestack[1:]
- else:
- del statestack[new_state:]
- elif new_state == '#push':
- statestack.append(statestack[-1])
- else:
- assert False, "wrong state def: %r" % new_state
- statetokens = tokendefs[statestack[-1]]
- break
- else:
- # We are here only if all state tokens have been considered
- # and there was not a match on any of them.
- try:
- if text[pos] == '\n':
- # at EOL, reset state to "root"
- statestack = ['root']
- statetokens = tokendefs['root']
- yield pos, Text, u'\n'
- pos += 1
- continue
- yield pos, Error, text[pos]
- pos += 1
- except IndexError:
- break
-
-
-class LexerContext(object):
- """
- A helper object that holds lexer position data.
- """
-
- def __init__(self, text, pos, stack=None, end=None):
- self.text = text
- self.pos = pos
- self.end = end or len(text) # end=0 not supported ;-)
- self.stack = stack or ['root']
-
- def __repr__(self):
- return 'LexerContext(%r, %r, %r)' % (
- self.text, self.pos, self.stack)
-
-
-class ExtendedRegexLexer(RegexLexer):
- """
- A RegexLexer that uses a context object to store its state.
- """
-
- def get_tokens_unprocessed(self, text=None, context=None):
- """
- Split ``text`` into (tokentype, text) pairs.
- If ``context`` is given, use this lexer context instead.
- """
- tokendefs = self._tokens
- if not context:
- ctx = LexerContext(text, 0)
- statetokens = tokendefs['root']
- else:
- ctx = context
- statetokens = tokendefs[ctx.stack[-1]]
- text = ctx.text
- while 1:
- for rexmatch, action, new_state in statetokens:
- m = rexmatch(text, ctx.pos, ctx.end)
- if m:
- if action is not None:
- if type(action) is _TokenType:
- yield ctx.pos, action, m.group()
- ctx.pos = m.end()
- else:
- for item in action(self, m, ctx):
- yield item
- if not new_state:
- # altered the state stack?
- statetokens = tokendefs[ctx.stack[-1]]
- # CAUTION: callback must set ctx.pos!
- if new_state is not None:
- # state transition
- if isinstance(new_state, tuple):
- for state in new_state:
- if state == '#pop':
- if len(ctx.stack) > 1:
- ctx.stack.pop()
- elif state == '#push':
- ctx.stack.append(ctx.stack[-1])
- else:
- ctx.stack.append(state)
- elif isinstance(new_state, int):
- # see RegexLexer for why this check is made
- if abs(new_state) >= len(ctx.stack):
- del ctx.state[1:]
- else:
- del ctx.stack[new_state:]
- elif new_state == '#push':
- ctx.stack.append(ctx.stack[-1])
- else:
- assert False, "wrong state def: %r" % new_state
- statetokens = tokendefs[ctx.stack[-1]]
- break
- else:
- try:
- if ctx.pos >= ctx.end:
- break
- if text[ctx.pos] == '\n':
- # at EOL, reset state to "root"
- ctx.stack = ['root']
- statetokens = tokendefs['root']
- yield ctx.pos, Text, u'\n'
- ctx.pos += 1
- continue
- yield ctx.pos, Error, text[ctx.pos]
- ctx.pos += 1
- except IndexError:
- break
-
-
-def do_insertions(insertions, tokens):
- """
- Helper for lexers which must combine the results of several
- sublexers.
-
- ``insertions`` is a list of ``(index, itokens)`` pairs.
- Each ``itokens`` iterable should be inserted at position
- ``index`` into the token stream given by the ``tokens``
- argument.
-
- The result is a combined token stream.
-
- TODO: clean up the code here.
- """
- insertions = iter(insertions)
- try:
- index, itokens = next(insertions)
- except StopIteration:
- # no insertions
- for item in tokens:
- yield item
- return
-
- realpos = None
- insleft = True
-
- # iterate over the token stream where we want to insert
- # the tokens from the insertion list.
- for i, t, v in tokens:
- # first iteration. store the postition of first item
- if realpos is None:
- realpos = i
- oldi = 0
- while insleft and i + len(v) >= index:
- tmpval = v[oldi:index - i]
- yield realpos, t, tmpval
- realpos += len(tmpval)
- for it_index, it_token, it_value in itokens:
- yield realpos, it_token, it_value
- realpos += len(it_value)
- oldi = index - i
- try:
- index, itokens = next(insertions)
- except StopIteration:
- insleft = False
- break # not strictly necessary
- yield realpos, t, v[oldi:]
- realpos += len(v) - oldi
-
- # leftover tokens
- while insleft:
- # no normal tokens, set realpos to zero
- realpos = realpos or 0
- for p, t, v in itokens:
- yield realpos, t, v
- realpos += len(v)
- try:
- index, itokens = next(insertions)
- except StopIteration:
- insleft = False
- break # not strictly necessary
-
-
-class ProfilingRegexLexerMeta(RegexLexerMeta):
- """Metaclass for ProfilingRegexLexer, collects regex timing info."""
-
- def _process_regex(cls, regex, rflags, state):
- if isinstance(regex, words):
- rex = regex_opt(regex.words, prefix=regex.prefix,
- suffix=regex.suffix)
- else:
- rex = regex
- compiled = re.compile(rex, rflags)
-
- def match_func(text, pos, endpos=sys.maxsize):
- info = cls._prof_data[-1].setdefault((state, rex), [0, 0.0])
- t0 = time.time()
- res = compiled.match(text, pos, endpos)
- t1 = time.time()
- info[0] += 1
- info[1] += t1 - t0
- return res
- return match_func
-
-
-@add_metaclass(ProfilingRegexLexerMeta)
-class ProfilingRegexLexer(RegexLexer):
- """Drop-in replacement for RegexLexer that does profiling of its regexes."""
-
- _prof_data = []
- _prof_sort_index = 4 # defaults to time per call
-
- def get_tokens_unprocessed(self, text, stack=('root',)):
- # this needs to be a stack, since using(this) will produce nested calls
- self.__class__._prof_data.append({})
- for tok in RegexLexer.get_tokens_unprocessed(self, text, stack):
- yield tok
- rawdata = self.__class__._prof_data.pop()
- data = sorted(((s, repr(r).strip('u\'').replace('\\\\', '\\')[:65],
- n, 1000 * t, 1000 * t / n)
- for ((s, r), (n, t)) in rawdata.items()),
- key=lambda x: x[self._prof_sort_index],
- reverse=True)
- sum_total = sum(x[3] for x in data)
-
- print()
- print('Profiling result for %s lexing %d chars in %.3f ms' %
- (self.__class__.__name__, len(text), sum_total))
- print('=' * 110)
- print('%-20s %-64s ncalls tottime percall' % ('state', 'regex'))
- print('-' * 110)
- for d in data:
- print('%-20s %-65s %5d %8.4f %8.4f' % d)
- print('=' * 110)
diff --git a/pygments/lexers/__init__.py b/pygments/lexers/__init__.py
deleted file mode 100644
index 1baf93b2..00000000
--- a/pygments/lexers/__init__.py
+++ /dev/null
@@ -1,337 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers
- ~~~~~~~~~~~~~~~
-
- Pygments lexers.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-import sys
-import types
-import fnmatch
-from os.path import basename
-
-from pygments.lexers._mapping import LEXERS
-from pygments.modeline import get_filetype_from_buffer
-from pygments.plugin import find_plugin_lexers
-from pygments.util import ClassNotFound, itervalues, guess_decode, text_type
-
-
-__all__ = ['get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class',
- 'guess_lexer', 'load_lexer_from_file'] + list(LEXERS)
-
-_lexer_cache = {}
-_pattern_cache = {}
-
-
-def _fn_matches(fn, glob):
- """Return whether the supplied file name fn matches pattern filename."""
- if glob not in _pattern_cache:
- pattern = _pattern_cache[glob] = re.compile(fnmatch.translate(glob))
- return pattern.match(fn)
- return _pattern_cache[glob].match(fn)
-
-
-def _load_lexers(module_name):
- """Load a lexer (and all others in the module too)."""
- mod = __import__(module_name, None, None, ['__all__'])
- for lexer_name in mod.__all__:
- cls = getattr(mod, lexer_name)
- _lexer_cache[cls.name] = cls
-
-
-def get_all_lexers():
- """Return a generator of tuples in the form ``(name, aliases,
- filenames, mimetypes)`` of all know lexers.
- """
- for item in itervalues(LEXERS):
- yield item[1:]
- for lexer in find_plugin_lexers():
- yield lexer.name, lexer.aliases, lexer.filenames, lexer.mimetypes
-
-
-def find_lexer_class(name):
- """Lookup a lexer class by name.
-
- Return None if not found.
- """
- if name in _lexer_cache:
- return _lexer_cache[name]
- # lookup builtin lexers
- for module_name, lname, aliases, _, _ in itervalues(LEXERS):
- if name == lname:
- _load_lexers(module_name)
- return _lexer_cache[name]
- # continue with lexers from setuptools entrypoints
- for cls in find_plugin_lexers():
- if cls.name == name:
- return cls
-
-
-def find_lexer_class_by_name(_alias):
- """Lookup a lexer class by alias.
-
- Like `get_lexer_by_name`, but does not instantiate the class.
-
- .. versionadded:: 2.2
- """
- if not _alias:
- raise ClassNotFound('no lexer for alias %r found' % _alias)
- # lookup builtin lexers
- for module_name, name, aliases, _, _ in itervalues(LEXERS):
- if _alias.lower() in aliases:
- if name not in _lexer_cache:
- _load_lexers(module_name)
- return _lexer_cache[name]
- # continue with lexers from setuptools entrypoints
- for cls in find_plugin_lexers():
- if _alias.lower() in cls.aliases:
- return cls
- raise ClassNotFound('no lexer for alias %r found' % _alias)
-
-
-def get_lexer_by_name(_alias, **options):
- """Get a lexer by an alias.
-
- Raises ClassNotFound if not found.
- """
- if not _alias:
- raise ClassNotFound('no lexer for alias %r found' % _alias)
-
- # lookup builtin lexers
- for module_name, name, aliases, _, _ in itervalues(LEXERS):
- if _alias.lower() in aliases:
- if name not in _lexer_cache:
- _load_lexers(module_name)
- return _lexer_cache[name](**options)
- # continue with lexers from setuptools entrypoints
- for cls in find_plugin_lexers():
- if _alias.lower() in cls.aliases:
- return cls(**options)
- raise ClassNotFound('no lexer for alias %r found' % _alias)
-
-
-def load_lexer_from_file(filename, lexername="CustomLexer", **options):
- """Load a lexer from a file.
-
- This method expects a file located relative to the current working
- directory, which contains a Lexer class. By default, it expects the
- Lexer to be name CustomLexer; you can specify your own class name
- as the second argument to this function.
-
- Users should be very careful with the input, because this method
- is equivalent to running eval on the input file.
-
- Raises ClassNotFound if there are any problems importing the Lexer.
-
- .. versionadded:: 2.2
- """
- try:
- # This empty dict will contain the namespace for the exec'd file
- custom_namespace = {}
- with open(filename, 'rb') as f:
- exec(f.read(), custom_namespace)
- # Retrieve the class `lexername` from that namespace
- if lexername not in custom_namespace:
- raise ClassNotFound('no valid %s class found in %s' %
- (lexername, filename))
- lexer_class = custom_namespace[lexername]
- # And finally instantiate it with the options
- return lexer_class(**options)
- except IOError as err:
- raise ClassNotFound('cannot read %s' % filename)
- except ClassNotFound as err:
- raise
- except Exception as err:
- raise ClassNotFound('error when loading custom lexer: %s' % err)
-
-
-def find_lexer_class_for_filename(_fn, code=None):
- """Get a lexer for a filename.
-
- If multiple lexers match the filename pattern, use ``analyse_text()`` to
- figure out which one is more appropriate.
-
- Returns None if not found.
- """
- matches = []
- fn = basename(_fn)
- for modname, name, _, filenames, _ in itervalues(LEXERS):
- for filename in filenames:
- if _fn_matches(fn, filename):
- if name not in _lexer_cache:
- _load_lexers(modname)
- matches.append((_lexer_cache[name], filename))
- for cls in find_plugin_lexers():
- for filename in cls.filenames:
- if _fn_matches(fn, filename):
- matches.append((cls, filename))
-
- if sys.version_info > (3,) and isinstance(code, bytes):
- # decode it, since all analyse_text functions expect unicode
- code = guess_decode(code)
-
- 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.
- if code:
- return cls.analyse_text(code) + bonus, cls.__name__
- return cls.priority + bonus, cls.__name__
-
- if matches:
- matches.sort(key=get_rating)
- # print "Possible lexers, after sort:", matches
- return matches[-1][0]
-
-
-def get_lexer_for_filename(_fn, code=None, **options):
- """Get a lexer for a filename.
-
- If multiple lexers match the filename pattern, use ``analyse_text()`` to
- figure out which one is more appropriate.
-
- Raises ClassNotFound if not found.
- """
- res = find_lexer_class_for_filename(_fn, code)
- if not res:
- raise ClassNotFound('no lexer for filename %r found' % _fn)
- return res(**options)
-
-
-def get_lexer_for_mimetype(_mime, **options):
- """Get a lexer for a mimetype.
-
- Raises ClassNotFound if not found.
- """
- for modname, name, _, _, mimetypes in itervalues(LEXERS):
- if _mime in mimetypes:
- if name not in _lexer_cache:
- _load_lexers(modname)
- return _lexer_cache[name](**options)
- for cls in find_plugin_lexers():
- if _mime in cls.mimetypes:
- return cls(**options)
- raise ClassNotFound('no lexer for mimetype %r found' % _mime)
-
-
-def _iter_lexerclasses(plugins=True):
- """Return an iterator over all lexer classes."""
- 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]
- if plugins:
- for lexer in find_plugin_lexers():
- yield lexer
-
-
-def guess_lexer_for_filename(_fn, _text, **options):
- """
- Lookup all lexers that handle those filenames primary (``filenames``)
- or secondary (``alias_filenames``). Then run a text analysis for those
- lexers and choose the best result.
-
- usage::
-
- >>> from pygments.lexers import guess_lexer_for_filename
- >>> guess_lexer_for_filename('hello.html', '<%= @foo %>')
- <pygments.lexers.templates.RhtmlLexer object at 0xb7d2f32c>
- >>> guess_lexer_for_filename('hello.html', '<h1>{{ title|e }}</h1>')
- <pygments.lexers.templates.HtmlDjangoLexer object at 0xb7d2f2ac>
- >>> guess_lexer_for_filename('style.css', 'a { color: <?= $link ?> }')
- <pygments.lexers.templates.CssPhpLexer object at 0xb7ba518c>
- """
- fn = basename(_fn)
- primary = {}
- matching_lexers = set()
- for lexer in _iter_lexerclasses():
- for filename in lexer.filenames:
- if _fn_matches(fn, filename):
- matching_lexers.add(lexer)
- primary[lexer] = True
- for filename in lexer.alias_filenames:
- if _fn_matches(fn, filename):
- matching_lexers.add(lexer)
- primary[lexer] = False
- if not matching_lexers:
- raise ClassNotFound('no lexer for filename %r found' % fn)
- if len(matching_lexers) == 1:
- return matching_lexers.pop()(**options)
- result = []
- for lexer in matching_lexers:
- rv = lexer.analyse_text(_text)
- if rv == 1.0:
- return lexer(**options)
- result.append((rv, lexer))
-
- def type_sort(t):
- # sort by:
- # - analyse score
- # - is primary filename pattern?
- # - priority
- # - last resort: class name
- return (t[0], primary[t[1]], t[1].priority, t[1].__name__)
- result.sort(key=type_sort)
-
- return result[-1][1](**options)
-
-
-def guess_lexer(_text, **options):
- """Guess a lexer by strong distinctions in the text (eg, shebang)."""
-
- if not isinstance(_text, text_type):
- inencoding = options.get('inencoding', options.get('encoding'))
- if inencoding:
- _text = _text.decode(inencoding or 'utf8')
- else:
- _text, _ = guess_decode(_text)
-
- # try to get a vim modeline first
- ft = get_filetype_from_buffer(_text)
-
- if ft is not None:
- try:
- return get_lexer_by_name(ft, **options)
- except ClassNotFound:
- pass
-
- best_lexer = [0.0, None]
- for lexer in _iter_lexerclasses():
- rv = lexer.analyse_text(_text)
- if rv == 1.0:
- return lexer(**options)
- if rv > best_lexer[0]:
- best_lexer[:] = (rv, lexer)
- if not best_lexer[0] or best_lexer[1] is None:
- raise ClassNotFound('no lexer matching the text found')
- return best_lexer[1](**options)
-
-
-class _automodule(types.ModuleType):
- """Automatically import lexers."""
-
- def __getattr__(self, name):
- info = LEXERS.get(name)
- if info:
- _load_lexers(info[0])
- cls = _lexer_cache[info[1]]
- setattr(self, name, cls)
- return cls
- raise AttributeError(name)
-
-
-oldmod = sys.modules[__name__]
-newmod = _automodule(__name__)
-newmod.__dict__.update(oldmod.__dict__)
-sys.modules[__name__] = newmod
-del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types
diff --git a/pygments/lexers/_asy_builtins.py b/pygments/lexers/_asy_builtins.py
deleted file mode 100644
index 6ac79ad7..00000000
--- a/pygments/lexers/_asy_builtins.py
+++ /dev/null
@@ -1,1645 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._asy_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This file contains the asy-function names and asy-variable names of
- Asymptote.
-
- Do not edit the ASYFUNCNAME and ASYVARNAME sets by hand.
- TODO: perl/python script in Asymptote SVN similar to asy-list.pl but only
- for function and variable names.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-ASYFUNCNAME = set((
- 'AND',
- 'Arc',
- 'ArcArrow',
- 'ArcArrows',
- 'Arrow',
- 'Arrows',
- 'Automatic',
- 'AvantGarde',
- 'BBox',
- 'BWRainbow',
- 'BWRainbow2',
- 'Bar',
- 'Bars',
- 'BeginArcArrow',
- 'BeginArrow',
- 'BeginBar',
- 'BeginDotMargin',
- 'BeginMargin',
- 'BeginPenMargin',
- 'Blank',
- 'Bookman',
- 'Bottom',
- 'BottomTop',
- 'Bounds',
- 'Break',
- 'Broken',
- 'BrokenLog',
- 'Ceil',
- 'Circle',
- 'CircleBarIntervalMarker',
- 'Cos',
- 'Courier',
- 'CrossIntervalMarker',
- 'DefaultFormat',
- 'DefaultLogFormat',
- 'Degrees',
- 'Dir',
- 'DotMargin',
- 'DotMargins',
- 'Dotted',
- 'Draw',
- 'Drawline',
- 'Embed',
- 'EndArcArrow',
- 'EndArrow',
- 'EndBar',
- 'EndDotMargin',
- 'EndMargin',
- 'EndPenMargin',
- 'Fill',
- 'FillDraw',
- 'Floor',
- 'Format',
- 'Full',
- 'Gaussian',
- 'Gaussrand',
- 'Gaussrandpair',
- 'Gradient',
- 'Grayscale',
- 'Helvetica',
- 'Hermite',
- 'HookHead',
- 'InOutTicks',
- 'InTicks',
- 'J',
- 'Label',
- 'Landscape',
- 'Left',
- 'LeftRight',
- 'LeftTicks',
- 'Legend',
- 'Linear',
- 'Link',
- 'Log',
- 'LogFormat',
- 'Margin',
- 'Margins',
- 'Mark',
- 'MidArcArrow',
- 'MidArrow',
- 'NOT',
- 'NewCenturySchoolBook',
- 'NoBox',
- 'NoMargin',
- 'NoModifier',
- 'NoTicks',
- 'NoTicks3',
- 'NoZero',
- 'NoZeroFormat',
- 'None',
- 'OR',
- 'OmitFormat',
- 'OmitTick',
- 'OutTicks',
- 'Ox',
- 'Oy',
- 'Palatino',
- 'PaletteTicks',
- 'Pen',
- 'PenMargin',
- 'PenMargins',
- 'Pentype',
- 'Portrait',
- 'RadialShade',
- 'Rainbow',
- 'Range',
- 'Relative',
- 'Right',
- 'RightTicks',
- 'Rotate',
- 'Round',
- 'SQR',
- 'Scale',
- 'ScaleX',
- 'ScaleY',
- 'ScaleZ',
- 'Seascape',
- 'Shift',
- 'Sin',
- 'Slant',
- 'Spline',
- 'StickIntervalMarker',
- 'Straight',
- 'Symbol',
- 'Tan',
- 'TeXify',
- 'Ticks',
- 'Ticks3',
- 'TildeIntervalMarker',
- 'TimesRoman',
- 'Top',
- 'TrueMargin',
- 'UnFill',
- 'UpsideDown',
- 'Wheel',
- 'X',
- 'XEquals',
- 'XOR',
- 'XY',
- 'XYEquals',
- 'XYZero',
- 'XYgrid',
- 'XZEquals',
- 'XZZero',
- 'XZero',
- 'XZgrid',
- 'Y',
- 'YEquals',
- 'YXgrid',
- 'YZ',
- 'YZEquals',
- 'YZZero',
- 'YZero',
- 'YZgrid',
- 'Z',
- 'ZX',
- 'ZXgrid',
- 'ZYgrid',
- 'ZapfChancery',
- 'ZapfDingbats',
- '_cputime',
- '_draw',
- '_eval',
- '_image',
- '_labelpath',
- '_projection',
- '_strokepath',
- '_texpath',
- 'aCos',
- 'aSin',
- 'aTan',
- 'abort',
- 'abs',
- 'accel',
- 'acos',
- 'acosh',
- 'acot',
- 'acsc',
- 'add',
- 'addArrow',
- 'addMargins',
- 'addSaveFunction',
- 'addnode',
- 'addnodes',
- 'addpenarc',
- 'addpenline',
- 'addseg',
- 'adjust',
- 'alias',
- 'align',
- 'all',
- 'altitude',
- 'angabscissa',
- 'angle',
- 'angpoint',
- 'animate',
- 'annotate',
- 'anticomplementary',
- 'antipedal',
- 'apply',
- 'approximate',
- 'arc',
- 'arcarrowsize',
- 'arccircle',
- 'arcdir',
- 'arcfromcenter',
- 'arcfromfocus',
- 'arclength',
- 'arcnodesnumber',
- 'arcpoint',
- 'arcsubtended',
- 'arcsubtendedcenter',
- 'arctime',
- 'arctopath',
- 'array',
- 'arrow',
- 'arrow2',
- 'arrowbase',
- 'arrowbasepoints',
- 'arrowsize',
- 'asec',
- 'asin',
- 'asinh',
- 'ask',
- 'assert',
- 'asy',
- 'asycode',
- 'asydir',
- 'asyfigure',
- 'asyfilecode',
- 'asyinclude',
- 'asywrite',
- 'atan',
- 'atan2',
- 'atanh',
- 'atbreakpoint',
- 'atexit',
- 'atime',
- 'attach',
- 'attract',
- 'atupdate',
- 'autoformat',
- 'autoscale',
- 'autoscale3',
- 'axes',
- 'axes3',
- 'axialshade',
- 'axis',
- 'axiscoverage',
- 'azimuth',
- 'babel',
- 'background',
- 'bangles',
- 'bar',
- 'barmarksize',
- 'barsize',
- 'basealign',
- 'baseline',
- 'bbox',
- 'beep',
- 'begin',
- 'beginclip',
- 'begingroup',
- 'beginpoint',
- 'between',
- 'bevel',
- 'bezier',
- 'bezierP',
- 'bezierPP',
- 'bezierPPP',
- 'bezulate',
- 'bibliography',
- 'bibliographystyle',
- 'binarytree',
- 'binarytreeNode',
- 'binomial',
- 'binput',
- 'bins',
- 'bisector',
- 'bisectorpoint',
- 'blend',
- 'boutput',
- 'box',
- 'bqe',
- 'breakpoint',
- 'breakpoints',
- 'brick',
- 'buildRestoreDefaults',
- 'buildRestoreThunk',
- 'buildcycle',
- 'bulletcolor',
- 'canonical',
- 'canonicalcartesiansystem',
- 'cartesiansystem',
- 'case1',
- 'case2',
- 'case3',
- 'cbrt',
- 'cd',
- 'ceil',
- 'center',
- 'centerToFocus',
- 'centroid',
- 'cevian',
- 'change2',
- 'changecoordsys',
- 'checkSegment',
- 'checkconditionlength',
- 'checker',
- 'checklengths',
- 'checkposition',
- 'checktriangle',
- 'choose',
- 'circle',
- 'circlebarframe',
- 'circlemarkradius',
- 'circlenodesnumber',
- 'circumcenter',
- 'circumcircle',
- 'clamped',
- 'clear',
- 'clip',
- 'clipdraw',
- 'close',
- 'cmyk',
- 'code',
- 'colatitude',
- 'collect',
- 'collinear',
- 'color',
- 'colorless',
- 'colors',
- 'colorspace',
- 'comma',
- 'compassmark',
- 'complement',
- 'complementary',
- 'concat',
- 'concurrent',
- 'cone',
- 'conic',
- 'conicnodesnumber',
- 'conictype',
- 'conj',
- 'connect',
- 'containmentTree',
- 'contains',
- 'contour',
- 'contour3',
- 'controlSpecifier',
- 'convert',
- 'coordinates',
- 'coordsys',
- 'copy',
- 'cos',
- 'cosh',
- 'cot',
- 'countIntersections',
- 'cputime',
- 'crop',
- 'cropcode',
- 'cross',
- 'crossframe',
- 'crosshatch',
- 'crossmarksize',
- 'csc',
- 'cubicroots',
- 'curabscissa',
- 'curlSpecifier',
- 'curpoint',
- 'currentarrow',
- 'currentexitfunction',
- 'currentmomarrow',
- 'currentpolarconicroutine',
- 'curve',
- 'cut',
- 'cutafter',
- 'cutbefore',
- 'cyclic',
- 'cylinder',
- 'debugger',
- 'deconstruct',
- 'defaultdir',
- 'defaultformat',
- 'defaultpen',
- 'defined',
- 'degenerate',
- 'degrees',
- 'delete',
- 'deletepreamble',
- 'determinant',
- 'diagonal',
- 'diamond',
- 'diffdiv',
- 'dir',
- 'dirSpecifier',
- 'dirtime',
- 'display',
- 'distance',
- 'divisors',
- 'do_overpaint',
- 'dot',
- 'dotframe',
- 'dotsize',
- 'downcase',
- 'draw',
- 'drawAll',
- 'drawDoubleLine',
- 'drawFermion',
- 'drawGhost',
- 'drawGluon',
- 'drawMomArrow',
- 'drawPhoton',
- 'drawScalar',
- 'drawVertex',
- 'drawVertexBox',
- 'drawVertexBoxO',
- 'drawVertexBoxX',
- 'drawVertexO',
- 'drawVertexOX',
- 'drawVertexTriangle',
- 'drawVertexTriangleO',
- 'drawVertexX',
- 'drawarrow',
- 'drawarrow2',
- 'drawline',
- 'drawtick',
- 'duplicate',
- 'elle',
- 'ellipse',
- 'ellipsenodesnumber',
- 'embed',
- 'embed3',
- 'empty',
- 'enclose',
- 'end',
- 'endScript',
- 'endclip',
- 'endgroup',
- 'endl',
- 'endpoint',
- 'endpoints',
- 'eof',
- 'eol',
- 'equation',
- 'equations',
- 'erase',
- 'erasestep',
- 'erf',
- 'erfc',
- 'error',
- 'errorbar',
- 'errorbars',
- 'eval',
- 'excenter',
- 'excircle',
- 'exit',
- 'exitXasyMode',
- 'exitfunction',
- 'exp',
- 'expfactors',
- 'expi',
- 'expm1',
- 'exradius',
- 'extend',
- 'extension',
- 'extouch',
- 'fabs',
- 'factorial',
- 'fermat',
- 'fft',
- 'fhorner',
- 'figure',
- 'file',
- 'filecode',
- 'fill',
- 'filldraw',
- 'filloutside',
- 'fillrule',
- 'filltype',
- 'find',
- 'finite',
- 'finiteDifferenceJacobian',
- 'firstcut',
- 'firstframe',
- 'fit',
- 'fit2',
- 'fixedscaling',
- 'floor',
- 'flush',
- 'fmdefaults',
- 'fmod',
- 'focusToCenter',
- 'font',
- 'fontcommand',
- 'fontsize',
- 'foot',
- 'format',
- 'frac',
- 'frequency',
- 'fromCenter',
- 'fromFocus',
- 'fspline',
- 'functionshade',
- 'gamma',
- 'generate_random_backtrace',
- 'generateticks',
- 'gergonne',
- 'getc',
- 'getint',
- 'getpair',
- 'getreal',
- 'getstring',
- 'gettriple',
- 'gluon',
- 'gouraudshade',
- 'graph',
- 'graphic',
- 'gray',
- 'grestore',
- 'grid',
- 'grid3',
- 'gsave',
- 'halfbox',
- 'hatch',
- 'hdiffdiv',
- 'hermite',
- 'hex',
- 'histogram',
- 'history',
- 'hline',
- 'hprojection',
- 'hsv',
- 'hyperbola',
- 'hyperbolanodesnumber',
- 'hyperlink',
- 'hypot',
- 'identity',
- 'image',
- 'incenter',
- 'incentral',
- 'incircle',
- 'increasing',
- 'incrementposition',
- 'indexedTransform',
- 'indexedfigure',
- 'initXasyMode',
- 'initdefaults',
- 'input',
- 'inradius',
- 'insert',
- 'inside',
- 'integrate',
- 'interactive',
- 'interior',
- 'interp',
- 'interpolate',
- 'intersect',
- 'intersection',
- 'intersectionpoint',
- 'intersectionpoints',
- 'intersections',
- 'intouch',
- 'inverse',
- 'inversion',
- 'invisible',
- 'is3D',
- 'isDuplicate',
- 'isogonal',
- 'isogonalconjugate',
- 'isotomic',
- 'isotomicconjugate',
- 'isparabola',
- 'italic',
- 'item',
- 'key',
- 'kurtosis',
- 'kurtosisexcess',
- 'label',
- 'labelaxis',
- 'labelmargin',
- 'labelpath',
- 'labels',
- 'labeltick',
- 'labelx',
- 'labelx3',
- 'labely',
- 'labely3',
- 'labelz',
- 'labelz3',
- 'lastcut',
- 'latex',
- 'latitude',
- 'latticeshade',
- 'layer',
- 'layout',
- 'ldexp',
- 'leastsquares',
- 'legend',
- 'legenditem',
- 'length',
- 'lift',
- 'light',
- 'limits',
- 'line',
- 'linear',
- 'linecap',
- 'lineinversion',
- 'linejoin',
- 'linemargin',
- 'lineskip',
- 'linetype',
- 'linewidth',
- 'link',
- 'list',
- 'lm_enorm',
- 'lm_evaluate_default',
- 'lm_lmdif',
- 'lm_lmpar',
- 'lm_minimize',
- 'lm_print_default',
- 'lm_print_quiet',
- 'lm_qrfac',
- 'lm_qrsolv',
- 'locale',
- 'locate',
- 'locatefile',
- 'location',
- 'log',
- 'log10',
- 'log1p',
- 'logaxiscoverage',
- 'longitude',
- 'lookup',
- 'magnetize',
- 'makeNode',
- 'makedraw',
- 'makepen',
- 'map',
- 'margin',
- 'markangle',
- 'markangleradius',
- 'markanglespace',
- 'markarc',
- 'marker',
- 'markinterval',
- 'marknodes',
- 'markrightangle',
- 'markuniform',
- 'mass',
- 'masscenter',
- 'massformat',
- 'math',
- 'max',
- 'max3',
- 'maxbezier',
- 'maxbound',
- 'maxcoords',
- 'maxlength',
- 'maxratio',
- 'maxtimes',
- 'mean',
- 'medial',
- 'median',
- 'midpoint',
- 'min',
- 'min3',
- 'minbezier',
- 'minbound',
- 'minipage',
- 'minratio',
- 'mintimes',
- 'miterlimit',
- 'momArrowPath',
- 'momarrowsize',
- 'monotonic',
- 'multifigure',
- 'nativeformat',
- 'natural',
- 'needshipout',
- 'newl',
- 'newpage',
- 'newslide',
- 'newton',
- 'newtree',
- 'nextframe',
- 'nextnormal',
- 'nextpage',
- 'nib',
- 'nodabscissa',
- 'none',
- 'norm',
- 'normalvideo',
- 'notaknot',
- 'nowarn',
- 'numberpage',
- 'nurb',
- 'object',
- 'offset',
- 'onpath',
- 'opacity',
- 'opposite',
- 'orientation',
- 'orig_circlenodesnumber',
- 'orig_circlenodesnumber1',
- 'orig_draw',
- 'orig_ellipsenodesnumber',
- 'orig_ellipsenodesnumber1',
- 'orig_hyperbolanodesnumber',
- 'orig_parabolanodesnumber',
- 'origin',
- 'orthic',
- 'orthocentercenter',
- 'outformat',
- 'outline',
- 'outprefix',
- 'output',
- 'overloadedMessage',
- 'overwrite',
- 'pack',
- 'pad',
- 'pairs',
- 'palette',
- 'parabola',
- 'parabolanodesnumber',
- 'parallel',
- 'partialsum',
- 'path',
- 'path3',
- 'pattern',
- 'pause',
- 'pdf',
- 'pedal',
- 'periodic',
- 'perp',
- 'perpendicular',
- 'perpendicularmark',
- 'phantom',
- 'phi1',
- 'phi2',
- 'phi3',
- 'photon',
- 'piecewisestraight',
- 'point',
- 'polar',
- 'polarconicroutine',
- 'polargraph',
- 'polygon',
- 'postcontrol',
- 'postscript',
- 'pow10',
- 'ppoint',
- 'prc',
- 'prc0',
- 'precision',
- 'precontrol',
- 'prepend',
- 'print_random_addresses',
- 'project',
- 'projection',
- 'purge',
- 'pwhermite',
- 'quadrant',
- 'quadraticroots',
- 'quantize',
- 'quarticroots',
- 'quotient',
- 'radialshade',
- 'radians',
- 'radicalcenter',
- 'radicalline',
- 'radius',
- 'rand',
- 'randompath',
- 'rd',
- 'readline',
- 'realmult',
- 'realquarticroots',
- 'rectangle',
- 'rectangular',
- 'rectify',
- 'reflect',
- 'relabscissa',
- 'relative',
- 'relativedistance',
- 'reldir',
- 'relpoint',
- 'reltime',
- 'remainder',
- 'remark',
- 'removeDuplicates',
- 'rename',
- 'replace',
- 'report',
- 'resetdefaultpen',
- 'restore',
- 'restoredefaults',
- 'reverse',
- 'reversevideo',
- 'rf',
- 'rfind',
- 'rgb',
- 'rgba',
- 'rgbint',
- 'rms',
- 'rotate',
- 'rotateO',
- 'rotation',
- 'round',
- 'roundbox',
- 'roundedpath',
- 'roundrectangle',
- 'samecoordsys',
- 'sameside',
- 'sample',
- 'save',
- 'savedefaults',
- 'saveline',
- 'scale',
- 'scale3',
- 'scaleO',
- 'scaleT',
- 'scaleless',
- 'scientific',
- 'search',
- 'searchtree',
- 'sec',
- 'secondaryX',
- 'secondaryY',
- 'seconds',
- 'section',
- 'sector',
- 'seek',
- 'seekeof',
- 'segment',
- 'sequence',
- 'setpens',
- 'sgn',
- 'sgnd',
- 'sharpangle',
- 'sharpdegrees',
- 'shift',
- 'shiftless',
- 'shipout',
- 'shipout3',
- 'show',
- 'side',
- 'simeq',
- 'simpson',
- 'sin',
- 'single',
- 'sinh',
- 'size',
- 'size3',
- 'skewness',
- 'skip',
- 'slant',
- 'sleep',
- 'slope',
- 'slopefield',
- 'solve',
- 'solveBVP',
- 'sort',
- 'sourceline',
- 'sphere',
- 'split',
- 'sqrt',
- 'square',
- 'srand',
- 'standardizecoordsys',
- 'startScript',
- 'startTrembling',
- 'stdev',
- 'step',
- 'stickframe',
- 'stickmarksize',
- 'stickmarkspace',
- 'stop',
- 'straight',
- 'straightness',
- 'string',
- 'stripdirectory',
- 'stripextension',
- 'stripfile',
- 'strokepath',
- 'subdivide',
- 'subitem',
- 'subpath',
- 'substr',
- 'sum',
- 'surface',
- 'symmedial',
- 'symmedian',
- 'system',
- 'tab',
- 'tableau',
- 'tan',
- 'tangent',
- 'tangential',
- 'tangents',
- 'tanh',
- 'tell',
- 'tensionSpecifier',
- 'tensorshade',
- 'tex',
- 'texcolor',
- 'texify',
- 'texpath',
- 'texpreamble',
- 'texreset',
- 'texshipout',
- 'texsize',
- 'textpath',
- 'thick',
- 'thin',
- 'tick',
- 'tickMax',
- 'tickMax3',
- 'tickMin',
- 'tickMin3',
- 'ticklabelshift',
- 'ticklocate',
- 'tildeframe',
- 'tildemarksize',
- 'tile',
- 'tiling',
- 'time',
- 'times',
- 'title',
- 'titlepage',
- 'topbox',
- 'transform',
- 'transformation',
- 'transpose',
- 'tremble',
- 'trembleFuzz',
- 'tremble_circlenodesnumber',
- 'tremble_circlenodesnumber1',
- 'tremble_draw',
- 'tremble_ellipsenodesnumber',
- 'tremble_ellipsenodesnumber1',
- 'tremble_hyperbolanodesnumber',
- 'tremble_marknodes',
- 'tremble_markuniform',
- 'tremble_parabolanodesnumber',
- 'triangle',
- 'triangleAbc',
- 'triangleabc',
- 'triangulate',
- 'tricoef',
- 'tridiagonal',
- 'trilinear',
- 'trim',
- 'trueMagnetize',
- 'truepoint',
- 'tube',
- 'uncycle',
- 'unfill',
- 'uniform',
- 'unit',
- 'unitrand',
- 'unitsize',
- 'unityroot',
- 'unstraighten',
- 'upcase',
- 'updatefunction',
- 'uperiodic',
- 'upscale',
- 'uptodate',
- 'usepackage',
- 'usersetting',
- 'usetypescript',
- 'usleep',
- 'value',
- 'variance',
- 'variancebiased',
- 'vbox',
- 'vector',
- 'vectorfield',
- 'verbatim',
- 'view',
- 'vline',
- 'vperiodic',
- 'vprojection',
- 'warn',
- 'warning',
- 'windingnumber',
- 'write',
- 'xaxis',
- 'xaxis3',
- 'xaxis3At',
- 'xaxisAt',
- 'xequals',
- 'xinput',
- 'xlimits',
- 'xoutput',
- 'xpart',
- 'xscale',
- 'xscaleO',
- 'xtick',
- 'xtick3',
- 'xtrans',
- 'yaxis',
- 'yaxis3',
- 'yaxis3At',
- 'yaxisAt',
- 'yequals',
- 'ylimits',
- 'ypart',
- 'yscale',
- 'yscaleO',
- 'ytick',
- 'ytick3',
- 'ytrans',
- 'zaxis3',
- 'zaxis3At',
- 'zero',
- 'zero3',
- 'zlimits',
- 'zpart',
- 'ztick',
- 'ztick3',
- 'ztrans'
-))
-
-ASYVARNAME = set((
- 'AliceBlue',
- 'Align',
- 'Allow',
- 'AntiqueWhite',
- 'Apricot',
- 'Aqua',
- 'Aquamarine',
- 'Aspect',
- 'Azure',
- 'BeginPoint',
- 'Beige',
- 'Bisque',
- 'Bittersweet',
- 'Black',
- 'BlanchedAlmond',
- 'Blue',
- 'BlueGreen',
- 'BlueViolet',
- 'Both',
- 'Break',
- 'BrickRed',
- 'Brown',
- 'BurlyWood',
- 'BurntOrange',
- 'CCW',
- 'CW',
- 'CadetBlue',
- 'CarnationPink',
- 'Center',
- 'Centered',
- 'Cerulean',
- 'Chartreuse',
- 'Chocolate',
- 'Coeff',
- 'Coral',
- 'CornflowerBlue',
- 'Cornsilk',
- 'Crimson',
- 'Crop',
- 'Cyan',
- 'Dandelion',
- 'DarkBlue',
- 'DarkCyan',
- 'DarkGoldenrod',
- 'DarkGray',
- 'DarkGreen',
- 'DarkKhaki',
- 'DarkMagenta',
- 'DarkOliveGreen',
- 'DarkOrange',
- 'DarkOrchid',
- 'DarkRed',
- 'DarkSalmon',
- 'DarkSeaGreen',
- 'DarkSlateBlue',
- 'DarkSlateGray',
- 'DarkTurquoise',
- 'DarkViolet',
- 'DeepPink',
- 'DeepSkyBlue',
- 'DefaultHead',
- 'DimGray',
- 'DodgerBlue',
- 'Dotted',
- 'Draw',
- 'E',
- 'ENE',
- 'EPS',
- 'ESE',
- 'E_Euler',
- 'E_PC',
- 'E_RK2',
- 'E_RK3BS',
- 'Emerald',
- 'EndPoint',
- 'Euler',
- 'Fill',
- 'FillDraw',
- 'FireBrick',
- 'FloralWhite',
- 'ForestGreen',
- 'Fuchsia',
- 'Gainsboro',
- 'GhostWhite',
- 'Gold',
- 'Goldenrod',
- 'Gray',
- 'Green',
- 'GreenYellow',
- 'Honeydew',
- 'HookHead',
- 'Horizontal',
- 'HotPink',
- 'I',
- 'IgnoreAspect',
- 'IndianRed',
- 'Indigo',
- 'Ivory',
- 'JOIN_IN',
- 'JOIN_OUT',
- 'JungleGreen',
- 'Khaki',
- 'LM_DWARF',
- 'LM_MACHEP',
- 'LM_SQRT_DWARF',
- 'LM_SQRT_GIANT',
- 'LM_USERTOL',
- 'Label',
- 'Lavender',
- 'LavenderBlush',
- 'LawnGreen',
- 'LeftJustified',
- 'LeftSide',
- 'LemonChiffon',
- 'LightBlue',
- 'LightCoral',
- 'LightCyan',
- 'LightGoldenrodYellow',
- 'LightGreen',
- 'LightGrey',
- 'LightPink',
- 'LightSalmon',
- 'LightSeaGreen',
- 'LightSkyBlue',
- 'LightSlateGray',
- 'LightSteelBlue',
- 'LightYellow',
- 'Lime',
- 'LimeGreen',
- 'Linear',
- 'Linen',
- 'Log',
- 'Logarithmic',
- 'Magenta',
- 'Mahogany',
- 'Mark',
- 'MarkFill',
- 'Maroon',
- 'Max',
- 'MediumAquamarine',
- 'MediumBlue',
- 'MediumOrchid',
- 'MediumPurple',
- 'MediumSeaGreen',
- 'MediumSlateBlue',
- 'MediumSpringGreen',
- 'MediumTurquoise',
- 'MediumVioletRed',
- 'Melon',
- 'MidPoint',
- 'MidnightBlue',
- 'Min',
- 'MintCream',
- 'MistyRose',
- 'Moccasin',
- 'Move',
- 'MoveQuiet',
- 'Mulberry',
- 'N',
- 'NE',
- 'NNE',
- 'NNW',
- 'NW',
- 'NavajoWhite',
- 'Navy',
- 'NavyBlue',
- 'NoAlign',
- 'NoCrop',
- 'NoFill',
- 'NoSide',
- 'OldLace',
- 'Olive',
- 'OliveDrab',
- 'OliveGreen',
- 'Orange',
- 'OrangeRed',
- 'Orchid',
- 'Ox',
- 'Oy',
- 'PC',
- 'PaleGoldenrod',
- 'PaleGreen',
- 'PaleTurquoise',
- 'PaleVioletRed',
- 'PapayaWhip',
- 'Peach',
- 'PeachPuff',
- 'Periwinkle',
- 'Peru',
- 'PineGreen',
- 'Pink',
- 'Plum',
- 'PowderBlue',
- 'ProcessBlue',
- 'Purple',
- 'RK2',
- 'RK3',
- 'RK3BS',
- 'RK4',
- 'RK5',
- 'RK5DP',
- 'RK5F',
- 'RawSienna',
- 'Red',
- 'RedOrange',
- 'RedViolet',
- 'Rhodamine',
- 'RightJustified',
- 'RightSide',
- 'RosyBrown',
- 'RoyalBlue',
- 'RoyalPurple',
- 'RubineRed',
- 'S',
- 'SE',
- 'SSE',
- 'SSW',
- 'SW',
- 'SaddleBrown',
- 'Salmon',
- 'SandyBrown',
- 'SeaGreen',
- 'Seashell',
- 'Sepia',
- 'Sienna',
- 'Silver',
- 'SimpleHead',
- 'SkyBlue',
- 'SlateBlue',
- 'SlateGray',
- 'Snow',
- 'SpringGreen',
- 'SteelBlue',
- 'Suppress',
- 'SuppressQuiet',
- 'Tan',
- 'TeXHead',
- 'Teal',
- 'TealBlue',
- 'Thistle',
- 'Ticksize',
- 'Tomato',
- 'Turquoise',
- 'UnFill',
- 'VERSION',
- 'Value',
- 'Vertical',
- 'Violet',
- 'VioletRed',
- 'W',
- 'WNW',
- 'WSW',
- 'Wheat',
- 'White',
- 'WhiteSmoke',
- 'WildStrawberry',
- 'XYAlign',
- 'YAlign',
- 'Yellow',
- 'YellowGreen',
- 'YellowOrange',
- 'addpenarc',
- 'addpenline',
- 'align',
- 'allowstepping',
- 'angularsystem',
- 'animationdelay',
- 'appendsuffix',
- 'arcarrowangle',
- 'arcarrowfactor',
- 'arrow2sizelimit',
- 'arrowangle',
- 'arrowbarb',
- 'arrowdir',
- 'arrowfactor',
- 'arrowhookfactor',
- 'arrowlength',
- 'arrowsizelimit',
- 'arrowtexfactor',
- 'authorpen',
- 'axis',
- 'axiscoverage',
- 'axislabelfactor',
- 'background',
- 'backgroundcolor',
- 'backgroundpen',
- 'barfactor',
- 'barmarksizefactor',
- 'basealign',
- 'baselinetemplate',
- 'beveljoin',
- 'bigvertexpen',
- 'bigvertexsize',
- 'black',
- 'blue',
- 'bm',
- 'bottom',
- 'bp',
- 'brown',
- 'bullet',
- 'byfoci',
- 'byvertices',
- 'camerafactor',
- 'chartreuse',
- 'circlemarkradiusfactor',
- 'circlenodesnumberfactor',
- 'circleprecision',
- 'circlescale',
- 'cm',
- 'codefile',
- 'codepen',
- 'codeskip',
- 'colorPen',
- 'coloredNodes',
- 'coloredSegments',
- 'conditionlength',
- 'conicnodesfactor',
- 'count',
- 'cputimeformat',
- 'crossmarksizefactor',
- 'currentcoordsys',
- 'currentlight',
- 'currentpatterns',
- 'currentpen',
- 'currentpicture',
- 'currentposition',
- 'currentprojection',
- 'curvilinearsystem',
- 'cuttings',
- 'cyan',
- 'darkblue',
- 'darkbrown',
- 'darkcyan',
- 'darkgray',
- 'darkgreen',
- 'darkgrey',
- 'darkmagenta',
- 'darkolive',
- 'darkred',
- 'dashdotted',
- 'dashed',
- 'datepen',
- 'dateskip',
- 'debuggerlines',
- 'debugging',
- 'deepblue',
- 'deepcyan',
- 'deepgray',
- 'deepgreen',
- 'deepgrey',
- 'deepmagenta',
- 'deepred',
- 'default',
- 'defaultControl',
- 'defaultS',
- 'defaultbackpen',
- 'defaultcoordsys',
- 'defaultfilename',
- 'defaultformat',
- 'defaultmassformat',
- 'defaultpen',
- 'diagnostics',
- 'differentlengths',
- 'dot',
- 'dotfactor',
- 'dotframe',
- 'dotted',
- 'doublelinepen',
- 'doublelinespacing',
- 'down',
- 'duplicateFuzz',
- 'ellipsenodesnumberfactor',
- 'eps',
- 'epsgeo',
- 'epsilon',
- 'evenodd',
- 'extendcap',
- 'fermionpen',
- 'figureborder',
- 'figuremattpen',
- 'firstnode',
- 'firststep',
- 'foregroundcolor',
- 'fuchsia',
- 'fuzz',
- 'gapfactor',
- 'ghostpen',
- 'gluonamplitude',
- 'gluonpen',
- 'gluonratio',
- 'gray',
- 'green',
- 'grey',
- 'hatchepsilon',
- 'havepagenumber',
- 'heavyblue',
- 'heavycyan',
- 'heavygray',
- 'heavygreen',
- 'heavygrey',
- 'heavymagenta',
- 'heavyred',
- 'hline',
- 'hwratio',
- 'hyperbolanodesnumberfactor',
- 'identity4',
- 'ignore',
- 'inXasyMode',
- 'inch',
- 'inches',
- 'includegraphicscommand',
- 'inf',
- 'infinity',
- 'institutionpen',
- 'intMax',
- 'intMin',
- 'invert',
- 'invisible',
- 'itempen',
- 'itemskip',
- 'itemstep',
- 'labelmargin',
- 'landscape',
- 'lastnode',
- 'left',
- 'legendhskip',
- 'legendlinelength',
- 'legendmargin',
- 'legendmarkersize',
- 'legendmaxrelativewidth',
- 'legendvskip',
- 'lightblue',
- 'lightcyan',
- 'lightgray',
- 'lightgreen',
- 'lightgrey',
- 'lightmagenta',
- 'lightolive',
- 'lightred',
- 'lightyellow',
- 'linemargin',
- 'lm_infmsg',
- 'lm_shortmsg',
- 'longdashdotted',
- 'longdashed',
- 'magenta',
- 'magneticPoints',
- 'magneticRadius',
- 'mantissaBits',
- 'markangleradius',
- 'markangleradiusfactor',
- 'markanglespace',
- 'markanglespacefactor',
- 'mediumblue',
- 'mediumcyan',
- 'mediumgray',
- 'mediumgreen',
- 'mediumgrey',
- 'mediummagenta',
- 'mediumred',
- 'mediumyellow',
- 'middle',
- 'minDistDefault',
- 'minblockheight',
- 'minblockwidth',
- 'mincirclediameter',
- 'minipagemargin',
- 'minipagewidth',
- 'minvertexangle',
- 'miterjoin',
- 'mm',
- 'momarrowfactor',
- 'momarrowlength',
- 'momarrowmargin',
- 'momarrowoffset',
- 'momarrowpen',
- 'monoPen',
- 'morepoints',
- 'nCircle',
- 'newbulletcolor',
- 'ngraph',
- 'nil',
- 'nmesh',
- 'nobasealign',
- 'nodeMarginDefault',
- 'nodesystem',
- 'nomarker',
- 'nopoint',
- 'noprimary',
- 'nullpath',
- 'nullpen',
- 'numarray',
- 'ocgindex',
- 'oldbulletcolor',
- 'olive',
- 'orange',
- 'origin',
- 'overpaint',
- 'page',
- 'pageheight',
- 'pagemargin',
- 'pagenumberalign',
- 'pagenumberpen',
- 'pagenumberposition',
- 'pagewidth',
- 'paleblue',
- 'palecyan',
- 'palegray',
- 'palegreen',
- 'palegrey',
- 'palemagenta',
- 'palered',
- 'paleyellow',
- 'parabolanodesnumberfactor',
- 'perpfactor',
- 'phi',
- 'photonamplitude',
- 'photonpen',
- 'photonratio',
- 'pi',
- 'pink',
- 'plain',
- 'plus',
- 'preamblenodes',
- 'pt',
- 'purple',
- 'r3',
- 'r4a',
- 'r4b',
- 'randMax',
- 'realDigits',
- 'realEpsilon',
- 'realMax',
- 'realMin',
- 'red',
- 'relativesystem',
- 'reverse',
- 'right',
- 'roundcap',
- 'roundjoin',
- 'royalblue',
- 'salmon',
- 'saveFunctions',
- 'scalarpen',
- 'sequencereal',
- 'settings',
- 'shipped',
- 'signedtrailingzero',
- 'solid',
- 'springgreen',
- 'sqrtEpsilon',
- 'squarecap',
- 'squarepen',
- 'startposition',
- 'stdin',
- 'stdout',
- 'stepfactor',
- 'stepfraction',
- 'steppagenumberpen',
- 'stepping',
- 'stickframe',
- 'stickmarksizefactor',
- 'stickmarkspacefactor',
- 'textpen',
- 'ticksize',
- 'tildeframe',
- 'tildemarksizefactor',
- 'tinv',
- 'titlealign',
- 'titlepagepen',
- 'titlepageposition',
- 'titlepen',
- 'titleskip',
- 'top',
- 'trailingzero',
- 'treeLevelStep',
- 'treeMinNodeWidth',
- 'treeNodeStep',
- 'trembleAngle',
- 'trembleFrequency',
- 'trembleRandom',
- 'tremblingMode',
- 'undefined',
- 'unitcircle',
- 'unitsquare',
- 'up',
- 'urlpen',
- 'urlskip',
- 'version',
- 'vertexpen',
- 'vertexsize',
- 'viewportmargin',
- 'viewportsize',
- 'vline',
- 'white',
- 'wye',
- 'xformStack',
- 'yellow',
- 'ylabelwidth',
- 'zerotickfuzz',
- 'zerowinding'
-))
diff --git a/pygments/lexers/_cl_builtins.py b/pygments/lexers/_cl_builtins.py
deleted file mode 100644
index d0306fab..00000000
--- a/pygments/lexers/_cl_builtins.py
+++ /dev/null
@@ -1,232 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._cl_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- ANSI Common Lisp builtins.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-BUILTIN_FUNCTIONS = set(( # 638 functions
- '<', '<=', '=', '>', '>=', '-', '/', '/=', '*', '+', '1-', '1+',
- 'abort', 'abs', 'acons', 'acos', 'acosh', 'add-method', 'adjoin',
- 'adjustable-array-p', 'adjust-array', 'allocate-instance',
- 'alpha-char-p', 'alphanumericp', 'append', 'apply', 'apropos',
- 'apropos-list', 'aref', 'arithmetic-error-operands',
- 'arithmetic-error-operation', 'array-dimension', 'array-dimensions',
- 'array-displacement', 'array-element-type', 'array-has-fill-pointer-p',
- 'array-in-bounds-p', 'arrayp', 'array-rank', 'array-row-major-index',
- 'array-total-size', 'ash', 'asin', 'asinh', 'assoc', 'assoc-if',
- 'assoc-if-not', 'atan', 'atanh', 'atom', 'bit', 'bit-and', 'bit-andc1',
- 'bit-andc2', 'bit-eqv', 'bit-ior', 'bit-nand', 'bit-nor', 'bit-not',
- 'bit-orc1', 'bit-orc2', 'bit-vector-p', 'bit-xor', 'boole',
- 'both-case-p', 'boundp', 'break', 'broadcast-stream-streams',
- 'butlast', 'byte', 'byte-position', 'byte-size', 'caaaar', 'caaadr',
- 'caaar', 'caadar', 'caaddr', 'caadr', 'caar', 'cadaar', 'cadadr',
- 'cadar', 'caddar', 'cadddr', 'caddr', 'cadr', 'call-next-method', 'car',
- 'cdaaar', 'cdaadr', 'cdaar', 'cdadar', 'cdaddr', 'cdadr', 'cdar',
- 'cddaar', 'cddadr', 'cddar', 'cdddar', 'cddddr', 'cdddr', 'cddr', 'cdr',
- 'ceiling', 'cell-error-name', 'cerror', 'change-class', 'char', 'char<',
- 'char<=', 'char=', 'char>', 'char>=', 'char/=', 'character',
- 'characterp', 'char-code', 'char-downcase', 'char-equal',
- 'char-greaterp', 'char-int', 'char-lessp', 'char-name',
- 'char-not-equal', 'char-not-greaterp', 'char-not-lessp', 'char-upcase',
- 'cis', 'class-name', 'class-of', 'clear-input', 'clear-output',
- 'close', 'clrhash', 'code-char', 'coerce', 'compile',
- 'compiled-function-p', 'compile-file', 'compile-file-pathname',
- 'compiler-macro-function', 'complement', 'complex', 'complexp',
- 'compute-applicable-methods', 'compute-restarts', 'concatenate',
- 'concatenated-stream-streams', 'conjugate', 'cons', 'consp',
- 'constantly', 'constantp', 'continue', 'copy-alist', 'copy-list',
- 'copy-pprint-dispatch', 'copy-readtable', 'copy-seq', 'copy-structure',
- 'copy-symbol', 'copy-tree', 'cos', 'cosh', 'count', 'count-if',
- 'count-if-not', 'decode-float', 'decode-universal-time', 'delete',
- 'delete-duplicates', 'delete-file', 'delete-if', 'delete-if-not',
- 'delete-package', 'denominator', 'deposit-field', 'describe',
- 'describe-object', 'digit-char', 'digit-char-p', 'directory',
- 'directory-namestring', 'disassemble', 'documentation', 'dpb',
- 'dribble', 'echo-stream-input-stream', 'echo-stream-output-stream',
- 'ed', 'eighth', 'elt', 'encode-universal-time', 'endp',
- 'enough-namestring', 'ensure-directories-exist',
- 'ensure-generic-function', 'eq', 'eql', 'equal', 'equalp', 'error',
- 'eval', 'evenp', 'every', 'exp', 'export', 'expt', 'fboundp',
- 'fceiling', 'fdefinition', 'ffloor', 'fifth', 'file-author',
- 'file-error-pathname', 'file-length', 'file-namestring',
- 'file-position', 'file-string-length', 'file-write-date',
- 'fill', 'fill-pointer', 'find', 'find-all-symbols', 'find-class',
- 'find-if', 'find-if-not', 'find-method', 'find-package', 'find-restart',
- 'find-symbol', 'finish-output', 'first', 'float', 'float-digits',
- 'floatp', 'float-precision', 'float-radix', 'float-sign', 'floor',
- 'fmakunbound', 'force-output', 'format', 'fourth', 'fresh-line',
- 'fround', 'ftruncate', 'funcall', 'function-keywords',
- 'function-lambda-expression', 'functionp', 'gcd', 'gensym', 'gentemp',
- 'get', 'get-decoded-time', 'get-dispatch-macro-character', 'getf',
- 'gethash', 'get-internal-real-time', 'get-internal-run-time',
- 'get-macro-character', 'get-output-stream-string', 'get-properties',
- 'get-setf-expansion', 'get-universal-time', 'graphic-char-p',
- 'hash-table-count', 'hash-table-p', 'hash-table-rehash-size',
- 'hash-table-rehash-threshold', 'hash-table-size', 'hash-table-test',
- 'host-namestring', 'identity', 'imagpart', 'import',
- 'initialize-instance', 'input-stream-p', 'inspect',
- 'integer-decode-float', 'integer-length', 'integerp',
- 'interactive-stream-p', 'intern', 'intersection',
- 'invalid-method-error', 'invoke-debugger', 'invoke-restart',
- 'invoke-restart-interactively', 'isqrt', 'keywordp', 'last', 'lcm',
- 'ldb', 'ldb-test', 'ldiff', 'length', 'lisp-implementation-type',
- 'lisp-implementation-version', 'list', 'list*', 'list-all-packages',
- 'listen', 'list-length', 'listp', 'load',
- 'load-logical-pathname-translations', 'log', 'logand', 'logandc1',
- 'logandc2', 'logbitp', 'logcount', 'logeqv', 'logical-pathname',
- 'logical-pathname-translations', 'logior', 'lognand', 'lognor',
- 'lognot', 'logorc1', 'logorc2', 'logtest', 'logxor', 'long-site-name',
- 'lower-case-p', 'machine-instance', 'machine-type', 'machine-version',
- 'macroexpand', 'macroexpand-1', 'macro-function', 'make-array',
- 'make-broadcast-stream', 'make-concatenated-stream', 'make-condition',
- 'make-dispatch-macro-character', 'make-echo-stream', 'make-hash-table',
- 'make-instance', 'make-instances-obsolete', 'make-list',
- 'make-load-form', 'make-load-form-saving-slots', 'make-package',
- 'make-pathname', 'make-random-state', 'make-sequence', 'make-string',
- 'make-string-input-stream', 'make-string-output-stream', 'make-symbol',
- 'make-synonym-stream', 'make-two-way-stream', 'makunbound', 'map',
- 'mapc', 'mapcan', 'mapcar', 'mapcon', 'maphash', 'map-into', 'mapl',
- 'maplist', 'mask-field', 'max', 'member', 'member-if', 'member-if-not',
- 'merge', 'merge-pathnames', 'method-combination-error',
- 'method-qualifiers', 'min', 'minusp', 'mismatch', 'mod',
- 'muffle-warning', 'name-char', 'namestring', 'nbutlast', 'nconc',
- 'next-method-p', 'nintersection', 'ninth', 'no-applicable-method',
- 'no-next-method', 'not', 'notany', 'notevery', 'nreconc', 'nreverse',
- 'nset-difference', 'nset-exclusive-or', 'nstring-capitalize',
- 'nstring-downcase', 'nstring-upcase', 'nsublis', 'nsubst', 'nsubst-if',
- 'nsubst-if-not', 'nsubstitute', 'nsubstitute-if', 'nsubstitute-if-not',
- 'nth', 'nthcdr', 'null', 'numberp', 'numerator', 'nunion', 'oddp',
- 'open', 'open-stream-p', 'output-stream-p', 'package-error-package',
- 'package-name', 'package-nicknames', 'packagep',
- 'package-shadowing-symbols', 'package-used-by-list', 'package-use-list',
- 'pairlis', 'parse-integer', 'parse-namestring', 'pathname',
- 'pathname-device', 'pathname-directory', 'pathname-host',
- 'pathname-match-p', 'pathname-name', 'pathnamep', 'pathname-type',
- 'pathname-version', 'peek-char', 'phase', 'plusp', 'position',
- 'position-if', 'position-if-not', 'pprint', 'pprint-dispatch',
- 'pprint-fill', 'pprint-indent', 'pprint-linear', 'pprint-newline',
- 'pprint-tab', 'pprint-tabular', 'prin1', 'prin1-to-string', 'princ',
- 'princ-to-string', 'print', 'print-object', 'probe-file', 'proclaim',
- 'provide', 'random', 'random-state-p', 'rassoc', 'rassoc-if',
- 'rassoc-if-not', 'rational', 'rationalize', 'rationalp', 'read',
- 'read-byte', 'read-char', 'read-char-no-hang', 'read-delimited-list',
- 'read-from-string', 'read-line', 'read-preserving-whitespace',
- 'read-sequence', 'readtable-case', 'readtablep', 'realp', 'realpart',
- 'reduce', 'reinitialize-instance', 'rem', 'remhash', 'remove',
- 'remove-duplicates', 'remove-if', 'remove-if-not', 'remove-method',
- 'remprop', 'rename-file', 'rename-package', 'replace', 'require',
- 'rest', 'restart-name', 'revappend', 'reverse', 'room', 'round',
- 'row-major-aref', 'rplaca', 'rplacd', 'sbit', 'scale-float', 'schar',
- 'search', 'second', 'set', 'set-difference',
- 'set-dispatch-macro-character', 'set-exclusive-or',
- 'set-macro-character', 'set-pprint-dispatch', 'set-syntax-from-char',
- 'seventh', 'shadow', 'shadowing-import', 'shared-initialize',
- 'short-site-name', 'signal', 'signum', 'simple-bit-vector-p',
- 'simple-condition-format-arguments', 'simple-condition-format-control',
- 'simple-string-p', 'simple-vector-p', 'sin', 'sinh', 'sixth', 'sleep',
- 'slot-boundp', 'slot-exists-p', 'slot-makunbound', 'slot-missing',
- 'slot-unbound', 'slot-value', 'software-type', 'software-version',
- 'some', 'sort', 'special-operator-p', 'sqrt', 'stable-sort',
- 'standard-char-p', 'store-value', 'stream-element-type',
- 'stream-error-stream', 'stream-external-format', 'streamp', 'string',
- 'string<', 'string<=', 'string=', 'string>', 'string>=', 'string/=',
- 'string-capitalize', 'string-downcase', 'string-equal',
- 'string-greaterp', 'string-left-trim', 'string-lessp',
- 'string-not-equal', 'string-not-greaterp', 'string-not-lessp',
- 'stringp', 'string-right-trim', 'string-trim', 'string-upcase',
- 'sublis', 'subseq', 'subsetp', 'subst', 'subst-if', 'subst-if-not',
- 'substitute', 'substitute-if', 'substitute-if-not', 'subtypep','svref',
- 'sxhash', 'symbol-function', 'symbol-name', 'symbolp', 'symbol-package',
- 'symbol-plist', 'symbol-value', 'synonym-stream-symbol', 'syntax:',
- 'tailp', 'tan', 'tanh', 'tenth', 'terpri', 'third',
- 'translate-logical-pathname', 'translate-pathname', 'tree-equal',
- 'truename', 'truncate', 'two-way-stream-input-stream',
- 'two-way-stream-output-stream', 'type-error-datum',
- 'type-error-expected-type', 'type-of', 'typep', 'unbound-slot-instance',
- 'unexport', 'unintern', 'union', 'unread-char', 'unuse-package',
- 'update-instance-for-different-class',
- 'update-instance-for-redefined-class', 'upgraded-array-element-type',
- 'upgraded-complex-part-type', 'upper-case-p', 'use-package',
- 'user-homedir-pathname', 'use-value', 'values', 'values-list', 'vector',
- 'vectorp', 'vector-pop', 'vector-push', 'vector-push-extend', 'warn',
- 'wild-pathname-p', 'write', 'write-byte', 'write-char', 'write-line',
- 'write-sequence', 'write-string', 'write-to-string', 'yes-or-no-p',
- 'y-or-n-p', 'zerop',
-))
-
-SPECIAL_FORMS = set((
- 'block', 'catch', 'declare', 'eval-when', 'flet', 'function', 'go', 'if',
- 'labels', 'lambda', 'let', 'let*', 'load-time-value', 'locally', 'macrolet',
- 'multiple-value-call', 'multiple-value-prog1', 'progn', 'progv', 'quote',
- 'return-from', 'setq', 'symbol-macrolet', 'tagbody', 'the', 'throw',
- 'unwind-protect',
-))
-
-MACROS = set((
- 'and', 'assert', 'call-method', 'case', 'ccase', 'check-type', 'cond',
- 'ctypecase', 'decf', 'declaim', 'defclass', 'defconstant', 'defgeneric',
- 'define-compiler-macro', 'define-condition', 'define-method-combination',
- 'define-modify-macro', 'define-setf-expander', 'define-symbol-macro',
- 'defmacro', 'defmethod', 'defpackage', 'defparameter', 'defsetf',
- 'defstruct', 'deftype', 'defun', 'defvar', 'destructuring-bind', 'do',
- 'do*', 'do-all-symbols', 'do-external-symbols', 'dolist', 'do-symbols',
- 'dotimes', 'ecase', 'etypecase', 'formatter', 'handler-bind',
- 'handler-case', 'ignore-errors', 'incf', 'in-package', 'lambda', 'loop',
- 'loop-finish', 'make-method', 'multiple-value-bind', 'multiple-value-list',
- 'multiple-value-setq', 'nth-value', 'or', 'pop',
- 'pprint-exit-if-list-exhausted', 'pprint-logical-block', 'pprint-pop',
- 'print-unreadable-object', 'prog', 'prog*', 'prog1', 'prog2', 'psetf',
- 'psetq', 'push', 'pushnew', 'remf', 'restart-bind', 'restart-case',
- 'return', 'rotatef', 'setf', 'shiftf', 'step', 'time', 'trace', 'typecase',
- 'unless', 'untrace', 'when', 'with-accessors', 'with-compilation-unit',
- 'with-condition-restarts', 'with-hash-table-iterator',
- 'with-input-from-string', 'with-open-file', 'with-open-stream',
- 'with-output-to-string', 'with-package-iterator', 'with-simple-restart',
- 'with-slots', 'with-standard-io-syntax',
-))
-
-LAMBDA_LIST_KEYWORDS = set((
- '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional',
- '&rest', '&whole',
-))
-
-DECLARATIONS = set((
- 'dynamic-extent', 'ignore', 'optimize', 'ftype', 'inline', 'special',
- 'ignorable', 'notinline', 'type',
-))
-
-BUILTIN_TYPES = set((
- 'atom', 'boolean', 'base-char', 'base-string', 'bignum', 'bit',
- 'compiled-function', 'extended-char', 'fixnum', 'keyword', 'nil',
- 'signed-byte', 'short-float', 'single-float', 'double-float', 'long-float',
- 'simple-array', 'simple-base-string', 'simple-bit-vector', 'simple-string',
- 'simple-vector', 'standard-char', 'unsigned-byte',
-
- # Condition Types
- 'arithmetic-error', 'cell-error', 'condition', 'control-error',
- 'division-by-zero', 'end-of-file', 'error', 'file-error',
- 'floating-point-inexact', 'floating-point-overflow',
- 'floating-point-underflow', 'floating-point-invalid-operation',
- 'parse-error', 'package-error', 'print-not-readable', 'program-error',
- 'reader-error', 'serious-condition', 'simple-condition', 'simple-error',
- 'simple-type-error', 'simple-warning', 'stream-error', 'storage-condition',
- 'style-warning', 'type-error', 'unbound-variable', 'unbound-slot',
- 'undefined-function', 'warning',
-))
-
-BUILTIN_CLASSES = set((
- 'array', 'broadcast-stream', 'bit-vector', 'built-in-class', 'character',
- 'class', 'complex', 'concatenated-stream', 'cons', 'echo-stream',
- 'file-stream', 'float', 'function', 'generic-function', 'hash-table',
- 'integer', 'list', 'logical-pathname', 'method-combination', 'method',
- 'null', 'number', 'package', 'pathname', 'ratio', 'rational', 'readtable',
- 'real', 'random-state', 'restart', 'sequence', 'standard-class',
- 'standard-generic-function', 'standard-method', 'standard-object',
- 'string-stream', 'stream', 'string', 'structure-class', 'structure-object',
- 'symbol', 'synonym-stream', 't', 'two-way-stream', 'vector',
-))
diff --git a/pygments/lexers/_cocoa_builtins.py b/pygments/lexers/_cocoa_builtins.py
deleted file mode 100644
index f7c55c61..00000000
--- a/pygments/lexers/_cocoa_builtins.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._cocoa_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This file defines a set of types used across Cocoa frameworks from Apple.
- There is a list of @interfaces, @protocols and some other (structs, unions)
-
- File may be also used as standalone generator for aboves.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-COCOA_INTERFACES = set(['UITableViewCell', 'HKCorrelationQuery', 'NSURLSessionDataTask', 'PHFetchOptions', 'NSLinguisticTagger', 'NSStream', 'AVAudioUnitDelay', 'GCMotion', 'SKPhysicsWorld', 'NSString', 'CMAttitude', 'AVAudioEnvironmentDistanceAttenuationParameters', 'HKStatisticsCollection', 'SCNPlane', 'CBPeer', 'JSContext', 'SCNTransaction', 'SCNTorus', 'AVAudioUnitEffect', 'UICollectionReusableView', 'MTLSamplerDescriptor', 'AVAssetReaderSampleReferenceOutput', 'AVMutableCompositionTrack', 'GKLeaderboard', 'NSFetchedResultsController', 'SKRange', 'MKTileOverlayRenderer', 'MIDINetworkSession', 'UIVisualEffectView', 'CIWarpKernel', 'PKObject', 'MKRoute', 'MPVolumeView', 'UIPrintInfo', 'SCNText', 'ADClient', 'PKPayment', 'AVMutableAudioMix', 'GLKEffectPropertyLight', 'WKScriptMessage', 'AVMIDIPlayer', 'PHCollectionListChangeRequest', 'UICollectionViewLayout', 'NSMutableCharacterSet', 'SKPaymentTransaction', 'NEOnDemandRuleConnect', 'NSShadow', 'SCNView', 'NSURLSessionConfiguration', 'MTLVertexAttributeDescriptor', 'CBCharacteristic', 'HKQuantityType', 'CKLocationSortDescriptor', 'NEVPNIKEv2SecurityAssociationParameters', 'CMStepCounter', 'NSNetService', 'AVAssetWriterInputMetadataAdaptor', 'UICollectionView', 'UIViewPrintFormatter', 'SCNLevelOfDetail', 'CAShapeLayer', 'MCPeerID', 'MPRatingCommand', 'WKNavigation', 'NSDictionary', 'NSFileVersion', 'CMGyroData', 'AVAudioUnitDistortion', 'CKFetchRecordsOperation', 'SKPhysicsJointSpring', 'SCNHitTestResult', 'AVAudioTime', 'CIFilter', 'UIView', 'SCNConstraint', 'CAPropertyAnimation', 'MKMapItem', 'MPRemoteCommandCenter', 'PKPaymentSummaryItem', 'UICollectionViewFlowLayoutInvalidationContext', 'UIInputViewController', 'PKPass', 'SCNPhysicsBehavior', 'MTLRenderPassColorAttachmentDescriptor', 'MKPolygonRenderer', 'CKNotification', 'JSValue', 'PHCollectionList', 'CLGeocoder', 'NSByteCountFormatter', 'AVCaptureScreenInput', 'MPFeedbackCommand', 'CAAnimation', 'MKOverlayPathView', 'UIActionSheet', 'UIMotionEffectGroup', 'NSLengthFormatter', 'UIBarItem', 'SKProduct', 'AVAssetExportSession', 'NSKeyedUnarchiver', 'NSMutableSet', 'SCNPyramid', 'PHAssetCollection', 'MKMapView', 'HMHomeManager', 'CATransition', 'MTLCompileOptions', 'UIVibrancyEffect', 'CLCircularRegion', 'MKTileOverlay', 'SCNShape', 'ACAccountCredential', 'SKPhysicsJointLimit', 'MKMapSnapshotter', 'AVMediaSelectionGroup', 'NSIndexSet', 'CBPeripheralManager', 'CKRecordZone', 'AVAudioRecorder', 'NSURL', 'CBCentral', 'NSNumber', 'AVAudioOutputNode', 'MTLVertexAttributeDescriptorArray', 'MKETAResponse', 'SKTransition', 'SSReadingList', 'HKSourceQuery', 'UITableViewRowAction', 'UITableView', 'SCNParticlePropertyController', 'AVCaptureStillImageOutput', 'GCController', 'AVAudioPlayerNode', 'AVAudioSessionPortDescription', 'NSHTTPURLResponse', 'NEOnDemandRuleEvaluateConnection', 'SKEffectNode', 'HKQuantity', 'GCControllerElement', 'AVPlayerItemAccessLogEvent', 'SCNBox', 'NSExtensionContext', 'MKOverlayRenderer', 'SCNPhysicsVehicle', 'NSDecimalNumber', 'EKReminder', 'MKPolylineView', 'CKQuery', 'AVAudioMixerNode', 'GKAchievementDescription', 'EKParticipant', 'NSBlockOperation', 'UIActivityItemProvider', 'CLLocation', 'NSBatchUpdateRequest', 'PHContentEditingOutput', 'PHObjectChangeDetails', 'HKWorkoutType', 'MPMoviePlayerController', 'AVAudioFormat', 'HMTrigger', 'MTLRenderPassDepthAttachmentDescriptor', 'SCNRenderer', 'GKScore', 'UISplitViewController', 'HKSource', 'NSURLConnection', 'ABUnknownPersonViewController', 'SCNTechnique', 'UIMenuController', 'NSEvent', 'SKTextureAtlas', 'NSKeyedArchiver', 'GKLeaderboardSet', 'NSSimpleCString', 'AVAudioPCMBuffer', 'CBATTRequest', 'GKMatchRequest', 'AVMetadataObject', 'SKProductsRequest', 'UIAlertView', 'NSIncrementalStore', 'MFMailComposeViewController', 'SCNFloor', 'NSSortDescriptor', 'CKFetchNotificationChangesOperation', 'MPMovieAccessLog', 'NSManagedObjectContext', 'AVAudioUnitGenerator', 'WKBackForwardList', 'SKMutableTexture', 'AVCaptureAudioDataOutput', 'ACAccount', 'AVMetadataItem', 'MPRatingCommandEvent', 'AVCaptureDeviceInputSource', 'CLLocationManager', 'MPRemoteCommand', 'AVCaptureSession', 'UIStepper', 'UIRefreshControl', 'NEEvaluateConnectionRule', 'CKModifyRecordsOperation', 'UICollectionViewTransitionLayout', 'CBCentralManager', 'NSPurgeableData', 'PKShippingMethod', 'SLComposeViewController', 'NSHashTable', 'MKUserTrackingBarButtonItem', 'UILexiconEntry', 'CMMotionActivity', 'SKAction', 'SKShader', 'AVPlayerItemOutput', 'MTLRenderPassAttachmentDescriptor', 'UIDocumentInteractionController', 'UIDynamicItemBehavior', 'NSMutableDictionary', 'UILabel', 'AVCaptureInputPort', 'NSExpression', 'CAInterAppAudioTransportView', 'SKMutablePayment', 'UIImage', 'PHCachingImageManager', 'SCNTransformConstraint', 'HKCorrelationType', 'UIColor', 'SCNGeometrySource', 'AVCaptureAutoExposureBracketedStillImageSettings', 'UIPopoverBackgroundView', 'UIToolbar', 'NSNotificationCenter', 'UICollectionViewLayoutAttributes', 'AVAssetReaderOutputMetadataAdaptor', 'NSEntityMigrationPolicy', 'HMUser', 'NSLocale', 'NSURLSession', 'SCNCamera', 'NSTimeZone', 'UIManagedDocument', 'AVMutableVideoCompositionLayerInstruction', 'AVAssetTrackGroup', 'NSInvocationOperation', 'ALAssetRepresentation', 'AVQueuePlayer', 'HMServiceGroup', 'UIPasteboard', 'PHContentEditingInput', 'NSLayoutManager', 'EKCalendarChooser', 'EKObject', 'CATiledLayer', 'GLKReflectionMapEffect', 'NSManagedObjectID', 'NSEnergyFormatter', 'SLRequest', 'HMCharacteristic', 'AVPlayerLayer', 'MTLRenderPassDescriptor', 'SKPayment', 'NSPointerArray', 'AVAudioMix', 'SCNLight', 'MCAdvertiserAssistant', 'MKMapSnapshotOptions', 'HKCategorySample', 'AVAudioEnvironmentReverbParameters', 'SCNMorpher', 'AVTimedMetadataGroup', 'CBMutableCharacteristic', 'NSFetchRequest', 'UIDevice', 'NSManagedObject', 'NKAssetDownload', 'AVOutputSettingsAssistant', 'SKPhysicsJointPin', 'UITabBar', 'UITextInputMode', 'NSFetchRequestExpression', 'HMActionSet', 'CTSubscriber', 'PHAssetChangeRequest', 'NSPersistentStoreRequest', 'UITabBarController', 'HKQuantitySample', 'AVPlayerItem', 'AVSynchronizedLayer', 'MKDirectionsRequest', 'NSMetadataItem', 'UIPresentationController', 'UINavigationItem', 'PHFetchResultChangeDetails', 'PHImageManager', 'AVCaptureManualExposureBracketedStillImageSettings', 'UIStoryboardPopoverSegue', 'SCNLookAtConstraint', 'UIGravityBehavior', 'UIWindow', 'CBMutableDescriptor', 'NEOnDemandRuleDisconnect', 'UIBezierPath', 'UINavigationController', 'ABPeoplePickerNavigationController', 'EKSource', 'AVAssetWriterInput', 'AVPlayerItemTrack', 'GLKEffectPropertyTexture', 'NSHTTPCookie', 'NSURLResponse', 'SKPaymentQueue', 'NSAssertionHandler', 'MKReverseGeocoder', 'GCControllerAxisInput', 'NSArray', 'NSOrthography', 'NSURLSessionUploadTask', 'NSCharacterSet', 'AVMutableVideoCompositionInstruction', 'AVAssetReaderOutput', 'EAGLContext', 'WKFrameInfo', 'CMPedometer', 'MyClass', 'CKModifyBadgeOperation', 'AVCaptureAudioFileOutput', 'SKEmitterNode', 'NSMachPort', 'AVVideoCompositionCoreAnimationTool', 'PHCollection', 'SCNPhysicsWorld', 'NSURLRequest', 'CMAccelerometerData', 'NSNetServiceBrowser', 'CLFloor', 'AVAsynchronousVideoCompositionRequest', 'SCNGeometry', 'SCNIKConstraint', 'CIKernel', 'CAGradientLayer', 'HKCharacteristicType', 'NSFormatter', 'SCNAction', 'CATransaction', 'CBUUID', 'UIStoryboard', 'MPMediaLibrary', 'UITapGestureRecognizer', 'MPMediaItemArtwork', 'NSURLSessionTask', 'AVAudioUnit', 'MCBrowserViewController', 'UIFontDescriptor', 'NSRelationshipDescription', 'HKSample', 'WKWebView', 'NSMutableAttributedString', 'NSPersistentStoreAsynchronousResult', 'MPNowPlayingInfoCenter', 'MKLocalSearch', 'EAAccessory', 'HKCorrelation', 'CATextLayer', 'NSNotificationQueue', 'UINib', 'GLKTextureLoader', 'HKObjectType', 'NSValue', 'NSMutableIndexSet', 'SKPhysicsContact', 'NSProgress', 'AVPlayerViewController', 'CAScrollLayer', 'GKSavedGame', 'NSTextCheckingResult', 'PHObjectPlaceholder', 'SKConstraint', 'EKEventEditViewController', 'NSEntityDescription', 'NSURLCredentialStorage', 'UIApplication', 'SKDownload', 'SCNNode', 'MKLocalSearchRequest', 'SKScene', 'UISearchDisplayController', 'NEOnDemandRule', 'MTLRenderPassStencilAttachmentDescriptor', 'CAReplicatorLayer', 'UIPrintPageRenderer', 'EKCalendarItem', 'NSUUID', 'EAAccessoryManager', 'NEOnDemandRuleIgnore', 'SKRegion', 'AVAssetResourceLoader', 'EAWiFiUnconfiguredAccessoryBrowser', 'NSUserActivity', 'CTCall', 'UIPrinterPickerController', 'CIVector', 'UINavigationBar', 'UIPanGestureRecognizer', 'MPMediaQuery', 'ABNewPersonViewController', 'CKRecordZoneID', 'HKAnchoredObjectQuery', 'CKFetchRecordZonesOperation', 'UIStoryboardSegue', 'ACAccountType', 'GKSession', 'SKVideoNode', 'PHChange', 'SKReceiptRefreshRequest', 'GCExtendedGamepadSnapshot', 'MPSeekCommandEvent', 'GCExtendedGamepad', 'CAValueFunction', 'SCNCylinder', 'NSNotification', 'NSBatchUpdateResult', 'PKPushCredentials', 'SCNPhysicsSliderJoint', 'AVCaptureDeviceFormat', 'AVPlayerItemErrorLog', 'NSMapTable', 'NSSet', 'CMMotionManager', 'GKVoiceChatService', 'UIPageControl', 'UILexicon', 'MTLArrayType', 'AVAudioUnitReverb', 'MKGeodesicPolyline', 'AVMutableComposition', 'NSLayoutConstraint', 'UIPrinter', 'NSOrderedSet', 'CBAttribute', 'PKPushPayload', 'NSIncrementalStoreNode', 'EKEventStore', 'MPRemoteCommandEvent', 'UISlider', 'UIBlurEffect', 'CKAsset', 'AVCaptureInput', 'AVAudioEngine', 'MTLVertexDescriptor', 'SKPhysicsBody', 'NSOperation', 'PKPaymentPass', 'UIImageAsset', 'MKMapCamera', 'SKProductsResponse', 'GLKEffectPropertyMaterial', 'AVCaptureDevice', 'CTCallCenter', 'CABTMIDILocalPeripheralViewController', 'NEVPNManager', 'HKQuery', 'SCNPhysicsContact', 'CBMutableService', 'AVSampleBufferDisplayLayer', 'SCNSceneSource', 'SKLightNode', 'CKDiscoveredUserInfo', 'NSMutableArray', 'MTLDepthStencilDescriptor', 'MTLArgument', 'NSMassFormatter', 'CIRectangleFeature', 'PKPushRegistry', 'NEVPNConnection', 'MCNearbyServiceBrowser', 'NSOperationQueue', 'MKPolylineRenderer', 'HKWorkout', 'NSValueTransformer', 'UICollectionViewFlowLayout', 'MPChangePlaybackRateCommandEvent', 'NSEntityMapping', 'SKTexture', 'NSMergePolicy', 'UITextInputStringTokenizer', 'NSRecursiveLock', 'AVAsset', 'NSUndoManager', 'AVAudioUnitSampler', 'NSItemProvider', 'SKUniform', 'MPMediaPickerController', 'CKOperation', 'MTLRenderPipelineDescriptor', 'EAWiFiUnconfiguredAccessory', 'NSFileCoordinator', 'SKRequest', 'NSFileHandle', 'NSConditionLock', 'UISegmentedControl', 'NSManagedObjectModel', 'UITabBarItem', 'SCNCone', 'MPMediaItem', 'SCNMaterial', 'EKRecurrenceRule', 'UIEvent', 'UITouch', 'UIPrintInteractionController', 'CMDeviceMotion', 'NEVPNProtocol', 'NSCompoundPredicate', 'HKHealthStore', 'MKMultiPoint', 'HKSampleType', 'UIPrintFormatter', 'AVAudioUnitEQFilterParameters', 'SKView', 'NSConstantString', 'UIPopoverController', 'CKDatabase', 'AVMetadataFaceObject', 'UIAccelerometer', 'EKEventViewController', 'CMAltitudeData', 'MTLStencilDescriptor', 'UISwipeGestureRecognizer', 'NSPort', 'MKCircleRenderer', 'AVCompositionTrack', 'NSAsynchronousFetchRequest', 'NSUbiquitousKeyValueStore', 'NSMetadataQueryResultGroup', 'AVAssetResourceLoadingDataRequest', 'UITableViewHeaderFooterView', 'CKNotificationID', 'AVAudioSession', 'HKUnit', 'NSNull', 'NSPersistentStoreResult', 'MKCircleView', 'AVAudioChannelLayout', 'NEVPNProtocolIKEv2', 'WKProcessPool', 'UIAttachmentBehavior', 'CLBeacon', 'NSInputStream', 'NSURLCache', 'GKPlayer', 'NSMappingModel', 'CIQRCodeFeature', 'AVMutableVideoComposition', 'PHFetchResult', 'NSAttributeDescription', 'AVPlayer', 'MKAnnotationView', 'PKPaymentRequest', 'NSTimer', 'CBDescriptor', 'MKOverlayView', 'AVAudioUnitTimePitch', 'NSSaveChangesRequest', 'UIReferenceLibraryViewController', 'SKPhysicsJointFixed', 'UILocalizedIndexedCollation', 'UIInterpolatingMotionEffect', 'UIDocumentPickerViewController', 'AVAssetWriter', 'NSBundle', 'SKStoreProductViewController', 'GLKViewController', 'NSMetadataQueryAttributeValueTuple', 'GKTurnBasedMatch', 'AVAudioFile', 'UIActivity', 'NSPipe', 'MKShape', 'NSMergeConflict', 'CIImage', 'HKObject', 'UIRotationGestureRecognizer', 'AVPlayerItemLegibleOutput', 'AVAssetImageGenerator', 'GCControllerButtonInput', 'CKMarkNotificationsReadOperation', 'CKSubscription', 'MPTimedMetadata', 'NKIssue', 'UIScreenMode', 'HMAccessoryBrowser', 'GKTurnBasedEventHandler', 'UIWebView', 'MKPolyline', 'JSVirtualMachine', 'AVAssetReader', 'NSAttributedString', 'GKMatchmakerViewController', 'NSCountedSet', 'UIButton', 'WKNavigationResponse', 'GKLocalPlayer', 'MPMovieErrorLog', 'AVSpeechUtterance', 'HKStatistics', 'UILocalNotification', 'HKBiologicalSexObject', 'AVURLAsset', 'CBPeripheral', 'NSDateComponentsFormatter', 'SKSpriteNode', 'UIAccessibilityElement', 'AVAssetWriterInputGroup', 'HMZone', 'AVAssetReaderAudioMixOutput', 'NSEnumerator', 'UIDocument', 'MKLocalSearchResponse', 'UISimpleTextPrintFormatter', 'PHPhotoLibrary', 'CBService', 'UIDocumentMenuViewController', 'MCSession', 'QLPreviewController', 'CAMediaTimingFunction', 'UITextPosition', 'ASIdentifierManager', 'AVAssetResourceLoadingRequest', 'SLComposeServiceViewController', 'UIPinchGestureRecognizer', 'PHObject', 'NSExtensionItem', 'HKSampleQuery', 'MTLRenderPipelineColorAttachmentDescriptorArray', 'MKRouteStep', 'SCNCapsule', 'NSMetadataQuery', 'AVAssetResourceLoadingContentInformationRequest', 'UITraitCollection', 'CTCarrier', 'NSFileSecurity', 'UIAcceleration', 'UIMotionEffect', 'MTLRenderPipelineReflection', 'CLHeading', 'CLVisit', 'MKDirectionsResponse', 'HMAccessory', 'MTLStructType', 'UITextView', 'CMMagnetometerData', 'UICollisionBehavior', 'UIProgressView', 'CKServerChangeToken', 'UISearchBar', 'MKPlacemark', 'AVCaptureConnection', 'NSPropertyMapping', 'ALAssetsFilter', 'SK3DNode', 'AVPlayerItemErrorLogEvent', 'NSJSONSerialization', 'AVAssetReaderVideoCompositionOutput', 'ABPersonViewController', 'CIDetector', 'GKTurnBasedMatchmakerViewController', 'MPMediaItemCollection', 'SCNSphere', 'NSCondition', 'NSURLCredential', 'MIDINetworkConnection', 'NSFileProviderExtension', 'NSDecimalNumberHandler', 'NSAtomicStoreCacheNode', 'NSAtomicStore', 'EKAlarm', 'CKNotificationInfo', 'AVAudioUnitEQ', 'UIPercentDrivenInteractiveTransition', 'MKPolygon', 'AVAssetTrackSegment', 'MTLVertexAttribute', 'NSExpressionDescription', 'HKStatisticsCollectionQuery', 'NSURLAuthenticationChallenge', 'NSDirectoryEnumerator', 'MKDistanceFormatter', 'UIAlertAction', 'NSPropertyListSerialization', 'GKPeerPickerController', 'UIUserNotificationSettings', 'UITableViewController', 'GKNotificationBanner', 'MKPointAnnotation', 'MTLRenderPassColorAttachmentDescriptorArray', 'NSCache', 'SKPhysicsJoint', 'NSXMLParser', 'UIViewController', 'PKPaymentToken', 'MFMessageComposeViewController', 'AVAudioInputNode', 'NSDataDetector', 'CABTMIDICentralViewController', 'AVAudioUnitMIDIInstrument', 'AVCaptureVideoPreviewLayer', 'AVAssetWriterInputPassDescription', 'MPChangePlaybackRateCommand', 'NSURLComponents', 'CAMetalLayer', 'UISnapBehavior', 'AVMetadataMachineReadableCodeObject', 'CKDiscoverUserInfosOperation', 'NSTextAttachment', 'NSException', 'UIMenuItem', 'CMMotionActivityManager', 'SCNGeometryElement', 'NCWidgetController', 'CAEmitterLayer', 'MKUserLocation', 'UIImagePickerController', 'CIFeature', 'AVCaptureDeviceInput', 'ALAsset', 'NSURLSessionDownloadTask', 'SCNPhysicsHingeJoint', 'MPMoviePlayerViewController', 'NSMutableOrderedSet', 'SCNMaterialProperty', 'UIFont', 'AVCaptureVideoDataOutput', 'NSCachedURLResponse', 'ALAssetsLibrary', 'NSInvocation', 'UILongPressGestureRecognizer', 'NSTextStorage', 'WKWebViewConfiguration', 'CIFaceFeature', 'MKMapSnapshot', 'GLKEffectPropertyFog', 'AVComposition', 'CKDiscoverAllContactsOperation', 'AVAudioMixInputParameters', 'CAEmitterBehavior', 'PKPassLibrary', 'UIMutableUserNotificationCategory', 'NSLock', 'NEVPNProtocolIPSec', 'ADBannerView', 'UIDocumentPickerExtensionViewController', 'UIActivityIndicatorView', 'AVPlayerMediaSelectionCriteria', 'CALayer', 'UIAccessibilityCustomAction', 'UIBarButtonItem', 'AVAudioSessionRouteDescription', 'CLBeaconRegion', 'HKBloodTypeObject', 'MTLVertexBufferLayoutDescriptorArray', 'CABasicAnimation', 'AVVideoCompositionInstruction', 'AVMutableTimedMetadataGroup', 'EKRecurrenceEnd', 'NSTextContainer', 'TWTweetComposeViewController', 'PKPaymentAuthorizationViewController', 'UIScrollView', 'WKNavigationAction', 'AVPlayerItemMetadataOutput', 'EKRecurrenceDayOfWeek', 'NSNumberFormatter', 'MTLComputePipelineReflection', 'UIScreen', 'CLRegion', 'NSProcessInfo', 'GLKTextureInfo', 'SCNSkinner', 'AVCaptureMetadataOutput', 'SCNAnimationEvent', 'NSTextTab', 'JSManagedValue', 'NSDate', 'UITextChecker', 'WKBackForwardListItem', 'NSData', 'NSParagraphStyle', 'AVMutableMetadataItem', 'EKCalendar', 'HKWorkoutEvent', 'NSMutableURLRequest', 'UIVideoEditorController', 'HMTimerTrigger', 'AVAudioUnitVarispeed', 'UIDynamicAnimator', 'AVCompositionTrackSegment', 'GCGamepadSnapshot', 'MPMediaEntity', 'GLKSkyboxEffect', 'UISwitch', 'EKStructuredLocation', 'UIGestureRecognizer', 'NSProxy', 'GLKBaseEffect', 'UIPushBehavior', 'GKScoreChallenge', 'NSCoder', 'MPMediaPlaylist', 'NSDateComponents', 'WKUserScript', 'EKEvent', 'NSDateFormatter', 'NSAsynchronousFetchResult', 'AVAssetWriterInputPixelBufferAdaptor', 'UIVisualEffect', 'UICollectionViewCell', 'UITextField', 'CLPlacemark', 'MPPlayableContentManager', 'AVCaptureOutput', 'HMCharacteristicWriteAction', 'CKModifySubscriptionsOperation', 'NSPropertyDescription', 'GCGamepad', 'UIMarkupTextPrintFormatter', 'SCNTube', 'NSPersistentStoreCoordinator', 'AVAudioEnvironmentNode', 'GKMatchmaker', 'CIContext', 'NSThread', 'SLComposeSheetConfigurationItem', 'SKPhysicsJointSliding', 'NSPredicate', 'GKVoiceChat', 'SKCropNode', 'AVCaptureAudioPreviewOutput', 'NSStringDrawingContext', 'GKGameCenterViewController', 'UIPrintPaper', 'SCNPhysicsBallSocketJoint', 'UICollectionViewLayoutInvalidationContext', 'GLKEffectPropertyTransform', 'AVAudioIONode', 'UIDatePicker', 'MKDirections', 'ALAssetsGroup', 'CKRecordZoneNotification', 'SCNScene', 'MPMovieAccessLogEvent', 'CKFetchSubscriptionsOperation', 'CAEmitterCell', 'AVAudioUnitTimeEffect', 'HMCharacteristicMetadata', 'MKPinAnnotationView', 'UIPickerView', 'UIImageView', 'UIUserNotificationCategory', 'SCNPhysicsVehicleWheel', 'HKCategoryType', 'MPMediaQuerySection', 'GKFriendRequestComposeViewController', 'NSError', 'MTLRenderPipelineColorAttachmentDescriptor', 'SCNPhysicsShape', 'UISearchController', 'SCNPhysicsBody', 'CTSubscriberInfo', 'AVPlayerItemAccessLog', 'MPMediaPropertyPredicate', 'CMLogItem', 'NSAutoreleasePool', 'NSSocketPort', 'AVAssetReaderTrackOutput', 'SKNode', 'UIMutableUserNotificationAction', 'SCNProgram', 'AVSpeechSynthesisVoice', 'CMAltimeter', 'AVCaptureAudioChannel', 'GKTurnBasedExchangeReply', 'AVVideoCompositionLayerInstruction', 'AVSpeechSynthesizer', 'GKChallengeEventHandler', 'AVCaptureFileOutput', 'UIControl', 'SCNPhysicsField', 'CKReference', 'LAContext', 'CKRecordID', 'ADInterstitialAd', 'AVAudioSessionDataSourceDescription', 'AVAudioBuffer', 'CIColorKernel', 'GCControllerDirectionPad', 'NSFileManager', 'AVMutableAudioMixInputParameters', 'UIScreenEdgePanGestureRecognizer', 'CAKeyframeAnimation', 'CKQueryNotification', 'PHAdjustmentData', 'EASession', 'AVAssetResourceRenewalRequest', 'UIInputView', 'NSFileWrapper', 'UIResponder', 'NSPointerFunctions', 'UIKeyCommand', 'NSHTTPCookieStorage', 'AVMediaSelectionOption', 'NSRunLoop', 'NSFileAccessIntent', 'CAAnimationGroup', 'MKCircle', 'UIAlertController', 'NSMigrationManager', 'NSDateIntervalFormatter', 'UICollectionViewUpdateItem', 'CKDatabaseOperation', 'PHImageRequestOptions', 'SKReachConstraints', 'CKRecord', 'CAInterAppAudioSwitcherView', 'WKWindowFeatures', 'GKInvite', 'NSMutableData', 'PHAssetCollectionChangeRequest', 'NSMutableParagraphStyle', 'UIDynamicBehavior', 'GLKEffectProperty', 'CKFetchRecordChangesOperation', 'SKShapeNode', 'MPMovieErrorLogEvent', 'MKPolygonView', 'MPContentItem', 'HMAction', 'NSScanner', 'GKAchievementChallenge', 'AVAudioPlayer', 'CKContainer', 'AVVideoComposition', 'NKLibrary', 'NSPersistentStore', 'AVCaptureMovieFileOutput', 'HMRoom', 'GKChallenge', 'UITextRange', 'NSURLProtectionSpace', 'ACAccountStore', 'MPSkipIntervalCommand', 'NSComparisonPredicate', 'HMHome', 'PHVideoRequestOptions', 'NSOutputStream', 'MPSkipIntervalCommandEvent', 'PKAddPassesViewController', 'UITextSelectionRect', 'CTTelephonyNetworkInfo', 'AVTextStyleRule', 'NSFetchedPropertyDescription', 'UIPageViewController', 'CATransformLayer', 'UICollectionViewController', 'AVAudioNode', 'MCNearbyServiceAdvertiser', 'NSObject', 'PHAsset', 'GKLeaderboardViewController', 'CKQueryCursor', 'MPMusicPlayerController', 'MKOverlayPathRenderer', 'CMPedometerData', 'HMService', 'SKFieldNode', 'GKAchievement', 'WKUserContentController', 'AVAssetTrack', 'TWRequest', 'SKLabelNode', 'AVCaptureBracketedStillImageSettings', 'MIDINetworkHost', 'MPMediaPredicate', 'AVFrameRateRange', 'MTLTextureDescriptor', 'MTLVertexBufferLayoutDescriptor', 'MPFeedbackCommandEvent', 'UIUserNotificationAction', 'HKStatisticsQuery', 'SCNParticleSystem', 'NSIndexPath', 'AVVideoCompositionRenderContext', 'CADisplayLink', 'HKObserverQuery', 'UIPopoverPresentationController', 'CKQueryOperation', 'CAEAGLLayer', 'NSMutableString', 'NSMessagePort', 'NSURLQueryItem', 'MTLStructMember', 'AVAudioSessionChannelDescription', 'GLKView', 'UIActivityViewController', 'GKAchievementViewController', 'GKTurnBasedParticipant', 'NSURLProtocol', 'NSUserDefaults', 'NSCalendar', 'SKKeyframeSequence', 'AVMetadataItemFilter', 'CKModifyRecordZonesOperation', 'WKPreferences', 'NSMethodSignature', 'NSRegularExpression', 'EAGLSharegroup', 'AVPlayerItemVideoOutput', 'PHContentEditingInputRequestOptions', 'GKMatch', 'CIColor', 'UIDictationPhrase'])
-COCOA_PROTOCOLS = set(['SKStoreProductViewControllerDelegate', 'AVVideoCompositionInstruction', 'AVAudioSessionDelegate', 'GKMatchDelegate', 'NSFileManagerDelegate', 'UILayoutSupport', 'NSCopying', 'UIPrintInteractionControllerDelegate', 'QLPreviewControllerDataSource', 'SKProductsRequestDelegate', 'NSTextStorageDelegate', 'MCBrowserViewControllerDelegate', 'MTLComputeCommandEncoder', 'SCNSceneExportDelegate', 'UISearchResultsUpdating', 'MFMailComposeViewControllerDelegate', 'MTLBlitCommandEncoder', 'NSDecimalNumberBehaviors', 'PHContentEditingController', 'NSMutableCopying', 'UIActionSheetDelegate', 'UIViewControllerTransitioningDelegate', 'UIAlertViewDelegate', 'AVAudioPlayerDelegate', 'MKReverseGeocoderDelegate', 'NSCoding', 'UITextInputTokenizer', 'GKFriendRequestComposeViewControllerDelegate', 'UIActivityItemSource', 'NSCacheDelegate', 'UIAdaptivePresentationControllerDelegate', 'GKAchievementViewControllerDelegate', 'UIViewControllerTransitionCoordinator', 'EKEventEditViewDelegate', 'NSURLConnectionDelegate', 'UITableViewDelegate', 'GKPeerPickerControllerDelegate', 'UIGuidedAccessRestrictionDelegate', 'AVSpeechSynthesizerDelegate', 'AVAudio3DMixing', 'AVPlayerItemLegibleOutputPushDelegate', 'ADInterstitialAdDelegate', 'HMAccessoryBrowserDelegate', 'AVAssetResourceLoaderDelegate', 'UITabBarControllerDelegate', 'CKRecordValue', 'SKPaymentTransactionObserver', 'AVCaptureAudioDataOutputSampleBufferDelegate', 'UIInputViewAudioFeedback', 'GKChallengeListener', 'SKSceneDelegate', 'UIPickerViewDelegate', 'UIWebViewDelegate', 'UIApplicationDelegate', 'GKInviteEventListener', 'MPMediaPlayback', 'MyClassJavaScriptMethods', 'AVAsynchronousKeyValueLoading', 'QLPreviewItem', 'SCNBoundingVolume', 'NSPortDelegate', 'UIContentContainer', 'SCNNodeRendererDelegate', 'SKRequestDelegate', 'SKPhysicsContactDelegate', 'HMAccessoryDelegate', 'UIPageViewControllerDataSource', 'SCNSceneRendererDelegate', 'SCNPhysicsContactDelegate', 'MKMapViewDelegate', 'AVPlayerItemOutputPushDelegate', 'UICollectionViewDelegate', 'UIImagePickerControllerDelegate', 'MTLRenderCommandEncoder', 'PKPaymentAuthorizationViewControllerDelegate', 'UIToolbarDelegate', 'WKUIDelegate', 'SCNActionable', 'NSURLConnectionDataDelegate', 'MKOverlay', 'CBCentralManagerDelegate', 'JSExport', 'NSTextLayoutOrientationProvider', 'UIPickerViewDataSource', 'PKPushRegistryDelegate', 'UIViewControllerTransitionCoordinatorContext', 'NSLayoutManagerDelegate', 'MTLLibrary', 'NSFetchedResultsControllerDelegate', 'ABPeoplePickerNavigationControllerDelegate', 'MTLResource', 'NSDiscardableContent', 'UITextFieldDelegate', 'MTLBuffer', 'MTLSamplerState', 'GKGameCenterControllerDelegate', 'MPMediaPickerControllerDelegate', 'UISplitViewControllerDelegate', 'UIAppearance', 'UIPickerViewAccessibilityDelegate', 'UITraitEnvironment', 'UIScrollViewAccessibilityDelegate', 'ADBannerViewDelegate', 'MPPlayableContentDataSource', 'MTLComputePipelineState', 'NSURLSessionDelegate', 'MTLCommandBuffer', 'NSXMLParserDelegate', 'UIViewControllerRestoration', 'UISearchBarDelegate', 'UIBarPositioning', 'CBPeripheralDelegate', 'UISearchDisplayDelegate', 'CAAction', 'PKAddPassesViewControllerDelegate', 'MCNearbyServiceAdvertiserDelegate', 'MTLDepthStencilState', 'GKTurnBasedMatchmakerViewControllerDelegate', 'MPPlayableContentDelegate', 'AVCaptureVideoDataOutputSampleBufferDelegate', 'UIAppearanceContainer', 'UIStateRestoring', 'UITextDocumentProxy', 'MTLDrawable', 'NSURLSessionTaskDelegate', 'NSFilePresenter', 'AVAudioStereoMixing', 'UIViewControllerContextTransitioning', 'UITextInput', 'CBPeripheralManagerDelegate', 'UITextInputDelegate', 'NSFastEnumeration', 'NSURLAuthenticationChallengeSender', 'SCNProgramDelegate', 'AVVideoCompositing', 'SCNAnimatable', 'NSSecureCoding', 'MCAdvertiserAssistantDelegate', 'GKLocalPlayerListener', 'GLKNamedEffect', 'UIPopoverControllerDelegate', 'AVCaptureMetadataOutputObjectsDelegate', 'NSExtensionRequestHandling', 'UITextSelecting', 'UIPrinterPickerControllerDelegate', 'NCWidgetProviding', 'MTLCommandEncoder', 'NSURLProtocolClient', 'MFMessageComposeViewControllerDelegate', 'UIVideoEditorControllerDelegate', 'WKNavigationDelegate', 'GKSavedGameListener', 'UITableViewDataSource', 'MTLFunction', 'EKCalendarChooserDelegate', 'NSUserActivityDelegate', 'UICollisionBehaviorDelegate', 'NSStreamDelegate', 'MCNearbyServiceBrowserDelegate', 'HMHomeDelegate', 'UINavigationControllerDelegate', 'MCSessionDelegate', 'UIDocumentPickerDelegate', 'UIViewControllerInteractiveTransitioning', 'GKTurnBasedEventListener', 'SCNSceneRenderer', 'MTLTexture', 'GLKViewDelegate', 'EAAccessoryDelegate', 'WKScriptMessageHandler', 'PHPhotoLibraryChangeObserver', 'NSKeyedUnarchiverDelegate', 'AVPlayerItemMetadataOutputPushDelegate', 'NSMachPortDelegate', 'SCNShadable', 'UIPopoverBackgroundViewMethods', 'UIDocumentMenuDelegate', 'UIBarPositioningDelegate', 'ABPersonViewControllerDelegate', 'NSNetServiceBrowserDelegate', 'EKEventViewDelegate', 'UIScrollViewDelegate', 'NSURLConnectionDownloadDelegate', 'UIGestureRecognizerDelegate', 'UINavigationBarDelegate', 'AVAudioMixing', 'NSFetchedResultsSectionInfo', 'UIDocumentInteractionControllerDelegate', 'MTLParallelRenderCommandEncoder', 'QLPreviewControllerDelegate', 'UIAccessibilityReadingContent', 'ABUnknownPersonViewControllerDelegate', 'GLKViewControllerDelegate', 'UICollectionViewDelegateFlowLayout', 'UIPopoverPresentationControllerDelegate', 'UIDynamicAnimatorDelegate', 'NSTextAttachmentContainer', 'MKAnnotation', 'UIAccessibilityIdentification', 'UICoordinateSpace', 'ABNewPersonViewControllerDelegate', 'MTLDevice', 'CAMediaTiming', 'AVCaptureFileOutputRecordingDelegate', 'HMHomeManagerDelegate', 'UITextViewDelegate', 'UITabBarDelegate', 'GKLeaderboardViewControllerDelegate', 'UISearchControllerDelegate', 'EAWiFiUnconfiguredAccessoryBrowserDelegate', 'UITextInputTraits', 'MTLRenderPipelineState', 'GKVoiceChatClient', 'UIKeyInput', 'UICollectionViewDataSource', 'SCNTechniqueSupport', 'NSLocking', 'AVCaptureFileOutputDelegate', 'GKChallengeEventHandlerDelegate', 'UIObjectRestoration', 'CIFilterConstructor', 'AVPlayerItemOutputPullDelegate', 'EAGLDrawable', 'AVVideoCompositionValidationHandling', 'UIViewControllerAnimatedTransitioning', 'NSURLSessionDownloadDelegate', 'UIAccelerometerDelegate', 'UIPageViewControllerDelegate', 'MTLCommandQueue', 'UIDataSourceModelAssociation', 'AVAudioRecorderDelegate', 'GKSessionDelegate', 'NSKeyedArchiverDelegate', 'CAMetalDrawable', 'UIDynamicItem', 'CLLocationManagerDelegate', 'NSMetadataQueryDelegate', 'NSNetServiceDelegate', 'GKMatchmakerViewControllerDelegate', 'NSURLSessionDataDelegate'])
-COCOA_PRIMITIVES = set(['ROTAHeader', '__CFBundle', 'MortSubtable', 'AudioFilePacketTableInfo', 'CGPDFOperatorTable', 'KerxStateEntry', 'ExtendedTempoEvent', 'CTParagraphStyleSetting', 'OpaqueMIDIPort', '_GLKMatrix3', '_GLKMatrix2', '_GLKMatrix4', 'ExtendedControlEvent', 'CAFAudioDescription', 'OpaqueCMBlockBuffer', 'CGTextDrawingMode', 'EKErrorCode', 'gss_buffer_desc_struct', 'AudioUnitParameterInfo', '__SCPreferences', '__CTFrame', '__CTLine', 'AudioFile_SMPTE_Time', 'gss_krb5_lucid_context_v1', 'OpaqueJSValue', 'TrakTableEntry', 'AudioFramePacketTranslation', 'CGImageSource', 'OpaqueJSPropertyNameAccumulator', 'JustPCGlyphRepeatAddAction', '__CFBinaryHeap', 'OpaqueMIDIThruConnection', 'opaqueCMBufferQueue', 'OpaqueMusicSequence', 'MortRearrangementSubtable', 'MixerDistanceParams', 'MorxSubtable', 'MIDIObjectPropertyChangeNotification', 'SFNTLookupSegment', 'CGImageMetadataErrors', 'CGPath', 'OpaqueMIDIEndpoint', 'AudioComponentPlugInInterface', 'gss_ctx_id_t_desc_struct', 'sfntFontFeatureSetting', 'OpaqueJSContextGroup', '__SCNetworkConnection', 'AudioUnitParameterValueTranslation', 'CGImageMetadataType', 'CGPattern', 'AudioFileTypeAndFormatID', 'CGContext', 'AUNodeInteraction', 'SFNTLookupTable', 'JustPCDecompositionAction', 'KerxControlPointHeader', 'AudioStreamPacketDescription', 'KernSubtableHeader', '__SecCertificate', 'AUMIDIOutputCallbackStruct', 'MIDIMetaEvent', 'AudioQueueChannelAssignment', 'AnchorPoint', 'JustTable', '__CFNetService', 'CF_BRIDGED_TYPE', 'gss_krb5_lucid_key', 'CGPDFDictionary', 'KerxSubtableHeader', 'CAF_UUID_ChunkHeader', 'gss_krb5_cfx_keydata', 'OpaqueJSClass', 'CGGradient', 'OpaqueMIDISetup', 'JustPostcompTable', '__CTParagraphStyle', 'AudioUnitParameterHistoryInfo', 'OpaqueJSContext', 'CGShading', 'MIDIThruConnectionParams', 'BslnFormat0Part', 'SFNTLookupSingle', '__CFHost', '__SecRandom', '__CTFontDescriptor', '_NSRange', 'sfntDirectory', 'AudioQueueLevelMeterState', 'CAFPositionPeak', 'PropLookupSegment', '__CVOpenGLESTextureCache', 'sfntInstance', '_GLKQuaternion', 'AnkrTable', '__SCNetworkProtocol', 'CAFFileHeader', 'KerxOrderedListHeader', 'CGBlendMode', 'STXEntryOne', 'CAFRegion', 'SFNTLookupTrimmedArrayHeader', 'SCNMatrix4', 'KerxControlPointEntry', 'OpaqueMusicTrack', '_GLKVector4', 'gss_OID_set_desc_struct', 'OpaqueMusicPlayer', '_CFHTTPAuthentication', 'CGAffineTransform', 'CAFMarkerChunk', 'AUHostIdentifier', 'ROTAGlyphEntry', 'BslnTable', 'gss_krb5_lucid_context_version', '_GLKMatrixStack', 'CGImage', 'KernStateEntry', 'SFNTLookupSingleHeader', 'MortLigatureSubtable', 'CAFUMIDChunk', 'SMPTETime', 'CAFDataChunk', 'CGPDFStream', 'AudioFileRegionList', 'STEntryTwo', 'SFNTLookupBinarySearchHeader', 'OpbdTable', '__CTGlyphInfo', 'BslnFormat2Part', 'KerxIndexArrayHeader', 'TrakTable', 'KerxKerningPair', '__CFBitVector', 'KernVersion0SubtableHeader', 'OpaqueAudioComponentInstance', 'AudioChannelLayout', '__CFUUID', 'MIDISysexSendRequest', '__CFNumberFormatter', 'CGImageSourceStatus', 'AudioFileMarkerList', 'AUSamplerBankPresetData', 'CGDataProvider', 'AudioFormatInfo', '__SecIdentity', 'sfntCMapExtendedSubHeader', 'MIDIChannelMessage', 'KernOffsetTable', 'CGColorSpaceModel', 'MFMailComposeErrorCode', 'CGFunction', '__SecTrust', 'AVAudio3DAngularOrientation', 'CGFontPostScriptFormat', 'KernStateHeader', 'AudioUnitCocoaViewInfo', 'CGDataConsumer', 'OpaqueMIDIDevice', 'KernVersion0Header', 'AnchorPointTable', 'CGImageDestination', 'CAFInstrumentChunk', 'AudioUnitMeterClipping', 'MorxChain', '__CTFontCollection', 'STEntryOne', 'STXEntryTwo', 'ExtendedNoteOnEvent', 'CGColorRenderingIntent', 'KerxSimpleArrayHeader', 'MorxTable', '_GLKVector3', '_GLKVector2', 'MortTable', 'CGPDFBox', 'AudioUnitParameterValueFromString', '__CFSocket', 'ALCdevice_struct', 'MIDINoteMessage', 'sfntFeatureHeader', 'CGRect', '__SCNetworkInterface', '__CFTree', 'MusicEventUserData', 'TrakTableData', 'GCQuaternion', 'MortContextualSubtable', '__CTRun', 'AudioUnitFrequencyResponseBin', 'MortChain', 'MorxInsertionSubtable', 'CGImageMetadata', 'gss_auth_identity', 'AudioUnitMIDIControlMapping', 'CAFChunkHeader', 'CGImagePropertyOrientation', 'CGPDFScanner', 'OpaqueMusicEventIterator', 'sfntDescriptorHeader', 'AudioUnitNodeConnection', 'OpaqueMIDIDeviceList', 'ExtendedAudioFormatInfo', 'BslnFormat1Part', 'sfntFontDescriptor', 'KernSimpleArrayHeader', '__CFRunLoopObserver', 'CGPatternTiling', 'MIDINotification', 'MorxLigatureSubtable', 'MessageComposeResult', 'MIDIThruConnectionEndpoint', 'MusicDeviceStdNoteParams', 'opaqueCMSimpleQueue', 'ALCcontext_struct', 'OpaqueAudioQueue', 'PropLookupSingle', 'CGInterpolationQuality', 'CGColor', 'AudioOutputUnitStartAtTimeParams', 'gss_name_t_desc_struct', 'CGFunctionCallbacks', 'CAFPacketTableHeader', 'AudioChannelDescription', 'sfntFeatureName', 'MorxContextualSubtable', 'CVSMPTETime', 'AudioValueRange', 'CGTextEncoding', 'AudioStreamBasicDescription', 'AUNodeRenderCallback', 'AudioPanningInfo', 'KerxOrderedListEntry', '__CFAllocator', 'OpaqueJSPropertyNameArray', '__SCDynamicStore', 'OpaqueMIDIEntity', '__CTRubyAnnotation', 'SCNVector4', 'CFHostClientContext', 'CFNetServiceClientContext', 'AudioUnitPresetMAS_SettingData', 'opaqueCMBufferQueueTriggerToken', 'AudioUnitProperty', 'CAFRegionChunk', 'CGPDFString', '__GLsync', '__CFStringTokenizer', 'JustWidthDeltaEntry', 'sfntVariationAxis', '__CFNetDiagnostic', 'CAFOverviewSample', 'sfntCMapEncoding', 'CGVector', '__SCNetworkService', 'opaqueCMSampleBuffer', 'AUHostVersionIdentifier', 'AudioBalanceFade', 'sfntFontRunFeature', 'KerxCoordinateAction', 'sfntCMapSubHeader', 'CVPlanarPixelBufferInfo', 'AUNumVersion', 'AUSamplerInstrumentData', 'AUPreset', '__CTRunDelegate', 'OpaqueAudioQueueProcessingTap', 'KerxTableHeader', '_NSZone', 'OpaqueExtAudioFile', '__CFRunLoopSource', '__CVMetalTextureCache', 'KerxAnchorPointAction', 'OpaqueJSString', 'AudioQueueParameterEvent', '__CFHTTPMessage', 'OpaqueCMClock', 'ScheduledAudioFileRegion', 'STEntryZero', 'AVAudio3DPoint', 'gss_channel_bindings_struct', 'sfntVariationHeader', 'AUChannelInfo', 'UIOffset', 'GLKEffectPropertyPrv', 'KerxStateHeader', 'CGLineJoin', 'CGPDFDocument', '__CFBag', 'KernOrderedListHeader', '__SCNetworkSet', '__SecKey', 'MIDIObjectAddRemoveNotification', 'AudioUnitParameter', 'JustPCActionSubrecord', 'AudioComponentDescription', 'AudioUnitParameterValueName', 'AudioUnitParameterEvent', 'KerxControlPointAction', 'AudioTimeStamp', 'KernKerningPair', 'gss_buffer_set_desc_struct', 'MortFeatureEntry', 'FontVariation', 'CAFStringID', 'LcarCaretClassEntry', 'AudioUnitParameterStringFromValue', 'ACErrorCode', 'ALMXGlyphEntry', 'LtagTable', '__CTTypesetter', 'AuthorizationOpaqueRef', 'UIEdgeInsets', 'CGPathElement', 'CAFMarker', 'KernTableHeader', 'NoteParamsControlValue', 'SSLContext', 'gss_cred_id_t_desc_struct', 'AudioUnitParameterNameInfo', 'CGDataConsumerCallbacks', 'ALMXHeader', 'CGLineCap', 'MIDIControlTransform', 'CGPDFArray', '__SecPolicy', 'AudioConverterPrimeInfo', '__CTTextTab', '__CFNetServiceMonitor', 'AUInputSamplesInOutputCallbackStruct', '__CTFramesetter', 'CGPDFDataFormat', 'STHeader', 'CVPlanarPixelBufferInfo_YCbCrPlanar', 'MIDIValueMap', 'JustDirectionTable', '__SCBondStatus', 'SFNTLookupSegmentHeader', 'OpaqueCMMemoryPool', 'CGPathDrawingMode', 'CGFont', '__SCNetworkReachability', 'AudioClassDescription', 'CGPoint', 'AVAudio3DVectorOrientation', 'CAFStrings', '__CFNetServiceBrowser', 'opaqueMTAudioProcessingTap', 'sfntNameRecord', 'CGPDFPage', 'CGLayer', 'ComponentInstanceRecord', 'CAFInfoStrings', 'HostCallbackInfo', 'MusicDeviceNoteParams', 'OpaqueVTCompressionSession', 'KernIndexArrayHeader', 'CVPlanarPixelBufferInfo_YCbCrBiPlanar', 'MusicTrackLoopInfo', 'opaqueCMFormatDescription', 'STClassTable', 'sfntDirectoryEntry', 'OpaqueCMTimebase', 'CGDataProviderDirectCallbacks', 'MIDIPacketList', 'CAFOverviewChunk', 'MIDIPacket', 'ScheduledAudioSlice', 'CGDataProviderSequentialCallbacks', 'AudioBuffer', 'MorxRearrangementSubtable', 'CGPatternCallbacks', 'AUDistanceAttenuationData', 'MIDIIOErrorNotification', 'CGPDFContentStream', 'IUnknownVTbl', 'MIDITransform', 'MortInsertionSubtable', 'CABarBeatTime', 'AudioBufferList', '__CVBuffer', 'AURenderCallbackStruct', 'STXEntryZero', 'JustPCDuctilityAction', 'OpaqueAudioQueueTimeline', 'VTDecompressionOutputCallbackRecord', 'OpaqueMIDIClient', '__CFPlugInInstance', 'AudioQueueBuffer', '__CFFileDescriptor', 'AudioUnitConnection', '_GKTurnBasedExchangeStatus', 'LcarCaretTable', 'CVPlanarComponentInfo', 'JustWidthDeltaGroup', 'OpaqueAudioComponent', 'ParameterEvent', '__CVPixelBufferPool', '__CTFont', 'CGColorSpace', 'CGSize', 'AUDependentParameter', 'MIDIDriverInterface', 'gss_krb5_rfc1964_keydata', '__CFDateFormatter', 'LtagStringRange', 'OpaqueVTDecompressionSession', 'gss_iov_buffer_desc_struct', 'AUPresetEvent', 'PropTable', 'KernOrderedListEntry', 'CF_BRIDGED_MUTABLE_TYPE', 'gss_OID_desc_struct', 'AudioUnitPresetMAS_Settings', 'AudioFileMarker', 'JustPCConditionalAddAction', 'BslnFormat3Part', '__CFNotificationCenter', 'MortSwashSubtable', 'AUParameterMIDIMapping', 'SCNVector3', 'OpaqueAudioConverter', 'MIDIRawData', 'sfntNameHeader', '__CFRunLoop', 'MFMailComposeResult', 'CATransform3D', 'OpbdSideValues', 'CAF_SMPTE_Time', '__SecAccessControl', 'JustPCAction', 'OpaqueVTFrameSilo', 'OpaqueVTMultiPassStorage', 'CGPathElementType', 'AudioFormatListItem', 'AudioUnitExternalBuffer', 'AudioFileRegion', 'AudioValueTranslation', 'CGImageMetadataTag', 'CAFPeakChunk', 'AudioBytePacketTranslation', 'sfntCMapHeader', '__CFURLEnumerator', 'STXHeader', 'CGPDFObjectType', 'SFNTLookupArrayHeader'])
-
-if __name__ == '__main__': # pragma: no cover
- import os
- import re
-
- FRAMEWORKS_PATH = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/'
- frameworks = os.listdir(FRAMEWORKS_PATH)
-
- all_interfaces = set()
- all_protocols = set()
- all_primitives = set()
- for framework in frameworks:
- frameworkHeadersDir = FRAMEWORKS_PATH + framework + '/Headers/'
- if not os.path.exists(frameworkHeadersDir):
- continue
-
- headerFilenames = os.listdir(frameworkHeadersDir)
-
- for f in headerFilenames:
- if not f.endswith('.h'):
- continue
-
- headerFilePath = frameworkHeadersDir + f
- with open(headerFilePath) as f:
- content = f.read()
- res = re.findall(r'(?<=@interface )\w+', content)
- for r in res:
- all_interfaces.add(r)
-
- res = re.findall(r'(?<=@protocol )\w+', content)
- for r in res:
- all_protocols.add(r)
-
- res = re.findall(r'(?<=typedef enum )\w+', content)
- for r in res:
- all_primitives.add(r)
-
- res = re.findall(r'(?<=typedef struct )\w+', content)
- for r in res:
- all_primitives.add(r)
-
- res = re.findall(r'(?<=typedef const struct )\w+', content)
- for r in res:
- all_primitives.add(r)
-
-
- print("ALL interfaces: \n")
- print(all_interfaces)
-
- print("\nALL protocols: \n")
- print(all_protocols)
-
- print("\nALL primitives: \n")
- print(all_primitives)
diff --git a/pygments/lexers/_csound_builtins.py b/pygments/lexers/_csound_builtins.py
deleted file mode 100644
index 16a48396..00000000
--- a/pygments/lexers/_csound_builtins.py
+++ /dev/null
@@ -1,1660 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._csound_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# Opcodes in Csound 6.12.0 at commit 6ca322bd31f1ca907c008616b40a5f237ff449db using
-# python -c "
-# import re, subprocess
-# output = subprocess.Popen(['csound', '--list-opcodes0'], stderr=subprocess.PIPE).communicate()[1]
-# opcodes = output[re.search(r'^$', output, re.M).end():re.search(r'^\d+ opcodes$', output, re.M).start()].split()
-# output = subprocess.Popen(['csound', '--list-opcodes2'], stderr=subprocess.PIPE).communicate()[1]
-# all_opcodes = output[re.search(r'^$', output, re.M).end():re.search(r'^\d+ opcodes$', output, re.M).start()].split()
-# deprecated_opcodes = [opcode for opcode in all_opcodes if opcode not in opcodes]
-# print '''OPCODES = set(\'''
-# {}
-# \'''.split())
-#
-# DEPRECATED_OPCODES = set(\'''
-# {}
-# \'''.split())
-# '''.format('\n'.join(opcodes), '\n'.join(deprecated_opcodes))
-# "
-# except for
-# cggoto csound.com/docs/manual/cggoto.html
-# cigoto csound.com/docs/manual/cigoto.html
-# cingoto (undocumented)
-# ckgoto csound.com/docs/manual/ckgoto.html
-# cngoto csound.com/docs/manual/cngoto.html
-# cnkgoto (undocumented)
-# endin csound.com/docs/manual/endin.html
-# endop csound.com/docs/manual/endop.html
-# goto csound.com/docs/manual/goto.html
-# igoto csound.com/docs/manual/igoto.html
-# instr csound.com/docs/manual/instr.html
-# kgoto csound.com/docs/manual/kgoto.html
-# loop_ge csound.com/docs/manual/loop_ge.html
-# loop_gt csound.com/docs/manual/loop_gt.html
-# loop_le csound.com/docs/manual/loop_le.html
-# loop_lt csound.com/docs/manual/loop_lt.html
-# opcode csound.com/docs/manual/opcode.html
-# reinit csound.com/docs/manual/reinit.html
-# return csound.com/docs/manual/return.html
-# rireturn csound.com/docs/manual/rireturn.html
-# rigoto csound.com/docs/manual/rigoto.html
-# tigoto csound.com/docs/manual/tigoto.html
-# timout csound.com/docs/manual/timout.html
-# which are treated as keywords in csound.py.
-
-OPCODES = set('''
-ATSadd
-ATSaddnz
-ATSbufread
-ATScross
-ATSinfo
-ATSinterpread
-ATSpartialtap
-ATSread
-ATSreadnz
-ATSsinnoi
-FLbox
-FLbutBank
-FLbutton
-FLcloseButton
-FLcolor
-FLcolor2
-FLcount
-FLexecButton
-FLgetsnap
-FLgroup
-FLgroupEnd
-FLgroup_end
-FLhide
-FLhvsBox
-FLhvsBoxSetValue
-FLjoy
-FLkeyIn
-FLknob
-FLlabel
-FLloadsnap
-FLmouse
-FLpack
-FLpackEnd
-FLpack_end
-FLpanel
-FLpanelEnd
-FLpanel_end
-FLprintk
-FLprintk2
-FLroller
-FLrun
-FLsavesnap
-FLscroll
-FLscrollEnd
-FLscroll_end
-FLsetAlign
-FLsetBox
-FLsetColor
-FLsetColor2
-FLsetFont
-FLsetPosition
-FLsetSize
-FLsetSnapGroup
-FLsetText
-FLsetTextColor
-FLsetTextSize
-FLsetTextType
-FLsetVal
-FLsetVal_i
-FLsetVali
-FLsetsnap
-FLshow
-FLslidBnk
-FLslidBnk2
-FLslidBnk2Set
-FLslidBnk2Setk
-FLslidBnkGetHandle
-FLslidBnkSet
-FLslidBnkSetk
-FLslider
-FLtabs
-FLtabsEnd
-FLtabs_end
-FLtext
-FLupdate
-FLvalue
-FLvkeybd
-FLvslidBnk
-FLvslidBnk2
-FLxyin
-JackoAudioIn
-JackoAudioInConnect
-JackoAudioOut
-JackoAudioOutConnect
-JackoFreewheel
-JackoInfo
-JackoInit
-JackoMidiInConnect
-JackoMidiOut
-JackoMidiOutConnect
-JackoNoteOut
-JackoOn
-JackoTransport
-K35_hpf
-K35_lpf
-MixerClear
-MixerGetLevel
-MixerReceive
-MixerSend
-MixerSetLevel
-MixerSetLevel_i
-OSCbundle
-OSCcount
-OSCinit
-OSCinitM
-OSClisten
-OSCraw
-OSCsend
-OSCsend_lo
-S
-STKBandedWG
-STKBeeThree
-STKBlowBotl
-STKBlowHole
-STKBowed
-STKBrass
-STKClarinet
-STKDrummer
-STKFlute
-STKFMVoices
-STKHevyMetl
-STKMandolin
-STKModalBar
-STKMoog
-STKPercFlut
-STKPlucked
-STKResonate
-STKRhodey
-STKSaxofony
-STKShakers
-STKSimple
-STKSitar
-STKStifKarp
-STKTubeBell
-STKVoicForm
-STKWhistle
-STKWurley
-a
-abs
-active
-adsr
-adsyn
-adsynt
-adsynt2
-aftouch
-alpass
-alwayson
-ampdb
-ampdbfs
-ampmidi
-ampmidid
-areson
-aresonk
-atone
-atonek
-atonex
-babo
-balance
-balance2
-bamboo
-barmodel
-bbcutm
-bbcuts
-beadsynt
-beosc
-betarand
-bexprnd
-bformdec1
-bformenc1
-binit
-biquad
-biquada
-birnd
-bpf
-bpfcos
-bqrez
-butbp
-butbr
-buthp
-butlp
-butterbp
-butterbr
-butterhp
-butterlp
-button
-buzz
-c2r
-cabasa
-cauchy
-cauchyi
-cbrt
-ceil
-cell
-cent
-centroid
-ceps
-cepsinv
-chanctrl
-changed
-changed2
-chani
-chano
-chebyshevpoly
-checkbox
-chn_S
-chn_a
-chn_k
-chnclear
-chnexport
-chnget
-chngetks
-chnmix
-chnparams
-chnset
-chnsetks
-chuap
-clear
-clfilt
-clip
-clockoff
-clockon
-cmp
-cmplxprod
-comb
-combinv
-compilecsd
-compileorc
-compilestr
-compress
-compress2
-connect
-control
-convle
-convolve
-copya2ftab
-copyf2array
-cos
-cosh
-cosinv
-cosseg
-cossegb
-cossegr
-cps2pch
-cpsmidi
-cpsmidib
-cpsmidinn
-cpsoct
-cpspch
-cpstmid
-cpstun
-cpstuni
-cpsxpch
-cpumeter
-cpuprc
-cross2
-crossfm
-crossfmi
-crossfmpm
-crossfmpmi
-crosspm
-crosspmi
-crunch
-ctlchn
-ctrl14
-ctrl21
-ctrl7
-ctrlinit
-cuserrnd
-dam
-date
-dates
-db
-dbamp
-dbfsamp
-dcblock
-dcblock2
-dconv
-dct
-dctinv
-deinterleave
-delay
-delay1
-delayk
-delayr
-delayw
-deltap
-deltap3
-deltapi
-deltapn
-deltapx
-deltapxw
-denorm
-diff
-diode_ladder
-directory
-diskgrain
-diskin
-diskin2
-dispfft
-display
-distort
-distort1
-divz
-doppler
-dot
-downsamp
-dripwater
-dssiactivate
-dssiaudio
-dssictls
-dssiinit
-dssilist
-dumpk
-dumpk2
-dumpk3
-dumpk4
-duserrnd
-dust
-dust2
-envlpx
-envlpxr
-ephasor
-eqfil
-evalstr
-event
-event_i
-exciter
-exitnow
-exp
-expcurve
-expon
-exprand
-exprandi
-expseg
-expsega
-expsegb
-expsegba
-expsegr
-fareylen
-fareyleni
-faustaudio
-faustcompile
-faustctl
-faustdsp
-faustgen
-faustplay
-fft
-fftinv
-ficlose
-filebit
-filelen
-filenchnls
-filepeak
-filescal
-filesr
-filevalid
-fillarray
-filter2
-fin
-fini
-fink
-fiopen
-flanger
-flashtxt
-flooper
-flooper2
-floor
-fmanal
-fmax
-fmb3
-fmbell
-fmin
-fmmetal
-fmod
-fmpercfl
-fmrhode
-fmvoice
-fmwurlie
-fof
-fof2
-fofilter
-fog
-fold
-follow
-follow2
-foscil
-foscili
-fout
-fouti
-foutir
-foutk
-fprintks
-fprints
-frac
-fractalnoise
-framebuffer
-freeverb
-ftaudio
-ftchnls
-ftconv
-ftcps
-ftfree
-ftgen
-ftgenonce
-ftgentmp
-ftlen
-ftload
-ftloadk
-ftlptim
-ftmorf
-ftom
-ftprint
-ftresize
-ftresizei
-ftsamplebank
-ftsave
-ftsavek
-ftslice
-ftsr
-gain
-gainslider
-gauss
-gaussi
-gausstrig
-gbuzz
-genarray
-genarray_i
-gendy
-gendyc
-gendyx
-getcfg
-getcol
-getftargs
-getrow
-getrowlin
-getseed
-gogobel
-grain
-grain2
-grain3
-granule
-guiro
-harmon
-harmon2
-harmon3
-harmon4
-hdf5read
-hdf5write
-hilbert
-hilbert2
-hrtfearly
-hrtfmove
-hrtfmove2
-hrtfreverb
-hrtfstat
-hsboscil
-hvs1
-hvs2
-hvs3
-hypot
-i
-ihold
-imagecreate
-imagefree
-imagegetpixel
-imageload
-imagesave
-imagesetpixel
-imagesize
-in
-in32
-inch
-inh
-init
-initc14
-initc21
-initc7
-inleta
-inletf
-inletk
-inletkid
-inletv
-ino
-inq
-inrg
-ins
-insglobal
-insremot
-int
-integ
-interleave
-interp
-invalue
-inx
-inz
-jacktransport
-jitter
-jitter2
-joystick
-jspline
-k
-la_i_add_mc
-la_i_add_mr
-la_i_add_vc
-la_i_add_vr
-la_i_assign_mc
-la_i_assign_mr
-la_i_assign_t
-la_i_assign_vc
-la_i_assign_vr
-la_i_conjugate_mc
-la_i_conjugate_mr
-la_i_conjugate_vc
-la_i_conjugate_vr
-la_i_distance_vc
-la_i_distance_vr
-la_i_divide_mc
-la_i_divide_mr
-la_i_divide_vc
-la_i_divide_vr
-la_i_dot_mc
-la_i_dot_mc_vc
-la_i_dot_mr
-la_i_dot_mr_vr
-la_i_dot_vc
-la_i_dot_vr
-la_i_get_mc
-la_i_get_mr
-la_i_get_vc
-la_i_get_vr
-la_i_invert_mc
-la_i_invert_mr
-la_i_lower_solve_mc
-la_i_lower_solve_mr
-la_i_lu_det_mc
-la_i_lu_det_mr
-la_i_lu_factor_mc
-la_i_lu_factor_mr
-la_i_lu_solve_mc
-la_i_lu_solve_mr
-la_i_mc_create
-la_i_mc_set
-la_i_mr_create
-la_i_mr_set
-la_i_multiply_mc
-la_i_multiply_mr
-la_i_multiply_vc
-la_i_multiply_vr
-la_i_norm_euclid_mc
-la_i_norm_euclid_mr
-la_i_norm_euclid_vc
-la_i_norm_euclid_vr
-la_i_norm_inf_mc
-la_i_norm_inf_mr
-la_i_norm_inf_vc
-la_i_norm_inf_vr
-la_i_norm_max_mc
-la_i_norm_max_mr
-la_i_norm1_mc
-la_i_norm1_mr
-la_i_norm1_vc
-la_i_norm1_vr
-la_i_print_mc
-la_i_print_mr
-la_i_print_vc
-la_i_print_vr
-la_i_qr_eigen_mc
-la_i_qr_eigen_mr
-la_i_qr_factor_mc
-la_i_qr_factor_mr
-la_i_qr_sym_eigen_mc
-la_i_qr_sym_eigen_mr
-la_i_random_mc
-la_i_random_mr
-la_i_random_vc
-la_i_random_vr
-la_i_size_mc
-la_i_size_mr
-la_i_size_vc
-la_i_size_vr
-la_i_subtract_mc
-la_i_subtract_mr
-la_i_subtract_vc
-la_i_subtract_vr
-la_i_t_assign
-la_i_trace_mc
-la_i_trace_mr
-la_i_transpose_mc
-la_i_transpose_mr
-la_i_upper_solve_mc
-la_i_upper_solve_mr
-la_i_vc_create
-la_i_vc_set
-la_i_vr_create
-la_i_vr_set
-la_k_a_assign
-la_k_add_mc
-la_k_add_mr
-la_k_add_vc
-la_k_add_vr
-la_k_assign_a
-la_k_assign_f
-la_k_assign_mc
-la_k_assign_mr
-la_k_assign_t
-la_k_assign_vc
-la_k_assign_vr
-la_k_conjugate_mc
-la_k_conjugate_mr
-la_k_conjugate_vc
-la_k_conjugate_vr
-la_k_current_f
-la_k_current_vr
-la_k_distance_vc
-la_k_distance_vr
-la_k_divide_mc
-la_k_divide_mr
-la_k_divide_vc
-la_k_divide_vr
-la_k_dot_mc
-la_k_dot_mc_vc
-la_k_dot_mr
-la_k_dot_mr_vr
-la_k_dot_vc
-la_k_dot_vr
-la_k_f_assign
-la_k_get_mc
-la_k_get_mr
-la_k_get_vc
-la_k_get_vr
-la_k_invert_mc
-la_k_invert_mr
-la_k_lower_solve_mc
-la_k_lower_solve_mr
-la_k_lu_det_mc
-la_k_lu_det_mr
-la_k_lu_factor_mc
-la_k_lu_factor_mr
-la_k_lu_solve_mc
-la_k_lu_solve_mr
-la_k_mc_set
-la_k_mr_set
-la_k_multiply_mc
-la_k_multiply_mr
-la_k_multiply_vc
-la_k_multiply_vr
-la_k_norm_euclid_mc
-la_k_norm_euclid_mr
-la_k_norm_euclid_vc
-la_k_norm_euclid_vr
-la_k_norm_inf_mc
-la_k_norm_inf_mr
-la_k_norm_inf_vc
-la_k_norm_inf_vr
-la_k_norm_max_mc
-la_k_norm_max_mr
-la_k_norm1_mc
-la_k_norm1_mr
-la_k_norm1_vc
-la_k_norm1_vr
-la_k_qr_eigen_mc
-la_k_qr_eigen_mr
-la_k_qr_factor_mc
-la_k_qr_factor_mr
-la_k_qr_sym_eigen_mc
-la_k_qr_sym_eigen_mr
-la_k_random_mc
-la_k_random_mr
-la_k_random_vc
-la_k_random_vr
-la_k_subtract_mc
-la_k_subtract_mr
-la_k_subtract_vc
-la_k_subtract_vr
-la_k_t_assign
-la_k_trace_mc
-la_k_trace_mr
-la_k_upper_solve_mc
-la_k_upper_solve_mr
-la_k_vc_set
-la_k_vr_set
-lenarray
-lfo
-limit
-limit1
-lincos
-line
-linen
-linenr
-lineto
-link_beat_force
-link_beat_get
-link_beat_request
-link_create
-link_enable
-link_is_enabled
-link_metro
-link_peers
-link_tempo_get
-link_tempo_set
-linlin
-linrand
-linseg
-linsegb
-linsegr
-liveconv
-locsend
-locsig
-log
-log10
-log2
-logbtwo
-logcurve
-loopseg
-loopsegp
-looptseg
-loopxseg
-lorenz
-loscil
-loscil3
-loscil3phs
-loscilphs
-loscilx
-lowpass2
-lowres
-lowresx
-lpf18
-lpform
-lpfreson
-lphasor
-lpinterp
-lposcil
-lposcil3
-lposcila
-lposcilsa
-lposcilsa2
-lpread
-lpreson
-lpshold
-lpsholdp
-lpslot
-lua_exec
-lua_iaopcall
-lua_iaopcall_off
-lua_ikopcall
-lua_ikopcall_off
-lua_iopcall
-lua_iopcall_off
-lua_opdef
-mac
-maca
-madsr
-mags
-mandel
-mandol
-maparray
-maparray_i
-marimba
-massign
-max
-max_k
-maxabs
-maxabsaccum
-maxaccum
-maxalloc
-maxarray
-mclock
-mdelay
-median
-mediank
-metro
-mfb
-midglobal
-midiarp
-midic14
-midic21
-midic7
-midichannelaftertouch
-midichn
-midicontrolchange
-midictrl
-mididefault
-midifilestatus
-midiin
-midinoteoff
-midinoteoncps
-midinoteonkey
-midinoteonoct
-midinoteonpch
-midion
-midion2
-midiout
-midiout_i
-midipgm
-midipitchbend
-midipolyaftertouch
-midiprogramchange
-miditempo
-midremot
-min
-minabs
-minabsaccum
-minaccum
-minarray
-mincer
-mirror
-mode
-modmatrix
-monitor
-moog
-moogladder
-moogladder2
-moogvcf
-moogvcf2
-moscil
-mp3bitrate
-mp3in
-mp3len
-mp3nchnls
-mp3scal
-mp3sr
-mpulse
-mrtmsg
-mtof
-mton
-multitap
-mute
-mvchpf
-mvclpf1
-mvclpf2
-mvclpf3
-mvclpf4
-mxadsr
-nchnls_hw
-nestedap
-nlalp
-nlfilt
-nlfilt2
-noise
-noteoff
-noteon
-noteondur
-noteondur2
-notnum
-nreverb
-nrpn
-nsamp
-nstance
-nstrnum
-ntom
-ntrpol
-nxtpow2
-octave
-octcps
-octmidi
-octmidib
-octmidinn
-octpch
-olabuffer
-oscbnk
-oscil
-oscil1
-oscil1i
-oscil3
-oscili
-oscilikt
-osciliktp
-oscilikts
-osciln
-oscils
-oscilx
-out
-out32
-outc
-outch
-outh
-outiat
-outic
-outic14
-outipat
-outipb
-outipc
-outkat
-outkc
-outkc14
-outkpat
-outkpb
-outkpc
-outleta
-outletf
-outletk
-outletkid
-outletv
-outo
-outq
-outq1
-outq2
-outq3
-outq4
-outrg
-outs
-outs1
-outs2
-outvalue
-outx
-outz
-p
-p5gconnect
-p5gdata
-pan
-pan2
-pareq
-part2txt
-partials
-partikkel
-partikkelget
-partikkelset
-partikkelsync
-passign
-paulstretch
-pcauchy
-pchbend
-pchmidi
-pchmidib
-pchmidinn
-pchoct
-pchtom
-pconvolve
-pcount
-pdclip
-pdhalf
-pdhalfy
-peak
-pgmassign
-pgmchn
-phaser1
-phaser2
-phasor
-phasorbnk
-phs
-pindex
-pinker
-pinkish
-pitch
-pitchac
-pitchamdf
-planet
-platerev
-plltrack
-pluck
-poisson
-pol2rect
-polyaft
-polynomial
-port
-portk
-poscil
-poscil3
-pow
-powershape
-powoftwo
-pows
-prealloc
-prepiano
-print
-print_type
-printarray
-printf
-printf_i
-printk
-printk2
-printks
-printks2
-prints
-product
-pset
-ptable
-ptable3
-ptablei
-ptableiw
-ptablew
-ptrack
-puts
-pvadd
-pvbufread
-pvcross
-pvinterp
-pvoc
-pvread
-pvs2array
-pvs2tab
-pvsadsyn
-pvsanal
-pvsarp
-pvsbandp
-pvsbandr
-pvsbin
-pvsblur
-pvsbuffer
-pvsbufread
-pvsbufread2
-pvscale
-pvscent
-pvsceps
-pvscross
-pvsdemix
-pvsdiskin
-pvsdisp
-pvsenvftw
-pvsfilter
-pvsfread
-pvsfreeze
-pvsfromarray
-pvsftr
-pvsftw
-pvsfwrite
-pvsgain
-pvshift
-pvsifd
-pvsin
-pvsinfo
-pvsinit
-pvslock
-pvsmaska
-pvsmix
-pvsmooth
-pvsmorph
-pvsosc
-pvsout
-pvspitch
-pvstanal
-pvstencil
-pvstrace
-pvsvoc
-pvswarp
-pvsynth
-pwd
-pyassign
-pyassigni
-pyassignt
-pycall
-pycall1
-pycall1i
-pycall1t
-pycall2
-pycall2i
-pycall2t
-pycall3
-pycall3i
-pycall3t
-pycall4
-pycall4i
-pycall4t
-pycall5
-pycall5i
-pycall5t
-pycall6
-pycall6i
-pycall6t
-pycall7
-pycall7i
-pycall7t
-pycall8
-pycall8i
-pycall8t
-pycalli
-pycalln
-pycallni
-pycallt
-pyeval
-pyevali
-pyevalt
-pyexec
-pyexeci
-pyexect
-pyinit
-pylassign
-pylassigni
-pylassignt
-pylcall
-pylcall1
-pylcall1i
-pylcall1t
-pylcall2
-pylcall2i
-pylcall2t
-pylcall3
-pylcall3i
-pylcall3t
-pylcall4
-pylcall4i
-pylcall4t
-pylcall5
-pylcall5i
-pylcall5t
-pylcall6
-pylcall6i
-pylcall6t
-pylcall7
-pylcall7i
-pylcall7t
-pylcall8
-pylcall8i
-pylcall8t
-pylcalli
-pylcalln
-pylcallni
-pylcallt
-pyleval
-pylevali
-pylevalt
-pylexec
-pylexeci
-pylexect
-pylrun
-pylruni
-pylrunt
-pyrun
-pyruni
-pyrunt
-qinf
-qnan
-r2c
-rand
-randh
-randi
-random
-randomh
-randomi
-rbjeq
-readclock
-readf
-readfi
-readk
-readk2
-readk3
-readk4
-readks
-readscore
-readscratch
-rect2pol
-release
-remoteport
-remove
-repluck
-reshapearray
-reson
-resonk
-resonr
-resonx
-resonxk
-resony
-resonz
-resyn
-reverb
-reverb2
-reverbsc
-rewindscore
-rezzy
-rfft
-rifft
-rms
-rnd
-rnd31
-round
-rspline
-rtclock
-s16b14
-s32b14
-samphold
-sandpaper
-sc_lag
-sc_lagud
-sc_phasor
-sc_trig
-scale
-scalearray
-scanhammer
-scans
-scantable
-scanu
-schedkwhen
-schedkwhennamed
-schedule
-schedwhen
-scoreline
-scoreline_i
-seed
-sekere
-select
-semitone
-sense
-sensekey
-seqtime
-seqtime2
-serialBegin
-serialEnd
-serialFlush
-serialPrint
-serialRead
-serialWrite
-serialWrite_i
-setcol
-setctrl
-setksmps
-setrow
-setscorepos
-sfilist
-sfinstr
-sfinstr3
-sfinstr3m
-sfinstrm
-sfload
-sflooper
-sfpassign
-sfplay
-sfplay3
-sfplay3m
-sfplaym
-sfplist
-sfpreset
-shaker
-shiftin
-shiftout
-signum
-sin
-sinh
-sininv
-sinsyn
-sleighbells
-slicearray
-slicearray_i
-slider16
-slider16f
-slider16table
-slider16tablef
-slider32
-slider32f
-slider32table
-slider32tablef
-slider64
-slider64f
-slider64table
-slider64tablef
-slider8
-slider8f
-slider8table
-slider8tablef
-sliderKawai
-sndloop
-sndwarp
-sndwarpst
-sockrecv
-sockrecvs
-socksend
-socksends
-sorta
-sortd
-soundin
-space
-spat3d
-spat3di
-spat3dt
-spdist
-splitrig
-sprintf
-sprintfk
-spsend
-sqrt
-squinewave
-statevar
-stix
-strcat
-strcatk
-strchar
-strchark
-strcmp
-strcmpk
-strcpy
-strcpyk
-strecv
-streson
-strfromurl
-strget
-strindex
-strindexk
-strlen
-strlenk
-strlower
-strlowerk
-strrindex
-strrindexk
-strset
-strsub
-strsubk
-strtod
-strtodk
-strtol
-strtolk
-strupper
-strupperk
-stsend
-subinstr
-subinstrinit
-sum
-sumarray
-svfilter
-syncgrain
-syncloop
-syncphasor
-system
-system_i
-tab
-tab2array
-tab2pvs
-tab_i
-tabifd
-table
-table3
-table3kt
-tablecopy
-tablefilter
-tablefilteri
-tablegpw
-tablei
-tableicopy
-tableigpw
-tableikt
-tableimix
-tableiw
-tablekt
-tablemix
-tableng
-tablera
-tableseg
-tableshuffle
-tableshufflei
-tablew
-tablewa
-tablewkt
-tablexkt
-tablexseg
-tabmorph
-tabmorpha
-tabmorphak
-tabmorphi
-tabplay
-tabrec
-tabrowlin
-tabsum
-tabw
-tabw_i
-tambourine
-tan
-tanh
-taninv
-taninv2
-tbvcf
-tempest
-tempo
-temposcal
-tempoval
-timedseq
-timeinstk
-timeinsts
-timek
-times
-tival
-tlineto
-tone
-tonek
-tonex
-tradsyn
-trandom
-transeg
-transegb
-transegr
-trcross
-trfilter
-trhighest
-trigger
-trigseq
-trim
-trim_i
-trirand
-trlowest
-trmix
-trscale
-trshift
-trsplit
-turnoff
-turnoff2
-turnon
-tvconv
-unirand
-unwrap
-upsamp
-urandom
-urd
-vactrol
-vadd
-vadd_i
-vaddv
-vaddv_i
-vaget
-valpass
-vaset
-vbap
-vbapg
-vbapgmove
-vbaplsinit
-vbapmove
-vbapz
-vbapzmove
-vcella
-vco
-vco2
-vco2ft
-vco2ift
-vco2init
-vcomb
-vcopy
-vcopy_i
-vdel_k
-vdelay
-vdelay3
-vdelayk
-vdelayx
-vdelayxq
-vdelayxs
-vdelayxw
-vdelayxwq
-vdelayxws
-vdivv
-vdivv_i
-vecdelay
-veloc
-vexp
-vexp_i
-vexpseg
-vexpv
-vexpv_i
-vibes
-vibr
-vibrato
-vincr
-vlimit
-vlinseg
-vlowres
-vmap
-vmirror
-vmult
-vmult_i
-vmultv
-vmultv_i
-voice
-vosim
-vphaseseg
-vport
-vpow
-vpow_i
-vpowv
-vpowv_i
-vpvoc
-vrandh
-vrandi
-vsubv
-vsubv_i
-vtaba
-vtabi
-vtabk
-vtable1k
-vtablea
-vtablei
-vtablek
-vtablewa
-vtablewi
-vtablewk
-vtabwa
-vtabwi
-vtabwk
-vwrap
-waveset
-websocket
-weibull
-wgbow
-wgbowedbar
-wgbrass
-wgclar
-wgflute
-wgpluck
-wgpluck2
-wguide1
-wguide2
-wiiconnect
-wiidata
-wiirange
-wiisend
-window
-wrap
-writescratch
-wterrain
-xadsr
-xin
-xout
-xscanmap
-xscans
-xscansmap
-xscanu
-xtratim
-xyscale
-zacl
-zakinit
-zamod
-zar
-zarg
-zaw
-zawm
-zdf_1pole
-zdf_1pole_mode
-zdf_2pole
-zdf_2pole_mode
-zdf_ladder
-zfilter2
-zir
-ziw
-ziwm
-zkcl
-zkmod
-zkr
-zkw
-zkwm
-'''.split())
-
-DEPRECATED_OPCODES = set('''
-array
-bformdec
-bformenc
-copy2ftab
-copy2ttab
-hrtfer
-ktableseg
-lentab
-maxtab
-mintab
-pop
-pop_f
-push
-push_f
-scalet
-sndload
-soundout
-soundouts
-specaddm
-specdiff
-specdisp
-specfilt
-spechist
-specptrk
-specscal
-specsum
-spectrum
-stack
-sumtab
-tabgen
-tabmap
-tabmap_i
-tabslice
-tb0
-tb0_init
-tb1
-tb10
-tb10_init
-tb11
-tb11_init
-tb12
-tb12_init
-tb13
-tb13_init
-tb14
-tb14_init
-tb15
-tb15_init
-tb1_init
-tb2
-tb2_init
-tb3
-tb3_init
-tb4
-tb4_init
-tb5
-tb5_init
-tb6
-tb6_init
-tb7
-tb7_init
-tb8
-tb8_init
-tb9
-tb9_init
-vbap16
-vbap4
-vbap4move
-vbap8
-vbap8move
-xyin
-'''.split())
diff --git a/pygments/lexers/_lasso_builtins.py b/pygments/lexers/_lasso_builtins.py
deleted file mode 100644
index 1d2719da..00000000
--- a/pygments/lexers/_lasso_builtins.py
+++ /dev/null
@@ -1,5327 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._lasso_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Built-in Lasso types, traits, methods, and members.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-BUILTINS = {
- 'Types': (
- 'array',
- 'atbegin',
- 'boolean',
- 'bson_iter',
- 'bson',
- 'bytes_document_body',
- 'bytes',
- 'cache_server_element',
- 'cache_server',
- 'capture',
- 'client_address',
- 'client_ip',
- 'component_container',
- 'component_render_state',
- 'component',
- 'curl',
- 'curltoken',
- 'currency',
- 'custom',
- 'data_document',
- 'database_registry',
- 'date',
- 'dateandtime',
- 'dbgp_packet',
- 'dbgp_server',
- 'debugging_stack',
- 'decimal',
- 'delve',
- 'dir',
- 'dirdesc',
- 'dns_response',
- 'document_base',
- 'document_body',
- 'document_header',
- 'dsinfo',
- 'duration',
- 'eacher',
- 'email_compose',
- 'email_parse',
- 'email_pop',
- 'email_queue_impl_base',
- 'email_queue_impl',
- 'email_smtp',
- 'email_stage_impl_base',
- 'email_stage_impl',
- 'fastcgi_each_fcgi_param',
- 'fastcgi_server',
- 'fcgi_record',
- 'fcgi_request',
- 'file',
- 'filedesc',
- 'filemaker_datasource',
- 'generateforeachkeyed',
- 'generateforeachunkeyed',
- 'generateseries',
- 'hash_map',
- 'html_atomic_element',
- 'html_attr',
- 'html_base',
- 'html_binary',
- 'html_br',
- 'html_cdata',
- 'html_container_element',
- 'html_div',
- 'html_document_body',
- 'html_document_head',
- 'html_eol',
- 'html_fieldset',
- 'html_form',
- 'html_h1',
- 'html_h2',
- 'html_h3',
- 'html_h4',
- 'html_h5',
- 'html_h6',
- 'html_hr',
- 'html_img',
- 'html_input',
- 'html_json',
- 'html_label',
- 'html_legend',
- 'html_link',
- 'html_meta',
- 'html_object',
- 'html_option',
- 'html_raw',
- 'html_script',
- 'html_select',
- 'html_span',
- 'html_style',
- 'html_table',
- 'html_td',
- 'html_text',
- 'html_th',
- 'html_tr',
- 'http_document_header',
- 'http_document',
- 'http_error',
- 'http_header_field',
- 'http_server_connection_handler_globals',
- 'http_server_connection_handler',
- 'http_server_request_logger_thread',
- 'http_server_web_connection',
- 'http_server',
- 'image',
- 'include_cache',
- 'inline_type',
- 'integer',
- 'java_jnienv',
- 'jbyte',
- 'jbytearray',
- 'jchar',
- 'jchararray',
- 'jfieldid',
- 'jfloat',
- 'jint',
- 'jmethodid',
- 'jobject',
- 'jshort',
- 'json_decode',
- 'json_encode',
- 'json_literal',
- 'json_object',
- 'keyword',
- 'lassoapp_compiledsrc_appsource',
- 'lassoapp_compiledsrc_fileresource',
- 'lassoapp_content_rep_halt',
- 'lassoapp_dirsrc_appsource',
- 'lassoapp_dirsrc_fileresource',
- 'lassoapp_installer',
- 'lassoapp_livesrc_appsource',
- 'lassoapp_livesrc_fileresource',
- 'lassoapp_long_expiring_bytes',
- 'lassoapp_manualsrc_appsource',
- 'lassoapp_zip_file_server',
- 'lassoapp_zipsrc_appsource',
- 'lassoapp_zipsrc_fileresource',
- 'ldap',
- 'library_thread_loader',
- 'list_node',
- 'list',
- 'locale',
- 'log_impl_base',
- 'log_impl',
- 'magick_image',
- 'map_node',
- 'map',
- 'memberstream',
- 'memory_session_driver_impl_entry',
- 'memory_session_driver_impl',
- 'memory_session_driver',
- 'mime_reader',
- 'mongo_client',
- 'mongo_collection',
- 'mongo_cursor',
- 'mustache_ctx',
- 'mysql_session_driver_impl',
- 'mysql_session_driver',
- 'net_named_pipe',
- 'net_tcp_ssl',
- 'net_tcp',
- 'net_udp_packet',
- 'net_udp',
- 'null',
- 'odbc_session_driver_impl',
- 'odbc_session_driver',
- 'opaque',
- 'os_process',
- 'pair_compare',
- 'pair',
- 'pairup',
- 'pdf_barcode',
- 'pdf_chunk',
- 'pdf_color',
- 'pdf_doc',
- 'pdf_font',
- 'pdf_hyphenator',
- 'pdf_image',
- 'pdf_list',
- 'pdf_paragraph',
- 'pdf_phrase',
- 'pdf_read',
- 'pdf_table',
- 'pdf_text',
- 'pdf_typebase',
- 'percent',
- 'portal_impl',
- 'queriable_groupby',
- 'queriable_grouping',
- 'queriable_groupjoin',
- 'queriable_join',
- 'queriable_orderby',
- 'queriable_orderbydescending',
- 'queriable_select',
- 'queriable_selectmany',
- 'queriable_skip',
- 'queriable_take',
- 'queriable_thenby',
- 'queriable_thenbydescending',
- 'queriable_where',
- 'queue',
- 'raw_document_body',
- 'regexp',
- 'repeat',
- 'scientific',
- 'security_registry',
- 'serialization_element',
- 'serialization_object_identity_compare',
- 'serialization_reader',
- 'serialization_writer_ref',
- 'serialization_writer_standin',
- 'serialization_writer',
- 'session_delete_expired_thread',
- 'set',
- 'signature',
- 'sourcefile',
- 'sqlite_column',
- 'sqlite_currentrow',
- 'sqlite_db',
- 'sqlite_results',
- 'sqlite_session_driver_impl_entry',
- 'sqlite_session_driver_impl',
- 'sqlite_session_driver',
- 'sqlite_table',
- 'sqlite3_stmt',
- 'sqlite3',
- 'staticarray',
- 'string',
- 'sys_process',
- 'tag',
- 'text_document',
- 'tie',
- 'timeonly',
- 'trait',
- 'tree_base',
- 'tree_node',
- 'tree_nullnode',
- 'ucal',
- 'usgcpu',
- 'usgvm',
- 'void',
- 'web_error_atend',
- 'web_node_base',
- 'web_node_content_representation_css_specialized',
- 'web_node_content_representation_html_specialized',
- 'web_node_content_representation_js_specialized',
- 'web_node_content_representation_xhr_container',
- 'web_node_echo',
- 'web_node_root',
- 'web_request_impl',
- 'web_request',
- 'web_response_impl',
- 'web_response',
- 'web_router',
- 'websocket_handler',
- 'worker_pool',
- 'xml_attr',
- 'xml_cdatasection',
- 'xml_characterdata',
- 'xml_comment',
- 'xml_document',
- 'xml_documentfragment',
- 'xml_documenttype',
- 'xml_domimplementation',
- 'xml_element',
- 'xml_entity',
- 'xml_entityreference',
- 'xml_namednodemap_attr',
- 'xml_namednodemap_ht',
- 'xml_namednodemap',
- 'xml_node',
- 'xml_nodelist',
- 'xml_notation',
- 'xml_processinginstruction',
- 'xml_text',
- 'xmlstream',
- 'zip_file_impl',
- 'zip_file',
- 'zip_impl',
- 'zip',
- ),
- 'Traits': (
- 'any',
- 'formattingbase',
- 'html_attributed',
- 'html_element_coreattrs',
- 'html_element_eventsattrs',
- 'html_element_i18nattrs',
- 'lassoapp_capabilities',
- 'lassoapp_resource',
- 'lassoapp_source',
- 'queriable_asstring',
- 'session_driver',
- 'trait_array',
- 'trait_asstring',
- 'trait_backcontractible',
- 'trait_backended',
- 'trait_backexpandable',
- 'trait_close',
- 'trait_contractible',
- 'trait_decompose_assignment',
- 'trait_doubleended',
- 'trait_each_sub',
- 'trait_encodeurl',
- 'trait_endedfullymutable',
- 'trait_expandable',
- 'trait_file',
- 'trait_finite',
- 'trait_finiteforeach',
- 'trait_foreach',
- 'trait_foreachtextelement',
- 'trait_frontcontractible',
- 'trait_frontended',
- 'trait_frontexpandable',
- 'trait_fullymutable',
- 'trait_generator',
- 'trait_generatorcentric',
- 'trait_hashable',
- 'trait_json_serialize',
- 'trait_keyed',
- 'trait_keyedfinite',
- 'trait_keyedforeach',
- 'trait_keyedmutable',
- 'trait_list',
- 'trait_map',
- 'trait_net',
- 'trait_pathcomponents',
- 'trait_positionallykeyed',
- 'trait_positionallysearchable',
- 'trait_queriable',
- 'trait_queriablelambda',
- 'trait_readbytes',
- 'trait_readstring',
- 'trait_scalar',
- 'trait_searchable',
- 'trait_serializable',
- 'trait_setencoding',
- 'trait_setoperations',
- 'trait_stack',
- 'trait_treenode',
- 'trait_writebytes',
- 'trait_writestring',
- 'trait_xml_elementcompat',
- 'trait_xml_nodecompat',
- 'web_connection',
- 'web_node_container',
- 'web_node_content_css_specialized',
- 'web_node_content_document',
- 'web_node_content_html_specialized',
- 'web_node_content_js_specialized',
- 'web_node_content_json_specialized',
- 'web_node_content_representation',
- 'web_node_content',
- 'web_node_postable',
- 'web_node',
- ),
- 'Unbound Methods': (
- 'abort_clear',
- 'abort_now',
- 'abort',
- 'action_param',
- 'action_params',
- 'action_statement',
- 'admin_authorization',
- 'admin_currentgroups',
- 'admin_currentuserid',
- 'admin_currentusername',
- 'admin_getpref',
- 'admin_initialize',
- 'admin_lassoservicepath',
- 'admin_removepref',
- 'admin_setpref',
- 'admin_userexists',
- 'all',
- 'auth_admin',
- 'auth_check',
- 'auth_custom',
- 'auth_group',
- 'auth_prompt',
- 'auth_user',
- 'bom_utf16be',
- 'bom_utf16le',
- 'bom_utf32be',
- 'bom_utf32le',
- 'bom_utf8',
- 'bw',
- 'capture_nearestloopabort',
- 'capture_nearestloopcontinue',
- 'capture_nearestloopcount',
- 'checked',
- 'cipher_decrypt_private',
- 'cipher_decrypt_public',
- 'cipher_decrypt',
- 'cipher_digest',
- 'cipher_encrypt_private',
- 'cipher_encrypt_public',
- 'cipher_encrypt',
- 'cipher_generate_key',
- 'cipher_hmac',
- 'cipher_keylength',
- 'cipher_list',
- 'cipher_open',
- 'cipher_seal',
- 'cipher_sign',
- 'cipher_verify',
- 'client_addr',
- 'client_authorization',
- 'client_browser',
- 'client_contentlength',
- 'client_contenttype',
- 'client_cookielist',
- 'client_cookies',
- 'client_encoding',
- 'client_formmethod',
- 'client_getargs',
- 'client_getparam',
- 'client_getparams',
- 'client_headers',
- 'client_integertoip',
- 'client_iptointeger',
- 'client_password',
- 'client_postargs',
- 'client_postparam',
- 'client_postparams',
- 'client_type',
- 'client_url',
- 'client_username',
- 'cn',
- 'column_name',
- 'column_names',
- 'column_type',
- 'column',
- 'compress',
- 'content_addheader',
- 'content_body',
- 'content_encoding',
- 'content_header',
- 'content_replaceheader',
- 'content_type',
- 'cookie_set',
- 'cookie',
- 'curl_easy_cleanup',
- 'curl_easy_duphandle',
- 'curl_easy_getinfo',
- 'curl_easy_init',
- 'curl_easy_reset',
- 'curl_easy_setopt',
- 'curl_easy_strerror',
- 'curl_getdate',
- 'curl_http_version_1_0',
- 'curl_http_version_1_1',
- 'curl_http_version_none',
- 'curl_ipresolve_v4',
- 'curl_ipresolve_v6',
- 'curl_ipresolve_whatever',
- 'curl_multi_perform',
- 'curl_multi_result',
- 'curl_netrc_ignored',
- 'curl_netrc_optional',
- 'curl_netrc_required',
- 'curl_sslversion_default',
- 'curl_sslversion_sslv2',
- 'curl_sslversion_sslv3',
- 'curl_sslversion_tlsv1',
- 'curl_version_asynchdns',
- 'curl_version_debug',
- 'curl_version_gssnegotiate',
- 'curl_version_idn',
- 'curl_version_info',
- 'curl_version_ipv6',
- 'curl_version_kerberos4',
- 'curl_version_largefile',
- 'curl_version_libz',
- 'curl_version_ntlm',
- 'curl_version_spnego',
- 'curl_version_ssl',
- 'curl_version',
- 'curlauth_any',
- 'curlauth_anysafe',
- 'curlauth_basic',
- 'curlauth_digest',
- 'curlauth_gssnegotiate',
- 'curlauth_none',
- 'curlauth_ntlm',
- 'curle_aborted_by_callback',
- 'curle_bad_calling_order',
- 'curle_bad_content_encoding',
- 'curle_bad_download_resume',
- 'curle_bad_function_argument',
- 'curle_bad_password_entered',
- 'curle_couldnt_connect',
- 'curle_couldnt_resolve_host',
- 'curle_couldnt_resolve_proxy',
- 'curle_failed_init',
- 'curle_file_couldnt_read_file',
- 'curle_filesize_exceeded',
- 'curle_ftp_access_denied',
- 'curle_ftp_cant_get_host',
- 'curle_ftp_cant_reconnect',
- 'curle_ftp_couldnt_get_size',
- 'curle_ftp_couldnt_retr_file',
- 'curle_ftp_couldnt_set_ascii',
- 'curle_ftp_couldnt_set_binary',
- 'curle_ftp_couldnt_use_rest',
- 'curle_ftp_port_failed',
- 'curle_ftp_quote_error',
- 'curle_ftp_ssl_failed',
- 'curle_ftp_user_password_incorrect',
- 'curle_ftp_weird_227_format',
- 'curle_ftp_weird_pass_reply',
- 'curle_ftp_weird_pasv_reply',
- 'curle_ftp_weird_server_reply',
- 'curle_ftp_weird_user_reply',
- 'curle_ftp_write_error',
- 'curle_function_not_found',
- 'curle_got_nothing',
- 'curle_http_post_error',
- 'curle_http_range_error',
- 'curle_http_returned_error',
- 'curle_interface_failed',
- 'curle_ldap_cannot_bind',
- 'curle_ldap_invalid_url',
- 'curle_ldap_search_failed',
- 'curle_library_not_found',
- 'curle_login_denied',
- 'curle_malformat_user',
- 'curle_obsolete',
- 'curle_ok',
- 'curle_operation_timeouted',
- 'curle_out_of_memory',
- 'curle_partial_file',
- 'curle_read_error',
- 'curle_recv_error',
- 'curle_send_error',
- 'curle_send_fail_rewind',
- 'curle_share_in_use',
- 'curle_ssl_cacert',
- 'curle_ssl_certproblem',
- 'curle_ssl_cipher',
- 'curle_ssl_connect_error',
- 'curle_ssl_engine_initfailed',
- 'curle_ssl_engine_notfound',
- 'curle_ssl_engine_setfailed',
- 'curle_ssl_peer_certificate',
- 'curle_telnet_option_syntax',
- 'curle_too_many_redirects',
- 'curle_unknown_telnet_option',
- 'curle_unsupported_protocol',
- 'curle_url_malformat_user',
- 'curle_url_malformat',
- 'curle_write_error',
- 'curlftpauth_default',
- 'curlftpauth_ssl',
- 'curlftpauth_tls',
- 'curlftpssl_all',
- 'curlftpssl_control',
- 'curlftpssl_last',
- 'curlftpssl_none',
- 'curlftpssl_try',
- 'curlinfo_connect_time',
- 'curlinfo_content_length_download',
- 'curlinfo_content_length_upload',
- 'curlinfo_content_type',
- 'curlinfo_effective_url',
- 'curlinfo_filetime',
- 'curlinfo_header_size',
- 'curlinfo_http_connectcode',
- 'curlinfo_httpauth_avail',
- 'curlinfo_namelookup_time',
- 'curlinfo_num_connects',
- 'curlinfo_os_errno',
- 'curlinfo_pretransfer_time',
- 'curlinfo_proxyauth_avail',
- 'curlinfo_redirect_count',
- 'curlinfo_redirect_time',
- 'curlinfo_request_size',
- 'curlinfo_response_code',
- 'curlinfo_size_download',
- 'curlinfo_size_upload',
- 'curlinfo_speed_download',
- 'curlinfo_speed_upload',
- 'curlinfo_ssl_engines',
- 'curlinfo_ssl_verifyresult',
- 'curlinfo_starttransfer_time',
- 'curlinfo_total_time',
- 'curlmsg_done',
- 'curlopt_autoreferer',
- 'curlopt_buffersize',
- 'curlopt_cainfo',
- 'curlopt_capath',
- 'curlopt_connecttimeout',
- 'curlopt_cookie',
- 'curlopt_cookiefile',
- 'curlopt_cookiejar',
- 'curlopt_cookiesession',
- 'curlopt_crlf',
- 'curlopt_customrequest',
- 'curlopt_dns_use_global_cache',
- 'curlopt_egdsocket',
- 'curlopt_encoding',
- 'curlopt_failonerror',
- 'curlopt_filetime',
- 'curlopt_followlocation',
- 'curlopt_forbid_reuse',
- 'curlopt_fresh_connect',
- 'curlopt_ftp_account',
- 'curlopt_ftp_create_missing_dirs',
- 'curlopt_ftp_response_timeout',
- 'curlopt_ftp_ssl',
- 'curlopt_ftp_use_eprt',
- 'curlopt_ftp_use_epsv',
- 'curlopt_ftpappend',
- 'curlopt_ftplistonly',
- 'curlopt_ftpport',
- 'curlopt_ftpsslauth',
- 'curlopt_header',
- 'curlopt_http_version',
- 'curlopt_http200aliases',
- 'curlopt_httpauth',
- 'curlopt_httpget',
- 'curlopt_httpheader',
- 'curlopt_httppost',
- 'curlopt_httpproxytunnel',
- 'curlopt_infilesize_large',
- 'curlopt_infilesize',
- 'curlopt_interface',
- 'curlopt_ipresolve',
- 'curlopt_krb4level',
- 'curlopt_low_speed_limit',
- 'curlopt_low_speed_time',
- 'curlopt_mail_from',
- 'curlopt_mail_rcpt',
- 'curlopt_maxconnects',
- 'curlopt_maxfilesize_large',
- 'curlopt_maxfilesize',
- 'curlopt_maxredirs',
- 'curlopt_netrc_file',
- 'curlopt_netrc',
- 'curlopt_nobody',
- 'curlopt_noprogress',
- 'curlopt_port',
- 'curlopt_post',
- 'curlopt_postfields',
- 'curlopt_postfieldsize_large',
- 'curlopt_postfieldsize',
- 'curlopt_postquote',
- 'curlopt_prequote',
- 'curlopt_proxy',
- 'curlopt_proxyauth',
- 'curlopt_proxyport',
- 'curlopt_proxytype',
- 'curlopt_proxyuserpwd',
- 'curlopt_put',
- 'curlopt_quote',
- 'curlopt_random_file',
- 'curlopt_range',
- 'curlopt_readdata',
- 'curlopt_referer',
- 'curlopt_resume_from_large',
- 'curlopt_resume_from',
- 'curlopt_ssl_cipher_list',
- 'curlopt_ssl_verifyhost',
- 'curlopt_ssl_verifypeer',
- 'curlopt_sslcert',
- 'curlopt_sslcerttype',
- 'curlopt_sslengine_default',
- 'curlopt_sslengine',
- 'curlopt_sslkey',
- 'curlopt_sslkeypasswd',
- 'curlopt_sslkeytype',
- 'curlopt_sslversion',
- 'curlopt_tcp_nodelay',
- 'curlopt_timecondition',
- 'curlopt_timeout',
- 'curlopt_timevalue',
- 'curlopt_transfertext',
- 'curlopt_unrestricted_auth',
- 'curlopt_upload',
- 'curlopt_url',
- 'curlopt_use_ssl',
- 'curlopt_useragent',
- 'curlopt_userpwd',
- 'curlopt_verbose',
- 'curlopt_writedata',
- 'curlproxy_http',
- 'curlproxy_socks4',
- 'curlproxy_socks5',
- 'database_adddefaultsqlitehost',
- 'database_database',
- 'database_initialize',
- 'database_name',
- 'database_qs',
- 'database_table_database_tables',
- 'database_table_datasource_databases',
- 'database_table_datasource_hosts',
- 'database_table_datasources',
- 'database_table_table_fields',
- 'database_util_cleanpath',
- 'dbgp_stop_stack_name',
- 'debugging_break',
- 'debugging_breakpoint_get',
- 'debugging_breakpoint_list',
- 'debugging_breakpoint_remove',
- 'debugging_breakpoint_set',
- 'debugging_breakpoint_update',
- 'debugging_context_locals',
- 'debugging_context_self',
- 'debugging_context_vars',
- 'debugging_detach',
- 'debugging_enabled',
- 'debugging_get_context',
- 'debugging_get_stack',
- 'debugging_run',
- 'debugging_step_in',
- 'debugging_step_out',
- 'debugging_step_over',
- 'debugging_stop',
- 'debugging_terminate',
- 'decimal_random',
- 'decompress',
- 'decrypt_blowfish',
- 'define_atbegin',
- 'define_atend',
- 'dns_default',
- 'dns_lookup',
- 'document',
- 'email_attachment_mime_type',
- 'email_batch',
- 'email_digestchallenge',
- 'email_digestresponse',
- 'email_extract',
- 'email_findemails',
- 'email_fix_address_list',
- 'email_fix_address',
- 'email_fs_error_clean',
- 'email_immediate',
- 'email_initialize',
- 'email_merge',
- 'email_mxlookup',
- 'email_pop_priv_extract',
- 'email_pop_priv_quote',
- 'email_pop_priv_substring',
- 'email_queue',
- 'email_result',
- 'email_safeemail',
- 'email_send',
- 'email_status',
- 'email_token',
- 'email_translatebreakstocrlf',
- 'encode_qheader',
- 'encoding_iso88591',
- 'encoding_utf8',
- 'encrypt_blowfish',
- 'encrypt_crammd5',
- 'encrypt_hmac',
- 'encrypt_md5',
- 'eol',
- 'eq',
- 'error_code_aborted',
- 'error_code_dividebyzero',
- 'error_code_filenotfound',
- 'error_code_invalidparameter',
- 'error_code_methodnotfound',
- 'error_code_networkerror',
- 'error_code_noerror',
- 'error_code_resnotfound',
- 'error_code_runtimeassertion',
- 'error_code',
- 'error_msg_aborted',
- 'error_msg_dividebyzero',
- 'error_msg_filenotfound',
- 'error_msg_invalidparameter',
- 'error_msg_methodnotfound',
- 'error_msg_networkerror',
- 'error_msg_noerror',
- 'error_msg_resnotfound',
- 'error_msg_runtimeassertion',
- 'error_msg',
- 'error_obj',
- 'error_pop',
- 'error_push',
- 'error_reset',
- 'error_stack',
- 'escape_tag',
- 'evdns_resolve_ipv4',
- 'evdns_resolve_ipv6',
- 'evdns_resolve_reverse_ipv6',
- 'evdns_resolve_reverse',
- 'ew',
- 'fail_if',
- 'fail_ifnot',
- 'fail_now',
- 'fail',
- 'failure_clear',
- 'fastcgi_createfcgirequest',
- 'fastcgi_handlecon',
- 'fastcgi_handlereq',
- 'fastcgi_initialize',
- 'fastcgi_initiate_request',
- 'fcgi_abort_request',
- 'fcgi_authorize',
- 'fcgi_begin_request',
- 'fcgi_bodychunksize',
- 'fcgi_cant_mpx_conn',
- 'fcgi_data',
- 'fcgi_end_request',
- 'fcgi_filter',
- 'fcgi_get_values_result',
- 'fcgi_get_values',
- 'fcgi_keep_conn',
- 'fcgi_makeendrequestbody',
- 'fcgi_makestdoutbody',
- 'fcgi_max_conns',
- 'fcgi_max_reqs',
- 'fcgi_mpxs_conns',
- 'fcgi_null_request_id',
- 'fcgi_overloaded',
- 'fcgi_params',
- 'fcgi_read_timeout_seconds',
- 'fcgi_readparam',
- 'fcgi_request_complete',
- 'fcgi_responder',
- 'fcgi_stderr',
- 'fcgi_stdin',
- 'fcgi_stdout',
- 'fcgi_unknown_role',
- 'fcgi_unknown_type',
- 'fcgi_version_1',
- 'fcgi_x_stdin',
- 'field_name',
- 'field_names',
- 'field',
- 'file_copybuffersize',
- 'file_defaultencoding',
- 'file_forceroot',
- 'file_modechar',
- 'file_modeline',
- 'file_stderr',
- 'file_stdin',
- 'file_stdout',
- 'file_tempfile',
- 'filemakerds_initialize',
- 'filemakerds',
- 'found_count',
- 'ft',
- 'ftp_deletefile',
- 'ftp_getdata',
- 'ftp_getfile',
- 'ftp_getlisting',
- 'ftp_putdata',
- 'ftp_putfile',
- 'full',
- 'generateforeach',
- 'gt',
- 'gte',
- 'handle_failure',
- 'handle',
- 'hash_primes',
- 'html_comment',
- 'http_char_colon',
- 'http_char_cr',
- 'http_char_htab',
- 'http_char_lf',
- 'http_char_question',
- 'http_char_space',
- 'http_default_files',
- 'http_read_headers',
- 'http_read_timeout_secs',
- 'http_server_apps_path',
- 'http_server_request_logger',
- 'if_empty',
- 'if_false',
- 'if_null',
- 'if_true',
- 'include_cache_compare',
- 'include_currentpath',
- 'include_filepath',
- 'include_localpath',
- 'include_once',
- 'include_path',
- 'include_raw',
- 'include_url',
- 'include',
- 'includes',
- 'inline_colinfo_name_pos',
- 'inline_colinfo_type_pos',
- 'inline_colinfo_valuelist_pos',
- 'inline_columninfo_pos',
- 'inline_foundcount_pos',
- 'inline_namedget',
- 'inline_namedput',
- 'inline_resultrows_pos',
- 'inline_scopeget',
- 'inline_scopepop',
- 'inline_scopepush',
- 'inline',
- 'integer_bitor',
- 'integer_random',
- 'io_dir_dt_blk',
- 'io_dir_dt_chr',
- 'io_dir_dt_dir',
- 'io_dir_dt_fifo',
- 'io_dir_dt_lnk',
- 'io_dir_dt_reg',
- 'io_dir_dt_sock',
- 'io_dir_dt_unknown',
- 'io_dir_dt_wht',
- 'io_file_access',
- 'io_file_chdir',
- 'io_file_chmod',
- 'io_file_chown',
- 'io_file_dirname',
- 'io_file_f_dupfd',
- 'io_file_f_getfd',
- 'io_file_f_getfl',
- 'io_file_f_getlk',
- 'io_file_f_rdlck',
- 'io_file_f_setfd',
- 'io_file_f_setfl',
- 'io_file_f_setlk',
- 'io_file_f_setlkw',
- 'io_file_f_test',
- 'io_file_f_tlock',
- 'io_file_f_ulock',
- 'io_file_f_unlck',
- 'io_file_f_wrlck',
- 'io_file_fd_cloexec',
- 'io_file_fioasync',
- 'io_file_fioclex',
- 'io_file_fiodtype',
- 'io_file_fiogetown',
- 'io_file_fionbio',
- 'io_file_fionclex',
- 'io_file_fionread',
- 'io_file_fiosetown',
- 'io_file_getcwd',
- 'io_file_lchown',
- 'io_file_link',
- 'io_file_lockf',
- 'io_file_lstat_atime',
- 'io_file_lstat_mode',
- 'io_file_lstat_mtime',
- 'io_file_lstat_size',
- 'io_file_mkdir',
- 'io_file_mkfifo',
- 'io_file_mkstemp',
- 'io_file_o_append',
- 'io_file_o_async',
- 'io_file_o_creat',
- 'io_file_o_excl',
- 'io_file_o_exlock',
- 'io_file_o_fsync',
- 'io_file_o_nofollow',
- 'io_file_o_nonblock',
- 'io_file_o_rdonly',
- 'io_file_o_rdwr',
- 'io_file_o_shlock',
- 'io_file_o_sync',
- 'io_file_o_trunc',
- 'io_file_o_wronly',
- 'io_file_pipe',
- 'io_file_readlink',
- 'io_file_realpath',
- 'io_file_remove',
- 'io_file_rename',
- 'io_file_rmdir',
- 'io_file_s_ifblk',
- 'io_file_s_ifchr',
- 'io_file_s_ifdir',
- 'io_file_s_ififo',
- 'io_file_s_iflnk',
- 'io_file_s_ifmt',
- 'io_file_s_ifreg',
- 'io_file_s_ifsock',
- 'io_file_s_irgrp',
- 'io_file_s_iroth',
- 'io_file_s_irusr',
- 'io_file_s_irwxg',
- 'io_file_s_irwxo',
- 'io_file_s_irwxu',
- 'io_file_s_isgid',
- 'io_file_s_isuid',
- 'io_file_s_isvtx',
- 'io_file_s_iwgrp',
- 'io_file_s_iwoth',
- 'io_file_s_iwusr',
- 'io_file_s_ixgrp',
- 'io_file_s_ixoth',
- 'io_file_s_ixusr',
- 'io_file_seek_cur',
- 'io_file_seek_end',
- 'io_file_seek_set',
- 'io_file_stat_atime',
- 'io_file_stat_mode',
- 'io_file_stat_mtime',
- 'io_file_stat_size',
- 'io_file_stderr',
- 'io_file_stdin',
- 'io_file_stdout',
- 'io_file_symlink',
- 'io_file_tempnam',
- 'io_file_truncate',
- 'io_file_umask',
- 'io_file_unlink',
- 'io_net_accept',
- 'io_net_af_inet',
- 'io_net_af_inet6',
- 'io_net_af_unix',
- 'io_net_bind',
- 'io_net_connect',
- 'io_net_getpeername',
- 'io_net_getsockname',
- 'io_net_ipproto_ip',
- 'io_net_ipproto_udp',
- 'io_net_listen',
- 'io_net_msg_oob',
- 'io_net_msg_peek',
- 'io_net_msg_waitall',
- 'io_net_recv',
- 'io_net_recvfrom',
- 'io_net_send',
- 'io_net_sendto',
- 'io_net_shut_rd',
- 'io_net_shut_rdwr',
- 'io_net_shut_wr',
- 'io_net_shutdown',
- 'io_net_so_acceptconn',
- 'io_net_so_broadcast',
- 'io_net_so_debug',
- 'io_net_so_dontroute',
- 'io_net_so_error',
- 'io_net_so_keepalive',
- 'io_net_so_linger',
- 'io_net_so_oobinline',
- 'io_net_so_rcvbuf',
- 'io_net_so_rcvlowat',
- 'io_net_so_rcvtimeo',
- 'io_net_so_reuseaddr',
- 'io_net_so_sndbuf',
- 'io_net_so_sndlowat',
- 'io_net_so_sndtimeo',
- 'io_net_so_timestamp',
- 'io_net_so_type',
- 'io_net_so_useloopback',
- 'io_net_sock_dgram',
- 'io_net_sock_raw',
- 'io_net_sock_rdm',
- 'io_net_sock_seqpacket',
- 'io_net_sock_stream',
- 'io_net_socket',
- 'io_net_sol_socket',
- 'io_net_ssl_accept',
- 'io_net_ssl_begin',
- 'io_net_ssl_connect',
- 'io_net_ssl_end',
- 'io_net_ssl_error',
- 'io_net_ssl_errorstring',
- 'io_net_ssl_funcerrorstring',
- 'io_net_ssl_liberrorstring',
- 'io_net_ssl_read',
- 'io_net_ssl_reasonerrorstring',
- 'io_net_ssl_setacceptstate',
- 'io_net_ssl_setconnectstate',
- 'io_net_ssl_setverifylocations',
- 'io_net_ssl_shutdown',
- 'io_net_ssl_usecertificatechainfile',
- 'io_net_ssl_useprivatekeyfile',
- 'io_net_ssl_write',
- 'java_jvm_create',
- 'java_jvm_getenv',
- 'jdbc_initialize',
- 'json_back_slash',
- 'json_back_space',
- 'json_close_array',
- 'json_close_object',
- 'json_colon',
- 'json_comma',
- 'json_consume_array',
- 'json_consume_object',
- 'json_consume_string',
- 'json_consume_token',
- 'json_cr',
- 'json_debug',
- 'json_deserialize',
- 'json_e_lower',
- 'json_e_upper',
- 'json_f_lower',
- 'json_form_feed',
- 'json_forward_slash',
- 'json_lf',
- 'json_n_lower',
- 'json_negative',
- 'json_open_array',
- 'json_open_object',
- 'json_period',
- 'json_positive',
- 'json_quote_double',
- 'json_rpccall',
- 'json_serialize',
- 'json_t_lower',
- 'json_tab',
- 'json_white_space',
- 'keycolumn_name',
- 'keycolumn_value',
- 'keyfield_name',
- 'keyfield_value',
- 'lasso_currentaction',
- 'lasso_errorreporting',
- 'lasso_executiontimelimit',
- 'lasso_methodexists',
- 'lasso_tagexists',
- 'lasso_uniqueid',
- 'lasso_version',
- 'lassoapp_current_app',
- 'lassoapp_current_include',
- 'lassoapp_do_with_include',
- 'lassoapp_exists',
- 'lassoapp_find_missing_file',
- 'lassoapp_format_mod_date',
- 'lassoapp_get_capabilities_name',
- 'lassoapp_include_current',
- 'lassoapp_include',
- 'lassoapp_initialize_db',
- 'lassoapp_initialize',
- 'lassoapp_invoke_resource',
- 'lassoapp_issourcefileextension',
- 'lassoapp_link',
- 'lassoapp_load_module',
- 'lassoapp_mime_get',
- 'lassoapp_mime_type_appcache',
- 'lassoapp_mime_type_css',
- 'lassoapp_mime_type_csv',
- 'lassoapp_mime_type_doc',
- 'lassoapp_mime_type_docx',
- 'lassoapp_mime_type_eof',
- 'lassoapp_mime_type_eot',
- 'lassoapp_mime_type_gif',
- 'lassoapp_mime_type_html',
- 'lassoapp_mime_type_ico',
- 'lassoapp_mime_type_jpg',
- 'lassoapp_mime_type_js',
- 'lassoapp_mime_type_lasso',
- 'lassoapp_mime_type_map',
- 'lassoapp_mime_type_pdf',
- 'lassoapp_mime_type_png',
- 'lassoapp_mime_type_ppt',
- 'lassoapp_mime_type_rss',
- 'lassoapp_mime_type_svg',
- 'lassoapp_mime_type_swf',
- 'lassoapp_mime_type_tif',
- 'lassoapp_mime_type_ttf',
- 'lassoapp_mime_type_txt',
- 'lassoapp_mime_type_woff',
- 'lassoapp_mime_type_xaml',
- 'lassoapp_mime_type_xap',
- 'lassoapp_mime_type_xbap',
- 'lassoapp_mime_type_xhr',
- 'lassoapp_mime_type_xml',
- 'lassoapp_mime_type_zip',
- 'lassoapp_path_to_method_name',
- 'lassoapp_settingsdb',
- 'layout_name',
- 'lcapi_datasourceadd',
- 'lcapi_datasourcecloseconnection',
- 'lcapi_datasourcedelete',
- 'lcapi_datasourceduplicate',
- 'lcapi_datasourceexecsql',
- 'lcapi_datasourcefindall',
- 'lcapi_datasourceimage',
- 'lcapi_datasourceinfo',
- 'lcapi_datasourceinit',
- 'lcapi_datasourcematchesname',
- 'lcapi_datasourcenames',
- 'lcapi_datasourcenothing',
- 'lcapi_datasourceopand',
- 'lcapi_datasourceopany',
- 'lcapi_datasourceopbw',
- 'lcapi_datasourceopct',
- 'lcapi_datasourceopeq',
- 'lcapi_datasourceopew',
- 'lcapi_datasourceopft',
- 'lcapi_datasourceopgt',
- 'lcapi_datasourceopgteq',
- 'lcapi_datasourceopin',
- 'lcapi_datasourceoplt',
- 'lcapi_datasourceoplteq',
- 'lcapi_datasourceopnbw',
- 'lcapi_datasourceopnct',
- 'lcapi_datasourceopneq',
- 'lcapi_datasourceopnew',
- 'lcapi_datasourceopnin',
- 'lcapi_datasourceopno',
- 'lcapi_datasourceopnot',
- 'lcapi_datasourceopnrx',
- 'lcapi_datasourceopor',
- 'lcapi_datasourceoprx',
- 'lcapi_datasourcepreparesql',
- 'lcapi_datasourceprotectionnone',
- 'lcapi_datasourceprotectionreadonly',
- 'lcapi_datasourcerandom',
- 'lcapi_datasourceschemanames',
- 'lcapi_datasourcescripts',
- 'lcapi_datasourcesearch',
- 'lcapi_datasourcesortascending',
- 'lcapi_datasourcesortcustom',
- 'lcapi_datasourcesortdescending',
- 'lcapi_datasourcetablenames',
- 'lcapi_datasourceterm',
- 'lcapi_datasourcetickle',
- 'lcapi_datasourcetypeblob',
- 'lcapi_datasourcetypeboolean',
- 'lcapi_datasourcetypedate',
- 'lcapi_datasourcetypedecimal',
- 'lcapi_datasourcetypeinteger',
- 'lcapi_datasourcetypestring',
- 'lcapi_datasourceunpreparesql',
- 'lcapi_datasourceupdate',
- 'lcapi_fourchartointeger',
- 'lcapi_listdatasources',
- 'lcapi_loadmodule',
- 'lcapi_loadmodules',
- 'lcapi_updatedatasourceslist',
- 'ldap_scope_base',
- 'ldap_scope_children',
- 'ldap_scope_onelevel',
- 'ldap_scope_subtree',
- 'library_once',
- 'library',
- 'ljapi_initialize',
- 'locale_availablelocales',
- 'locale_canada',
- 'locale_canadafrench',
- 'locale_china',
- 'locale_chinese',
- 'locale_default',
- 'locale_english',
- 'locale_format_style_date_time',
- 'locale_format_style_default',
- 'locale_format_style_full',
- 'locale_format_style_long',
- 'locale_format_style_medium',
- 'locale_format_style_none',
- 'locale_format_style_short',
- 'locale_format',
- 'locale_france',
- 'locale_french',
- 'locale_german',
- 'locale_germany',
- 'locale_isocountries',
- 'locale_isolanguages',
- 'locale_italian',
- 'locale_italy',
- 'locale_japan',
- 'locale_japanese',
- 'locale_korea',
- 'locale_korean',
- 'locale_prc',
- 'locale_setdefault',
- 'locale_simplifiedchinese',
- 'locale_taiwan',
- 'locale_traditionalchinese',
- 'locale_uk',
- 'locale_us',
- 'log_always',
- 'log_critical',
- 'log_deprecated',
- 'log_destination_console',
- 'log_destination_database',
- 'log_destination_file',
- 'log_detail',
- 'log_initialize',
- 'log_level_critical',
- 'log_level_deprecated',
- 'log_level_detail',
- 'log_level_sql',
- 'log_level_warning',
- 'log_max_file_size',
- 'log_setdestination',
- 'log_sql',
- 'log_trim_file_size',
- 'log_warning',
- 'log',
- 'loop_abort',
- 'loop_continue',
- 'loop_count',
- 'loop_key_pop',
- 'loop_key_push',
- 'loop_key',
- 'loop_pop',
- 'loop_push',
- 'loop_value_pop',
- 'loop_value_push',
- 'loop_value',
- 'loop',
- 'lt',
- 'lte',
- 'main_thread_only',
- 'max',
- 'maxrecords_value',
- 'median',
- 'method_name',
- 'micros',
- 'millis',
- 'min',
- 'minimal',
- 'mongo_insert_continue_on_error',
- 'mongo_insert_no_validate',
- 'mongo_insert_none',
- 'mongo_query_await_data',
- 'mongo_query_exhaust',
- 'mongo_query_no_cursor_timeout',
- 'mongo_query_none',
- 'mongo_query_oplog_replay',
- 'mongo_query_partial',
- 'mongo_query_slave_ok',
- 'mongo_query_tailable_cursor',
- 'mongo_remove_none',
- 'mongo_remove_single_remove',
- 'mongo_update_multi_update',
- 'mongo_update_no_validate',
- 'mongo_update_none',
- 'mongo_update_upsert',
- 'mustache_compile_file',
- 'mustache_compile_string',
- 'mustache_include',
- 'mysqlds',
- 'namespace_global',
- 'namespace_import',
- 'namespace_using',
- 'nbw',
- 'ncn',
- 'neq',
- 'net_connectinprogress',
- 'net_connectok',
- 'net_typessl',
- 'net_typessltcp',
- 'net_typessludp',
- 'net_typetcp',
- 'net_typeudp',
- 'net_waitread',
- 'net_waittimeout',
- 'net_waitwrite',
- 'new',
- 'none',
- 'nrx',
- 'nslookup',
- 'odbc_session_driver_mssql',
- 'odbc',
- 'output_none',
- 'output',
- 'pdf_package',
- 'pdf_rectangle',
- 'pdf_serve',
- 'pi',
- 'portal',
- 'postgresql',
- 'process',
- 'protect_now',
- 'protect',
- 'queriable_average',
- 'queriable_defaultcompare',
- 'queriable_do',
- 'queriable_internal_combinebindings',
- 'queriable_max',
- 'queriable_min',
- 'queriable_qsort',
- 'queriable_reversecompare',
- 'queriable_sum',
- 'random_seed',
- 'range',
- 'records_array',
- 'records_map',
- 'records',
- 'redirect_url',
- 'referer_url',
- 'referrer_url',
- 'register_thread',
- 'register',
- 'response_filepath',
- 'response_localpath',
- 'response_path',
- 'response_realm',
- 'response_root',
- 'resultset_count',
- 'resultset',
- 'resultsets',
- 'rows_array',
- 'rows_impl',
- 'rows',
- 'rx',
- 'schema_name',
- 'security_database',
- 'security_default_realm',
- 'security_initialize',
- 'security_table_groups',
- 'security_table_ug_map',
- 'security_table_users',
- 'selected',
- 'series',
- 'server_admin',
- 'server_ip',
- 'server_name',
- 'server_port',
- 'server_protocol',
- 'server_push',
- 'server_signature',
- 'server_software',
- 'session_abort',
- 'session_addvar',
- 'session_decorate',
- 'session_deleteexpired',
- 'session_end',
- 'session_getdefaultdriver',
- 'session_id',
- 'session_initialize',
- 'session_removevar',
- 'session_result',
- 'session_setdefaultdriver',
- 'session_start',
- 'shown_count',
- 'shown_first',
- 'shown_last',
- 'site_id',
- 'site_name',
- 'skiprecords_value',
- 'sleep',
- 'split_thread',
- 'sqlite_abort',
- 'sqlite_auth',
- 'sqlite_blob',
- 'sqlite_busy',
- 'sqlite_cantopen',
- 'sqlite_constraint',
- 'sqlite_corrupt',
- 'sqlite_createdb',
- 'sqlite_done',
- 'sqlite_empty',
- 'sqlite_error',
- 'sqlite_float',
- 'sqlite_format',
- 'sqlite_full',
- 'sqlite_integer',
- 'sqlite_internal',
- 'sqlite_interrupt',
- 'sqlite_ioerr',
- 'sqlite_locked',
- 'sqlite_mismatch',
- 'sqlite_misuse',
- 'sqlite_nolfs',
- 'sqlite_nomem',
- 'sqlite_notadb',
- 'sqlite_notfound',
- 'sqlite_null',
- 'sqlite_ok',
- 'sqlite_perm',
- 'sqlite_protocol',
- 'sqlite_range',
- 'sqlite_readonly',
- 'sqlite_row',
- 'sqlite_schema',
- 'sqlite_setsleepmillis',
- 'sqlite_setsleeptries',
- 'sqlite_text',
- 'sqlite_toobig',
- 'sqliteconnector',
- 'staticarray_join',
- 'stdout',
- 'stdoutnl',
- 'string_validcharset',
- 'suspend',
- 'sys_appspath',
- 'sys_chroot',
- 'sys_clock',
- 'sys_clockspersec',
- 'sys_credits',
- 'sys_databasespath',
- 'sys_detach_exec',
- 'sys_difftime',
- 'sys_dll_ext',
- 'sys_drand48',
- 'sys_environ',
- 'sys_eol',
- 'sys_erand48',
- 'sys_errno',
- 'sys_exec_pid_to_os_pid',
- 'sys_exec',
- 'sys_exit',
- 'sys_fork',
- 'sys_garbagecollect',
- 'sys_getbytessincegc',
- 'sys_getchar',
- 'sys_getegid',
- 'sys_getenv',
- 'sys_geteuid',
- 'sys_getgid',
- 'sys_getgrnam',
- 'sys_getheapfreebytes',
- 'sys_getheapsize',
- 'sys_getlogin',
- 'sys_getpid',
- 'sys_getppid',
- 'sys_getpwnam',
- 'sys_getpwuid',
- 'sys_getstartclock',
- 'sys_getthreadcount',
- 'sys_getuid',
- 'sys_growheapby',
- 'sys_homepath',
- 'sys_is_full_path',
- 'sys_is_windows',
- 'sys_isfullpath',
- 'sys_iswindows',
- 'sys_iterate',
- 'sys_jrand48',
- 'sys_kill_exec',
- 'sys_kill',
- 'sys_lcong48',
- 'sys_librariespath',
- 'sys_listtraits',
- 'sys_listtypes',
- 'sys_listunboundmethods',
- 'sys_loadlibrary',
- 'sys_lrand48',
- 'sys_masterhomepath',
- 'sys_mrand48',
- 'sys_nrand48',
- 'sys_pid_exec',
- 'sys_pointersize',
- 'sys_rand',
- 'sys_random',
- 'sys_seed48',
- 'sys_setenv',
- 'sys_setgid',
- 'sys_setsid',
- 'sys_setuid',
- 'sys_sigabrt',
- 'sys_sigalrm',
- 'sys_sigbus',
- 'sys_sigchld',
- 'sys_sigcont',
- 'sys_sigfpe',
- 'sys_sighup',
- 'sys_sigill',
- 'sys_sigint',
- 'sys_sigkill',
- 'sys_sigpipe',
- 'sys_sigprof',
- 'sys_sigquit',
- 'sys_sigsegv',
- 'sys_sigstop',
- 'sys_sigsys',
- 'sys_sigterm',
- 'sys_sigtrap',
- 'sys_sigtstp',
- 'sys_sigttin',
- 'sys_sigttou',
- 'sys_sigurg',
- 'sys_sigusr1',
- 'sys_sigusr2',
- 'sys_sigvtalrm',
- 'sys_sigxcpu',
- 'sys_sigxfsz',
- 'sys_srand',
- 'sys_srand48',
- 'sys_srandom',
- 'sys_strerror',
- 'sys_supportpath',
- 'sys_test_exec',
- 'sys_time',
- 'sys_uname',
- 'sys_unsetenv',
- 'sys_usercapimodulepath',
- 'sys_userstartuppath',
- 'sys_version',
- 'sys_wait_exec',
- 'sys_waitpid',
- 'sys_wcontinued',
- 'sys_while',
- 'sys_wnohang',
- 'sys_wuntraced',
- 'table_name',
- 'tag_exists',
- 'tag_name',
- 'thread_var_get',
- 'thread_var_pop',
- 'thread_var_push',
- 'threadvar_find',
- 'threadvar_get',
- 'threadvar_set_asrt',
- 'threadvar_set',
- 'timer',
- 'token_value',
- 'treemap',
- 'u_lb_alphabetic',
- 'u_lb_ambiguous',
- 'u_lb_break_after',
- 'u_lb_break_before',
- 'u_lb_break_both',
- 'u_lb_break_symbols',
- 'u_lb_carriage_return',
- 'u_lb_close_punctuation',
- 'u_lb_combining_mark',
- 'u_lb_complex_context',
- 'u_lb_contingent_break',
- 'u_lb_exclamation',
- 'u_lb_glue',
- 'u_lb_h2',
- 'u_lb_h3',
- 'u_lb_hyphen',
- 'u_lb_ideographic',
- 'u_lb_infix_numeric',
- 'u_lb_inseparable',
- 'u_lb_jl',
- 'u_lb_jt',
- 'u_lb_jv',
- 'u_lb_line_feed',
- 'u_lb_mandatory_break',
- 'u_lb_next_line',
- 'u_lb_nonstarter',
- 'u_lb_numeric',
- 'u_lb_open_punctuation',
- 'u_lb_postfix_numeric',
- 'u_lb_prefix_numeric',
- 'u_lb_quotation',
- 'u_lb_space',
- 'u_lb_surrogate',
- 'u_lb_unknown',
- 'u_lb_word_joiner',
- 'u_lb_zwspace',
- 'u_nt_decimal',
- 'u_nt_digit',
- 'u_nt_none',
- 'u_nt_numeric',
- 'u_sb_aterm',
- 'u_sb_close',
- 'u_sb_format',
- 'u_sb_lower',
- 'u_sb_numeric',
- 'u_sb_oletter',
- 'u_sb_other',
- 'u_sb_sep',
- 'u_sb_sp',
- 'u_sb_sterm',
- 'u_sb_upper',
- 'u_wb_aletter',
- 'u_wb_extendnumlet',
- 'u_wb_format',
- 'u_wb_katakana',
- 'u_wb_midletter',
- 'u_wb_midnum',
- 'u_wb_numeric',
- 'u_wb_other',
- 'ucal_ampm',
- 'ucal_dayofmonth',
- 'ucal_dayofweek',
- 'ucal_dayofweekinmonth',
- 'ucal_dayofyear',
- 'ucal_daysinfirstweek',
- 'ucal_dowlocal',
- 'ucal_dstoffset',
- 'ucal_era',
- 'ucal_extendedyear',
- 'ucal_firstdayofweek',
- 'ucal_hour',
- 'ucal_hourofday',
- 'ucal_julianday',
- 'ucal_lenient',
- 'ucal_listtimezones',
- 'ucal_millisecond',
- 'ucal_millisecondsinday',
- 'ucal_minute',
- 'ucal_month',
- 'ucal_second',
- 'ucal_weekofmonth',
- 'ucal_weekofyear',
- 'ucal_year',
- 'ucal_yearwoy',
- 'ucal_zoneoffset',
- 'uchar_age',
- 'uchar_alphabetic',
- 'uchar_ascii_hex_digit',
- 'uchar_bidi_class',
- 'uchar_bidi_control',
- 'uchar_bidi_mirrored',
- 'uchar_bidi_mirroring_glyph',
- 'uchar_block',
- 'uchar_canonical_combining_class',
- 'uchar_case_folding',
- 'uchar_case_sensitive',
- 'uchar_dash',
- 'uchar_decomposition_type',
- 'uchar_default_ignorable_code_point',
- 'uchar_deprecated',
- 'uchar_diacritic',
- 'uchar_east_asian_width',
- 'uchar_extender',
- 'uchar_full_composition_exclusion',
- 'uchar_general_category_mask',
- 'uchar_general_category',
- 'uchar_grapheme_base',
- 'uchar_grapheme_cluster_break',
- 'uchar_grapheme_extend',
- 'uchar_grapheme_link',
- 'uchar_hangul_syllable_type',
- 'uchar_hex_digit',
- 'uchar_hyphen',
- 'uchar_id_continue',
- 'uchar_ideographic',
- 'uchar_ids_binary_operator',
- 'uchar_ids_trinary_operator',
- 'uchar_iso_comment',
- 'uchar_join_control',
- 'uchar_joining_group',
- 'uchar_joining_type',
- 'uchar_lead_canonical_combining_class',
- 'uchar_line_break',
- 'uchar_logical_order_exception',
- 'uchar_lowercase_mapping',
- 'uchar_lowercase',
- 'uchar_math',
- 'uchar_name',
- 'uchar_nfc_inert',
- 'uchar_nfc_quick_check',
- 'uchar_nfd_inert',
- 'uchar_nfd_quick_check',
- 'uchar_nfkc_inert',
- 'uchar_nfkc_quick_check',
- 'uchar_nfkd_inert',
- 'uchar_nfkd_quick_check',
- 'uchar_noncharacter_code_point',
- 'uchar_numeric_type',
- 'uchar_numeric_value',
- 'uchar_pattern_syntax',
- 'uchar_pattern_white_space',
- 'uchar_posix_alnum',
- 'uchar_posix_blank',
- 'uchar_posix_graph',
- 'uchar_posix_print',
- 'uchar_posix_xdigit',
- 'uchar_quotation_mark',
- 'uchar_radical',
- 'uchar_s_term',
- 'uchar_script',
- 'uchar_segment_starter',
- 'uchar_sentence_break',
- 'uchar_simple_case_folding',
- 'uchar_simple_lowercase_mapping',
- 'uchar_simple_titlecase_mapping',
- 'uchar_simple_uppercase_mapping',
- 'uchar_soft_dotted',
- 'uchar_terminal_punctuation',
- 'uchar_titlecase_mapping',
- 'uchar_trail_canonical_combining_class',
- 'uchar_unicode_1_name',
- 'uchar_unified_ideograph',
- 'uchar_uppercase_mapping',
- 'uchar_uppercase',
- 'uchar_variation_selector',
- 'uchar_white_space',
- 'uchar_word_break',
- 'uchar_xid_continue',
- 'uncompress',
- 'usage',
- 'uuid_compare',
- 'uuid_copy',
- 'uuid_generate_random',
- 'uuid_generate_time',
- 'uuid_generate',
- 'uuid_is_null',
- 'uuid_parse',
- 'uuid_unparse_lower',
- 'uuid_unparse_upper',
- 'uuid_unparse',
- 'value_list',
- 'value_listitem',
- 'valuelistitem',
- 'var_keys',
- 'var_values',
- 'wap_isenabled',
- 'wap_maxbuttons',
- 'wap_maxcolumns',
- 'wap_maxhorzpixels',
- 'wap_maxrows',
- 'wap_maxvertpixels',
- 'web_handlefcgirequest',
- 'web_node_content_representation_css',
- 'web_node_content_representation_html',
- 'web_node_content_representation_js',
- 'web_node_content_representation_xhr',
- 'web_node_forpath',
- 'web_nodes_initialize',
- 'web_nodes_normalizeextension',
- 'web_nodes_processcontentnode',
- 'web_nodes_requesthandler',
- 'web_response_nodesentry',
- 'web_router_database',
- 'web_router_initialize',
- 'websocket_handler_timeout',
- 'wexitstatus',
- 'wifcontinued',
- 'wifexited',
- 'wifsignaled',
- 'wifstopped',
- 'wstopsig',
- 'wtermsig',
- 'xml_transform',
- 'xml',
- 'zip_add_dir',
- 'zip_add',
- 'zip_checkcons',
- 'zip_close',
- 'zip_cm_bzip2',
- 'zip_cm_default',
- 'zip_cm_deflate',
- 'zip_cm_deflate64',
- 'zip_cm_implode',
- 'zip_cm_pkware_implode',
- 'zip_cm_reduce_1',
- 'zip_cm_reduce_2',
- 'zip_cm_reduce_3',
- 'zip_cm_reduce_4',
- 'zip_cm_shrink',
- 'zip_cm_store',
- 'zip_create',
- 'zip_delete',
- 'zip_em_3des_112',
- 'zip_em_3des_168',
- 'zip_em_aes_128',
- 'zip_em_aes_192',
- 'zip_em_aes_256',
- 'zip_em_des',
- 'zip_em_none',
- 'zip_em_rc2_old',
- 'zip_em_rc2',
- 'zip_em_rc4',
- 'zip_em_trad_pkware',
- 'zip_em_unknown',
- 'zip_er_changed',
- 'zip_er_close',
- 'zip_er_compnotsupp',
- 'zip_er_crc',
- 'zip_er_deleted',
- 'zip_er_eof',
- 'zip_er_exists',
- 'zip_er_incons',
- 'zip_er_internal',
- 'zip_er_inval',
- 'zip_er_memory',
- 'zip_er_multidisk',
- 'zip_er_noent',
- 'zip_er_nozip',
- 'zip_er_ok',
- 'zip_er_open',
- 'zip_er_read',
- 'zip_er_remove',
- 'zip_er_rename',
- 'zip_er_seek',
- 'zip_er_tmpopen',
- 'zip_er_write',
- 'zip_er_zipclosed',
- 'zip_er_zlib',
- 'zip_error_get_sys_type',
- 'zip_error_get',
- 'zip_error_to_str',
- 'zip_et_none',
- 'zip_et_sys',
- 'zip_et_zlib',
- 'zip_excl',
- 'zip_fclose',
- 'zip_file_error_get',
- 'zip_file_strerror',
- 'zip_fl_compressed',
- 'zip_fl_nocase',
- 'zip_fl_nodir',
- 'zip_fl_unchanged',
- 'zip_fopen_index',
- 'zip_fopen',
- 'zip_fread',
- 'zip_get_archive_comment',
- 'zip_get_file_comment',
- 'zip_get_name',
- 'zip_get_num_files',
- 'zip_name_locate',
- 'zip_open',
- 'zip_rename',
- 'zip_replace',
- 'zip_set_archive_comment',
- 'zip_set_file_comment',
- 'zip_stat_index',
- 'zip_stat',
- 'zip_strerror',
- 'zip_unchange_all',
- 'zip_unchange_archive',
- 'zip_unchange',
- 'zlib_version',
- ),
- 'Lasso 8 Tags': (
- '__char',
- '__sync_timestamp__',
- '_admin_addgroup',
- '_admin_adduser',
- '_admin_defaultconnector',
- '_admin_defaultconnectornames',
- '_admin_defaultdatabase',
- '_admin_defaultfield',
- '_admin_defaultgroup',
- '_admin_defaulthost',
- '_admin_defaulttable',
- '_admin_defaultuser',
- '_admin_deleteconnector',
- '_admin_deletedatabase',
- '_admin_deletefield',
- '_admin_deletegroup',
- '_admin_deletehost',
- '_admin_deletetable',
- '_admin_deleteuser',
- '_admin_duplicategroup',
- '_admin_internaldatabase',
- '_admin_listconnectors',
- '_admin_listdatabases',
- '_admin_listfields',
- '_admin_listgroups',
- '_admin_listhosts',
- '_admin_listtables',
- '_admin_listusers',
- '_admin_refreshconnector',
- '_admin_refreshsecurity',
- '_admin_servicepath',
- '_admin_updateconnector',
- '_admin_updatedatabase',
- '_admin_updatefield',
- '_admin_updategroup',
- '_admin_updatehost',
- '_admin_updatetable',
- '_admin_updateuser',
- '_chartfx_activation_string',
- '_chartfx_getchallengestring',
- '_chop_args',
- '_chop_mimes',
- '_client_addr_old',
- '_client_address_old',
- '_client_ip_old',
- '_database_names',
- '_datasource_reload',
- '_date_current',
- '_date_format',
- '_date_msec',
- '_date_parse',
- '_execution_timelimit',
- '_file_chmod',
- '_initialize',
- '_jdbc_acceptsurl',
- '_jdbc_debug',
- '_jdbc_deletehost',
- '_jdbc_driverclasses',
- '_jdbc_driverinfo',
- '_jdbc_metainfo',
- '_jdbc_propertyinfo',
- '_jdbc_setdriver',
- '_lasso_param',
- '_log_helper',
- '_proc_noparam',
- '_proc_withparam',
- '_recursion_limit',
- '_request_param',
- '_security_binaryexpiration',
- '_security_flushcaches',
- '_security_isserialized',
- '_security_serialexpiration',
- '_srand',
- '_strict_literals',
- '_substring',
- '_xmlrpc_exconverter',
- '_xmlrpc_inconverter',
- '_xmlrpc_xmlinconverter',
- 'abort',
- 'action_addinfo',
- 'action_addrecord',
- 'action_param',
- 'action_params',
- 'action_setfoundcount',
- 'action_setrecordid',
- 'action_settotalcount',
- 'action_statement',
- 'admin_allowedfileroots',
- 'admin_changeuser',
- 'admin_createuser',
- 'admin_currentgroups',
- 'admin_currentuserid',
- 'admin_currentusername',
- 'admin_getpref',
- 'admin_groupassignuser',
- 'admin_grouplistusers',
- 'admin_groupremoveuser',
- 'admin_lassoservicepath',
- 'admin_listgroups',
- 'admin_refreshlicensing',
- 'admin_refreshsecurity',
- 'admin_reloaddatasource',
- 'admin_removepref',
- 'admin_setpref',
- 'admin_userexists',
- 'admin_userlistgroups',
- 'all',
- 'and',
- 'array',
- 'array_iterator',
- 'auth',
- 'auth_admin',
- 'auth_auth',
- 'auth_custom',
- 'auth_group',
- 'auth_prompt',
- 'auth_user',
- 'base64',
- 'bean',
- 'bigint',
- 'bom_utf16be',
- 'bom_utf16le',
- 'bom_utf32be',
- 'bom_utf32le',
- 'bom_utf8',
- 'boolean',
- 'bw',
- 'bytes',
- 'cache',
- 'cache_delete',
- 'cache_empty',
- 'cache_exists',
- 'cache_fetch',
- 'cache_internal',
- 'cache_maintenance',
- 'cache_object',
- 'cache_preferences',
- 'cache_store',
- 'case',
- 'chartfx',
- 'chartfx_records',
- 'chartfx_serve',
- 'checked',
- 'choice_list',
- 'choice_listitem',
- 'choicelistitem',
- 'cipher_decrypt',
- 'cipher_digest',
- 'cipher_encrypt',
- 'cipher_hmac',
- 'cipher_keylength',
- 'cipher_list',
- 'click_text',
- 'client_addr',
- 'client_address',
- 'client_authorization',
- 'client_browser',
- 'client_contentlength',
- 'client_contenttype',
- 'client_cookielist',
- 'client_cookies',
- 'client_encoding',
- 'client_formmethod',
- 'client_getargs',
- 'client_getparams',
- 'client_headers',
- 'client_ip',
- 'client_ipfrominteger',
- 'client_iptointeger',
- 'client_password',
- 'client_postargs',
- 'client_postparams',
- 'client_type',
- 'client_url',
- 'client_username',
- 'cn',
- 'column',
- 'column_name',
- 'column_names',
- 'compare_beginswith',
- 'compare_contains',
- 'compare_endswith',
- 'compare_equalto',
- 'compare_greaterthan',
- 'compare_greaterthanorequals',
- 'compare_greaterthanorequls',
- 'compare_lessthan',
- 'compare_lessthanorequals',
- 'compare_notbeginswith',
- 'compare_notcontains',
- 'compare_notendswith',
- 'compare_notequalto',
- 'compare_notregexp',
- 'compare_regexp',
- 'compare_strictequalto',
- 'compare_strictnotequalto',
- 'compiler_removecacheddoc',
- 'compiler_setdefaultparserflags',
- 'compress',
- 'content_body',
- 'content_encoding',
- 'content_header',
- 'content_type',
- 'cookie',
- 'cookie_set',
- 'curl_ftp_getfile',
- 'curl_ftp_getlisting',
- 'curl_ftp_putfile',
- 'curl_include_url',
- 'currency',
- 'database_changecolumn',
- 'database_changefield',
- 'database_createcolumn',
- 'database_createfield',
- 'database_createtable',
- 'database_fmcontainer',
- 'database_hostinfo',
- 'database_inline',
- 'database_name',
- 'database_nameitem',
- 'database_names',
- 'database_realname',
- 'database_removecolumn',
- 'database_removefield',
- 'database_removetable',
- 'database_repeating',
- 'database_repeating_valueitem',
- 'database_repeatingvalueitem',
- 'database_schemanameitem',
- 'database_schemanames',
- 'database_tablecolumn',
- 'database_tablenameitem',
- 'database_tablenames',
- 'datasource_name',
- 'datasource_register',
- 'date',
- 'date__date_current',
- 'date__date_format',
- 'date__date_msec',
- 'date__date_parse',
- 'date_add',
- 'date_date',
- 'date_difference',
- 'date_duration',
- 'date_format',
- 'date_getcurrentdate',
- 'date_getday',
- 'date_getdayofweek',
- 'date_gethour',
- 'date_getlocaltimezone',
- 'date_getminute',
- 'date_getmonth',
- 'date_getsecond',
- 'date_gettime',
- 'date_getyear',
- 'date_gmttolocal',
- 'date_localtogmt',
- 'date_maximum',
- 'date_minimum',
- 'date_msec',
- 'date_setformat',
- 'date_subtract',
- 'db_layoutnameitem',
- 'db_layoutnames',
- 'db_nameitem',
- 'db_names',
- 'db_tablenameitem',
- 'db_tablenames',
- 'dbi_column_names',
- 'dbi_field_names',
- 'decimal',
- 'decimal_setglobaldefaultprecision',
- 'decode_base64',
- 'decode_bheader',
- 'decode_hex',
- 'decode_html',
- 'decode_json',
- 'decode_qheader',
- 'decode_quotedprintable',
- 'decode_quotedprintablebytes',
- 'decode_url',
- 'decode_xml',
- 'decompress',
- 'decrypt_blowfish',
- 'decrypt_blowfish2',
- 'default',
- 'define_atbegin',
- 'define_atend',
- 'define_constant',
- 'define_prototype',
- 'define_tag',
- 'define_tagp',
- 'define_type',
- 'define_typep',
- 'deserialize',
- 'directory_directorynameitem',
- 'directory_lister',
- 'directory_nameitem',
- 'directorynameitem',
- 'dns_default',
- 'dns_lookup',
- 'dns_response',
- 'duration',
- 'else',
- 'email_batch',
- 'email_compose',
- 'email_digestchallenge',
- 'email_digestresponse',
- 'email_extract',
- 'email_findemails',
- 'email_immediate',
- 'email_merge',
- 'email_mxerror',
- 'email_mxlookup',
- 'email_parse',
- 'email_pop',
- 'email_queue',
- 'email_result',
- 'email_safeemail',
- 'email_send',
- 'email_smtp',
- 'email_status',
- 'email_token',
- 'email_translatebreakstocrlf',
- 'encode_base64',
- 'encode_bheader',
- 'encode_break',
- 'encode_breaks',
- 'encode_crc32',
- 'encode_hex',
- 'encode_html',
- 'encode_htmltoxml',
- 'encode_json',
- 'encode_qheader',
- 'encode_quotedprintable',
- 'encode_quotedprintablebytes',
- 'encode_set',
- 'encode_smart',
- 'encode_sql',
- 'encode_sql92',
- 'encode_stricturl',
- 'encode_url',
- 'encode_xml',
- 'encrypt_blowfish',
- 'encrypt_blowfish2',
- 'encrypt_crammd5',
- 'encrypt_hmac',
- 'encrypt_md5',
- 'eq',
- 'error_adderror',
- 'error_code',
- 'error_code_aborted',
- 'error_code_assert',
- 'error_code_bof',
- 'error_code_connectioninvalid',
- 'error_code_couldnotclosefile',
- 'error_code_couldnotcreateoropenfile',
- 'error_code_couldnotdeletefile',
- 'error_code_couldnotdisposememory',
- 'error_code_couldnotlockmemory',
- 'error_code_couldnotreadfromfile',
- 'error_code_couldnotunlockmemory',
- 'error_code_couldnotwritetofile',
- 'error_code_criterianotmet',
- 'error_code_datasourceerror',
- 'error_code_directoryfull',
- 'error_code_diskfull',
- 'error_code_dividebyzero',
- 'error_code_eof',
- 'error_code_failure',
- 'error_code_fieldrestriction',
- 'error_code_file',
- 'error_code_filealreadyexists',
- 'error_code_filecorrupt',
- 'error_code_fileinvalid',
- 'error_code_fileinvalidaccessmode',
- 'error_code_fileisclosed',
- 'error_code_fileisopen',
- 'error_code_filelocked',
- 'error_code_filenotfound',
- 'error_code_fileunlocked',
- 'error_code_httpfilenotfound',
- 'error_code_illegalinstruction',
- 'error_code_illegaluseoffrozeninstance',
- 'error_code_invaliddatabase',
- 'error_code_invalidfilename',
- 'error_code_invalidmemoryobject',
- 'error_code_invalidparameter',
- 'error_code_invalidpassword',
- 'error_code_invalidpathname',
- 'error_code_invalidusername',
- 'error_code_ioerror',
- 'error_code_loopaborted',
- 'error_code_memory',
- 'error_code_network',
- 'error_code_nilpointer',
- 'error_code_noerr',
- 'error_code_nopermission',
- 'error_code_outofmemory',
- 'error_code_outofstackspace',
- 'error_code_overflow',
- 'error_code_postconditionfailed',
- 'error_code_preconditionfailed',
- 'error_code_resnotfound',
- 'error_code_resource',
- 'error_code_streamreaderror',
- 'error_code_streamwriteerror',
- 'error_code_syntaxerror',
- 'error_code_tagnotfound',
- 'error_code_unknownerror',
- 'error_code_varnotfound',
- 'error_code_volumedoesnotexist',
- 'error_code_webactionnotsupported',
- 'error_code_webadderror',
- 'error_code_webdeleteerror',
- 'error_code_webmodulenotfound',
- 'error_code_webnosuchobject',
- 'error_code_webrepeatingrelatedfield',
- 'error_code_webrequiredfieldmissing',
- 'error_code_webtimeout',
- 'error_code_webupdateerror',
- 'error_columnrestriction',
- 'error_currenterror',
- 'error_databaseconnectionunavailable',
- 'error_databasetimeout',
- 'error_deleteerror',
- 'error_fieldrestriction',
- 'error_filenotfound',
- 'error_invaliddatabase',
- 'error_invalidpassword',
- 'error_invalidusername',
- 'error_modulenotfound',
- 'error_msg',
- 'error_msg_aborted',
- 'error_msg_assert',
- 'error_msg_bof',
- 'error_msg_connectioninvalid',
- 'error_msg_couldnotclosefile',
- 'error_msg_couldnotcreateoropenfile',
- 'error_msg_couldnotdeletefile',
- 'error_msg_couldnotdisposememory',
- 'error_msg_couldnotlockmemory',
- 'error_msg_couldnotreadfromfile',
- 'error_msg_couldnotunlockmemory',
- 'error_msg_couldnotwritetofile',
- 'error_msg_criterianotmet',
- 'error_msg_datasourceerror',
- 'error_msg_directoryfull',
- 'error_msg_diskfull',
- 'error_msg_dividebyzero',
- 'error_msg_eof',
- 'error_msg_failure',
- 'error_msg_fieldrestriction',
- 'error_msg_file',
- 'error_msg_filealreadyexists',
- 'error_msg_filecorrupt',
- 'error_msg_fileinvalid',
- 'error_msg_fileinvalidaccessmode',
- 'error_msg_fileisclosed',
- 'error_msg_fileisopen',
- 'error_msg_filelocked',
- 'error_msg_filenotfound',
- 'error_msg_fileunlocked',
- 'error_msg_httpfilenotfound',
- 'error_msg_illegalinstruction',
- 'error_msg_illegaluseoffrozeninstance',
- 'error_msg_invaliddatabase',
- 'error_msg_invalidfilename',
- 'error_msg_invalidmemoryobject',
- 'error_msg_invalidparameter',
- 'error_msg_invalidpassword',
- 'error_msg_invalidpathname',
- 'error_msg_invalidusername',
- 'error_msg_ioerror',
- 'error_msg_loopaborted',
- 'error_msg_memory',
- 'error_msg_network',
- 'error_msg_nilpointer',
- 'error_msg_noerr',
- 'error_msg_nopermission',
- 'error_msg_outofmemory',
- 'error_msg_outofstackspace',
- 'error_msg_overflow',
- 'error_msg_postconditionfailed',
- 'error_msg_preconditionfailed',
- 'error_msg_resnotfound',
- 'error_msg_resource',
- 'error_msg_streamreaderror',
- 'error_msg_streamwriteerror',
- 'error_msg_syntaxerror',
- 'error_msg_tagnotfound',
- 'error_msg_unknownerror',
- 'error_msg_varnotfound',
- 'error_msg_volumedoesnotexist',
- 'error_msg_webactionnotsupported',
- 'error_msg_webadderror',
- 'error_msg_webdeleteerror',
- 'error_msg_webmodulenotfound',
- 'error_msg_webnosuchobject',
- 'error_msg_webrepeatingrelatedfield',
- 'error_msg_webrequiredfieldmissing',
- 'error_msg_webtimeout',
- 'error_msg_webupdateerror',
- 'error_noerror',
- 'error_nopermission',
- 'error_norecordsfound',
- 'error_outofmemory',
- 'error_pop',
- 'error_push',
- 'error_reqcolumnmissing',
- 'error_reqfieldmissing',
- 'error_requiredcolumnmissing',
- 'error_requiredfieldmissing',
- 'error_reset',
- 'error_seterrorcode',
- 'error_seterrormessage',
- 'error_updateerror',
- 'euro',
- 'event_schedule',
- 'ew',
- 'fail',
- 'fail_if',
- 'false',
- 'field',
- 'field_name',
- 'field_names',
- 'file',
- 'file_autoresolvefullpaths',
- 'file_chmod',
- 'file_control',
- 'file_copy',
- 'file_create',
- 'file_creationdate',
- 'file_currenterror',
- 'file_delete',
- 'file_exists',
- 'file_getlinecount',
- 'file_getsize',
- 'file_isdirectory',
- 'file_listdirectory',
- 'file_moddate',
- 'file_modechar',
- 'file_modeline',
- 'file_move',
- 'file_openread',
- 'file_openreadwrite',
- 'file_openwrite',
- 'file_openwriteappend',
- 'file_openwritetruncate',
- 'file_probeeol',
- 'file_processuploads',
- 'file_read',
- 'file_readline',
- 'file_rename',
- 'file_serve',
- 'file_setsize',
- 'file_stream',
- 'file_streamcopy',
- 'file_uploads',
- 'file_waitread',
- 'file_waittimeout',
- 'file_waitwrite',
- 'file_write',
- 'find_soap_ops',
- 'form_param',
- 'found_count',
- 'ft',
- 'ftp_getfile',
- 'ftp_getlisting',
- 'ftp_putfile',
- 'full',
- 'global',
- 'global_defined',
- 'global_remove',
- 'global_reset',
- 'globals',
- 'gt',
- 'gte',
- 'handle',
- 'handle_error',
- 'header',
- 'html_comment',
- 'http_getfile',
- 'ical_alarm',
- 'ical_attribute',
- 'ical_calendar',
- 'ical_daylight',
- 'ical_event',
- 'ical_freebusy',
- 'ical_item',
- 'ical_journal',
- 'ical_parse',
- 'ical_standard',
- 'ical_timezone',
- 'ical_todo',
- 'if',
- 'if_empty',
- 'if_false',
- 'if_null',
- 'if_true',
- 'image',
- 'image_url',
- 'img',
- 'include',
- 'include_cgi',
- 'include_currentpath',
- 'include_once',
- 'include_raw',
- 'include_url',
- 'inline',
- 'integer',
- 'iterate',
- 'iterator',
- 'java',
- 'java_bean',
- 'json_records',
- 'json_rpccall',
- 'keycolumn_name',
- 'keycolumn_value',
- 'keyfield_name',
- 'keyfield_value',
- 'lasso_comment',
- 'lasso_currentaction',
- 'lasso_datasourceis',
- 'lasso_datasourceis4d',
- 'lasso_datasourceisfilemaker',
- 'lasso_datasourceisfilemaker7',
- 'lasso_datasourceisfilemaker9',
- 'lasso_datasourceisfilemakersa',
- 'lasso_datasourceisjdbc',
- 'lasso_datasourceislassomysql',
- 'lasso_datasourceismysql',
- 'lasso_datasourceisodbc',
- 'lasso_datasourceisopenbase',
- 'lasso_datasourceisoracle',
- 'lasso_datasourceispostgresql',
- 'lasso_datasourceisspotlight',
- 'lasso_datasourceissqlite',
- 'lasso_datasourceissqlserver',
- 'lasso_datasourcemodulename',
- 'lasso_datatype',
- 'lasso_disableondemand',
- 'lasso_errorreporting',
- 'lasso_executiontimelimit',
- 'lasso_parser',
- 'lasso_process',
- 'lasso_sessionid',
- 'lasso_siteid',
- 'lasso_siteisrunning',
- 'lasso_sitename',
- 'lasso_siterestart',
- 'lasso_sitestart',
- 'lasso_sitestop',
- 'lasso_tagexists',
- 'lasso_tagmodulename',
- 'lasso_uniqueid',
- 'lasso_updatecheck',
- 'lasso_uptime',
- 'lasso_version',
- 'lassoapp_create',
- 'lassoapp_dump',
- 'lassoapp_flattendir',
- 'lassoapp_getappdata',
- 'lassoapp_link',
- 'lassoapp_list',
- 'lassoapp_process',
- 'lassoapp_unitize',
- 'layout_name',
- 'ldap',
- 'ldap_scope_base',
- 'ldap_scope_onelevel',
- 'ldap_scope_subtree',
- 'ldml',
- 'ldml_ldml',
- 'library',
- 'library_once',
- 'link',
- 'link_currentaction',
- 'link_currentactionparams',
- 'link_currentactionurl',
- 'link_currentgroup',
- 'link_currentgroupparams',
- 'link_currentgroupurl',
- 'link_currentrecord',
- 'link_currentrecordparams',
- 'link_currentrecordurl',
- 'link_currentsearch',
- 'link_currentsearchparams',
- 'link_currentsearchurl',
- 'link_detail',
- 'link_detailparams',
- 'link_detailurl',
- 'link_firstgroup',
- 'link_firstgroupparams',
- 'link_firstgroupurl',
- 'link_firstrecord',
- 'link_firstrecordparams',
- 'link_firstrecordurl',
- 'link_lastgroup',
- 'link_lastgroupparams',
- 'link_lastgroupurl',
- 'link_lastrecord',
- 'link_lastrecordparams',
- 'link_lastrecordurl',
- 'link_nextgroup',
- 'link_nextgroupparams',
- 'link_nextgroupurl',
- 'link_nextrecord',
- 'link_nextrecordparams',
- 'link_nextrecordurl',
- 'link_params',
- 'link_prevgroup',
- 'link_prevgroupparams',
- 'link_prevgroupurl',
- 'link_prevrecord',
- 'link_prevrecordparams',
- 'link_prevrecordurl',
- 'link_setformat',
- 'link_url',
- 'list',
- 'list_additem',
- 'list_fromlist',
- 'list_fromstring',
- 'list_getitem',
- 'list_itemcount',
- 'list_iterator',
- 'list_removeitem',
- 'list_replaceitem',
- 'list_reverseiterator',
- 'list_tostring',
- 'literal',
- 'ljax_end',
- 'ljax_hastarget',
- 'ljax_include',
- 'ljax_start',
- 'ljax_target',
- 'local',
- 'local_defined',
- 'local_remove',
- 'local_reset',
- 'locale_format',
- 'locals',
- 'log',
- 'log_always',
- 'log_critical',
- 'log_deprecated',
- 'log_destination_console',
- 'log_destination_database',
- 'log_destination_file',
- 'log_detail',
- 'log_level_critical',
- 'log_level_deprecated',
- 'log_level_detail',
- 'log_level_sql',
- 'log_level_warning',
- 'log_setdestination',
- 'log_sql',
- 'log_warning',
- 'logicalop_value',
- 'logicaloperator_value',
- 'loop',
- 'loop_abort',
- 'loop_continue',
- 'loop_count',
- 'lt',
- 'lte',
- 'magick_image',
- 'map',
- 'map_iterator',
- 'match_comparator',
- 'match_notrange',
- 'match_notregexp',
- 'match_range',
- 'match_regexp',
- 'math_abs',
- 'math_acos',
- 'math_add',
- 'math_asin',
- 'math_atan',
- 'math_atan2',
- 'math_ceil',
- 'math_converteuro',
- 'math_cos',
- 'math_div',
- 'math_exp',
- 'math_floor',
- 'math_internal_rand',
- 'math_internal_randmax',
- 'math_internal_srand',
- 'math_ln',
- 'math_log',
- 'math_log10',
- 'math_max',
- 'math_min',
- 'math_mod',
- 'math_mult',
- 'math_pow',
- 'math_random',
- 'math_range',
- 'math_rint',
- 'math_roman',
- 'math_round',
- 'math_sin',
- 'math_sqrt',
- 'math_sub',
- 'math_tan',
- 'maxrecords_value',
- 'memory_session_driver',
- 'mime_type',
- 'minimal',
- 'misc__srand',
- 'misc_randomnumber',
- 'misc_roman',
- 'misc_valid_creditcard',
- 'mysql_session_driver',
- 'named_param',
- 'namespace_current',
- 'namespace_delimiter',
- 'namespace_exists',
- 'namespace_file_fullpathexists',
- 'namespace_global',
- 'namespace_import',
- 'namespace_load',
- 'namespace_page',
- 'namespace_unload',
- 'namespace_using',
- 'neq',
- 'net',
- 'net_connectinprogress',
- 'net_connectok',
- 'net_typessl',
- 'net_typessltcp',
- 'net_typessludp',
- 'net_typetcp',
- 'net_typeudp',
- 'net_waitread',
- 'net_waittimeout',
- 'net_waitwrite',
- 'no_default_output',
- 'none',
- 'noprocess',
- 'not',
- 'nrx',
- 'nslookup',
- 'null',
- 'object',
- 'once',
- 'oneoff',
- 'op_logicalvalue',
- 'operator_logicalvalue',
- 'option',
- 'or',
- 'os_process',
- 'output',
- 'output_none',
- 'pair',
- 'params_up',
- 'pdf_barcode',
- 'pdf_color',
- 'pdf_doc',
- 'pdf_font',
- 'pdf_image',
- 'pdf_list',
- 'pdf_read',
- 'pdf_serve',
- 'pdf_table',
- 'pdf_text',
- 'percent',
- 'portal',
- 'postcondition',
- 'precondition',
- 'prettyprintingnsmap',
- 'prettyprintingtypemap',
- 'priorityqueue',
- 'private',
- 'proc_convert',
- 'proc_convertbody',
- 'proc_convertone',
- 'proc_extract',
- 'proc_extractone',
- 'proc_find',
- 'proc_first',
- 'proc_foreach',
- 'proc_get',
- 'proc_join',
- 'proc_lasso',
- 'proc_last',
- 'proc_map_entry',
- 'proc_null',
- 'proc_regexp',
- 'proc_xml',
- 'proc_xslt',
- 'process',
- 'protect',
- 'queue',
- 'rand',
- 'randomnumber',
- 'raw',
- 'recid_value',
- 'record_count',
- 'recordcount',
- 'recordid_value',
- 'records',
- 'records_array',
- 'records_map',
- 'redirect_url',
- 'reference',
- 'referer',
- 'referer_url',
- 'referrer',
- 'referrer_url',
- 'regexp',
- 'repeating',
- 'repeating_valueitem',
- 'repeatingvalueitem',
- 'repetition',
- 'req_column',
- 'req_field',
- 'required_column',
- 'required_field',
- 'response_fileexists',
- 'response_filepath',
- 'response_localpath',
- 'response_path',
- 'response_realm',
- 'resultset',
- 'resultset_count',
- 'return',
- 'return_value',
- 'reverseiterator',
- 'roman',
- 'row_count',
- 'rows',
- 'rows_array',
- 'run_children',
- 'rx',
- 'schema_name',
- 'scientific',
- 'search_args',
- 'search_arguments',
- 'search_columnitem',
- 'search_fielditem',
- 'search_operatoritem',
- 'search_opitem',
- 'search_valueitem',
- 'searchfielditem',
- 'searchoperatoritem',
- 'searchopitem',
- 'searchvalueitem',
- 'select',
- 'selected',
- 'self',
- 'serialize',
- 'series',
- 'server_date',
- 'server_day',
- 'server_ip',
- 'server_name',
- 'server_port',
- 'server_push',
- 'server_siteisrunning',
- 'server_sitestart',
- 'server_sitestop',
- 'server_time',
- 'session_abort',
- 'session_addoutputfilter',
- 'session_addvar',
- 'session_addvariable',
- 'session_deleteexpired',
- 'session_driver',
- 'session_end',
- 'session_id',
- 'session_removevar',
- 'session_removevariable',
- 'session_result',
- 'session_setdriver',
- 'session_start',
- 'set',
- 'set_iterator',
- 'set_reverseiterator',
- 'shown_count',
- 'shown_first',
- 'shown_last',
- 'site_atbegin',
- 'site_id',
- 'site_name',
- 'site_restart',
- 'skiprecords_value',
- 'sleep',
- 'soap_convertpartstopairs',
- 'soap_definetag',
- 'soap_info',
- 'soap_lastrequest',
- 'soap_lastresponse',
- 'soap_stub',
- 'sort_args',
- 'sort_arguments',
- 'sort_columnitem',
- 'sort_fielditem',
- 'sort_orderitem',
- 'sortcolumnitem',
- 'sortfielditem',
- 'sortorderitem',
- 'sqlite_createdb',
- 'sqlite_session_driver',
- 'sqlite_setsleepmillis',
- 'sqlite_setsleeptries',
- 'srand',
- 'stack',
- 'stock_quote',
- 'string',
- 'string_charfromname',
- 'string_concatenate',
- 'string_countfields',
- 'string_endswith',
- 'string_extract',
- 'string_findposition',
- 'string_findregexp',
- 'string_fordigit',
- 'string_getfield',
- 'string_getunicodeversion',
- 'string_insert',
- 'string_isalpha',
- 'string_isalphanumeric',
- 'string_isdigit',
- 'string_ishexdigit',
- 'string_islower',
- 'string_isnumeric',
- 'string_ispunctuation',
- 'string_isspace',
- 'string_isupper',
- 'string_length',
- 'string_lowercase',
- 'string_remove',
- 'string_removeleading',
- 'string_removetrailing',
- 'string_replace',
- 'string_replaceregexp',
- 'string_todecimal',
- 'string_tointeger',
- 'string_uppercase',
- 'string_validcharset',
- 'table_name',
- 'table_realname',
- 'tag',
- 'tag_name',
- 'tags',
- 'tags_find',
- 'tags_list',
- 'tcp_close',
- 'tcp_open',
- 'tcp_send',
- 'tcp_tcp_close',
- 'tcp_tcp_open',
- 'tcp_tcp_send',
- 'thread_abort',
- 'thread_atomic',
- 'thread_event',
- 'thread_exists',
- 'thread_getcurrentid',
- 'thread_getpriority',
- 'thread_info',
- 'thread_list',
- 'thread_lock',
- 'thread_pipe',
- 'thread_priority_default',
- 'thread_priority_high',
- 'thread_priority_low',
- 'thread_rwlock',
- 'thread_semaphore',
- 'thread_setpriority',
- 'token_value',
- 'total_records',
- 'treemap',
- 'treemap_iterator',
- 'true',
- 'url_rewrite',
- 'valid_creditcard',
- 'valid_date',
- 'valid_email',
- 'valid_url',
- 'value_list',
- 'value_listitem',
- 'valuelistitem',
- 'var',
- 'var_defined',
- 'var_remove',
- 'var_reset',
- 'var_set',
- 'variable',
- 'variable_defined',
- 'variable_set',
- 'variables',
- 'variant_count',
- 'vars',
- 'wap_isenabled',
- 'wap_maxbuttons',
- 'wap_maxcolumns',
- 'wap_maxhorzpixels',
- 'wap_maxrows',
- 'wap_maxvertpixels',
- 'while',
- 'wsdl_extract',
- 'wsdl_getbinding',
- 'wsdl_getbindingforoperation',
- 'wsdl_getbindingoperations',
- 'wsdl_getmessagenamed',
- 'wsdl_getmessageparts',
- 'wsdl_getmessagetriofromporttype',
- 'wsdl_getopbodystyle',
- 'wsdl_getopbodyuse',
- 'wsdl_getoperation',
- 'wsdl_getoplocation',
- 'wsdl_getopmessagetypes',
- 'wsdl_getopsoapaction',
- 'wsdl_getportaddress',
- 'wsdl_getportsforservice',
- 'wsdl_getporttype',
- 'wsdl_getporttypeoperation',
- 'wsdl_getservicedocumentation',
- 'wsdl_getservices',
- 'wsdl_gettargetnamespace',
- 'wsdl_issoapoperation',
- 'wsdl_listoperations',
- 'wsdl_maketest',
- 'xml',
- 'xml_extract',
- 'xml_rpc',
- 'xml_rpccall',
- 'xml_rw',
- 'xml_serve',
- 'xml_transform',
- 'xml_xml',
- 'xml_xmlstream',
- 'xmlstream',
- 'xsd_attribute',
- 'xsd_blankarraybase',
- 'xsd_blankbase',
- 'xsd_buildtype',
- 'xsd_cache',
- 'xsd_checkcardinality',
- 'xsd_continueall',
- 'xsd_continueannotation',
- 'xsd_continueany',
- 'xsd_continueanyattribute',
- 'xsd_continueattribute',
- 'xsd_continueattributegroup',
- 'xsd_continuechoice',
- 'xsd_continuecomplexcontent',
- 'xsd_continuecomplextype',
- 'xsd_continuedocumentation',
- 'xsd_continueextension',
- 'xsd_continuegroup',
- 'xsd_continuekey',
- 'xsd_continuelist',
- 'xsd_continuerestriction',
- 'xsd_continuesequence',
- 'xsd_continuesimplecontent',
- 'xsd_continuesimpletype',
- 'xsd_continueunion',
- 'xsd_deserialize',
- 'xsd_fullyqualifyname',
- 'xsd_generate',
- 'xsd_generateblankfromtype',
- 'xsd_generateblanksimpletype',
- 'xsd_generatetype',
- 'xsd_getschematype',
- 'xsd_issimpletype',
- 'xsd_loadschema',
- 'xsd_lookupnamespaceuri',
- 'xsd_lookuptype',
- 'xsd_processany',
- 'xsd_processattribute',
- 'xsd_processattributegroup',
- 'xsd_processcomplextype',
- 'xsd_processelement',
- 'xsd_processgroup',
- 'xsd_processimport',
- 'xsd_processinclude',
- 'xsd_processschema',
- 'xsd_processsimpletype',
- 'xsd_ref',
- 'xsd_type',
- )
-}
-MEMBERS = {
- 'Member Methods': (
- 'abort',
- 'abs',
- 'accept_charset',
- 'accept',
- 'acceptconnections',
- 'acceptdeserializedelement',
- 'acceptnossl',
- 'acceptpost',
- 'accesskey',
- 'acos',
- 'acosh',
- 'action',
- 'actionparams',
- 'active_tick',
- 'add',
- 'addatend',
- 'addattachment',
- 'addbarcode',
- 'addchapter',
- 'addcheckbox',
- 'addcolumninfo',
- 'addcombobox',
- 'addcomment',
- 'addcomponent',
- 'addcomponents',
- 'addcss',
- 'adddatabasetable',
- 'adddatasource',
- 'adddatasourcedatabase',
- 'adddatasourcehost',
- 'adddir',
- 'adddirpath',
- 'addendjs',
- 'addendjstext',
- 'adderror',
- 'addfavicon',
- 'addfile',
- 'addgroup',
- 'addheader',
- 'addhiddenfield',
- 'addhtmlpart',
- 'addimage',
- 'addjavascript',
- 'addjs',
- 'addjstext',
- 'addlist',
- 'addmathfunctions',
- 'addmember',
- 'addoneheaderline',
- 'addpage',
- 'addparagraph',
- 'addpart',
- 'addpasswordfield',
- 'addphrase',
- 'addpostdispatch',
- 'addpredispatch',
- 'addradiobutton',
- 'addradiogroup',
- 'addresetbutton',
- 'addrow',
- 'addsection',
- 'addselectlist',
- 'addset',
- 'addsubmitbutton',
- 'addsubnode',
- 'addtable',
- 'addtask',
- 'addtext',
- 'addtextarea',
- 'addtextfield',
- 'addtextpart',
- 'addtobuffer',
- 'addtrait',
- 'adduser',
- 'addusertogroup',
- 'addwarning',
- 'addzip',
- 'allocobject',
- 'am',
- 'ampm',
- 'annotate',
- 'answer',
- 'apop',
- 'append',
- 'appendarray',
- 'appendarraybegin',
- 'appendarrayend',
- 'appendbool',
- 'appendbytes',
- 'appendchar',
- 'appendchild',
- 'appendcolon',
- 'appendcomma',
- 'appenddata',
- 'appenddatetime',
- 'appenddbpointer',
- 'appenddecimal',
- 'appenddocument',
- 'appendimagetolist',
- 'appendinteger',
- 'appendnowutc',
- 'appendnull',
- 'appendoid',
- 'appendregex',
- 'appendreplacement',
- 'appendstring',
- 'appendtail',
- 'appendtime',
- 'applyheatcolors',
- 'appmessage',
- 'appname',
- 'appprefix',
- 'appstatus',
- 'arc',
- 'archive',
- 'arguments',
- 'argumentvalue',
- 'asarray',
- 'asarraystring',
- 'asasync',
- 'asbytes',
- 'ascopy',
- 'ascopydeep',
- 'asdecimal',
- 'asgenerator',
- 'asin',
- 'asinh',
- 'asinteger',
- 'askeyedgenerator',
- 'aslazystring',
- 'aslist',
- 'asraw',
- 'asstaticarray',
- 'asstring',
- 'asstringhex',
- 'asstringoct',
- 'asxml',
- 'atan',
- 'atan2',
- 'atanh',
- 'atend',
- 'atends',
- 'atime',
- 'attributecount',
- 'attributes',
- 'attrs',
- 'auth',
- 'authenticate',
- 'authorize',
- 'autocollectbuffer',
- 'average',
- 'back',
- 'basename',
- 'basepaths',
- 'baseuri',
- 'bcc',
- 'beginssl',
- 'beginswith',
- 'begintls',
- 'bestcharset',
- 'bind_blob',
- 'bind_double',
- 'bind_int',
- 'bind_null',
- 'bind_parameter_index',
- 'bind_text',
- 'bind',
- 'bindcount',
- 'bindone',
- 'bindparam',
- 'bitand',
- 'bitclear',
- 'bitflip',
- 'bitformat',
- 'bitnot',
- 'bitor',
- 'bitset',
- 'bitshiftleft',
- 'bitshiftright',
- 'bittest',
- 'bitxor',
- 'blur',
- 'body',
- 'bodybytes',
- 'boundary',
- 'bptoxml',
- 'bptypetostr',
- 'bucketnumber',
- 'buff',
- 'buildquery',
- 'businessdaysbetween',
- 'by',
- 'bytes',
- 'cachedappprefix',
- 'cachedroot',
- 'callboolean',
- 'callbooleanmethod',
- 'callbytemethod',
- 'callcharmethod',
- 'calldoublemethod',
- 'calledname',
- 'callfirst',
- 'callfloat',
- 'callfloatmethod',
- 'callint',
- 'callintmethod',
- 'calllongmethod',
- 'callnonvirtualbooleanmethod',
- 'callnonvirtualbytemethod',
- 'callnonvirtualcharmethod',
- 'callnonvirtualdoublemethod',
- 'callnonvirtualfloatmethod',
- 'callnonvirtualintmethod',
- 'callnonvirtuallongmethod',
- 'callnonvirtualobjectmethod',
- 'callnonvirtualshortmethod',
- 'callnonvirtualvoidmethod',
- 'callobject',
- 'callobjectmethod',
- 'callshortmethod',
- 'callsite_col',
- 'callsite_file',
- 'callsite_line',
- 'callstack',
- 'callstaticboolean',
- 'callstaticbooleanmethod',
- 'callstaticbytemethod',
- 'callstaticcharmethod',
- 'callstaticdoublemethod',
- 'callstaticfloatmethod',
- 'callstaticint',
- 'callstaticintmethod',
- 'callstaticlongmethod',
- 'callstaticobject',
- 'callstaticobjectmethod',
- 'callstaticshortmethod',
- 'callstaticstring',
- 'callstaticvoidmethod',
- 'callstring',
- 'callvoid',
- 'callvoidmethod',
- 'cancel',
- 'cap',
- 'capa',
- 'capabilities',
- 'capi',
- 'cbrt',
- 'cc',
- 'ceil',
- 'chardigitvalue',
- 'charname',
- 'charset',
- 'chartype',
- 'checkdebugging',
- 'checked',
- 'checkuser',
- 'childnodes',
- 'chk',
- 'chmod',
- 'choosecolumntype',
- 'chown',
- 'chunked',
- 'circle',
- 'class',
- 'classid',
- 'clear',
- 'clonenode',
- 'close',
- 'closepath',
- 'closeprepared',
- 'closewrite',
- 'code',
- 'codebase',
- 'codetype',
- 'colmap',
- 'colorspace',
- 'column_blob',
- 'column_count',
- 'column_decltype',
- 'column_double',
- 'column_int64',
- 'column_name',
- 'column_text',
- 'column_type',
- 'command',
- 'comments',
- 'compare',
- 'comparecodepointorder',
- 'componentdelimiter',
- 'components',
- 'composite',
- 'compress',
- 'concat',
- 'condtoint',
- 'configureds',
- 'configuredskeys',
- 'connect',
- 'connection',
- 'connectionhandler',
- 'connhandler',
- 'consume_domain',
- 'consume_label',
- 'consume_message',
- 'consume_rdata',
- 'consume_string',
- 'contains',
- 'content_disposition',
- 'content_transfer_encoding',
- 'content_type',
- 'content',
- 'contentlength',
- 'contents',
- 'contenttype',
- 'continuation',
- 'continuationpacket',
- 'continuationpoint',
- 'continuationstack',
- 'continue',
- 'contrast',
- 'conventionaltop',
- 'convert',
- 'cookie',
- 'cookies',
- 'cookiesarray',
- 'cookiesary',
- 'copyto',
- 'cos',
- 'cosh',
- 'count',
- 'countkeys',
- 'country',
- 'countusersbygroup',
- 'crc',
- 'create',
- 'createattribute',
- 'createattributens',
- 'createcdatasection',
- 'createcomment',
- 'createdocument',
- 'createdocumentfragment',
- 'createdocumenttype',
- 'createelement',
- 'createelementns',
- 'createentityreference',
- 'createindex',
- 'createprocessinginstruction',
- 'createtable',
- 'createtextnode',
- 'criteria',
- 'crop',
- 'csscontent',
- 'curl',
- 'current',
- 'currentfile',
- 'curveto',
- 'd',
- 'data',
- 'databasecolumnnames',
- 'databasecolumns',
- 'databasemap',
- 'databasename',
- 'datasourcecolumnnames',
- 'datasourcecolumns',
- 'datasourcemap',
- 'date',
- 'day',
- 'dayofmonth',
- 'dayofweek',
- 'dayofweekinmonth',
- 'dayofyear',
- 'days',
- 'daysbetween',
- 'db',
- 'dbtablestable',
- 'debug',
- 'declare',
- 'decodebase64',
- 'decodehex',
- 'decodehtml',
- 'decodeqp',
- 'decodeurl',
- 'decodexml',
- 'decompose',
- 'decomposeassignment',
- 'defaultcontentrepresentation',
- 'defer',
- 'deg2rad',
- 'dele',
- 'delete',
- 'deletedata',
- 'deleteglobalref',
- 'deletelocalref',
- 'delim',
- 'depth',
- 'dereferencepointer',
- 'describe',
- 'description',
- 'deserialize',
- 'detach',
- 'detectcharset',
- 'didinclude',
- 'difference',
- 'digit',
- 'dir',
- 'displaycountry',
- 'displaylanguage',
- 'displayname',
- 'displayscript',
- 'displayvariant',
- 'div',
- 'dns_response',
- 'do',
- 'doatbegins',
- 'doatends',
- 'doccomment',
- 'doclose',
- 'doctype',
- 'document',
- 'documentelement',
- 'documentroot',
- 'domainbody',
- 'done',
- 'dosessions',
- 'dowithclose',
- 'dowlocal',
- 'download',
- 'drawtext',
- 'drop',
- 'dropindex',
- 'dsdbtable',
- 'dshoststable',
- 'dsinfo',
- 'dst',
- 'dstable',
- 'dstoffset',
- 'dtdid',
- 'dup',
- 'dup2',
- 'each',
- 'eachbyte',
- 'eachcharacter',
- 'eachchild',
- 'eachcomponent',
- 'eachdir',
- 'eachdirpath',
- 'eachdirpathrecursive',
- 'eachentry',
- 'eachfile',
- 'eachfilename',
- 'eachfilepath',
- 'eachfilepathrecursive',
- 'eachkey',
- 'eachline',
- 'eachlinebreak',
- 'eachmatch',
- 'eachnode',
- 'eachpair',
- 'eachpath',
- 'eachpathrecursive',
- 'eachrow',
- 'eachsub',
- 'eachword',
- 'eachwordbreak',
- 'element',
- 'eligiblepath',
- 'eligiblepaths',
- 'encodebase64',
- 'encodehex',
- 'encodehtml',
- 'encodehtmltoxml',
- 'encodemd5',
- 'encodepassword',
- 'encodeqp',
- 'encodesql',
- 'encodesql92',
- 'encodeurl',
- 'encodevalue',
- 'encodexml',
- 'encoding',
- 'enctype',
- 'end',
- 'endjs',
- 'endssl',
- 'endswith',
- 'endtls',
- 'enhance',
- 'ensurestopped',
- 'entities',
- 'entry',
- 'env',
- 'equals',
- 'era',
- 'erf',
- 'erfc',
- 'err',
- 'errcode',
- 'errmsg',
- 'error',
- 'errors',
- 'errstack',
- 'escape_member',
- 'establisherrorstate',
- 'exceptioncheck',
- 'exceptionclear',
- 'exceptiondescribe',
- 'exceptionoccurred',
- 'exchange',
- 'execinits',
- 'execinstalls',
- 'execute',
- 'executelazy',
- 'executenow',
- 'exists',
- 'exit',
- 'exitcode',
- 'exp',
- 'expire',
- 'expireminutes',
- 'expiresminutes',
- 'expm1',
- 'export16bits',
- 'export32bits',
- 'export64bits',
- 'export8bits',
- 'exportas',
- 'exportbytes',
- 'exportfdf',
- 'exportpointerbits',
- 'exportsigned16bits',
- 'exportsigned32bits',
- 'exportsigned64bits',
- 'exportsigned8bits',
- 'exportstring',
- 'expose',
- 'extendedyear',
- 'extensiondelimiter',
- 'extensions',
- 'extract',
- 'extractfast',
- 'extractfastone',
- 'extractimage',
- 'extractone',
- 'f',
- 'fabs',
- 'fail',
- 'failnoconnectionhandler',
- 'family',
- 'fatalerror',
- 'fcgireq',
- 'fchdir',
- 'fchmod',
- 'fchown',
- 'fd',
- 'features',
- 'fetchdata',
- 'fieldnames',
- 'fieldposition',
- 'fieldstable',
- 'fieldtype',
- 'fieldvalue',
- 'file',
- 'filename',
- 'filenames',
- 'filequeue',
- 'fileuploads',
- 'fileuploadsary',
- 'filterinputcolumn',
- 'finalize',
- 'find',
- 'findall',
- 'findandmodify',
- 'findbucket',
- 'findcase',
- 'findclass',
- 'findcount',
- 'finddescendant',
- 'findfirst',
- 'findinclude',
- 'findinctx',
- 'findindex',
- 'findlast',
- 'findpattern',
- 'findposition',
- 'findsymbols',
- 'first',
- 'firstchild',
- 'firstcomponent',
- 'firstdayofweek',
- 'firstnode',
- 'fixformat',
- 'flags',
- 'fliph',
- 'flipv',
- 'floor',
- 'flush',
- 'foldcase',
- 'foo',
- 'for',
- 'forcedrowid',
- 'foreach',
- 'foreachaccept',
- 'foreachbyte',
- 'foreachcharacter',
- 'foreachchild',
- 'foreachday',
- 'foreachentry',
- 'foreachfile',
- 'foreachfilename',
- 'foreachkey',
- 'foreachline',
- 'foreachlinebreak',
- 'foreachmatch',
- 'foreachnode',
- 'foreachpair',
- 'foreachpathcomponent',
- 'foreachrow',
- 'foreachspool',
- 'foreachsub',
- 'foreachwordbreak',
- 'form',
- 'format',
- 'formatas',
- 'formatcontextelement',
- 'formatcontextelements',
- 'formatnumber',
- 'free',
- 'frexp',
- 'from',
- 'fromname',
- 'fromport',
- 'fromreflectedfield',
- 'fromreflectedmethod',
- 'front',
- 'fsync',
- 'ftpdeletefile',
- 'ftpgetlisting',
- 'ftruncate',
- 'fullpath',
- 'fx',
- 'gamma',
- 'gatewayinterface',
- 'gen',
- 'generatechecksum',
- 'get',
- 'getabswidth',
- 'getalignment',
- 'getappsource',
- 'getarraylength',
- 'getattr',
- 'getattribute',
- 'getattributenamespace',
- 'getattributenode',
- 'getattributenodens',
- 'getattributens',
- 'getbarheight',
- 'getbarmultiplier',
- 'getbarwidth',
- 'getbaseline',
- 'getbold',
- 'getbooleanarrayelements',
- 'getbooleanarrayregion',
- 'getbooleanfield',
- 'getbordercolor',
- 'getborderwidth',
- 'getbytearrayelements',
- 'getbytearrayregion',
- 'getbytefield',
- 'getchararrayelements',
- 'getchararrayregion',
- 'getcharfield',
- 'getclass',
- 'getcode',
- 'getcolor',
- 'getcolumn',
- 'getcolumncount',
- 'getcolumns',
- 'getdatabasebyalias',
- 'getdatabasebyid',
- 'getdatabasebyname',
- 'getdatabasehost',
- 'getdatabasetable',
- 'getdatabasetablebyalias',
- 'getdatabasetablebyid',
- 'getdatabasetablepart',
- 'getdatasource',
- 'getdatasourcedatabase',
- 'getdatasourcedatabasebyid',
- 'getdatasourcehost',
- 'getdatasourceid',
- 'getdatasourcename',
- 'getdefaultstorage',
- 'getdoublearrayelements',
- 'getdoublearrayregion',
- 'getdoublefield',
- 'getelementbyid',
- 'getelementsbytagname',
- 'getelementsbytagnamens',
- 'getencoding',
- 'getface',
- 'getfield',
- 'getfieldid',
- 'getfile',
- 'getfloatarrayelements',
- 'getfloatarrayregion',
- 'getfloatfield',
- 'getfont',
- 'getformat',
- 'getfullfontname',
- 'getgroup',
- 'getgroupid',
- 'getheader',
- 'getheaders',
- 'gethostdatabase',
- 'gethtmlattr',
- 'gethtmlattrstring',
- 'getinclude',
- 'getintarrayelements',
- 'getintarrayregion',
- 'getintfield',
- 'getisocomment',
- 'getitalic',
- 'getlasterror',
- 'getlcapitype',
- 'getlibrary',
- 'getlongarrayelements',
- 'getlongarrayregion',
- 'getlongfield',
- 'getmargins',
- 'getmethodid',
- 'getmode',
- 'getnameditem',
- 'getnameditemns',
- 'getnode',
- 'getnumericvalue',
- 'getobjectarrayelement',
- 'getobjectclass',
- 'getobjectfield',
- 'getpadding',
- 'getpagenumber',
- 'getparts',
- 'getprefs',
- 'getpropertyvalue',
- 'getprowcount',
- 'getpsfontname',
- 'getrange',
- 'getrowcount',
- 'getset',
- 'getshortarrayelements',
- 'getshortarrayregion',
- 'getshortfield',
- 'getsize',
- 'getsortfieldspart',
- 'getspacing',
- 'getstaticbooleanfield',
- 'getstaticbytefield',
- 'getstaticcharfield',
- 'getstaticdoublefield',
- 'getstaticfieldid',
- 'getstaticfloatfield',
- 'getstaticintfield',
- 'getstaticlongfield',
- 'getstaticmethodid',
- 'getstaticobjectfield',
- 'getstaticshortfield',
- 'getstatus',
- 'getstringchars',
- 'getstringlength',
- 'getstyle',
- 'getsupportedencodings',
- 'gettablebyid',
- 'gettext',
- 'gettextalignment',
- 'gettextsize',
- 'gettrigger',
- 'gettype',
- 'getunderline',
- 'getuniquealiasname',
- 'getuser',
- 'getuserbykey',
- 'getuserid',
- 'getversion',
- 'getzipfilebytes',
- 'givenblock',
- 'gmt',
- 'gotconnection',
- 'gotfileupload',
- 'groupby',
- 'groupcolumns',
- 'groupcount',
- 'groupjoin',
- 'handlebreakpointget',
- 'handlebreakpointlist',
- 'handlebreakpointremove',
- 'handlebreakpointset',
- 'handlebreakpointupdate',
- 'handlecontextget',
- 'handlecontextnames',
- 'handlecontinuation',
- 'handledefinitionbody',
- 'handledefinitionhead',
- 'handledefinitionresource',
- 'handledevconnection',
- 'handleevalexpired',
- 'handlefeatureget',
- 'handlefeatureset',
- 'handlelassoappcontent',
- 'handlelassoappresponse',
- 'handlenested',
- 'handlenormalconnection',
- 'handlepop',
- 'handleresource',
- 'handlesource',
- 'handlestackget',
- 'handlestderr',
- 'handlestdin',
- 'handlestdout',
- 'handshake',
- 'hasattribute',
- 'hasattributens',
- 'hasattributes',
- 'hasbinaryproperty',
- 'haschildnodes',
- 'hasexpired',
- 'hasfeature',
- 'hasfield',
- 'hash',
- 'hashtmlattr',
- 'hasmethod',
- 'hastable',
- 'hastrailingcomponent',
- 'hasvalue',
- 'head',
- 'header',
- 'headerbytes',
- 'headers',
- 'headersarray',
- 'headersmap',
- 'height',
- 'histogram',
- 'home',
- 'host',
- 'hostcolumnnames',
- 'hostcolumnnames2',
- 'hostcolumns',
- 'hostcolumns2',
- 'hostdatasource',
- 'hostextra',
- 'hostid',
- 'hostisdynamic',
- 'hostmap',
- 'hostmap2',
- 'hostname',
- 'hostpassword',
- 'hostport',
- 'hostschema',
- 'hosttableencoding',
- 'hosttonet16',
- 'hosttonet32',
- 'hosttonet64',
- 'hostusername',
- 'hour',
- 'hourofampm',
- 'hourofday',
- 'hoursbetween',
- 'href',
- 'hreflang',
- 'htmlcontent',
- 'htmlizestacktrace',
- 'htmlizestacktracelink',
- 'httpaccept',
- 'httpacceptencoding',
- 'httpacceptlanguage',
- 'httpauthorization',
- 'httpcachecontrol',
- 'httpconnection',
- 'httpcookie',
- 'httpequiv',
- 'httphost',
- 'httpreferer',
- 'httpreferrer',
- 'httpuseragent',
- 'hypot',
- 'id',
- 'idealinmemory',
- 'idle',
- 'idmap',
- 'ifempty',
- 'ifkey',
- 'ifnotempty',
- 'ifnotkey',
- 'ignorecase',
- 'ilogb',
- 'imgptr',
- 'implementation',
- 'import16bits',
- 'import32bits',
- 'import64bits',
- 'import8bits',
- 'importas',
- 'importbytes',
- 'importfdf',
- 'importnode',
- 'importpointer',
- 'importstring',
- 'in',
- 'include',
- 'includebytes',
- 'includelibrary',
- 'includelibraryonce',
- 'includeonce',
- 'includes',
- 'includestack',
- 'indaylighttime',
- 'index',
- 'init',
- 'initialize',
- 'initrequest',
- 'inits',
- 'inneroncompare',
- 'input',
- 'inputcolumns',
- 'inputtype',
- 'insert',
- 'insertback',
- 'insertbefore',
- 'insertdata',
- 'insertfirst',
- 'insertfrom',
- 'insertfront',
- 'insertinternal',
- 'insertlast',
- 'insertpage',
- 'install',
- 'installs',
- 'integer',
- 'internalsubset',
- 'interrupt',
- 'intersection',
- 'inttocond',
- 'invoke',
- 'invokeautocollect',
- 'invokeuntil',
- 'invokewhile',
- 'ioctl',
- 'isa',
- 'isalive',
- 'isallof',
- 'isalnum',
- 'isalpha',
- 'isanyof',
- 'isbase',
- 'isblank',
- 'iscntrl',
- 'isdigit',
- 'isdir',
- 'isdirectory',
- 'isempty',
- 'isemptyelement',
- 'isfirststep',
- 'isfullpath',
- 'isgraph',
- 'ishttps',
- 'isidle',
- 'isinstanceof',
- 'islink',
- 'islower',
- 'ismultipart',
- 'isnan',
- 'isnota',
- 'isnotempty',
- 'isnothing',
- 'iso3country',
- 'iso3language',
- 'isopen',
- 'isprint',
- 'ispunct',
- 'issameobject',
- 'isset',
- 'issourcefile',
- 'isspace',
- 'isssl',
- 'issupported',
- 'istitle',
- 'istruetype',
- 'istype',
- 'isualphabetic',
- 'isulowercase',
- 'isupper',
- 'isuuppercase',
- 'isuwhitespace',
- 'isvalid',
- 'iswhitespace',
- 'isxdigit',
- 'isxhr',
- 'item',
- 'j0',
- 'j1',
- 'javascript',
- 'jbarcode',
- 'jcolor',
- 'jfont',
- 'jimage',
- 'jlist',
- 'jn',
- 'jobjectisa',
- 'join',
- 'jread',
- 'jscontent',
- 'jsonfornode',
- 'jsonhtml',
- 'jsonisleaf',
- 'jsonlabel',
- 'jtable',
- 'jtext',
- 'julianday',
- 'kernel',
- 'key',
- 'keycolumns',
- 'keys',
- 'keywords',
- 'kill',
- 'label',
- 'lang',
- 'language',
- 'last_insert_rowid',
- 'last',
- 'lastaccessdate',
- 'lastaccesstime',
- 'lastchild',
- 'lastcomponent',
- 'lasterror',
- 'lastinsertid',
- 'lastnode',
- 'lastpoint',
- 'lasttouched',
- 'lazyvalue',
- 'ldexp',
- 'leaveopen',
- 'left',
- 'length',
- 'lgamma',
- 'line',
- 'linediffers',
- 'linkto',
- 'linktype',
- 'list',
- 'listactivedatasources',
- 'listalldatabases',
- 'listalltables',
- 'listdatabasetables',
- 'listdatasourcedatabases',
- 'listdatasourcehosts',
- 'listdatasources',
- 'listen',
- 'listgroups',
- 'listgroupsbyuser',
- 'listhostdatabases',
- 'listhosts',
- 'listmethods',
- 'listnode',
- 'listusers',
- 'listusersbygroup',
- 'loadcerts',
- 'loaddatasourcehostinfo',
- 'loaddatasourceinfo',
- 'loadlibrary',
- 'localaddress',
- 'localname',
- 'locals',
- 'lock',
- 'log',
- 'log10',
- 'log1p',
- 'logb',
- 'lookupnamespace',
- 'lop',
- 'lowagiefont',
- 'lowercase',
- 'makecolor',
- 'makecolumnlist',
- 'makecolumnmap',
- 'makecookieyumyum',
- 'makefullpath',
- 'makeinheritedcopy',
- 'makenonrelative',
- 'makeurl',
- 'map',
- 'marker',
- 'matches',
- 'matchesstart',
- 'matchposition',
- 'matchstring',
- 'matchtriggers',
- 'max',
- 'maxinmemory',
- 'maxlength',
- 'maxrows',
- 'maxworkers',
- 'maybeslash',
- 'maybevalue',
- 'md5hex',
- 'media',
- 'members',
- 'merge',
- 'meta',
- 'method',
- 'methodname',
- 'millisecond',
- 'millisecondsinday',
- 'mime_boundary',
- 'mime_contenttype',
- 'mime_hdrs',
- 'mime',
- 'mimes',
- 'min',
- 'minute',
- 'minutesbetween',
- 'moddatestr',
- 'mode',
- 'modf',
- 'modificationdate',
- 'modificationtime',
- 'modulate',
- 'monitorenter',
- 'monitorexit',
- 'month',
- 'moveto',
- 'movetoattribute',
- 'movetoattributenamespace',
- 'movetoelement',
- 'movetofirstattribute',
- 'movetonextattribute',
- 'msg',
- 'mtime',
- 'multiple',
- 'n',
- 'name',
- 'named',
- 'namespaceuri',
- 'needinitialization',
- 'net',
- 'nettohost16',
- 'nettohost32',
- 'nettohost64',
- 'new',
- 'newbooleanarray',
- 'newbytearray',
- 'newchararray',
- 'newdoublearray',
- 'newfloatarray',
- 'newglobalref',
- 'newintarray',
- 'newlongarray',
- 'newobject',
- 'newobjectarray',
- 'newshortarray',
- 'newstring',
- 'next',
- 'nextafter',
- 'nextnode',
- 'nextprime',
- 'nextprune',
- 'nextprunedelta',
- 'nextsibling',
- 'nodeforpath',
- 'nodelist',
- 'nodename',
- 'nodetype',
- 'nodevalue',
- 'noop',
- 'normalize',
- 'notationname',
- 'notations',
- 'novaluelists',
- 'numsets',
- 'object',
- 'objects',
- 'objecttype',
- 'onclick',
- 'oncompare',
- 'oncomparestrict',
- 'onconvert',
- 'oncreate',
- 'ondblclick',
- 'onkeydown',
- 'onkeypress',
- 'onkeyup',
- 'onmousedown',
- 'onmousemove',
- 'onmouseout',
- 'onmouseover',
- 'onmouseup',
- 'onreset',
- 'onsubmit',
- 'ontop',
- 'open',
- 'openappend',
- 'openread',
- 'opentruncate',
- 'openwith',
- 'openwrite',
- 'openwriteonly',
- 'orderby',
- 'orderbydescending',
- 'out',
- 'output',
- 'outputencoding',
- 'ownerdocument',
- 'ownerelement',
- 'padleading',
- 'padtrailing',
- 'padzero',
- 'pagecount',
- 'pagerotation',
- 'pagesize',
- 'param',
- 'paramdescs',
- 'params',
- 'parent',
- 'parentdir',
- 'parentnode',
- 'parse_body',
- 'parse_boundary',
- 'parse_charset',
- 'parse_content_disposition',
- 'parse_content_transfer_encoding',
- 'parse_content_type',
- 'parse_hdrs',
- 'parse_mode',
- 'parse_msg',
- 'parse_parts',
- 'parse_rawhdrs',
- 'parse',
- 'parseas',
- 'parsedocument',
- 'parsenumber',
- 'parseoneheaderline',
- 'pass',
- 'path',
- 'pathinfo',
- 'pathtouri',
- 'pathtranslated',
- 'pause',
- 'payload',
- 'pdifference',
- 'perform',
- 'performonce',
- 'perms',
- 'pid',
- 'pixel',
- 'pm',
- 'polldbg',
- 'pollide',
- 'pop_capa',
- 'pop_cmd',
- 'pop_debug',
- 'pop_err',
- 'pop_get',
- 'pop_ids',
- 'pop_index',
- 'pop_log',
- 'pop_mode',
- 'pop_net',
- 'pop_res',
- 'pop_server',
- 'pop_timeout',
- 'pop_token',
- 'pop',
- 'popctx',
- 'popinclude',
- 'populate',
- 'port',
- 'position',
- 'postdispatch',
- 'postparam',
- 'postparams',
- 'postparamsary',
- 'poststring',
- 'pow',
- 'predispatch',
- 'prefix',
- 'preflight',
- 'prepare',
- 'prepared',
- 'pretty',
- 'prev',
- 'previoussibling',
- 'printsimplemsg',
- 'private_compare',
- 'private_find',
- 'private_findlast',
- 'private_merge',
- 'private_rebalanceforinsert',
- 'private_rebalanceforremove',
- 'private_replaceall',
- 'private_replacefirst',
- 'private_rotateleft',
- 'private_rotateright',
- 'private_setrange',
- 'private_split',
- 'probemimetype',
- 'provides',
- 'proxying',
- 'prune',
- 'publicid',
- 'pullhttpheader',
- 'pullmimepost',
- 'pulloneheaderline',
- 'pullpost',
- 'pullrawpost',
- 'pullrawpostchunks',
- 'pullrequest',
- 'pullrequestline',
- 'push',
- 'pushctx',
- 'pushinclude',
- 'qdarray',
- 'qdcount',
- 'queryparam',
- 'queryparams',
- 'queryparamsary',
- 'querystring',
- 'queue_maintenance',
- 'queue_messages',
- 'queue_status',
- 'queue',
- 'quit',
- 'r',
- 'raw',
- 'rawcontent',
- 'rawdiff',
- 'rawheader',
- 'rawheaders',
- 'rawinvokable',
- 'read',
- 'readattributevalue',
- 'readbytes',
- 'readbytesfully',
- 'readdestinations',
- 'readerror',
- 'readidobjects',
- 'readline',
- 'readmessage',
- 'readnumber',
- 'readobject',
- 'readobjecttcp',
- 'readpacket',
- 'readsomebytes',
- 'readstring',
- 'ready',
- 'realdoc',
- 'realpath',
- 'receivefd',
- 'recipients',
- 'recover',
- 'rect',
- 'rectype',
- 'red',
- 'redirectto',
- 'referrals',
- 'refid',
- 'refobj',
- 'refresh',
- 'rel',
- 'remainder',
- 'remoteaddr',
- 'remoteaddress',
- 'remoteport',
- 'remove',
- 'removeall',
- 'removeattribute',
- 'removeattributenode',
- 'removeattributens',
- 'removeback',
- 'removechild',
- 'removedatabasetable',
- 'removedatasource',
- 'removedatasourcedatabase',
- 'removedatasourcehost',
- 'removefield',
- 'removefirst',
- 'removefront',
- 'removegroup',
- 'removelast',
- 'removeleading',
- 'removenameditem',
- 'removenameditemns',
- 'removenode',
- 'removesubnode',
- 'removetrailing',
- 'removeuser',
- 'removeuserfromallgroups',
- 'removeuserfromgroup',
- 'rename',
- 'renderbytes',
- 'renderdocumentbytes',
- 'renderstring',
- 'replace',
- 'replaceall',
- 'replacechild',
- 'replacedata',
- 'replacefirst',
- 'replaceheader',
- 'replacepattern',
- 'representnode',
- 'representnoderesult',
- 'reqid',
- 'requestid',
- 'requestmethod',
- 'requestparams',
- 'requesturi',
- 'requires',
- 'reserve',
- 'reset',
- 'resize',
- 'resolutionh',
- 'resolutionv',
- 'resolvelinks',
- 'resourcedata',
- 'resourceinvokable',
- 'resourcename',
- 'resources',
- 'respond',
- 'restart',
- 'restname',
- 'result',
- 'results',
- 'resume',
- 'retr',
- 'retrieve',
- 'returncolumns',
- 'returntype',
- 'rev',
- 'reverse',
- 'rewind',
- 'right',
- 'rint',
- 'roll',
- 'root',
- 'rootmap',
- 'rotate',
- 'route',
- 'rowsfound',
- 'rset',
- 'rule',
- 'rules',
- 'run',
- 'running',
- 'runonce',
- 's',
- 'sa',
- 'safeexport8bits',
- 'sameas',
- 'save',
- 'savedata',
- 'scalb',
- 'scale',
- 'scanfordatasource',
- 'scantasks',
- 'scanworkers',
- 'schemaname',
- 'scheme',
- 'script',
- 'scriptextensions',
- 'scriptfilename',
- 'scriptname',
- 'scripttype',
- 'scripturi',
- 'scripturl',
- 'scrubkeywords',
- 'search',
- 'searchinbucket',
- 'searchurl',
- 'second',
- 'secondsbetween',
- 'seek',
- 'select',
- 'selected',
- 'selectmany',
- 'self',
- 'send',
- 'sendchunk',
- 'sendfd',
- 'sendfile',
- 'sendpacket',
- 'sendresponse',
- 'separator',
- 'serializationelements',
- 'serialize',
- 'serveraddr',
- 'serveradmin',
- 'servername',
- 'serverport',
- 'serverprotocol',
- 'serversignature',
- 'serversoftware',
- 'sessionsdump',
- 'sessionsmap',
- 'set',
- 'setalignment',
- 'setattr',
- 'setattribute',
- 'setattributenode',
- 'setattributenodens',
- 'setattributens',
- 'setbarheight',
- 'setbarmultiplier',
- 'setbarwidth',
- 'setbaseline',
- 'setbold',
- 'setbooleanarrayregion',
- 'setbooleanfield',
- 'setbordercolor',
- 'setborderwidth',
- 'setbytearrayregion',
- 'setbytefield',
- 'setchararrayregion',
- 'setcharfield',
- 'setcode',
- 'setcolor',
- 'setcolorspace',
- 'setcookie',
- 'setcwd',
- 'setdefaultstorage',
- 'setdestination',
- 'setdoublearrayregion',
- 'setdoublefield',
- 'setencoding',
- 'setface',
- 'setfieldvalue',
- 'setfindpattern',
- 'setfloatarrayregion',
- 'setfloatfield',
- 'setfont',
- 'setformat',
- 'setgeneratechecksum',
- 'setheaders',
- 'sethtmlattr',
- 'setignorecase',
- 'setinput',
- 'setintarrayregion',
- 'setintfield',
- 'setitalic',
- 'setlinewidth',
- 'setlongarrayregion',
- 'setlongfield',
- 'setmarker',
- 'setmaxfilesize',
- 'setmode',
- 'setname',
- 'setnameditem',
- 'setnameditemns',
- 'setobjectarrayelement',
- 'setobjectfield',
- 'setpadding',
- 'setpagenumber',
- 'setpagerange',
- 'setposition',
- 'setrange',
- 'setreplacepattern',
- 'setshortarrayregion',
- 'setshortfield',
- 'setshowchecksum',
- 'setsize',
- 'setspacing',
- 'setstaticbooleanfield',
- 'setstaticbytefield',
- 'setstaticcharfield',
- 'setstaticdoublefield',
- 'setstaticfloatfield',
- 'setstaticintfield',
- 'setstaticlongfield',
- 'setstaticobjectfield',
- 'setstaticshortfield',
- 'setstatus',
- 'settextalignment',
- 'settextsize',
- 'settimezone',
- 'settrait',
- 'setunderline',
- 'sharpen',
- 'shouldabort',
- 'shouldclose',
- 'showchecksum',
- 'showcode39startstop',
- 'showeanguardbars',
- 'shutdownrd',
- 'shutdownrdwr',
- 'shutdownwr',
- 'sin',
- 'sinh',
- 'size',
- 'skip',
- 'skiprows',
- 'sort',
- 'sortcolumns',
- 'source',
- 'sourcecolumn',
- 'sourcefile',
- 'sourceline',
- 'specified',
- 'split',
- 'splitconnection',
- 'splitdebuggingthread',
- 'splitextension',
- 'splittext',
- 'splitthread',
- 'splittoprivatedev',
- 'splituppath',
- 'sql',
- 'sqlite3',
- 'sqrt',
- 'src',
- 'srcpath',
- 'sslerrfail',
- 'stack',
- 'standby',
- 'start',
- 'startone',
- 'startup',
- 'stat',
- 'statement',
- 'statementonly',
- 'stats',
- 'status',
- 'statuscode',
- 'statusmsg',
- 'stdin',
- 'step',
- 'stls',
- 'stop',
- 'stoprunning',
- 'storedata',
- 'stripfirstcomponent',
- 'striplastcomponent',
- 'style',
- 'styletype',
- 'sub',
- 'subject',
- 'subnode',
- 'subnodes',
- 'substringdata',
- 'subtract',
- 'subtraits',
- 'sum',
- 'supportscontentrepresentation',
- 'swapbytes',
- 'systemid',
- 't',
- 'tabindex',
- 'table',
- 'tablecolumnnames',
- 'tablecolumns',
- 'tablehascolumn',
- 'tableizestacktrace',
- 'tableizestacktracelink',
- 'tablemap',
- 'tablename',
- 'tables',
- 'tabs',
- 'tabstr',
- 'tag',
- 'tagname',
- 'take',
- 'tan',
- 'tanh',
- 'target',
- 'tasks',
- 'tb',
- 'tell',
- 'testexitcode',
- 'testlock',
- 'textwidth',
- 'thenby',
- 'thenbydescending',
- 'threadreaddesc',
- 'throw',
- 'thrownew',
- 'time',
- 'timezone',
- 'title',
- 'titlecase',
- 'to',
- 'token',
- 'tolower',
- 'top',
- 'toreflectedfield',
- 'toreflectedmethod',
- 'total_changes',
- 'totitle',
- 'touch',
- 'toupper',
- 'toxmlstring',
- 'trace',
- 'trackingid',
- 'trait',
- 'transform',
- 'trigger',
- 'trim',
- 'trunk',
- 'tryfinderrorfile',
- 'trylock',
- 'tryreadobject',
- 'type',
- 'typename',
- 'uidl',
- 'uncompress',
- 'unescape',
- 'union',
- 'uniqueid',
- 'unlock',
- 'unspool',
- 'up',
- 'update',
- 'updategroup',
- 'upload',
- 'uppercase',
- 'url',
- 'used',
- 'usemap',
- 'user',
- 'usercolumns',
- 'valid',
- 'validate',
- 'validatesessionstable',
- 'value',
- 'values',
- 'valuetype',
- 'variant',
- 'version',
- 'wait',
- 'waitforcompletion',
- 'warnings',
- 'week',
- 'weekofmonth',
- 'weekofyear',
- 'where',
- 'width',
- 'workers',
- 'workinginputcolumns',
- 'workingkeycolumns',
- 'workingkeyfield_name',
- 'workingreturncolumns',
- 'workingsortcolumns',
- 'write',
- 'writebodybytes',
- 'writebytes',
- 'writeheader',
- 'writeheaderbytes',
- 'writeheaderline',
- 'writeid',
- 'writemessage',
- 'writeobject',
- 'writeobjecttcp',
- 'writestring',
- 'wroteheaders',
- 'xhtml',
- 'xmllang',
- 'y0',
- 'y1',
- 'year',
- 'yearwoy',
- 'yn',
- 'z',
- 'zip',
- 'zipfile',
- 'zipfilename',
- 'zipname',
- 'zips',
- 'zoneoffset',
- ),
- 'Lasso 8 Member Tags': (
- 'accept',
- 'add',
- 'addattachment',
- 'addattribute',
- 'addbarcode',
- 'addchapter',
- 'addcheckbox',
- 'addchild',
- 'addcombobox',
- 'addcomment',
- 'addcontent',
- 'addhiddenfield',
- 'addhtmlpart',
- 'addimage',
- 'addjavascript',
- 'addlist',
- 'addnamespace',
- 'addnextsibling',
- 'addpage',
- 'addparagraph',
- 'addparenttype',
- 'addpart',
- 'addpasswordfield',
- 'addphrase',
- 'addprevsibling',
- 'addradiobutton',
- 'addradiogroup',
- 'addresetbutton',
- 'addsection',
- 'addselectlist',
- 'addsibling',
- 'addsubmitbutton',
- 'addtable',
- 'addtext',
- 'addtextarea',
- 'addtextfield',
- 'addtextpart',
- 'alarms',
- 'annotate',
- 'answer',
- 'append',
- 'appendreplacement',
- 'appendtail',
- 'arc',
- 'asasync',
- 'astype',
- 'atbegin',
- 'atbottom',
- 'atend',
- 'atfarleft',
- 'atfarright',
- 'attop',
- 'attributecount',
- 'attributes',
- 'authenticate',
- 'authorize',
- 'backward',
- 'baseuri',
- 'bcc',
- 'beanproperties',
- 'beginswith',
- 'bind',
- 'bitand',
- 'bitclear',
- 'bitflip',
- 'bitformat',
- 'bitnot',
- 'bitor',
- 'bitset',
- 'bitshiftleft',
- 'bitshiftright',
- 'bittest',
- 'bitxor',
- 'blur',
- 'body',
- 'boundary',
- 'bytes',
- 'call',
- 'cancel',
- 'capabilities',
- 'cc',
- 'chardigitvalue',
- 'charname',
- 'charset',
- 'chartype',
- 'children',
- 'circle',
- 'close',
- 'closepath',
- 'closewrite',
- 'code',
- 'colorspace',
- 'command',
- 'comments',
- 'compare',
- 'comparecodepointorder',
- 'compile',
- 'composite',
- 'connect',
- 'contains',
- 'content_disposition',
- 'content_transfer_encoding',
- 'content_type',
- 'contents',
- 'contrast',
- 'convert',
- 'crop',
- 'curveto',
- 'data',
- 'date',
- 'day',
- 'daylights',
- 'dayofweek',
- 'dayofyear',
- 'decrement',
- 'delete',
- 'depth',
- 'describe',
- 'description',
- 'deserialize',
- 'detach',
- 'detachreference',
- 'difference',
- 'digit',
- 'document',
- 'down',
- 'drawtext',
- 'dst',
- 'dump',
- 'endswith',
- 'enhance',
- 'equals',
- 'errors',
- 'eval',
- 'events',
- 'execute',
- 'export16bits',
- 'export32bits',
- 'export64bits',
- 'export8bits',
- 'exportfdf',
- 'exportstring',
- 'extract',
- 'extractone',
- 'fieldnames',
- 'fieldtype',
- 'fieldvalue',
- 'file',
- 'find',
- 'findindex',
- 'findnamespace',
- 'findnamespacebyhref',
- 'findpattern',
- 'findposition',
- 'first',
- 'firstchild',
- 'fliph',
- 'flipv',
- 'flush',
- 'foldcase',
- 'foreach',
- 'format',
- 'forward',
- 'freebusies',
- 'freezetype',
- 'freezevalue',
- 'from',
- 'fulltype',
- 'generatechecksum',
- 'get',
- 'getabswidth',
- 'getalignment',
- 'getattribute',
- 'getattributenamespace',
- 'getbarheight',
- 'getbarmultiplier',
- 'getbarwidth',
- 'getbaseline',
- 'getbordercolor',
- 'getborderwidth',
- 'getcode',
- 'getcolor',
- 'getcolumncount',
- 'getencoding',
- 'getface',
- 'getfont',
- 'getformat',
- 'getfullfontname',
- 'getheaders',
- 'getmargins',
- 'getmethod',
- 'getnumericvalue',
- 'getpadding',
- 'getpagenumber',
- 'getparams',
- 'getproperty',
- 'getpsfontname',
- 'getrange',
- 'getrowcount',
- 'getsize',
- 'getspacing',
- 'getsupportedencodings',
- 'gettextalignment',
- 'gettextsize',
- 'gettype',
- 'gmt',
- 'groupcount',
- 'hasattribute',
- 'haschildren',
- 'hasvalue',
- 'header',
- 'headers',
- 'height',
- 'histogram',
- 'hosttonet16',
- 'hosttonet32',
- 'hour',
- 'id',
- 'ignorecase',
- 'import16bits',
- 'import32bits',
- 'import64bits',
- 'import8bits',
- 'importfdf',
- 'importstring',
- 'increment',
- 'input',
- 'insert',
- 'insertatcurrent',
- 'insertfirst',
- 'insertfrom',
- 'insertlast',
- 'insertpage',
- 'integer',
- 'intersection',
- 'invoke',
- 'isa',
- 'isalnum',
- 'isalpha',
- 'isbase',
- 'iscntrl',
- 'isdigit',
- 'isemptyelement',
- 'islower',
- 'isopen',
- 'isprint',
- 'isspace',
- 'istitle',
- 'istruetype',
- 'isualphabetic',
- 'isulowercase',
- 'isupper',
- 'isuuppercase',
- 'isuwhitespace',
- 'iswhitespace',
- 'iterator',
- 'javascript',
- 'join',
- 'journals',
- 'key',
- 'keys',
- 'last',
- 'lastchild',
- 'lasterror',
- 'left',
- 'length',
- 'line',
- 'listen',
- 'localaddress',
- 'localname',
- 'lock',
- 'lookupnamespace',
- 'lowercase',
- 'marker',
- 'matches',
- 'matchesstart',
- 'matchposition',
- 'matchstring',
- 'merge',
- 'millisecond',
- 'minute',
- 'mode',
- 'modulate',
- 'month',
- 'moveto',
- 'movetoattributenamespace',
- 'movetoelement',
- 'movetofirstattribute',
- 'movetonextattribute',
- 'name',
- 'namespaces',
- 'namespaceuri',
- 'nettohost16',
- 'nettohost32',
- 'newchild',
- 'next',
- 'nextsibling',
- 'nodetype',
- 'open',
- 'output',
- 'padleading',
- 'padtrailing',
- 'pagecount',
- 'pagesize',
- 'paraminfo',
- 'params',
- 'parent',
- 'path',
- 'pixel',
- 'position',
- 'prefix',
- 'previoussibling',
- 'properties',
- 'rawheaders',
- 'read',
- 'readattributevalue',
- 'readerror',
- 'readfrom',
- 'readline',
- 'readlock',
- 'readstring',
- 'readunlock',
- 'recipients',
- 'rect',
- 'refcount',
- 'referrals',
- 'remoteaddress',
- 'remove',
- 'removeall',
- 'removeattribute',
- 'removechild',
- 'removecurrent',
- 'removefirst',
- 'removelast',
- 'removeleading',
- 'removenamespace',
- 'removetrailing',
- 'render',
- 'replace',
- 'replaceall',
- 'replacefirst',
- 'replacepattern',
- 'replacewith',
- 'reserve',
- 'reset',
- 'resolutionh',
- 'resolutionv',
- 'response',
- 'results',
- 'retrieve',
- 'returntype',
- 'reverse',
- 'reverseiterator',
- 'right',
- 'rotate',
- 'run',
- 'save',
- 'scale',
- 'search',
- 'second',
- 'send',
- 'serialize',
- 'set',
- 'setalignment',
- 'setbarheight',
- 'setbarmultiplier',
- 'setbarwidth',
- 'setbaseline',
- 'setblocking',
- 'setbordercolor',
- 'setborderwidth',
- 'setbytes',
- 'setcode',
- 'setcolor',
- 'setcolorspace',
- 'setdatatype',
- 'setencoding',
- 'setface',
- 'setfieldvalue',
- 'setfont',
- 'setformat',
- 'setgeneratechecksum',
- 'setheight',
- 'setlassodata',
- 'setlinewidth',
- 'setmarker',
- 'setmode',
- 'setname',
- 'setpadding',
- 'setpagenumber',
- 'setpagerange',
- 'setposition',
- 'setproperty',
- 'setrange',
- 'setshowchecksum',
- 'setsize',
- 'setspacing',
- 'settemplate',
- 'settemplatestr',
- 'settextalignment',
- 'settextdata',
- 'settextsize',
- 'settype',
- 'setunderline',
- 'setwidth',
- 'setxmldata',
- 'sharpen',
- 'showchecksum',
- 'showcode39startstop',
- 'showeanguardbars',
- 'signal',
- 'signalall',
- 'size',
- 'smooth',
- 'sort',
- 'sortwith',
- 'split',
- 'standards',
- 'steal',
- 'subject',
- 'substring',
- 'subtract',
- 'swapbytes',
- 'textwidth',
- 'time',
- 'timezones',
- 'titlecase',
- 'to',
- 'todos',
- 'tolower',
- 'totitle',
- 'toupper',
- 'transform',
- 'trim',
- 'type',
- 'unescape',
- 'union',
- 'uniqueid',
- 'unlock',
- 'unserialize',
- 'up',
- 'uppercase',
- 'value',
- 'values',
- 'valuetype',
- 'wait',
- 'waskeyword',
- 'week',
- 'width',
- 'write',
- 'writelock',
- 'writeto',
- 'writeunlock',
- 'xmllang',
- 'xmlschematype',
- 'year',
- )
-}
diff --git a/pygments/lexers/_lua_builtins.py b/pygments/lexers/_lua_builtins.py
deleted file mode 100644
index b2b46a6f..00000000
--- a/pygments/lexers/_lua_builtins.py
+++ /dev/null
@@ -1,295 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._lua_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This file contains the names and modules of lua functions
- It is able to re-generate itself, but for adding new functions you
- probably have to add some callbacks (see function module_callbacks).
-
- Do not edit the MODULES dict by hand.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-MODULES = {'basic': ('_G',
- '_VERSION',
- 'assert',
- 'collectgarbage',
- 'dofile',
- 'error',
- 'getmetatable',
- 'ipairs',
- 'load',
- 'loadfile',
- 'next',
- 'pairs',
- 'pcall',
- 'print',
- 'rawequal',
- 'rawget',
- 'rawlen',
- 'rawset',
- 'select',
- 'setmetatable',
- 'tonumber',
- 'tostring',
- 'type',
- 'xpcall'),
- 'bit32': ('bit32.arshift',
- 'bit32.band',
- 'bit32.bnot',
- 'bit32.bor',
- 'bit32.btest',
- 'bit32.bxor',
- 'bit32.extract',
- 'bit32.lrotate',
- 'bit32.lshift',
- 'bit32.replace',
- 'bit32.rrotate',
- 'bit32.rshift'),
- 'coroutine': ('coroutine.create',
- 'coroutine.isyieldable',
- 'coroutine.resume',
- 'coroutine.running',
- 'coroutine.status',
- 'coroutine.wrap',
- 'coroutine.yield'),
- 'debug': ('debug.debug',
- 'debug.gethook',
- 'debug.getinfo',
- 'debug.getlocal',
- 'debug.getmetatable',
- 'debug.getregistry',
- 'debug.getupvalue',
- 'debug.getuservalue',
- 'debug.sethook',
- 'debug.setlocal',
- 'debug.setmetatable',
- 'debug.setupvalue',
- 'debug.setuservalue',
- 'debug.traceback',
- 'debug.upvalueid',
- 'debug.upvaluejoin'),
- 'io': ('io.close',
- 'io.flush',
- 'io.input',
- 'io.lines',
- 'io.open',
- 'io.output',
- 'io.popen',
- 'io.read',
- 'io.stderr',
- 'io.stdin',
- 'io.stdout',
- 'io.tmpfile',
- 'io.type',
- 'io.write'),
- 'math': ('math.abs',
- 'math.acos',
- 'math.asin',
- 'math.atan',
- 'math.atan2',
- 'math.ceil',
- 'math.cos',
- 'math.cosh',
- 'math.deg',
- 'math.exp',
- 'math.floor',
- 'math.fmod',
- 'math.frexp',
- 'math.huge',
- 'math.ldexp',
- 'math.log',
- 'math.max',
- 'math.maxinteger',
- 'math.min',
- 'math.mininteger',
- 'math.modf',
- 'math.pi',
- 'math.pow',
- 'math.rad',
- 'math.random',
- 'math.randomseed',
- 'math.sin',
- 'math.sinh',
- 'math.sqrt',
- 'math.tan',
- 'math.tanh',
- 'math.tointeger',
- 'math.type',
- 'math.ult'),
- 'modules': ('package.config',
- 'package.cpath',
- 'package.loaded',
- 'package.loadlib',
- 'package.path',
- 'package.preload',
- 'package.searchers',
- 'package.searchpath',
- 'require'),
- 'os': ('os.clock',
- 'os.date',
- 'os.difftime',
- 'os.execute',
- 'os.exit',
- 'os.getenv',
- 'os.remove',
- 'os.rename',
- 'os.setlocale',
- 'os.time',
- 'os.tmpname'),
- 'string': ('string.byte',
- 'string.char',
- 'string.dump',
- 'string.find',
- 'string.format',
- 'string.gmatch',
- 'string.gsub',
- 'string.len',
- 'string.lower',
- 'string.match',
- 'string.pack',
- 'string.packsize',
- 'string.rep',
- 'string.reverse',
- 'string.sub',
- 'string.unpack',
- 'string.upper'),
- 'table': ('table.concat',
- 'table.insert',
- 'table.move',
- 'table.pack',
- 'table.remove',
- 'table.sort',
- 'table.unpack'),
- 'utf8': ('utf8.char',
- 'utf8.charpattern',
- 'utf8.codepoint',
- 'utf8.codes',
- 'utf8.len',
- 'utf8.offset')}
-
-if __name__ == '__main__': # pragma: no cover
- import re
- import sys
-
- # urllib ends up wanting to import a module called 'math' -- if
- # pygments/lexers is in the path, this ends badly.
- for i in range(len(sys.path)-1, -1, -1):
- if sys.path[i].endswith('/lexers'):
- del sys.path[i]
-
- try:
- from urllib import urlopen
- except ImportError:
- from urllib.request import urlopen
- import pprint
-
- # you can't generally find out what module a function belongs to if you
- # have only its name. Because of this, here are some callback functions
- # that recognize if a gioven function belongs to a specific module
- def module_callbacks():
- def is_in_coroutine_module(name):
- return name.startswith('coroutine.')
-
- def is_in_modules_module(name):
- if name in ['require', 'module'] or name.startswith('package'):
- return True
- else:
- return False
-
- def is_in_string_module(name):
- return name.startswith('string.')
-
- def is_in_table_module(name):
- return name.startswith('table.')
-
- def is_in_math_module(name):
- return name.startswith('math')
-
- def is_in_io_module(name):
- return name.startswith('io.')
-
- def is_in_os_module(name):
- return name.startswith('os.')
-
- def is_in_debug_module(name):
- return name.startswith('debug.')
-
- return {'coroutine': is_in_coroutine_module,
- 'modules': is_in_modules_module,
- 'string': is_in_string_module,
- 'table': is_in_table_module,
- 'math': is_in_math_module,
- 'io': is_in_io_module,
- 'os': is_in_os_module,
- 'debug': is_in_debug_module}
-
-
-
- def get_newest_version():
- f = urlopen('http://www.lua.org/manual/')
- r = re.compile(r'^<A HREF="(\d\.\d)/">(Lua )?\1</A>')
- for line in f:
- m = r.match(line)
- if m is not None:
- return m.groups()[0]
-
- def get_lua_functions(version):
- f = urlopen('http://www.lua.org/manual/%s/' % version)
- r = re.compile(r'^<A HREF="manual.html#pdf-(?!lua|LUA)([^:]+)">\1</A>')
- functions = []
- for line in f:
- m = r.match(line)
- if m is not None:
- functions.append(m.groups()[0])
- return functions
-
- def get_function_module(name):
- for mod, cb in module_callbacks().items():
- if cb(name):
- return mod
- if '.' in name:
- return name.split('.')[0]
- else:
- return 'basic'
-
- def regenerate(filename, modules):
- with open(filename) as fp:
- content = fp.read()
-
- header = content[:content.find('MODULES = {')]
- footer = content[content.find("if __name__ == '__main__':"):]
-
-
- with open(filename, 'w') as fp:
- fp.write(header)
- fp.write('MODULES = %s\n\n' % pprint.pformat(modules))
- fp.write(footer)
-
- def run():
- version = get_newest_version()
- functions = set()
- for v in ('5.2', version):
- print('> Downloading function index for Lua %s' % v)
- f = get_lua_functions(v)
- print('> %d functions found, %d new:' %
- (len(f), len(set(f) - functions)))
- functions |= set(f)
-
- functions = sorted(functions)
-
- modules = {}
- for full_function_name in functions:
- print('>> %s' % full_function_name)
- m = get_function_module(full_function_name)
- modules.setdefault(m, []).append(full_function_name)
- modules = dict((k, tuple(v)) for k, v in modules.iteritems())
-
- regenerate(__file__, modules)
-
- run()
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
deleted file mode 100644
index 595e100f..00000000
--- a/pygments/lexers/_mapping.py
+++ /dev/null
@@ -1,524 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._mapping
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer mapping definitions. This file is generated by itself. Everytime
- you change something on a builtin lexer definition, run this script from
- the lexers folder to update it.
-
- Do not alter the LEXERS dictionary by hand.
-
- :copyright: Copyright 2006-2014, 2016 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-LEXERS = {
- 'ABAPLexer': ('pygments.lexers.business', 'ABAP', ('abap',), ('*.abap', '*.ABAP'), ('text/x-abap',)),
- 'APLLexer': ('pygments.lexers.apl', 'APL', ('apl',), ('*.apl',), ()),
- 'AbnfLexer': ('pygments.lexers.grammar_notation', 'ABNF', ('abnf',), ('*.abnf',), ('text/x-abnf',)),
- 'ActionScript3Lexer': ('pygments.lexers.actionscript', 'ActionScript 3', ('as3', 'actionscript3'), ('*.as',), ('application/x-actionscript3', 'text/x-actionscript3', 'text/actionscript3')),
- 'ActionScriptLexer': ('pygments.lexers.actionscript', 'ActionScript', ('as', 'actionscript'), ('*.as',), ('application/x-actionscript', 'text/x-actionscript', 'text/actionscript')),
- 'AdaLexer': ('pygments.lexers.pascal', 'Ada', ('ada', 'ada95', 'ada2005'), ('*.adb', '*.ads', '*.ada'), ('text/x-ada',)),
- 'AdlLexer': ('pygments.lexers.archetype', 'ADL', ('adl',), ('*.adl', '*.adls', '*.adlf', '*.adlx'), ()),
- 'AgdaLexer': ('pygments.lexers.haskell', 'Agda', ('agda',), ('*.agda',), ('text/x-agda',)),
- 'AheuiLexer': ('pygments.lexers.esoteric', 'Aheui', ('aheui',), ('*.aheui',), ()),
- 'AlloyLexer': ('pygments.lexers.dsls', 'Alloy', ('alloy',), ('*.als',), ('text/x-alloy',)),
- 'AmbientTalkLexer': ('pygments.lexers.ambient', 'AmbientTalk', ('at', 'ambienttalk', 'ambienttalk/2'), ('*.at',), ('text/x-ambienttalk',)),
- 'AmplLexer': ('pygments.lexers.ampl', 'Ampl', ('ampl',), ('*.run',), ()),
- 'Angular2HtmlLexer': ('pygments.lexers.templates', 'HTML + Angular2', ('html+ng2',), ('*.ng2',), ()),
- 'Angular2Lexer': ('pygments.lexers.templates', 'Angular2', ('ng2',), (), ()),
- 'AntlrActionScriptLexer': ('pygments.lexers.parsers', 'ANTLR With ActionScript Target', ('antlr-as', 'antlr-actionscript'), ('*.G', '*.g'), ()),
- 'AntlrCSharpLexer': ('pygments.lexers.parsers', 'ANTLR With C# Target', ('antlr-csharp', 'antlr-c#'), ('*.G', '*.g'), ()),
- 'AntlrCppLexer': ('pygments.lexers.parsers', 'ANTLR With CPP Target', ('antlr-cpp',), ('*.G', '*.g'), ()),
- 'AntlrJavaLexer': ('pygments.lexers.parsers', 'ANTLR With Java Target', ('antlr-java',), ('*.G', '*.g'), ()),
- 'AntlrLexer': ('pygments.lexers.parsers', 'ANTLR', ('antlr',), (), ()),
- 'AntlrObjectiveCLexer': ('pygments.lexers.parsers', 'ANTLR With ObjectiveC Target', ('antlr-objc',), ('*.G', '*.g'), ()),
- 'AntlrPerlLexer': ('pygments.lexers.parsers', 'ANTLR With Perl Target', ('antlr-perl',), ('*.G', '*.g'), ()),
- 'AntlrPythonLexer': ('pygments.lexers.parsers', 'ANTLR With Python Target', ('antlr-python',), ('*.G', '*.g'), ()),
- 'AntlrRubyLexer': ('pygments.lexers.parsers', 'ANTLR With Ruby Target', ('antlr-ruby', 'antlr-rb'), ('*.G', '*.g'), ()),
- 'ApacheConfLexer': ('pygments.lexers.configs', 'ApacheConf', ('apacheconf', 'aconf', 'apache'), ('.htaccess', 'apache.conf', 'apache2.conf'), ('text/x-apacheconf',)),
- 'AppleScriptLexer': ('pygments.lexers.scripting', 'AppleScript', ('applescript',), ('*.applescript',), ()),
- 'ArduinoLexer': ('pygments.lexers.c_like', 'Arduino', ('arduino',), ('*.ino',), ('text/x-arduino',)),
- 'AspectJLexer': ('pygments.lexers.jvm', 'AspectJ', ('aspectj',), ('*.aj',), ('text/x-aspectj',)),
- 'AsymptoteLexer': ('pygments.lexers.graphics', 'Asymptote', ('asy', 'asymptote'), ('*.asy',), ('text/x-asymptote',)),
- 'AugeasLexer': ('pygments.lexers.configs', 'Augeas', ('augeas',), ('*.aug',), ()),
- 'AutoItLexer': ('pygments.lexers.automation', 'AutoIt', ('autoit',), ('*.au3',), ('text/x-autoit',)),
- 'AutohotkeyLexer': ('pygments.lexers.automation', 'autohotkey', ('ahk', 'autohotkey'), ('*.ahk', '*.ahkl'), ('text/x-autohotkey',)),
- 'AwkLexer': ('pygments.lexers.textedit', 'Awk', ('awk', 'gawk', 'mawk', 'nawk'), ('*.awk',), ('application/x-awk',)),
- 'BBCBasicLexer': ('pygments.lexers.basic', 'BBC Basic', ('bbcbasic',), ('*.bbc',), ()),
- 'BBCodeLexer': ('pygments.lexers.markup', 'BBCode', ('bbcode',), (), ('text/x-bbcode',)),
- 'BCLexer': ('pygments.lexers.algebra', 'BC', ('bc',), ('*.bc',), ()),
- 'BSTLexer': ('pygments.lexers.bibtex', 'BST', ('bst', 'bst-pybtex'), ('*.bst',), ()),
- 'BaseMakefileLexer': ('pygments.lexers.make', 'Base Makefile', ('basemake',), (), ()),
- 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'zsh', 'shell'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '*.exheres-0', '*.exlib', '*.zsh', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript', 'text/x-shellscript')),
- 'BashSessionLexer': ('pygments.lexers.shell', 'Bash Session', ('console', 'shell-session'), ('*.sh-session', '*.shell-session'), ('application/x-shell-session', 'application/x-sh-session')),
- 'BatchLexer': ('pygments.lexers.shell', 'Batchfile', ('bat', 'batch', 'dosbatch', 'winbatch'), ('*.bat', '*.cmd'), ('application/x-dos-batch',)),
- 'BefungeLexer': ('pygments.lexers.esoteric', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)),
- 'BibTeXLexer': ('pygments.lexers.bibtex', 'BibTeX', ('bib', 'bibtex'), ('*.bib',), ('text/x-bibtex',)),
- 'BlitzBasicLexer': ('pygments.lexers.basic', 'BlitzBasic', ('blitzbasic', 'b3d', 'bplus'), ('*.bb', '*.decls'), ('text/x-bb',)),
- 'BlitzMaxLexer': ('pygments.lexers.basic', 'BlitzMax', ('blitzmax', 'bmax'), ('*.bmx',), ('text/x-bmx',)),
- 'BnfLexer': ('pygments.lexers.grammar_notation', 'BNF', ('bnf',), ('*.bnf',), ('text/x-bnf',)),
- 'BoaLexer': ('pygments.lexers.boa', 'Boa', ('boa',), ('*.boa',), ()),
- 'BooLexer': ('pygments.lexers.dotnet', 'Boo', ('boo',), ('*.boo',), ('text/x-boo',)),
- 'BoogieLexer': ('pygments.lexers.verification', 'Boogie', ('boogie',), ('*.bpl',), ()),
- 'BrainfuckLexer': ('pygments.lexers.esoteric', 'Brainfuck', ('brainfuck', 'bf'), ('*.bf', '*.b'), ('application/x-brainfuck',)),
- 'BroLexer': ('pygments.lexers.dsls', 'Bro', ('bro',), ('*.bro',), ()),
- 'BugsLexer': ('pygments.lexers.modeling', 'BUGS', ('bugs', 'winbugs', 'openbugs'), ('*.bug',), ()),
- 'CAmkESLexer': ('pygments.lexers.esoteric', 'CAmkES', ('camkes', 'idl4'), ('*.camkes', '*.idl4'), ()),
- 'CLexer': ('pygments.lexers.c_cpp', 'C', ('c',), ('*.c', '*.h', '*.idc'), ('text/x-chdr', 'text/x-csrc')),
- 'CMakeLexer': ('pygments.lexers.make', 'CMake', ('cmake',), ('*.cmake', 'CMakeLists.txt'), ('text/x-cmake',)),
- 'CObjdumpLexer': ('pygments.lexers.asm', 'c-objdump', ('c-objdump',), ('*.c-objdump',), ('text/x-c-objdump',)),
- 'CPSALexer': ('pygments.lexers.lisp', 'CPSA', ('cpsa',), ('*.cpsa',), ()),
- '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',)),
- 'Ca65Lexer': ('pygments.lexers.asm', 'ca65 assembler', ('ca65',), ('*.s',), ()),
- 'CadlLexer': ('pygments.lexers.archetype', 'cADL', ('cadl',), ('*.cadl',), ()),
- 'CapDLLexer': ('pygments.lexers.esoteric', 'CapDL', ('capdl',), ('*.cdl',), ()),
- 'CapnProtoLexer': ('pygments.lexers.capnproto', "Cap'n Proto", ('capnp',), ('*.capnp',), ()),
- 'CbmBasicV2Lexer': ('pygments.lexers.basic', 'CBM BASIC V2', ('cbmbas',), ('*.bas',), ()),
- 'CeylonLexer': ('pygments.lexers.jvm', 'Ceylon', ('ceylon',), ('*.ceylon',), ('text/x-ceylon',)),
- 'Cfengine3Lexer': ('pygments.lexers.configs', 'CFEngine3', ('cfengine3', 'cf3'), ('*.cf',), ()),
- 'ChaiscriptLexer': ('pygments.lexers.scripting', 'ChaiScript', ('chai', 'chaiscript'), ('*.chai',), ('text/x-chaiscript', 'application/x-chaiscript')),
- 'ChapelLexer': ('pygments.lexers.chapel', 'Chapel', ('chapel', 'chpl'), ('*.chpl',), ()),
- 'CharmciLexer': ('pygments.lexers.c_like', 'Charmci', ('charmci',), ('*.ci',), ()),
- 'CheetahHtmlLexer': ('pygments.lexers.templates', 'HTML+Cheetah', ('html+cheetah', 'html+spitfire', 'htmlcheetah'), (), ('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')),
- 'CirruLexer': ('pygments.lexers.webmisc', 'Cirru', ('cirru',), ('*.cirru',), ('text/x-cirru',)),
- 'ClayLexer': ('pygments.lexers.c_like', 'Clay', ('clay',), ('*.clay',), ('text/x-clay',)),
- 'CleanLexer': ('pygments.lexers.clean', 'Clean', ('clean',), ('*.icl', '*.dcl'), ()),
- 'ClojureLexer': ('pygments.lexers.jvm', 'Clojure', ('clojure', 'clj'), ('*.clj',), ('text/x-clojure', 'application/x-clojure')),
- 'ClojureScriptLexer': ('pygments.lexers.jvm', 'ClojureScript', ('clojurescript', 'cljs'), ('*.cljs',), ('text/x-clojurescript', 'application/x-clojurescript')),
- 'CobolFreeformatLexer': ('pygments.lexers.business', 'COBOLFree', ('cobolfree',), ('*.cbl', '*.CBL'), ()),
- 'CobolLexer': ('pygments.lexers.business', 'COBOL', ('cobol',), ('*.cob', '*.COB', '*.cpy', '*.CPY'), ('text/x-cobol',)),
- 'CoffeeScriptLexer': ('pygments.lexers.javascript', 'CoffeeScript', ('coffee-script', 'coffeescript', 'coffee'), ('*.coffee',), ('text/coffeescript',)),
- 'ColdfusionCFCLexer': ('pygments.lexers.templates', 'Coldfusion CFC', ('cfc',), ('*.cfc',), ()),
- 'ColdfusionHtmlLexer': ('pygments.lexers.templates', 'Coldfusion HTML', ('cfm',), ('*.cfm', '*.cfml'), ('application/x-coldfusion',)),
- 'ColdfusionLexer': ('pygments.lexers.templates', 'cfstatement', ('cfs',), (), ()),
- 'CommonLispLexer': ('pygments.lexers.lisp', 'Common Lisp', ('common-lisp', 'cl', 'lisp'), ('*.cl', '*.lisp'), ('text/x-common-lisp',)),
- 'ComponentPascalLexer': ('pygments.lexers.oberon', 'Component Pascal', ('componentpascal', 'cp'), ('*.cp', '*.cps'), ('text/x-component-pascal',)),
- 'CoqLexer': ('pygments.lexers.theorem', 'Coq', ('coq',), ('*.v',), ('text/x-coq',)),
- 'CppLexer': ('pygments.lexers.c_cpp', 'C++', ('cpp', 'c++'), ('*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx', '*.C', '*.H', '*.cp', '*.CPP'), ('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',)),
- 'CrmshLexer': ('pygments.lexers.dsls', 'Crmsh', ('crmsh', 'pcmk'), ('*.crmsh', '*.pcmk'), ()),
- 'CrocLexer': ('pygments.lexers.d', 'Croc', ('croc',), ('*.croc',), ('text/x-crocsrc',)),
- 'CryptolLexer': ('pygments.lexers.haskell', 'Cryptol', ('cryptol', 'cry'), ('*.cry',), ('text/x-cryptol',)),
- 'CrystalLexer': ('pygments.lexers.crystal', 'Crystal', ('cr', 'crystal'), ('*.cr',), ('text/x-crystal',)),
- 'CsoundDocumentLexer': ('pygments.lexers.csound', 'Csound Document', ('csound-document', 'csound-csd'), ('*.csd',), ()),
- 'CsoundOrchestraLexer': ('pygments.lexers.csound', 'Csound Orchestra', ('csound', 'csound-orc'), ('*.orc', '*.udo'), ()),
- 'CsoundScoreLexer': ('pygments.lexers.csound', 'Csound Score', ('csound-score', 'csound-sco'), ('*.sco',), ()),
- 'CssDjangoLexer': ('pygments.lexers.templates', 'CSS+Django/Jinja', ('css+django', 'css+jinja'), (), ('text/css+django', 'text/css+jinja')),
- 'CssErbLexer': ('pygments.lexers.templates', 'CSS+Ruby', ('css+erb', 'css+ruby'), (), ('text/css+ruby',)),
- 'CssGenshiLexer': ('pygments.lexers.templates', 'CSS+Genshi Text', ('css+genshitext', 'css+genshi'), (), ('text/css+genshi',)),
- 'CssLexer': ('pygments.lexers.css', 'CSS', ('css',), ('*.css',), ('text/css',)),
- 'CssPhpLexer': ('pygments.lexers.templates', 'CSS+PHP', ('css+php',), (), ('text/css+php',)),
- 'CssSmartyLexer': ('pygments.lexers.templates', 'CSS+Smarty', ('css+smarty',), (), ('text/css+smarty',)),
- 'CudaLexer': ('pygments.lexers.c_like', 'CUDA', ('cuda', 'cu'), ('*.cu', '*.cuh'), ('text/x-cuda',)),
- 'CypherLexer': ('pygments.lexers.graph', 'Cypher', ('cypher',), ('*.cyp', '*.cypher'), ()),
- 'CythonLexer': ('pygments.lexers.python', 'Cython', ('cython', 'pyx', 'pyrex'), ('*.pyx', '*.pxd', '*.pxi'), ('text/x-cython', 'application/x-cython')),
- 'DLexer': ('pygments.lexers.d', 'D', ('d',), ('*.d', '*.di'), ('text/x-dsrc',)),
- 'DObjdumpLexer': ('pygments.lexers.asm', 'd-objdump', ('d-objdump',), ('*.d-objdump',), ('text/x-d-objdump',)),
- 'DarcsPatchLexer': ('pygments.lexers.diff', 'Darcs Patch', ('dpatch',), ('*.dpatch', '*.darcspatch'), ()),
- 'DartLexer': ('pygments.lexers.javascript', 'Dart', ('dart',), ('*.dart',), ('text/x-dart',)),
- 'Dasm16Lexer': ('pygments.lexers.asm', 'DASM16', ('dasm16',), ('*.dasm16', '*.dasm'), ('text/x-dasm16',)),
- 'DebianControlLexer': ('pygments.lexers.installers', 'Debian Control file', ('control', 'debcontrol'), ('control',), ()),
- 'DelphiLexer': ('pygments.lexers.pascal', 'Delphi', ('delphi', 'pas', 'pascal', 'objectpascal'), ('*.pas', '*.dpr'), ('text/x-pascal',)),
- 'DgLexer': ('pygments.lexers.python', 'dg', ('dg',), ('*.dg',), ('text/x-dg',)),
- 'DiffLexer': ('pygments.lexers.diff', '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')),
- 'DockerLexer': ('pygments.lexers.configs', 'Docker', ('docker', 'dockerfile'), ('Dockerfile', '*.docker'), ('text/x-dockerfile-config',)),
- 'DtdLexer': ('pygments.lexers.html', 'DTD', ('dtd',), ('*.dtd',), ('application/xml-dtd',)),
- 'DuelLexer': ('pygments.lexers.webmisc', 'Duel', ('duel', 'jbst', 'jsonml+bst'), ('*.duel', '*.jbst'), ('text/x-duel', 'text/x-jbst')),
- 'DylanConsoleLexer': ('pygments.lexers.dylan', 'Dylan session', ('dylan-console', 'dylan-repl'), ('*.dylan-console',), ('text/x-dylan-console',)),
- 'DylanLexer': ('pygments.lexers.dylan', 'Dylan', ('dylan',), ('*.dylan', '*.dyl', '*.intr'), ('text/x-dylan',)),
- 'DylanLidLexer': ('pygments.lexers.dylan', 'DylanLID', ('dylan-lid', 'lid'), ('*.lid', '*.hdp'), ('text/x-dylan-lid',)),
- 'ECLLexer': ('pygments.lexers.ecl', 'ECL', ('ecl',), ('*.ecl',), ('application/x-ecl',)),
- 'ECLexer': ('pygments.lexers.c_like', 'eC', ('ec',), ('*.ec', '*.eh'), ('text/x-echdr', 'text/x-ecsrc')),
- 'EarlGreyLexer': ('pygments.lexers.javascript', 'Earl Grey', ('earl-grey', 'earlgrey', 'eg'), ('*.eg',), ('text/x-earl-grey',)),
- 'EasytrieveLexer': ('pygments.lexers.scripting', 'Easytrieve', ('easytrieve',), ('*.ezt', '*.mac'), ('text/x-easytrieve',)),
- 'EbnfLexer': ('pygments.lexers.parsers', 'EBNF', ('ebnf',), ('*.ebnf',), ('text/x-ebnf',)),
- 'EiffelLexer': ('pygments.lexers.eiffel', 'Eiffel', ('eiffel',), ('*.e',), ('text/x-eiffel',)),
- 'ElixirConsoleLexer': ('pygments.lexers.erlang', 'Elixir iex session', ('iex',), (), ('text/x-elixir-shellsession',)),
- 'ElixirLexer': ('pygments.lexers.erlang', 'Elixir', ('elixir', 'ex', 'exs'), ('*.ex', '*.exs'), ('text/x-elixir',)),
- 'ElmLexer': ('pygments.lexers.elm', 'Elm', ('elm',), ('*.elm',), ('text/x-elm',)),
- 'EmacsLispLexer': ('pygments.lexers.lisp', 'EmacsLisp', ('emacs', 'elisp', 'emacs-lisp'), ('*.el',), ('text/x-elisp', 'application/x-elisp')),
- 'ErbLexer': ('pygments.lexers.templates', 'ERB', ('erb',), (), ('application/x-ruby-templating',)),
- 'ErlangLexer': ('pygments.lexers.erlang', 'Erlang', ('erlang',), ('*.erl', '*.hrl', '*.es', '*.escript'), ('text/x-erlang',)),
- 'ErlangShellLexer': ('pygments.lexers.erlang', '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',)),
- 'EzhilLexer': ('pygments.lexers.ezhil', 'Ezhil', ('ezhil',), ('*.n',), ('text/x-ezhil',)),
- 'FSharpLexer': ('pygments.lexers.dotnet', 'F#', ('fsharp', 'f#'), ('*.fs', '*.fsi'), ('text/x-fsharp',)),
- 'FactorLexer': ('pygments.lexers.factor', 'Factor', ('factor',), ('*.factor',), ('text/x-factor',)),
- 'FancyLexer': ('pygments.lexers.ruby', 'Fancy', ('fancy', 'fy'), ('*.fy', '*.fancypack'), ('text/x-fancysrc',)),
- 'FantomLexer': ('pygments.lexers.fantom', 'Fantom', ('fan',), ('*.fan',), ('application/x-fantom',)),
- 'FelixLexer': ('pygments.lexers.felix', 'Felix', ('felix', 'flx'), ('*.flx', '*.flxh'), ('text/x-felix',)),
- 'FennelLexer': ('pygments.lexers.lisp', 'Fennel', ('fennel', 'fnl'), ('*.fnl',), ()),
- 'FishShellLexer': ('pygments.lexers.shell', 'Fish', ('fish', 'fishshell'), ('*.fish', '*.load'), ('application/x-fish',)),
- 'FlatlineLexer': ('pygments.lexers.dsls', 'Flatline', ('flatline',), (), ('text/x-flatline',)),
- 'FloScriptLexer': ('pygments.lexers.floscript', 'FloScript', ('floscript', 'flo'), ('*.flo',), ()),
- 'ForthLexer': ('pygments.lexers.forth', 'Forth', ('forth',), ('*.frt', '*.fs'), ('application/x-forth',)),
- 'FortranFixedLexer': ('pygments.lexers.fortran', 'FortranFixed', ('fortranfixed',), ('*.f', '*.F'), ()),
- 'FortranLexer': ('pygments.lexers.fortran', 'Fortran', ('fortran',), ('*.f03', '*.f90', '*.F03', '*.F90'), ('text/x-fortran',)),
- 'FoxProLexer': ('pygments.lexers.foxpro', 'FoxPro', ('foxpro', 'vfp', 'clipper', 'xbase'), ('*.PRG', '*.prg'), ()),
- 'FreeFemLexer': ('pygments.lexers.freefem', 'Freefem', ('freefem',), ('*.edp',), ('text/x-freefem',)),
- 'GAPLexer': ('pygments.lexers.algebra', 'GAP', ('gap',), ('*.g', '*.gd', '*.gi', '*.gap'), ()),
- 'GLShaderLexer': ('pygments.lexers.graphics', 'GLSL', ('glsl',), ('*.vert', '*.frag', '*.geo'), ('text/x-glslsrc',)),
- 'GasLexer': ('pygments.lexers.asm', 'GAS', ('gas', 'asm'), ('*.s', '*.S'), ('text/x-gas',)),
- 'GenshiLexer': ('pygments.lexers.templates', 'Genshi', ('genshi', 'kid', 'xml+genshi', 'xml+kid'), ('*.kid',), ('application/x-genshi', 'application/x-kid')),
- 'GenshiTextLexer': ('pygments.lexers.templates', 'Genshi Text', ('genshitext',), (), ('application/x-genshi-text', 'text/x-genshi')),
- 'GettextLexer': ('pygments.lexers.textfmts', 'Gettext Catalog', ('pot', 'po'), ('*.pot', '*.po'), ('application/x-gettext', 'text/x-gettext', 'text/gettext')),
- 'GherkinLexer': ('pygments.lexers.testing', 'Gherkin', ('cucumber', 'gherkin'), ('*.feature',), ('text/x-gherkin',)),
- 'GnuplotLexer': ('pygments.lexers.graphics', 'Gnuplot', ('gnuplot',), ('*.plot', '*.plt'), ('text/x-gnuplot',)),
- 'GoLexer': ('pygments.lexers.go', 'Go', ('go',), ('*.go',), ('text/x-gosrc',)),
- 'GoloLexer': ('pygments.lexers.jvm', 'Golo', ('golo',), ('*.golo',), ()),
- 'GoodDataCLLexer': ('pygments.lexers.business', '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.markup', 'Groff', ('groff', 'nroff', 'man'), ('*.[1234567]', '*.man'), ('application/x-troff', 'text/troff')),
- 'GroovyLexer': ('pygments.lexers.jvm', 'Groovy', ('groovy',), ('*.groovy', '*.gradle'), ('text/x-groovy',)),
- 'HLSLShaderLexer': ('pygments.lexers.graphics', 'HLSL', ('hlsl',), ('*.hlsl', '*.hlsli'), ('text/x-hlsl',)),
- 'HamlLexer': ('pygments.lexers.html', 'Haml', ('haml',), ('*.haml',), ('text/x-haml',)),
- 'HandlebarsHtmlLexer': ('pygments.lexers.templates', 'HTML+Handlebars', ('html+handlebars',), ('*.handlebars', '*.hbs'), ('text/html+handlebars', 'text/x-handlebars-template')),
- 'HandlebarsLexer': ('pygments.lexers.templates', 'Handlebars', ('handlebars',), (), ()),
- 'HaskellLexer': ('pygments.lexers.haskell', 'Haskell', ('haskell', 'hs'), ('*.hs',), ('text/x-haskell',)),
- 'HaxeLexer': ('pygments.lexers.haxe', 'Haxe', ('hx', 'haxe', 'hxsl'), ('*.hx', '*.hxsl'), ('text/haxe', 'text/x-haxe', 'text/x-hx')),
- 'HexdumpLexer': ('pygments.lexers.hexdump', 'Hexdump', ('hexdump',), (), ()),
- 'HsailLexer': ('pygments.lexers.asm', 'HSAIL', ('hsail', 'hsa'), ('*.hsail',), ('text/x-hsail',)),
- 'HspecLexer': ('pygments.lexers.haskell', 'Hspec', ('hspec',), (), ()),
- 'HtmlDjangoLexer': ('pygments.lexers.templates', 'HTML+Django/Jinja', ('html+django', 'html+jinja', 'htmldjango'), (), ('text/html+django', 'text/html+jinja')),
- 'HtmlGenshiLexer': ('pygments.lexers.templates', 'HTML+Genshi', ('html+genshi', 'html+kid'), (), ('text/html+genshi',)),
- 'HtmlLexer': ('pygments.lexers.html', '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.textfmts', 'HTTP', ('http',), (), ()),
- 'HxmlLexer': ('pygments.lexers.haxe', 'Hxml', ('haxeml', 'hxml'), ('*.hxml',), ()),
- 'HyLexer': ('pygments.lexers.lisp', 'Hy', ('hylang',), ('*.hy',), ('text/x-hy', 'application/x-hy')),
- 'HybrisLexer': ('pygments.lexers.scripting', 'Hybris', ('hybris', 'hy'), ('*.hy', '*.hyb'), ('text/x-hybris', 'application/x-hybris')),
- 'IDLLexer': ('pygments.lexers.idl', 'IDL', ('idl',), ('*.pro',), ('text/idl',)),
- 'IconLexer': ('pygments.lexers.unicon', 'Icon', ('icon',), ('*.icon', '*.ICON'), ()),
- 'IdrisLexer': ('pygments.lexers.haskell', 'Idris', ('idris', 'idr'), ('*.idr',), ('text/x-idris',)),
- 'IgorLexer': ('pygments.lexers.igor', 'Igor', ('igor', 'igorpro'), ('*.ipf',), ('text/ipf',)),
- 'Inform6Lexer': ('pygments.lexers.int_fiction', 'Inform 6', ('inform6', 'i6'), ('*.inf',), ()),
- 'Inform6TemplateLexer': ('pygments.lexers.int_fiction', 'Inform 6 template', ('i6t',), ('*.i6t',), ()),
- 'Inform7Lexer': ('pygments.lexers.int_fiction', 'Inform 7', ('inform7', 'i7'), ('*.ni', '*.i7x'), ()),
- 'IniLexer': ('pygments.lexers.configs', 'INI', ('ini', 'cfg', 'dosini'), ('*.ini', '*.cfg', '*.inf'), ('text/x-ini', 'text/inf')),
- 'IoLexer': ('pygments.lexers.iolang', 'Io', ('io',), ('*.io',), ('text/x-iosrc',)),
- 'IokeLexer': ('pygments.lexers.jvm', 'Ioke', ('ioke', 'ik'), ('*.ik',), ('text/x-iokesrc',)),
- 'IrcLogsLexer': ('pygments.lexers.textfmts', 'IRC logs', ('irc',), ('*.weechatlog',), ('text/x-irclog',)),
- 'IsabelleLexer': ('pygments.lexers.theorem', 'Isabelle', ('isabelle',), ('*.thy',), ('text/x-isabelle',)),
- 'JLexer': ('pygments.lexers.j', 'J', ('j',), ('*.ijs',), ('text/x-j',)),
- 'JagsLexer': ('pygments.lexers.modeling', 'JAGS', ('jags',), ('*.jag', '*.bug'), ()),
- 'JasminLexer': ('pygments.lexers.jvm', 'Jasmin', ('jasmin', 'jasminxt'), ('*.j',), ()),
- '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')),
- 'JavascriptLexer': ('pygments.lexers.javascript', 'JavaScript', ('js', 'javascript'), ('*.js', '*.jsm'), ('application/javascript', 'application/x-javascript', 'text/x-javascript', 'text/javascript')),
- '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')),
- 'JclLexer': ('pygments.lexers.scripting', 'JCL', ('jcl',), ('*.jcl',), ('text/x-jcl',)),
- 'JsgfLexer': ('pygments.lexers.grammar_notation', 'JSGF', ('jsgf',), ('*.jsgf',), ('application/jsgf', 'application/x-jsgf', 'text/jsgf')),
- 'JsonBareObjectLexer': ('pygments.lexers.data', 'JSONBareObject', ('json-object',), (), ('application/json-object',)),
- 'JsonLdLexer': ('pygments.lexers.data', 'JSON-LD', ('jsonld', 'json-ld'), ('*.jsonld',), ('application/ld+json',)),
- 'JsonLexer': ('pygments.lexers.data', 'JSON', ('json',), ('*.json',), ('application/json',)),
- 'JspLexer': ('pygments.lexers.templates', 'Java Server Page', ('jsp',), ('*.jsp',), ('application/x-jsp',)),
- 'JuliaConsoleLexer': ('pygments.lexers.julia', 'Julia console', ('jlcon',), (), ()),
- 'JuliaLexer': ('pygments.lexers.julia', 'Julia', ('julia', 'jl'), ('*.jl',), ('text/x-julia', 'application/x-julia')),
- 'JuttleLexer': ('pygments.lexers.javascript', 'Juttle', ('juttle', 'juttle'), ('*.juttle',), ('application/juttle', 'application/x-juttle', 'text/x-juttle', 'text/juttle')),
- 'KalLexer': ('pygments.lexers.javascript', 'Kal', ('kal',), ('*.kal',), ('text/kal', 'application/kal')),
- 'KconfigLexer': ('pygments.lexers.configs', 'Kconfig', ('kconfig', 'menuconfig', 'linux-config', 'kernel-config'), ('Kconfig', '*Config.in*', 'external.in*', 'standard-modules.in'), ('text/x-kconfig',)),
- 'KokaLexer': ('pygments.lexers.haskell', 'Koka', ('koka',), ('*.kk', '*.kki'), ('text/x-koka',)),
- 'KotlinLexer': ('pygments.lexers.jvm', 'Kotlin', ('kotlin',), ('*.kt',), ('text/x-kotlin',)),
- 'LSLLexer': ('pygments.lexers.scripting', 'LSL', ('lsl',), ('*.lsl',), ('text/x-lsl',)),
- 'LassoCssLexer': ('pygments.lexers.templates', 'CSS+Lasso', ('css+lasso',), (), ('text/css+lasso',)),
- 'LassoHtmlLexer': ('pygments.lexers.templates', 'HTML+Lasso', ('html+lasso',), (), ('text/html+lasso', 'application/x-httpd-lasso', 'application/x-httpd-lasso[89]')),
- 'LassoJavascriptLexer': ('pygments.lexers.templates', 'JavaScript+Lasso', ('js+lasso', 'javascript+lasso'), (), ('application/x-javascript+lasso', 'text/x-javascript+lasso', 'text/javascript+lasso')),
- 'LassoLexer': ('pygments.lexers.javascript', 'Lasso', ('lasso', 'lassoscript'), ('*.lasso', '*.lasso[89]'), ('text/x-lasso',)),
- 'LassoXmlLexer': ('pygments.lexers.templates', 'XML+Lasso', ('xml+lasso',), (), ('application/xml+lasso',)),
- 'LeanLexer': ('pygments.lexers.theorem', 'Lean', ('lean',), ('*.lean',), ('text/x-lean',)),
- 'LessCssLexer': ('pygments.lexers.css', 'LessCss', ('less',), ('*.less',), ('text/x-less-css',)),
- 'LighttpdConfLexer': ('pygments.lexers.configs', 'Lighttpd configuration file', ('lighty', 'lighttpd'), (), ('text/x-lighttpd-conf',)),
- 'LimboLexer': ('pygments.lexers.inferno', 'Limbo', ('limbo',), ('*.b',), ('text/limbo',)),
- 'LiquidLexer': ('pygments.lexers.templates', 'liquid', ('liquid',), ('*.liquid',), ()),
- 'LiterateAgdaLexer': ('pygments.lexers.haskell', 'Literate Agda', ('lagda', 'literate-agda'), ('*.lagda',), ('text/x-literate-agda',)),
- 'LiterateCryptolLexer': ('pygments.lexers.haskell', 'Literate Cryptol', ('lcry', 'literate-cryptol', 'lcryptol'), ('*.lcry',), ('text/x-literate-cryptol',)),
- 'LiterateHaskellLexer': ('pygments.lexers.haskell', 'Literate Haskell', ('lhs', 'literate-haskell', 'lhaskell'), ('*.lhs',), ('text/x-literate-haskell',)),
- 'LiterateIdrisLexer': ('pygments.lexers.haskell', 'Literate Idris', ('lidr', 'literate-idris', 'lidris'), ('*.lidr',), ('text/x-literate-idris',)),
- 'LiveScriptLexer': ('pygments.lexers.javascript', 'LiveScript', ('live-script', 'livescript'), ('*.ls',), ('text/livescript',)),
- 'LlvmLexer': ('pygments.lexers.asm', 'LLVM', ('llvm',), ('*.ll',), ('text/x-llvm',)),
- 'LogosLexer': ('pygments.lexers.objective', 'Logos', ('logos',), ('*.x', '*.xi', '*.xm', '*.xmi'), ('text/x-logos',)),
- 'LogtalkLexer': ('pygments.lexers.prolog', 'Logtalk', ('logtalk',), ('*.lgt', '*.logtalk'), ('text/x-logtalk',)),
- 'LuaLexer': ('pygments.lexers.scripting', 'Lua', ('lua',), ('*.lua', '*.wlua'), ('text/x-lua', 'application/x-lua')),
- 'MOOCodeLexer': ('pygments.lexers.scripting', 'MOOCode', ('moocode', 'moo'), ('*.moo',), ('text/x-moocode',)),
- 'MSDOSSessionLexer': ('pygments.lexers.shell', 'MSDOS Session', ('doscon',), (), ()),
- 'MakefileLexer': ('pygments.lexers.make', 'Makefile', ('make', 'makefile', 'mf', 'bsdmake'), ('*.mak', '*.mk', 'Makefile', 'makefile', 'Makefile.*', 'GNUmakefile'), ('text/x-makefile',)),
- 'MakoCssLexer': ('pygments.lexers.templates', 'CSS+Mako', ('css+mako',), (), ('text/css+mako',)),
- 'MakoHtmlLexer': ('pygments.lexers.templates', 'HTML+Mako', ('html+mako',), (), ('text/html+mako',)),
- 'MakoJavascriptLexer': ('pygments.lexers.templates', 'JavaScript+Mako', ('js+mako', 'javascript+mako'), (), ('application/x-javascript+mako', 'text/x-javascript+mako', 'text/javascript+mako')),
- 'MakoLexer': ('pygments.lexers.templates', 'Mako', ('mako',), ('*.mao',), ('application/x-mako',)),
- 'MakoXmlLexer': ('pygments.lexers.templates', 'XML+Mako', ('xml+mako',), (), ('application/xml+mako',)),
- 'MaqlLexer': ('pygments.lexers.business', 'MAQL', ('maql',), ('*.maql',), ('text/x-gooddata-maql', 'application/x-gooddata-maql')),
- 'MarkdownLexer': ('pygments.lexers.markup', 'markdown', ('md',), ('*.md',), ('text/x-markdown',)),
- 'MaskLexer': ('pygments.lexers.javascript', 'Mask', ('mask',), ('*.mask',), ('text/x-mask',)),
- 'MasonLexer': ('pygments.lexers.templates', 'Mason', ('mason',), ('*.m', '*.mhtml', '*.mc', '*.mi', 'autohandler', 'dhandler'), ('application/x-mason',)),
- 'MathematicaLexer': ('pygments.lexers.algebra', 'Mathematica', ('mathematica', 'mma', 'nb'), ('*.nb', '*.cdf', '*.nbp', '*.ma'), ('application/mathematica', 'application/vnd.wolfram.mathematica', 'application/vnd.wolfram.mathematica.package', 'application/vnd.wolfram.cdf')),
- 'MatlabLexer': ('pygments.lexers.matlab', 'Matlab', ('matlab',), ('*.m',), ('text/matlab',)),
- 'MatlabSessionLexer': ('pygments.lexers.matlab', 'Matlab session', ('matlabsession',), (), ()),
- 'MiniDLexer': ('pygments.lexers.d', 'MiniD', ('minid',), (), ('text/x-minidsrc',)),
- 'ModelicaLexer': ('pygments.lexers.modeling', 'Modelica', ('modelica',), ('*.mo',), ('text/x-modelica',)),
- 'Modula2Lexer': ('pygments.lexers.modula2', 'Modula-2', ('modula2', 'm2'), ('*.def', '*.mod'), ('text/x-modula2',)),
- 'MoinWikiLexer': ('pygments.lexers.markup', 'MoinMoin/Trac Wiki markup', ('trac-wiki', 'moin'), (), ('text/x-trac-wiki',)),
- 'MonkeyLexer': ('pygments.lexers.basic', 'Monkey', ('monkey',), ('*.monkey',), ('text/x-monkey',)),
- 'MonteLexer': ('pygments.lexers.monte', 'Monte', ('monte',), ('*.mt',), ()),
- 'MoonScriptLexer': ('pygments.lexers.scripting', 'MoonScript', ('moon', 'moonscript'), ('*.moon',), ('text/x-moonscript', 'application/x-moonscript')),
- 'MozPreprocCssLexer': ('pygments.lexers.markup', 'CSS+mozpreproc', ('css+mozpreproc',), ('*.css.in',), ()),
- 'MozPreprocHashLexer': ('pygments.lexers.markup', 'mozhashpreproc', ('mozhashpreproc',), (), ()),
- 'MozPreprocJavascriptLexer': ('pygments.lexers.markup', 'Javascript+mozpreproc', ('javascript+mozpreproc',), ('*.js.in',), ()),
- 'MozPreprocPercentLexer': ('pygments.lexers.markup', 'mozpercentpreproc', ('mozpercentpreproc',), (), ()),
- 'MozPreprocXulLexer': ('pygments.lexers.markup', 'XUL+mozpreproc', ('xul+mozpreproc',), ('*.xul.in',), ()),
- 'MqlLexer': ('pygments.lexers.c_like', 'MQL', ('mql', 'mq4', 'mq5', 'mql4', 'mql5'), ('*.mq4', '*.mq5', '*.mqh'), ('text/x-mql',)),
- 'MscgenLexer': ('pygments.lexers.dsls', 'Mscgen', ('mscgen', 'msc'), ('*.msc',), ()),
- 'MuPADLexer': ('pygments.lexers.algebra', 'MuPAD', ('mupad',), ('*.mu',), ()),
- 'MxmlLexer': ('pygments.lexers.actionscript', 'MXML', ('mxml',), ('*.mxml',), ()),
- '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',)),
- 'NCLLexer': ('pygments.lexers.ncl', 'NCL', ('ncl',), ('*.ncl',), ('text/ncl',)),
- 'NSISLexer': ('pygments.lexers.installers', 'NSIS', ('nsis', 'nsi', 'nsh'), ('*.nsi', '*.nsh'), ('text/x-nsis',)),
- 'NasmLexer': ('pygments.lexers.asm', 'NASM', ('nasm',), ('*.asm', '*.ASM'), ('text/x-nasm',)),
- 'NasmObjdumpLexer': ('pygments.lexers.asm', 'objdump-nasm', ('objdump-nasm',), ('*.objdump-intel',), ('text/x-nasm-objdump',)),
- 'NemerleLexer': ('pygments.lexers.dotnet', 'Nemerle', ('nemerle',), ('*.n',), ('text/x-nemerle',)),
- 'NesCLexer': ('pygments.lexers.c_like', 'nesC', ('nesc',), ('*.nc',), ('text/x-nescsrc',)),
- 'NewLispLexer': ('pygments.lexers.lisp', 'NewLisp', ('newlisp',), ('*.lsp', '*.nl', '*.kif'), ('text/x-newlisp', 'application/x-newlisp')),
- 'NewspeakLexer': ('pygments.lexers.smalltalk', 'Newspeak', ('newspeak',), ('*.ns2',), ('text/x-newspeak',)),
- 'NginxConfLexer': ('pygments.lexers.configs', 'Nginx configuration file', ('nginx',), ('nginx.conf',), ('text/x-nginx-conf',)),
- 'NimrodLexer': ('pygments.lexers.nimrod', 'Nimrod', ('nim', 'nimrod'), ('*.nim', '*.nimrod'), ('text/x-nim',)),
- 'NitLexer': ('pygments.lexers.nit', 'Nit', ('nit',), ('*.nit',), ()),
- 'NixLexer': ('pygments.lexers.nix', 'Nix', ('nixos', 'nix'), ('*.nix',), ('text/x-nix',)),
- 'NuSMVLexer': ('pygments.lexers.smv', 'NuSMV', ('nusmv',), ('*.smv',), ()),
- 'NumPyLexer': ('pygments.lexers.python', 'NumPy', ('numpy',), (), ()),
- 'ObjdumpLexer': ('pygments.lexers.asm', 'objdump', ('objdump',), ('*.objdump',), ('text/x-objdump',)),
- 'ObjectiveCLexer': ('pygments.lexers.objective', 'Objective-C', ('objective-c', 'objectivec', 'obj-c', 'objc'), ('*.m', '*.h'), ('text/x-objective-c',)),
- 'ObjectiveCppLexer': ('pygments.lexers.objective', 'Objective-C++', ('objective-c++', 'objectivec++', 'obj-c++', 'objc++'), ('*.mm', '*.hh'), ('text/x-objective-c++',)),
- 'ObjectiveJLexer': ('pygments.lexers.javascript', 'Objective-J', ('objective-j', 'objectivej', 'obj-j', 'objj'), ('*.j',), ('text/x-objective-j',)),
- 'OcamlLexer': ('pygments.lexers.ml', 'OCaml', ('ocaml',), ('*.ml', '*.mli', '*.mll', '*.mly'), ('text/x-ocaml',)),
- 'OctaveLexer': ('pygments.lexers.matlab', 'Octave', ('octave',), ('*.m',), ('text/octave',)),
- 'OdinLexer': ('pygments.lexers.archetype', 'ODIN', ('odin',), ('*.odin',), ('text/odin',)),
- 'OocLexer': ('pygments.lexers.ooc', 'Ooc', ('ooc',), ('*.ooc',), ('text/x-ooc',)),
- 'OpaLexer': ('pygments.lexers.ml', 'Opa', ('opa',), ('*.opa',), ('text/x-opa',)),
- 'OpenEdgeLexer': ('pygments.lexers.business', 'OpenEdge ABL', ('openedge', 'abl', 'progress'), ('*.p', '*.cls'), ('text/x-openedge', 'application/x-openedge')),
- 'PacmanConfLexer': ('pygments.lexers.configs', 'PacmanConf', ('pacmanconf',), ('pacman.conf',), ()),
- 'PanLexer': ('pygments.lexers.dsls', 'Pan', ('pan',), ('*.pan',), ()),
- 'ParaSailLexer': ('pygments.lexers.parasail', 'ParaSail', ('parasail',), ('*.psi', '*.psl'), ('text/x-parasail',)),
- 'PawnLexer': ('pygments.lexers.pawn', 'Pawn', ('pawn',), ('*.p', '*.pwn', '*.inc'), ('text/x-pawn',)),
- 'Perl6Lexer': ('pygments.lexers.perl', 'Perl6', ('perl6', 'pl6'), ('*.pl', '*.pm', '*.nqp', '*.p6', '*.6pl', '*.p6l', '*.pl6', '*.6pm', '*.p6m', '*.pm6', '*.t'), ('text/x-perl6', 'application/x-perl6')),
- 'PerlLexer': ('pygments.lexers.perl', 'Perl', ('perl', 'pl'), ('*.pl', '*.pm', '*.t'), ('text/x-perl', 'application/x-perl')),
- 'PhpLexer': ('pygments.lexers.php', 'PHP', ('php', 'php3', 'php4', 'php5'), ('*.php', '*.php[345]', '*.inc'), ('text/x-php',)),
- 'PigLexer': ('pygments.lexers.jvm', 'Pig', ('pig',), ('*.pig',), ('text/x-pig',)),
- 'PikeLexer': ('pygments.lexers.c_like', 'Pike', ('pike',), ('*.pike', '*.pmod'), ('text/x-pike',)),
- 'PkgConfigLexer': ('pygments.lexers.configs', 'PkgConfig', ('pkgconfig',), ('*.pc',), ()),
- 'PlPgsqlLexer': ('pygments.lexers.sql', 'PL/pgSQL', ('plpgsql',), (), ('text/x-plpgsql',)),
- 'PonyLexer': ('pygments.lexers.pony', 'Pony', ('pony',), ('*.pony',), ()),
- 'PostScriptLexer': ('pygments.lexers.graphics', 'PostScript', ('postscript', 'postscr'), ('*.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.graphics', 'POVRay', ('pov',), ('*.pov', '*.inc'), ('text/x-povray',)),
- 'PowerShellLexer': ('pygments.lexers.shell', 'PowerShell', ('powershell', 'posh', 'ps1', 'psm1'), ('*.ps1', '*.psm1'), ('text/x-powershell',)),
- 'PowerShellSessionLexer': ('pygments.lexers.shell', 'PowerShell Session', ('ps1con',), (), ()),
- 'PraatLexer': ('pygments.lexers.praat', 'Praat', ('praat',), ('*.praat', '*.proc', '*.psc'), ()),
- 'PrologLexer': ('pygments.lexers.prolog', 'Prolog', ('prolog',), ('*.ecl', '*.prolog', '*.pro', '*.pl'), ('text/x-prolog',)),
- 'PropertiesLexer': ('pygments.lexers.configs', 'Properties', ('properties', 'jproperties'), ('*.properties',), ('text/x-java-properties',)),
- 'ProtoBufLexer': ('pygments.lexers.dsls', 'Protocol Buffer', ('protobuf', 'proto'), ('*.proto',), ()),
- 'PugLexer': ('pygments.lexers.html', 'Pug', ('pug', 'jade'), ('*.pug', '*.jade'), ('text/x-pug', 'text/x-jade')),
- 'PuppetLexer': ('pygments.lexers.dsls', 'Puppet', ('puppet',), ('*.pp',), ()),
- 'PyPyLogLexer': ('pygments.lexers.console', 'PyPy Log', ('pypylog', 'pypy'), ('*.pypylog',), ('application/x-pypylog',)),
- 'Python3Lexer': ('pygments.lexers.python', 'Python 3', ('python3', 'py3'), (), ('text/x-python3', 'application/x-python3')),
- 'Python3TracebackLexer': ('pygments.lexers.python', 'Python 3.0 Traceback', ('py3tb',), ('*.py3tb',), ('text/x-python3-traceback',)),
- 'PythonConsoleLexer': ('pygments.lexers.python', 'Python console session', ('pycon',), (), ('text/x-python-doctest',)),
- 'PythonLexer': ('pygments.lexers.python', 'Python', ('python', 'py', 'sage'), ('*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac', '*.sage'), ('text/x-python', 'application/x-python')),
- 'PythonTracebackLexer': ('pygments.lexers.python', 'Python Traceback', ('pytb',), ('*.pytb',), ('text/x-python-traceback',)),
- 'QBasicLexer': ('pygments.lexers.basic', 'QBasic', ('qbasic', 'basic'), ('*.BAS', '*.bas'), ('text/basic',)),
- 'QVToLexer': ('pygments.lexers.qvt', 'QVTO', ('qvto', 'qvt'), ('*.qvto',), ()),
- 'QmlLexer': ('pygments.lexers.webmisc', 'QML', ('qml', 'qbs'), ('*.qml', '*.qbs'), ('application/x-qml', 'application/x-qt.qbs+qml')),
- 'RConsoleLexer': ('pygments.lexers.r', 'RConsole', ('rconsole', 'rout'), ('*.Rout',), ()),
- 'RNCCompactLexer': ('pygments.lexers.rnc', 'Relax-NG Compact', ('rnc', 'rng-compact'), ('*.rnc',), ()),
- 'RPMSpecLexer': ('pygments.lexers.installers', 'RPMSpec', ('spec',), ('*.spec',), ('text/x-rpm-spec',)),
- 'RacketLexer': ('pygments.lexers.lisp', 'Racket', ('racket', 'rkt'), ('*.rkt', '*.rktd', '*.rktl'), ('text/x-racket', 'application/x-racket')),
- 'RagelCLexer': ('pygments.lexers.parsers', 'Ragel in C Host', ('ragel-c',), ('*.rl',), ()),
- 'RagelCppLexer': ('pygments.lexers.parsers', 'Ragel in CPP Host', ('ragel-cpp',), ('*.rl',), ()),
- 'RagelDLexer': ('pygments.lexers.parsers', 'Ragel in D Host', ('ragel-d',), ('*.rl',), ()),
- 'RagelEmbeddedLexer': ('pygments.lexers.parsers', 'Embedded Ragel', ('ragel-em',), ('*.rl',), ()),
- 'RagelJavaLexer': ('pygments.lexers.parsers', 'Ragel in Java Host', ('ragel-java',), ('*.rl',), ()),
- 'RagelLexer': ('pygments.lexers.parsers', 'Ragel', ('ragel',), (), ()),
- 'RagelObjectiveCLexer': ('pygments.lexers.parsers', 'Ragel in Objective C Host', ('ragel-objc',), ('*.rl',), ()),
- 'RagelRubyLexer': ('pygments.lexers.parsers', 'Ragel in Ruby Host', ('ragel-ruby', 'ragel-rb'), ('*.rl',), ()),
- 'RawTokenLexer': ('pygments.lexers.special', 'Raw token data', ('raw',), (), ('application/x-pygments-tokens',)),
- 'RdLexer': ('pygments.lexers.r', 'Rd', ('rd',), ('*.Rd',), ('text/x-r-doc',)),
- 'RebolLexer': ('pygments.lexers.rebol', 'REBOL', ('rebol',), ('*.r', '*.r3', '*.reb'), ('text/x-rebol',)),
- 'RedLexer': ('pygments.lexers.rebol', 'Red', ('red', 'red/system'), ('*.red', '*.reds'), ('text/x-red', 'text/x-red-system')),
- 'RedcodeLexer': ('pygments.lexers.esoteric', 'Redcode', ('redcode',), ('*.cw',), ()),
- 'RegeditLexer': ('pygments.lexers.configs', 'reg', ('registry',), ('*.reg',), ('text/x-windows-registry',)),
- 'ResourceLexer': ('pygments.lexers.resource', 'ResourceBundle', ('resource', 'resourcebundle'), ('*.txt',), ()),
- 'RexxLexer': ('pygments.lexers.scripting', 'Rexx', ('rexx', 'arexx'), ('*.rexx', '*.rex', '*.rx', '*.arexx'), ('text/x-rexx',)),
- 'RhtmlLexer': ('pygments.lexers.templates', 'RHTML', ('rhtml', 'html+erb', 'html+ruby'), ('*.rhtml',), ('text/html+ruby',)),
- 'RoboconfGraphLexer': ('pygments.lexers.roboconf', 'Roboconf Graph', ('roboconf-graph',), ('*.graph',), ()),
- 'RoboconfInstancesLexer': ('pygments.lexers.roboconf', 'Roboconf Instances', ('roboconf-instances',), ('*.instances',), ()),
- 'RobotFrameworkLexer': ('pygments.lexers.robotframework', 'RobotFramework', ('robotframework',), ('*.txt', '*.robot'), ('text/x-robotframework',)),
- 'RqlLexer': ('pygments.lexers.sql', 'RQL', ('rql',), ('*.rql',), ('text/x-rql',)),
- 'RslLexer': ('pygments.lexers.dsls', 'RSL', ('rsl',), ('*.rsl',), ('text/rsl',)),
- 'RstLexer': ('pygments.lexers.markup', 'reStructuredText', ('rst', 'rest', 'restructuredtext'), ('*.rst', '*.rest'), ('text/x-rst', 'text/prs.fallenstein.rst')),
- 'RtsLexer': ('pygments.lexers.trafficscript', 'TrafficScript', ('rts', 'trafficscript'), ('*.rts',), ()),
- 'RubyConsoleLexer': ('pygments.lexers.ruby', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)),
- 'RubyLexer': ('pygments.lexers.ruby', 'Ruby', ('rb', 'ruby', 'duby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx', '*.duby', 'Gemfile'), ('text/x-ruby', 'application/x-ruby')),
- 'RustLexer': ('pygments.lexers.rust', 'Rust', ('rust', 'rs'), ('*.rs', '*.rs.in'), ('text/rust',)),
- 'SASLexer': ('pygments.lexers.sas', 'SAS', ('sas',), ('*.SAS', '*.sas'), ('text/x-sas', 'text/sas', 'application/x-sas')),
- 'SLexer': ('pygments.lexers.r', 'S', ('splus', 's', 'r'), ('*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron'), ('text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r', 'text/x-R', 'text/x-r-history', 'text/x-r-profile')),
- 'SMLLexer': ('pygments.lexers.ml', 'Standard ML', ('sml',), ('*.sml', '*.sig', '*.fun'), ('text/x-standardml', 'application/x-standardml')),
- 'SarlLexer': ('pygments.lexers.jvm', 'SARL', ('sarl',), ('*.sarl',), ('text/x-sarl',)),
- 'SassLexer': ('pygments.lexers.css', 'Sass', ('sass',), ('*.sass',), ('text/x-sass',)),
- 'ScalaLexer': ('pygments.lexers.jvm', 'Scala', ('scala',), ('*.scala',), ('text/x-scala',)),
- 'ScamlLexer': ('pygments.lexers.html', 'Scaml', ('scaml',), ('*.scaml',), ('text/x-scaml',)),
- 'SchemeLexer': ('pygments.lexers.lisp', 'Scheme', ('scheme', 'scm'), ('*.scm', '*.ss'), ('text/x-scheme', 'application/x-scheme')),
- 'ScilabLexer': ('pygments.lexers.matlab', 'Scilab', ('scilab',), ('*.sci', '*.sce', '*.tst'), ('text/scilab',)),
- 'ScssLexer': ('pygments.lexers.css', 'SCSS', ('scss',), ('*.scss',), ('text/x-scss',)),
- 'ShExCLexer': ('pygments.lexers.rdf', 'ShExC', ('shexc', 'shex'), ('*.shex',), ('text/shex',)),
- 'ShenLexer': ('pygments.lexers.lisp', 'Shen', ('shen',), ('*.shen',), ('text/x-shen', 'application/x-shen')),
- 'SilverLexer': ('pygments.lexers.verification', 'Silver', ('silver',), ('*.sil', '*.vpr'), ()),
- 'SlashLexer': ('pygments.lexers.slash', 'Slash', ('slash',), ('*.sl',), ()),
- 'SlimLexer': ('pygments.lexers.webmisc', 'Slim', ('slim',), ('*.slim',), ('text/x-slim',)),
- 'SlurmBashLexer': ('pygments.lexers.shell', 'Slurm', ('slurm', 'sbatch'), ('*.sl',), ()),
- 'SmaliLexer': ('pygments.lexers.dalvik', 'Smali', ('smali',), ('*.smali',), ('text/smali',)),
- 'SmalltalkLexer': ('pygments.lexers.smalltalk', 'Smalltalk', ('smalltalk', 'squeak', 'st'), ('*.st',), ('text/x-smalltalk',)),
- 'SmartGameFormatLexer': ('pygments.lexers.sgf', 'SmartGameFormat', ('sgf',), ('*.sgf',), ()),
- 'SmartyLexer': ('pygments.lexers.templates', 'Smarty', ('smarty',), ('*.tpl',), ('application/x-smarty',)),
- 'SnobolLexer': ('pygments.lexers.snobol', 'Snobol', ('snobol',), ('*.snobol',), ('text/x-snobol',)),
- 'SnowballLexer': ('pygments.lexers.dsls', 'Snowball', ('snowball',), ('*.sbl',), ()),
- 'SourcePawnLexer': ('pygments.lexers.pawn', 'SourcePawn', ('sp',), ('*.sp',), ('text/x-sourcepawn',)),
- 'SourcesListLexer': ('pygments.lexers.installers', 'Debian Sourcelist', ('sourceslist', 'sources.list', 'debsources'), ('sources.list',), ()),
- 'SparqlLexer': ('pygments.lexers.rdf', 'SPARQL', ('sparql',), ('*.rq', '*.sparql'), ('application/sparql-query',)),
- '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.configs', 'SquidConf', ('squidconf', 'squid.conf', 'squid'), ('squid.conf',), ('text/x-squidconf',)),
- 'SspLexer': ('pygments.lexers.templates', 'Scalate Server Page', ('ssp',), ('*.ssp',), ('application/x-ssp',)),
- 'StanLexer': ('pygments.lexers.modeling', 'Stan', ('stan',), ('*.stan',), ()),
- 'StataLexer': ('pygments.lexers.stata', 'Stata', ('stata', 'do'), ('*.do', '*.ado'), ('text/x-stata', 'text/stata', 'application/x-stata')),
- 'SuperColliderLexer': ('pygments.lexers.supercollider', 'SuperCollider', ('sc', 'supercollider'), ('*.sc', '*.scd'), ('application/supercollider', 'text/supercollider')),
- 'SwiftLexer': ('pygments.lexers.objective', 'Swift', ('swift',), ('*.swift',), ('text/x-swift',)),
- 'SwigLexer': ('pygments.lexers.c_like', 'SWIG', ('swig',), ('*.swg', '*.i'), ('text/swig',)),
- 'SystemVerilogLexer': ('pygments.lexers.hdl', 'systemverilog', ('systemverilog', 'sv'), ('*.sv', '*.svh'), ('text/x-systemverilog',)),
- 'TAPLexer': ('pygments.lexers.testing', 'TAP', ('tap',), ('*.tap',), ()),
- 'TOMLLexer': ('pygments.lexers.configs', 'TOML', ('toml',), ('*.toml',), ()),
- 'Tads3Lexer': ('pygments.lexers.int_fiction', 'TADS 3', ('tads3',), ('*.t',), ()),
- 'TasmLexer': ('pygments.lexers.asm', 'TASM', ('tasm',), ('*.asm', '*.ASM', '*.tasm'), ('text/x-tasm',)),
- 'TclLexer': ('pygments.lexers.tcl', 'Tcl', ('tcl',), ('*.tcl', '*.rvt'), ('text/x-tcl', 'text/x-script.tcl', 'application/x-tcl')),
- 'TcshLexer': ('pygments.lexers.shell', 'Tcsh', ('tcsh', 'csh'), ('*.tcsh', '*.csh'), ('application/x-csh',)),
- 'TcshSessionLexer': ('pygments.lexers.shell', 'Tcsh Session', ('tcshcon',), (), ()),
- 'TeaTemplateLexer': ('pygments.lexers.templates', 'Tea', ('tea',), ('*.tea',), ('text/x-tea',)),
- 'TeraTermLexer': ('pygments.lexers.teraterm', 'Tera Term macro', ('ttl', 'teraterm', 'teratermmacro'), ('*.ttl',), ('text/x-teratermmacro',)),
- 'TermcapLexer': ('pygments.lexers.configs', 'Termcap', ('termcap',), ('termcap', 'termcap.src'), ()),
- 'TerminfoLexer': ('pygments.lexers.configs', 'Terminfo', ('terminfo',), ('terminfo', 'terminfo.src'), ()),
- 'TerraformLexer': ('pygments.lexers.configs', 'Terraform', ('terraform', 'tf'), ('*.tf',), ('application/x-tf', 'application/x-terraform')),
- 'TexLexer': ('pygments.lexers.markup', 'TeX', ('tex', 'latex'), ('*.tex', '*.aux', '*.toc'), ('text/x-tex', 'text/x-latex')),
- 'TextLexer': ('pygments.lexers.special', 'Text only', ('text',), ('*.txt',), ('text/plain',)),
- 'ThriftLexer': ('pygments.lexers.dsls', 'Thrift', ('thrift',), ('*.thrift',), ('application/x-thrift',)),
- 'TodotxtLexer': ('pygments.lexers.textfmts', 'Todotxt', ('todotxt',), ('todo.txt', '*.todotxt'), ('text/x-todo',)),
- 'TransactSqlLexer': ('pygments.lexers.sql', 'Transact-SQL', ('tsql', 't-sql'), ('*.sql',), ('text/x-tsql',)),
- 'TreetopLexer': ('pygments.lexers.parsers', 'Treetop', ('treetop',), ('*.treetop', '*.tt'), ()),
- 'TurtleLexer': ('pygments.lexers.rdf', 'Turtle', ('turtle',), ('*.ttl',), ('text/turtle', 'application/x-turtle')),
- 'TwigHtmlLexer': ('pygments.lexers.templates', 'HTML+Twig', ('html+twig',), ('*.twig',), ('text/html+twig',)),
- 'TwigLexer': ('pygments.lexers.templates', 'Twig', ('twig',), (), ('application/x-twig',)),
- 'TypeScriptLexer': ('pygments.lexers.javascript', 'TypeScript', ('ts', 'typescript'), ('*.ts', '*.tsx'), ('text/x-typescript',)),
- 'TypoScriptCssDataLexer': ('pygments.lexers.typoscript', 'TypoScriptCssData', ('typoscriptcssdata',), (), ()),
- 'TypoScriptHtmlDataLexer': ('pygments.lexers.typoscript', 'TypoScriptHtmlData', ('typoscripthtmldata',), (), ()),
- 'TypoScriptLexer': ('pygments.lexers.typoscript', 'TypoScript', ('typoscript',), ('*.typoscript',), ('text/x-typoscript',)),
- 'UcodeLexer': ('pygments.lexers.unicon', 'ucode', ('ucode',), ('*.u', '*.u1', '*.u2'), ()),
- 'UniconLexer': ('pygments.lexers.unicon', 'Unicon', ('unicon',), ('*.icn',), ('text/unicon',)),
- 'UrbiscriptLexer': ('pygments.lexers.urbi', 'UrbiScript', ('urbiscript',), ('*.u',), ('application/x-urbiscript',)),
- 'VBScriptLexer': ('pygments.lexers.basic', 'VBScript', ('vbscript',), ('*.vbs', '*.VBS'), ()),
- 'VCLLexer': ('pygments.lexers.varnish', 'VCL', ('vcl',), ('*.vcl',), ('text/x-vclsrc',)),
- 'VCLSnippetLexer': ('pygments.lexers.varnish', 'VCLSnippets', ('vclsnippets', 'vclsnippet'), (), ('text/x-vclsnippet',)),
- 'VCTreeStatusLexer': ('pygments.lexers.console', 'VCTreeStatus', ('vctreestatus',), (), ()),
- 'VGLLexer': ('pygments.lexers.dsls', 'VGL', ('vgl',), ('*.rpf',), ()),
- 'ValaLexer': ('pygments.lexers.c_like', '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', ('verilog', 'v'), ('*.v',), ('text/x-verilog',)),
- 'VhdlLexer': ('pygments.lexers.hdl', 'vhdl', ('vhdl',), ('*.vhdl', '*.vhd'), ('text/x-vhdl',)),
- 'VimLexer': ('pygments.lexers.textedit', 'VimL', ('vim',), ('*.vim', '.vimrc', '.exrc', '.gvimrc', '_vimrc', '_exrc', '_gvimrc', 'vimrc', 'gvimrc'), ('text/x-vim',)),
- 'WDiffLexer': ('pygments.lexers.diff', 'WDiff', ('wdiff',), ('*.wdiff',), ()),
- 'WhileyLexer': ('pygments.lexers.whiley', 'Whiley', ('whiley',), ('*.whiley',), ('text/x-whiley',)),
- 'X10Lexer': ('pygments.lexers.x10', 'X10', ('x10', 'xten'), ('*.x10',), ('text/x-x10',)),
- 'XQueryLexer': ('pygments.lexers.webmisc', 'XQuery', ('xquery', 'xqy', 'xq', 'xql', 'xqm'), ('*.xqy', '*.xquery', '*.xq', '*.xql', '*.xqm'), ('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.html', 'XML', ('xml',), ('*.xml', '*.xsl', '*.rss', '*.xslt', '*.xsd', '*.wsdl', '*.wsf'), ('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',)),
- 'XorgLexer': ('pygments.lexers.xorg', 'Xorg', ('xorg.conf',), ('xorg.conf',), ()),
- 'XsltLexer': ('pygments.lexers.html', 'XSLT', ('xslt',), ('*.xsl', '*.xslt', '*.xpl'), ('application/xsl+xml', 'application/xslt+xml')),
- 'XtendLexer': ('pygments.lexers.jvm', 'Xtend', ('xtend',), ('*.xtend',), ('text/x-xtend',)),
- 'XtlangLexer': ('pygments.lexers.lisp', 'xtlang', ('extempore',), ('*.xtm',), ()),
- 'YamlJinjaLexer': ('pygments.lexers.templates', 'YAML+Jinja', ('yaml+jinja', 'salt', 'sls'), ('*.sls',), ('text/x-yaml+jinja', 'text/x-sls')),
- 'YamlLexer': ('pygments.lexers.data', 'YAML', ('yaml',), ('*.yaml', '*.yml'), ('text/x-yaml',)),
- 'ZephirLexer': ('pygments.lexers.php', 'Zephir', ('zephir',), ('*.zep',), ()),
- 'ZigLexer': ('pygments.lexers.zig', 'Zig', ('zig',), ('*.zig',), ('text/zig',)),
-}
-
-if __name__ == '__main__': # pragma: no cover
- import sys
- import os
-
- # lookup lexers
- found_lexers = []
- sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
- for root, dirs, files in os.walk('.'):
- for filename in files:
- if filename.endswith('.py') and not filename.startswith('_'):
- module_name = 'pygments.lexers%s.%s' % (
- root[1:].replace('/', '.'), filename[:-3])
- print(module_name)
- module = __import__(module_name, None, None, [''])
- for lexer_name in module.__all__:
- lexer = getattr(module, lexer_name)
- found_lexers.append(
- '%r: %r' % (lexer_name,
- (module_name,
- lexer.name,
- tuple(lexer.aliases),
- tuple(lexer.filenames),
- tuple(lexer.mimetypes))))
- # sort them to make the diff minimal
- found_lexers.sort()
-
- # extract useful sourcecode from this file
- with open(__file__) as fp:
- content = fp.read()
- # replace crnl to nl for Windows.
- #
- # Note that, originally, contributers should keep nl of master
- # repository, for example by using some kind of automatic
- # management EOL, like `EolExtension
- # <https://www.mercurial-scm.org/wiki/EolExtension>`.
- content = content.replace("\r\n", "\n")
- header = content[:content.find('LEXERS = {')]
- footer = content[content.find("if __name__ == '__main__':"):]
-
- # write new file
- with open(__file__, 'w') as fp:
- fp.write(header)
- fp.write('LEXERS = {\n %s,\n}\n\n' % ',\n '.join(found_lexers))
- fp.write(footer)
-
- print ('=== %d lexers processed.' % len(found_lexers))
diff --git a/pygments/lexers/_mql_builtins.py b/pygments/lexers/_mql_builtins.py
deleted file mode 100644
index 8c803791..00000000
--- a/pygments/lexers/_mql_builtins.py
+++ /dev/null
@@ -1,1172 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._mql_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Builtins for the MqlLexer.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-types = (
- 'AccountBalance',
- 'AccountCompany',
- 'AccountCredit',
- 'AccountCurrency',
- 'AccountEquity',
- 'AccountFreeMarginCheck',
- 'AccountFreeMarginMode',
- 'AccountFreeMargin',
- 'AccountInfoDouble',
- 'AccountInfoInteger',
- 'AccountInfoString',
- 'AccountLeverage',
- 'AccountMargin',
- 'AccountName',
- 'AccountNumber',
- 'AccountProfit',
- 'AccountServer',
- 'AccountStopoutLevel',
- 'AccountStopoutMode',
- 'Alert',
- 'ArrayBsearch',
- 'ArrayCompare',
- 'ArrayCopyRates',
- 'ArrayCopySeries',
- 'ArrayCopy',
- 'ArrayDimension',
- 'ArrayFill',
- 'ArrayFree',
- 'ArrayGetAsSeries',
- 'ArrayInitialize',
- 'ArrayIsDynamic',
- 'ArrayIsSeries',
- 'ArrayMaximum',
- 'ArrayMinimum',
- 'ArrayRange',
- 'ArrayResize',
- 'ArraySetAsSeries',
- 'ArraySize',
- 'ArraySort',
- 'CharArrayToString',
- 'CharToString',
- 'CharToStr',
- 'CheckPointer',
- 'ColorToARGB',
- 'ColorToString',
- 'Comment',
- 'CopyClose',
- 'CopyHigh',
- 'CopyLow',
- 'CopyOpen',
- 'CopyRates',
- 'CopyRealVolume',
- 'CopySpread',
- 'CopyTickVolume',
- 'CopyTime',
- 'DayOfWeek',
- 'DayOfYear',
- 'Day',
- 'DebugBreak',
- 'Digits',
- 'DoubleToString',
- 'DoubleToStr',
- 'EnumToString',
- 'EventChartCustom',
- 'EventKillTimer',
- 'EventSetMillisecondTimer',
- 'EventSetTimer',
- 'ExpertRemove',
- 'FileClose',
- 'FileCopy',
- 'FileDelete',
- 'FileFindClose',
- 'FileFindFirst',
- 'FileFindNext',
- 'FileFlush',
- 'FileGetInteger',
- 'FileIsEnding',
- 'FileIsExist',
- 'FileIsLineEnding',
- 'FileMove',
- 'FileOpenHistory',
- 'FileOpen',
- 'FileReadArray',
- 'FileReadBool',
- 'FileReadDatetime',
- 'FileReadDouble',
- 'FileReadFloat',
- 'FileReadInteger',
- 'FileReadLong',
- 'FileReadNumber',
- 'FileReadString',
- 'FileReadStruct',
- 'FileSeek',
- 'FileSize',
- 'FileTell',
- 'FileWriteArray',
- 'FileWriteDouble',
- 'FileWriteFloat',
- 'FileWriteInteger',
- 'FileWriteLong',
- 'FileWriteString',
- 'FileWriteStruct',
- 'FileWrite',
- 'FolderClean',
- 'FolderCreate',
- 'FolderDelete',
- 'GetLastError',
- 'GetPointer',
- 'GetTickCount',
- 'GlobalVariableCheck',
- 'GlobalVariableDel',
- 'GlobalVariableGet',
- 'GlobalVariableName',
- 'GlobalVariableSetOnCondition',
- 'GlobalVariableSet',
- 'GlobalVariableTemp',
- 'GlobalVariableTime',
- 'GlobalVariablesDeleteAll',
- 'GlobalVariablesFlush',
- 'GlobalVariablesTotal',
- 'HideTestIndicators',
- 'Hour',
- 'IndicatorBuffers',
- 'IndicatorCounted',
- 'IndicatorDigits',
- 'IndicatorSetDouble',
- 'IndicatorSetInteger',
- 'IndicatorSetString',
- 'IndicatorShortName',
- 'IntegerToString',
- 'IsConnected',
- 'IsDemo',
- 'IsDllsAllowed',
- 'IsExpertEnabled',
- 'IsLibrariesAllowed',
- 'IsOptimization',
- 'IsStopped',
- 'IsTesting',
- 'IsTradeAllowed',
- 'IsTradeContextBusy',
- 'IsVisualMode',
- 'MQLInfoInteger',
- 'MQLInfoString',
- 'MarketInfo',
- 'MathAbs',
- 'MathArccos',
- 'MathArcsin',
- 'MathArctan',
- 'MathCeil',
- 'MathCos',
- 'MathExp',
- 'MathFloor',
- 'MathIsValidNumber',
- 'MathLog',
- 'MathMax',
- 'MathMin',
- 'MathMod',
- 'MathPow',
- 'MathRand',
- 'MathRound',
- 'MathSin',
- 'MathSqrt',
- 'MathSrand',
- 'MathTan',
- 'MessageBox',
- 'Minute',
- 'Month',
- 'NormalizeDouble',
- 'ObjectCreate',
- 'ObjectDelete',
- 'ObjectDescription',
- 'ObjectFind',
- 'ObjectGetDouble',
- 'ObjectGetFiboDescription',
- 'ObjectGetInteger',
- 'ObjectGetShiftByValue',
- 'ObjectGetString',
- 'ObjectGetTimeByValue',
- 'ObjectGetValueByShift',
- 'ObjectGetValueByTime',
- 'ObjectGet',
- 'ObjectMove',
- 'ObjectName',
- 'ObjectSetDouble',
- 'ObjectSetFiboDescription',
- 'ObjectSetInteger',
- 'ObjectSetString',
- 'ObjectSetText',
- 'ObjectSet',
- 'ObjectType',
- 'ObjectsDeleteAll',
- 'ObjectsTotal',
- 'OrderCloseBy',
- 'OrderClosePrice',
- 'OrderCloseTime',
- 'OrderClose',
- 'OrderComment',
- 'OrderCommission',
- 'OrderDelete',
- 'OrderExpiration',
- 'OrderLots',
- 'OrderMagicNumber',
- 'OrderModify',
- 'OrderOpenPrice',
- 'OrderOpenTime',
- 'OrderPrint',
- 'OrderProfit',
- 'OrderSelect',
- 'OrderSend',
- 'OrderStopLoss',
- 'OrderSwap',
- 'OrderSymbol',
- 'OrderTakeProfit',
- 'OrderTicket',
- 'OrderType',
- 'OrdersHistoryTotal',
- 'OrdersTotal',
- 'PeriodSeconds',
- 'Period',
- 'PlaySound',
- 'Point',
- 'PrintFormat',
- 'Print',
- 'RefreshRates',
- 'ResetLastError',
- 'ResourceCreate',
- 'ResourceFree',
- 'ResourceReadImage',
- 'ResourceSave',
- 'Seconds',
- 'SendFTP',
- 'SendMail',
- 'SendNotification',
- 'SeriesInfoInteger',
- 'SetIndexArrow',
- 'SetIndexBuffer',
- 'SetIndexDrawBegin',
- 'SetIndexEmptyValue',
- 'SetIndexLabel',
- 'SetIndexShift',
- 'SetIndexStyle',
- 'SetLevelStyle',
- 'SetLevelValue',
- 'ShortArrayToString',
- 'ShortToString',
- 'Sleep',
- 'StrToDouble',
- 'StrToInteger',
- 'StrToTime',
- 'StringAdd',
- 'StringBufferLen',
- 'StringCompare',
- 'StringConcatenate',
- 'StringFill',
- 'StringFind',
- 'StringFormat',
- 'StringGetCharacter',
- 'StringGetChar',
- 'StringInit',
- 'StringLen',
- 'StringReplace',
- 'StringSetCharacter',
- 'StringSetChar',
- 'StringSplit',
- 'StringSubstr',
- 'StringToCharArray',
- 'StringToColor',
- 'StringToDouble',
- 'StringToInteger',
- 'StringToLower',
- 'StringToShortArray',
- 'StringToTime',
- 'StringToUpper',
- 'StringTrimLeft',
- 'StringTrimRight',
- 'StructToTime',
- 'SymbolInfoDouble',
- 'SymbolInfoInteger',
- 'SymbolInfoSessionQuote',
- 'SymbolInfoSessionTrade',
- 'SymbolInfoString',
- 'SymbolInfoTick',
- 'SymbolIsSynchronized',
- 'SymbolName',
- 'SymbolSelect',
- 'SymbolsTotal',
- 'Symbol',
- 'TerminalClose',
- 'TerminalCompany',
- 'TerminalName',
- 'TerminalPath',
- 'TesterStatistics',
- 'TextGetSize',
- 'TextOut',
- 'TextSetFont',
- 'TimeCurrent',
- 'TimeDayOfWeek',
- 'TimeDayOfYear',
- 'TimeDaylightSavings',
- 'TimeDay',
- 'TimeGMTOffset',
- 'TimeGMT',
- 'TimeHour',
- 'TimeLocal',
- 'TimeMinute',
- 'TimeMonth',
- 'TimeSeconds',
- 'TimeToString',
- 'TimeToStruct',
- 'TimeToStr',
- 'TimeTradeServer',
- 'TimeYear',
- 'UninitializeReason',
- 'WindowBarsPerChart',
- 'WindowExpertName',
- 'WindowFind',
- 'WindowFirstVisibleBar',
- 'WindowHandle',
- 'WindowIsVisible',
- 'WindowOnDropped',
- 'WindowPriceMax',
- 'WindowPriceMin',
- 'WindowPriceOnDropped',
- 'WindowRedraw',
- 'WindowScreenShot',
- 'WindowTimeOnDropped',
- 'WindowXOnDropped',
- 'WindowYOnDropped',
- 'WindowsTotal',
- 'Year',
- 'ZeroMemory',
- 'iAC',
- 'iADX',
- 'iAD',
- 'iAO',
- 'iATR',
- 'iAlligator',
- 'iBWMFI',
- 'iBandsOnArray',
- 'iBands',
- 'iBarShift',
- 'iBars',
- 'iBearsPower',
- 'iBullsPower',
- 'iCCIOnArray',
- 'iCCI',
- 'iClose',
- 'iCustom',
- 'iDeMarker',
- 'iEnvelopesOnArray',
- 'iEnvelopes',
- 'iForce',
- 'iFractals',
- 'iGator',
- 'iHighest',
- 'iHigh',
- 'iIchimoku',
- 'iLowest',
- 'iLow',
- 'iMACD',
- 'iMAOnArray',
- 'iMA',
- 'iMFI',
- 'iMomentumOnArray',
- 'iMomentum',
- 'iOBV',
- 'iOpen',
- 'iOsMA',
- 'iRSIOnArray',
- 'iRSI',
- 'iRVI',
- 'iSAR',
- 'iStdDevOnArray',
- 'iStdDev',
- 'iStochastic',
- 'iTime',
- 'iVolume',
- 'iWPR',
-)
-
-constants = (
- 'ACCOUNT_BALANCE',
- 'ACCOUNT_COMPANY',
- 'ACCOUNT_CREDIT',
- 'ACCOUNT_CURRENCY',
- 'ACCOUNT_EQUITY',
- 'ACCOUNT_FREEMARGIN',
- 'ACCOUNT_LEVERAGE',
- 'ACCOUNT_LIMIT_ORDERS',
- 'ACCOUNT_LOGIN',
- 'ACCOUNT_MARGIN',
- 'ACCOUNT_MARGIN_LEVEL',
- 'ACCOUNT_MARGIN_SO_CALL',
- 'ACCOUNT_MARGIN_SO_MODE',
- 'ACCOUNT_MARGIN_SO_SO',
- 'ACCOUNT_NAME',
- 'ACCOUNT_PROFIT',
- 'ACCOUNT_SERVER',
- 'ACCOUNT_STOPOUT_MODE_MONEY',
- 'ACCOUNT_STOPOUT_MODE_PERCENT',
- 'ACCOUNT_TRADE_ALLOWED',
- 'ACCOUNT_TRADE_EXPERT',
- 'ACCOUNT_TRADE_MODE',
- 'ACCOUNT_TRADE_MODE_CONTEST',
- 'ACCOUNT_TRADE_MODE_DEMO',
- 'ACCOUNT_TRADE_MODE_REAL',
- 'ALIGN_CENTER',
- 'ALIGN_LEFT',
- 'ALIGN_RIGHT',
- 'ANCHOR_BOTTOM',
- 'ANCHOR_CENTER',
- 'ANCHOR_LEFT',
- 'ANCHOR_LEFT_LOWER',
- 'ANCHOR_LEFT_UPPER',
- 'ANCHOR_LOWER',
- 'ANCHOR_RIGHT',
- 'ANCHOR_RIGHT_LOWER',
- 'ANCHOR_RIGHT_UPPER',
- 'ANCHOR_TOP',
- 'ANCHOR_UPPER',
- 'BORDER_FLAT',
- 'BORDER_RAISED',
- 'BORDER_SUNKEN',
- 'CHARTEVENT_CHART_CHANGE',
- 'CHARTEVENT_CLICK',
- 'CHARTEVENT_CUSTOM',
- 'CHARTEVENT_CUSTOM_LAST',
- 'CHARTEVENT_KEYDOWN',
- 'CHARTEVENT_MOUSE_MOVE',
- 'CHARTEVENT_OBJECT_CHANGE',
- 'CHARTEVENT_OBJECT_CLICK',
- 'CHARTEVENT_OBJECT_CREATE',
- 'CHARTEVENT_OBJECT_DELETE',
- 'CHARTEVENT_OBJECT_DRAG',
- 'CHARTEVENT_OBJECT_ENDEDIT',
- 'CHARTS_MAX',
- 'CHART_AUTOSCROLL',
- 'CHART_BARS',
- 'CHART_BEGIN',
- 'CHART_BRING_TO_TOP',
- 'CHART_CANDLES',
- 'CHART_COLOR_ASK',
- 'CHART_COLOR_BACKGROUND',
- 'CHART_COLOR_BID',
- 'CHART_COLOR_CANDLE_BEAR',
- 'CHART_COLOR_CANDLE_BULL',
- 'CHART_COLOR_CHART_DOWN',
- 'CHART_COLOR_CHART_LINE',
- 'CHART_COLOR_CHART_UP',
- 'CHART_COLOR_FOREGROUND',
- 'CHART_COLOR_GRID',
- 'CHART_COLOR_LAST',
- 'CHART_COLOR_STOP_LEVEL',
- 'CHART_COLOR_VOLUME',
- 'CHART_COMMENT',
- 'CHART_CURRENT_POS',
- 'CHART_DRAG_TRADE_LEVELS',
- 'CHART_END',
- 'CHART_EVENT_MOUSE_MOVE',
- 'CHART_EVENT_OBJECT_CREATE',
- 'CHART_EVENT_OBJECT_DELETE',
- 'CHART_FIRST_VISIBLE_BAR',
- 'CHART_FIXED_MAX',
- 'CHART_FIXED_MIN',
- 'CHART_FIXED_POSITION',
- 'CHART_FOREGROUND',
- 'CHART_HEIGHT_IN_PIXELS',
- 'CHART_IS_OBJECT',
- 'CHART_LINE',
- 'CHART_MODE',
- 'CHART_MOUSE_SCROLL',
- 'CHART_POINTS_PER_BAR',
- 'CHART_PRICE_MAX',
- 'CHART_PRICE_MIN',
- 'CHART_SCALEFIX',
- 'CHART_SCALEFIX_11',
- 'CHART_SCALE',
- 'CHART_SCALE_PT_PER_BAR',
- 'CHART_SHIFT',
- 'CHART_SHIFT_SIZE',
- 'CHART_SHOW_ASK_LINE',
- 'CHART_SHOW_BID_LINE',
- 'CHART_SHOW_DATE_SCALE',
- 'CHART_SHOW_GRID',
- 'CHART_SHOW_LAST_LINE',
- 'CHART_SHOW_OBJECT_DESCR',
- 'CHART_SHOW_OHLC',
- 'CHART_SHOW_PERIOD_SEP',
- 'CHART_SHOW_PRICE_SCALE',
- 'CHART_SHOW_TRADE_LEVELS',
- 'CHART_SHOW_VOLUMES',
- 'CHART_VISIBLE_BARS',
- 'CHART_VOLUME_HIDE',
- 'CHART_VOLUME_REAL',
- 'CHART_VOLUME_TICK',
- 'CHART_WIDTH_IN_BARS',
- 'CHART_WIDTH_IN_PIXELS',
- 'CHART_WINDOWS_TOTAL',
- 'CHART_WINDOW_HANDLE',
- 'CHART_WINDOW_IS_VISIBLE',
- 'CHART_WINDOW_YDISTANCE',
- 'CHAR_MAX',
- 'CHAR_MIN',
- 'CLR_NONE',
- 'CORNER_LEFT_LOWER',
- 'CORNER_LEFT_UPPER',
- 'CORNER_RIGHT_LOWER',
- 'CORNER_RIGHT_UPPER',
- 'CP_ACP',
- 'CP_MACCP',
- 'CP_OEMCP',
- 'CP_SYMBOL',
- 'CP_THREAD_ACP',
- 'CP_UTF7',
- 'CP_UTF8',
- 'DBL_DIG',
- 'DBL_EPSILON',
- 'DBL_MANT_DIG',
- 'DBL_MAX',
- 'DBL_MAX_10_EXP',
- 'DBL_MAX_EXP',
- 'DBL_MIN',
- 'DBL_MIN_10_EXP',
- 'DBL_MIN_EXP',
- 'DRAW_ARROW',
- 'DRAW_FILLING',
- 'DRAW_HISTOGRAM',
- 'DRAW_LINE',
- 'DRAW_NONE',
- 'DRAW_SECTION',
- 'DRAW_ZIGZAG',
- 'EMPTY',
- 'EMPTY_VALUE',
- 'ERR_ACCOUNT_DISABLED',
- 'ERR_BROKER_BUSY',
- 'ERR_COMMON_ERROR',
- 'ERR_INVALID_ACCOUNT',
- 'ERR_INVALID_PRICE',
- 'ERR_INVALID_STOPS',
- 'ERR_INVALID_TRADE_PARAMETERS',
- 'ERR_INVALID_TRADE_VOLUME',
- 'ERR_LONG_POSITIONS_ONLY_ALLOWED',
- 'ERR_MALFUNCTIONAL_TRADE',
- 'ERR_MARKET_CLOSED',
- 'ERR_NOT_ENOUGH_MONEY',
- 'ERR_NOT_ENOUGH_RIGHTS',
- 'ERR_NO_CONNECTION',
- 'ERR_NO_ERROR',
- 'ERR_NO_RESULT',
- 'ERR_OFF_QUOTES',
- 'ERR_OLD_VERSION',
- 'ERR_ORDER_LOCKED',
- 'ERR_PRICE_CHANGED',
- 'ERR_REQUOTE',
- 'ERR_SERVER_BUSY',
- 'ERR_TOO_FREQUENT_REQUESTS',
- 'ERR_TOO_MANY_REQUESTS',
- 'ERR_TRADE_CONTEXT_BUSY',
- 'ERR_TRADE_DISABLED',
- 'ERR_TRADE_EXPIRATION_DENIED',
- 'ERR_TRADE_HEDGE_PROHIBITED',
- 'ERR_TRADE_MODIFY_DENIED',
- 'ERR_TRADE_PROHIBITED_BY_FIFO',
- 'ERR_TRADE_TIMEOUT',
- 'ERR_TRADE_TOO_MANY_ORDERS',
- 'FILE_ACCESS_DATE',
- 'FILE_ANSI',
- 'FILE_BIN',
- 'FILE_COMMON',
- 'FILE_CREATE_DATE',
- 'FILE_CSV',
- 'FILE_END',
- 'FILE_EXISTS',
- 'FILE_IS_ANSI',
- 'FILE_IS_BINARY',
- 'FILE_IS_COMMON',
- 'FILE_IS_CSV',
- 'FILE_IS_READABLE',
- 'FILE_IS_TEXT',
- 'FILE_IS_WRITABLE',
- 'FILE_LINE_END',
- 'FILE_MODIFY_DATE',
- 'FILE_POSITION',
- 'FILE_READ',
- 'FILE_REWRITE',
- 'FILE_SHARE_READ',
- 'FILE_SHARE_WRITE',
- 'FILE_SIZE',
- 'FILE_TXT',
- 'FILE_UNICODE',
- 'FILE_WRITE',
- 'FLT_DIG',
- 'FLT_EPSILON',
- 'FLT_MANT_DIG',
- 'FLT_MAX',
- 'FLT_MAX_10_EXP',
- 'FLT_MAX_EXP',
- 'FLT_MIN',
- 'FLT_MIN_10_EXP',
- 'FLT_MIN_EXP',
- 'FRIDAY',
- 'GANN_DOWN_TREND',
- 'GANN_UP_TREND',
- 'IDABORT',
- 'IDCANCEL',
- 'IDCONTINUE',
- 'IDIGNORE',
- 'IDNO',
- 'IDOK',
- 'IDRETRY',
- 'IDTRYAGAIN',
- 'IDYES',
- 'INDICATOR_CALCULATIONS',
- 'INDICATOR_COLOR_INDEX',
- 'INDICATOR_DATA',
- 'INDICATOR_DIGITS',
- 'INDICATOR_HEIGHT',
- 'INDICATOR_LEVELCOLOR',
- 'INDICATOR_LEVELSTYLE',
- 'INDICATOR_LEVELS',
- 'INDICATOR_LEVELTEXT',
- 'INDICATOR_LEVELVALUE',
- 'INDICATOR_LEVELWIDTH',
- 'INDICATOR_MAXIMUM',
- 'INDICATOR_MINIMUM',
- 'INDICATOR_SHORTNAME',
- 'INT_MAX',
- 'INT_MIN',
- 'INVALID_HANDLE',
- 'IS_DEBUG_MODE',
- 'IS_PROFILE_MODE',
- 'LICENSE_DEMO',
- 'LICENSE_FREE',
- 'LICENSE_FULL',
- 'LICENSE_TIME',
- 'LONG_MAX',
- 'LONG_MIN',
- 'MB_ABORTRETRYIGNORE',
- 'MB_CANCELTRYCONTINUE',
- 'MB_DEFBUTTON1',
- 'MB_DEFBUTTON2',
- 'MB_DEFBUTTON3',
- 'MB_DEFBUTTON4',
- 'MB_ICONASTERISK',
- 'MB_ICONERROR',
- 'MB_ICONEXCLAMATION',
- 'MB_ICONHAND',
- 'MB_ICONINFORMATION',
- 'MB_ICONQUESTION',
- 'MB_ICONSTOP',
- 'MB_ICONWARNING',
- 'MB_OKCANCEL',
- 'MB_OK',
- 'MB_RETRYCANCEL',
- 'MB_YESNOCANCEL',
- 'MB_YESNO',
- 'MODE_ASK',
- 'MODE_BID',
- 'MODE_CHINKOUSPAN',
- 'MODE_CLOSE',
- 'MODE_DIGITS',
- 'MODE_EMA',
- 'MODE_EXPIRATION',
- 'MODE_FREEZELEVEL',
- 'MODE_GATORJAW',
- 'MODE_GATORLIPS',
- 'MODE_GATORTEETH',
- 'MODE_HIGH',
- 'MODE_KIJUNSEN',
- 'MODE_LOTSIZE',
- 'MODE_LOTSTEP',
- 'MODE_LOWER',
- 'MODE_LOW',
- 'MODE_LWMA',
- 'MODE_MAIN',
- 'MODE_MARGINCALCMODE',
- 'MODE_MARGINHEDGED',
- 'MODE_MARGININIT',
- 'MODE_MARGINMAINTENANCE',
- 'MODE_MARGINREQUIRED',
- 'MODE_MAXLOT',
- 'MODE_MINLOT',
- 'MODE_MINUSDI',
- 'MODE_OPEN',
- 'MODE_PLUSDI',
- 'MODE_POINT',
- 'MODE_PROFITCALCMODE',
- 'MODE_SENKOUSPANA',
- 'MODE_SENKOUSPANB',
- 'MODE_SIGNAL',
- 'MODE_SMA',
- 'MODE_SMMA',
- 'MODE_SPREAD',
- 'MODE_STARTING',
- 'MODE_STOPLEVEL',
- 'MODE_SWAPLONG',
- 'MODE_SWAPSHORT',
- 'MODE_SWAPTYPE',
- 'MODE_TENKANSEN',
- 'MODE_TICKSIZE',
- 'MODE_TICKVALUE',
- 'MODE_TIME',
- 'MODE_TRADEALLOWED',
- 'MODE_UPPER',
- 'MODE_VOLUME',
- 'MONDAY',
- 'MQL_DEBUG',
- 'MQL_DLLS_ALLOWED',
- 'MQL_FRAME_MODE',
- 'MQL_LICENSE_TYPE',
- 'MQL_OPTIMIZATION',
- 'MQL_PROFILER',
- 'MQL_PROGRAM_NAME',
- 'MQL_PROGRAM_PATH',
- 'MQL_PROGRAM_TYPE',
- 'MQL_TESTER',
- 'MQL_TRADE_ALLOWED',
- 'MQL_VISUAL_MODE',
- 'M_1_PI',
- 'M_2_PI',
- 'M_2_SQRTPI',
- 'M_E',
- 'M_LN2',
- 'M_LN10',
- 'M_LOG2E',
- 'M_LOG10E',
- 'M_PI',
- 'M_PI_2',
- 'M_PI_4',
- 'M_SQRT1_2',
- 'M_SQRT2',
- 'NULL',
- 'OBJPROP_ALIGN',
- 'OBJPROP_ANCHOR',
- 'OBJPROP_ANGLE',
- 'OBJPROP_ARROWCODE',
- 'OBJPROP_BACK',
- 'OBJPROP_BGCOLOR',
- 'OBJPROP_BMPFILE',
- 'OBJPROP_BORDER_COLOR',
- 'OBJPROP_BORDER_TYPE',
- 'OBJPROP_CHART_ID',
- 'OBJPROP_CHART_SCALE',
- 'OBJPROP_COLOR',
- 'OBJPROP_CORNER',
- 'OBJPROP_CREATETIME',
- 'OBJPROP_DATE_SCALE',
- 'OBJPROP_DEVIATION',
- 'OBJPROP_DRAWLINES',
- 'OBJPROP_ELLIPSE',
- 'OBJPROP_FIBOLEVELS',
- 'OBJPROP_FILL',
- 'OBJPROP_FIRSTLEVEL',
- 'OBJPROP_FONTSIZE',
- 'OBJPROP_FONT',
- 'OBJPROP_HIDDEN',
- 'OBJPROP_LEVELCOLOR',
- 'OBJPROP_LEVELSTYLE',
- 'OBJPROP_LEVELS',
- 'OBJPROP_LEVELTEXT',
- 'OBJPROP_LEVELVALUE',
- 'OBJPROP_LEVELWIDTH',
- 'OBJPROP_NAME',
- 'OBJPROP_PERIOD',
- 'OBJPROP_PRICE1',
- 'OBJPROP_PRICE2',
- 'OBJPROP_PRICE3',
- 'OBJPROP_PRICE',
- 'OBJPROP_PRICE_SCALE',
- 'OBJPROP_RAY',
- 'OBJPROP_RAY_RIGHT',
- 'OBJPROP_READONLY',
- 'OBJPROP_SCALE',
- 'OBJPROP_SELECTABLE',
- 'OBJPROP_SELECTED',
- 'OBJPROP_STATE',
- 'OBJPROP_STYLE',
- 'OBJPROP_SYMBOL',
- 'OBJPROP_TEXT',
- 'OBJPROP_TIME1',
- 'OBJPROP_TIME2',
- 'OBJPROP_TIME3',
- 'OBJPROP_TIMEFRAMES',
- 'OBJPROP_TIME',
- 'OBJPROP_TOOLTIP',
- 'OBJPROP_TYPE',
- 'OBJPROP_WIDTH',
- 'OBJPROP_XDISTANCE',
- 'OBJPROP_XOFFSET',
- 'OBJPROP_XSIZE',
- 'OBJPROP_YDISTANCE',
- 'OBJPROP_YOFFSET',
- 'OBJPROP_YSIZE',
- 'OBJPROP_ZORDER',
- 'OBJ_ALL_PERIODS',
- 'OBJ_ARROW',
- 'OBJ_ARROW_BUY',
- 'OBJ_ARROW_CHECK',
- 'OBJ_ARROW_DOWN',
- 'OBJ_ARROW_LEFT_PRICE',
- 'OBJ_ARROW_RIGHT_PRICE',
- 'OBJ_ARROW_SELL',
- 'OBJ_ARROW_STOP',
- 'OBJ_ARROW_THUMB_DOWN',
- 'OBJ_ARROW_THUMB_UP',
- 'OBJ_ARROW_UP',
- 'OBJ_BITMAP',
- 'OBJ_BITMAP_LABEL',
- 'OBJ_BUTTON',
- 'OBJ_CHANNEL',
- 'OBJ_CYCLES',
- 'OBJ_EDIT',
- 'OBJ_ELLIPSE',
- 'OBJ_EVENT',
- 'OBJ_EXPANSION',
- 'OBJ_FIBOARC',
- 'OBJ_FIBOCHANNEL',
- 'OBJ_FIBOFAN',
- 'OBJ_FIBOTIMES',
- 'OBJ_FIBO',
- 'OBJ_GANNFAN',
- 'OBJ_GANNGRID',
- 'OBJ_GANNLINE',
- 'OBJ_HLINE',
- 'OBJ_LABEL',
- 'OBJ_NO_PERIODS',
- 'OBJ_PERIOD_D1',
- 'OBJ_PERIOD_H1',
- 'OBJ_PERIOD_H4',
- 'OBJ_PERIOD_M1',
- 'OBJ_PERIOD_M5',
- 'OBJ_PERIOD_M15',
- 'OBJ_PERIOD_M30',
- 'OBJ_PERIOD_MN1',
- 'OBJ_PERIOD_W1',
- 'OBJ_PITCHFORK',
- 'OBJ_RECTANGLE',
- 'OBJ_RECTANGLE_LABEL',
- 'OBJ_REGRESSION',
- 'OBJ_STDDEVCHANNEL',
- 'OBJ_TEXT',
- 'OBJ_TRENDBYANGLE',
- 'OBJ_TREND',
- 'OBJ_TRIANGLE',
- 'OBJ_VLINE',
- 'OP_BUYLIMIT',
- 'OP_BUYSTOP',
- 'OP_BUY',
- 'OP_SELLLIMIT',
- 'OP_SELLSTOP',
- 'OP_SELL',
- 'PERIOD_CURRENT',
- 'PERIOD_D1',
- 'PERIOD_H1',
- 'PERIOD_H2',
- 'PERIOD_H3',
- 'PERIOD_H4',
- 'PERIOD_H6',
- 'PERIOD_H8',
- 'PERIOD_H12',
- 'PERIOD_M1',
- 'PERIOD_M2',
- 'PERIOD_M3',
- 'PERIOD_M4',
- 'PERIOD_M5',
- 'PERIOD_M6',
- 'PERIOD_M10',
- 'PERIOD_M12',
- 'PERIOD_M15',
- 'PERIOD_M20',
- 'PERIOD_M30',
- 'PERIOD_MN1',
- 'PERIOD_W1',
- 'POINTER_AUTOMATIC',
- 'POINTER_DYNAMIC',
- 'POINTER_INVALID'
- 'PRICE_CLOSE',
- 'PRICE_HIGH',
- 'PRICE_LOW',
- 'PRICE_MEDIAN',
- 'PRICE_OPEN',
- 'PRICE_TYPICAL',
- 'PRICE_WEIGHTED',
- 'PROGRAM_EXPERT',
- 'PROGRAM_INDICATOR',
- 'PROGRAM_SCRIPT',
- 'REASON_ACCOUNT',
- 'REASON_CHARTCHANGE',
- 'REASON_CHARTCLOSE',
- 'REASON_CLOSE',
- 'REASON_INITFAILED',
- 'REASON_PARAMETERS',
- 'REASON_PROGRAM'
- 'REASON_RECOMPILE',
- 'REASON_REMOVE',
- 'REASON_TEMPLATE',
- 'SATURDAY',
- 'SEEK_CUR',
- 'SEEK_END',
- 'SEEK_SET',
- 'SERIES_BARS_COUNT',
- 'SERIES_FIRSTDATE',
- 'SERIES_LASTBAR_DATE',
- 'SERIES_SERVER_FIRSTDATE',
- 'SERIES_SYNCHRONIZED',
- 'SERIES_TERMINAL_FIRSTDATE',
- 'SHORT_MAX',
- 'SHORT_MIN',
- 'STAT_BALANCEDD_PERCENT',
- 'STAT_BALANCEMIN',
- 'STAT_BALANCE_DDREL_PERCENT',
- 'STAT_BALANCE_DD',
- 'STAT_BALANCE_DD_RELATIVE',
- 'STAT_CONLOSSMAX',
- 'STAT_CONLOSSMAX_TRADES',
- 'STAT_CONPROFITMAX',
- 'STAT_CONPROFITMAX_TRADES',
- 'STAT_CUSTOM_ONTESTER',
- 'STAT_DEALS',
- 'STAT_EQUITYDD_PERCENT',
- 'STAT_EQUITYMIN',
- 'STAT_EQUITY_DDREL_PERCENT',
- 'STAT_EQUITY_DD',
- 'STAT_EQUITY_DD_RELATIVE',
- 'STAT_EXPECTED_PAYOFF',
- 'STAT_GROSS_LOSS',
- 'STAT_GROSS_PROFIT',
- 'STAT_INITIAL_DEPOSIT',
- 'STAT_LONG_TRADES',
- 'STAT_LOSSTRADES_AVGCON',
- 'STAT_LOSS_TRADES',
- 'STAT_MAX_CONLOSSES',
- 'STAT_MAX_CONLOSS_TRADES',
- 'STAT_MAX_CONPROFIT_TRADES',
- 'STAT_MAX_CONWINS',
- 'STAT_MAX_LOSSTRADE',
- 'STAT_MAX_PROFITTRADE',
- 'STAT_MIN_MARGINLEVEL',
- 'STAT_PROFITTRADES_AVGCON',
- 'STAT_PROFIT',
- 'STAT_PROFIT_FACTOR',
- 'STAT_PROFIT_LONGTRADES',
- 'STAT_PROFIT_SHORTTRADES',
- 'STAT_PROFIT_TRADES',
- 'STAT_RECOVERY_FACTOR',
- 'STAT_SHARPE_RATIO',
- 'STAT_SHORT_TRADES',
- 'STAT_TRADES',
- 'STAT_WITHDRAWAL',
- 'STO_CLOSECLOSE',
- 'STO_LOWHIGH',
- 'STYLE_DASHDOTDOT',
- 'STYLE_DASHDOT',
- 'STYLE_DASH',
- 'STYLE_DOT',
- 'STYLE_SOLID',
- 'SUNDAY',
- 'SYMBOL_ARROWDOWN',
- 'SYMBOL_ARROWUP',
- 'SYMBOL_CHECKSIGN',
- 'SYMBOL_LEFTPRICE',
- 'SYMBOL_RIGHTPRICE',
- 'SYMBOL_STOPSIGN',
- 'SYMBOL_THUMBSDOWN',
- 'SYMBOL_THUMBSUP',
- 'TERMINAL_BUILD',
- 'TERMINAL_CODEPAGE',
- 'TERMINAL_COMMONDATA_PATH',
- 'TERMINAL_COMPANY',
- 'TERMINAL_CONNECTED',
- 'TERMINAL_CPU_CORES',
- 'TERMINAL_DATA_PATH',
- 'TERMINAL_DISK_SPACE',
- 'TERMINAL_DLLS_ALLOWED',
- 'TERMINAL_EMAIL_ENABLED',
- 'TERMINAL_FTP_ENABLED',
- 'TERMINAL_LANGUAGE',
- 'TERMINAL_MAXBARS',
- 'TERMINAL_MEMORY_AVAILABLE',
- 'TERMINAL_MEMORY_PHYSICAL',
- 'TERMINAL_MEMORY_TOTAL',
- 'TERMINAL_MEMORY_USED',
- 'TERMINAL_NAME',
- 'TERMINAL_OPENCL_SUPPORT',
- 'TERMINAL_PATH',
- 'TERMINAL_TRADE_ALLOWED',
- 'TERMINAL_X64',
- 'THURSDAY',
- 'TRADE_ACTION_DEAL',
- 'TRADE_ACTION_MODIFY',
- 'TRADE_ACTION_PENDING',
- 'TRADE_ACTION_REMOVE',
- 'TRADE_ACTION_SLTP',
- 'TUESDAY',
- 'UCHAR_MAX',
- 'UINT_MAX',
- 'ULONG_MAX',
- 'USHORT_MAX',
- 'VOLUME_REAL',
- 'VOLUME_TICK',
- 'WEDNESDAY',
- 'WHOLE_ARRAY',
- 'WRONG_VALUE',
- 'clrNONE',
- '__DATETIME__',
- '__DATE__',
- '__FILE__',
- '__FUNCSIG__',
- '__FUNCTION__',
- '__LINE__',
- '__MQL4BUILD__',
- '__MQLBUILD__',
- '__PATH__',
-)
-
-colors = (
- 'AliceBlue',
- 'AntiqueWhite',
- 'Aquamarine',
- 'Aqua',
- 'Beige',
- 'Bisque',
- 'Black',
- 'BlanchedAlmond',
- 'BlueViolet',
- 'Blue',
- 'Brown',
- 'BurlyWood',
- 'CadetBlue',
- 'Chartreuse',
- 'Chocolate',
- 'Coral',
- 'CornflowerBlue',
- 'Cornsilk',
- 'Crimson',
- 'DarkBlue',
- 'DarkGoldenrod',
- 'DarkGray',
- 'DarkGreen',
- 'DarkKhaki',
- 'DarkOliveGreen',
- 'DarkOrange',
- 'DarkOrchid',
- 'DarkSalmon',
- 'DarkSeaGreen',
- 'DarkSlateBlue',
- 'DarkSlateGray',
- 'DarkTurquoise',
- 'DarkViolet',
- 'DeepPink',
- 'DeepSkyBlue',
- 'DimGray',
- 'DodgerBlue',
- 'FireBrick',
- 'ForestGreen',
- 'Gainsboro',
- 'Goldenrod',
- 'Gold',
- 'Gray',
- 'GreenYellow',
- 'Green',
- 'Honeydew',
- 'HotPink',
- 'IndianRed',
- 'Indigo',
- 'Ivory',
- 'Khaki',
- 'LavenderBlush',
- 'Lavender',
- 'LawnGreen',
- 'LemonChiffon',
- 'LightBlue',
- 'LightCoral',
- 'LightCyan',
- 'LightGoldenrod',
- 'LightGray',
- 'LightGreen',
- 'LightPink',
- 'LightSalmon',
- 'LightSeaGreen',
- 'LightSkyBlue',
- 'LightSlateGray',
- 'LightSteelBlue',
- 'LightYellow',
- 'LimeGreen',
- 'Lime',
- 'Linen',
- 'Magenta',
- 'Maroon',
- 'MediumAquamarine',
- 'MediumBlue',
- 'MediumOrchid',
- 'MediumPurple',
- 'MediumSeaGreen',
- 'MediumSlateBlue',
- 'MediumSpringGreen',
- 'MediumTurquoise',
- 'MediumVioletRed',
- 'MidnightBlue',
- 'MintCream',
- 'MistyRose',
- 'Moccasin',
- 'NavajoWhite',
- 'Navy',
- 'OldLace',
- 'OliveDrab',
- 'Olive',
- 'OrangeRed',
- 'Orange',
- 'Orchid',
- 'PaleGoldenrod',
- 'PaleGreen',
- 'PaleTurquoise',
- 'PaleVioletRed',
- 'PapayaWhip',
- 'PeachPuff',
- 'Peru',
- 'Pink',
- 'Plum',
- 'PowderBlue',
- 'Purple',
- 'Red',
- 'RosyBrown',
- 'RoyalBlue',
- 'SaddleBrown',
- 'Salmon',
- 'SandyBrown',
- 'SeaGreen',
- 'Seashell',
- 'Sienna',
- 'Silver',
- 'SkyBlue',
- 'SlateBlue',
- 'SlateGray',
- 'Snow',
- 'SpringGreen',
- 'SteelBlue',
- 'Tan',
- 'Teal',
- 'Thistle',
- 'Tomato',
- 'Turquoise',
- 'Violet',
- 'Wheat',
- 'WhiteSmoke',
- 'White',
- 'YellowGreen',
- 'Yellow',
-)
-
-keywords = (
- 'input', '_Digits', '_Point', '_LastError', '_Period', '_RandomSeed',
- '_StopFlag', '_Symbol', '_UninitReason', 'Ask', 'Bars', 'Bid',
- 'Close', 'Digits', 'High', 'Low', 'Open', 'Point', 'Time',
- 'Volume',
-)
-c_types = (
- 'void', 'char', 'uchar', 'bool', 'short', 'ushort', 'int', 'uint',
- 'color', 'long', 'ulong', 'datetime', 'float', 'double',
- 'string',
-)
diff --git a/pygments/lexers/_openedge_builtins.py b/pygments/lexers/_openedge_builtins.py
deleted file mode 100644
index 09587e00..00000000
--- a/pygments/lexers/_openedge_builtins.py
+++ /dev/null
@@ -1,2547 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._openedge_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Builtin list for the OpenEdgeLexer.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-OPENEDGEKEYWORDS = (
- 'ABSOLUTE',
- 'ABS',
- 'ABSO',
- 'ABSOL',
- 'ABSOLU',
- 'ABSOLUT',
- 'ACCELERATOR',
- 'ACCUMULATE',
- 'ACCUM',
- 'ACCUMU',
- 'ACCUMUL',
- 'ACCUMULA',
- 'ACCUMULAT',
- 'ACTIVE-FORM',
- 'ACTIVE-WINDOW',
- 'ADD',
- 'ADD-BUFFER',
- 'ADD-CALC-COLUMN',
- 'ADD-COLUMNS-FROM',
- 'ADD-EVENTS-PROCEDURE',
- 'ADD-FIELDS-FROM',
- 'ADD-FIRST',
- 'ADD-INDEX-FIELD',
- 'ADD-LAST',
- 'ADD-LIKE-COLUMN',
- 'ADD-LIKE-FIELD',
- 'ADD-LIKE-INDEX',
- 'ADD-NEW-FIELD',
- 'ADD-NEW-INDEX',
- 'ADD-SCHEMA-LOCATION',
- 'ADD-SUPER-PROCEDURE',
- 'ADM-DATA',
- 'ADVISE',
- 'ALERT-BOX',
- 'ALIAS',
- 'ALL',
- 'ALLOW-COLUMN-SEARCHING',
- 'ALLOW-REPLICATION',
- 'ALTER',
- 'ALWAYS-ON-TOP',
- 'AMBIGUOUS',
- 'AMBIG',
- 'AMBIGU',
- 'AMBIGUO',
- 'AMBIGUOU',
- 'ANALYZE',
- 'ANALYZ',
- 'AND',
- 'ANSI-ONLY',
- 'ANY',
- 'ANYWHERE',
- 'APPEND',
- 'APPL-ALERT-BOXES',
- 'APPL-ALERT',
- 'APPL-ALERT-',
- 'APPL-ALERT-B',
- 'APPL-ALERT-BO',
- 'APPL-ALERT-BOX',
- 'APPL-ALERT-BOXE',
- 'APPL-CONTEXT-ID',
- 'APPLICATION',
- 'APPLY',
- 'APPSERVER-INFO',
- 'APPSERVER-PASSWORD',
- 'APPSERVER-USERID',
- 'ARRAY-MESSAGE',
- 'AS',
- 'ASC',
- 'ASCENDING',
- 'ASCE',
- 'ASCEN',
- 'ASCEND',
- 'ASCENDI',
- 'ASCENDIN',
- 'ASK-OVERWRITE',
- 'ASSEMBLY',
- 'ASSIGN',
- 'ASYNCHRONOUS',
- 'ASYNC-REQUEST-COUNT',
- 'ASYNC-REQUEST-HANDLE',
- 'AT',
- 'ATTACHED-PAIRLIST',
- 'ATTR-SPACE',
- 'ATTR',
- 'ATTRI',
- 'ATTRIB',
- 'ATTRIBU',
- 'ATTRIBUT',
- 'AUDIT-CONTROL',
- 'AUDIT-ENABLED',
- 'AUDIT-EVENT-CONTEXT',
- 'AUDIT-POLICY',
- 'AUTHENTICATION-FAILED',
- 'AUTHORIZATION',
- 'AUTO-COMPLETION',
- 'AUTO-COMP',
- 'AUTO-COMPL',
- 'AUTO-COMPLE',
- 'AUTO-COMPLET',
- 'AUTO-COMPLETI',
- 'AUTO-COMPLETIO',
- 'AUTO-ENDKEY',
- 'AUTO-END-KEY',
- 'AUTO-GO',
- 'AUTO-INDENT',
- 'AUTO-IND',
- 'AUTO-INDE',
- 'AUTO-INDEN',
- 'AUTOMATIC',
- 'AUTO-RESIZE',
- 'AUTO-RETURN',
- 'AUTO-RET',
- 'AUTO-RETU',
- 'AUTO-RETUR',
- 'AUTO-SYNCHRONIZE',
- 'AUTO-ZAP',
- 'AUTO-Z',
- 'AUTO-ZA',
- 'AVAILABLE',
- 'AVAIL',
- 'AVAILA',
- 'AVAILAB',
- 'AVAILABL',
- 'AVAILABLE-FORMATS',
- 'AVERAGE',
- 'AVE',
- 'AVER',
- 'AVERA',
- 'AVERAG',
- 'AVG',
- 'BACKGROUND',
- 'BACK',
- 'BACKG',
- 'BACKGR',
- 'BACKGRO',
- 'BACKGROU',
- 'BACKGROUN',
- 'BACKWARDS',
- 'BACKWARD',
- 'BASE64-DECODE',
- 'BASE64-ENCODE',
- 'BASE-ADE',
- 'BASE-KEY',
- 'BATCH-MODE',
- 'BATCH',
- 'BATCH-',
- 'BATCH-M',
- 'BATCH-MO',
- 'BATCH-MOD',
- 'BATCH-SIZE',
- 'BEFORE-HIDE',
- 'BEFORE-H',
- 'BEFORE-HI',
- 'BEFORE-HID',
- 'BEGIN-EVENT-GROUP',
- 'BEGINS',
- 'BELL',
- 'BETWEEN',
- 'BGCOLOR',
- 'BGC',
- 'BGCO',
- 'BGCOL',
- 'BGCOLO',
- 'BIG-ENDIAN',
- 'BINARY',
- 'BIND',
- 'BIND-WHERE',
- 'BLANK',
- 'BLOCK-ITERATION-DISPLAY',
- 'BORDER-BOTTOM-CHARS',
- 'BORDER-B',
- 'BORDER-BO',
- 'BORDER-BOT',
- 'BORDER-BOTT',
- 'BORDER-BOTTO',
- 'BORDER-BOTTOM-PIXELS',
- 'BORDER-BOTTOM-P',
- 'BORDER-BOTTOM-PI',
- 'BORDER-BOTTOM-PIX',
- 'BORDER-BOTTOM-PIXE',
- 'BORDER-BOTTOM-PIXEL',
- 'BORDER-LEFT-CHARS',
- 'BORDER-L',
- 'BORDER-LE',
- 'BORDER-LEF',
- 'BORDER-LEFT',
- 'BORDER-LEFT-',
- 'BORDER-LEFT-C',
- 'BORDER-LEFT-CH',
- 'BORDER-LEFT-CHA',
- 'BORDER-LEFT-CHAR',
- 'BORDER-LEFT-PIXELS',
- 'BORDER-LEFT-P',
- 'BORDER-LEFT-PI',
- 'BORDER-LEFT-PIX',
- 'BORDER-LEFT-PIXE',
- 'BORDER-LEFT-PIXEL',
- 'BORDER-RIGHT-CHARS',
- 'BORDER-R',
- 'BORDER-RI',
- 'BORDER-RIG',
- 'BORDER-RIGH',
- 'BORDER-RIGHT',
- 'BORDER-RIGHT-',
- 'BORDER-RIGHT-C',
- 'BORDER-RIGHT-CH',
- 'BORDER-RIGHT-CHA',
- 'BORDER-RIGHT-CHAR',
- 'BORDER-RIGHT-PIXELS',
- 'BORDER-RIGHT-P',
- 'BORDER-RIGHT-PI',
- 'BORDER-RIGHT-PIX',
- 'BORDER-RIGHT-PIXE',
- 'BORDER-RIGHT-PIXEL',
- 'BORDER-TOP-CHARS',
- 'BORDER-T',
- 'BORDER-TO',
- 'BORDER-TOP',
- 'BORDER-TOP-',
- 'BORDER-TOP-C',
- 'BORDER-TOP-CH',
- 'BORDER-TOP-CHA',
- 'BORDER-TOP-CHAR',
- 'BORDER-TOP-PIXELS',
- 'BORDER-TOP-P',
- 'BORDER-TOP-PI',
- 'BORDER-TOP-PIX',
- 'BORDER-TOP-PIXE',
- 'BORDER-TOP-PIXEL',
- 'BOX',
- 'BOX-SELECTABLE',
- 'BOX-SELECT',
- 'BOX-SELECTA',
- 'BOX-SELECTAB',
- 'BOX-SELECTABL',
- 'BREAK',
- 'BROWSE',
- 'BUFFER',
- 'BUFFER-CHARS',
- 'BUFFER-COMPARE',
- 'BUFFER-COPY',
- 'BUFFER-CREATE',
- 'BUFFER-DELETE',
- 'BUFFER-FIELD',
- 'BUFFER-HANDLE',
- 'BUFFER-LINES',
- 'BUFFER-NAME',
- 'BUFFER-RELEASE',
- 'BUFFER-VALUE',
- 'BUTTON',
- 'BUTTONS',
- 'BY',
- 'BY-POINTER',
- 'BY-VARIANT-POINTER',
- 'CACHE',
- 'CACHE-SIZE',
- 'CALL',
- 'CALL-NAME',
- 'CALL-TYPE',
- 'CANCEL-BREAK',
- 'CANCEL-BUTTON',
- 'CAN-CREATE',
- 'CAN-DELETE',
- 'CAN-DO',
- 'CAN-FIND',
- 'CAN-QUERY',
- 'CAN-READ',
- 'CAN-SET',
- 'CAN-WRITE',
- 'CAPS',
- 'CAREFUL-PAINT',
- 'CASE',
- 'CASE-SENSITIVE',
- 'CASE-SEN',
- 'CASE-SENS',
- 'CASE-SENSI',
- 'CASE-SENSIT',
- 'CASE-SENSITI',
- 'CASE-SENSITIV',
- 'CAST',
- 'CATCH',
- 'CDECL',
- 'CENTERED',
- 'CENTER',
- 'CENTERE',
- 'CHAINED',
- 'CHARACTER_LENGTH',
- 'CHARSET',
- 'CHECK',
- 'CHECKED',
- 'CHOOSE',
- 'CHR',
- 'CLASS',
- 'CLASS-TYPE',
- 'CLEAR',
- 'CLEAR-APPL-CONTEXT',
- 'CLEAR-LOG',
- 'CLEAR-SELECTION',
- 'CLEAR-SELECT',
- 'CLEAR-SELECTI',
- 'CLEAR-SELECTIO',
- 'CLEAR-SORT-ARROWS',
- 'CLEAR-SORT-ARROW',
- 'CLIENT-CONNECTION-ID',
- 'CLIENT-PRINCIPAL',
- 'CLIENT-TTY',
- 'CLIENT-TYPE',
- 'CLIENT-WORKSTATION',
- 'CLIPBOARD',
- 'CLOSE',
- 'CLOSE-LOG',
- 'CODE',
- 'CODEBASE-LOCATOR',
- 'CODEPAGE',
- 'CODEPAGE-CONVERT',
- 'COLLATE',
- 'COL-OF',
- 'COLON',
- 'COLON-ALIGNED',
- 'COLON-ALIGN',
- 'COLON-ALIGNE',
- 'COLOR',
- 'COLOR-TABLE',
- 'COLUMN',
- 'COL',
- 'COLU',
- 'COLUM',
- 'COLUMN-BGCOLOR',
- 'COLUMN-DCOLOR',
- 'COLUMN-FGCOLOR',
- 'COLUMN-FONT',
- 'COLUMN-LABEL',
- 'COLUMN-LAB',
- 'COLUMN-LABE',
- 'COLUMN-MOVABLE',
- 'COLUMN-OF',
- 'COLUMN-PFCOLOR',
- 'COLUMN-READ-ONLY',
- 'COLUMN-RESIZABLE',
- 'COLUMNS',
- 'COLUMN-SCROLLING',
- 'COMBO-BOX',
- 'COMMAND',
- 'COMPARES',
- 'COMPILE',
- 'COMPILER',
- 'COMPLETE',
- 'COM-SELF',
- 'CONFIG-NAME',
- 'CONNECT',
- 'CONNECTED',
- 'CONSTRUCTOR',
- 'CONTAINS',
- 'CONTENTS',
- 'CONTEXT',
- 'CONTEXT-HELP',
- 'CONTEXT-HELP-FILE',
- 'CONTEXT-HELP-ID',
- 'CONTEXT-POPUP',
- 'CONTROL',
- 'CONTROL-BOX',
- 'CONTROL-FRAME',
- 'CONVERT',
- 'CONVERT-3D-COLORS',
- 'CONVERT-TO-OFFSET',
- 'CONVERT-TO-OFFS',
- 'CONVERT-TO-OFFSE',
- 'COPY-DATASET',
- 'COPY-LOB',
- 'COPY-SAX-ATTRIBUTES',
- 'COPY-TEMP-TABLE',
- 'COUNT',
- 'COUNT-OF',
- 'CPCASE',
- 'CPCOLL',
- 'CPINTERNAL',
- 'CPLOG',
- 'CPPRINT',
- 'CPRCODEIN',
- 'CPRCODEOUT',
- 'CPSTREAM',
- 'CPTERM',
- 'CRC-VALUE',
- 'CREATE',
- 'CREATE-LIKE',
- 'CREATE-LIKE-SEQUENTIAL',
- 'CREATE-NODE-NAMESPACE',
- 'CREATE-RESULT-LIST-ENTRY',
- 'CREATE-TEST-FILE',
- 'CURRENT',
- 'CURRENT_DATE',
- 'CURRENT-CHANGED',
- 'CURRENT-COLUMN',
- 'CURRENT-ENVIRONMENT',
- 'CURRENT-ENV',
- 'CURRENT-ENVI',
- 'CURRENT-ENVIR',
- 'CURRENT-ENVIRO',
- 'CURRENT-ENVIRON',
- 'CURRENT-ENVIRONM',
- 'CURRENT-ENVIRONME',
- 'CURRENT-ENVIRONMEN',
- 'CURRENT-ITERATION',
- 'CURRENT-LANGUAGE',
- 'CURRENT-LANG',
- 'CURRENT-LANGU',
- 'CURRENT-LANGUA',
- 'CURRENT-LANGUAG',
- 'CURRENT-QUERY',
- 'CURRENT-RESULT-ROW',
- 'CURRENT-ROW-MODIFIED',
- 'CURRENT-VALUE',
- 'CURRENT-WINDOW',
- 'CURSOR',
- 'CURS',
- 'CURSO',
- 'CURSOR-CHAR',
- 'CURSOR-LINE',
- 'CURSOR-OFFSET',
- 'DATABASE',
- 'DATA-BIND',
- 'DATA-ENTRY-RETURN',
- 'DATA-ENTRY-RET',
- 'DATA-ENTRY-RETU',
- 'DATA-ENTRY-RETUR',
- 'DATA-RELATION',
- 'DATA-REL',
- 'DATA-RELA',
- 'DATA-RELAT',
- 'DATA-RELATI',
- 'DATA-RELATIO',
- 'DATASERVERS',
- 'DATASET',
- 'DATASET-HANDLE',
- 'DATA-SOURCE',
- 'DATA-SOURCE-COMPLETE-MAP',
- 'DATA-SOURCE-MODIFIED',
- 'DATA-SOURCE-ROWID',
- 'DATA-TYPE',
- 'DATA-T',
- 'DATA-TY',
- 'DATA-TYP',
- 'DATE-FORMAT',
- 'DATE-F',
- 'DATE-FO',
- 'DATE-FOR',
- 'DATE-FORM',
- 'DATE-FORMA',
- 'DAY',
- 'DBCODEPAGE',
- 'DBCOLLATION',
- 'DBNAME',
- 'DBPARAM',
- 'DB-REFERENCES',
- 'DBRESTRICTIONS',
- 'DBREST',
- 'DBRESTR',
- 'DBRESTRI',
- 'DBRESTRIC',
- 'DBRESTRICT',
- 'DBRESTRICTI',
- 'DBRESTRICTIO',
- 'DBRESTRICTION',
- 'DBTASKID',
- 'DBTYPE',
- 'DBVERSION',
- 'DBVERS',
- 'DBVERSI',
- 'DBVERSIO',
- 'DCOLOR',
- 'DDE',
- 'DDE-ERROR',
- 'DDE-ID',
- 'DDE-I',
- 'DDE-ITEM',
- 'DDE-NAME',
- 'DDE-TOPIC',
- 'DEBLANK',
- 'DEBUG',
- 'DEBU',
- 'DEBUG-ALERT',
- 'DEBUGGER',
- 'DEBUG-LIST',
- 'DECIMALS',
- 'DECLARE',
- 'DECLARE-NAMESPACE',
- 'DECRYPT',
- 'DEFAULT',
- 'DEFAULT-BUFFER-HANDLE',
- 'DEFAULT-BUTTON',
- 'DEFAUT-B',
- 'DEFAUT-BU',
- 'DEFAUT-BUT',
- 'DEFAUT-BUTT',
- 'DEFAUT-BUTTO',
- 'DEFAULT-COMMIT',
- 'DEFAULT-EXTENSION',
- 'DEFAULT-EX',
- 'DEFAULT-EXT',
- 'DEFAULT-EXTE',
- 'DEFAULT-EXTEN',
- 'DEFAULT-EXTENS',
- 'DEFAULT-EXTENSI',
- 'DEFAULT-EXTENSIO',
- 'DEFAULT-NOXLATE',
- 'DEFAULT-NOXL',
- 'DEFAULT-NOXLA',
- 'DEFAULT-NOXLAT',
- 'DEFAULT-VALUE',
- 'DEFAULT-WINDOW',
- 'DEFINED',
- 'DEFINE-USER-EVENT-MANAGER',
- 'DELETE',
- 'DEL',
- 'DELE',
- 'DELET',
- 'DELETE-CHARACTER',
- 'DELETE-CHAR',
- 'DELETE-CHARA',
- 'DELETE-CHARAC',
- 'DELETE-CHARACT',
- 'DELETE-CHARACTE',
- 'DELETE-CURRENT-ROW',
- 'DELETE-LINE',
- 'DELETE-RESULT-LIST-ENTRY',
- 'DELETE-SELECTED-ROW',
- 'DELETE-SELECTED-ROWS',
- 'DELIMITER',
- 'DESC',
- 'DESCENDING',
- 'DESCE',
- 'DESCEN',
- 'DESCEND',
- 'DESCENDI',
- 'DESCENDIN',
- 'DESELECT-FOCUSED-ROW',
- 'DESELECTION',
- 'DESELECT-ROWS',
- 'DESELECT-SELECTED-ROW',
- 'DESTRUCTOR',
- 'DIALOG-BOX',
- 'DICTIONARY',
- 'DICT',
- 'DICTI',
- 'DICTIO',
- 'DICTION',
- 'DICTIONA',
- 'DICTIONAR',
- 'DIR',
- 'DISABLE',
- 'DISABLE-AUTO-ZAP',
- 'DISABLED',
- 'DISABLE-DUMP-TRIGGERS',
- 'DISABLE-LOAD-TRIGGERS',
- 'DISCONNECT',
- 'DISCON',
- 'DISCONN',
- 'DISCONNE',
- 'DISCONNEC',
- 'DISP',
- 'DISPLAY',
- 'DISPL',
- 'DISPLA',
- 'DISPLAY-MESSAGE',
- 'DISPLAY-TYPE',
- 'DISPLAY-T',
- 'DISPLAY-TY',
- 'DISPLAY-TYP',
- 'DISTINCT',
- 'DO',
- 'DOMAIN-DESCRIPTION',
- 'DOMAIN-NAME',
- 'DOMAIN-TYPE',
- 'DOS',
- 'DOUBLE',
- 'DOWN',
- 'DRAG-ENABLED',
- 'DROP',
- 'DROP-DOWN',
- 'DROP-DOWN-LIST',
- 'DROP-FILE-NOTIFY',
- 'DROP-TARGET',
- 'DUMP',
- 'DYNAMIC',
- 'DYNAMIC-FUNCTION',
- 'EACH',
- 'ECHO',
- 'EDGE-CHARS',
- 'EDGE',
- 'EDGE-',
- 'EDGE-C',
- 'EDGE-CH',
- 'EDGE-CHA',
- 'EDGE-CHAR',
- 'EDGE-PIXELS',
- 'EDGE-P',
- 'EDGE-PI',
- 'EDGE-PIX',
- 'EDGE-PIXE',
- 'EDGE-PIXEL',
- 'EDIT-CAN-PASTE',
- 'EDIT-CAN-UNDO',
- 'EDIT-CLEAR',
- 'EDIT-COPY',
- 'EDIT-CUT',
- 'EDITING',
- 'EDITOR',
- 'EDIT-PASTE',
- 'EDIT-UNDO',
- 'ELSE',
- 'EMPTY',
- 'EMPTY-TEMP-TABLE',
- 'ENABLE',
- 'ENABLED-FIELDS',
- 'ENCODE',
- 'ENCRYPT',
- 'ENCRYPT-AUDIT-MAC-KEY',
- 'ENCRYPTION-SALT',
- 'END',
- 'END-DOCUMENT',
- 'END-ELEMENT',
- 'END-EVENT-GROUP',
- 'END-FILE-DROP',
- 'ENDKEY',
- 'END-KEY',
- 'END-MOVE',
- 'END-RESIZE',
- 'END-ROW-RESIZE',
- 'END-USER-PROMPT',
- 'ENTERED',
- 'ENTRY',
- 'EQ',
- 'ERROR',
- 'ERROR-COLUMN',
- 'ERROR-COL',
- 'ERROR-COLU',
- 'ERROR-COLUM',
- 'ERROR-ROW',
- 'ERROR-STACK-TRACE',
- 'ERROR-STATUS',
- 'ERROR-STAT',
- 'ERROR-STATU',
- 'ESCAPE',
- 'ETIME',
- 'EVENT-GROUP-ID',
- 'EVENT-PROCEDURE',
- 'EVENT-PROCEDURE-CONTEXT',
- 'EVENTS',
- 'EVENT',
- 'EVENT-TYPE',
- 'EVENT-T',
- 'EVENT-TY',
- 'EVENT-TYP',
- 'EXCEPT',
- 'EXCLUSIVE-ID',
- 'EXCLUSIVE-LOCK',
- 'EXCLUSIVE',
- 'EXCLUSIVE-',
- 'EXCLUSIVE-L',
- 'EXCLUSIVE-LO',
- 'EXCLUSIVE-LOC',
- 'EXCLUSIVE-WEB-USER',
- 'EXECUTE',
- 'EXISTS',
- 'EXP',
- 'EXPAND',
- 'EXPANDABLE',
- 'EXPLICIT',
- 'EXPORT',
- 'EXPORT-PRINCIPAL',
- 'EXTENDED',
- 'EXTENT',
- 'EXTERNAL',
- 'FALSE',
- 'FETCH',
- 'FETCH-SELECTED-ROW',
- 'FGCOLOR',
- 'FGC',
- 'FGCO',
- 'FGCOL',
- 'FGCOLO',
- 'FIELD',
- 'FIELDS',
- 'FILE',
- 'FILE-CREATE-DATE',
- 'FILE-CREATE-TIME',
- 'FILE-INFORMATION',
- 'FILE-INFO',
- 'FILE-INFOR',
- 'FILE-INFORM',
- 'FILE-INFORMA',
- 'FILE-INFORMAT',
- 'FILE-INFORMATI',
- 'FILE-INFORMATIO',
- 'FILE-MOD-DATE',
- 'FILE-MOD-TIME',
- 'FILENAME',
- 'FILE-NAME',
- 'FILE-OFFSET',
- 'FILE-OFF',
- 'FILE-OFFS',
- 'FILE-OFFSE',
- 'FILE-SIZE',
- 'FILE-TYPE',
- 'FILL',
- 'FILLED',
- 'FILL-IN',
- 'FILTERS',
- 'FINAL',
- 'FINALLY',
- 'FIND',
- 'FIND-BY-ROWID',
- 'FIND-CASE-SENSITIVE',
- 'FIND-CURRENT',
- 'FINDER',
- 'FIND-FIRST',
- 'FIND-GLOBAL',
- 'FIND-LAST',
- 'FIND-NEXT-OCCURRENCE',
- 'FIND-PREV-OCCURRENCE',
- 'FIND-SELECT',
- 'FIND-UNIQUE',
- 'FIND-WRAP-AROUND',
- 'FIRST',
- 'FIRST-ASYNCH-REQUEST',
- 'FIRST-CHILD',
- 'FIRST-COLUMN',
- 'FIRST-FORM',
- 'FIRST-OBJECT',
- 'FIRST-OF',
- 'FIRST-PROCEDURE',
- 'FIRST-PROC',
- 'FIRST-PROCE',
- 'FIRST-PROCED',
- 'FIRST-PROCEDU',
- 'FIRST-PROCEDUR',
- 'FIRST-SERVER',
- 'FIRST-TAB-ITEM',
- 'FIRST-TAB-I',
- 'FIRST-TAB-IT',
- 'FIRST-TAB-ITE',
- 'FIT-LAST-COLUMN',
- 'FIXED-ONLY',
- 'FLAT-BUTTON',
- 'FLOAT',
- 'FOCUS',
- 'FOCUSED-ROW',
- 'FOCUSED-ROW-SELECTED',
- 'FONT',
- 'FONT-TABLE',
- 'FOR',
- 'FORCE-FILE',
- 'FOREGROUND',
- 'FORE',
- 'FOREG',
- 'FOREGR',
- 'FOREGRO',
- 'FOREGROU',
- 'FOREGROUN',
- 'FORM',
- 'FORMAT',
- 'FORMA',
- 'FORMATTED',
- 'FORMATTE',
- 'FORM-LONG-INPUT',
- 'FORWARD',
- 'FORWARDS',
- 'FRAGMENT',
- 'FRAGMEN',
- 'FRAME',
- 'FRAM',
- 'FRAME-COL',
- 'FRAME-DB',
- 'FRAME-DOWN',
- 'FRAME-FIELD',
- 'FRAME-FILE',
- 'FRAME-INDEX',
- 'FRAME-INDE',
- 'FRAME-LINE',
- 'FRAME-NAME',
- 'FRAME-ROW',
- 'FRAME-SPACING',
- 'FRAME-SPA',
- 'FRAME-SPAC',
- 'FRAME-SPACI',
- 'FRAME-SPACIN',
- 'FRAME-VALUE',
- 'FRAME-VAL',
- 'FRAME-VALU',
- 'FRAME-X',
- 'FRAME-Y',
- 'FREQUENCY',
- 'FROM',
- 'FROM-CHARS',
- 'FROM-C',
- 'FROM-CH',
- 'FROM-CHA',
- 'FROM-CHAR',
- 'FROM-CURRENT',
- 'FROM-CUR',
- 'FROM-CURR',
- 'FROM-CURRE',
- 'FROM-CURREN',
- 'FROM-PIXELS',
- 'FROM-P',
- 'FROM-PI',
- 'FROM-PIX',
- 'FROM-PIXE',
- 'FROM-PIXEL',
- 'FULL-HEIGHT-CHARS',
- 'FULL-HEIGHT',
- 'FULL-HEIGHT-',
- 'FULL-HEIGHT-C',
- 'FULL-HEIGHT-CH',
- 'FULL-HEIGHT-CHA',
- 'FULL-HEIGHT-CHAR',
- 'FULL-HEIGHT-PIXELS',
- 'FULL-HEIGHT-P',
- 'FULL-HEIGHT-PI',
- 'FULL-HEIGHT-PIX',
- 'FULL-HEIGHT-PIXE',
- 'FULL-HEIGHT-PIXEL',
- 'FULL-PATHNAME',
- 'FULL-PATHN',
- 'FULL-PATHNA',
- 'FULL-PATHNAM',
- 'FULL-WIDTH-CHARS',
- 'FULL-WIDTH',
- 'FULL-WIDTH-',
- 'FULL-WIDTH-C',
- 'FULL-WIDTH-CH',
- 'FULL-WIDTH-CHA',
- 'FULL-WIDTH-CHAR',
- 'FULL-WIDTH-PIXELS',
- 'FULL-WIDTH-P',
- 'FULL-WIDTH-PI',
- 'FULL-WIDTH-PIX',
- 'FULL-WIDTH-PIXE',
- 'FULL-WIDTH-PIXEL',
- 'FUNCTION',
- 'FUNCTION-CALL-TYPE',
- 'GATEWAYS',
- 'GATEWAY',
- 'GE',
- 'GENERATE-MD5',
- 'GENERATE-PBE-KEY',
- 'GENERATE-PBE-SALT',
- 'GENERATE-RANDOM-KEY',
- 'GENERATE-UUID',
- 'GET',
- 'GET-ATTR-CALL-TYPE',
- 'GET-ATTRIBUTE-NODE',
- 'GET-BINARY-DATA',
- 'GET-BLUE-VALUE',
- 'GET-BLUE',
- 'GET-BLUE-',
- 'GET-BLUE-V',
- 'GET-BLUE-VA',
- 'GET-BLUE-VAL',
- 'GET-BLUE-VALU',
- 'GET-BROWSE-COLUMN',
- 'GET-BUFFER-HANDLEGETBYTE',
- 'GET-BYTE',
- 'GET-CALLBACK-PROC-CONTEXT',
- 'GET-CALLBACK-PROC-NAME',
- 'GET-CGI-LIST',
- 'GET-CGI-LONG-VALUE',
- 'GET-CGI-VALUE',
- 'GET-CODEPAGES',
- 'GET-COLLATIONS',
- 'GET-CONFIG-VALUE',
- 'GET-CURRENT',
- 'GET-DOUBLE',
- 'GET-DROPPED-FILE',
- 'GET-DYNAMIC',
- 'GET-ERROR-COLUMN',
- 'GET-ERROR-ROW',
- 'GET-FILE',
- 'GET-FILE-NAME',
- 'GET-FILE-OFFSET',
- 'GET-FILE-OFFSE',
- 'GET-FIRST',
- 'GET-FLOAT',
- 'GET-GREEN-VALUE',
- 'GET-GREEN',
- 'GET-GREEN-',
- 'GET-GREEN-V',
- 'GET-GREEN-VA',
- 'GET-GREEN-VAL',
- 'GET-GREEN-VALU',
- 'GET-INDEX-BY-NAMESPACE-NAME',
- 'GET-INDEX-BY-QNAME',
- 'GET-INT64',
- 'GET-ITERATION',
- 'GET-KEY-VALUE',
- 'GET-KEY-VAL',
- 'GET-KEY-VALU',
- 'GET-LAST',
- 'GET-LOCALNAME-BY-INDEX',
- 'GET-LONG',
- 'GET-MESSAGE',
- 'GET-NEXT',
- 'GET-NUMBER',
- 'GET-POINTER-VALUE',
- 'GET-PREV',
- 'GET-PRINTERS',
- 'GET-PROPERTY',
- 'GET-QNAME-BY-INDEX',
- 'GET-RED-VALUE',
- 'GET-RED',
- 'GET-RED-',
- 'GET-RED-V',
- 'GET-RED-VA',
- 'GET-RED-VAL',
- 'GET-RED-VALU',
- 'GET-REPOSITIONED-ROW',
- 'GET-RGB-VALUE',
- 'GET-SELECTED-WIDGET',
- 'GET-SELECTED',
- 'GET-SELECTED-',
- 'GET-SELECTED-W',
- 'GET-SELECTED-WI',
- 'GET-SELECTED-WID',
- 'GET-SELECTED-WIDG',
- 'GET-SELECTED-WIDGE',
- 'GET-SHORT',
- 'GET-SIGNATURE',
- 'GET-SIZE',
- 'GET-STRING',
- 'GET-TAB-ITEM',
- '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',
- 'GET-TEXT-HEIGHT-PIXELS',
- 'GET-TEXT-HEIGHT-P',
- 'GET-TEXT-HEIGHT-PI',
- 'GET-TEXT-HEIGHT-PIX',
- 'GET-TEXT-HEIGHT-PIXE',
- 'GET-TEXT-HEIGHT-PIXEL',
- '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',
- 'GET-TEXT-WIDTH-PIXELS',
- 'GET-TEXT-WIDTH-P',
- 'GET-TEXT-WIDTH-PI',
- 'GET-TEXT-WIDTH-PIX',
- 'GET-TEXT-WIDTH-PIXE',
- 'GET-TEXT-WIDTH-PIXEL',
- 'GET-TYPE-BY-INDEX',
- 'GET-TYPE-BY-NAMESPACE-NAME',
- 'GET-TYPE-BY-QNAME',
- 'GET-UNSIGNED-LONG',
- 'GET-UNSIGNED-SHORT',
- 'GET-URI-BY-INDEX',
- 'GET-VALUE-BY-INDEX',
- 'GET-VALUE-BY-NAMESPACE-NAME',
- 'GET-VALUE-BY-QNAME',
- 'GET-WAIT-STATE',
- 'GLOBAL',
- 'GO-ON',
- 'GO-PENDING',
- 'GO-PEND',
- 'GO-PENDI',
- 'GO-PENDIN',
- 'GRANT',
- 'GRAPHIC-EDGE',
- 'GRAPHIC-E',
- 'GRAPHIC-ED',
- 'GRAPHIC-EDG',
- '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',
- 'GRID-FACTOR-VERTICAL',
- 'GRID-FACTOR-V',
- 'GRID-FACTOR-VE',
- 'GRID-FACTOR-VER',
- 'GRID-FACTOR-VERT',
- 'GRID-FACTOR-VERTI',
- 'GRID-FACTOR-VERTIC',
- 'GRID-FACTOR-VERTICA',
- 'GRID-SNAP',
- 'GRID-UNIT-HEIGHT-CHARS',
- 'GRID-UNIT-HEIGHT',
- 'GRID-UNIT-HEIGHT-',
- 'GRID-UNIT-HEIGHT-C',
- 'GRID-UNIT-HEIGHT-CH',
- 'GRID-UNIT-HEIGHT-CHA',
- 'GRID-UNIT-HEIGHT-PIXELS',
- 'GRID-UNIT-HEIGHT-P',
- 'GRID-UNIT-HEIGHT-PI',
- 'GRID-UNIT-HEIGHT-PIX',
- 'GRID-UNIT-HEIGHT-PIXE',
- 'GRID-UNIT-HEIGHT-PIXEL',
- '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',
- 'GRID-UNIT-WIDTH-PIXELS',
- 'GRID-UNIT-WIDTH-P',
- 'GRID-UNIT-WIDTH-PI',
- 'GRID-UNIT-WIDTH-PIX',
- 'GRID-UNIT-WIDTH-PIXE',
- 'GRID-UNIT-WIDTH-PIXEL',
- 'GRID-VISIBLE',
- 'GROUP',
- 'GT',
- 'GUID',
- 'HANDLER',
- 'HAS-RECORDS',
- 'HAVING',
- 'HEADER',
- 'HEIGHT-CHARS',
- 'HEIGHT',
- 'HEIGHT-',
- 'HEIGHT-C',
- 'HEIGHT-CH',
- 'HEIGHT-CHA',
- 'HEIGHT-CHAR',
- 'HEIGHT-PIXELS',
- 'HEIGHT-P',
- 'HEIGHT-PI',
- 'HEIGHT-PIX',
- 'HEIGHT-PIXE',
- 'HEIGHT-PIXEL',
- 'HELP',
- 'HEX-DECODE',
- 'HEX-ENCODE',
- 'HIDDEN',
- 'HIDE',
- 'HORIZONTAL',
- 'HORI',
- 'HORIZ',
- 'HORIZO',
- 'HORIZON',
- 'HORIZONT',
- 'HORIZONTA',
- 'HOST-BYTE-ORDER',
- 'HTML-CHARSET',
- 'HTML-END-OF-LINE',
- 'HTML-END-OF-PAGE',
- 'HTML-FRAME-BEGIN',
- 'HTML-FRAME-END',
- 'HTML-HEADER-BEGIN',
- 'HTML-HEADER-END',
- 'HTML-TITLE-BEGIN',
- 'HTML-TITLE-END',
- 'HWND',
- 'ICON',
- 'IF',
- 'IMAGE',
- 'IMAGE-DOWN',
- 'IMAGE-INSENSITIVE',
- 'IMAGE-SIZE',
- 'IMAGE-SIZE-CHARS',
- 'IMAGE-SIZE-C',
- 'IMAGE-SIZE-CH',
- 'IMAGE-SIZE-CHA',
- 'IMAGE-SIZE-CHAR',
- 'IMAGE-SIZE-PIXELS',
- 'IMAGE-SIZE-P',
- 'IMAGE-SIZE-PI',
- 'IMAGE-SIZE-PIX',
- 'IMAGE-SIZE-PIXE',
- 'IMAGE-SIZE-PIXEL',
- 'IMAGE-UP',
- 'IMMEDIATE-DISPLAY',
- 'IMPLEMENTS',
- 'IMPORT',
- 'IMPORT-PRINCIPAL',
- 'IN',
- 'INCREMENT-EXCLUSIVE-ID',
- 'INDEX',
- 'INDEXED-REPOSITION',
- 'INDEX-HINT',
- 'INDEX-INFORMATION',
- 'INDICATOR',
- 'INFORMATION',
- 'INFO',
- 'INFOR',
- 'INFORM',
- 'INFORMA',
- 'INFORMAT',
- 'INFORMATI',
- 'INFORMATIO',
- 'IN-HANDLE',
- 'INHERIT-BGCOLOR',
- 'INHERIT-BGC',
- 'INHERIT-BGCO',
- 'INHERIT-BGCOL',
- 'INHERIT-BGCOLO',
- 'INHERIT-FGCOLOR',
- 'INHERIT-FGC',
- 'INHERIT-FGCO',
- 'INHERIT-FGCOL',
- 'INHERIT-FGCOLO',
- 'INHERITS',
- 'INITIAL',
- 'INIT',
- 'INITI',
- 'INITIA',
- 'INITIAL-DIR',
- 'INITIAL-FILTER',
- 'INITIALIZE-DOCUMENT-TYPE',
- 'INITIATE',
- 'INNER-CHARS',
- 'INNER-LINES',
- 'INPUT',
- 'INPUT-OUTPUT',
- 'INPUT-O',
- 'INPUT-OU',
- 'INPUT-OUT',
- 'INPUT-OUTP',
- 'INPUT-OUTPU',
- 'INPUT-VALUE',
- 'INSERT',
- 'INSERT-ATTRIBUTE',
- 'INSERT-BACKTAB',
- 'INSERT-B',
- 'INSERT-BA',
- 'INSERT-BAC',
- 'INSERT-BACK',
- 'INSERT-BACKT',
- 'INSERT-BACKTA',
- 'INSERT-FILE',
- 'INSERT-ROW',
- 'INSERT-STRING',
- 'INSERT-TAB',
- 'INSERT-T',
- 'INSERT-TA',
- 'INTERFACE',
- 'INTERNAL-ENTRIES',
- 'INTO',
- 'INVOKE',
- 'IS',
- 'IS-ATTR-SPACE',
- 'IS-ATTR',
- 'IS-ATTR-',
- 'IS-ATTR-S',
- 'IS-ATTR-SP',
- 'IS-ATTR-SPA',
- 'IS-ATTR-SPAC',
- 'IS-CLASS',
- 'IS-CLAS',
- 'IS-LEAD-BYTE',
- 'IS-OPEN',
- 'IS-PARAMETER-SET',
- 'IS-ROW-SELECTED',
- 'IS-SELECTED',
- 'ITEM',
- 'ITEMS-PER-ROW',
- 'JOIN',
- 'JOIN-BY-SQLDB',
- 'KBLABEL',
- 'KEEP-CONNECTION-OPEN',
- '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',
- 'KEEP-MESSAGES',
- 'KEEP-SECURITY-CACHE',
- 'KEEP-TAB-ORDER',
- 'KEY',
- 'KEYCODE',
- 'KEY-CODE',
- 'KEYFUNCTION',
- 'KEYFUNC',
- 'KEYFUNCT',
- 'KEYFUNCTI',
- 'KEYFUNCTIO',
- 'KEY-FUNCTION',
- 'KEY-FUNC',
- 'KEY-FUNCT',
- 'KEY-FUNCTI',
- 'KEY-FUNCTIO',
- 'KEYLABEL',
- 'KEY-LABEL',
- 'KEYS',
- 'KEYWORD',
- 'KEYWORD-ALL',
- 'LABEL',
- 'LABEL-BGCOLOR',
- 'LABEL-BGC',
- 'LABEL-BGCO',
- 'LABEL-BGCOL',
- 'LABEL-BGCOLO',
- 'LABEL-DCOLOR',
- 'LABEL-DC',
- 'LABEL-DCO',
- 'LABEL-DCOL',
- 'LABEL-DCOLO',
- 'LABEL-FGCOLOR',
- 'LABEL-FGC',
- 'LABEL-FGCO',
- 'LABEL-FGCOL',
- 'LABEL-FGCOLO',
- 'LABEL-FONT',
- 'LABEL-PFCOLOR',
- 'LABEL-PFC',
- 'LABEL-PFCO',
- 'LABEL-PFCOL',
- 'LABEL-PFCOLO',
- 'LABELS',
- 'LANDSCAPE',
- 'LANGUAGES',
- 'LANGUAGE',
- 'LARGE',
- 'LARGE-TO-SMALL',
- 'LAST',
- 'LAST-ASYNCH-REQUEST',
- 'LAST-BATCH',
- 'LAST-CHILD',
- 'LAST-EVENT',
- 'LAST-EVEN',
- 'LAST-FORM',
- 'LASTKEY',
- 'LAST-KEY',
- 'LAST-OBJECT',
- 'LAST-OF',
- 'LAST-PROCEDURE',
- 'LAST-PROCE',
- 'LAST-PROCED',
- 'LAST-PROCEDU',
- 'LAST-PROCEDUR',
- 'LAST-SERVER',
- 'LAST-TAB-ITEM',
- 'LAST-TAB-I',
- 'LAST-TAB-IT',
- 'LAST-TAB-ITE',
- 'LC',
- 'LDBNAME',
- 'LE',
- 'LEAVE',
- 'LEFT-ALIGNED',
- 'LEFT-ALIGN',
- 'LEFT-ALIGNE',
- 'LEFT-TRIM',
- 'LENGTH',
- 'LIBRARY',
- 'LIKE',
- 'LIKE-SEQUENTIAL',
- 'LINE',
- 'LINE-COUNTER',
- 'LINE-COUNT',
- 'LINE-COUNTE',
- 'LIST-EVENTS',
- 'LISTING',
- 'LISTI',
- 'LISTIN',
- 'LIST-ITEM-PAIRS',
- 'LIST-ITEMS',
- 'LIST-PROPERTY-NAMES',
- 'LIST-QUERY-ATTRS',
- 'LIST-SET-ATTRS',
- 'LIST-WIDGETS',
- 'LITERAL-QUESTION',
- 'LITTLE-ENDIAN',
- 'LOAD',
- 'LOAD-DOMAINS',
- 'LOAD-ICON',
- 'LOAD-IMAGE',
- 'LOAD-IMAGE-DOWN',
- 'LOAD-IMAGE-INSENSITIVE',
- 'LOAD-IMAGE-UP',
- 'LOAD-MOUSE-POINTER',
- 'LOAD-MOUSE-P',
- 'LOAD-MOUSE-PO',
- 'LOAD-MOUSE-POI',
- 'LOAD-MOUSE-POIN',
- 'LOAD-MOUSE-POINT',
- 'LOAD-MOUSE-POINTE',
- 'LOAD-PICTURE',
- 'LOAD-SMALL-ICON',
- 'LOCAL-NAME',
- 'LOCATOR-COLUMN-NUMBER',
- 'LOCATOR-LINE-NUMBER',
- 'LOCATOR-PUBLIC-ID',
- 'LOCATOR-SYSTEM-ID',
- 'LOCATOR-TYPE',
- 'LOCKED',
- 'LOCK-REGISTRATION',
- 'LOG',
- 'LOG-AUDIT-EVENT',
- 'LOGIN-EXPIRATION-TIMESTAMP',
- 'LOGIN-HOST',
- 'LOGIN-STATE',
- 'LOG-MANAGER',
- 'LOGOUT',
- 'LOOKAHEAD',
- 'LOOKUP',
- 'LT',
- 'MACHINE-CLASS',
- 'MANDATORY',
- 'MANUAL-HIGHLIGHT',
- 'MAP',
- 'MARGIN-EXTRA',
- 'MARGIN-HEIGHT-CHARS',
- 'MARGIN-HEIGHT',
- 'MARGIN-HEIGHT-',
- 'MARGIN-HEIGHT-C',
- 'MARGIN-HEIGHT-CH',
- 'MARGIN-HEIGHT-CHA',
- 'MARGIN-HEIGHT-CHAR',
- 'MARGIN-HEIGHT-PIXELS',
- 'MARGIN-HEIGHT-P',
- 'MARGIN-HEIGHT-PI',
- 'MARGIN-HEIGHT-PIX',
- 'MARGIN-HEIGHT-PIXE',
- 'MARGIN-HEIGHT-PIXEL',
- 'MARGIN-WIDTH-CHARS',
- 'MARGIN-WIDTH',
- 'MARGIN-WIDTH-',
- 'MARGIN-WIDTH-C',
- 'MARGIN-WIDTH-CH',
- 'MARGIN-WIDTH-CHA',
- 'MARGIN-WIDTH-CHAR',
- 'MARGIN-WIDTH-PIXELS',
- 'MARGIN-WIDTH-P',
- 'MARGIN-WIDTH-PI',
- 'MARGIN-WIDTH-PIX',
- 'MARGIN-WIDTH-PIXE',
- 'MARGIN-WIDTH-PIXEL',
- 'MARK-NEW',
- 'MARK-ROW-STATE',
- 'MATCHES',
- 'MAX-BUTTON',
- 'MAX-CHARS',
- 'MAX-DATA-GUESS',
- 'MAX-HEIGHT',
- 'MAX-HEIGHT-CHARS',
- 'MAX-HEIGHT-C',
- 'MAX-HEIGHT-CH',
- 'MAX-HEIGHT-CHA',
- 'MAX-HEIGHT-CHAR',
- 'MAX-HEIGHT-PIXELS',
- 'MAX-HEIGHT-P',
- 'MAX-HEIGHT-PI',
- 'MAX-HEIGHT-PIX',
- 'MAX-HEIGHT-PIXE',
- 'MAX-HEIGHT-PIXEL',
- 'MAXIMIZE',
- 'MAXIMUM',
- 'MAX',
- 'MAXI',
- 'MAXIM',
- 'MAXIMU',
- 'MAXIMUM-LEVEL',
- 'MAX-ROWS',
- 'MAX-SIZE',
- 'MAX-VALUE',
- 'MAX-VAL',
- 'MAX-VALU',
- 'MAX-WIDTH-CHARS',
- 'MAX-WIDTH',
- 'MAX-WIDTH-',
- 'MAX-WIDTH-C',
- 'MAX-WIDTH-CH',
- 'MAX-WIDTH-CHA',
- 'MAX-WIDTH-CHAR',
- 'MAX-WIDTH-PIXELS',
- 'MAX-WIDTH-P',
- 'MAX-WIDTH-PI',
- 'MAX-WIDTH-PIX',
- 'MAX-WIDTH-PIXE',
- 'MAX-WIDTH-PIXEL',
- 'MD5-DIGEST',
- 'MEMBER',
- 'MEMPTR-TO-NODE-VALUE',
- 'MENU',
- 'MENUBAR',
- 'MENU-BAR',
- 'MENU-ITEM',
- 'MENU-KEY',
- 'MENU-K',
- 'MENU-KE',
- 'MENU-MOUSE',
- 'MENU-M',
- 'MENU-MO',
- 'MENU-MOU',
- 'MENU-MOUS',
- 'MERGE-BY-FIELD',
- 'MESSAGE',
- 'MESSAGE-AREA',
- 'MESSAGE-AREA-FONT',
- 'MESSAGE-LINES',
- 'METHOD',
- 'MIN-BUTTON',
- 'MIN-COLUMN-WIDTH-CHARS',
- 'MIN-COLUMN-WIDTH-C',
- 'MIN-COLUMN-WIDTH-CH',
- 'MIN-COLUMN-WIDTH-CHA',
- 'MIN-COLUMN-WIDTH-CHAR',
- 'MIN-COLUMN-WIDTH-PIXELS',
- 'MIN-COLUMN-WIDTH-P',
- 'MIN-COLUMN-WIDTH-PI',
- 'MIN-COLUMN-WIDTH-PIX',
- 'MIN-COLUMN-WIDTH-PIXE',
- 'MIN-COLUMN-WIDTH-PIXEL',
- 'MIN-HEIGHT-CHARS',
- 'MIN-HEIGHT',
- 'MIN-HEIGHT-',
- 'MIN-HEIGHT-C',
- 'MIN-HEIGHT-CH',
- 'MIN-HEIGHT-CHA',
- 'MIN-HEIGHT-CHAR',
- 'MIN-HEIGHT-PIXELS',
- 'MIN-HEIGHT-P',
- 'MIN-HEIGHT-PI',
- 'MIN-HEIGHT-PIX',
- 'MIN-HEIGHT-PIXE',
- 'MIN-HEIGHT-PIXEL',
- 'MINIMUM',
- 'MIN',
- 'MINI',
- 'MINIM',
- 'MINIMU',
- 'MIN-SIZE',
- 'MIN-VALUE',
- 'MIN-VAL',
- 'MIN-VALU',
- 'MIN-WIDTH-CHARS',
- 'MIN-WIDTH',
- 'MIN-WIDTH-',
- 'MIN-WIDTH-C',
- 'MIN-WIDTH-CH',
- 'MIN-WIDTH-CHA',
- 'MIN-WIDTH-CHAR',
- 'MIN-WIDTH-PIXELS',
- 'MIN-WIDTH-P',
- 'MIN-WIDTH-PI',
- 'MIN-WIDTH-PIX',
- 'MIN-WIDTH-PIXE',
- 'MIN-WIDTH-PIXEL',
- 'MODIFIED',
- 'MODULO',
- 'MOD',
- 'MODU',
- 'MODUL',
- 'MONTH',
- 'MOUSE',
- 'MOUSE-POINTER',
- 'MOUSE-P',
- 'MOUSE-PO',
- 'MOUSE-POI',
- 'MOUSE-POIN',
- 'MOUSE-POINT',
- 'MOUSE-POINTE',
- 'MOVABLE',
- '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',
- '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',
- 'MOVE-COLUMN',
- 'MOVE-COL',
- 'MOVE-COLU',
- 'MOVE-COLUM',
- 'MOVE-TO-BOTTOM',
- 'MOVE-TO-B',
- 'MOVE-TO-BO',
- 'MOVE-TO-BOT',
- 'MOVE-TO-BOTT',
- 'MOVE-TO-BOTTO',
- 'MOVE-TO-EOF',
- 'MOVE-TO-TOP',
- 'MOVE-TO-T',
- 'MOVE-TO-TO',
- 'MPE',
- 'MULTI-COMPILE',
- 'MULTIPLE',
- 'MULTIPLE-KEY',
- 'MULTITASKING-INTERVAL',
- 'MUST-EXIST',
- 'NAME',
- 'NAMESPACE-PREFIX',
- 'NAMESPACE-URI',
- 'NATIVE',
- 'NE',
- 'NEEDS-APPSERVER-PROMPT',
- 'NEEDS-PROMPT',
- 'NEW',
- 'NEW-INSTANCE',
- 'NEW-ROW',
- 'NEXT',
- 'NEXT-COLUMN',
- 'NEXT-PROMPT',
- 'NEXT-ROWID',
- 'NEXT-SIBLING',
- 'NEXT-TAB-ITEM',
- 'NEXT-TAB-I',
- 'NEXT-TAB-IT',
- 'NEXT-TAB-ITE',
- 'NEXT-VALUE',
- 'NO',
- 'NO-APPLY',
- 'NO-ARRAY-MESSAGE',
- 'NO-ASSIGN',
- 'NO-ATTR-LIST',
- 'NO-ATTR',
- 'NO-ATTR-',
- 'NO-ATTR-L',
- 'NO-ATTR-LI',
- 'NO-ATTR-LIS',
- 'NO-ATTR-SPACE',
- 'NO-ATTR-S',
- 'NO-ATTR-SP',
- 'NO-ATTR-SPA',
- 'NO-ATTR-SPAC',
- 'NO-AUTO-VALIDATE',
- 'NO-BIND-WHERE',
- 'NO-BOX',
- 'NO-CONSOLE',
- 'NO-CONVERT',
- 'NO-CONVERT-3D-COLORS',
- 'NO-CURRENT-VALUE',
- 'NO-DEBUG',
- 'NODE-VALUE-TO-MEMPTR',
- 'NO-DRAG',
- 'NO-ECHO',
- 'NO-EMPTY-SPACE',
- 'NO-ERROR',
- 'NO-FILL',
- 'NO-F',
- 'NO-FI',
- 'NO-FIL',
- 'NO-FOCUS',
- 'NO-HELP',
- 'NO-HIDE',
- 'NO-INDEX-HINT',
- 'NO-INHERIT-BGCOLOR',
- 'NO-INHERIT-BGC',
- 'NO-INHERIT-BGCO',
- 'NO-INHERIT-FGCOLOR',
- 'NO-INHERIT-FGC',
- 'NO-INHERIT-FGCO',
- 'NO-INHERIT-FGCOL',
- 'NO-INHERIT-FGCOLO',
- 'NO-JOIN-BY-SQLDB',
- 'NO-LABELS',
- 'NO-LABE',
- 'NO-LOBS',
- 'NO-LOCK',
- 'NO-LOOKAHEAD',
- 'NO-MAP',
- 'NO-MESSAGE',
- 'NO-MES',
- 'NO-MESS',
- 'NO-MESSA',
- 'NO-MESSAG',
- 'NONAMESPACE-SCHEMA-LOCATION',
- 'NONE',
- 'NO-PAUSE',
- 'NO-PREFETCH',
- 'NO-PREFE',
- 'NO-PREFET',
- 'NO-PREFETC',
- 'NORMALIZE',
- 'NO-ROW-MARKERS',
- 'NO-SCROLLBAR-VERTICAL',
- 'NO-SEPARATE-CONNECTION',
- 'NO-SEPARATORS',
- 'NOT',
- 'NO-TAB-STOP',
- 'NOT-ACTIVE',
- 'NO-UNDERLINE',
- 'NO-UND',
- 'NO-UNDE',
- 'NO-UNDER',
- 'NO-UNDERL',
- 'NO-UNDERLI',
- 'NO-UNDERLIN',
- 'NO-UNDO',
- 'NO-VALIDATE',
- 'NO-VAL',
- 'NO-VALI',
- 'NO-VALID',
- 'NO-VALIDA',
- 'NO-VALIDAT',
- 'NOW',
- 'NO-WAIT',
- 'NO-WORD-WRAP',
- 'NULL',
- 'NUM-ALIASES',
- 'NUM-ALI',
- 'NUM-ALIA',
- 'NUM-ALIAS',
- 'NUM-ALIASE',
- 'NUM-BUFFERS',
- 'NUM-BUTTONS',
- 'NUM-BUT',
- 'NUM-BUTT',
- 'NUM-BUTTO',
- 'NUM-BUTTON',
- 'NUM-COLUMNS',
- 'NUM-COL',
- 'NUM-COLU',
- 'NUM-COLUM',
- 'NUM-COLUMN',
- 'NUM-COPIES',
- 'NUM-DBS',
- 'NUM-DROPPED-FILES',
- 'NUM-ENTRIES',
- 'NUMERIC',
- 'NUMERIC-FORMAT',
- 'NUMERIC-F',
- 'NUMERIC-FO',
- 'NUMERIC-FOR',
- 'NUMERIC-FORM',
- 'NUMERIC-FORMA',
- 'NUM-FIELDS',
- 'NUM-FORMATS',
- 'NUM-ITEMS',
- 'NUM-ITERATIONS',
- 'NUM-LINES',
- 'NUM-LOCKED-COLUMNS',
- 'NUM-LOCKED-COL',
- 'NUM-LOCKED-COLU',
- 'NUM-LOCKED-COLUM',
- 'NUM-LOCKED-COLUMN',
- 'NUM-MESSAGES',
- 'NUM-PARAMETERS',
- 'NUM-REFERENCES',
- 'NUM-REPLACED',
- 'NUM-RESULTS',
- 'NUM-SELECTED-ROWS',
- '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',
- 'NUM-TABS',
- 'NUM-TO-RETAIN',
- 'NUM-VISIBLE-COLUMNS',
- 'OCTET-LENGTH',
- 'OF',
- 'OFF',
- 'OK',
- 'OK-CANCEL',
- 'OLD',
- 'ON',
- 'ON-FRAME-BORDER',
- 'ON-FRAME',
- 'ON-FRAME-',
- 'ON-FRAME-B',
- 'ON-FRAME-BO',
- 'ON-FRAME-BOR',
- 'ON-FRAME-BORD',
- 'ON-FRAME-BORDE',
- 'OPEN',
- 'OPSYS',
- 'OPTION',
- 'OR',
- 'ORDERED-JOIN',
- 'ORDINAL',
- 'OS-APPEND',
- 'OS-COMMAND',
- 'OS-COPY',
- 'OS-CREATE-DIR',
- 'OS-DELETE',
- 'OS-DIR',
- 'OS-DRIVES',
- 'OS-DRIVE',
- 'OS-ERROR',
- 'OS-GETENV',
- 'OS-RENAME',
- 'OTHERWISE',
- 'OUTPUT',
- 'OVERLAY',
- 'OVERRIDE',
- 'OWNER',
- 'PAGE',
- 'PAGE-BOTTOM',
- 'PAGE-BOT',
- 'PAGE-BOTT',
- 'PAGE-BOTTO',
- 'PAGED',
- 'PAGE-NUMBER',
- 'PAGE-NUM',
- 'PAGE-NUMB',
- 'PAGE-NUMBE',
- 'PAGE-SIZE',
- 'PAGE-TOP',
- 'PAGE-WIDTH',
- 'PAGE-WID',
- 'PAGE-WIDT',
- 'PARAMETER',
- 'PARAM',
- 'PARAME',
- 'PARAMET',
- 'PARAMETE',
- 'PARENT',
- 'PARSE-STATUS',
- 'PARTIAL-KEY',
- 'PASCAL',
- 'PASSWORD-FIELD',
- 'PATHNAME',
- 'PAUSE',
- 'PBE-HASH-ALGORITHM',
- 'PBE-HASH-ALG',
- 'PBE-HASH-ALGO',
- 'PBE-HASH-ALGOR',
- 'PBE-HASH-ALGORI',
- 'PBE-HASH-ALGORIT',
- 'PBE-HASH-ALGORITH',
- 'PBE-KEY-ROUNDS',
- 'PDBNAME',
- 'PERSISTENT',
- 'PERSIST',
- 'PERSISTE',
- 'PERSISTEN',
- 'PERSISTENT-CACHE-DISABLED',
- 'PFCOLOR',
- 'PFC',
- 'PFCO',
- 'PFCOL',
- 'PFCOLO',
- 'PIXELS',
- 'PIXELS-PER-COLUMN',
- 'PIXELS-PER-COL',
- 'PIXELS-PER-COLU',
- 'PIXELS-PER-COLUM',
- 'PIXELS-PER-ROW',
- 'POPUP-MENU',
- 'POPUP-M',
- 'POPUP-ME',
- 'POPUP-MEN',
- 'POPUP-ONLY',
- 'POPUP-O',
- 'POPUP-ON',
- 'POPUP-ONL',
- 'PORTRAIT',
- 'POSITION',
- 'PRECISION',
- 'PREFER-DATASET',
- 'PREPARED',
- 'PREPARE-STRING',
- 'PREPROCESS',
- 'PREPROC',
- 'PREPROCE',
- 'PREPROCES',
- 'PRESELECT',
- 'PRESEL',
- 'PRESELE',
- 'PRESELEC',
- 'PREV',
- 'PREV-COLUMN',
- 'PREV-SIBLING',
- 'PREV-TAB-ITEM',
- 'PREV-TAB-I',
- 'PREV-TAB-IT',
- 'PREV-TAB-ITE',
- 'PRIMARY',
- 'PRINTER',
- 'PRINTER-CONTROL-HANDLE',
- 'PRINTER-HDC',
- 'PRINTER-NAME',
- 'PRINTER-PORT',
- 'PRINTER-SETUP',
- 'PRIVATE',
- 'PRIVATE-DATA',
- 'PRIVATE-D',
- 'PRIVATE-DA',
- 'PRIVATE-DAT',
- 'PRIVILEGES',
- 'PROCEDURE',
- 'PROCE',
- 'PROCED',
- 'PROCEDU',
- 'PROCEDUR',
- 'PROCEDURE-CALL-TYPE',
- 'PROCESS',
- 'PROC-HANDLE',
- 'PROC-HA',
- 'PROC-HAN',
- 'PROC-HAND',
- 'PROC-HANDL',
- 'PROC-STATUS',
- 'PROC-ST',
- 'PROC-STA',
- 'PROC-STAT',
- 'PROC-STATU',
- 'proc-text',
- 'proc-text-buffe',
- 'PROFILER',
- 'PROGRAM-NAME',
- 'PROGRESS',
- 'PROGRESS-SOURCE',
- 'PROGRESS-S',
- 'PROGRESS-SO',
- 'PROGRESS-SOU',
- 'PROGRESS-SOUR',
- 'PROGRESS-SOURC',
- 'PROMPT',
- 'PROMPT-FOR',
- 'PROMPT-F',
- 'PROMPT-FO',
- 'PROMSGS',
- 'PROPATH',
- 'PROPERTY',
- 'PROTECTED',
- 'PROVERSION',
- 'PROVERS',
- 'PROVERSI',
- 'PROVERSIO',
- 'PROXY',
- 'PROXY-PASSWORD',
- 'PROXY-USERID',
- 'PUBLIC',
- 'PUBLIC-ID',
- 'PUBLISH',
- 'PUBLISHED-EVENTS',
- 'PUT',
- 'PUTBYTE',
- 'PUT-BYTE',
- 'PUT-DOUBLE',
- 'PUT-FLOAT',
- 'PUT-INT64',
- 'PUT-KEY-VALUE',
- 'PUT-KEY-VAL',
- 'PUT-KEY-VALU',
- 'PUT-LONG',
- 'PUT-SHORT',
- 'PUT-STRING',
- 'PUT-UNSIGNED-LONG',
- 'QUERY',
- 'QUERY-CLOSE',
- 'QUERY-OFF-END',
- 'QUERY-OPEN',
- 'QUERY-PREPARE',
- 'QUERY-TUNING',
- 'QUESTION',
- 'QUIT',
- 'QUOTER',
- 'RADIO-BUTTONS',
- 'RADIO-SET',
- 'RANDOM',
- 'RAW-TRANSFER',
- 'RCODE-INFORMATION',
- 'RCODE-INFO',
- 'RCODE-INFOR',
- 'RCODE-INFORM',
- 'RCODE-INFORMA',
- 'RCODE-INFORMAT',
- 'RCODE-INFORMATI',
- 'RCODE-INFORMATIO',
- 'READ-AVAILABLE',
- 'READ-EXACT-NUM',
- 'READ-FILE',
- 'READKEY',
- 'READ-ONLY',
- 'READ-XML',
- 'READ-XMLSCHEMA',
- 'REAL',
- 'RECORD-LENGTH',
- 'RECTANGLE',
- 'RECT',
- 'RECTA',
- 'RECTAN',
- 'RECTANG',
- 'RECTANGL',
- 'RECURSIVE',
- 'REFERENCE-ONLY',
- 'REFRESH',
- 'REFRESHABLE',
- 'REFRESH-AUDIT-POLICY',
- 'REGISTER-DOMAIN',
- 'RELEASE',
- 'REMOTE',
- 'REMOVE-EVENTS-PROCEDURE',
- 'REMOVE-SUPER-PROCEDURE',
- 'REPEAT',
- 'REPLACE',
- 'REPLACE-SELECTION-TEXT',
- 'REPOSITION',
- 'REPOSITION-BACKWARD',
- 'REPOSITION-FORWARD',
- 'REPOSITION-MODE',
- 'REPOSITION-TO-ROW',
- 'REPOSITION-TO-ROWID',
- 'REQUEST',
- 'RESET',
- 'RESIZABLE',
- 'RESIZA',
- 'RESIZAB',
- 'RESIZABL',
- 'RESIZE',
- 'RESTART-ROW',
- 'RESTART-ROWID',
- 'RETAIN',
- 'RETAIN-SHAPE',
- 'RETRY',
- 'RETRY-CANCEL',
- 'RETURN',
- 'RETURN-INSERTED',
- 'RETURN-INS',
- 'RETURN-INSE',
- 'RETURN-INSER',
- 'RETURN-INSERT',
- 'RETURN-INSERTE',
- 'RETURNS',
- 'RETURN-TO-START-DIR',
- 'RETURN-TO-START-DI',
- 'RETURN-VALUE',
- 'RETURN-VAL',
- 'RETURN-VALU',
- 'RETURN-VALUE-DATA-TYPE',
- 'REVERSE-FROM',
- 'REVERT',
- 'REVOKE',
- 'RGB-VALUE',
- 'RIGHT-ALIGNED',
- 'RETURN-ALIGN',
- 'RETURN-ALIGNE',
- 'RIGHT-TRIM',
- 'R-INDEX',
- 'ROLES',
- 'ROUND',
- 'ROUTINE-LEVEL',
- 'ROW',
- 'ROW-HEIGHT-CHARS',
- 'ROW-HEIGHT-PIXELS',
- 'ROW-MARKERS',
- 'ROW-OF',
- 'ROW-RESIZABLE',
- 'RULE',
- 'RUN',
- 'RUN-PROCEDURE',
- 'SAVE',
- 'SAVE-AS',
- 'SAVE-FILE',
- 'SAX-COMPLETE',
- 'SAX-COMPLE',
- 'SAX-COMPLET',
- 'SAX-PARSE',
- 'SAX-PARSE-FIRST',
- 'SAX-PARSE-NEXT',
- 'SAX-PARSER-ERROR',
- 'SAX-RUNNING',
- 'SAX-UNINITIALIZED',
- 'SAX-WRITE-BEGIN',
- 'SAX-WRITE-COMPLETE',
- 'SAX-WRITE-CONTENT',
- 'SAX-WRITE-ELEMENT',
- 'SAX-WRITE-ERROR',
- 'SAX-WRITE-IDLE',
- 'SAX-WRITER',
- 'SAX-WRITE-TAG',
- 'SCHEMA',
- 'SCHEMA-LOCATION',
- 'SCHEMA-MARSHAL',
- 'SCHEMA-PATH',
- 'SCREEN',
- 'SCREEN-IO',
- 'SCREEN-LINES',
- 'SCREEN-VALUE',
- 'SCREEN-VAL',
- 'SCREEN-VALU',
- 'SCROLL',
- 'SCROLLABLE',
- 'SCROLLBAR-HORIZONTAL',
- 'SCROLLBAR-H',
- 'SCROLLBAR-HO',
- 'SCROLLBAR-HOR',
- 'SCROLLBAR-HORI',
- 'SCROLLBAR-HORIZ',
- 'SCROLLBAR-HORIZO',
- 'SCROLLBAR-HORIZON',
- 'SCROLLBAR-HORIZONT',
- 'SCROLLBAR-HORIZONTA',
- 'SCROLL-BARS',
- 'SCROLLBAR-VERTICAL',
- 'SCROLLBAR-V',
- 'SCROLLBAR-VE',
- 'SCROLLBAR-VER',
- 'SCROLLBAR-VERT',
- 'SCROLLBAR-VERTI',
- 'SCROLLBAR-VERTIC',
- 'SCROLLBAR-VERTICA',
- 'SCROLL-DELTA',
- 'SCROLLED-ROW-POSITION',
- 'SCROLLED-ROW-POS',
- 'SCROLLED-ROW-POSI',
- 'SCROLLED-ROW-POSIT',
- 'SCROLLED-ROW-POSITI',
- 'SCROLLED-ROW-POSITIO',
- 'SCROLLING',
- 'SCROLL-OFFSET',
- 'SCROLL-TO-CURRENT-ROW',
- 'SCROLL-TO-ITEM',
- 'SCROLL-TO-I',
- 'SCROLL-TO-IT',
- 'SCROLL-TO-ITE',
- 'SCROLL-TO-SELECTED-ROW',
- 'SDBNAME',
- 'SEAL',
- 'SEAL-TIMESTAMP',
- 'SEARCH',
- 'SEARCH-SELF',
- 'SEARCH-TARGET',
- 'SECTION',
- 'SECURITY-POLICY',
- 'SEEK',
- 'SELECT',
- 'SELECTABLE',
- 'SELECT-ALL',
- 'SELECTED',
- 'SELECT-FOCUSED-ROW',
- 'SELECTION',
- 'SELECTION-END',
- 'SELECTION-LIST',
- 'SELECTION-START',
- 'SELECTION-TEXT',
- 'SELECT-NEXT-ROW',
- 'SELECT-PREV-ROW',
- 'SELECT-ROW',
- 'SELF',
- 'SEND',
- 'send-sql-statement',
- 'send-sql',
- 'SENSITIVE',
- 'SEPARATE-CONNECTION',
- 'SEPARATOR-FGCOLOR',
- 'SEPARATORS',
- 'SERVER',
- 'SERVER-CONNECTION-BOUND',
- 'SERVER-CONNECTION-BOUND-REQUEST',
- 'SERVER-CONNECTION-CONTEXT',
- 'SERVER-CONNECTION-ID',
- 'SERVER-OPERATING-MODE',
- 'SESSION',
- 'SESSION-ID',
- 'SET',
- 'SET-APPL-CONTEXT',
- 'SET-ATTR-CALL-TYPE',
- 'SET-ATTRIBUTE-NODE',
- 'SET-BLUE-VALUE',
- 'SET-BLUE',
- 'SET-BLUE-',
- 'SET-BLUE-V',
- 'SET-BLUE-VA',
- 'SET-BLUE-VAL',
- 'SET-BLUE-VALU',
- 'SET-BREAK',
- 'SET-BUFFERS',
- 'SET-CALLBACK',
- 'SET-CLIENT',
- 'SET-COMMIT',
- 'SET-CONTENTS',
- 'SET-CURRENT-VALUE',
- 'SET-DB-CLIENT',
- 'SET-DYNAMIC',
- 'SET-EVENT-MANAGER-OPTION',
- 'SET-GREEN-VALUE',
- 'SET-GREEN',
- 'SET-GREEN-',
- 'SET-GREEN-V',
- 'SET-GREEN-VA',
- 'SET-GREEN-VAL',
- 'SET-GREEN-VALU',
- 'SET-INPUT-SOURCE',
- 'SET-OPTION',
- 'SET-OUTPUT-DESTINATION',
- 'SET-PARAMETER',
- 'SET-POINTER-VALUE',
- 'SET-PROPERTY',
- 'SET-RED-VALUE',
- 'SET-RED',
- 'SET-RED-',
- 'SET-RED-V',
- 'SET-RED-VA',
- 'SET-RED-VAL',
- 'SET-RED-VALU',
- 'SET-REPOSITIONED-ROW',
- 'SET-RGB-VALUE',
- 'SET-ROLLBACK',
- 'SET-SELECTION',
- 'SET-SIZE',
- 'SET-SORT-ARROW',
- 'SETUSERID',
- 'SETUSER',
- 'SETUSERI',
- 'SET-WAIT-STATE',
- 'SHA1-DIGEST',
- 'SHARED',
- 'SHARE-LOCK',
- 'SHARE',
- 'SHARE-',
- 'SHARE-L',
- 'SHARE-LO',
- 'SHARE-LOC',
- 'SHOW-IN-TASKBAR',
- 'SHOW-STATS',
- 'SHOW-STAT',
- 'SIDE-LABEL-HANDLE',
- 'SIDE-LABEL-H',
- 'SIDE-LABEL-HA',
- 'SIDE-LABEL-HAN',
- 'SIDE-LABEL-HAND',
- 'SIDE-LABEL-HANDL',
- 'SIDE-LABELS',
- 'SIDE-LAB',
- 'SIDE-LABE',
- 'SIDE-LABEL',
- 'SILENT',
- 'SIMPLE',
- 'SINGLE',
- 'SIZE',
- 'SIZE-CHARS',
- 'SIZE-C',
- 'SIZE-CH',
- 'SIZE-CHA',
- 'SIZE-CHAR',
- 'SIZE-PIXELS',
- 'SIZE-P',
- 'SIZE-PI',
- 'SIZE-PIX',
- 'SIZE-PIXE',
- 'SIZE-PIXEL',
- 'SKIP',
- 'SKIP-DELETED-RECORD',
- 'SLIDER',
- 'SMALL-ICON',
- 'SMALLINT',
- 'SMALL-TITLE',
- 'SOME',
- 'SORT',
- 'SORT-ASCENDING',
- 'SORT-NUMBER',
- 'SOURCE',
- 'SOURCE-PROCEDURE',
- 'SPACE',
- 'SQL',
- 'SQRT',
- 'SSL-SERVER-NAME',
- 'STANDALONE',
- 'START',
- 'START-DOCUMENT',
- 'START-ELEMENT',
- 'START-MOVE',
- 'START-RESIZE',
- 'START-ROW-RESIZE',
- 'STATE-DETAIL',
- 'STATIC',
- 'STATUS',
- 'STATUS-AREA',
- 'STATUS-AREA-FONT',
- 'STDCALL',
- 'STOP',
- 'STOP-PARSING',
- 'STOPPED',
- 'STOPPE',
- 'STORED-PROCEDURE',
- 'STORED-PROC',
- 'STORED-PROCE',
- 'STORED-PROCED',
- 'STORED-PROCEDU',
- 'STORED-PROCEDUR',
- 'STREAM',
- 'STREAM-HANDLE',
- 'STREAM-IO',
- 'STRETCH-TO-FIT',
- 'STRICT',
- 'STRING',
- 'STRING-VALUE',
- 'STRING-XREF',
- 'SUB-AVERAGE',
- 'SUB-AVE',
- 'SUB-AVER',
- 'SUB-AVERA',
- 'SUB-AVERAG',
- 'SUB-COUNT',
- 'SUB-MAXIMUM',
- 'SUM-MAX',
- 'SUM-MAXI',
- 'SUM-MAXIM',
- 'SUM-MAXIMU',
- 'SUB-MENU',
- 'SUBSUB-',
- 'SUB-MIN',
- 'SUBSCRIBE',
- 'SUBSTITUTE',
- 'SUBST',
- 'SUBSTI',
- 'SUBSTIT',
- 'SUBSTITU',
- 'SUBSTITUT',
- 'SUBSTRING',
- 'SUBSTR',
- 'SUBSTRI',
- 'SUBSTRIN',
- 'SUB-TOTAL',
- 'SUBTYPE',
- 'SUM',
- 'SUPER',
- 'SUPER-PROCEDURES',
- 'SUPPRESS-NAMESPACE-PROCESSING',
- 'SUPPRESS-WARNINGS',
- 'SUPPRESS-W',
- 'SUPPRESS-WA',
- 'SUPPRESS-WAR',
- 'SUPPRESS-WARN',
- 'SUPPRESS-WARNI',
- 'SUPPRESS-WARNIN',
- 'SUPPRESS-WARNING',
- 'SYMMETRIC-ENCRYPTION-ALGORITHM',
- 'SYMMETRIC-ENCRYPTION-IV',
- 'SYMMETRIC-ENCRYPTION-KEY',
- 'SYMMETRIC-SUPPORT',
- 'SYSTEM-ALERT-BOXES',
- 'SYSTEM-ALERT',
- 'SYSTEM-ALERT-',
- 'SYSTEM-ALERT-B',
- 'SYSTEM-ALERT-BO',
- 'SYSTEM-ALERT-BOX',
- 'SYSTEM-ALERT-BOXE',
- 'SYSTEM-DIALOG',
- 'SYSTEM-HELP',
- 'SYSTEM-ID',
- 'TABLE',
- 'TABLE-HANDLE',
- 'TABLE-NUMBER',
- 'TAB-POSITION',
- 'TAB-STOP',
- 'TARGET',
- 'TARGET-PROCEDURE',
- 'TEMP-DIRECTORY',
- 'TEMP-DIR',
- 'TEMP-DIRE',
- 'TEMP-DIREC',
- 'TEMP-DIRECT',
- 'TEMP-DIRECTO',
- 'TEMP-DIRECTOR',
- 'TEMP-TABLE',
- 'TEMP-TABLE-PREPARE',
- 'TERM',
- 'TERMINAL',
- 'TERMI',
- 'TERMIN',
- 'TERMINA',
- 'TERMINATE',
- 'TEXT',
- 'TEXT-CURSOR',
- 'TEXT-SEG-GROW',
- 'TEXT-SELECTED',
- 'THEN',
- 'THIS-OBJECT',
- 'THIS-PROCEDURE',
- 'THREE-D',
- 'THROW',
- 'THROUGH',
- 'THRU',
- 'TIC-MARKS',
- 'TIME',
- 'TIME-SOURCE',
- 'TITLE',
- 'TITLE-BGCOLOR',
- 'TITLE-BGC',
- 'TITLE-BGCO',
- 'TITLE-BGCOL',
- 'TITLE-BGCOLO',
- 'TITLE-DCOLOR',
- 'TITLE-DC',
- 'TITLE-DCO',
- 'TITLE-DCOL',
- 'TITLE-DCOLO',
- 'TITLE-FGCOLOR',
- 'TITLE-FGC',
- 'TITLE-FGCO',
- 'TITLE-FGCOL',
- 'TITLE-FGCOLO',
- 'TITLE-FONT',
- 'TITLE-FO',
- 'TITLE-FON',
- 'TO',
- 'TODAY',
- 'TOGGLE-BOX',
- 'TOOLTIP',
- 'TOOLTIPS',
- 'TOPIC',
- 'TOP-NAV-QUERY',
- 'TOP-ONLY',
- 'TO-ROWID',
- 'TOTAL',
- 'TRAILING',
- 'TRANS',
- 'TRANSACTION',
- 'TRANSACTION-MODE',
- 'TRANS-INIT-PROCEDURE',
- 'TRANSPARENT',
- 'TRIGGER',
- 'TRIGGERS',
- 'TRIM',
- 'TRUE',
- 'TRUNCATE',
- 'TRUNC',
- 'TRUNCA',
- 'TRUNCAT',
- 'TYPE',
- 'TYPE-OF',
- 'UNBOX',
- 'UNBUFFERED',
- 'UNBUFF',
- 'UNBUFFE',
- 'UNBUFFER',
- 'UNBUFFERE',
- 'UNDERLINE',
- 'UNDERL',
- 'UNDERLI',
- 'UNDERLIN',
- 'UNDO',
- 'UNFORMATTED',
- 'UNFORM',
- 'UNFORMA',
- 'UNFORMAT',
- 'UNFORMATT',
- 'UNFORMATTE',
- 'UNION',
- 'UNIQUE',
- 'UNIQUE-ID',
- 'UNIQUE-MATCH',
- 'UNIX',
- 'UNLESS-HIDDEN',
- 'UNLOAD',
- 'UNSIGNED-LONG',
- 'UNSUBSCRIBE',
- 'UP',
- 'UPDATE',
- 'UPDATE-ATTRIBUTE',
- 'URL',
- 'URL-DECODE',
- 'URL-ENCODE',
- 'URL-PASSWORD',
- 'URL-USERID',
- 'USE',
- 'USE-DICT-EXPS',
- 'USE-FILENAME',
- 'USE-INDEX',
- 'USER',
- 'USE-REVVIDEO',
- 'USERID',
- 'USER-ID',
- 'USE-TEXT',
- 'USE-UNDERLINE',
- 'USE-WIDGET-POOL',
- 'USING',
- 'V6DISPLAY',
- 'V6FRAME',
- 'VALIDATE',
- 'VALIDATE-EXPRESSION',
- 'VALIDATE-MESSAGE',
- 'VALIDATE-SEAL',
- 'VALIDATION-ENABLED',
- 'VALID-EVENT',
- 'VALID-HANDLE',
- 'VALID-OBJECT',
- 'VALUE',
- 'VALUE-CHANGED',
- 'VALUES',
- 'VARIABLE',
- 'VAR',
- 'VARI',
- 'VARIA',
- 'VARIAB',
- 'VARIABL',
- 'VERBOSE',
- 'VERSION',
- 'VERTICAL',
- 'VERT',
- 'VERTI',
- 'VERTIC',
- 'VERTICA',
- 'VIEW',
- 'VIEW-AS',
- 'VIEW-FIRST-COLUMN-ON-REOPEN',
- 'VIRTUAL-HEIGHT-CHARS',
- 'VIRTUAL-HEIGHT',
- 'VIRTUAL-HEIGHT-',
- 'VIRTUAL-HEIGHT-C',
- 'VIRTUAL-HEIGHT-CH',
- 'VIRTUAL-HEIGHT-CHA',
- 'VIRTUAL-HEIGHT-CHAR',
- 'VIRTUAL-HEIGHT-PIXELS',
- 'VIRTUAL-HEIGHT-P',
- 'VIRTUAL-HEIGHT-PI',
- 'VIRTUAL-HEIGHT-PIX',
- 'VIRTUAL-HEIGHT-PIXE',
- 'VIRTUAL-HEIGHT-PIXEL',
- 'VIRTUAL-WIDTH-CHARS',
- 'VIRTUAL-WIDTH',
- 'VIRTUAL-WIDTH-',
- 'VIRTUAL-WIDTH-C',
- 'VIRTUAL-WIDTH-CH',
- 'VIRTUAL-WIDTH-CHA',
- 'VIRTUAL-WIDTH-CHAR',
- 'VIRTUAL-WIDTH-PIXELS',
- 'VIRTUAL-WIDTH-P',
- 'VIRTUAL-WIDTH-PI',
- 'VIRTUAL-WIDTH-PIX',
- 'VIRTUAL-WIDTH-PIXE',
- 'VIRTUAL-WIDTH-PIXEL',
- 'VISIBLE',
- 'VOID',
- 'WAIT',
- 'WAIT-FOR',
- 'WARNING',
- 'WEB-CONTEXT',
- 'WEEKDAY',
- 'WHEN',
- 'WHERE',
- 'WHILE',
- 'WIDGET',
- 'WIDGET-ENTER',
- 'WIDGET-E',
- 'WIDGET-EN',
- 'WIDGET-ENT',
- 'WIDGET-ENTE',
- 'WIDGET-ID',
- 'WIDGET-LEAVE',
- 'WIDGET-L',
- 'WIDGET-LE',
- 'WIDGET-LEA',
- 'WIDGET-LEAV',
- 'WIDGET-POOL',
- 'WIDTH-CHARS',
- 'WIDTH',
- 'WIDTH-',
- 'WIDTH-C',
- 'WIDTH-CH',
- 'WIDTH-CHA',
- 'WIDTH-CHAR',
- 'WIDTH-PIXELS',
- 'WIDTH-P',
- 'WIDTH-PI',
- 'WIDTH-PIX',
- 'WIDTH-PIXE',
- 'WIDTH-PIXEL',
- 'WINDOW',
- 'WINDOW-MAXIMIZED',
- 'WINDOW-MAXIM',
- 'WINDOW-MAXIMI',
- 'WINDOW-MAXIMIZ',
- 'WINDOW-MAXIMIZE',
- 'WINDOW-MINIMIZED',
- 'WINDOW-MINIM',
- 'WINDOW-MINIMI',
- 'WINDOW-MINIMIZ',
- 'WINDOW-MINIMIZE',
- 'WINDOW-NAME',
- 'WINDOW-NORMAL',
- 'WINDOW-STATE',
- 'WINDOW-STA',
- 'WINDOW-STAT',
- 'WINDOW-SYSTEM',
- 'WITH',
- 'WORD-INDEX',
- 'WORD-WRAP',
- 'WORK-AREA-HEIGHT-PIXELS',
- 'WORK-AREA-WIDTH-PIXELS',
- 'WORK-AREA-X',
- 'WORK-AREA-Y',
- 'WORKFILE',
- 'WORK-TABLE',
- 'WORK-TAB',
- 'WORK-TABL',
- 'WRITE',
- 'WRITE-CDATA',
- 'WRITE-CHARACTERS',
- 'WRITE-COMMENT',
- 'WRITE-DATA-ELEMENT',
- 'WRITE-EMPTY-ELEMENT',
- 'WRITE-ENTITY-REF',
- 'WRITE-EXTERNAL-DTD',
- 'WRITE-FRAGMENT',
- 'WRITE-MESSAGE',
- 'WRITE-PROCESSING-INSTRUCTION',
- 'WRITE-STATUS',
- 'WRITE-XML',
- 'WRITE-XMLSCHEMA',
- 'X',
- 'XCODE',
- 'XML-DATA-TYPE',
- 'XML-NODE-TYPE',
- 'XML-SCHEMA-PATH',
- 'XML-SUPPRESS-NAMESPACE-PROCESSING',
- 'X-OF',
- 'XREF',
- 'XREF-XML',
- 'Y',
- 'YEAR',
- 'YEAR-OFFSET',
- 'YES',
- 'YES-NO',
- 'YES-NO-CANCEL',
- 'Y-OF'
-)
diff --git a/pygments/lexers/_php_builtins.py b/pygments/lexers/_php_builtins.py
deleted file mode 100644
index 44ef2053..00000000
--- a/pygments/lexers/_php_builtins.py
+++ /dev/null
@@ -1,4756 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._php_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This file loads the function names and their modules from the
- php webpage and generates itself.
-
- Do not alter the MODULES dict by hand!
-
- WARNING: the generation transfers quite much data over your
- internet connection. don't run that at home, use
- a server ;-)
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-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',
- 'apd_continue',
- 'apd_croak',
- 'apd_dump_function_table',
- 'apd_dump_persistent_resources',
- 'apd_dump_regular_resources',
- 'apd_echo',
- 'apd_get_active_symbols',
- 'apd_set_pprof_trace',
- 'apd_set_session_trace_socket',
- 'apd_set_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_rpl_parse',
- 'mysqli_enable_reads_from_master',
- 'mysqli_enable_rpl_parse',
- 'mysqli_escape_string',
- 'mysqli_execute',
- 'mysqli_fetch',
- 'mysqli_get_cache_stats',
- 'mysqli_get_metadata',
- 'mysqli_master_query',
- 'mysqli_param_count',
- 'mysqli_report',
- 'mysqli_rpl_parse_enabled',
- 'mysqli_rpl_probe',
- 'mysqli_send_long_data',
- 'mysqli_slave_query'),
- 'Apache': ('apache_child_terminate',
- 'apache_get_modules',
- 'apache_get_version',
- 'apache_getenv',
- 'apache_lookup_uri',
- 'apache_note',
- 'apache_request_headers',
- 'apache_reset_timeout',
- 'apache_response_headers',
- 'apache_setenv',
- 'getallheaders',
- 'virtual'),
- 'Array': ('array_change_key_case',
- 'array_chunk',
- 'array_column',
- '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_exists',
- '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',
- 'bcmul',
- 'bcpow',
- 'bcpowmod',
- 'bcscale',
- 'bcsqrt',
- 'bcsub'),
- 'Blenc': ('blenc_encrypt',),
- 'Bzip2': ('bzclose',
- 'bzcompress',
- 'bzdecompress',
- 'bzerrno',
- 'bzerror',
- 'bzerrstr',
- 'bzflush',
- 'bzopen',
- 'bzread',
- 'bzwrite'),
- 'COM': ('com_addref',
- 'com_create_guid',
- 'com_event_sink',
- 'com_get_active_object',
- 'com_get',
- 'com_invoke',
- 'com_isenum',
- 'com_load_typelib',
- 'com_load',
- 'com_message_pump',
- 'com_print_typeinfo',
- 'com_propget',
- 'com_propput',
- 'com_propset',
- 'com_release',
- 'com_set',
- 'variant_abs',
- 'variant_add',
- 'variant_and',
- 'variant_cast',
- 'variant_cat',
- 'variant_cmp',
- 'variant_date_from_timestamp',
- 'variant_date_to_timestamp',
- 'variant_div',
- 'variant_eqv',
- 'variant_fix',
- 'variant_get_type',
- 'variant_idiv',
- 'variant_imp',
- 'variant_int',
- 'variant_mod',
- 'variant_mul',
- 'variant_neg',
- 'variant_not',
- 'variant_or',
- 'variant_pow',
- 'variant_round',
- 'variant_set_type',
- 'variant_set',
- 'variant_sub',
- 'variant_xor'),
- 'CUBRID': ('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_autocommit',
- 'cubrid_get_charset',
- 'cubrid_get_class_name',
- 'cubrid_get_client_info',
- 'cubrid_get_db_parameter',
- 'cubrid_get_query_timeout',
- '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_lob2_bind',
- 'cubrid_lob2_close',
- 'cubrid_lob2_export',
- 'cubrid_lob2_import',
- 'cubrid_lob2_new',
- 'cubrid_lob2_read',
- 'cubrid_lob2_seek64',
- 'cubrid_lob2_seek',
- 'cubrid_lob2_size64',
- 'cubrid_lob2_size',
- 'cubrid_lob2_tell64',
- 'cubrid_lob2_tell',
- 'cubrid_lob2_write',
- 'cubrid_lock_read',
- 'cubrid_lock_write',
- 'cubrid_move_cursor',
- 'cubrid_next_result',
- 'cubrid_num_cols',
- 'cubrid_num_rows',
- 'cubrid_pconnect_with_url',
- 'cubrid_pconnect',
- 'cubrid_prepare',
- 'cubrid_put',
- 'cubrid_rollback',
- 'cubrid_schema',
- 'cubrid_seq_drop',
- 'cubrid_seq_insert',
- 'cubrid_seq_put',
- 'cubrid_set_add',
- 'cubrid_set_autocommit',
- 'cubrid_set_db_parameter',
- 'cubrid_set_drop',
- 'cubrid_set_query_timeout',
- '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',
- 'jdtojewish',
- 'JDToJulian',
- 'jdtounix',
- 'JewishToJD',
- 'JulianToJD',
- 'unixtojd'),
- 'Classes/Object': ('__autoload',
- '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_declared_traits',
- 'get_object_vars',
- 'get_parent_class',
- 'interface_exists',
- 'is_a',
- 'is_subclass_of',
- 'method_exists',
- 'property_exists',
- 'trait_exists'),
- 'Classkit': ('classkit_import',
- 'classkit_method_add',
- 'classkit_method_copy',
- 'classkit_method_redefine',
- 'classkit_method_remove',
- 'classkit_method_rename'),
- 'Crack': ('crack_check',
- 'crack_closedict',
- 'crack_getlastmessage',
- 'crack_opendict'),
- 'Ctype': ('ctype_alnum',
- 'ctype_alpha',
- 'ctype_cntrl',
- 'ctype_digit',
- 'ctype_graph',
- 'ctype_lower',
- 'ctype_print',
- 'ctype_punct',
- 'ctype_space',
- 'ctype_upper',
- 'ctype_xdigit'),
- 'Cyrus': ('cyrus_authenticate',
- 'cyrus_bind',
- 'cyrus_close',
- 'cyrus_connect',
- 'cyrus_query',
- 'cyrus_unbind'),
- 'DB++': ('dbplus_add',
- 'dbplus_aql',
- 'dbplus_chdir',
- 'dbplus_close',
- 'dbplus_curr',
- 'dbplus_errcode',
- 'dbplus_errno',
- 'dbplus_find',
- 'dbplus_first',
- 'dbplus_flush',
- 'dbplus_freealllocks',
- 'dbplus_freelock',
- 'dbplus_freerlocks',
- 'dbplus_getlock',
- 'dbplus_getunique',
- 'dbplus_info',
- 'dbplus_last',
- 'dbplus_lockrel',
- 'dbplus_next',
- 'dbplus_open',
- 'dbplus_prev',
- 'dbplus_rchperm',
- 'dbplus_rcreate',
- 'dbplus_rcrtexact',
- 'dbplus_rcrtlike',
- 'dbplus_resolve',
- 'dbplus_restorepos',
- 'dbplus_rkeys',
- 'dbplus_ropen',
- 'dbplus_rquery',
- 'dbplus_rrename',
- 'dbplus_rsecindex',
- 'dbplus_runlink',
- 'dbplus_rzap',
- 'dbplus_savepos',
- 'dbplus_setindex',
- 'dbplus_setindexbynumber',
- 'dbplus_sql',
- 'dbplus_tcl',
- 'dbplus_tremove',
- 'dbplus_undo',
- 'dbplus_undoprepare',
- 'dbplus_unlockrel',
- 'dbplus_unselect',
- 'dbplus_update',
- 'dbplus_xlockrel',
- 'dbplus_xunlockrel'),
- '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',),
- 'Date/Time': ('checkdate',
- 'date_add',
- 'date_create_from_format',
- 'date_create_immutable_from_format',
- 'date_create_immutable',
- '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',
- 'gmmktime',
- 'gmstrftime',
- 'idate',
- 'localtime',
- 'microtime',
- 'mktime',
- 'strftime',
- 'strptime',
- 'strtotime',
- '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',
- 'dio_read',
- 'dio_seek',
- 'dio_stat',
- 'dio_tcsetattr',
- 'dio_truncate',
- 'dio_write'),
- 'Directory': ('chdir',
- 'chroot',
- 'closedir',
- 'dir',
- 'getcwd',
- 'opendir',
- 'readdir',
- 'rewinddir',
- 'scandir'),
- 'Eio': ('eio_busy',
- 'eio_cancel',
- 'eio_chmod',
- 'eio_chown',
- 'eio_close',
- 'eio_custom',
- 'eio_dup2',
- 'eio_event_loop',
- 'eio_fallocate',
- 'eio_fchmod',
- 'eio_fchown',
- 'eio_fdatasync',
- 'eio_fstat',
- 'eio_fstatvfs',
- 'eio_fsync',
- 'eio_ftruncate',
- 'eio_futime',
- 'eio_get_event_stream',
- 'eio_get_last_error',
- 'eio_grp_add',
- 'eio_grp_cancel',
- 'eio_grp_limit',
- 'eio_grp',
- 'eio_init',
- 'eio_link',
- 'eio_lstat',
- 'eio_mkdir',
- 'eio_mknod',
- 'eio_nop',
- 'eio_npending',
- 'eio_nready',
- 'eio_nreqs',
- 'eio_nthreads',
- 'eio_open',
- 'eio_poll',
- 'eio_read',
- 'eio_readahead',
- 'eio_readdir',
- 'eio_readlink',
- 'eio_realpath',
- 'eio_rename',
- 'eio_rmdir',
- 'eio_seek',
- 'eio_sendfile',
- 'eio_set_max_idle',
- 'eio_set_max_parallel',
- 'eio_set_max_poll_reqs',
- 'eio_set_max_poll_time',
- 'eio_set_min_parallel',
- 'eio_stat',
- 'eio_statvfs',
- 'eio_symlink',
- 'eio_sync_file_range',
- 'eio_sync',
- 'eio_syncfs',
- 'eio_truncate',
- 'eio_unlink',
- 'eio_utime',
- 'eio_write'),
- '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', 'expect_popen'),
- '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',
- 'fdf_create',
- 'fdf_enum_values',
- 'fdf_errno',
- 'fdf_error',
- 'fdf_get_ap',
- 'fdf_get_attachment',
- 'fdf_get_encoding',
- 'fdf_get_file',
- 'fdf_get_flags',
- 'fdf_get_opt',
- 'fdf_get_status',
- 'fdf_get_value',
- 'fdf_get_version',
- 'fdf_header',
- 'fdf_next_field_name',
- 'fdf_open_string',
- 'fdf_open',
- 'fdf_remove_item',
- 'fdf_save_string',
- 'fdf_save',
- 'fdf_set_ap',
- 'fdf_set_encoding',
- 'fdf_set_file',
- 'fdf_set_flags',
- 'fdf_set_javascript_action',
- 'fdf_set_on_import_javascript',
- 'fdf_set_opt',
- 'fdf_set_status',
- 'fdf_set_submit_form_action',
- 'fdf_set_target_frame',
- 'fdf_set_value',
- 'fdf_set_version'),
- 'FPM': ('fastcgi_finish_request',),
- 'FTP': ('ftp_alloc',
- 'ftp_cdup',
- 'ftp_chdir',
- 'ftp_chmod',
- 'ftp_close',
- 'ftp_connect',
- 'ftp_delete',
- 'ftp_exec',
- 'ftp_fget',
- 'ftp_fput',
- 'ftp_get_option',
- 'ftp_get',
- 'ftp_login',
- 'ftp_mdtm',
- 'ftp_mkdir',
- 'ftp_nb_continue',
- 'ftp_nb_fget',
- 'ftp_nb_fput',
- 'ftp_nb_get',
- 'ftp_nb_put',
- 'ftp_nlist',
- 'ftp_pasv',
- 'ftp_put',
- 'ftp_pwd',
- 'ftp_quit',
- 'ftp_raw',
- 'ftp_rawlist',
- 'ftp_rename',
- 'ftp_rmdir',
- 'ftp_set_option',
- 'ftp_site',
- 'ftp_size',
- 'ftp_ssl_connect',
- 'ftp_systype'),
- 'Fann': ('fann_cascadetrain_on_data',
- 'fann_cascadetrain_on_file',
- 'fann_clear_scaling_params',
- 'fann_copy',
- 'fann_create_from_file',
- 'fann_create_shortcut_array',
- 'fann_create_shortcut',
- 'fann_create_sparse_array',
- 'fann_create_sparse',
- 'fann_create_standard_array',
- 'fann_create_standard',
- 'fann_create_train_from_callback',
- 'fann_create_train',
- 'fann_descale_input',
- 'fann_descale_output',
- 'fann_descale_train',
- 'fann_destroy_train',
- 'fann_destroy',
- 'fann_duplicate_train_data',
- 'fann_get_activation_function',
- 'fann_get_activation_steepness',
- 'fann_get_bias_array',
- 'fann_get_bit_fail_limit',
- 'fann_get_bit_fail',
- 'fann_get_cascade_activation_functions_count',
- 'fann_get_cascade_activation_functions',
- 'fann_get_cascade_activation_steepnesses_count',
- 'fann_get_cascade_activation_steepnesses',
- 'fann_get_cascade_candidate_change_fraction',
- 'fann_get_cascade_candidate_limit',
- 'fann_get_cascade_candidate_stagnation_epochs',
- 'fann_get_cascade_max_cand_epochs',
- 'fann_get_cascade_max_out_epochs',
- 'fann_get_cascade_min_cand_epochs',
- 'fann_get_cascade_min_out_epochs',
- 'fann_get_cascade_num_candidate_groups',
- 'fann_get_cascade_num_candidates',
- 'fann_get_cascade_output_change_fraction',
- 'fann_get_cascade_output_stagnation_epochs',
- 'fann_get_cascade_weight_multiplier',
- 'fann_get_connection_array',
- 'fann_get_connection_rate',
- 'fann_get_errno',
- 'fann_get_errstr',
- 'fann_get_layer_array',
- 'fann_get_learning_momentum',
- 'fann_get_learning_rate',
- 'fann_get_MSE',
- 'fann_get_network_type',
- 'fann_get_num_input',
- 'fann_get_num_layers',
- 'fann_get_num_output',
- 'fann_get_quickprop_decay',
- 'fann_get_quickprop_mu',
- 'fann_get_rprop_decrease_factor',
- 'fann_get_rprop_delta_max',
- 'fann_get_rprop_delta_min',
- 'fann_get_rprop_delta_zero',
- 'fann_get_rprop_increase_factor',
- 'fann_get_sarprop_step_error_shift',
- 'fann_get_sarprop_step_error_threshold_factor',
- 'fann_get_sarprop_temperature',
- 'fann_get_sarprop_weight_decay_shift',
- 'fann_get_total_connections',
- 'fann_get_total_neurons',
- 'fann_get_train_error_function',
- 'fann_get_train_stop_function',
- 'fann_get_training_algorithm',
- 'fann_init_weights',
- 'fann_length_train_data',
- 'fann_merge_train_data',
- 'fann_num_input_train_data',
- 'fann_num_output_train_data',
- 'fann_print_error',
- 'fann_randomize_weights',
- 'fann_read_train_from_file',
- 'fann_reset_errno',
- 'fann_reset_errstr',
- 'fann_reset_MSE',
- 'fann_run',
- 'fann_save_train',
- 'fann_save',
- 'fann_scale_input_train_data',
- 'fann_scale_input',
- 'fann_scale_output_train_data',
- 'fann_scale_output',
- 'fann_scale_train_data',
- 'fann_scale_train',
- 'fann_set_activation_function_hidden',
- 'fann_set_activation_function_layer',
- 'fann_set_activation_function_output',
- 'fann_set_activation_function',
- 'fann_set_activation_steepness_hidden',
- 'fann_set_activation_steepness_layer',
- 'fann_set_activation_steepness_output',
- 'fann_set_activation_steepness',
- 'fann_set_bit_fail_limit',
- 'fann_set_callback',
- 'fann_set_cascade_activation_functions',
- 'fann_set_cascade_activation_steepnesses',
- 'fann_set_cascade_candidate_change_fraction',
- 'fann_set_cascade_candidate_limit',
- 'fann_set_cascade_candidate_stagnation_epochs',
- 'fann_set_cascade_max_cand_epochs',
- 'fann_set_cascade_max_out_epochs',
- 'fann_set_cascade_min_cand_epochs',
- 'fann_set_cascade_min_out_epochs',
- 'fann_set_cascade_num_candidate_groups',
- 'fann_set_cascade_output_change_fraction',
- 'fann_set_cascade_output_stagnation_epochs',
- 'fann_set_cascade_weight_multiplier',
- 'fann_set_error_log',
- 'fann_set_input_scaling_params',
- 'fann_set_learning_momentum',
- 'fann_set_learning_rate',
- 'fann_set_output_scaling_params',
- 'fann_set_quickprop_decay',
- 'fann_set_quickprop_mu',
- 'fann_set_rprop_decrease_factor',
- 'fann_set_rprop_delta_max',
- 'fann_set_rprop_delta_min',
- 'fann_set_rprop_delta_zero',
- 'fann_set_rprop_increase_factor',
- 'fann_set_sarprop_step_error_shift',
- 'fann_set_sarprop_step_error_threshold_factor',
- 'fann_set_sarprop_temperature',
- 'fann_set_sarprop_weight_decay_shift',
- 'fann_set_scaling_params',
- 'fann_set_train_error_function',
- 'fann_set_train_stop_function',
- 'fann_set_training_algorithm',
- 'fann_set_weight_array',
- 'fann_set_weight',
- 'fann_shuffle_train_data',
- 'fann_subset_train_data',
- 'fann_test_data',
- 'fann_test',
- 'fann_train_epoch',
- 'fann_train_on_data',
- 'fann_train_on_file',
- 'fann_train'),
- 'Fileinfo': ('finfo_buffer',
- 'finfo_close',
- 'finfo_file',
- 'finfo_open',
- 'finfo_set_flags',
- 'mime_content_type'),
- 'Filesystem': ('basename',
- 'chgrp',
- 'chmod',
- 'chown',
- 'clearstatcache',
- 'copy',
- 'dirname',
- 'disk_free_space',
- 'disk_total_space',
- 'diskfreespace',
- 'fclose',
- 'feof',
- 'fflush',
- 'fgetc',
- 'fgetcsv',
- 'fgets',
- 'fgetss',
- 'file_exists',
- 'file_get_contents',
- 'file_put_contents',
- 'file',
- 'fileatime',
- 'filectime',
- 'filegroup',
- 'fileinode',
- 'filemtime',
- 'fileowner',
- 'fileperms',
- 'filesize',
- 'filetype',
- 'flock',
- 'fnmatch',
- 'fopen',
- 'fpassthru',
- 'fputcsv',
- 'fputs',
- 'fread',
- 'fscanf',
- 'fseek',
- 'fstat',
- 'ftell',
- 'ftruncate',
- 'fwrite',
- 'glob',
- 'is_dir',
- 'is_executable',
- 'is_file',
- 'is_link',
- 'is_readable',
- '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',
- 'rmdir',
- 'set_file_buffer',
- 'stat',
- 'symlink',
- 'tempnam',
- 'tmpfile',
- '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',
- 'ibase_blob_add',
- 'ibase_blob_cancel',
- 'ibase_blob_close',
- 'ibase_blob_create',
- 'ibase_blob_echo',
- 'ibase_blob_get',
- 'ibase_blob_import',
- 'ibase_blob_info',
- 'ibase_blob_open',
- 'ibase_close',
- 'ibase_commit_ret',
- 'ibase_commit',
- 'ibase_connect',
- 'ibase_db_info',
- 'ibase_delete_user',
- 'ibase_drop_db',
- 'ibase_errcode',
- 'ibase_errmsg',
- 'ibase_execute',
- 'ibase_fetch_assoc',
- 'ibase_fetch_object',
- 'ibase_fetch_row',
- 'ibase_field_info',
- 'ibase_free_event_handler',
- 'ibase_free_query',
- 'ibase_free_result',
- 'ibase_gen_id',
- 'ibase_maintain_db',
- 'ibase_modify_user',
- 'ibase_name_result',
- 'ibase_num_fields',
- 'ibase_num_params',
- 'ibase_param_info',
- 'ibase_pconnect',
- 'ibase_prepare',
- 'ibase_query',
- 'ibase_restore',
- 'ibase_rollback_ret',
- 'ibase_rollback',
- 'ibase_server_info',
- 'ibase_service_attach',
- 'ibase_service_detach',
- 'ibase_set_event_handler',
- 'ibase_trans',
- 'ibase_wait_event'),
- 'FriBiDi': ('fribidi_log2vis',),
- 'FrontBase': ('fbsql_affected_rows',
- 'fbsql_autocommit',
- 'fbsql_blob_size',
- 'fbsql_change_user',
- 'fbsql_clob_size',
- 'fbsql_close',
- 'fbsql_commit',
- 'fbsql_connect',
- 'fbsql_create_blob',
- 'fbsql_create_clob',
- 'fbsql_create_db',
- 'fbsql_data_seek',
- 'fbsql_database_password',
- 'fbsql_database',
- 'fbsql_db_query',
- 'fbsql_db_status',
- 'fbsql_drop_db',
- 'fbsql_errno',
- 'fbsql_error',
- 'fbsql_fetch_array',
- 'fbsql_fetch_assoc',
- 'fbsql_fetch_field',
- 'fbsql_fetch_lengths',
- 'fbsql_fetch_object',
- 'fbsql_fetch_row',
- 'fbsql_field_flags',
- 'fbsql_field_len',
- 'fbsql_field_name',
- 'fbsql_field_seek',
- 'fbsql_field_table',
- 'fbsql_field_type',
- 'fbsql_free_result',
- 'fbsql_get_autostart_info',
- 'fbsql_hostname',
- 'fbsql_insert_id',
- 'fbsql_list_dbs',
- 'fbsql_list_fields',
- 'fbsql_list_tables',
- 'fbsql_next_result',
- 'fbsql_num_fields',
- 'fbsql_num_rows',
- 'fbsql_password',
- 'fbsql_pconnect',
- 'fbsql_query',
- 'fbsql_read_blob',
- '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_array',
- 'call_user_func',
- 'create_function',
- 'forward_static_call_array',
- 'forward_static_call',
- 'func_get_arg',
- 'func_get_args',
- 'func_num_args',
- 'function_exists',
- 'get_defined_functions',
- 'register_shutdown_function',
- 'register_tick_function',
- 'unregister_tick_function'),
- 'GD and Image': ('gd_info',
- 'getimagesize',
- 'getimagesizefromstring',
- 'image_type_to_extension',
- 'image_type_to_mime_type',
- 'image2wbmp',
- 'imageaffine',
- 'imageaffinematrixconcat',
- 'imageaffinematrixget',
- 'imagealphablending',
- 'imageantialias',
- 'imagearc',
- 'imagechar',
- 'imagecharup',
- 'imagecolorallocate',
- 'imagecolorallocatealpha',
- 'imagecolorat',
- 'imagecolorclosest',
- 'imagecolorclosestalpha',
- 'imagecolorclosesthwb',
- 'imagecolordeallocate',
- 'imagecolorexact',
- 'imagecolorexactalpha',
- 'imagecolormatch',
- 'imagecolorresolve',
- 'imagecolorresolvealpha',
- 'imagecolorset',
- 'imagecolorsforindex',
- 'imagecolorstotal',
- 'imagecolortransparent',
- 'imageconvolution',
- 'imagecopy',
- 'imagecopymerge',
- 'imagecopymergegray',
- 'imagecopyresampled',
- 'imagecopyresized',
- 'imagecreate',
- 'imagecreatefromgd2',
- 'imagecreatefromgd2part',
- 'imagecreatefromgd',
- 'imagecreatefromgif',
- 'imagecreatefromjpeg',
- 'imagecreatefrompng',
- 'imagecreatefromstring',
- 'imagecreatefromwbmp',
- 'imagecreatefromwebp',
- 'imagecreatefromxbm',
- 'imagecreatefromxpm',
- 'imagecreatetruecolor',
- 'imagecrop',
- 'imagecropauto',
- 'imagedashedline',
- 'imagedestroy',
- 'imageellipse',
- 'imagefill',
- 'imagefilledarc',
- 'imagefilledellipse',
- 'imagefilledpolygon',
- 'imagefilledrectangle',
- 'imagefilltoborder',
- 'imagefilter',
- 'imageflip',
- 'imagefontheight',
- 'imagefontwidth',
- 'imageftbbox',
- 'imagefttext',
- 'imagegammacorrect',
- 'imagegd2',
- 'imagegd',
- 'imagegif',
- 'imagegrabscreen',
- 'imagegrabwindow',
- 'imageinterlace',
- 'imageistruecolor',
- 'imagejpeg',
- 'imagelayereffect',
- 'imageline',
- 'imageloadfont',
- 'imagepalettecopy',
- 'imagepalettetotruecolor',
- 'imagepng',
- 'imagepolygon',
- 'imagepsbbox',
- 'imagepsencodefont',
- 'imagepsextendfont',
- 'imagepsfreefont',
- 'imagepsloadfont',
- 'imagepsslantfont',
- 'imagepstext',
- 'imagerectangle',
- 'imagerotate',
- 'imagesavealpha',
- 'imagescale',
- 'imagesetbrush',
- 'imagesetinterpolation',
- 'imagesetpixel',
- 'imagesetstyle',
- 'imagesetthickness',
- 'imagesettile',
- 'imagestring',
- 'imagestringup',
- 'imagesx',
- 'imagesy',
- 'imagetruecolortopalette',
- 'imagettfbbox',
- 'imagettftext',
- 'imagetypes',
- 'imagewbmp',
- 'imagewebp',
- 'imagexbm',
- 'iptcembed',
- 'iptcparse',
- 'jpeg2wbmp',
- 'png2wbmp'),
- 'GMP': ('gmp_abs',
- 'gmp_add',
- 'gmp_and',
- 'gmp_clrbit',
- 'gmp_cmp',
- 'gmp_com',
- 'gmp_div_q',
- 'gmp_div_qr',
- 'gmp_div_r',
- 'gmp_div',
- 'gmp_divexact',
- 'gmp_fact',
- 'gmp_gcd',
- 'gmp_gcdext',
- 'gmp_hamdist',
- 'gmp_init',
- 'gmp_intval',
- 'gmp_invert',
- 'gmp_jacobi',
- 'gmp_legendre',
- 'gmp_mod',
- 'gmp_mul',
- 'gmp_neg',
- 'gmp_nextprime',
- 'gmp_or',
- 'gmp_perfect_square',
- 'gmp_popcount',
- 'gmp_pow',
- 'gmp_powm',
- 'gmp_prob_prime',
- 'gmp_random',
- 'gmp_scan0',
- 'gmp_scan1',
- 'gmp_setbit',
- 'gmp_sign',
- 'gmp_sqrt',
- 'gmp_sqrtrem',
- 'gmp_strval',
- 'gmp_sub',
- 'gmp_testbit',
- 'gmp_xor'),
- 'GeoIP': ('geoip_asnum_by_name',
- '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_domain_by_name',
- 'geoip_id_by_name',
- 'geoip_isp_by_name',
- 'geoip_netspeedcell_by_name',
- 'geoip_org_by_name',
- 'geoip_record_by_name',
- 'geoip_region_by_name',
- 'geoip_region_name_by_code',
- 'geoip_setup_custom_directory',
- '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_pbkdf2',
- 'hash_update_file',
- 'hash_update_stream',
- 'hash_update',
- 'hash'),
- 'Hyperwave': ('hw_Array2Objrec',
- 'hw_changeobject',
- '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_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_getrellink',
- 'hw_GetRemote',
- 'hw_getremotechildren',
- 'hw_GetSrcByDestObj',
- 'hw_GetText',
- 'hw_getusername',
- 'hw_Identify',
- 'hw_InCollections',
- 'hw_Info',
- 'hw_InsColl',
- 'hw_InsDoc',
- 'hw_insertanchors',
- 'hw_InsertDocument',
- 'hw_InsertObject',
- 'hw_mapid',
- 'hw_Modifyobject',
- 'hw_mv',
- 'hw_New_Document',
- 'hw_objrec2array',
- 'hw_Output_Document',
- 'hw_pConnect',
- 'hw_PipeDocument',
- 'hw_Root',
- 'hw_setlinkroot',
- 'hw_stat',
- 'hw_Unlock',
- 'hw_Who'),
- 'Hyperwave API': ('hwapi_attribute_new',
- 'hwapi_content_new',
- 'hwapi_hgcsp',
- 'hwapi_object_new'),
- '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',
- 'db2_lob_read',
- 'db2_next_result',
- 'db2_num_fields',
- 'db2_num_rows',
- 'db2_pclose',
- 'db2_pconnect',
- 'db2_prepare',
- 'db2_primary_keys',
- 'db2_procedure_columns',
- 'db2_procedures',
- 'db2_result',
- 'db2_rollback',
- 'db2_server_info',
- 'db2_set_option',
- 'db2_special_columns',
- 'db2_statistics',
- 'db2_stmt_error',
- 'db2_stmt_errormsg',
- 'db2_table_privileges',
- 'db2_tables'),
- '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': ('grapheme_substr', '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',
- 'imap_base64',
- 'imap_binary',
- 'imap_body',
- 'imap_bodystruct',
- 'imap_check',
- 'imap_clearflag_full',
- 'imap_close',
- 'imap_create',
- 'imap_createmailbox',
- 'imap_delete',
- 'imap_deletemailbox',
- 'imap_errors',
- 'imap_expunge',
- 'imap_fetch_overview',
- 'imap_fetchbody',
- 'imap_fetchheader',
- 'imap_fetchmime',
- 'imap_fetchstructure',
- 'imap_fetchtext',
- 'imap_gc',
- 'imap_get_quota',
- 'imap_get_quotaroot',
- 'imap_getacl',
- 'imap_getmailboxes',
- 'imap_getsubscribed',
- 'imap_header',
- 'imap_headerinfo',
- 'imap_headers',
- 'imap_last_error',
- 'imap_list',
- 'imap_listmailbox',
- 'imap_listscan',
- 'imap_listsubscribed',
- 'imap_lsub',
- 'imap_mail_compose',
- 'imap_mail_copy',
- 'imap_mail_move',
- 'imap_mail',
- 'imap_mailboxmsginfo',
- 'imap_mime_header_decode',
- 'imap_msgno',
- 'imap_num_msg',
- 'imap_num_recent',
- 'imap_open',
- 'imap_ping',
- 'imap_qprint',
- 'imap_rename',
- 'imap_renamemailbox',
- 'imap_reopen',
- 'imap_rfc822_parse_adrlist',
- 'imap_rfc822_parse_headers',
- 'imap_rfc822_write_address',
- 'imap_savebody',
- 'imap_scan',
- 'imap_scanmailbox',
- 'imap_search',
- 'imap_set_quota',
- 'imap_setacl',
- 'imap_setflag_full',
- 'imap_sort',
- 'imap_status',
- 'imap_subscribe',
- 'imap_thread',
- 'imap_timeout',
- 'imap_uid',
- 'imap_undelete',
- 'imap_unsubscribe',
- 'imap_utf7_decode',
- 'imap_utf7_encode',
- 'imap_utf8'),
- 'Informix': ('ifx_affected_rows',
- 'ifx_blobinfile_mode',
- 'ifx_byteasvarchar',
- 'ifx_close',
- 'ifx_connect',
- 'ifx_copy_blob',
- 'ifx_create_blob',
- 'ifx_create_char',
- 'ifx_do',
- 'ifx_error',
- 'ifx_errormsg',
- 'ifx_fetch_row',
- 'ifx_fieldproperties',
- 'ifx_fieldtypes',
- 'ifx_free_blob',
- 'ifx_free_char',
- 'ifx_free_result',
- 'ifx_get_blob',
- 'ifx_get_char',
- 'ifx_getsqlca',
- 'ifx_htmltbl_result',
- 'ifx_nullformat',
- 'ifx_num_fields',
- 'ifx_num_rows',
- 'ifx_pconnect',
- 'ifx_prepare',
- 'ifx_query',
- 'ifx_textasvarchar',
- 'ifx_update_blob',
- 'ifx_update_char',
- 'ifxus_close_slob',
- 'ifxus_create_slob',
- 'ifxus_free_slob',
- 'ifxus_open_slob',
- 'ifxus_read_slob',
- 'ifxus_seek_slob',
- 'ifxus_tell_slob',
- 'ifxus_write_slob'),
- '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_msg',
- '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',
- 'ldap_close',
- 'ldap_compare',
- 'ldap_connect',
- 'ldap_control_paged_result_response',
- 'ldap_control_paged_result',
- 'ldap_count_entries',
- 'ldap_delete',
- 'ldap_dn2ufn',
- 'ldap_err2str',
- 'ldap_errno',
- 'ldap_error',
- 'ldap_explode_dn',
- 'ldap_first_attribute',
- 'ldap_first_entry',
- 'ldap_first_reference',
- 'ldap_free_result',
- 'ldap_get_attributes',
- 'ldap_get_dn',
- 'ldap_get_entries',
- 'ldap_get_option',
- 'ldap_get_values_len',
- 'ldap_get_values',
- 'ldap_list',
- 'ldap_mod_add',
- 'ldap_mod_del',
- 'ldap_mod_replace',
- 'ldap_modify',
- 'ldap_next_attribute',
- 'ldap_next_entry',
- 'ldap_next_reference',
- 'ldap_parse_reference',
- 'ldap_parse_result',
- 'ldap_read',
- 'ldap_rename',
- 'ldap_sasl_bind',
- 'ldap_search',
- 'ldap_set_option',
- 'ldap_set_rebind_proc',
- 'ldap_sort',
- 'ldap_start_tls',
- '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',
- 'notes_create_note',
- 'notes_drop_db',
- 'notes_find_note',
- 'notes_header_info',
- 'notes_list_msgs',
- 'notes_mark_read',
- 'notes_mark_unread',
- 'notes_nav_create',
- 'notes_search',
- 'notes_unread',
- 'notes_version'),
- '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',
- 'm_responseparam',
- 'm_returnstatus',
- 'm_setblocking',
- 'm_setdropfile',
- 'm_setip',
- 'm_setssl_cafile',
- 'm_setssl_files',
- 'm_setssl',
- 'm_settimeout',
- 'm_sslcert_gen_hash',
- 'm_transactionssent',
- 'm_transinqueue',
- 'm_transkeyval',
- 'm_transnew',
- 'm_transsend',
- 'm_uwait',
- 'm_validateidentifier',
- 'm_verifyconnection',
- 'm_verifysslcert'),
- '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',
- 'atan2',
- 'atan',
- 'atanh',
- 'base_convert',
- 'bindec',
- 'ceil',
- 'cos',
- 'cosh',
- 'decbin',
- 'dechex',
- 'decoct',
- 'deg2rad',
- 'exp',
- 'expm1',
- 'floor',
- 'fmod',
- 'getrandmax',
- 'hexdec',
- 'hypot',
- 'is_finite',
- 'is_infinite',
- 'is_nan',
- 'lcg_value',
- 'log10',
- 'log1p',
- 'log',
- 'max',
- 'min',
- 'mt_getrandmax',
- 'mt_rand',
- 'mt_srand',
- 'octdec',
- 'pi',
- 'pow',
- 'rad2deg',
- 'rand',
- 'round',
- 'sin',
- 'sinh',
- 'sqrt',
- 'srand',
- 'tan',
- 'tanh'),
- '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',
- 'maxdb_stmt_bind_param',
- 'maxdb_stmt_bind_result',
- 'maxdb_stmt_close_long_data',
- 'maxdb_stmt_close',
- 'maxdb_stmt_data_seek',
- 'maxdb_stmt_errno',
- 'maxdb_stmt_error',
- 'maxdb_stmt_execute',
- 'maxdb_stmt_fetch',
- 'maxdb_stmt_free_result',
- 'maxdb_stmt_init',
- 'maxdb_stmt_num_rows',
- 'maxdb_stmt_param_count',
- 'maxdb_stmt_prepare',
- 'maxdb_stmt_reset',
- 'maxdb_stmt_result_metadata',
- 'maxdb_stmt_send_long_data',
- 'maxdb_stmt_sqlstate',
- 'maxdb_stmt_store_result',
- 'maxdb_store_result',
- 'maxdb_thread_id',
- 'maxdb_thread_safe',
- 'maxdb_use_result',
- 'maxdb_warning_count'),
- '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',),
- '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',
- 'constant',
- 'define',
- 'defined',
- 'die',
- 'eval',
- 'exit',
- 'get_browser',
- '__halt_compiler',
- 'highlight_file',
- 'highlight_string',
- 'ignore_user_abort',
- 'pack',
- 'php_check_syntax',
- '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_array',
- 'msession_get_data',
- 'msession_get',
- 'msession_inc',
- 'msession_list',
- 'msession_listvar',
- 'msession_lock',
- 'msession_plugin',
- 'msession_randstr',
- 'msession_set_array',
- 'msession_set_data',
- 'msession_set',
- 'msession_timeout',
- 'msession_uniq',
- 'msession_unlock'),
- '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',
- 'mb_decode_mimeheader',
- 'mb_decode_numericentity',
- 'mb_detect_encoding',
- 'mb_detect_order',
- 'mb_encode_mimeheader',
- 'mb_encode_numericentity',
- 'mb_encoding_aliases',
- 'mb_ereg_match',
- 'mb_ereg_replace_callback',
- 'mb_ereg_replace',
- '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_ereg_search',
- 'mb_ereg',
- 'mb_eregi_replace',
- 'mb_eregi',
- 'mb_get_info',
- 'mb_http_input',
- 'mb_http_output',
- 'mb_internal_encoding',
- 'mb_language',
- 'mb_list_encodings',
- 'mb_output_handler',
- 'mb_parse_str',
- 'mb_preferred_mime_name',
- 'mb_regex_encoding',
- 'mb_regex_set_options',
- 'mb_send_mail',
- '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_count',
- 'mb_substr'),
- 'MySQL': ('mysql_affected_rows',
- 'mysql_client_encoding',
- 'mysql_close',
- 'mysql_connect',
- 'mysql_create_db',
- 'mysql_data_seek',
- 'mysql_db_name',
- 'mysql_db_query',
- 'mysql_drop_db',
- 'mysql_errno',
- 'mysql_error',
- 'mysql_escape_string',
- 'mysql_fetch_array',
- 'mysql_fetch_assoc',
- 'mysql_fetch_field',
- 'mysql_fetch_lengths',
- 'mysql_fetch_object',
- 'mysql_fetch_row',
- 'mysql_field_flags',
- 'mysql_field_len',
- 'mysql_field_name',
- 'mysql_field_seek',
- 'mysql_field_table',
- 'mysql_field_type',
- 'mysql_free_result',
- 'mysql_get_client_info',
- 'mysql_get_host_info',
- 'mysql_get_proto_info',
- 'mysql_get_server_info',
- 'mysql_info',
- 'mysql_insert_id',
- 'mysql_list_dbs',
- 'mysql_list_fields',
- 'mysql_list_processes',
- 'mysql_list_tables',
- 'mysql_num_fields',
- 'mysql_num_rows',
- 'mysql_pconnect',
- 'mysql_ping',
- 'mysql_query',
- 'mysql_real_escape_string',
- 'mysql_result',
- 'mysql_select_db',
- 'mysql_set_charset',
- 'mysql_stat',
- 'mysql_tablename',
- 'mysql_thread_id',
- 'mysql_unbuffered_query'),
- 'Mysqlnd_memcache': ('mysqlnd_memcache_get_config', 'mysqlnd_memcache_set'),
- 'Mysqlnd_ms': ('mysqlnd_ms_dump_servers',
- 'mysqlnd_ms_fabric_select_global',
- 'mysqlnd_ms_fabric_select_shard',
- 'mysqlnd_ms_get_last_gtid',
- 'mysqlnd_ms_get_last_used_connection',
- 'mysqlnd_ms_get_stats',
- 'mysqlnd_ms_match_wild',
- 'mysqlnd_ms_query_is_select',
- 'mysqlnd_ms_set_qos',
- 'mysqlnd_ms_set_user_pick_server'),
- 'Mysqlnd_uh': ('mysqlnd_uh_convert_to_mysqlnd',
- 'mysqlnd_uh_set_connection_proxy',
- 'mysqlnd_uh_set_statement_proxy'),
- 'NSAPI': ('nsapi_request_headers', 'nsapi_response_headers', 'nsapi_virtual'),
- 'Ncurses': ('ncurses_addch',
- 'ncurses_addchnstr',
- 'ncurses_addchstr',
- 'ncurses_addnstr',
- 'ncurses_addstr',
- 'ncurses_assume_default_colors',
- 'ncurses_attroff',
- 'ncurses_attron',
- 'ncurses_attrset',
- 'ncurses_baudrate',
- 'ncurses_beep',
- 'ncurses_bkgd',
- 'ncurses_bkgdset',
- 'ncurses_border',
- 'ncurses_bottom_panel',
- 'ncurses_can_change_color',
- 'ncurses_cbreak',
- 'ncurses_clear',
- 'ncurses_clrtobot',
- 'ncurses_clrtoeol',
- 'ncurses_color_content',
- 'ncurses_color_set',
- 'ncurses_curs_set',
- 'ncurses_def_prog_mode',
- 'ncurses_def_shell_mode',
- 'ncurses_define_key',
- 'ncurses_del_panel',
- 'ncurses_delay_output',
- 'ncurses_delch',
- 'ncurses_deleteln',
- 'ncurses_delwin',
- 'ncurses_doupdate',
- 'ncurses_echo',
- 'ncurses_echochar',
- 'ncurses_end',
- 'ncurses_erase',
- 'ncurses_erasechar',
- 'ncurses_filter',
- 'ncurses_flash',
- 'ncurses_flushinp',
- 'ncurses_getch',
- 'ncurses_getmaxyx',
- 'ncurses_getmouse',
- 'ncurses_getyx',
- 'ncurses_halfdelay',
- 'ncurses_has_colors',
- 'ncurses_has_ic',
- 'ncurses_has_il',
- 'ncurses_has_key',
- 'ncurses_hide_panel',
- 'ncurses_hline',
- 'ncurses_inch',
- 'ncurses_init_color',
- 'ncurses_init_pair',
- 'ncurses_init',
- 'ncurses_insch',
- 'ncurses_insdelln',
- 'ncurses_insertln',
- 'ncurses_insstr',
- 'ncurses_instr',
- 'ncurses_isendwin',
- 'ncurses_keyok',
- 'ncurses_keypad',
- 'ncurses_killchar',
- 'ncurses_longname',
- 'ncurses_meta',
- 'ncurses_mouse_trafo',
- 'ncurses_mouseinterval',
- 'ncurses_mousemask',
- 'ncurses_move_panel',
- 'ncurses_move',
- 'ncurses_mvaddch',
- 'ncurses_mvaddchnstr',
- 'ncurses_mvaddchstr',
- 'ncurses_mvaddnstr',
- 'ncurses_mvaddstr',
- 'ncurses_mvcur',
- 'ncurses_mvdelch',
- 'ncurses_mvgetch',
- 'ncurses_mvhline',
- 'ncurses_mvinch',
- 'ncurses_mvvline',
- 'ncurses_mvwaddstr',
- 'ncurses_napms',
- 'ncurses_new_panel',
- 'ncurses_newpad',
- 'ncurses_newwin',
- 'ncurses_nl',
- 'ncurses_nocbreak',
- 'ncurses_noecho',
- 'ncurses_nonl',
- 'ncurses_noqiflush',
- 'ncurses_noraw',
- 'ncurses_pair_content',
- 'ncurses_panel_above',
- 'ncurses_panel_below',
- 'ncurses_panel_window',
- 'ncurses_pnoutrefresh',
- 'ncurses_prefresh',
- 'ncurses_putp',
- 'ncurses_qiflush',
- 'ncurses_raw',
- 'ncurses_refresh',
- 'ncurses_replace_panel',
- 'ncurses_reset_prog_mode',
- 'ncurses_reset_shell_mode',
- 'ncurses_resetty',
- 'ncurses_savetty',
- 'ncurses_scr_dump',
- 'ncurses_scr_init',
- 'ncurses_scr_restore',
- 'ncurses_scr_set',
- 'ncurses_scrl',
- 'ncurses_show_panel',
- 'ncurses_slk_attr',
- 'ncurses_slk_attroff',
- 'ncurses_slk_attron',
- 'ncurses_slk_attrset',
- 'ncurses_slk_clear',
- 'ncurses_slk_color',
- 'ncurses_slk_init',
- 'ncurses_slk_noutrefresh',
- 'ncurses_slk_refresh',
- 'ncurses_slk_restore',
- 'ncurses_slk_set',
- 'ncurses_slk_touch',
- 'ncurses_standend',
- 'ncurses_standout',
- 'ncurses_start_color',
- 'ncurses_termattrs',
- 'ncurses_termname',
- 'ncurses_timeout',
- 'ncurses_top_panel',
- 'ncurses_typeahead',
- 'ncurses_ungetch',
- 'ncurses_ungetmouse',
- 'ncurses_update_panels',
- 'ncurses_use_default_colors',
- 'ncurses_use_env',
- 'ncurses_use_extended_names',
- 'ncurses_vidattr',
- 'ncurses_vline',
- 'ncurses_waddch',
- 'ncurses_waddstr',
- 'ncurses_wattroff',
- 'ncurses_wattron',
- 'ncurses_wattrset',
- 'ncurses_wborder',
- 'ncurses_wclear',
- 'ncurses_wcolor_set',
- 'ncurses_werase',
- 'ncurses_wgetch',
- 'ncurses_whline',
- 'ncurses_wmouse_trafo',
- 'ncurses_wmove',
- 'ncurses_wnoutrefresh',
- 'ncurses_wrefresh',
- 'ncurses_wstandend',
- 'ncurses_wstandout',
- 'ncurses_wvline'),
- 'Network': ('checkdnsrr',
- 'closelog',
- 'define_syslog_variables',
- 'dns_check_record',
- 'dns_get_mx',
- 'dns_get_record',
- 'fsockopen',
- 'gethostbyaddr',
- 'gethostbyname',
- 'gethostbynamel',
- 'gethostname',
- 'getmxrr',
- 'getprotobyname',
- 'getprotobynumber',
- 'getservbyname',
- 'getservbyport',
- 'header_register_callback',
- 'header_remove',
- 'header',
- 'headers_list',
- 'headers_sent',
- 'http_response_code',
- 'inet_ntop',
- 'inet_pton',
- 'ip2long',
- 'long2ip',
- 'openlog',
- 'pfsockopen',
- 'setcookie',
- 'setrawcookie',
- 'socket_get_status',
- 'socket_set_blocking',
- 'socket_set_timeout',
- 'syslog'),
- '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',
- 'newt_cls',
- 'newt_compact_button',
- 'newt_component_add_callback',
- 'newt_component_takes_focus',
- 'newt_create_grid',
- 'newt_cursor_off',
- 'newt_cursor_on',
- 'newt_delay',
- 'newt_draw_form',
- 'newt_draw_root_text',
- 'newt_entry_get_value',
- 'newt_entry_set_filter',
- 'newt_entry_set_flags',
- 'newt_entry_set',
- 'newt_entry',
- 'newt_finished',
- 'newt_form_add_component',
- 'newt_form_add_components',
- 'newt_form_add_hot_key',
- 'newt_form_destroy',
- 'newt_form_get_current',
- 'newt_form_run',
- 'newt_form_set_background',
- 'newt_form_set_height',
- 'newt_form_set_size',
- 'newt_form_set_timer',
- 'newt_form_set_width',
- 'newt_form_watch_fd',
- 'newt_form',
- 'newt_get_screen_size',
- 'newt_grid_add_components_to_form',
- 'newt_grid_basic_window',
- 'newt_grid_free',
- 'newt_grid_get_size',
- 'newt_grid_h_close_stacked',
- 'newt_grid_h_stacked',
- 'newt_grid_place',
- 'newt_grid_set_field',
- 'newt_grid_simple_window',
- 'newt_grid_v_close_stacked',
- 'newt_grid_v_stacked',
- 'newt_grid_wrapped_window_at',
- 'newt_grid_wrapped_window',
- 'newt_init',
- 'newt_label_set_text',
- 'newt_label',
- 'newt_listbox_append_entry',
- 'newt_listbox_clear_selection',
- 'newt_listbox_clear',
- 'newt_listbox_delete_entry',
- 'newt_listbox_get_current',
- 'newt_listbox_get_selection',
- 'newt_listbox_insert_entry',
- 'newt_listbox_item_count',
- 'newt_listbox_select_item',
- 'newt_listbox_set_current_by_key',
- 'newt_listbox_set_current',
- 'newt_listbox_set_data',
- 'newt_listbox_set_entry',
- 'newt_listbox_set_width',
- 'newt_listbox',
- 'newt_listitem_get_data',
- 'newt_listitem_set',
- 'newt_listitem',
- 'newt_open_window',
- 'newt_pop_help_line',
- 'newt_pop_window',
- 'newt_push_help_line',
- 'newt_radio_get_current',
- 'newt_radiobutton',
- 'newt_redraw_help_line',
- 'newt_reflow_text',
- 'newt_refresh',
- 'newt_resize_screen',
- 'newt_resume',
- 'newt_run_form',
- 'newt_scale_set',
- 'newt_scale',
- 'newt_scrollbar_set',
- 'newt_set_help_callback',
- 'newt_set_suspend_callback',
- 'newt_suspend',
- 'newt_textbox_get_num_lines',
- 'newt_textbox_reflowed',
- 'newt_textbox_set_height',
- 'newt_textbox_set_text',
- 'newt_textbox',
- 'newt_vertical_scrollbar',
- 'newt_wait_for_key',
- 'newt_win_choice',
- 'newt_win_entries',
- 'newt_win_menu',
- 'newt_win_message',
- 'newt_win_messagev',
- 'newt_win_ternary'),
- 'OAuth': ('oauth_get_sbs', 'oauth_urlencode'),
- 'OCI8': ('oci_bind_array_by_name',
- 'oci_bind_by_name',
- 'oci_cancel',
- 'oci_client_version',
- 'oci_close',
- 'oci_commit',
- 'oci_connect',
- 'oci_define_by_name',
- 'oci_error',
- 'oci_execute',
- '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_raw',
- 'oci_field_type',
- 'oci_free_descriptor',
- 'oci_free_statement',
- 'oci_get_implicit_resultset',
- 'oci_internal_debug',
- 'oci_lob_copy',
- 'oci_lob_is_equal',
- 'oci_new_collection',
- 'oci_new_connect',
- 'oci_new_cursor',
- 'oci_new_descriptor',
- 'oci_num_fields',
- 'oci_num_rows',
- 'oci_parse',
- 'oci_password_change',
- 'oci_pconnect',
- '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'),
- 'ODBC': ('odbc_autocommit',
- 'odbc_binmode',
- 'odbc_close_all',
- 'odbc_close',
- 'odbc_columnprivileges',
- 'odbc_columns',
- 'odbc_commit',
- 'odbc_connect',
- 'odbc_cursor',
- 'odbc_data_source',
- 'odbc_do',
- 'odbc_error',
- 'odbc_errormsg',
- 'odbc_exec',
- 'odbc_execute',
- 'odbc_fetch_array',
- 'odbc_fetch_into',
- 'odbc_fetch_object',
- 'odbc_fetch_row',
- 'odbc_field_len',
- 'odbc_field_name',
- 'odbc_field_num',
- 'odbc_field_precision',
- 'odbc_field_scale',
- 'odbc_field_type',
- 'odbc_foreignkeys',
- 'odbc_free_result',
- 'odbc_gettypeinfo',
- 'odbc_longreadlen',
- 'odbc_next_result',
- 'odbc_num_fields',
- 'odbc_num_rows',
- 'odbc_pconnect',
- 'odbc_prepare',
- 'odbc_primarykeys',
- 'odbc_procedurecolumns',
- 'odbc_procedures',
- 'odbc_result_all',
- 'odbc_result',
- 'odbc_rollback',
- 'odbc_setoption',
- 'odbc_specialcolumns',
- 'odbc_statistics',
- 'odbc_tableprivileges',
- 'odbc_tables'),
- 'OPcache': ('opcache_compile_file',
- 'opcache_get_configuration',
- 'opcache_get_status',
- 'opcache_invalidate',
- 'opcache_reset'),
- 'Object Aggregation': ('aggregate_info',
- 'aggregate_methods_by_list',
- 'aggregate_methods_by_regexp',
- 'aggregate_methods',
- 'aggregate_properties_by_list',
- 'aggregate_properties_by_regexp',
- 'aggregate_properties',
- 'aggregate',
- 'aggregation_info',
- 'deaggregate'),
- '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_cipher_iv_length',
- '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_pbkdf2',
- '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_to_file',
- 'openssl_pkey_export',
- 'openssl_pkey_free',
- 'openssl_pkey_get_details',
- 'openssl_pkey_get_private',
- 'openssl_pkey_get_public',
- 'openssl_pkey_new',
- 'openssl_private_decrypt',
- 'openssl_private_encrypt',
- 'openssl_public_decrypt',
- 'openssl_public_encrypt',
- 'openssl_random_pseudo_bytes',
- 'openssl_seal',
- 'openssl_sign',
- 'openssl_spki_export_challenge',
- 'openssl_spki_export',
- 'openssl_spki_new',
- 'openssl_spki_verify',
- 'openssl_verify',
- 'openssl_x509_check_private_key',
- 'openssl_x509_checkpurpose',
- 'openssl_x509_export_to_file',
- 'openssl_x509_export',
- 'openssl_x509_free',
- 'openssl_x509_parse',
- 'openssl_x509_read'),
- 'Output Control': ('flush',
- 'ob_clean',
- 'ob_end_clean',
- 'ob_end_flush',
- 'ob_flush',
- 'ob_get_clean',
- 'ob_get_contents',
- 'ob_get_flush',
- 'ob_get_length',
- 'ob_get_level',
- 'ob_get_status',
- 'ob_gzhandler',
- 'ob_implicit_flush',
- 'ob_list_handlers',
- 'ob_start',
- 'output_add_rewrite_var',
- 'output_reset_rewrite_vars'),
- '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_errno',
- 'pcntl_exec',
- 'pcntl_fork',
- 'pcntl_get_last_error',
- 'pcntl_getpriority',
- 'pcntl_setpriority',
- 'pcntl_signal_dispatch',
- 'pcntl_signal',
- 'pcntl_sigprocmask',
- 'pcntl_sigtimedwait',
- 'pcntl_sigwaitinfo',
- 'pcntl_strerror',
- 'pcntl_wait',
- 'pcntl_waitpid',
- 'pcntl_wexitstatus',
- 'pcntl_wifexited',
- 'pcntl_wifsignaled',
- 'pcntl_wifstopped',
- 'pcntl_wstopsig',
- 'pcntl_wtermsig'),
- 'PCRE': ('preg_filter',
- 'preg_grep',
- 'preg_last_error',
- 'preg_match_all',
- 'preg_match',
- 'preg_quote',
- 'preg_replace_callback',
- 'preg_replace',
- 'preg_split'),
- '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',
- 'cli_get_process_title',
- 'cli_set_process_title',
- 'dl',
- 'extension_loaded',
- 'gc_collect_cycles',
- 'gc_disable',
- 'gc_enable',
- 'gc_enabled',
- 'get_cfg_var',
- 'get_current_user',
- 'get_defined_constants',
- 'get_extension_funcs',
- 'get_include_path',
- 'get_included_files',
- 'get_loaded_extensions',
- 'get_magic_quotes_gpc',
- 'get_magic_quotes_runtime',
- 'get_required_files',
- 'getenv',
- 'getlastmod',
- 'getmygid',
- 'getmyinode',
- 'getmypid',
- 'getmyuid',
- 'getopt',
- 'getrusage',
- 'ini_alter',
- 'ini_get_all',
- 'ini_get',
- 'ini_restore',
- 'ini_set',
- 'magic_quotes_runtime',
- 'memory_get_peak_usage',
- 'memory_get_usage',
- 'php_ini_loaded_file',
- 'php_ini_scanned_files',
- 'php_logo_guid',
- 'php_sapi_name',
- 'php_uname',
- 'phpcredits',
- 'phpinfo',
- 'phpversion',
- 'putenv',
- 'restore_include_path',
- '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_access',
- 'posix_ctermid',
- 'posix_errno',
- 'posix_get_last_error',
- 'posix_getcwd',
- 'posix_getegid',
- 'posix_geteuid',
- 'posix_getgid',
- 'posix_getgrgid',
- 'posix_getgrnam',
- 'posix_getgroups',
- 'posix_getlogin',
- 'posix_getpgid',
- 'posix_getpgrp',
- 'posix_getpid',
- 'posix_getppid',
- 'posix_getpwnam',
- 'posix_getpwuid',
- 'posix_getrlimit',
- 'posix_getsid',
- 'posix_getuid',
- 'posix_initgroups',
- 'posix_isatty',
- 'posix_kill',
- 'posix_mkfifo',
- 'posix_mknod',
- 'posix_setegid',
- 'posix_seteuid',
- 'posix_setgid',
- 'posix_setpgid',
- 'posix_setsid',
- 'posix_setuid',
- 'posix_strerror',
- 'posix_times',
- 'posix_ttyname',
- 'posix_uname'),
- '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'),
- 'Password Hashing': ('password_get_info',
- 'password_hash',
- 'password_needs_rehash',
- 'password_verify'),
- 'PostgreSQL': ('pg_affected_rows',
- 'pg_cancel_query',
- 'pg_client_encoding',
- 'pg_close',
- 'pg_connect',
- 'pg_connection_busy',
- 'pg_connection_reset',
- 'pg_connection_status',
- 'pg_convert',
- 'pg_copy_from',
- 'pg_copy_to',
- 'pg_dbname',
- 'pg_delete',
- 'pg_end_copy',
- 'pg_escape_bytea',
- 'pg_escape_identifier',
- 'pg_escape_literal',
- 'pg_escape_string',
- 'pg_execute',
- 'pg_fetch_all_columns',
- 'pg_fetch_all',
- 'pg_fetch_array',
- 'pg_fetch_assoc',
- 'pg_fetch_object',
- 'pg_fetch_result',
- 'pg_fetch_row',
- 'pg_field_is_null',
- 'pg_field_name',
- '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',
- 'pg_get_pid',
- 'pg_get_result',
- 'pg_host',
- 'pg_insert',
- 'pg_last_error',
- 'pg_last_notice',
- 'pg_last_oid',
- 'pg_lo_close',
- 'pg_lo_create',
- 'pg_lo_export',
- 'pg_lo_import',
- 'pg_lo_open',
- 'pg_lo_read_all',
- 'pg_lo_read',
- 'pg_lo_seek',
- 'pg_lo_tell',
- 'pg_lo_truncate',
- 'pg_lo_unlink',
- 'pg_lo_write',
- 'pg_meta_data',
- 'pg_num_fields',
- 'pg_num_rows',
- 'pg_options',
- 'pg_parameter_status',
- 'pg_pconnect',
- 'pg_ping',
- 'pg_port',
- 'pg_prepare',
- 'pg_put_line',
- 'pg_query_params',
- 'pg_query',
- 'pg_result_error_field',
- 'pg_result_error',
- 'pg_result_seek',
- 'pg_result_status',
- 'pg_select',
- 'pg_send_execute',
- 'pg_send_prepare',
- 'pg_send_query_params',
- 'pg_send_query',
- 'pg_set_client_encoding',
- 'pg_set_error_verbosity',
- 'pg_trace',
- 'pg_transaction_status',
- 'pg_tty',
- 'pg_unescape_bytea',
- 'pg_untrace',
- 'pg_update',
- 'pg_version'),
- 'Printer': ('printer_abort',
- 'printer_close',
- 'printer_create_brush',
- 'printer_create_dc',
- 'printer_create_font',
- 'printer_create_pen',
- 'printer_delete_brush',
- 'printer_delete_dc',
- 'printer_delete_font',
- 'printer_delete_pen',
- 'printer_draw_bmp',
- 'printer_draw_chord',
- 'printer_draw_elipse',
- 'printer_draw_line',
- 'printer_draw_pie',
- 'printer_draw_rectangle',
- 'printer_draw_roundrect',
- 'printer_draw_text',
- 'printer_end_doc',
- 'printer_end_page',
- 'printer_get_option',
- 'printer_list',
- 'printer_logical_fontheight',
- 'printer_open',
- 'printer_select_brush',
- 'printer_select_font',
- 'printer_select_pen',
- 'printer_set_option',
- 'printer_start_doc',
- 'printer_start_page',
- 'printer_write'),
- 'Proctitle': ('setproctitle', 'setthreadtitle'),
- 'Program execution': ('escapeshellarg',
- 'escapeshellcmd',
- 'exec',
- 'passthru',
- 'proc_close',
- 'proc_get_status',
- 'proc_nice',
- 'proc_open',
- 'proc_terminate',
- 'shell_exec',
- 'system'),
- 'Pspell': ('pspell_add_to_personal',
- 'pspell_add_to_session',
- 'pspell_check',
- 'pspell_clear_session',
- 'pspell_config_create',
- 'pspell_config_data_dir',
- 'pspell_config_dict_dir',
- 'pspell_config_ignore',
- 'pspell_config_mode',
- 'pspell_config_personal',
- 'pspell_config_repl',
- 'pspell_config_runtogether',
- 'pspell_config_save_repl',
- 'pspell_new_config',
- 'pspell_new_personal',
- 'pspell_new',
- 'pspell_save_wordlist',
- 'pspell_store_replacement',
- 'pspell_suggest'),
- '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_version',
- 'rrd_xport',
- 'rrdc_disconnect'),
- '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_tagged_attr_data',
- 'radius_get_tagged_attr_tag',
- '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_salt_encrypt_attr',
- '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',
- 'readline_clear_history',
- 'readline_completion_function',
- 'readline_info',
- 'readline_list_history',
- 'readline_on_new_line',
- 'readline_read_history',
- 'readline_redisplay',
- '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', 'use_soap_error_handler'),
- 'SPL': ('class_implements',
- 'class_parents',
- 'class_uses',
- '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'),
- 'SQLSRV': ('sqlsrv_begin_transaction',
- 'sqlsrv_cancel',
- 'sqlsrv_client_info',
- 'sqlsrv_close',
- 'sqlsrv_commit',
- 'sqlsrv_configure',
- 'sqlsrv_connect',
- 'sqlsrv_errors',
- 'sqlsrv_execute',
- 'sqlsrv_fetch_array',
- 'sqlsrv_fetch_object',
- 'sqlsrv_fetch',
- 'sqlsrv_field_metadata',
- 'sqlsrv_free_stmt',
- 'sqlsrv_get_config',
- 'sqlsrv_get_field',
- 'sqlsrv_has_rows',
- 'sqlsrv_next_result',
- 'sqlsrv_num_fields',
- 'sqlsrv_num_rows',
- 'sqlsrv_prepare',
- 'sqlsrv_query',
- 'sqlsrv_rollback',
- 'sqlsrv_rows_affected',
- 'sqlsrv_send_stream_data',
- 'sqlsrv_server_info'),
- '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_key',
- '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',
- 'sqlite_valid'),
- 'SSH2': ('ssh2_auth_agent',
- '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_chmod',
- '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',
- 'swf_actionnextframe',
- 'swf_actionplay',
- 'swf_actionprevframe',
- 'swf_actionsettarget',
- 'swf_actionstop',
- 'swf_actiontogglequality',
- 'swf_actionwaitforframe',
- 'swf_addbuttonrecord',
- 'swf_addcolor',
- 'swf_closefile',
- 'swf_definebitmap',
- 'swf_definefont',
- 'swf_defineline',
- 'swf_definepoly',
- 'swf_definerect',
- 'swf_definetext',
- 'swf_endbutton',
- 'swf_enddoaction',
- 'swf_endshape',
- 'swf_endsymbol',
- 'swf_fontsize',
- 'swf_fontslant',
- 'swf_fonttracking',
- 'swf_getbitmapinfo',
- 'swf_getfontinfo',
- 'swf_getframe',
- 'swf_labelframe',
- 'swf_lookat',
- 'swf_modifyobject',
- 'swf_mulcolor',
- 'swf_nextid',
- 'swf_oncondition',
- 'swf_openfile',
- 'swf_ortho2',
- 'swf_ortho',
- 'swf_perspective',
- 'swf_placeobject',
- 'swf_polarview',
- 'swf_popmatrix',
- 'swf_posround',
- 'swf_pushmatrix',
- 'swf_removeobject',
- 'swf_rotate',
- 'swf_scale',
- 'swf_setfont',
- 'swf_setframe',
- 'swf_shapearc',
- 'swf_shapecurveto3',
- 'swf_shapecurveto',
- 'swf_shapefillbitmapclip',
- 'swf_shapefillbitmaptile',
- 'swf_shapefilloff',
- 'swf_shapefillsolid',
- 'swf_shapelinesolid',
- 'swf_shapelineto',
- 'swf_shapemoveto',
- 'swf_showframe',
- 'swf_startbutton',
- 'swf_startdoaction',
- 'swf_startshape',
- 'swf_startsymbol',
- 'swf_textwidth',
- 'swf_translate',
- 'swf_viewport'),
- 'Semaphore': ('ftok',
- 'msg_get_queue',
- 'msg_queue_exists',
- 'msg_receive',
- 'msg_remove_queue',
- 'msg_send',
- 'msg_set_queue',
- 'msg_stat_queue',
- 'sem_acquire',
- 'sem_get',
- 'sem_release',
- 'sem_remove',
- 'shm_attach',
- 'shm_detach',
- 'shm_get_var',
- 'shm_has_var',
- 'shm_put_var',
- '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_shutdown',
- 'session_register',
- 'session_save_path',
- 'session_set_cookie_params',
- 'session_set_save_handler',
- 'session_start',
- 'session_status',
- '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'),
- 'Socket': ('socket_accept',
- 'socket_bind',
- 'socket_clear_error',
- 'socket_close',
- 'socket_cmsg_space',
- 'socket_connect',
- 'socket_create_listen',
- 'socket_create_pair',
- 'socket_create',
- 'socket_get_option',
- 'socket_getpeername',
- 'socket_getsockname',
- 'socket_import_stream',
- 'socket_last_error',
- 'socket_listen',
- 'socket_read',
- 'socket_recv',
- 'socket_recvfrom',
- 'socket_recvmsg',
- 'socket_select',
- 'socket_send',
- 'socket_sendmsg',
- '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',
- 'stream_set_blocking',
- 'stream_set_chunk_size',
- 'stream_set_read_buffer',
- '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_socket_shutdown',
- 'stream_supports_lock',
- 'stream_wrapper_register',
- 'stream_wrapper_restore',
- 'stream_wrapper_unregister'),
- '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',
- 'hex2bin',
- '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',
- 'strstr',
- 'strtok',
- 'strtolower',
- 'strtoupper',
- 'strtr',
- 'substr_compare',
- 'substr_count',
- 'substr_replace',
- 'substr',
- 'trim',
- 'ucfirst',
- 'ucwords',
- 'vfprintf',
- 'vprintf',
- 'vsprintf',
- 'wordwrap'),
- 'Sybase': ('sybase_affected_rows',
- 'sybase_close',
- 'sybase_connect',
- 'sybase_data_seek',
- 'sybase_deadlock_retry_count',
- 'sybase_fetch_array',
- 'sybase_fetch_assoc',
- 'sybase_fetch_field',
- 'sybase_fetch_object',
- 'sybase_fetch_row',
- 'sybase_field_seek',
- 'sybase_free_result',
- 'sybase_get_last_message',
- 'sybase_min_client_severity',
- 'sybase_min_error_severity',
- 'sybase_min_message_severity',
- 'sybase_min_server_severity',
- 'sybase_num_fields',
- 'sybase_num_rows',
- 'sybase_pconnect',
- 'sybase_query',
- 'sybase_result',
- 'sybase_select_db',
- 'sybase_set_message_handler',
- 'sybase_unbuffered_query'),
- 'TCP': ('tcpwrap_check',),
- 'Taint': ('is_tainted', 'taint', 'untaint'),
- 'Tidy': ('ob_tidyhandler',
- 'tidy_access_count',
- 'tidy_config_count',
- 'tidy_error_count',
- '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'),
- 'Trader': ('trader_acos',
- 'trader_ad',
- 'trader_add',
- 'trader_adosc',
- 'trader_adx',
- 'trader_adxr',
- 'trader_apo',
- 'trader_aroon',
- 'trader_aroonosc',
- 'trader_asin',
- 'trader_atan',
- 'trader_atr',
- 'trader_avgprice',
- 'trader_bbands',
- 'trader_beta',
- 'trader_bop',
- 'trader_cci',
- 'trader_cdl2crows',
- 'trader_cdl3blackcrows',
- 'trader_cdl3inside',
- 'trader_cdl3linestrike',
- 'trader_cdl3outside',
- 'trader_cdl3starsinsouth',
- 'trader_cdl3whitesoldiers',
- 'trader_cdlabandonedbaby',
- 'trader_cdladvanceblock',
- 'trader_cdlbelthold',
- 'trader_cdlbreakaway',
- 'trader_cdlclosingmarubozu',
- 'trader_cdlconcealbabyswall',
- 'trader_cdlcounterattack',
- 'trader_cdldarkcloudcover',
- 'trader_cdldoji',
- 'trader_cdldojistar',
- 'trader_cdldragonflydoji',
- 'trader_cdlengulfing',
- 'trader_cdleveningdojistar',
- 'trader_cdleveningstar',
- 'trader_cdlgapsidesidewhite',
- 'trader_cdlgravestonedoji',
- 'trader_cdlhammer',
- 'trader_cdlhangingman',
- 'trader_cdlharami',
- 'trader_cdlharamicross',
- 'trader_cdlhighwave',
- 'trader_cdlhikkake',
- 'trader_cdlhikkakemod',
- 'trader_cdlhomingpigeon',
- 'trader_cdlidentical3crows',
- 'trader_cdlinneck',
- 'trader_cdlinvertedhammer',
- 'trader_cdlkicking',
- 'trader_cdlkickingbylength',
- 'trader_cdlladderbottom',
- 'trader_cdllongleggeddoji',
- 'trader_cdllongline',
- 'trader_cdlmarubozu',
- 'trader_cdlmatchinglow',
- 'trader_cdlmathold',
- 'trader_cdlmorningdojistar',
- 'trader_cdlmorningstar',
- 'trader_cdlonneck',
- 'trader_cdlpiercing',
- 'trader_cdlrickshawman',
- 'trader_cdlrisefall3methods',
- 'trader_cdlseparatinglines',
- 'trader_cdlshootingstar',
- 'trader_cdlshortline',
- 'trader_cdlspinningtop',
- 'trader_cdlstalledpattern',
- 'trader_cdlsticksandwich',
- 'trader_cdltakuri',
- 'trader_cdltasukigap',
- 'trader_cdlthrusting',
- 'trader_cdltristar',
- 'trader_cdlunique3river',
- 'trader_cdlupsidegap2crows',
- 'trader_cdlxsidegap3methods',
- 'trader_ceil',
- 'trader_cmo',
- 'trader_correl',
- 'trader_cos',
- 'trader_cosh',
- 'trader_dema',
- 'trader_div',
- 'trader_dx',
- 'trader_ema',
- 'trader_errno',
- 'trader_exp',
- 'trader_floor',
- 'trader_get_compat',
- 'trader_get_unstable_period',
- 'trader_ht_dcperiod',
- 'trader_ht_dcphase',
- 'trader_ht_phasor',
- 'trader_ht_sine',
- 'trader_ht_trendline',
- 'trader_ht_trendmode',
- 'trader_kama',
- 'trader_linearreg_angle',
- 'trader_linearreg_intercept',
- 'trader_linearreg_slope',
- 'trader_linearreg',
- 'trader_ln',
- 'trader_log10',
- 'trader_ma',
- 'trader_macd',
- 'trader_macdext',
- 'trader_macdfix',
- 'trader_mama',
- 'trader_mavp',
- 'trader_max',
- 'trader_maxindex',
- 'trader_medprice',
- 'trader_mfi',
- 'trader_midpoint',
- 'trader_midprice',
- 'trader_min',
- 'trader_minindex',
- 'trader_minmax',
- 'trader_minmaxindex',
- 'trader_minus_di',
- 'trader_minus_dm',
- 'trader_mom',
- 'trader_mult',
- 'trader_natr',
- 'trader_obv',
- 'trader_plus_di',
- 'trader_plus_dm',
- 'trader_ppo',
- 'trader_roc',
- 'trader_rocp',
- 'trader_rocr100',
- 'trader_rocr',
- 'trader_rsi',
- 'trader_sar',
- 'trader_sarext',
- 'trader_set_compat',
- 'trader_set_unstable_period',
- 'trader_sin',
- 'trader_sinh',
- 'trader_sma',
- 'trader_sqrt',
- 'trader_stddev',
- 'trader_stoch',
- 'trader_stochf',
- 'trader_stochrsi',
- 'trader_sub',
- 'trader_sum',
- 'trader_t3',
- 'trader_tan',
- 'trader_tanh',
- 'trader_tema',
- 'trader_trange',
- 'trader_trima',
- 'trader_trix',
- 'trader_tsf',
- 'trader_typprice',
- 'trader_ultosc',
- 'trader_var',
- 'trader_wclprice',
- 'trader_willr',
- 'trader_wma'),
- 'URL': ('base64_decode',
- 'base64_encode',
- 'get_headers',
- 'get_meta_tags',
- 'http_build_query',
- 'parse_url',
- 'rawurldecode',
- 'rawurlencode',
- 'urldecode',
- 'urlencode'),
- 'Uopz': ('uopz_backup',
- 'uopz_compose',
- 'uopz_copy',
- 'uopz_delete',
- 'uopz_extend',
- 'uopz_flags',
- 'uopz_function',
- 'uopz_implement',
- 'uopz_overload',
- 'uopz_redefine',
- 'uopz_rename',
- 'uopz_restore',
- 'uopz_undefine'),
- 'Variable handling': ('boolval',
- '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',
- 'w32api_register_function',
- 'w32api_set_call_method'),
- 'WDDX': ('wddx_add_vars',
- 'wddx_deserialize',
- 'wddx_packet_end',
- 'wddx_packet_start',
- 'wddx_serialize_value',
- 'wddx_serialize_vars'),
- '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',
- '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_into_struct',
- 'xml_parse',
- 'xml_parser_create_ns',
- 'xml_parser_create',
- '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_request',
- 'xmlrpc_decode',
- 'xmlrpc_encode_request',
- 'xmlrpc_encode',
- 'xmlrpc_get_type',
- 'xmlrpc_is_fault',
- 'xmlrpc_parse_method_descriptions',
- 'xmlrpc_server_add_introspection_data',
- 'xmlrpc_server_call_method',
- 'xmlrpc_server_create',
- 'xmlrpc_server_destroy',
- 'xmlrpc_server_register_introspection_callback',
- 'xmlrpc_server_register_method',
- 'xmlrpc_set_type'),
- 'XSLT (PHP 4)': ('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'),
- 'Xhprof': ('xhprof_disable',
- 'xhprof_enable',
- 'xhprof_sample_disable',
- 'xhprof_sample_enable'),
- 'YAZ': ('yaz_addinfo',
- 'yaz_ccl_conf',
- 'yaz_ccl_parse',
- 'yaz_close',
- 'yaz_connect',
- 'yaz_database',
- 'yaz_element',
- 'yaz_errno',
- 'yaz_error',
- 'yaz_es_result',
- 'yaz_es',
- 'yaz_get_option',
- 'yaz_hits',
- 'yaz_itemorder',
- 'yaz_present',
- 'yaz_range',
- 'yaz_record',
- 'yaz_scan_result',
- 'yaz_scan',
- 'yaz_schema',
- 'yaz_search',
- 'yaz_set_option',
- 'yaz_sort',
- 'yaz_syntax',
- 'yaz_wait'),
- 'YP/NIS': ('yp_all',
- 'yp_cat',
- 'yp_err_string',
- 'yp_errno',
- 'yp_first',
- 'yp_get_default_domain',
- 'yp_master',
- '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',
- 'zip_entry_compressionmethod',
- 'zip_entry_filesize',
- 'zip_entry_name',
- 'zip_entry_open',
- 'zip_entry_read',
- 'zip_open',
- 'zip_read'),
- 'Zlib': ('gzclose',
- 'gzcompress',
- 'gzdecode',
- 'gzdeflate',
- 'gzencode',
- 'gzeof',
- 'gzfile',
- 'gzgetc',
- 'gzgets',
- 'gzgetss',
- 'gzinflate',
- 'gzopen',
- 'gzpassthru',
- 'gzputs',
- 'gzread',
- 'gzrewind',
- 'gzseek',
- 'gztell',
- 'gzuncompress',
- 'gzwrite',
- 'readgzfile',
- 'zlib_decode',
- 'zlib_encode',
- 'zlib_get_coding_type'),
- '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',
- 'bcompiler_write_included_filename'),
- 'cURL': ('curl_close',
- 'curl_copy_handle',
- 'curl_errno',
- 'curl_error',
- 'curl_escape',
- 'curl_exec',
- 'curl_file_create',
- '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_multi_setopt',
- 'curl_multi_strerror',
- 'curl_pause',
- 'curl_reset',
- 'curl_setopt_array',
- 'curl_setopt',
- 'curl_share_close',
- 'curl_share_init',
- 'curl_share_setopt',
- 'curl_strerror',
- 'curl_unescape',
- 'curl_version'),
- 'chdb': ('chdb_create',),
- 'dBase': ('dbase_add_record',
- 'dbase_close',
- 'dbase_create',
- 'dbase_delete_record',
- 'dbase_get_header_info',
- 'dbase_get_record_with_names',
- 'dbase_get_record',
- 'dbase_numfields',
- 'dbase_numrecords',
- 'dbase_open',
- 'dbase_pack',
- 'dbase_replace_record'),
- 'dbx': ('dbx_close',
- 'dbx_compare',
- 'dbx_connect',
- 'dbx_error',
- 'dbx_escape_string',
- 'dbx_fetch_row',
- 'dbx_query',
- 'dbx_sort'),
- 'filePro': ('filepro_fieldcount',
- 'filepro_fieldname',
- 'filepro_fieldtype',
- 'filepro_fieldwidth',
- 'filepro_retrieve',
- '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'),
- '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_external_entity_loader',
- 'libxml_set_streams_context',
- 'libxml_use_internal_errors'),
- 'mSQL': ('msql_affected_rows',
- 'msql_close',
- 'msql_connect',
- 'msql_create_db',
- 'msql_createdb',
- 'msql_data_seek',
- 'msql_db_query',
- 'msql_dbname',
- 'msql_drop_db',
- 'msql_error',
- 'msql_fetch_array',
- 'msql_fetch_field',
- 'msql_fetch_object',
- 'msql_fetch_row',
- 'msql_field_flags',
- 'msql_field_len',
- 'msql_field_name',
- 'msql_field_seek',
- 'msql_field_table',
- 'msql_field_type',
- 'msql_fieldflags',
- 'msql_fieldlen',
- 'msql_fieldname',
- 'msql_fieldtable',
- 'msql_fieldtype',
- 'msql_free_result',
- 'msql_list_dbs',
- 'msql_list_fields',
- 'msql_list_tables',
- 'msql_num_fields',
- 'msql_num_rows',
- 'msql_numfields',
- 'msql_numrows',
- 'msql_pconnect',
- 'msql_query',
- 'msql_regcase',
- 'msql_result',
- 'msql_select_db',
- 'msql_tablename',
- 'msql'),
- 'mnoGoSearch': ('udm_add_search_limit',
- 'udm_alloc_agent_array',
- 'udm_alloc_agent',
- 'udm_api_version',
- 'udm_cat_list',
- 'udm_cat_path',
- 'udm_check_charset',
- 'udm_check_stored',
- 'udm_clear_search_limits',
- 'udm_close_stored',
- 'udm_crc32',
- 'udm_errno',
- 'udm_error',
- 'udm_find',
- 'udm_free_agent',
- 'udm_free_ispell_data',
- 'udm_free_res',
- 'udm_get_doc_count',
- 'udm_get_res_field',
- 'udm_get_res_param',
- 'udm_hash32',
- 'udm_load_ispell_data',
- 'udm_open_stored',
- 'udm_set_agent_param'),
- '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_clear_cache',
- 'mysqlnd_qc_get_available_handlers',
- 'mysqlnd_qc_get_cache_info',
- 'mysqlnd_qc_get_core_stats',
- 'mysqlnd_qc_get_normalized_query_trace_log',
- 'mysqlnd_qc_get_query_trace_log',
- 'mysqlnd_qc_set_cache_condition',
- 'mysqlnd_qc_set_is_select',
- 'mysqlnd_qc_set_storage_handler',
- 'mysqlnd_qc_set_user_handlers'),
- 'qtdom': ('qdom_error', 'qdom_tree'),
- '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_domain',
- 'vpopmail_alias_del',
- 'vpopmail_alias_get_all',
- 'vpopmail_alias_get',
- 'vpopmail_auth_user',
- '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_bdiff_size',
- 'xdiff_file_bdiff',
- 'xdiff_file_bpatch',
- 'xdiff_file_diff_binary',
- 'xdiff_file_diff',
- 'xdiff_file_merge3',
- 'xdiff_file_patch_binary',
- '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_rabdiff')}
-
-
-if __name__ == '__main__': # pragma: no cover
- import glob
- import os
- import pprint
- import re
- import shutil
- import tarfile
- try:
- from urllib import urlretrieve
- except ImportError:
- from urllib.request import urlretrieve
-
- 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 = r'<a href="function\..*?\.html">(.*?)</a>'
- PHP_MODULE_RE = '<title>(.*?) Functions</title>'
-
- def get_php_functions():
- function_re = re.compile(PHP_FUNCTION_RE)
- module_re = re.compile(PHP_MODULE_RE)
- modules = {}
-
- for file in get_php_references():
- module = ''
- with open(file) as f:
- for line in f:
- if not module:
- search = module_re.search(line)
- if search:
- module = search.group(1)
- modules[module] = []
-
- elif 'href="function.' in line:
- for match in function_re.finditer(line):
- fn = match.group(1)
- if '-&gt;' not in fn and '::' not in fn and fn not in modules[module]:
- modules[module].append(fn)
-
- if module:
- # These are dummy manual pages, not actual functions
- if module == 'PHP Options/Info':
- modules[module].remove('main')
-
- if module == 'Filesystem':
- modules[module].remove('delete')
-
- if not modules[module]:
- del modules[module]
-
- return modules
-
- def get_php_references():
- download = urlretrieve(PHP_MANUAL_URL)
- with tarfile.open(download[0]) as tar:
- tar.extractall()
- for file in glob.glob("%s%s" % (PHP_MANUAL_DIR, PHP_REFERENCE_GLOB)):
- yield file
- os.remove(download[0])
-
- def regenerate(filename, modules):
- with open(filename) as fp:
- content = fp.read()
-
- header = content[:content.find('MODULES = {')]
- footer = content[content.find("if __name__ == '__main__':"):]
-
- with open(filename, 'w') as fp:
- fp.write(header)
- fp.write('MODULES = %s\n\n' % pprint.pformat(modules))
- fp.write(footer)
-
- def run():
- print('>> Downloading Function Index')
- modules = get_php_functions()
- total = sum(len(v) for v in modules.values())
- print('%d functions found' % total)
- regenerate(__file__, modules)
- shutil.rmtree(PHP_MANUAL_DIR)
-
- run()
diff --git a/pygments/lexers/_postgres_builtins.py b/pygments/lexers/_postgres_builtins.py
deleted file mode 100644
index 21086722..00000000
--- a/pygments/lexers/_postgres_builtins.py
+++ /dev/null
@@ -1,621 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._postgres_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Self-updating data files for PostgreSQL lexer.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-
-# 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',
- 'EVENT',
- 'EXCEPT',
- 'EXCLUDE',
- 'EXCLUDING',
- 'EXCLUSIVE',
- 'EXECUTE',
- 'EXISTS',
- 'EXPLAIN',
- 'EXTENSION',
- 'EXTERNAL',
- 'EXTRACT',
- 'FALSE',
- 'FAMILY',
- 'FETCH',
- 'FILTER',
- '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',
- 'LATERAL',
- 'LC_COLLATE',
- 'LC_CTYPE',
- 'LEADING',
- 'LEAKPROOF',
- 'LEAST',
- 'LEFT',
- 'LEVEL',
- 'LIKE',
- 'LIMIT',
- 'LISTEN',
- 'LOAD',
- 'LOCAL',
- 'LOCALTIME',
- 'LOCALTIMESTAMP',
- 'LOCATION',
- 'LOCK',
- 'MAPPING',
- 'MATCH',
- 'MATERIALIZED',
- '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',
- 'ORDINALITY',
- 'OUT',
- 'OUTER',
- 'OVER',
- 'OVERLAPS',
- 'OVERLAY',
- 'OWNED',
- 'OWNER',
- 'PARSER',
- 'PARTIAL',
- 'PARTITION',
- 'PASSING',
- 'PASSWORD',
- 'PLACING',
- 'PLANS',
- 'POLICY',
- 'POSITION',
- 'PRECEDING',
- 'PRECISION',
- 'PREPARE',
- 'PREPARED',
- 'PRESERVE',
- 'PRIMARY',
- 'PRIOR',
- 'PRIVILEGES',
- 'PROCEDURAL',
- 'PROCEDURE',
- 'PROGRAM',
- 'QUOTE',
- 'RANGE',
- 'READ',
- 'REAL',
- 'REASSIGN',
- 'RECHECK',
- 'RECURSIVE',
- 'REF',
- 'REFERENCES',
- 'REFRESH',
- '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',
- 'SNAPSHOT',
- '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',
- 'TYPES',
- 'UNBOUNDED',
- 'UNCOMMITTED',
- 'UNENCRYPTED',
- 'UNION',
- 'UNIQUE',
- 'UNKNOWN',
- 'UNLISTEN',
- 'UNLOGGED',
- 'UNTIL',
- 'UPDATE',
- 'USER',
- 'USING',
- 'VACUUM',
- 'VALID',
- 'VALIDATE',
- 'VALIDATOR',
- 'VALUE',
- 'VALUES',
- 'VARCHAR',
- 'VARIADIC',
- 'VARYING',
- 'VERBOSE',
- 'VERSION',
- 'VIEW',
- 'VIEWS',
- 'VOLATILE',
- 'WHEN',
- 'WHERE',
- 'WHITESPACE',
- 'WINDOW',
- 'WITH',
- 'WITHIN',
- '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',
- 'json',
- 'jsonb',
- 'line',
- 'lseg',
- 'macaddr',
- 'money',
- 'numeric',
- 'path',
- 'pg_lsn',
- 'point',
- 'polygon',
- 'real',
- 'serial',
- 'serial2',
- 'serial4',
- 'serial8',
- 'smallint',
- 'smallserial',
- 'text',
- 'time',
- 'timestamp',
- 'timestamptz',
- 'timetz',
- 'tsquery',
- 'tsvector',
- 'txid_snapshot',
- 'uuid',
- 'varbit',
- 'varchar',
- 'with time zone',
- 'without time zone',
- 'xml',
-)
-
-PSEUDO_TYPES = (
- 'any',
- 'anyelement',
- 'anyarray',
- 'anynonarray',
- 'anyenum',
- 'anyrange',
- 'cstring',
- 'internal',
- 'language_handler',
- 'fdw_handler',
- 'record',
- 'trigger',
- 'void',
- 'opaque',
-)
-
-# Remove 'trigger' from types
-PSEUDO_TYPES = tuple(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__': # pragma: no cover
- import re
- try:
- from urllib import urlopen
- except ImportError:
- from urllib.request import urlopen
-
- from pygments.util import format_lines
-
- # 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(urlopen(DATATYPES_URL))
- datatypes = parse_datatypes(data_file)
- pseudos = parse_pseudos(data_file)
-
- keywords = parse_keywords(urlopen(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()
- 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 update_consts(filename, constname, content):
- with open(filename) as f:
- data = f.read()
-
- # Line to start/end inserting
- re_match = re.compile(r'^%s\s*=\s*\($.*?^\s*\)$' % constname, re.M | re.S)
- m = re_match.search(data)
- if not m:
- raise ValueError('Could not find existing definition for %s' %
- (constname,))
-
- new_block = format_lines(constname, content)
- data = data[:m.start()] + new_block + data[m.end():]
-
- with open(filename, 'w') as f:
- f.write(data)
-
- update_myself()
diff --git a/pygments/lexers/_scilab_builtins.py b/pygments/lexers/_scilab_builtins.py
deleted file mode 100644
index b26a0085..00000000
--- a/pygments/lexers/_scilab_builtins.py
+++ /dev/null
@@ -1,3094 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._scilab_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Builtin list for the ScilabLexer.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# Autogenerated
-
-commands_kw = (
- 'abort',
- 'apropos',
- 'break',
- 'case',
- 'catch',
- 'continue',
- 'do',
- 'else',
- 'elseif',
- 'end',
- 'endfunction',
- 'for',
- 'function',
- 'help',
- 'if',
- 'pause',
- 'quit',
- 'select',
- 'then',
- 'try',
- 'while',
-)
-
-functions_kw = (
- '!!_invoke_',
- '%H5Object_e',
- '%H5Object_fieldnames',
- '%H5Object_p',
- '%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',
- '%_EClass_6',
- '%_EClass_e',
- '%_EClass_p',
- '%_EObj_0',
- '%_EObj_1__EObj',
- '%_EObj_1_b',
- '%_EObj_1_c',
- '%_EObj_1_i',
- '%_EObj_1_s',
- '%_EObj_2__EObj',
- '%_EObj_2_b',
- '%_EObj_2_c',
- '%_EObj_2_i',
- '%_EObj_2_s',
- '%_EObj_3__EObj',
- '%_EObj_3_b',
- '%_EObj_3_c',
- '%_EObj_3_i',
- '%_EObj_3_s',
- '%_EObj_4__EObj',
- '%_EObj_4_b',
- '%_EObj_4_c',
- '%_EObj_4_i',
- '%_EObj_4_s',
- '%_EObj_5',
- '%_EObj_6',
- '%_EObj_a__EObj',
- '%_EObj_a_b',
- '%_EObj_a_c',
- '%_EObj_a_i',
- '%_EObj_a_s',
- '%_EObj_d__EObj',
- '%_EObj_d_b',
- '%_EObj_d_c',
- '%_EObj_d_i',
- '%_EObj_d_s',
- '%_EObj_disp',
- '%_EObj_e',
- '%_EObj_g__EObj',
- '%_EObj_g_b',
- '%_EObj_g_c',
- '%_EObj_g_i',
- '%_EObj_g_s',
- '%_EObj_h__EObj',
- '%_EObj_h_b',
- '%_EObj_h_c',
- '%_EObj_h_i',
- '%_EObj_h_s',
- '%_EObj_i__EObj',
- '%_EObj_j__EObj',
- '%_EObj_j_b',
- '%_EObj_j_c',
- '%_EObj_j_i',
- '%_EObj_j_s',
- '%_EObj_k__EObj',
- '%_EObj_k_b',
- '%_EObj_k_c',
- '%_EObj_k_i',
- '%_EObj_k_s',
- '%_EObj_l__EObj',
- '%_EObj_l_b',
- '%_EObj_l_c',
- '%_EObj_l_i',
- '%_EObj_l_s',
- '%_EObj_m__EObj',
- '%_EObj_m_b',
- '%_EObj_m_c',
- '%_EObj_m_i',
- '%_EObj_m_s',
- '%_EObj_n__EObj',
- '%_EObj_n_b',
- '%_EObj_n_c',
- '%_EObj_n_i',
- '%_EObj_n_s',
- '%_EObj_o__EObj',
- '%_EObj_o_b',
- '%_EObj_o_c',
- '%_EObj_o_i',
- '%_EObj_o_s',
- '%_EObj_p',
- '%_EObj_p__EObj',
- '%_EObj_p_b',
- '%_EObj_p_c',
- '%_EObj_p_i',
- '%_EObj_p_s',
- '%_EObj_q__EObj',
- '%_EObj_q_b',
- '%_EObj_q_c',
- '%_EObj_q_i',
- '%_EObj_q_s',
- '%_EObj_r__EObj',
- '%_EObj_r_b',
- '%_EObj_r_c',
- '%_EObj_r_i',
- '%_EObj_r_s',
- '%_EObj_s__EObj',
- '%_EObj_s_b',
- '%_EObj_s_c',
- '%_EObj_s_i',
- '%_EObj_s_s',
- '%_EObj_t',
- '%_EObj_x__EObj',
- '%_EObj_x_b',
- '%_EObj_x_c',
- '%_EObj_x_i',
- '%_EObj_x_s',
- '%_EObj_y__EObj',
- '%_EObj_y_b',
- '%_EObj_y_c',
- '%_EObj_y_i',
- '%_EObj_y_s',
- '%_EObj_z__EObj',
- '%_EObj_z_b',
- '%_EObj_z_c',
- '%_EObj_z_i',
- '%_EObj_z_s',
- '%_eigs',
- '%_load',
- '%b_1__EObj',
- '%b_2__EObj',
- '%b_3__EObj',
- '%b_4__EObj',
- '%b_a__EObj',
- '%b_d__EObj',
- '%b_g__EObj',
- '%b_h__EObj',
- '%b_i_XMLList',
- '%b_i__EObj',
- '%b_j__EObj',
- '%b_k__EObj',
- '%b_l__EObj',
- '%b_m__EObj',
- '%b_n__EObj',
- '%b_o__EObj',
- '%b_p__EObj',
- '%b_q__EObj',
- '%b_r__EObj',
- '%b_s__EObj',
- '%b_x__EObj',
- '%b_y__EObj',
- '%b_z__EObj',
- '%c_1__EObj',
- '%c_2__EObj',
- '%c_3__EObj',
- '%c_4__EObj',
- '%c_a__EObj',
- '%c_d__EObj',
- '%c_g__EObj',
- '%c_h__EObj',
- '%c_i_XMLAttr',
- '%c_i_XMLDoc',
- '%c_i_XMLElem',
- '%c_i_XMLList',
- '%c_i__EObj',
- '%c_j__EObj',
- '%c_k__EObj',
- '%c_l__EObj',
- '%c_m__EObj',
- '%c_n__EObj',
- '%c_o__EObj',
- '%c_p__EObj',
- '%c_q__EObj',
- '%c_r__EObj',
- '%c_s__EObj',
- '%c_x__EObj',
- '%c_y__EObj',
- '%c_z__EObj',
- '%ce_i_XMLList',
- '%fptr_i_XMLList',
- '%h_i_XMLList',
- '%hm_i_XMLList',
- '%i_1__EObj',
- '%i_2__EObj',
- '%i_3__EObj',
- '%i_4__EObj',
- '%i_a__EObj',
- '%i_abs',
- '%i_cumprod',
- '%i_cumsum',
- '%i_d__EObj',
- '%i_diag',
- '%i_g__EObj',
- '%i_h__EObj',
- '%i_i_XMLList',
- '%i_i__EObj',
- '%i_j__EObj',
- '%i_k__EObj',
- '%i_l__EObj',
- '%i_m__EObj',
- '%i_matrix',
- '%i_max',
- '%i_maxi',
- '%i_min',
- '%i_mini',
- '%i_mput',
- '%i_n__EObj',
- '%i_o__EObj',
- '%i_p',
- '%i_p__EObj',
- '%i_prod',
- '%i_q__EObj',
- '%i_r__EObj',
- '%i_s__EObj',
- '%i_sum',
- '%i_tril',
- '%i_triu',
- '%i_x__EObj',
- '%i_y__EObj',
- '%i_z__EObj',
- '%ip_i_XMLList',
- '%l_i_XMLList',
- '%l_i__EObj',
- '%lss_i_XMLList',
- '%mc_i_XMLList',
- '%msp_full',
- '%msp_i_XMLList',
- '%msp_spget',
- '%p_i_XMLList',
- '%ptr_i_XMLList',
- '%r_i_XMLList',
- '%s_1__EObj',
- '%s_2__EObj',
- '%s_3__EObj',
- '%s_4__EObj',
- '%s_a__EObj',
- '%s_d__EObj',
- '%s_g__EObj',
- '%s_h__EObj',
- '%s_i_XMLList',
- '%s_i__EObj',
- '%s_j__EObj',
- '%s_k__EObj',
- '%s_l__EObj',
- '%s_m__EObj',
- '%s_n__EObj',
- '%s_o__EObj',
- '%s_p__EObj',
- '%s_q__EObj',
- '%s_r__EObj',
- '%s_s__EObj',
- '%s_x__EObj',
- '%s_y__EObj',
- '%s_z__EObj',
- '%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',
- '_d',
- '_str2code',
- 'about',
- 'abs',
- 'acos',
- 'addModulePreferences',
- 'addcolor',
- 'addf',
- 'addhistory',
- 'addinter',
- 'addlocalizationdomain',
- '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',
- 'buildDoc',
- 'buildouttb',
- 'bvode',
- 'c_link',
- 'call',
- 'callblk',
- 'captions',
- 'cd',
- 'cdfbet',
- 'cdfbin',
- 'cdfchi',
- 'cdfchn',
- 'cdff',
- 'cdffnc',
- 'cdfgam',
- 'cdfnbn',
- 'cdfnor',
- 'cdfpoi',
- 'cdft',
- 'ceil',
- 'champ',
- 'champ1',
- 'chdir',
- 'chol',
- 'clc',
- 'clean',
- 'clear',
- 'clearfun',
- 'clearglobal',
- 'closeEditor',
- 'closeEditvar',
- 'closeXcos',
- 'code2str',
- 'coeff',
- 'color',
- 'comp',
- 'completion',
- 'conj',
- 'contour2di',
- 'contr',
- 'conv2',
- 'convstr',
- 'copy',
- 'copyfile',
- 'corr',
- 'cos',
- 'coserror',
- 'createdir',
- 'cshep2d',
- 'csvDefault',
- 'csvIsnum',
- 'csvRead',
- 'csvStringToDouble',
- 'csvTextScan',
- 'csvWrite',
- 'ctree2',
- 'ctree3',
- 'ctree4',
- 'cumprod',
- 'cumsum',
- 'curblock',
- 'curblockc',
- 'daskr',
- 'dasrt',
- 'dassl',
- 'data2sig',
- 'datatipCreate',
- 'datatipManagerMode',
- 'datatipMove',
- 'datatipRemove',
- 'datatipSetDisplay',
- 'datatipSetInterp',
- 'datatipSetOrientation',
- 'datatipSetStyle',
- 'datatipToggle',
- 'dawson',
- 'dct',
- 'debug',
- 'dec2base',
- 'deff',
- 'definedfields',
- 'degree',
- 'delbpt',
- 'delete',
- 'deletefile',
- 'delip',
- 'delmenu',
- 'det',
- 'dgettext',
- 'dhinf',
- 'diag',
- 'diary',
- 'diffobjs',
- 'disp',
- 'dispbpt',
- 'displayhistory',
- 'disposefftwlibrary',
- 'dlgamma',
- 'dnaupd',
- 'dneupd',
- 'double',
- 'drawaxis',
- 'drawlater',
- 'drawnow',
- 'driver',
- 'dsaupd',
- 'dsearch',
- 'dseupd',
- 'dst',
- 'duplicate',
- 'editvar',
- 'emptystr',
- 'end_scicosim',
- 'ereduc',
- 'erf',
- 'erfc',
- 'erfcx',
- 'erfi',
- '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',
- 'figure',
- 'file',
- 'filebrowser',
- 'fileext',
- 'fileinfo',
- 'fileparts',
- 'filesep',
- 'find',
- 'findBD',
- 'findfiles',
- 'fire_closing_finished',
- 'floor',
- 'format',
- 'fort',
- 'fprintfMat',
- 'freq',
- 'frexp',
- 'fromc',
- 'fromjava',
- 'fscanfMat',
- 'fsolve',
- 'fstair',
- 'full',
- 'fullpath',
- 'funcprot',
- 'funptr',
- 'gamma',
- 'gammaln',
- 'geom3d',
- 'get',
- 'getURL',
- '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',
- 'graphicfunction',
- 'grayplot',
- 'grep',
- 'gsort',
- 'gstacksize',
- 'h5attr',
- 'h5close',
- 'h5cp',
- 'h5dataset',
- 'h5dump',
- 'h5exists',
- 'h5flush',
- 'h5get',
- 'h5group',
- 'h5isArray',
- 'h5isAttr',
- 'h5isCompound',
- 'h5isFile',
- 'h5isGroup',
- 'h5isList',
- 'h5isRef',
- 'h5isSet',
- 'h5isSpace',
- 'h5isType',
- 'h5isVlen',
- 'h5label',
- 'h5ln',
- 'h5ls',
- 'h5mount',
- 'h5mv',
- 'h5open',
- 'h5read',
- 'h5readattr',
- 'h5rm',
- 'h5umount',
- 'h5write',
- 'h5writeattr',
- 'havewindow',
- 'helpbrowser',
- 'hess',
- 'hinf',
- 'historymanager',
- 'historysize',
- 'host',
- 'htmlDump',
- 'htmlRead',
- 'htmlReadStr',
- 'htmlWrite',
- 'iconvert',
- 'ieee',
- 'ilib_verbose',
- 'imag',
- 'impl',
- 'import_from_hdf5',
- 'imult',
- 'inpnvi',
- 'int',
- 'int16',
- 'int2d',
- 'int32',
- 'int3d',
- 'int8',
- 'interp',
- 'interp2d',
- 'interp3d',
- 'intg',
- 'intppty',
- 'inttype',
- 'inv',
- 'invoke_lu',
- 'is_handle_valid',
- 'is_hdf5_file',
- 'isalphanum',
- 'isascii',
- 'isdef',
- 'isdigit',
- 'isdir',
- 'isequal',
- 'isequalbitwise',
- 'iserror',
- 'isfile',
- 'isglobal',
- 'isletter',
- 'isnum',
- 'isreal',
- 'iswaitingforinput',
- 'jallowClassReloading',
- 'jarray',
- 'jautoTranspose',
- 'jautoUnwrap',
- 'javaclasspath',
- 'javalibrarypath',
- 'jcast',
- 'jcompile',
- 'jconvMatrixMethod',
- 'jcreatejar',
- 'jdeff',
- 'jdisableTrace',
- 'jenableTrace',
- 'jexists',
- 'jgetclassname',
- 'jgetfield',
- 'jgetfields',
- 'jgetinfo',
- 'jgetmethods',
- 'jimport',
- 'jinvoke',
- 'jinvoke_db',
- 'jnewInstance',
- 'jremove',
- 'jsetfield',
- 'junwrap',
- 'junwraprem',
- 'jwrap',
- 'jwrapinfloat',
- 'kron',
- 'lasterror',
- 'ldiv',
- 'ldivf',
- 'legendre',
- 'length',
- 'lib',
- 'librarieslist',
- 'libraryinfo',
- 'light',
- 'linear_interpn',
- 'lines',
- 'link',
- 'linmeq',
- 'list',
- 'listvar_in_hdf5',
- 'load',
- 'loadGui',
- 'loadScicos',
- 'loadXcos',
- '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',
- 'name2rgb',
- 'nearfloat',
- 'newaxes',
- 'newest',
- 'newfun',
- 'nnz',
- 'norm',
- 'notify',
- 'number_properties',
- 'ode',
- 'odedc',
- 'ones',
- 'openged',
- 'opentk',
- 'optim',
- 'or',
- 'ordmmd',
- 'parallel_concurrency',
- 'parallel_run',
- 'param3d',
- 'param3d1',
- 'part',
- 'pathconvert',
- 'pathsep',
- 'phase_simulation',
- 'plot2d',
- 'plot2d1',
- 'plot2d2',
- 'plot2d3',
- 'plot2d4',
- 'plot3d',
- 'plot3d1',
- 'plotbrowser',
- 'pointer_xproperty',
- 'poly',
- 'ppol',
- 'pppdiv',
- 'predef',
- 'preferences',
- 'print',
- 'printf',
- 'printfigure',
- 'printsetupbox',
- 'prod',
- 'progressionbar',
- 'prompt',
- 'pwd',
- 'qld',
- 'qp_solve',
- 'qr',
- 'raise_window',
- 'rand',
- 'rankqr',
- 'rat',
- 'rcond',
- 'rdivf',
- 'read',
- 'read4b',
- 'read_csv',
- 'readb',
- 'readgateway',
- 'readmps',
- 'real',
- 'realtime',
- 'realtimeinit',
- 'regexp',
- 'relocate_handle',
- 'remez',
- 'removeModulePreferences',
- 'removedir',
- 'removelinehistory',
- 'res_with_prec',
- 'resethistory',
- 'residu',
- 'resume',
- 'return',
- 'ricc',
- 'rlist',
- 'roots',
- 'rotate_axes',
- 'round',
- 'rpem',
- 'rtitr',
- 'rubberbox',
- 'save',
- 'saveGui',
- '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_window',
- 'sident',
- 'sig2data',
- 'sign',
- 'simp',
- 'simp_mode',
- 'sin',
- 'size',
- 'slash',
- 'sleep',
- 'sorder',
- 'sparse',
- 'spchol',
- 'spcompack',
- 'spec',
- 'spget',
- 'splin',
- 'splin2d',
- 'splin3d',
- 'splitURL',
- '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',
- 'useeditor',
- 'user',
- 'var2vec',
- 'varn',
- 'vec2var',
- 'waitbar',
- 'warnBlockByUID',
- 'warning',
- 'what',
- 'where',
- 'whereis',
- 'who',
- 'winsid',
- 'with_module',
- 'writb',
- 'write',
- 'write4b',
- 'write_csv',
- 'x_choose',
- 'x_choose_modeless',
- 'x_dialog',
- 'x_mdialog',
- 'xarc',
- 'xarcs',
- 'xarrows',
- 'xchange',
- 'xchoicesi',
- 'xclick',
- 'xcos',
- 'xcosAddToolsMenu',
- 'xcosConfigureXmlFile',
- 'xcosDiagramToScilab',
- 'xcosPalCategoryAdd',
- 'xcosPalDelete',
- 'xcosPalDisable',
- 'xcosPalEnable',
- 'xcosPalGenerateIcon',
- 'xcosPalGet',
- 'xcosPalLoad',
- 'xcosPalMove',
- 'xcosSimulationStarted',
- 'xcosUpdateBlock',
- 'xdel',
- 'xend',
- 'xfarc',
- 'xfarcs',
- 'xfpoly',
- 'xfpolys',
- 'xfrect',
- 'xget',
- 'xgetmouse',
- 'xgraduate',
- 'xgrid',
- 'xinit',
- 'xlfont',
- 'xls_open',
- 'xls_read',
- 'xmlAddNs',
- 'xmlAppend',
- 'xmlAsNumber',
- 'xmlAsText',
- 'xmlDTD',
- 'xmlDelete',
- 'xmlDocument',
- 'xmlDump',
- 'xmlElement',
- 'xmlFormat',
- 'xmlGetNsByHref',
- 'xmlGetNsByPrefix',
- 'xmlGetOpenDocs',
- 'xmlIsValidObject',
- 'xmlName',
- 'xmlNs',
- 'xmlRead',
- 'xmlReadStr',
- 'xmlRelaxNG',
- 'xmlRemove',
- 'xmlSchema',
- 'xmlSetAttributes',
- 'xmlValidate',
- 'xmlWrite',
- 'xmlXPath',
- 'xname',
- 'xpause',
- 'xpoly',
- 'xpolys',
- 'xrect',
- 'xrects',
- 'xs2bmp',
- 'xs2emf',
- 'xs2eps',
- 'xs2gif',
- 'xs2jpg',
- 'xs2pdf',
- 'xs2png',
- 'xs2ppm',
- 'xs2ps',
- 'xs2svg',
- 'xsegs',
- 'xset',
- 'xstring',
- 'xstringb',
- 'xtitle',
- 'zeros',
- 'znaupd',
- 'zneupd',
- 'zoom_rect',
-)
-
-macros_kw = (
- '!_deff_wrapper',
- '%0_i_st',
- '%3d_i_h',
- '%Block_xcosUpdateBlock',
- '%TNELDER_p',
- '%TNELDER_string',
- '%TNMPLOT_p',
- '%TNMPLOT_string',
- '%TOPTIM_p',
- '%TOPTIM_string',
- '%TSIMPLEX_p',
- '%TSIMPLEX_string',
- '%_EVoid_p',
- '%_gsort',
- '%_listvarinfile',
- '%_rlist',
- '%_save',
- '%_sodload',
- '%_strsplit',
- '%_unwrap',
- '%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_grand',
- '%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',
- '%bicg',
- '%bicgstab',
- '%c_a_c',
- '%c_b_c',
- '%c_b_s',
- '%c_diag',
- '%c_dsearch',
- '%c_e',
- '%c_eye',
- '%c_f_s',
- '%c_grand',
- '%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',
- '%cgs',
- '%champdat_i_h',
- '%choose',
- '%diagram_xcos',
- '%dir_p',
- '%fptr_i_st',
- '%grand_perm',
- '%grayplot_i_h',
- '%h_i_st',
- '%hmS_k_hmS_generic',
- '%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_dsearch',
- '%hm_e',
- '%hm_exp',
- '%hm_eye',
- '%hm_f_hm',
- '%hm_find',
- '%hm_floor',
- '%hm_g_hm',
- '%hm_grand',
- '%hm_gsort',
- '%hm_h_hm',
- '%hm_i_b',
- '%hm_i_ce',
- '%hm_i_h',
- '%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_max',
- '%hm_mean',
- '%hm_median',
- '%hm_min',
- '%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_stdev',
- '%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_dsearch',
- '%i_e',
- '%i_fft',
- '%i_g_i',
- '%i_gcd',
- '%i_grand',
- '%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_part',
- '%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_grand',
- '%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_part',
- '%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',
- '%pcg',
- '%plist_p',
- '%plist_string',
- '%r_0',
- '%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_cumsum',
- '%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_varn',
- '%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_bezout',
- '%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_gcd',
- '%s_grand',
- '%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_lcm',
- '%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_conj',
- '%sp_cos',
- '%sp_cumprod',
- '%sp_cumsum',
- '%sp_d_s',
- '%sp_d_sp',
- '%sp_det',
- '%sp_diag',
- '%sp_e',
- '%sp_exp',
- '%sp_f_s',
- '%sp_floor',
- '%sp_grand',
- '%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_max',
- '%sp_min',
- '%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',
- 'TCL_CreateSlave',
- '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',
- 'arhnk',
- 'arl2',
- 'arma2p',
- 'arma2ss',
- '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',
- 'atomsGetInstalledPath',
- 'atomsGetLoaded',
- 'atomsGetLoadedPath',
- 'atomsInstall',
- 'atomsIsInstalled',
- 'atomsIsLoaded',
- 'atomsList',
- 'atomsLoad',
- 'atomsQuit',
- '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',
- 'bode_asymp',
- 'bstap',
- 'buttmag',
- 'bvodeS',
- 'bytecode',
- 'bytecodewalk',
- 'cainv',
- 'calendar',
- 'calerf',
- 'calfrq',
- 'canon',
- 'casc',
- 'cat',
- 'cat_code',
- 'cb_m2sci_gui',
- 'ccontrg',
- 'cell',
- 'cell2mat',
- 'cellstr',
- 'center',
- 'cepstrum',
- 'cfspec',
- 'char',
- 'chart',
- 'cheb1mag',
- 'cheb2mag',
- 'check_gateways',
- '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',
- 'configure_msifort',
- 'configure_msvc',
- 'conjgrad',
- 'cont_frm',
- 'cont_mat',
- 'contrss',
- 'conv',
- 'convert_to_float',
- 'convertindex',
- 'convol',
- 'convol2d',
- 'copfac',
- 'correl',
- 'cosd',
- 'cosh',
- 'coshm',
- 'cosm',
- 'cotd',
- 'cotg',
- 'coth',
- 'cothm',
- 'cov',
- 'covar',
- 'createXConfiguration',
- 'createfun',
- 'createstruct',
- 'cross',
- '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_run',
- 'demo_viewCode',
- 'denom',
- 'derivat',
- 'derivative',
- 'des2ss',
- 'des2tf',
- 'detectmsifort64tools',
- 'detectmsvc64tools',
- 'determ',
- 'detr',
- 'detrend',
- 'devtools_run_builder',
- 'dhnorm',
- 'diff',
- 'diophant',
- 'dir',
- 'dirname',
- 'dispfiles',
- 'dllinfo',
- 'dscr',
- 'dsimul',
- 'dt_ility',
- 'dtsi',
- 'edit',
- 'edit_error',
- 'editor',
- 'eigenmarkov',
- 'eigs',
- 'ell1mag',
- 'enlarge_shape',
- 'entropy',
- 'eomday',
- 'epred',
- 'eqfir',
- 'eqiir',
- 'equil',
- 'equil1',
- 'erfinv',
- 'etime',
- 'eval',
- 'evans',
- 'evstr',
- 'example_run',
- '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',
- 'fix',
- 'fixedpointgcd',
- 'flipdim',
- 'flts',
- 'fminsearch',
- 'formatBlackTip',
- 'formatBodeMagTip',
- 'formatBodePhaseTip',
- 'formatGainplotTip',
- 'formatHallModuleTip',
- 'formatHallPhaseTip',
- 'formatNicholsGainTip',
- 'formatNicholsPhaseTip',
- 'formatNyquistTip',
- 'formatPhaseplotTip',
- 'formatSgridDampingTip',
- 'formatSgridFreqTip',
- 'formatZgridDampingTip',
- 'formatZgridFreqTip',
- 'format_txt',
- 'fourplan',
- 'frep2tf',
- 'freson',
- 'frfit',
- 'frmag',
- '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',
- 'genmarkov',
- 'geomean',
- 'getDiagramVersion',
- 'getModelicaPath',
- 'getPreferencesValue',
- '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_from_sci',
- 'help_skeleton',
- 'hermit',
- 'hex2dec',
- 'hilb',
- 'hilbert',
- 'histc',
- 'horner',
- 'householder',
- 'hrmt',
- 'htrianr',
- 'hypermat',
- 'idct',
- 'idst',
- 'ifft',
- 'ifftshift',
- 'iir',
- 'iirgroup',
- 'iirlp',
- 'iirmod',
- 'ilib_build',
- 'ilib_build_jar',
- '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',
- 'iscolumn',
- 'isempty',
- 'isfield',
- 'isinf',
- 'ismatrix',
- 'isnan',
- 'isrow',
- 'isscalar',
- 'issparse',
- 'issquare',
- 'isstruct',
- 'isvector',
- 'jmat',
- 'justify',
- 'kalm',
- 'karmarkar',
- 'kernel',
- 'kpure',
- 'krac2',
- 'kroneck',
- 'lattn',
- 'lattp',
- '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',
- 'members',
- '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_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_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',
- 'nanreglin',
- '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_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_function',
- 'nmplot_get',
- 'nmplot_historyplot',
- 'nmplot_log',
- 'nmplot_new',
- 'nmplot_outputcmd',
- 'nmplot_restart',
- 'nmplot_search',
- 'nmplot_simplexhistory',
- 'noisegen',
- 'nonreg_test_run',
- 'now',
- 'nthroot',
- 'null',
- 'num2cell',
- 'numderivative',
- '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_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_reflect',
- 'optimsimplex_setall',
- 'optimsimplex_setallfv',
- 'optimsimplex_setallx',
- 'optimsimplex_setfv',
- 'optimsimplex_setn',
- 'optimsimplex_setnbve',
- 'optimsimplex_setve',
- 'optimsimplex_setx',
- 'optimsimplex_shrink',
- 'optimsimplex_size',
- 'optimsimplex_sort',
- 'optimsimplex_xbar',
- 'orth',
- 'output_ga_default',
- 'output_moga_default',
- 'output_nsga2_default',
- 'output_nsga_default',
- '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',
- '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',
- 'setPreferencesValue',
- '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',
- '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_localization',
- 'tbx_build_macros',
- 'tbx_build_pal_loader',
- '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',
- 'tbx_generate_pofile',
- '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',
- 'unwrap',
- 'variance',
- 'variancef',
- 'vec2list',
- 'vectorfind',
- 'ver',
- 'warnobsolete',
- 'wavread',
- 'wavwrite',
- 'wcenter',
- 'weekday',
- 'wfir',
- 'wfir_gui',
- 'whereami',
- 'who_user',
- 'whos',
- 'wiener',
- 'wigner',
- 'window',
- 'winlist',
- 'with_javasci',
- 'with_macros_source',
- 'with_modelica_compiler',
- 'with_tk',
- 'xcorr',
- 'xcosBlockEval',
- 'xcosBlockInterface',
- 'xcosCodeGeneration',
- 'xcosConfigureModelica',
- 'xcosPal',
- 'xcosPalAdd',
- 'xcosPalAddBlock',
- 'xcosPalExport',
- 'xcosPalGenerateAllIcons',
- 'xcosShowBlockWarning',
- 'xcosValidateBlockSet',
- 'xcosValidateCompareBlock',
- 'xcos_compile',
- 'xcos_debug_gui',
- 'xcos_run',
- 'xcos_simulate',
- 'xcov',
- 'xmltochm',
- 'xmltoformat',
- 'xmltohtml',
- 'xmltojar',
- 'xmltopdf',
- 'xmltops',
- 'xmltoweb',
- 'yulewalk',
- 'zeropen',
- 'zgrid',
- 'zpbutt',
- 'zpch1',
- 'zpch2',
- 'zpell',
-)
-
-variables_kw = (
- '$',
- '%F',
- '%T',
- '%e',
- '%eps',
- '%f',
- '%fftw',
- '%gui',
- '%i',
- '%inf',
- '%io',
- '%modalWarning',
- '%nan',
- '%pi',
- '%s',
- '%t',
- '%tk',
- '%toolboxes',
- '%toolboxes_dir',
- '%z',
- 'PWD',
- 'SCI',
- 'SCIHOME',
- 'TMPDIR',
- 'arnoldilib',
- 'assertlib',
- 'atomslib',
- 'cacsdlib',
- 'compatibility_functilib',
- 'corelib',
- 'data_structureslib',
- 'demo_toolslib',
- 'development_toolslib',
- 'differential_equationlib',
- 'dynamic_linklib',
- 'elementary_functionslib',
- 'enull',
- 'evoid',
- 'external_objectslib',
- 'fd',
- 'fileiolib',
- 'functionslib',
- 'genetic_algorithmslib',
- 'helptoolslib',
- 'home',
- 'integerlib',
- 'interpolationlib',
- 'iolib',
- 'jnull',
- 'jvoid',
- 'linear_algebralib',
- 'm2scilib',
- 'matiolib',
- 'modules_managerlib',
- 'neldermeadlib',
- 'optimbaselib',
- 'optimizationlib',
- 'optimsimplexlib',
- 'output_streamlib',
- 'overloadinglib',
- 'parameterslib',
- 'polynomialslib',
- 'preferenceslib',
- 'randliblib',
- 'scicos_autolib',
- 'scicos_utilslib',
- 'scinoteslib',
- 'signal_processinglib',
- 'simulated_annealinglib',
- 'soundlib',
- 'sparselib',
- 'special_functionslib',
- 'spreadsheetlib',
- 'statisticslib',
- 'stringlib',
- 'tclscilib',
- 'timelib',
- 'umfpacklib',
- 'xcoslib',
-)
-
-
-if __name__ == '__main__': # pragma: no cover
- import subprocess
- from pygments.util import format_lines, duplicates_removed
-
- mapping = {'variables': 'builtin'}
-
- def extract_completion(var_type):
- s = subprocess.Popen(['scilab', '-nwni'], stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- output = s.communicate('''\
-fd = mopen("/dev/stderr", "wt");
-mputl(strcat(completion("", "%s"), "||"), fd);
-mclose(fd)\n''' % var_type)
- if '||' not in output[1]:
- raise Exception(output[0])
- # Invalid DISPLAY causes this to be output:
- text = output[1].strip()
- if text.startswith('Error: unable to open display \n'):
- text = text[len('Error: unable to open display \n'):]
- return text.split('||')
-
- new_data = {}
- seen = set() # only keep first type for a given word
- for t in ('functions', 'commands', 'macros', 'variables'):
- new_data[t] = duplicates_removed(extract_completion(t), seen)
- seen.update(set(new_data[t]))
-
-
- with open(__file__) as f:
- content = f.read()
-
- header = content[:content.find('# Autogenerated')]
- footer = content[content.find("if __name__ == '__main__':"):]
-
- with open(__file__, 'w') as f:
- f.write(header)
- f.write('# Autogenerated\n\n')
- for k, v in sorted(new_data.iteritems()):
- f.write(format_lines(k + '_kw', v) + '\n\n')
- f.write(footer)
diff --git a/pygments/lexers/_sourcemod_builtins.py b/pygments/lexers/_sourcemod_builtins.py
deleted file mode 100644
index fa967167..00000000
--- a/pygments/lexers/_sourcemod_builtins.py
+++ /dev/null
@@ -1,1163 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._sourcemod_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This file contains the names of SourceMod functions.
- It is able to re-generate itself.
-
- Do not edit the FUNCTIONS list by hand.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-FUNCTIONS = (
- 'OnEntityCreated',
- 'OnEntityDestroyed',
- 'OnGetGameDescription',
- 'OnLevelInit',
- 'SDKHook',
- 'SDKHookEx',
- 'SDKUnhook',
- 'SDKHooks_TakeDamage',
- 'SDKHooks_DropWeapon',
- 'TopMenuHandler',
- 'CreateTopMenu',
- 'LoadTopMenuConfig',
- 'AddToTopMenu',
- 'GetTopMenuInfoString',
- 'GetTopMenuObjName',
- 'RemoveFromTopMenu',
- 'DisplayTopMenu',
- 'DisplayTopMenuCategory',
- 'FindTopMenuCategory',
- 'SetTopMenuTitleCaching',
- 'OnAdminMenuCreated',
- 'OnAdminMenuReady',
- 'GetAdminTopMenu',
- 'AddTargetsToMenu',
- 'AddTargetsToMenu2',
- 'RedisplayAdminMenu',
- 'TEHook',
- 'AddTempEntHook',
- 'RemoveTempEntHook',
- 'TE_Start',
- 'TE_IsValidProp',
- 'TE_WriteNum',
- 'TE_ReadNum',
- 'TE_WriteFloat',
- 'TE_ReadFloat',
- 'TE_WriteVector',
- 'TE_ReadVector',
- 'TE_WriteAngles',
- 'TE_WriteFloatArray',
- 'TE_Send',
- 'TE_WriteEncodedEnt',
- 'TE_SendToAll',
- 'TE_SendToClient',
- 'CreateKeyValues',
- 'KvSetString',
- 'KvSetNum',
- 'KvSetUInt64',
- 'KvSetFloat',
- 'KvSetColor',
- 'KvSetVector',
- 'KvGetString',
- 'KvGetNum',
- 'KvGetFloat',
- 'KvGetColor',
- 'KvGetUInt64',
- 'KvGetVector',
- 'KvJumpToKey',
- 'KvJumpToKeySymbol',
- 'KvGotoFirstSubKey',
- 'KvGotoNextKey',
- 'KvSavePosition',
- 'KvDeleteKey',
- 'KvDeleteThis',
- 'KvGoBack',
- 'KvRewind',
- 'KvGetSectionName',
- 'KvSetSectionName',
- 'KvGetDataType',
- 'KeyValuesToFile',
- 'FileToKeyValues',
- 'StringToKeyValues',
- 'KvSetEscapeSequences',
- 'KvNodesInStack',
- 'KvCopySubkeys',
- 'KvFindKeyById',
- 'KvGetNameSymbol',
- 'KvGetSectionSymbol',
- 'TE_SetupSparks',
- 'TE_SetupSmoke',
- 'TE_SetupDust',
- 'TE_SetupMuzzleFlash',
- 'TE_SetupMetalSparks',
- 'TE_SetupEnergySplash',
- 'TE_SetupArmorRicochet',
- 'TE_SetupGlowSprite',
- 'TE_SetupExplosion',
- 'TE_SetupBloodSprite',
- 'TE_SetupBeamRingPoint',
- 'TE_SetupBeamPoints',
- 'TE_SetupBeamLaser',
- 'TE_SetupBeamRing',
- 'TE_SetupBeamFollow',
- 'HookEvent',
- 'HookEventEx',
- 'UnhookEvent',
- 'CreateEvent',
- 'FireEvent',
- 'CancelCreatedEvent',
- 'GetEventBool',
- 'SetEventBool',
- 'GetEventInt',
- 'SetEventInt',
- 'GetEventFloat',
- 'SetEventFloat',
- 'GetEventString',
- 'SetEventString',
- 'GetEventName',
- 'SetEventBroadcast',
- 'GetUserMessageType',
- 'GetUserMessageId',
- 'GetUserMessageName',
- 'StartMessage',
- 'StartMessageEx',
- 'EndMessage',
- 'MsgHook',
- 'MsgPostHook',
- 'HookUserMessage',
- 'UnhookUserMessage',
- 'StartMessageAll',
- 'StartMessageOne',
- 'InactivateClient',
- 'ReconnectClient',
- 'GetMaxEntities',
- 'GetEntityCount',
- 'IsValidEntity',
- 'IsValidEdict',
- 'IsEntNetworkable',
- 'CreateEdict',
- 'RemoveEdict',
- 'GetEdictFlags',
- 'SetEdictFlags',
- 'GetEdictClassname',
- 'GetEntityNetClass',
- 'ChangeEdictState',
- 'GetEntData',
- 'SetEntData',
- 'GetEntDataFloat',
- 'SetEntDataFloat',
- 'GetEntDataEnt2',
- 'SetEntDataEnt2',
- 'GetEntDataVector',
- 'SetEntDataVector',
- 'GetEntDataString',
- 'SetEntDataString',
- 'FindSendPropOffs',
- 'FindSendPropInfo',
- 'FindDataMapOffs',
- 'FindDataMapInfo',
- 'GetEntSendPropOffs',
- 'GetEntProp',
- 'SetEntProp',
- 'GetEntPropFloat',
- 'SetEntPropFloat',
- 'GetEntPropEnt',
- 'SetEntPropEnt',
- 'GetEntPropVector',
- 'SetEntPropVector',
- 'GetEntPropString',
- 'SetEntPropString',
- 'GetEntPropArraySize',
- 'GetEntDataArray',
- 'SetEntDataArray',
- 'GetEntityAddress',
- 'GetEntityClassname',
- 'float',
- 'FloatMul',
- 'FloatDiv',
- 'FloatAdd',
- 'FloatSub',
- 'FloatFraction',
- 'RoundToZero',
- 'RoundToCeil',
- 'RoundToFloor',
- 'RoundToNearest',
- 'FloatCompare',
- 'SquareRoot',
- 'Pow',
- 'Exponential',
- 'Logarithm',
- 'Sine',
- 'Cosine',
- 'Tangent',
- 'FloatAbs',
- 'ArcTangent',
- 'ArcCosine',
- 'ArcSine',
- 'ArcTangent2',
- 'RoundFloat',
- 'operator%',
- 'DegToRad',
- 'RadToDeg',
- 'GetURandomInt',
- 'GetURandomFloat',
- 'SetURandomSeed',
- 'SetURandomSeedSimple',
- 'RemovePlayerItem',
- 'GivePlayerItem',
- 'GetPlayerWeaponSlot',
- 'IgniteEntity',
- 'ExtinguishEntity',
- 'TeleportEntity',
- 'ForcePlayerSuicide',
- 'SlapPlayer',
- 'FindEntityByClassname',
- 'GetClientEyeAngles',
- 'CreateEntityByName',
- 'DispatchSpawn',
- 'DispatchKeyValue',
- 'DispatchKeyValueFloat',
- 'DispatchKeyValueVector',
- 'GetClientAimTarget',
- 'GetTeamCount',
- 'GetTeamName',
- 'GetTeamScore',
- 'SetTeamScore',
- 'GetTeamClientCount',
- 'SetEntityModel',
- 'GetPlayerDecalFile',
- 'GetPlayerJingleFile',
- 'GetServerNetStats',
- 'EquipPlayerWeapon',
- 'ActivateEntity',
- 'SetClientInfo',
- 'GivePlayerAmmo',
- 'SetClientListeningFlags',
- 'GetClientListeningFlags',
- 'SetListenOverride',
- 'GetListenOverride',
- 'IsClientMuted',
- 'TR_GetPointContents',
- 'TR_GetPointContentsEnt',
- 'TR_TraceRay',
- 'TR_TraceHull',
- 'TR_TraceRayFilter',
- 'TR_TraceHullFilter',
- 'TR_TraceRayEx',
- 'TR_TraceHullEx',
- 'TR_TraceRayFilterEx',
- 'TR_TraceHullFilterEx',
- 'TR_GetFraction',
- 'TR_GetEndPosition',
- 'TR_GetEntityIndex',
- 'TR_DidHit',
- 'TR_GetHitGroup',
- 'TR_GetPlaneNormal',
- 'TR_PointOutsideWorld',
- 'SortIntegers',
- 'SortFloats',
- 'SortStrings',
- 'SortFunc1D',
- 'SortCustom1D',
- 'SortCustom2D',
- 'SortADTArray',
- 'SortFuncADTArray',
- 'SortADTArrayCustom',
- 'CompileRegex',
- 'MatchRegex',
- 'GetRegexSubString',
- 'SimpleRegexMatch',
- 'TF2_GetPlayerClass',
- 'TF2_SetPlayerClass',
- 'TF2_RemoveWeaponSlot',
- 'TF2_RemoveAllWeapons',
- 'TF2_IsPlayerInCondition',
- 'TF2_GetObjectType',
- 'TF2_GetObjectMode',
- 'NominateMap',
- 'RemoveNominationByMap',
- 'RemoveNominationByOwner',
- 'GetExcludeMapList',
- 'GetNominatedMapList',
- 'CanMapChooserStartVote',
- 'InitiateMapChooserVote',
- 'HasEndOfMapVoteFinished',
- 'EndOfMapVoteEnabled',
- 'OnNominationRemoved',
- 'OnMapVoteStarted',
- 'CreateTimer',
- 'KillTimer',
- 'TriggerTimer',
- 'GetTickedTime',
- 'GetMapTimeLeft',
- 'GetMapTimeLimit',
- 'ExtendMapTimeLimit',
- 'GetTickInterval',
- 'OnMapTimeLeftChanged',
- 'IsServerProcessing',
- 'CreateDataTimer',
- 'ByteCountToCells',
- 'CreateArray',
- 'ClearArray',
- 'CloneArray',
- 'ResizeArray',
- 'GetArraySize',
- 'PushArrayCell',
- 'PushArrayString',
- 'PushArrayArray',
- 'GetArrayCell',
- 'GetArrayString',
- 'GetArrayArray',
- 'SetArrayCell',
- 'SetArrayString',
- 'SetArrayArray',
- 'ShiftArrayUp',
- 'RemoveFromArray',
- 'SwapArrayItems',
- 'FindStringInArray',
- 'FindValueInArray',
- 'ProcessTargetString',
- 'ReplyToTargetError',
- 'MultiTargetFilter',
- 'AddMultiTargetFilter',
- 'RemoveMultiTargetFilter',
- 'OnBanClient',
- 'OnBanIdentity',
- 'OnRemoveBan',
- 'BanClient',
- 'BanIdentity',
- 'RemoveBan',
- 'CreateTrie',
- 'SetTrieValue',
- 'SetTrieArray',
- 'SetTrieString',
- 'GetTrieValue',
- 'GetTrieArray',
- 'GetTrieString',
- 'RemoveFromTrie',
- 'ClearTrie',
- 'GetTrieSize',
- 'GetFunctionByName',
- 'CreateGlobalForward',
- 'CreateForward',
- 'GetForwardFunctionCount',
- 'AddToForward',
- 'RemoveFromForward',
- 'RemoveAllFromForward',
- 'Call_StartForward',
- 'Call_StartFunction',
- 'Call_PushCell',
- 'Call_PushCellRef',
- 'Call_PushFloat',
- 'Call_PushFloatRef',
- 'Call_PushArray',
- 'Call_PushArrayEx',
- 'Call_PushString',
- 'Call_PushStringEx',
- 'Call_Finish',
- 'Call_Cancel',
- 'NativeCall',
- 'CreateNative',
- 'ThrowNativeError',
- 'GetNativeStringLength',
- 'GetNativeString',
- 'SetNativeString',
- 'GetNativeCell',
- 'GetNativeCellRef',
- 'SetNativeCellRef',
- 'GetNativeArray',
- 'SetNativeArray',
- 'FormatNativeString',
- 'RequestFrameCallback',
- 'RequestFrame',
- 'OnRebuildAdminCache',
- 'DumpAdminCache',
- 'AddCommandOverride',
- 'GetCommandOverride',
- 'UnsetCommandOverride',
- 'CreateAdmGroup',
- 'FindAdmGroup',
- 'SetAdmGroupAddFlag',
- 'GetAdmGroupAddFlag',
- 'GetAdmGroupAddFlags',
- 'SetAdmGroupImmuneFrom',
- 'GetAdmGroupImmuneCount',
- 'GetAdmGroupImmuneFrom',
- 'AddAdmGroupCmdOverride',
- 'GetAdmGroupCmdOverride',
- 'RegisterAuthIdentType',
- 'CreateAdmin',
- 'GetAdminUsername',
- 'BindAdminIdentity',
- 'SetAdminFlag',
- 'GetAdminFlag',
- 'GetAdminFlags',
- 'AdminInheritGroup',
- 'GetAdminGroupCount',
- 'GetAdminGroup',
- 'SetAdminPassword',
- 'GetAdminPassword',
- 'FindAdminByIdentity',
- 'RemoveAdmin',
- 'FlagBitsToBitArray',
- 'FlagBitArrayToBits',
- 'FlagArrayToBits',
- 'FlagBitsToArray',
- 'FindFlagByName',
- 'FindFlagByChar',
- 'FindFlagChar',
- 'ReadFlagString',
- 'CanAdminTarget',
- 'CreateAuthMethod',
- 'SetAdmGroupImmunityLevel',
- 'GetAdmGroupImmunityLevel',
- 'SetAdminImmunityLevel',
- 'GetAdminImmunityLevel',
- 'FlagToBit',
- 'BitToFlag',
- 'ServerCommand',
- 'ServerCommandEx',
- 'InsertServerCommand',
- 'ServerExecute',
- 'ClientCommand',
- 'FakeClientCommand',
- 'FakeClientCommandEx',
- 'PrintToServer',
- 'PrintToConsole',
- 'ReplyToCommand',
- 'GetCmdReplySource',
- 'SetCmdReplySource',
- 'IsChatTrigger',
- 'ShowActivity2',
- 'ShowActivity',
- 'ShowActivityEx',
- 'FormatActivitySource',
- 'SrvCmd',
- 'RegServerCmd',
- 'ConCmd',
- 'RegConsoleCmd',
- 'RegAdminCmd',
- 'GetCmdArgs',
- 'GetCmdArg',
- 'GetCmdArgString',
- 'CreateConVar',
- 'FindConVar',
- 'ConVarChanged',
- 'HookConVarChange',
- 'UnhookConVarChange',
- 'GetConVarBool',
- 'SetConVarBool',
- 'GetConVarInt',
- 'SetConVarInt',
- 'GetConVarFloat',
- 'SetConVarFloat',
- 'GetConVarString',
- 'SetConVarString',
- 'ResetConVar',
- 'GetConVarDefault',
- 'GetConVarFlags',
- 'SetConVarFlags',
- 'GetConVarBounds',
- 'SetConVarBounds',
- 'GetConVarName',
- 'QueryClientConVar',
- 'GetCommandIterator',
- 'ReadCommandIterator',
- 'CheckCommandAccess',
- 'CheckAccess',
- 'IsValidConVarChar',
- 'GetCommandFlags',
- 'SetCommandFlags',
- 'FindFirstConCommand',
- 'FindNextConCommand',
- 'SendConVarValue',
- 'AddServerTag',
- 'RemoveServerTag',
- 'CommandListener',
- 'AddCommandListener',
- 'RemoveCommandListener',
- 'CommandExists',
- 'OnClientSayCommand',
- 'OnClientSayCommand_Post',
- 'TF2_IgnitePlayer',
- 'TF2_RespawnPlayer',
- 'TF2_RegeneratePlayer',
- 'TF2_AddCondition',
- 'TF2_RemoveCondition',
- 'TF2_SetPlayerPowerPlay',
- 'TF2_DisguisePlayer',
- 'TF2_RemovePlayerDisguise',
- 'TF2_StunPlayer',
- 'TF2_MakeBleed',
- 'TF2_GetClass',
- 'TF2_CalcIsAttackCritical',
- 'TF2_OnIsHolidayActive',
- 'TF2_IsHolidayActive',
- 'TF2_IsPlayerInDuel',
- 'TF2_RemoveWearable',
- 'TF2_OnConditionAdded',
- 'TF2_OnConditionRemoved',
- 'TF2_OnWaitingForPlayersStart',
- 'TF2_OnWaitingForPlayersEnd',
- 'TF2_OnPlayerTeleport',
- 'SQL_Connect',
- 'SQL_DefConnect',
- 'SQL_ConnectCustom',
- 'SQLite_UseDatabase',
- 'SQL_CheckConfig',
- 'SQL_GetDriver',
- 'SQL_ReadDriver',
- 'SQL_GetDriverIdent',
- 'SQL_GetDriverProduct',
- 'SQL_SetCharset',
- 'SQL_GetAffectedRows',
- 'SQL_GetInsertId',
- 'SQL_GetError',
- 'SQL_EscapeString',
- 'SQL_QuoteString',
- 'SQL_FastQuery',
- 'SQL_Query',
- 'SQL_PrepareQuery',
- 'SQL_FetchMoreResults',
- 'SQL_HasResultSet',
- 'SQL_GetRowCount',
- 'SQL_GetFieldCount',
- 'SQL_FieldNumToName',
- 'SQL_FieldNameToNum',
- 'SQL_FetchRow',
- 'SQL_MoreRows',
- 'SQL_Rewind',
- 'SQL_FetchString',
- 'SQL_FetchFloat',
- 'SQL_FetchInt',
- 'SQL_IsFieldNull',
- 'SQL_FetchSize',
- 'SQL_BindParamInt',
- 'SQL_BindParamFloat',
- 'SQL_BindParamString',
- 'SQL_Execute',
- 'SQL_LockDatabase',
- 'SQL_UnlockDatabase',
- 'SQLTCallback',
- 'SQL_IsSameConnection',
- 'SQL_TConnect',
- 'SQL_TQuery',
- 'SQL_CreateTransaction',
- 'SQL_AddQuery',
- 'SQLTxnSuccess',
- 'SQLTxnFailure',
- 'SQL_ExecuteTransaction',
- 'CloseHandle',
- 'CloneHandle',
- 'MenuHandler',
- 'CreateMenu',
- 'DisplayMenu',
- 'DisplayMenuAtItem',
- 'AddMenuItem',
- 'InsertMenuItem',
- 'RemoveMenuItem',
- 'RemoveAllMenuItems',
- 'GetMenuItem',
- 'GetMenuSelectionPosition',
- 'GetMenuItemCount',
- 'SetMenuPagination',
- 'GetMenuPagination',
- 'GetMenuStyle',
- 'SetMenuTitle',
- 'GetMenuTitle',
- 'CreatePanelFromMenu',
- 'GetMenuExitButton',
- 'SetMenuExitButton',
- 'GetMenuExitBackButton',
- 'SetMenuExitBackButton',
- 'SetMenuNoVoteButton',
- 'CancelMenu',
- 'GetMenuOptionFlags',
- 'SetMenuOptionFlags',
- 'IsVoteInProgress',
- 'CancelVote',
- 'VoteMenu',
- 'VoteMenuToAll',
- 'VoteHandler',
- 'SetVoteResultCallback',
- 'CheckVoteDelay',
- 'IsClientInVotePool',
- 'RedrawClientVoteMenu',
- 'GetMenuStyleHandle',
- 'CreatePanel',
- 'CreateMenuEx',
- 'GetClientMenu',
- 'CancelClientMenu',
- 'GetMaxPageItems',
- 'GetPanelStyle',
- 'SetPanelTitle',
- 'DrawPanelItem',
- 'DrawPanelText',
- 'CanPanelDrawFlags',
- 'SetPanelKeys',
- 'SendPanelToClient',
- 'GetPanelTextRemaining',
- 'GetPanelCurrentKey',
- 'SetPanelCurrentKey',
- 'RedrawMenuItem',
- 'InternalShowMenu',
- 'GetMenuVoteInfo',
- 'IsNewVoteAllowed',
- 'PrefetchSound',
- 'EmitAmbientSound',
- 'FadeClientVolume',
- 'StopSound',
- 'EmitSound',
- 'EmitSentence',
- 'GetDistGainFromSoundLevel',
- 'AmbientSHook',
- 'NormalSHook',
- 'AddAmbientSoundHook',
- 'AddNormalSoundHook',
- 'RemoveAmbientSoundHook',
- 'RemoveNormalSoundHook',
- 'EmitSoundToClient',
- 'EmitSoundToAll',
- 'ATTN_TO_SNDLEVEL',
- 'GetGameSoundParams',
- 'EmitGameSound',
- 'EmitAmbientGameSound',
- 'EmitGameSoundToClient',
- 'EmitGameSoundToAll',
- 'PrecacheScriptSound',
- 'strlen',
- 'StrContains',
- 'strcmp',
- 'strncmp',
- 'StrEqual',
- 'strcopy',
- 'Format',
- 'FormatEx',
- 'VFormat',
- 'StringToInt',
- 'StringToIntEx',
- 'IntToString',
- 'StringToFloat',
- 'StringToFloatEx',
- 'FloatToString',
- 'BreakString',
- 'TrimString',
- 'SplitString',
- 'ReplaceString',
- 'ReplaceStringEx',
- 'GetCharBytes',
- 'IsCharAlpha',
- 'IsCharNumeric',
- 'IsCharSpace',
- 'IsCharMB',
- 'IsCharUpper',
- 'IsCharLower',
- 'StripQuotes',
- 'CharToUpper',
- 'CharToLower',
- 'FindCharInString',
- 'StrCat',
- 'ExplodeString',
- 'ImplodeStrings',
- 'GetVectorLength',
- 'GetVectorDistance',
- 'GetVectorDotProduct',
- 'GetVectorCrossProduct',
- 'NormalizeVector',
- 'GetAngleVectors',
- 'GetVectorAngles',
- 'GetVectorVectors',
- 'AddVectors',
- 'SubtractVectors',
- 'ScaleVector',
- 'NegateVector',
- 'MakeVectorFromPoints',
- 'BaseComm_IsClientGagged',
- 'BaseComm_IsClientMuted',
- 'BaseComm_SetClientGag',
- 'BaseComm_SetClientMute',
- 'FormatUserLogText',
- 'FindPluginByFile',
- 'FindTarget',
- 'AcceptEntityInput',
- 'SetVariantBool',
- 'SetVariantString',
- 'SetVariantInt',
- 'SetVariantFloat',
- 'SetVariantVector3D',
- 'SetVariantPosVector3D',
- 'SetVariantColor',
- 'SetVariantEntity',
- 'GameRules_GetProp',
- 'GameRules_SetProp',
- 'GameRules_GetPropFloat',
- 'GameRules_SetPropFloat',
- 'GameRules_GetPropEnt',
- 'GameRules_SetPropEnt',
- 'GameRules_GetPropVector',
- 'GameRules_SetPropVector',
- 'GameRules_GetPropString',
- 'GameRules_SetPropString',
- 'GameRules_GetRoundState',
- 'OnClientConnect',
- 'OnClientConnected',
- 'OnClientPutInServer',
- 'OnClientDisconnect',
- 'OnClientDisconnect_Post',
- 'OnClientCommand',
- 'OnClientSettingsChanged',
- 'OnClientAuthorized',
- 'OnClientPreAdminCheck',
- 'OnClientPostAdminFilter',
- 'OnClientPostAdminCheck',
- 'GetMaxClients',
- 'GetMaxHumanPlayers',
- 'GetClientCount',
- 'GetClientName',
- 'GetClientIP',
- 'GetClientAuthString',
- 'GetClientAuthId',
- 'GetSteamAccountID',
- 'GetClientUserId',
- 'IsClientConnected',
- 'IsClientInGame',
- 'IsClientInKickQueue',
- 'IsClientAuthorized',
- 'IsFakeClient',
- 'IsClientSourceTV',
- 'IsClientReplay',
- 'IsClientObserver',
- 'IsPlayerAlive',
- 'GetClientInfo',
- 'GetClientTeam',
- 'SetUserAdmin',
- 'GetUserAdmin',
- 'AddUserFlags',
- 'RemoveUserFlags',
- 'SetUserFlagBits',
- 'GetUserFlagBits',
- 'CanUserTarget',
- 'RunAdminCacheChecks',
- 'NotifyPostAdminCheck',
- 'CreateFakeClient',
- 'SetFakeClientConVar',
- 'GetClientHealth',
- 'GetClientModel',
- 'GetClientWeapon',
- 'GetClientMaxs',
- 'GetClientMins',
- 'GetClientAbsAngles',
- 'GetClientAbsOrigin',
- 'GetClientArmor',
- 'GetClientDeaths',
- 'GetClientFrags',
- 'GetClientDataRate',
- 'IsClientTimingOut',
- 'GetClientTime',
- 'GetClientLatency',
- 'GetClientAvgLatency',
- 'GetClientAvgLoss',
- 'GetClientAvgChoke',
- 'GetClientAvgData',
- 'GetClientAvgPackets',
- 'GetClientOfUserId',
- 'KickClient',
- 'KickClientEx',
- 'ChangeClientTeam',
- 'GetClientSerial',
- 'GetClientFromSerial',
- 'FindStringTable',
- 'GetNumStringTables',
- 'GetStringTableNumStrings',
- 'GetStringTableMaxStrings',
- 'GetStringTableName',
- 'FindStringIndex',
- 'ReadStringTable',
- 'GetStringTableDataLength',
- 'GetStringTableData',
- 'SetStringTableData',
- 'AddToStringTable',
- 'LockStringTables',
- 'AddFileToDownloadsTable',
- 'GetEntityFlags',
- 'SetEntityFlags',
- 'GetEntityMoveType',
- 'SetEntityMoveType',
- 'GetEntityRenderMode',
- 'SetEntityRenderMode',
- 'GetEntityRenderFx',
- 'SetEntityRenderFx',
- 'SetEntityRenderColor',
- 'GetEntityGravity',
- 'SetEntityGravity',
- 'SetEntityHealth',
- 'GetClientButtons',
- 'EntityOutput',
- 'HookEntityOutput',
- 'UnhookEntityOutput',
- 'HookSingleEntityOutput',
- 'UnhookSingleEntityOutput',
- 'SMC_CreateParser',
- 'SMC_ParseFile',
- 'SMC_GetErrorString',
- 'SMC_ParseStart',
- 'SMC_SetParseStart',
- 'SMC_ParseEnd',
- 'SMC_SetParseEnd',
- 'SMC_NewSection',
- 'SMC_KeyValue',
- 'SMC_EndSection',
- 'SMC_SetReaders',
- 'SMC_RawLine',
- 'SMC_SetRawLine',
- 'BfWriteBool',
- 'BfWriteByte',
- 'BfWriteChar',
- 'BfWriteShort',
- 'BfWriteWord',
- 'BfWriteNum',
- 'BfWriteFloat',
- 'BfWriteString',
- 'BfWriteEntity',
- 'BfWriteAngle',
- 'BfWriteCoord',
- 'BfWriteVecCoord',
- 'BfWriteVecNormal',
- 'BfWriteAngles',
- 'BfReadBool',
- 'BfReadByte',
- 'BfReadChar',
- 'BfReadShort',
- 'BfReadWord',
- 'BfReadNum',
- 'BfReadFloat',
- 'BfReadString',
- 'BfReadEntity',
- 'BfReadAngle',
- 'BfReadCoord',
- 'BfReadVecCoord',
- 'BfReadVecNormal',
- 'BfReadAngles',
- 'BfGetNumBytesLeft',
- 'CreateProfiler',
- 'StartProfiling',
- 'StopProfiling',
- 'GetProfilerTime',
- 'OnPluginStart',
- 'AskPluginLoad2',
- 'OnPluginEnd',
- 'OnPluginPauseChange',
- 'OnGameFrame',
- 'OnMapStart',
- 'OnMapEnd',
- 'OnConfigsExecuted',
- 'OnAutoConfigsBuffered',
- 'OnAllPluginsLoaded',
- 'GetMyHandle',
- 'GetPluginIterator',
- 'MorePlugins',
- 'ReadPlugin',
- 'GetPluginStatus',
- 'GetPluginFilename',
- 'IsPluginDebugging',
- 'GetPluginInfo',
- 'FindPluginByNumber',
- 'SetFailState',
- 'ThrowError',
- 'GetTime',
- 'FormatTime',
- 'LoadGameConfigFile',
- 'GameConfGetOffset',
- 'GameConfGetKeyValue',
- 'GameConfGetAddress',
- 'GetSysTickCount',
- 'AutoExecConfig',
- 'RegPluginLibrary',
- 'LibraryExists',
- 'GetExtensionFileStatus',
- 'OnLibraryAdded',
- 'OnLibraryRemoved',
- 'ReadMapList',
- 'SetMapListCompatBind',
- 'OnClientFloodCheck',
- 'OnClientFloodResult',
- 'CanTestFeatures',
- 'GetFeatureStatus',
- 'RequireFeature',
- 'LoadFromAddress',
- 'StoreToAddress',
- 'CreateStack',
- 'PushStackCell',
- 'PushStackString',
- 'PushStackArray',
- 'PopStackCell',
- 'PopStackString',
- 'PopStackArray',
- 'IsStackEmpty',
- 'PopStack',
- 'OnPlayerRunCmd',
- 'BuildPath',
- 'OpenDirectory',
- 'ReadDirEntry',
- 'OpenFile',
- 'DeleteFile',
- 'ReadFileLine',
- 'ReadFile',
- 'ReadFileString',
- 'WriteFile',
- 'WriteFileString',
- 'WriteFileLine',
- 'ReadFileCell',
- 'WriteFileCell',
- 'IsEndOfFile',
- 'FileSeek',
- 'FilePosition',
- 'FileExists',
- 'RenameFile',
- 'DirExists',
- 'FileSize',
- 'FlushFile',
- 'RemoveDir',
- 'CreateDirectory',
- 'GetFileTime',
- 'LogToOpenFile',
- 'LogToOpenFileEx',
- 'PbReadInt',
- 'PbReadFloat',
- 'PbReadBool',
- 'PbReadString',
- 'PbReadColor',
- 'PbReadAngle',
- 'PbReadVector',
- 'PbReadVector2D',
- 'PbGetRepeatedFieldCount',
- 'PbSetInt',
- 'PbSetFloat',
- 'PbSetBool',
- 'PbSetString',
- 'PbSetColor',
- 'PbSetAngle',
- 'PbSetVector',
- 'PbSetVector2D',
- 'PbAddInt',
- 'PbAddFloat',
- 'PbAddBool',
- 'PbAddString',
- 'PbAddColor',
- 'PbAddAngle',
- 'PbAddVector',
- 'PbAddVector2D',
- 'PbRemoveRepeatedFieldValue',
- 'PbReadMessage',
- 'PbReadRepeatedMessage',
- 'PbAddMessage',
- 'SetNextMap',
- 'GetNextMap',
- 'ForceChangeLevel',
- 'GetMapHistorySize',
- 'GetMapHistory',
- 'GeoipCode2',
- 'GeoipCode3',
- 'GeoipCountry',
- 'MarkNativeAsOptional',
- 'RegClientCookie',
- 'FindClientCookie',
- 'SetClientCookie',
- 'GetClientCookie',
- 'SetAuthIdCookie',
- 'AreClientCookiesCached',
- 'OnClientCookiesCached',
- 'CookieMenuHandler',
- 'SetCookiePrefabMenu',
- 'SetCookieMenuItem',
- 'ShowCookieMenu',
- 'GetCookieIterator',
- 'ReadCookieIterator',
- 'GetCookieAccess',
- 'GetClientCookieTime',
- 'LoadTranslations',
- 'SetGlobalTransTarget',
- 'GetClientLanguage',
- 'GetServerLanguage',
- 'GetLanguageCount',
- 'GetLanguageInfo',
- 'SetClientLanguage',
- 'GetLanguageByCode',
- 'GetLanguageByName',
- 'CS_OnBuyCommand',
- 'CS_OnCSWeaponDrop',
- 'CS_OnGetWeaponPrice',
- 'CS_OnTerminateRound',
- 'CS_RespawnPlayer',
- 'CS_SwitchTeam',
- 'CS_DropWeapon',
- 'CS_TerminateRound',
- 'CS_GetTranslatedWeaponAlias',
- 'CS_GetWeaponPrice',
- 'CS_GetClientClanTag',
- 'CS_SetClientClanTag',
- 'CS_GetTeamScore',
- 'CS_SetTeamScore',
- 'CS_GetMVPCount',
- 'CS_SetMVPCount',
- 'CS_GetClientContributionScore',
- 'CS_SetClientContributionScore',
- 'CS_GetClientAssists',
- 'CS_SetClientAssists',
- 'CS_AliasToWeaponID',
- 'CS_WeaponIDToAlias',
- 'CS_IsValidWeaponID',
- 'CS_UpdateClientModel',
- 'LogToGame',
- 'SetRandomSeed',
- 'GetRandomFloat',
- 'GetRandomInt',
- 'IsMapValid',
- 'IsDedicatedServer',
- 'GetEngineTime',
- 'GetGameTime',
- 'GetGameTickCount',
- 'GetGameDescription',
- 'GetGameFolderName',
- 'GetCurrentMap',
- 'PrecacheModel',
- 'PrecacheSentenceFile',
- 'PrecacheDecal',
- 'PrecacheGeneric',
- 'IsModelPrecached',
- 'IsDecalPrecached',
- 'IsGenericPrecached',
- 'PrecacheSound',
- 'IsSoundPrecached',
- 'CreateDialog',
- 'GetEngineVersion',
- 'PrintToChat',
- 'PrintToChatAll',
- 'PrintCenterText',
- 'PrintCenterTextAll',
- 'PrintHintText',
- 'PrintHintTextToAll',
- 'ShowVGUIPanel',
- 'CreateHudSynchronizer',
- 'SetHudTextParams',
- 'SetHudTextParamsEx',
- 'ShowSyncHudText',
- 'ClearSyncHud',
- 'ShowHudText',
- 'ShowMOTDPanel',
- 'DisplayAskConnectBox',
- 'EntIndexToEntRef',
- 'EntRefToEntIndex',
- 'MakeCompatEntRef',
- 'SetClientViewEntity',
- 'SetLightStyle',
- 'GetClientEyePosition',
- 'CreateDataPack',
- 'WritePackCell',
- 'WritePackFloat',
- 'WritePackString',
- 'ReadPackCell',
- 'ReadPackFloat',
- 'ReadPackString',
- 'ResetPack',
- 'GetPackPosition',
- 'SetPackPosition',
- 'IsPackReadable',
- 'LogMessage',
- 'LogToFile',
- 'LogToFileEx',
- 'LogAction',
- 'LogError',
- 'OnLogAction',
- 'GameLogHook',
- 'AddGameLogHook',
- 'RemoveGameLogHook',
- 'FindTeamByName',
- 'StartPrepSDKCall',
- 'PrepSDKCall_SetVirtual',
- 'PrepSDKCall_SetSignature',
- 'PrepSDKCall_SetAddress',
- 'PrepSDKCall_SetFromConf',
- 'PrepSDKCall_SetReturnInfo',
- 'PrepSDKCall_AddParameter',
- 'EndPrepSDKCall',
- 'SDKCall',
- 'GetPlayerResourceEntity',
-)
-
-
-if __name__ == '__main__': # pragma: no cover
- import re
- import sys
- try:
- from urllib import FancyURLopener
- except ImportError:
- from urllib.request import FancyURLopener
-
- from pygments.util import format_lines
-
- # urllib ends up wanting to import a module called 'math' -- if
- # pygments/lexers is in the path, this ends badly.
- for i in range(len(sys.path)-1, -1, -1):
- if sys.path[i].endswith('/lexers'):
- del sys.path[i]
-
- class Opener(FancyURLopener):
- version = 'Mozilla/5.0 (Pygments Sourcemod Builtins Update)'
-
- opener = Opener()
-
- def get_version():
- f = opener.open('http://docs.sourcemod.net/api/index.php')
- r = re.compile(r'SourceMod v\.<b>([\d\.]+(?:-\w+)?)</td>')
- for line in f:
- m = r.search(line)
- if m is not None:
- return m.groups()[0]
- raise ValueError('No version in api docs')
-
- def get_sm_functions():
- f = opener.open('http://docs.sourcemod.net/api/SMfuncs.js')
- r = re.compile(r'SMfunctions\[\d+\] = Array \("(?:public )?([^,]+)",".+"\);')
- functions = []
- for line in f:
- m = r.match(line)
- if m is not None:
- functions.append(m.groups()[0])
- return functions
-
- def regenerate(filename, natives):
- with open(filename) as fp:
- content = fp.read()
-
- header = content[:content.find('FUNCTIONS = (')]
- footer = content[content.find("if __name__ == '__main__':")-1:]
-
-
- with open(filename, 'w') as fp:
- fp.write(header)
- fp.write(format_lines('FUNCTIONS', natives))
- fp.write(footer)
-
- def run():
- version = get_version()
- print('> Downloading function index for SourceMod %s' % version)
- functions = get_sm_functions()
- print('> %d functions found:' % len(functions))
-
- functionlist = []
- for full_function_name in functions:
- print('>> %s' % full_function_name)
- functionlist.append(full_function_name)
-
- regenerate(__file__, functionlist)
-
-
- run()
diff --git a/pygments/lexers/_stan_builtins.py b/pygments/lexers/_stan_builtins.py
deleted file mode 100644
index e95f5b1e..00000000
--- a/pygments/lexers/_stan_builtins.py
+++ /dev/null
@@ -1,558 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._stan_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This file contains the names of functions for Stan used by
- ``pygments.lexers.math.StanLexer. This is for Stan language version 2.17.0.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-KEYWORDS = (
- 'break',
- 'continue',
- 'else',
- 'for',
- 'if',
- 'in',
- 'print',
- 'reject',
- 'return',
- 'while',
-)
-
-TYPES = (
- 'cholesky_factor_corr',
- 'cholesky_factor_cov',
- 'corr_matrix',
- 'cov_matrix',
- 'int',
- 'matrix',
- 'ordered',
- 'positive_ordered',
- 'real',
- 'row_vector',
- 'simplex',
- 'unit_vector',
- 'vector',
- 'void',
-)
-
-FUNCTIONS = (
- 'abs',
- 'acos',
- 'acosh',
- 'algebra_solver',
- 'append_array',
- 'append_col',
- 'append_row',
- 'asin',
- 'asinh',
- 'atan',
- 'atan2',
- 'atanh',
- 'bernoulli_cdf',
- 'bernoulli_lccdf',
- 'bernoulli_lcdf',
- 'bernoulli_logit_lpmf',
- 'bernoulli_logit_rng',
- 'bernoulli_lpmf',
- 'bernoulli_rng',
- 'bessel_first_kind',
- 'bessel_second_kind',
- 'beta_binomial_cdf',
- 'beta_binomial_lccdf',
- 'beta_binomial_lcdf',
- 'beta_binomial_lpmf',
- 'beta_binomial_rng',
- 'beta_cdf',
- 'beta_lccdf',
- 'beta_lcdf',
- 'beta_lpdf',
- 'beta_rng',
- 'binary_log_loss',
- 'binomial_cdf',
- 'binomial_coefficient_log',
- 'binomial_lccdf',
- 'binomial_lcdf',
- 'binomial_logit_lpmf',
- 'binomial_lpmf',
- 'binomial_rng',
- 'block',
- 'categorical_logit_lpmf',
- 'categorical_logit_rng',
- 'categorical_lpmf',
- 'categorical_rng',
- 'cauchy_cdf',
- 'cauchy_lccdf',
- 'cauchy_lcdf',
- 'cauchy_lpdf',
- 'cauchy_rng',
- 'cbrt',
- 'ceil',
- 'chi_square_cdf',
- 'chi_square_lccdf',
- 'chi_square_lcdf',
- 'chi_square_lpdf',
- 'chi_square_rng',
- 'cholesky_decompose',
- 'choose',
- 'col',
- 'cols',
- 'columns_dot_product',
- 'columns_dot_self',
- 'cos',
- 'cosh',
- 'cov_exp_quad',
- 'crossprod',
- 'csr_extract_u',
- 'csr_extract_v',
- 'csr_extract_w',
- 'csr_matrix_times_vector',
- 'csr_to_dense_matrix',
- 'cumulative_sum',
- 'determinant',
- 'diag_matrix',
- 'diag_post_multiply',
- 'diag_pre_multiply',
- 'diagonal',
- 'digamma',
- 'dims',
- 'dirichlet_lpdf',
- 'dirichlet_rng',
- 'distance',
- 'dot_product',
- 'dot_self',
- 'double_exponential_cdf',
- 'double_exponential_lccdf',
- 'double_exponential_lcdf',
- 'double_exponential_lpdf',
- 'double_exponential_rng',
- 'e',
- 'eigenvalues_sym',
- 'eigenvectors_sym',
- 'erf',
- 'erfc',
- 'exp',
- 'exp2',
- 'exp_mod_normal_cdf',
- 'exp_mod_normal_lccdf',
- 'exp_mod_normal_lcdf',
- 'exp_mod_normal_lpdf',
- 'exp_mod_normal_rng',
- 'expm1',
- 'exponential_cdf',
- 'exponential_lccdf',
- 'exponential_lcdf',
- 'exponential_lpdf',
- 'exponential_rng',
- 'fabs',
- 'falling_factorial',
- 'fdim',
- 'floor',
- 'fma',
- 'fmax',
- 'fmin',
- 'fmod',
- 'frechet_cdf',
- 'frechet_lccdf',
- 'frechet_lcdf',
- 'frechet_lpdf',
- 'frechet_rng',
- 'gamma_cdf',
- 'gamma_lccdf',
- 'gamma_lcdf',
- 'gamma_lpdf',
- 'gamma_p',
- 'gamma_q',
- 'gamma_rng',
- 'gaussian_dlm_obs_lpdf',
- 'get_lp',
- 'gumbel_cdf',
- 'gumbel_lccdf',
- 'gumbel_lcdf',
- 'gumbel_lpdf',
- 'gumbel_rng',
- 'head',
- 'hypergeometric_lpmf',
- 'hypergeometric_rng',
- 'hypot',
- 'inc_beta',
- 'int_step',
- 'integrate_ode',
- 'integrate_ode_bdf',
- 'integrate_ode_rk45',
- 'inv',
- 'inv_chi_square_cdf',
- 'inv_chi_square_lccdf',
- 'inv_chi_square_lcdf',
- 'inv_chi_square_lpdf',
- 'inv_chi_square_rng',
- 'inv_cloglog',
- 'inv_gamma_cdf',
- 'inv_gamma_lccdf',
- 'inv_gamma_lcdf',
- 'inv_gamma_lpdf',
- 'inv_gamma_rng',
- 'inv_logit',
- 'inv_Phi',
- 'inv_sqrt',
- 'inv_square',
- 'inv_wishart_lpdf',
- 'inv_wishart_rng',
- 'inverse',
- 'inverse_spd',
- 'is_inf',
- 'is_nan',
- 'lbeta',
- 'lchoose',
- 'lgamma',
- 'lkj_corr_cholesky_lpdf',
- 'lkj_corr_cholesky_rng',
- 'lkj_corr_lpdf',
- 'lkj_corr_rng',
- 'lmgamma',
- 'lmultiply',
- 'log',
- 'log10',
- 'log1m',
- 'log1m_exp',
- 'log1m_inv_logit',
- 'log1p',
- 'log1p_exp',
- 'log2',
- 'log_determinant',
- 'log_diff_exp',
- 'log_falling_factorial',
- 'log_inv_logit',
- 'log_mix',
- 'log_rising_factorial',
- 'log_softmax',
- 'log_sum_exp',
- 'logistic_cdf',
- 'logistic_lccdf',
- 'logistic_lcdf',
- 'logistic_lpdf',
- 'logistic_rng',
- 'logit',
- 'lognormal_cdf',
- 'lognormal_lccdf',
- 'lognormal_lcdf',
- 'lognormal_lpdf',
- 'lognormal_rng',
- 'machine_precision',
- 'matrix_exp',
- 'max',
- 'mdivide_left_spd',
- 'mdivide_left_tri_low',
- 'mdivide_right_spd',
- 'mdivide_right_tri_low',
- 'mean',
- 'min',
- 'modified_bessel_first_kind',
- 'modified_bessel_second_kind',
- 'multi_gp_cholesky_lpdf',
- 'multi_gp_lpdf',
- 'multi_normal_cholesky_lpdf',
- 'multi_normal_cholesky_rng',
- 'multi_normal_lpdf',
- 'multi_normal_prec_lpdf',
- 'multi_normal_rng',
- 'multi_student_t_lpdf',
- 'multi_student_t_rng',
- 'multinomial_lpmf',
- 'multinomial_rng',
- 'multiply_log',
- 'multiply_lower_tri_self_transpose',
- 'neg_binomial_2_cdf',
- 'neg_binomial_2_lccdf',
- 'neg_binomial_2_lcdf',
- 'neg_binomial_2_log_lpmf',
- 'neg_binomial_2_log_rng',
- 'neg_binomial_2_lpmf',
- 'neg_binomial_2_rng',
- 'neg_binomial_cdf',
- 'neg_binomial_lccdf',
- 'neg_binomial_lcdf',
- 'neg_binomial_lpmf',
- 'neg_binomial_rng',
- 'negative_infinity',
- 'normal_cdf',
- 'normal_lccdf',
- 'normal_lcdf',
- 'normal_lpdf',
- 'normal_rng',
- 'not_a_number',
- 'num_elements',
- 'ordered_logistic_lpmf',
- 'ordered_logistic_rng',
- 'owens_t',
- 'pareto_cdf',
- 'pareto_lccdf',
- 'pareto_lcdf',
- 'pareto_lpdf',
- 'pareto_rng',
- 'pareto_type_2_cdf',
- 'pareto_type_2_lccdf',
- 'pareto_type_2_lcdf',
- 'pareto_type_2_lpdf',
- 'pareto_type_2_rng',
- 'Phi',
- 'Phi_approx',
- 'pi',
- 'poisson_cdf',
- 'poisson_lccdf',
- 'poisson_lcdf',
- 'poisson_log_lpmf',
- 'poisson_log_rng',
- 'poisson_lpmf',
- 'poisson_rng',
- 'positive_infinity',
- 'pow',
- 'print',
- 'prod',
- 'qr_Q',
- 'qr_R',
- 'quad_form',
- 'quad_form_diag',
- 'quad_form_sym',
- 'rank',
- 'rayleigh_cdf',
- 'rayleigh_lccdf',
- 'rayleigh_lcdf',
- 'rayleigh_lpdf',
- 'rayleigh_rng',
- 'reject',
- 'rep_array',
- 'rep_matrix',
- 'rep_row_vector',
- 'rep_vector',
- 'rising_factorial',
- 'round',
- 'row',
- 'rows',
- 'rows_dot_product',
- 'rows_dot_self',
- 'scaled_inv_chi_square_cdf',
- 'scaled_inv_chi_square_lccdf',
- 'scaled_inv_chi_square_lcdf',
- 'scaled_inv_chi_square_lpdf',
- 'scaled_inv_chi_square_rng',
- 'sd',
- 'segment',
- 'sin',
- 'singular_values',
- 'sinh',
- 'size',
- 'skew_normal_cdf',
- 'skew_normal_lccdf',
- 'skew_normal_lcdf',
- 'skew_normal_lpdf',
- 'skew_normal_rng',
- 'softmax',
- 'sort_asc',
- 'sort_desc',
- 'sort_indices_asc',
- 'sort_indices_desc',
- 'sqrt',
- 'sqrt2',
- 'square',
- 'squared_distance',
- 'step',
- 'student_t_cdf',
- 'student_t_lccdf',
- 'student_t_lcdf',
- 'student_t_lpdf',
- 'student_t_rng',
- 'sub_col',
- 'sub_row',
- 'sum',
- 'tail',
- 'tan',
- 'tanh',
- 'target',
- 'tcrossprod',
- 'tgamma',
- 'to_array_1d',
- 'to_array_2d',
- 'to_matrix',
- 'to_row_vector',
- 'to_vector',
- 'trace',
- 'trace_gen_quad_form',
- 'trace_quad_form',
- 'trigamma',
- 'trunc',
- 'uniform_cdf',
- 'uniform_lccdf',
- 'uniform_lcdf',
- 'uniform_lpdf',
- 'uniform_rng',
- 'variance',
- 'von_mises_lpdf',
- 'von_mises_rng',
- 'weibull_cdf',
- 'weibull_lccdf',
- 'weibull_lcdf',
- 'weibull_lpdf',
- 'weibull_rng',
- 'wiener_lpdf',
- 'wishart_lpdf',
- 'wishart_rng',
-)
-
-DISTRIBUTIONS = (
- 'bernoulli',
- 'bernoulli_logit',
- 'beta',
- 'beta_binomial',
- 'binomial',
- 'binomial_logit',
- 'categorical',
- 'categorical_logit',
- 'cauchy',
- 'chi_square',
- 'dirichlet',
- 'double_exponential',
- 'exp_mod_normal',
- 'exponential',
- 'frechet',
- 'gamma',
- 'gaussian_dlm_obs',
- 'gumbel',
- 'hypergeometric',
- 'inv_chi_square',
- 'inv_gamma',
- 'inv_wishart',
- 'lkj_corr',
- 'lkj_corr_cholesky',
- 'logistic',
- 'lognormal',
- 'multi_gp',
- 'multi_gp_cholesky',
- 'multi_normal',
- 'multi_normal_cholesky',
- 'multi_normal_prec',
- 'multi_student_t',
- 'multinomial',
- 'neg_binomial',
- 'neg_binomial_2',
- 'neg_binomial_2_log',
- 'normal',
- 'ordered_logistic',
- 'pareto',
- 'pareto_type_2',
- 'poisson',
- 'poisson_log',
- 'rayleigh',
- 'scaled_inv_chi_square',
- 'skew_normal',
- 'student_t',
- 'uniform',
- 'von_mises',
- 'weibull',
- 'wiener',
- 'wishart',
-)
-
-RESERVED = (
- 'alignas',
- 'alignof',
- 'and',
- 'and_eq',
- 'asm',
- 'auto',
- 'bitand',
- 'bitor',
- 'bool',
- 'break',
- 'case',
- 'catch',
- 'char',
- 'char16_t',
- 'char32_t',
- 'class',
- 'compl',
- 'const',
- 'const_cast',
- 'constexpr',
- 'continue',
- 'decltype',
- 'default',
- 'delete',
- 'do',
- 'double',
- 'dynamic_cast',
- 'else',
- 'enum',
- 'explicit',
- 'export',
- 'extern',
- 'false',
- 'float',
- 'for',
- 'friend',
- 'fvar',
- 'goto',
- 'if',
- 'in',
- 'inline',
- 'int',
- 'long',
- 'lp__',
- 'mutable',
- 'namespace',
- 'new',
- 'noexcept',
- 'not',
- 'not_eq',
- 'nullptr',
- 'operator',
- 'or',
- 'or_eq',
- 'private',
- 'protected',
- 'public',
- 'register',
- 'reinterpret_cast',
- 'repeat',
- 'return',
- 'short',
- 'signed',
- 'sizeof',
- 'STAN_MAJOR',
- 'STAN_MATH_MAJOR',
- 'STAN_MATH_MINOR',
- 'STAN_MATH_PATCH',
- 'STAN_MINOR',
- 'STAN_PATCH',
- 'static',
- 'static_assert',
- 'static_cast',
- 'struct',
- 'switch',
- 'template',
- 'then',
- 'this',
- 'thread_local',
- 'throw',
- 'true',
- 'try',
- 'typedef',
- 'typeid',
- 'typename',
- 'union',
- 'unsigned',
- 'until',
- 'using',
- 'var',
- 'virtual',
- 'void',
- 'volatile',
- 'wchar_t',
- 'while',
- 'xor',
- 'xor_eq',
-)
diff --git a/pygments/lexers/_stata_builtins.py b/pygments/lexers/_stata_builtins.py
deleted file mode 100644
index 3f4abdcb..00000000
--- a/pygments/lexers/_stata_builtins.py
+++ /dev/null
@@ -1,421 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._stata_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Builtins for Stata
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-
-builtins_special = (
- "if", "in", "using", "replace", "by", "gen", "generate"
-)
-
-builtins_base = (
- "if", "else", "in", "foreach", "for", "forv", "forva",
- "forval", "forvalu", "forvalue", "forvalues", "by", "bys",
- "bysort", "quietly", "qui", "about", "ac",
- "ac_7", "acprplot", "acprplot_7", "adjust", "ado", "adopath",
- "adoupdate", "alpha", "ameans", "an", "ano", "anov", "anova",
- "anova_estat", "anova_terms", "anovadef", "aorder", "ap", "app",
- "appe", "appen", "append", "arch", "arch_dr", "arch_estat",
- "arch_p", "archlm", "areg", "areg_p", "args", "arima",
- "arima_dr", "arima_estat", "arima_p", "as", "asmprobit",
- "asmprobit_estat", "asmprobit_lf", "asmprobit_mfx__dlg",
- "asmprobit_p", "ass", "asse", "asser", "assert", "avplot",
- "avplot_7", "avplots", "avplots_7", "bcskew0", "bgodfrey",
- "binreg", "bip0_lf", "biplot", "bipp_lf", "bipr_lf",
- "bipr_p", "biprobit", "bitest", "bitesti", "bitowt", "blogit",
- "bmemsize", "boot", "bootsamp", "bootstrap", "bootstrap_8",
- "boxco_l", "boxco_p", "boxcox", "boxcox_6", "boxcox_p",
- "bprobit", "br", "break", "brier", "bro", "brow", "brows",
- "browse", "brr", "brrstat", "bs", "bs_7", "bsampl_w",
- "bsample", "bsample_7", "bsqreg", "bstat", "bstat_7", "bstat_8",
- "bstrap", "bstrap_7", "ca", "ca_estat", "ca_p", "cabiplot",
- "camat", "canon", "canon_8", "canon_8_p", "canon_estat",
- "canon_p", "cap", "caprojection", "capt", "captu", "captur",
- "capture", "cat", "cc", "cchart", "cchart_7", "cci",
- "cd", "censobs_table", "centile", "cf", "char", "chdir",
- "checkdlgfiles", "checkestimationsample", "checkhlpfiles",
- "checksum", "chelp", "ci", "cii", "cl", "class", "classutil",
- "clear", "cli", "clis", "clist", "clo", "clog", "clog_lf",
- "clog_p", "clogi", "clogi_sw", "clogit", "clogit_lf",
- "clogit_p", "clogitp", "clogl_sw", "cloglog", "clonevar",
- "clslistarray", "cluster", "cluster_measures", "cluster_stop",
- "cluster_tree", "cluster_tree_8", "clustermat", "cmdlog",
- "cnr", "cnre", "cnreg", "cnreg_p", "cnreg_sw", "cnsreg",
- "codebook", "collaps4", "collapse", "colormult_nb",
- "colormult_nw", "compare", "compress", "conf", "confi",
- "confir", "confirm", "conren", "cons", "const", "constr",
- "constra", "constrai", "constrain", "constraint", "continue",
- "contract", "copy", "copyright", "copysource", "cor", "corc",
- "corr", "corr2data", "corr_anti", "corr_kmo", "corr_smc",
- "corre", "correl", "correla", "correlat", "correlate",
- "corrgram", "cou", "coun", "count", "cox", "cox_p", "cox_sw",
- "coxbase", "coxhaz", "coxvar", "cprplot", "cprplot_7",
- "crc", "cret", "cretu", "cretur", "creturn", "cross", "cs",
- "cscript", "cscript_log", "csi", "ct", "ct_is", "ctset",
- "ctst_5", "ctst_st", "cttost", "cumsp", "cumsp_7", "cumul",
- "cusum", "cusum_7", "cutil", "d", "datasig", "datasign",
- "datasigna", "datasignat", "datasignatu", "datasignatur",
- "datasignature", "datetof", "db", "dbeta", "de", "dec",
- "deco", "decod", "decode", "deff", "des", "desc", "descr",
- "descri", "describ", "describe", "destring", "dfbeta",
- "dfgls", "dfuller", "di", "di_g", "dir", "dirstats", "dis",
- "discard", "disp", "disp_res", "disp_s", "displ", "displa",
- "display", "distinct", "do", "doe", "doed", "doedi",
- "doedit", "dotplot", "dotplot_7", "dprobit", "drawnorm",
- "drop", "ds", "ds_util", "dstdize", "duplicates", "durbina",
- "dwstat", "dydx", "e", "ed", "edi", "edit", "egen",
- "eivreg", "emdef", "end", "en", "enc", "enco", "encod", "encode",
- "eq", "erase", "ereg", "ereg_lf", "ereg_p", "ereg_sw",
- "ereghet", "ereghet_glf", "ereghet_glf_sh", "ereghet_gp",
- "ereghet_ilf", "ereghet_ilf_sh", "ereghet_ip", "eret",
- "eretu", "eretur", "ereturn", "err", "erro", "error", "est",
- "est_cfexist", "est_cfname", "est_clickable", "est_expand",
- "est_hold", "est_table", "est_unhold", "est_unholdok",
- "estat", "estat_default", "estat_summ", "estat_vce_only",
- "esti", "estimates", "etodow", "etof", "etomdy", "ex",
- "exi", "exit", "expand", "expandcl", "fac", "fact", "facto",
- "factor", "factor_estat", "factor_p", "factor_pca_rotated",
- "factor_rotate", "factormat", "fcast", "fcast_compute",
- "fcast_graph", "fdades", "fdadesc", "fdadescr", "fdadescri",
- "fdadescrib", "fdadescribe", "fdasav", "fdasave", "fdause",
- "fh_st", "open", "read", "close",
- "file", "filefilter", "fillin", "find_hlp_file", "findfile",
- "findit", "findit_7", "fit", "fl", "fli", "flis", "flist",
- "for5_0", "form", "forma", "format", "fpredict", "frac_154",
- "frac_adj", "frac_chk", "frac_cox", "frac_ddp", "frac_dis",
- "frac_dv", "frac_in", "frac_mun", "frac_pp", "frac_pq",
- "frac_pv", "frac_wgt", "frac_xo", "fracgen", "fracplot",
- "fracplot_7", "fracpoly", "fracpred", "fron_ex", "fron_hn",
- "fron_p", "fron_tn", "fron_tn2", "frontier", "ftodate", "ftoe",
- "ftomdy", "ftowdate", "g", "gamhet_glf", "gamhet_gp",
- "gamhet_ilf", "gamhet_ip", "gamma", "gamma_d2", "gamma_p",
- "gamma_sw", "gammahet", "gdi_hexagon", "gdi_spokes", "ge",
- "gen", "gene", "gener", "genera", "generat", "generate",
- "genrank", "genstd", "genvmean", "gettoken", "gl", "gladder",
- "gladder_7", "glim_l01", "glim_l02", "glim_l03", "glim_l04",
- "glim_l05", "glim_l06", "glim_l07", "glim_l08", "glim_l09",
- "glim_l10", "glim_l11", "glim_l12", "glim_lf", "glim_mu",
- "glim_nw1", "glim_nw2", "glim_nw3", "glim_p", "glim_v1",
- "glim_v2", "glim_v3", "glim_v4", "glim_v5", "glim_v6",
- "glim_v7", "glm", "glm_6", "glm_p", "glm_sw", "glmpred", "glo",
- "glob", "globa", "global", "glogit", "glogit_8", "glogit_p",
- "gmeans", "gnbre_lf", "gnbreg", "gnbreg_5", "gnbreg_p",
- "gomp_lf", "gompe_sw", "gomper_p", "gompertz", "gompertzhet",
- "gomphet_glf", "gomphet_glf_sh", "gomphet_gp", "gomphet_ilf",
- "gomphet_ilf_sh", "gomphet_ip", "gphdot", "gphpen",
- "gphprint", "gprefs", "gprobi_p", "gprobit", "gprobit_8", "gr",
- "gr7", "gr_copy", "gr_current", "gr_db", "gr_describe",
- "gr_dir", "gr_draw", "gr_draw_replay", "gr_drop", "gr_edit",
- "gr_editviewopts", "gr_example", "gr_example2", "gr_export",
- "gr_print", "gr_qscheme", "gr_query", "gr_read", "gr_rename",
- "gr_replay", "gr_save", "gr_set", "gr_setscheme", "gr_table",
- "gr_undo", "gr_use", "graph", "graph7", "grebar", "greigen",
- "greigen_7", "greigen_8", "grmeanby", "grmeanby_7",
- "gs_fileinfo", "gs_filetype", "gs_graphinfo", "gs_stat",
- "gsort", "gwood", "h", "hadimvo", "hareg", "hausman",
- "haver", "he", "heck_d2", "heckma_p", "heckman", "heckp_lf",
- "heckpr_p", "heckprob", "hel", "help", "hereg", "hetpr_lf",
- "hetpr_p", "hetprob", "hettest", "hexdump", "hilite",
- "hist", "hist_7", "histogram", "hlogit", "hlu", "hmeans",
- "hotel", "hotelling", "hprobit", "hreg", "hsearch", "icd9",
- "icd9_ff", "icd9p", "iis", "impute", "imtest", "inbase",
- "include", "inf", "infi", "infil", "infile", "infix", "inp",
- "inpu", "input", "ins", "insheet", "insp", "inspe",
- "inspec", "inspect", "integ", "inten", "intreg", "intreg_7",
- "intreg_p", "intrg2_ll", "intrg_ll", "intrg_ll2", "ipolate",
- "iqreg", "ir", "irf", "irf_create", "irfm", "iri", "is_svy",
- "is_svysum", "isid", "istdize", "ivprob_1_lf", "ivprob_lf",
- "ivprobit", "ivprobit_p", "ivreg", "ivreg_footnote",
- "ivtob_1_lf", "ivtob_lf", "ivtobit", "ivtobit_p", "jackknife",
- "jacknife", "jknife", "jknife_6", "jknife_8", "jkstat",
- "joinby", "kalarma1", "kap", "kap_3", "kapmeier", "kappa",
- "kapwgt", "kdensity", "kdensity_7", "keep", "ksm", "ksmirnov",
- "ktau", "kwallis", "l", "la", "lab", "labe", "label",
- "labelbook", "ladder", "levels", "levelsof", "leverage",
- "lfit", "lfit_p", "li", "lincom", "line", "linktest",
- "lis", "list", "lloghet_glf", "lloghet_glf_sh", "lloghet_gp",
- "lloghet_ilf", "lloghet_ilf_sh", "lloghet_ip", "llogi_sw",
- "llogis_p", "llogist", "llogistic", "llogistichet",
- "lnorm_lf", "lnorm_sw", "lnorma_p", "lnormal", "lnormalhet",
- "lnormhet_glf", "lnormhet_glf_sh", "lnormhet_gp",
- "lnormhet_ilf", "lnormhet_ilf_sh", "lnormhet_ip", "lnskew0",
- "loadingplot", "loc", "loca", "local", "log", "logi",
- "logis_lf", "logistic", "logistic_p", "logit", "logit_estat",
- "logit_p", "loglogs", "logrank", "loneway", "lookfor",
- "lookup", "lowess", "lowess_7", "lpredict", "lrecomp", "lroc",
- "lroc_7", "lrtest", "ls", "lsens", "lsens_7", "lsens_x",
- "lstat", "ltable", "ltable_7", "ltriang", "lv", "lvr2plot",
- "lvr2plot_7", "m", "ma", "mac", "macr", "macro", "makecns",
- "man", "manova", "manova_estat", "manova_p", "manovatest",
- "mantel", "mark", "markin", "markout", "marksample", "mat",
- "mat_capp", "mat_order", "mat_put_rr", "mat_rapp", "mata",
- "mata_clear", "mata_describe", "mata_drop", "mata_matdescribe",
- "mata_matsave", "mata_matuse", "mata_memory", "mata_mlib",
- "mata_mosave", "mata_rename", "mata_which", "matalabel",
- "matcproc", "matlist", "matname", "matr", "matri",
- "matrix", "matrix_input__dlg", "matstrik", "mcc", "mcci",
- "md0_", "md1_", "md1debug_", "md2_", "md2debug_", "mds",
- "mds_estat", "mds_p", "mdsconfig", "mdslong", "mdsmat",
- "mdsshepard", "mdytoe", "mdytof", "me_derd", "mean",
- "means", "median", "memory", "memsize", "meqparse", "mer",
- "merg", "merge", "mfp", "mfx", "mhelp", "mhodds", "minbound",
- "mixed_ll", "mixed_ll_reparm", "mkassert", "mkdir",
- "mkmat", "mkspline", "ml", "ml_5", "ml_adjs", "ml_bhhhs",
- "ml_c_d", "ml_check", "ml_clear", "ml_cnt", "ml_debug",
- "ml_defd", "ml_e0", "ml_e0_bfgs", "ml_e0_cycle", "ml_e0_dfp",
- "ml_e0i", "ml_e1", "ml_e1_bfgs", "ml_e1_bhhh", "ml_e1_cycle",
- "ml_e1_dfp", "ml_e2", "ml_e2_cycle", "ml_ebfg0", "ml_ebfr0",
- "ml_ebfr1", "ml_ebh0q", "ml_ebhh0", "ml_ebhr0", "ml_ebr0i",
- "ml_ecr0i", "ml_edfp0", "ml_edfr0", "ml_edfr1", "ml_edr0i",
- "ml_eds", "ml_eer0i", "ml_egr0i", "ml_elf", "ml_elf_bfgs",
- "ml_elf_bhhh", "ml_elf_cycle", "ml_elf_dfp", "ml_elfi",
- "ml_elfs", "ml_enr0i", "ml_enrr0", "ml_erdu0", "ml_erdu0_bfgs",
- "ml_erdu0_bhhh", "ml_erdu0_bhhhq", "ml_erdu0_cycle",
- "ml_erdu0_dfp", "ml_erdu0_nrbfgs", "ml_exde", "ml_footnote",
- "ml_geqnr", "ml_grad0", "ml_graph", "ml_hbhhh", "ml_hd0",
- "ml_hold", "ml_init", "ml_inv", "ml_log", "ml_max",
- "ml_mlout", "ml_mlout_8", "ml_model", "ml_nb0", "ml_opt",
- "ml_p", "ml_plot", "ml_query", "ml_rdgrd", "ml_repor",
- "ml_s_e", "ml_score", "ml_searc", "ml_technique", "ml_unhold",
- "mleval", "mlf_", "mlmatbysum", "mlmatsum", "mlog", "mlogi",
- "mlogit", "mlogit_footnote", "mlogit_p", "mlopts", "mlsum",
- "mlvecsum", "mnl0_", "mor", "more", "mov", "move", "mprobit",
- "mprobit_lf", "mprobit_p", "mrdu0_", "mrdu1_", "mvdecode",
- "mvencode", "mvreg", "mvreg_estat", "n", "nbreg",
- "nbreg_al", "nbreg_lf", "nbreg_p", "nbreg_sw", "nestreg", "net",
- "newey", "newey_7", "newey_p", "news", "nl", "nl_7", "nl_9",
- "nl_9_p", "nl_p", "nl_p_7", "nlcom", "nlcom_p", "nlexp2",
- "nlexp2_7", "nlexp2a", "nlexp2a_7", "nlexp3", "nlexp3_7",
- "nlgom3", "nlgom3_7", "nlgom4", "nlgom4_7", "nlinit", "nllog3",
- "nllog3_7", "nllog4", "nllog4_7", "nlog_rd", "nlogit",
- "nlogit_p", "nlogitgen", "nlogittree", "nlpred", "no",
- "nobreak", "noi", "nois", "noisi", "noisil", "noisily", "note",
- "notes", "notes_dlg", "nptrend", "numlabel", "numlist", "odbc",
- "old_ver", "olo", "olog", "ologi", "ologi_sw", "ologit",
- "ologit_p", "ologitp", "on", "one", "onew", "onewa", "oneway",
- "op_colnm", "op_comp", "op_diff", "op_inv", "op_str", "opr",
- "opro", "oprob", "oprob_sw", "oprobi", "oprobi_p", "oprobit",
- "oprobitp", "opts_exclusive", "order", "orthog", "orthpoly",
- "ou", "out", "outf", "outfi", "outfil", "outfile", "outs",
- "outsh", "outshe", "outshee", "outsheet", "ovtest", "pac",
- "pac_7", "palette", "parse", "parse_dissim", "pause", "pca",
- "pca_8", "pca_display", "pca_estat", "pca_p", "pca_rotate",
- "pcamat", "pchart", "pchart_7", "pchi", "pchi_7", "pcorr",
- "pctile", "pentium", "pergram", "pergram_7", "permute",
- "permute_8", "personal", "peto_st", "pkcollapse", "pkcross",
- "pkequiv", "pkexamine", "pkexamine_7", "pkshape", "pksumm",
- "pksumm_7", "pl", "plo", "plot", "plugin", "pnorm",
- "pnorm_7", "poisgof", "poiss_lf", "poiss_sw", "poisso_p",
- "poisson", "poisson_estat", "post", "postclose", "postfile",
- "postutil", "pperron", "pr", "prais", "prais_e", "prais_e2",
- "prais_p", "predict", "predictnl", "preserve", "print",
- "pro", "prob", "probi", "probit", "probit_estat", "probit_p",
- "proc_time", "procoverlay", "procrustes", "procrustes_estat",
- "procrustes_p", "profiler", "prog", "progr", "progra",
- "program", "prop", "proportion", "prtest", "prtesti", "pwcorr",
- "pwd", "q", "s", "qby", "qbys", "qchi", "qchi_7", "qladder",
- "qladder_7", "qnorm", "qnorm_7", "qqplot", "qqplot_7", "qreg",
- "qreg_c", "qreg_p", "qreg_sw", "qu", "quadchk", "quantile",
- "quantile_7", "que", "quer", "query", "range", "ranksum",
- "ratio", "rchart", "rchart_7", "rcof", "recast", "reclink",
- "recode", "reg", "reg3", "reg3_p", "regdw", "regr", "regre",
- "regre_p2", "regres", "regres_p", "regress", "regress_estat",
- "regriv_p", "remap", "ren", "rena", "renam", "rename",
- "renpfix", "repeat", "replace", "report", "reshape",
- "restore", "ret", "retu", "retur", "return", "rm", "rmdir",
- "robvar", "roccomp", "roccomp_7", "roccomp_8", "rocf_lf",
- "rocfit", "rocfit_8", "rocgold", "rocplot", "rocplot_7",
- "roctab", "roctab_7", "rolling", "rologit", "rologit_p",
- "rot", "rota", "rotat", "rotate", "rotatemat", "rreg",
- "rreg_p", "ru", "run", "runtest", "rvfplot", "rvfplot_7",
- "rvpplot", "rvpplot_7", "sa", "safesum", "sample",
- "sampsi", "sav", "save", "savedresults", "saveold", "sc",
- "sca", "scal", "scala", "scalar", "scatter", "scm_mine",
- "sco", "scob_lf", "scob_p", "scobi_sw", "scobit", "scor",
- "score", "scoreplot", "scoreplot_help", "scree", "screeplot",
- "screeplot_help", "sdtest", "sdtesti", "se", "search",
- "separate", "seperate", "serrbar", "serrbar_7", "serset", "set",
- "set_defaults", "sfrancia", "sh", "she", "shel", "shell",
- "shewhart", "shewhart_7", "signestimationsample", "signrank",
- "signtest", "simul", "simul_7", "simulate", "simulate_8",
- "sktest", "sleep", "slogit", "slogit_d2", "slogit_p", "smooth",
- "snapspan", "so", "sor", "sort", "spearman", "spikeplot",
- "spikeplot_7", "spikeplt", "spline_x", "split", "sqreg",
- "sqreg_p", "sret", "sretu", "sretur", "sreturn", "ssc", "st",
- "st_ct", "st_hc", "st_hcd", "st_hcd_sh", "st_is", "st_issys",
- "st_note", "st_promo", "st_set", "st_show", "st_smpl",
- "st_subid", "stack", "statsby", "statsby_8", "stbase", "stci",
- "stci_7", "stcox", "stcox_estat", "stcox_fr", "stcox_fr_ll",
- "stcox_p", "stcox_sw", "stcoxkm", "stcoxkm_7", "stcstat",
- "stcurv", "stcurve", "stcurve_7", "stdes", "stem", "stepwise",
- "stereg", "stfill", "stgen", "stir", "stjoin", "stmc", "stmh",
- "stphplot", "stphplot_7", "stphtest", "stphtest_7",
- "stptime", "strate", "strate_7", "streg", "streg_sw", "streset",
- "sts", "sts_7", "stset", "stsplit", "stsum", "sttocc",
- "sttoct", "stvary", "stweib", "su", "suest", "suest_8",
- "sum", "summ", "summa", "summar", "summari", "summariz",
- "summarize", "sunflower", "sureg", "survcurv", "survsum",
- "svar", "svar_p", "svmat", "svy", "svy_disp", "svy_dreg",
- "svy_est", "svy_est_7", "svy_estat", "svy_get", "svy_gnbreg_p",
- "svy_head", "svy_header", "svy_heckman_p", "svy_heckprob_p",
- "svy_intreg_p", "svy_ivreg_p", "svy_logistic_p", "svy_logit_p",
- "svy_mlogit_p", "svy_nbreg_p", "svy_ologit_p", "svy_oprobit_p",
- "svy_poisson_p", "svy_probit_p", "svy_regress_p", "svy_sub",
- "svy_sub_7", "svy_x", "svy_x_7", "svy_x_p", "svydes",
- "svydes_8", "svygen", "svygnbreg", "svyheckman", "svyheckprob",
- "svyintreg", "svyintreg_7", "svyintrg", "svyivreg", "svylc",
- "svylog_p", "svylogit", "svymarkout", "svymarkout_8",
- "svymean", "svymlog", "svymlogit", "svynbreg", "svyolog",
- "svyologit", "svyoprob", "svyoprobit", "svyopts",
- "svypois", "svypois_7", "svypoisson", "svyprobit", "svyprobt",
- "svyprop", "svyprop_7", "svyratio", "svyreg", "svyreg_p",
- "svyregress", "svyset", "svyset_7", "svyset_8", "svytab",
- "svytab_7", "svytest", "svytotal", "sw", "sw_8", "swcnreg",
- "swcox", "swereg", "swilk", "swlogis", "swlogit",
- "swologit", "swoprbt", "swpois", "swprobit", "swqreg",
- "swtobit", "swweib", "symmetry", "symmi", "symplot",
- "symplot_7", "syntax", "sysdescribe", "sysdir", "sysuse",
- "szroeter", "ta", "tab", "tab1", "tab2", "tab_or", "tabd",
- "tabdi", "tabdis", "tabdisp", "tabi", "table", "tabodds",
- "tabodds_7", "tabstat", "tabu", "tabul", "tabula", "tabulat",
- "tabulate", "te", "tempfile", "tempname", "tempvar", "tes",
- "test", "testnl", "testparm", "teststd", "tetrachoric",
- "time_it", "timer", "tis", "tob", "tobi", "tobit", "tobit_p",
- "tobit_sw", "token", "tokeni", "tokeniz", "tokenize",
- "tostring", "total", "translate", "translator", "transmap",
- "treat_ll", "treatr_p", "treatreg", "trim", "trnb_cons",
- "trnb_mean", "trpoiss_d2", "trunc_ll", "truncr_p", "truncreg",
- "tsappend", "tset", "tsfill", "tsline", "tsline_ex",
- "tsreport", "tsrevar", "tsrline", "tsset", "tssmooth",
- "tsunab", "ttest", "ttesti", "tut_chk", "tut_wait", "tutorial",
- "tw", "tware_st", "two", "twoway", "twoway__fpfit_serset",
- "twoway__function_gen", "twoway__histogram_gen",
- "twoway__ipoint_serset", "twoway__ipoints_serset",
- "twoway__kdensity_gen", "twoway__lfit_serset",
- "twoway__normgen_gen", "twoway__pci_serset",
- "twoway__qfit_serset", "twoway__scatteri_serset",
- "twoway__sunflower_gen", "twoway_ksm_serset", "ty", "typ",
- "type", "typeof", "u", "unab", "unabbrev", "unabcmd",
- "update", "us", "use", "uselabel", "var", "var_mkcompanion",
- "var_p", "varbasic", "varfcast", "vargranger", "varirf",
- "varirf_add", "varirf_cgraph", "varirf_create", "varirf_ctable",
- "varirf_describe", "varirf_dir", "varirf_drop", "varirf_erase",
- "varirf_graph", "varirf_ograph", "varirf_rename", "varirf_set",
- "varirf_table", "varlist", "varlmar", "varnorm", "varsoc",
- "varstable", "varstable_w", "varstable_w2", "varwle",
- "vce", "vec", "vec_fevd", "vec_mkphi", "vec_p", "vec_p_w",
- "vecirf_create", "veclmar", "veclmar_w", "vecnorm",
- "vecnorm_w", "vecrank", "vecstable", "verinst", "vers",
- "versi", "versio", "version", "view", "viewsource", "vif",
- "vwls", "wdatetof", "webdescribe", "webseek", "webuse",
- "weib1_lf", "weib2_lf", "weib_lf", "weib_lf0", "weibhet_glf",
- "weibhet_glf_sh", "weibhet_glfa", "weibhet_glfa_sh",
- "weibhet_gp", "weibhet_ilf", "weibhet_ilf_sh", "weibhet_ilfa",
- "weibhet_ilfa_sh", "weibhet_ip", "weibu_sw", "weibul_p",
- "weibull", "weibull_c", "weibull_s", "weibullhet",
- "wh", "whelp", "whi", "which", "whil", "while", "wilc_st",
- "wilcoxon", "win", "wind", "windo", "window", "winexec",
- "wntestb", "wntestb_7", "wntestq", "xchart", "xchart_7",
- "xcorr", "xcorr_7", "xi", "xi_6", "xmlsav", "xmlsave",
- "xmluse", "xpose", "xsh", "xshe", "xshel", "xshell",
- "xt_iis", "xt_tis", "xtab_p", "xtabond", "xtbin_p",
- "xtclog", "xtcloglog", "xtcloglog_8", "xtcloglog_d2",
- "xtcloglog_pa_p", "xtcloglog_re_p", "xtcnt_p", "xtcorr",
- "xtdata", "xtdes", "xtfront_p", "xtfrontier", "xtgee",
- "xtgee_elink", "xtgee_estat", "xtgee_makeivar", "xtgee_p",
- "xtgee_plink", "xtgls", "xtgls_p", "xthaus", "xthausman",
- "xtht_p", "xthtaylor", "xtile", "xtint_p", "xtintreg",
- "xtintreg_8", "xtintreg_d2", "xtintreg_p", "xtivp_1",
- "xtivp_2", "xtivreg", "xtline", "xtline_ex", "xtlogit",
- "xtlogit_8", "xtlogit_d2", "xtlogit_fe_p", "xtlogit_pa_p",
- "xtlogit_re_p", "xtmixed", "xtmixed_estat", "xtmixed_p",
- "xtnb_fe", "xtnb_lf", "xtnbreg", "xtnbreg_pa_p",
- "xtnbreg_refe_p", "xtpcse", "xtpcse_p", "xtpois", "xtpoisson",
- "xtpoisson_d2", "xtpoisson_pa_p", "xtpoisson_refe_p", "xtpred",
- "xtprobit", "xtprobit_8", "xtprobit_d2", "xtprobit_re_p",
- "xtps_fe", "xtps_lf", "xtps_ren", "xtps_ren_8", "xtrar_p",
- "xtrc", "xtrc_p", "xtrchh", "xtrefe_p", "xtreg", "xtreg_be",
- "xtreg_fe", "xtreg_ml", "xtreg_pa_p", "xtreg_re",
- "xtregar", "xtrere_p", "xtset", "xtsf_ll", "xtsf_llti",
- "xtsum", "xttab", "xttest0", "xttobit", "xttobit_8",
- "xttobit_p", "xttrans", "yx", "yxview__barlike_draw",
- "yxview_area_draw", "yxview_bar_draw", "yxview_dot_draw",
- "yxview_dropline_draw", "yxview_function_draw",
- "yxview_iarrow_draw", "yxview_ilabels_draw",
- "yxview_normal_draw", "yxview_pcarrow_draw",
- "yxview_pcbarrow_draw", "yxview_pccapsym_draw",
- "yxview_pcscatter_draw", "yxview_pcspike_draw",
- "yxview_rarea_draw", "yxview_rbar_draw", "yxview_rbarm_draw",
- "yxview_rcap_draw", "yxview_rcapsym_draw",
- "yxview_rconnected_draw", "yxview_rline_draw",
- "yxview_rscatter_draw", "yxview_rspike_draw",
- "yxview_spike_draw", "yxview_sunflower_draw", "zap_s", "zinb",
- "zinb_llf", "zinb_plf", "zip", "zip_llf", "zip_p", "zip_plf",
- "zt_ct_5", "zt_hc_5", "zt_hcd_5", "zt_is_5", "zt_iss_5",
- "zt_sho_5", "zt_smp_5", "ztbase_5", "ztcox_5", "ztdes_5",
- "ztereg_5", "ztfill_5", "ztgen_5", "ztir_5", "ztjoin_5", "ztnb",
- "ztnb_p", "ztp", "ztp_p", "zts_5", "ztset_5", "ztspli_5",
- "ztsum_5", "zttoct_5", "ztvary_5", "ztweib_5"
-)
-
-builtins_functions = (
- "Cdhms", "Chms", "Clock", "Cmdyhms", "Cofc", "Cofd", "F",
- "Fden", "Ftail", "I", "J", "_caller", "abbrev", "abs", "acos",
- "acosh", "asin", "asinh", "atan", "atan2", "atanh",
- "autocode", "betaden", "binomial", "binomialp", "binomialtail",
- "binormal", "bofd", "byteorder", "c", "ceil", "char",
- "chi2", "chi2den", "chi2tail", "cholesky", "chop", "clip",
- "clock", "cloglog", "cofC", "cofd", "colnumb", "colsof", "comb",
- "cond", "corr", "cos", "cosh", "d", "daily", "date", "day",
- "det", "dgammapda", "dgammapdada", "dgammapdadx", "dgammapdx",
- "dgammapdxdx", "dhms", "diag", "diag0cnt", "digamma",
- "dofC", "dofb", "dofc", "dofh", "dofm", "dofq", "dofw",
- "dofy", "dow", "doy", "dunnettprob", "e", "el", "epsdouble",
- "epsfloat", "exp", "fileexists", "fileread", "filereaderror",
- "filewrite", "float", "floor", "fmtwidth", "gammaden",
- "gammap", "gammaptail", "get", "group", "h", "hadamard",
- "halfyear", "halfyearly", "has_eprop", "hh", "hhC", "hms",
- "hofd", "hours", "hypergeometric", "hypergeometricp", "ibeta",
- "ibetatail", "index", "indexnot", "inlist", "inrange", "int",
- "inv", "invF", "invFtail", "invbinomial", "invbinomialtail",
- "invchi2", "invchi2tail", "invcloglog", "invdunnettprob",
- "invgammap", "invgammaptail", "invibeta", "invibetatail",
- "invlogit", "invnFtail", "invnbinomial", "invnbinomialtail",
- "invnchi2", "invnchi2tail", "invnibeta", "invnorm", "invnormal",
- "invnttail", "invpoisson", "invpoissontail", "invsym", "invt",
- "invttail", "invtukeyprob", "irecode", "issym", "issymmetric",
- "itrim", "length", "ln", "lnfact", "lnfactorial", "lngamma",
- "lnnormal", "lnnormalden", "log", "log10", "logit", "lower",
- "ltrim", "m", "match", "matmissing", "matrix", "matuniform",
- "max", "maxbyte", "maxdouble", "maxfloat", "maxint", "maxlong",
- "mdy", "mdyhms", "mi", "min", "minbyte", "mindouble",
- "minfloat", "minint", "minlong", "minutes", "missing", "mm",
- "mmC", "mod", "mofd", "month", "monthly", "mreldif",
- "msofhours", "msofminutes", "msofseconds", "nF", "nFden",
- "nFtail", "nbetaden", "nbinomial", "nbinomialp", "nbinomialtail",
- "nchi2", "nchi2den", "nchi2tail", "nibeta", "norm", "normal",
- "normalden", "normd", "npnF", "npnchi2", "npnt", "nt", "ntden",
- "nttail", "nullmat", "plural", "poisson", "poissonp",
- "poissontail", "proper", "q", "qofd", "quarter", "quarterly",
- "r", "rbeta", "rbinomial", "rchi2", "real", "recode", "regexm",
- "regexr", "regexs", "reldif", "replay", "return", "reverse",
- "rgamma", "rhypergeometric", "rnbinomial", "rnormal", "round",
- "rownumb", "rowsof", "rpoisson", "rt", "rtrim", "runiform", "s",
- "scalar", "seconds", "sign", "sin", "sinh", "smallestdouble",
- "soundex", "soundex_nara", "sqrt", "ss", "ssC", "strcat",
- "strdup", "string", "strlen", "strlower", "strltrim", "strmatch",
- "strofreal", "strpos", "strproper", "strreverse", "strrtrim",
- "strtoname", "strtrim", "strupper", "subinstr", "subinword",
- "substr", "sum", "sweep", "syminv", "t", "tC", "tan", "tanh",
- "tc", "td", "tden", "th", "tin", "tm", "tq", "trace",
- "trigamma", "trim", "trunc", "ttail", "tukeyprob", "tw",
- "twithin", "uniform", "upper", "vec", "vecdiag", "w", "week",
- "weekly", "wofd", "word", "wordcount", "year", "yearly",
- "yh", "ym", "yofd", "yq", "yw"
-)
diff --git a/pygments/lexers/_tsql_builtins.py b/pygments/lexers/_tsql_builtins.py
deleted file mode 100644
index dfc5f618..00000000
--- a/pygments/lexers/_tsql_builtins.py
+++ /dev/null
@@ -1,1004 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._tsql_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- These are manually translated lists from https://msdn.microsoft.com.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# See https://msdn.microsoft.com/en-us/library/ms174986.aspx.
-OPERATORS = (
- '!<',
- '!=',
- '!>',
- '<',
- '<=',
- '<>',
- '=',
- '>',
- '>=',
- '+',
- '+=',
- '-',
- '-=',
- '*',
- '*=',
- '/',
- '/=',
- '%',
- '%=',
- '&',
- '&=',
- '|',
- '|=',
- '^',
- '^=',
- '~',
- '::',
-)
-
-OPERATOR_WORDS = (
- 'all',
- 'and',
- 'any',
- 'between',
- 'except',
- 'exists',
- 'in',
- 'intersect',
- 'like',
- 'not',
- 'or',
- 'some',
- 'union',
-)
-
-_KEYWORDS_SERVER = (
- 'add',
- 'all',
- 'alter',
- 'and',
- 'any',
- 'as',
- 'asc',
- 'authorization',
- 'backup',
- 'begin',
- 'between',
- 'break',
- 'browse',
- 'bulk',
- 'by',
- 'cascade',
- 'case',
- 'catch',
- 'check',
- 'checkpoint',
- 'close',
- 'clustered',
- 'coalesce',
- 'collate',
- 'column',
- 'commit',
- 'compute',
- 'constraint',
- 'contains',
- 'containstable',
- 'continue',
- 'convert',
- 'create',
- 'cross',
- 'current',
- 'current_date',
- 'current_time',
- 'current_timestamp',
- 'current_user',
- 'cursor',
- 'database',
- 'dbcc',
- 'deallocate',
- 'declare',
- 'default',
- 'delete',
- 'deny',
- 'desc',
- 'disk',
- 'distinct',
- 'distributed',
- 'double',
- 'drop',
- 'dump',
- 'else',
- 'end',
- 'errlvl',
- 'escape',
- 'except',
- 'exec',
- 'execute',
- 'exists',
- 'exit',
- 'external',
- 'fetch',
- 'file',
- 'fillfactor',
- 'for',
- 'foreign',
- 'freetext',
- 'freetexttable',
- 'from',
- 'full',
- 'function',
- 'goto',
- 'grant',
- 'group',
- 'having',
- 'holdlock',
- 'identity',
- 'identity_insert',
- 'identitycol',
- 'if',
- 'in',
- 'index',
- 'inner',
- 'insert',
- 'intersect',
- 'into',
- 'is',
- 'join',
- 'key',
- 'kill',
- 'left',
- 'like',
- 'lineno',
- 'load',
- 'merge',
- 'national',
- 'nocheck',
- 'nonclustered',
- 'not',
- 'null',
- 'nullif',
- 'of',
- 'off',
- 'offsets',
- 'on',
- 'open',
- 'opendatasource',
- 'openquery',
- 'openrowset',
- 'openxml',
- 'option',
- 'or',
- 'order',
- 'outer',
- 'over',
- 'percent',
- 'pivot',
- 'plan',
- 'precision',
- 'primary',
- 'print',
- 'proc',
- 'procedure',
- 'public',
- 'raiserror',
- 'read',
- 'readtext',
- 'reconfigure',
- 'references',
- 'replication',
- 'restore',
- 'restrict',
- 'return',
- 'revert',
- 'revoke',
- 'right',
- 'rollback',
- 'rowcount',
- 'rowguidcol',
- 'rule',
- 'save',
- 'schema',
- 'securityaudit',
- 'select',
- 'semantickeyphrasetable',
- 'semanticsimilaritydetailstable',
- 'semanticsimilaritytable',
- 'session_user',
- 'set',
- 'setuser',
- 'shutdown',
- 'some',
- 'statistics',
- 'system_user',
- 'table',
- 'tablesample',
- 'textsize',
- 'then',
- 'throw',
- 'to',
- 'top',
- 'tran',
- 'transaction',
- 'trigger',
- 'truncate',
- 'try',
- 'try_convert',
- 'tsequal',
- 'union',
- 'unique',
- 'unpivot',
- 'update',
- 'updatetext',
- 'use',
- 'user',
- 'values',
- 'varying',
- 'view',
- 'waitfor',
- 'when',
- 'where',
- 'while',
- 'with',
- 'within',
- 'writetext',
-)
-
-_KEYWORDS_FUTURE = (
- 'absolute',
- 'action',
- 'admin',
- 'after',
- 'aggregate',
- 'alias',
- 'allocate',
- 'are',
- 'array',
- 'asensitive',
- 'assertion',
- 'asymmetric',
- 'at',
- 'atomic',
- 'before',
- 'binary',
- 'bit',
- 'blob',
- 'boolean',
- 'both',
- 'breadth',
- 'call',
- 'called',
- 'cardinality',
- 'cascaded',
- 'cast',
- 'catalog',
- 'char',
- 'character',
- 'class',
- 'clob',
- 'collation',
- 'collect',
- 'completion',
- 'condition',
- 'connect',
- 'connection',
- 'constraints',
- 'constructor',
- 'corr',
- 'corresponding',
- 'covar_pop',
- 'covar_samp',
- 'cube',
- 'cume_dist',
- 'current_catalog',
- 'current_default_transform_group',
- 'current_path',
- 'current_role',
- 'current_schema',
- 'current_transform_group_for_type',
- 'cycle',
- 'data',
- 'date',
- 'day',
- 'dec',
- 'decimal',
- 'deferrable',
- 'deferred',
- 'depth',
- 'deref',
- 'describe',
- 'descriptor',
- 'destroy',
- 'destructor',
- 'deterministic',
- 'diagnostics',
- 'dictionary',
- 'disconnect',
- 'domain',
- 'dynamic',
- 'each',
- 'element',
- 'end-exec',
- 'equals',
- 'every',
- 'exception',
- 'false',
- 'filter',
- 'first',
- 'float',
- 'found',
- 'free',
- 'fulltexttable',
- 'fusion',
- 'general',
- 'get',
- 'global',
- 'go',
- 'grouping',
- 'hold',
- 'host',
- 'hour',
- 'ignore',
- 'immediate',
- 'indicator',
- 'initialize',
- 'initially',
- 'inout',
- 'input',
- 'int',
- 'integer',
- 'intersection',
- 'interval',
- 'isolation',
- 'iterate',
- 'language',
- 'large',
- 'last',
- 'lateral',
- 'leading',
- 'less',
- 'level',
- 'like_regex',
- 'limit',
- 'ln',
- 'local',
- 'localtime',
- 'localtimestamp',
- 'locator',
- 'map',
- 'match',
- 'member',
- 'method',
- 'minute',
- 'mod',
- 'modifies',
- 'modify',
- 'module',
- 'month',
- 'multiset',
- 'names',
- 'natural',
- 'nchar',
- 'nclob',
- 'new',
- 'next',
- 'no',
- 'none',
- 'normalize',
- 'numeric',
- 'object',
- 'occurrences_regex',
- 'old',
- 'only',
- 'operation',
- 'ordinality',
- 'out',
- 'output',
- 'overlay',
- 'pad',
- 'parameter',
- 'parameters',
- 'partial',
- 'partition',
- 'path',
- 'percent_rank',
- 'percentile_cont',
- 'percentile_disc',
- 'position_regex',
- 'postfix',
- 'prefix',
- 'preorder',
- 'prepare',
- 'preserve',
- 'prior',
- 'privileges',
- 'range',
- 'reads',
- 'real',
- 'recursive',
- 'ref',
- 'referencing',
- 'regr_avgx',
- 'regr_avgy',
- 'regr_count',
- 'regr_intercept',
- 'regr_r2',
- 'regr_slope',
- 'regr_sxx',
- 'regr_sxy',
- 'regr_syy',
- 'relative',
- 'release',
- 'result',
- 'returns',
- 'role',
- 'rollup',
- 'routine',
- 'row',
- 'rows',
- 'savepoint',
- 'scope',
- 'scroll',
- 'search',
- 'second',
- 'section',
- 'sensitive',
- 'sequence',
- 'session',
- 'sets',
- 'similar',
- 'size',
- 'smallint',
- 'space',
- 'specific',
- 'specifictype',
- 'sql',
- 'sqlexception',
- 'sqlstate',
- 'sqlwarning',
- 'start',
- 'state',
- 'statement',
- 'static',
- 'stddev_pop',
- 'stddev_samp',
- 'structure',
- 'submultiset',
- 'substring_regex',
- 'symmetric',
- 'system',
- 'temporary',
- 'terminate',
- 'than',
- 'time',
- 'timestamp',
- 'timezone_hour',
- 'timezone_minute',
- 'trailing',
- 'translate_regex',
- 'translation',
- 'treat',
- 'true',
- 'uescape',
- 'under',
- 'unknown',
- 'unnest',
- 'usage',
- 'using',
- 'value',
- 'var_pop',
- 'var_samp',
- 'varchar',
- 'variable',
- 'whenever',
- 'width_bucket',
- 'window',
- 'within',
- 'without',
- 'work',
- 'write',
- 'xmlagg',
- 'xmlattributes',
- 'xmlbinary',
- 'xmlcast',
- 'xmlcomment',
- 'xmlconcat',
- 'xmldocument',
- 'xmlelement',
- 'xmlexists',
- 'xmlforest',
- 'xmliterate',
- 'xmlnamespaces',
- 'xmlparse',
- 'xmlpi',
- 'xmlquery',
- 'xmlserialize',
- 'xmltable',
- 'xmltext',
- 'xmlvalidate',
- 'year',
- 'zone',
-)
-
-_KEYWORDS_ODBC = (
- 'absolute',
- 'action',
- 'ada',
- 'add',
- 'all',
- 'allocate',
- 'alter',
- 'and',
- 'any',
- 'are',
- 'as',
- 'asc',
- 'assertion',
- 'at',
- 'authorization',
- 'avg',
- 'begin',
- 'between',
- 'bit',
- 'bit_length',
- 'both',
- 'by',
- 'cascade',
- 'cascaded',
- 'case',
- 'cast',
- 'catalog',
- 'char',
- 'char_length',
- 'character',
- 'character_length',
- 'check',
- 'close',
- 'coalesce',
- 'collate',
- 'collation',
- 'column',
- 'commit',
- 'connect',
- 'connection',
- 'constraint',
- 'constraints',
- 'continue',
- 'convert',
- 'corresponding',
- 'count',
- 'create',
- 'cross',
- 'current',
- 'current_date',
- 'current_time',
- 'current_timestamp',
- 'current_user',
- 'cursor',
- 'date',
- 'day',
- 'deallocate',
- 'dec',
- 'decimal',
- 'declare',
- 'default',
- 'deferrable',
- 'deferred',
- 'delete',
- 'desc',
- 'describe',
- 'descriptor',
- 'diagnostics',
- 'disconnect',
- 'distinct',
- 'domain',
- 'double',
- 'drop',
- 'else',
- 'end',
- 'end-exec',
- 'escape',
- 'except',
- 'exception',
- 'exec',
- 'execute',
- 'exists',
- 'external',
- 'extract',
- 'false',
- 'fetch',
- 'first',
- 'float',
- 'for',
- 'foreign',
- 'fortran',
- 'found',
- 'from',
- 'full',
- 'get',
- 'global',
- 'go',
- 'goto',
- 'grant',
- 'group',
- 'having',
- 'hour',
- 'identity',
- 'immediate',
- 'in',
- 'include',
- 'index',
- 'indicator',
- 'initially',
- 'inner',
- 'input',
- 'insensitive',
- 'insert',
- 'int',
- 'integer',
- 'intersect',
- 'interval',
- 'into',
- 'is',
- 'isolation',
- 'join',
- 'key',
- 'language',
- 'last',
- 'leading',
- 'left',
- 'level',
- 'like',
- 'local',
- 'lower',
- 'match',
- 'max',
- 'min',
- 'minute',
- 'module',
- 'month',
- 'names',
- 'national',
- 'natural',
- 'nchar',
- 'next',
- 'no',
- 'none',
- 'not',
- 'null',
- 'nullif',
- 'numeric',
- 'octet_length',
- 'of',
- 'on',
- 'only',
- 'open',
- 'option',
- 'or',
- 'order',
- 'outer',
- 'output',
- 'overlaps',
- 'pad',
- 'partial',
- 'pascal',
- 'position',
- 'precision',
- 'prepare',
- 'preserve',
- 'primary',
- 'prior',
- 'privileges',
- 'procedure',
- 'public',
- 'read',
- 'real',
- 'references',
- 'relative',
- 'restrict',
- 'revoke',
- 'right',
- 'rollback',
- 'rows',
- 'schema',
- 'scroll',
- 'second',
- 'section',
- 'select',
- 'session',
- 'session_user',
- 'set',
- 'size',
- 'smallint',
- 'some',
- 'space',
- 'sql',
- 'sqlca',
- 'sqlcode',
- 'sqlerror',
- 'sqlstate',
- 'sqlwarning',
- 'substring',
- 'sum',
- 'system_user',
- 'table',
- 'temporary',
- 'then',
- 'time',
- 'timestamp',
- 'timezone_hour',
- 'timezone_minute',
- 'to',
- 'trailing',
- 'transaction',
- 'translate',
- 'translation',
- 'trim',
- 'true',
- 'union',
- 'unique',
- 'unknown',
- 'update',
- 'upper',
- 'usage',
- 'user',
- 'using',
- 'value',
- 'values',
- 'varchar',
- 'varying',
- 'view',
- 'when',
- 'whenever',
- 'where',
- 'with',
- 'work',
- 'write',
- 'year',
- 'zone',
-)
-
-# See https://msdn.microsoft.com/en-us/library/ms189822.aspx.
-KEYWORDS = sorted(set(_KEYWORDS_FUTURE + _KEYWORDS_ODBC + _KEYWORDS_SERVER))
-
-# See https://msdn.microsoft.com/en-us/library/ms187752.aspx.
-TYPES = (
- 'bigint',
- 'binary',
- 'bit',
- 'char',
- 'cursor',
- 'date',
- 'datetime',
- 'datetime2',
- 'datetimeoffset',
- 'decimal',
- 'float',
- 'hierarchyid',
- 'image',
- 'int',
- 'money',
- 'nchar',
- 'ntext',
- 'numeric',
- 'nvarchar',
- 'real',
- 'smalldatetime',
- 'smallint',
- 'smallmoney',
- 'sql_variant',
- 'table',
- 'text',
- 'time',
- 'timestamp',
- 'tinyint',
- 'uniqueidentifier',
- 'varbinary',
- 'varchar',
- 'xml',
-)
-
-# See https://msdn.microsoft.com/en-us/library/ms174318.aspx.
-FUNCTIONS = (
- '$partition',
- 'abs',
- 'acos',
- 'app_name',
- 'applock_mode',
- 'applock_test',
- 'ascii',
- 'asin',
- 'assemblyproperty',
- 'atan',
- 'atn2',
- 'avg',
- 'binary_checksum',
- 'cast',
- 'ceiling',
- 'certencoded',
- 'certprivatekey',
- 'char',
- 'charindex',
- 'checksum',
- 'checksum_agg',
- 'choose',
- 'col_length',
- 'col_name',
- 'columnproperty',
- 'compress',
- 'concat',
- 'connectionproperty',
- 'context_info',
- 'convert',
- 'cos',
- 'cot',
- 'count',
- 'count_big',
- 'current_request_id',
- 'current_timestamp',
- 'current_transaction_id',
- 'current_user',
- 'cursor_status',
- 'database_principal_id',
- 'databasepropertyex',
- 'dateadd',
- 'datediff',
- 'datediff_big',
- 'datefromparts',
- 'datename',
- 'datepart',
- 'datetime2fromparts',
- 'datetimefromparts',
- 'datetimeoffsetfromparts',
- 'day',
- 'db_id',
- 'db_name',
- 'decompress',
- 'degrees',
- 'dense_rank',
- 'difference',
- 'eomonth',
- 'error_line',
- 'error_message',
- 'error_number',
- 'error_procedure',
- 'error_severity',
- 'error_state',
- 'exp',
- 'file_id',
- 'file_idex',
- 'file_name',
- 'filegroup_id',
- 'filegroup_name',
- 'filegroupproperty',
- 'fileproperty',
- 'floor',
- 'format',
- 'formatmessage',
- 'fulltextcatalogproperty',
- 'fulltextserviceproperty',
- 'get_filestream_transaction_context',
- 'getansinull',
- 'getdate',
- 'getutcdate',
- 'grouping',
- 'grouping_id',
- 'has_perms_by_name',
- 'host_id',
- 'host_name',
- 'iif',
- 'index_col',
- 'indexkey_property',
- 'indexproperty',
- 'is_member',
- 'is_rolemember',
- 'is_srvrolemember',
- 'isdate',
- 'isjson',
- 'isnull',
- 'isnumeric',
- 'json_modify',
- 'json_query',
- 'json_value',
- 'left',
- 'len',
- 'log',
- 'log10',
- 'lower',
- 'ltrim',
- 'max',
- 'min',
- 'min_active_rowversion',
- 'month',
- 'nchar',
- 'newid',
- 'newsequentialid',
- 'ntile',
- 'object_definition',
- 'object_id',
- 'object_name',
- 'object_schema_name',
- 'objectproperty',
- 'objectpropertyex',
- 'opendatasource',
- 'openjson',
- 'openquery',
- 'openrowset',
- 'openxml',
- 'original_db_name',
- 'original_login',
- 'parse',
- 'parsename',
- 'patindex',
- 'permissions',
- 'pi',
- 'power',
- 'pwdcompare',
- 'pwdencrypt',
- 'quotename',
- 'radians',
- 'rand',
- 'rank',
- 'replace',
- 'replicate',
- 'reverse',
- 'right',
- 'round',
- 'row_number',
- 'rowcount_big',
- 'rtrim',
- 'schema_id',
- 'schema_name',
- 'scope_identity',
- 'serverproperty',
- 'session_context',
- 'session_user',
- 'sign',
- 'sin',
- 'smalldatetimefromparts',
- 'soundex',
- 'sp_helplanguage',
- 'space',
- 'sqrt',
- 'square',
- 'stats_date',
- 'stdev',
- 'stdevp',
- 'str',
- 'string_escape',
- 'string_split',
- 'stuff',
- 'substring',
- 'sum',
- 'suser_id',
- 'suser_name',
- 'suser_sid',
- 'suser_sname',
- 'switchoffset',
- 'sysdatetime',
- 'sysdatetimeoffset',
- 'system_user',
- 'sysutcdatetime',
- 'tan',
- 'textptr',
- 'textvalid',
- 'timefromparts',
- 'todatetimeoffset',
- 'try_cast',
- 'try_convert',
- 'try_parse',
- 'type_id',
- 'type_name',
- 'typeproperty',
- 'unicode',
- 'upper',
- 'user_id',
- 'user_name',
- 'var',
- 'varp',
- 'xact_state',
- 'year',
-)
diff --git a/pygments/lexers/_vbscript_builtins.py b/pygments/lexers/_vbscript_builtins.py
deleted file mode 100644
index e7520072..00000000
--- a/pygments/lexers/_vbscript_builtins.py
+++ /dev/null
@@ -1,280 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._vbscript_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- These are manually translated lists from
- http://www.indusoft.com/pdf/VBScript%20Reference.pdf.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-KEYWORDS = [
- 'ByRef',
- 'ByVal',
- # dim: special rule
- 'call',
- 'case',
- 'class',
- # const: special rule
- 'do',
- 'each',
- 'else',
- 'elseif',
- 'end',
- 'erase',
- 'execute',
- 'function',
- 'exit',
- 'for',
- 'function',
- 'GetRef',
- 'global',
- 'if',
- 'let',
- 'loop',
- 'next',
- 'new',
- # option: special rule
- 'private',
- 'public',
- 'redim',
- 'select',
- 'set',
- 'sub',
- 'then',
- 'wend',
- 'while',
- 'with',
-]
-
-BUILTIN_FUNCTIONS = [
- 'Abs',
- 'Array',
- 'Asc',
- 'Atn',
- 'CBool',
- 'CByte',
- 'CCur',
- 'CDate',
- 'CDbl',
- 'Chr',
- 'CInt',
- 'CLng',
- 'Cos',
- 'CreateObject',
- 'CSng',
- 'CStr',
- 'Date',
- 'DateAdd',
- 'DateDiff',
- 'DatePart',
- 'DateSerial',
- 'DateValue',
- 'Day',
- 'Eval',
- 'Exp',
- 'Filter',
- 'Fix',
- 'FormatCurrency',
- 'FormatDateTime',
- 'FormatNumber',
- 'FormatPercent',
- 'GetObject',
- 'GetLocale',
- 'Hex',
- 'Hour',
- 'InStr',
- 'inStrRev',
- 'Int',
- 'IsArray',
- 'IsDate',
- 'IsEmpty',
- 'IsNull',
- 'IsNumeric',
- 'IsObject',
- 'Join',
- 'LBound',
- 'LCase',
- 'Left',
- 'Len',
- 'LoadPicture',
- 'Log',
- 'LTrim',
- 'Mid',
- 'Minute',
- 'Month',
- 'MonthName',
- 'MsgBox',
- 'Now',
- 'Oct',
- 'Randomize',
- 'RegExp',
- 'Replace',
- 'RGB',
- 'Right',
- 'Rnd',
- 'Round',
- 'RTrim',
- 'ScriptEngine',
- 'ScriptEngineBuildVersion',
- 'ScriptEngineMajorVersion',
- 'ScriptEngineMinorVersion',
- 'Second',
- 'SetLocale',
- 'Sgn',
- 'Space',
- 'Split',
- 'Sqr',
- 'StrComp',
- 'String',
- 'StrReverse',
- 'Tan',
- 'Time',
- 'Timer',
- 'TimeSerial',
- 'TimeValue',
- 'Trim',
- 'TypeName',
- 'UBound',
- 'UCase',
- 'VarType',
- 'Weekday',
- 'WeekdayName',
- 'Year',
-]
-
-BUILTIN_VARIABLES = [
- 'Debug',
- 'Dictionary',
- 'Drive',
- 'Drives',
- 'Err',
- 'File',
- 'Files',
- 'FileSystemObject',
- 'Folder',
- 'Folders',
- 'Match',
- 'Matches',
- 'RegExp',
- 'Submatches',
- 'TextStream',
-]
-
-OPERATORS = [
- '+',
- '-',
- '*',
- '/',
- '\\',
- '^',
- '|',
- '<',
- '<=',
- '>',
- '>=',
- '=',
- '<>',
- '&',
- '$',
-]
-
-OPERATOR_WORDS = [
- 'mod',
- 'and',
- 'or',
- 'xor',
- 'eqv',
- 'imp',
- 'is',
- 'not',
-]
-
-BUILTIN_CONSTANTS = [
- 'False',
- 'True',
- 'vbAbort',
- 'vbAbortRetryIgnore',
- 'vbApplicationModal',
- 'vbArray',
- 'vbBinaryCompare',
- 'vbBlack',
- 'vbBlue',
- 'vbBoole',
- 'vbByte',
- 'vbCancel',
- 'vbCr',
- 'vbCritical',
- 'vbCrLf',
- 'vbCurrency',
- 'vbCyan',
- 'vbDataObject',
- 'vbDate',
- 'vbDefaultButton1',
- 'vbDefaultButton2',
- 'vbDefaultButton3',
- 'vbDefaultButton4',
- 'vbDouble',
- 'vbEmpty',
- 'vbError',
- 'vbExclamation',
- 'vbFalse',
- 'vbFirstFullWeek',
- 'vbFirstJan1',
- 'vbFormFeed',
- 'vbFriday',
- 'vbGeneralDate',
- 'vbGreen',
- 'vbIgnore',
- 'vbInformation',
- 'vbInteger',
- 'vbLf',
- 'vbLong',
- 'vbLongDate',
- 'vbLongTime',
- 'vbMagenta',
- 'vbMonday',
- 'vbMsgBoxHelpButton',
- 'vbMsgBoxRight',
- 'vbMsgBoxRtlReading',
- 'vbMsgBoxSetForeground',
- 'vbNewLine',
- 'vbNo',
- 'vbNull',
- 'vbNullChar',
- 'vbNullString',
- 'vbObject',
- 'vbObjectError',
- 'vbOK',
- 'vbOKCancel',
- 'vbOKOnly',
- 'vbQuestion',
- 'vbRed',
- 'vbRetry',
- 'vbRetryCancel',
- 'vbSaturday',
- 'vbShortDate',
- 'vbShortTime',
- 'vbSingle',
- 'vbString',
- 'vbSunday',
- 'vbSystemModal',
- 'vbTab',
- 'vbTextCompare',
- 'vbThursday',
- 'vbTrue',
- 'vbTuesday',
- 'vbUseDefault',
- 'vbUseSystem',
- 'vbUseSystem',
- 'vbVariant',
- 'vbVerticalTab',
- 'vbWednesday',
- 'vbWhite',
- 'vbYellow',
- 'vbYes',
- 'vbYesNo',
- 'vbYesNoCancel',
-]
diff --git a/pygments/lexers/_vim_builtins.py b/pygments/lexers/_vim_builtins.py
deleted file mode 100644
index 39c9ed19..00000000
--- a/pygments/lexers/_vim_builtins.py
+++ /dev/null
@@ -1,1939 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._vim_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This file is autogenerated by scripts/get_vimkw.py
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# Split up in multiple functions so it's importable by jython, which has a
-# per-method size limit.
-
-def _getauto():
- var = (
- ('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'),
- ('CompleteDone','CompleteDone'),
- ('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'),
- ('QuitPre','QuitPre'),
- ('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'),
- ('TextChanged','TextChanged'),
- ('TextChangedI','TextChangedI'),
- ('User','User'),
- ('UserGettingBored','UserGettingBored'),
- ('VimEnter','VimEnter'),
- ('VimLeave','VimLeave'),
- ('VimLeavePre','VimLeavePre'),
- ('VimResized','VimResized'),
- ('WinEnter','WinEnter'),
- ('WinLeave','WinLeave'),
- ('event','event'),
- )
- return var
-auto = _getauto()
-
-def _getcommand():
- var = (
- ('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'),
- ('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'),
- ('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'),
- ('cn','cn'),
- ('cn','cnext'),
- ('cnew','cnewer'),
- ('cnf','cnf'),
- ('cnf','cnfile'),
- ('co','copy'),
- ('col','colder'),
- ('colo','colorscheme'),
- ('com','com'),
- ('comc','comclear'),
- ('comp','compiler'),
- ('con','con'),
- ('con','continue'),
- ('conf','confirm'),
- ('cope','copen'),
- ('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'),
- ('delel','delel'),
- ('delep','delep'),
- ('deletel','deletel'),
- ('deletep','deletep'),
- ('deletl','deletl'),
- ('deletp','deletp'),
- ('delf','delf'),
- ('delf','delfunction'),
- ('dell','dell'),
- ('delm','delmarks'),
- ('delp','delp'),
- ('dep','dep'),
- ('di','di'),
- ('di','display'),
- ('diffg','diffget'),
- ('diffo','diffoff'),
- ('diffp','diffpatch'),
- ('diffpu','diffput'),
- ('diffs','diffsplit'),
- ('difft','diffthis'),
- ('diffu','diffupdate'),
- ('dig','dig'),
- ('dig','digraphs'),
- ('dir','dir'),
- ('dj','djump'),
- ('dl','dl'),
- ('dli','dlist'),
- ('do','do'),
- ('doau','doau'),
- ('dp','dp'),
- ('dr','drop'),
- ('ds','dsearch'),
- ('dsp','dsplit'),
- ('e','e'),
- ('e','edit'),
- ('ea','ea'),
- ('earlier','earlier'),
- ('ec','ec'),
- ('echoe','echoerr'),
- ('echom','echomsg'),
- ('echon','echon'),
- ('el','else'),
- ('elsei','elseif'),
- ('em','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'),
- ('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'),
- ('go','goto'),
- ('gr','grep'),
- ('grepa','grepadd'),
- ('gui','gui'),
- ('gvim','gvim'),
- ('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'),
- ('intro','intro'),
- ('is','isearch'),
- ('isp','isplit'),
- ('iuna','iunabbrev'),
- ('j','join'),
- ('ju','jumps'),
- ('k','k'),
- ('kee','keepmarks'),
- ('keepa','keepa'),
- ('keepalt','keepalt'),
- ('keepj','keepjumps'),
- ('keepp','keeppatterns'),
- ('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'),
- ('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'),
- ('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'),
- ('mak','make'),
- ('marks','marks'),
- ('mat','match'),
- ('menut','menut'),
- ('menut','menutranslate'),
- ('mes','mes'),
- ('messages','messages'),
- ('mk','mk'),
- ('mk','mkexrc'),
- ('mks','mksession'),
- ('mksp','mkspell'),
- ('mkv','mkv'),
- ('mkv','mkvimrc'),
- ('mkvie','mkview'),
- ('mo','mo'),
- ('mod','mode'),
- ('mz','mz'),
- ('mz','mzscheme'),
- ('mzf','mzfile'),
- ('n','n'),
- ('n','next'),
- ('nb','nbkey'),
- ('nbc','nbclose'),
- ('nbs','nbstart'),
- ('ne','ne'),
- ('new','new'),
- ('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','print'),
- ('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'),
- ('py3do','py3do'),
- ('pydo','pydo'),
- ('pyf','pyfile'),
- ('python3','python3'),
- ('q','q'),
- ('q','quit'),
- ('qa','qall'),
- ('quita','quitall'),
- ('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'),
- ('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'),
- ('sun','sunhide'),
- ('sunme','sunme'),
- ('sunmenu','sunmenu'),
- ('sus','suspend'),
- ('sv','sview'),
- ('sw','swapname'),
- ('sy','sy'),
- ('syn','syn'),
- ('sync','sync'),
- ('syncbind','syncbind'),
- ('syntime','syntime'),
- ('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'),
- ('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'),
- ('xunme','xunme'),
- ('xunmenu','xunmenu'),
- ('xwininfo','xwininfo'),
- ('y','yank'),
- )
- return var
-command = _getcommand()
-
-def _getoption():
- var = (
- ('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'),
- ('fic','fic'),
- ('fileencoding','fileencoding'),
- ('fileencodings','fileencodings'),
- ('fileformat','fileformat'),
- ('fileformats','fileformats'),
- ('fileignorecase','fileignorecase'),
- ('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'),
- ('imactivatefunc','imactivatefunc'),
- ('imactivatekey','imactivatekey'),
- ('imaf','imaf'),
- ('imak','imak'),
- ('imc','imc'),
- ('imcmdline','imcmdline'),
- ('imd','imd'),
- ('imdisable','imdisable'),
- ('imi','imi'),
- ('iminsert','iminsert'),
- ('ims','ims'),
- ('imsearch','imsearch'),
- ('imsf','imsf'),
- ('imstatusfunc','imstatusfunc'),
- ('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'),
- ('invcscoperelative','invcscoperelative'),
- ('invcscopetag','invcscopetag'),
- ('invcscopeverbose','invcscopeverbose'),
- ('invcsre','invcsre'),
- ('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'),
- ('invfic','invfic'),
- ('invfileignorecase','invfileignorecase'),
- ('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'),
- ('invudf','invudf'),
- ('invundofile','invundofile'),
- ('invvb','invvb'),
- ('invvisualbell','invvisualbell'),
- ('invwa','invwa'),
- ('invwarn','invwarn'),
- ('invwb','invwb'),
- ('invweirdinvert','invweirdinvert'),
- ('invwfh','invwfh'),
- ('invwfw','invwfw'),
- ('invwic','invwic'),
- ('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'),
- ('nocscoperelative','nocscoperelative'),
- ('nocscopetag','nocscopetag'),
- ('nocscopeverbose','nocscopeverbose'),
- ('nocsre','nocsre'),
- ('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'),
- ('nofic','nofic'),
- ('nofileignorecase','nofileignorecase'),
- ('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'),
- ('noudf','noudf'),
- ('noundofile','noundofile'),
- ('novb','novb'),
- ('novisualbell','novisualbell'),
- ('nowa','nowa'),
- ('nowarn','nowarn'),
- ('nowb','nowb'),
- ('noweirdinvert','noweirdinvert'),
- ('nowfh','nowfh'),
- ('nowfw','nowfw'),
- ('nowic','nowic'),
- ('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'),
- ('re','re'),
- ('readonly','readonly'),
- ('redrawtime','redrawtime'),
- ('regexpengine','regexpengine'),
- ('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'),
- ('shellxescape','shellxescape'),
- ('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'),
- ('sxe','sxe'),
- ('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_u7','t_u7'),
- ('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'),
- )
- return var
-option = _getoption()
-
diff --git a/pygments/lexers/actionscript.py b/pygments/lexers/actionscript.py
deleted file mode 100644
index f4b4964e..00000000
--- a/pygments/lexers/actionscript.py
+++ /dev/null
@@ -1,240 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.actionscript
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for ActionScript and MXML.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, using, this, words, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['ActionScriptLexer', 'ActionScript3Lexer', 'MxmlLexer']
-
-
-class ActionScriptLexer(RegexLexer):
- """
- For ActionScript source code.
-
- .. versionadded:: 0.9
- """
-
- name = 'ActionScript'
- aliases = ['as', 'actionscript']
- filenames = ['*.as']
- mimetypes = ['application/x-actionscript', 'text/x-actionscript',
- 'text/actionscript']
-
- flags = re.DOTALL
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'/(\\\\|\\/|[^/\n])*/[gim]*', String.Regex),
- (r'[~^*!%&<>|+=:;,/?\\-]+', Operator),
- (r'[{}\[\]();.]+', Punctuation),
- (words((
- 'case', 'default', 'for', 'each', 'in', 'while', 'do', 'break',
- 'return', 'continue', 'if', 'else', 'throw', 'try', 'catch',
- 'var', 'with', 'new', 'typeof', 'arguments', 'instanceof', 'this',
- 'switch'), suffix=r'\b'),
- Keyword),
- (words((
- 'class', 'public', 'final', 'internal', 'native', 'override', 'private',
- 'protected', 'static', 'import', 'extends', 'implements', 'interface',
- 'intrinsic', 'return', 'super', 'dynamic', 'function', 'const', 'get',
- 'namespace', 'package', 'set'), suffix=r'\b'),
- Keyword.Declaration),
- (r'(true|false|null|NaN|Infinity|-Infinity|undefined|Void)\b',
- Keyword.Constant),
- (words((
- 'Accessibility', 'AccessibilityProperties', 'ActionScriptVersion',
- 'ActivityEvent', 'AntiAliasType', 'ApplicationDomain', 'AsBroadcaster', 'Array',
- 'AsyncErrorEvent', 'AVM1Movie', 'BevelFilter', 'Bitmap', 'BitmapData',
- 'BitmapDataChannel', 'BitmapFilter', 'BitmapFilterQuality', 'BitmapFilterType',
- 'BlendMode', 'BlurFilter', 'Boolean', 'ByteArray', 'Camera', 'Capabilities', 'CapsStyle',
- 'Class', 'Color', 'ColorMatrixFilter', 'ColorTransform', 'ContextMenu',
- 'ContextMenuBuiltInItems', 'ContextMenuEvent', 'ContextMenuItem',
- 'ConvultionFilter', 'CSMSettings', 'DataEvent', 'Date', 'DefinitionError',
- 'DeleteObjectSample', 'Dictionary', 'DisplacmentMapFilter', 'DisplayObject',
- 'DisplacmentMapFilterMode', 'DisplayObjectContainer', 'DropShadowFilter',
- 'Endian', 'EOFError', 'Error', 'ErrorEvent', 'EvalError', 'Event', 'EventDispatcher',
- 'EventPhase', 'ExternalInterface', 'FileFilter', 'FileReference',
- 'FileReferenceList', 'FocusDirection', 'FocusEvent', 'Font', 'FontStyle', 'FontType',
- 'FrameLabel', 'FullScreenEvent', 'Function', 'GlowFilter', 'GradientBevelFilter',
- 'GradientGlowFilter', 'GradientType', 'Graphics', 'GridFitType', 'HTTPStatusEvent',
- 'IBitmapDrawable', 'ID3Info', 'IDataInput', 'IDataOutput', 'IDynamicPropertyOutput'
- 'IDynamicPropertyWriter', 'IEventDispatcher', 'IExternalizable',
- 'IllegalOperationError', 'IME', 'IMEConversionMode', 'IMEEvent', 'int',
- 'InteractiveObject', 'InterpolationMethod', 'InvalidSWFError', 'InvokeEvent',
- 'IOError', 'IOErrorEvent', 'JointStyle', 'Key', 'Keyboard', 'KeyboardEvent', 'KeyLocation',
- 'LineScaleMode', 'Loader', 'LoaderContext', 'LoaderInfo', 'LoadVars', 'LocalConnection',
- 'Locale', 'Math', 'Matrix', 'MemoryError', 'Microphone', 'MorphShape', 'Mouse', 'MouseEvent',
- 'MovieClip', 'MovieClipLoader', 'Namespace', 'NetConnection', 'NetStatusEvent',
- 'NetStream', 'NewObjectSample', 'Number', 'Object', 'ObjectEncoding', 'PixelSnapping',
- 'Point', 'PrintJob', 'PrintJobOptions', 'PrintJobOrientation', 'ProgressEvent', 'Proxy',
- 'QName', 'RangeError', 'Rectangle', 'ReferenceError', 'RegExp', 'Responder', 'Sample',
- 'Scene', 'ScriptTimeoutError', 'Security', 'SecurityDomain', 'SecurityError',
- 'SecurityErrorEvent', 'SecurityPanel', 'Selection', 'Shape', 'SharedObject',
- 'SharedObjectFlushStatus', 'SimpleButton', 'Socket', 'Sound', 'SoundChannel',
- 'SoundLoaderContext', 'SoundMixer', 'SoundTransform', 'SpreadMethod', 'Sprite',
- 'StackFrame', 'StackOverflowError', 'Stage', 'StageAlign', 'StageDisplayState',
- 'StageQuality', 'StageScaleMode', 'StaticText', 'StatusEvent', 'String', 'StyleSheet',
- 'SWFVersion', 'SyncEvent', 'SyntaxError', 'System', 'TextColorType', 'TextField',
- 'TextFieldAutoSize', 'TextFieldType', 'TextFormat', 'TextFormatAlign',
- 'TextLineMetrics', 'TextRenderer', 'TextSnapshot', 'Timer', 'TimerEvent', 'Transform',
- 'TypeError', 'uint', 'URIError', 'URLLoader', 'URLLoaderDataFormat', 'URLRequest',
- 'URLRequestHeader', 'URLRequestMethod', 'URLStream', 'URLVariabeles', 'VerifyError',
- 'Video', 'XML', 'XMLDocument', 'XMLList', 'XMLNode', 'XMLNodeType', 'XMLSocket',
- 'XMLUI'), suffix=r'\b'),
- Name.Builtin),
- (words((
- 'decodeURI', 'decodeURIComponent', 'encodeURI', 'escape', 'eval', 'isFinite', 'isNaN',
- 'isXMLName', 'clearInterval', 'fscommand', 'getTimer', 'getURL', 'getVersion',
- 'parseFloat', 'parseInt', 'setInterval', 'trace', 'updateAfterEvent',
- 'unescape'), suffix=r'\b'),
- Name.Function),
- (r'[$a-zA-Z_]\w*', Name.Other),
- (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'0x[0-9a-f]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- ]
- }
-
-
-class ActionScript3Lexer(RegexLexer):
- """
- For ActionScript 3 source code.
-
- .. versionadded:: 0.11
- """
-
- name = 'ActionScript 3'
- aliases = ['as3', 'actionscript3']
- filenames = ['*.as']
- mimetypes = ['application/x-actionscript3', 'text/x-actionscript3',
- 'text/actionscript3']
-
- identifier = r'[$a-zA-Z_]\w*'
- typeidentifier = identifier + r'(?:\.<\w+>)?'
-
- flags = re.DOTALL | re.MULTILINE
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'(function\s+)(' + identifier + r')(\s*)(\()',
- bygroups(Keyword.Declaration, Name.Function, Text, Operator),
- 'funcparams'),
- (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+)(' + typeidentifier + r')(\s*)(\()',
- bygroups(Keyword, Text, Keyword.Type, Text, Operator)),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'/(\\\\|\\/|[^\n])*/[gisx]*', String.Regex),
- (r'(\.)(' + identifier + r')', bygroups(Operator, Name.Attribute)),
- (r'(case|default|for|each|in|while|do|break|return|continue|if|else|'
- r'throw|try|catch|with|new|typeof|arguments|instanceof|this|'
- r'switch|import|include|as|is)\b',
- Keyword),
- (r'(class|public|final|internal|native|override|private|protected|'
- r'static|import|extends|implements|interface|intrinsic|return|super|'
- r'dynamic|function|const|get|namespace|package|set)\b',
- Keyword.Declaration),
- (r'(true|false|null|NaN|Infinity|-Infinity|undefined|void)\b',
- Keyword.Constant),
- (r'(decodeURI|decodeURIComponent|encodeURI|escape|eval|isFinite|isNaN|'
- r'isXMLName|clearInterval|fscommand|getTimer|getURL|getVersion|'
- r'isFinite|parseFloat|parseInt|setInterval|trace|updateAfterEvent|'
- r'unescape)\b', Name.Function),
- (identifier, Name),
- (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'0x[0-9a-f]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r'[~^*!%&<>|+=:;,/?\\{}\[\]().-]+', Operator),
- ],
- 'funcparams': [
- (r'\s+', Text),
- (r'(\s*)(\.\.\.)?(' + identifier + r')(\s*)(:)(\s*)(' +
- typeidentifier + r'|\*)(\s*)',
- bygroups(Text, Punctuation, Name, Text, Operator, Text,
- Keyword.Type, Text), 'defval'),
- (r'\)', Operator, 'type')
- ],
- 'type': [
- (r'(\s*)(:)(\s*)(' + typeidentifier + r'|\*)',
- bygroups(Text, Operator, Text, Keyword.Type), '#pop:2'),
- (r'\s+', Text, '#pop:2'),
- default('#pop:2')
- ],
- 'defval': [
- (r'(=)(\s*)([^(),]+)(\s*)(,?)',
- bygroups(Operator, Text, using(this), Text, Operator), '#pop'),
- (r',', Operator, '#pop'),
- default('#pop')
- ]
- }
-
- def analyse_text(text):
- if re.match(r'\w+\s*:\s*\w', text):
- return 0.3
- return 0
-
-
-class MxmlLexer(RegexLexer):
- """
- For MXML markup.
- Nested AS3 in <script> tags is highlighted by the appropriate lexer.
-
- .. versionadded:: 1.1
- """
- flags = re.MULTILINE | re.DOTALL
- name = 'MXML'
- aliases = ['mxml']
- filenames = ['*.mxml']
- mimetimes = ['text/xml', 'application/xml']
-
- tokens = {
- 'root': [
- ('[^<&]+', Text),
- (r'&\S*?;', Name.Entity),
- (r'(\<\!\[CDATA\[)(.*?)(\]\]\>)',
- bygroups(String, using(ActionScript3Lexer), String)),
- ('<!--', Comment, 'comment'),
- (r'<\?.*?\?>', Comment.Preproc),
- ('<![^>]*>', Comment.Preproc),
- (r'<\s*[\w:.-]+', Name.Tag, 'tag'),
- (r'<\s*/\s*[\w:.-]+\s*>', Name.Tag),
- ],
- 'comment': [
- ('[^-]+', Comment),
- ('-->', Comment, '#pop'),
- ('-', Comment),
- ],
- 'tag': [
- (r'\s+', Text),
- (r'[\w.:-]+\s*=', Name.Attribute, 'attr'),
- (r'/?\s*>', Name.Tag, '#pop'),
- ],
- 'attr': [
- (r'\s+', Text),
- ('".*?"', String, '#pop'),
- ("'.*?'", String, '#pop'),
- (r'[^\s>]+', String, '#pop'),
- ],
- }
diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py
deleted file mode 100644
index 0e726339..00000000
--- a/pygments/lexers/agile.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.agile
- ~~~~~~~~~~~~~~~~~~~~~
-
- Just export lexer classes previously contained in this module.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexers.lisp import SchemeLexer
-from pygments.lexers.jvm import IokeLexer, ClojureLexer
-from pygments.lexers.python import PythonLexer, PythonConsoleLexer, \
- PythonTracebackLexer, Python3Lexer, Python3TracebackLexer, DgLexer
-from pygments.lexers.ruby import RubyLexer, RubyConsoleLexer, FancyLexer
-from pygments.lexers.perl import PerlLexer, Perl6Lexer
-from pygments.lexers.d import CrocLexer, MiniDLexer
-from pygments.lexers.iolang import IoLexer
-from pygments.lexers.tcl import TclLexer
-from pygments.lexers.factor import FactorLexer
-from pygments.lexers.scripting import LuaLexer, MoonScriptLexer
-
-__all__ = []
diff --git a/pygments/lexers/algebra.py b/pygments/lexers/algebra.py
deleted file mode 100644
index ba2a61a9..00000000
--- a/pygments/lexers/algebra.py
+++ /dev/null
@@ -1,221 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.algebra
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for computer algebra systems.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['GAPLexer', 'MathematicaLexer', 'MuPADLexer', 'BCLexer']
-
-
-class GAPLexer(RegexLexer):
- """
- For `GAP <http://www.gap-system.org>`_ source code.
-
- .. versionadded:: 2.0
- """
- name = 'GAP'
- aliases = ['gap']
- filenames = ['*.g', '*.gd', '*.gi', '*.gap']
-
- tokens = {
- 'root': [
- (r'#.*$', Comment.Single),
- (r'"(?:[^"\\]|\\.)*"', String),
- (r'\(|\)|\[|\]|\{|\}', Punctuation),
- (r'''(?x)\b(?:
- if|then|elif|else|fi|
- for|while|do|od|
- repeat|until|
- break|continue|
- function|local|return|end|
- rec|
- quit|QUIT|
- IsBound|Unbind|
- TryNextMethod|
- Info|Assert
- )\b''', Keyword),
- (r'''(?x)\b(?:
- true|false|fail|infinity
- )\b''',
- Name.Constant),
- (r'''(?x)\b(?:
- (Declare|Install)([A-Z][A-Za-z]+)|
- BindGlobal|BIND_GLOBAL
- )\b''',
- Name.Builtin),
- (r'\.|,|:=|;|=|\+|-|\*|/|\^|>|<', Operator),
- (r'''(?x)\b(?:
- and|or|not|mod|in
- )\b''',
- Operator.Word),
- (r'''(?x)
- (?:\w+|`[^`]*`)
- (?:::\w+|`[^`]*`)*''', Name.Variable),
- (r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number),
- (r'\.[0-9]+(?:e[0-9]+)?', Number),
- (r'.', Text)
- ],
- }
-
-
-class MathematicaLexer(RegexLexer):
- """
- Lexer for `Mathematica <http://www.wolfram.com/mathematica/>`_ source code.
-
- .. versionadded:: 2.0
- """
- name = 'Mathematica'
- aliases = ['mathematica', 'mma', 'nb']
- filenames = ['*.nb', '*.cdf', '*.nbp', '*.ma']
- mimetypes = ['application/mathematica',
- 'application/vnd.wolfram.mathematica',
- 'application/vnd.wolfram.mathematica.package',
- 'application/vnd.wolfram.cdf']
-
- # http://reference.wolfram.com/mathematica/guide/Syntax.html
- operators = (
- ";;", "=", "=.", "!=" "==", ":=", "->", ":>", "/.", "+", "-", "*", "/",
- "^", "&&", "||", "!", "<>", "|", "/;", "?", "@", "//", "/@", "@@",
- "@@@", "~~", "===", "&", "<", ">", "<=", ">=",
- )
-
- punctuation = (",", ";", "(", ")", "[", "]", "{", "}")
-
- def _multi_escape(entries):
- return '(%s)' % ('|'.join(re.escape(entry) for entry in entries))
-
- tokens = {
- 'root': [
- (r'(?s)\(\*.*?\*\)', Comment),
-
- (r'([a-zA-Z]+[A-Za-z0-9]*`)', Name.Namespace),
- (r'([A-Za-z0-9]*_+[A-Za-z0-9]*)', Name.Variable),
- (r'#\d*', Name.Variable),
- (r'([a-zA-Z]+[a-zA-Z0-9]*)', Name),
-
- (r'-?\d+\.\d*', Number.Float),
- (r'-?\d*\.\d+', Number.Float),
- (r'-?\d+', Number.Integer),
-
- (words(operators), Operator),
- (words(punctuation), Punctuation),
- (r'".*?"', String),
- (r'\s+', Text.Whitespace),
- ],
- }
-
-
-class MuPADLexer(RegexLexer):
- """
- A `MuPAD <http://www.mupad.com>`_ lexer.
- Contributed by Christopher Creutzig <christopher@creutzig.de>.
-
- .. versionadded:: 0.8
- """
- name = 'MuPAD'
- aliases = ['mupad']
- filenames = ['*.mu']
-
- tokens = {
- 'root': [
- (r'//.*?$', Comment.Single),
- (r'/\*', Comment.Multiline, 'comment'),
- (r'"(?:[^"\\]|\\.)*"', String),
- (r'\(|\)|\[|\]|\{|\}', Punctuation),
- (r'''(?x)\b(?:
- next|break|end|
- axiom|end_axiom|category|end_category|domain|end_domain|inherits|
- if|%if|then|elif|else|end_if|
- case|of|do|otherwise|end_case|
- while|end_while|
- repeat|until|end_repeat|
- for|from|to|downto|step|end_for|
- proc|local|option|save|begin|end_proc|
- delete|frame
- )\b''', Keyword),
- (r'''(?x)\b(?:
- DOM_ARRAY|DOM_BOOL|DOM_COMPLEX|DOM_DOMAIN|DOM_EXEC|DOM_EXPR|
- DOM_FAIL|DOM_FLOAT|DOM_FRAME|DOM_FUNC_ENV|DOM_HFARRAY|DOM_IDENT|
- DOM_INT|DOM_INTERVAL|DOM_LIST|DOM_NIL|DOM_NULL|DOM_POLY|DOM_PROC|
- DOM_PROC_ENV|DOM_RAT|DOM_SET|DOM_STRING|DOM_TABLE|DOM_VAR
- )\b''', Name.Class),
- (r'''(?x)\b(?:
- PI|EULER|E|CATALAN|
- NIL|FAIL|undefined|infinity|
- TRUE|FALSE|UNKNOWN
- )\b''',
- Name.Constant),
- (r'\b(?:dom|procname)\b', Name.Builtin.Pseudo),
- (r'\.|,|:|;|=|\+|-|\*|/|\^|@|>|<|\$|\||!|\'|%|~=', Operator),
- (r'''(?x)\b(?:
- and|or|not|xor|
- assuming|
- div|mod|
- union|minus|intersect|in|subset
- )\b''',
- Operator.Word),
- (r'\b(?:I|RDN_INF|RD_NINF|RD_NAN)\b', Number),
- # (r'\b(?:adt|linalg|newDomain|hold)\b', Name.Builtin),
- (r'''(?x)
- ((?:[a-zA-Z_#][\w#]*|`[^`]*`)
- (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*)(\s*)([(])''',
- bygroups(Name.Function, Text, Punctuation)),
- (r'''(?x)
- (?:[a-zA-Z_#][\w#]*|`[^`]*`)
- (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*''', Name.Variable),
- (r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number),
- (r'\.[0-9]+(?:e[0-9]+)?', Number),
- (r'.', Text)
- ],
- 'comment': [
- (r'[^*/]', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ],
- }
-
-
-class BCLexer(RegexLexer):
- """
- A `BC <https://www.gnu.org/software/bc/>`_ lexer.
-
- .. versionadded:: 2.1
- """
- name = 'BC'
- aliases = ['bc']
- filenames = ['*.bc']
-
- tokens = {
- 'root': [
- (r'/\*', Comment.Multiline, 'comment'),
- (r'"(?:[^"\\]|\\.)*"', String),
- (r'[{}();,]', Punctuation),
- (words(('if', 'else', 'while', 'for', 'break', 'continue',
- 'halt', 'return', 'define', 'auto', 'print', 'read',
- 'length', 'scale', 'sqrt', 'limits', 'quit',
- 'warranty'), suffix=r'\b'), Keyword),
- (r'\+\+|--|\|\||&&|'
- r'([-<>+*%\^/!=])=?', Operator),
- # bc doesn't support exponential
- (r'[0-9]+(\.[0-9]*)?', Number),
- (r'\.[0-9]+', Number),
- (r'.', Text)
- ],
- 'comment': [
- (r'[^*/]+', Comment.Multiline),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ],
- }
diff --git a/pygments/lexers/ambient.py b/pygments/lexers/ambient.py
deleted file mode 100644
index 7d42d12a..00000000
--- a/pygments/lexers/ambient.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.ambient
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for AmbientTalk language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['AmbientTalkLexer']
-
-
-class AmbientTalkLexer(RegexLexer):
- """
- Lexer for `AmbientTalk <https://code.google.com/p/ambienttalk>`_ source code.
-
- .. versionadded:: 2.0
- """
- name = 'AmbientTalk'
- filenames = ['*.at']
- aliases = ['at', 'ambienttalk', 'ambienttalk/2']
- mimetypes = ['text/x-ambienttalk']
-
- flags = re.MULTILINE | re.DOTALL
-
- builtin = words(('if:', 'then:', 'else:', 'when:', 'whenever:', 'discovered:',
- 'disconnected:', 'reconnected:', 'takenOffline:', 'becomes:',
- 'export:', 'as:', 'object:', 'actor:', 'mirror:', 'taggedAs:',
- 'mirroredBy:', 'is:'))
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'(def|deftype|import|alias|exclude)\b', Keyword),
- (builtin, Name.Builtin),
- (r'(true|false|nil)\b', Keyword.Constant),
- (r'(~|lobby|jlobby|/)\.', Keyword.Constant, 'namespace'),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r'\|', Punctuation, 'arglist'),
- (r'<:|[*^!%&<>+=,./?-]|:=', Operator),
- (r"`[a-zA-Z_]\w*", String.Symbol),
- (r"[a-zA-Z_]\w*:", Name.Function),
- (r"[{}()\[\];`]", Punctuation),
- (r'(self|super)\b', Name.Variable.Instance),
- (r"[a-zA-Z_]\w*", Name.Variable),
- (r"@[a-zA-Z_]\w*", Name.Class),
- (r"@\[", Name.Class, 'annotations'),
- include('numbers'),
- ],
- 'numbers': [
- (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
- (r'\d+', Number.Integer)
- ],
- 'namespace': [
- (r'[a-zA-Z_]\w*\.', Name.Namespace),
- (r'[a-zA-Z_]\w*:', Name.Function, '#pop'),
- (r'[a-zA-Z_]\w*(?!\.)', Name.Function, '#pop')
- ],
- 'annotations': [
- (r"(.*?)\]", Name.Class, '#pop')
- ],
- 'arglist': [
- (r'\|', Punctuation, '#pop'),
- (r'\s*(,)\s*', Punctuation),
- (r'[a-zA-Z_]\w*', Name.Variable),
- ],
- }
diff --git a/pygments/lexers/ampl.py b/pygments/lexers/ampl.py
deleted file mode 100644
index 21e7847f..00000000
--- a/pygments/lexers/ampl.py
+++ /dev/null
@@ -1,87 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.ampl
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the AMPL language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups, using, this, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['AmplLexer']
-
-
-class AmplLexer(RegexLexer):
- """
- For `AMPL <http://ampl.com/>`_ source code.
-
- .. versionadded:: 2.2
- """
- name = 'Ampl'
- aliases = ['ampl']
- filenames = ['*.run']
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'\s+', Text.Whitespace),
- (r'#.*?\n', Comment.Single),
- (r'/[*](.|\n)*?[*]/', Comment.Multiline),
- (words((
- 'call', 'cd', 'close', 'commands', 'data', 'delete', 'display',
- 'drop', 'end', 'environ', 'exit', 'expand', 'include', 'load',
- 'model', 'objective', 'option', 'problem', 'purge', 'quit',
- 'redeclare', 'reload', 'remove', 'reset', 'restore', 'shell',
- 'show', 'solexpand', 'solution', 'solve', 'update', 'unload',
- 'xref', 'coeff', 'coef', 'cover', 'obj', 'interval', 'default',
- 'from', 'to', 'to_come', 'net_in', 'net_out', 'dimen',
- 'dimension', 'check', 'complements', 'write', 'function',
- 'pipe', 'format', 'if', 'then', 'else', 'in', 'while', 'repeat',
- 'for'), suffix=r'\b'), Keyword.Reserved),
- (r'(integer|binary|symbolic|ordered|circular|reversed|INOUT|IN|OUT|LOCAL)',
- Keyword.Type),
- (r'\".*?\"', String.Double),
- (r'\'.*?\'', String.Single),
- (r'[()\[\]{},;:]+', Punctuation),
- (r'\b(\w+)(\.)(astatus|init0|init|lb0|lb1|lb2|lb|lrc|'
- r'lslack|rc|relax|slack|sstatus|status|ub0|ub1|ub2|'
- r'ub|urc|uslack|val)',
- bygroups(Name.Variable, Punctuation, Keyword.Reserved)),
- (r'(set|param|var|arc|minimize|maximize|subject to|s\.t\.|subj to|'
- r'node|table|suffix|read table|write table)(\s+)(\w+)',
- bygroups(Keyword.Declaration, Text, Name.Variable)),
- (r'(param)(\s*)(:)(\s*)(\w+)(\s*)(:)(\s*)((\w|\s)+)',
- bygroups(Keyword.Declaration, Text, Punctuation, Text,
- Name.Variable, Text, Punctuation, Text, Name.Variable)),
- (r'(let|fix|unfix)(\s*)((?:\{.*\})?)(\s*)(\w+)',
- bygroups(Keyword.Declaration, Text, using(this), Text, Name.Variable)),
- (words((
- 'abs', 'acos', 'acosh', 'alias', 'asin', 'asinh', 'atan', 'atan2',
- 'atanh', 'ceil', 'ctime', 'cos', 'exp', 'floor', 'log', 'log10',
- 'max', 'min', 'precision', 'round', 'sin', 'sinh', 'sqrt', 'tan',
- 'tanh', 'time', 'trunc', 'Beta', 'Cauchy', 'Exponential', 'Gamma',
- 'Irand224', 'Normal', 'Normal01', 'Poisson', 'Uniform', 'Uniform01',
- 'num', 'num0', 'ichar', 'char', 'length', 'substr', 'sprintf',
- 'match', 'sub', 'gsub', 'print', 'printf', 'next', 'nextw', 'prev',
- 'prevw', 'first', 'last', 'ord', 'ord0', 'card', 'arity',
- 'indexarity'), prefix=r'\b', suffix=r'\b'), Name.Builtin),
- (r'(\+|\-|\*|/|\*\*|=|<=|>=|==|\||\^|<|>|\!|\.\.|:=|\&|\!=|<<|>>)',
- Operator),
- (words((
- 'or', 'exists', 'forall', 'and', 'in', 'not', 'within', 'union',
- 'diff', 'difference', 'symdiff', 'inter', 'intersect',
- 'intersection', 'cross', 'setof', 'by', 'less', 'sum', 'prod',
- 'product', 'div', 'mod'), suffix=r'\b'),
- Keyword.Reserved), # Operator.Name but not enough emphasized with that
- (r'(\d+\.(?!\.)\d*|\.(?!.)\d+)([eE][+-]?\d+)?', Number.Float),
- (r'\d+([eE][+-]?\d+)?', Number.Integer),
- (r'[+-]?Infinity', Number.Integer),
- (r'(\w+|(\.(?!\.)))', Text)
- ]
-
- }
diff --git a/pygments/lexers/apl.py b/pygments/lexers/apl.py
deleted file mode 100644
index 26962504..00000000
--- a/pygments/lexers/apl.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.apl
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for APL.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['APLLexer']
-
-
-class APLLexer(RegexLexer):
- """
- A simple APL lexer.
-
- .. versionadded:: 2.0
- """
- name = 'APL'
- aliases = ['apl']
- filenames = ['*.apl']
-
- tokens = {
- 'root': [
- # Whitespace
- # ==========
- (r'\s+', Text),
- #
- # Comment
- # =======
- # '⍝' is traditional; '#' is supported by GNU APL and NGN (but not Dyalog)
- (u'[⍝#].*$', Comment.Single),
- #
- # Strings
- # =======
- (r'\'((\'\')|[^\'])*\'', String.Single),
- (r'"(("")|[^"])*"', String.Double), # supported by NGN APL
- #
- # Punctuation
- # ===========
- # This token type is used for diamond and parenthesis
- # but not for bracket and ; (see below)
- (u'[⋄◇()]', Punctuation),
- #
- # Array indexing
- # ==============
- # Since this token type is very important in APL, it is not included in
- # the punctuation token type but rather in the following one
- (r'[\[\];]', String.Regex),
- #
- # Distinguished names
- # ===================
- # following IBM APL2 standard
- (u'⎕[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*', Name.Function),
- #
- # Labels
- # ======
- # following IBM APL2 standard
- # (u'[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*:', Name.Label),
- #
- # Variables
- # =========
- # following IBM APL2 standard
- (u'[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*', Name.Variable),
- #
- # Numbers
- # =======
- (u'¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞)'
- u'([Jj]¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞))?',
- Number),
- #
- # Operators
- # ==========
- (u'[\\.\\\\\\/⌿⍀¨⍣⍨⍠⍤∘]', Name.Attribute), # closest token type
- (u'[+\\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗]',
- Operator),
- #
- # Constant
- # ========
- (u'⍬', Name.Constant),
- #
- # Quad symbol
- # ===========
- (u'[⎕⍞]', Name.Variable.Global),
- #
- # Arrows left/right
- # =================
- (u'[←→]', Keyword.Declaration),
- #
- # D-Fn
- # ====
- (u'[⍺⍵⍶⍹∇:]', Name.Builtin.Pseudo),
- (r'[{}]', Keyword.Type),
- ],
- }
diff --git a/pygments/lexers/archetype.py b/pygments/lexers/archetype.py
deleted file mode 100644
index 68ec5c04..00000000
--- a/pygments/lexers/archetype.py
+++ /dev/null
@@ -1,318 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.archetype
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for Archetype-related syntaxes, including:
-
- - ODIN syntax <https://github.com/openEHR/odin>
- - ADL syntax <http://www.openehr.org/releases/trunk/architecture/am/adl2.pdf>
- - cADL sub-syntax of ADL
-
- For uses of this syntax, see the openEHR archetypes <http://www.openEHR.org/ckm>
-
- Contributed by Thomas Beale <https://github.com/wolandscat>,
- <https://bitbucket.org/thomas_beale>.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, bygroups, using, default
-from pygments.token import Text, Comment, Name, Literal, Number, String, \
- Punctuation, Keyword, Operator, Generic
-
-__all__ = ['OdinLexer', 'CadlLexer', 'AdlLexer']
-
-
-class AtomsLexer(RegexLexer):
- """
- Lexer for Values used in ADL and ODIN.
-
- .. versionadded:: 2.1
- """
-
- tokens = {
- # ----- pseudo-states for inclusion -----
- 'whitespace': [
- (r'\n', Text),
- (r'\s+', Text),
- (r'[ \t]*--.*$', Comment),
- ],
- 'archetype_id': [
- (r'[ \t]*([a-zA-Z]\w+(\.[a-zA-Z]\w+)*::)?[a-zA-Z]\w+(-[a-zA-Z]\w+){2}'
- r'\.\w+[\w-]*\.v\d+(\.\d+){,2}((-[a-z]+)(\.\d+)?)?', Name.Decorator),
- ],
- 'date_constraints': [
- # ISO 8601-based date/time constraints
- (r'[Xx?YyMmDdHhSs\d]{2,4}([:-][Xx?YyMmDdHhSs\d]{2}){2}', Literal.Date),
- # ISO 8601-based duration constraints + optional trailing slash
- (r'(P[YyMmWwDd]+(T[HhMmSs]+)?|PT[HhMmSs]+)/?', Literal.Date),
- ],
- 'ordered_values': [
- # ISO 8601 date with optional 'T' ligature
- (r'\d{4}-\d{2}-\d{2}T?', Literal.Date),
- # ISO 8601 time
- (r'\d{2}:\d{2}:\d{2}(\.\d+)?([+-]\d{4}|Z)?', Literal.Date),
- # ISO 8601 duration
- (r'P((\d*(\.\d+)?[YyMmWwDd]){1,3}(T(\d*(\.\d+)?[HhMmSs]){,3})?|'
- r'T(\d*(\.\d+)?[HhMmSs]){,3})', Literal.Date),
- (r'[+-]?(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float),
- (r'[+-]?(\d+)*\.\d+%?', Number.Float),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[+-]?\d+%?', Number.Integer),
- ],
- 'values': [
- include('ordered_values'),
- (r'([Tt]rue|[Ff]alse)', Literal),
- (r'"', String, 'string'),
- (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
- (r'[a-z][a-z0-9+.-]*:', Literal, 'uri'),
- # term code
- (r'(\[)(\w[\w-]*(?:\([^)\n]+\))?)(::)(\w[\w-]*)(\])',
- bygroups(Punctuation, Name.Decorator, Punctuation, Name.Decorator,
- Punctuation)),
- (r'\|', Punctuation, 'interval'),
- # list continuation
- (r'\.\.\.', Punctuation),
- ],
- 'constraint_values': [
- (r'(\[)(\w[\w-]*(?:\([^)\n]+\))?)(::)',
- bygroups(Punctuation, Name.Decorator, Punctuation), 'adl14_code_constraint'),
- # ADL 1.4 ordinal constraint
- (r'(\d*)(\|)(\[\w[\w-]*::\w[\w-]*\])((?:[,;])?)',
- bygroups(Number, Punctuation, Name.Decorator, Punctuation)),
- include('date_constraints'),
- include('values'),
- ],
-
- # ----- real states -----
- 'string': [
- ('"', String, '#pop'),
- (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|'
- r'u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})', String.Escape),
- # all other characters
- (r'[^\\"]+', String),
- # stray backslash
- (r'\\', String),
- ],
- 'uri': [
- # effective URI terminators
- (r'[,>\s]', Punctuation, '#pop'),
- (r'[^>\s,]+', Literal),
- ],
- 'interval': [
- (r'\|', Punctuation, '#pop'),
- include('ordered_values'),
- (r'\.\.', Punctuation),
- (r'[<>=] *', Punctuation),
- # handle +/-
- (r'\+/-', Punctuation),
- (r'\s+', Text),
- ],
- 'any_code': [
- include('archetype_id'),
- # if it is a code
- (r'[a-z_]\w*[0-9.]+(@[^\]]+)?', Name.Decorator),
- # if it is tuple with attribute names
- (r'[a-z_]\w*', Name.Class),
- # if it is an integer, i.e. Xpath child index
- (r'[0-9]+', Text),
- (r'\|', Punctuation, 'code_rubric'),
- (r'\]', Punctuation, '#pop'),
- # handle use_archetype statement
- (r'\s*,\s*', Punctuation),
- ],
- 'code_rubric': [
- (r'\|', Punctuation, '#pop'),
- (r'[^|]+', String),
- ],
- 'adl14_code_constraint': [
- (r'\]', Punctuation, '#pop'),
- (r'\|', Punctuation, 'code_rubric'),
- (r'(\w[\w-]*)([;,]?)', bygroups(Name.Decorator, Punctuation)),
- include('whitespace'),
- ],
- }
-
-
-class OdinLexer(AtomsLexer):
- """
- Lexer for ODIN syntax.
-
- .. versionadded:: 2.1
- """
- name = 'ODIN'
- aliases = ['odin']
- filenames = ['*.odin']
- mimetypes = ['text/odin']
-
- tokens = {
- 'path': [
- (r'>', Punctuation, '#pop'),
- # attribute name
- (r'[a-z_]\w*', Name.Class),
- (r'/', Punctuation),
- (r'\[', Punctuation, 'key'),
- (r'\s*,\s*', Punctuation, '#pop'),
- (r'\s+', Text, '#pop'),
- ],
- 'key': [
- include('values'),
- (r'\]', Punctuation, '#pop'),
- ],
- 'type_cast': [
- (r'\)', Punctuation, '#pop'),
- (r'[^)]+', Name.Class),
- ],
- 'root': [
- include('whitespace'),
- (r'([Tt]rue|[Ff]alse)', Literal),
- include('values'),
- # x-ref path
- (r'/', Punctuation, 'path'),
- # x-ref path starting with key
- (r'\[', Punctuation, 'key'),
- # attribute name
- (r'[a-z_]\w*', Name.Class),
- (r'=', Operator),
- (r'\(', Punctuation, 'type_cast'),
- (r',', Punctuation),
- (r'<', Punctuation),
- (r'>', Punctuation),
- (r';', Punctuation),
- ],
- }
-
-
-class CadlLexer(AtomsLexer):
- """
- Lexer for cADL syntax.
-
- .. versionadded:: 2.1
- """
- name = 'cADL'
- aliases = ['cadl']
- filenames = ['*.cadl']
-
- tokens = {
- 'path': [
- # attribute name
- (r'[a-z_]\w*', Name.Class),
- (r'/', Punctuation),
- (r'\[', Punctuation, 'any_code'),
- (r'\s+', Punctuation, '#pop'),
- ],
- 'root': [
- include('whitespace'),
- (r'(cardinality|existence|occurrences|group|include|exclude|'
- r'allow_archetype|use_archetype|use_node)\W', Keyword.Type),
- (r'(and|or|not|there_exists|xor|implies|for_all)\W', Keyword.Type),
- (r'(after|before|closed)\W', Keyword.Type),
- (r'(not)\W', Operator),
- (r'(matches|is_in)\W', Operator),
- # is_in / not is_in char
- (u'(\u2208|\u2209)', Operator),
- # there_exists / not there_exists / for_all / and / or
- (u'(\u2203|\u2204|\u2200|\u2227|\u2228|\u22BB|\223C)',
- Operator),
- # regex in slot or as string constraint
- (r'(\{)(\s*/[^}]+/\s*)(\})',
- bygroups(Punctuation, String.Regex, Punctuation)),
- # regex in slot or as string constraint
- (r'(\{)(\s*\^[^}]+\^\s*)(\})',
- bygroups(Punctuation, String.Regex, Punctuation)),
- (r'/', Punctuation, 'path'),
- # for cardinality etc
- (r'(\{)((?:\d+\.\.)?(?:\d+|\*))'
- r'((?:\s*;\s*(?:ordered|unordered|unique)){,2})(\})',
- bygroups(Punctuation, Number, Number, Punctuation)),
- # [{ is start of a tuple value
- (r'\[\{', Punctuation),
- (r'\}\]', Punctuation),
- (r'\{', Punctuation),
- (r'\}', Punctuation),
- include('constraint_values'),
- # type name
- (r'[A-Z]\w+(<[A-Z]\w+([A-Za-z_<>]*)>)?', Name.Class),
- # attribute name
- (r'[a-z_]\w*', Name.Class),
- (r'\[', Punctuation, 'any_code'),
- (r'(~|//|\\\\|\+|-|/|\*|\^|!=|=|<=|>=|<|>]?)', Operator),
- (r'\(', Punctuation),
- (r'\)', Punctuation),
- # for lists of values
- (r',', Punctuation),
- (r'"', String, 'string'),
- # for assumed value
- (r';', Punctuation),
- ],
- }
-
-
-class AdlLexer(AtomsLexer):
- """
- Lexer for ADL syntax.
-
- .. versionadded:: 2.1
- """
-
- name = 'ADL'
- aliases = ['adl']
- filenames = ['*.adl', '*.adls', '*.adlf', '*.adlx']
-
- tokens = {
- 'whitespace': [
- # blank line ends
- (r'\s*\n', Text),
- # comment-only line
- (r'^[ \t]*--.*$', Comment),
- ],
- 'odin_section': [
- # repeating the following two rules from the root state enable multi-line
- # strings that start in the first column to be dealt with
- (r'^(language|description|ontology|terminology|annotations|'
- r'component_terminologies|revision_history)[ \t]*\n', Generic.Heading),
- (r'^(definition)[ \t]*\n', Generic.Heading, 'cadl_section'),
- (r'^([ \t]*|[ \t]+.*)\n', using(OdinLexer)),
- (r'^([^"]*")(>[ \t]*\n)', bygroups(String, Punctuation)),
- # template overlay delimiter
- (r'^----------*\n', Text, '#pop'),
- (r'^.*\n', String),
- default('#pop'),
- ],
- 'cadl_section': [
- (r'^([ \t]*|[ \t]+.*)\n', using(CadlLexer)),
- default('#pop'),
- ],
- 'rules_section': [
- (r'^[ \t]+.*\n', using(CadlLexer)),
- default('#pop'),
- ],
- 'metadata': [
- (r'\)', Punctuation, '#pop'),
- (r';', Punctuation),
- (r'([Tt]rue|[Ff]alse)', Literal),
- # numbers and version ids
- (r'\d+(\.\d+)*', Literal),
- # Guids
- (r'(\d|[a-fA-F])+(-(\d|[a-fA-F])+){3,}', Literal),
- (r'\w+', Name.Class),
- (r'"', String, 'string'),
- (r'=', Operator),
- (r'[ \t]+', Text),
- default('#pop'),
- ],
- 'root': [
- (r'^(archetype|template_overlay|operational_template|template|'
- r'speciali[sz]e)', Generic.Heading),
- (r'^(language|description|ontology|terminology|annotations|'
- r'component_terminologies|revision_history)[ \t]*\n',
- Generic.Heading, 'odin_section'),
- (r'^(definition)[ \t]*\n', Generic.Heading, 'cadl_section'),
- (r'^(rules)[ \t]*\n', Generic.Heading, 'rules_section'),
- include('archetype_id'),
- (r'[ \t]*\(', Punctuation, 'metadata'),
- include('whitespace'),
- ],
- }
diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py
deleted file mode 100644
index 87dcff38..00000000
--- a/pygments/lexers/asm.py
+++ /dev/null
@@ -1,774 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.asm
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for assembly languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, using, words, \
- DelegatingLexer
-from pygments.lexers.c_cpp import CppLexer, CLexer
-from pygments.lexers.d import DLexer
-from pygments.token import Text, Name, Number, String, Comment, Punctuation, \
- Other, Keyword, Operator
-
-__all__ = ['GasLexer', 'ObjdumpLexer', 'DObjdumpLexer', 'CppObjdumpLexer',
- 'CObjdumpLexer', 'HsailLexer', 'LlvmLexer', 'NasmLexer',
- 'NasmObjdumpLexer', 'TasmLexer', 'Ca65Lexer', 'Dasm16Lexer']
-
-
-class GasLexer(RegexLexer):
- """
- For Gas (AT&T) assembly code.
- """
- name = 'GAS'
- aliases = ['gas', 'asm']
- filenames = ['*.s', '*.S']
- mimetypes = ['text/x-gas']
-
- #: optional Comment or Whitespace
- string = r'"(\\"|[^"])*"'
- char = r'[\w$.@-]'
- identifier = r'(?:[a-zA-Z$_]' + char + r'*|\.' + char + '+)'
- number = r'(?:0[xX][a-zA-Z0-9]+|\d+)'
-
- tokens = {
- 'root': [
- include('whitespace'),
- (identifier + ':', Name.Label),
- (r'\.' + identifier, Name.Attribute, 'directive-args'),
- (r'lock|rep(n?z)?|data\d+', Name.Attribute),
- (identifier, Name.Function, 'instruction-args'),
- (r'[\r\n]+', Text)
- ],
- 'directive-args': [
- (identifier, Name.Constant),
- (string, String),
- ('@' + identifier, Name.Attribute),
- (number, Number.Integer),
- (r'[\r\n]+', Text, '#pop'),
- (r'[;#].*?\n', Comment, '#pop'),
-
- include('punctuation'),
- include('whitespace')
- ],
- 'instruction-args': [
- # For objdump-disassembled code, shouldn't occur in
- # actual assembler input
- ('([a-z0-9]+)( )(<)('+identifier+')(>)',
- bygroups(Number.Hex, Text, Punctuation, Name.Constant,
- Punctuation)),
- ('([a-z0-9]+)( )(<)('+identifier+')([-+])('+number+')(>)',
- bygroups(Number.Hex, Text, Punctuation, Name.Constant,
- Punctuation, Number.Integer, Punctuation)),
-
- # Address constants
- (identifier, Name.Constant),
- (number, Number.Integer),
- # Registers
- ('%' + identifier, Name.Variable),
- # Numeric constants
- ('$'+number, Number.Integer),
- (r"$'(.|\\')'", String.Char),
- (r'[\r\n]+', Text, '#pop'),
- (r'[;#].*?\n', Comment, '#pop'),
-
- include('punctuation'),
- include('whitespace')
- ],
- 'whitespace': [
- (r'\n', Text),
- (r'\s+', Text),
- (r'[;#].*?\n', Comment)
- ],
- 'punctuation': [
- (r'[-*,.()\[\]!:]+', Punctuation)
- ]
- }
-
- def analyse_text(text):
- if re.match(r'^\.(text|data|section)', text, re.M):
- return True
- elif re.match(r'^\.\w+', text, re.M):
- return 0.1
-
-
-def _objdump_lexer_tokens(asm_lexer):
- """
- Common objdump lexer tokens to wrap an ASM lexer.
- """
- hex_re = r'[0-9A-Za-z]'
- return {
- 'root': [
- # File name & format:
- ('(.*?)(:)( +file format )(.*?)$',
- bygroups(Name.Label, Punctuation, Text, String)),
- # Section header
- ('(Disassembly of section )(.*?)(:)$',
- bygroups(Text, Name.Label, Punctuation)),
- # Function labels
- # (With offset)
- ('('+hex_re+'+)( )(<)(.*?)([-+])(0[xX][A-Za-z0-9]+)(>:)$',
- bygroups(Number.Hex, Text, Punctuation, Name.Function,
- Punctuation, Number.Hex, Punctuation)),
- # (Without offset)
- ('('+hex_re+'+)( )(<)(.*?)(>:)$',
- bygroups(Number.Hex, Text, Punctuation, Name.Function,
- Punctuation)),
- # Code line with disassembled instructions
- ('( *)('+hex_re+r'+:)(\t)((?:'+hex_re+hex_re+' )+)( *\t)([a-zA-Z].*?)$',
- bygroups(Text, Name.Label, Text, Number.Hex, Text,
- using(asm_lexer))),
- # Code line with ascii
- ('( *)('+hex_re+r'+:)(\t)((?:'+hex_re+hex_re+' )+)( *)(.*?)$',
- bygroups(Text, Name.Label, Text, Number.Hex, Text, String)),
- # Continued code line, only raw opcodes without disassembled
- # instruction
- ('( *)('+hex_re+r'+:)(\t)((?:'+hex_re+hex_re+' )+)$',
- bygroups(Text, Name.Label, Text, Number.Hex)),
- # Skipped a few bytes
- (r'\t\.\.\.$', Text),
- # Relocation line
- # (With offset)
- (r'(\t\t\t)('+hex_re+r'+:)( )([^\t]+)(\t)(.*?)([-+])(0x'+hex_re+'+)$',
- bygroups(Text, Name.Label, Text, Name.Property, Text,
- Name.Constant, Punctuation, Number.Hex)),
- # (Without offset)
- (r'(\t\t\t)('+hex_re+r'+:)( )([^\t]+)(\t)(.*?)$',
- bygroups(Text, Name.Label, Text, Name.Property, Text,
- Name.Constant)),
- (r'[^\n]+\n', Other)
- ]
- }
-
-
-class ObjdumpLexer(RegexLexer):
- """
- For the output of 'objdump -dr'
- """
- name = 'objdump'
- aliases = ['objdump']
- filenames = ['*.objdump']
- mimetypes = ['text/x-objdump']
-
- tokens = _objdump_lexer_tokens(GasLexer)
-
-
-class DObjdumpLexer(DelegatingLexer):
- """
- For the output of 'objdump -Sr on compiled D files'
- """
- name = 'd-objdump'
- aliases = ['d-objdump']
- filenames = ['*.d-objdump']
- mimetypes = ['text/x-d-objdump']
-
- def __init__(self, **options):
- super(DObjdumpLexer, self).__init__(DLexer, ObjdumpLexer, **options)
-
-
-class CppObjdumpLexer(DelegatingLexer):
- """
- For the output of 'objdump -Sr on compiled C++ files'
- """
- name = 'cpp-objdump'
- aliases = ['cpp-objdump', 'c++-objdumb', 'cxx-objdump']
- filenames = ['*.cpp-objdump', '*.c++-objdump', '*.cxx-objdump']
- mimetypes = ['text/x-cpp-objdump']
-
- def __init__(self, **options):
- super(CppObjdumpLexer, self).__init__(CppLexer, ObjdumpLexer, **options)
-
-
-class CObjdumpLexer(DelegatingLexer):
- """
- For the output of 'objdump -Sr on compiled C files'
- """
- name = 'c-objdump'
- aliases = ['c-objdump']
- filenames = ['*.c-objdump']
- mimetypes = ['text/x-c-objdump']
-
- def __init__(self, **options):
- super(CObjdumpLexer, self).__init__(CLexer, ObjdumpLexer, **options)
-
-
-class HsailLexer(RegexLexer):
- """
- For HSAIL assembly code.
-
- .. versionadded:: 2.2
- """
- name = 'HSAIL'
- aliases = ['hsail', 'hsa']
- filenames = ['*.hsail']
- mimetypes = ['text/x-hsail']
-
- string = r'"[^"]*?"'
- identifier = r'[a-zA-Z_][\w.]*'
- # Registers
- register_number = r'[0-9]+'
- register = r'(\$(c|s|d|q)' + register_number + ')'
- # Qualifiers
- alignQual = r'(align\(\d+\))'
- widthQual = r'(width\((\d+|all)\))'
- allocQual = r'(alloc\(agent\))'
- # Instruction Modifiers
- roundingMod = (r'((_ftz)?(_up|_down|_zero|_near))')
- datatypeMod = (r'_('
- # packedTypes
- r'u8x4|s8x4|u16x2|s16x2|u8x8|s8x8|u16x4|s16x4|u32x2|s32x2|'
- r'u8x16|s8x16|u16x8|s16x8|u32x4|s32x4|u64x2|s64x2|'
- r'f16x2|f16x4|f16x8|f32x2|f32x4|f64x2|'
- # baseTypes
- r'u8|s8|u16|s16|u32|s32|u64|s64|'
- r'b128|b8|b16|b32|b64|b1|'
- r'f16|f32|f64|'
- # opaqueType
- r'roimg|woimg|rwimg|samp|sig32|sig64)')
-
- # Numeric Constant
- float = r'((\d+\.)|(\d*\.\d+))[eE][+-]?\d+'
- hexfloat = r'0[xX](([0-9a-fA-F]+\.[0-9a-fA-F]*)|([0-9a-fA-F]*\.[0-9a-fA-F]+))[pP][+-]?\d+'
- ieeefloat = r'0((h|H)[0-9a-fA-F]{4}|(f|F)[0-9a-fA-F]{8}|(d|D)[0-9a-fA-F]{16})'
-
- tokens = {
- 'root': [
- include('whitespace'),
- include('comments'),
-
- (string, String),
-
- (r'@' + identifier + ':?', Name.Label),
-
- (register, Name.Variable.Anonymous),
-
- include('keyword'),
-
- (r'&' + identifier, Name.Variable.Global),
- (r'%' + identifier, Name.Variable),
-
- (hexfloat, Number.Hex),
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
- (ieeefloat, Number.Float),
- (float, Number.Float),
- (r'\d+', Number.Integer),
-
- (r'[=<>{}\[\]()*.,:;!]|x\b', Punctuation)
- ],
- 'whitespace': [
- (r'(\n|\s)+', Text),
- ],
- 'comments': [
- (r'/\*.*?\*/', Comment.Multiline),
- (r'//.*?\n', Comment.Single),
- ],
- 'keyword': [
- # Types
- (r'kernarg' + datatypeMod, Keyword.Type),
-
- # Regular keywords
- (r'\$(full|base|small|large|default|zero|near)', Keyword),
- (words((
- 'module', 'extension', 'pragma', 'prog', 'indirect', 'signature',
- 'decl', 'kernel', 'function', 'enablebreakexceptions',
- 'enabledetectexceptions', 'maxdynamicgroupsize', 'maxflatgridsize',
- 'maxflatworkgroupsize', 'requireddim', 'requiredgridsize',
- 'requiredworkgroupsize', 'requirenopartialworkgroups'),
- suffix=r'\b'), Keyword),
-
- # instructions
- (roundingMod, Keyword),
- (datatypeMod, Keyword),
- (r'_(' + alignQual + '|' + widthQual + ')', Keyword),
- (r'_kernarg', Keyword),
- (r'(nop|imagefence)\b', Keyword),
- (words((
- 'cleardetectexcept', 'clock', 'cuid', 'debugtrap', 'dim',
- 'getdetectexcept', 'groupbaseptr', 'kernargbaseptr', 'laneid',
- 'maxcuid', 'maxwaveid', 'packetid', 'setdetectexcept', 'waveid',
- 'workitemflatabsid', 'workitemflatid', 'nullptr', 'abs', 'bitrev',
- 'currentworkgroupsize', 'currentworkitemflatid', 'fract', 'ncos',
- 'neg', 'nexp2', 'nlog2', 'nrcp', 'nrsqrt', 'nsin', 'nsqrt',
- 'gridgroups', 'gridsize', 'not', 'sqrt', 'workgroupid',
- 'workgroupsize', 'workitemabsid', 'workitemid', 'ceil', 'floor',
- 'rint', 'trunc', 'add', 'bitmask', 'borrow', 'carry', 'copysign',
- 'div', 'rem', 'sub', 'shl', 'shr', 'and', 'or', 'xor', 'unpackhi',
- 'unpacklo', 'max', 'min', 'fma', 'mad', 'bitextract', 'bitselect',
- 'shuffle', 'cmov', 'bitalign', 'bytealign', 'lerp', 'nfma', 'mul',
- 'mulhi', 'mul24hi', 'mul24', 'mad24', 'mad24hi', 'bitinsert',
- 'combine', 'expand', 'lda', 'mov', 'pack', 'unpack', 'packcvt',
- 'unpackcvt', 'sad', 'sementp', 'ftos', 'stof', 'cmp', 'ld', 'st',
- '_eq', '_ne', '_lt', '_le', '_gt', '_ge', '_equ', '_neu', '_ltu',
- '_leu', '_gtu', '_geu', '_num', '_nan', '_seq', '_sne', '_slt',
- '_sle', '_sgt', '_sge', '_snum', '_snan', '_sequ', '_sneu', '_sltu',
- '_sleu', '_sgtu', '_sgeu', 'atomic', '_ld', '_st', '_cas', '_add',
- '_and', '_exch', '_max', '_min', '_or', '_sub', '_wrapdec',
- '_wrapinc', '_xor', 'ret', 'cvt', '_readonly', '_kernarg', '_global',
- 'br', 'cbr', 'sbr', '_scacq', '_screl', '_scar', '_rlx', '_wave',
- '_wg', '_agent', '_system', 'ldimage', 'stimage', '_v2', '_v3', '_v4',
- '_1d', '_2d', '_3d', '_1da', '_2da', '_1db', '_2ddepth', '_2dadepth',
- '_width', '_height', '_depth', '_array', '_channelorder',
- '_channeltype', 'querysampler', '_coord', '_filter', '_addressing',
- 'barrier', 'wavebarrier', 'initfbar', 'joinfbar', 'waitfbar',
- 'arrivefbar', 'leavefbar', 'releasefbar', 'ldf', 'activelaneid',
- 'activelanecount', 'activelanemask', 'activelanepermute', 'call',
- 'scall', 'icall', 'alloca', 'packetcompletionsig',
- 'addqueuewriteindex', 'casqueuewriteindex', 'ldqueuereadindex',
- 'stqueuereadindex', 'readonly', 'global', 'private', 'group',
- 'spill', 'arg', '_upi', '_downi', '_zeroi', '_neari', '_upi_sat',
- '_downi_sat', '_zeroi_sat', '_neari_sat', '_supi', '_sdowni',
- '_szeroi', '_sneari', '_supi_sat', '_sdowni_sat', '_szeroi_sat',
- '_sneari_sat', '_pp', '_ps', '_sp', '_ss', '_s', '_p', '_pp_sat',
- '_ps_sat', '_sp_sat', '_ss_sat', '_s_sat', '_p_sat')), Keyword),
-
- # Integer types
- (r'i[1-9]\d*', Keyword)
- ]
- }
-
-
-class LlvmLexer(RegexLexer):
- """
- For LLVM assembly code.
- """
- name = 'LLVM'
- aliases = ['llvm']
- filenames = ['*.ll']
- mimetypes = ['text/x-llvm']
-
- #: optional Comment or Whitespace
- string = r'"[^"]*?"'
- identifier = r'([-a-zA-Z$._][\w\-$.]*|' + string + ')'
-
- tokens = {
- 'root': [
- include('whitespace'),
-
- # Before keywords, because keywords are valid label names :(...
- (identifier + r'\s*:', Name.Label),
-
- include('keyword'),
-
- (r'%' + identifier, Name.Variable),
- (r'@' + identifier, Name.Variable.Global),
- (r'%\d+', Name.Variable.Anonymous),
- (r'@\d+', Name.Variable.Global),
- (r'#\d+', Name.Variable.Global),
- (r'!' + identifier, Name.Variable),
- (r'!\d+', Name.Variable.Anonymous),
- (r'c?' + string, String),
-
- (r'0[xX][a-fA-F0-9]+', Number),
- (r'-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?', Number),
-
- (r'[=<>{}\[\]()*.,!]|x\b', Punctuation)
- ],
- 'whitespace': [
- (r'(\n|\s)+', Text),
- (r';.*?\n', Comment)
- ],
- 'keyword': [
- # Regular keywords
- (words((
- 'acq_rel', 'acquire', 'add', 'addrspace', 'addrspacecast', 'afn', 'alias',
- 'aliasee', 'align', 'alignLog2', 'alignstack', 'alloca', 'allocsize', 'allOnes',
- 'alwaysinline', 'amdgpu_cs', 'amdgpu_es', 'amdgpu_gs', 'amdgpu_hs',
- 'amdgpu_kernel', 'amdgpu_ls', 'amdgpu_ps', 'amdgpu_vs', 'and', 'any',
- 'anyregcc', 'appending', 'arcp', 'argmemonly', 'args', 'arm_aapcs_vfpcc',
- 'arm_aapcscc', 'arm_apcscc', 'ashr', 'asm', 'atomic', 'atomicrmw', 'attributes',
- 'available_externally', 'avr_intrcc', 'avr_signalcc', 'bit', 'bitcast',
- 'bitMask', 'blockaddress', 'br', 'branchFunnel', 'builtin', 'byArg', 'byte',
- 'byteArray', 'byval', 'c', 'call', 'callee', 'caller', 'calls', 'catch',
- 'catchpad', 'catchret', 'catchswitch', 'cc', 'ccc', 'cleanup', 'cleanuppad',
- 'cleanupret', 'cmpxchg', 'cold', 'coldcc', 'comdat', 'common', 'constant',
- 'contract', 'convergent', 'critical', 'cxx_fast_tlscc', 'datalayout', 'declare',
- 'default', 'define', 'deplibs', 'dereferenceable', 'dereferenceable_or_null',
- 'distinct', 'dllexport', 'dllimport', 'double', 'dso_local', 'dso_preemptable',
- 'dsoLocal', 'eq', 'exact', 'exactmatch', 'extern_weak', 'external',
- 'externally_initialized', 'extractelement', 'extractvalue', 'fadd', 'false',
- 'fast', 'fastcc', 'fcmp', 'fdiv', 'fence', 'filter', 'flags', 'float', 'fmul',
- 'fp128', 'fpext', 'fptosi', 'fptoui', 'fptrunc', 'frem', 'from', 'fsub',
- 'funcFlags', 'function', 'gc', 'getelementptr', 'ghccc', 'global', 'guid', 'gv',
- 'half', 'hash', 'hhvm_ccc', 'hhvmcc', 'hidden', 'hot', 'hotness', 'icmp',
- 'ifunc', 'inaccessiblemem_or_argmemonly', 'inaccessiblememonly', 'inalloca',
- 'inbounds', 'indir', 'indirectbr', 'info', 'initialexec', 'inline',
- 'inlineBits', 'inlinehint', 'inrange', 'inreg', 'insertelement', 'insertvalue',
- 'insts', 'intel_ocl_bicc', 'inteldialect', 'internal', 'inttoptr', 'invoke',
- 'jumptable', 'kind', 'label', 'landingpad', 'largest', 'linkage', 'linkonce',
- 'linkonce_odr', 'live', 'load', 'local_unnamed_addr', 'localdynamic',
- 'localexec', 'lshr', 'max', 'metadata', 'min', 'minsize', 'module', 'monotonic',
- 'msp430_intrcc', 'mul', 'musttail', 'naked', 'name', 'nand', 'ne', 'nest',
- 'ninf', 'nnan', 'noalias', 'nobuiltin', 'nocapture', 'nocf_check',
- 'noduplicate', 'noduplicates', 'noimplicitfloat', 'noinline', 'none',
- 'nonlazybind', 'nonnull', 'norecurse', 'noRecurse', 'noredzone', 'noreturn',
- 'notail', 'notEligibleToImport', 'nounwind', 'nsw', 'nsz', 'null', 'nuw', 'oeq',
- 'offset', 'oge', 'ogt', 'ole', 'olt', 'one', 'opaque', 'optforfuzzing',
- 'optnone', 'optsize', 'or', 'ord', 'path', 'personality', 'phi', 'ppc_fp128',
- 'prefix', 'preserve_allcc', 'preserve_mostcc', 'private', 'prologue',
- 'protected', 'ptrtoint', 'ptx_device', 'ptx_kernel', 'readnone', 'readNone',
- 'readonly', 'readOnly', 'reassoc', 'refs', 'relbf', 'release', 'resByArg',
- 'resume', 'ret', 'returnDoesNotAlias', 'returned', 'returns_twice', 'safestack',
- 'samesize', 'sanitize_address', 'sanitize_hwaddress', 'sanitize_memory',
- 'sanitize_thread', 'sdiv', 'section', 'select', 'seq_cst', 'sext', 'sge', 'sgt',
- 'shadowcallstack', 'shl', 'shufflevector', 'sideeffect', 'signext', 'single',
- 'singleImpl', 'singleImplName', 'sitofp', 'sizeM1', 'sizeM1BitWidth', 'sle',
- 'slt', 'source_filename', 'speculatable', 'spir_func', 'spir_kernel', 'srem',
- 'sret', 'ssp', 'sspreq', 'sspstrong', 'store', 'strictfp', 'sub', 'summaries',
- 'summary', 'swiftcc', 'swifterror', 'swiftself', 'switch', 'syncscope', 'tail',
- 'target', 'thread_local', 'to', 'token', 'triple', 'true', 'trunc', 'type',
- 'typeCheckedLoadConstVCalls', 'typeCheckedLoadVCalls', 'typeid', 'typeIdInfo',
- 'typeTestAssumeConstVCalls', 'typeTestAssumeVCalls', 'typeTestRes', 'typeTests',
- 'udiv', 'ueq', 'uge', 'ugt', 'uitofp', 'ule', 'ult', 'umax', 'umin', 'undef',
- 'une', 'uniformRetVal', 'uniqueRetVal', 'unknown', 'unnamed_addr', 'uno',
- 'unordered', 'unreachable', 'unsat', 'unwind', 'urem', 'uselistorder',
- 'uselistorder_bb', 'uwtable', 'va_arg', 'variable', 'vFuncId',
- 'virtualConstProp', 'void', 'volatile', 'weak', 'weak_odr', 'webkit_jscc',
- 'win64cc', 'within', 'wpdRes', 'wpdResolutions', 'writeonly', 'x',
- 'x86_64_sysvcc', 'x86_fastcallcc', 'x86_fp80', 'x86_intrcc', 'x86_mmx',
- 'x86_regcallcc', 'x86_stdcallcc', 'x86_thiscallcc', 'x86_vectorcallcc', 'xchg',
- 'xor', 'zeroext', 'zeroinitializer', 'zext'),
- suffix=r'\b'), Keyword),
-
- # Types
- (words(('void', 'half', 'float', 'double', 'x86_fp80', 'fp128',
- 'ppc_fp128', 'label', 'metadata', 'token')), Keyword.Type),
-
- # Integer types
- (r'i[1-9]\d*', Keyword)
- ]
- }
-
-
-class NasmLexer(RegexLexer):
- """
- For Nasm (Intel) assembly code.
- """
- name = 'NASM'
- aliases = ['nasm']
- filenames = ['*.asm', '*.ASM']
- mimetypes = ['text/x-nasm']
-
- # Tasm uses the same file endings, but TASM is not as common as NASM, so
- # we prioritize NASM higher by default
- priority = 1.0
-
- identifier = r'[a-z$._?][\w$.?#@~]*'
- hexn = r'(?:0x[0-9a-f]+|$0[0-9a-f]*|[0-9]+[0-9a-f]*h)'
- octn = r'[0-7]+q'
- binn = r'[01]+b'
- decn = r'[0-9]+'
- floatn = decn + r'\.e?' + decn
- string = r'"(\\"|[^"\n])*"|' + r"'(\\'|[^'\n])*'|" + r"`(\\`|[^`\n])*`"
- declkw = r'(?:res|d)[bwdqt]|times'
- register = (r'r[0-9][0-5]?[bwd]|'
- r'[a-d][lh]|[er]?[a-d]x|[er]?[sb]p|[er]?[sd]i|[c-gs]s|st[0-7]|'
- r'mm[0-7]|cr[0-4]|dr[0-367]|tr[3-7]')
- wordop = r'seg|wrt|strict'
- type = r'byte|[dq]?word'
- # Directives must be followed by whitespace, otherwise CPU will match
- # cpuid for instance.
- directives = (r'(?:BITS|USE16|USE32|SECTION|SEGMENT|ABSOLUTE|EXTERN|GLOBAL|'
- r'ORG|ALIGN|STRUC|ENDSTRUC|COMMON|CPU|GROUP|UPPERCASE|IMPORT|'
- r'EXPORT|LIBRARY|MODULE)\s+')
-
- flags = re.IGNORECASE | re.MULTILINE
- tokens = {
- 'root': [
- (r'^\s*%', Comment.Preproc, 'preproc'),
- include('whitespace'),
- (identifier + ':', Name.Label),
- (r'(%s)(\s+)(equ)' % identifier,
- bygroups(Name.Constant, Keyword.Declaration, Keyword.Declaration),
- 'instruction-args'),
- (directives, Keyword, 'instruction-args'),
- (declkw, Keyword.Declaration, 'instruction-args'),
- (identifier, Name.Function, 'instruction-args'),
- (r'[\r\n]+', Text)
- ],
- 'instruction-args': [
- (string, String),
- (hexn, Number.Hex),
- (octn, Number.Oct),
- (binn, Number.Bin),
- (floatn, Number.Float),
- (decn, Number.Integer),
- include('punctuation'),
- (register, Name.Builtin),
- (identifier, Name.Variable),
- (r'[\r\n]+', Text, '#pop'),
- include('whitespace')
- ],
- 'preproc': [
- (r'[^;\n]+', Comment.Preproc),
- (r';.*?\n', Comment.Single, '#pop'),
- (r'\n', Comment.Preproc, '#pop'),
- ],
- 'whitespace': [
- (r'\n', Text),
- (r'[ \t]+', Text),
- (r';.*', Comment.Single)
- ],
- 'punctuation': [
- (r'[,():\[\]]+', Punctuation),
- (r'[&|^<>+*/%~-]+', Operator),
- (r'[$]+', Keyword.Constant),
- (wordop, Operator.Word),
- (type, Keyword.Type)
- ],
- }
-
- def analyse_text(text):
- # Probably TASM
- if re.match(r'PROC', text, re.IGNORECASE):
- return False
-
-
-class NasmObjdumpLexer(ObjdumpLexer):
- """
- For the output of 'objdump -d -M intel'.
-
- .. versionadded:: 2.0
- """
- name = 'objdump-nasm'
- aliases = ['objdump-nasm']
- filenames = ['*.objdump-intel']
- mimetypes = ['text/x-nasm-objdump']
-
- tokens = _objdump_lexer_tokens(NasmLexer)
-
-
-class TasmLexer(RegexLexer):
- """
- For Tasm (Turbo Assembler) assembly code.
- """
- name = 'TASM'
- aliases = ['tasm']
- filenames = ['*.asm', '*.ASM', '*.tasm']
- mimetypes = ['text/x-tasm']
-
- identifier = r'[@a-z$._?][\w$.?#@~]*'
- hexn = r'(?:0x[0-9a-f]+|$0[0-9a-f]*|[0-9]+[0-9a-f]*h)'
- octn = r'[0-7]+q'
- binn = r'[01]+b'
- decn = r'[0-9]+'
- floatn = decn + r'\.e?' + decn
- string = r'"(\\"|[^"\n])*"|' + r"'(\\'|[^'\n])*'|" + r"`(\\`|[^`\n])*`"
- declkw = r'(?:res|d)[bwdqt]|times'
- register = (r'r[0-9][0-5]?[bwd]|'
- r'[a-d][lh]|[er]?[a-d]x|[er]?[sb]p|[er]?[sd]i|[c-gs]s|st[0-7]|'
- r'mm[0-7]|cr[0-4]|dr[0-367]|tr[3-7]')
- wordop = r'seg|wrt|strict'
- type = r'byte|[dq]?word'
- directives = (r'BITS|USE16|USE32|SECTION|SEGMENT|ABSOLUTE|EXTERN|GLOBAL|'
- r'ORG|ALIGN|STRUC|ENDSTRUC|ENDS|COMMON|CPU|GROUP|UPPERCASE|INCLUDE|'
- r'EXPORT|LIBRARY|MODULE|PROC|ENDP|USES|ARG|DATASEG|UDATASEG|END|IDEAL|'
- r'P386|MODEL|ASSUME|CODESEG|SIZE')
- # T[A-Z][a-z] is more of a convention. Lexer should filter out STRUC definitions
- # and then 'add' them to datatype somehow.
- datatype = (r'db|dd|dw|T[A-Z][a-z]+')
-
- flags = re.IGNORECASE | re.MULTILINE
- tokens = {
- 'root': [
- (r'^\s*%', Comment.Preproc, 'preproc'),
- include('whitespace'),
- (identifier + ':', Name.Label),
- (directives, Keyword, 'instruction-args'),
- (r'(%s)(\s+)(%s)' % (identifier, datatype),
- bygroups(Name.Constant, Keyword.Declaration, Keyword.Declaration),
- 'instruction-args'),
- (declkw, Keyword.Declaration, 'instruction-args'),
- (identifier, Name.Function, 'instruction-args'),
- (r'[\r\n]+', Text)
- ],
- 'instruction-args': [
- (string, String),
- (hexn, Number.Hex),
- (octn, Number.Oct),
- (binn, Number.Bin),
- (floatn, Number.Float),
- (decn, Number.Integer),
- include('punctuation'),
- (register, Name.Builtin),
- (identifier, Name.Variable),
- # Do not match newline when it's preceeded by a backslash
- (r'(\\\s*)(;.*)([\r\n])', bygroups(Text, Comment.Single, Text)),
- (r'[\r\n]+', Text, '#pop'),
- include('whitespace')
- ],
- 'preproc': [
- (r'[^;\n]+', Comment.Preproc),
- (r';.*?\n', Comment.Single, '#pop'),
- (r'\n', Comment.Preproc, '#pop'),
- ],
- 'whitespace': [
- (r'[\n\r]', Text),
- (r'\\[\n\r]', Text),
- (r'[ \t]+', Text),
- (r';.*', Comment.Single)
- ],
- 'punctuation': [
- (r'[,():\[\]]+', Punctuation),
- (r'[&|^<>+*=/%~-]+', Operator),
- (r'[$]+', Keyword.Constant),
- (wordop, Operator.Word),
- (type, Keyword.Type)
- ],
- }
-
- def analyse_text(text):
- # See above
- if re.match(r'PROC', text, re.I):
- return True
-
-
-class Ca65Lexer(RegexLexer):
- """
- For ca65 assembler sources.
-
- .. versionadded:: 1.6
- """
- name = 'ca65 assembler'
- aliases = ['ca65']
- filenames = ['*.s']
-
- flags = re.IGNORECASE
-
- tokens = {
- 'root': [
- (r';.*', Comment.Single),
- (r'\s+', Text),
- (r'[a-z_.@$][\w.@$]*:', Name.Label),
- (r'((ld|st)[axy]|(in|de)[cxy]|asl|lsr|ro[lr]|adc|sbc|cmp|cp[xy]'
- r'|cl[cvdi]|se[cdi]|jmp|jsr|bne|beq|bpl|bmi|bvc|bvs|bcc|bcs'
- r'|p[lh][ap]|rt[is]|brk|nop|ta[xy]|t[xy]a|txs|tsx|and|ora|eor'
- r'|bit)\b', Keyword),
- (r'\.\w+', Keyword.Pseudo),
- (r'[-+~*/^&|!<>=]', Operator),
- (r'"[^"\n]*.', String),
- (r"'[^'\n]*.", String.Char),
- (r'\$[0-9a-f]+|[0-9a-f]+h\b', Number.Hex),
- (r'\d+', Number.Integer),
- (r'%[01]+', Number.Bin),
- (r'[#,.:()=\[\]]', Punctuation),
- (r'[a-z_.@$][\w.@$]*', Name),
- ]
- }
-
- def analyse_text(self, text):
- # comments in GAS start with "#"
- if re.match(r'^\s*;', text, re.MULTILINE):
- return 0.9
-
-
-class Dasm16Lexer(RegexLexer):
- """
- Simple lexer for DCPU-16 Assembly
-
- Check http://0x10c.com/doc/dcpu-16.txt
-
- .. versionadded:: 2.4
- """
- name = 'DASM16'
- aliases = ['dasm16']
- filenames = ['*.dasm16', '*.dasm']
- mimetypes = ['text/x-dasm16']
-
- INSTRUCTIONS = [
- 'SET',
- 'ADD', 'SUB',
- 'MUL', 'MLI',
- 'DIV', 'DVI',
- 'MOD', 'MDI',
- 'AND', 'BOR', 'XOR',
- 'SHR', 'ASR', 'SHL',
- 'IFB', 'IFC', 'IFE', 'IFN', 'IFG', 'IFA', 'IFL', 'IFU',
- 'ADX', 'SBX',
- 'STI', 'STD',
- 'JSR',
- 'INT', 'IAG', 'IAS', 'RFI', 'IAQ', 'HWN', 'HWQ', 'HWI',
- ]
-
- REGISTERS = [
- 'A', 'B', 'C',
- 'X', 'Y', 'Z',
- 'I', 'J',
- 'SP', 'PC', 'EX',
- 'POP', 'PEEK', 'PUSH'
- ]
-
- # Regexes yo
- char = r'[a-zA-Z$._0-9@]'
- identifier = r'(?:[a-zA-Z$_]' + char + r'*|\.' + char + '+)'
- number = r'[+-]?(?:0[xX][a-zA-Z0-9]+|\d+)'
- binary_number = r'0b[01_]+'
- instruction = r'(?i)(' + '|'.join(INSTRUCTIONS) + ')'
- single_char = r"'\\?" + char + "'"
- string = r'"(\\"|[^"])*"'
-
- def guess_identifier(lexer, match):
- ident = match.group(0)
- klass = Name.Variable if ident.upper() in lexer.REGISTERS else Name.Label
- yield match.start(), klass, ident
-
- tokens = {
- 'root': [
- include('whitespace'),
- (':' + identifier, Name.Label),
- (identifier + ':', Name.Label),
- (instruction, Name.Function, 'instruction-args'),
- (r'\.' + identifier, Name.Function, 'data-args'),
- (r'[\r\n]+', Text)
- ],
-
- 'numeric' : [
- (binary_number, Number.Integer),
- (number, Number.Integer),
- (single_char, String),
- ],
-
- 'arg' : [
- (identifier, guess_identifier),
- include('numeric')
- ],
-
- 'deref' : [
- (r'\+', Punctuation),
- (r'\]', Punctuation, '#pop'),
- include('arg'),
- include('whitespace')
- ],
-
- 'instruction-line' : [
- (r'[\r\n]+', Text, '#pop'),
- (r';.*?$', Comment, '#pop'),
- include('whitespace')
- ],
-
- 'instruction-args': [
- (r',', Punctuation),
- (r'\[', Punctuation, 'deref'),
- include('arg'),
- include('instruction-line')
- ],
-
- 'data-args' : [
- (r',', Punctuation),
- include('numeric'),
- (string, String),
- include('instruction-line')
- ],
-
- 'whitespace': [
- (r'\n', Text),
- (r'\s+', Text),
- (r';.*?\n', Comment)
- ],
- }
diff --git a/pygments/lexers/automation.py b/pygments/lexers/automation.py
deleted file mode 100644
index 5f27b6c6..00000000
--- a/pygments/lexers/automation.py
+++ /dev/null
@@ -1,374 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.automation
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for automation scripting languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, bygroups, combined
-from pygments.token import Text, Comment, Operator, Name, String, \
- Number, Punctuation, Generic
-
-__all__ = ['AutohotkeyLexer', 'AutoItLexer']
-
-
-class AutohotkeyLexer(RegexLexer):
- """
- For `autohotkey <http://www.autohotkey.com/>`_ source code.
-
- .. versionadded:: 1.4
- """
- name = 'autohotkey'
- aliases = ['ahk', 'autohotkey']
- filenames = ['*.ahk', '*.ahkl']
- mimetypes = ['text/x-autohotkey']
-
- tokens = {
- 'root': [
- (r'^(\s*)(/\*)', bygroups(Text, Comment.Multiline), 'incomment'),
- (r'^(\s*)(\()', bygroups(Text, Generic), 'incontinuation'),
- (r'\s+;.*?$', Comment.Single),
- (r'^;.*?$', Comment.Single),
- (r'[]{}(),;[]', Punctuation),
- (r'(in|is|and|or|not)\b', Operator.Word),
- (r'\%[a-zA-Z_#@$][\w#@$]*\%', Name.Variable),
- (r'!=|==|:=|\.=|<<|>>|[-~+/*%=<>&^|?:!.]', Operator),
- include('commands'),
- include('labels'),
- include('builtInFunctions'),
- include('builtInVariables'),
- (r'"', String, combined('stringescape', 'dqs')),
- include('numbers'),
- (r'[a-zA-Z_#@$][\w#@$]*', Name),
- (r'\\|\'', Text),
- (r'\`([,%`abfnrtv\-+;])', String.Escape),
- include('garbage'),
- ],
- 'incomment': [
- (r'^\s*\*/', Comment.Multiline, '#pop'),
- (r'[^*/]', Comment.Multiline),
- (r'[*/]', Comment.Multiline)
- ],
- 'incontinuation': [
- (r'^\s*\)', Generic, '#pop'),
- (r'[^)]', Generic),
- (r'[)]', Generic),
- ],
- '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),
- ],
- 'labels': [
- # hotkeys and labels
- # technically, hotkey names are limited to named keys and buttons
- (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\d+', Number.Oct),
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
- (r'\d+L', Number.Integer.Long),
- (r'\d+', Number.Integer)
- ],
- 'stringescape': [
- (r'\"\"|\`([,%`abfnrtv])', String.Escape),
- ],
- 'strings': [
- (r'[^"\n]+', String),
- ],
- 'dqs': [
- (r'"', String, '#pop'),
- include('strings')
- ],
- 'garbage': [
- (r'[^\S\n]', Text),
- # (r'.', Text), # no cheating
- ],
- }
-
-
-class AutoItLexer(RegexLexer):
- """
- For `AutoIt <http://www.autoitscript.com/site/autoit/>`_ files.
-
- AutoIt is a freeware BASIC-like scripting language
- designed for automating the Windows GUI and general scripting
-
- .. versionadded:: 1.6
- """
- name = 'AutoIt'
- aliases = ['autoit']
- filenames = ['*.au3']
- mimetypes = ['text/x-autoit']
-
- # Keywords, functions, macros from au3.keywords.properties
- # which can be found in AutoIt installed directory, e.g.
- # c:\Program Files (x86)\AutoIt3\SciTE\au3.keywords.properties
-
- keywords = """\
- #include-once #include #endregion #forcedef #forceref #region
- and byref case continueloop dim do else elseif endfunc endif
- endselect exit exitloop for func global
- if local next not or return select step
- then to until wend while exit""".split()
-
- functions = """\
- abs acos adlibregister adlibunregister asc ascw asin assign atan
- autoitsetoption autoitwingettitle autoitwinsettitle beep binary binarylen
- binarymid binarytostring bitand bitnot bitor bitrotate bitshift bitxor
- blockinput break call cdtray ceiling chr chrw clipget clipput consoleread
- consolewrite consolewriteerror controlclick controlcommand controldisable
- controlenable controlfocus controlgetfocus controlgethandle controlgetpos
- controlgettext controlhide controllistview controlmove controlsend
- controlsettext controlshow controltreeview cos dec dircopy dircreate
- dirgetsize dirmove dirremove dllcall dllcalladdress dllcallbackfree
- dllcallbackgetptr dllcallbackregister dllclose dllopen dllstructcreate
- dllstructgetdata dllstructgetptr dllstructgetsize dllstructsetdata
- drivegetdrive drivegetfilesystem drivegetlabel drivegetserial drivegettype
- drivemapadd drivemapdel drivemapget drivesetlabel drivespacefree
- drivespacetotal drivestatus envget envset envupdate eval execute exp
- filechangedir fileclose filecopy filecreatentfslink filecreateshortcut
- filedelete fileexists filefindfirstfile filefindnextfile fileflush
- filegetattrib filegetencoding filegetlongname filegetpos filegetshortcut
- filegetshortname filegetsize filegettime filegetversion fileinstall filemove
- fileopen fileopendialog fileread filereadline filerecycle filerecycleempty
- filesavedialog fileselectfolder filesetattrib filesetpos filesettime
- filewrite filewriteline floor ftpsetproxy guicreate guictrlcreateavi
- guictrlcreatebutton guictrlcreatecheckbox guictrlcreatecombo
- guictrlcreatecontextmenu guictrlcreatedate guictrlcreatedummy
- guictrlcreateedit guictrlcreategraphic guictrlcreategroup guictrlcreateicon
- guictrlcreateinput guictrlcreatelabel guictrlcreatelist
- guictrlcreatelistview guictrlcreatelistviewitem guictrlcreatemenu
- guictrlcreatemenuitem guictrlcreatemonthcal guictrlcreateobj
- guictrlcreatepic guictrlcreateprogress guictrlcreateradio
- guictrlcreateslider guictrlcreatetab guictrlcreatetabitem
- guictrlcreatetreeview guictrlcreatetreeviewitem guictrlcreateupdown
- guictrldelete guictrlgethandle guictrlgetstate guictrlread guictrlrecvmsg
- guictrlregisterlistviewsort guictrlsendmsg guictrlsendtodummy
- guictrlsetbkcolor guictrlsetcolor guictrlsetcursor guictrlsetdata
- guictrlsetdefbkcolor guictrlsetdefcolor guictrlsetfont guictrlsetgraphic
- guictrlsetimage guictrlsetlimit guictrlsetonevent guictrlsetpos
- guictrlsetresizing guictrlsetstate guictrlsetstyle guictrlsettip guidelete
- guigetcursorinfo guigetmsg guigetstyle guiregistermsg guisetaccelerators
- guisetbkcolor guisetcoord guisetcursor guisetfont guisethelp guiseticon
- guisetonevent guisetstate guisetstyle guistartgroup guiswitch hex hotkeyset
- httpsetproxy httpsetuseragent hwnd inetclose inetget inetgetinfo inetgetsize
- inetread inidelete iniread inireadsection inireadsectionnames
- inirenamesection iniwrite iniwritesection inputbox int isadmin isarray
- isbinary isbool isdeclared isdllstruct isfloat ishwnd isint iskeyword
- isnumber isobj isptr isstring log memgetstats mod mouseclick mouseclickdrag
- mousedown mousegetcursor mousegetpos mousemove mouseup mousewheel msgbox
- number objcreate objcreateinterface objevent objevent objget objname
- onautoitexitregister onautoitexitunregister opt ping pixelchecksum
- pixelgetcolor pixelsearch pluginclose pluginopen processclose processexists
- processgetstats processlist processsetpriority processwait processwaitclose
- progressoff progresson progressset ptr random regdelete regenumkey
- regenumval regread regwrite round run runas runaswait runwait send
- sendkeepactive seterror setextended shellexecute shellexecutewait shutdown
- sin sleep soundplay soundsetwavevolume splashimageon splashoff splashtexton
- sqrt srandom statusbargettext stderrread stdinwrite stdioclose stdoutread
- string stringaddcr stringcompare stringformat stringfromasciiarray
- stringinstr stringisalnum stringisalpha stringisascii stringisdigit
- stringisfloat stringisint stringislower stringisspace stringisupper
- stringisxdigit stringleft stringlen stringlower stringmid stringregexp
- stringregexpreplace stringreplace stringright stringsplit stringstripcr
- stringstripws stringtoasciiarray stringtobinary stringtrimleft
- stringtrimright stringupper tan tcpaccept tcpclosesocket tcpconnect
- tcplisten tcpnametoip tcprecv tcpsend tcpshutdown tcpstartup timerdiff
- timerinit tooltip traycreateitem traycreatemenu traygetmsg trayitemdelete
- trayitemgethandle trayitemgetstate trayitemgettext trayitemsetonevent
- trayitemsetstate trayitemsettext traysetclick trayseticon traysetonevent
- traysetpauseicon traysetstate traysettooltip traytip ubound udpbind
- udpclosesocket udpopen udprecv udpsend udpshutdown udpstartup vargettype
- winactivate winactive winclose winexists winflash wingetcaretpos
- wingetclasslist wingetclientsize wingethandle wingetpos wingetprocess
- wingetstate wingettext wingettitle winkill winlist winmenuselectitem
- winminimizeall winminimizeallundo winmove winsetontop winsetstate
- winsettitle winsettrans winwait winwaitactive winwaitclose
- winwaitnotactive""".split()
-
- macros = """\
- @appdatacommondir @appdatadir @autoitexe @autoitpid @autoitversion
- @autoitx64 @com_eventobj @commonfilesdir @compiled @computername @comspec
- @cpuarch @cr @crlf @desktopcommondir @desktopdepth @desktopdir
- @desktopheight @desktoprefresh @desktopwidth @documentscommondir @error
- @exitcode @exitmethod @extended @favoritescommondir @favoritesdir
- @gui_ctrlhandle @gui_ctrlid @gui_dragfile @gui_dragid @gui_dropid
- @gui_winhandle @homedrive @homepath @homeshare @hotkeypressed @hour
- @ipaddress1 @ipaddress2 @ipaddress3 @ipaddress4 @kblayout @lf
- @logondnsdomain @logondomain @logonserver @mday @min @mon @msec @muilang
- @mydocumentsdir @numparams @osarch @osbuild @oslang @osservicepack @ostype
- @osversion @programfilesdir @programscommondir @programsdir @scriptdir
- @scriptfullpath @scriptlinenumber @scriptname @sec @startmenucommondir
- @startmenudir @startupcommondir @startupdir @sw_disable @sw_enable @sw_hide
- @sw_lock @sw_maximize @sw_minimize @sw_restore @sw_show @sw_showdefault
- @sw_showmaximized @sw_showminimized @sw_showminnoactive @sw_showna
- @sw_shownoactivate @sw_shownormal @sw_unlock @systemdir @tab @tempdir
- @tray_id @trayiconflashing @trayiconvisible @username @userprofiledir @wday
- @windowsdir @workingdir @yday @year""".split()
-
- tokens = {
- 'root': [
- (r';.*\n', Comment.Single),
- (r'(#comments-start|#cs)(.|\n)*?(#comments-end|#ce)',
- Comment.Multiline),
- (r'[\[\]{}(),;]', Punctuation),
- (r'(and|or|not)\b', Operator.Word),
- (r'[$|@][a-zA-Z_]\w*', Name.Variable),
- (r'!=|==|:=|\.=|<<|>>|[-~+/*%=<>&^|?:!.]', Operator),
- include('commands'),
- include('labels'),
- include('builtInFunctions'),
- include('builtInMarcros'),
- (r'"', String, combined('stringescape', 'dqs')),
- include('numbers'),
- (r'[a-zA-Z_#@$][\w#@$]*', Name),
- (r'\\|\'', Text),
- (r'\`([,%`abfnrtv\-+;])', String.Escape),
- (r'_\n', Text), # Line continuation
- include('garbage'),
- ],
- 'commands': [
- (r'(?i)(\s*)(%s)\b' % '|'.join(keywords),
- bygroups(Text, Name.Builtin)),
- ],
- 'builtInFunctions': [
- (r'(?i)(%s)\b' % '|'.join(functions),
- Name.Function),
- ],
- 'builtInMarcros': [
- (r'(?i)(%s)\b' % '|'.join(macros),
- Name.Variable.Global),
- ],
- 'labels': [
- # sendkeys
- (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\d+', Number.Oct),
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
- (r'\d+L', Number.Integer.Long),
- (r'\d+', Number.Integer)
- ],
- 'stringescape': [
- (r'\"\"|\`([,%`abfnrtv])', String.Escape),
- ],
- 'strings': [
- (r'[^"\n]+', String),
- ],
- 'dqs': [
- (r'"', String, '#pop'),
- include('strings')
- ],
- 'garbage': [
- (r'[^\S\n]', Text),
- ],
- }
diff --git a/pygments/lexers/basic.py b/pygments/lexers/basic.py
deleted file mode 100644
index 372c8229..00000000
--- a/pygments/lexers/basic.py
+++ /dev/null
@@ -1,659 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.basic
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for BASIC like languages (other than VB.net).
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, default, words, include
-from pygments.token import Comment, Error, Keyword, Name, Number, \
- Punctuation, Operator, String, Text, Whitespace
-from pygments.lexers import _vbscript_builtins
-
-
-__all__ = ['BlitzBasicLexer', 'BlitzMaxLexer', 'MonkeyLexer', 'CbmBasicV2Lexer',
- 'QBasicLexer', 'VBScriptLexer', 'BBCBasicLexer']
-
-
-
-class BlitzMaxLexer(RegexLexer):
- """
- For `BlitzMax <http://blitzbasic.com>`_ source code.
-
- .. versionadded:: 1.4
- """
-
- name = 'BlitzMax'
- aliases = ['blitzmax', 'bmax']
- filenames = ['*.bmx']
- mimetypes = ['text/x-bmx']
-
- bmax_vopwords = r'\b(Shl|Shr|Sar|Mod)\b'
- bmax_sktypes = r'@{1,2}|[!#$%]'
- bmax_lktypes = r'\b(Int|Byte|Short|Float|Double|Long)\b'
- bmax_name = r'[a-z_]\w*'
- bmax_var = (r'(%s)(?:(?:([ \t]*)(%s)|([ \t]*:[ \t]*\b(?:Shl|Shr|Sar|Mod)\b)'
- r'|([ \t]*)(:)([ \t]*)(?:%s|(%s)))(?:([ \t]*)(Ptr))?)') % \
- (bmax_name, bmax_sktypes, bmax_lktypes, bmax_name)
- bmax_func = bmax_var + r'?((?:[ \t]|\.\.\n)*)([(])'
-
- flags = re.MULTILINE | re.IGNORECASE
- tokens = {
- 'root': [
- # Text
- (r'[ \t]+', Text),
- (r'\.\.\n', Text), # Line continuation
- # Comments
- (r"'.*?\n", Comment.Single),
- (r'([ \t]*)\bRem\n(\n|.)*?\s*\bEnd([ \t]*)Rem', Comment.Multiline),
- # Data types
- ('"', String.Double, 'string'),
- # Numbers
- (r'[0-9]+\.[0-9]*(?!\.)', Number.Float),
- (r'\.[0-9]*(?!\.)', Number.Float),
- (r'[0-9]+', Number.Integer),
- (r'\$[0-9a-f]+', Number.Hex),
- (r'\%[10]+', Number.Bin),
- # Other
- (r'(?:(?:(:)?([ \t]*)(:?%s|([+\-*/&|~]))|Or|And|Not|[=<>^]))' %
- (bmax_vopwords), Operator),
- (r'[(),.:\[\]]', Punctuation),
- (r'(?:#[\w \t]*)', Name.Label),
- (r'(?:\?[\w \t]*)', Comment.Preproc),
- # Identifiers
- (r'\b(New)\b([ \t]?)([(]?)(%s)' % (bmax_name),
- bygroups(Keyword.Reserved, Text, Punctuation, Name.Class)),
- (r'\b(Import|Framework|Module)([ \t]+)(%s\.%s)' %
- (bmax_name, bmax_name),
- bygroups(Keyword.Reserved, Text, Keyword.Namespace)),
- (bmax_func, bygroups(Name.Function, Text, Keyword.Type,
- Operator, Text, Punctuation, Text,
- Keyword.Type, Name.Class, Text,
- Keyword.Type, Text, Punctuation)),
- (bmax_var, bygroups(Name.Variable, Text, Keyword.Type, Operator,
- Text, Punctuation, Text, Keyword.Type,
- Name.Class, Text, Keyword.Type)),
- (r'\b(Type|Extends)([ \t]+)(%s)' % (bmax_name),
- bygroups(Keyword.Reserved, Text, Name.Class)),
- # Keywords
- (r'\b(Ptr)\b', Keyword.Type),
- (r'\b(Pi|True|False|Null|Self|Super)\b', Keyword.Constant),
- (r'\b(Local|Global|Const|Field)\b', Keyword.Declaration),
- (words((
- 'TNullMethodException', 'TNullFunctionException',
- 'TNullObjectException', 'TArrayBoundsException',
- 'TRuntimeException'), prefix=r'\b', suffix=r'\b'), Name.Exception),
- (words((
- 'Strict', 'SuperStrict', 'Module', 'ModuleInfo',
- 'End', 'Return', 'Continue', 'Exit', 'Public', 'Private',
- 'Var', 'VarPtr', 'Chr', 'Len', 'Asc', 'SizeOf', 'Sgn', 'Abs', 'Min', 'Max',
- 'New', 'Release', 'Delete', 'Incbin', 'IncbinPtr', 'IncbinLen',
- 'Framework', 'Include', 'Import', 'Extern', 'EndExtern',
- 'Function', 'EndFunction', 'Type', 'EndType', 'Extends', 'Method', 'EndMethod',
- 'Abstract', 'Final', 'If', 'Then', 'Else', 'ElseIf', 'EndIf',
- 'For', 'To', 'Next', 'Step', 'EachIn', 'While', 'Wend', 'EndWhile',
- 'Repeat', 'Until', 'Forever', 'Select', 'Case', 'Default', 'EndSelect',
- 'Try', 'Catch', 'EndTry', 'Throw', 'Assert', 'Goto', 'DefData', 'ReadData',
- 'RestoreData'), prefix=r'\b', suffix=r'\b'),
- Keyword.Reserved),
- # Final resolve (for variable names and such)
- (r'(%s)' % (bmax_name), Name.Variable),
- ],
- 'string': [
- (r'""', String.Double),
- (r'"C?', String.Double, '#pop'),
- (r'[^"]+', String.Double),
- ],
- }
-
-
-class BlitzBasicLexer(RegexLexer):
- """
- For `BlitzBasic <http://blitzbasic.com>`_ source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'BlitzBasic'
- aliases = ['blitzbasic', 'b3d', 'bplus']
- filenames = ['*.bb', '*.decls']
- mimetypes = ['text/x-bb']
-
- bb_sktypes = r'@{1,2}|[#$%]'
- bb_name = r'[a-z]\w*'
- bb_var = (r'(%s)(?:([ \t]*)(%s)|([ \t]*)([.])([ \t]*)(?:(%s)))?') % \
- (bb_name, bb_sktypes, bb_name)
-
- flags = re.MULTILINE | re.IGNORECASE
- tokens = {
- 'root': [
- # Text
- (r'[ \t]+', Text),
- # Comments
- (r";.*?\n", Comment.Single),
- # Data types
- ('"', String.Double, 'string'),
- # Numbers
- (r'[0-9]+\.[0-9]*(?!\.)', Number.Float),
- (r'\.[0-9]+(?!\.)', Number.Float),
- (r'[0-9]+', Number.Integer),
- (r'\$[0-9a-f]+', Number.Hex),
- (r'\%[10]+', Number.Bin),
- # Other
- (words(('Shl', 'Shr', 'Sar', 'Mod', 'Or', 'And', 'Not',
- 'Abs', 'Sgn', 'Handle', 'Int', 'Float', 'Str',
- 'First', 'Last', 'Before', 'After'),
- prefix=r'\b', suffix=r'\b'),
- Operator),
- (r'([+\-*/~=<>^])', Operator),
- (r'[(),:\[\]\\]', Punctuation),
- (r'\.([ \t]*)(%s)' % bb_name, Name.Label),
- # Identifiers
- (r'\b(New)\b([ \t]+)(%s)' % (bb_name),
- bygroups(Keyword.Reserved, Text, Name.Class)),
- (r'\b(Gosub|Goto)\b([ \t]+)(%s)' % (bb_name),
- bygroups(Keyword.Reserved, Text, Name.Label)),
- (r'\b(Object)\b([ \t]*)([.])([ \t]*)(%s)\b' % (bb_name),
- bygroups(Operator, Text, Punctuation, Text, Name.Class)),
- (r'\b%s\b([ \t]*)(\()' % bb_var,
- bygroups(Name.Function, Text, Keyword.Type, Text, Punctuation,
- Text, Name.Class, Text, Punctuation)),
- (r'\b(Function)\b([ \t]+)%s' % bb_var,
- bygroups(Keyword.Reserved, Text, Name.Function, Text, Keyword.Type,
- Text, Punctuation, Text, Name.Class)),
- (r'\b(Type)([ \t]+)(%s)' % (bb_name),
- bygroups(Keyword.Reserved, Text, Name.Class)),
- # Keywords
- (r'\b(Pi|True|False|Null)\b', Keyword.Constant),
- (r'\b(Local|Global|Const|Field|Dim)\b', Keyword.Declaration),
- (words((
- 'End', 'Return', 'Exit', 'Chr', 'Len', 'Asc', 'New', 'Delete', 'Insert',
- 'Include', 'Function', 'Type', 'If', 'Then', 'Else', 'ElseIf', 'EndIf',
- 'For', 'To', 'Next', 'Step', 'Each', 'While', 'Wend',
- 'Repeat', 'Until', 'Forever', 'Select', 'Case', 'Default',
- 'Goto', 'Gosub', 'Data', 'Read', 'Restore'), prefix=r'\b', suffix=r'\b'),
- Keyword.Reserved),
- # Final resolve (for variable names and such)
- # (r'(%s)' % (bb_name), Name.Variable),
- (bb_var, bygroups(Name.Variable, Text, Keyword.Type,
- Text, Punctuation, Text, Name.Class)),
- ],
- 'string': [
- (r'""', String.Double),
- (r'"C?', String.Double, '#pop'),
- (r'[^"]+', String.Double),
- ],
- }
-
-
-class MonkeyLexer(RegexLexer):
- """
- For
- `Monkey <https://en.wikipedia.org/wiki/Monkey_(programming_language)>`_
- source code.
-
- .. versionadded:: 1.6
- """
-
- name = 'Monkey'
- aliases = ['monkey']
- filenames = ['*.monkey']
- mimetypes = ['text/x-monkey']
-
- name_variable = r'[a-z_]\w*'
- name_function = r'[A-Z]\w*'
- name_constant = r'[A-Z_][A-Z0-9_]*'
- name_class = r'[A-Z]\w*'
- name_module = r'[a-z0-9_]*'
-
- keyword_type = r'(?:Int|Float|String|Bool|Object|Array|Void)'
- # ? == Bool // % == Int // # == Float // $ == String
- keyword_type_special = r'[?%#$]'
-
- flags = re.MULTILINE
-
- tokens = {
- 'root': [
- # Text
- (r'\s+', Text),
- # Comments
- (r"'.*", Comment),
- (r'(?i)^#rem\b', Comment.Multiline, 'comment'),
- # preprocessor directives
- (r'(?i)^(?:#If|#ElseIf|#Else|#EndIf|#End|#Print|#Error)\b', Comment.Preproc),
- # preprocessor variable (any line starting with '#' that is not a directive)
- (r'^#', Comment.Preproc, 'variables'),
- # String
- ('"', String.Double, 'string'),
- # Numbers
- (r'[0-9]+\.[0-9]*(?!\.)', Number.Float),
- (r'\.[0-9]+(?!\.)', Number.Float),
- (r'[0-9]+', Number.Integer),
- (r'\$[0-9a-fA-Z]+', Number.Hex),
- (r'\%[10]+', Number.Bin),
- # Native data types
- (r'\b%s\b' % keyword_type, Keyword.Type),
- # Exception handling
- (r'(?i)\b(?:Try|Catch|Throw)\b', Keyword.Reserved),
- (r'Throwable', Name.Exception),
- # Builtins
- (r'(?i)\b(?:Null|True|False)\b', Name.Builtin),
- (r'(?i)\b(?:Self|Super)\b', Name.Builtin.Pseudo),
- (r'\b(?:HOST|LANG|TARGET|CONFIG)\b', Name.Constant),
- # Keywords
- (r'(?i)^(Import)(\s+)(.*)(\n)',
- bygroups(Keyword.Namespace, Text, Name.Namespace, Text)),
- (r'(?i)^Strict\b.*\n', Keyword.Reserved),
- (r'(?i)(Const|Local|Global|Field)(\s+)',
- bygroups(Keyword.Declaration, Text), 'variables'),
- (r'(?i)(New|Class|Interface|Extends|Implements)(\s+)',
- bygroups(Keyword.Reserved, Text), 'classname'),
- (r'(?i)(Function|Method)(\s+)',
- bygroups(Keyword.Reserved, Text), 'funcname'),
- (r'(?i)(?:End|Return|Public|Private|Extern|Property|'
- r'Final|Abstract)\b', Keyword.Reserved),
- # Flow Control stuff
- (r'(?i)(?:If|Then|Else|ElseIf|EndIf|'
- r'Select|Case|Default|'
- r'While|Wend|'
- r'Repeat|Until|Forever|'
- r'For|To|Until|Step|EachIn|Next|'
- r'Exit|Continue)\s+', Keyword.Reserved),
- # not used yet
- (r'(?i)\b(?:Module|Inline)\b', Keyword.Reserved),
- # Array
- (r'[\[\]]', Punctuation),
- # Other
- (r'<=|>=|<>|\*=|/=|\+=|-=|&=|~=|\|=|[-&*/^+=<>|~]', Operator),
- (r'(?i)(?:Not|Mod|Shl|Shr|And|Or)', Operator.Word),
- (r'[(){}!#,.:]', Punctuation),
- # catch the rest
- (r'%s\b' % name_constant, Name.Constant),
- (r'%s\b' % name_function, Name.Function),
- (r'%s\b' % name_variable, Name.Variable),
- ],
- 'funcname': [
- (r'(?i)%s\b' % name_function, Name.Function),
- (r':', Punctuation, 'classname'),
- (r'\s+', Text),
- (r'\(', Punctuation, 'variables'),
- (r'\)', Punctuation, '#pop')
- ],
- 'classname': [
- (r'%s\.' % name_module, Name.Namespace),
- (r'%s\b' % keyword_type, Keyword.Type),
- (r'%s\b' % name_class, Name.Class),
- # array (of given size)
- (r'(\[)(\s*)(\d*)(\s*)(\])',
- bygroups(Punctuation, Text, Number.Integer, Text, Punctuation)),
- # generics
- (r'\s+(?!<)', Text, '#pop'),
- (r'<', Punctuation, '#push'),
- (r'>', Punctuation, '#pop'),
- (r'\n', Text, '#pop'),
- default('#pop')
- ],
- 'variables': [
- (r'%s\b' % name_constant, Name.Constant),
- (r'%s\b' % name_variable, Name.Variable),
- (r'%s' % keyword_type_special, Keyword.Type),
- (r'\s+', Text),
- (r':', Punctuation, 'classname'),
- (r',', Punctuation, '#push'),
- default('#pop')
- ],
- 'string': [
- (r'[^"~]+', String.Double),
- (r'~q|~n|~r|~t|~z|~~', String.Escape),
- (r'"', String.Double, '#pop'),
- ],
- 'comment': [
- (r'(?i)^#rem.*?', Comment.Multiline, "#push"),
- (r'(?i)^#end.*?', Comment.Multiline, "#pop"),
- (r'\n', Comment.Multiline),
- (r'.+', Comment.Multiline),
- ],
- }
-
-
-class CbmBasicV2Lexer(RegexLexer):
- """
- For CBM BASIC V2 sources.
-
- .. versionadded:: 1.6
- """
- name = 'CBM BASIC V2'
- aliases = ['cbmbas']
- filenames = ['*.bas']
-
- flags = re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'rem.*\n', Comment.Single),
- (r'\s+', Text),
- (r'new|run|end|for|to|next|step|go(to|sub)?|on|return|stop|cont'
- r'|if|then|input#?|read|wait|load|save|verify|poke|sys|print#?'
- r'|list|clr|cmd|open|close|get#?', Keyword.Reserved),
- (r'data|restore|dim|let|def|fn', Keyword.Declaration),
- (r'tab|spc|sgn|int|abs|usr|fre|pos|sqr|rnd|log|exp|cos|sin|tan|atn'
- r'|peek|len|val|asc|(str|chr|left|right|mid)\$', Name.Builtin),
- (r'[-+*/^<>=]', Operator),
- (r'not|and|or', Operator.Word),
- (r'"[^"\n]*.', String),
- (r'\d+|[-+]?\d*\.\d*(e[-+]?\d+)?', Number.Float),
- (r'[(),:;]', Punctuation),
- (r'\w+[$%]?', Name),
- ]
- }
-
- def analyse_text(self, text):
- # if it starts with a line number, it shouldn't be a "modern" Basic
- # like VB.net
- if re.match(r'\d+', text):
- return 0.2
-
-
-class QBasicLexer(RegexLexer):
- """
- For
- `QBasic <http://en.wikipedia.org/wiki/QBasic>`_
- source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'QBasic'
- aliases = ['qbasic', 'basic']
- filenames = ['*.BAS', '*.bas']
- mimetypes = ['text/basic']
-
- declarations = ('DATA', 'LET')
-
- functions = (
- 'ABS', 'ASC', 'ATN', 'CDBL', 'CHR$', 'CINT', 'CLNG',
- 'COMMAND$', 'COS', 'CSNG', 'CSRLIN', 'CVD', 'CVDMBF', 'CVI',
- 'CVL', 'CVS', 'CVSMBF', 'DATE$', 'ENVIRON$', 'EOF', 'ERDEV',
- 'ERDEV$', 'ERL', 'ERR', 'EXP', 'FILEATTR', 'FIX', 'FRE',
- 'FREEFILE', 'HEX$', 'INKEY$', 'INP', 'INPUT$', 'INSTR', 'INT',
- 'IOCTL$', 'LBOUND', 'LCASE$', 'LEFT$', 'LEN', 'LOC', 'LOF',
- 'LOG', 'LPOS', 'LTRIM$', 'MID$', 'MKD$', 'MKDMBF$', 'MKI$',
- 'MKL$', 'MKS$', 'MKSMBF$', 'OCT$', 'PEEK', 'PEN', 'PLAY',
- 'PMAP', 'POINT', 'POS', 'RIGHT$', 'RND', 'RTRIM$', 'SADD',
- 'SCREEN', 'SEEK', 'SETMEM', 'SGN', 'SIN', 'SPACE$', 'SPC',
- 'SQR', 'STICK', 'STR$', 'STRIG', 'STRING$', 'TAB', 'TAN',
- 'TIME$', 'TIMER', 'UBOUND', 'UCASE$', 'VAL', 'VARPTR',
- 'VARPTR$', 'VARSEG'
- )
-
- metacommands = ('$DYNAMIC', '$INCLUDE', '$STATIC')
-
- operators = ('AND', 'EQV', 'IMP', 'NOT', 'OR', 'XOR')
-
- statements = (
- 'BEEP', 'BLOAD', 'BSAVE', 'CALL', 'CALL ABSOLUTE',
- 'CALL INTERRUPT', 'CALLS', 'CHAIN', 'CHDIR', 'CIRCLE', 'CLEAR',
- 'CLOSE', 'CLS', 'COLOR', 'COM', 'COMMON', 'CONST', 'DATA',
- 'DATE$', 'DECLARE', 'DEF FN', 'DEF SEG', 'DEFDBL', 'DEFINT',
- 'DEFLNG', 'DEFSNG', 'DEFSTR', 'DEF', 'DIM', 'DO', 'LOOP',
- 'DRAW', 'END', 'ENVIRON', 'ERASE', 'ERROR', 'EXIT', 'FIELD',
- 'FILES', 'FOR', 'NEXT', 'FUNCTION', 'GET', 'GOSUB', 'GOTO',
- 'IF', 'THEN', 'INPUT', 'INPUT #', 'IOCTL', 'KEY', 'KEY',
- 'KILL', 'LET', 'LINE', 'LINE INPUT', 'LINE INPUT #', 'LOCATE',
- 'LOCK', 'UNLOCK', 'LPRINT', 'LSET', 'MID$', 'MKDIR', 'NAME',
- 'ON COM', 'ON ERROR', 'ON KEY', 'ON PEN', 'ON PLAY',
- 'ON STRIG', 'ON TIMER', 'ON UEVENT', 'ON', 'OPEN', 'OPEN COM',
- 'OPTION BASE', 'OUT', 'PAINT', 'PALETTE', 'PCOPY', 'PEN',
- 'PLAY', 'POKE', 'PRESET', 'PRINT', 'PRINT #', 'PRINT USING',
- 'PSET', 'PUT', 'PUT', 'RANDOMIZE', 'READ', 'REDIM', 'REM',
- 'RESET', 'RESTORE', 'RESUME', 'RETURN', 'RMDIR', 'RSET', 'RUN',
- 'SCREEN', 'SEEK', 'SELECT CASE', 'SHARED', 'SHELL', 'SLEEP',
- 'SOUND', 'STATIC', 'STOP', 'STRIG', 'SUB', 'SWAP', 'SYSTEM',
- 'TIME$', 'TIMER', 'TROFF', 'TRON', 'TYPE', 'UEVENT', 'UNLOCK',
- 'VIEW', 'WAIT', 'WHILE', 'WEND', 'WIDTH', 'WINDOW', 'WRITE'
- )
-
- keywords = (
- 'ACCESS', 'ALIAS', 'ANY', 'APPEND', 'AS', 'BASE', 'BINARY',
- 'BYVAL', 'CASE', 'CDECL', 'DOUBLE', 'ELSE', 'ELSEIF', 'ENDIF',
- 'INTEGER', 'IS', 'LIST', 'LOCAL', 'LONG', 'LOOP', 'MOD',
- 'NEXT', 'OFF', 'ON', 'OUTPUT', 'RANDOM', 'SIGNAL', 'SINGLE',
- 'STEP', 'STRING', 'THEN', 'TO', 'UNTIL', 'USING', 'WEND'
- )
-
- tokens = {
- 'root': [
- (r'\n+', Text),
- (r'\s+', Text.Whitespace),
- (r'^(\s*)(\d*)(\s*)(REM .*)$',
- bygroups(Text.Whitespace, Name.Label, Text.Whitespace,
- Comment.Single)),
- (r'^(\s*)(\d+)(\s*)',
- bygroups(Text.Whitespace, Name.Label, Text.Whitespace)),
- (r'(?=[\s]*)(\w+)(?=[\s]*=)', Name.Variable.Global),
- (r'(?=[^"]*)\'.*$', Comment.Single),
- (r'"[^\n"]*"', String.Double),
- (r'(END)(\s+)(FUNCTION|IF|SELECT|SUB)',
- bygroups(Keyword.Reserved, Text.Whitespace, Keyword.Reserved)),
- (r'(DECLARE)(\s+)([A-Z]+)(\s+)(\S+)',
- bygroups(Keyword.Declaration, Text.Whitespace, Name.Variable,
- Text.Whitespace, Name)),
- (r'(DIM)(\s+)(SHARED)(\s+)([^\s(]+)',
- bygroups(Keyword.Declaration, Text.Whitespace, Name.Variable,
- Text.Whitespace, Name.Variable.Global)),
- (r'(DIM)(\s+)([^\s(]+)',
- bygroups(Keyword.Declaration, Text.Whitespace, Name.Variable.Global)),
- (r'^(\s*)([a-zA-Z_]+)(\s*)(\=)',
- bygroups(Text.Whitespace, Name.Variable.Global, Text.Whitespace,
- Operator)),
- (r'(GOTO|GOSUB)(\s+)(\w+\:?)',
- bygroups(Keyword.Reserved, Text.Whitespace, Name.Label)),
- (r'(SUB)(\s+)(\w+\:?)',
- bygroups(Keyword.Reserved, Text.Whitespace, Name.Label)),
- include('declarations'),
- include('functions'),
- include('metacommands'),
- include('operators'),
- include('statements'),
- include('keywords'),
- (r'[a-zA-Z_]\w*[$@#&!]', Name.Variable.Global),
- (r'[a-zA-Z_]\w*\:', Name.Label),
- (r'\-?\d*\.\d+[@|#]?', Number.Float),
- (r'\-?\d+[@|#]', Number.Float),
- (r'\-?\d+#?', Number.Integer.Long),
- (r'\-?\d+#?', Number.Integer),
- (r'!=|==|:=|\.=|<<|>>|[-~+/\\*%=<>&^|?:!.]', Operator),
- (r'[\[\]{}(),;]', Punctuation),
- (r'[\w]+', Name.Variable.Global),
- ],
- # can't use regular \b because of X$()
- # XXX: use words() here
- 'declarations': [
- (r'\b(%s)(?=\(|\b)' % '|'.join(map(re.escape, declarations)),
- Keyword.Declaration),
- ],
- 'functions': [
- (r'\b(%s)(?=\(|\b)' % '|'.join(map(re.escape, functions)),
- Keyword.Reserved),
- ],
- 'metacommands': [
- (r'\b(%s)(?=\(|\b)' % '|'.join(map(re.escape, metacommands)),
- Keyword.Constant),
- ],
- 'operators': [
- (r'\b(%s)(?=\(|\b)' % '|'.join(map(re.escape, operators)), Operator.Word),
- ],
- 'statements': [
- (r'\b(%s)\b' % '|'.join(map(re.escape, statements)),
- Keyword.Reserved),
- ],
- 'keywords': [
- (r'\b(%s)\b' % '|'.join(keywords), Keyword),
- ],
- }
-
- def analyse_text(text):
- if '$DYNAMIC' in text or '$STATIC' in text:
- return 0.9
-
-
-class VBScriptLexer(RegexLexer):
- """
- VBScript is scripting language that is modeled on Visual Basic.
-
- .. versionadded:: 2.4
- """
- name = 'VBScript'
- aliases = ['vbscript']
- filenames = ['*.vbs', '*.VBS']
- flags = re.IGNORECASE
-
- tokens = {
- 'root': [
- (r"'[^\n]*", Comment.Single),
- (r'\s+', Whitespace),
- ('"', String.Double, 'string'),
- ('&h[0-9a-f]+', Number.Hex),
- # Float variant 1, for example: 1., 1.e2, 1.2e3
- (r'[0-9]+\.[0-9]*(e[+-]?[0-9]+)?', Number.Float),
- (r'\.[0-9]+(e[+-]?[0-9]+)?', Number.Float), # Float variant 2, for example: .1, .1e2
- (r'[0-9]+e[+-]?[0-9]+', Number.Float), # Float variant 3, for example: 123e45
- (r'\d+', Number.Integer),
- ('#.+#', String), # date or time value
- (r'(dim)(\s+)([a-z_][a-z0-9_]*)',
- bygroups(Keyword.Declaration, Whitespace, Name.Variable), 'dim_more'),
- (r'(function|sub)(\s+)([a-z_][a-z0-9_]*)',
- bygroups(Keyword.Declaration, Whitespace, Name.Function)),
- (r'(class)(\s+)([a-z_][a-z0-9_]*)', bygroups(Keyword.Declaration, Whitespace, Name.Class)),
- (r'(const)(\s+)([a-z_][a-z0-9_]*)', bygroups(Keyword.Declaration, Whitespace, Name.Constant)),
- (r'(end)(\s+)(class|function|if|property|sub|with)', bygroups(Keyword, Whitespace, Keyword)),
- (r'(on)(\s+)(error)(\s+)(goto)(\s+)(0)',
- bygroups(Keyword, Whitespace, Keyword, Whitespace, Keyword, Whitespace, Number.Integer)),
- (r'(on)(\s+)(error)(\s+)(resume)(\s+)(next)',
- bygroups(Keyword, Whitespace, Keyword, Whitespace, Keyword, Whitespace, Keyword)),
- (r'(option)(\s+)(explicit)', bygroups(Keyword, Whitespace, Keyword)),
- (r'(property)(\s+)(get|let|set)(\s+)([a-z_][a-z0-9_]*)',
- bygroups(Keyword.Declaration, Whitespace, Keyword.Declaration, Whitespace, Name.Property)),
- (r'rem\s.*[^\n]*', Comment.Single),
- (words(_vbscript_builtins.KEYWORDS, suffix=r'\b'), Keyword),
- (words(_vbscript_builtins.OPERATORS), Operator),
- (words(_vbscript_builtins.OPERATOR_WORDS, suffix=r'\b'), Operator.Word),
- (words(_vbscript_builtins.BUILTIN_CONSTANTS, suffix=r'\b'), Name.Constant),
- (words(_vbscript_builtins.BUILTIN_FUNCTIONS, suffix=r'\b'), Name.Builtin),
- (words(_vbscript_builtins.BUILTIN_VARIABLES, suffix=r'\b'), Name.Builtin),
- (r'[a-z_][a-z0-9_]*', Name),
- (r'\b_\n', Operator),
- (words(r'(),.:'), Punctuation),
- (r'.+(\n)?', Error)
- ],
- 'dim_more': [
- (r'(\s*)(,)(\s*)([a-z_][a-z0-9]*)', bygroups(Whitespace, Punctuation, Whitespace, Name.Variable)),
- default('#pop'),
- ],
- 'string': [
- (r'[^"\n]+', String.Double),
- (r'\"\"', String.Double),
- (r'"', String.Double, '#pop'),
- (r'\n', Error, '#pop'), # Unterminated string
- ],
- }
-
-
-class BBCBasicLexer(RegexLexer):
- """
- BBC Basic was supplied on the BBC Micro, and later Acorn RISC OS.
- It is also used by BBC Basic For Windows.
-
- .. versionadded:: 2.4
- """
- base_keywords = ['OTHERWISE', 'AND', 'DIV', 'EOR', 'MOD', 'OR', 'ERROR',
- 'LINE', 'OFF', 'STEP', 'SPC', 'TAB', 'ELSE', 'THEN',
- 'OPENIN', 'PTR', 'PAGE', 'TIME', 'LOMEM', 'HIMEM', 'ABS',
- 'ACS', 'ADVAL', 'ASC', 'ASN', 'ATN', 'BGET', 'COS', 'COUNT',
- 'DEG', 'ERL', 'ERR', 'EVAL', 'EXP', 'EXT', 'FALSE', 'FN',
- 'GET', 'INKEY', 'INSTR', 'INT', 'LEN', 'LN', 'LOG', 'NOT',
- 'OPENUP', 'OPENOUT', 'PI', 'POINT', 'POS', 'RAD', 'RND',
- 'SGN', 'SIN', 'SQR', 'TAN', 'TO', 'TRUE', 'USR', 'VAL',
- 'VPOS', 'CHR$', 'GET$', 'INKEY$', 'LEFT$', 'MID$',
- 'RIGHT$', 'STR$', 'STRING$', 'EOF', 'PTR', 'PAGE', 'TIME',
- 'LOMEM', 'HIMEM', 'SOUND', 'BPUT', 'CALL', 'CHAIN', 'CLEAR',
- 'CLOSE', 'CLG', 'CLS', 'DATA', 'DEF', 'DIM', 'DRAW', 'END',
- 'ENDPROC', 'ENVELOPE', 'FOR', 'GOSUB', 'GOTO', 'GCOL', 'IF',
- 'INPUT', 'LET', 'LOCAL', 'MODE', 'MOVE', 'NEXT', 'ON',
- 'VDU', 'PLOT', 'PRINT', 'PROC', 'READ', 'REM', 'REPEAT',
- 'REPORT', 'RESTORE', 'RETURN', 'RUN', 'STOP', 'COLOUR',
- 'TRACE', 'UNTIL', 'WIDTH', 'OSCLI']
-
- basic5_keywords = ['WHEN', 'OF', 'ENDCASE', 'ENDIF', 'ENDWHILE', 'CASE',
- 'CIRCLE', 'FILL', 'ORIGIN', 'POINT', 'RECTANGLE', 'SWAP',
- 'WHILE', 'WAIT', 'MOUSE', 'QUIT', 'SYS', 'INSTALL',
- 'LIBRARY', 'TINT', 'ELLIPSE', 'BEATS', 'TEMPO', 'VOICES',
- 'VOICE', 'STEREO', 'OVERLAY', 'APPEND', 'AUTO', 'CRUNCH',
- 'DELETE', 'EDIT', 'HELP', 'LIST', 'LOAD', 'LVAR', 'NEW',
- 'OLD', 'RENUMBER', 'SAVE', 'TEXTLOAD', 'TEXTSAVE',
- 'TWIN', 'TWINO', 'INSTALL', 'SUM', 'BEAT']
-
-
- name = 'BBC Basic'
- aliases = ['bbcbasic']
- filenames = ['*.bbc']
-
- tokens = {
- 'root': [
- (r"[0-9]+", Name.Label),
- (r"(\*)([^\n]*)",
- bygroups(Keyword.Pseudo, Comment.Special)),
- (r"", Whitespace, 'code'),
- ],
-
- 'code': [
- (r"(REM)([^\n]*)",
- bygroups(Keyword.Declaration, Comment.Single)),
- (r'\n', Whitespace, 'root'),
- (r'\s+', Whitespace),
- (r':', Comment.Preproc),
-
- # Some special cases to make functions come out nicer
- (r'(DEF)(\s*)(FN|PROC)([A-Za-z_@][\w@]*)',
- bygroups(Keyword.Declaration, Whitespace, Keyword.Declaration, Name.Function)),
- (r'(FN|PROC)([A-Za-z_@][\w@]*)',
- bygroups(Keyword, Name.Function)),
-
- (r'(GOTO|GOSUB|THEN|RESTORE)(\s*)(\d+)',
- bygroups(Keyword, Whitespace, Name.Label)),
-
- (r'(TRUE|FALSE)', Keyword.Constant),
- (r'(PAGE|LOMEM|HIMEM|TIME|WIDTH|ERL|ERR|REPORT\$|POS|VPOS|VOICES)', Keyword.Pseudo),
-
- (words(base_keywords), Keyword),
- (words(basic5_keywords), Keyword),
-
- ('"', String.Double, 'string'),
-
- ('%[01]{1,32}', Number.Bin),
- ('&[0-9a-f]{1,8}', Number.Hex),
-
- (r'[+-]?[0-9]+\.[0-9]*(E[+-]?[0-9]+)?', Number.Float),
- (r'[+-]?\.[0-9]+(E[+-]?[0-9]+)?', Number.Float),
- (r'[+-]?[0-9]+E[+-]?[0-9]+', Number.Float),
- (r'[+-]?\d+', Number.Integer),
-
- (r'([A-Za-z_@][\w@]*[%$]?)', Name.Variable),
- (r'([+\-]=|[$!|?+\-*/%^=><();]|>=|<=|<>|<<|>>|>>>|,)', Operator),
- ],
- 'string': [
- (r'[^"\n]+', String.Double),
- (r'"', String.Double, '#pop'),
- (r'\n', Error, 'root'), # Unterminated string
- ],
- }
-
- def analyse_text(text):
- if text.startswith('10REM >') or text.startswith('REM >'):
- return 0.9
diff --git a/pygments/lexers/bibtex.py b/pygments/lexers/bibtex.py
deleted file mode 100644
index 855254ef..00000000
--- a/pygments/lexers/bibtex.py
+++ /dev/null
@@ -1,160 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.bibtex
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for BibTeX bibliography data and styles
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, default, \
- words
-from pygments.token import Name, Comment, String, Error, Number, Text, \
- Keyword, Punctuation
-
-__all__ = ['BibTeXLexer', 'BSTLexer']
-
-
-class BibTeXLexer(ExtendedRegexLexer):
- """
- A lexer for BibTeX bibliography data format.
-
- .. versionadded:: 2.2
- """
-
- name = 'BibTeX'
- aliases = ['bib', 'bibtex']
- filenames = ['*.bib']
- mimetypes = ["text/x-bibtex"]
- flags = re.IGNORECASE
-
- ALLOWED_CHARS = r'@!$&*+\-./:;<>?\[\\\]^`|~'
- IDENTIFIER = '[{0}][{1}]*'.format('a-z_' + ALLOWED_CHARS, r'\w' + ALLOWED_CHARS)
-
- def open_brace_callback(self, match, ctx):
- opening_brace = match.group()
- ctx.opening_brace = opening_brace
- yield match.start(), Punctuation, opening_brace
- ctx.pos = match.end()
-
- def close_brace_callback(self, match, ctx):
- closing_brace = match.group()
- if (
- ctx.opening_brace == '{' and closing_brace != '}' or
- ctx.opening_brace == '(' and closing_brace != ')'
- ):
- yield match.start(), Error, closing_brace
- else:
- yield match.start(), Punctuation, closing_brace
- del ctx.opening_brace
- ctx.pos = match.end()
-
- tokens = {
- 'root': [
- include('whitespace'),
- ('@comment', Comment),
- ('@preamble', Name.Class, ('closing-brace', 'value', 'opening-brace')),
- ('@string', Name.Class, ('closing-brace', 'field', 'opening-brace')),
- ('@' + IDENTIFIER, Name.Class,
- ('closing-brace', 'command-body', 'opening-brace')),
- ('.+', Comment),
- ],
- 'opening-brace': [
- include('whitespace'),
- (r'[{(]', open_brace_callback, '#pop'),
- ],
- 'closing-brace': [
- include('whitespace'),
- (r'[})]', close_brace_callback, '#pop'),
- ],
- 'command-body': [
- include('whitespace'),
- (r'[^\s\,\}]+', Name.Label, ('#pop', 'fields')),
- ],
- 'fields': [
- include('whitespace'),
- (',', Punctuation, 'field'),
- default('#pop'),
- ],
- 'field': [
- include('whitespace'),
- (IDENTIFIER, Name.Attribute, ('value', '=')),
- default('#pop'),
- ],
- '=': [
- include('whitespace'),
- ('=', Punctuation, '#pop'),
- ],
- 'value': [
- include('whitespace'),
- (IDENTIFIER, Name.Variable),
- ('"', String, 'quoted-string'),
- (r'\{', String, 'braced-string'),
- (r'[\d]+', Number),
- ('#', Punctuation),
- default('#pop'),
- ],
- 'quoted-string': [
- (r'\{', String, 'braced-string'),
- ('"', String, '#pop'),
- (r'[^\{\"]+', String),
- ],
- 'braced-string': [
- (r'\{', String, '#push'),
- (r'\}', String, '#pop'),
- (r'[^\{\}]+', String),
- ],
- 'whitespace': [
- (r'\s+', Text),
- ],
- }
-
-
-class BSTLexer(RegexLexer):
- """
- A lexer for BibTeX bibliography styles.
-
- .. versionadded:: 2.2
- """
-
- name = 'BST'
- aliases = ['bst', 'bst-pybtex']
- filenames = ['*.bst']
- flags = re.IGNORECASE | re.MULTILINE
-
- tokens = {
- 'root': [
- include('whitespace'),
- (words(['read', 'sort']), Keyword),
- (words(['execute', 'integers', 'iterate', 'reverse', 'strings']),
- Keyword, ('group')),
- (words(['function', 'macro']), Keyword, ('group', 'group')),
- (words(['entry']), Keyword, ('group', 'group', 'group')),
- ],
- 'group': [
- include('whitespace'),
- (r'\{', Punctuation, ('#pop', 'group-end', 'body')),
- ],
- 'group-end': [
- include('whitespace'),
- (r'\}', Punctuation, '#pop'),
- ],
- 'body': [
- include('whitespace'),
- (r"\'[^#\"\{\}\s]+", Name.Function),
- (r'[^#\"\{\}\s]+\$', Name.Builtin),
- (r'[^#\"\{\}\s]+', Name.Variable),
- (r'"[^\"]*"', String),
- (r'#-?\d+', Number),
- (r'\{', Punctuation, ('group-end', 'body')),
- default('#pop'),
- ],
- 'whitespace': [
- (r'\s+', Text),
- ('%.*?$', Comment.SingleLine),
- ],
- }
diff --git a/pygments/lexers/boa.py b/pygments/lexers/boa.py
deleted file mode 100644
index a57c0e4a..00000000
--- a/pygments/lexers/boa.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.boa
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Boa language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, words
-from pygments.token import String, Comment, Keyword, Name, Number, Text, \
- Operator, Punctuation
-
-__all__ = ['BoaLexer']
-
-line_re = re.compile('.*?\n')
-
-
-class BoaLexer(RegexLexer):
- """
- Lexer for the `Boa <http://boa.cs.iastate.edu/docs/>`_ language.
-
- .. versionadded:: 2.4
- """
- name = 'Boa'
- aliases = ['boa']
- filenames = ['*.boa']
-
- reserved = words(
- ('input', 'output', 'of', 'weight', 'before', 'after', 'stop',
- 'ifall', 'foreach', 'exists', 'function', 'break', 'switch', 'case',
- 'visitor', 'default', 'return', 'visit', 'while', 'if', 'else'),
- suffix=r'\b', prefix=r'\b')
- keywords = words(
- ('bottom', 'collection', 'maximum', 'mean', 'minimum', 'set', 'sum',
- 'top', 'string', 'int', 'bool', 'float', 'time', 'false', 'true',
- 'array', 'map', 'stack', 'enum', 'type'), suffix=r'\b', prefix=r'\b')
- classes = words(
- ('Project', 'ForgeKind', 'CodeRepository', 'Revision', 'RepositoryKind',
- 'ChangedFile', 'FileKind', 'ASTRoot', 'Namespace', 'Declaration', 'Type',
- 'Method', 'Variable', 'Statement', 'Expression', 'Modifier',
- 'StatementKind', 'ExpressionKind', 'ModifierKind', 'Visibility',
- 'TypeKind', 'Person', 'ChangeKind'),
- suffix=r'\b', prefix=r'\b')
- operators = ('->', ':=', ':', '=', '<<', '!', '++', '||',
- '&&', '+', '-', '*', ">", "<")
- string_sep = ('`', '\"')
- built_in_functions = words(
- (
- # Array functions
- 'new', 'sort',
- # Date & Time functions
- 'yearof', 'dayofyear', 'hourof', 'minuteof', 'secondof', 'now',
- 'addday', 'addmonth', 'addweek', 'addyear', 'dayofmonth', 'dayofweek',
- 'dayofyear', 'formattime', 'trunctoday', 'trunctohour', 'trunctominute',
- 'trunctomonth', 'trunctosecond', 'trunctoyear',
- # Map functions
- 'clear', 'haskey', 'keys', 'lookup', 'remove', 'values',
- # Math functions
- 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh',
- 'ceil', 'cos', 'cosh', 'exp', 'floor', 'highbit', 'isfinite', 'isinf',
- 'isnan', 'isnormal', 'log', 'log10', 'max', 'min', 'nrand', 'pow',
- 'rand', 'round', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc',
- # Other functions
- 'def', 'hash', 'len',
- # Set functions
- 'add', 'contains', 'remove',
- # String functions
- 'format', 'lowercase', 'match', 'matchposns', 'matchstrs', 'regex',
- 'split', 'splitall', 'splitn', 'strfind', 'strreplace', 'strrfind',
- 'substring', 'trim', 'uppercase',
- # Type Conversion functions
- 'bool', 'float', 'int', 'string', 'time',
- # Domain-Specific functions
- 'getast', 'getsnapshot', 'hasfiletype', 'isfixingrevision', 'iskind',
- 'isliteral',
- ),
- prefix=r'\b',
- suffix=r'\(')
-
- tokens = {
- 'root': [
- (r'#.*?$', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (reserved, Keyword.Reserved),
- (built_in_functions, Name.Function),
- (keywords, Keyword.Type),
- (classes, Name.Classes),
- (words(operators), Operator),
- (r'[][(),;{}\\.]', Punctuation),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r'`(\\\\|\\`|[^`])*`', String),
- (words(string_sep), String.Delimeter),
- (r'[a-zA-Z_]+', Name.Variable),
- (r'[0-9]+', Number.Integer),
- (r'\s+?', Text), # Whitespace
- ]
- }
diff --git a/pygments/lexers/business.py b/pygments/lexers/business.py
deleted file mode 100644
index 37f161a0..00000000
--- a/pygments/lexers/business.py
+++ /dev/null
@@ -1,612 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.business
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for "business-oriented" languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, words, bygroups
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-
-from pygments.lexers._openedge_builtins import OPENEDGEKEYWORDS
-
-__all__ = ['CobolLexer', 'CobolFreeformatLexer', 'ABAPLexer', 'OpenEdgeLexer',
- 'GoodDataCLLexer', 'MaqlLexer']
-
-
-class CobolLexer(RegexLexer):
- """
- Lexer for OpenCOBOL code.
-
- .. versionadded:: 1.6
- """
- name = 'COBOL'
- aliases = ['cobol']
- filenames = ['*.cob', '*.COB', '*.cpy', '*.CPY']
- mimetypes = ['text/x-cobol']
- flags = re.IGNORECASE | re.MULTILINE
-
- # Data Types: by PICTURE and USAGE
- # Operators: **, *, +, -, /, <, >, <=, >=, =, <>
- # Logical (?): NOT, AND, OR
-
- # Reserved words:
- # http://opencobol.add1tocobol.com/#reserved-words
- # Intrinsics:
- # http://opencobol.add1tocobol.com/#does-opencobol-implement-any-intrinsic-functions
-
- tokens = {
- 'root': [
- include('comment'),
- include('strings'),
- include('core'),
- include('nums'),
- (r'[a-z0-9]([\w\-]*[a-z0-9]+)?', Name.Variable),
- # (r'[\s]+', Text),
- (r'[ \t]+', Text),
- ],
- 'comment': [
- (r'(^.{6}[*/].*\n|^.{6}|\*>.*\n)', Comment),
- ],
- 'core': [
- # Figurative constants
- (r'(^|(?<=[^\w\-]))(ALL\s+)?'
- r'((ZEROES)|(HIGH-VALUE|LOW-VALUE|QUOTE|SPACE|ZERO)(S)?)'
- r'\s*($|(?=[^\w\-]))',
- Name.Constant),
-
- # Reserved words STATEMENTS and other bolds
- (words((
- 'ACCEPT', 'ADD', 'ALLOCATE', 'CALL', 'CANCEL', 'CLOSE', 'COMPUTE',
- 'CONFIGURATION', 'CONTINUE', 'DATA', 'DELETE', 'DISPLAY', 'DIVIDE',
- 'DIVISION', 'ELSE', 'END', 'END-ACCEPT',
- 'END-ADD', 'END-CALL', 'END-COMPUTE', 'END-DELETE', 'END-DISPLAY',
- 'END-DIVIDE', 'END-EVALUATE', 'END-IF', 'END-MULTIPLY', 'END-OF-PAGE',
- 'END-PERFORM', 'END-READ', 'END-RETURN', 'END-REWRITE', 'END-SEARCH',
- 'END-START', 'END-STRING', 'END-SUBTRACT', 'END-UNSTRING', 'END-WRITE',
- 'ENVIRONMENT', 'EVALUATE', 'EXIT', 'FD', 'FILE', 'FILE-CONTROL', 'FOREVER',
- 'FREE', 'GENERATE', 'GO', 'GOBACK', 'IDENTIFICATION', 'IF', 'INITIALIZE',
- 'INITIATE', 'INPUT-OUTPUT', 'INSPECT', 'INVOKE', 'I-O-CONTROL', 'LINKAGE',
- 'LOCAL-STORAGE', 'MERGE', 'MOVE', 'MULTIPLY', 'OPEN', 'PERFORM',
- 'PROCEDURE', 'PROGRAM-ID', 'RAISE', 'READ', 'RELEASE', 'RESUME',
- 'RETURN', 'REWRITE', 'SCREEN', 'SD', 'SEARCH', 'SECTION', 'SET',
- 'SORT', 'START', 'STOP', 'STRING', 'SUBTRACT', 'SUPPRESS',
- 'TERMINATE', 'THEN', 'UNLOCK', 'UNSTRING', 'USE', 'VALIDATE',
- 'WORKING-STORAGE', 'WRITE'), prefix=r'(^|(?<=[^\w\-]))',
- suffix=r'\s*($|(?=[^\w\-]))'),
- Keyword.Reserved),
-
- # Reserved words
- (words((
- 'ACCESS', 'ADDRESS', 'ADVANCING', 'AFTER', 'ALL',
- 'ALPHABET', 'ALPHABETIC', 'ALPHABETIC-LOWER', 'ALPHABETIC-UPPER',
- 'ALPHANUMERIC', 'ALPHANUMERIC-EDITED', 'ALSO', 'ALTER', 'ALTERNATE'
- 'ANY', 'ARE', 'AREA', 'AREAS', 'ARGUMENT-NUMBER', 'ARGUMENT-VALUE', 'AS',
- 'ASCENDING', 'ASSIGN', 'AT', 'AUTO', 'AUTO-SKIP', 'AUTOMATIC',
- 'AUTOTERMINATE', 'BACKGROUND-COLOR', 'BASED', 'BEEP', 'BEFORE', 'BELL',
- 'BLANK', 'BLINK', 'BLOCK', 'BOTTOM', 'BY', 'BYTE-LENGTH', 'CHAINING',
- 'CHARACTER', 'CHARACTERS', 'CLASS', 'CODE', 'CODE-SET', 'COL',
- 'COLLATING', 'COLS', 'COLUMN', 'COLUMNS', 'COMMA', 'COMMAND-LINE',
- 'COMMIT', 'COMMON', 'CONSTANT', 'CONTAINS', 'CONTENT', 'CONTROL',
- 'CONTROLS', 'CONVERTING', 'COPY', 'CORR', 'CORRESPONDING', 'COUNT', 'CRT',
- 'CURRENCY', 'CURSOR', 'CYCLE', 'DATE', 'DAY', 'DAY-OF-WEEK', 'DE',
- 'DEBUGGING', 'DECIMAL-POINT', 'DECLARATIVES', 'DEFAULT', 'DELIMITED',
- 'DELIMITER', 'DEPENDING', 'DESCENDING', 'DETAIL', 'DISK',
- 'DOWN', 'DUPLICATES', 'DYNAMIC', 'EBCDIC',
- 'ENTRY', 'ENVIRONMENT-NAME', 'ENVIRONMENT-VALUE', 'EOL', 'EOP',
- 'EOS', 'ERASE', 'ERROR', 'ESCAPE', 'EXCEPTION',
- 'EXCLUSIVE', 'EXTEND', 'EXTERNAL', 'FILE-ID', 'FILLER', 'FINAL',
- 'FIRST', 'FIXED', 'FLOAT-LONG', 'FLOAT-SHORT',
- 'FOOTING', 'FOR', 'FOREGROUND-COLOR', 'FORMAT', 'FROM', 'FULL',
- 'FUNCTION', 'FUNCTION-ID', 'GIVING', 'GLOBAL', 'GROUP',
- 'HEADING', 'HIGHLIGHT', 'I-O', 'ID',
- 'IGNORE', 'IGNORING', 'IN', 'INDEX', 'INDEXED', 'INDICATE',
- 'INITIAL', 'INITIALIZED', 'INPUT', 'INTO', 'INTRINSIC', 'INVALID',
- 'IS', 'JUST', 'JUSTIFIED', 'KEY', 'LABEL',
- 'LAST', 'LEADING', 'LEFT', 'LENGTH', 'LIMIT', 'LIMITS', 'LINAGE',
- 'LINAGE-COUNTER', 'LINE', 'LINES', 'LOCALE', 'LOCK',
- 'LOWLIGHT', 'MANUAL', 'MEMORY', 'MINUS', 'MODE', 'MULTIPLE',
- 'NATIONAL', 'NATIONAL-EDITED', 'NATIVE', 'NEGATIVE', 'NEXT', 'NO',
- 'NULL', 'NULLS', 'NUMBER', 'NUMBERS', 'NUMERIC', 'NUMERIC-EDITED',
- 'OBJECT-COMPUTER', 'OCCURS', 'OF', 'OFF', 'OMITTED', 'ON', 'ONLY',
- 'OPTIONAL', 'ORDER', 'ORGANIZATION', 'OTHER', 'OUTPUT', 'OVERFLOW',
- 'OVERLINE', 'PACKED-DECIMAL', 'PADDING', 'PAGE', 'PARAGRAPH',
- 'PLUS', 'POINTER', 'POSITION', 'POSITIVE', 'PRESENT', 'PREVIOUS',
- 'PRINTER', 'PRINTING', 'PROCEDURE-POINTER', 'PROCEDURES',
- 'PROCEED', 'PROGRAM', 'PROGRAM-POINTER', 'PROMPT', 'QUOTE',
- 'QUOTES', 'RANDOM', 'RD', 'RECORD', 'RECORDING', 'RECORDS', 'RECURSIVE',
- 'REDEFINES', 'REEL', 'REFERENCE', 'RELATIVE', 'REMAINDER', 'REMOVAL',
- 'RENAMES', 'REPLACING', 'REPORT', 'REPORTING', 'REPORTS', 'REPOSITORY',
- 'REQUIRED', 'RESERVE', 'RETURNING', 'REVERSE-VIDEO', 'REWIND',
- 'RIGHT', 'ROLLBACK', 'ROUNDED', 'RUN', 'SAME', 'SCROLL',
- 'SECURE', 'SEGMENT-LIMIT', 'SELECT', 'SENTENCE', 'SEPARATE',
- 'SEQUENCE', 'SEQUENTIAL', 'SHARING', 'SIGN', 'SIGNED', 'SIGNED-INT',
- 'SIGNED-LONG', 'SIGNED-SHORT', 'SIZE', 'SORT-MERGE', 'SOURCE',
- 'SOURCE-COMPUTER', 'SPECIAL-NAMES', 'STANDARD',
- 'STANDARD-1', 'STANDARD-2', 'STATUS', 'SUM',
- 'SYMBOLIC', 'SYNC', 'SYNCHRONIZED', 'TALLYING', 'TAPE',
- 'TEST', 'THROUGH', 'THRU', 'TIME', 'TIMES', 'TO', 'TOP', 'TRAILING',
- 'TRANSFORM', 'TYPE', 'UNDERLINE', 'UNIT', 'UNSIGNED',
- 'UNSIGNED-INT', 'UNSIGNED-LONG', 'UNSIGNED-SHORT', 'UNTIL', 'UP',
- 'UPDATE', 'UPON', 'USAGE', 'USING', 'VALUE', 'VALUES', 'VARYING',
- 'WAIT', 'WHEN', 'WITH', 'WORDS', 'YYYYDDD', 'YYYYMMDD'),
- prefix=r'(^|(?<=[^\w\-]))', suffix=r'\s*($|(?=[^\w\-]))'),
- Keyword.Pseudo),
-
- # inactive reserved words
- (words((
- 'ACTIVE-CLASS', 'ALIGNED', 'ANYCASE', 'ARITHMETIC', 'ATTRIBUTE',
- 'B-AND', 'B-NOT', 'B-OR', 'B-XOR', 'BIT', 'BOOLEAN', 'CD', 'CENTER',
- 'CF', 'CH', 'CHAIN', 'CLASS-ID', 'CLASSIFICATION', 'COMMUNICATION',
- 'CONDITION', 'DATA-POINTER', 'DESTINATION', 'DISABLE', 'EC', 'EGI',
- 'EMI', 'ENABLE', 'END-RECEIVE', 'ENTRY-CONVENTION', 'EO', 'ESI',
- 'EXCEPTION-OBJECT', 'EXPANDS', 'FACTORY', 'FLOAT-BINARY-16',
- 'FLOAT-BINARY-34', 'FLOAT-BINARY-7', 'FLOAT-DECIMAL-16',
- 'FLOAT-DECIMAL-34', 'FLOAT-EXTENDED', 'FORMAT', 'FUNCTION-POINTER',
- 'GET', 'GROUP-USAGE', 'IMPLEMENTS', 'INFINITY', 'INHERITS',
- 'INTERFACE', 'INTERFACE-ID', 'INVOKE', 'LC_ALL', 'LC_COLLATE',
- 'LC_CTYPE', 'LC_MESSAGES', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME',
- 'LINE-COUNTER', 'MESSAGE', 'METHOD', 'METHOD-ID', 'NESTED', 'NONE',
- 'NORMAL', 'OBJECT', 'OBJECT-REFERENCE', 'OPTIONS', 'OVERRIDE',
- 'PAGE-COUNTER', 'PF', 'PH', 'PROPERTY', 'PROTOTYPE', 'PURGE',
- 'QUEUE', 'RAISE', 'RAISING', 'RECEIVE', 'RELATION', 'REPLACE',
- 'REPRESENTS-NOT-A-NUMBER', 'RESET', 'RESUME', 'RETRY', 'RF', 'RH',
- 'SECONDS', 'SEGMENT', 'SELF', 'SEND', 'SOURCES', 'STATEMENT',
- 'STEP', 'STRONG', 'SUB-QUEUE-1', 'SUB-QUEUE-2', 'SUB-QUEUE-3',
- 'SUPER', 'SYMBOL', 'SYSTEM-DEFAULT', 'TABLE', 'TERMINAL', 'TEXT',
- 'TYPEDEF', 'UCS-4', 'UNIVERSAL', 'USER-DEFAULT', 'UTF-16', 'UTF-8',
- 'VAL-STATUS', 'VALID', 'VALIDATE', 'VALIDATE-STATUS'),
- prefix=r'(^|(?<=[^\w\-]))', suffix=r'\s*($|(?=[^\w\-]))'),
- Error),
-
- # Data Types
- (r'(^|(?<=[^\w\-]))'
- r'(PIC\s+.+?(?=(\s|\.\s))|PICTURE\s+.+?(?=(\s|\.\s))|'
- r'(COMPUTATIONAL)(-[1-5X])?|(COMP)(-[1-5X])?|'
- r'BINARY-C-LONG|'
- r'BINARY-CHAR|BINARY-DOUBLE|BINARY-LONG|BINARY-SHORT|'
- r'BINARY)\s*($|(?=[^\w\-]))', Keyword.Type),
-
- # Operators
- (r'(\*\*|\*|\+|-|/|<=|>=|<|>|==|/=|=)', Operator),
-
- # (r'(::)', Keyword.Declaration),
-
- (r'([(),;:&%.])', Punctuation),
-
- # Intrinsics
- (r'(^|(?<=[^\w\-]))(ABS|ACOS|ANNUITY|ASIN|ATAN|BYTE-LENGTH|'
- r'CHAR|COMBINED-DATETIME|CONCATENATE|COS|CURRENT-DATE|'
- r'DATE-OF-INTEGER|DATE-TO-YYYYMMDD|DAY-OF-INTEGER|DAY-TO-YYYYDDD|'
- r'EXCEPTION-(?:FILE|LOCATION|STATEMENT|STATUS)|EXP10|EXP|E|'
- r'FACTORIAL|FRACTION-PART|INTEGER-OF-(?:DATE|DAY|PART)|INTEGER|'
- r'LENGTH|LOCALE-(?:DATE|TIME(?:-FROM-SECONDS)?)|LOG(?:10)?|'
- r'LOWER-CASE|MAX|MEAN|MEDIAN|MIDRANGE|MIN|MOD|NUMVAL(?:-C)?|'
- r'ORD(?:-MAX|-MIN)?|PI|PRESENT-VALUE|RANDOM|RANGE|REM|REVERSE|'
- r'SECONDS-FROM-FORMATTED-TIME|SECONDS-PAST-MIDNIGHT|SIGN|SIN|SQRT|'
- r'STANDARD-DEVIATION|STORED-CHAR-LENGTH|SUBSTITUTE(?:-CASE)?|'
- r'SUM|TAN|TEST-DATE-YYYYMMDD|TEST-DAY-YYYYDDD|TRIM|'
- r'UPPER-CASE|VARIANCE|WHEN-COMPILED|YEAR-TO-YYYY)\s*'
- r'($|(?=[^\w\-]))', Name.Function),
-
- # Booleans
- (r'(^|(?<=[^\w\-]))(true|false)\s*($|(?=[^\w\-]))', Name.Builtin),
- # Comparing Operators
- (r'(^|(?<=[^\w\-]))(equal|equals|ne|lt|le|gt|ge|'
- r'greater|less|than|not|and|or)\s*($|(?=[^\w\-]))', Operator.Word),
- ],
-
- # \"[^\"\n]*\"|\'[^\'\n]*\'
- 'strings': [
- # apparently strings can be delimited by EOL if they are continued
- # in the next line
- (r'"[^"\n]*("|\n)', String.Double),
- (r"'[^'\n]*('|\n)", String.Single),
- ],
-
- 'nums': [
- (r'\d+(\s*|\.$|$)', Number.Integer),
- (r'[+-]?\d*\.\d+(E[-+]?\d+)?', Number.Float),
- (r'[+-]?\d+\.\d*(E[-+]?\d+)?', Number.Float),
- ],
- }
-
-
-class CobolFreeformatLexer(CobolLexer):
- """
- Lexer for Free format OpenCOBOL code.
-
- .. versionadded:: 1.6
- """
- name = 'COBOLFree'
- aliases = ['cobolfree']
- filenames = ['*.cbl', '*.CBL']
- mimetypes = []
- flags = re.IGNORECASE | re.MULTILINE
-
- tokens = {
- 'comment': [
- (r'(\*>.*\n|^\w*\*.*$)', Comment),
- ],
- }
-
-
-class ABAPLexer(RegexLexer):
- """
- Lexer for ABAP, SAP's integrated language.
-
- .. versionadded:: 1.1
- """
- name = 'ABAP'
- aliases = ['abap']
- filenames = ['*.abap', '*.ABAP']
- mimetypes = ['text/x-abap']
-
- flags = re.IGNORECASE | re.MULTILINE
-
- tokens = {
- 'common': [
- (r'\s+', Text),
- (r'^\*.*$', Comment.Single),
- (r'\".*?\n', Comment.Single),
- (r'##\w+', Comment.Special),
- ],
- 'variable-names': [
- (r'<\S+>', Name.Variable),
- (r'\w[\w~]*(?:(\[\])|->\*)?', Name.Variable),
- ],
- 'root': [
- include('common'),
- # function calls
- (r'CALL\s+(?:BADI|CUSTOMER-FUNCTION|FUNCTION)',
- Keyword),
- (r'(CALL\s+(?:DIALOG|SCREEN|SUBSCREEN|SELECTION-SCREEN|'
- r'TRANSACTION|TRANSFORMATION))\b',
- Keyword),
- (r'(FORM|PERFORM)(\s+)(\w+)',
- bygroups(Keyword, Text, Name.Function)),
- (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~]+)',
- bygroups(Keyword, Text, Name.Function)),
- # method calls
- (r'(\s+)([\w\-]+)([=\-]>)([\w\-~]+)',
- bygroups(Text, Name.Variable, Operator, Name.Function)),
- # call methodnames returning style
- (r'(?<=(=|-)>)([\w\-~]+)(?=\()', Name.Function),
-
- # text elements
- (r'(TEXT)(-)(\d{3})',
- bygroups(Keyword, Punctuation, Number.Integer)),
- (r'(TEXT)(-)(\w{3})',
- bygroups(Keyword, Punctuation, Name.Variable)),
-
- # keywords with dashes in them.
- # these need to be first, because for instance the -ID part
- # of MESSAGE-ID wouldn't get highlighted if MESSAGE was
- # first in the list of keywords.
- (r'(ADD-CORRESPONDING|AUTHORITY-CHECK|'
- r'CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|'
- r'DELETE-ADJACENT|DIVIDE-CORRESPONDING|'
- r'EDITOR-CALL|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|EXIT-COMMAND|'
- r'FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|'
- r'INTERFACE-POOL|INVERTED-DATE|'
- r'LOAD-OF-PROGRAM|LOG-POINT|'
- r'MESSAGE-ID|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|'
- r'NEW-LINE|NEW-PAGE|NEW-SECTION|NO-EXTENSION|'
- r'OUTPUT-LENGTH|PRINT-CONTROL|'
- r'SELECT-OPTIONS|START-OF-SELECTION|SUBTRACT-CORRESPONDING|'
- r'SYNTAX-CHECK|SYSTEM-EXCEPTIONS|'
- r'TYPE-POOL|TYPE-POOLS|NO-DISPLAY'
- r')\b', Keyword),
-
- # keyword kombinations
- (r'(?<![-\>])(CREATE\s+(PUBLIC|PRIVATE|DATA|OBJECT)|'
- r'(PUBLIC|PRIVATE|PROTECTED)\s+SECTION|'
- r'(TYPE|LIKE)\s+((LINE\s+OF|REF\s+TO|'
- r'(SORTED|STANDARD|HASHED)\s+TABLE\s+OF))?|'
- r'FROM\s+(DATABASE|MEMORY)|CALL\s+METHOD|'
- r'(GROUP|ORDER) BY|HAVING|SEPARATED BY|'
- r'GET\s+(BADI|BIT|CURSOR|DATASET|LOCALE|PARAMETER|'
- r'PF-STATUS|(PROPERTY|REFERENCE)\s+OF|'
- r'RUN\s+TIME|TIME\s+(STAMP)?)?|'
- r'SET\s+(BIT|BLANK\s+LINES|COUNTRY|CURSOR|DATASET|EXTENDED\s+CHECK|'
- r'HANDLER|HOLD\s+DATA|LANGUAGE|LEFT\s+SCROLL-BOUNDARY|'
- r'LOCALE|MARGIN|PARAMETER|PF-STATUS|PROPERTY\s+OF|'
- r'RUN\s+TIME\s+(ANALYZER|CLOCK\s+RESOLUTION)|SCREEN|'
- r'TITLEBAR|UPADTE\s+TASK\s+LOCAL|USER-COMMAND)|'
- r'CONVERT\s+((INVERTED-)?DATE|TIME|TIME\s+STAMP|TEXT)|'
- r'(CLOSE|OPEN)\s+(DATASET|CURSOR)|'
- r'(TO|FROM)\s+(DATA BUFFER|INTERNAL TABLE|MEMORY ID|'
- r'DATABASE|SHARED\s+(MEMORY|BUFFER))|'
- r'DESCRIBE\s+(DISTANCE\s+BETWEEN|FIELD|LIST|TABLE)|'
- r'FREE\s(MEMORY|OBJECT)?|'
- r'PROCESS\s+(BEFORE\s+OUTPUT|AFTER\s+INPUT|'
- r'ON\s+(VALUE-REQUEST|HELP-REQUEST))|'
- r'AT\s+(LINE-SELECTION|USER-COMMAND|END\s+OF|NEW)|'
- r'AT\s+SELECTION-SCREEN(\s+(ON(\s+(BLOCK|(HELP|VALUE)-REQUEST\s+FOR|'
- r'END\s+OF|RADIOBUTTON\s+GROUP))?|OUTPUT))?|'
- r'SELECTION-SCREEN:?\s+((BEGIN|END)\s+OF\s+((TABBED\s+)?BLOCK|LINE|'
- r'SCREEN)|COMMENT|FUNCTION\s+KEY|'
- r'INCLUDE\s+BLOCKS|POSITION|PUSHBUTTON|'
- r'SKIP|ULINE)|'
- r'LEAVE\s+(LIST-PROCESSING|PROGRAM|SCREEN|'
- r'TO LIST-PROCESSING|TO TRANSACTION)'
- r'(ENDING|STARTING)\s+AT|'
- r'FORMAT\s+(COLOR|INTENSIFIED|INVERSE|HOTSPOT|INPUT|FRAMES|RESET)|'
- r'AS\s+(CHECKBOX|SUBSCREEN|WINDOW)|'
- r'WITH\s+(((NON-)?UNIQUE)?\s+KEY|FRAME)|'
- r'(BEGIN|END)\s+OF|'
- r'DELETE(\s+ADJACENT\s+DUPLICATES\sFROM)?|'
- r'COMPARING(\s+ALL\s+FIELDS)?|'
- r'(INSERT|APPEND)(\s+INITIAL\s+LINE\s+(IN)?TO|\s+LINES\s+OF)?|'
- r'IN\s+((BYTE|CHARACTER)\s+MODE|PROGRAM)|'
- r'END-OF-(DEFINITION|PAGE|SELECTION)|'
- r'WITH\s+FRAME(\s+TITLE)|'
- r'(REPLACE|FIND)\s+((FIRST|ALL)\s+OCCURRENCES?\s+OF\s+)?(SUBSTRING|REGEX)?|'
- r'MATCH\s+(LENGTH|COUNT|LINE|OFFSET)|'
- r'(RESPECTING|IGNORING)\s+CASE|'
- r'IN\s+UPDATE\s+TASK|'
- r'(SOURCE|RESULT)\s+(XML)?|'
- r'REFERENCE\s+INTO|'
-
- # simple kombinations
- r'AND\s+(MARK|RETURN)|CLIENT\s+SPECIFIED|CORRESPONDING\s+FIELDS\s+OF|'
- r'IF\s+FOUND|FOR\s+EVENT|INHERITING\s+FROM|LEAVE\s+TO\s+SCREEN|'
- r'LOOP\s+AT\s+(SCREEN)?|LOWER\s+CASE|MATCHCODE\s+OBJECT|MODIF\s+ID|'
- r'MODIFY\s+SCREEN|NESTING\s+LEVEL|NO\s+INTERVALS|OF\s+STRUCTURE|'
- r'RADIOBUTTON\s+GROUP|RANGE\s+OF|REF\s+TO|SUPPRESS DIALOG|'
- r'TABLE\s+OF|UPPER\s+CASE|TRANSPORTING\s+NO\s+FIELDS|'
- r'VALUE\s+CHECK|VISIBLE\s+LENGTH|HEADER\s+LINE|COMMON\s+PART)\b', Keyword),
-
- # single word keywords.
- (r'(^|(?<=(\s|\.)))(ABBREVIATED|ABSTRACT|ADD|ALIASES|ALIGN|ALPHA|'
- r'ASSERT|AS|ASSIGN(ING)?|AT(\s+FIRST)?|'
- r'BACK|BLOCK|BREAK-POINT|'
- r'CASE|CATCH|CHANGING|CHECK|CLASS|CLEAR|COLLECT|COLOR|COMMIT|'
- r'CREATE|COMMUNICATION|COMPONENTS?|COMPUTE|CONCATENATE|CONDENSE|'
- r'CONSTANTS|CONTEXTS|CONTINUE|CONTROLS|COUNTRY|CURRENCY|'
- r'DATA|DATE|DECIMALS|DEFAULT|DEFINE|DEFINITION|DEFERRED|DEMAND|'
- r'DETAIL|DIRECTORY|DIVIDE|DO|DUMMY|'
- r'ELSE(IF)?|ENDAT|ENDCASE|ENDCATCH|ENDCLASS|ENDDO|ENDFORM|ENDFUNCTION|'
- r'ENDIF|ENDINTERFACE|ENDLOOP|ENDMETHOD|ENDMODULE|ENDSELECT|ENDTRY|ENDWHILE|'
- r'ENHANCEMENT|EVENTS|EXACT|EXCEPTIONS?|EXIT|EXPONENT|EXPORT|EXPORTING|EXTRACT|'
- r'FETCH|FIELDS?|FOR|FORM|FORMAT|FREE|FROM|FUNCTION|'
- r'HIDE|'
- r'ID|IF|IMPORT|IMPLEMENTATION|IMPORTING|IN|INCLUDE|INCLUDING|'
- r'INDEX|INFOTYPES|INITIALIZATION|INTERFACE|INTERFACES|INTO|'
- r'LANGUAGE|LEAVE|LENGTH|LINES|LOAD|LOCAL|'
- r'JOIN|'
- r'KEY|'
- r'NEXT|'
- r'MAXIMUM|MESSAGE|METHOD[S]?|MINIMUM|MODULE|MODIFIER|MODIFY|MOVE|MULTIPLY|'
- r'NODES|NUMBER|'
- r'OBLIGATORY|OBJECT|OF|OFF|ON|OTHERS|OVERLAY|'
- r'PACK|PAD|PARAMETERS|PERCENTAGE|POSITION|PROGRAM|PROVIDE|PUBLIC|PUT|PF\d\d|'
- r'RAISE|RAISING|RANGES?|READ|RECEIVE|REDEFINITION|REFRESH|REJECT|REPORT|RESERVE|'
- r'RESUME|RETRY|RETURN|RETURNING|RIGHT|ROLLBACK|REPLACE|'
- r'SCROLL|SEARCH|SELECT|SHIFT|SIGN|SINGLE|SIZE|SKIP|SORT|SPLIT|STATICS|STOP|'
- r'STYLE|SUBMATCHES|SUBMIT|SUBTRACT|SUM(?!\()|SUMMARY|SUMMING|SUPPLY|'
- r'TABLE|TABLES|TIMESTAMP|TIMES?|TIMEZONE|TITLE|\??TO|'
- r'TOP-OF-PAGE|TRANSFER|TRANSLATE|TRY|TYPES|'
- r'ULINE|UNDER|UNPACK|UPDATE|USING|'
- r'VALUE|VALUES|VIA|VARYING|VARY|'
- r'WAIT|WHEN|WHERE|WIDTH|WHILE|WITH|WINDOW|WRITE|XSD|ZERO)\b', Keyword),
-
- # builtins
- (r'(abs|acos|asin|atan|'
- r'boolc|boolx|bit_set|'
- r'char_off|charlen|ceil|cmax|cmin|condense|contains|'
- r'contains_any_of|contains_any_not_of|concat_lines_of|cos|cosh|'
- r'count|count_any_of|count_any_not_of|'
- r'dbmaxlen|distance|'
- r'escape|exp|'
- r'find|find_end|find_any_of|find_any_not_of|floor|frac|from_mixed|'
- r'insert|'
- r'lines|log|log10|'
- r'match|matches|'
- r'nmax|nmin|numofchar|'
- r'repeat|replace|rescale|reverse|round|'
- r'segment|shift_left|shift_right|sign|sin|sinh|sqrt|strlen|'
- r'substring|substring_after|substring_from|substring_before|substring_to|'
- r'tan|tanh|to_upper|to_lower|to_mixed|translate|trunc|'
- r'xstrlen)(\()\b', bygroups(Name.Builtin, Punctuation)),
-
- (r'&[0-9]', Name),
- (r'[0-9]+', Number.Integer),
-
- # operators which look like variable names before
- # parsing variable names.
- (r'(?<=(\s|.))(AND|OR|EQ|NE|GT|LT|GE|LE|CO|CN|CA|NA|CS|NOT|NS|CP|NP|'
- r'BYTE-CO|BYTE-CN|BYTE-CA|BYTE-NA|BYTE-CS|BYTE-NS|'
- r'IS\s+(NOT\s+)?(INITIAL|ASSIGNED|REQUESTED|BOUND))\b', Operator.Word),
-
- include('variable-names'),
-
- # standard operators after variable names,
- # because < and > are part of field symbols.
- (r'[?*<>=\-+&]', Operator),
- (r"'(''|[^'])*'", String.Single),
- (r"`([^`])*`", String.Single),
- (r"([|}])([^{}|]*?)([|{])",
- bygroups(Punctuation, String.Single, Punctuation)),
- (r'[/;:()\[\],.]', Punctuation),
- (r'(!)(\w+)', bygroups(Operator, Name)),
- ],
- }
-
-
-class OpenEdgeLexer(RegexLexer):
- """
- Lexer for `OpenEdge ABL (formerly Progress)
- <http://web.progress.com/en/openedge/abl.html>`_ source code.
-
- .. versionadded:: 1.5
- """
- name = 'OpenEdge ABL'
- aliases = ['openedge', 'abl', 'progress']
- filenames = ['*.p', '*.cls']
- mimetypes = ['text/x-openedge', 'application/x-openedge']
-
- types = (r'(?i)(^|(?<=[^\w\-]))(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*($|(?=[^\w\-]))')
-
- keywords = words(OPENEDGEKEYWORDS,
- prefix=r'(?i)(^|(?<=[^\w\-]))',
- suffix=r'\s*($|(?=[^\w\-]))')
-
- 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 GoodDataCLLexer(RegexLexer):
- """
- Lexer for `GoodData-CL
- <http://github.com/gooddata/GoodData-CL/raw/master/cli/src/main/resources/\
-com/gooddata/processor/COMMANDS.txt>`_
- script files.
-
- .. versionadded:: 1.4
- """
-
- name = 'GoodData-CL'
- aliases = ['gooddata-cl']
- filenames = ['*.gdc']
- mimetypes = ['text/x-gooddata-cl']
-
- flags = re.IGNORECASE
- tokens = {
- 'root': [
- # Comments
- (r'#.*', Comment.Single),
- # Function call
- (r'[a-z]\w*', Name.Function),
- # Argument list
- (r'\(', Punctuation, 'args-list'),
- # Punctuation
- (r';', Punctuation),
- # Space is not significant
- (r'\s+', Text)
- ],
- 'args-list': [
- (r'\)', Punctuation, '#pop'),
- (r',', Punctuation),
- (r'[a-z]\w*', Name.Variable),
- (r'=', Operator),
- (r'"', String, 'string-literal'),
- (r'[0-9]+(?:\.[0-9]+)?(?:e[+-]?[0-9]{1,3})?', Number),
- # Space is not significant
- (r'\s', Text)
- ],
- 'string-literal': [
- (r'\\[tnrfbae"\\]', String.Escape),
- (r'"', String, '#pop'),
- (r'[^\\"]+', String)
- ]
- }
-
-
-class MaqlLexer(RegexLexer):
- """
- Lexer for `GoodData MAQL
- <https://secure.gooddata.com/docs/html/advanced.metric.tutorial.html>`_
- scripts.
-
- .. versionadded:: 1.4
- """
-
- name = 'MAQL'
- aliases = ['maql']
- filenames = ['*.maql']
- mimetypes = ['text/x-gooddata-maql', 'application/x-gooddata-maql']
-
- flags = re.IGNORECASE
- tokens = {
- 'root': [
- # IDENTITY
- (r'IDENTIFIER\b', Name.Builtin),
- # IDENTIFIER
- (r'\{[^}]+\}', Name.Variable),
- # NUMBER
- (r'[0-9]+(?:\.[0-9]+)?(?:e[+-]?[0-9]{1,3})?', Number),
- # STRING
- (r'"', String, 'string-literal'),
- # RELATION
- (r'\<\>|\!\=', Operator),
- (r'\=|\>\=|\>|\<\=|\<', Operator),
- # :=
- (r'\:\=', Operator),
- # OBJECT
- (r'\[[^]]+\]', Name.Variable.Class),
- # keywords
- (words((
- 'DIMENSION', 'DIMENSIONS', 'BOTTOM', 'METRIC', 'COUNT', 'OTHER',
- 'FACT', 'WITH', 'TOP', 'OR', 'ATTRIBUTE', 'CREATE', 'PARENT',
- 'FALSE', 'ROW', 'ROWS', 'FROM', 'ALL', 'AS', 'PF', 'COLUMN',
- 'COLUMNS', 'DEFINE', 'REPORT', 'LIMIT', 'TABLE', 'LIKE', 'AND',
- 'BY', 'BETWEEN', 'EXCEPT', 'SELECT', 'MATCH', 'WHERE', 'TRUE',
- 'FOR', 'IN', 'WITHOUT', 'FILTER', 'ALIAS', 'WHEN', 'NOT', 'ON',
- 'KEYS', 'KEY', 'FULLSET', 'PRIMARY', 'LABELS', 'LABEL',
- 'VISUAL', 'TITLE', 'DESCRIPTION', 'FOLDER', 'ALTER', 'DROP',
- 'ADD', 'DATASET', 'DATATYPE', 'INT', 'BIGINT', 'DOUBLE', 'DATE',
- 'VARCHAR', 'DECIMAL', 'SYNCHRONIZE', 'TYPE', 'DEFAULT', 'ORDER',
- 'ASC', 'DESC', 'HYPERLINK', 'INCLUDE', 'TEMPLATE', 'MODIFY'),
- suffix=r'\b'),
- Keyword),
- # FUNCNAME
- (r'[a-z]\w*\b', Name.Function),
- # Comments
- (r'#.*', Comment.Single),
- # Punctuation
- (r'[,;()]', Punctuation),
- # Space is not significant
- (r'\s+', Text)
- ],
- 'string-literal': [
- (r'\\[tnrfbae"\\]', String.Escape),
- (r'"', String, '#pop'),
- (r'[^\\"]+', String)
- ],
- }
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py
deleted file mode 100644
index e676a8af..00000000
--- a/pygments/lexers/c_cpp.py
+++ /dev/null
@@ -1,252 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.c_cpp
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for C/C++ languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, using, \
- this, inherit, default, words
-from pygments.util import get_bool_opt
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-
-__all__ = ['CLexer', 'CppLexer']
-
-
-class CFamilyLexer(RegexLexer):
- """
- For C family source code. This is used as a base class to avoid repetitious
- definitions.
- """
-
- #: optional Comment or Whitespace
- _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
-
- # The trailing ?, rather than *, avoids a geometric performance drop here.
- #: only one /* */ style comment
- _ws1 = r'\s*(?:/[*].*?[*]/\s*)?'
-
- tokens = {
- 'whitespace': [
- # preprocessor directives: without whitespace
- (r'^#if\s+0', Comment.Preproc, 'if0'),
- ('^#', Comment.Preproc, 'macro'),
- # or with whitespace
- ('^(' + _ws1 + r')(#if\s+0)',
- bygroups(using(this), Comment.Preproc), 'if0'),
- ('^(' + _ws1 + ')(#)',
- bygroups(using(this), Comment.Preproc), 'macro'),
- (r'\n', Text),
- (r'\s+', Text),
- (r'\\\n', Text), # line continuation
- (r'//(\n|[\w\W]*?[^\\]\n)', Comment.Single),
- (r'/(\\\n)?[*][\w\W]*?[*](\\\n)?/', Comment.Multiline),
- # Open until EOF, so no ending delimeter
- (r'/(\\\n)?[*][\w\W]*', Comment.Multiline),
- ],
- 'statements': [
- (r'(L?)(")', bygroups(String.Affix, String), 'string'),
- (r"(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')",
- bygroups(String.Affix, String.Char, String.Char, 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),
- (words(('asm', 'auto', 'break', 'case', 'const', 'continue',
- 'default', 'do', 'else', 'enum', 'extern', 'for', 'goto',
- 'if', 'register', 'restricted', 'return', 'sizeof',
- 'static', 'struct', 'switch', 'typedef', 'union',
- 'volatile', 'while'),
- suffix=r'\b'), Keyword),
- (r'(bool|int|long|float|short|double|char|unsigned|signed|void)\b',
- Keyword.Type),
- (words(('inline', '_inline', '__inline', 'naked', 'restrict',
- 'thread', 'typename'), suffix=r'\b'), Keyword.Reserved),
- # Vector intrinsics
- (r'(__m(128i|128d|128|64))\b', Keyword.Reserved),
- # Microsoft-isms
- (words((
- 'asm', 'int8', 'based', 'except', 'int16', 'stdcall', 'cdecl',
- 'fastcall', 'int32', 'declspec', 'finally', 'int64', 'try',
- 'leave', 'wchar_t', 'w64', 'unaligned', 'raise', 'noop',
- 'identifier', 'forceinline', 'assume'),
- prefix=r'__', suffix=r'\b'), Keyword.Reserved),
- (r'(true|false|NULL)\b', Name.Builtin),
- (r'([a-zA-Z_]\w*)(\s*)(:)(?!:)', bygroups(Name.Label, Text, Punctuation)),
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'root': [
- include('whitespace'),
- # functions
- (r'((?:[\w*\s])+?(?:\s|[*]))' # return arguments
- r'([a-zA-Z_]\w*)' # method name
- r'(\s*\([^;]*?\))' # signature
- r'([^;{]*)(\{)',
- bygroups(using(this), Name.Function, using(this), using(this),
- Punctuation),
- 'function'),
- # function declarations
- (r'((?:[\w*\s])+?(?:\s|[*]))' # return arguments
- r'([a-zA-Z_]\w*)' # method name
- r'(\s*\([^;]*?\))' # signature
- r'([^;]*)(;)',
- bygroups(using(this), Name.Function, using(this), using(this),
- Punctuation)),
- default('statement'),
- ],
- 'statement': [
- include('whitespace'),
- include('statements'),
- ('[{}]', Punctuation),
- (';', Punctuation, '#pop'),
- ],
- 'function': [
- include('whitespace'),
- include('statements'),
- (';', Punctuation),
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|'
- r'u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})', String.Escape),
- (r'[^\\"\n]+', String), # all other characters
- (r'\\\n', String), # line continuation
- (r'\\', String), # stray backslash
- ],
- 'macro': [
- (r'(include)(' + _ws1 + r')([^\n]+)',
- bygroups(Comment.Preproc, Text, Comment.PreprocFile)),
- (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 = set((
- '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 = set((
- '_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'))
- linux_types = set((
- 'clockid_t', 'cpu_set_t', 'cpumask_t', 'dev_t', 'gid_t', 'id_t', 'ino_t', 'key_t',
- 'mode_t', 'nfds_t', 'pid_t', 'rlim_t', 'sig_t', 'sighandler_t', 'siginfo_t',
- 'sigset_t', 'sigval_t', 'socklen_t', 'timer_t', 'uid_t'))
-
- def __init__(self, **options):
- self.stdlibhighlighting = get_bool_opt(options, 'stdlibhighlighting', True)
- self.c99highlighting = get_bool_opt(options, 'c99highlighting', True)
- self.platformhighlighting = get_bool_opt(options, 'platformhighlighting', 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
- elif self.platformhighlighting and value in self.linux_types:
- token = Keyword.Type
- yield index, token, value
-
-
-class CLexer(CFamilyLexer):
- """
- For C source code with preprocessor directives.
- """
- name = 'C'
- aliases = ['c']
- filenames = ['*.c', '*.h', '*.idc']
- mimetypes = ['text/x-chdr', 'text/x-csrc']
- priority = 0.1
-
- def analyse_text(text):
- if re.search(r'^\s*#include [<"]', text, re.MULTILINE):
- return 0.1
- if re.search(r'^\s*#ifn?def ', text, re.MULTILINE):
- return 0.1
-
-
-class CppLexer(CFamilyLexer):
- """
- For C++ source code with preprocessor directives.
- """
- name = 'C++'
- aliases = ['cpp', 'c++']
- filenames = ['*.cpp', '*.hpp', '*.c++', '*.h++',
- '*.cc', '*.hh', '*.cxx', '*.hxx',
- '*.C', '*.H', '*.cp', '*.CPP']
- mimetypes = ['text/x-c++hdr', 'text/x-c++src']
- priority = 0.1
-
- tokens = {
- 'statements': [
- (words((
- 'catch', 'const_cast', 'delete', 'dynamic_cast', 'explicit',
- 'export', 'friend', 'mutable', 'namespace', 'new', 'operator',
- 'private', 'protected', 'public', 'reinterpret_cast',
- 'restrict', 'static_cast', 'template', 'this', 'throw', 'throws',
- 'try', 'typeid', 'typename', 'using', 'virtual',
- 'constexpr', 'nullptr', 'decltype', 'thread_local',
- 'alignas', 'alignof', 'static_assert', 'noexcept', 'override',
- 'final'), suffix=r'\b'), Keyword),
- (r'char(16_t|32_t)\b', Keyword.Type),
- (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
- # C++11 raw strings
- (r'(R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)(")',
- bygroups(String.Affix, String, String.Delimiter, String.Delimiter,
- String, String.Delimiter, String)),
- # C++11 UTF-8/16/32 strings
- (r'(u8|u|U)(")', bygroups(String.Affix, String), 'string'),
- inherit,
- ],
- 'root': [
- inherit,
- # C++ Microsoft-isms
- (words(('virtual_inheritance', 'uuidof', 'super', 'single_inheritance',
- 'multiple_inheritance', 'interface', 'event'),
- prefix=r'__', suffix=r'\b'), Keyword.Reserved),
- # Offload C++ extensions, http://offload.codeplay.com/
- (r'__(offload|blockingoffload|outer)\b', Keyword.Pseudo),
- ],
- 'classname': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop'),
- # template specification
- (r'\s*(?=>)', Text, '#pop'),
- ],
- }
-
- def analyse_text(text):
- if re.search('#include <[a-z_]+>', text):
- return 0.2
- if re.search('using namespace ', text):
- return 0.4
diff --git a/pygments/lexers/c_like.py b/pygments/lexers/c_like.py
deleted file mode 100644
index cc88dfb9..00000000
--- a/pygments/lexers/c_like.py
+++ /dev/null
@@ -1,571 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.c_like
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for other C-like languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, inherit, words, \
- default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-from pygments.lexers.c_cpp import CLexer, CppLexer
-from pygments.lexers import _mql_builtins
-
-__all__ = ['PikeLexer', 'NesCLexer', 'ClayLexer', 'ECLexer', 'ValaLexer',
- 'CudaLexer', 'SwigLexer', 'MqlLexer', 'ArduinoLexer', 'CharmciLexer']
-
-
-class PikeLexer(CppLexer):
- """
- For `Pike <http://pike.lysator.liu.se/>`_ source code.
-
- .. versionadded:: 2.0
- """
- name = 'Pike'
- aliases = ['pike']
- filenames = ['*.pike', '*.pmod']
- mimetypes = ['text/x-pike']
-
- tokens = {
- 'statements': [
- (words((
- 'catch', 'new', 'private', 'protected', 'public', 'gauge',
- 'throw', 'throws', 'class', 'interface', 'implement', 'abstract', 'extends', 'from',
- 'this', 'super', 'constant', 'final', 'static', 'import', 'use', 'extern',
- 'inline', 'proto', 'break', 'continue', 'if', 'else', 'for',
- 'while', 'do', 'switch', 'case', 'as', 'in', 'version', 'return', 'true', 'false', 'null',
- '__VERSION__', '__MAJOR__', '__MINOR__', '__BUILD__', '__REAL_VERSION__',
- '__REAL_MAJOR__', '__REAL_MINOR__', '__REAL_BUILD__', '__DATE__', '__TIME__',
- '__FILE__', '__DIR__', '__LINE__', '__AUTO_BIGNUM__', '__NT__', '__PIKE__',
- '__amigaos__', '_Pragma', 'static_assert', 'defined', 'sscanf'), suffix=r'\b'),
- Keyword),
- (r'(bool|int|long|float|short|double|char|string|object|void|mapping|'
- r'array|multiset|program|function|lambda|mixed|'
- r'[a-z_][a-z0-9_]*_t)\b',
- Keyword.Type),
- (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
- (r'[~!%^&*+=|?:<>/@-]', Operator),
- inherit,
- ],
- 'classname': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop'),
- # template specification
- (r'\s*(?=>)', Text, '#pop'),
- ],
- }
-
-
-class NesCLexer(CLexer):
- """
- For `nesC <https://github.com/tinyos/nesc>`_ source code with preprocessor
- directives.
-
- .. versionadded:: 2.0
- """
- name = 'nesC'
- aliases = ['nesc']
- filenames = ['*.nc']
- mimetypes = ['text/x-nescsrc']
-
- tokens = {
- 'statements': [
- (words((
- 'abstract', 'as', 'async', 'atomic', 'call', 'command', 'component',
- 'components', 'configuration', 'event', 'extends', 'generic',
- 'implementation', 'includes', 'interface', 'module', 'new', 'norace',
- 'post', 'provides', 'signal', 'task', 'uses'), suffix=r'\b'),
- Keyword),
- (words(('nx_struct', 'nx_union', 'nx_int8_t', 'nx_int16_t', 'nx_int32_t',
- 'nx_int64_t', 'nx_uint8_t', 'nx_uint16_t', 'nx_uint32_t',
- 'nx_uint64_t'), suffix=r'\b'),
- Keyword.Type),
- inherit,
- ],
- }
-
-
-class ClayLexer(RegexLexer):
- """
- For `Clay <http://claylabs.com/clay/>`_ source.
-
- .. versionadded:: 2.0
- """
- name = 'Clay'
- filenames = ['*.clay']
- aliases = ['clay']
- mimetypes = ['text/x-clay']
- tokens = {
- 'root': [
- (r'\s', Text),
- (r'//.*?$', Comment.Single),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
- (r'\b(public|private|import|as|record|variant|instance'
- r'|define|overload|default|external|alias'
- r'|rvalue|ref|forward|inline|noinline|forceinline'
- r'|enum|var|and|or|not|if|else|goto|return|while'
- r'|switch|case|break|continue|for|in|true|false|try|catch|throw'
- r'|finally|onerror|staticassert|eval|when|newtype'
- r'|__FILE__|__LINE__|__COLUMN__|__ARG__'
- r')\b', Keyword),
- (r'[~!%^&*+=|:<>/-]', Operator),
- (r'[#(){}\[\],;.]', Punctuation),
- (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
- (r'\d+[LlUu]*', Number.Integer),
- (r'\b(true|false)\b', Name.Builtin),
- (r'(?i)[a-z_?][\w?]*', Name),
- (r'"""', String, 'tdqs'),
- (r'"', String, 'dqs'),
- ],
- 'strings': [
- (r'(?i)\\(x[0-9a-f]{2}|.)', String.Escape),
- (r'.', String),
- ],
- 'nl': [
- (r'\n', String),
- ],
- 'dqs': [
- (r'"', String, '#pop'),
- include('strings'),
- ],
- 'tdqs': [
- (r'"""', String, '#pop'),
- include('strings'),
- include('nl'),
- ],
- }
-
-
-class ECLexer(CLexer):
- """
- For eC source code with preprocessor directives.
-
- .. versionadded:: 1.5
- """
- name = 'eC'
- aliases = ['ec']
- filenames = ['*.ec', '*.eh']
- mimetypes = ['text/x-echdr', 'text/x-ecsrc']
-
- tokens = {
- 'statements': [
- (words((
- 'virtual', 'class', 'private', 'public', 'property', 'import',
- 'delete', 'new', 'new0', 'renew', 'renew0', 'define', 'get',
- 'set', 'remote', 'dllexport', 'dllimport', 'stdcall', 'subclass',
- '__on_register_module', 'namespace', 'using', 'typed_object',
- 'any_object', 'incref', 'register', 'watch', 'stopwatching', 'firewatchers',
- 'watchable', 'class_designer', 'class_fixed', 'class_no_expansion', 'isset',
- 'class_default_property', 'property_category', 'class_data',
- 'class_property', 'thisclass', 'dbtable', 'dbindex',
- 'database_open', 'dbfield'), suffix=r'\b'), Keyword),
- (words(('uint', 'uint16', 'uint32', 'uint64', 'bool', 'byte',
- 'unichar', 'int64'), suffix=r'\b'),
- Keyword.Type),
- (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
- (r'(null|value|this)\b', Name.Builtin),
- inherit,
- ],
- 'classname': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop'),
- # template specification
- (r'\s*(?=>)', Text, '#pop'),
- ],
- }
-
-
-class ValaLexer(RegexLexer):
- """
- For Vala source code with preprocessor directives.
-
- .. versionadded:: 1.1
- """
- name = 'Vala'
- aliases = ['vala', 'vapi']
- filenames = ['*.vala', '*.vapi']
- mimetypes = ['text/x-vala']
-
- tokens = {
- 'whitespace': [
- (r'^\s*#if\s+0', Comment.Preproc, 'if0'),
- (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'(?s)""".*?"""', String), # verbatim strings
- (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
- (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
- (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
- (r'0[0-7]+[Ll]?', Number.Oct),
- (r'\d+[Ll]?', Number.Integer),
- (r'[~!%^&*+=|?:<>/-]', Operator),
- (r'(\[)(Compact|Immutable|(?:Boolean|Simple)Type)(\])',
- bygroups(Punctuation, Name.Decorator, Punctuation)),
- # TODO: "correctly" parse complex code attributes
- (r'(\[)(CCode|(?:Integer|Floating)Type)',
- bygroups(Punctuation, Name.Decorator)),
- (r'[()\[\],.]', Punctuation),
- (words((
- 'as', 'base', 'break', 'case', 'catch', 'construct', 'continue',
- 'default', 'delete', 'do', 'else', 'enum', 'finally', 'for',
- 'foreach', 'get', 'if', 'in', 'is', 'lock', 'new', 'out', 'params',
- 'return', 'set', 'sizeof', 'switch', 'this', 'throw', 'try',
- 'typeof', 'while', 'yield'), suffix=r'\b'),
- Keyword),
- (words((
- 'abstract', 'const', 'delegate', 'dynamic', 'ensures', 'extern',
- 'inline', 'internal', 'override', 'owned', 'private', 'protected',
- 'public', 'ref', 'requires', 'signal', 'static', 'throws', 'unowned',
- 'var', 'virtual', 'volatile', 'weak', 'yields'), suffix=r'\b'),
- Keyword.Declaration),
- (r'(namespace|using)(\s+)', bygroups(Keyword.Namespace, Text),
- 'namespace'),
- (r'(class|errordomain|interface|struct)(\s+)',
- bygroups(Keyword.Declaration, Text), 'class'),
- (r'(\.)([a-zA-Z_]\w*)',
- bygroups(Operator, Name.Attribute)),
- # void is an actual keyword, others are in glib-2.0.vapi
- (words((
- 'void', 'bool', 'char', 'double', 'float', 'int', 'int8', 'int16',
- 'int32', 'int64', 'long', 'short', 'size_t', 'ssize_t', 'string',
- 'time_t', 'uchar', 'uint', 'uint8', 'uint16', 'uint32', 'uint64',
- 'ulong', 'unichar', 'ushort'), suffix=r'\b'),
- Keyword.Type),
- (r'(true|false|null)\b', Name.Builtin),
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'root': [
- include('whitespace'),
- default('statement'),
- ],
- 'statement': [
- include('whitespace'),
- include('statements'),
- ('[{}]', Punctuation),
- (';', 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
- ],
- '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),
- ],
- 'class': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop')
- ],
- 'namespace': [
- (r'[a-zA-Z_][\w.]*', Name.Namespace, '#pop')
- ],
- }
-
-
-class CudaLexer(CLexer):
- """
- For NVIDIA `CUDA™ <http://developer.nvidia.com/category/zone/cuda-zone>`_
- source.
-
- .. versionadded:: 1.6
- """
- name = 'CUDA'
- filenames = ['*.cu', '*.cuh']
- aliases = ['cuda', 'cu']
- mimetypes = ['text/x-cuda']
-
- function_qualifiers = set(('__device__', '__global__', '__host__',
- '__noinline__', '__forceinline__'))
- variable_qualifiers = set(('__device__', '__constant__', '__shared__',
- '__restrict__'))
- vector_types = set(('char1', 'uchar1', 'char2', 'uchar2', 'char3', 'uchar3',
- 'char4', 'uchar4', 'short1', 'ushort1', 'short2', 'ushort2',
- 'short3', 'ushort3', 'short4', 'ushort4', 'int1', 'uint1',
- 'int2', 'uint2', 'int3', 'uint3', 'int4', 'uint4', 'long1',
- 'ulong1', 'long2', 'ulong2', 'long3', 'ulong3', 'long4',
- 'ulong4', 'longlong1', 'ulonglong1', 'longlong2',
- 'ulonglong2', 'float1', 'float2', 'float3', 'float4',
- 'double1', 'double2', 'dim3'))
- variables = set(('gridDim', 'blockIdx', 'blockDim', 'threadIdx', 'warpSize'))
- functions = set(('__threadfence_block', '__threadfence', '__threadfence_system',
- '__syncthreads', '__syncthreads_count', '__syncthreads_and',
- '__syncthreads_or'))
- execution_confs = set(('<<<', '>>>'))
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in CLexer.get_tokens_unprocessed(self, text):
- if token is Name:
- if value in self.variable_qualifiers:
- token = Keyword.Type
- elif value in self.vector_types:
- token = Keyword.Type
- elif value in self.variables:
- token = Name.Builtin
- elif value in self.execution_confs:
- token = Keyword.Pseudo
- elif value in self.function_qualifiers:
- token = Keyword.Reserved
- elif value in self.functions:
- token = Name.Function
- yield index, token, value
-
-
-class SwigLexer(CppLexer):
- """
- For `SWIG <http://www.swig.org/>`_ source code.
-
- .. versionadded:: 2.0
- """
- name = 'SWIG'
- aliases = ['swig']
- filenames = ['*.swg', '*.i']
- mimetypes = ['text/swig']
- priority = 0.04 # Lower than C/C++ and Objective C/C++
-
- tokens = {
- 'statements': [
- # SWIG directives
- (r'(%[a-z_][a-z0-9_]*)', Name.Function),
- # Special variables
- (r'\$\**\&?\w+', Name),
- # Stringification / additional preprocessor directives
- (r'##*[a-zA-Z_]\w*', Comment.Preproc),
- inherit,
- ],
- }
-
- # This is a far from complete set of SWIG directives
- swig_directives = set((
- # Most common directives
- '%apply', '%define', '%director', '%enddef', '%exception', '%extend',
- '%feature', '%fragment', '%ignore', '%immutable', '%import', '%include',
- '%inline', '%insert', '%module', '%newobject', '%nspace', '%pragma',
- '%rename', '%shared_ptr', '%template', '%typecheck', '%typemap',
- # Less common directives
- '%arg', '%attribute', '%bang', '%begin', '%callback', '%catches', '%clear',
- '%constant', '%copyctor', '%csconst', '%csconstvalue', '%csenum',
- '%csmethodmodifiers', '%csnothrowexception', '%default', '%defaultctor',
- '%defaultdtor', '%defined', '%delete', '%delobject', '%descriptor',
- '%exceptionclass', '%exceptionvar', '%extend_smart_pointer', '%fragments',
- '%header', '%ifcplusplus', '%ignorewarn', '%implicit', '%implicitconv',
- '%init', '%javaconst', '%javaconstvalue', '%javaenum', '%javaexception',
- '%javamethodmodifiers', '%kwargs', '%luacode', '%mutable', '%naturalvar',
- '%nestedworkaround', '%perlcode', '%pythonabc', '%pythonappend',
- '%pythoncallback', '%pythoncode', '%pythondynamic', '%pythonmaybecall',
- '%pythonnondynamic', '%pythonprepend', '%refobject', '%shadow', '%sizeof',
- '%trackobjects', '%types', '%unrefobject', '%varargs', '%warn',
- '%warnfilter'))
-
- def analyse_text(text):
- rv = 0
- # Search for SWIG directives, which are conventionally at the beginning of
- # a line. The probability of them being within a line is low, so let another
- # lexer win in this case.
- matches = re.findall(r'^\s*(%[a-z_][a-z0-9_]*)', text, re.M)
- for m in matches:
- if m in SwigLexer.swig_directives:
- rv = 0.98
- break
- else:
- rv = 0.91 # Fraction higher than MatlabLexer
- return rv
-
-
-class MqlLexer(CppLexer):
- """
- For `MQL4 <http://docs.mql4.com/>`_ and
- `MQL5 <http://www.mql5.com/en/docs>`_ source code.
-
- .. versionadded:: 2.0
- """
- name = 'MQL'
- aliases = ['mql', 'mq4', 'mq5', 'mql4', 'mql5']
- filenames = ['*.mq4', '*.mq5', '*.mqh']
- mimetypes = ['text/x-mql']
-
- tokens = {
- 'statements': [
- (words(_mql_builtins.keywords, suffix=r'\b'), Keyword),
- (words(_mql_builtins.c_types, suffix=r'\b'), Keyword.Type),
- (words(_mql_builtins.types, suffix=r'\b'), Name.Function),
- (words(_mql_builtins.constants, suffix=r'\b'), Name.Constant),
- (words(_mql_builtins.colors, prefix='(clr)?', suffix=r'\b'),
- Name.Constant),
- inherit,
- ],
- }
-
-
-class ArduinoLexer(CppLexer):
- """
- For `Arduino(tm) <https://arduino.cc/>`_ source.
-
- This is an extension of the CppLexer, as the Arduino® Language is a superset
- of C++
-
- .. versionadded:: 2.1
- """
-
- name = 'Arduino'
- aliases = ['arduino']
- filenames = ['*.ino']
- mimetypes = ['text/x-arduino']
-
- # Language sketch main structure functions
- structure = set(('setup', 'loop'))
-
- # Language operators
- operators = set(('not', 'or', 'and', 'xor'))
-
- # Language 'variables'
- variables = set((
- 'DIGITAL_MESSAGE', 'FIRMATA_STRING', 'ANALOG_MESSAGE', 'REPORT_DIGITAL',
- 'REPORT_ANALOG', 'INPUT_PULLUP', 'SET_PIN_MODE', 'INTERNAL2V56', 'SYSTEM_RESET',
- 'LED_BUILTIN', 'INTERNAL1V1', 'SYSEX_START', 'INTERNAL', 'EXTERNAL', 'HIGH',
- 'LOW', 'INPUT', 'OUTPUT', 'INPUT_PULLUP', 'LED_BUILTIN', 'true', 'false',
- 'void', 'boolean', 'char', 'unsigned char', 'byte', 'int', 'unsigned int',
- 'word', 'long', 'unsigned long', 'short', 'float', 'double', 'string', 'String',
- 'array', 'static', 'volatile', 'const', 'boolean', 'byte', 'word', 'string',
- 'String', 'array', 'int', 'float', 'private', 'char', 'virtual', 'operator',
- 'sizeof', 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', 'int8_t', 'int16_t',
- 'int32_t', 'int64_t', 'dynamic_cast', 'typedef', 'const_cast', 'const',
- 'struct', 'static_cast', 'union', 'unsigned', 'long', 'volatile', 'static',
- 'protected', 'bool', 'public', 'friend', 'auto', 'void', 'enum', 'extern',
- 'class', 'short', 'reinterpret_cast', 'double', 'register', 'explicit',
- 'signed', 'inline', 'delete', '_Bool', 'complex', '_Complex', '_Imaginary',
- 'atomic_bool', 'atomic_char', 'atomic_schar', 'atomic_uchar', 'atomic_short',
- 'atomic_ushort', 'atomic_int', 'atomic_uint', 'atomic_long', 'atomic_ulong',
- 'atomic_llong', 'atomic_ullong', 'PROGMEM'))
-
- # Language shipped functions and class ( )
- functions = set((
- 'KeyboardController', 'MouseController', 'SoftwareSerial', 'EthernetServer',
- 'EthernetClient', 'LiquidCrystal', 'RobotControl', 'GSMVoiceCall',
- 'EthernetUDP', 'EsploraTFT', 'HttpClient', 'RobotMotor', 'WiFiClient',
- 'GSMScanner', 'FileSystem', 'Scheduler', 'GSMServer', 'YunClient', 'YunServer',
- 'IPAddress', 'GSMClient', 'GSMModem', 'Keyboard', 'Ethernet', 'Console',
- 'GSMBand', 'Esplora', 'Stepper', 'Process', 'WiFiUDP', 'GSM_SMS', 'Mailbox',
- 'USBHost', 'Firmata', 'PImage', 'Client', 'Server', 'GSMPIN', 'FileIO',
- 'Bridge', 'Serial', 'EEPROM', 'Stream', 'Mouse', 'Audio', 'Servo', 'File',
- 'Task', 'GPRS', 'WiFi', 'Wire', 'TFT', 'GSM', 'SPI', 'SD',
- 'runShellCommandAsynchronously', 'analogWriteResolution',
- 'retrieveCallingNumber', 'printFirmwareVersion', 'analogReadResolution',
- 'sendDigitalPortPair', 'noListenOnLocalhost', 'readJoystickButton',
- 'setFirmwareVersion', 'readJoystickSwitch', 'scrollDisplayRight',
- 'getVoiceCallStatus', 'scrollDisplayLeft', 'writeMicroseconds',
- 'delayMicroseconds', 'beginTransmission', 'getSignalStrength',
- 'runAsynchronously', 'getAsynchronously', 'listenOnLocalhost',
- 'getCurrentCarrier', 'readAccelerometer', 'messageAvailable',
- 'sendDigitalPorts', 'lineFollowConfig', 'countryNameWrite', 'runShellCommand',
- 'readStringUntil', 'rewindDirectory', 'readTemperature', 'setClockDivider',
- 'readLightSensor', 'endTransmission', 'analogReference', 'detachInterrupt',
- 'countryNameRead', 'attachInterrupt', 'encryptionType', 'readBytesUntil',
- 'robotNameWrite', 'readMicrophone', 'robotNameRead', 'cityNameWrite',
- 'userNameWrite', 'readJoystickY', 'readJoystickX', 'mouseReleased',
- 'openNextFile', 'scanNetworks', 'noInterrupts', 'digitalWrite', 'beginSpeaker',
- 'mousePressed', 'isActionDone', 'mouseDragged', 'displayLogos', 'noAutoscroll',
- 'addParameter', 'remoteNumber', 'getModifiers', 'keyboardRead', 'userNameRead',
- 'waitContinue', 'processInput', 'parseCommand', 'printVersion', 'readNetworks',
- 'writeMessage', 'blinkVersion', 'cityNameRead', 'readMessage', 'setDataMode',
- 'parsePacket', 'isListening', 'setBitOrder', 'beginPacket', 'isDirectory',
- 'motorsWrite', 'drawCompass', 'digitalRead', 'clearScreen', 'serialEvent',
- 'rightToLeft', 'setTextSize', 'leftToRight', 'requestFrom', 'keyReleased',
- 'compassRead', 'analogWrite', 'interrupts', 'WiFiServer', 'disconnect',
- 'playMelody', 'parseFloat', 'autoscroll', 'getPINUsed', 'setPINUsed',
- 'setTimeout', 'sendAnalog', 'readSlider', 'analogRead', 'beginWrite',
- 'createChar', 'motorsStop', 'keyPressed', 'tempoWrite', 'readButton',
- 'subnetMask', 'debugPrint', 'macAddress', 'writeGreen', 'randomSeed',
- 'attachGPRS', 'readString', 'sendString', 'remotePort', 'releaseAll',
- 'mouseMoved', 'background', 'getXChange', 'getYChange', 'answerCall',
- 'getResult', 'voiceCall', 'endPacket', 'constrain', 'getSocket', 'writeJSON',
- 'getButton', 'available', 'connected', 'findUntil', 'readBytes', 'exitValue',
- 'readGreen', 'writeBlue', 'startLoop', 'IPAddress', 'isPressed', 'sendSysex',
- 'pauseMode', 'gatewayIP', 'setCursor', 'getOemKey', 'tuneWrite', 'noDisplay',
- 'loadImage', 'switchPIN', 'onRequest', 'onReceive', 'changePIN', 'playFile',
- 'noBuffer', 'parseInt', 'overflow', 'checkPIN', 'knobRead', 'beginTFT',
- 'bitClear', 'updateIR', 'bitWrite', 'position', 'writeRGB', 'highByte',
- 'writeRed', 'setSpeed', 'readBlue', 'noStroke', 'remoteIP', 'transfer',
- 'shutdown', 'hangCall', 'beginSMS', 'endWrite', 'attached', 'maintain',
- 'noCursor', 'checkReg', 'checkPUK', 'shiftOut', 'isValid', 'shiftIn', 'pulseIn',
- 'connect', 'println', 'localIP', 'pinMode', 'getIMEI', 'display', 'noBlink',
- 'process', 'getBand', 'running', 'beginSD', 'drawBMP', 'lowByte', 'setBand',
- 'release', 'bitRead', 'prepare', 'pointTo', 'readRed', 'setMode', 'noFill',
- 'remove', 'listen', 'stroke', 'detach', 'attach', 'noTone', 'exists', 'buffer',
- 'height', 'bitSet', 'circle', 'config', 'cursor', 'random', 'IRread', 'setDNS',
- 'endSMS', 'getKey', 'micros', 'millis', 'begin', 'print', 'write', 'ready',
- 'flush', 'width', 'isPIN', 'blink', 'clear', 'press', 'mkdir', 'rmdir', 'close',
- 'point', 'yield', 'image', 'BSSID', 'click', 'delay', 'read', 'text', 'move',
- 'peek', 'beep', 'rect', 'line', 'open', 'seek', 'fill', 'size', 'turn', 'stop',
- 'home', 'find', 'step', 'tone', 'sqrt', 'RSSI', 'SSID', 'end', 'bit', 'tan',
- 'cos', 'sin', 'pow', 'map', 'abs', 'max', 'min', 'get', 'run', 'put',
- 'isAlphaNumeric', 'isAlpha', 'isAscii', 'isWhitespace', 'isControl', 'isDigit',
- 'isGraph', 'isLowerCase', 'isPrintable', 'isPunct', 'isSpace', 'isUpperCase',
- 'isHexadecimalDigit'))
-
- # do not highlight
- suppress_highlight = set((
- 'namespace', 'template', 'mutable', 'using', 'asm', 'typeid',
- 'typename', 'this', 'alignof', 'constexpr', 'decltype', 'noexcept',
- 'static_assert', 'thread_local', 'restrict'))
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in CppLexer.get_tokens_unprocessed(self, text):
- if value in self.structure:
- yield index, Name.Builtin, value
- elif value in self.operators:
- yield index, Operator, value
- elif value in self.variables:
- yield index, Keyword.Reserved, value
- elif value in self.suppress_highlight:
- yield index, Name, value
- elif value in self.functions:
- yield index, Name.Function, value
- else:
- yield index, token, value
-
-
-class CharmciLexer(CppLexer):
- """
- For `Charm++ <https://charm.cs.illinois.edu>`_ interface files (.ci).
-
- .. versionadded:: 2.4
- """
-
- name = 'Charmci'
- aliases = ['charmci']
- filenames = ['*.ci']
-
- mimetypes = []
-
- tokens = {
- 'statements': [
- (r'(module)(\s+)', bygroups(Keyword, Text), 'classname'),
- (words(('mainmodule', 'mainchare', 'chare', 'array', 'group',
- 'nodegroup', 'message', 'conditional')), Keyword),
- (words(('entry', 'aggregate', 'threaded', 'sync', 'exclusive',
- 'nokeep', 'notrace', 'immediate', 'expedited', 'inline',
- 'local', 'python', 'accel', 'readwrite', 'writeonly',
- 'accelblock', 'memcritical', 'packed', 'varsize',
- 'initproc', 'initnode', 'initcall', 'stacksize',
- 'createhere', 'createhome', 'reductiontarget', 'iget',
- 'nocopy', 'mutable', 'migratable', 'readonly')), Keyword),
- inherit,
- ],
- }
diff --git a/pygments/lexers/capnproto.py b/pygments/lexers/capnproto.py
deleted file mode 100644
index 01524046..00000000
--- a/pygments/lexers/capnproto.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.capnproto
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Cap'n Proto schema language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, default
-from pygments.token import Text, Comment, Keyword, Name, Literal
-
-__all__ = ['CapnProtoLexer']
-
-
-class CapnProtoLexer(RegexLexer):
- """
- For `Cap'n Proto <https://capnproto.org>`_ source.
-
- .. versionadded:: 2.2
- """
- name = 'Cap\'n Proto'
- filenames = ['*.capnp']
- aliases = ['capnp']
-
- flags = re.MULTILINE | re.UNICODE
-
- tokens = {
- 'root': [
- (r'#.*?$', Comment.Single),
- (r'@[0-9a-zA-Z]*', Name.Decorator),
- (r'=', Literal, 'expression'),
- (r':', Name.Class, 'type'),
- (r'\$', Name.Attribute, 'annotation'),
- (r'(struct|enum|interface|union|import|using|const|annotation|'
- r'extends|in|of|on|as|with|from|fixed)\b',
- Keyword),
- (r'[\w.]+', Name),
- (r'[^#@=:$\w]+', Text),
- ],
- 'type': [
- (r'[^][=;,(){}$]+', Name.Class),
- (r'[\[(]', Name.Class, 'parentype'),
- default('#pop'),
- ],
- 'parentype': [
- (r'[^][;()]+', Name.Class),
- (r'[\[(]', Name.Class, '#push'),
- (r'[])]', Name.Class, '#pop'),
- default('#pop'),
- ],
- 'expression': [
- (r'[^][;,(){}$]+', Literal),
- (r'[\[(]', Literal, 'parenexp'),
- default('#pop'),
- ],
- 'parenexp': [
- (r'[^][;()]+', Literal),
- (r'[\[(]', Literal, '#push'),
- (r'[])]', Literal, '#pop'),
- default('#pop'),
- ],
- 'annotation': [
- (r'[^][;,(){}=:]+', Name.Attribute),
- (r'[\[(]', Name.Attribute, 'annexp'),
- default('#pop'),
- ],
- 'annexp': [
- (r'[^][;()]+', Name.Attribute),
- (r'[\[(]', Name.Attribute, '#push'),
- (r'[])]', Name.Attribute, '#pop'),
- default('#pop'),
- ],
- }
diff --git a/pygments/lexers/chapel.py b/pygments/lexers/chapel.py
deleted file mode 100644
index f2cd80dd..00000000
--- a/pygments/lexers/chapel.py
+++ /dev/null
@@ -1,112 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.chapel
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Chapel language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['ChapelLexer']
-
-
-class ChapelLexer(RegexLexer):
- """
- For `Chapel <http://chapel.cray.com/>`_ source.
-
- .. versionadded:: 2.0
- """
- name = 'Chapel'
- filenames = ['*.chpl']
- aliases = ['chapel', 'chpl']
- # mimetypes = ['text/x-chapel']
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'\s+', Text),
- (r'\\\n', Text),
-
- (r'//(.*?)\n', Comment.Single),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
-
- (r'(config|const|in|inout|out|param|ref|type|var)\b',
- Keyword.Declaration),
- (r'(false|nil|true)\b', Keyword.Constant),
- (r'(bool|complex|imag|int|opaque|range|real|string|uint)\b',
- Keyword.Type),
- (words((
- 'align', 'as', 'atomic',
- 'begin', 'borrowed', 'break', 'by',
- 'catch', 'cobegin', 'coforall', 'continue',
- 'delete', 'dmapped', 'do', 'domain',
- 'else', 'enum', 'except', 'export', 'extern',
- 'for', 'forall',
- 'if', 'index', 'inline',
- 'label', 'lambda', 'let', 'local',
- 'new', 'noinit',
- 'on', 'only', 'otherwise', 'override', 'owned',
- 'pragma', 'private', 'prototype', 'public',
- 'reduce', 'require', 'return',
- 'scan', 'select', 'serial', 'shared', 'single', 'sparse', 'subdomain', 'sync',
- 'then', 'throw', 'throws', 'try',
- 'unmanaged', 'use',
- 'when', 'where', 'while', 'with',
- 'yield',
- 'zip'), suffix=r'\b'),
- Keyword),
- (r'(iter)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
- (r'(proc)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
- (r'(class|module|record|union)(\s+)', bygroups(Keyword, Text),
- 'classname'),
-
- # imaginary integers
- (r'\d+i', Number),
- (r'\d+\.\d*([Ee][-+]\d+)?i', Number),
- (r'\.\d+([Ee][-+]\d+)?i', Number),
- (r'\d+[Ee][-+]\d+i', Number),
-
- # reals cannot end with a period due to lexical ambiguity with
- # .. operator. See reference for rationale.
- (r'(\d*\.\d+)([eE][+-]?[0-9]+)?i?', Number.Float),
- (r'\d+[eE][+-]?[0-9]+i?', Number.Float),
-
- # integer literals
- # -- binary
- (r'0[bB][01]+', Number.Bin),
- # -- hex
- (r'0[xX][0-9a-fA-F]+', Number.Hex),
- # -- octal
- (r'0[oO][0-7]+', Number.Oct),
- # -- decimal
- (r'[0-9]+', Number.Integer),
-
- # strings
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'(\\\\|\\'|[^'])*'", String),
-
- # tokens
- (r'(=|\+=|-=|\*=|/=|\*\*=|%=|&=|\|=|\^=|&&=|\|\|=|<<=|>>=|'
- r'<=>|<~>|\.\.|by|#|\.\.\.|'
- r'&&|\|\||!|&|\||\^|~|<<|>>|'
- r'==|!=|<=|>=|<|>|'
- r'[+\-*/%]|\*\*)', Operator),
- (r'[:;,.?()\[\]{}]', Punctuation),
-
- # identifiers
- (r'[a-zA-Z_][\w$]*', Name.Other),
- ],
- 'classname': [
- (r'[a-zA-Z_][\w$]*', Name.Class, '#pop'),
- ],
- 'procname': [
- (r'([a-zA-Z_][.\w$]*|\~[a-zA-Z_][.\w$]*|[+*/!~%<>=&^|\-]{1,2})',
- Name.Function, '#pop'),
- ],
- }
diff --git a/pygments/lexers/clean.py b/pygments/lexers/clean.py
deleted file mode 100644
index 59b183b8..00000000
--- a/pygments/lexers/clean.py
+++ /dev/null
@@ -1,178 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.clean
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Clean language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import ExtendedRegexLexer, words, include, bygroups
-from pygments.token import Comment, Error, Keyword, Literal, Name, Number, \
- Operator, Punctuation, String, Whitespace
-
-__all__ = ['CleanLexer']
-
-
-class CleanLexer(ExtendedRegexLexer):
- """
- Lexer for the general purpose, state-of-the-art, pure and lazy functional
- programming language Clean (http://clean.cs.ru.nl/Clean).
-
- .. versionadded: 2.2
- """
- name = 'Clean'
- aliases = ['clean']
- filenames = ['*.icl', '*.dcl']
-
- keywords = (
- 'case', 'ccall', 'class', 'code', 'code inline', 'derive', 'export',
- 'foreign', 'generic', 'if', 'in', 'infix', 'infixl', 'infixr',
- 'instance', 'let', 'of', 'otherwise', 'special', 'stdcall', 'where',
- 'with')
-
- modulewords = ('implementation', 'definition', 'system')
-
- lowerId = r'[a-z`][\w\d`]*'
- upperId = r'[A-Z`][\w\d`]*'
- funnyId = r'[~@#\$%\^?!+\-*<>\\/|&=:]+'
- scoreUpperId = r'_' + upperId
- scoreLowerId = r'_' + lowerId
- moduleId = r'[a-zA-Z_][a-zA-Z0-9_.`]+'
- classId = '|'.join([lowerId, upperId, funnyId])
-
- tokens = {
- 'root': [
- include('comments'),
- include('keywords'),
- include('module'),
- include('import'),
- include('whitespace'),
- include('literals'),
- include('operators'),
- include('delimiters'),
- include('names'),
- ],
- 'whitespace': [
- (r'\s+', Whitespace),
- ],
- 'comments': [
- (r'//.*\n', Comment.Single),
- (r'/\*', Comment.Multi, 'comments.in'),
- (r'/\*\*', Comment.Special, 'comments.in'),
- ],
- 'comments.in': [
- (r'\*\/', Comment.Multi, '#pop'),
- (r'/\*', Comment.Multi, '#push'),
- (r'[^*/]+', Comment.Multi),
- (r'\*(?!/)', Comment.Multi),
- (r'/', Comment.Multi),
- ],
- 'keywords': [
- (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword),
- ],
- 'module': [
- (words(modulewords, prefix=r'\b', suffix=r'\b'), Keyword.Namespace),
- (r'\bmodule\b', Keyword.Namespace, 'module.name'),
- ],
- 'module.name': [
- include('whitespace'),
- (moduleId, Name.Class, '#pop'),
- ],
- 'import': [
- (r'\b(import)\b(\s*)', bygroups(Keyword, Whitespace), 'import.module'),
- (r'\b(from)\b(\s*)\b(' + moduleId + r')\b(\s*)\b(import)\b',
- bygroups(Keyword, Whitespace, Name.Class, Whitespace, Keyword),
- 'import.what'),
- ],
- 'import.module': [
- (r'\b(qualified)\b(\s*)', bygroups(Keyword, Whitespace)),
- (r'(\s*)\b(as)\b', bygroups(Whitespace, Keyword), ('#pop', 'import.module.as')),
- (moduleId, Name.Class),
- (r'(\s*)(,)(\s*)', bygroups(Whitespace, Punctuation, Whitespace)),
- (r'\s*', Whitespace, '#pop'),
- ],
- 'import.module.as': [
- include('whitespace'),
- (lowerId, Name.Class, '#pop'),
- (upperId, Name.Class, '#pop'),
- ],
- 'import.what': [
- (r'\b(class)\b(\s+)(' + classId + r')',
- bygroups(Keyword, Whitespace, Name.Class), 'import.what.class'),
- (r'\b(instance)(\s+)(' + classId + r')(\s+)',
- bygroups(Keyword, Whitespace, Name.Class, Whitespace), 'import.what.instance'),
- (r'(::)(\s*)\b(' + upperId + r')\b',
- bygroups(Punctuation, Whitespace, Name.Class), 'import.what.type'),
- (r'\b(generic)\b(\s+)\b(' + lowerId + '|' + upperId + r')\b',
- bygroups(Keyword, Whitespace, Name)),
- include('names'),
- (r'(,)(\s+)', bygroups(Punctuation, Whitespace)),
- (r'$', Whitespace, '#pop'),
- include('whitespace'),
- ],
- 'import.what.class': [
- (r',', Punctuation, '#pop'),
- (r'\(', Punctuation, 'import.what.class.members'),
- (r'$', Whitespace, '#pop:2'),
- include('whitespace'),
- ],
- 'import.what.class.members': [
- (r',', Punctuation),
- (r'\.\.', Punctuation),
- (r'\)', Punctuation, '#pop'),
- include('names'),
- ],
- 'import.what.instance': [
- (r'[,)]', Punctuation, '#pop'),
- (r'\(', Punctuation, 'import.what.instance'),
- (r'$', Whitespace, '#pop:2'),
- include('whitespace'),
- include('names'),
- ],
- 'import.what.type': [
- (r',', Punctuation, '#pop'),
- (r'[({]', Punctuation, 'import.what.type.consesandfields'),
- (r'$', Whitespace, '#pop:2'),
- include('whitespace'),
- ],
- 'import.what.type.consesandfields': [
- (r',', Punctuation),
- (r'\.\.', Punctuation),
- (r'[)}]', Punctuation, '#pop'),
- include('names'),
- ],
- 'literals': [
- (r'\'([^\'\\]|\\(x[\da-fA-F]+|\d+|.))\'', Literal.Char),
- (r'[+~-]?0[0-7]+\b', Number.Oct),
- (r'[+~-]?\d+\.\d+(E[+-]?\d+)?', Number.Float),
- (r'[+~-]?\d+\b', Number.Integer),
- (r'[+~-]?0x[\da-fA-F]+\b', Number.Hex),
- (r'True|False', Literal),
- (r'"', String.Double, 'literals.stringd'),
- ],
- 'literals.stringd': [
- (r'[^\\"\n]+', String.Double),
- (r'"', String.Double, '#pop'),
- (r'\\.', String.Double),
- (r'[$\n]', Error, '#pop'),
- ],
- 'operators': [
- (r'[-~@#\$%\^?!+*<>\\/|&=:\.]+', Operator),
- (r'\b_+\b', Operator),
- ],
- 'delimiters': [
- (r'[,;(){}\[\]]', Punctuation),
- (r'(\')([\w`.]+)(\')',
- bygroups(Punctuation, Name.Class, Punctuation)),
- ],
- 'names': [
- (lowerId, Name),
- (scoreLowerId, Name),
- (funnyId, Name.Function),
- (upperId, Name.Class),
- (scoreUpperId, Name.Class),
- ]
- }
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
deleted file mode 100644
index 0dab602e..00000000
--- a/pygments/lexers/compiled.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.compiled
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Just export lexer classes previously contained in this module.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexers.jvm import JavaLexer, ScalaLexer
-from pygments.lexers.c_cpp import CLexer, CppLexer
-from pygments.lexers.d import DLexer
-from pygments.lexers.objective import ObjectiveCLexer, \
- ObjectiveCppLexer, LogosLexer
-from pygments.lexers.go import GoLexer
-from pygments.lexers.rust import RustLexer
-from pygments.lexers.c_like import ECLexer, ValaLexer, CudaLexer
-from pygments.lexers.pascal import DelphiLexer, Modula2Lexer, AdaLexer
-from pygments.lexers.business import CobolLexer, CobolFreeformatLexer
-from pygments.lexers.fortran import FortranLexer
-from pygments.lexers.prolog import PrologLexer
-from pygments.lexers.python import CythonLexer
-from pygments.lexers.graphics import GLShaderLexer
-from pygments.lexers.ml import OcamlLexer
-from pygments.lexers.basic import BlitzBasicLexer, BlitzMaxLexer, MonkeyLexer
-from pygments.lexers.dylan import DylanLexer, DylanLidLexer, DylanConsoleLexer
-from pygments.lexers.ooc import OocLexer
-from pygments.lexers.felix import FelixLexer
-from pygments.lexers.nimrod import NimrodLexer
-from pygments.lexers.crystal import CrystalLexer
-
-__all__ = []
diff --git a/pygments/lexers/configs.py b/pygments/lexers/configs.py
deleted file mode 100644
index 717246af..00000000
--- a/pygments/lexers/configs.py
+++ /dev/null
@@ -1,934 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.configs
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for configuration file formats.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, default, words, bygroups, include, using
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Whitespace, Literal
-from pygments.lexers.shell import BashLexer
-from pygments.lexers.data import JsonLexer
-
-__all__ = ['IniLexer', 'RegeditLexer', 'PropertiesLexer', 'KconfigLexer',
- 'Cfengine3Lexer', 'ApacheConfLexer', 'SquidConfLexer',
- 'NginxConfLexer', 'LighttpdConfLexer', 'DockerLexer',
- 'TerraformLexer', 'TermcapLexer', 'TerminfoLexer',
- 'PkgConfigLexer', 'PacmanConfLexer', 'AugeasLexer', 'TOMLLexer']
-
-
-class IniLexer(RegexLexer):
- """
- Lexer for configuration files in INI style.
- """
-
- name = 'INI'
- aliases = ['ini', 'cfg', 'dosini']
- filenames = ['*.ini', '*.cfg', '*.inf']
- mimetypes = ['text/x-ini', 'text/inf']
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'[;#].*', Comment.Single),
- (r'\[.*?\]$', Keyword),
- (r'(.*?)([ \t]*)(=)([ \t]*)(.*(?:\n[ \t].+)*)',
- bygroups(Name.Attribute, Text, Operator, Text, String)),
- # standalone option, supported by some INI parsers
- (r'(.+?)$', Name.Attribute),
- ],
- }
-
- def analyse_text(text):
- npos = text.find('\n')
- if npos < 3:
- return False
- return text[0] == '[' and text[npos-1] == ']'
-
-
-class RegeditLexer(RegexLexer):
- """
- Lexer for `Windows Registry
- <http://en.wikipedia.org/wiki/Windows_Registry#.REG_files>`_ files produced
- by regedit.
-
- .. versionadded:: 1.6
- """
-
- name = 'reg'
- aliases = ['registry']
- filenames = ['*.reg']
- mimetypes = ['text/x-windows-registry']
-
- tokens = {
- 'root': [
- (r'Windows Registry Editor.*', Text),
- (r'\s+', Text),
- (r'[;#].*', Comment.Single),
- (r'(\[)(-?)(HKEY_[A-Z_]+)(.*?\])$',
- bygroups(Keyword, Operator, Name.Builtin, Keyword)),
- # String keys, which obey somewhat normal escaping
- (r'("(?:\\"|\\\\|[^"])+")([ \t]*)(=)([ \t]*)',
- bygroups(Name.Attribute, Text, Operator, Text),
- 'value'),
- # Bare keys (includes @)
- (r'(.*?)([ \t]*)(=)([ \t]*)',
- bygroups(Name.Attribute, Text, Operator, Text),
- 'value'),
- ],
- 'value': [
- (r'-', Operator, '#pop'), # delete value
- (r'(dword|hex(?:\([0-9a-fA-F]\))?)(:)([0-9a-fA-F,]+)',
- bygroups(Name.Variable, Punctuation, Number), '#pop'),
- # As far as I know, .reg files do not support line continuation.
- (r'.+', String, '#pop'),
- default('#pop'),
- ]
- }
-
- def analyse_text(text):
- return text.startswith('Windows Registry Editor')
-
-
-class PropertiesLexer(RegexLexer):
- """
- Lexer for configuration files in Java's properties format.
-
- Note: trailing whitespace counts as part of the value as per spec
-
- .. versionadded:: 1.4
- """
-
- name = 'Properties'
- aliases = ['properties', 'jproperties']
- filenames = ['*.properties']
- mimetypes = ['text/x-java-properties']
-
- tokens = {
- 'root': [
- (r'^(\w+)([ \t])(\w+\s*)$', bygroups(Name.Attribute, Text, String)),
- (r'^\w+(\\[ \t]\w*)*$', Name.Attribute),
- (r'(^ *)([#!].*)', bygroups(Text, Comment)),
- # More controversial comments
- (r'(^ *)((?:;|//).*)', bygroups(Text, Comment)),
- (r'(.*?)([ \t]*)([=:])([ \t]*)(.*(?:(?<=\\)\n.*)*)',
- bygroups(Name.Attribute, Text, Operator, Text, String)),
- (r'\s', Text),
- ],
- }
-
-
-def _rx_indent(level):
- # Kconfig *always* interprets a tab as 8 spaces, so this is the default.
- # Edit this if you are in an environment where KconfigLexer gets expanded
- # input (tabs expanded to spaces) and the expansion tab width is != 8,
- # e.g. in connection with Trac (trac.ini, [mimeviewer], tab_width).
- # Value range here is 2 <= {tab_width} <= 8.
- tab_width = 8
- # Regex matching a given indentation {level}, assuming that indentation is
- # a multiple of {tab_width}. In other cases there might be problems.
- if tab_width == 2:
- space_repeat = '+'
- else:
- space_repeat = '{1,%d}' % (tab_width - 1)
- if level == 1:
- level_repeat = ''
- else:
- level_repeat = '{%s}' % level
- return r'(?:\t| %s\t| {%s})%s.*\n' % (space_repeat, tab_width, level_repeat)
-
-
-class KconfigLexer(RegexLexer):
- """
- For Linux-style Kconfig files.
-
- .. versionadded:: 1.6
- """
-
- name = 'Kconfig'
- aliases = ['kconfig', 'menuconfig', 'linux-config', 'kernel-config']
- # Adjust this if new kconfig file names appear in your environment
- filenames = ['Kconfig', '*Config.in*', 'external.in*',
- 'standard-modules.in']
- mimetypes = ['text/x-kconfig']
- # No re.MULTILINE, indentation-aware help text needs line-by-line handling
- flags = 0
-
- def call_indent(level):
- # If indentation >= {level} is detected, enter state 'indent{level}'
- return (_rx_indent(level), String.Doc, 'indent%s' % level)
-
- def do_indent(level):
- # Print paragraphs of indentation level >= {level} as String.Doc,
- # ignoring blank lines. Then return to 'root' state.
- return [
- (_rx_indent(level), String.Doc),
- (r'\s*\n', Text),
- default('#pop:2')
- ]
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'#.*?\n', Comment.Single),
- (words((
- 'mainmenu', 'config', 'menuconfig', 'choice', 'endchoice',
- 'comment', 'menu', 'endmenu', 'visible if', 'if', 'endif',
- 'source', 'prompt', 'select', 'depends on', 'default',
- 'range', 'option'), suffix=r'\b'),
- Keyword),
- (r'(---help---|help)[\t ]*\n', Keyword, 'help'),
- (r'(bool|tristate|string|hex|int|defconfig_list|modules|env)\b',
- Name.Builtin),
- (r'[!=&|]', Operator),
- (r'[()]', Punctuation),
- (r'[0-9]+', Number.Integer),
- (r"'(''|[^'])*'", String.Single),
- (r'"(""|[^"])*"', String.Double),
- (r'\S+', Text),
- ],
- # Help text is indented, multi-line and ends when a lower indentation
- # level is detected.
- 'help': [
- # Skip blank lines after help token, if any
- (r'\s*\n', Text),
- # Determine the first help line's indentation level heuristically(!).
- # Attention: this is not perfect, but works for 99% of "normal"
- # indentation schemes up to a max. indentation level of 7.
- call_indent(7),
- call_indent(6),
- call_indent(5),
- call_indent(4),
- call_indent(3),
- call_indent(2),
- call_indent(1),
- default('#pop'), # for incomplete help sections without text
- ],
- # Handle text for indentation levels 7 to 1
- 'indent7': do_indent(7),
- 'indent6': do_indent(6),
- 'indent5': do_indent(5),
- 'indent4': do_indent(4),
- 'indent3': do_indent(3),
- 'indent2': do_indent(2),
- 'indent1': do_indent(1),
- }
-
-
-class Cfengine3Lexer(RegexLexer):
- """
- Lexer for `CFEngine3 <http://cfengine.org>`_ policy files.
-
- .. versionadded:: 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 ApacheConfLexer(RegexLexer):
- """
- Lexer for configuration files following the Apache config file
- format.
-
- .. versionadded:: 0.6
- """
-
- name = 'ApacheConf'
- aliases = ['apacheconf', 'aconf', 'apache']
- filenames = ['.htaccess', 'apache.conf', 'apache2.conf']
- mimetypes = ['text/x-apacheconf']
- flags = re.MULTILINE | re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'(#.*?)$', Comment),
- (r'(<[^\s>]+)(?:(\s+)(.*))?(>)',
- bygroups(Name.Tag, Text, String, Name.Tag)),
- (r'([a-z]\w*)(\s+)',
- bygroups(Name.Builtin, Text), 'value'),
- (r'\.+', Text),
- ],
- 'value': [
- (r'\\\n', Text),
- (r'$', Text, '#pop'),
- (r'\\', Text),
- (r'[^\S\n]+', Text),
- (r'\d+\.\d+\.\d+\.\d+(?:/\d+)?', Number),
- (r'\d+', Number),
- (r'/([a-z0-9][\w./-]+)', String.Other),
- (r'(on|off|none|any|all|double|email|dns|min|minimal|'
- r'os|productonly|full|emerg|alert|crit|error|warn|'
- r'notice|info|debug|registry|script|inetd|standalone|'
- r'user|group)\b', Keyword),
- (r'"([^"\\]*(?:\\.[^"\\]*)*)"', String.Double),
- (r'[^\s"\\]+', Text)
- ],
- }
-
-
-class SquidConfLexer(RegexLexer):
- """
- Lexer for `squid <http://www.squid-cache.org/>`_ configuration files.
-
- .. versionadded:: 0.9
- """
-
- name = 'SquidConf'
- aliases = ['squidconf', 'squid.conf', 'squid']
- filenames = ['squid.conf']
- mimetypes = ['text/x-squidconf']
- flags = re.IGNORECASE
-
- 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_max", "quick_abort_min",
- "quick_abort_pct", "range_offset_limit", "read_timeout",
- "redirect_children", "redirect_program",
- "redirect_rewrites_host_header", "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}))'
- )
-
- tokens = {
- 'root': [
- (r'\s+', Whitespace),
- (r'#', Comment, 'comment'),
- (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(opts, prefix=r'\b', suffix=r'\b'), Name.Constant),
- # Actions
- (words(actions, prefix=r'\b', suffix=r'\b'), String),
- (words(actions_stats, prefix=r'stats/', suffix=r'\b'), String),
- (words(actions_log, prefix=r'log/', suffix=r'='), String),
- (words(acls, prefix=r'\b', suffix=r'\b'), Keyword),
- (ip_re + r'(?:/(?:' + ip_re + r'|\b\d+\b))?', Number.Float),
- (r'(?:\b\d+\b(?:-\b\d+|%)?)', Number),
- (r'\S+', Text),
- ],
- 'comment': [
- (r'\s*TAG:.*', String.Escape, '#pop'),
- (r'.+', Comment, '#pop'),
- default('#pop'),
- ],
- }
-
-
-class NginxConfLexer(RegexLexer):
- """
- Lexer for `Nginx <http://nginx.net/>`_ configuration files.
-
- .. versionadded:: 0.11
- """
- name = 'Nginx configuration file'
- aliases = ['nginx']
- filenames = ['nginx.conf']
- mimetypes = ['text/x-nginx-conf']
-
- tokens = {
- 'root': [
- (r'(include)(\s+)([^\s;]+)', bygroups(Keyword, Text, Name)),
- (r'[^\s;#]+', Keyword, 'stmt'),
- include('base'),
- ],
- 'block': [
- (r'\}', Punctuation, '#pop:2'),
- (r'[^\s;#]+', Keyword.Namespace, 'stmt'),
- include('base'),
- ],
- 'stmt': [
- (r'\{', Punctuation, 'block'),
- (r';', Punctuation, '#pop'),
- include('base'),
- ],
- 'base': [
- (r'#.*\n', Comment.Single),
- (r'on|off', Name.Constant),
- (r'\$[^\s;#()]+', Name.Variable),
- (r'([a-z0-9.-]+)(:)([0-9]+)',
- bygroups(Name, Punctuation, Number.Integer)),
- (r'[a-z-]+/[a-z-+]+', String), # mimetype
- # (r'[a-zA-Z._-]+', Keyword),
- (r'[0-9]+[km]?\b', Number.Integer),
- (r'(~)(\s*)([^\s{]+)', bygroups(Punctuation, Text, String.Regex)),
- (r'[:=~]', Punctuation),
- (r'[^\s;#{}$]+', String), # catch all
- (r'/[^\s;#]*', Name), # pathname
- (r'\s+', Text),
- (r'[$;]', Text), # leftover characters
- ],
- }
-
-
-class LighttpdConfLexer(RegexLexer):
- """
- Lexer for `Lighttpd <http://lighttpd.net/>`_ configuration files.
-
- .. versionadded:: 0.11
- """
- name = 'Lighttpd configuration file'
- aliases = ['lighty', 'lighttpd']
- filenames = []
- mimetypes = ['text/x-lighttpd-conf']
-
- tokens = {
- 'root': [
- (r'#.*\n', Comment.Single),
- (r'/\S*', Name), # pathname
- (r'[a-zA-Z._-]+', Keyword),
- (r'\d+\.\d+\.\d+\.\d+(?:/\d+)?', Number),
- (r'[0-9]+', Number),
- (r'=>|=~|\+=|==|=|\+', Operator),
- (r'\$[A-Z]+', Name.Builtin),
- (r'[(){}\[\],]', Punctuation),
- (r'"([^"\\]*(?:\\.[^"\\]*)*)"', String.Double),
- (r'\s+', Text),
- ],
-
- }
-
-
-class DockerLexer(RegexLexer):
- """
- Lexer for `Docker <http://docker.io>`_ configuration files.
-
- .. versionadded:: 2.0
- """
- name = 'Docker'
- aliases = ['docker', 'dockerfile']
- filenames = ['Dockerfile', '*.docker']
- mimetypes = ['text/x-dockerfile-config']
-
- _keywords = (r'(?:FROM|MAINTAINER|EXPOSE|WORKDIR|USER|STOPSIGNAL)')
- _bash_keywords = (r'(?:RUN|CMD|ENTRYPOINT|ENV|ARG|LABEL|ADD|COPY)')
- _lb = r'(?:\s*\\?\s*)' # dockerfile line break regex
- flags = re.IGNORECASE | re.MULTILINE
-
- tokens = {
- 'root': [
- (r'#.*', Comment),
- (r'(ONBUILD)(%s)' % (_lb,), bygroups(Keyword, using(BashLexer))),
- (r'(HEALTHCHECK)((%s--\w+=\w+%s)*)' % (_lb, _lb),
- bygroups(Keyword, using(BashLexer))),
- (r'(VOLUME|ENTRYPOINT|CMD|SHELL)(%s)(\[.*?\])' % (_lb,),
- bygroups(Keyword, using(BashLexer), using(JsonLexer))),
- (r'(LABEL|ENV|ARG)((%s\w+=\w+%s)*)' % (_lb, _lb),
- bygroups(Keyword, using(BashLexer))),
- (r'(%s|VOLUME)\b(.*)' % (_keywords), bygroups(Keyword, String)),
- (r'(%s)' % (_bash_keywords,), Keyword),
- (r'(.*\\\n)*.+', using(BashLexer)),
- ]
- }
-
-
-class TerraformLexer(RegexLexer):
- """
- Lexer for `terraformi .tf files <https://www.terraform.io/>`_.
-
- .. versionadded:: 2.1
- """
-
- name = 'Terraform'
- aliases = ['terraform', 'tf']
- filenames = ['*.tf']
- mimetypes = ['application/x-tf', 'application/x-terraform']
-
- embedded_keywords = ('ingress', 'egress', 'listener', 'default', 'connection', 'alias', 'tags', 'lifecycle', 'timeouts')
-
- tokens = {
- 'root': [
- include('string'),
- include('punctuation'),
- include('curly'),
- include('basic'),
- include('whitespace'),
- (r'[0-9]+', Number),
- ],
- 'basic': [
- (words(('true', 'false'), prefix=r'\b', suffix=r'\b'), Keyword.Type),
- (r'\s*/\*', Comment.Multiline, 'comment'),
- (r'\s*#.*\n', Comment.Single),
- (r'(.*?)(\s*)(=)', bygroups(Name.Attribute, Text, Operator)),
- (words(('variable', 'resource', 'provider', 'provisioner', 'module'),
- prefix=r'\b', suffix=r'\b'), Keyword.Reserved, 'function'),
- (words(embedded_keywords, prefix=r'\b', suffix=r'\b'), Keyword.Declaration),
- (r'\$\{', String.Interpol, 'var_builtin'),
- ],
- 'function': [
- (r'(\s+)(".*")(\s+)', bygroups(Text, String, Text)),
- include('punctuation'),
- include('curly'),
- ],
- 'var_builtin': [
- (r'\$\{', String.Interpol, '#push'),
- (words(('concat', 'file', 'join', 'lookup', 'element'),
- prefix=r'\b', suffix=r'\b'), Name.Builtin),
- include('string'),
- include('punctuation'),
- (r'\s+', Text),
- (r'\}', String.Interpol, '#pop'),
- ],
- 'string': [
- (r'(".*")', bygroups(String.Double)),
- ],
- 'punctuation': [
- (r'[\[\](),.]', Punctuation),
- ],
- # Keep this seperate from punctuation - we sometimes want to use different
- # Tokens for { }
- 'curly': [
- (r'\{', Text.Punctuation),
- (r'\}', Text.Punctuation),
- ],
- 'comment': [
- (r'[^*/]', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ],
- 'whitespace': [
- (r'\n', Text),
- (r'\s+', Text),
- (r'\\\n', Text),
- ],
- }
-
-
-class TermcapLexer(RegexLexer):
- """
- Lexer for termcap database source.
-
- This is very simple and minimal.
-
- .. versionadded:: 2.1
- """
- name = 'Termcap'
- aliases = ['termcap']
- filenames = ['termcap', 'termcap.src']
- mimetypes = []
-
- # NOTE:
- # * multiline with trailing backslash
- # * separator is ':'
- # * to embed colon as data, we must use \072
- # * space after separator is not allowed (mayve)
- tokens = {
- 'root': [
- (r'^#.*$', Comment),
- (r'^[^\s#:|]+', Name.Tag, 'names'),
- ],
- 'names': [
- (r'\n', Text, '#pop'),
- (r':', Punctuation, 'defs'),
- (r'\|', Punctuation),
- (r'[^:|]+', Name.Attribute),
- ],
- 'defs': [
- (r'\\\n[ \t]*', Text),
- (r'\n[ \t]*', Text, '#pop:2'),
- (r'(#)([0-9]+)', bygroups(Operator, Number)),
- (r'=', Operator, 'data'),
- (r':', Punctuation),
- (r'[^\s:=#]+', Name.Class),
- ],
- 'data': [
- (r'\\072', Literal),
- (r':', Punctuation, '#pop'),
- (r'[^:\\]+', Literal), # for performance
- (r'.', Literal),
- ],
- }
-
-
-class TerminfoLexer(RegexLexer):
- """
- Lexer for terminfo database source.
-
- This is very simple and minimal.
-
- .. versionadded:: 2.1
- """
- name = 'Terminfo'
- aliases = ['terminfo']
- filenames = ['terminfo', 'terminfo.src']
- mimetypes = []
-
- # NOTE:
- # * multiline with leading whitespace
- # * separator is ','
- # * to embed comma as data, we can use \,
- # * space after separator is allowed
- tokens = {
- 'root': [
- (r'^#.*$', Comment),
- (r'^[^\s#,|]+', Name.Tag, 'names'),
- ],
- 'names': [
- (r'\n', Text, '#pop'),
- (r'(,)([ \t]*)', bygroups(Punctuation, Text), 'defs'),
- (r'\|', Punctuation),
- (r'[^,|]+', Name.Attribute),
- ],
- 'defs': [
- (r'\n[ \t]+', Text),
- (r'\n', Text, '#pop:2'),
- (r'(#)([0-9]+)', bygroups(Operator, Number)),
- (r'=', Operator, 'data'),
- (r'(,)([ \t]*)', bygroups(Punctuation, Text)),
- (r'[^\s,=#]+', Name.Class),
- ],
- 'data': [
- (r'\\[,\\]', Literal),
- (r'(,)([ \t]*)', bygroups(Punctuation, Text), '#pop'),
- (r'[^\\,]+', Literal), # for performance
- (r'.', Literal),
- ],
- }
-
-
-class PkgConfigLexer(RegexLexer):
- """
- Lexer for `pkg-config
- <http://www.freedesktop.org/wiki/Software/pkg-config/>`_
- (see also `manual page <http://linux.die.net/man/1/pkg-config>`_).
-
- .. versionadded:: 2.1
- """
-
- name = 'PkgConfig'
- aliases = ['pkgconfig']
- filenames = ['*.pc']
- mimetypes = []
-
- tokens = {
- 'root': [
- (r'#.*$', Comment.Single),
-
- # variable definitions
- (r'^(\w+)(=)', bygroups(Name.Attribute, Operator)),
-
- # keyword lines
- (r'^([\w.]+)(:)',
- bygroups(Name.Tag, Punctuation), 'spvalue'),
-
- # variable references
- include('interp'),
-
- # fallback
- (r'[^${}#=:\n.]+', Text),
- (r'.', Text),
- ],
- 'interp': [
- # you can escape literal "$" as "$$"
- (r'\$\$', Text),
-
- # variable references
- (r'\$\{', String.Interpol, 'curly'),
- ],
- 'curly': [
- (r'\}', String.Interpol, '#pop'),
- (r'\w+', Name.Attribute),
- ],
- 'spvalue': [
- include('interp'),
-
- (r'#.*$', Comment.Single, '#pop'),
- (r'\n', Text, '#pop'),
-
- # fallback
- (r'[^${}#\n]+', Text),
- (r'.', Text),
- ],
- }
-
-
-class PacmanConfLexer(RegexLexer):
- """
- Lexer for `pacman.conf
- <https://www.archlinux.org/pacman/pacman.conf.5.html>`_.
-
- Actually, IniLexer works almost fine for this format,
- but it yield error token. It is because pacman.conf has
- a form without assignment like:
-
- UseSyslog
- Color
- TotalDownload
- CheckSpace
- VerbosePkgLists
-
- These are flags to switch on.
-
- .. versionadded:: 2.1
- """
-
- name = 'PacmanConf'
- aliases = ['pacmanconf']
- filenames = ['pacman.conf']
- mimetypes = []
-
- tokens = {
- 'root': [
- # comment
- (r'#.*$', Comment.Single),
-
- # section header
- (r'^\s*\[.*?\]\s*$', Keyword),
-
- # variable definitions
- # (Leading space is allowed...)
- (r'(\w+)(\s*)(=)',
- bygroups(Name.Attribute, Text, Operator)),
-
- # flags to on
- (r'^(\s*)(\w+)(\s*)$',
- bygroups(Text, Name.Attribute, Text)),
-
- # built-in special values
- (words((
- '$repo', # repository
- '$arch', # architecture
- '%o', # outfile
- '%u', # url
- ), suffix=r'\b'),
- Name.Variable),
-
- # fallback
- (r'.', Text),
- ],
- }
-
-
-class AugeasLexer(RegexLexer):
- """
- Lexer for `Augeas <http://augeas.net>`_.
-
- .. versionadded:: 2.4
- """
- name = 'Augeas'
- aliases = ['augeas']
- filenames = ['*.aug']
-
- tokens = {
- 'root': [
- (r'(module)(\s*)([^\s=]+)', bygroups(Keyword.Namespace, Text, Name.Namespace)),
- (r'(let)(\s*)([^\s=]+)', bygroups(Keyword.Declaration, Text, Name.Variable)),
- (r'(del|store|value|counter|seq|key|label|autoload|incl|excl|transform|test|get|put)(\s+)', bygroups(Name.Builtin, Text)),
- (r'(\()([^:]+)(\:)(unit|string|regexp|lens|tree|filter)(\))', bygroups(Punctuation, Name.Variable, Punctuation, Keyword.Type, Punctuation)),
- (r'\(\*', Comment.Multiline, 'comment'),
- (r'[*+\-.;=?|]', Operator),
- (r'[()\[\]{}]', Operator),
- (r'"', String.Double, 'string'),
- (r'\/', String.Regex, 'regex'),
- (r'([A-Z]\w*)(\.)(\w+)', bygroups(Name.Namespace, Punctuation, Name.Variable)),
- (r'.', Name.Variable),
- (r'\s', Text),
- ],
- 'string': [
- (r'\\.', String.Escape),
- (r'[^"]', String.Double),
- (r'"', String.Double, '#pop'),
- ],
- 'regex': [
- (r'\\.', String.Escape),
- (r'[^/]', String.Regex),
- (r'\/', String.Regex, '#pop'),
- ],
- 'comment': [
- (r'[^*)]', Comment.Multiline),
- (r'\(\*', Comment.Multiline, '#push'),
- (r'\*\)', Comment.Multiline, '#pop'),
- (r'[)*]', Comment.Multiline)
- ],
- }
-
-
-class TOMLLexer(RegexLexer):
- """
- Lexer for `TOML <https://github.com/toml-lang/toml>`_, a simple language
- for config files.
-
- .. versionadded:: 2.4
- """
-
- name = 'TOML'
- aliases = ['toml']
- filenames = ['*.toml']
-
- tokens = {
- 'root': [
-
- # Basics, comments, strings
- (r'\s+', Text),
- (r'#.*?$', Comment.Single),
- # Basic string
- (r'"(\\\\|\\"|[^"])*"', String),
- # Literal string
- (r'\'\'\'(.*)\'\'\'', String),
- (r'\'[^\']*\'', String),
- (r'(true|false)$', Keyword.Constant),
- (r'[a-zA-Z_][\w\-]*', Name),
-
- (r'\[.*?\]$', Keyword),
- # Datetime
- # TODO this needs to be expanded, as TOML is rather flexible:
- # https://github.com/toml-lang/toml#offset-date-time
- (r'\d{4}-\d{2}-\d{2}(?:T| )\d{2}:\d{2}:\d{2}(?:Z|[-+]\d{2}:\d{2})', Number.Integer),
-
- # Numbers
- (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?', Number.Float),
- (r'\d+[eE][+-]?[0-9]+j?', Number.Float),
- # Handle +-inf, +-infinity, +-nan
- (r'[+-]?(?:(inf(?:inity)?)|nan)', Number.Float),
- (r'[+-]?\d+', Number.Integer),
-
- # Punctuation
- (r'[]{}:(),;[]', Punctuation),
- (r'\.', Punctuation),
-
- # Operators
- (r'=', Operator)
-
- ]
- }
diff --git a/pygments/lexers/console.py b/pygments/lexers/console.py
deleted file mode 100644
index ab93b7b8..00000000
--- a/pygments/lexers/console.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.console
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for misc console output.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, bygroups
-from pygments.token import Generic, Comment, String, Text, Keyword, Name, \
- Punctuation, Number
-
-__all__ = ['VCTreeStatusLexer', 'PyPyLogLexer']
-
-
-class VCTreeStatusLexer(RegexLexer):
- """
- For colorizing output of version control status commands, like "hg
- status" or "svn status".
-
- .. versionadded:: 2.0
- """
- name = 'VCTreeStatus'
- aliases = ['vctreestatus']
- filenames = []
- mimetypes = []
-
- tokens = {
- 'root': [
- (r'^A \+ C\s+', Generic.Error),
- (r'^A\s+\+?\s+', String),
- (r'^M\s+', Generic.Inserted),
- (r'^C\s+', Generic.Error),
- (r'^D\s+', Generic.Deleted),
- (r'^[?!]\s+', Comment.Preproc),
- (r' >\s+.*\n', Comment.Preproc),
- (r'.*\n', Text)
- ]
- }
-
-
-class PyPyLogLexer(RegexLexer):
- """
- Lexer for PyPy log files.
-
- .. versionadded:: 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"--end of the loop--", 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|float_neg|"
- 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),
- ],
- }
diff --git a/pygments/lexers/crystal.py b/pygments/lexers/crystal.py
deleted file mode 100644
index 1fa7270c..00000000
--- a/pygments/lexers/crystal.py
+++ /dev/null
@@ -1,393 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.crystal
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for Crystal.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import ExtendedRegexLexer, include, \
- bygroups, default, LexerContext, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-
-__all__ = ['CrystalLexer']
-
-line_re = re.compile('.*?\n')
-
-
-CRYSTAL_OPERATORS = [
- '!=', '!~', '!', '%', '&&', '&', '**', '*', '+', '-', '/', '<=>', '<<', '<=', '<',
- '===', '==', '=~', '=', '>=', '>>', '>', '[]=', '[]?', '[]', '^', '||', '|', '~'
-]
-
-
-class CrystalLexer(ExtendedRegexLexer):
- """
- For `Crystal <http://crystal-lang.org>`_ source code.
-
- .. versionadded:: 2.2
- """
-
- name = 'Crystal'
- aliases = ['cr', 'crystal']
- filenames = ['*.cr']
- mimetypes = ['text/x-crystal']
-
- flags = re.DOTALL | re.MULTILINE
-
- def heredoc_callback(self, match, ctx):
- # okay, this is the hardest part of parsing Crystal...
- # match: 1 = <<-?, 2 = quote? 3 = name 4 = quote? 5 = rest of line
-
- start = match.start(1)
- yield start, Operator, match.group(1) # <<-?
- yield match.start(2), String.Heredoc, match.group(2) # quote ", ', `
- yield match.start(3), String.Delimiter, match.group(3) # heredoc name
- yield match.start(4), String.Heredoc, match.group(4) # quote again
-
- heredocstack = ctx.__dict__.setdefault('heredocstack', [])
- outermost = not bool(heredocstack)
- heredocstack.append((match.group(1) == '<<-', match.group(3)))
-
- ctx.pos = match.start(5)
- ctx.end = match.end(5)
- # this may find other heredocs
- for i, t, v in self.get_tokens_unprocessed(context=ctx):
- yield i, t, v
- ctx.pos = match.end()
-
- if outermost:
- # this is the outer heredoc again, now we can process them all
- for tolerant, hdname in heredocstack:
- lines = []
- for match in line_re.finditer(ctx.text, ctx.pos):
- if tolerant:
- check = match.group().strip()
- else:
- check = match.group().rstrip()
- if check == hdname:
- for amatch in lines:
- yield amatch.start(), String.Heredoc, amatch.group()
- yield match.start(), String.Delimiter, match.group()
- ctx.pos = match.end()
- break
- else:
- lines.append(match)
- else:
- # end of heredoc not found -- error!
- for amatch in lines:
- yield amatch.start(), Error, amatch.group()
- ctx.end = len(ctx.text)
- del heredocstack[:]
-
- def gen_crystalstrings_rules():
- def intp_regex_callback(self, match, ctx):
- 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[imsx]*
- ctx.pos = match.end()
-
- def intp_string_callback(self, match, ctx):
- yield match.start(1), String.Other, match.group(1)
- 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
- ctx.pos = match.end()
-
- states = {}
- states['strings'] = [
- (r'\:@{0,2}[a-zA-Z_]\w*[!?]?', String.Symbol),
- (words(CRYSTAL_OPERATORS, prefix=r'\:@{0,2}'), String.Symbol),
- (r":'(\\\\|\\'|[^'])*'", String.Symbol),
- # This allows arbitrary text after '\ for simplicity
- (r"'(\\\\|\\'|[^']|\\[^'\\]+)'", String.Char),
- (r':"', String.Symbol, 'simple-sym'),
- # Crystal doesn't have "symbol:"s but this simplifies function args
- (r'([a-zA-Z_]\w*)(:)(?!:)', bygroups(String.Symbol, Punctuation)),
- (r'"', String.Double, 'simple-string'),
- (r'(?<!\.)`', String.Backtick, 'simple-backtick'),
- ]
-
- # double-quoted string and symbol
- for name, ttype, end in ('string', String.Double, '"'), \
- ('sym', String.Symbol, '"'), \
- ('backtick', String.Backtick, '`'):
- states['simple-'+name] = [
- include('string-escaped' if name == 'sym' else 'string-intp-escaped'),
- (r'[^\\%s#]+' % end, ttype),
- (r'[\\#]', ttype),
- (end, ttype, '#pop'),
- ]
-
- # braced quoted strings
- for lbrace, rbrace, bracecc, name in \
- ('\\{', '\\}', '{}', 'cb'), \
- ('\\[', '\\]', '\\[\\]', 'sb'), \
- ('\\(', '\\)', '()', 'pa'), \
- ('<', '>', '<>', 'ab'):
- states[name+'-intp-string'] = [
- (r'\\[' + lbrace + ']', String.Other),
- (lbrace, String.Other, '#push'),
- (rbrace, String.Other, '#pop'),
- include('string-intp-escaped'),
- (r'[\\#' + bracecc + ']', String.Other),
- (r'[^\\#' + bracecc + ']+', String.Other),
- ]
- states['strings'].append((r'%' + lbrace, String.Other,
- name+'-intp-string'))
- states[name+'-string'] = [
- (r'\\[\\' + bracecc + ']', String.Other),
- (lbrace, String.Other, '#push'),
- (rbrace, String.Other, '#pop'),
- (r'[\\#' + bracecc + ']', String.Other),
- (r'[^\\#' + bracecc + ']+', String.Other),
- ]
- # http://crystal-lang.org/docs/syntax_and_semantics/literals/array.html
- states['strings'].append((r'%[wi]' + lbrace, String.Other,
- name+'-string'))
- states[name+'-regex'] = [
- (r'\\[\\' + bracecc + ']', String.Regex),
- (lbrace, String.Regex, '#push'),
- (rbrace + '[imsx]*', String.Regex, '#pop'),
- include('string-intp'),
- (r'[\\#' + bracecc + ']', String.Regex),
- (r'[^\\#' + bracecc + ']+', String.Regex),
- ]
- states['strings'].append((r'%r' + lbrace, String.Regex,
- name+'-regex'))
-
- # these must come after %<brace>!
- states['strings'] += [
- # %r regex
- (r'(%r([\W_]))((?:\\\2|(?!\2).)*)(\2[imsx]*)',
- intp_regex_callback),
- # regular fancy strings with qsw
- (r'(%[wi]([\W_]))((?:\\\2|(?!\2).)*)(\2)',
- intp_string_callback),
- # special forms of fancy strings after operators or
- # in method calls with braces
- (r'(?<=[-+/*%=<>&!^|~,(])(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)',
- bygroups(Text, String.Other, None)),
- # and because of fixed width lookbehinds the whole thing a
- # second time for line startings...
- (r'^(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)',
- bygroups(Text, String.Other, None)),
- # all regular fancy strings without qsw
- (r'(%([\[{(<]))((?:\\\2|(?!\2).)*)(\2)',
- intp_string_callback),
- ]
-
- return states
-
- tokens = {
- 'root': [
- (r'#.*?$', Comment.Single),
- # keywords
- (words('''
- abstract asm as begin break case do else elsif end ensure extend ifdef if
- include instance_sizeof next of pointerof private protected rescue return
- require sizeof super then typeof unless until when while with yield
- '''.split(), suffix=r'\b'), Keyword),
- (words(['true', 'false', 'nil'], suffix=r'\b'), Keyword.Constant),
- # start of function, class and module names
- (r'(module|lib)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)',
- bygroups(Keyword, Text, Name.Namespace)),
- (r'(def|fun|macro)(\s+)((?:[a-zA-Z_]\w*::)*)',
- bygroups(Keyword, Text, Name.Namespace), 'funcname'),
- (r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'),
- (r'(class|struct|union|type|alias|enum)(\s+)((?:[a-zA-Z_]\w*::)*)',
- bygroups(Keyword, Text, Name.Namespace), 'classname'),
- (r'(self|out|uninitialized)\b|(is_a|responds_to)\?', Keyword.Pseudo),
- # macros
- (words('''
- debugger record pp assert_responds_to spawn parallel
- getter setter property delegate def_hash def_equals def_equals_and_hash
- forward_missing_to
- '''.split(), suffix=r'\b'), Name.Builtin.Pseudo),
- (r'getter[!?]|property[!?]|__(DIR|FILE|LINE)__\b', Name.Builtin.Pseudo),
- # builtins
- # http://crystal-lang.org/api/toplevel.html
- (words('''
- Object Value Struct Reference Proc Class Nil Symbol Enum Void
- Bool Number Int Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64
- Float Float32 Float64 Char String
- Pointer Slice Range Exception Regex
- Mutex StaticArray Array Hash Set Tuple Deque Box Process File
- Dir Time Channel Concurrent Scheduler
- abort at_exit caller delay exit fork future get_stack_top gets
- lazy loop main p print printf puts
- raise rand read_line sleep sprintf system with_color
- '''.split(), prefix=r'(?<!\.)', suffix=r'\b'), Name.Builtin),
- # normal heredocs
- (r'(?<!\w)(<<-?)(["`\']?)([a-zA-Z_]\w*)(\2)(.*?\n)',
- heredoc_callback),
- # empty string heredocs
- (r'(<<-?)("|\')()(\2)(.*?\n)', heredoc_callback),
- (r'__END__', Comment.Preproc, 'end-part'),
- # multiline regex (after keywords or assignments)
- (r'(?:^|(?<=[=<>~!:])|'
- r'(?<=(?:\s|;)when\s)|'
- r'(?<=(?:\s|;)or\s)|'
- r'(?<=(?:\s|;)and\s)|'
- r'(?<=\.index\s)|'
- r'(?<=\.scan\s)|'
- r'(?<=\.sub\s)|'
- r'(?<=\.sub!\s)|'
- r'(?<=\.gsub\s)|'
- r'(?<=\.gsub!\s)|'
- r'(?<=\.match\s)|'
- r'(?<=(?:\s|;)if\s)|'
- r'(?<=(?:\s|;)elsif\s)|'
- r'(?<=^when\s)|'
- r'(?<=^index\s)|'
- r'(?<=^scan\s)|'
- r'(?<=^sub\s)|'
- r'(?<=^gsub\s)|'
- r'(?<=^sub!\s)|'
- r'(?<=^gsub!\s)|'
- r'(?<=^match\s)|'
- r'(?<=^if\s)|'
- r'(?<=^elsif\s)'
- r')(\s*)(/)', bygroups(Text, 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=])', 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?)
- # since pygments 0.7 we also eat a "?" operator after numbers
- # so that the char operator does not work. Chars are not allowed
- # there so that you can use the ternary operator.
- # stupid example:
- # x>=0?n[x]:""
- (r'(0o[0-7]+(?:_[0-7]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?',
- bygroups(Number.Oct, Text, Operator)),
- (r'(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?',
- bygroups(Number.Hex, Text, Operator)),
- (r'(0b[01]+(?:_[01]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?',
- bygroups(Number.Bin, Text, Operator)),
- # 3 separate expressions for floats because any of the 3 optional
- # parts makes it a float
- (r'((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)(?:e[+-]?[0-9]+)?'
- r'(?:_?f[0-9]+)?)(\s*)([/?])?',
- bygroups(Number.Float, Text, Operator)),
- (r'((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)?(?:e[+-]?[0-9]+)'
- r'(?:_?f[0-9]+)?)(\s*)([/?])?',
- bygroups(Number.Float, Text, Operator)),
- (r'((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)?(?:e[+-]?[0-9]+)?'
- r'(?:_?f[0-9]+))(\s*)([/?])?',
- bygroups(Number.Float, Text, Operator)),
- (r'(0\b|[1-9][\d]*(?:_\d+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?',
- bygroups(Number.Integer, Text, Operator)),
- # Names
- (r'@@[a-zA-Z_]\w*', Name.Variable.Class),
- (r'@[a-zA-Z_]\w*', Name.Variable.Instance),
- (r'\$\w+', Name.Variable.Global),
- (r'\$[!@&`\'+~=/\\,;.<>_*$?:"^-]', Name.Variable.Global),
- (r'\$-[0adFiIlpvw]', Name.Variable.Global),
- (r'::', Operator),
- include('strings'),
- # chars
- (r'\?(\\[MC]-)*' # modifiers
- r'(\\([\\befnrtv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)'
- r'(?!\w)',
- String.Char),
- (r'[A-Z][A-Z_]+\b', Name.Constant),
- # macro expansion
- (r'\{%', String.Interpol, 'in-macro-control'),
- (r'\{\{', String.Interpol, 'in-macro-expr'),
- # attributes
- (r'(@\[)(\s*)([A-Z]\w*)',
- bygroups(Operator, Text, Name.Decorator), 'in-attr'),
- # this is needed because Crystal attributes can look
- # like keywords (class) or like this: ` ?!?
- (words(CRYSTAL_OPERATORS, prefix=r'(\.|::)'),
- bygroups(Operator, Name.Operator)),
- (r'(\.|::)([a-zA-Z_]\w*[!?]?|[*%&^`~+\-/\[<>=])',
- bygroups(Operator, Name)),
- # Names can end with [!?] unless it's "!="
- (r'[a-zA-Z_]\w*(?:[!?](?!=))?', Name),
- (r'(\[|\]\??|\*\*|<=>?|>=|<<?|>>?|=~|===|'
- r'!~|&&?|\|\||\.{1,3})', Operator),
- (r'[-+/*%=<>&!^|~]=?', Operator),
- (r'[(){};,/?:\\]', Punctuation),
- (r'\s+', Text)
- ],
- 'funcname': [
- (r'(?:([a-zA-Z_]\w*)(\.))?'
- r'([a-zA-Z_]\w*[!?]?|\*\*?|[-+]@?|'
- r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)',
- bygroups(Name.Class, Operator, Name.Function), '#pop'),
- default('#pop')
- ],
- 'classname': [
- (r'[A-Z_]\w*', Name.Class),
- (r'(\()(\s*)([A-Z_]\w*)(\s*)(\))',
- bygroups(Punctuation, Text, Name.Class, Text, Punctuation)),
- default('#pop')
- ],
- 'in-intp': [
- (r'\{', String.Interpol, '#push'),
- (r'\}', String.Interpol, '#pop'),
- include('root'),
- ],
- 'string-intp': [
- (r'#\{', String.Interpol, 'in-intp'),
- ],
- 'string-escaped': [
- (r'\\([\\befnstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})', String.Escape)
- ],
- 'string-intp-escaped': [
- include('string-intp'),
- include('string-escaped'),
- ],
- 'interpolated-regex': [
- include('string-intp'),
- (r'[\\#]', String.Regex),
- (r'[^\\#]+', String.Regex),
- ],
- 'interpolated-string': [
- include('string-intp'),
- (r'[\\#]', String.Other),
- (r'[^\\#]+', String.Other),
- ],
- 'multiline-regex': [
- include('string-intp'),
- (r'\\\\', String.Regex),
- (r'\\/', String.Regex),
- (r'[\\#]', String.Regex),
- (r'[^\\/#]+', String.Regex),
- (r'/[imsx]*', String.Regex, '#pop'),
- ],
- 'end-part': [
- (r'.+', Comment.Preproc, '#pop')
- ],
- 'in-macro-control': [
- (r'\{%', String.Interpol, '#push'),
- (r'%\}', String.Interpol, '#pop'),
- (r'for\b|in\b', Keyword),
- include('root'),
- ],
- 'in-macro-expr': [
- (r'\{\{', String.Interpol, '#push'),
- (r'\}\}', String.Interpol, '#pop'),
- include('root'),
- ],
- 'in-attr': [
- (r'\[', Operator, '#push'),
- (r'\]', Operator, '#pop'),
- include('root'),
- ],
- }
- tokens.update(gen_crystalstrings_rules())
diff --git a/pygments/lexers/csound.py b/pygments/lexers/csound.py
deleted file mode 100644
index 4f754d45..00000000
--- a/pygments/lexers/csound.py
+++ /dev/null
@@ -1,460 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.csound
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Csound languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, default, include, using, words
-from pygments.token import Comment, Error, Keyword, Name, Number, Operator, Punctuation, \
- String, Text, Whitespace
-from pygments.lexers._csound_builtins import OPCODES, DEPRECATED_OPCODES
-from pygments.lexers.html import HtmlLexer
-from pygments.lexers.python import PythonLexer
-from pygments.lexers.scripting import LuaLexer
-
-__all__ = ['CsoundScoreLexer', 'CsoundOrchestraLexer', 'CsoundDocumentLexer']
-
-newline = (r'((?:(?:;|//).*)*)(\n)', bygroups(Comment.Single, Text))
-
-
-class CsoundLexer(RegexLexer):
- tokens = {
- 'whitespace': [
- (r'[ \t]+', Text),
- (r'/[*](?:.|\n)*?[*]/', Comment.Multiline),
- (r'(?:;|//).*$', Comment.Single),
- (r'(\\)(\n)', bygroups(Whitespace, Text))
- ],
-
- 'preprocessor directives': [
- (r'#(?:e(?:nd(?:if)?|lse)\b|##)|@@?[ \t]*\d+', Comment.Preproc),
- (r'#include', Comment.Preproc, 'include directive'),
- (r'#[ \t]*define', Comment.Preproc, 'define directive'),
- (r'#(?:ifn?def|undef)\b', Comment.Preproc, 'macro directive')
- ],
-
- 'include directive': [
- include('whitespace'),
- (r'([^ \t]).*?\1', String, '#pop')
- ],
-
- 'define directive': [
- (r'\n', Text),
- include('whitespace'),
- (r'([A-Z_a-z]\w*)(\()', bygroups(Comment.Preproc, Punctuation),
- ('#pop', 'macro parameter name list')),
- (r'[A-Z_a-z]\w*', Comment.Preproc, ('#pop', 'before macro body'))
- ],
- 'macro parameter name list': [
- include('whitespace'),
- (r'[A-Z_a-z]\w*', Comment.Preproc),
- (r"['#]", Punctuation),
- (r'\)', Punctuation, ('#pop', 'before macro body'))
- ],
- 'before macro body': [
- (r'\n', Text),
- include('whitespace'),
- (r'#', Punctuation, ('#pop', 'macro body'))
- ],
- 'macro body': [
- (r'(?:\\(?!#)|[^#\\]|\n)+', Comment.Preproc),
- (r'\\#', Comment.Preproc),
- (r'(?<!\\)#', Punctuation, '#pop')
- ],
-
- 'macro directive': [
- include('whitespace'),
- (r'[A-Z_a-z]\w*', Comment.Preproc, '#pop')
- ],
-
- 'macro uses': [
- (r'(\$[A-Z_a-z]\w*\.?)(\()', bygroups(Comment.Preproc, Punctuation),
- 'macro parameter value list'),
- (r'\$[A-Z_a-z]\w*(?:\.|\b)', Comment.Preproc)
- ],
- 'macro parameter value list': [
- (r'(?:[^\'#"{()]|\{(?!\{))+', Comment.Preproc),
- (r"['#]", Punctuation),
- (r'"', String, 'macro parameter value quoted string'),
- (r'\{\{', String, 'macro parameter value braced string'),
- (r'\(', Comment.Preproc, 'macro parameter value parenthetical'),
- (r'\)', Punctuation, '#pop')
- ],
- 'macro parameter value quoted string': [
- (r"\\[#'()]", Comment.Preproc),
- (r"[#'()]", Error),
- include('quoted string')
- ],
- 'macro parameter value braced string': [
- (r"\\[#'()]", Comment.Preproc),
- (r"[#'()]", Error),
- include('braced string')
- ],
- 'macro parameter value parenthetical': [
- (r'(?:[^\\()]|\\\))+', Comment.Preproc),
- (r'\(', Comment.Preproc, '#push'),
- (r'\)', Comment.Preproc, '#pop')
- ],
-
- 'whitespace and macro uses': [
- include('whitespace'),
- include('macro uses')
- ],
-
- 'numbers': [
- (r'\d+[Ee][+-]?\d+|(\d+\.\d*|\d*\.\d+)([Ee][+-]?\d+)?', Number.Float),
- (r'(0[Xx])([0-9A-Fa-f]+)', bygroups(Keyword.Type, Number.Hex)),
- (r'\d+', Number.Integer)
- ],
-
- 'braced string': [
- # Do nothing. This must be defined in subclasses.
- ]
- }
-
-
-class CsoundScoreLexer(CsoundLexer):
- """
- For `Csound <https://csound.github.io>`_ scores.
-
- .. versionadded:: 2.1
- """
-
- name = 'Csound Score'
- aliases = ['csound-score', 'csound-sco']
- filenames = ['*.sco']
-
- tokens = {
- 'root': [
- (r'\n', Text),
- include('whitespace and macro uses'),
- include('preprocessor directives'),
-
- (r'[abCdefiqstvxy]', Keyword),
- # There is also a w statement that is generated internally and should not be
- # used; see https://github.com/csound/csound/issues/750.
-
- (r'z', Keyword.Constant),
- # z is a constant equal to 800,000,000,000. 800 billion seconds is about
- # 25,367.8 years. See also
- # https://csound.github.io/docs/manual/ScoreTop.html and
- # https://github.com/csound/csound/search?q=stof+path%3AEngine+filename%3Asread.c.
-
- (r'([nNpP][pP])(\d+)', bygroups(Keyword, Number.Integer)),
-
- (r'[mn]', Keyword, 'mark statement'),
-
- include('numbers'),
- (r'[!+\-*/^%&|<>#~.]', Operator),
- (r'[()\[\]]', Punctuation),
- (r'"', String, 'quoted string'),
- (r'\{', Comment.Preproc, 'loop after left brace'),
- ],
-
- 'mark statement': [
- include('whitespace and macro uses'),
- (r'[A-Z_a-z]\w*', Name.Label),
- (r'\n', Text, '#pop')
- ],
-
- 'quoted string': [
- (r'"', String, '#pop'),
- (r'[^"$]+', String),
- include('macro uses'),
- (r'[$]', String)
- ],
-
- 'loop after left brace': [
- include('whitespace and macro uses'),
- (r'\d+', Number.Integer, ('#pop', 'loop after repeat count')),
- ],
- 'loop after repeat count': [
- include('whitespace and macro uses'),
- (r'[A-Z_a-z]\w*', Comment.Preproc, ('#pop', 'loop'))
- ],
- 'loop': [
- (r'\}', Comment.Preproc, '#pop'),
- include('root')
- ],
-
- # Braced strings are not allowed in Csound scores, but this is needed
- # because the superclass includes it.
- 'braced string': [
- (r'\}\}', String, '#pop'),
- (r'[^}]|\}(?!\})', String)
- ]
- }
-
-
-class CsoundOrchestraLexer(CsoundLexer):
- """
- For `Csound <https://csound.github.io>`_ orchestras.
-
- .. versionadded:: 2.1
- """
-
- name = 'Csound Orchestra'
- aliases = ['csound', 'csound-orc']
- filenames = ['*.orc', '*.udo']
-
- user_defined_opcodes = set()
-
- def opcode_name_callback(lexer, match):
- opcode = match.group(0)
- lexer.user_defined_opcodes.add(opcode)
- yield match.start(), Name.Function, opcode
-
- def name_callback(lexer, match):
- name = match.group(1)
- if name in OPCODES or name in DEPRECATED_OPCODES:
- yield match.start(), Name.Builtin, name
- if match.group(2):
- yield match.start(2), Punctuation, match.group(2)
- yield match.start(3), Keyword.Type, match.group(3)
- elif name in lexer.user_defined_opcodes:
- yield match.start(), Name.Function, name
- else:
- nameMatch = re.search(r'^(g?[afikSw])(\w+)', name)
- if nameMatch:
- yield nameMatch.start(1), Keyword.Type, nameMatch.group(1)
- yield nameMatch.start(2), Name, nameMatch.group(2)
- else:
- yield match.start(), Name, name
-
- # If there's a trailing :V, for example, we want to keep this around
- # and emit it as well, otherwise this lexer will not pass round-trip
- # testing
- if match.group(2):
- yield match.start(2), Punctuation, match.group(2)
- yield match.start(3), Name, match.group(3)
-
- tokens = {
- 'root': [
- (r'\n', Text),
-
- (r'^([ \t]*)(\w+)(:)(?:[ \t]+|$)', bygroups(Text, Name.Label, Punctuation)),
-
- include('whitespace and macro uses'),
- include('preprocessor directives'),
-
- (r'\binstr\b', Keyword.Declaration, 'instrument numbers and identifiers'),
- (r'\bopcode\b', Keyword.Declaration, 'after opcode keyword'),
- (r'\b(?:end(?:in|op))\b', Keyword.Declaration),
-
- include('partial statements')
- ],
-
- 'partial statements': [
- (r'\b(?:0dbfs|A4|k(?:r|smps)|nchnls(?:_i)?|sr)\b', Name.Variable.Global),
-
- include('numbers'),
-
- (r'\+=|-=|\*=|/=|<<|>>|<=|>=|==|!=|&&|\|\||[~¬]|[=!+\-*/^%&|<>#?:]', Operator),
- (r'[(),\[\]]', Punctuation),
-
- (r'"', String, 'quoted string'),
- (r'\{\{', String, 'braced string'),
-
- (words((
- 'do', 'else', 'elseif', 'endif', 'enduntil', 'fi', 'if', 'ithen', 'kthen',
- 'od', 'then', 'until', 'while',
- ), prefix=r'\b', suffix=r'\b'), Keyword),
- (words(('return', 'rireturn'), prefix=r'\b', suffix=r'\b'), Keyword.Pseudo),
-
- (r'\b[ik]?goto\b', Keyword, 'goto label'),
- (r'\b(r(?:einit|igoto)|tigoto)(\(|\b)', bygroups(Keyword.Pseudo, Punctuation),
- 'goto label'),
- (r'\b(c(?:g|in?|k|nk?)goto)(\(|\b)', bygroups(Keyword.Pseudo, Punctuation),
- ('goto label', 'goto argument')),
- (r'\b(timout)(\(|\b)', bygroups(Keyword.Pseudo, Punctuation),
- ('goto label', 'goto argument', 'goto argument')),
- (r'\b(loop_[gl][et])(\(|\b)', bygroups(Keyword.Pseudo, Punctuation),
- ('goto label', 'goto argument', 'goto argument', 'goto argument')),
-
- (r'\bprintk?s\b', Name.Builtin, 'prints opcode'),
- (r'\b(?:readscore|scoreline(?:_i)?)\b', Name.Builtin, 'Csound score opcode'),
- (r'\bpyl?run[it]?\b', Name.Builtin, 'Python opcode'),
- (r'\blua_(?:exec|opdef)\b', Name.Builtin, 'Lua opcode'),
- (r'\bp\d+\b', Name.Variable.Instance),
- (r'\b([A-Z_a-z]\w*)(?:(:)([A-Za-z]))?\b', name_callback)
- ],
-
- 'instrument numbers and identifiers': [
- include('whitespace and macro uses'),
- (r'\d+|[A-Z_a-z]\w*', Name.Function),
- (r'[+,]', Punctuation),
- (r'\n', Text, '#pop')
- ],
-
- 'after opcode keyword': [
- include('whitespace and macro uses'),
- (r'[A-Z_a-z]\w*', opcode_name_callback, ('#pop', 'opcode type signatures')),
- (r'\n', Text, '#pop')
- ],
- 'opcode type signatures': [
- include('whitespace and macro uses'),
-
- # https://github.com/csound/csound/search?q=XIDENT+path%3AEngine+filename%3Acsound_orc.lex
- (r'0|[afijkKoOpPStV\[\]]+', Keyword.Type),
-
- (r',', Punctuation),
- (r'\n', Text, '#pop')
- ],
-
- 'quoted string': [
- (r'"', String, '#pop'),
- (r'[^\\"$%)]+', String),
- include('macro uses'),
- include('escape sequences'),
- include('format specifiers'),
- (r'[\\$%)]', String)
- ],
- 'braced string': [
- (r'\}\}', String, '#pop'),
- (r'(?:[^\\%)}]|\}(?!\}))+', String),
- include('escape sequences'),
- include('format specifiers'),
- (r'[\\%)]', String)
- ],
- 'escape sequences': [
- # https://github.com/csound/csound/search?q=unquote_string+path%3AEngine+filename%3Acsound_orc_compile.c
- (r'\\(?:[\\abnrt"]|[0-7]{1,3})', String.Escape)
- ],
- # Format specifiers are highlighted in all strings, even though only
- # fprintks https://csound.github.io/docs/manual/fprintks.html
- # fprints https://csound.github.io/docs/manual/fprints.html
- # printf/printf_i https://csound.github.io/docs/manual/printf.html
- # printks https://csound.github.io/docs/manual/printks.html
- # prints https://csound.github.io/docs/manual/prints.html
- # sprintf https://csound.github.io/docs/manual/sprintf.html
- # sprintfk https://csound.github.io/docs/manual/sprintfk.html
- # work with strings that contain format specifiers. In addition, these
- # opcodes’ handling of format specifiers is inconsistent:
- # - fprintks, fprints, printks, and prints do accept %a and %A
- # specifiers, but can’t accept %s specifiers.
- # - printf, printf_i, sprintf, and sprintfk don’t accept %a and %A
- # specifiers, but can accept %s specifiers.
- # See https://github.com/csound/csound/issues/747 for more information.
- 'format specifiers': [
- (r'%[#0\- +]*\d*(?:\.\d+)?[diuoxXfFeEgGaAcs]', String.Interpol),
- (r'%%', String.Escape)
- ],
-
- 'goto argument': [
- include('whitespace and macro uses'),
- (r',', Punctuation, '#pop'),
- include('partial statements')
- ],
- 'goto label': [
- include('whitespace and macro uses'),
- (r'\w+', Name.Label, '#pop'),
- default('#pop')
- ],
-
- 'prints opcode': [
- include('whitespace and macro uses'),
- (r'"', String, 'prints quoted string'),
- default('#pop')
- ],
- 'prints quoted string': [
- (r'\\\\[aAbBnNrRtT]', String.Escape),
- (r'%[!nNrRtT]|[~^]{1,2}', String.Escape),
- include('quoted string')
- ],
-
- 'Csound score opcode': [
- include('whitespace and macro uses'),
- (r'\{\{', String, 'Csound score'),
- (r'\n', Text, '#pop')
- ],
- 'Csound score': [
- (r'\}\}', String, '#pop'),
- (r'([^}]+)|\}(?!\})', using(CsoundScoreLexer))
- ],
-
- 'Python opcode': [
- include('whitespace and macro uses'),
- (r'\{\{', String, 'Python'),
- (r'\n', Text, '#pop')
- ],
- 'Python': [
- (r'\}\}', String, '#pop'),
- (r'([^}]+)|\}(?!\})', using(PythonLexer))
- ],
-
- 'Lua opcode': [
- include('whitespace and macro uses'),
- (r'\{\{', String, 'Lua'),
- (r'\n', Text, '#pop')
- ],
- 'Lua': [
- (r'\}\}', String, '#pop'),
- (r'([^}]+)|\}(?!\})', using(LuaLexer))
- ]
- }
-
-
-class CsoundDocumentLexer(RegexLexer):
- """
- For `Csound <https://csound.github.io>`_ documents.
-
- .. versionadded:: 2.1
- """
-
- name = 'Csound Document'
- aliases = ['csound-document', 'csound-csd']
- filenames = ['*.csd']
-
- # These tokens are based on those in XmlLexer in pygments/lexers/html.py. Making
- # CsoundDocumentLexer a subclass of XmlLexer rather than RegexLexer may seem like a
- # better idea, since Csound Document files look like XML files. However, Csound
- # Documents can contain Csound comments (preceded by //, for example) before and
- # after the root element, unescaped bitwise AND & and less than < operators, etc. In
- # other words, while Csound Document files look like XML files, they may not actually
- # be XML files.
- tokens = {
- 'root': [
- (r'/[*](.|\n)*?[*]/', Comment.Multiline),
- (r'(?:;|//).*$', Comment.Single),
- (r'[^/;<]+|/(?!/)', Text),
-
- (r'<\s*CsInstruments', Name.Tag, ('orchestra', 'tag')),
- (r'<\s*CsScore', Name.Tag, ('score', 'tag')),
- (r'<\s*[Hh][Tt][Mm][Ll]', Name.Tag, ('HTML', 'tag')),
-
- (r'<\s*[\w:.-]+', Name.Tag, 'tag'),
- (r'<\s*/\s*[\w:.-]+\s*>', Name.Tag)
- ],
-
- 'orchestra': [
- (r'<\s*/\s*CsInstruments\s*>', Name.Tag, '#pop'),
- (r'(.|\n)+?(?=<\s*/\s*CsInstruments\s*>)', using(CsoundOrchestraLexer))
- ],
- 'score': [
- (r'<\s*/\s*CsScore\s*>', Name.Tag, '#pop'),
- (r'(.|\n)+?(?=<\s*/\s*CsScore\s*>)', using(CsoundScoreLexer))
- ],
- 'HTML': [
- (r'<\s*/\s*[Hh][Tt][Mm][Ll]\s*>', Name.Tag, '#pop'),
- (r'(.|\n)+?(?=<\s*/\s*[Hh][Tt][Mm][Ll]\s*>)', using(HtmlLexer))
- ],
-
- 'tag': [
- (r'\s+', Text),
- (r'[\w.:-]+\s*=', Name.Attribute, 'attr'),
- (r'/?\s*>', Name.Tag, '#pop')
- ],
- 'attr': [
- (r'\s+', Text),
- (r'".*?"', String, '#pop'),
- (r"'.*?'", String, '#pop'),
- (r'[^\s>]+', String, '#pop')
- ]
- }
diff --git a/pygments/lexers/css.py b/pygments/lexers/css.py
deleted file mode 100644
index 4c77efe0..00000000
--- a/pygments/lexers/css.py
+++ /dev/null
@@ -1,692 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.css
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for CSS and related stylesheet formats.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-import copy
-
-from pygments.lexer import ExtendedRegexLexer, RegexLexer, include, bygroups, \
- default, words, inherit
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-from pygments.util import iteritems
-
-__all__ = ['CssLexer', 'SassLexer', 'ScssLexer', 'LessCssLexer']
-
-
-# List of vendor prefixes obtained from:
-# https://www.w3.org/TR/CSS21/syndata.html#vendor-keyword-history
-_vendor_prefixes = (
- '-ms-', 'mso-', '-moz-', '-o-', '-xv-', '-atsc-', '-wap-', '-khtml-',
- '-webkit-', 'prince-', '-ah-', '-hp-', '-ro-', '-rim-', '-tc-',
-)
-
-# List of CSS properties obtained from:
-# https://www.w3.org/Style/CSS/all-properties.en.html
-# Note: handle --* separately
-_css_properties = (
- 'align-content', 'align-items', 'align-self', 'alignment-baseline', 'all',
- 'animation', 'animation-delay', 'animation-direction',
- 'animation-duration', 'animation-fill-mode', 'animation-iteration-count',
- 'animation-name', 'animation-play-state', 'animation-timing-function',
- 'appearance', 'azimuth', 'backface-visibility', 'background',
- 'background-attachment', 'background-blend-mode', 'background-clip',
- 'background-color', 'background-image', 'background-origin',
- 'background-position', 'background-repeat', 'background-size',
- 'baseline-shift', 'bookmark-label', 'bookmark-level', 'bookmark-state',
- 'border', 'border-bottom', 'border-bottom-color',
- 'border-bottom-left-radius', 'border-bottom-right-radius',
- 'border-bottom-style', 'border-bottom-width', 'border-boundary',
- 'border-collapse', 'border-color', 'border-image', 'border-image-outset',
- 'border-image-repeat', 'border-image-slice', 'border-image-source',
- 'border-image-width', 'border-left', 'border-left-color',
- 'border-left-style', 'border-left-width', 'border-radius', 'border-right',
- 'border-right-color', 'border-right-style', 'border-right-width',
- 'border-spacing', 'border-style', 'border-top', 'border-top-color',
- 'border-top-left-radius', 'border-top-right-radius', 'border-top-style',
- 'border-top-width', 'border-width', 'bottom', 'box-decoration-break',
- 'box-shadow', 'box-sizing', 'box-snap', 'box-suppress', 'break-after',
- 'break-before', 'break-inside', 'caption-side', 'caret', 'caret-animation',
- 'caret-color', 'caret-shape', 'chains', 'clear', 'clip', 'clip-path',
- 'clip-rule', 'color', 'color-interpolation-filters', 'column-count',
- 'column-fill', 'column-gap', 'column-rule', 'column-rule-color',
- 'column-rule-style', 'column-rule-width', 'column-span', 'column-width',
- 'columns', 'content', 'counter-increment', 'counter-reset', 'counter-set',
- 'crop', 'cue', 'cue-after', 'cue-before', 'cursor', 'direction', 'display',
- 'dominant-baseline', 'elevation', 'empty-cells', 'filter', 'flex',
- 'flex-basis', 'flex-direction', 'flex-flow', 'flex-grow', 'flex-shrink',
- 'flex-wrap', 'float', 'float-defer', 'float-offset', 'float-reference',
- 'flood-color', 'flood-opacity', 'flow', 'flow-from', 'flow-into', 'font',
- 'font-family', 'font-feature-settings', 'font-kerning',
- 'font-language-override', 'font-size', 'font-size-adjust', 'font-stretch',
- 'font-style', 'font-synthesis', 'font-variant', 'font-variant-alternates',
- 'font-variant-caps', 'font-variant-east-asian', 'font-variant-ligatures',
- 'font-variant-numeric', 'font-variant-position', 'font-weight',
- 'footnote-display', 'footnote-policy', 'glyph-orientation-vertical',
- 'grid', 'grid-area', 'grid-auto-columns', 'grid-auto-flow',
- 'grid-auto-rows', 'grid-column', 'grid-column-end', 'grid-column-gap',
- 'grid-column-start', 'grid-gap', 'grid-row', 'grid-row-end',
- 'grid-row-gap', 'grid-row-start', 'grid-template', 'grid-template-areas',
- 'grid-template-columns', 'grid-template-rows', 'hanging-punctuation',
- 'height', 'hyphenate-character', 'hyphenate-limit-chars',
- 'hyphenate-limit-last', 'hyphenate-limit-lines', 'hyphenate-limit-zone',
- 'hyphens', 'image-orientation', 'image-resolution', 'initial-letter',
- 'initial-letter-align', 'initial-letter-wrap', 'isolation',
- 'justify-content', 'justify-items', 'justify-self', 'left',
- 'letter-spacing', 'lighting-color', 'line-break', 'line-grid',
- 'line-height', 'line-snap', 'list-style', 'list-style-image',
- 'list-style-position', 'list-style-type', 'margin', 'margin-bottom',
- 'margin-left', 'margin-right', 'margin-top', 'marker-side',
- 'marquee-direction', 'marquee-loop', 'marquee-speed', 'marquee-style',
- 'mask', 'mask-border', 'mask-border-mode', 'mask-border-outset',
- 'mask-border-repeat', 'mask-border-slice', 'mask-border-source',
- 'mask-border-width', 'mask-clip', 'mask-composite', 'mask-image',
- 'mask-mode', 'mask-origin', 'mask-position', 'mask-repeat', 'mask-size',
- 'mask-type', 'max-height', 'max-lines', 'max-width', 'min-height',
- 'min-width', 'mix-blend-mode', 'motion', 'motion-offset', 'motion-path',
- 'motion-rotation', 'move-to', 'nav-down', 'nav-left', 'nav-right',
- 'nav-up', 'object-fit', 'object-position', 'offset-after', 'offset-before',
- 'offset-end', 'offset-start', 'opacity', 'order', 'orphans', 'outline',
- 'outline-color', 'outline-offset', 'outline-style', 'outline-width',
- 'overflow', 'overflow-style', 'overflow-wrap', 'overflow-x', 'overflow-y',
- 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top',
- 'page', 'page-break-after', 'page-break-before', 'page-break-inside',
- 'page-policy', 'pause', 'pause-after', 'pause-before', 'perspective',
- 'perspective-origin', 'pitch', 'pitch-range', 'play-during', 'polar-angle',
- 'polar-distance', 'position', 'presentation-level', 'quotes',
- 'region-fragment', 'resize', 'rest', 'rest-after', 'rest-before',
- 'richness', 'right', 'rotation', 'rotation-point', 'ruby-align',
- 'ruby-merge', 'ruby-position', 'running', 'scroll-snap-coordinate',
- 'scroll-snap-destination', 'scroll-snap-points-x', 'scroll-snap-points-y',
- 'scroll-snap-type', 'shape-image-threshold', 'shape-inside', 'shape-margin',
- 'shape-outside', 'size', 'speak', 'speak-as', 'speak-header',
- 'speak-numeral', 'speak-punctuation', 'speech-rate', 'stress', 'string-set',
- 'tab-size', 'table-layout', 'text-align', 'text-align-last',
- 'text-combine-upright', 'text-decoration', 'text-decoration-color',
- 'text-decoration-line', 'text-decoration-skip', 'text-decoration-style',
- 'text-emphasis', 'text-emphasis-color', 'text-emphasis-position',
- 'text-emphasis-style', 'text-indent', 'text-justify', 'text-orientation',
- 'text-overflow', 'text-shadow', 'text-space-collapse', 'text-space-trim',
- 'text-spacing', 'text-transform', 'text-underline-position', 'text-wrap',
- 'top', 'transform', 'transform-origin', 'transform-style', 'transition',
- 'transition-delay', 'transition-duration', 'transition-property',
- 'transition-timing-function', 'unicode-bidi', 'user-select',
- 'vertical-align', 'visibility', 'voice-balance', 'voice-duration',
- 'voice-family', 'voice-pitch', 'voice-range', 'voice-rate', 'voice-stress',
- 'voice-volume', 'volume', 'white-space', 'widows', 'width', 'will-change',
- 'word-break', 'word-spacing', 'word-wrap', 'wrap-after', 'wrap-before',
- 'wrap-flow', 'wrap-inside', 'wrap-through', 'writing-mode', 'z-index',
-)
-
-# List of keyword values obtained from:
-# http://cssvalues.com/
-_keyword_values = (
- 'absolute', 'alias', 'all', 'all-petite-caps', 'all-scroll',
- 'all-small-caps', 'allow-end', 'alpha', 'alternate', 'alternate-reverse',
- 'always', 'armenian', 'auto', 'avoid', 'avoid-column', 'avoid-page',
- 'backwards', 'balance', 'baseline', 'below', 'blink', 'block', 'bold',
- 'bolder', 'border-box', 'both', 'bottom', 'box-decoration', 'break-word',
- 'capitalize', 'cell', 'center', 'circle', 'clip', 'clone', 'close-quote',
- 'col-resize', 'collapse', 'color', 'color-burn', 'color-dodge', 'column',
- 'column-reverse', 'compact', 'condensed', 'contain', 'container',
- 'content-box', 'context-menu', 'copy', 'cover', 'crisp-edges', 'crosshair',
- 'currentColor', 'cursive', 'darken', 'dashed', 'decimal',
- 'decimal-leading-zero', 'default', 'descendants', 'difference', 'digits',
- 'disc', 'distribute', 'dot', 'dotted', 'double', 'double-circle', 'e-resize',
- 'each-line', 'ease', 'ease-in', 'ease-in-out', 'ease-out', 'edges',
- 'ellipsis', 'end', 'ew-resize', 'exclusion', 'expanded', 'extra-condensed',
- 'extra-expanded', 'fantasy', 'fill', 'fill-box', 'filled', 'first', 'fixed',
- 'flat', 'flex', 'flex-end', 'flex-start', 'flip', 'force-end', 'forwards',
- 'from-image', 'full-width', 'geometricPrecision', 'georgian', 'groove',
- 'hanging', 'hard-light', 'help', 'hidden', 'hide', 'horizontal', 'hue',
- 'icon', 'infinite', 'inherit', 'initial', 'ink', 'inline', 'inline-block',
- 'inline-flex', 'inline-table', 'inset', 'inside', 'inter-word', 'invert',
- 'isolate', 'italic', 'justify', 'large', 'larger', 'last', 'left',
- 'lighten', 'lighter', 'line-through', 'linear', 'list-item', 'local',
- 'loose', 'lower-alpha', 'lower-greek', 'lower-latin', 'lower-roman',
- 'lowercase', 'ltr', 'luminance', 'luminosity', 'mandatory', 'manipulation',
- 'manual', 'margin-box', 'match-parent', 'medium', 'mixed', 'monospace',
- 'move', 'multiply', 'n-resize', 'ne-resize', 'nesw-resize',
- 'no-close-quote', 'no-drop', 'no-open-quote', 'no-repeat', 'none', 'normal',
- 'not-allowed', 'nowrap', 'ns-resize', 'nw-resize', 'nwse-resize', 'objects',
- 'oblique', 'off', 'on', 'open', 'open-quote', 'optimizeLegibility',
- 'optimizeSpeed', 'outset', 'outside', 'over', 'overlay', 'overline',
- 'padding-box', 'page', 'pan-down', 'pan-left', 'pan-right', 'pan-up',
- 'pan-x', 'pan-y', 'paused', 'petite-caps', 'pixelated', 'pointer',
- 'preserve-3d', 'progress', 'proximity', 'relative', 'repeat',
- 'repeat no-repeat', 'repeat-x', 'repeat-y', 'reverse', 'ridge', 'right',
- 'round', 'row', 'row-resize', 'row-reverse', 'rtl', 'ruby', 'ruby-base',
- 'ruby-base-container', 'ruby-text', 'ruby-text-container', 'run-in',
- 'running', 's-resize', 'sans-serif', 'saturation', 'scale-down', 'screen',
- 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate',
- 'serif', 'sesame', 'show', 'sideways', 'sideways-left', 'sideways-right',
- 'slice', 'small', 'small-caps', 'smaller', 'smooth', 'snap', 'soft-light',
- 'solid', 'space', 'space-around', 'space-between', 'spaces', 'square',
- 'start', 'static', 'step-end', 'step-start', 'sticky', 'stretch', 'strict',
- 'stroke-box', 'style', 'sw-resize', 'table', 'table-caption', 'table-cell',
- 'table-column', 'table-column-group', 'table-footer-group',
- 'table-header-group', 'table-row', 'table-row-group', 'text', 'thick',
- 'thin', 'titling-caps', 'to', 'top', 'triangle', 'ultra-condensed',
- 'ultra-expanded', 'under', 'underline', 'unicase', 'unset', 'upper-alpha',
- 'upper-latin', 'upper-roman', 'uppercase', 'upright', 'use-glyph-orientation',
- 'vertical', 'vertical-text', 'view-box', 'visible', 'w-resize', 'wait',
- 'wavy', 'weight', 'weight style', 'wrap', 'wrap-reverse', 'x-large',
- 'x-small', 'xx-large', 'xx-small', 'zoom-in', 'zoom-out',
-)
-
-# List of extended color keywords obtained from:
-# https://drafts.csswg.org/css-color/#named-colors
-_color_keywords = (
- 'aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige',
- 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown',
- 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral',
- 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan',
- 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki',
- 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred',
- 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray',
- 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue',
- 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite',
- 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod',
- 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred',
- 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen',
- 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan',
- 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey',
- 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue',
- 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow',
- 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine',
- 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen',
- 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise',
- 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin',
- 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange',
- 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise',
- 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum',
- 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown', 'royalblue',
- 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna',
- 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow',
- 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise',
- 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen',
-) + ('transparent',)
-
-# List of other keyword values from other sources:
-_other_keyword_values = (
- 'above', 'aural', 'behind', 'bidi-override', 'center-left', 'center-right',
- 'cjk-ideographic', 'continuous', 'crop', 'cross', 'embed', 'far-left',
- 'far-right', 'fast', 'faster', 'hebrew', 'high', 'higher', 'hiragana',
- 'hiragana-iroha', 'katakana', 'katakana-iroha', 'landscape', 'left-side',
- 'leftwards', 'level', 'loud', 'low', 'lower', 'message-box', 'middle',
- 'mix', 'narrower', 'once', 'portrait', 'right-side', 'rightwards', 'silent',
- 'slow', 'slower', 'small-caption', 'soft', 'spell-out', 'status-bar',
- 'super', 'text-bottom', 'text-top', 'wider', 'x-fast', 'x-high', 'x-loud',
- 'x-low', 'x-soft', 'yes', 'pre', 'pre-wrap', 'pre-line',
-)
-
-# List of functional notation and function keyword values:
-_functional_notation_keyword_values = (
- 'attr', 'blackness', 'blend', 'blenda', 'blur', 'brightness', 'calc',
- 'circle', 'color-mod', 'contrast', 'counter', 'cubic-bezier', 'device-cmyk',
- 'drop-shadow', 'ellipse', 'gray', 'grayscale', 'hsl', 'hsla', 'hue',
- 'hue-rotate', 'hwb', 'image', 'inset', 'invert', 'lightness',
- 'linear-gradient', 'matrix', 'matrix3d', 'opacity', 'perspective',
- 'polygon', 'radial-gradient', 'rect', 'repeating-linear-gradient',
- 'repeating-radial-gradient', 'rgb', 'rgba', 'rotate', 'rotate3d', 'rotateX',
- 'rotateY', 'rotateZ', 'saturate', 'saturation', 'scale', 'scale3d',
- 'scaleX', 'scaleY', 'scaleZ', 'sepia', 'shade', 'skewX', 'skewY', 'steps',
- 'tint', 'toggle', 'translate', 'translate3d', 'translateX', 'translateY',
- 'translateZ', 'whiteness',
-)
-# Note! Handle url(...) separately.
-
-# List of units obtained from:
-# https://www.w3.org/TR/css3-values/
-_angle_units = (
- 'deg', 'grad', 'rad', 'turn',
-)
-_frequency_units = (
- 'Hz', 'kHz',
-)
-_length_units = (
- 'em', 'ex', 'ch', 'rem',
- 'vh', 'vw', 'vmin', 'vmax',
- 'px', 'mm', 'cm', 'in', 'pt', 'pc', 'q',
-)
-_resolution_units = (
- 'dpi', 'dpcm', 'dppx',
-)
-_time_units = (
- 's', 'ms',
-)
-_all_units = _angle_units + _frequency_units + _length_units + \
- _resolution_units + _time_units
-
-
-class CssLexer(RegexLexer):
- """
- For CSS (Cascading Style Sheets).
- """
-
- name = 'CSS'
- aliases = ['css']
- filenames = ['*.css']
- mimetypes = ['text/css']
-
- tokens = {
- 'root': [
- include('basics'),
- ],
- 'basics': [
- (r'\s+', Text),
- (r'/\*(?:.|\n)*?\*/', Comment),
- (r'\{', Punctuation, 'content'),
- (r'(\:{1,2})([\w-]+)', bygroups(Punctuation, Name.Decorator)),
- (r'(\.)([\w-]+)', bygroups(Punctuation, Name.Class)),
- (r'(\#)([\w-]+)', bygroups(Punctuation, Name.Namespace)),
- (r'(@)([\w-]+)', bygroups(Punctuation, Keyword), 'atrule'),
- (r'[\w-]+', Name.Tag),
- (r'[~^*!%&$\[\]()<>|+=@:;,./?-]', Operator),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single)
- ],
- 'atrule': [
- (r'\{', Punctuation, 'atcontent'),
- (r';', Punctuation, '#pop'),
- include('basics'),
- ],
- 'atcontent': [
- include('basics'),
- (r'\}', Punctuation, '#pop:2'),
- ],
- 'content': [
- (r'\s+', Text),
- (r'\}', Punctuation, '#pop'),
- (r';', Punctuation),
- (r'^@.*?$', Comment.Preproc),
-
- (words(_vendor_prefixes,), Keyword.Pseudo),
- (r'('+r'|'.join(_css_properties)+r')(\s*)(\:)',
- bygroups(Keyword, Text, Punctuation), 'value-start'),
- (r'([a-zA-Z_][\w-]*)(\s*)(\:)', bygroups(Name, Text, Punctuation),
- 'value-start'),
-
- (r'/\*(?:.|\n)*?\*/', Comment),
- ],
- 'value-start': [
- (r'\s+', Text),
- (words(_vendor_prefixes,), Name.Builtin.Pseudo),
- include('urls'),
- (r'('+r'|'.join(_functional_notation_keyword_values)+r')(\()',
- bygroups(Name.Builtin, Punctuation), 'function-start'),
- (r'([a-zA-Z_][\w-]+)(\()',
- bygroups(Name.Function, Punctuation), 'function-start'),
- (words(_keyword_values, suffix=r'\b'), Keyword.Constant),
- (words(_other_keyword_values, suffix=r'\b'), Keyword.Constant),
- (words(_color_keywords, suffix=r'\b'), Keyword.Constant),
- # for transition-property etc.
- (words(_css_properties, suffix=r'\b'), Keyword),
- (r'\!important', Comment.Preproc),
- (r'/\*(?:.|\n)*?\*/', Comment),
-
- include('numeric-values'),
-
- (r'[~^*!%&<>|+=@:./?-]+', Operator),
- (r'[\[\](),]+', Punctuation),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r'[a-zA-Z_][\w-]*', Name),
- (r';', Punctuation, '#pop'),
- (r'\}', Punctuation, '#pop:2'),
- ],
- 'function-start': [
- (r'\s+', Text),
- include('urls'),
- (words(_vendor_prefixes,), Keyword.Pseudo),
- (words(_keyword_values, suffix=r'\b'), Keyword.Constant),
- (words(_other_keyword_values, suffix=r'\b'), Keyword.Constant),
- (words(_color_keywords, suffix=r'\b'), Keyword.Constant),
-
- # function-start may be entered recursively
- (r'(' + r'|'.join(_functional_notation_keyword_values) + r')(\()',
- bygroups(Name.Builtin, Punctuation), 'function-start'),
- (r'([a-zA-Z_][\w-]+)(\()',
- bygroups(Name.Function, Punctuation), 'function-start'),
-
- (r'/\*(?:.|\n)*?\*/', Comment),
- include('numeric-values'),
- (r'[*+/-]', Operator),
- (r'[,]', Punctuation),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r'[a-zA-Z_-]\w*', Name),
- (r'\)', Punctuation, '#pop'),
- ],
- 'urls': [
- (r'(url)(\()(".*?")(\))', bygroups(Name.Builtin, Punctuation,
- String.Double, Punctuation)),
- (r"(url)(\()('.*?')(\))", bygroups(Name.Builtin, Punctuation,
- String.Single, Punctuation)),
- (r'(url)(\()(.*?)(\))', bygroups(Name.Builtin, Punctuation,
- String.Other, Punctuation)),
- ],
- 'numeric-values': [
- (r'\#[a-zA-Z0-9]{1,6}', Number.Hex),
- (r'[+\-]?[0-9]*[.][0-9]+', Number.Float, 'numeric-end'),
- (r'[+\-]?[0-9]+', Number.Integer, 'numeric-end'),
- ],
- 'numeric-end': [
- (words(_all_units, suffix=r'\b'), Keyword.Type),
- (r'%', Keyword.Type),
- default('#pop'),
- ],
- }
-
-
-common_sass_tokens = {
- 'value': [
- (r'[ \t]+', Text),
- (r'[!$][\w-]+', Name.Variable),
- (r'url\(', String.Other, 'string-url'),
- (r'[a-z_-][\w-]*(?=\()', Name.Function),
- (words(_css_properties + (
- 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid', 'baseline',
- 'behind', 'below', 'bidi-override', 'blink', 'block', 'bold', 'bolder', 'both',
- 'capitalize', 'center-left', 'center-right', 'center', 'circle',
- 'cjk-ideographic', 'close-quote', 'collapse', 'condensed', 'continuous',
- 'crop', 'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero',
- 'decimal', 'default', 'digits', 'disc', 'dotted', 'double', 'e-resize', 'embed',
- 'extra-condensed', 'extra-expanded', 'expanded', 'fantasy', 'far-left',
- 'far-right', 'faster', 'fast', 'fixed', 'georgian', 'groove', 'hebrew', 'help',
- 'hidden', 'hide', 'higher', 'high', 'hiragana-iroha', 'hiragana', 'icon',
- 'inherit', 'inline-table', 'inline', 'inset', 'inside', 'invert', 'italic',
- 'justify', 'katakana-iroha', 'katakana', 'landscape', 'larger', 'large',
- 'left-side', 'leftwards', 'level', 'lighter', 'line-through', 'list-item',
- 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr',
- 'lower', 'low', 'medium', 'message-box', 'middle', 'mix', 'monospace',
- 'n-resize', 'narrower', 'ne-resize', 'no-close-quote', 'no-open-quote',
- 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize', 'oblique', 'once',
- 'open-quote', 'outset', 'outside', 'overline', 'pointer', 'portrait', 'px',
- 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side',
- 'rightwards', 's-resize', 'sans-serif', 'scroll', 'se-resize',
- 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent',
- 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid',
- 'spell-out', 'square', 'static', 'status-bar', 'super', 'sw-resize',
- 'table-caption', 'table-cell', 'table-column', 'table-column-group',
- 'table-footer-group', 'table-header-group', 'table-row',
- 'table-row-group', 'text', 'text-bottom', 'text-top', 'thick', 'thin',
- 'transparent', 'ultra-condensed', 'ultra-expanded', 'underline',
- 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
- 'visible', 'w-resize', 'wait', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud',
- 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yes'), suffix=r'\b'),
- Name.Constant),
- (words(_color_keywords, suffix=r'\b'), Name.Entity),
- (words((
- 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green',
- 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua'), suffix=r'\b'),
- Name.Builtin),
- (r'\!(important|default)', Name.Exception),
- (r'(true|false)', Name.Pseudo),
- (r'(and|or|not)', Operator.Word),
- (r'/\*', Comment.Multiline, 'inline-comment'),
- (r'//[^\n]*', Comment.Single),
- (r'\#[a-z0-9]{1,6}', Number.Hex),
- (r'(-?\d+)(\%|[a-z]+)?', bygroups(Number.Integer, Keyword.Type)),
- (r'(-?\d*\.\d+)(\%|[a-z]+)?', bygroups(Number.Float, Keyword.Type)),
- (r'#\{', String.Interpol, 'interpolation'),
- (r'[~^*!&%<>|+=@:,./?-]+', Operator),
- (r'[\[\]()]+', Punctuation),
- (r'"', String.Double, 'string-double'),
- (r"'", String.Single, 'string-single'),
- (r'[a-z_-][\w-]*', Name),
- ],
-
- 'interpolation': [
- (r'\}', String.Interpol, '#pop'),
- include('value'),
- ],
-
- 'selector': [
- (r'[ \t]+', Text),
- (r'\:', Name.Decorator, 'pseudo-class'),
- (r'\.', Name.Class, 'class'),
- (r'\#', Name.Namespace, 'id'),
- (r'[\w-]+', Name.Tag),
- (r'#\{', String.Interpol, 'interpolation'),
- (r'&', Keyword),
- (r'[~^*!&\[\]()<>|+=@:;,./?-]', Operator),
- (r'"', String.Double, 'string-double'),
- (r"'", String.Single, 'string-single'),
- ],
-
- 'string-double': [
- (r'(\\.|#(?=[^\n{])|[^\n"#])+', String.Double),
- (r'#\{', String.Interpol, 'interpolation'),
- (r'"', String.Double, '#pop'),
- ],
-
- 'string-single': [
- (r"(\\.|#(?=[^\n{])|[^\n'#])+", String.Single),
- (r'#\{', String.Interpol, 'interpolation'),
- (r"'", String.Single, '#pop'),
- ],
-
- 'string-url': [
- (r'(\\#|#(?=[^\n{])|[^\n#)])+', String.Other),
- (r'#\{', String.Interpol, 'interpolation'),
- (r'\)', String.Other, '#pop'),
- ],
-
- 'pseudo-class': [
- (r'[\w-]+', Name.Decorator),
- (r'#\{', String.Interpol, 'interpolation'),
- default('#pop'),
- ],
-
- 'class': [
- (r'[\w-]+', Name.Class),
- (r'#\{', String.Interpol, 'interpolation'),
- default('#pop'),
- ],
-
- 'id': [
- (r'[\w-]+', Name.Namespace),
- (r'#\{', String.Interpol, 'interpolation'),
- default('#pop'),
- ],
-
- 'for': [
- (r'(from|to|through)', Operator.Word),
- include('value'),
- ],
-}
-
-
-def _indentation(lexer, match, ctx):
- indentation = match.group(0)
- yield match.start(), Text, indentation
- ctx.last_indentation = indentation
- ctx.pos = match.end()
-
- if hasattr(ctx, 'block_state') and ctx.block_state and \
- indentation.startswith(ctx.block_indentation) and \
- indentation != ctx.block_indentation:
- ctx.stack.append(ctx.block_state)
- else:
- ctx.block_state = None
- ctx.block_indentation = None
- ctx.stack.append('content')
-
-
-def _starts_block(token, state):
- def callback(lexer, match, ctx):
- yield match.start(), token, match.group(0)
-
- if hasattr(ctx, 'last_indentation'):
- ctx.block_indentation = ctx.last_indentation
- else:
- ctx.block_indentation = ''
-
- ctx.block_state = state
- ctx.pos = match.end()
-
- return callback
-
-
-class SassLexer(ExtendedRegexLexer):
- """
- For Sass stylesheets.
-
- .. versionadded:: 1.3
- """
-
- name = 'Sass'
- aliases = ['sass']
- filenames = ['*.sass']
- mimetypes = ['text/x-sass']
-
- flags = re.IGNORECASE | re.MULTILINE
-
- tokens = {
- 'root': [
- (r'[ \t]*\n', Text),
- (r'[ \t]*', _indentation),
- ],
-
- 'content': [
- (r'//[^\n]*', _starts_block(Comment.Single, 'single-comment'),
- 'root'),
- (r'/\*[^\n]*', _starts_block(Comment.Multiline, 'multi-comment'),
- 'root'),
- (r'@import', Keyword, 'import'),
- (r'@for', Keyword, 'for'),
- (r'@(debug|warn|if|while)', Keyword, 'value'),
- (r'(@mixin)( [\w-]+)', bygroups(Keyword, Name.Function), 'value'),
- (r'(@include)( [\w-]+)', bygroups(Keyword, Name.Decorator), 'value'),
- (r'@extend', Keyword, 'selector'),
- (r'@[\w-]+', Keyword, 'selector'),
- (r'=[\w-]+', Name.Function, 'value'),
- (r'\+[\w-]+', Name.Decorator, 'value'),
- (r'([!$][\w-]\w*)([ \t]*(?:(?:\|\|)?=|:))',
- bygroups(Name.Variable, Operator), 'value'),
- (r':', Name.Attribute, 'old-style-attr'),
- (r'(?=.+?[=:]([^a-z]|$))', Name.Attribute, 'new-style-attr'),
- default('selector'),
- ],
-
- 'single-comment': [
- (r'.+', Comment.Single),
- (r'\n', Text, 'root'),
- ],
-
- 'multi-comment': [
- (r'.+', Comment.Multiline),
- (r'\n', Text, 'root'),
- ],
-
- 'import': [
- (r'[ \t]+', Text),
- (r'\S+', String),
- (r'\n', Text, 'root'),
- ],
-
- 'old-style-attr': [
- (r'[^\s:="\[]+', Name.Attribute),
- (r'#\{', String.Interpol, 'interpolation'),
- (r'[ \t]*=', Operator, 'value'),
- default('value'),
- ],
-
- 'new-style-attr': [
- (r'[^\s:="\[]+', Name.Attribute),
- (r'#\{', String.Interpol, 'interpolation'),
- (r'[ \t]*[=:]', Operator, 'value'),
- ],
-
- 'inline-comment': [
- (r"(\\#|#(?=[^\n{])|\*(?=[^\n/])|[^\n#*])+", Comment.Multiline),
- (r'#\{', String.Interpol, 'interpolation'),
- (r"\*/", Comment, '#pop'),
- ],
- }
- for group, common in iteritems(common_sass_tokens):
- tokens[group] = copy.copy(common)
- tokens['value'].append((r'\n', Text, 'root'))
- tokens['selector'].append((r'\n', Text, 'root'))
-
-
-class ScssLexer(RegexLexer):
- """
- For SCSS stylesheets.
- """
-
- name = 'SCSS'
- aliases = ['scss']
- filenames = ['*.scss']
- mimetypes = ['text/x-scss']
-
- flags = re.IGNORECASE | re.DOTALL
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'@import', Keyword, 'value'),
- (r'@for', Keyword, 'for'),
- (r'@(debug|warn|if|while)', Keyword, 'value'),
- (r'(@mixin)( [\w-]+)', bygroups(Keyword, Name.Function), 'value'),
- (r'(@include)( [\w-]+)', bygroups(Keyword, Name.Decorator), 'value'),
- (r'@extend', Keyword, 'selector'),
- (r'(@media)(\s+)', bygroups(Keyword, Text), 'value'),
- (r'@[\w-]+', Keyword, 'selector'),
- (r'(\$[\w-]*\w)([ \t]*:)', bygroups(Name.Variable, Operator), 'value'),
- # TODO: broken, and prone to infinite loops.
- # (r'(?=[^;{}][;}])', Name.Attribute, 'attr'),
- # (r'(?=[^;{}:]+:[^a-z])', Name.Attribute, 'attr'),
- default('selector'),
- ],
-
- 'attr': [
- (r'[^\s:="\[]+', Name.Attribute),
- (r'#\{', String.Interpol, 'interpolation'),
- (r'[ \t]*:', Operator, 'value'),
- default('#pop'),
- ],
-
- 'inline-comment': [
- (r"(\\#|#(?=[^{])|\*(?=[^/])|[^#*])+", Comment.Multiline),
- (r'#\{', String.Interpol, 'interpolation'),
- (r"\*/", Comment, '#pop'),
- ],
- }
- for group, common in iteritems(common_sass_tokens):
- tokens[group] = copy.copy(common)
- tokens['value'].extend([(r'\n', Text), (r'[;{}]', Punctuation, '#pop')])
- tokens['selector'].extend([(r'\n', Text), (r'[;{}]', Punctuation, '#pop')])
-
-
-class LessCssLexer(CssLexer):
- """
- For `LESS <http://lesscss.org/>`_ styleshets.
-
- .. versionadded:: 2.1
- """
-
- name = 'LessCss'
- aliases = ['less']
- filenames = ['*.less']
- mimetypes = ['text/x-less-css']
-
- tokens = {
- 'root': [
- (r'@\w+', Name.Variable),
- inherit,
- ],
- 'content': [
- (r'\{', Punctuation, '#push'),
- inherit,
- ],
- }
diff --git a/pygments/lexers/d.py b/pygments/lexers/d.py
deleted file mode 100644
index b14f7dcd..00000000
--- a/pygments/lexers/d.py
+++ /dev/null
@@ -1,251 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.d
- ~~~~~~~~~~~~~~~~~
-
- Lexers for D languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Text, Comment, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['DLexer', 'CrocLexer', 'MiniDLexer']
-
-
-class DLexer(RegexLexer):
- """
- For D source.
-
- .. versionadded:: 1.2
- """
- name = 'D'
- filenames = ['*.d', '*.di']
- aliases = ['d']
- mimetypes = ['text/x-dsrc']
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'\s+', Text),
- # (r'\\\n', Text), # line continuations
- # Comments
- (r'//(.*?)\n', Comment.Single),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
- (r'/\+', Comment.Multiline, 'nested_comment'),
- # Keywords
- (words((
- 'abstract', 'alias', 'align', 'asm', 'assert', 'auto', 'body',
- 'break', 'case', 'cast', 'catch', 'class', 'const', 'continue',
- 'debug', 'default', 'delegate', 'delete', 'deprecated', 'do', 'else',
- 'enum', 'export', 'extern', 'finally', 'final', 'foreach_reverse',
- 'foreach', 'for', 'function', 'goto', 'if', 'immutable', 'import',
- 'interface', 'invariant', 'inout', 'in', 'is', 'lazy', 'mixin',
- 'module', 'new', 'nothrow', 'out', 'override', 'package', 'pragma',
- 'private', 'protected', 'public', 'pure', 'ref', 'return', 'scope',
- 'shared', 'static', 'struct', 'super', 'switch', 'synchronized',
- 'template', 'this', 'throw', 'try', 'typedef', 'typeid', 'typeof',
- 'union', 'unittest', 'version', 'volatile', 'while', 'with',
- '__gshared', '__traits', '__vector', '__parameters'),
- suffix=r'\b'),
- Keyword),
- (words((
- 'bool', 'byte', 'cdouble', 'cent', 'cfloat', 'char', 'creal',
- 'dchar', 'double', 'float', 'idouble', 'ifloat', 'int', 'ireal',
- 'long', 'real', 'short', 'ubyte', 'ucent', 'uint', 'ulong',
- 'ushort', 'void', 'wchar'), suffix=r'\b'),
- Keyword.Type),
- (r'(false|true|null)\b', Keyword.Constant),
- (words((
- '__FILE__', '__MODULE__', '__LINE__', '__FUNCTION__', '__PRETTY_FUNCTION__'
- '', '__DATE__', '__EOF__', '__TIME__', '__TIMESTAMP__', '__VENDOR__',
- '__VERSION__'), suffix=r'\b'),
- Keyword.Pseudo),
- (r'macro\b', Keyword.Reserved),
- (r'(string|wstring|dstring|size_t|ptrdiff_t)\b', Name.Builtin),
- # FloatLiteral
- # -- HexFloat
- (r'0[xX]([0-9a-fA-F_]*\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)'
- r'[pP][+\-]?[0-9_]+[fFL]?[i]?', Number.Float),
- # -- DecimalFloat
- (r'[0-9_]+(\.[0-9_]+[eE][+\-]?[0-9_]+|'
- r'\.[0-9_]*|[eE][+\-]?[0-9_]+)[fFL]?[i]?', Number.Float),
- (r'\.(0|[1-9][0-9_]*)([eE][+\-]?[0-9_]+)?[fFL]?[i]?', Number.Float),
- # IntegerLiteral
- # -- Binary
- (r'0[Bb][01_]+', Number.Bin),
- # -- Octal
- (r'0[0-7_]+', Number.Oct),
- # -- Hexadecimal
- (r'0[xX][0-9a-fA-F_]+', Number.Hex),
- # -- Decimal
- (r'(0|[1-9][0-9_]*)([LUu]|Lu|LU|uL|UL)?', Number.Integer),
- # CharacterLiteral
- (r"""'(\\['"?\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}"""
- r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|\\&\w+;|.)'""",
- String.Char),
- # StringLiteral
- # -- WysiwygString
- (r'r"[^"]*"[cwd]?', String),
- # -- AlternateWysiwygString
- (r'`[^`]*`[cwd]?', String),
- # -- DoubleQuotedString
- (r'"(\\\\|\\"|[^"])*"[cwd]?', String),
- # -- EscapeSequence
- (r"\\(['\"?\\abfnrtv]|x[0-9a-fA-F]{2}|[0-7]{1,3}"
- r"|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|&\w+;)",
- String),
- # -- HexString
- (r'x"[0-9a-fA-F_\s]*"[cwd]?', String),
- # -- DelimitedString
- (r'q"\[', String, 'delimited_bracket'),
- (r'q"\(', String, 'delimited_parenthesis'),
- (r'q"<', String, 'delimited_angle'),
- (r'q"\{', String, 'delimited_curly'),
- (r'q"([a-zA-Z_]\w*)\n.*?\n\1"', String),
- (r'q"(.).*?\1"', String),
- # -- TokenString
- (r'q\{', String, 'token_string'),
- # Attributes
- (r'@([a-zA-Z_]\w*)?', Name.Decorator),
- # Tokens
- (r'(~=|\^=|%=|\*=|==|!>=|!<=|!<>=|!<>|!<|!>|!=|>>>=|>>>|>>=|>>|>='
- r'|<>=|<>|<<=|<<|<=|\+\+|\+=|--|-=|\|\||\|=|&&|&=|\.\.\.|\.\.|/=)'
- r'|[/.&|\-+<>!()\[\]{}?,;:$=*%^~]', Punctuation),
- # Identifier
- (r'[a-zA-Z_]\w*', Name),
- # Line
- (r'#line\s.*\n', Comment.Special),
- ],
- 'nested_comment': [
- (r'[^+/]+', Comment.Multiline),
- (r'/\+', Comment.Multiline, '#push'),
- (r'\+/', Comment.Multiline, '#pop'),
- (r'[+/]', Comment.Multiline),
- ],
- 'token_string': [
- (r'\{', Punctuation, 'token_string_nest'),
- (r'\}', String, '#pop'),
- include('root'),
- ],
- 'token_string_nest': [
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- include('root'),
- ],
- 'delimited_bracket': [
- (r'[^\[\]]+', String),
- (r'\[', String, 'delimited_inside_bracket'),
- (r'\]"', String, '#pop'),
- ],
- 'delimited_inside_bracket': [
- (r'[^\[\]]+', String),
- (r'\[', String, '#push'),
- (r'\]', String, '#pop'),
- ],
- 'delimited_parenthesis': [
- (r'[^()]+', String),
- (r'\(', String, 'delimited_inside_parenthesis'),
- (r'\)"', String, '#pop'),
- ],
- 'delimited_inside_parenthesis': [
- (r'[^()]+', String),
- (r'\(', String, '#push'),
- (r'\)', String, '#pop'),
- ],
- 'delimited_angle': [
- (r'[^<>]+', String),
- (r'<', String, 'delimited_inside_angle'),
- (r'>"', String, '#pop'),
- ],
- 'delimited_inside_angle': [
- (r'[^<>]+', String),
- (r'<', String, '#push'),
- (r'>', String, '#pop'),
- ],
- 'delimited_curly': [
- (r'[^{}]+', String),
- (r'\{', String, 'delimited_inside_curly'),
- (r'\}"', String, '#pop'),
- ],
- 'delimited_inside_curly': [
- (r'[^{}]+', String),
- (r'\{', String, '#push'),
- (r'\}', String, '#pop'),
- ],
- }
-
-
-class CrocLexer(RegexLexer):
- """
- For `Croc <http://jfbillingsley.com/croc>`_ source.
- """
- name = 'Croc'
- filenames = ['*.croc']
- aliases = ['croc']
- mimetypes = ['text/x-crocsrc']
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'\s+', Text),
- # Comments
- (r'//(.*?)\n', Comment.Single),
- (r'/\*', Comment.Multiline, 'nestedcomment'),
- # Keywords
- (words((
- 'as', 'assert', 'break', 'case', 'catch', 'class', 'continue',
- 'default', 'do', 'else', 'finally', 'for', 'foreach', 'function',
- 'global', 'namespace', 'if', 'import', 'in', 'is', 'local',
- 'module', 'return', 'scope', 'super', 'switch', 'this', 'throw',
- 'try', 'vararg', 'while', 'with', 'yield'), suffix=r'\b'),
- Keyword),
- (r'(false|true|null)\b', Keyword.Constant),
- # FloatLiteral
- (r'([0-9][0-9_]*)(?=[.eE])(\.[0-9][0-9_]*)?([eE][+\-]?[0-9_]+)?',
- Number.Float),
- # IntegerLiteral
- # -- Binary
- (r'0[bB][01][01_]*', Number.Bin),
- # -- Hexadecimal
- (r'0[xX][0-9a-fA-F][0-9a-fA-F_]*', Number.Hex),
- # -- Decimal
- (r'([0-9][0-9_]*)(?![.eE])', Number.Integer),
- # CharacterLiteral
- (r"""'(\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-9]{1,3}"""
- r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|.)'""",
- String.Char),
- # StringLiteral
- # -- WysiwygString
- (r'@"(""|[^"])*"', String),
- (r'@`(``|[^`])*`', String),
- (r"@'(''|[^'])*'", String),
- # -- DoubleQuotedString
- (r'"(\\\\|\\"|[^"])*"', String),
- # Tokens
- (r'(~=|\^=|%=|\*=|==|!=|>>>=|>>>|>>=|>>|>=|<=>|\?=|-\>'
- r'|<<=|<<|<=|\+\+|\+=|--|-=|\|\||\|=|&&|&=|\.\.|/=)'
- r'|[-/.&$@|\+<>!()\[\]{}?,;:=*%^~#\\]', Punctuation),
- # Identifier
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'nestedcomment': [
- (r'[^*/]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline),
- ],
- }
-
-
-class MiniDLexer(CrocLexer):
- """
- For MiniD source. MiniD is now known as Croc.
- """
- name = 'MiniD'
- filenames = [] # don't lex .md as MiniD, reserve for Markdown
- aliases = ['minid']
- mimetypes = ['text/x-minidsrc']
diff --git a/pygments/lexers/dalvik.py b/pygments/lexers/dalvik.py
deleted file mode 100644
index 0e39bb96..00000000
--- a/pygments/lexers/dalvik.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.dalvik
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Pygments lexers for Dalvik VM-related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups
-from pygments.token import Keyword, Text, Comment, Name, String, Number, \
- Punctuation
-
-__all__ = ['SmaliLexer']
-
-
-class SmaliLexer(RegexLexer):
- """
- For `Smali <http://code.google.com/p/smali/>`_ (Android/Dalvik) assembly
- code.
-
- .. versionadded:: 1.6
- """
- name = 'Smali'
- aliases = ['smali']
- filenames = ['*.smali']
- mimetypes = ['text/smali']
-
- tokens = {
- 'root': [
- include('comment'),
- include('label'),
- include('field'),
- include('method'),
- include('class'),
- include('directive'),
- include('access-modifier'),
- include('instruction'),
- include('literal'),
- include('punctuation'),
- include('type'),
- include('whitespace')
- ],
- 'directive': [
- (r'^[ \t]*\.(class|super|implements|field|subannotation|annotation|'
- r'enum|method|registers|locals|array-data|packed-switch|'
- r'sparse-switch|catchall|catch|line|parameter|local|prologue|'
- r'epilogue|source)', Keyword),
- (r'^[ \t]*\.end (field|subannotation|annotation|method|array-data|'
- 'packed-switch|sparse-switch|parameter|local)', Keyword),
- (r'^[ \t]*\.restart local', Keyword),
- ],
- 'access-modifier': [
- (r'(public|private|protected|static|final|synchronized|bridge|'
- r'varargs|native|abstract|strictfp|synthetic|constructor|'
- r'declared-synchronized|interface|enum|annotation|volatile|'
- r'transient)', Keyword),
- ],
- 'whitespace': [
- (r'\n', Text),
- (r'\s+', Text),
- ],
- 'instruction': [
- (r'\b[vp]\d+\b', Name.Builtin), # registers
- (r'\b[a-z][A-Za-z0-9/-]+\s+', Text), # instructions
- ],
- 'literal': [
- (r'".*"', String),
- (r'0x[0-9A-Fa-f]+t?', Number.Hex),
- (r'[0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'[0-9]+L?', Number.Integer),
- ],
- 'field': [
- (r'(\$?\b)([\w$]*)(:)',
- bygroups(Punctuation, Name.Variable, Punctuation)),
- ],
- 'method': [
- (r'<(?:cl)?init>', Name.Function), # constructor
- (r'(\$?\b)([\w$]*)(\()',
- bygroups(Punctuation, Name.Function, Punctuation)),
- ],
- 'label': [
- (r':\w+', Name.Label),
- ],
- 'class': [
- # class names in the form Lcom/namespace/ClassName;
- # I only want to color the ClassName part, so the namespace part is
- # treated as 'Text'
- (r'(L)((?:[\w$]+/)*)([\w$]+)(;)',
- bygroups(Keyword.Type, Text, Name.Class, Text)),
- ],
- 'punctuation': [
- (r'->', Punctuation),
- (r'[{},():=.-]', Punctuation),
- ],
- 'type': [
- (r'[ZBSCIJFDV\[]+', Keyword.Type),
- ],
- 'comment': [
- (r'#.*?\n', Comment),
- ],
- }
-
- def analyse_text(text):
- score = 0
- if re.search(r'^\s*\.class\s', text, re.MULTILINE):
- score += 0.5
- if re.search(r'\b((check-cast|instance-of|throw-verification-error'
- r')\b|(-to|add|[ais]get|[ais]put|and|cmpl|const|div|'
- r'if|invoke|move|mul|neg|not|or|rem|return|rsub|shl|'
- r'shr|sub|ushr)[-/])|{|}', text, re.MULTILINE):
- score += 0.3
- if re.search(r'(\.(catchall|epilogue|restart local|prologue)|'
- r'\b(array-data|class-change-error|declared-synchronized|'
- r'(field|inline|vtable)@0x[0-9a-fA-F]|generic-error|'
- r'illegal-class-access|illegal-field-access|'
- r'illegal-method-access|instantiation-error|no-error|'
- r'no-such-class|no-such-field|no-such-method|'
- r'packed-switch|sparse-switch))\b', text, re.MULTILINE):
- score += 0.6
- return score
diff --git a/pygments/lexers/data.py b/pygments/lexers/data.py
deleted file mode 100644
index 46ca7340..00000000
--- a/pygments/lexers/data.py
+++ /dev/null
@@ -1,561 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.data
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for data file format.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, ExtendedRegexLexer, LexerContext, \
- include, bygroups, inherit
-from pygments.token import Text, Comment, Keyword, Name, String, Number, \
- Punctuation, Literal, Error
-
-__all__ = ['YamlLexer', 'JsonLexer', 'JsonBareObjectLexer', 'JsonLdLexer']
-
-
-class YamlLexerContext(LexerContext):
- """Indentation context for the YAML lexer."""
-
- def __init__(self, *args, **kwds):
- super(YamlLexerContext, self).__init__(*args, **kwds)
- self.indent_stack = []
- self.indent = -1
- self.next_indent = 0
- self.block_scalar_indent = None
-
-
-class YamlLexer(ExtendedRegexLexer):
- """
- Lexer for `YAML <http://yaml.org/>`_, a human-friendly data serialization
- language.
-
- .. versionadded:: 0.11
- """
-
- name = 'YAML'
- aliases = ['yaml']
- filenames = ['*.yaml', '*.yml']
- mimetypes = ['text/x-yaml']
-
- def something(token_class):
- """Do not produce empty tokens."""
- def callback(lexer, match, context):
- text = match.group()
- if not text:
- return
- yield match.start(), token_class, text
- context.pos = match.end()
- return callback
-
- def reset_indent(token_class):
- """Reset the indentation levels."""
- def callback(lexer, match, context):
- text = match.group()
- context.indent_stack = []
- context.indent = -1
- context.next_indent = 0
- context.block_scalar_indent = None
- yield match.start(), token_class, text
- context.pos = match.end()
- return callback
-
- def save_indent(token_class, start=False):
- """Save a possible indentation level."""
- def callback(lexer, match, context):
- text = match.group()
- extra = ''
- if start:
- context.next_indent = len(text)
- if context.next_indent < context.indent:
- while context.next_indent < context.indent:
- context.indent = context.indent_stack.pop()
- if context.next_indent > context.indent:
- extra = text[context.indent:]
- text = text[:context.indent]
- else:
- context.next_indent += len(text)
- if text:
- yield match.start(), token_class, text
- if extra:
- yield match.start()+len(text), token_class.Error, extra
- context.pos = match.end()
- return callback
-
- def set_indent(token_class, implicit=False):
- """Set the previously saved indentation level."""
- def callback(lexer, match, context):
- text = match.group()
- if context.indent < context.next_indent:
- context.indent_stack.append(context.indent)
- context.indent = context.next_indent
- if not implicit:
- context.next_indent += len(text)
- yield match.start(), token_class, text
- context.pos = match.end()
- return callback
-
- def set_block_scalar_indent(token_class):
- """Set an explicit indentation level for a block scalar."""
- def callback(lexer, match, context):
- text = match.group()
- context.block_scalar_indent = None
- if not text:
- return
- increment = match.group(1)
- if increment:
- current_indent = max(context.indent, 0)
- increment = int(increment)
- context.block_scalar_indent = current_indent + increment
- if text:
- yield match.start(), token_class, text
- context.pos = match.end()
- return callback
-
- def parse_block_scalar_empty_line(indent_token_class, content_token_class):
- """Process an empty line in a block scalar."""
- def callback(lexer, match, context):
- text = match.group()
- if (context.block_scalar_indent is None or
- len(text) <= context.block_scalar_indent):
- if text:
- yield match.start(), indent_token_class, text
- else:
- indentation = text[:context.block_scalar_indent]
- content = text[context.block_scalar_indent:]
- yield match.start(), indent_token_class, indentation
- yield (match.start()+context.block_scalar_indent,
- content_token_class, content)
- context.pos = match.end()
- return callback
-
- def parse_block_scalar_indent(token_class):
- """Process indentation spaces in a block scalar."""
- def callback(lexer, match, context):
- text = match.group()
- if context.block_scalar_indent is None:
- if len(text) <= max(context.indent, 0):
- context.stack.pop()
- context.stack.pop()
- return
- context.block_scalar_indent = len(text)
- else:
- if len(text) < context.block_scalar_indent:
- context.stack.pop()
- context.stack.pop()
- return
- if text:
- yield match.start(), token_class, text
- context.pos = match.end()
- return callback
-
- def parse_plain_scalar_indent(token_class):
- """Process indentation spaces in a plain scalar."""
- def callback(lexer, match, context):
- text = match.group()
- if len(text) <= context.indent:
- context.stack.pop()
- context.stack.pop()
- return
- if text:
- yield match.start(), token_class, text
- context.pos = match.end()
- return callback
-
- tokens = {
- # the root rules
- 'root': [
- # ignored whitespaces
- (r'[ ]+(?=#|$)', Text),
- # line breaks
- (r'\n+', Text),
- # a comment
- (r'#[^\n]*', Comment.Single),
- # the '%YAML' directive
- (r'^%YAML(?=[ ]|$)', reset_indent(Name.Tag), 'yaml-directive'),
- # the %TAG directive
- (r'^%TAG(?=[ ]|$)', reset_indent(Name.Tag), 'tag-directive'),
- # document start and document end indicators
- (r'^(?:---|\.\.\.)(?=[ ]|$)', reset_indent(Name.Namespace),
- 'block-line'),
- # indentation spaces
- (r'[ ]*(?!\s|$)', save_indent(Text, start=True),
- ('block-line', 'indentation')),
- ],
-
- # trailing whitespaces after directives or a block scalar indicator
- 'ignored-line': [
- # ignored whitespaces
- (r'[ ]+(?=#|$)', Text),
- # a comment
- (r'#[^\n]*', Comment.Single),
- # line break
- (r'\n', Text, '#pop:2'),
- ],
-
- # the %YAML directive
- 'yaml-directive': [
- # the version number
- (r'([ ]+)([0-9]+\.[0-9]+)',
- bygroups(Text, Number), 'ignored-line'),
- ],
-
- # the %TAG directive
- 'tag-directive': [
- # a tag handle and the corresponding prefix
- (r'([ ]+)(!|![\w-]*!)'
- r'([ ]+)(!|!?[\w;/?:@&=+$,.!~*\'()\[\]%-]+)',
- bygroups(Text, Keyword.Type, Text, Keyword.Type),
- 'ignored-line'),
- ],
-
- # block scalar indicators and indentation spaces
- 'indentation': [
- # trailing whitespaces are ignored
- (r'[ ]*$', something(Text), '#pop:2'),
- # whitespaces preceding block collection indicators
- (r'[ ]+(?=[?:-](?:[ ]|$))', save_indent(Text)),
- # block collection indicators
- (r'[?:-](?=[ ]|$)', set_indent(Punctuation.Indicator)),
- # the beginning a block line
- (r'[ ]*', save_indent(Text), '#pop'),
- ],
-
- # an indented line in the block context
- 'block-line': [
- # the line end
- (r'[ ]*(?=#|$)', something(Text), '#pop'),
- # whitespaces separating tokens
- (r'[ ]+', Text),
- # key with colon
- (r'''([^#,:?\[\]{}"'\n]+)(:)(?=[ ]|$)''',
- bygroups(Name.Tag, set_indent(Punctuation, implicit=True))),
- # tags, anchors and aliases,
- include('descriptors'),
- # block collections and scalars
- include('block-nodes'),
- # flow collections and quoted scalars
- include('flow-nodes'),
- # a plain scalar
- (r'(?=[^\s?:,\[\]{}#&*!|>\'"%@`-]|[?:-]\S)',
- something(Name.Variable),
- 'plain-scalar-in-block-context'),
- ],
-
- # tags, anchors, aliases
- 'descriptors': [
- # a full-form tag
- (r'!<[\w#;/?:@&=+$,.!~*\'()\[\]%-]+>', Keyword.Type),
- # a tag in the form '!', '!suffix' or '!handle!suffix'
- (r'!(?:[\w-]+!)?'
- r'[\w#;/?:@&=+$,.!~*\'()\[\]%-]*', Keyword.Type),
- # an anchor
- (r'&[\w-]+', Name.Label),
- # an alias
- (r'\*[\w-]+', Name.Variable),
- ],
-
- # block collections and scalars
- 'block-nodes': [
- # implicit key
- (r':(?=[ ]|$)', set_indent(Punctuation.Indicator, implicit=True)),
- # literal and folded scalars
- (r'[|>]', Punctuation.Indicator,
- ('block-scalar-content', 'block-scalar-header')),
- ],
-
- # flow collections and quoted scalars
- 'flow-nodes': [
- # a flow sequence
- (r'\[', Punctuation.Indicator, 'flow-sequence'),
- # a flow mapping
- (r'\{', Punctuation.Indicator, 'flow-mapping'),
- # a single-quoted scalar
- (r'\'', String, 'single-quoted-scalar'),
- # a double-quoted scalar
- (r'\"', String, 'double-quoted-scalar'),
- ],
-
- # the content of a flow collection
- 'flow-collection': [
- # whitespaces
- (r'[ ]+', Text),
- # line breaks
- (r'\n+', Text),
- # a comment
- (r'#[^\n]*', Comment.Single),
- # simple indicators
- (r'[?:,]', Punctuation.Indicator),
- # tags, anchors and aliases
- include('descriptors'),
- # nested collections and quoted scalars
- include('flow-nodes'),
- # a plain scalar
- (r'(?=[^\s?:,\[\]{}#&*!|>\'"%@`])',
- something(Name.Variable),
- 'plain-scalar-in-flow-context'),
- ],
-
- # a flow sequence indicated by '[' and ']'
- 'flow-sequence': [
- # include flow collection rules
- include('flow-collection'),
- # the closing indicator
- (r'\]', Punctuation.Indicator, '#pop'),
- ],
-
- # a flow mapping indicated by '{' and '}'
- 'flow-mapping': [
- # key with colon
- (r'''([^,:?\[\]{}"'\n]+)(:)(?=[ ]|$)''',
- bygroups(Name.Tag, Punctuation)),
- # include flow collection rules
- include('flow-collection'),
- # the closing indicator
- (r'\}', Punctuation.Indicator, '#pop'),
- ],
-
- # block scalar lines
- 'block-scalar-content': [
- # line break
- (r'\n', Text),
- # empty line
- (r'^[ ]+$',
- parse_block_scalar_empty_line(Text, Name.Constant)),
- # indentation spaces (we may leave the state here)
- (r'^[ ]*', parse_block_scalar_indent(Text)),
- # line content
- (r'[\S\t ]+', Name.Constant),
- ],
-
- # the content of a literal or folded scalar
- 'block-scalar-header': [
- # indentation indicator followed by chomping flag
- (r'([1-9])?[+-]?(?=[ ]|$)',
- set_block_scalar_indent(Punctuation.Indicator),
- 'ignored-line'),
- # chomping flag followed by indentation indicator
- (r'[+-]?([1-9])?(?=[ ]|$)',
- set_block_scalar_indent(Punctuation.Indicator),
- 'ignored-line'),
- ],
-
- # ignored and regular whitespaces in quoted scalars
- 'quoted-scalar-whitespaces': [
- # leading and trailing whitespaces are ignored
- (r'^[ ]+', Text),
- (r'[ ]+$', Text),
- # line breaks are ignored
- (r'\n+', Text),
- # other whitespaces are a part of the value
- (r'[ ]+', Name.Variable),
- ],
-
- # single-quoted scalars
- 'single-quoted-scalar': [
- # include whitespace and line break rules
- include('quoted-scalar-whitespaces'),
- # escaping of the quote character
- (r'\'\'', String.Escape),
- # regular non-whitespace characters
- (r'[^\s\']+', String),
- # the closing quote
- (r'\'', String, '#pop'),
- ],
-
- # double-quoted scalars
- 'double-quoted-scalar': [
- # include whitespace and line break rules
- include('quoted-scalar-whitespaces'),
- # escaping of special characters
- (r'\\[0abt\tn\nvfre "\\N_LP]', String),
- # escape codes
- (r'\\(?:x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})',
- String.Escape),
- # regular non-whitespace characters
- (r'[^\s"\\]+', String),
- # the closing quote
- (r'"', String, '#pop'),
- ],
-
- # the beginning of a new line while scanning a plain scalar
- 'plain-scalar-in-block-context-new-line': [
- # empty lines
- (r'^[ ]+$', Text),
- # line breaks
- (r'\n+', Text),
- # document start and document end indicators
- (r'^(?=---|\.\.\.)', something(Name.Namespace), '#pop:3'),
- # indentation spaces (we may leave the block line state here)
- (r'^[ ]*', parse_plain_scalar_indent(Text), '#pop'),
- ],
-
- # a plain scalar in the block context
- 'plain-scalar-in-block-context': [
- # the scalar ends with the ':' indicator
- (r'[ ]*(?=:[ ]|:$)', something(Text), '#pop'),
- # the scalar ends with whitespaces followed by a comment
- (r'[ ]+(?=#)', Text, '#pop'),
- # trailing whitespaces are ignored
- (r'[ ]+$', Text),
- # line breaks are ignored
- (r'\n+', Text, 'plain-scalar-in-block-context-new-line'),
- # other whitespaces are a part of the value
- (r'[ ]+', Literal.Scalar.Plain),
- # regular non-whitespace characters
- (r'(?::(?!\s)|[^\s:])+', Literal.Scalar.Plain),
- ],
-
- # a plain scalar is the flow context
- 'plain-scalar-in-flow-context': [
- # the scalar ends with an indicator character
- (r'[ ]*(?=[,:?\[\]{}])', something(Text), '#pop'),
- # the scalar ends with a comment
- (r'[ ]+(?=#)', Text, '#pop'),
- # leading and trailing whitespaces are ignored
- (r'^[ ]+', Text),
- (r'[ ]+$', Text),
- # line breaks are ignored
- (r'\n+', Text),
- # other whitespaces are a part of the value
- (r'[ ]+', Name.Variable),
- # regular non-whitespace characters
- (r'[^\s,:?\[\]{}]+', Name.Variable),
- ],
-
- }
-
- def get_tokens_unprocessed(self, text=None, context=None):
- if context is None:
- context = YamlLexerContext(text, 0)
- return super(YamlLexer, self).get_tokens_unprocessed(text, context)
-
-
-class JsonLexer(RegexLexer):
- """
- For JSON data structures.
-
- .. versionadded:: 1.5
- """
-
- name = 'JSON'
- aliases = ['json']
- filenames = ['*.json']
- mimetypes = ['application/json']
-
- flags = re.DOTALL
-
- # integer part of a number
- int_part = r'-?(0|[1-9]\d*)'
-
- # fractional part of a number
- frac_part = r'\.\d+'
-
- # exponential part of a number
- exp_part = r'[eE](\+|-)?\d+'
-
- tokens = {
- 'whitespace': [
- (r'\s+', Text),
- ],
-
- # represents a simple terminal value
- 'simplevalue': [
- (r'(true|false|null)\b', Keyword.Constant),
- (('%(int_part)s(%(frac_part)s%(exp_part)s|'
- '%(exp_part)s|%(frac_part)s)') % vars(),
- Number.Float),
- (int_part, 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:2'),
- ],
-
- # 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 JsonBareObjectLexer(JsonLexer):
- """
- For JSON data structures (with missing object curly braces).
-
- .. versionadded:: 2.2
- """
-
- name = 'JSONBareObject'
- aliases = ['json-object']
- filenames = []
- mimetypes = ['application/json-object']
-
- tokens = {
- 'root': [
- (r'\}', Error),
- include('objectvalue'),
- ],
- 'objectattribute': [
- (r'\}', Error),
- inherit,
- ],
- }
-
-
-class JsonLdLexer(JsonLexer):
- """
- For `JSON-LD <http://json-ld.org/>`_ linked data.
-
- .. versionadded:: 2.0
- """
-
- name = 'JSON-LD'
- aliases = ['jsonld', 'json-ld']
- filenames = ['*.jsonld']
- mimetypes = ['application/ld+json']
-
- tokens = {
- 'objectvalue': [
- (r'"@(context|id|value|language|type|container|list|set|'
- r'reverse|index|base|vocab|graph)"', Name.Decorator,
- 'objectattribute'),
- inherit,
- ],
- }
diff --git a/pygments/lexers/diff.py b/pygments/lexers/diff.py
deleted file mode 100644
index 5ff8375c..00000000
--- a/pygments/lexers/diff.py
+++ /dev/null
@@ -1,165 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.diff
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for diff/patch formats.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups
-from pygments.token import Text, Comment, Operator, Keyword, Name, Generic, \
- Literal
-
-__all__ = ['DiffLexer', 'DarcsPatchLexer', 'WDiffLexer']
-
-
-class DiffLexer(RegexLexer):
- """
- Lexer for unified or context-style diffs or patches.
- """
-
- name = 'Diff'
- aliases = ['diff', 'udiff']
- filenames = ['*.diff', '*.patch']
- mimetypes = ['text/x-diff', 'text/x-patch']
-
- tokens = {
- 'root': [
- (r' .*\n', Text),
- (r'\+.*\n', Generic.Inserted),
- (r'-.*\n', Generic.Deleted),
- (r'!.*\n', Generic.Strong),
- (r'@.*\n', Generic.Subheading),
- (r'([Ii]ndex|diff).*\n', Generic.Heading),
- (r'=.*\n', Generic.Heading),
- (r'.*\n', Text),
- ]
- }
-
- def analyse_text(text):
- if text[:7] == 'Index: ':
- return True
- if text[:5] == 'diff ':
- return True
- if text[:4] == '--- ':
- return 0.9
-
-
-class DarcsPatchLexer(RegexLexer):
- """
- DarcsPatchLexer is a lexer for the various versions of the darcs patch
- format. Examples of this format are derived by commands such as
- ``darcs annotate --patch`` and ``darcs send``.
-
- .. versionadded:: 0.10
- """
-
- name = 'Darcs Patch'
- aliases = ['dpatch']
- filenames = ['*.dpatch', '*.darcspatch']
-
- DPATCH_KEYWORDS = ('hunk', 'addfile', 'adddir', 'rmfile', 'rmdir', 'move',
- 'replace')
-
- tokens = {
- 'root': [
- (r'<', Operator),
- (r'>', Operator),
- (r'\{', Operator),
- (r'\}', Operator),
- (r'(\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)(\])',
- bygroups(Operator, Keyword, Name, Text, Name, Operator,
- Literal.Date, Text, Operator)),
- (r'(\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)',
- bygroups(Operator, Keyword, Name, Text, Name, Operator,
- Literal.Date, Text), 'comment'),
- (r'New patches:', Generic.Heading),
- (r'Context:', Generic.Heading),
- (r'Patch bundle hash:', Generic.Heading),
- (r'(\s*)(%s)(.*\n)' % '|'.join(DPATCH_KEYWORDS),
- bygroups(Text, Keyword, Text)),
- (r'\+', Generic.Inserted, "insert"),
- (r'-', Generic.Deleted, "delete"),
- (r'.*\n', Text),
- ],
- 'comment': [
- (r'[^\]].*\n', Comment),
- (r'\]', Operator, "#pop"),
- ],
- 'specialText': [ # darcs add [_CODE_] special operators for clarity
- (r'\n', Text, "#pop"), # line-based
- (r'\[_[^_]*_]', Operator),
- ],
- 'insert': [
- include('specialText'),
- (r'\[', Generic.Inserted),
- (r'[^\n\[]+', Generic.Inserted),
- ],
- 'delete': [
- include('specialText'),
- (r'\[', Generic.Deleted),
- (r'[^\n\[]+', Generic.Deleted),
- ],
- }
-
-
-class WDiffLexer(RegexLexer):
- """
- A `wdiff <https://www.gnu.org/software/wdiff/>`_ lexer.
-
- Note that:
-
- * only to normal output (without option like -l).
- * if target files of wdiff contain "[-", "-]", "{+", "+}",
- especially they are unbalanced, this lexer will get confusing.
-
- .. versionadded:: 2.2
- """
-
- name = 'WDiff'
- aliases = ['wdiff']
- filenames = ['*.wdiff']
- mimetypes = []
-
- flags = re.MULTILINE | re.DOTALL
-
- # We can only assume "[-" after "[-" before "-]" is `nested`,
- # for instance wdiff to wdiff outputs. We have no way to
- # distinct these marker is of wdiff output from original text.
-
- ins_op = r"\{\+"
- ins_cl = r"\+\}"
- del_op = r"\[\-"
- del_cl = r"\-\]"
- normal = r'[^{}[\]+-]+' # for performance
- tokens = {
- 'root': [
- (ins_op, Generic.Inserted, 'inserted'),
- (del_op, Generic.Deleted, 'deleted'),
- (normal, Text),
- (r'.', Text),
- ],
- 'inserted': [
- (ins_op, Generic.Inserted, '#push'),
- (del_op, Generic.Inserted, '#push'),
- (del_cl, Generic.Inserted, '#pop'),
-
- (ins_cl, Generic.Inserted, '#pop'),
- (normal, Generic.Inserted),
- (r'.', Generic.Inserted),
- ],
- 'deleted': [
- (del_op, Generic.Deleted, '#push'),
- (ins_op, Generic.Deleted, '#push'),
- (ins_cl, Generic.Deleted, '#pop'),
-
- (del_cl, Generic.Deleted, '#pop'),
- (normal, Generic.Deleted),
- (r'.', Generic.Deleted),
- ],
- }
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py
deleted file mode 100644
index 458a9eb4..00000000
--- a/pygments/lexers/dotnet.py
+++ /dev/null
@@ -1,688 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.dotnet
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for .net languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-import re
-
-from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, \
- using, this, default, words
-from pygments.token import Punctuation, \
- Text, Comment, Operator, Keyword, Name, String, Number, Literal, Other
-from pygments.util import get_choice_opt, iteritems
-from pygments import unistring as uni
-
-from pygments.lexers.html import XmlLexer
-
-__all__ = ['CSharpLexer', 'NemerleLexer', 'BooLexer', 'VbNetLexer',
- 'CSharpAspxLexer', 'VbNetAspxLexer', 'FSharpLexer']
-
-
-class CSharpLexer(RegexLexer):
- """
- For `C# <http://msdn2.microsoft.com/en-us/vcsharp/default.aspx>`_
- 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``.
-
- .. versionadded:: 0.8
- """
-
- name = 'C#'
- aliases = ['csharp', 'c#']
- filenames = ['*.cs']
- mimetypes = ['text/x-csharp'] # 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 = {
- 'none': r'@?[_a-zA-Z]\w*',
- 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' +
- '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc',
- 'Cf', 'Mn', 'Mc') + ']*'),
- 'full': ('@?(?:_|[^' +
- uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])'
- + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl',
- 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'),
- }
-
- tokens = {}
- token_variants = True
-
- for levelname, cs_ident in iteritems(levels):
- 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'[~!%^&*()+=|\[\]:;,.<>/?-]', 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|async|await|base|break|by|case|catch|'
- r'checked|const|continue|default|delegate|'
- r'do|else|enum|event|explicit|extern|false|finally|'
- r'fixed|for|foreach|goto|if|implicit|in|interface|'
- r'internal|is|let|lock|new|null|on|operator|'
- r'out|override|params|private|protected|public|readonly|'
- 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|alias|ascending|'
- r'descending|from|group|into|orderby|select|thenby|where|'
- r'join|equals)\b', Keyword),
- (r'(global)(::)', bygroups(Keyword, Punctuation)),
- (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),
- ],
- 'class': [
- (cs_ident, Name.Class, '#pop'),
- default('#pop'),
- ],
- 'namespace': [
- (r'(?=\()', Text, '#pop'), # using (resource)
- ('(' + cs_ident + r'|\.)+', Name.Namespace, '#pop'),
- ]
- }
-
- def __init__(self, **options):
- level = get_choice_opt(options, 'unicodelevel', list(self.tokens), '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 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``.
-
- .. versionadded:: 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 = {
- 'none': r'@?[_a-zA-Z]\w*',
- 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' +
- '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc',
- 'Cf', 'Mn', 'Mc') + ']*'),
- 'full': ('@?(?:_|[^' +
- uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])'
- + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl',
- 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'),
- }
-
- tokens = {}
- token_variants = True
-
- for levelname, cs_ident in iteritems(levels):
- 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', list(self.tokens),
- '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.
- """
-
- name = 'Boo'
- aliases = ['boo']
- filenames = ['*.boo']
- mimetypes = ['text/x-boo']
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'(#|//).*$', Comment.Single),
- (r'/[*]', Comment.Multiline, 'comment'),
- (r'[]{}:(),.;[]', Punctuation),
- (r'\\\n', Text),
- (r'\\', Text),
- (r'(in|is|and|or|not)\b', Operator.Word),
- (r'/(\\\\|\\/|[^/\s])/', String.Regex),
- (r'@/(\\\\|\\/|[^/])*/', String.Regex),
- (r'=~|!=|==|<<|>>|[-+/*%=<>&^|]', Operator),
- (r'(as|abstract|callable|constructor|destructor|do|import|'
- r'enum|event|final|get|interface|internal|of|override|'
- r'partial|private|protected|public|return|set|static|'
- r'struct|transient|virtual|yield|super|and|break|cast|'
- r'continue|elif|else|ensure|except|for|given|goto|if|in|'
- r'is|isa|not|or|otherwise|pass|raise|ref|try|unless|when|'
- r'while|from|as)\b', Keyword),
- (r'def(?=\s+\(.*?\))', Keyword),
- (r'(def)(\s+)', bygroups(Keyword, Text), 'funcname'),
- (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
- (r'(namespace)(\s+)', bygroups(Keyword, Text), 'namespace'),
- (r'(?<!\.)(true|false|null|self|__eval__|__switch__|array|'
- r'assert|checked|enumerate|filter|getter|len|lock|map|'
- r'matrix|max|min|normalArrayIndexing|print|property|range|'
- r'rawArrayIndexing|required|typeof|unchecked|using|'
- r'yieldAll|zip)\b', Name.Builtin),
- (r'"""(\\\\|\\"|.*?)"""', String.Double),
- (r'"(\\\\|\\"|[^"]*?)"', String.Double),
- (r"'(\\\\|\\'|[^']*?)'", String.Single),
- (r'[a-zA-Z_]\w*', Name),
- (r'(\d+\.\d*|\d*\.\d+)([fF][+-]?[0-9]+)?', Number.Float),
- (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),
- (r'\d+', Number.Integer),
- ],
- 'comment': [
- ('/[*]', Comment.Multiline, '#push'),
- ('[*]/', Comment.Multiline, '#pop'),
- ('[^/*]', Comment.Multiline),
- ('[*/]', Comment.Multiline)
- ],
- 'funcname': [
- (r'[a-zA-Z_]\w*', Name.Function, '#pop')
- ],
- 'classname': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop')
- ],
- 'namespace': [
- (r'[a-zA-Z_][\w.]*', Name.Namespace, '#pop')
- ]
- }
-
-
-class VbNetLexer(RegexLexer):
- """
- For
- `Visual Basic.NET <http://msdn2.microsoft.com/en-us/vbasic/default.aspx>`_
- source code.
- """
-
- name = 'VB.net'
- aliases = ['vb.net', 'vbnet']
- filenames = ['*.vb', '*.bas']
- mimetypes = ['text/x-vbnet', 'text/x-vba'] # (?)
-
- uni_name = '[_' + uni.combine('Ll', 'Lt', 'Lm', 'Nl') + ']' + \
- '[' + uni.combine('Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc',
- 'Cf', 'Mn', 'Mc') + ']*'
-
- flags = re.MULTILINE | re.IGNORECASE
- tokens = {
- 'root': [
- (r'^\s*<.*?>', Name.Attribute),
- (r'\s+', Text),
- (r'\n', Text),
- (r'rem\b.*?\n', Comment),
- (r"'.*?\n", Comment),
- (r'#If\s.*?\sThen|#ElseIf\s.*?\sThen|#Else|#End\s+If|#Const|'
- r'#ExternalSource.*?\n|#End\s+ExternalSource|'
- r'#Region.*?\n|#End\s+Region|#ExternalChecksum',
- Comment.Preproc),
- (r'[(){}!#,.:]', Punctuation),
- (r'Option\s+(Strict|Explicit|Compare)\s+'
- r'(On|Off|Binary|Text)', Keyword.Declaration),
- (words((
- 'AddHandler', 'Alias', 'ByRef', 'ByVal', 'Call', 'Case',
- 'Catch', 'CBool', 'CByte', 'CChar', 'CDate', 'CDec', 'CDbl',
- 'CInt', 'CLng', 'CObj', 'Continue', 'CSByte', 'CShort', 'CSng',
- 'CStr', 'CType', 'CUInt', 'CULng', 'CUShort', 'Declare',
- 'Default', 'Delegate', 'DirectCast', 'Do', 'Each', 'Else',
- 'ElseIf', 'EndIf', 'Erase', 'Error', 'Event', 'Exit', 'False',
- 'Finally', 'For', 'Friend', 'Get', 'Global', 'GoSub', 'GoTo',
- 'Handles', 'If', 'Implements', 'Inherits', 'Interface', 'Let',
- 'Lib', 'Loop', 'Me', 'MustInherit', 'MustOverride', 'MyBase',
- 'MyClass', 'Narrowing', 'New', 'Next', 'Not', 'Nothing',
- 'NotInheritable', 'NotOverridable', 'Of', 'On', 'Operator',
- 'Option', 'Optional', 'Overloads', 'Overridable', 'Overrides',
- 'ParamArray', 'Partial', 'Private', 'Protected', 'Public',
- 'RaiseEvent', 'ReadOnly', 'ReDim', 'RemoveHandler', 'Resume',
- 'Return', 'Select', 'Set', 'Shadows', 'Shared', 'Single',
- 'Static', 'Step', 'Stop', 'SyncLock', 'Then', 'Throw', 'To',
- 'True', 'Try', 'TryCast', 'Wend', 'Using', 'When', 'While',
- 'Widening', 'With', 'WithEvents', 'WriteOnly'),
- prefix=r'(?<!\.)', suffix=r'\b'), Keyword),
- (r'(?<!\.)End\b', Keyword, 'end'),
- (r'(?<!\.)(Dim|Const)\b', Keyword, 'dim'),
- (r'(?<!\.)(Function|Sub|Property)(\s+)',
- bygroups(Keyword, Text), 'funcname'),
- (r'(?<!\.)(Class|Structure|Enum)(\s+)',
- bygroups(Keyword, Text), 'classname'),
- (r'(?<!\.)(Module|Namespace|Imports)(\s+)',
- bygroups(Keyword, Text), 'namespace'),
- (r'(?<!\.)(Boolean|Byte|Char|Date|Decimal|Double|Integer|Long|'
- r'Object|SByte|Short|Single|String|Variant|UInteger|ULong|'
- r'UShort)\b', Keyword.Type),
- (r'(?<!\.)(AddressOf|And|AndAlso|As|GetType|In|Is|IsNot|Like|Mod|'
- r'Or|OrElse|TypeOf|Xor)\b', Operator.Word),
- (r'&=|[*]=|/=|\\=|\^=|\+=|-=|<<=|>>=|<<|>>|:=|'
- r'<=|>=|<>|[-&*/\\^+=<>\[\]]',
- Operator),
- ('"', String, 'string'),
- (r'_\n', Text), # Line continuation (must be before Name)
- (uni_name + '[%&@!#$]?', Name),
- ('#.*?#', Literal.Date),
- (r'(\d+\.\d*|\d*\.\d+)(F[+-]?[0-9]+)?', Number.Float),
- (r'\d+([SILDFR]|US|UI|UL)?', Number.Integer),
- (r'&H[0-9a-f]+([SILDFR]|US|UI|UL)?', Number.Integer),
- (r'&O[0-7]+([SILDFR]|US|UI|UL)?', Number.Integer),
- ],
- 'string': [
- (r'""', String),
- (r'"C?', String, '#pop'),
- (r'[^"]+', String),
- ],
- 'dim': [
- (uni_name, Name.Variable, '#pop'),
- default('#pop'), # any other syntax
- ],
- 'funcname': [
- (uni_name, Name.Function, '#pop'),
- ],
- 'classname': [
- (uni_name, Name.Class, '#pop'),
- ],
- 'namespace': [
- (uni_name, Name.Namespace),
- (r'\.', Name.Namespace),
- default('#pop'),
- ],
- 'end': [
- (r'\s+', Text),
- (r'(Function|Sub|Property|Class|Structure|Enum|Module|Namespace)\b',
- Keyword, '#pop'),
- default('#pop'),
- ]
- }
-
- def analyse_text(text):
- if re.search(r'^\s*(#If|Module|Namespace)', text, re.MULTILINE):
- return 0.5
-
-
-class GenericAspxLexer(RegexLexer):
- """
- Lexer for ASP.NET pages.
- """
-
- name = 'aspx-gen'
- filenames = []
- mimetypes = []
-
- flags = re.DOTALL
-
- tokens = {
- 'root': [
- (r'(<%[@=#]?)(.*?)(%>)', bygroups(Name.Tag, Other, Name.Tag)),
- (r'(<script.*?>)(.*?)(</script>)', bygroups(using(XmlLexer),
- Other,
- using(XmlLexer))),
- (r'(.+?)(?=<)', using(XmlLexer)),
- (r'.+', using(XmlLexer)),
- ],
- }
-
-
-# TODO support multiple languages within the same source file
-class CSharpAspxLexer(DelegatingLexer):
- """
- Lexer for highlighting C# within ASP.NET pages.
- """
-
- name = 'aspx-cs'
- aliases = ['aspx-cs']
- filenames = ['*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd']
- mimetypes = []
-
- def __init__(self, **options):
- super(CSharpAspxLexer, self).__init__(CSharpLexer, GenericAspxLexer,
- **options)
-
- def analyse_text(text):
- if re.search(r'Page\s*Language="C#"', text, re.I) is not None:
- return 0.2
- elif re.search(r'script[^>]+language=["\']C#', text, re.I) is not None:
- return 0.15
-
-
-class VbNetAspxLexer(DelegatingLexer):
- """
- Lexer for highlighting Visual Basic.net within ASP.NET pages.
- """
-
- name = 'aspx-vb'
- aliases = ['aspx-vb']
- filenames = ['*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd']
- mimetypes = []
-
- def __init__(self, **options):
- super(VbNetAspxLexer, self).__init__(VbNetLexer, GenericAspxLexer,
- **options)
-
- def analyse_text(text):
- if re.search(r'Page\s*Language="Vb"', text, re.I) is not None:
- 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 <https://fsharp.org/>`_ (version 3.0).
-
- .. versionadded:: 1.5
- """
-
- name = 'F#'
- aliases = ['fsharp', 'f#']
- filenames = ['*.fs', '*.fsi']
- mimetypes = ['text/x-fsharp']
-
- keywords = [
- 'abstract', 'as', 'assert', 'base', 'begin', 'class', 'default',
- 'delegate', 'do!', 'do', 'done', 'downcast', 'downto', 'elif', 'else',
- 'end', 'exception', 'extern', 'false', 'finally', 'for', 'function',
- 'fun', 'global', 'if', 'inherit', 'inline', 'interface', 'internal',
- 'in', 'lazy', 'let!', 'let', 'match', 'member', 'module', 'mutable',
- 'namespace', 'new', 'null', 'of', 'open', 'override', 'private', 'public',
- 'rec', 'return!', 'return', 'select', 'static', 'struct', 'then', 'to',
- 'true', 'try', 'type', 'upcast', 'use!', 'use', 'val', 'void', 'when',
- 'while', 'with', 'yield!', 'yield',
- ]
- # Reserved words; cannot hurt to color them as keywords too.
- keywords += [
- 'atomic', 'break', 'checked', 'component', 'const', 'constraint',
- 'constructor', 'continue', 'eager', 'event', 'external', 'fixed',
- 'functor', 'include', 'method', 'mixin', 'object', 'parallel',
- 'process', 'protected', 'pure', 'sealed', 'tailcall', 'trait',
- 'virtual', 'volatile',
- ]
- keyopts = [
- '!=', '#', '&&', '&', r'\(', r'\)', r'\*', r'\+', ',', r'-\.',
- '->', '-', r'\.\.', r'\.', '::', ':=', ':>', ':', ';;', ';', '<-',
- r'<\]', '<', r'>\]', '>', r'\?\?', r'\?', r'\[<', r'\[\|', r'\[', r'\]',
- '_', '`', r'\{', r'\|\]', r'\|', r'\}', '~', '<@@', '<@', '=', '@>', '@@>',
- ]
-
- operators = r'[!$%&*+\./:<=>?@^|~-]'
- word_operators = ['and', 'or', 'not']
- prefix_syms = r'[!?~]'
- infix_syms = r'[=<>@^|&+\*/$%-]'
- primitives = [
- 'sbyte', 'byte', 'char', 'nativeint', 'unativeint', 'float32', 'single',
- 'float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32',
- 'uint32', 'int64', 'uint64', 'decimal', 'unit', 'bool', 'string',
- 'list', 'exn', 'obj', 'enum',
- ]
-
- # See http://msdn.microsoft.com/en-us/library/dd233181.aspx and/or
- # http://fsharp.org/about/files/spec.pdf for reference. Good luck.
-
- tokens = {
- 'escape-sequence': [
- (r'\\[\\"\'ntbrafv]', String.Escape),
- (r'\\[0-9]{3}', String.Escape),
- (r'\\u[0-9a-fA-F]{4}', String.Escape),
- (r'\\U[0-9a-fA-F]{8}', String.Escape),
- ],
- 'root': [
- (r'\s+', Text),
- (r'\(\)|\[\]', Name.Builtin.Pseudo),
- (r'\b(?<!\.)([A-Z][\w\']*)(?=\s*\.)',
- Name.Namespace, 'dotted'),
- (r'\b([A-Z][\w\']*)', Name),
- (r'///.*?\n', String.Doc),
- (r'//.*?\n', Comment.Single),
- (r'\(\*(?!\))', Comment, 'comment'),
-
- (r'@"', String, 'lstring'),
- (r'"""', String, 'tqs'),
- (r'"', String, 'string'),
-
- (r'\b(open|module)(\s+)([\w.]+)',
- bygroups(Keyword, Text, Name.Namespace)),
- (r'\b(let!?)(\s+)(\w+)',
- bygroups(Keyword, Text, Name.Variable)),
- (r'\b(type)(\s+)(\w+)',
- bygroups(Keyword, Text, Name.Class)),
- (r'\b(member|override)(\s+)(\w+)(\.)(\w+)',
- bygroups(Keyword, Text, Name, Punctuation, Name.Function)),
- (r'\b(%s)\b' % '|'.join(keywords), Keyword),
- (r'``([^`\n\r\t]|`[^`\n\r\t])+``', Name),
- (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|\d+)\b.*?\n',
- Comment.Preproc),
-
- (r"[^\W\d][\w']*", Name),
-
- (r'\d[\d_]*[uU]?[yslLnQRZINGmM]?', Number.Integer),
- (r'0[xX][\da-fA-F][\da-fA-F_]*[uU]?[yslLn]?[fF]?', Number.Hex),
- (r'0[oO][0-7][0-7_]*[uU]?[yslLn]?', Number.Oct),
- (r'0[bB][01][01_]*[uU]?[yslLn]?', Number.Bin),
- (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)[fFmM]?',
- Number.Float),
-
- (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'B?",
- String.Char),
- (r"'.'", String.Char),
- (r"'", Keyword), # a stray quote is another syntax element
-
- (r'@?"', String.Double, 'string'),
-
- (r'[~?][a-z][\w\']*:', Name.Variable),
- ],
- 'dotted': [
- (r'\s+', Text),
- (r'\.', Punctuation),
- (r'[A-Z][\w\']*(?=\s*\.)', Name.Namespace),
- (r'[A-Z][\w\']*', Name, '#pop'),
- (r'[a-z_][\w\']*', Name, '#pop'),
- # e.g. dictionary index access
- default('#pop'),
- ],
- 'comment': [
- (r'[^(*)@"]+', Comment),
- (r'\(\*', Comment, '#push'),
- (r'\*\)', Comment, '#pop'),
- # comments cannot be closed within strings in comments
- (r'@"', String, 'lstring'),
- (r'"""', String, 'tqs'),
- (r'"', String, 'string'),
- (r'[(*)@]', Comment),
- ],
- 'string': [
- (r'[^\\"]+', String),
- include('escape-sequence'),
- (r'\\\n', String),
- (r'\n', String), # newlines are allowed in any string
- (r'"B?', String, '#pop'),
- ],
- 'lstring': [
- (r'[^"]+', String),
- (r'\n', String),
- (r'""', String),
- (r'"B?', String, '#pop'),
- ],
- 'tqs': [
- (r'[^"]+', String),
- (r'\n', String),
- (r'"""B?', String, '#pop'),
- (r'"', String),
- ],
- }
diff --git a/pygments/lexers/dsls.py b/pygments/lexers/dsls.py
deleted file mode 100644
index eb338d79..00000000
--- a/pygments/lexers/dsls.py
+++ /dev/null
@@ -1,878 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.dsls
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for various domain-specific languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import ExtendedRegexLexer, RegexLexer, bygroups, words, \
- include, default, this, using, combined
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Literal, Whitespace
-
-__all__ = ['ProtoBufLexer', 'BroLexer', 'PuppetLexer', 'RslLexer',
- 'MscgenLexer', 'VGLLexer', 'AlloyLexer', 'PanLexer',
- 'CrmshLexer', 'ThriftLexer', 'FlatlineLexer', 'SnowballLexer']
-
-
-class ProtoBufLexer(RegexLexer):
- """
- Lexer for `Protocol Buffer <http://code.google.com/p/protobuf/>`_
- definition files.
-
- .. versionadded:: 1.4
- """
-
- name = 'Protocol Buffer'
- aliases = ['protobuf', 'proto']
- filenames = ['*.proto']
-
- tokens = {
- 'root': [
- (r'[ \t]+', Text),
- (r'[,;{}\[\]()<>]', Punctuation),
- (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
- (r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline),
- (words((
- 'import', 'option', 'optional', 'required', 'repeated',
- 'reserved', 'default', 'packed', 'ctype', 'extensions', 'to',
- 'max', 'rpc', 'returns', 'oneof'), prefix=r'\b', suffix=r'\b'),
- Keyword),
- (words((
- 'int32', 'int64', 'uint32', 'uint64', 'sint32', 'sint64',
- 'fixed32', 'fixed64', 'sfixed32', 'sfixed64',
- 'float', 'double', 'bool', 'string', 'bytes'), suffix=r'\b'),
- Keyword.Type),
- (r'(true|false)\b', Keyword.Constant),
- (r'(package)(\s+)', bygroups(Keyword.Namespace, Text), 'package'),
- (r'(message|extend)(\s+)',
- bygroups(Keyword.Declaration, Text), 'message'),
- (r'(enum|group|service)(\s+)',
- bygroups(Keyword.Declaration, Text), 'type'),
- (r'\".*?\"', String),
- (r'\'.*?\'', String),
- (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
- (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
- (r'(\-?(inf|nan))\b', Number.Float),
- (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
- (r'0[0-7]+[LlUu]*', Number.Oct),
- (r'\d+[LlUu]*', Number.Integer),
- (r'[+-=]', Operator),
- (r'([a-zA-Z_][\w.]*)([ \t]*)(=)',
- bygroups(Name.Attribute, Text, Operator)),
- (r'[a-zA-Z_][\w.]*', Name),
- ],
- 'package': [
- (r'[a-zA-Z_]\w*', Name.Namespace, '#pop'),
- default('#pop'),
- ],
- 'message': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop'),
- default('#pop'),
- ],
- 'type': [
- (r'[a-zA-Z_]\w*', Name, '#pop'),
- default('#pop'),
- ],
- }
-
-
-class ThriftLexer(RegexLexer):
- """
- For `Thrift <https://thrift.apache.org/>`__ interface definitions.
-
- .. versionadded:: 2.1
- """
- name = 'Thrift'
- aliases = ['thrift']
- filenames = ['*.thrift']
- mimetypes = ['application/x-thrift']
-
- tokens = {
- 'root': [
- include('whitespace'),
- include('comments'),
- (r'"', String.Double, combined('stringescape', 'dqs')),
- (r'\'', String.Single, combined('stringescape', 'sqs')),
- (r'(namespace)(\s+)',
- bygroups(Keyword.Namespace, Text.Whitespace), 'namespace'),
- (r'(enum|union|struct|service|exception)(\s+)',
- bygroups(Keyword.Declaration, Text.Whitespace), 'class'),
- (r'((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)' # return arguments
- r'((?:[^\W\d]|\$)[\w$]*)' # method name
- r'(\s*)(\()', # signature start
- bygroups(using(this), Name.Function, Text, Operator)),
- include('keywords'),
- include('numbers'),
- (r'[&=]', Operator),
- (r'[:;,{}()<>\[\]]', Punctuation),
- (r'[a-zA-Z_](\.\w|\w)*', Name),
- ],
- 'whitespace': [
- (r'\n', Text.Whitespace),
- (r'\s+', Text.Whitespace),
- ],
- 'comments': [
- (r'#.*$', Comment),
- (r'//.*?\n', Comment),
- (r'/\*[\w\W]*?\*/', Comment.Multiline),
- ],
- 'stringescape': [
- (r'\\([\\nrt"\'])', String.Escape),
- ],
- 'dqs': [
- (r'"', String.Double, '#pop'),
- (r'[^\\"\n]+', String.Double),
- ],
- 'sqs': [
- (r"'", String.Single, '#pop'),
- (r'[^\\\'\n]+', String.Single),
- ],
- 'namespace': [
- (r'[a-z*](\.\w|\w)*', Name.Namespace, '#pop'),
- default('#pop'),
- ],
- 'class': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop'),
- default('#pop'),
- ],
- 'keywords': [
- (r'(async|oneway|extends|throws|required|optional)\b', Keyword),
- (r'(true|false)\b', Keyword.Constant),
- (r'(const|typedef)\b', Keyword.Declaration),
- (words((
- 'cpp_namespace', 'cpp_include', 'cpp_type', 'java_package',
- 'cocoa_prefix', 'csharp_namespace', 'delphi_namespace',
- 'php_namespace', 'py_module', 'perl_package',
- 'ruby_namespace', 'smalltalk_category', 'smalltalk_prefix',
- 'xsd_all', 'xsd_optional', 'xsd_nillable', 'xsd_namespace',
- 'xsd_attrs', 'include'), suffix=r'\b'),
- Keyword.Namespace),
- (words((
- 'void', 'bool', 'byte', 'i16', 'i32', 'i64', 'double',
- 'string', 'binary', 'map', 'list', 'set', 'slist',
- 'senum'), suffix=r'\b'),
- Keyword.Type),
- (words((
- 'BEGIN', 'END', '__CLASS__', '__DIR__', '__FILE__',
- '__FUNCTION__', '__LINE__', '__METHOD__', '__NAMESPACE__',
- 'abstract', 'alias', 'and', 'args', 'as', 'assert', 'begin',
- 'break', 'case', 'catch', 'class', 'clone', 'continue',
- 'declare', 'def', 'default', 'del', 'delete', 'do', 'dynamic',
- 'elif', 'else', 'elseif', 'elsif', 'end', 'enddeclare',
- 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile',
- 'ensure', 'except', 'exec', 'finally', 'float', 'for',
- 'foreach', 'function', 'global', 'goto', 'if', 'implements',
- 'import', 'in', 'inline', 'instanceof', 'interface', 'is',
- 'lambda', 'module', 'native', 'new', 'next', 'nil', 'not',
- 'or', 'pass', 'public', 'print', 'private', 'protected',
- 'raise', 'redo', 'rescue', 'retry', 'register', 'return',
- 'self', 'sizeof', 'static', 'super', 'switch', 'synchronized',
- 'then', 'this', 'throw', 'transient', 'try', 'undef',
- 'unless', 'unsigned', 'until', 'use', 'var', 'virtual',
- 'volatile', 'when', 'while', 'with', 'xor', 'yield'),
- prefix=r'\b', suffix=r'\b'),
- Keyword.Reserved),
- ],
- 'numbers': [
- (r'[+-]?(\d+\.\d+([eE][+-]?\d+)?|\.?\d+[eE][+-]?\d+)', Number.Float),
- (r'[+-]?0x[0-9A-Fa-f]+', Number.Hex),
- (r'[+-]?[0-9]+', Number.Integer),
- ],
- }
-
-
-class BroLexer(RegexLexer):
- """
- For `Bro <http://bro-ids.org/>`_ scripts.
-
- .. versionadded:: 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|hook|local|module|next'
- r'|of|print|redef|return|schedule|switch|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_]\w*', 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)
- ]
- }
-
-
-class PuppetLexer(RegexLexer):
- """
- For `Puppet <http://puppetlabs.com/>`__ configuration DSL.
-
- .. versionadded:: 1.6
- """
- name = 'Puppet'
- aliases = ['puppet']
- filenames = ['*.pp']
-
- tokens = {
- 'root': [
- include('comments'),
- include('keywords'),
- include('names'),
- include('numbers'),
- include('operators'),
- include('strings'),
-
- (r'[]{}:(),;[]', Punctuation),
- (r'[^\S\n]+', Text),
- ],
-
- 'comments': [
- (r'\s*#.*$', Comment),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
- ],
-
- 'operators': [
- (r'(=>|\?|<|>|=|\+|-|/|\*|~|!|\|)', Operator),
- (r'(in|and|or|not)\b', Operator.Word),
- ],
-
- 'names': [
- (r'[a-zA-Z_]\w*', Name.Attribute),
- (r'(\$\S+)(\[)(\S+)(\])', bygroups(Name.Variable, Punctuation,
- String, Punctuation)),
- (r'\$\S+', Name.Variable),
- ],
-
- 'numbers': [
- # Copypasta from the Python lexer
- (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+j?', Number.Integer)
- ],
-
- 'keywords': [
- # Left out 'group' and 'require'
- # Since they're often used as attributes
- (words((
- 'absent', 'alert', 'alias', 'audit', 'augeas', 'before', 'case',
- 'check', 'class', 'computer', 'configured', 'contained',
- 'create_resources', 'crit', 'cron', 'debug', 'default',
- 'define', 'defined', 'directory', 'else', 'elsif', 'emerg',
- 'err', 'exec', 'extlookup', 'fail', 'false', 'file',
- 'filebucket', 'fqdn_rand', 'generate', 'host', 'if', 'import',
- 'include', 'info', 'inherits', 'inline_template', 'installed',
- 'interface', 'k5login', 'latest', 'link', 'loglevel',
- 'macauthorization', 'mailalias', 'maillist', 'mcx', 'md5',
- 'mount', 'mounted', 'nagios_command', 'nagios_contact',
- 'nagios_contactgroup', 'nagios_host', 'nagios_hostdependency',
- 'nagios_hostescalation', 'nagios_hostextinfo', 'nagios_hostgroup',
- 'nagios_service', 'nagios_servicedependency', 'nagios_serviceescalation',
- 'nagios_serviceextinfo', 'nagios_servicegroup', 'nagios_timeperiod',
- 'node', 'noop', 'notice', 'notify', 'package', 'present', 'purged',
- 'realize', 'regsubst', 'resources', 'role', 'router', 'running',
- 'schedule', 'scheduled_task', 'search', 'selboolean', 'selmodule',
- 'service', 'sha1', 'shellquote', 'split', 'sprintf',
- 'ssh_authorized_key', 'sshkey', 'stage', 'stopped', 'subscribe',
- 'tag', 'tagged', 'template', 'tidy', 'true', 'undef', 'unmounted',
- 'user', 'versioncmp', 'vlan', 'warning', 'yumrepo', 'zfs', 'zone',
- 'zpool'), prefix='(?i)', suffix=r'\b'),
- Keyword),
- ],
-
- 'strings': [
- (r'"([^"])*"', String),
- (r"'(\\'|[^'])*'", String),
- ],
-
- }
-
-
-class RslLexer(RegexLexer):
- """
- `RSL <http://en.wikipedia.org/wiki/RAISE>`_ is the formal specification
- language used in RAISE (Rigorous Approach to Industrial Software Engineering)
- method.
-
- .. versionadded:: 2.0
- """
- name = 'RSL'
- aliases = ['rsl']
- filenames = ['*.rsl']
- mimetypes = ['text/rsl']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- (words((
- 'Bool', 'Char', 'Int', 'Nat', 'Real', 'Text', 'Unit', 'abs',
- 'all', 'always', 'any', 'as', 'axiom', 'card', 'case', 'channel',
- 'chaos', 'class', 'devt_relation', 'dom', 'elems', 'else', 'elif',
- 'end', 'exists', 'extend', 'false', 'for', 'hd', 'hide', 'if',
- 'in', 'is', 'inds', 'initialise', 'int', 'inter', 'isin', 'len',
- 'let', 'local', 'ltl_assertion', 'object', 'of', 'out', 'post',
- 'pre', 'read', 'real', 'rng', 'scheme', 'skip', 'stop', 'swap',
- 'then', 'theory', 'test_case', 'tl', 'transition_system', 'true',
- 'type', 'union', 'until', 'use', 'value', 'variable', 'while',
- 'with', 'write', '~isin', '-inflist', '-infset', '-list',
- '-set'), prefix=r'\b', suffix=r'\b'),
- Keyword),
- (r'(variable|value)\b', Keyword.Declaration),
- (r'--.*?\n', Comment),
- (r'<:.*?:>', Comment),
- (r'\{!.*?!\}', Comment),
- (r'/\*.*?\*/', Comment),
- (r'^[ \t]*([\w]+)[ \t]*:[^:]', Name.Function),
- (r'(^[ \t]*)([\w]+)([ \t]*\([\w\s,]*\)[ \t]*)(is|as)',
- bygroups(Text, Name.Function, Text, Keyword)),
- (r'\b[A-Z]\w*\b', Keyword.Type),
- (r'(true|false)\b', Keyword.Constant),
- (r'".*"', String),
- (r'\'.\'', String.Char),
- (r'(><|->|-m->|/\\|<=|<<=|<\.|\|\||\|\^\||-~->|-~m->|\\/|>=|>>|'
- r'\.>|\+\+|-\\|<->|=>|:-|~=|\*\*|<<|>>=|\+>|!!|\|=\||#)',
- Operator),
- (r'[0-9]+\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'0x[0-9a-f]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
- (r'.', Text),
- ],
- }
-
- def analyse_text(text):
- """
- Check for the most common text in the beginning of a RSL file.
- """
- if re.search(r'scheme\s*.*?=\s*class\s*type', text, re.I) is not None:
- return 1.0
-
-
-class MscgenLexer(RegexLexer):
- """
- For `Mscgen <http://www.mcternan.me.uk/mscgen/>`_ files.
-
- .. versionadded:: 1.6
- """
- name = 'Mscgen'
- aliases = ['mscgen', 'msc']
- filenames = ['*.msc']
-
- _var = r'(\w+|"(?:\\"|[^"])*")'
-
- tokens = {
- 'root': [
- (r'msc\b', Keyword.Type),
- # Options
- (r'(hscale|HSCALE|width|WIDTH|wordwraparcs|WORDWRAPARCS'
- r'|arcgradient|ARCGRADIENT)\b', Name.Property),
- # Operators
- (r'(abox|ABOX|rbox|RBOX|box|BOX|note|NOTE)\b', Operator.Word),
- (r'(\.|-|\|){3}', Keyword),
- (r'(?:-|=|\.|:){2}'
- r'|<<=>>|<->|<=>|<<>>|<:>'
- r'|->|=>>|>>|=>|:>|-x|-X'
- r'|<-|<<=|<<|<=|<:|x-|X-|=', Operator),
- # Names
- (r'\*', Name.Builtin),
- (_var, Name.Variable),
- # Other
- (r'\[', Punctuation, 'attrs'),
- (r'\{|\}|,|;', Punctuation),
- include('comments')
- ],
- 'attrs': [
- (r'\]', Punctuation, '#pop'),
- (_var + r'(\s*)(=)(\s*)' + _var,
- bygroups(Name.Attribute, Text.Whitespace, Operator, Text.Whitespace,
- String)),
- (r',', Punctuation),
- include('comments')
- ],
- 'comments': [
- (r'(?://|#).*?\n', Comment.Single),
- (r'/\*(?:.|\n)*?\*/', Comment.Multiline),
- (r'[ \t\r\n]+', Text.Whitespace)
- ]
- }
-
-
-class VGLLexer(RegexLexer):
- """
- For `SampleManager VGL <http://www.thermoscientific.com/samplemanager>`_
- source code.
-
- .. versionadded:: 1.6
- """
- name = 'VGL'
- aliases = ['vgl']
- filenames = ['*.rpf']
-
- flags = re.MULTILINE | re.DOTALL | re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'\{[^}]*\}', Comment.Multiline),
- (r'declare', Keyword.Constant),
- (r'(if|then|else|endif|while|do|endwhile|and|or|prompt|object'
- r'|create|on|line|with|global|routine|value|endroutine|constant'
- r'|global|set|join|library|compile_option|file|exists|create|copy'
- r'|delete|enable|windows|name|notprotected)(?! *[=<>.,()])',
- Keyword),
- (r'(true|false|null|empty|error|locked)', Keyword.Constant),
- (r'[~^*#!%&\[\]()<>|+=:;,./?-]', Operator),
- (r'"[^"]*"', String),
- (r'(\.)([a-z_$][\w$]*)', bygroups(Operator, Name.Attribute)),
- (r'[0-9][0-9]*(\.[0-9]+(e[+\-]?[0-9]+)?)?', Number),
- (r'[a-z_$][\w$]*', Name),
- (r'[\r\n]+', Text),
- (r'\s+', Text)
- ]
- }
-
-
-class AlloyLexer(RegexLexer):
- """
- For `Alloy <http://alloy.mit.edu>`_ source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'Alloy'
- aliases = ['alloy']
- filenames = ['*.als']
- mimetypes = ['text/x-alloy']
-
- flags = re.MULTILINE | re.DOTALL
-
- iden_rex = r'[a-zA-Z_][\w\']*'
- text_tuple = (r'[^\S\n]+', Text)
-
- tokens = {
- 'sig': [
- (r'(extends)\b', Keyword, '#pop'),
- (iden_rex, Name),
- text_tuple,
- (r',', Punctuation),
- (r'\{', Operator, '#pop'),
- ],
- 'module': [
- text_tuple,
- (iden_rex, Name, '#pop'),
- ],
- 'fun': [
- text_tuple,
- (r'\{', Operator, '#pop'),
- (iden_rex, Name, '#pop'),
- ],
- 'root': [
- (r'--.*?$', Comment.Single),
- (r'//.*?$', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- text_tuple,
- (r'(module|open)(\s+)', bygroups(Keyword.Namespace, Text),
- 'module'),
- (r'(sig|enum)(\s+)', bygroups(Keyword.Declaration, Text), 'sig'),
- (r'(iden|univ|none)\b', Keyword.Constant),
- (r'(int|Int)\b', Keyword.Type),
- (r'(this|abstract|extends|set|seq|one|lone|let)\b', Keyword),
- (r'(all|some|no|sum|disj|when|else)\b', Keyword),
- (r'(run|check|for|but|exactly|expect|as)\b', Keyword),
- (r'(and|or|implies|iff|in)\b', Operator.Word),
- (r'(fun|pred|fact|assert)(\s+)', bygroups(Keyword, Text), 'fun'),
- (r'!|#|&&|\+\+|<<|>>|>=|<=>|<=|\.|->', Operator),
- (r'[-+/*%=<>&!^|~{}\[\]().]', Operator),
- (iden_rex, Name),
- (r'[:,]', Punctuation),
- (r'[0-9]+', Number.Integer),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r'\n', Text),
- ]
- }
-
-
-class PanLexer(RegexLexer):
- """
- Lexer for `pan <http://github.com/quattor/pan/>`_ source files.
-
- Based on tcsh lexer.
-
- .. versionadded:: 2.0
- """
-
- name = 'Pan'
- aliases = ['pan']
- filenames = ['*.pan']
-
- tokens = {
- 'root': [
- include('basic'),
- (r'\(', Keyword, 'paren'),
- (r'\{', Keyword, 'curly'),
- include('data'),
- ],
- 'basic': [
- (words((
- 'if', 'for', 'with', 'else', 'type', 'bind', 'while', 'valid', 'final',
- 'prefix', 'unique', 'object', 'foreach', 'include', 'template',
- 'function', 'variable', 'structure', 'extensible', 'declaration'),
- prefix=r'\b', suffix=r'\s*\b'),
- Keyword),
- (words((
- 'file_contents', 'format', 'index', 'length', 'match', 'matches',
- 'replace', 'splice', 'split', 'substr', 'to_lowercase', 'to_uppercase',
- 'debug', 'error', 'traceback', 'deprecated', 'base64_decode',
- 'base64_encode', 'digest', 'escape', 'unescape', 'append', 'create',
- 'first', 'nlist', 'key', 'list', 'merge', 'next', 'prepend', 'is_boolean',
- 'is_defined', 'is_double', 'is_list', 'is_long', 'is_nlist', 'is_null',
- 'is_number', 'is_property', 'is_resource', 'is_string', 'to_boolean',
- 'to_double', 'to_long', 'to_string', 'clone', 'delete', 'exists',
- 'path_exists', 'if_exists', 'return', 'value'),
- prefix=r'\b', suffix=r'\s*\b'),
- Name.Builtin),
- (r'#.*', 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';', Punctuation),
- ],
- 'data': [
- (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
- (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
- (r'\s+', Text),
- (r'[^=\s\[\]{}()$"\'`\\;#]+', Text),
- (r'\d+(?= |\Z)', Number),
- ],
- 'curly': [
- (r'\}', Keyword, '#pop'),
- (r':-', Keyword),
- (r'\w+', Name.Variable),
- (r'[^}:"\'`$]+', Punctuation),
- (r':', Punctuation),
- include('root'),
- ],
- 'paren': [
- (r'\)', Keyword, '#pop'),
- include('root'),
- ],
- }
-
-
-class CrmshLexer(RegexLexer):
- """
- Lexer for `crmsh <http://crmsh.github.io/>`_ configuration files
- for Pacemaker clusters.
-
- .. versionadded:: 2.1
- """
- name = 'Crmsh'
- aliases = ['crmsh', 'pcmk']
- filenames = ['*.crmsh', '*.pcmk']
- mimetypes = []
-
- elem = words((
- 'node', 'primitive', 'group', 'clone', 'ms', 'location',
- 'colocation', 'order', 'fencing_topology', 'rsc_ticket',
- 'rsc_template', 'property', 'rsc_defaults',
- 'op_defaults', 'acl_target', 'acl_group', 'user', 'role',
- 'tag'), suffix=r'(?![\w#$-])')
- sub = words((
- 'params', 'meta', 'operations', 'op', 'rule',
- 'attributes', 'utilization'), suffix=r'(?![\w#$-])')
- acl = words(('read', 'write', 'deny'), suffix=r'(?![\w#$-])')
- bin_rel = words(('and', 'or'), suffix=r'(?![\w#$-])')
- un_ops = words(('defined', 'not_defined'), suffix=r'(?![\w#$-])')
- date_exp = words(('in_range', 'date', 'spec', 'in'), suffix=r'(?![\w#$-])')
- acl_mod = (r'(?:tag|ref|reference|attribute|type|xpath)')
- bin_ops = (r'(?:lt|gt|lte|gte|eq|ne)')
- val_qual = (r'(?:string|version|number)')
- rsc_role_action = (r'(?:Master|Started|Slave|Stopped|'
- r'start|promote|demote|stop)')
-
- tokens = {
- 'root': [
- (r'^#.*\n?', Comment),
- # attr=value (nvpair)
- (r'([\w#$-]+)(=)("(?:""|[^"])*"|\S+)',
- bygroups(Name.Attribute, Punctuation, String)),
- # need this construct, otherwise numeric node ids
- # are matched as scores
- # elem id:
- (r'(node)(\s+)([\w#$-]+)(:)',
- bygroups(Keyword, Whitespace, Name, Punctuation)),
- # scores
- (r'([+-]?([0-9]+|inf)):', Number),
- # keywords (elements and other)
- (elem, Keyword),
- (sub, Keyword),
- (acl, Keyword),
- # binary operators
- (r'(?:%s:)?(%s)(?![\w#$-])' % (val_qual, bin_ops), Operator.Word),
- # other operators
- (bin_rel, Operator.Word),
- (un_ops, Operator.Word),
- (date_exp, Operator.Word),
- # builtin attributes (e.g. #uname)
- (r'#[a-z]+(?![\w#$-])', Name.Builtin),
- # acl_mod:blah
- (r'(%s)(:)("(?:""|[^"])*"|\S+)' % acl_mod,
- bygroups(Keyword, Punctuation, Name)),
- # rsc_id[:(role|action)]
- # NB: this matches all other identifiers
- (r'([\w#$-]+)(?:(:)(%s))?(?![\w#$-])' % rsc_role_action,
- bygroups(Name, Punctuation, Operator.Word)),
- # punctuation
- (r'(\\(?=\n)|[\[\](){}/:@])', Punctuation),
- (r'\s+|\n', Whitespace),
- ],
- }
-
-
-class FlatlineLexer(RegexLexer):
- """
- Lexer for `Flatline <https://github.com/bigmlcom/flatline>`_ expressions.
-
- .. versionadded:: 2.2
- """
- name = 'Flatline'
- aliases = ['flatline']
- filenames = []
- mimetypes = ['text/x-flatline']
-
- special_forms = ('let',)
-
- builtins = (
- "!=", "*", "+", "-", "<", "<=", "=", ">", ">=", "abs", "acos", "all",
- "all-but", "all-with-defaults", "all-with-numeric-default", "and",
- "asin", "atan", "avg", "avg-window", "bin-center", "bin-count", "call",
- "category-count", "ceil", "cond", "cond-window", "cons", "cos", "cosh",
- "count", "diff-window", "div", "ensure-value", "ensure-weighted-value",
- "epoch", "epoch-day", "epoch-fields", "epoch-hour", "epoch-millisecond",
- "epoch-minute", "epoch-month", "epoch-second", "epoch-weekday",
- "epoch-year", "exp", "f", "field", "field-prop", "fields", "filter",
- "first", "floor", "head", "if", "in", "integer", "language", "length",
- "levenshtein", "linear-regression", "list", "ln", "log", "log10", "map",
- "matches", "matches?", "max", "maximum", "md5", "mean", "median", "min",
- "minimum", "missing", "missing-count", "missing?", "missing_count",
- "mod", "mode", "normalize", "not", "nth", "occurrences", "or",
- "percentile", "percentile-label", "population", "population-fraction",
- "pow", "preferred", "preferred?", "quantile-label", "rand", "rand-int",
- "random-value", "re-quote", "real", "replace", "replace-first", "rest",
- "round", "row-number", "segment-label", "sha1", "sha256", "sin", "sinh",
- "sqrt", "square", "standard-deviation", "standard_deviation", "str",
- "subs", "sum", "sum-squares", "sum-window", "sum_squares", "summary",
- "summary-no", "summary-str", "tail", "tan", "tanh", "to-degrees",
- "to-radians", "variance", "vectorize", "weighted-random-value", "window",
- "winnow", "within-percentiles?", "z-score",
- )
-
- valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+'
-
- tokens = {
- 'root': [
- # whitespaces - usually not relevant
- (r'[,\s]+', Text),
-
- # numbers
- (r'-?\d+\.\d+', Number.Float),
- (r'-?\d+', Number.Integer),
- (r'0x-?[a-f\d]+', Number.Hex),
-
- # strings, symbols and characters
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"\\(.|[a-z]+)", String.Char),
-
- # expression template placeholder
- (r'_', String.Symbol),
-
- # highlight the special forms
- (words(special_forms, suffix=' '), Keyword),
-
- # highlight the builtins
- (words(builtins, suffix=' '), Name.Builtin),
-
- # the remaining functions
- (r'(?<=\()' + valid_name, Name.Function),
-
- # find the remaining variables
- (valid_name, Name.Variable),
-
- # parentheses
- (r'(\(|\))', Punctuation),
- ],
- }
-
-
-class SnowballLexer(ExtendedRegexLexer):
- """
- Lexer for `Snowball <http://snowballstem.org/>`_ source code.
-
- .. versionadded:: 2.2
- """
-
- name = 'Snowball'
- aliases = ['snowball']
- filenames = ['*.sbl']
-
- _ws = r'\n\r\t '
-
- def __init__(self, **options):
- self._reset_stringescapes()
- ExtendedRegexLexer.__init__(self, **options)
-
- def _reset_stringescapes(self):
- self._start = "'"
- self._end = "'"
-
- def _string(do_string_first):
- def callback(lexer, match, ctx):
- s = match.start()
- text = match.group()
- string = re.compile(r'([^%s]*)(.)' % re.escape(lexer._start)).match
- escape = re.compile(r'([^%s]*)(.)' % re.escape(lexer._end)).match
- pos = 0
- do_string = do_string_first
- while pos < len(text):
- if do_string:
- match = string(text, pos)
- yield s + match.start(1), String.Single, match.group(1)
- if match.group(2) == "'":
- yield s + match.start(2), String.Single, match.group(2)
- ctx.stack.pop()
- break
- yield s + match.start(2), String.Escape, match.group(2)
- pos = match.end()
- match = escape(text, pos)
- yield s + match.start(), String.Escape, match.group()
- if match.group(2) != lexer._end:
- ctx.stack[-1] = 'escape'
- break
- pos = match.end()
- do_string = True
- ctx.pos = s + match.end()
- return callback
-
- def _stringescapes(lexer, match, ctx):
- lexer._start = match.group(3)
- lexer._end = match.group(5)
- return bygroups(Keyword.Reserved, Text, String.Escape, Text,
- String.Escape)(lexer, match, ctx)
-
- tokens = {
- 'root': [
- (words(('len', 'lenof'), suffix=r'\b'), Operator.Word),
- include('root1'),
- ],
- 'root1': [
- (r'[%s]+' % _ws, Text),
- (r'\d+', Number.Integer),
- (r"'", String.Single, 'string'),
- (r'[()]', Punctuation),
- (r'/\*[\w\W]*?\*/', Comment.Multiline),
- (r'//.*', Comment.Single),
- (r'[!*+\-/<=>]=|[-=]>|<[+-]|[$*+\-/<=>?\[\]]', Operator),
- (words(('as', 'get', 'hex', 'among', 'define', 'decimal',
- 'backwardmode'), suffix=r'\b'),
- Keyword.Reserved),
- (words(('strings', 'booleans', 'integers', 'routines', 'externals',
- 'groupings'), suffix=r'\b'),
- Keyword.Reserved, 'declaration'),
- (words(('do', 'or', 'and', 'for', 'hop', 'non', 'not', 'set', 'try',
- 'fail', 'goto', 'loop', 'next', 'test', 'true',
- 'false', 'unset', 'atmark', 'attach', 'delete', 'gopast',
- 'insert', 'repeat', 'sizeof', 'tomark', 'atleast',
- 'atlimit', 'reverse', 'setmark', 'tolimit', 'setlimit',
- 'backwards', 'substring'), suffix=r'\b'),
- Operator.Word),
- (words(('size', 'limit', 'cursor', 'maxint', 'minint'),
- suffix=r'\b'),
- Name.Builtin),
- (r'(stringdef\b)([%s]*)([^%s]+)' % (_ws, _ws),
- bygroups(Keyword.Reserved, Text, String.Escape)),
- (r'(stringescapes\b)([%s]*)(.)([%s]*)(.)' % (_ws, _ws),
- _stringescapes),
- (r'[A-Za-z]\w*', Name),
- ],
- 'declaration': [
- (r'\)', Punctuation, '#pop'),
- (words(('len', 'lenof'), suffix=r'\b'), Name,
- ('root1', 'declaration')),
- include('root1'),
- ],
- 'string': [
- (r"[^']*'", _string(True)),
- ],
- 'escape': [
- (r"[^']*'", _string(False)),
- ],
- }
-
- def get_tokens_unprocessed(self, text=None, context=None):
- self._reset_stringescapes()
- return ExtendedRegexLexer.get_tokens_unprocessed(self, text, context)
diff --git a/pygments/lexers/dylan.py b/pygments/lexers/dylan.py
deleted file mode 100644
index b9a13e27..00000000
--- a/pygments/lexers/dylan.py
+++ /dev/null
@@ -1,289 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.dylan
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Dylan language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic, Literal
-
-__all__ = ['DylanLexer', 'DylanConsoleLexer', 'DylanLidLexer']
-
-
-class DylanLexer(RegexLexer):
- """
- For the `Dylan <http://www.opendylan.org/>`_ language.
-
- .. versionadded:: 0.7
- """
-
- name = 'Dylan'
- aliases = ['dylan']
- filenames = ['*.dylan', '*.dyl', '*.intr']
- mimetypes = ['text/x-dylan']
-
- flags = re.IGNORECASE
-
- builtins = set((
- 'subclass', 'abstract', 'block', 'concrete', 'constant', 'class',
- 'compiler-open', 'compiler-sideways', 'domain', 'dynamic',
- 'each-subclass', 'exception', 'exclude', 'function', 'generic',
- 'handler', 'inherited', 'inline', 'inline-only', 'instance',
- 'interface', 'import', 'keyword', 'library', 'macro', 'method',
- 'module', 'open', 'primary', 'required', 'sealed', 'sideways',
- 'singleton', 'slot', 'thread', 'variable', 'virtual'))
-
- keywords = set((
- 'above', 'afterwards', 'begin', 'below', 'by', 'case', 'cleanup',
- 'create', 'define', 'else', 'elseif', 'end', 'export', 'finally',
- 'for', 'from', 'if', 'in', 'let', 'local', 'otherwise', 'rename',
- 'select', 'signal', 'then', 'to', 'unless', 'until', 'use', 'when',
- 'while'))
-
- operators = set((
- '~', '+', '-', '*', '|', '^', '=', '==', '~=', '~==', '<', '<=',
- '>', '>=', '&', '|'))
-
- functions = set((
- 'abort', 'abs', 'add', 'add!', 'add-method', 'add-new', 'add-new!',
- 'all-superclasses', 'always', 'any?', 'applicable-method?', 'apply',
- 'aref', 'aref-setter', 'as', 'as-lowercase', 'as-lowercase!',
- 'as-uppercase', 'as-uppercase!', 'ash', 'backward-iteration-protocol',
- 'break', 'ceiling', 'ceiling/', 'cerror', 'check-type', 'choose',
- 'choose-by', 'complement', 'compose', 'concatenate', 'concatenate-as',
- 'condition-format-arguments', 'condition-format-string', 'conjoin',
- 'copy-sequence', 'curry', 'default-handler', 'dimension', 'dimensions',
- 'direct-subclasses', 'direct-superclasses', 'disjoin', 'do',
- 'do-handlers', 'element', 'element-setter', 'empty?', 'error', 'even?',
- 'every?', 'false-or', 'fill!', 'find-key', 'find-method', 'first',
- 'first-setter', 'floor', 'floor/', 'forward-iteration-protocol',
- 'function-arguments', 'function-return-values',
- 'function-specializers', 'gcd', 'generic-function-mandatory-keywords',
- 'generic-function-methods', 'head', 'head-setter', 'identity',
- 'initialize', 'instance?', 'integral?', 'intersection',
- 'key-sequence', 'key-test', 'last', 'last-setter', 'lcm', 'limited',
- 'list', 'logand', 'logbit?', 'logior', 'lognot', 'logxor', 'make',
- 'map', 'map-as', 'map-into', 'max', 'member?', 'merge-hash-codes',
- 'min', 'modulo', 'negative', 'negative?', 'next-method',
- 'object-class', 'object-hash', 'odd?', 'one-of', 'pair', 'pop',
- 'pop-last', 'positive?', 'push', 'push-last', 'range', 'rank',
- 'rcurry', 'reduce', 'reduce1', 'remainder', 'remove', 'remove!',
- 'remove-duplicates', 'remove-duplicates!', 'remove-key!',
- 'remove-method', 'replace-elements!', 'replace-subsequence!',
- 'restart-query', 'return-allowed?', 'return-description',
- 'return-query', 'reverse', 'reverse!', 'round', 'round/',
- 'row-major-index', 'second', 'second-setter', 'shallow-copy',
- 'signal', 'singleton', 'size', 'size-setter', 'slot-initialized?',
- 'sort', 'sort!', 'sorted-applicable-methods', 'subsequence-position',
- 'subtype?', 'table-protocol', 'tail', 'tail-setter', 'third',
- 'third-setter', 'truncate', 'truncate/', 'type-error-expected-type',
- 'type-error-value', 'type-for-copy', 'type-union', 'union', 'values',
- 'vector', 'zero?'))
-
- valid_name = '\\\\?[\\w!&*<>|^$%@\\-+~?/=]+'
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in RegexLexer.get_tokens_unprocessed(self, text):
- if token is Name:
- lowercase_value = value.lower()
- if lowercase_value in self.builtins:
- yield index, Name.Builtin, value
- continue
- if lowercase_value in self.keywords:
- yield index, Keyword, value
- continue
- if lowercase_value in self.functions:
- yield index, Name.Builtin, value
- continue
- if lowercase_value in self.operators:
- yield index, Operator, value
- continue
- yield index, token, value
-
- tokens = {
- 'root': [
- # Whitespace
- (r'\s+', Text),
-
- # single line comment
- (r'//.*?\n', Comment.Single),
-
- # lid header
- (r'([a-z0-9-]+)(:)([ \t]*)(.*(?:\n[ \t].+)*)',
- bygroups(Name.Attribute, Operator, Text, String)),
-
- default('code') # no header match, switch to code
- ],
- 'code': [
- # Whitespace
- (r'\s+', Text),
-
- # single line comment
- (r'//.*?\n', Comment.Single),
-
- # multi-line comment
- (r'/\*', Comment.Multiline, 'comment'),
-
- # strings and characters
- (r'"', String, 'string'),
- (r"'(\\.|\\[0-7]{1,3}|\\x[a-f0-9]{1,2}|[^\\\'\n])'", String.Char),
-
- # binary integer
- (r'#b[01]+', Number.Bin),
-
- # octal integer
- (r'#o[0-7]+', Number.Oct),
-
- # floating point
- (r'[-+]?(\d*\.\d+(e[-+]?\d+)?|\d+(\.\d*)?e[-+]?\d+)', Number.Float),
-
- # decimal integer
- (r'[-+]?\d+', Number.Integer),
-
- # hex integer
- (r'#x[0-9a-f]+', Number.Hex),
-
- # Macro parameters
- (r'(\?' + valid_name + ')(:)'
- r'(token|name|variable|expression|body|case-body|\*)',
- bygroups(Name.Tag, Operator, Name.Builtin)),
- (r'(\?)(:)(token|name|variable|expression|body|case-body|\*)',
- bygroups(Name.Tag, Operator, Name.Builtin)),
- (r'\?' + valid_name, Name.Tag),
-
- # Punctuation
- (r'(=>|::|#\(|#\[|##|\?\?|\?=|\?|[(){}\[\],.;])', Punctuation),
-
- # Most operators are picked up as names and then re-flagged.
- # This one isn't valid in a name though, so we pick it up now.
- (r':=', Operator),
-
- # Pick up #t / #f before we match other stuff with #.
- (r'#[tf]', Literal),
-
- # #"foo" style keywords
- (r'#"', String.Symbol, 'keyword'),
-
- # #rest, #key, #all-keys, etc.
- (r'#[a-z0-9-]+', Keyword),
-
- # required-init-keyword: style keywords.
- (valid_name + ':', Keyword),
-
- # class names
- ('<' + valid_name + '>', Name.Class),
-
- # define variable forms.
- (r'\*' + valid_name + r'\*', Name.Variable.Global),
-
- # define constant forms.
- (r'\$' + valid_name, Name.Constant),
-
- # everything else. We re-flag some of these in the method above.
- (valid_name, Name),
- ],
- 'comment': [
- (r'[^*/]', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ],
- 'keyword': [
- (r'"', String.Symbol, '#pop'),
- (r'[^\\"]+', String.Symbol), # all other characters
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r'\\([\\abfnrtv"\']|x[a-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
- ]
- }
-
-
-class DylanLidLexer(RegexLexer):
- """
- For Dylan LID (Library Interchange Definition) files.
-
- .. versionadded:: 1.6
- """
-
- name = 'DylanLID'
- aliases = ['dylan-lid', 'lid']
- filenames = ['*.lid', '*.hdp']
- mimetypes = ['text/x-dylan-lid']
-
- flags = re.IGNORECASE
-
- tokens = {
- 'root': [
- # Whitespace
- (r'\s+', Text),
-
- # single line comment
- (r'//.*?\n', Comment.Single),
-
- # lid header
- (r'(.*?)(:)([ \t]*)(.*(?:\n[ \t].+)*)',
- bygroups(Name.Attribute, Operator, Text, String)),
- ]
- }
-
-
-class DylanConsoleLexer(Lexer):
- """
- For Dylan interactive console output like:
-
- .. sourcecode:: dylan-console
-
- ? let a = 1;
- => 1
- ? a
- => 1
-
- This is based on a copy of the RubyConsoleLexer.
-
- .. versionadded:: 1.6
- """
- name = 'Dylan session'
- aliases = ['dylan-console', 'dylan-repl']
- filenames = ['*.dylan-console']
- mimetypes = ['text/x-dylan-console']
-
- _line_re = re.compile('.*?\n')
- _prompt_re = re.compile(r'\?| ')
-
- def get_tokens_unprocessed(self, text):
- dylexer = DylanLexer(**self.options)
-
- curcode = ''
- insertions = []
- for match in self._line_re.finditer(text):
- line = match.group()
- 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,
- dylexer.get_tokens_unprocessed(curcode)):
- yield item
- curcode = ''
- insertions = []
- yield match.start(), Generic.Output, line
- if curcode:
- for item in do_insertions(insertions,
- dylexer.get_tokens_unprocessed(curcode)):
- yield item
diff --git a/pygments/lexers/ecl.py b/pygments/lexers/ecl.py
deleted file mode 100644
index c695c18c..00000000
--- a/pygments/lexers/ecl.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.ecl
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for the ECL language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-
-__all__ = ['ECLLexer']
-
-
-class ECLLexer(RegexLexer):
- """
- Lexer for the declarative big-data `ECL
- <http://hpccsystems.com/community/docs/ecl-language-reference/html>`_
- language.
-
- .. versionadded:: 1.5
- """
-
- name = 'ECL'
- aliases = ['ecl']
- filenames = ['*.ecl']
- mimetypes = ['application/x-ecl']
-
- flags = re.IGNORECASE | re.MULTILINE
-
- tokens = {
- 'root': [
- include('whitespace'),
- include('statements'),
- ],
- 'whitespace': [
- (r'\s+', Text),
- (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+)e[+-]?\d+[lu]*', Number.Float),
- (r'(\d+\.\d*|\.\d+|\d+f)f?', Number.Float),
- (r'0x[0-9a-f]+[lu]*', Number.Hex),
- (r'0[0-7]+[lu]*', Number.Oct),
- (r'\d+[lu]*', Number.Integer),
- (r'\*/', Error),
- (r'[~!%^&*+=|?:<>/-]+', Operator),
- (r'[{}()\[\],.;]', Punctuation),
- (r'[a-z_]\w*', Name),
- ],
- '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': [
- (words((
- 'APPLY', 'ASSERT', 'BUILD', 'BUILDINDEX', 'EVALUATE', 'FAIL',
- 'KEYDIFF', 'KEYPATCH', 'LOADXML', 'NOTHOR', 'NOTIFY', 'OUTPUT',
- 'PARALLEL', 'SEQUENTIAL', 'SOAPCALL', 'CHECKPOINT', 'DEPRECATED',
- 'FAILCODE', 'FAILMESSAGE', 'FAILURE', 'GLOBAL', 'INDEPENDENT',
- 'ONWARNING', 'PERSIST', 'PRIORITY', 'RECOVERY', 'STORED', 'SUCCESS',
- 'WAIT', 'WHEN'), suffix=r'\b'),
- Keyword.Reserved),
- # These are classed differently, check later
- (words((
- 'ALL', 'AND', 'ANY', 'AS', 'ATMOST', 'BEFORE', 'BEGINC++', 'BEST', 'BETWEEN', 'CASE',
- 'CONST', 'COUNTER', 'CSV', 'DESCEND', 'ENCRYPT', 'ENDC++', 'ENDMACRO', 'EXCEPT',
- 'EXCLUSIVE', 'EXPIRE', 'EXPORT', 'EXTEND', 'FALSE', 'FEW', 'FIRST', 'FLAT', 'FULL',
- 'FUNCTION', 'GROUP', 'HEADER', 'HEADING', 'HOLE', 'IFBLOCK', 'IMPORT', 'IN', 'JOINED',
- 'KEEP', 'KEYED', 'LAST', 'LEFT', 'LIMIT', 'LOAD', 'LOCAL', 'LOCALE', 'LOOKUP', 'MACRO',
- 'MANY', 'MAXCOUNT', 'MAXLENGTH', 'MIN SKEW', 'MODULE', 'INTERFACE', 'NAMED', 'NOCASE',
- 'NOROOT', 'NOSCAN', 'NOSORT', 'NOT', 'OF', 'ONLY', 'OPT', 'OR', 'OUTER', 'OVERWRITE',
- 'PACKED', 'PARTITION', 'PENALTY', 'PHYSICALLENGTH', 'PIPE', 'QUOTE', 'RELATIONSHIP',
- 'REPEAT', 'RETURN', 'RIGHT', 'SCAN', 'SELF', 'SEPARATOR', 'SERVICE', 'SHARED', 'SKEW',
- 'SKIP', 'SQL', 'STORE', 'TERMINATOR', 'THOR', 'THRESHOLD', 'TOKEN', 'TRANSFORM', 'TRIM',
- 'TRUE', 'TYPE', 'UNICODEORDER', 'UNSORTED', 'VALIDATE', 'VIRTUAL', 'WHOLE', 'WILD',
- 'WITHIN', 'XML', 'XPATH', '__COMPRESSED__'), suffix=r'\b'),
- Keyword.Reserved),
- ],
- 'functions': [
- (words((
- 'ABS', 'ACOS', 'ALLNODES', 'ASCII', 'ASIN', 'ASSTRING', 'ATAN', 'ATAN2', 'AVE', 'CASE',
- 'CHOOSE', 'CHOOSEN', 'CHOOSESETS', 'CLUSTERSIZE', 'COMBINE', 'CORRELATION', 'COS',
- 'COSH', 'COUNT', 'COVARIANCE', 'CRON', 'DATASET', 'DEDUP', 'DEFINE', 'DENORMALIZE',
- 'DISTRIBUTE', 'DISTRIBUTED', 'DISTRIBUTION', 'EBCDIC', 'ENTH', 'ERROR', 'EVALUATE',
- 'EVENT', 'EVENTEXTRA', 'EVENTNAME', 'EXISTS', 'EXP', 'FAILCODE', 'FAILMESSAGE',
- 'FETCH', 'FROMUNICODE', 'GETISVALID', 'GLOBAL', 'GRAPH', 'GROUP', 'HASH', 'HASH32',
- 'HASH64', 'HASHCRC', 'HASHMD5', 'HAVING', 'IF', 'INDEX', 'INTFORMAT', 'ISVALID',
- 'ITERATE', 'JOIN', 'KEYUNICODE', 'LENGTH', 'LIBRARY', 'LIMIT', 'LN', 'LOCAL', 'LOG', 'LOOP',
- 'MAP', 'MATCHED', 'MATCHLENGTH', 'MATCHPOSITION', 'MATCHTEXT', 'MATCHUNICODE',
- 'MAX', 'MERGE', 'MERGEJOIN', 'MIN', 'NOLOCAL', 'NONEMPTY', 'NORMALIZE', 'PARSE', 'PIPE',
- 'POWER', 'PRELOAD', 'PROCESS', 'PROJECT', 'PULL', 'RANDOM', 'RANGE', 'RANK', 'RANKED',
- 'REALFORMAT', 'RECORDOF', 'REGEXFIND', 'REGEXREPLACE', 'REGROUP', 'REJECTED',
- 'ROLLUP', 'ROUND', 'ROUNDUP', 'ROW', 'ROWDIFF', 'SAMPLE', 'SET', 'SIN', 'SINH', 'SIZEOF',
- 'SOAPCALL', 'SORT', 'SORTED', 'SQRT', 'STEPPED', 'STORED', 'SUM', 'TABLE', 'TAN', 'TANH',
- 'THISNODE', 'TOPN', 'TOUNICODE', 'TRANSFER', 'TRIM', 'TRUNCATE', 'TYPEOF', 'UNGROUP',
- 'UNICODEORDER', 'VARIANCE', 'WHICH', 'WORKUNIT', 'XMLDECODE', 'XMLENCODE',
- 'XMLTEXT', 'XMLUNICODE'), suffix=r'\b'),
- Name.Function),
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r'\'', String, '#pop'),
- (r'[^"\']+', String),
- ],
- }
diff --git a/pygments/lexers/eiffel.py b/pygments/lexers/eiffel.py
deleted file mode 100644
index 3f7ce55d..00000000
--- a/pygments/lexers/eiffel.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.eiffel
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Eiffel language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['EiffelLexer']
-
-
-class EiffelLexer(RegexLexer):
- """
- For `Eiffel <http://www.eiffel.com>`_ source code.
-
- .. versionadded:: 2.0
- """
- name = 'Eiffel'
- aliases = ['eiffel']
- filenames = ['*.e']
- mimetypes = ['text/x-eiffel']
-
- tokens = {
- 'root': [
- (r'[^\S\n]+', Text),
- (r'--.*?\n', Comment.Single),
- (r'[^\S\n]+', Text),
- # Please note that keyword and operator are case insensitive.
- (r'(?i)(true|false|void|current|result|precursor)\b', Keyword.Constant),
- (r'(?i)(and(\s+then)?|not|xor|implies|or(\s+else)?)\b', Operator.Word),
- (words((
- 'across', 'agent', 'alias', 'all', 'as', 'assign', 'attached',
- 'attribute', 'check', 'class', 'convert', 'create', 'debug',
- 'deferred', 'detachable', 'do', 'else', 'elseif', 'end', 'ensure',
- 'expanded', 'export', 'external', 'feature', 'from', 'frozen', 'if',
- 'inherit', 'inspect', 'invariant', 'like', 'local', 'loop', 'none',
- 'note', 'obsolete', 'old', 'once', 'only', 'redefine', 'rename',
- 'require', 'rescue', 'retry', 'select', 'separate', 'then',
- 'undefine', 'until', 'variant', 'when'), prefix=r'(?i)\b', suffix=r'\b'),
- Keyword.Reserved),
- (r'"\[(([^\]%]|\n)|%(.|\n)|\][^"])*?\]"', String),
- (r'"([^"%\n]|%.)*?"', String),
- include('numbers'),
- (r"'([^'%]|%'|%%)'", String.Char),
- (r"(//|\\\\|>=|<=|:=|/=|~|/~|[\\?!#%&@|+/\-=>*$<^\[\]])", Operator),
- (r"([{}():;,.])", Punctuation),
- (r'([a-z]\w*)|([A-Z][A-Z0-9_]*[a-z]\w*)', Name),
- (r'([A-Z][A-Z0-9_]*)', Name.Class),
- (r'\n+', Text),
- ],
- 'numbers': [
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
- (r'0[bB][01]+', Number.Bin),
- (r'0[cC][0-7]+', Number.Oct),
- (r'([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)', Number.Float),
- (r'[0-9]+', Number.Integer),
- ],
- }
diff --git a/pygments/lexers/elm.py b/pygments/lexers/elm.py
deleted file mode 100644
index 86dafc7c..00000000
--- a/pygments/lexers/elm.py
+++ /dev/null
@@ -1,121 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.elm
- ~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Elm programming language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, words, include
-from pygments.token import Comment, Keyword, Name, Number, Punctuation, String, Text
-
-__all__ = ['ElmLexer']
-
-
-class ElmLexer(RegexLexer):
- """
- For `Elm <http://elm-lang.org/>`_ source code.
-
- .. versionadded:: 2.1
- """
-
- name = 'Elm'
- aliases = ['elm']
- filenames = ['*.elm']
- mimetypes = ['text/x-elm']
-
- validName = r'[a-z_][a-zA-Z0-9_\']*'
-
- specialName = r'^main '
-
- builtinOps = (
- '~', '||', '|>', '|', '`', '^', '\\', '\'', '>>', '>=', '>', '==',
- '=', '<~', '<|', '<=', '<<', '<-', '<', '::', ':', '/=', '//', '/',
- '..', '.', '->', '-', '++', '+', '*', '&&', '%',
- )
-
- reservedWords = words((
- 'alias', 'as', 'case', 'else', 'if', 'import', 'in',
- 'let', 'module', 'of', 'port', 'then', 'type', 'where',
- ), suffix=r'\b')
-
- tokens = {
- 'root': [
-
- # Comments
- (r'\{-', Comment.Multiline, 'comment'),
- (r'--.*', Comment.Single),
-
- # Whitespace
- (r'\s+', Text),
-
- # Strings
- (r'"', String, 'doublequote'),
-
- # Modules
- (r'^\s*module\s*', Keyword.Namespace, 'imports'),
-
- # Imports
- (r'^\s*import\s*', Keyword.Namespace, 'imports'),
-
- # Shaders
- (r'\[glsl\|.*', Name.Entity, 'shader'),
-
- # Keywords
- (reservedWords, Keyword.Reserved),
-
- # Types
- (r'[A-Z]\w*', Keyword.Type),
-
- # Main
- (specialName, Keyword.Reserved),
-
- # Prefix Operators
- (words((builtinOps), prefix=r'\(', suffix=r'\)'), Name.Function),
-
- # Infix Operators
- (words((builtinOps)), Name.Function),
-
- # Numbers
- include('numbers'),
-
- # Variable Names
- (validName, Name.Variable),
-
- # Parens
- (r'[,()\[\]{}]', Punctuation),
-
- ],
-
- 'comment': [
- (r'-(?!\})', Comment.Multiline),
- (r'\{-', Comment.Multiline, 'comment'),
- (r'[^-}]', Comment.Multiline),
- (r'-\}', Comment.Multiline, '#pop'),
- ],
-
- 'doublequote': [
- (r'\\u[0-9a-fA-F]{4}', String.Escape),
- (r'\\[nrfvb\\"]', String.Escape),
- (r'[^"]', String),
- (r'"', String, '#pop'),
- ],
-
- 'imports': [
- (r'\w+(\.\w+)*', Name.Class, '#pop'),
- ],
-
- 'numbers': [
- (r'_?\d+\.(?=\d+)', Number.Float),
- (r'_?\d+', Number.Integer),
- ],
-
- 'shader': [
- (r'\|(?!\])', Name.Entity),
- (r'\|\]', Name.Entity, '#pop'),
- (r'.*\n', Name.Entity),
- ],
- }
diff --git a/pygments/lexers/erlang.py b/pygments/lexers/erlang.py
deleted file mode 100644
index 07a46c80..00000000
--- a/pygments/lexers/erlang.py
+++ /dev/null
@@ -1,533 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.erlang
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Erlang.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions, \
- include, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic
-
-__all__ = ['ErlangLexer', 'ErlangShellLexer', 'ElixirConsoleLexer',
- 'ElixirLexer']
-
-
-line_re = re.compile('.*?\n')
-
-
-class ErlangLexer(RegexLexer):
- """
- For the Erlang functional programming language.
-
- Blame Jeremy Thurgood (http://jerith.za.net/).
-
- .. versionadded:: 0.9
- """
-
- name = 'Erlang'
- aliases = ['erlang']
- filenames = ['*.erl', '*.hrl', '*.es', '*.escript']
- mimetypes = ['text/x-erlang']
-
- keywords = (
- 'after', 'begin', 'case', 'catch', 'cond', 'end', 'fun', 'if',
- 'let', 'of', 'query', 'receive', 'try', 'when',
- )
-
- builtins = ( # See erlang(3) man page
- 'abs', 'append_element', 'apply', 'atom_to_list', 'binary_to_list',
- 'bitstring_to_list', 'binary_to_term', 'bit_size', 'bump_reductions',
- 'byte_size', 'cancel_timer', 'check_process_code', 'delete_module',
- 'demonitor', 'disconnect_node', 'display', 'element', 'erase', 'exit',
- 'float', 'float_to_list', 'fun_info', 'fun_to_list',
- 'function_exported', 'garbage_collect', 'get', 'get_keys',
- 'group_leader', 'hash', 'hd', 'integer_to_list', 'iolist_to_binary',
- 'iolist_size', 'is_atom', 'is_binary', 'is_bitstring', 'is_boolean',
- 'is_builtin', 'is_float', 'is_function', 'is_integer', 'is_list',
- 'is_number', 'is_pid', 'is_port', 'is_process_alive', 'is_record',
- 'is_reference', 'is_tuple', 'length', 'link', 'list_to_atom',
- 'list_to_binary', 'list_to_bitstring', 'list_to_existing_atom',
- 'list_to_float', 'list_to_integer', 'list_to_pid', 'list_to_tuple',
- 'load_module', 'localtime_to_universaltime', 'make_tuple', 'md5',
- 'md5_final', 'md5_update', 'memory', 'module_loaded', 'monitor',
- 'monitor_node', 'node', 'nodes', 'open_port', 'phash', 'phash2',
- 'pid_to_list', 'port_close', 'port_command', 'port_connect',
- 'port_control', 'port_call', 'port_info', 'port_to_list',
- 'process_display', 'process_flag', 'process_info', 'purge_module',
- 'put', 'read_timer', 'ref_to_list', 'register', 'resume_process',
- 'round', 'send', 'send_after', 'send_nosuspend', 'set_cookie',
- 'setelement', 'size', 'spawn', 'spawn_link', 'spawn_monitor',
- 'spawn_opt', 'split_binary', 'start_timer', 'statistics',
- 'suspend_process', 'system_flag', 'system_info', 'system_monitor',
- 'system_profile', 'term_to_binary', 'tl', 'trace', 'trace_delivered',
- 'trace_info', 'trace_pattern', 'trunc', 'tuple_size', 'tuple_to_list',
- 'universaltime_to_localtime', 'unlink', 'unregister', 'whereis'
- )
-
- operators = r'(\+\+?|--?|\*|/|<|>|/=|=:=|=/=|=<|>=|==?|<-|!|\?)'
- word_operators = (
- 'and', 'andalso', 'band', 'bnot', 'bor', 'bsl', 'bsr', 'bxor',
- 'div', 'not', 'or', 'orelse', 'rem', 'xor'
- )
-
- atom_re = r"(?:[a-z]\w*|'[^\n']*[^\\]')"
-
- variable_re = r'(?:[A-Z_]\w*)'
-
- esc_char_re = r'[bdefnrstv\'"\\]'
- esc_octal_re = r'[0-7][0-7]?[0-7]?'
- esc_hex_re = r'(?:x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\})'
- esc_ctrl_re = r'\^[a-zA-Z]'
- escape_re = r'(?:\\(?:'+esc_char_re+r'|'+esc_octal_re+r'|'+esc_hex_re+r'|'+esc_ctrl_re+r'))'
-
- macro_re = r'(?:'+variable_re+r'|'+atom_re+r')'
-
- base_re = r'(?:[2-9]|[12][0-9]|3[0-6])'
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'%.*\n', Comment),
- (words(keywords, suffix=r'\b'), Keyword),
- (words(builtins, suffix=r'\b'), Name.Builtin),
- (words(word_operators, suffix=r'\b'), Operator.Word),
- (r'^-', Punctuation, 'directive'),
- (operators, Operator),
- (r'"', String, 'string'),
- (r'<<', Name.Label),
- (r'>>', Name.Label),
- ('(' + atom_re + ')(:)', bygroups(Name.Namespace, Punctuation)),
- ('(?:^|(?<=:))(' + atom_re + r')(\s*)(\()',
- bygroups(Name.Function, Text, Punctuation)),
- (r'[+-]?' + base_re + r'#[0-9a-zA-Z]+', Number.Integer),
- (r'[+-]?\d+', Number.Integer),
- (r'[+-]?\d+.\d+', Number.Float),
- (r'[]\[:_@\".{}()|;,]', Punctuation),
- (variable_re, Name.Variable),
- (atom_re, Name),
- (r'\?'+macro_re, Name.Constant),
- (r'\$(?:'+escape_re+r'|\\[ %]|[^\\])', String.Char),
- (r'#'+atom_re+r'(:?\.'+atom_re+r')?', Name.Label),
-
- # Erlang script shebang
- (r'\A#!.+\n', Comment.Hashbang),
-
- # EEP 43: Maps
- # http://www.erlang.org/eeps/eep-0043.html
- (r'#\{', Punctuation, 'map_key'),
- ],
- 'string': [
- (escape_re, String.Escape),
- (r'"', String, '#pop'),
- (r'~[0-9.*]*[~#+BPWXb-ginpswx]', String.Interpol),
- (r'[^"\\~]+', String),
- (r'~', String),
- ],
- 'directive': [
- (r'(define)(\s*)(\()('+macro_re+r')',
- bygroups(Name.Entity, Text, Punctuation, Name.Constant), '#pop'),
- (r'(record)(\s*)(\()('+macro_re+r')',
- bygroups(Name.Entity, Text, Punctuation, Name.Label), '#pop'),
- (atom_re, Name.Entity, '#pop'),
- ],
- 'map_key': [
- include('root'),
- (r'=>', Punctuation, 'map_val'),
- (r':=', Punctuation, 'map_val'),
- (r'\}', Punctuation, '#pop'),
- ],
- 'map_val': [
- include('root'),
- (r',', Punctuation, '#pop'),
- (r'(?=\})', Punctuation, '#pop'),
- ],
- }
-
-
-class ErlangShellLexer(Lexer):
- """
- Shell sessions in erl (for Erlang code).
-
- .. versionadded:: 1.1
- """
- name = 'Erlang erl session'
- aliases = ['erl']
- filenames = ['*.erl-sh']
- mimetypes = ['text/x-erl-shellsession']
-
- _prompt_re = re.compile(r'(?:\([\w@_.]+\))?\d+>(?=\s|\Z)')
-
- def get_tokens_unprocessed(self, text):
- erlexer = ErlangLexer(**self.options)
-
- curcode = ''
- insertions = []
- for match in line_re.finditer(text):
- line = match.group()
- 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,
- erlexer.get_tokens_unprocessed(curcode)):
- yield item
- curcode = ''
- insertions = []
- if line.startswith('*'):
- yield match.start(), Generic.Traceback, line
- else:
- yield match.start(), Generic.Output, line
- if curcode:
- for item in do_insertions(insertions,
- erlexer.get_tokens_unprocessed(curcode)):
- yield item
-
-
-def gen_elixir_string_rules(name, symbol, token):
- states = {}
- states['string_' + name] = [
- (r'[^#%s\\]+' % (symbol,), token),
- include('escapes'),
- (r'\\.', token),
- (r'(%s)' % (symbol,), bygroups(token), "#pop"),
- include('interpol')
- ]
- return states
-
-
-def gen_elixir_sigstr_rules(term, token, interpol=True):
- if interpol:
- return [
- (r'[^#%s\\]+' % (term,), token),
- include('escapes'),
- (r'\\.', token),
- (r'%s[a-zA-Z]*' % (term,), token, '#pop'),
- include('interpol')
- ]
- else:
- return [
- (r'[^%s\\]+' % (term,), token),
- (r'\\.', token),
- (r'%s[a-zA-Z]*' % (term,), token, '#pop'),
- ]
-
-
-class ElixirLexer(RegexLexer):
- """
- For the `Elixir language <http://elixir-lang.org>`_.
-
- .. versionadded:: 1.5
- """
-
- name = 'Elixir'
- aliases = ['elixir', 'ex', 'exs']
- filenames = ['*.ex', '*.exs']
- mimetypes = ['text/x-elixir']
-
- KEYWORD = ('fn', 'do', 'end', 'after', 'else', 'rescue', 'catch')
- KEYWORD_OPERATOR = ('not', 'and', 'or', 'when', 'in')
- BUILTIN = (
- 'case', 'cond', 'for', 'if', 'unless', 'try', 'receive', 'raise',
- 'quote', 'unquote', 'unquote_splicing', 'throw', 'super',
- )
- BUILTIN_DECLARATION = (
- 'def', 'defp', 'defmodule', 'defprotocol', 'defmacro', 'defmacrop',
- 'defdelegate', 'defexception', 'defstruct', 'defimpl', 'defcallback',
- )
-
- BUILTIN_NAMESPACE = ('import', 'require', 'use', 'alias')
- CONSTANT = ('nil', 'true', 'false')
-
- PSEUDO_VAR = ('_', '__MODULE__', '__DIR__', '__ENV__', '__CALLER__')
-
- OPERATORS3 = (
- '<<<', '>>>', '|||', '&&&', '^^^', '~~~', '===', '!==',
- '~>>', '<~>', '|~>', '<|>',
- )
- OPERATORS2 = (
- '==', '!=', '<=', '>=', '&&', '||', '<>', '++', '--', '|>', '=~',
- '->', '<-', '|', '.', '=', '~>', '<~',
- )
- OPERATORS1 = ('<', '>', '+', '-', '*', '/', '!', '^', '&')
-
- PUNCTUATION = (
- '\\\\', '<<', '>>', '=>', '(', ')', ':', ';', ',', '[', ']',
- )
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in RegexLexer.get_tokens_unprocessed(self, text):
- if token is Name:
- if value in self.KEYWORD:
- yield index, Keyword, value
- elif value in self.KEYWORD_OPERATOR:
- yield index, Operator.Word, value
- elif value in self.BUILTIN:
- yield index, Keyword, value
- elif value in self.BUILTIN_DECLARATION:
- yield index, Keyword.Declaration, value
- elif value in self.BUILTIN_NAMESPACE:
- yield index, Keyword.Namespace, value
- elif value in self.CONSTANT:
- yield index, Name.Constant, value
- elif value in self.PSEUDO_VAR:
- yield index, Name.Builtin.Pseudo, value
- else:
- yield index, token, value
- else:
- yield index, token, value
-
- def gen_elixir_sigil_rules():
- # all valid sigil terminators (excluding heredocs)
- terminators = [
- (r'\{', r'\}', 'cb'),
- (r'\[', r'\]', 'sb'),
- (r'\(', r'\)', 'pa'),
- (r'<', r'>', 'ab'),
- (r'/', r'/', 'slas'),
- (r'\|', r'\|', 'pipe'),
- ('"', '"', 'quot'),
- ("'", "'", 'apos'),
- ]
-
- # heredocs have slightly different rules
- triquotes = [(r'"""', 'triquot'), (r"'''", 'triapos')]
-
- token = String.Other
- states = {'sigils': []}
-
- for term, name in triquotes:
- states['sigils'] += [
- (r'(~[a-z])(%s)' % (term,), bygroups(token, String.Heredoc),
- (name + '-end', name + '-intp')),
- (r'(~[A-Z])(%s)' % (term,), bygroups(token, String.Heredoc),
- (name + '-end', name + '-no-intp')),
- ]
-
- states[name + '-end'] = [
- (r'[a-zA-Z]+', token, '#pop'),
- default('#pop'),
- ]
- states[name + '-intp'] = [
- (r'^\s*' + term, String.Heredoc, '#pop'),
- include('heredoc_interpol'),
- ]
- states[name + '-no-intp'] = [
- (r'^\s*' + term, String.Heredoc, '#pop'),
- include('heredoc_no_interpol'),
- ]
-
- for lterm, rterm, name in terminators:
- states['sigils'] += [
- (r'~[a-z]' + lterm, token, name + '-intp'),
- (r'~[A-Z]' + lterm, token, name + '-no-intp'),
- ]
- states[name + '-intp'] = gen_elixir_sigstr_rules(rterm, token)
- states[name + '-no-intp'] = \
- gen_elixir_sigstr_rules(rterm, token, interpol=False)
-
- return states
-
- op3_re = "|".join(re.escape(s) for s in OPERATORS3)
- op2_re = "|".join(re.escape(s) for s in OPERATORS2)
- op1_re = "|".join(re.escape(s) for s in OPERATORS1)
- ops_re = r'(?:%s|%s|%s)' % (op3_re, op2_re, op1_re)
- punctuation_re = "|".join(re.escape(s) for s in PUNCTUATION)
- alnum = r'\w'
- name_re = r'(?:\.\.\.|[a-z_]%s*[!?]?)' % alnum
- modname_re = r'[A-Z]%(alnum)s*(?:\.[A-Z]%(alnum)s*)*' % {'alnum': alnum}
- complex_name_re = r'(?:%s|%s|%s)' % (name_re, modname_re, ops_re)
- special_atom_re = r'(?:\.\.\.|<<>>|%\{\}|%|\{\})'
-
- long_hex_char_re = r'(\\x\{)([\da-fA-F]+)(\})'
- hex_char_re = r'(\\x[\da-fA-F]{1,2})'
- escape_char_re = r'(\\[abdefnrstv])'
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'#.*$', Comment.Single),
-
- # Various kinds of characters
- (r'(\?)' + long_hex_char_re,
- bygroups(String.Char,
- String.Escape, Number.Hex, String.Escape)),
- (r'(\?)' + hex_char_re,
- bygroups(String.Char, String.Escape)),
- (r'(\?)' + escape_char_re,
- bygroups(String.Char, String.Escape)),
- (r'\?\\?.', String.Char),
-
- # '::' has to go before atoms
- (r':::', String.Symbol),
- (r'::', Operator),
-
- # atoms
- (r':' + special_atom_re, String.Symbol),
- (r':' + complex_name_re, String.Symbol),
- (r':"', String.Symbol, 'string_double_atom'),
- (r":'", String.Symbol, 'string_single_atom'),
-
- # [keywords: ...]
- (r'(%s|%s)(:)(?=\s|\n)' % (special_atom_re, complex_name_re),
- bygroups(String.Symbol, Punctuation)),
-
- # @attributes
- (r'@' + name_re, Name.Attribute),
-
- # identifiers
- (name_re, Name),
- (r'(%%?)(%s)' % (modname_re,), bygroups(Punctuation, Name.Class)),
-
- # operators and punctuation
- (op3_re, Operator),
- (op2_re, Operator),
- (punctuation_re, Punctuation),
- (r'&\d', Name.Entity), # anon func arguments
- (op1_re, Operator),
-
- # numbers
- (r'0b[01]+', Number.Bin),
- (r'0o[0-7]+', Number.Oct),
- (r'0x[\da-fA-F]+', Number.Hex),
- (r'\d(_?\d)*\.\d(_?\d)*([eE][-+]?\d(_?\d)*)?', Number.Float),
- (r'\d(_?\d)*', Number.Integer),
-
- # strings and heredocs
- (r'"""\s*', String.Heredoc, 'heredoc_double'),
- (r"'''\s*$", String.Heredoc, 'heredoc_single'),
- (r'"', String.Double, 'string_double'),
- (r"'", String.Single, 'string_single'),
-
- include('sigils'),
-
- (r'%\{', Punctuation, 'map_key'),
- (r'\{', Punctuation, 'tuple'),
- ],
- 'heredoc_double': [
- (r'^\s*"""', String.Heredoc, '#pop'),
- include('heredoc_interpol'),
- ],
- 'heredoc_single': [
- (r"^\s*'''", String.Heredoc, '#pop'),
- include('heredoc_interpol'),
- ],
- 'heredoc_interpol': [
- (r'[^#\\\n]+', String.Heredoc),
- include('escapes'),
- (r'\\.', String.Heredoc),
- (r'\n+', String.Heredoc),
- include('interpol'),
- ],
- 'heredoc_no_interpol': [
- (r'[^\\\n]+', String.Heredoc),
- (r'\\.', String.Heredoc),
- (r'\n+', String.Heredoc),
- ],
- 'escapes': [
- (long_hex_char_re,
- bygroups(String.Escape, Number.Hex, String.Escape)),
- (hex_char_re, String.Escape),
- (escape_char_re, String.Escape),
- ],
- 'interpol': [
- (r'#\{', String.Interpol, 'interpol_string'),
- ],
- 'interpol_string': [
- (r'\}', String.Interpol, "#pop"),
- include('root')
- ],
- 'map_key': [
- include('root'),
- (r':', Punctuation, 'map_val'),
- (r'=>', Punctuation, 'map_val'),
- (r'\}', Punctuation, '#pop'),
- ],
- 'map_val': [
- include('root'),
- (r',', Punctuation, '#pop'),
- (r'(?=\})', Punctuation, '#pop'),
- ],
- 'tuple': [
- include('root'),
- (r'\}', Punctuation, '#pop'),
- ],
- }
- tokens.update(gen_elixir_string_rules('double', '"', String.Double))
- tokens.update(gen_elixir_string_rules('single', "'", String.Single))
- tokens.update(gen_elixir_string_rules('double_atom', '"', String.Symbol))
- tokens.update(gen_elixir_string_rules('single_atom', "'", String.Symbol))
- tokens.update(gen_elixir_sigil_rules())
-
-
-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
-
- .. versionadded:: 1.5
- """
-
- name = 'Elixir iex session'
- aliases = ['iex']
- mimetypes = ['text/x-elixir-shellsession']
-
- _prompt_re = re.compile(r'(iex|\.{3})((?:\([\w@_.]+\))?\d+|\(\d+\))?> ')
-
- def get_tokens_unprocessed(self, text):
- exlexer = ElixirLexer(**self.options)
-
- curcode = ''
- in_error = False
- insertions = []
- for match in line_re.finditer(text):
- line = match.group()
- if line.startswith(u'** '):
- in_error = True
- insertions.append((len(curcode),
- [(0, Generic.Error, line[:-1])]))
- curcode += line[-1:]
- else:
- m = self._prompt_re.match(line)
- if m is not None:
- in_error = False
- 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 = []
- token = Generic.Error if in_error else Generic.Output
- yield match.start(), token, line
- if curcode:
- for item in do_insertions(
- insertions, exlexer.get_tokens_unprocessed(curcode)):
- yield item
diff --git a/pygments/lexers/esoteric.py b/pygments/lexers/esoteric.py
deleted file mode 100644
index 6946c902..00000000
--- a/pygments/lexers/esoteric.py
+++ /dev/null
@@ -1,277 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.esoteric
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for esoteric languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-
-__all__ = ['BrainfuckLexer', 'BefungeLexer', 'RedcodeLexer', 'CAmkESLexer',
- 'CapDLLexer', 'AheuiLexer']
-
-
-class BrainfuckLexer(RegexLexer):
- """
- Lexer for the esoteric `BrainFuck <http://www.muppetlabs.com/~breadbox/bf/>`_
- language.
- """
-
- name = 'Brainfuck'
- aliases = ['brainfuck', 'bf']
- filenames = ['*.bf', '*.b']
- mimetypes = ['application/x-brainfuck']
-
- tokens = {
- 'common': [
- # use different colors for different instruction types
- (r'[.,]+', Name.Tag),
- (r'[+-]+', Name.Builtin),
- (r'[<>]+', Name.Variable),
- (r'[^.,+\-<>\[\]]+', Comment),
- ],
- 'root': [
- (r'\[', Keyword, 'loop'),
- (r'\]', Error),
- include('common'),
- ],
- 'loop': [
- (r'\[', Keyword, '#push'),
- (r'\]', Keyword, '#pop'),
- include('common'),
- ]
- }
-
-
-class BefungeLexer(RegexLexer):
- """
- Lexer for the esoteric `Befunge <http://en.wikipedia.org/wiki/Befunge>`_
- language.
-
- .. versionadded:: 0.7
- """
- name = 'Befunge'
- aliases = ['befunge']
- filenames = ['*.befunge']
- mimetypes = ['application/x-befunge']
-
- tokens = {
- 'root': [
- (r'[0-9a-f]', Number),
- (r'[+*/%!`-]', Operator), # Traditional math
- (r'[<>^v?\[\]rxjk]', Name.Variable), # Move, imperatives
- (r'[:\\$.,n]', Name.Builtin), # Stack ops, imperatives
- (r'[|_mw]', Keyword),
- (r'[{}]', Name.Tag), # Befunge-98 stack ops
- (r'".*?"', String.Double), # Strings don't appear to allow escapes
- (r'\'.', String.Single), # Single character
- (r'[#;]', Comment), # Trampoline... depends on direction hit
- (r'[pg&~=@iotsy]', Keyword), # Misc
- (r'[()A-Z]', Comment), # Fingerprints
- (r'\s+', Text), # Whitespace doesn't matter
- ],
- }
-
-
-class CAmkESLexer(RegexLexer):
- """
- Basic lexer for the input language for the
- `CAmkES <https://sel4.systems/CAmkES/>`_ component platform.
-
- .. versionadded:: 2.1
- """
- name = 'CAmkES'
- aliases = ['camkes', 'idl4']
- filenames = ['*.camkes', '*.idl4']
-
- tokens = {
- 'root': [
- # C pre-processor directive
- (r'^\s*#.*\n', Comment.Preproc),
-
- # Whitespace, comments
- (r'\s+', Text),
- (r'/\*(.|\n)*?\*/', Comment),
- (r'//.*\n', Comment),
-
- (r'[\[(){},.;\]]', Punctuation),
- (r'[~!%^&*+=|?:<>/-]', Operator),
-
- (words(('assembly', 'attribute', 'component', 'composition',
- 'configuration', 'connection', 'connector', 'consumes',
- 'control', 'dataport', 'Dataport', 'Dataports', 'emits',
- 'event', 'Event', 'Events', 'export', 'from', 'group',
- 'hardware', 'has', 'interface', 'Interface', 'maybe',
- 'procedure', 'Procedure', 'Procedures', 'provides',
- 'template', 'thread', 'threads', 'to', 'uses', 'with'),
- suffix=r'\b'), Keyword),
-
- (words(('bool', 'boolean', 'Buf', 'char', 'character', 'double',
- 'float', 'in', 'inout', 'int', 'int16_6', 'int32_t',
- 'int64_t', 'int8_t', 'integer', 'mutex', 'out', 'real',
- 'refin', 'semaphore', 'signed', 'string', 'struct',
- 'uint16_t', 'uint32_t', 'uint64_t', 'uint8_t', 'uintptr_t',
- 'unsigned', 'void'),
- suffix=r'\b'), Keyword.Type),
-
- # Recognised attributes
- (r'[a-zA-Z_]\w*_(priority|domain|buffer)', Keyword.Reserved),
- (words(('dma_pool', 'from_access', 'to_access'), suffix=r'\b'),
- Keyword.Reserved),
-
- # CAmkES-level include
- (r'import\s+(<[^>]*>|"[^"]*");', Comment.Preproc),
-
- # C-level include
- (r'include\s+(<[^>]*>|"[^"]*");', Comment.Preproc),
-
- # Literals
- (r'0[xX][\da-fA-F]+', Number.Hex),
- (r'-?[\d]+', Number),
- (r'-?[\d]+\.[\d]+', Number.Float),
- (r'"[^"]*"', String),
- (r'[Tt]rue|[Ff]alse', Name.Builtin),
-
- # Identifiers
- (r'[a-zA-Z_]\w*', Name),
- ],
- }
-
-
-class CapDLLexer(RegexLexer):
- """
- Basic lexer for
- `CapDL <https://ssrg.nicta.com.au/publications/nictaabstracts/Kuz_KLW_10.abstract.pml>`_.
-
- The source of the primary tool that reads such specifications is available
- at https://github.com/seL4/capdl/tree/master/capDL-tool. Note that this
- lexer only supports a subset of the grammar. For example, identifiers can
- shadow type names, but these instances are currently incorrectly
- highlighted as types. Supporting this would need a stateful lexer that is
- considered unnecessarily complex for now.
-
- .. versionadded:: 2.2
- """
- name = 'CapDL'
- aliases = ['capdl']
- filenames = ['*.cdl']
-
- tokens = {
- 'root': [
- # C pre-processor directive
- (r'^\s*#.*\n', Comment.Preproc),
-
- # Whitespace, comments
- (r'\s+', Text),
- (r'/\*(.|\n)*?\*/', Comment),
- (r'(//|--).*\n', Comment),
-
- (r'[<>\[(){},:;=\]]', Punctuation),
- (r'\.\.', Punctuation),
-
- (words(('arch', 'arm11', 'caps', 'child_of', 'ia32', 'irq', 'maps',
- 'objects'), suffix=r'\b'), Keyword),
-
- (words(('aep', 'asid_pool', 'cnode', 'ep', 'frame', 'io_device',
- 'io_ports', 'io_pt', 'notification', 'pd', 'pt', 'tcb',
- 'ut', 'vcpu'), suffix=r'\b'), Keyword.Type),
-
- # Properties
- (words(('asid', 'addr', 'badge', 'cached', 'dom', 'domainID', 'elf',
- 'fault_ep', 'G', 'guard', 'guard_size', 'init', 'ip',
- 'prio', 'sp', 'R', 'RG', 'RX', 'RW', 'RWG', 'RWX', 'W',
- 'WG', 'WX', 'level', 'masked', 'master_reply', 'paddr',
- 'ports', 'reply', 'uncached'), suffix=r'\b'),
- Keyword.Reserved),
-
- # Literals
- (r'0[xX][\da-fA-F]+', Number.Hex),
- (r'\d+(\.\d+)?(k|M)?', Number),
- (words(('bits',), suffix=r'\b'), Number),
- (words(('cspace', 'vspace', 'reply_slot', 'caller_slot',
- 'ipc_buffer_slot'), suffix=r'\b'), Number),
-
- # Identifiers
- (r'[a-zA-Z_][-@\.\w]*', Name),
- ],
- }
-
-
-class RedcodeLexer(RegexLexer):
- """
- A simple Redcode lexer based on ICWS'94.
- Contributed by Adam Blinkinsop <blinks@acm.org>.
-
- .. versionadded:: 0.8
- """
- name = 'Redcode'
- aliases = ['redcode']
- filenames = ['*.cw']
-
- opcodes = ('DAT', 'MOV', 'ADD', 'SUB', 'MUL', 'DIV', 'MOD',
- 'JMP', 'JMZ', 'JMN', 'DJN', 'CMP', 'SLT', 'SPL',
- 'ORG', 'EQU', 'END')
- modifiers = ('A', 'B', 'AB', 'BA', 'F', 'X', 'I')
-
- tokens = {
- 'root': [
- # Whitespace:
- (r'\s+', Text),
- (r';.*$', Comment.Single),
- # Lexemes:
- # Identifiers
- (r'\b(%s)\b' % '|'.join(opcodes), Name.Function),
- (r'\b(%s)\b' % '|'.join(modifiers), Name.Decorator),
- (r'[A-Za-z_]\w+', Name),
- # Operators
- (r'[-+*/%]', Operator),
- (r'[#$@<>]', Operator), # mode
- (r'[.,]', Punctuation), # mode
- # Numbers
- (r'[-+]?\d+', Number.Integer),
- ],
- }
-
-
-class AheuiLexer(RegexLexer):
- """
- Aheui_ Lexer.
-
- Aheui_ is esoteric language based on Korean alphabets.
-
- .. _Aheui: http://aheui.github.io/
-
- """
-
- name = 'Aheui'
- aliases = ['aheui']
- filenames = ['*.aheui']
-
- tokens = {
- 'root': [
- (u'['
- u'나-낳냐-냫너-넣녀-녛노-놓뇨-눟뉴-닇'
- u'다-닿댜-댷더-덯뎌-뎧도-돟됴-둫듀-딓'
- u'따-땋땨-떃떠-떻뗘-뗳또-똫뚀-뚷뜌-띟'
- u'라-랗랴-럏러-렇려-렿로-롷료-뤃류-릫'
- u'마-맣먀-먛머-멓며-몋모-뫃묘-뭏뮤-믷'
- u'바-밯뱌-뱧버-벟벼-볗보-봏뵤-붛뷰-빃'
- u'빠-빻뺘-뺳뻐-뻫뼈-뼣뽀-뽛뾰-뿧쀼-삏'
- u'사-샇샤-샿서-섷셔-셯소-솧쇼-숳슈-싛'
- u'싸-쌓쌰-썋써-쎃쎠-쎻쏘-쏳쑈-쑿쓔-씧'
- u'자-잫쟈-쟣저-젛져-졓조-좋죠-줗쥬-즿'
- u'차-챃챠-챻처-첳쳐-쳫초-촣쵸-춯츄-칗'
- u'카-캏캬-컇커-컿켜-켷코-콯쿄-쿻큐-킣'
- u'타-탛탸-턓터-텋텨-톃토-톻툐-퉇튜-틯'
- u'파-팧퍄-퍟퍼-펗펴-폏포-퐇표-풓퓨-픻'
- u'하-핳햐-햫허-헣혀-혛호-홓효-훟휴-힇'
- u']', Operator),
- ('.', Comment),
- ],
- }
diff --git a/pygments/lexers/ezhil.py b/pygments/lexers/ezhil.py
deleted file mode 100644
index ee465885..00000000
--- a/pygments/lexers/ezhil.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.ezhil
- ~~~~~~~~~~~~~~~~~~~~~
-
- Pygments lexers for Ezhil language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Keyword, Text, Comment, Name
-from pygments.token import String, Number, Punctuation, Operator
-
-__all__ = ['EzhilLexer']
-
-
-class EzhilLexer(RegexLexer):
- """
- Lexer for `Ezhil, a Tamil script-based programming language <http://ezhillang.org>`_
-
- .. versionadded:: 2.1
- """
- name = 'Ezhil'
- aliases = ['ezhil']
- filenames = ['*.n']
- mimetypes = ['text/x-ezhil']
- flags = re.MULTILINE | re.UNICODE
- # Refer to tamil.utf8.tamil_letters from open-tamil for a stricter version of this.
- # This much simpler version is close enough, and includes combining marks.
- _TALETTERS = u'[a-zA-Z_]|[\u0b80-\u0bff]'
- tokens = {
- 'root': [
- include('keywords'),
- (r'#.*\n', Comment.Single),
- (r'[@+/*,^\-%]|[!<>=]=?|&&?|\|\|?', Operator),
- (u'இல்', Operator.Word),
- (words((u'assert', u'max', u'min',
- u'நீளம்', u'சரம்_இடமாற்று', u'சரம்_கண்டுபிடி',
- u'பட்டியல்', u'பின்இணை', u'வரிசைப்படுத்து',
- u'எடு', u'தலைகீழ்', u'நீட்டிக்க', u'நுழைக்க', u'வை',
- u'கோப்பை_திற', u'கோப்பை_எழுது', u'கோப்பை_மூடு',
- u'pi', u'sin', u'cos', u'tan', u'sqrt', u'hypot', u'pow',
- u'exp', u'log', u'log10', u'exit',
- ), suffix=r'\b'), Name.Builtin),
- (r'(True|False)\b', Keyword.Constant),
- (r'[^\S\n]+', Text),
- include('identifier'),
- include('literal'),
- (r'[(){}\[\]:;.]', Punctuation),
- ],
- 'keywords': [
- (u'பதிப்பி|தேர்ந்தெடு|தேர்வு|ஏதேனில்|ஆனால்|இல்லைஆனால்|இல்லை|ஆக|ஒவ்வொன்றாக|இல்|வரை|செய்|முடியேனில்|பின்கொடு|முடி|நிரல்பாகம்|தொடர்|நிறுத்து|நிரல்பாகம்', Keyword),
- ],
- 'identifier': [
- (u'(?:'+_TALETTERS+u')(?:[0-9]|'+_TALETTERS+u')*', Name),
- ],
- 'literal': [
- (r'".*?"', String),
- (r'(?u)\d+((\.\d*)?[eE][+-]?\d+|\.\d*)', Number.Float),
- (r'(?u)\d+', Number.Integer),
- ]
- }
-
- def __init__(self, **options):
- super(EzhilLexer, self).__init__(**options)
- self.encoding = options.get('encoding', 'utf-8')
diff --git a/pygments/lexers/factor.py b/pygments/lexers/factor.py
deleted file mode 100644
index 4aed8f6e..00000000
--- a/pygments/lexers/factor.py
+++ /dev/null
@@ -1,344 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.factor
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Factor language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, default, words
-from pygments.token import Text, Comment, Keyword, Name, String, Number
-
-__all__ = ['FactorLexer']
-
-
-class FactorLexer(RegexLexer):
- """
- Lexer for the `Factor <http://factorcode.org>`_ language.
-
- .. versionadded:: 1.4
- """
- name = 'Factor'
- aliases = ['factor']
- filenames = ['*.factor']
- mimetypes = ['text/x-factor']
-
- flags = re.MULTILINE | re.UNICODE
-
- builtin_kernel = words((
- '-rot', '2bi', '2bi@', '2bi*', '2curry', '2dip', '2drop', '2dup', '2keep', '2nip',
- '2over', '2tri', '2tri@', '2tri*', '3bi', '3curry', '3dip', '3drop', '3dup', '3keep',
- '3tri', '4dip', '4drop', '4dup', '4keep', '<wrapper>', '=', '>boolean', 'clone',
- '?', '?execute', '?if', 'and', 'assert', 'assert=', 'assert?', 'bi', 'bi-curry',
- 'bi-curry@', 'bi-curry*', 'bi@', 'bi*', 'boa', 'boolean', 'boolean?', 'both?',
- 'build', 'call', 'callstack', 'callstack>array', 'callstack?', 'clear', '(clone)',
- 'compose', 'compose?', 'curry', 'curry?', 'datastack', 'die', 'dip', 'do', 'drop',
- 'dup', 'dupd', 'either?', 'eq?', 'equal?', 'execute', 'hashcode', 'hashcode*',
- 'identity-hashcode', 'identity-tuple', 'identity-tuple?', 'if', 'if*',
- 'keep', 'loop', 'most', 'new', 'nip', 'not', 'null', 'object', 'or', 'over',
- 'pick', 'prepose', 'retainstack', 'rot', 'same?', 'swap', 'swapd', 'throw',
- 'tri', 'tri-curry', 'tri-curry@', 'tri-curry*', 'tri@', 'tri*', 'tuple',
- 'tuple?', 'unless', 'unless*', 'until', 'when', 'when*', 'while', 'with',
- 'wrapper', 'wrapper?', 'xor'), suffix=r'\s')
-
- builtin_assocs = words((
- '2cache', '<enum>', '>alist', '?at', '?of', 'assoc', 'assoc-all?',
- 'assoc-any?', 'assoc-clone-like', 'assoc-combine', 'assoc-diff',
- 'assoc-diff!', 'assoc-differ', 'assoc-each', 'assoc-empty?',
- 'assoc-filter', 'assoc-filter!', 'assoc-filter-as', 'assoc-find',
- 'assoc-hashcode', 'assoc-intersect', 'assoc-like', 'assoc-map',
- 'assoc-map-as', 'assoc-partition', 'assoc-refine', 'assoc-size',
- 'assoc-stack', 'assoc-subset?', 'assoc-union', 'assoc-union!',
- 'assoc=', 'assoc>map', 'assoc?', 'at', 'at+', 'at*', 'cache', 'change-at',
- 'clear-assoc', 'delete-at', 'delete-at*', 'enum', 'enum?', 'extract-keys',
- 'inc-at', 'key?', 'keys', 'map>assoc', 'maybe-set-at', 'new-assoc', 'of',
- 'push-at', 'rename-at', 'set-at', 'sift-keys', 'sift-values', 'substitute',
- 'unzip', 'value-at', 'value-at*', 'value?', 'values', 'zip'), suffix=r'\s')
-
- builtin_combinators = words((
- '2cleave', '2cleave>quot', '3cleave', '3cleave>quot', '4cleave',
- '4cleave>quot', 'alist>quot', 'call-effect', 'case', 'case-find',
- 'case>quot', 'cleave', 'cleave>quot', 'cond', 'cond>quot', 'deep-spread>quot',
- 'execute-effect', 'linear-case-quot', 'no-case', 'no-case?', 'no-cond',
- 'no-cond?', 'recursive-hashcode', 'shallow-spread>quot', 'spread',
- 'to-fixed-point', 'wrong-values', 'wrong-values?'), suffix=r'\s')
-
- builtin_math = words((
- '-', '/', '/f', '/i', '/mod', '2/', '2^', '<', '<=', '<fp-nan>', '>',
- '>=', '>bignum', '>fixnum', '>float', '>integer', '(all-integers?)',
- '(each-integer)', '(find-integer)', '*', '+', '?1+',
- 'abs', 'align', 'all-integers?', 'bignum', 'bignum?', 'bit?', 'bitand',
- 'bitnot', 'bitor', 'bits>double', 'bits>float', 'bitxor', 'complex',
- 'complex?', 'denominator', 'double>bits', 'each-integer', 'even?',
- 'find-integer', 'find-last-integer', 'fixnum', 'fixnum?', 'float',
- 'float>bits', 'float?', 'fp-bitwise=', 'fp-infinity?', 'fp-nan-payload',
- 'fp-nan?', 'fp-qnan?', 'fp-sign', 'fp-snan?', 'fp-special?',
- 'if-zero', 'imaginary-part', 'integer', 'integer>fixnum',
- 'integer>fixnum-strict', 'integer?', 'log2', 'log2-expects-positive',
- 'log2-expects-positive?', 'mod', 'neg', 'neg?', 'next-float',
- 'next-power-of-2', 'number', 'number=', 'number?', 'numerator', 'odd?',
- 'out-of-fixnum-range', 'out-of-fixnum-range?', 'power-of-2?',
- 'prev-float', 'ratio', 'ratio?', 'rational', 'rational?', 'real',
- 'real-part', 'real?', 'recip', 'rem', 'sgn', 'shift', 'sq', 'times',
- 'u<', 'u<=', 'u>', 'u>=', 'unless-zero', 'unordered?', 'when-zero',
- 'zero?'), suffix=r'\s')
-
- builtin_sequences = words((
- '1sequence', '2all?', '2each', '2map', '2map-as', '2map-reduce', '2reduce',
- '2selector', '2sequence', '3append', '3append-as', '3each', '3map', '3map-as',
- '3sequence', '4sequence', '<repetition>', '<reversed>', '<slice>', '?first',
- '?last', '?nth', '?second', '?set-nth', 'accumulate', 'accumulate!',
- 'accumulate-as', 'all?', 'any?', 'append', 'append!', 'append-as',
- 'assert-sequence', 'assert-sequence=', 'assert-sequence?',
- 'binary-reduce', 'bounds-check', 'bounds-check?', 'bounds-error',
- 'bounds-error?', 'but-last', 'but-last-slice', 'cartesian-each',
- 'cartesian-map', 'cartesian-product', 'change-nth', 'check-slice',
- 'check-slice-error', 'clone-like', 'collapse-slice', 'collector',
- 'collector-for', 'concat', 'concat-as', 'copy', 'count', 'cut', 'cut-slice',
- 'cut*', 'delete-all', 'delete-slice', 'drop-prefix', 'each', 'each-from',
- 'each-index', 'empty?', 'exchange', 'filter', 'filter!', 'filter-as', 'find',
- 'find-from', 'find-index', 'find-index-from', 'find-last', 'find-last-from',
- 'first', 'first2', 'first3', 'first4', 'flip', 'follow', 'fourth', 'glue', 'halves',
- 'harvest', 'head', 'head-slice', 'head-slice*', 'head*', 'head?',
- 'if-empty', 'immutable', 'immutable-sequence', 'immutable-sequence?',
- 'immutable?', 'index', 'index-from', 'indices', 'infimum', 'infimum-by',
- 'insert-nth', 'interleave', 'iota', 'iota-tuple', 'iota-tuple?', 'join',
- 'join-as', 'last', 'last-index', 'last-index-from', 'length', 'lengthen',
- 'like', 'longer', 'longer?', 'longest', 'map', 'map!', 'map-as', 'map-find',
- 'map-find-last', 'map-index', 'map-integers', 'map-reduce', 'map-sum',
- 'max-length', 'member-eq?', 'member?', 'midpoint@', 'min-length',
- 'mismatch', 'move', 'new-like', 'new-resizable', 'new-sequence',
- 'non-negative-integer-expected', 'non-negative-integer-expected?',
- 'nth', 'nths', 'pad-head', 'pad-tail', 'padding', 'partition', 'pop', 'pop*',
- 'prefix', 'prepend', 'prepend-as', 'produce', 'produce-as', 'product', 'push',
- 'push-all', 'push-either', 'push-if', 'reduce', 'reduce-index', 'remove',
- 'remove!', 'remove-eq', 'remove-eq!', 'remove-nth', 'remove-nth!', 'repetition',
- 'repetition?', 'replace-slice', 'replicate', 'replicate-as', 'rest',
- 'rest-slice', 'reverse', 'reverse!', 'reversed', 'reversed?', 'second',
- 'selector', 'selector-for', 'sequence', 'sequence-hashcode', 'sequence=',
- 'sequence?', 'set-first', 'set-fourth', 'set-last', 'set-length', 'set-nth',
- 'set-second', 'set-third', 'short', 'shorten', 'shorter', 'shorter?',
- 'shortest', 'sift', 'slice', 'slice-error', 'slice-error?', 'slice?',
- 'snip', 'snip-slice', 'start', 'start*', 'subseq', 'subseq?', 'suffix',
- 'suffix!', 'sum', 'sum-lengths', 'supremum', 'supremum-by', 'surround', 'tail',
- 'tail-slice', 'tail-slice*', 'tail*', 'tail?', 'third', 'trim',
- 'trim-head', 'trim-head-slice', 'trim-slice', 'trim-tail', 'trim-tail-slice',
- 'unclip', 'unclip-last', 'unclip-last-slice', 'unclip-slice', 'unless-empty',
- 'virtual-exemplar', 'virtual-sequence', 'virtual-sequence?', 'virtual@',
- 'when-empty'), suffix=r'\s')
-
- builtin_namespaces = words((
- '+@', 'change', 'change-global', 'counter', 'dec', 'get', 'get-global',
- 'global', 'inc', 'init-namespaces', 'initialize', 'is-global', 'make-assoc',
- 'namespace', 'namestack', 'off', 'on', 'set', 'set-global', 'set-namestack',
- 'toggle', 'with-global', 'with-scope', 'with-variable', 'with-variables'),
- suffix=r'\s')
-
- builtin_arrays = words((
- '1array', '2array', '3array', '4array', '<array>', '>array', 'array',
- 'array?', 'pair', 'pair?', 'resize-array'), suffix=r'\s')
-
- builtin_io = words((
- '(each-stream-block-slice)', '(each-stream-block)',
- '(stream-contents-by-block)', '(stream-contents-by-element)',
- '(stream-contents-by-length-or-block)',
- '(stream-contents-by-length)', '+byte+', '+character+',
- 'bad-seek-type', 'bad-seek-type?', 'bl', 'contents', 'each-block',
- 'each-block-size', 'each-block-slice', 'each-line', 'each-morsel',
- 'each-stream-block', 'each-stream-block-slice', 'each-stream-line',
- 'error-stream', 'flush', 'input-stream', 'input-stream?',
- 'invalid-read-buffer', 'invalid-read-buffer?', 'lines', 'nl',
- 'output-stream', 'output-stream?', 'print', 'read', 'read-into',
- 'read-partial', 'read-partial-into', 'read-until', 'read1', 'readln',
- 'seek-absolute', 'seek-absolute?', 'seek-end', 'seek-end?',
- 'seek-input', 'seek-output', 'seek-relative', 'seek-relative?',
- 'stream-bl', 'stream-contents', 'stream-contents*', 'stream-copy',
- 'stream-copy*', 'stream-element-type', 'stream-flush',
- 'stream-length', 'stream-lines', 'stream-nl', 'stream-print',
- 'stream-read', 'stream-read-into', 'stream-read-partial',
- 'stream-read-partial-into', 'stream-read-partial-unsafe',
- 'stream-read-unsafe', 'stream-read-until', 'stream-read1',
- 'stream-readln', 'stream-seek', 'stream-seekable?', 'stream-tell',
- 'stream-write', 'stream-write1', 'tell-input', 'tell-output',
- 'with-error-stream', 'with-error-stream*', 'with-error>output',
- 'with-input-output+error-streams',
- 'with-input-output+error-streams*', 'with-input-stream',
- 'with-input-stream*', 'with-output-stream', 'with-output-stream*',
- 'with-output>error', 'with-output+error-stream',
- 'with-output+error-stream*', 'with-streams', 'with-streams*',
- 'write', 'write1'), suffix=r'\s')
-
- builtin_strings = words((
- '1string', '<string>', '>string', 'resize-string', 'string',
- 'string?'), suffix=r'\s')
-
- builtin_vectors = words((
- '1vector', '<vector>', '>vector', '?push', 'vector', 'vector?'),
- suffix=r'\s')
-
- builtin_continuations = words((
- '<condition>', '<continuation>', '<restart>', 'attempt-all',
- 'attempt-all-error', 'attempt-all-error?', 'callback-error-hook',
- 'callcc0', 'callcc1', 'cleanup', 'compute-restarts', 'condition',
- 'condition?', 'continuation', 'continuation?', 'continue',
- 'continue-restart', 'continue-with', 'current-continuation',
- 'error', 'error-continuation', 'error-in-thread', 'error-thread',
- 'ifcc', 'ignore-errors', 'in-callback?', 'original-error', 'recover',
- 'restart', 'restart?', 'restarts', 'rethrow', 'rethrow-restarts',
- 'return', 'return-continuation', 'thread-error-hook', 'throw-continue',
- 'throw-restarts', 'with-datastack', 'with-return'), suffix=r'\s')
-
- tokens = {
- 'root': [
- # factor allows a file to start with a shebang
- (r'#!.*$', Comment.Preproc),
- default('base'),
- ],
- 'base': [
- (r'\s+', Text),
-
- # defining words
- (r'((?:MACRO|MEMO|TYPED)?:[:]?)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Function)),
- (r'(M:[:]?)(\s+)(\S+)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Class, Text, Name.Function)),
- (r'(C:)(\s+)(\S+)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Function, Text, Name.Class)),
- (r'(GENERIC:)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Function)),
- (r'(HOOK:|GENERIC#)(\s+)(\S+)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Function, Text, Name.Function)),
- (r'\(\s', Name.Function, 'stackeffect'),
- (r';\s', Keyword),
-
- # imports and namespaces
- (r'(USING:)(\s+)',
- bygroups(Keyword.Namespace, Text), 'vocabs'),
- (r'(USE:|UNUSE:|IN:|QUALIFIED:)(\s+)(\S+)',
- bygroups(Keyword.Namespace, Text, Name.Namespace)),
- (r'(QUALIFIED-WITH:)(\s+)(\S+)(\s+)(\S+)',
- bygroups(Keyword.Namespace, Text, Name.Namespace, Text, Name.Namespace)),
- (r'(FROM:|EXCLUDE:)(\s+)(\S+)(\s+=>\s)',
- bygroups(Keyword.Namespace, Text, Name.Namespace, Text), 'words'),
- (r'(RENAME:)(\s+)(\S+)(\s+)(\S+)(\s+=>\s+)(\S+)',
- bygroups(Keyword.Namespace, Text, Name.Function, Text, Name.Namespace, Text, Name.Function)),
- (r'(ALIAS:|TYPEDEF:)(\s+)(\S+)(\s+)(\S+)',
- bygroups(Keyword.Namespace, Text, Name.Function, Text, Name.Function)),
- (r'(DEFER:|FORGET:|POSTPONE:)(\s+)(\S+)',
- bygroups(Keyword.Namespace, Text, Name.Function)),
-
- # tuples and classes
- (r'(TUPLE:|ERROR:)(\s+)(\S+)(\s+<\s+)(\S+)',
- bygroups(Keyword, Text, Name.Class, Text, Name.Class), 'slots'),
- (r'(TUPLE:|ERROR:|BUILTIN:)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Class), 'slots'),
- (r'(MIXIN:|UNION:|INTERSECTION:)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Class)),
- (r'(PREDICATE:)(\s+)(\S+)(\s+<\s+)(\S+)',
- bygroups(Keyword, Text, Name.Class, Text, Name.Class)),
- (r'(C:)(\s+)(\S+)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Function, Text, Name.Class)),
- (r'(INSTANCE:)(\s+)(\S+)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Class, Text, Name.Class)),
- (r'(SLOT:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Function)),
- (r'(SINGLETON:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
- (r'SINGLETONS:', Keyword, 'classes'),
-
- # other syntax
- (r'(CONSTANT:|SYMBOL:|MAIN:|HELP:)(\s+)(\S+)',
- bygroups(Keyword, Text, Name.Function)),
- (r'SYMBOLS:\s', Keyword, 'words'),
- (r'SYNTAX:\s', Keyword),
- (r'ALIEN:\s', Keyword),
- (r'(STRUCT:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
- (r'(FUNCTION:)(\s+\S+\s+)(\S+)(\s+\(\s+[^)]+\)\s)',
- bygroups(Keyword.Namespace, Text, Name.Function, Text)),
- (r'(FUNCTION-ALIAS:)(\s+)(\S+)(\s+\S+\s+)(\S+)(\s+\(\s+[^)]+\)\s)',
- bygroups(Keyword.Namespace, Text, Name.Function, Text, Name.Function, Text)),
-
- # vocab.private
- (r'(?:<PRIVATE|PRIVATE>)\s', Keyword.Namespace),
-
- # strings
- (r'"""\s+(?:.|\n)*?\s+"""', String),
- (r'"(?:\\\\|\\"|[^"])*"', String),
- (r'\S+"\s+(?:\\\\|\\"|[^"])*"', String),
- (r'CHAR:\s+(?:\\[\\abfnrstv]|[^\\]\S*)\s', String.Char),
-
- # comments
- (r'!\s+.*$', Comment),
- (r'#!\s+.*$', Comment),
- (r'/\*\s+(?:.|\n)*?\s\*/\s', Comment),
-
- # boolean constants
- (r'[tf]\s', Name.Constant),
-
- # symbols and literals
- (r'[\\$]\s+\S+', Name.Constant),
- (r'M\\\s+\S+\s+\S+', Name.Constant),
-
- # numbers
- (r'[+-]?(?:[\d,]*\d)?\.(?:\d([\d,]*\d)?)?(?:[eE][+-]?\d+)?\s', Number),
- (r'[+-]?\d(?:[\d,]*\d)?(?:[eE][+-]?\d+)?\s', Number),
- (r'0x[a-fA-F\d](?:[a-fA-F\d,]*[a-fA-F\d])?(?:p\d([\d,]*\d)?)?\s', Number),
- (r'NAN:\s+[a-fA-F\d](?:[a-fA-F\d,]*[a-fA-F\d])?(?:p\d([\d,]*\d)?)?\s', Number),
- (r'0b[01]+\s', Number.Bin),
- (r'0o[0-7]+\s', Number.Oct),
- (r'(?:\d([\d,]*\d)?)?\+\d(?:[\d,]*\d)?/\d(?:[\d,]*\d)?\s', Number),
- (r'(?:\-\d([\d,]*\d)?)?\-\d(?:[\d,]*\d)?/\d(?:[\d,]*\d)?\s', Number),
-
- # keywords
- (r'(?:deprecated|final|foldable|flushable|inline|recursive)\s',
- Keyword),
-
- # builtins
- (builtin_kernel, Name.Builtin),
- (builtin_assocs, Name.Builtin),
- (builtin_combinators, Name.Builtin),
- (builtin_math, Name.Builtin),
- (builtin_sequences, Name.Builtin),
- (builtin_namespaces, Name.Builtin),
- (builtin_arrays, Name.Builtin),
- (builtin_io, Name.Builtin),
- (builtin_strings, Name.Builtin),
- (builtin_vectors, Name.Builtin),
- (builtin_continuations, Name.Builtin),
-
- # everything else is text
- (r'\S+', Text),
- ],
- 'stackeffect': [
- (r'\s+', Text),
- (r'\(\s+', Name.Function, 'stackeffect'),
- (r'\)\s', Name.Function, '#pop'),
- (r'--\s', Name.Function),
- (r'\S+', Name.Variable),
- ],
- 'slots': [
- (r'\s+', Text),
- (r';\s', Keyword, '#pop'),
- (r'(\{\s+)(\S+)(\s+[^}]+\s+\}\s)',
- bygroups(Text, Name.Variable, Text)),
- (r'\S+', Name.Variable),
- ],
- 'vocabs': [
- (r'\s+', Text),
- (r';\s', Keyword, '#pop'),
- (r'\S+', Name.Namespace),
- ],
- 'classes': [
- (r'\s+', Text),
- (r';\s', Keyword, '#pop'),
- (r'\S+', Name.Class),
- ],
- 'words': [
- (r'\s+', Text),
- (r';\s', Keyword, '#pop'),
- (r'\S+', Name.Function),
- ],
- }
diff --git a/pygments/lexers/fantom.py b/pygments/lexers/fantom.py
deleted file mode 100644
index b1b0dd94..00000000
--- a/pygments/lexers/fantom.py
+++ /dev/null
@@ -1,250 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.fantom
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Fantom language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from string import Template
-
-from pygments.lexer import RegexLexer, include, bygroups, using, \
- this, default, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Literal
-
-__all__ = ['FantomLexer']
-
-
-class FantomLexer(RegexLexer):
- """
- For Fantom source code.
-
- .. versionadded:: 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_]\w*',
- # 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': [
- (words((
- 'try', 'catch', 'throw', 'finally', 'for', 'if', 'else', 'while',
- 'as', 'is', 'isnot', 'switch', 'case', 'default', 'continue',
- 'break', 'do', 'return', 'get', 'set'), prefix=r'\b', suffix=r'\b'),
- Keyword),
- (r'\b(it|this|super)\b', Name.Builtin.Pseudo),
- ],
- 'operators': [
- (r'\+\+|\-\-|\+|\-|\*|/|\|\||&&|<=>|<=|<|>=|>|=|!|\[|\]', Operator)
- ],
- 'inType': [
- (r'[\[\]|\->:?]', Punctuation),
- (s(r'$id'), Name.Class),
- default('#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'),
- default('#pop')
- ],
- 'usingClass': [
- (r'[ \t]+', Text), # consume whitespaces
- (r'(as)(\s+)(\w+)',
- bygroups(Keyword.Declaration, Text, Name.Class), '#pop:2'),
- (r'[\w$]+', Name.Class),
- default('#pop:2') # jump out to root state
- ],
- 'facet': [
- (r'\s+', Text),
- (r'\{', Punctuation, 'facetFields'),
- default('#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)
- ],
- }
diff --git a/pygments/lexers/felix.py b/pygments/lexers/felix.py
deleted file mode 100644
index cf768a45..00000000
--- a/pygments/lexers/felix.py
+++ /dev/null
@@ -1,273 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.felix
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Felix language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, bygroups, default, words, \
- combined
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['FelixLexer']
-
-
-class FelixLexer(RegexLexer):
- """
- For `Felix <http://www.felix-lang.org>`_ source code.
-
- .. versionadded:: 1.2
- """
-
- name = 'Felix'
- aliases = ['felix', 'flx']
- filenames = ['*.flx', '*.flxh']
- mimetypes = ['text/x-felix']
-
- preproc = (
- 'elif', 'else', 'endif', 'if', 'ifdef', 'ifndef',
- )
-
- keywords = (
- '_', '_deref', 'all', 'as',
- 'assert', 'attempt', 'call', 'callback', 'case', 'caseno', 'cclass',
- 'code', 'compound', 'ctypes', 'do', 'done', 'downto', 'elif', 'else',
- 'endattempt', 'endcase', 'endif', 'endmatch', 'enum', 'except',
- 'exceptions', 'expect', 'finally', 'for', 'forall', 'forget', 'fork',
- 'functor', 'goto', 'ident', 'if', 'incomplete', 'inherit', 'instance',
- 'interface', 'jump', 'lambda', 'loop', 'match', 'module', 'namespace',
- 'new', 'noexpand', 'nonterm', 'obj', 'of', 'open', 'parse', 'raise',
- 'regexp', 'reglex', 'regmatch', 'rename', 'return', 'the', 'then',
- 'to', 'type', 'typecase', 'typedef', 'typematch', 'typeof', 'upto',
- 'when', 'whilst', 'with', 'yield',
- )
-
- keyword_directives = (
- '_gc_pointer', '_gc_type', 'body', 'comment', 'const', 'export',
- 'header', 'inline', 'lval', 'macro', 'noinline', 'noreturn',
- 'package', 'private', 'pod', 'property', 'public', 'publish',
- 'requires', 'todo', 'virtual', 'use',
- )
-
- keyword_declarations = (
- 'def', 'let', 'ref', 'val', 'var',
- )
-
- keyword_types = (
- 'unit', 'void', 'any', 'bool',
- 'byte', 'offset',
- 'address', 'caddress', 'cvaddress', 'vaddress',
- 'tiny', 'short', 'int', 'long', 'vlong',
- 'utiny', 'ushort', 'vshort', 'uint', 'ulong', 'uvlong',
- 'int8', 'int16', 'int32', 'int64',
- 'uint8', 'uint16', 'uint32', 'uint64',
- 'float', 'double', 'ldouble',
- 'complex', 'dcomplex', 'lcomplex',
- 'imaginary', 'dimaginary', 'limaginary',
- 'char', 'wchar', 'uchar',
- 'charp', 'charcp', 'ucharp', 'ucharcp',
- 'string', 'wstring', 'ustring',
- 'cont',
- 'array', 'varray', 'list',
- 'lvalue', 'opt', 'slice',
- )
-
- keyword_constants = (
- 'false', 'true',
- )
-
- operator_words = (
- 'and', 'not', 'in', 'is', 'isin', 'or', 'xor',
- )
-
- name_builtins = (
- '_svc', 'while',
- )
-
- name_pseudo = (
- 'root', 'self', 'this',
- )
-
- decimal_suffixes = '([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?'
-
- tokens = {
- 'root': [
- include('whitespace'),
-
- # Keywords
- (words(('axiom', 'ctor', 'fun', 'gen', 'proc', 'reduce',
- 'union'), suffix=r'\b'),
- Keyword, 'funcname'),
- (words(('class', 'cclass', 'cstruct', 'obj', 'struct'), suffix=r'\b'),
- Keyword, 'classname'),
- (r'(instance|module|typeclass)\b', Keyword, 'modulename'),
-
- (words(keywords, suffix=r'\b'), Keyword),
- (words(keyword_directives, suffix=r'\b'), Name.Decorator),
- (words(keyword_declarations, suffix=r'\b'), Keyword.Declaration),
- (words(keyword_types, suffix=r'\b'), Keyword.Type),
- (words(keyword_constants, suffix=r'\b'), Keyword.Constant),
-
- # Operators
- include('operators'),
-
- # Float Literal
- # -- Hex Float
- (r'0[xX]([0-9a-fA-F_]*\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)'
- r'[pP][+\-]?[0-9_]+[lLfFdD]?', Number.Float),
- # -- DecimalFloat
- (r'[0-9_]+(\.[0-9_]+[eE][+\-]?[0-9_]+|'
- r'\.[0-9_]*|[eE][+\-]?[0-9_]+)[lLfFdD]?', Number.Float),
- (r'\.(0|[1-9][0-9_]*)([eE][+\-]?[0-9_]+)?[lLfFdD]?',
- Number.Float),
-
- # IntegerLiteral
- # -- Binary
- (r'0[Bb][01_]+%s' % decimal_suffixes, Number.Bin),
- # -- Octal
- (r'0[0-7_]+%s' % decimal_suffixes, Number.Oct),
- # -- Hexadecimal
- (r'0[xX][0-9a-fA-F_]+%s' % decimal_suffixes, Number.Hex),
- # -- Decimal
- (r'(0|[1-9][0-9_]*)%s' % decimal_suffixes, Number.Integer),
-
- # Strings
- ('([rR][cC]?|[cC][rR])"""', String, 'tdqs'),
- ("([rR][cC]?|[cC][rR])'''", String, 'tsqs'),
- ('([rR][cC]?|[cC][rR])"', String, 'dqs'),
- ("([rR][cC]?|[cC][rR])'", String, 'sqs'),
- ('[cCfFqQwWuU]?"""', String, combined('stringescape', 'tdqs')),
- ("[cCfFqQwWuU]?'''", String, combined('stringescape', 'tsqs')),
- ('[cCfFqQwWuU]?"', String, combined('stringescape', 'dqs')),
- ("[cCfFqQwWuU]?'", String, combined('stringescape', 'sqs')),
-
- # Punctuation
- (r'[\[\]{}:(),;?]', Punctuation),
-
- # Labels
- (r'[a-zA-Z_]\w*:>', Name.Label),
-
- # Identifiers
- (r'(%s)\b' % '|'.join(name_builtins), Name.Builtin),
- (r'(%s)\b' % '|'.join(name_pseudo), Name.Builtin.Pseudo),
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'whitespace': [
- (r'\n', Text),
- (r'\s+', Text),
-
- include('comment'),
-
- # Preprocessor
- (r'#\s*if\s+0', Comment.Preproc, 'if0'),
- (r'#', Comment.Preproc, 'macro'),
- ],
- 'operators': [
- (r'(%s)\b' % '|'.join(operator_words), Operator.Word),
- (r'!=|==|<<|>>|\|\||&&|[-~+/*%=<>&^|.$]', Operator),
- ],
- 'comment': [
- (r'//(.*?)\n', Comment.Single),
- (r'/[*]', Comment.Multiline, 'comment2'),
- ],
- 'comment2': [
- (r'[^/*]', Comment.Multiline),
- (r'/[*]', Comment.Multiline, '#push'),
- (r'[*]/', Comment.Multiline, '#pop'),
- (r'[/*]', Comment.Multiline),
- ],
- 'if0': [
- (r'^\s*#if.*?(?<!\\)\n', Comment, '#push'),
- (r'^\s*#endif.*?(?<!\\)\n', Comment, '#pop'),
- (r'.*?\n', Comment),
- ],
- 'macro': [
- include('comment'),
- (r'(import|include)(\s+)(<[^>]*?>)',
- bygroups(Comment.Preproc, Text, String), '#pop'),
- (r'(import|include)(\s+)("[^"]*?")',
- bygroups(Comment.Preproc, Text, String), '#pop'),
- (r"(import|include)(\s+)('[^']*?')",
- bygroups(Comment.Preproc, Text, String), '#pop'),
- (r'[^/\n]+', Comment.Preproc),
- # (r'/[*](.|\n)*?[*]/', Comment),
- # (r'//.*?\n', Comment, '#pop'),
- (r'/', Comment.Preproc),
- (r'(?<=\\)\n', Comment.Preproc),
- (r'\n', Comment.Preproc, '#pop'),
- ],
- 'funcname': [
- include('whitespace'),
- (r'[a-zA-Z_]\w*', Name.Function, '#pop'),
- # anonymous functions
- (r'(?=\()', Text, '#pop'),
- ],
- 'classname': [
- include('whitespace'),
- (r'[a-zA-Z_]\w*', Name.Class, '#pop'),
- # anonymous classes
- (r'(?=\{)', Text, '#pop'),
- ],
- 'modulename': [
- include('whitespace'),
- (r'\[', Punctuation, ('modulename2', 'tvarlist')),
- default('modulename2'),
- ],
- 'modulename2': [
- include('whitespace'),
- (r'([a-zA-Z_]\w*)', Name.Namespace, '#pop:2'),
- ],
- 'tvarlist': [
- include('whitespace'),
- include('operators'),
- (r'\[', Punctuation, '#push'),
- (r'\]', Punctuation, '#pop'),
- (r',', Punctuation),
- (r'(with|where)\b', Keyword),
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'stringescape': [
- (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
- r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
- ],
- 'strings': [
- (r'%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
- '[hlL]?[E-GXc-giorsux%]', String.Interpol),
- (r'[^\\\'"%\n]+', String),
- # quotes, percents and backslashes must be parsed one at a time
- (r'[\'"\\]', String),
- # unhandled string formatting sign
- (r'%', String)
- # newlines are an error (use "nl" state)
- ],
- 'nl': [
- (r'\n', String)
- ],
- 'dqs': [
- (r'"', String, '#pop'),
- # included here again for raw strings
- (r'\\\\|\\"|\\\n', String.Escape),
- include('strings')
- ],
- 'sqs': [
- (r"'", String, '#pop'),
- # included here again for raw strings
- (r"\\\\|\\'|\\\n", String.Escape),
- include('strings')
- ],
- 'tdqs': [
- (r'"""', String, '#pop'),
- include('strings'),
- include('nl')
- ],
- 'tsqs': [
- (r"'''", String, '#pop'),
- include('strings'),
- include('nl')
- ],
- }
diff --git a/pygments/lexers/floscript.py b/pygments/lexers/floscript.py
deleted file mode 100644
index d5744331..00000000
--- a/pygments/lexers/floscript.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.floscript
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for FloScript
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['FloScriptLexer']
-
-
-class FloScriptLexer(RegexLexer):
- """
- For `FloScript <https://github.com/ioflo/ioflo>`_ configuration language source code.
-
- .. versionadded:: 2.4
- """
-
- name = 'FloScript'
- aliases = ['floscript', 'flo']
- filenames = ['*.flo']
-
- def innerstring_rules(ttype):
- return [
- # the old style '%s' % (...) string formatting
- (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
- '[hlL]?[E-GXc-giorsux%]', String.Interpol),
- # backslashes, quotes and formatting signs must be parsed one at a time
- (r'[^\\\'"%\n]+', ttype),
- (r'[\'"\\]', ttype),
- # unhandled string formatting sign
- (r'%', ttype),
- # newlines are an error (use "nl" state)
- ]
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'[^\S\n]+', Text),
-
- (r'[]{}:(),;[]', Punctuation),
- (r'\\\n', Text),
- (r'\\', Text),
- (r'(to|by|with|from|per|for|cum|qua|via|as|at|in|of|on|re|is|if|be|into|'
- r'and|not)\b', Operator.Word),
- (r'!=|==|<<|>>|[-~+/*%=<>&^|.]', Operator),
- (r'(load|init|server|logger|log|loggee|first|over|under|next|done|timeout|'
- r'repeat|native|benter|enter|recur|exit|precur|renter|rexit|print|put|inc|'
- r'copy|set|aux|rear|raze|go|let|do|bid|ready|start|stop|run|abort|use|flo|'
- r'give|take)\b', Name.Builtin),
- (r'(frame|framer|house)\b', Keyword),
- ('"', String, 'string'),
-
- include('name'),
- include('numbers'),
- (r'#.+$', Comment.Singleline),
- ],
- 'string': [
- ('[^"]+', String),
- ('"', String, '#pop'),
- ],
- 'numbers': [
- (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[bB][01]+', Number.Bin),
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
- (r'\d+L', Number.Integer.Long),
- (r'\d+j?', Number.Integer)
- ],
-
- 'name': [
- (r'@[\w.]+', Name.Decorator),
- (r'[a-zA-Z_]\w*', Name),
- ],
- }
diff --git a/pygments/lexers/forth.py b/pygments/lexers/forth.py
deleted file mode 100644
index 934bf478..00000000
--- a/pygments/lexers/forth.py
+++ /dev/null
@@ -1,179 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.forth
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Forth language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups
-from pygments.token import Error, Punctuation, Literal, Token, \
- Text, Comment, Operator, Keyword, Name, String, Number, Generic
-
-
-__all__ = ['ForthLexer']
-
-
-class ForthLexer(RegexLexer):
- """
- Lexer for Forth files.
-
- .. versionadded:: 2.2
- """
- name = 'Forth'
- aliases = ['forth']
- filenames = ['*.frt', '*.fs']
- mimetypes = ['application/x-forth']
-
- delimiter = r'\s'
- delimiter_end = r'(?=[%s])' % delimiter
-
- valid_name_chars = r'[^%s]' % delimiter
- valid_name = r"%s+%s" % (valid_name_chars, delimiter_end)
-
- flags = re.IGNORECASE | re.MULTILINE
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- # All comment types
- (r'\\.*?\n', Comment.Single),
- (r'\([\s].*?\)', Comment.Single),
- # defining words. The next word is a new command name
- (r'(:|variable|constant|value|buffer:)(\s+)',
- bygroups(Keyword.Namespace, Text), 'worddef'),
- # strings are rather simple
- (r'([.sc]")(\s+?)', bygroups(String, Text), 'stringdef'),
- # keywords from the various wordsets
- # *** Wordset BLOCK
- (r'(blk|block|buffer|evaluate|flush|load|save-buffers|update|'
- # *** Wordset BLOCK-EXT
- r'empty-buffers|list|refill|scr|thru|'
- # *** Wordset CORE
- r'\#s|\*\/mod|\+loop|\/mod|0<|0=|1\+|1-|2!|'
- r'2\*|2\/|2@|2drop|2dup|2over|2swap|>body|'
- r'>in|>number|>r|\?dup|abort|abort\"|abs|'
- r'accept|align|aligned|allot|and|base|begin|'
- r'bl|c!|c,|c@|cell\+|cells|char|char\+|'
- r'chars|constant|count|cr|create|decimal|'
- r'depth|do|does>|drop|dup|else|emit|environment\?|'
- r'evaluate|execute|exit|fill|find|fm\/mod|'
- r'here|hold|i|if|immediate|invert|j|key|'
- r'leave|literal|loop|lshift|m\*|max|min|'
- r'mod|move|negate|or|over|postpone|quit|'
- r'r>|r@|recurse|repeat|rot|rshift|s\"|s>d|'
- r'sign|sm\/rem|source|space|spaces|state|swap|'
- r'then|type|u\.|u\<|um\*|um\/mod|unloop|until|'
- r'variable|while|word|xor|\[char\]|\[\'\]|'
- r'@|!|\#|<\#|\#>|:|;|\+|-|\*|\/|,|<|>|\|1\+|1-|\.|'
- # *** Wordset CORE-EXT
- r'\.r|0<>|'
- r'0>|2>r|2r>|2r@|:noname|\?do|again|c\"|'
- r'case|compile,|endcase|endof|erase|false|'
- r'hex|marker|nip|of|pad|parse|pick|refill|'
- r'restore-input|roll|save-input|source-id|to|'
- r'true|tuck|u\.r|u>|unused|value|within|'
- r'\[compile\]|'
- # *** Wordset CORE-EXT-obsolescent
- r'\#tib|convert|expect|query|span|'
- r'tib|'
- # *** Wordset DOUBLE
- r'2constant|2literal|2variable|d\+|d-|'
- r'd\.|d\.r|d0<|d0=|d2\*|d2\/|d<|d=|d>s|'
- r'dabs|dmax|dmin|dnegate|m\*\/|m\+|'
- # *** Wordset DOUBLE-EXT
- r'2rot|du<|'
- # *** Wordset EXCEPTION
- r'catch|throw|'
- # *** Wordset EXCEPTION-EXT
- r'abort|abort\"|'
- # *** Wordset FACILITY
- r'at-xy|key\?|page|'
- # *** Wordset FACILITY-EXT
- r'ekey|ekey>char|ekey\?|emit\?|ms|time&date|'
- # *** Wordset FILE
- r'BIN|CLOSE-FILE|CREATE-FILE|DELETE-FILE|FILE-POSITION|'
- r'FILE-SIZE|INCLUDE-FILE|INCLUDED|OPEN-FILE|R\/O|'
- r'R\/W|READ-FILE|READ-LINE|REPOSITION-FILE|RESIZE-FILE|'
- r'S\"|SOURCE-ID|W/O|WRITE-FILE|WRITE-LINE|'
- # *** Wordset FILE-EXT
- r'FILE-STATUS|FLUSH-FILE|REFILL|RENAME-FILE|'
- # *** Wordset FLOAT
- r'>float|d>f|'
- r'f!|f\*|f\+|f-|f\/|f0<|f0=|f<|f>d|f@|'
- r'falign|faligned|fconstant|fdepth|fdrop|fdup|'
- r'fliteral|float\+|floats|floor|fmax|fmin|'
- r'fnegate|fover|frot|fround|fswap|fvariable|'
- r'represent|'
- # *** Wordset FLOAT-EXT
- r'df!|df@|dfalign|dfaligned|dfloat\+|'
- r'dfloats|f\*\*|f\.|fabs|facos|facosh|falog|'
- r'fasin|fasinh|fatan|fatan2|fatanh|fcos|fcosh|'
- r'fe\.|fexp|fexpm1|fln|flnp1|flog|fs\.|fsin|'
- r'fsincos|fsinh|fsqrt|ftan|ftanh|f~|precision|'
- r'set-precision|sf!|sf@|sfalign|sfaligned|sfloat\+|'
- r'sfloats|'
- # *** Wordset LOCAL
- r'\(local\)|to|'
- # *** Wordset LOCAL-EXT
- r'locals\||'
- # *** Wordset MEMORY
- r'allocate|free|resize|'
- # *** Wordset SEARCH
- r'definitions|find|forth-wordlist|get-current|'
- r'get-order|search-wordlist|set-current|set-order|'
- r'wordlist|'
- # *** Wordset SEARCH-EXT
- r'also|forth|only|order|previous|'
- # *** Wordset STRING
- r'-trailing|\/string|blank|cmove|cmove>|compare|'
- r'search|sliteral|'
- # *** Wordset TOOLS
- r'.s|dump|see|words|'
- # *** Wordset TOOLS-EXT
- r';code|'
- r'ahead|assembler|bye|code|cs-pick|cs-roll|'
- r'editor|state|\[else\]|\[if\]|\[then\]|'
- # *** Wordset TOOLS-EXT-obsolescent
- r'forget|'
- # Forth 2012
- r'defer|defer@|defer!|action-of|begin-structure|field:|buffer:|'
- r'parse-name|buffer:|traverse-wordlist|n>r|nr>|2value|fvalue|'
- r'name>interpret|name>compile|name>string|'
- r'cfield:|end-structure)'+delimiter, Keyword),
-
- # Numbers
- (r'(\$[0-9A-F]+)', Number.Hex),
- (r'(\#|%|&|\-|\+)?[0-9]+', Number.Integer),
- (r'(\#|%|&|\-|\+)?[0-9.]+', Keyword.Type),
- # amforth specific
- (r'(@i|!i|@e|!e|pause|noop|turnkey|sleep|'
- r'itype|icompare|sp@|sp!|rp@|rp!|up@|up!|'
- r'>a|a>|a@|a!|a@+|a@-|>b|b>|b@|b!|b@+|b@-|'
- r'find-name|1ms|'
- r'sp0|rp0|\(evaluate\)|int-trap|int!)' + delimiter,
- Name.Constant),
- # a proposal
- (r'(do-recognizer|r:fail|recognizer:|get-recognizers|'
- r'set-recognizers|r:float|r>comp|r>int|r>post|'
- r'r:name|r:word|r:dnum|r:num|recognizer|forth-recognizer|'
- r'rec:num|rec:float|rec:word)' + delimiter, Name.Decorator),
- # defining words. The next word is a new command name
- (r'(Evalue|Rvalue|Uvalue|Edefer|Rdefer|Udefer)(\s+)',
- bygroups(Keyword.Namespace, Text), 'worddef'),
-
- (valid_name, Name.Function), # Anything else is executed
-
- ],
- 'worddef': [
- (r'\S+', Name.Class, '#pop'),
- ],
- 'stringdef': [
- (r'[^"]+', String, '#pop'),
- ],
- }
diff --git a/pygments/lexers/fortran.py b/pygments/lexers/fortran.py
deleted file mode 100644
index 4f5c3b25..00000000
--- a/pygments/lexers/fortran.py
+++ /dev/null
@@ -1,206 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.fortran
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Fortran languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, include, words, using, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic
-
-__all__ = ['FortranLexer', 'FortranFixedLexer']
-
-
-class FortranLexer(RegexLexer):
- """
- Lexer for FORTRAN 90 code.
-
- .. versionadded:: 0.10
- """
- name = 'Fortran'
- aliases = ['fortran']
- filenames = ['*.f03', '*.f90', '*.F03', '*.F90']
- mimetypes = ['text/x-fortran']
- flags = re.IGNORECASE | re.MULTILINE
-
- # Data Types: INTEGER, REAL, COMPLEX, LOGICAL, CHARACTER and DOUBLE PRECISION
- # Operators: **, *, +, -, /, <, >, <=, >=, ==, /=
- # Logical (?): NOT, AND, OR, EQV, NEQV
-
- # Builtins:
- # http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Table-of-Intrinsic-Functions.html
-
- tokens = {
- 'root': [
- (r'^#.*\n', Comment.Preproc),
- (r'!.*\n', Comment),
- include('strings'),
- include('core'),
- (r'[a-z][\w$]*', Name),
- include('nums'),
- (r'[\s]+', Text),
- ],
- 'core': [
- # Statements
- (words((
- 'ABSTRACT', 'ACCEPT', 'ALL', 'ALLSTOP', 'ALLOCATABLE', 'ALLOCATE',
- 'ARRAY', 'ASSIGN', 'ASSOCIATE', 'ASYNCHRONOUS', 'BACKSPACE', 'BIND',
- 'BLOCK', 'BLOCKDATA', 'BYTE', 'CALL', 'CASE', 'CLASS', 'CLOSE',
- 'CODIMENSION', 'COMMON', 'CONCURRRENT', 'CONTIGUOUS', 'CONTAINS',
- 'CONTINUE', 'CRITICAL', 'CYCLE', 'DATA', 'DEALLOCATE', 'DECODE',
- 'DEFERRED', 'DIMENSION', 'DO', 'ELEMENTAL', 'ELSE', 'ENCODE', 'END',
- 'ENTRY', 'ENUM', 'ENUMERATOR', 'EQUIVALENCE', 'EXIT', 'EXTENDS',
- 'EXTERNAL', 'EXTRINSIC', 'FILE', 'FINAL', 'FORALL', 'FORMAT',
- 'FUNCTION', 'GENERIC', 'GOTO', 'IF', 'IMAGES', 'IMPLICIT',
- 'IMPORT', 'IMPURE', 'INCLUDE', 'INQUIRE', 'INTENT', 'INTERFACE',
- 'INTRINSIC', 'IS', 'LOCK', 'MEMORY', 'MODULE', 'NAMELIST', 'NULLIFY',
- 'NONE', 'NON_INTRINSIC', 'NON_OVERRIDABLE', 'NOPASS', 'OPEN', 'OPTIONAL',
- 'OPTIONS', 'PARAMETER', 'PASS', 'PAUSE', 'POINTER', 'PRINT', 'PRIVATE',
- 'PROGRAM', 'PROCEDURE', 'PROTECTED', 'PUBLIC', 'PURE', 'READ',
- 'RECURSIVE', 'RESULT', 'RETURN', 'REWIND', 'SAVE', 'SELECT', 'SEQUENCE',
- 'STOP', 'SUBMODULE', 'SUBROUTINE', 'SYNC', 'SYNCALL', 'SYNCIMAGES',
- 'SYNCMEMORY', 'TARGET', 'THEN', 'TYPE', 'UNLOCK', 'USE', 'VALUE',
- 'VOLATILE', 'WHERE', 'WRITE', 'WHILE'), prefix=r'\b', suffix=r'\s*\b'),
- Keyword),
-
- # Data Types
- (words((
- 'CHARACTER', 'COMPLEX', 'DOUBLE PRECISION', 'DOUBLE COMPLEX', 'INTEGER',
- 'LOGICAL', 'REAL', 'C_INT', 'C_SHORT', 'C_LONG', 'C_LONG_LONG',
- 'C_SIGNED_CHAR', 'C_SIZE_T', 'C_INT8_T', 'C_INT16_T', 'C_INT32_T',
- 'C_INT64_T', 'C_INT_LEAST8_T', 'C_INT_LEAST16_T', 'C_INT_LEAST32_T',
- 'C_INT_LEAST64_T', 'C_INT_FAST8_T', 'C_INT_FAST16_T', 'C_INT_FAST32_T',
- 'C_INT_FAST64_T', 'C_INTMAX_T', 'C_INTPTR_T', 'C_FLOAT', 'C_DOUBLE',
- 'C_LONG_DOUBLE', 'C_FLOAT_COMPLEX', 'C_DOUBLE_COMPLEX',
- 'C_LONG_DOUBLE_COMPLEX', 'C_BOOL', 'C_CHAR', 'C_PTR', 'C_FUNPTR'),
- prefix=r'\b', suffix=r'\s*\b'),
- Keyword.Type),
-
- # Operators
- (r'(\*\*|\*|\+|-|\/|<|>|<=|>=|==|\/=|=)', Operator),
-
- (r'(::)', Keyword.Declaration),
-
- (r'[()\[\],:&%;.]', Punctuation),
- # Intrinsics
- (words((
- 'Abort', 'Abs', 'Access', 'AChar', 'ACos', 'ACosH', 'AdjustL',
- 'AdjustR', 'AImag', 'AInt', 'Alarm', 'All', 'Allocated', 'ALog',
- 'AMax', 'AMin', 'AMod', 'And', 'ANInt', 'Any', 'ASin', 'ASinH',
- 'Associated', 'ATan', 'ATanH', 'Atomic_Define', 'Atomic_Ref',
- 'BesJ', 'BesJN', 'Bessel_J0', 'Bessel_J1', 'Bessel_JN', 'Bessel_Y0',
- 'Bessel_Y1', 'Bessel_YN', 'BesY', 'BesYN', 'BGE', 'BGT', 'BLE',
- 'BLT', 'Bit_Size', 'BTest', 'CAbs', 'CCos', 'Ceiling', 'CExp',
- 'Char', 'ChDir', 'ChMod', 'CLog', 'Cmplx', 'Command_Argument_Count',
- 'Complex', 'Conjg', 'Cos', 'CosH', 'Count', 'CPU_Time', 'CShift',
- 'CSin', 'CSqRt', 'CTime', 'C_Loc', 'C_Associated',
- 'C_Null_Ptr', 'C_Null_Funptr', 'C_F_Pointer', 'C_F_ProcPointer',
- 'C_Null_Char', 'C_Alert', 'C_Backspace', 'C_Form_Feed', 'C_FunLoc',
- 'C_Sizeof', 'C_New_Line', 'C_Carriage_Return',
- 'C_Horizontal_Tab', 'C_Vertical_Tab', 'DAbs', 'DACos', 'DASin',
- 'DATan', 'Date_and_Time', 'DbesJ', 'DbesJN', 'DbesY',
- 'DbesYN', 'Dble', 'DCos', 'DCosH', 'DDiM', 'DErF',
- 'DErFC', 'DExp', 'Digits', 'DiM', 'DInt', 'DLog', 'DMax',
- 'DMin', 'DMod', 'DNInt', 'Dot_Product', 'DProd', 'DSign', 'DSinH',
- 'DShiftL', 'DShiftR', 'DSin', 'DSqRt', 'DTanH', 'DTan', 'DTime',
- 'EOShift', 'Epsilon', 'ErF', 'ErFC', 'ErFC_Scaled', 'ETime',
- 'Execute_Command_Line', 'Exit', 'Exp', 'Exponent', 'Extends_Type_Of',
- 'FDate', 'FGet', 'FGetC', 'FindLoc', 'Float', 'Floor', 'Flush',
- 'FNum', 'FPutC', 'FPut', 'Fraction', 'FSeek', 'FStat', 'FTell',
- 'Gamma', 'GError', 'GetArg', 'Get_Command', 'Get_Command_Argument',
- 'Get_Environment_Variable', 'GetCWD', 'GetEnv', 'GetGId', 'GetLog',
- 'GetPId', 'GetUId', 'GMTime', 'HostNm', 'Huge', 'Hypot', 'IAbs',
- 'IAChar', 'IAll', 'IAnd', 'IAny', 'IArgC', 'IBClr', 'IBits',
- 'IBSet', 'IChar', 'IDate', 'IDiM', 'IDInt', 'IDNInt', 'IEOr',
- 'IErrNo', 'IFix', 'Imag', 'ImagPart', 'Image_Index', 'Index',
- 'Int', 'IOr', 'IParity', 'IRand', 'IsaTty', 'IShft', 'IShftC',
- 'ISign', 'Iso_C_Binding', 'Is_Contiguous', 'Is_Iostat_End',
- 'Is_Iostat_Eor', 'ITime', 'Kill', 'Kind', 'LBound', 'LCoBound',
- 'Len', 'Len_Trim', 'LGe', 'LGt', 'Link', 'LLe', 'LLt', 'LnBlnk',
- 'Loc', 'Log', 'Log_Gamma', 'Logical', 'Long', 'LShift', 'LStat',
- 'LTime', 'MaskL', 'MaskR', 'MatMul', 'Max', 'MaxExponent',
- 'MaxLoc', 'MaxVal', 'MClock', 'Merge', 'Merge_Bits', 'Move_Alloc',
- 'Min', 'MinExponent', 'MinLoc', 'MinVal', 'Mod', 'Modulo', 'MvBits',
- 'Nearest', 'New_Line', 'NInt', 'Norm2', 'Not', 'Null', 'Num_Images',
- 'Or', 'Pack', 'Parity', 'PError', 'Precision', 'Present', 'Product',
- 'Radix', 'Rand', 'Random_Number', 'Random_Seed', 'Range', 'Real',
- 'RealPart', 'Rename', 'Repeat', 'Reshape', 'RRSpacing', 'RShift',
- 'Same_Type_As', 'Scale', 'Scan', 'Second', 'Selected_Char_Kind',
- 'Selected_Int_Kind', 'Selected_Real_Kind', 'Set_Exponent', 'Shape',
- 'ShiftA', 'ShiftL', 'ShiftR', 'Short', 'Sign', 'Signal', 'SinH',
- 'Sin', 'Sleep', 'Sngl', 'Spacing', 'Spread', 'SqRt', 'SRand',
- 'Stat', 'Storage_Size', 'Sum', 'SymLnk', 'System', 'System_Clock',
- 'Tan', 'TanH', 'Time', 'This_Image', 'Tiny', 'TrailZ', 'Transfer',
- 'Transpose', 'Trim', 'TtyNam', 'UBound', 'UCoBound', 'UMask',
- 'Unlink', 'Unpack', 'Verify', 'XOr', 'ZAbs', 'ZCos', 'ZExp',
- 'ZLog', 'ZSin', 'ZSqRt'), prefix=r'\b', suffix=r'\s*\b'),
- Name.Builtin),
-
- # Booleans
- (r'\.(true|false)\.', Name.Builtin),
- # Comparing Operators
- (r'\.(eq|ne|lt|le|gt|ge|not|and|or|eqv|neqv)\.', Operator.Word),
- ],
-
- 'strings': [
- (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
- (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
- ],
-
- 'nums': [
- (r'\d+(?![.e])(_[a-z]\w+)?', Number.Integer),
- (r'[+-]?\d*\.\d+([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float),
- (r'[+-]?\d+\.\d*([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float),
- (r'[+-]?\d+(\.\d*)?[ed][-+]?\d+(_[a-z]\w+)?', Number.Float),
- ],
- }
-
-
-class FortranFixedLexer(RegexLexer):
- """
- Lexer for fixed format Fortran.
-
- .. versionadded:: 2.1
- """
- name = 'FortranFixed'
- aliases = ['fortranfixed']
- filenames = ['*.f', '*.F']
-
- flags = re.IGNORECASE
-
- def _lex_fortran(self, match, ctx=None):
- """Lex a line just as free form fortran without line break."""
- lexer = FortranLexer()
- text = match.group(0) + "\n"
- for index, token, value in lexer.get_tokens_unprocessed(text):
- value = value.replace('\n', '')
- if value != '':
- yield index, token, value
-
- tokens = {
- 'root': [
- (r'[C*].*\n', Comment),
- (r'#.*\n', Comment.Preproc),
- (r' {0,4}!.*\n', Comment),
- (r'(.{5})', Name.Label, 'cont-char'),
- (r'.*\n', using(FortranLexer)),
- ],
- 'cont-char': [
- (' ', Text, 'code'),
- ('0', Comment, 'code'),
- ('.', Generic.Strong, 'code'),
- ],
- 'code': [
- (r'(.{66})(.*)(\n)',
- bygroups(_lex_fortran, Comment, Text), 'root'),
- (r'(.*)(\n)', bygroups(_lex_fortran, Text), 'root'),
- default('root'),
- ]
- }
diff --git a/pygments/lexers/foxpro.py b/pygments/lexers/foxpro.py
deleted file mode 100644
index 868a44d8..00000000
--- a/pygments/lexers/foxpro.py
+++ /dev/null
@@ -1,428 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.foxpro
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Simple lexer for Microsoft Visual FoxPro source code.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer
-from pygments.token import Punctuation, Text, Comment, Operator, Keyword, \
- Name, String
-
-__all__ = ['FoxProLexer']
-
-
-class FoxProLexer(RegexLexer):
- """Lexer for Microsoft Visual FoxPro language.
-
- FoxPro syntax allows to shorten all keywords and function names
- to 4 characters. Shortened forms are not recognized by this lexer.
-
- .. versionadded:: 1.6
- """
-
- name = 'FoxPro'
- aliases = ['foxpro', 'vfp', 'clipper', 'xbase']
- filenames = ['*.PRG', '*.prg']
- mimetype = []
-
- flags = re.IGNORECASE | re.MULTILINE
-
- tokens = {
- 'root': [
- (r';\s*\n', Punctuation), # consume newline
- (r'(^|\n)\s*', Text, 'newline'),
-
- # Square brackets may be used for array indices
- # and for string literal. Look for arrays
- # before matching string literals.
- (r'(?<=\w)\[[0-9, ]+\]', Text),
- (r'\'[^\'\n]*\'|"[^"\n]*"|\[[^]*]\]', String),
- (r'(^\s*\*|&&|&amp;&amp;).*?\n', Comment.Single),
-
- (r'(ABS|ACLASS|ACOPY|ACOS|ADATABASES|ADBOBJECTS|ADDBS|'
- r'ADDPROPERTY|ADEL|ADIR|ADLLS|ADOCKSTATE|AELEMENT|AERROR|'
- r'AEVENTS|AFIELDS|AFONT|AGETCLASS|AGETFILEVERSION|AINS|'
- r'AINSTANCE|ALANGUAGE|ALEN|ALIAS|ALINES|ALLTRIM|'
- r'AMEMBERS|AMOUSEOBJ|ANETRESOURCES|APRINTERS|APROCINFO|'
- r'ASC|ASCAN|ASELOBJ|ASESSIONS|ASIN|ASORT|ASQLHANDLES|'
- r'ASTACKINFO|ASUBSCRIPT|AT|AT_C|ATAGINFO|ATAN|ATC|ATCC|'
- r'ATCLINE|ATLINE|ATN2|AUSED|AVCXCLASSES|BAR|BARCOUNT|'
- r'BARPROMPT|BETWEEN|BINDEVENT|BINTOC|BITAND|BITCLEAR|'
- r'BITLSHIFT|BITNOT|BITOR|BITRSHIFT|BITSET|BITTEST|BITXOR|'
- r'BOF|CANDIDATE|CAPSLOCK|CAST|CDOW|CDX|CEILING|CHR|CHRSAW|'
- r'CHRTRAN|CHRTRANC|CLEARRESULTSET|CMONTH|CNTBAR|CNTPAD|COL|'
- r'COM|Functions|COMARRAY|COMCLASSINFO|COMPOBJ|COMPROP|'
- r'COMRETURNERROR|COS|CPCONVERT|CPCURRENT|CPDBF|CREATEBINARY|'
- r'CREATEOBJECT|CREATEOBJECTEX|CREATEOFFLINE|CTOBIN|CTOD|'
- r'CTOT|CURDIR|CURSORGETPROP|CURSORSETPROP|CURSORTOXML|'
- r'CURVAL|DATE|DATETIME|DAY|DBC|DBF|DBGETPROP|DBSETPROP|'
- r'DBUSED|DDEAbortTrans|DDEAdvise|DDEEnabled|DDEExecute|'
- r'DDEInitiate|DDELastError|DDEPoke|DDERequest|DDESetOption|'
- r'DDESetService|DDESetTopic|DDETerminate|DEFAULTEXT|'
- r'DELETED|DESCENDING|DIFFERENCE|DIRECTORY|DISKSPACE|'
- r'DisplayPath|DMY|DODEFAULT|DOW|DRIVETYPE|DROPOFFLINE|'
- r'DTOC|DTOR|DTOS|DTOT|EDITSOURCE|EMPTY|EOF|ERROR|EVAL(UATE)?|'
- r'EVENTHANDLER|EVL|EXECSCRIPT|EXP|FCHSIZE|FCLOSE|FCOUNT|'
- r'FCREATE|FDATE|FEOF|FERROR|FFLUSH|FGETS|FIELD|FILE|'
- r'FILETOSTR|FILTER|FKLABEL|FKMAX|FLDLIST|FLOCK|FLOOR|'
- r'FONTMETRIC|FOPEN|FOR|FORCEEXT|FORCEPATH|FOUND|FPUTS|'
- r'FREAD|FSEEK|FSIZE|FTIME|FULLPATH|FV|FWRITE|'
- r'GETAUTOINCVALUE|GETBAR|GETCOLOR|GETCP|GETDIR|GETENV|'
- r'GETFILE|GETFLDSTATE|GETFONT|GETINTERFACE|'
- r'GETNEXTMODIFIED|GETOBJECT|GETPAD|GETPEM|GETPICT|'
- r'GETPRINTER|GETRESULTSET|GETWORDCOUNT|GETWORDNUM|'
- r'GETCURSORADAPTER|GOMONTH|HEADER|HOME|HOUR|ICASE|'
- r'IDXCOLLATE|IIF|IMESTATUS|INDBC|INDEXSEEK|INKEY|INLIST|'
- r'INPUTBOX|INSMODE|INT|ISALPHA|ISBLANK|ISCOLOR|ISDIGIT|'
- r'ISEXCLUSIVE|ISFLOCKED|ISLEADBYTE|ISLOWER|ISMEMOFETCHED|'
- r'ISMOUSE|ISNULL|ISPEN|ISREADONLY|ISRLOCKED|'
- r'ISTRANSACTABLE|ISUPPER|JUSTDRIVE|JUSTEXT|JUSTFNAME|'
- r'JUSTPATH|JUSTSTEM|KEY|KEYMATCH|LASTKEY|LEFT|LEFTC|LEN|'
- r'LENC|LIKE|LIKEC|LINENO|LOADPICTURE|LOCFILE|LOCK|LOG|'
- r'LOG10|LOOKUP|LOWER|LTRIM|LUPDATE|MAKETRANSACTABLE|MAX|'
- r'MCOL|MDOWN|MDX|MDY|MEMLINES|MEMORY|MENU|MESSAGE|'
- r'MESSAGEBOX|MIN|MINUTE|MLINE|MOD|MONTH|MRKBAR|MRKPAD|'
- r'MROW|MTON|MWINDOW|NDX|NEWOBJECT|NORMALIZE|NTOM|NUMLOCK|'
- r'NVL|OBJNUM|OBJTOCLIENT|OBJVAR|OCCURS|OEMTOANSI|OLDVAL|'
- r'ON|ORDER|OS|PAD|PADL|PARAMETERS|PAYMENT|PCOL|PCOUNT|'
- r'PEMSTATUS|PI|POPUP|PRIMARY|PRINTSTATUS|PRMBAR|PRMPAD|'
- r'PROGRAM|PROMPT|PROPER|PROW|PRTINFO|PUTFILE|PV|QUARTER|'
- r'RAISEEVENT|RAND|RAT|RATC|RATLINE|RDLEVEL|READKEY|RECCOUNT|'
- r'RECNO|RECSIZE|REFRESH|RELATION|REPLICATE|REQUERY|RGB|'
- r'RGBSCHEME|RIGHT|RIGHTC|RLOCK|ROUND|ROW|RTOD|RTRIM|'
- r'SAVEPICTURE|SCHEME|SCOLS|SEC|SECONDS|SEEK|SELECT|SET|'
- r'SETFLDSTATE|SETRESULTSET|SIGN|SIN|SKPBAR|SKPPAD|SOUNDEX|'
- r'SPACE|SQLCANCEL|SQLCOLUMNS|SQLCOMMIT|SQLCONNECT|'
- r'SQLDISCONNECT|SQLEXEC|SQLGETPROP|SQLIDLEDISCONNECT|'
- r'SQLMORERESULTS|SQLPREPARE|SQLROLLBACK|SQLSETPROP|'
- r'SQLSTRINGCONNECT|SQLTABLES|SQRT|SROWS|STR|STRCONV|'
- r'STREXTRACT|STRTOFILE|STRTRAN|STUFF|STUFFC|SUBSTR|'
- r'SUBSTRC|SYS|SYSMETRIC|TABLEREVERT|TABLEUPDATE|TAG|'
- r'TAGCOUNT|TAGNO|TAN|TARGET|TEXTMERGE|TIME|TRANSFORM|'
- r'TRIM|TTOC|TTOD|TXNLEVEL|TXTWIDTH|TYPE|UNBINDEVENTS|'
- r'UNIQUE|UPDATED|UPPER|USED|VAL|VARREAD|VARTYPE|VERSION|'
- r'WBORDER|WCHILD|WCOLS|WDOCKABLE|WEEK|WEXIST|WFONT|WLAST|'
- r'WLCOL|WLROW|WMAXIMUM|WMINIMUM|WONTOP|WOUTPUT|WPARENT|'
- r'WREAD|WROWS|WTITLE|WVISIBLE|XMLTOCURSOR|XMLUPDATEGRAM|'
- r'YEAR)(?=\s*\()', Name.Function),
-
- (r'_ALIGNMENT|_ASCIICOLS|_ASCIIROWS|_ASSIST|_BEAUTIFY|_BOX|'
- r'_BROWSER|_BUILDER|_CALCMEM|_CALCVALUE|_CLIPTEXT|_CONVERTER|'
- r'_COVERAGE|_CUROBJ|_DBLCLICK|_DIARYDATE|_DOS|_FOXDOC|_FOXREF|'
- r'_GALLERY|_GENGRAPH|_GENHTML|_GENMENU|_GENPD|_GENSCRN|'
- r'_GENXTAB|_GETEXPR|_INCLUDE|_INCSEEK|_INDENT|_LMARGIN|_MAC|'
- r'_MENUDESIGNER|_MLINE|_PADVANCE|_PAGENO|_PAGETOTAL|_PBPAGE|'
- r'_PCOLNO|_PCOPIES|_PDRIVER|_PDSETUP|_PECODE|_PEJECT|_PEPAGE|'
- r'_PLENGTH|_PLINENO|_PLOFFSET|_PPITCH|_PQUALITY|_PRETEXT|'
- r'_PSCODE|_PSPACING|_PWAIT|_RMARGIN|_REPORTBUILDER|'
- r'_REPORTOUTPUT|_REPORTPREVIEW|_SAMPLES|_SCCTEXT|_SCREEN|'
- r'_SHELL|_SPELLCHK|_STARTUP|_TABS|_TALLY|_TASKPANE|_TEXT|'
- r'_THROTTLE|_TOOLBOX|_TOOLTIPTIMEOUT|_TRANSPORT|_TRIGGERLEVEL|'
- r'_UNIX|_VFP|_WINDOWS|_WIZARD|_WRAP', Keyword.Pseudo),
-
- (r'THISFORMSET|THISFORM|THIS', Name.Builtin),
-
- (r'Application|CheckBox|Collection|Column|ComboBox|'
- r'CommandButton|CommandGroup|Container|Control|CursorAdapter|'
- r'Cursor|Custom|DataEnvironment|DataObject|EditBox|'
- r'Empty|Exception|Fields|Files|File|FormSet|Form|FoxCode|'
- r'Grid|Header|Hyperlink|Image|Label|Line|ListBox|Objects|'
- r'OptionButton|OptionGroup|PageFrame|Page|ProjectHook|Projects|'
- r'Project|Relation|ReportListener|Separator|Servers|Server|'
- r'Session|Shape|Spinner|Tables|TextBox|Timer|ToolBar|'
- r'XMLAdapter|XMLField|XMLTable', Name.Class),
-
- (r'm\.[a-z_]\w*', Name.Variable),
- (r'\.(F|T|AND|OR|NOT|NULL)\.|\b(AND|OR|NOT|NULL)\b', Operator.Word),
-
- (r'\.(ActiveColumn|ActiveControl|ActiveForm|ActivePage|'
- r'ActiveProject|ActiveRow|AddLineFeeds|ADOCodePage|Alias|'
- r'Alignment|Align|AllowAddNew|AllowAutoColumnFit|'
- r'AllowCellSelection|AllowDelete|AllowHeaderSizing|'
- r'AllowInsert|AllowModalMessages|AllowOutput|AllowRowSizing|'
- r'AllowSimultaneousFetch|AllowTabs|AllowUpdate|'
- r'AlwaysOnBottom|AlwaysOnTop|Anchor|Application|'
- r'AutoActivate|AutoCenter|AutoCloseTables|AutoComplete|'
- r'AutoCompSource|AutoCompTable|AutoHideScrollBar|'
- r'AutoIncrement|AutoOpenTables|AutoRelease|AutoSize|'
- r'AutoVerbMenu|AutoYield|BackColor|ForeColor|BackStyle|'
- r'BaseClass|BatchUpdateCount|BindControls|BorderColor|'
- r'BorderStyle|BorderWidth|BoundColumn|BoundTo|Bound|'
- r'BreakOnError|BufferModeOverride|BufferMode|'
- r'BuildDateTime|ButtonCount|Buttons|Cancel|Caption|'
- r'Centered|Century|ChildAlias|ChildOrder|ChildTable|'
- r'ClassLibrary|Class|ClipControls|Closable|CLSID|CodePage|'
- r'ColorScheme|ColorSource|ColumnCount|ColumnLines|'
- r'ColumnOrder|Columns|ColumnWidths|CommandClauses|'
- r'Comment|CompareMemo|ConflictCheckCmd|ConflictCheckType|'
- r'ContinuousScroll|ControlBox|ControlCount|Controls|'
- r'ControlSource|ConversionFunc|Count|CurrentControl|'
- r'CurrentDataSession|CurrentPass|CurrentX|CurrentY|'
- r'CursorSchema|CursorSource|CursorStatus|Curvature|'
- r'Database|DataSessionID|DataSession|DataSourceType|'
- r'DataSource|DataType|DateFormat|DateMark|Debug|'
- r'DeclareXMLPrefix|DEClassLibrary|DEClass|DefaultFilePath|'
- r'Default|DefOLELCID|DeleteCmdDataSourceType|DeleteCmdDataSource|'
- r'DeleteCmd|DeleteMark|Description|Desktop|'
- r'Details|DisabledBackColor|DisabledForeColor|'
- r'DisabledItemBackColor|DisabledItemForeColor|'
- r'DisabledPicture|DisableEncode|DisplayCount|'
- r'DisplayValue|Dockable|Docked|DockPosition|'
- r'DocumentFile|DownPicture|DragIcon|DragMode|DrawMode|'
- r'DrawStyle|DrawWidth|DynamicAlignment|DynamicBackColor|'
- r'DynamicForeColor|DynamicCurrentControl|DynamicFontBold|'
- r'DynamicFontItalic|DynamicFontStrikethru|'
- r'DynamicFontUnderline|DynamicFontName|DynamicFontOutline|'
- r'DynamicFontShadow|DynamicFontSize|DynamicInputMask|'
- r'DynamicLineHeight|EditorOptions|Enabled|'
- r'EnableHyperlinks|Encrypted|ErrorNo|Exclude|Exclusive|'
- r'FetchAsNeeded|FetchMemoCmdList|FetchMemoDataSourceType|'
- r'FetchMemoDataSource|FetchMemo|FetchSize|'
- r'FileClassLibrary|FileClass|FillColor|FillStyle|Filter|'
- r'FirstElement|FirstNestedTable|Flags|FontBold|FontItalic|'
- r'FontStrikethru|FontUnderline|FontCharSet|FontCondense|'
- r'FontExtend|FontName|FontOutline|FontShadow|FontSize|'
- r'ForceCloseTag|Format|FormCount|FormattedOutput|Forms|'
- r'FractionDigits|FRXDataSession|FullName|GDIPlusGraphics|'
- r'GridLineColor|GridLines|GridLineWidth|HalfHeightCaption|'
- r'HeaderClassLibrary|HeaderClass|HeaderHeight|Height|'
- r'HelpContextID|HideSelection|HighlightBackColor|'
- r'HighlightForeColor|HighlightStyle|HighlightRowLineWidth|'
- r'HighlightRow|Highlight|HomeDir|Hours|HostName|'
- r'HScrollSmallChange|hWnd|Icon|IncrementalSearch|Increment|'
- r'InitialSelectedAlias|InputMask|InsertCmdDataSourceType|'
- r'InsertCmdDataSource|InsertCmdRefreshCmd|'
- r'InsertCmdRefreshFieldList|InsertCmdRefreshKeyFieldList|'
- r'InsertCmd|Instancing|IntegralHeight|'
- r'Interval|IMEMode|IsAttribute|IsBase64|IsBinary|IsNull|'
- r'IsDiffGram|IsLoaded|ItemBackColor,|ItemData|ItemIDData|'
- r'ItemTips|IXMLDOMElement|KeyboardHighValue|KeyboardLowValue|'
- r'Keyfield|KeyFieldList|KeyPreview|KeySort|LanguageOptions|'
- r'LeftColumn|Left|LineContents|LineNo|LineSlant|LinkMaster|'
- r'ListCount|ListenerType|ListIndex|ListItemID|ListItem|'
- r'List|LockColumnsLeft|LockColumns|LockScreen|MacDesktop|'
- r'MainFile|MapN19_4ToCurrency|MapBinary|MapVarchar|Margin|'
- r'MaxButton|MaxHeight|MaxLeft|MaxLength|MaxRecords|MaxTop|'
- r'MaxWidth|MDIForm|MemberClassLibrary|MemberClass|'
- r'MemoWindow|Message|MinButton|MinHeight|MinWidth|'
- r'MouseIcon|MousePointer|Movable|MoverBars|MultiSelect|'
- r'Name|NestedInto|NewIndex|NewItemID|NextSiblingTable|'
- r'NoCpTrans|NoDataOnLoad|NoData|NullDisplay|'
- r'NumberOfElements|Object|OLEClass|OLEDragMode|'
- r'OLEDragPicture|OLEDropEffects|OLEDropHasData|'
- r'OLEDropMode|OLEDropTextInsertion|OLELCID|'
- r'OLERequestPendingTimeout|OLEServerBusyRaiseError|'
- r'OLEServerBusyTimeout|OLETypeAllowed|OneToMany|'
- r'OpenViews|OpenWindow|Optimize|OrderDirection|Order|'
- r'OutputPageCount|OutputType|PageCount|PageHeight|'
- r'PageNo|PageOrder|Pages|PageTotal|PageWidth|'
- r'PanelLink|Panel|ParentAlias|ParentClass|ParentTable|'
- r'Parent|Partition|PasswordChar|PictureMargin|'
- r'PicturePosition|PictureSpacing|PictureSelectionDisplay|'
- r'PictureVal|Picture|Prepared|'
- r'PolyPoints|PreserveWhiteSpace|PreviewContainer|'
- r'PrintJobName|Procedure|PROCESSID|ProgID|ProjectHookClass|'
- r'ProjectHookLibrary|ProjectHook|QuietMode|'
- r'ReadCycle|ReadLock|ReadMouse|ReadObject|ReadOnly|'
- r'ReadSave|ReadTimeout|RecordMark|RecordSourceType|'
- r'RecordSource|RefreshAlias|'
- r'RefreshCmdDataSourceType|RefreshCmdDataSource|RefreshCmd|'
- r'RefreshIgnoreFieldList|RefreshTimeStamp|RelationalExpr|'
- r'RelativeColumn|RelativeRow|ReleaseType|Resizable|'
- r'RespectCursorCP|RespectNesting|RightToLeft|RotateFlip|'
- r'Rotation|RowColChange|RowHeight|RowSourceType|'
- r'RowSource|ScaleMode|SCCProvider|SCCStatus|ScrollBars|'
- r'Seconds|SelectCmd|SelectedID|'
- r'SelectedItemBackColor|SelectedItemForeColor|Selected|'
- r'SelectionNamespaces|SelectOnEntry|SelLength|SelStart|'
- r'SelText|SendGDIPlusImage|SendUpdates|ServerClassLibrary|'
- r'ServerClass|ServerHelpFile|ServerName|'
- r'ServerProject|ShowTips|ShowInTaskbar|ShowWindow|'
- r'Sizable|SizeBox|SOM|Sorted|Sparse|SpecialEffect|'
- r'SpinnerHighValue|SpinnerLowValue|SplitBar|StackLevel|'
- r'StartMode|StatusBarText|StatusBar|Stretch|StrictDateEntry|'
- r'Style|TabIndex|Tables|TabOrientation|Tabs|TabStop|'
- r'TabStretch|TabStyle|Tag|TerminateRead|Text|Themes|'
- r'ThreadID|TimestampFieldList|TitleBar|ToolTipText|'
- r'TopIndex|TopItemID|Top|TwoPassProcess|TypeLibCLSID|'
- r'TypeLibDesc|TypeLibName|Type|Unicode|UpdatableFieldList|'
- r'UpdateCmdDataSourceType|UpdateCmdDataSource|'
- r'UpdateCmdRefreshCmd|UpdateCmdRefreshFieldList|'
- r'UpdateCmdRefreshKeyFieldList|UpdateCmd|'
- r'UpdateGramSchemaLocation|UpdateGram|UpdateNameList|UpdateType|'
- r'UseCodePage|UseCursorSchema|UseDeDataSource|UseMemoSize|'
- r'UserValue|UseTransactions|UTF8Encoded|Value|VersionComments|'
- r'VersionCompany|VersionCopyright|VersionDescription|'
- r'VersionNumber|VersionProduct|VersionTrademarks|Version|'
- r'VFPXMLProgID|ViewPortHeight|ViewPortLeft|'
- r'ViewPortTop|ViewPortWidth|VScrollSmallChange|View|Visible|'
- r'VisualEffect|WhatsThisButton|WhatsThisHelpID|WhatsThisHelp|'
- r'WhereType|Width|WindowList|WindowState|WindowType|WordWrap|'
- r'WrapCharInCDATA|WrapInCDATA|WrapMemoInCDATA|XMLAdapter|'
- r'XMLConstraints|XMLNameIsXPath|XMLNamespace|XMLName|'
- r'XMLPrefix|XMLSchemaLocation|XMLTable|XMLType|'
- r'XSDfractionDigits|XSDmaxLength|XSDtotalDigits|'
- r'XSDtype|ZoomBox)', Name.Attribute),
-
- (r'\.(ActivateCell|AddColumn|AddItem|AddListItem|AddObject|'
- r'AddProperty|AddTableSchema|AddToSCC|Add|'
- r'ApplyDiffgram|Attach|AutoFit|AutoOpen|Box|Build|'
- r'CancelReport|ChangesToCursor|CheckIn|CheckOut|Circle|'
- r'CleanUp|ClearData|ClearStatus|Clear|CloneObject|CloseTables|'
- r'Close|Cls|CursorAttach|CursorDetach|CursorFill|'
- r'CursorRefresh|DataToClip|DelayedMemoFetch|DeleteColumn|'
- r'Dock|DoMessage|DoScroll|DoStatus|DoVerb|Drag|Draw|Eval|'
- r'GetData|GetDockState|GetFormat|GetKey|GetLatestVersion|'
- r'GetPageHeight|GetPageWidth|Help|Hide|IncludePageInOutput|'
- r'IndexToItemID|ItemIDToIndex|Item|LoadXML|Line|Modify|'
- r'MoveItem|Move|Nest|OLEDrag|OnPreviewClose|OutputPage|'
- r'Point|Print|PSet|Quit|ReadExpression|ReadMethod|'
- r'RecordRefresh|Refresh|ReleaseXML|Release|RemoveFromSCC|'
- r'RemoveItem|RemoveListItem|RemoveObject|Remove|'
- r'Render|Requery|RequestData|ResetToDefault|Reset|Run|'
- r'SaveAsClass|SaveAs|SetAll|SetData|SetFocus|SetFormat|'
- r'SetMain|SetVar|SetViewPort|ShowWhatsThis|Show|'
- r'SupportsListenerType|TextHeight|TextWidth|ToCursor|'
- r'ToXML|UndoCheckOut|Unnest|UpdateStatus|WhatsThisMode|'
- r'WriteExpression|WriteMethod|ZOrder)', Name.Function),
-
- (r'\.(Activate|AdjustObjectSize|AfterBand|AfterBuild|'
- r'AfterCloseTables|AfterCursorAttach|AfterCursorClose|'
- r'AfterCursorDetach|AfterCursorFill|AfterCursorRefresh|'
- r'AfterCursorUpdate|AfterDelete|AfterInsert|'
- r'AfterRecordRefresh|AfterUpdate|AfterDock|AfterReport|'
- r'AfterRowColChange|BeforeBand|BeforeCursorAttach|'
- r'BeforeCursorClose|BeforeCursorDetach|BeforeCursorFill|'
- r'BeforeCursorRefresh|BeforeCursorUpdate|BeforeDelete|'
- r'BeforeInsert|BeforeDock|BeforeOpenTables|'
- r'BeforeRecordRefresh|BeforeReport|BeforeRowColChange|'
- r'BeforeUpdate|Click|dbc_Activate|dbc_AfterAddTable|'
- r'dbc_AfterAppendProc|dbc_AfterCloseTable|dbc_AfterCopyProc|'
- r'dbc_AfterCreateConnection|dbc_AfterCreateOffline|'
- r'dbc_AfterCreateTable|dbc_AfterCreateView|dbc_AfterDBGetProp|'
- r'dbc_AfterDBSetProp|dbc_AfterDeleteConnection|'
- r'dbc_AfterDropOffline|dbc_AfterDropTable|'
- r'dbc_AfterModifyConnection|dbc_AfterModifyProc|'
- r'dbc_AfterModifyTable|dbc_AfterModifyView|dbc_AfterOpenTable|'
- r'dbc_AfterRemoveTable|dbc_AfterRenameConnection|'
- r'dbc_AfterRenameTable|dbc_AfterRenameView|'
- r'dbc_AfterValidateData|dbc_BeforeAddTable|'
- r'dbc_BeforeAppendProc|dbc_BeforeCloseTable|'
- r'dbc_BeforeCopyProc|dbc_BeforeCreateConnection|'
- r'dbc_BeforeCreateOffline|dbc_BeforeCreateTable|'
- r'dbc_BeforeCreateView|dbc_BeforeDBGetProp|'
- r'dbc_BeforeDBSetProp|dbc_BeforeDeleteConnection|'
- r'dbc_BeforeDropOffline|dbc_BeforeDropTable|'
- r'dbc_BeforeModifyConnection|dbc_BeforeModifyProc|'
- r'dbc_BeforeModifyTable|dbc_BeforeModifyView|'
- r'dbc_BeforeOpenTable|dbc_BeforeRemoveTable|'
- r'dbc_BeforeRenameConnection|dbc_BeforeRenameTable|'
- r'dbc_BeforeRenameView|dbc_BeforeValidateData|'
- r'dbc_CloseData|dbc_Deactivate|dbc_ModifyData|dbc_OpenData|'
- r'dbc_PackData|DblClick|Deactivate|Deleted|Destroy|DoCmd|'
- r'DownClick|DragDrop|DragOver|DropDown|ErrorMessage|Error|'
- r'EvaluateContents|GotFocus|Init|InteractiveChange|KeyPress|'
- r'LoadReport|Load|LostFocus|Message|MiddleClick|MouseDown|'
- r'MouseEnter|MouseLeave|MouseMove|MouseUp|MouseWheel|Moved|'
- r'OLECompleteDrag|OLEDragOver|OLEGiveFeedback|OLESetData|'
- r'OLEStartDrag|OnMoveItem|Paint|ProgrammaticChange|'
- r'QueryAddFile|QueryModifyFile|QueryNewFile|QueryRemoveFile|'
- r'QueryRunFile|QueryUnload|RangeHigh|RangeLow|ReadActivate|'
- r'ReadDeactivate|ReadShow|ReadValid|ReadWhen|Resize|'
- r'RightClick|SCCInit|SCCDestroy|Scrolled|Timer|UIEnable|'
- r'UnDock|UnloadReport|Unload|UpClick|Valid|When)', Name.Function),
-
- (r'\s+', Text),
- # everything else is not colored
- (r'.', Text),
- ],
- 'newline': [
- (r'\*.*?$', Comment.Single, '#pop'),
- (r'(ACCEPT|ACTIVATE\s*MENU|ACTIVATE\s*POPUP|ACTIVATE\s*SCREEN|'
- r'ACTIVATE\s*WINDOW|APPEND|APPEND\s*FROM|APPEND\s*FROM\s*ARRAY|'
- r'APPEND\s*GENERAL|APPEND\s*MEMO|ASSIST|AVERAGE|BLANK|BROWSE|'
- r'BUILD\s*APP|BUILD\s*EXE|BUILD\s*PROJECT|CALCULATE|CALL|'
- r'CANCEL|CHANGE|CLEAR|CLOSE|CLOSE\s*MEMO|COMPILE|CONTINUE|'
- r'COPY\s*FILE|COPY\s*INDEXES|COPY\s*MEMO|COPY\s*STRUCTURE|'
- r'COPY\s*STRUCTURE\s*EXTENDED|COPY\s*TAG|COPY\s*TO|'
- r'COPY\s*TO\s*ARRAY|COUNT|CREATE|CREATE\s*COLOR\s*SET|'
- r'CREATE\s*CURSOR|CREATE\s*FROM|CREATE\s*LABEL|CREATE\s*MENU|'
- r'CREATE\s*PROJECT|CREATE\s*QUERY|CREATE\s*REPORT|'
- r'CREATE\s*SCREEN|CREATE\s*TABLE|CREATE\s*VIEW|DDE|'
- r'DEACTIVATE\s*MENU|DEACTIVATE\s*POPUP|DEACTIVATE\s*WINDOW|'
- r'DECLARE|DEFINE\s*BAR|DEFINE\s*BOX|DEFINE\s*MENU|'
- r'DEFINE\s*PAD|DEFINE\s*POPUP|DEFINE\s*WINDOW|DELETE|'
- r'DELETE\s*FILE|DELETE\s*TAG|DIMENSION|DIRECTORY|DISPLAY|'
- r'DISPLAY\s*FILES|DISPLAY\s*MEMORY|DISPLAY\s*STATUS|'
- r'DISPLAY\s*STRUCTURE|DO|EDIT|EJECT|EJECT\s*PAGE|ERASE|'
- r'EXIT|EXPORT|EXTERNAL|FILER|FIND|FLUSH|FUNCTION|GATHER|'
- r'GETEXPR|GO|GOTO|HELP|HIDE\s*MENU|HIDE\s*POPUP|'
- r'HIDE\s*WINDOW|IMPORT|INDEX|INPUT|INSERT|JOIN|KEYBOARD|'
- r'LABEL|LIST|LOAD|LOCATE|LOOP|MENU|MENU\s*TO|MODIFY\s*COMMAND|'
- r'MODIFY\s*FILE|MODIFY\s*GENERAL|MODIFY\s*LABEL|MODIFY\s*MEMO|'
- r'MODIFY\s*MENU|MODIFY\s*PROJECT|MODIFY\s*QUERY|'
- r'MODIFY\s*REPORT|MODIFY\s*SCREEN|MODIFY\s*STRUCTURE|'
- r'MODIFY\s*WINDOW|MOVE\s*POPUP|MOVE\s*WINDOW|NOTE|'
- r'ON\s*APLABOUT|ON\s*BAR|ON\s*ERROR|ON\s*ESCAPE|'
- r'ON\s*EXIT\s*BAR|ON\s*EXIT\s*MENU|ON\s*EXIT\s*PAD|'
- r'ON\s*EXIT\s*POPUP|ON\s*KEY|ON\s*KEY\s*=|ON\s*KEY\s*LABEL|'
- r'ON\s*MACHELP|ON\s*PAD|ON\s*PAGE|ON\s*READERROR|'
- r'ON\s*SELECTION\s*BAR|ON\s*SELECTION\s*MENU|'
- r'ON\s*SELECTION\s*PAD|ON\s*SELECTION\s*POPUP|ON\s*SHUTDOWN|'
- r'PACK|PARAMETERS|PLAY\s*MACRO|POP\s*KEY|POP\s*MENU|'
- r'POP\s*POPUP|PRIVATE|PROCEDURE|PUBLIC|PUSH\s*KEY|'
- r'PUSH\s*MENU|PUSH\s*POPUP|QUIT|READ|READ\s*MENU|RECALL|'
- r'REINDEX|RELEASE|RELEASE\s*MODULE|RENAME|REPLACE|'
- r'REPLACE\s*FROM\s*ARRAY|REPORT|RESTORE\s*FROM|'
- r'RESTORE\s*MACROS|RESTORE\s*SCREEN|RESTORE\s*WINDOW|'
- r'RESUME|RETRY|RETURN|RUN|RUN\s*\/N"|RUNSCRIPT|'
- r'SAVE\s*MACROS|SAVE\s*SCREEN|SAVE\s*TO|SAVE\s*WINDOWS|'
- r'SCATTER|SCROLL|SEEK|SELECT|SET|SET\s*ALTERNATE|'
- r'SET\s*ANSI|SET\s*APLABOUT|SET\s*AUTOSAVE|SET\s*BELL|'
- r'SET\s*BLINK|SET\s*BLOCKSIZE|SET\s*BORDER|SET\s*BRSTATUS|'
- r'SET\s*CARRY|SET\s*CENTURY|SET\s*CLEAR|SET\s*CLOCK|'
- r'SET\s*COLLATE|SET\s*COLOR\s*OF|SET\s*COLOR\s*OF\s*SCHEME|'
- r'SET\s*COLOR\s*SET|SET\s*COLOR\s*TO|SET\s*COMPATIBLE|'
- r'SET\s*CONFIRM|SET\s*CONSOLE|SET\s*CURRENCY|SET\s*CURSOR|'
- r'SET\s*DATE|SET\s*DEBUG|SET\s*DECIMALS|SET\s*DEFAULT|'
- r'SET\s*DELETED|SET\s*DELIMITERS|SET\s*DEVELOPMENT|'
- r'SET\s*DEVICE|SET\s*DISPLAY|SET\s*DOHISTORY|SET\s*ECHO|'
- r'SET\s*ESCAPE|SET\s*EXACT|SET\s*EXCLUSIVE|SET\s*FIELDS|'
- r'SET\s*FILTER|SET\s*FIXED|SET\s*FORMAT|SET\s*FULLPATH|'
- r'SET\s*FUNCTION|SET\s*HEADINGS|SET\s*HELP|SET\s*HELPFILTER|'
- r'SET\s*HOURS|SET\s*INDEX|SET\s*INTENSITY|SET\s*KEY|'
- r'SET\s*KEYCOMP|SET\s*LIBRARY|SET\s*LOCK|SET\s*LOGERRORS|'
- r'SET\s*MACDESKTOP|SET\s*MACHELP|SET\s*MACKEY|SET\s*MARGIN|'
- r'SET\s*MARK\s*OF|SET\s*MARK\s*TO|SET\s*MEMOWIDTH|'
- r'SET\s*MESSAGE|SET\s*MOUSE|SET\s*MULTILOCKS|SET\s*NEAR|'
- r'SET\s*NOCPTRANS|SET\s*NOTIFY|SET\s*ODOMETER|SET\s*OPTIMIZE|'
- r'SET\s*ORDER|SET\s*PALETTE|SET\s*PATH|SET\s*PDSETUP|'
- r'SET\s*POINT|SET\s*PRINTER|SET\s*PROCEDURE|SET\s*READBORDER|'
- r'SET\s*REFRESH|SET\s*RELATION|SET\s*RELATION\s*OFF|'
- r'SET\s*REPROCESS|SET\s*RESOURCE|SET\s*SAFETY|SET\s*SCOREBOARD|'
- r'SET\s*SEPARATOR|SET\s*SHADOWS|SET\s*SKIP|SET\s*SKIP\s*OF|'
- r'SET\s*SPACE|SET\s*STATUS|SET\s*STATUS\s*BAR|SET\s*STEP|'
- r'SET\s*STICKY|SET\s*SYSMENU|SET\s*TALK|SET\s*TEXTMERGE|'
- r'SET\s*TEXTMERGE\s*DELIMITERS|SET\s*TOPIC|SET\s*TRBETWEEN|'
- r'SET\s*TYPEAHEAD|SET\s*UDFPARMS|SET\s*UNIQUE|SET\s*VIEW|'
- r'SET\s*VOLUME|SET\s*WINDOW\s*OF\s*MEMO|SET\s*XCMDFILE|'
- r'SHOW\s*GET|SHOW\s*GETS|SHOW\s*MENU|SHOW\s*OBJECT|'
- r'SHOW\s*POPUP|SHOW\s*WINDOW|SIZE\s*POPUP|SKIP|SORT|'
- r'STORE|SUM|SUSPEND|TOTAL|TYPE|UNLOCK|UPDATE|USE|WAIT|'
- r'ZAP|ZOOM\s*WINDOW|DO\s*CASE|CASE|OTHERWISE|ENDCASE|'
- r'DO\s*WHILE|ENDDO|FOR|ENDFOR|NEXT|IF|ELSE|ENDIF|PRINTJOB|'
- r'ENDPRINTJOB|SCAN|ENDSCAN|TEXT|ENDTEXT|=)',
- Keyword.Reserved, '#pop'),
- (r'#\s*(IF|ELIF|ELSE|ENDIF|DEFINE|IFDEF|IFNDEF|INCLUDE)',
- Comment.Preproc, '#pop'),
- (r'(m\.)?[a-z_]\w*', Name.Variable, '#pop'),
- (r'.', Text, '#pop'),
- ],
- }
diff --git a/pygments/lexers/freefem.py b/pygments/lexers/freefem.py
deleted file mode 100644
index c43b285d..00000000
--- a/pygments/lexers/freefem.py
+++ /dev/null
@@ -1,898 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.freefem
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for FreeFem++ language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, bygroups, inherit, words, \
- default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-from pygments.lexers.c_cpp import CLexer, CppLexer
-from pygments.lexers import _mql_builtins
-
-__all__ = ['FreeFemLexer']
-
-
-class FreeFemLexer(CppLexer):
- """
- For `FreeFem++ <https://freefem.org/>`_ source.
-
- This is an extension of the CppLexer, as the FreeFem Language is a superset
- of C++.
-
- .. versionadded:: 2.4
- """
-
- name = 'Freefem'
- aliases = ['freefem']
- filenames = ['*.edp']
- mimetypes = ['text/x-freefem']
-
- # Language operators
- operators = set(('+', '-', '*', '.*', '/', './', '%', '^', '^-1', ':', '\''))
-
- # types
- types = set(('bool', 'border', 'complex', 'dmatrix', 'fespace', 'func', 'gslspline',
- 'ifstream', 'int', 'macro', 'matrix', 'mesh', 'mesh3', 'mpiComm',
- 'mpiGroup', 'mpiRequest', 'NewMacro', 'EndMacro', 'ofstream', 'Pmmap',
- 'problem', 'Psemaphore', 'real', 'solve', 'string', 'varf'))
-
- # finite element spaces
- fespaces = set(('BDM1', 'BDM1Ortho', 'Edge03d', 'Edge13d', 'Edge23d', 'FEQF', 'HCT',
- 'P0', 'P03d', 'P0Edge', 'P1', 'P13d', 'P1b', 'P1b3d', 'P1bl', 'P1bl3d',
- 'P1dc', 'P1Edge', 'P1nc', 'P2', 'P23d', 'P2b', 'P2BR', 'P2dc', 'P2Edge',
- 'P2h', 'P2Morley', 'P2pnc', 'P3', 'P3dc', 'P3Edge', 'P4', 'P4dc',
- 'P4Edge', 'P5Edge', 'RT0', 'RT03d', 'RT0Ortho', 'RT1', 'RT1Ortho',
- 'RT2', 'RT2Ortho'))
-
- # preprocessor
- preprocessor = set(('ENDIFMACRO', 'include', 'IFMACRO', 'load'))
-
- # Language keywords
- keywords = set((
- 'adj',
- 'append',
- 'area',
- 'ARGV',
- 'be',
- 'binary',
- 'BoundaryEdge',
- 'bordermeasure',
- 'CG',
- 'Cholesky',
- 'cin',
- 'cout',
- 'Crout',
- 'default',
- 'diag',
- 'edgeOrientation',
- 'endl',
- 'false',
- 'ffind',
- 'FILE',
- 'find',
- 'fixed',
- 'flush',
- 'GMRES',
- 'good',
- 'hTriangle',
- 'im',
- 'imax',
- 'imin',
- 'InternalEdge',
- 'l1',
- 'l2',
- 'label',
- 'lenEdge',
- 'length',
- 'LINE',
- 'linfty',
- 'LU',
- 'm',
- 'max',
- 'measure',
- 'min',
- 'mpiAnySource',
- 'mpiBAND',
- 'mpiBXOR',
- 'mpiCommWorld',
- 'mpiLAND',
- 'mpiLOR',
- 'mpiLXOR',
- 'mpiMAX',
- 'mpiMIN',
- 'mpiPROD',
- 'mpirank',
- 'mpisize',
- 'mpiSUM',
- 'mpiUndefined',
- 'n',
- 'N',
- 'nbe',
- 'ndof',
- 'ndofK',
- 'noshowbase',
- 'noshowpos',
- 'notaregion',
- 'nt',
- 'nTonEdge',
- 'nuEdge',
- 'nuTriangle',
- 'nv',
- 'P',
- 'pi',
- 'precision',
- 'qf1pE',
- 'qf1pElump',
- 'qf1pT',
- 'qf1pTlump',
- 'qfV1',
- 'qfV1lump',
- 'qf2pE',
- 'qf2pT',
- 'qf2pT4P1',
- 'qfV2',
- 'qf3pE',
- 'qf4pE',
- 'qf5pE',
- 'qf5pT',
- 'qfV5',
- 'qf7pT',
- 'qf9pT',
- 'qfnbpE',
- 'quantile',
- 're',
- 'region',
- 'rfind',
- 'scientific',
- 'searchMethod',
- 'setw',
- 'showbase',
- 'showpos',
- 'sparsesolver',
- 'sum',
- 'tellp',
- 'true',
- 'UMFPACK',
- 'unused',
- 'whoinElement',
- 'verbosity',
- 'version',
- 'volume',
- 'x',
- 'y',
- 'z'
- ))
-
- # Language shipped functions and class ( )
- functions = set((
- 'abs',
- 'acos',
- 'acosh',
- 'adaptmesh',
- 'adj',
- 'AffineCG',
- 'AffineGMRES',
- 'arg',
- 'asin',
- 'asinh',
- 'assert',
- 'atan',
- 'atan2',
- 'atanh',
- 'atof',
- 'atoi',
- 'BFGS',
- 'broadcast',
- 'buildlayers',
- 'buildmesh',
- 'ceil',
- 'chi',
- 'complexEigenValue',
- 'copysign',
- 'change',
- 'checkmovemesh',
- 'clock',
- 'cmaes',
- 'conj',
- 'convect',
- 'cos',
- 'cosh',
- 'cube',
- 'd',
- 'dd',
- 'dfft',
- 'diffnp',
- 'diffpos',
- 'dimKrylov',
- 'dist',
- 'dumptable',
- 'dx',
- 'dxx',
- 'dxy',
- 'dxz',
- 'dy',
- 'dyx',
- 'dyy',
- 'dyz',
- 'dz',
- 'dzx',
- 'dzy',
- 'dzz',
- 'EigenValue',
- 'emptymesh',
- 'erf',
- 'erfc',
- 'exec',
- 'exit',
- 'exp',
- 'fdim',
- 'floor',
- 'fmax',
- 'fmin',
- 'fmod',
- 'freeyams',
- 'getARGV',
- 'getline',
- 'gmshload',
- 'gmshload3',
- 'gslcdfugaussianP',
- 'gslcdfugaussianQ',
- 'gslcdfugaussianPinv',
- 'gslcdfugaussianQinv',
- 'gslcdfgaussianP',
- 'gslcdfgaussianQ',
- 'gslcdfgaussianPinv',
- 'gslcdfgaussianQinv',
- 'gslcdfgammaP',
- 'gslcdfgammaQ',
- 'gslcdfgammaPinv',
- 'gslcdfgammaQinv',
- 'gslcdfcauchyP',
- 'gslcdfcauchyQ',
- 'gslcdfcauchyPinv',
- 'gslcdfcauchyQinv',
- 'gslcdflaplaceP',
- 'gslcdflaplaceQ',
- 'gslcdflaplacePinv',
- 'gslcdflaplaceQinv',
- 'gslcdfrayleighP',
- 'gslcdfrayleighQ',
- 'gslcdfrayleighPinv',
- 'gslcdfrayleighQinv',
- 'gslcdfchisqP',
- 'gslcdfchisqQ',
- 'gslcdfchisqPinv',
- 'gslcdfchisqQinv',
- 'gslcdfexponentialP',
- 'gslcdfexponentialQ',
- 'gslcdfexponentialPinv',
- 'gslcdfexponentialQinv',
- 'gslcdfexppowP',
- 'gslcdfexppowQ',
- 'gslcdftdistP',
- 'gslcdftdistQ',
- 'gslcdftdistPinv',
- 'gslcdftdistQinv',
- 'gslcdffdistP',
- 'gslcdffdistQ',
- 'gslcdffdistPinv',
- 'gslcdffdistQinv',
- 'gslcdfbetaP',
- 'gslcdfbetaQ',
- 'gslcdfbetaPinv',
- 'gslcdfbetaQinv',
- 'gslcdfflatP',
- 'gslcdfflatQ',
- 'gslcdfflatPinv',
- 'gslcdfflatQinv',
- 'gslcdflognormalP',
- 'gslcdflognormalQ',
- 'gslcdflognormalPinv',
- 'gslcdflognormalQinv',
- 'gslcdfgumbel1P',
- 'gslcdfgumbel1Q',
- 'gslcdfgumbel1Pinv',
- 'gslcdfgumbel1Qinv',
- 'gslcdfgumbel2P',
- 'gslcdfgumbel2Q',
- 'gslcdfgumbel2Pinv',
- 'gslcdfgumbel2Qinv',
- 'gslcdfweibullP',
- 'gslcdfweibullQ',
- 'gslcdfweibullPinv',
- 'gslcdfweibullQinv',
- 'gslcdfparetoP',
- 'gslcdfparetoQ',
- 'gslcdfparetoPinv',
- 'gslcdfparetoQinv',
- 'gslcdflogisticP',
- 'gslcdflogisticQ',
- 'gslcdflogisticPinv',
- 'gslcdflogisticQinv',
- 'gslcdfbinomialP',
- 'gslcdfbinomialQ',
- 'gslcdfpoissonP',
- 'gslcdfpoissonQ',
- 'gslcdfgeometricP',
- 'gslcdfgeometricQ',
- 'gslcdfnegativebinomialP',
- 'gslcdfnegativebinomialQ',
- 'gslcdfpascalP',
- 'gslcdfpascalQ',
- 'gslinterpakima',
- 'gslinterpakimaperiodic',
- 'gslinterpcsplineperiodic',
- 'gslinterpcspline',
- 'gslinterpsteffen',
- 'gslinterplinear',
- 'gslinterppolynomial',
- 'gslranbernoullipdf',
- 'gslranbeta',
- 'gslranbetapdf',
- 'gslranbinomialpdf',
- 'gslranexponential',
- 'gslranexponentialpdf',
- 'gslranexppow',
- 'gslranexppowpdf',
- 'gslrancauchy',
- 'gslrancauchypdf',
- 'gslranchisq',
- 'gslranchisqpdf',
- 'gslranerlang',
- 'gslranerlangpdf',
- 'gslranfdist',
- 'gslranfdistpdf',
- 'gslranflat',
- 'gslranflatpdf',
- 'gslrangamma',
- 'gslrangammaint',
- 'gslrangammapdf',
- 'gslrangammamt',
- 'gslrangammaknuth',
- 'gslrangaussian',
- 'gslrangaussianratiomethod',
- 'gslrangaussianziggurat',
- 'gslrangaussianpdf',
- 'gslranugaussian',
- 'gslranugaussianratiomethod',
- 'gslranugaussianpdf',
- 'gslrangaussiantail',
- 'gslrangaussiantailpdf',
- 'gslranugaussiantail',
- 'gslranugaussiantailpdf',
- 'gslranlandau',
- 'gslranlandaupdf',
- 'gslrangeometricpdf',
- 'gslrangumbel1',
- 'gslrangumbel1pdf',
- 'gslrangumbel2',
- 'gslrangumbel2pdf',
- 'gslranlogistic',
- 'gslranlogisticpdf',
- 'gslranlognormal',
- 'gslranlognormalpdf',
- 'gslranlogarithmicpdf',
- 'gslrannegativebinomialpdf',
- 'gslranpascalpdf',
- 'gslranpareto',
- 'gslranparetopdf',
- 'gslranpoissonpdf',
- 'gslranrayleigh',
- 'gslranrayleighpdf',
- 'gslranrayleightail',
- 'gslranrayleightailpdf',
- 'gslrantdist',
- 'gslrantdistpdf',
- 'gslranlaplace',
- 'gslranlaplacepdf',
- 'gslranlevy',
- 'gslranweibull',
- 'gslranweibullpdf',
- 'gslsfairyAi',
- 'gslsfairyBi',
- 'gslsfairyAiscaled',
- 'gslsfairyBiscaled',
- 'gslsfairyAideriv',
- 'gslsfairyBideriv',
- 'gslsfairyAiderivscaled',
- 'gslsfairyBiderivscaled',
- 'gslsfairyzeroAi',
- 'gslsfairyzeroBi',
- 'gslsfairyzeroAideriv',
- 'gslsfairyzeroBideriv',
- 'gslsfbesselJ0',
- 'gslsfbesselJ1',
- 'gslsfbesselJn',
- 'gslsfbesselY0',
- 'gslsfbesselY1',
- 'gslsfbesselYn',
- 'gslsfbesselI0',
- 'gslsfbesselI1',
- 'gslsfbesselIn',
- 'gslsfbesselI0scaled',
- 'gslsfbesselI1scaled',
- 'gslsfbesselInscaled',
- 'gslsfbesselK0',
- 'gslsfbesselK1',
- 'gslsfbesselKn',
- 'gslsfbesselK0scaled',
- 'gslsfbesselK1scaled',
- 'gslsfbesselKnscaled',
- 'gslsfbesselj0',
- 'gslsfbesselj1',
- 'gslsfbesselj2',
- 'gslsfbesseljl',
- 'gslsfbessely0',
- 'gslsfbessely1',
- 'gslsfbessely2',
- 'gslsfbesselyl',
- 'gslsfbesseli0scaled',
- 'gslsfbesseli1scaled',
- 'gslsfbesseli2scaled',
- 'gslsfbesselilscaled',
- 'gslsfbesselk0scaled',
- 'gslsfbesselk1scaled',
- 'gslsfbesselk2scaled',
- 'gslsfbesselklscaled',
- 'gslsfbesselJnu',
- 'gslsfbesselYnu',
- 'gslsfbesselInuscaled',
- 'gslsfbesselInu',
- 'gslsfbesselKnuscaled',
- 'gslsfbesselKnu',
- 'gslsfbessellnKnu',
- 'gslsfbesselzeroJ0',
- 'gslsfbesselzeroJ1',
- 'gslsfbesselzeroJnu',
- 'gslsfclausen',
- 'gslsfhydrogenicR1',
- 'gslsfdawson',
- 'gslsfdebye1',
- 'gslsfdebye2',
- 'gslsfdebye3',
- 'gslsfdebye4',
- 'gslsfdebye5',
- 'gslsfdebye6',
- 'gslsfdilog',
- 'gslsfmultiply',
- 'gslsfellintKcomp',
- 'gslsfellintEcomp',
- 'gslsfellintPcomp',
- 'gslsfellintDcomp',
- 'gslsfellintF',
- 'gslsfellintE',
- 'gslsfellintRC',
- 'gslsferfc',
- 'gslsflogerfc',
- 'gslsferf',
- 'gslsferfZ',
- 'gslsferfQ',
- 'gslsfhazard',
- 'gslsfexp',
- 'gslsfexpmult',
- 'gslsfexpm1',
- 'gslsfexprel',
- 'gslsfexprel2',
- 'gslsfexpreln',
- 'gslsfexpintE1',
- 'gslsfexpintE2',
- 'gslsfexpintEn',
- 'gslsfexpintE1scaled',
- 'gslsfexpintE2scaled',
- 'gslsfexpintEnscaled',
- 'gslsfexpintEi',
- 'gslsfexpintEiscaled',
- 'gslsfShi',
- 'gslsfChi',
- 'gslsfexpint3',
- 'gslsfSi',
- 'gslsfCi',
- 'gslsfatanint',
- 'gslsffermidiracm1',
- 'gslsffermidirac0',
- 'gslsffermidirac1',
- 'gslsffermidirac2',
- 'gslsffermidiracint',
- 'gslsffermidiracmhalf',
- 'gslsffermidirachalf',
- 'gslsffermidirac3half',
- 'gslsffermidiracinc0',
- 'gslsflngamma',
- 'gslsfgamma',
- 'gslsfgammastar',
- 'gslsfgammainv',
- 'gslsftaylorcoeff',
- 'gslsffact',
- 'gslsfdoublefact',
- 'gslsflnfact',
- 'gslsflndoublefact',
- 'gslsflnchoose',
- 'gslsfchoose',
- 'gslsflnpoch',
- 'gslsfpoch',
- 'gslsfpochrel',
- 'gslsfgammaincQ',
- 'gslsfgammaincP',
- 'gslsfgammainc',
- 'gslsflnbeta',
- 'gslsfbeta',
- 'gslsfbetainc',
- 'gslsfgegenpoly1',
- 'gslsfgegenpoly2',
- 'gslsfgegenpoly3',
- 'gslsfgegenpolyn',
- 'gslsfhyperg0F1',
- 'gslsfhyperg1F1int',
- 'gslsfhyperg1F1',
- 'gslsfhypergUint',
- 'gslsfhypergU',
- 'gslsfhyperg2F0',
- 'gslsflaguerre1',
- 'gslsflaguerre2',
- 'gslsflaguerre3',
- 'gslsflaguerren',
- 'gslsflambertW0',
- 'gslsflambertWm1',
- 'gslsflegendrePl',
- 'gslsflegendreP1',
- 'gslsflegendreP2',
- 'gslsflegendreP3',
- 'gslsflegendreQ0',
- 'gslsflegendreQ1',
- 'gslsflegendreQl',
- 'gslsflegendrePlm',
- 'gslsflegendresphPlm',
- 'gslsflegendrearraysize',
- 'gslsfconicalPhalf',
- 'gslsfconicalPmhalf',
- 'gslsfconicalP0',
- 'gslsfconicalP1',
- 'gslsfconicalPsphreg',
- 'gslsfconicalPcylreg',
- 'gslsflegendreH3d0',
- 'gslsflegendreH3d1',
- 'gslsflegendreH3d',
- 'gslsflog',
- 'gslsflogabs',
- 'gslsflog1plusx',
- 'gslsflog1plusxmx',
- 'gslsfpowint',
- 'gslsfpsiint',
- 'gslsfpsi',
- 'gslsfpsi1piy',
- 'gslsfpsi1int',
- 'gslsfpsi1',
- 'gslsfpsin',
- 'gslsfsynchrotron1',
- 'gslsfsynchrotron2',
- 'gslsftransport2',
- 'gslsftransport3',
- 'gslsftransport4',
- 'gslsftransport5',
- 'gslsfsin',
- 'gslsfcos',
- 'gslsfhypot',
- 'gslsfsinc',
- 'gslsflnsinh',
- 'gslsflncosh',
- 'gslsfanglerestrictsymm',
- 'gslsfanglerestrictpos',
- 'gslsfzetaint',
- 'gslsfzeta',
- 'gslsfzetam1',
- 'gslsfzetam1int',
- 'gslsfhzeta',
- 'gslsfetaint',
- 'gslsfeta',
- 'imag',
- 'int1d',
- 'int2d',
- 'int3d',
- 'intalledges',
- 'intallfaces',
- 'interpolate',
- 'invdiff',
- 'invdiffnp',
- 'invdiffpos',
- 'Isend',
- 'isInf',
- 'isNaN',
- 'isoline',
- 'Irecv',
- 'j0',
- 'j1',
- 'jn',
- 'jump',
- 'lgamma',
- 'LinearCG',
- 'LinearGMRES',
- 'log',
- 'log10',
- 'lrint',
- 'lround',
- 'max',
- 'mean',
- 'medit',
- 'min',
- 'mmg3d',
- 'movemesh',
- 'movemesh23',
- 'mpiAlltoall',
- 'mpiAlltoallv',
- 'mpiAllgather',
- 'mpiAllgatherv',
- 'mpiAllReduce',
- 'mpiBarrier',
- 'mpiGather',
- 'mpiGatherv',
- 'mpiRank',
- 'mpiReduce',
- 'mpiScatter',
- 'mpiScatterv',
- 'mpiSize',
- 'mpiWait',
- 'mpiWaitAny',
- 'mpiWtick',
- 'mpiWtime',
- 'mshmet',
- 'NaN',
- 'NLCG',
- 'on',
- 'plot',
- 'polar',
- 'Post',
- 'pow',
- 'processor',
- 'processorblock',
- 'projection',
- 'randinit',
- 'randint31',
- 'randint32',
- 'random',
- 'randreal1',
- 'randreal2',
- 'randreal3',
- 'randres53',
- 'Read',
- 'readmesh',
- 'readmesh3',
- 'Recv',
- 'rint',
- 'round',
- 'savemesh',
- 'savesol',
- 'savevtk',
- 'seekg',
- 'Sent',
- 'set',
- 'sign',
- 'signbit',
- 'sin',
- 'sinh',
- 'sort',
- 'splitComm',
- 'splitmesh',
- 'sqrt',
- 'square',
- 'srandom',
- 'srandomdev',
- 'Stringification',
- 'swap',
- 'system',
- 'tan',
- 'tanh',
- 'tellg',
- 'tetg',
- 'tetgconvexhull',
- 'tetgreconstruction',
- 'tetgtransfo',
- 'tgamma',
- 'triangulate',
- 'trunc',
- 'Wait',
- 'Write',
- 'y0',
- 'y1',
- 'yn'
- ))
-
- # function parameters
- parameters = set((
- 'A',
- 'A1',
- 'abserror',
- 'absolute',
- 'aniso',
- 'aspectratio',
- 'B',
- 'B1',
- 'bb',
- 'beginend',
- 'bin',
- 'boundary',
- 'bw',
- 'close',
- 'cmm',
- 'coef',
- 'composante',
- 'cutoff',
- 'datafilename',
- 'dataname',
- 'dim',
- 'distmax',
- 'displacement',
- 'doptions',
- 'dparams',
- 'eps',
- 'err',
- 'errg',
- 'facemerge',
- 'facetcl',
- 'factorize',
- 'file',
- 'fill',
- 'fixedborder',
- 'flabel',
- 'flags',
- 'floatmesh',
- 'floatsol',
- 'fregion',
- 'gradation',
- 'grey',
- 'hmax',
- 'hmin',
- 'holelist',
- 'hsv',
- 'init',
- 'inquire',
- 'inside',
- 'IsMetric',
- 'iso',
- 'ivalue',
- 'keepbackvertices',
- 'label',
- 'labeldown',
- 'labelmid',
- 'labelup',
- 'levelset',
- 'loptions',
- 'lparams',
- 'maxit',
- 'maxsubdiv',
- 'meditff',
- 'mem',
- 'memory',
- 'metric',
- 'mode',
- 'nbarrow',
- 'nbiso',
- 'nbiter',
- 'nbjacoby',
- 'nboffacetcl',
- 'nbofholes',
- 'nbofregions',
- 'nbregul',
- 'nbsmooth',
- 'nbvx',
- 'ncv',
- 'nev',
- 'nomeshgeneration',
- 'normalization',
- 'omega',
- 'op',
- 'optimize',
- 'option',
- 'options',
- 'order',
- 'orientation',
- 'periodic',
- 'power',
- 'precon',
- 'prev',
- 'ps',
- 'ptmerge',
- 'qfe',
- 'qforder',
- 'qft',
- 'qfV',
- 'ratio',
- 'rawvector',
- 'reffacelow',
- 'reffacemid',
- 'reffaceup',
- 'refnum',
- 'reftet',
- 'reftri',
- 'region',
- 'regionlist',
- 'renumv',
- 'rescaling',
- 'ridgeangle',
- 'save',
- 'sigma',
- 'sizeofvolume',
- 'smoothing',
- 'solver',
- 'sparams',
- 'split',
- 'splitin2',
- 'splitpbedge',
- 'stop',
- 'strategy',
- 'swap',
- 'switch',
- 'sym',
- 't',
- 'tgv',
- 'thetamax',
- 'tol',
- 'tolpivot',
- 'tolpivotsym',
- 'transfo',
- 'U2Vc',
- 'value',
- 'varrow',
- 'vector',
- 'veps',
- 'viso',
- 'wait',
- 'width',
- 'withsurfacemesh',
- 'WindowIndex',
- 'which',
- 'zbound'
- ))
-
- # deprecated
- deprecated = set(('fixeborder',))
-
- # do not highlight
- suppress_highlight = set((
- 'alignof',
- 'asm',
- 'constexpr',
- 'decltype',
- 'div',
- 'double',
- 'grad',
- 'mutable',
- 'namespace',
- 'noexcept',
- 'restrict',
- 'static_assert',
- 'template',
- 'this',
- 'thread_local',
- 'typeid',
- 'typename',
- 'using'
- ))
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in CppLexer.get_tokens_unprocessed(self, text):
- if value in self.operators:
- yield index, Operator, value
- elif value in self.types:
- yield index, Keyword.Type, value
- elif value in self.fespaces:
- yield index, Name.Class, value
- elif value in self.preprocessor:
- yield index, Comment.Preproc, value
- elif value in self.keywords:
- yield index, Keyword.Reserved, value
- elif value in self.functions:
- yield index, Name.Function, value
- elif value in self.parameters:
- yield index, Keyword.Pseudo, value
- elif value in self.suppress_highlight:
- yield index, Name, value
- else:
- yield index, token, value
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py
deleted file mode 100644
index 2d94aca3..00000000
--- a/pygments/lexers/functional.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.functional
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Just export lexer classes previously contained in this module.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexers.lisp import SchemeLexer, CommonLispLexer, RacketLexer, \
- NewLispLexer, ShenLexer
-from pygments.lexers.haskell import HaskellLexer, LiterateHaskellLexer, \
- KokaLexer
-from pygments.lexers.theorem import CoqLexer
-from pygments.lexers.erlang import ErlangLexer, ErlangShellLexer, \
- ElixirConsoleLexer, ElixirLexer
-from pygments.lexers.ml import SMLLexer, OcamlLexer, OpaLexer
-
-__all__ = []
diff --git a/pygments/lexers/go.py b/pygments/lexers/go.py
deleted file mode 100644
index f6bb7fc8..00000000
--- a/pygments/lexers/go.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.go
- ~~~~~~~~~~~~~~~~~~
-
- Lexers for the Google Go language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['GoLexer']
-
-
-class GoLexer(RegexLexer):
- """
- For `Go <http://golang.org>`_ source.
-
- .. versionadded:: 1.2
- """
- name = 'Go'
- filenames = ['*.go']
- aliases = ['go']
- mimetypes = ['text/x-gosrc']
-
- flags = re.MULTILINE | re.UNICODE
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'\s+', Text),
- (r'\\\n', Text), # line continuations
- (r'//(.*?)\n', Comment.Single),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
- (r'(import|package)\b', Keyword.Namespace),
- (r'(var|func|struct|map|chan|type|interface|const)\b',
- Keyword.Declaration),
- (words((
- 'break', 'default', 'select', 'case', 'defer', 'go',
- 'else', 'goto', 'switch', 'fallthrough', 'if', 'range',
- 'continue', 'for', 'return'), suffix=r'\b'),
- Keyword),
- (r'(true|false|iota|nil)\b', Keyword.Constant),
- # It seems the builtin types aren't actually keywords, but
- # can be used as functions. So we need two declarations.
- (words((
- 'uint', 'uint8', 'uint16', 'uint32', 'uint64',
- 'int', 'int8', 'int16', 'int32', 'int64',
- 'float', 'float32', 'float64',
- 'complex64', 'complex128', 'byte', 'rune',
- 'string', 'bool', 'error', 'uintptr',
- 'print', 'println', 'panic', 'recover', 'close', 'complex',
- 'real', 'imag', 'len', 'cap', 'append', 'copy', 'delete',
- 'new', 'make'), suffix=r'\b(\()'),
- bygroups(Name.Builtin, Punctuation)),
- (words((
- 'uint', 'uint8', 'uint16', 'uint32', 'uint64',
- 'int', 'int8', 'int16', 'int32', 'int64',
- 'float', 'float32', 'float64',
- 'complex64', 'complex128', 'byte', 'rune',
- 'string', 'bool', 'error', 'uintptr'), suffix=r'\b'),
- Keyword.Type),
- # imaginary_lit
- (r'\d+i', Number),
- (r'\d+\.\d*([Ee][-+]\d+)?i', Number),
- (r'\.\d+([Ee][-+]\d+)?i', Number),
- (r'\d+[Ee][-+]\d+i', Number),
- # float_lit
- (r'\d+(\.\d+[eE][+\-]?\d+|'
- r'\.\d*|[eE][+\-]?\d+)', Number.Float),
- (r'\.\d+([eE][+\-]?\d+)?', Number.Float),
- # int_lit
- # -- octal_lit
- (r'0[0-7]+', Number.Oct),
- # -- hex_lit
- (r'0[xX][0-9a-fA-F]+', Number.Hex),
- # -- decimal_lit
- (r'(0|[1-9][0-9]*)', Number.Integer),
- # char_lit
- (r"""'(\\['"\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}"""
- r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'""",
- String.Char),
- # StringLiteral
- # -- raw_string_lit
- (r'`[^`]*`', String),
- # -- interpreted_string_lit
- (r'"(\\\\|\\"|[^"])*"', String),
- # Tokens
- (r'(<<=|>>=|<<|>>|<=|>=|&\^=|&\^|\+=|-=|\*=|/=|%=|&=|\|=|&&|\|\|'
- r'|<-|\+\+|--|==|!=|:=|\.\.\.|[+\-*/%&])', Operator),
- (r'[|^<>=!()\[\]{}.,;:]', Punctuation),
- # identifier
- (r'[^\W\d]\w*', Name.Other),
- ]
- }
diff --git a/pygments/lexers/grammar_notation.py b/pygments/lexers/grammar_notation.py
deleted file mode 100644
index 66d3eb36..00000000
--- a/pygments/lexers/grammar_notation.py
+++ /dev/null
@@ -1,213 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.grammar_notation
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for grammer notations like BNF.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, include, this, using, words
-from pygments.token import Comment, Keyword, Literal, Name, Number, \
- Operator, Punctuation, String, Text
-
-__all__ = ['BnfLexer', 'AbnfLexer', 'JsgfLexer']
-
-
-class BnfLexer(RegexLexer):
- """
- This lexer is for grammer notations which are similar to
- original BNF.
-
- In order to maximize a number of targets of this lexer,
- let's decide some designs:
-
- * We don't distinguish `Terminal Symbol`.
-
- * We do assume that `NonTerminal Symbol` are always enclosed
- with arrow brackets.
-
- * We do assume that `NonTerminal Symbol` may include
- any printable characters except arrow brackets and ASCII 0x20.
- This assumption is for `RBNF <http://www.rfc-base.org/txt/rfc-5511.txt>`_.
-
- * We do assume that target notation doesn't support comment.
-
- * We don't distinguish any operators and punctuation except
- `::=`.
-
- Though these desision making might cause too minimal highlighting
- and you might be disappointed, but it is reasonable for us.
-
- .. versionadded:: 2.1
- """
-
- name = 'BNF'
- aliases = ['bnf']
- filenames = ['*.bnf']
- mimetypes = ['text/x-bnf']
-
- tokens = {
- 'root': [
- (r'(<)([ -;=?-~]+)(>)',
- bygroups(Punctuation, Name.Class, Punctuation)),
-
- # an only operator
- (r'::=', Operator),
-
- # fallback
- (r'[^<>:]+', Text), # for performance
- (r'.', Text),
- ],
- }
-
-
-class AbnfLexer(RegexLexer):
- """
- Lexer for `IETF 7405 ABNF
- <http://www.ietf.org/rfc/rfc7405.txt>`_
- (Updates `5234 <http://www.ietf.org/rfc/rfc5234.txt>`_)
- grammars.
-
- .. versionadded:: 2.1
- """
-
- name = 'ABNF'
- aliases = ['abnf']
- filenames = ['*.abnf']
- mimetypes = ['text/x-abnf']
-
- _core_rules = (
- 'ALPHA', 'BIT', 'CHAR', 'CR', 'CRLF', 'CTL', 'DIGIT',
- 'DQUOTE', 'HEXDIG', 'HTAB', 'LF', 'LWSP', 'OCTET',
- 'SP', 'VCHAR', 'WSP')
-
- tokens = {
- 'root': [
- # comment
- (r';.*$', Comment.Single),
-
- # quoted
- # double quote itself in this state, it is as '%x22'.
- (r'(%[si])?"[^"]*"', Literal),
-
- # binary (but i have never seen...)
- (r'%b[01]+\-[01]+\b', Literal), # range
- (r'%b[01]+(\.[01]+)*\b', Literal), # concat
-
- # decimal
- (r'%d[0-9]+\-[0-9]+\b', Literal), # range
- (r'%d[0-9]+(\.[0-9]+)*\b', Literal), # concat
-
- # hexadecimal
- (r'%x[0-9a-fA-F]+\-[0-9a-fA-F]+\b', Literal), # range
- (r'%x[0-9a-fA-F]+(\.[0-9a-fA-F]+)*\b', Literal), # concat
-
- # repetition (<a>*<b>element) including nRule
- (r'\b[0-9]+\*[0-9]+', Operator),
- (r'\b[0-9]+\*', Operator),
- (r'\b[0-9]+', Operator),
- (r'\*', Operator),
-
- # Strictly speaking, these are not keyword but
- # are called `Core Rule'.
- (words(_core_rules, suffix=r'\b'), Keyword),
-
- # nonterminals (ALPHA *(ALPHA / DIGIT / "-"))
- (r'[a-zA-Z][a-zA-Z0-9-]+\b', Name.Class),
-
- # operators
- (r'(=/|=|/)', Operator),
-
- # punctuation
- (r'[\[\]()]', Punctuation),
-
- # fallback
- (r'\s+', Text),
- (r'.', Text),
- ],
- }
-
-
-class JsgfLexer(RegexLexer):
- """
- For `JSpeech Grammar Format <https://www.w3.org/TR/jsgf/>`_
- grammars.
-
- .. versionadded:: 2.2
- """
- name = 'JSGF'
- aliases = ['jsgf']
- filenames = ['*.jsgf']
- mimetypes = ['application/jsgf', 'application/x-jsgf', 'text/jsgf']
-
- flags = re.MULTILINE | re.UNICODE
-
- tokens = {
- 'root': [
- include('comments'),
- include('non-comments'),
- ],
- 'comments': [
- (r'/\*\*(?!/)', Comment.Multiline, 'documentation comment'),
- (r'/\*[\w\W]*?\*/', Comment.Multiline),
- (r'//.*', Comment.Single),
- ],
- 'non-comments': [
- (r'\A#JSGF[^;]*', Comment.Preproc),
- (r'\s+', Text),
- (r';', Punctuation),
- (r'[=|()\[\]*+]', Operator),
- (r'/[^/]+/', Number.Float),
- (r'"', String.Double, 'string'),
- (r'\{', String.Other, 'tag'),
- (words(('import', 'public'), suffix=r'\b'), Keyword.Reserved),
- (r'grammar\b', Keyword.Reserved, 'grammar name'),
- (r'(<)(NULL|VOID)(>)',
- bygroups(Punctuation, Name.Builtin, Punctuation)),
- (r'<', Punctuation, 'rulename'),
- (r'\w+|[^\s;=|()\[\]*+/"{<\w]+', Text),
- ],
- 'string': [
- (r'"', String.Double, '#pop'),
- (r'\\.', String.Escape),
- (r'[^\\"]+', String.Double),
- ],
- 'tag': [
- (r'\}', String.Other, '#pop'),
- (r'\\.', String.Escape),
- (r'[^\\}]+', String.Other),
- ],
- 'grammar name': [
- (r';', Punctuation, '#pop'),
- (r'\s+', Text),
- (r'\.', Punctuation),
- (r'[^;\s.]+', Name.Namespace),
- ],
- 'rulename': [
- (r'>', Punctuation, '#pop'),
- (r'\*', Punctuation),
- (r'\s+', Text),
- (r'([^.>]+)(\s*)(\.)', bygroups(Name.Namespace, Text, Punctuation)),
- (r'[^.>]+', Name.Constant),
- ],
- 'documentation comment': [
- (r'\*/', Comment.Multiline, '#pop'),
- (r'(^\s*\*?\s*)(@(?:example|see)\s+)'
- r'([\w\W]*?(?=(?:^\s*\*?\s*@|\*/)))',
- bygroups(Comment.Multiline, Comment.Special,
- using(this, state='example'))),
- (r'(^\s*\*?\s*)(@\S*)',
- bygroups(Comment.Multiline, Comment.Special)),
- (r'[^*\n@]+|\w|\W', Comment.Multiline),
- ],
- 'example': [
- (r'\n\s*\*', Comment.Multiline),
- include('non-comments'),
- (r'.', Comment.Multiline),
- ],
- }
diff --git a/pygments/lexers/graph.py b/pygments/lexers/graph.py
deleted file mode 100644
index f7b45e29..00000000
--- a/pygments/lexers/graph.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.graph
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for graph query languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, using, this
-from pygments.token import Keyword, Punctuation, Comment, Operator, Name,\
- String, Number, Whitespace
-
-
-__all__ = ['CypherLexer']
-
-
-class CypherLexer(RegexLexer):
- """
- For `Cypher Query Language
- <https://neo4j.com/docs/developer-manual/3.3/cypher/>`_
-
- For the Cypher version in Neo4j 3.3
-
- .. versionadded:: 2.0
- """
- name = 'Cypher'
- aliases = ['cypher']
- filenames = ['*.cyp', '*.cypher']
-
- flags = re.MULTILINE | re.IGNORECASE
-
- tokens = {
- 'root': [
- include('comment'),
- include('keywords'),
- include('clauses'),
- include('relations'),
- include('strings'),
- include('whitespace'),
- include('barewords'),
- ],
- 'comment': [
- (r'^.*//.*\n', Comment.Single),
- ],
- 'keywords': [
- (r'(create|order|match|limit|set|skip|start|return|with|where|'
- r'delete|foreach|not|by|true|false)\b', Keyword),
- ],
- 'clauses': [
- # based on https://neo4j.com/docs/cypher-refcard/3.3/
- (r'(all|any|as|asc|ascending|assert|call|case|create|'
- r'create\s+index|create\s+unique|delete|desc|descending|'
- r'distinct|drop\s+constraint\s+on|drop\s+index\s+on|end|'
- r'ends\s+with|fieldterminator|foreach|in|is\s+node\s+key|'
- r'is\s+null|is\s+unique|limit|load\s+csv\s+from|match|merge|none|'
- r'not|null|on\s+match|on\s+create|optional\s+match|order\s+by|'
- r'remove|return|set|skip|single|start|starts\s+with|then|union|'
- r'union\s+all|unwind|using\s+periodic\s+commit|yield|where|when|'
- r'with)\b', Keyword),
- ],
- 'relations': [
- (r'(-\[)(.*?)(\]->)', bygroups(Operator, using(this), Operator)),
- (r'(<-\[)(.*?)(\]-)', bygroups(Operator, using(this), Operator)),
- (r'(-\[)(.*?)(\]-)', bygroups(Operator, using(this), Operator)),
- (r'-->|<--|\[|\]', Operator),
- (r'<|>|<>|=|<=|=>|\(|\)|\||:|,|;', Punctuation),
- (r'[.*{}]', Punctuation),
- ],
- 'strings': [
- (r'"(?:\\[tbnrf\'"\\]|[^\\"])*"', String),
- (r'`(?:``|[^`])+`', Name.Variable),
- ],
- 'whitespace': [
- (r'\s+', Whitespace),
- ],
- 'barewords': [
- (r'[a-z]\w*', Name),
- (r'\d+', Number),
- ],
- }
diff --git a/pygments/lexers/graphics.py b/pygments/lexers/graphics.py
deleted file mode 100644
index b0b9145e..00000000
--- a/pygments/lexers/graphics.py
+++ /dev/null
@@ -1,781 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.graphics
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for computer graphics and plotting related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, words, include, bygroups, using, \
- this, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, \
- Number, Punctuation, String
-
-__all__ = ['GLShaderLexer', 'PostScriptLexer', 'AsymptoteLexer', 'GnuplotLexer',
- 'PovrayLexer', 'HLSLShaderLexer']
-
-
-class GLShaderLexer(RegexLexer):
- """
- GLSL (OpenGL Shader) lexer.
-
- .. versionadded:: 1.1
- """
- name = 'GLSL'
- aliases = ['glsl']
- filenames = ['*.vert', '*.frag', '*.geo']
- mimetypes = ['text/x-glslsrc']
-
- tokens = {
- 'root': [
- (r'^#.*', Comment.Preproc),
- (r'//.*', Comment.Single),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
- (r'\+|-|~|!=?|\*|/|%|<<|>>|<=?|>=?|==?|&&?|\^|\|\|?',
- Operator),
- (r'[?:]', Operator), # quick hack for ternary
- (r'\bdefined\b', Operator),
- (r'[;{}(),\[\]]', Punctuation),
- # FIXME when e is present, no decimal point needed
- (r'[+-]?\d*\.\d+([eE][-+]?\d+)?', Number.Float),
- (r'[+-]?\d+\.\d*([eE][-+]?\d+)?', Number.Float),
- (r'0[xX][0-9a-fA-F]*', Number.Hex),
- (r'0[0-7]*', Number.Oct),
- (r'[1-9][0-9]*', Number.Integer),
- (words((
- # Storage qualifiers
- 'attribute', 'const', 'uniform', 'varying',
- 'buffer', 'shared', 'in', 'out',
- # Layout qualifiers
- 'layout',
- # Interpolation qualifiers
- 'flat', 'smooth', 'noperspective',
- # Auxiliary qualifiers
- 'centroid', 'sample', 'patch',
- # Parameter qualifiers. Some double as Storage qualifiers
- 'inout',
- # Precision qualifiers
- 'lowp', 'mediump', 'highp', 'precision',
- # Invariance qualifiers
- 'invariant',
- # Precise qualifiers
- 'precise',
- # Memory qualifiers
- 'coherent', 'volatile', 'restrict', 'readonly', 'writeonly',
- # Statements
- 'break', 'continue', 'do', 'for', 'while', 'switch',
- 'case', 'default', 'if', 'else', 'subroutine',
- 'discard', 'return', 'struct'),
- prefix=r'\b', suffix=r'\b'),
- Keyword),
- (words((
- # Boolean values
- 'true', 'false'),
- prefix=r'\b', suffix=r'\b'),
- Keyword.Constant),
- (words((
- # Miscellaneous types
- 'void', 'atomic_uint',
- # Floating-point scalars and vectors
- 'float', 'vec2', 'vec3', 'vec4',
- 'double', 'dvec2', 'dvec3', 'dvec4',
- # Integer scalars and vectors
- 'int', 'ivec2', 'ivec3', 'ivec4',
- 'uint', 'uvec2', 'uvec3', 'uvec4',
- # Boolean scalars and vectors
- 'bool', 'bvec2', 'bvec3', 'bvec4',
- # Matrices
- 'mat2', 'mat3', 'mat4', 'dmat2', 'dmat3', 'dmat4',
- 'mat2x2', 'mat2x3', 'mat2x4', 'dmat2x2', 'dmat2x3', 'dmat2x4',
- 'mat3x2', 'mat3x3', 'mat3x4', 'dmat3x2', 'dmat3x3',
- 'dmat3x4', 'mat4x2', 'mat4x3', 'mat4x4', 'dmat4x2', 'dmat4x3', 'dmat4x4',
- # Floating-point samplers
- 'sampler1D', 'sampler2D', 'sampler3D', 'samplerCube',
- 'sampler1DArray', 'sampler2DArray', 'samplerCubeArray',
- 'sampler2DRect', 'samplerBuffer',
- 'sampler2DMS', 'sampler2DMSArray',
- # Shadow samplers
- 'sampler1DShadow', 'sampler2DShadow', 'samplerCubeShadow',
- 'sampler1DArrayShadow', 'sampler2DArrayShadow',
- 'samplerCubeArrayShadow', 'sampler2DRectShadow',
- # Signed integer samplers
- 'isampler1D', 'isampler2D', 'isampler3D', 'isamplerCube',
- 'isampler1DArray', 'isampler2DArray', 'isamplerCubeArray',
- 'isampler2DRect', 'isamplerBuffer',
- 'isampler2DMS', 'isampler2DMSArray',
- # Unsigned integer samplers
- 'usampler1D', 'usampler2D', 'usampler3D', 'usamplerCube',
- 'usampler1DArray', 'usampler2DArray', 'usamplerCubeArray',
- 'usampler2DRect', 'usamplerBuffer',
- 'usampler2DMS', 'usampler2DMSArray',
- # Floating-point image types
- 'image1D', 'image2D', 'image3D', 'imageCube',
- 'image1DArray', 'image2DArray', 'imageCubeArray',
- 'image2DRect', 'imageBuffer',
- 'image2DMS', 'image2DMSArray',
- # Signed integer image types
- 'iimage1D', 'iimage2D', 'iimage3D', 'iimageCube',
- 'iimage1DArray', 'iimage2DArray', 'iimageCubeArray',
- 'iimage2DRect', 'iimageBuffer',
- 'iimage2DMS', 'iimage2DMSArray',
- # Unsigned integer image types
- 'uimage1D', 'uimage2D', 'uimage3D', 'uimageCube',
- 'uimage1DArray', 'uimage2DArray', 'uimageCubeArray',
- 'uimage2DRect', 'uimageBuffer',
- 'uimage2DMS', 'uimage2DMSArray'),
- prefix=r'\b', suffix=r'\b'),
- Keyword.Type),
- (words((
- # Reserved for future use.
- 'common', 'partition', 'active', 'asm', 'class',
- 'union', 'enum', 'typedef', 'template', 'this',
- 'resource', 'goto', 'inline', 'noinline', 'public',
- 'static', 'extern', 'external', 'interface', 'long',
- 'short', 'half', 'fixed', 'unsigned', 'superp', 'input',
- 'output', 'hvec2', 'hvec3', 'hvec4', 'fvec2', 'fvec3',
- 'fvec4', 'sampler3DRect', 'filter', 'sizeof', 'cast',
- 'namespace', 'using'),
- prefix=r'\b', suffix=r'\b'),
- Keyword.Reserved),
- # All names beginning with "gl_" are reserved.
- (r'gl_\w*', Name.Builtin),
- (r'[a-zA-Z_]\w*', Name),
- (r'\.', Punctuation),
- (r'\s+', Text),
- ],
- }
-
-
-class HLSLShaderLexer(RegexLexer):
- """
- HLSL (Microsoft Direct3D Shader) lexer.
-
- .. versionadded:: 2.3
- """
- name = 'HLSL'
- aliases = ['hlsl']
- filenames = ['*.hlsl', '*.hlsli']
- mimetypes = ['text/x-hlsl']
-
- tokens = {
- 'root': [
- (r'^#.*', Comment.Preproc),
- (r'//.*', Comment.Single),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
- (r'\+|-|~|!=?|\*|/|%|<<|>>|<=?|>=?|==?|&&?|\^|\|\|?',
- Operator),
- (r'[?:]', Operator), # quick hack for ternary
- (r'\bdefined\b', Operator),
- (r'[;{}(),.\[\]]', Punctuation),
- # FIXME when e is present, no decimal point needed
- (r'[+-]?\d*\.\d+([eE][-+]?\d+)?f?', Number.Float),
- (r'[+-]?\d+\.\d*([eE][-+]?\d+)?f?', Number.Float),
- (r'0[xX][0-9a-fA-F]*', Number.Hex),
- (r'0[0-7]*', Number.Oct),
- (r'[1-9][0-9]*', Number.Integer),
- (r'"', String, 'string'),
- (words((
- 'asm','asm_fragment','break','case','cbuffer','centroid','class',
- 'column_major','compile','compile_fragment','const','continue',
- 'default','discard','do','else','export','extern','for','fxgroup',
- 'globallycoherent','groupshared','if','in','inline','inout',
- 'interface','line','lineadj','linear','namespace','nointerpolation',
- 'noperspective','NULL','out','packoffset','pass','pixelfragment',
- 'point','precise','return','register','row_major','sample',
- 'sampler','shared','stateblock','stateblock_state','static',
- 'struct','switch','tbuffer','technique','technique10',
- 'technique11','texture','typedef','triangle','triangleadj',
- 'uniform','vertexfragment','volatile','while'),
- prefix=r'\b', suffix=r'\b'),
- Keyword),
- (words(('true','false'), prefix=r'\b', suffix=r'\b'),
- Keyword.Constant),
- (words((
- 'auto','catch','char','const_cast','delete','dynamic_cast','enum',
- 'explicit','friend','goto','long','mutable','new','operator',
- 'private','protected','public','reinterpret_cast','short','signed',
- 'sizeof','static_cast','template','this','throw','try','typename',
- 'union','unsigned','using','virtual'),
- prefix=r'\b', suffix=r'\b'),
- Keyword.Reserved),
- (words((
- 'dword','matrix','snorm','string','unorm','unsigned','void','vector',
- 'BlendState','Buffer','ByteAddressBuffer','ComputeShader',
- 'DepthStencilState','DepthStencilView','DomainShader',
- 'GeometryShader','HullShader','InputPatch','LineStream',
- 'OutputPatch','PixelShader','PointStream','RasterizerState',
- 'RenderTargetView','RasterizerOrderedBuffer',
- 'RasterizerOrderedByteAddressBuffer',
- 'RasterizerOrderedStructuredBuffer','RasterizerOrderedTexture1D',
- 'RasterizerOrderedTexture1DArray','RasterizerOrderedTexture2D',
- 'RasterizerOrderedTexture2DArray','RasterizerOrderedTexture3D',
- 'RWBuffer','RWByteAddressBuffer','RWStructuredBuffer',
- 'RWTexture1D','RWTexture1DArray','RWTexture2D','RWTexture2DArray',
- 'RWTexture3D','SamplerState','SamplerComparisonState',
- 'StructuredBuffer','Texture1D','Texture1DArray','Texture2D',
- 'Texture2DArray','Texture2DMS','Texture2DMSArray','Texture3D',
- 'TextureCube','TextureCubeArray','TriangleStream','VertexShader'),
- prefix=r'\b', suffix=r'\b'),
- Keyword.Type),
- (words((
- 'bool','double','float','int','half','min16float','min10float',
- 'min16int','min12int','min16uint','uint'),
- prefix=r'\b', suffix=r'([1-4](x[1-4])?)?\b'),
- Keyword.Type), # vector and matrix types
- (words((
- 'abort','abs','acos','all','AllMemoryBarrier',
- 'AllMemoryBarrierWithGroupSync','any','AppendStructuredBuffer',
- 'asdouble','asfloat','asin','asint','asuint','asuint','atan',
- 'atan2','ceil','CheckAccessFullyMapped','clamp','clip',
- 'CompileShader','ConsumeStructuredBuffer','cos','cosh','countbits',
- 'cross','D3DCOLORtoUBYTE4','ddx','ddx_coarse','ddx_fine','ddy',
- 'ddy_coarse','ddy_fine','degrees','determinant',
- 'DeviceMemoryBarrier','DeviceMemoryBarrierWithGroupSync','distance',
- 'dot','dst','errorf','EvaluateAttributeAtCentroid',
- 'EvaluateAttributeAtSample','EvaluateAttributeSnapped','exp',
- 'exp2','f16tof32','f32tof16','faceforward','firstbithigh',
- 'firstbitlow','floor','fma','fmod','frac','frexp','fwidth',
- 'GetRenderTargetSampleCount','GetRenderTargetSamplePosition',
- 'GlobalOrderedCountIncrement','GroupMemoryBarrier',
- 'GroupMemoryBarrierWithGroupSync','InterlockedAdd','InterlockedAnd',
- 'InterlockedCompareExchange','InterlockedCompareStore',
- 'InterlockedExchange','InterlockedMax','InterlockedMin',
- 'InterlockedOr','InterlockedXor','isfinite','isinf','isnan',
- 'ldexp','length','lerp','lit','log','log10','log2','mad','max',
- 'min','modf','msad4','mul','noise','normalize','pow','printf',
- 'Process2DQuadTessFactorsAvg','Process2DQuadTessFactorsMax',
- 'Process2DQuadTessFactorsMin','ProcessIsolineTessFactors',
- 'ProcessQuadTessFactorsAvg','ProcessQuadTessFactorsMax',
- 'ProcessQuadTessFactorsMin','ProcessTriTessFactorsAvg',
- 'ProcessTriTessFactorsMax','ProcessTriTessFactorsMin',
- 'QuadReadLaneAt','QuadSwapX','QuadSwapY','radians','rcp',
- 'reflect','refract','reversebits','round','rsqrt','saturate',
- 'sign','sin','sincos','sinh','smoothstep','sqrt','step','tan',
- 'tanh','tex1D','tex1D','tex1Dbias','tex1Dgrad','tex1Dlod',
- 'tex1Dproj','tex2D','tex2D','tex2Dbias','tex2Dgrad','tex2Dlod',
- 'tex2Dproj','tex3D','tex3D','tex3Dbias','tex3Dgrad','tex3Dlod',
- 'tex3Dproj','texCUBE','texCUBE','texCUBEbias','texCUBEgrad',
- 'texCUBElod','texCUBEproj','transpose','trunc','WaveAllBitAnd',
- 'WaveAllMax','WaveAllMin','WaveAllBitOr','WaveAllBitXor',
- 'WaveAllEqual','WaveAllProduct','WaveAllSum','WaveAllTrue',
- 'WaveAnyTrue','WaveBallot','WaveGetLaneCount','WaveGetLaneIndex',
- 'WaveGetOrderedIndex','WaveIsHelperLane','WaveOnce',
- 'WavePrefixProduct','WavePrefixSum','WaveReadFirstLane',
- 'WaveReadLaneAt'),
- prefix=r'\b', suffix=r'\b'),
- Name.Builtin), # built-in functions
- (words((
- 'SV_ClipDistance','SV_ClipDistance0','SV_ClipDistance1',
- 'SV_Culldistance','SV_CullDistance0','SV_CullDistance1',
- 'SV_Coverage','SV_Depth','SV_DepthGreaterEqual',
- 'SV_DepthLessEqual','SV_DispatchThreadID','SV_DomainLocation',
- 'SV_GroupID','SV_GroupIndex','SV_GroupThreadID','SV_GSInstanceID',
- 'SV_InnerCoverage','SV_InsideTessFactor','SV_InstanceID',
- 'SV_IsFrontFace','SV_OutputControlPointID','SV_Position',
- 'SV_PrimitiveID','SV_RenderTargetArrayIndex','SV_SampleIndex',
- 'SV_StencilRef','SV_TessFactor','SV_VertexID',
- 'SV_ViewportArrayIndex'),
- prefix=r'\b', suffix=r'\b'),
- Name.Decorator), # system-value semantics
- (r'\bSV_Target[0-7]?\b', Name.Decorator),
- (words((
- 'allow_uav_condition','branch','call','domain','earlydepthstencil',
- 'fastopt','flatten','forcecase','instance','loop','maxtessfactor',
- 'numthreads','outputcontrolpoints','outputtopology','partitioning',
- 'patchconstantfunc','unroll'),
- prefix=r'\b', suffix=r'\b'),
- Name.Decorator), # attributes
- (r'[a-zA-Z_]\w*', Name),
- (r'\\$', Comment.Preproc), # backslash at end of line -- usually macro continuation
- (r'\s+', Text),
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|'
- r'u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})', String.Escape),
- (r'[^\\"\n]+', String), # all other characters
- (r'\\\n', String), # line continuation
- (r'\\', String), # stray backslash
- ],
- }
-
-
-class PostScriptLexer(RegexLexer):
- """
- Lexer for PostScript files.
-
- The PostScript Language Reference published by Adobe at
- <http://partners.adobe.com/public/developer/en/ps/PLRM.pdf>
- is the authority for this.
-
- .. versionadded:: 1.4
- """
- name = 'PostScript'
- aliases = ['postscript', 'postscr']
- filenames = ['*.ps', '*.eps']
- mimetypes = ['application/postscript']
-
- delimiter = r'()<>\[\]{}/%\s'
- delimiter_end = r'(?=[%s])' % delimiter
-
- valid_name_chars = r'[^%s]' % delimiter
- valid_name = r"%s+%s" % (valid_name_chars, delimiter_end)
-
- tokens = {
- 'root': [
- # All comment types
- (r'^%!.+\n', Comment.Preproc),
- (r'%%.*\n', Comment.Special),
- (r'(^%.*\n){2,}', Comment.Multiline),
- (r'%.*\n', Comment.Single),
-
- # String literals are awkward; enter separate state.
- (r'\(', String, 'stringliteral'),
-
- (r'[{}<>\[\]]', Punctuation),
-
- # Numbers
- (r'<[0-9A-Fa-f]+>' + delimiter_end, Number.Hex),
- # Slight abuse: use Oct to signify any explicit base system
- (r'[0-9]+\#(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)'
- r'((e|E)[0-9]+)?' + delimiter_end, Number.Oct),
- (r'(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)((e|E)[0-9]+)?'
- + delimiter_end, Number.Float),
- (r'(\-|\+)?[0-9]+' + delimiter_end, Number.Integer),
-
- # References
- (r'\/%s' % valid_name, Name.Variable),
-
- # Names
- (valid_name, Name.Function), # Anything else is executed
-
- # These keywords taken from
- # <http://www.math.ubc.ca/~cass/graphics/manual/pdf/a1.pdf>
- # Is there an authoritative list anywhere that doesn't involve
- # trawling documentation?
-
- (r'(false|true)' + delimiter_end, Keyword.Constant),
-
- # Conditionals / flow control
- (r'(eq|ne|g[et]|l[et]|and|or|not|if(?:else)?|for(?:all)?)'
- + delimiter_end, Keyword.Reserved),
-
- (words((
- 'abs', 'add', 'aload', 'arc', 'arcn', 'array', 'atan', 'begin',
- 'bind', 'ceiling', 'charpath', 'clip', 'closepath', 'concat',
- 'concatmatrix', 'copy', 'cos', 'currentlinewidth', 'currentmatrix',
- 'currentpoint', 'curveto', 'cvi', 'cvs', 'def', 'defaultmatrix',
- 'dict', 'dictstackoverflow', 'div', 'dtransform', 'dup', 'end',
- 'exch', 'exec', 'exit', 'exp', 'fill', 'findfont', 'floor', 'get',
- 'getinterval', 'grestore', 'gsave', 'gt', 'identmatrix', 'idiv',
- 'idtransform', 'index', 'invertmatrix', 'itransform', 'length',
- 'lineto', 'ln', 'load', 'log', 'loop', 'matrix', 'mod', 'moveto',
- 'mul', 'neg', 'newpath', 'pathforall', 'pathbbox', 'pop', 'print',
- 'pstack', 'put', 'quit', 'rand', 'rangecheck', 'rcurveto', 'repeat',
- 'restore', 'rlineto', 'rmoveto', 'roll', 'rotate', 'round', 'run',
- 'save', 'scale', 'scalefont', 'setdash', 'setfont', 'setgray',
- 'setlinecap', 'setlinejoin', 'setlinewidth', 'setmatrix',
- 'setrgbcolor', 'shfill', 'show', 'showpage', 'sin', 'sqrt',
- 'stack', 'stringwidth', 'stroke', 'strokepath', 'sub', 'syntaxerror',
- 'transform', 'translate', 'truncate', 'typecheck', 'undefined',
- 'undefinedfilename', 'undefinedresult'), suffix=delimiter_end),
- Name.Builtin),
-
- (r'\s+', Text),
- ],
-
- 'stringliteral': [
- (r'[^()\\]+', String),
- (r'\\', String.Escape, 'escape'),
- (r'\(', String, '#push'),
- (r'\)', String, '#pop'),
- ],
-
- 'escape': [
- (r'[0-8]{3}|n|r|t|b|f|\\|\(|\)', String.Escape, '#pop'),
- default('#pop'),
- ],
- }
-
-
-class AsymptoteLexer(RegexLexer):
- """
- For `Asymptote <http://asymptote.sf.net/>`_ source code.
-
- .. versionadded:: 1.2
- """
- name = 'Asymptote'
- aliases = ['asy', 'asymptote']
- filenames = ['*.asy']
- mimetypes = ['text/x-asymptote']
-
- #: optional Comment or Whitespace
- _ws = r'(?:\s|//.*?\n|/\*.*?\*/)+'
-
- tokens = {
- 'whitespace': [
- (r'\n', Text),
- (r'\s+', Text),
- (r'\\\n', Text), # line continuation
- (r'//(\n|(.|\n)*?[^\\]\n)', Comment),
- (r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment),
- ],
- 'statements': [
- # simple string (TeX friendly)
- (r'"(\\\\|\\"|[^"])*"', String),
- # C style string (with character escapes)
- (r"'", String, 'string'),
- (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
- (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
- (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
- (r'0[0-7]+[Ll]?', Number.Oct),
- (r'\d+[Ll]?', Number.Integer),
- (r'[~!%^&*+=|?:<>/-]', Operator),
- (r'[()\[\],.]', Punctuation),
- (r'\b(case)(.+?)(:)', bygroups(Keyword, using(this), Text)),
- (r'(and|controls|tension|atleast|curl|if|else|while|for|do|'
- r'return|break|continue|struct|typedef|new|access|import|'
- r'unravel|from|include|quote|static|public|private|restricted|'
- r'this|explicit|true|false|null|cycle|newframe|operator)\b', Keyword),
- # Since an asy-type-name can be also an asy-function-name,
- # in the following we test if the string " [a-zA-Z]" follows
- # the Keyword.Type.
- # Of course it is not perfect !
- (r'(Braid|FitResult|Label|Legend|TreeNode|abscissa|arc|arrowhead|'
- r'binarytree|binarytreeNode|block|bool|bool3|bounds|bqe|circle|'
- r'conic|coord|coordsys|cputime|ellipse|file|filltype|frame|grid3|'
- r'guide|horner|hsv|hyperbola|indexedTransform|int|inversion|key|'
- r'light|line|linefit|marginT|marker|mass|object|pair|parabola|path|'
- r'path3|pen|picture|point|position|projection|real|revolution|'
- r'scaleT|scientific|segment|side|slice|splitface|string|surface|'
- r'tensionSpecifier|ticklocate|ticksgridT|tickvalues|transform|'
- r'transformation|tree|triangle|trilinear|triple|vector|'
- r'vertex|void)(?=\s+[a-zA-Z])', Keyword.Type),
- # Now the asy-type-name which are not asy-function-name
- # except yours !
- # Perhaps useless
- (r'(Braid|FitResult|TreeNode|abscissa|arrowhead|block|bool|bool3|'
- r'bounds|coord|frame|guide|horner|int|linefit|marginT|pair|pen|'
- r'picture|position|real|revolution|slice|splitface|ticksgridT|'
- r'tickvalues|tree|triple|vertex|void)\b', Keyword.Type),
- (r'[a-zA-Z_]\w*:(?!:)', Name.Label),
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'root': [
- include('whitespace'),
- # functions
- (r'((?:[\w*\s])+?(?:\s|\*))' # return arguments
- r'([a-zA-Z_]\w*)' # method name
- r'(\s*\([^;]*?\))' # signature
- r'(' + _ws + r')(\{)',
- bygroups(using(this), Name.Function, using(this), using(this),
- Punctuation),
- 'function'),
- # function declarations
- (r'((?:[\w*\s])+?(?:\s|\*))' # return arguments
- r'([a-zA-Z_]\w*)' # method name
- r'(\s*\([^;]*?\))' # signature
- r'(' + _ws + r')(;)',
- bygroups(using(this), Name.Function, using(this), using(this),
- Punctuation)),
- default('statement'),
- ],
- 'statement': [
- include('whitespace'),
- include('statements'),
- ('[{}]', Punctuation),
- (';', Punctuation, '#pop'),
- ],
- 'function': [
- include('whitespace'),
- include('statements'),
- (';', Punctuation),
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- ],
- 'string': [
- (r"'", String, '#pop'),
- (r'\\([\\abfnrtv"\'?]|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
- (r'\n', String),
- (r"[^\\'\n]+", String), # all other characters
- (r'\\\n', String),
- (r'\\n', String), # line continuation
- (r'\\', String), # stray backslash
- ],
- }
-
- def get_tokens_unprocessed(self, text):
- from pygments.lexers._asy_builtins import ASYFUNCNAME, ASYVARNAME
- for index, token, value in \
- RegexLexer.get_tokens_unprocessed(self, text):
- if token is Name and value in ASYFUNCNAME:
- token = Name.Function
- elif token is Name and value in ASYVARNAME:
- token = Name.Variable
- yield index, token, value
-
-
-def _shortened(word):
- dpos = word.find('$')
- return '|'.join(word[:dpos] + word[dpos+1:i] + r'\b'
- for i in range(len(word), dpos, -1))
-
-
-def _shortened_many(*words):
- return '|'.join(map(_shortened, words))
-
-
-class GnuplotLexer(RegexLexer):
- """
- For `Gnuplot <http://gnuplot.info/>`_ plotting scripts.
-
- .. versionadded:: 0.11
- """
-
- name = 'Gnuplot'
- aliases = ['gnuplot']
- filenames = ['*.plot', '*.plt']
- mimetypes = ['text/x-gnuplot']
-
- tokens = {
- 'root': [
- include('whitespace'),
- (_shortened('bi$nd'), Keyword, 'bind'),
- (_shortened_many('ex$it', 'q$uit'), Keyword, 'quit'),
- (_shortened('f$it'), Keyword, 'fit'),
- (r'(if)(\s*)(\()', bygroups(Keyword, Text, Punctuation), 'if'),
- (r'else\b', Keyword),
- (_shortened('pa$use'), Keyword, 'pause'),
- (_shortened_many('p$lot', 'rep$lot', 'sp$lot'), Keyword, 'plot'),
- (_shortened('sa$ve'), Keyword, 'save'),
- (_shortened('se$t'), Keyword, ('genericargs', 'optionarg')),
- (_shortened_many('sh$ow', 'uns$et'),
- Keyword, ('noargs', 'optionarg')),
- (_shortened_many('low$er', 'ra$ise', 'ca$ll', 'cd$', 'cl$ear',
- 'h$elp', '\\?$', 'hi$story', 'l$oad', 'pr$int',
- 'pwd$', 're$read', 'res$et', 'scr$eendump',
- 'she$ll', 'sy$stem', 'up$date'),
- Keyword, 'genericargs'),
- (_shortened_many('pwd$', 're$read', 'res$et', 'scr$eendump',
- 'she$ll', 'test$'),
- Keyword, 'noargs'),
- (r'([a-zA-Z_]\w*)(\s*)(=)',
- bygroups(Name.Variable, Text, Operator), 'genericargs'),
- (r'([a-zA-Z_]\w*)(\s*\(.*?\)\s*)(=)',
- bygroups(Name.Function, Text, Operator), 'genericargs'),
- (r'@[a-zA-Z_]\w*', Name.Constant), # macros
- (r';', Keyword),
- ],
- 'comment': [
- (r'[^\\\n]', Comment),
- (r'\\\n', Comment),
- (r'\\', Comment),
- # don't add the newline to the Comment token
- default('#pop'),
- ],
- 'whitespace': [
- ('#', Comment, 'comment'),
- (r'[ \t\v\f]+', Text),
- ],
- 'noargs': [
- include('whitespace'),
- # semicolon and newline end the argument list
- (r';', Punctuation, '#pop'),
- (r'\n', Text, '#pop'),
- ],
- 'dqstring': [
- (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
- (r'\n', String, '#pop'), # newline ends the string too
- ],
- 'sqstring': [
- (r"''", String), # escaped single quote
- (r"'", String, '#pop'),
- (r"[^\\'\n]+", String), # all other characters
- (r'\\\n', String), # line continuation
- (r'\\', String), # normal backslash
- (r'\n', String, '#pop'), # newline ends the string too
- ],
- 'genericargs': [
- include('noargs'),
- (r'"', String, 'dqstring'),
- (r"'", String, 'sqstring'),
- (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float),
- (r'(\d+\.\d*|\.\d+)', Number.Float),
- (r'-?\d+', Number.Integer),
- ('[,.~!%^&*+=|?:<>/-]', Operator),
- (r'[{}()\[\]]', Punctuation),
- (r'(eq|ne)\b', Operator.Word),
- (r'([a-zA-Z_]\w*)(\s*)(\()',
- bygroups(Name.Function, Text, Punctuation)),
- (r'[a-zA-Z_]\w*', Name),
- (r'@[a-zA-Z_]\w*', Name.Constant), # macros
- (r'\\\n', Text),
- ],
- 'optionarg': [
- include('whitespace'),
- (_shortened_many(
- "a$ll", "an$gles", "ar$row", "au$toscale", "b$ars", "bor$der",
- "box$width", "cl$abel", "c$lip", "cn$trparam", "co$ntour", "da$ta",
- "data$file", "dg$rid3d", "du$mmy", "enc$oding", "dec$imalsign",
- "fit$", "font$path", "fo$rmat", "fu$nction", "fu$nctions", "g$rid",
- "hid$den3d", "his$torysize", "is$osamples", "k$ey", "keyt$itle",
- "la$bel", "li$nestyle", "ls$", "loa$dpath", "loc$ale", "log$scale",
- "mac$ros", "map$ping", "map$ping3d", "mar$gin", "lmar$gin",
- "rmar$gin", "tmar$gin", "bmar$gin", "mo$use", "multi$plot",
- "mxt$ics", "nomxt$ics", "mx2t$ics", "nomx2t$ics", "myt$ics",
- "nomyt$ics", "my2t$ics", "nomy2t$ics", "mzt$ics", "nomzt$ics",
- "mcbt$ics", "nomcbt$ics", "of$fsets", "or$igin", "o$utput",
- "pa$rametric", "pm$3d", "pal$ette", "colorb$ox", "p$lot",
- "poi$ntsize", "pol$ar", "pr$int", "obj$ect", "sa$mples", "si$ze",
- "st$yle", "su$rface", "table$", "t$erminal", "termo$ptions", "ti$cs",
- "ticsc$ale", "ticsl$evel", "timef$mt", "tim$estamp", "tit$le",
- "v$ariables", "ve$rsion", "vi$ew", "xyp$lane", "xda$ta", "x2da$ta",
- "yda$ta", "y2da$ta", "zda$ta", "cbda$ta", "xl$abel", "x2l$abel",
- "yl$abel", "y2l$abel", "zl$abel", "cbl$abel", "xti$cs", "noxti$cs",
- "x2ti$cs", "nox2ti$cs", "yti$cs", "noyti$cs", "y2ti$cs", "noy2ti$cs",
- "zti$cs", "nozti$cs", "cbti$cs", "nocbti$cs", "xdti$cs", "noxdti$cs",
- "x2dti$cs", "nox2dti$cs", "ydti$cs", "noydti$cs", "y2dti$cs",
- "noy2dti$cs", "zdti$cs", "nozdti$cs", "cbdti$cs", "nocbdti$cs",
- "xmti$cs", "noxmti$cs", "x2mti$cs", "nox2mti$cs", "ymti$cs",
- "noymti$cs", "y2mti$cs", "noy2mti$cs", "zmti$cs", "nozmti$cs",
- "cbmti$cs", "nocbmti$cs", "xr$ange", "x2r$ange", "yr$ange",
- "y2r$ange", "zr$ange", "cbr$ange", "rr$ange", "tr$ange", "ur$ange",
- "vr$ange", "xzeroa$xis", "x2zeroa$xis", "yzeroa$xis", "y2zeroa$xis",
- "zzeroa$xis", "zeroa$xis", "z$ero"), Name.Builtin, '#pop'),
- ],
- 'bind': [
- ('!', Keyword, '#pop'),
- (_shortened('all$windows'), Name.Builtin),
- include('genericargs'),
- ],
- 'quit': [
- (r'gnuplot\b', Keyword),
- include('noargs'),
- ],
- 'fit': [
- (r'via\b', Name.Builtin),
- include('plot'),
- ],
- 'if': [
- (r'\)', Punctuation, '#pop'),
- include('genericargs'),
- ],
- 'pause': [
- (r'(mouse|any|button1|button2|button3)\b', Name.Builtin),
- (_shortened('key$press'), Name.Builtin),
- include('genericargs'),
- ],
- 'plot': [
- (_shortened_many('ax$es', 'axi$s', 'bin$ary', 'ev$ery', 'i$ndex',
- 'mat$rix', 's$mooth', 'thru$', 't$itle',
- 'not$itle', 'u$sing', 'w$ith'),
- Name.Builtin),
- include('genericargs'),
- ],
- 'save': [
- (_shortened_many('f$unctions', 's$et', 't$erminal', 'v$ariables'),
- Name.Builtin),
- include('genericargs'),
- ],
- }
-
-
-class PovrayLexer(RegexLexer):
- """
- For `Persistence of Vision Raytracer <http://www.povray.org/>`_ files.
-
- .. versionadded:: 0.11
- """
- name = 'POVRay'
- aliases = ['pov']
- filenames = ['*.pov', '*.inc']
- mimetypes = ['text/x-povray']
-
- tokens = {
- 'root': [
- (r'/\*[\w\W]*?\*/', Comment.Multiline),
- (r'//.*\n', Comment.Single),
- (r'(?s)"(?:\\.|[^"\\])+"', String.Double),
- (words((
- 'break', 'case', 'debug', 'declare', 'default', 'define', 'else',
- 'elseif', 'end', 'error', 'fclose', 'fopen', 'for', 'if', 'ifdef',
- 'ifndef', 'include', 'local', 'macro', 'range', 'read', 'render',
- 'statistics', 'switch', 'undef', 'version', 'warning', 'while',
- 'write'), prefix=r'#', suffix=r'\b'),
- Comment.Preproc),
- (words((
- 'aa_level', 'aa_threshold', 'abs', 'acos', 'acosh', 'adaptive', 'adc_bailout',
- 'agate', 'agate_turb', 'all', 'alpha', 'ambient', 'ambient_light', 'angle',
- 'aperture', 'arc_angle', 'area_light', 'asc', 'asin', 'asinh', 'assumed_gamma',
- 'atan', 'atan2', 'atanh', 'atmosphere', 'atmospheric_attenuation',
- 'attenuating', 'average', 'background', 'black_hole', 'blue', 'blur_samples',
- 'bounded_by', 'box_mapping', 'bozo', 'break', 'brick', 'brick_size',
- 'brightness', 'brilliance', 'bumps', 'bumpy1', 'bumpy2', 'bumpy3', 'bump_map',
- 'bump_size', 'case', 'caustics', 'ceil', 'checker', 'chr', 'clipped_by', 'clock',
- 'color', 'color_map', 'colour', 'colour_map', 'component', 'composite', 'concat',
- 'confidence', 'conic_sweep', 'constant', 'control0', 'control1', 'cos', 'cosh',
- 'count', 'crackle', 'crand', 'cube', 'cubic_spline', 'cylindrical_mapping',
- 'debug', 'declare', 'default', 'degrees', 'dents', 'diffuse', 'direction',
- 'distance', 'distance_maximum', 'div', 'dust', 'dust_type', 'eccentricity',
- 'else', 'emitting', 'end', 'error', 'error_bound', 'exp', 'exponent',
- 'fade_distance', 'fade_power', 'falloff', 'falloff_angle', 'false',
- 'file_exists', 'filter', 'finish', 'fisheye', 'flatness', 'flip', 'floor',
- 'focal_point', 'fog', 'fog_alt', 'fog_offset', 'fog_type', 'frequency', 'gif',
- 'global_settings', 'glowing', 'gradient', 'granite', 'gray_threshold',
- 'green', 'halo', 'hexagon', 'hf_gray_16', 'hierarchy', 'hollow', 'hypercomplex',
- 'if', 'ifdef', 'iff', 'image_map', 'incidence', 'include', 'int', 'interpolate',
- 'inverse', 'ior', 'irid', 'irid_wavelength', 'jitter', 'lambda', 'leopard',
- 'linear', 'linear_spline', 'linear_sweep', 'location', 'log', 'looks_like',
- 'look_at', 'low_error_factor', 'mandel', 'map_type', 'marble', 'material_map',
- 'matrix', 'max', 'max_intersections', 'max_iteration', 'max_trace_level',
- 'max_value', 'metallic', 'min', 'minimum_reuse', 'mod', 'mortar',
- 'nearest_count', 'no', 'normal', 'normal_map', 'no_shadow', 'number_of_waves',
- 'octaves', 'off', 'offset', 'omega', 'omnimax', 'on', 'once', 'onion', 'open',
- 'orthographic', 'panoramic', 'pattern1', 'pattern2', 'pattern3',
- 'perspective', 'pgm', 'phase', 'phong', 'phong_size', 'pi', 'pigment',
- 'pigment_map', 'planar_mapping', 'png', 'point_at', 'pot', 'pow', 'ppm',
- 'precision', 'pwr', 'quadratic_spline', 'quaternion', 'quick_color',
- 'quick_colour', 'quilted', 'radial', 'radians', 'radiosity', 'radius', 'rainbow',
- 'ramp_wave', 'rand', 'range', 'reciprocal', 'recursion_limit', 'red',
- 'reflection', 'refraction', 'render', 'repeat', 'rgb', 'rgbf', 'rgbft', 'rgbt',
- 'right', 'ripples', 'rotate', 'roughness', 'samples', 'scale', 'scallop_wave',
- 'scattering', 'seed', 'shadowless', 'sin', 'sine_wave', 'sinh', 'sky', 'sky_sphere',
- 'slice', 'slope_map', 'smooth', 'specular', 'spherical_mapping', 'spiral',
- 'spiral1', 'spiral2', 'spotlight', 'spotted', 'sqr', 'sqrt', 'statistics', 'str',
- 'strcmp', 'strength', 'strlen', 'strlwr', 'strupr', 'sturm', 'substr', 'switch', 'sys',
- 't', 'tan', 'tanh', 'test_camera_1', 'test_camera_2', 'test_camera_3',
- 'test_camera_4', 'texture', 'texture_map', 'tga', 'thickness', 'threshold',
- 'tightness', 'tile2', 'tiles', 'track', 'transform', 'translate', 'transmit',
- 'triangle_wave', 'true', 'ttf', 'turbulence', 'turb_depth', 'type',
- 'ultra_wide_angle', 'up', 'use_color', 'use_colour', 'use_index', 'u_steps',
- 'val', 'variance', 'vaxis_rotate', 'vcross', 'vdot', 'version', 'vlength',
- 'vnormalize', 'volume_object', 'volume_rendered', 'vol_with_light',
- 'vrotate', 'v_steps', 'warning', 'warp', 'water_level', 'waves', 'while', 'width',
- 'wood', 'wrinkles', 'yes'), prefix=r'\b', suffix=r'\b'),
- Keyword),
- (words((
- 'bicubic_patch', 'blob', 'box', 'camera', 'cone', 'cubic', 'cylinder', 'difference',
- 'disc', 'height_field', 'intersection', 'julia_fractal', 'lathe',
- 'light_source', 'merge', 'mesh', 'object', 'plane', 'poly', 'polygon', 'prism',
- 'quadric', 'quartic', 'smooth_triangle', 'sor', 'sphere', 'superellipsoid',
- 'text', 'torus', 'triangle', 'union'), suffix=r'\b'),
- Name.Builtin),
- # TODO: <=, etc
- (r'[\[\](){}<>;,]', Punctuation),
- (r'[-+*/=]', Operator),
- (r'\b(x|y|z|u|v)\b', Name.Builtin.Pseudo),
- (r'[a-zA-Z_]\w*', Name),
- (r'[0-9]+\.[0-9]*', Number.Float),
- (r'\.[0-9]+', Number.Float),
- (r'[0-9]+', Number.Integer),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r'\s+', Text),
- ]
- }
diff --git a/pygments/lexers/haskell.py b/pygments/lexers/haskell.py
deleted file mode 100644
index d9eecaaf..00000000
--- a/pygments/lexers/haskell.py
+++ /dev/null
@@ -1,869 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.haskell
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Haskell and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, \
- default, include, inherit
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic
-from pygments import unistring as uni
-
-__all__ = ['HaskellLexer', 'HspecLexer', 'IdrisLexer', 'AgdaLexer', 'CryptolLexer',
- 'LiterateHaskellLexer', 'LiterateIdrisLexer', 'LiterateAgdaLexer',
- 'LiterateCryptolLexer', 'KokaLexer']
-
-
-line_re = re.compile('.*?\n')
-
-
-class HaskellLexer(RegexLexer):
- """
- A Haskell lexer based on the lexemes defined in the Haskell 98 Report.
-
- .. versionadded:: 0.8
- """
- name = 'Haskell'
- aliases = ['haskell', 'hs']
- filenames = ['*.hs']
- mimetypes = ['text/x-haskell']
-
- flags = re.MULTILINE | re.UNICODE
-
- reserved = ('case', 'class', 'data', 'default', 'deriving', 'do', 'else',
- 'family', 'if', 'in', 'infix[lr]?', 'instance',
- 'let', 'newtype', 'of', 'then', 'type', 'where', '_')
- ascii = ('NUL', 'SOH', '[SE]TX', 'EOT', 'ENQ', 'ACK',
- 'BEL', 'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'S[OI]', 'DLE',
- 'DC[1-4]', 'NAK', 'SYN', 'ETB', 'CAN',
- 'EM', 'SUB', 'ESC', '[FGRU]S', 'SP', 'DEL')
-
- tokens = {
- 'root': [
- # Whitespace:
- (r'\s+', Text),
- # (r'--\s*|.*$', Comment.Doc),
- (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single),
- (r'\{-', Comment.Multiline, 'comment'),
- # Lexemes:
- # Identifiers
- (r'\bimport\b', Keyword.Reserved, 'import'),
- (r'\bmodule\b', Keyword.Reserved, 'module'),
- (r'\berror\b', Name.Exception),
- (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved),
- (r"'[^\\]'", String.Char), # this has to come before the TH quote
- (r'^[_' + uni.Ll + r'][\w\']*', Name.Function),
- (r"'?[_" + uni.Ll + r"][\w']*", Name),
- (r"('')?[" + uni.Lu + r"][\w\']*", Keyword.Type),
- (r"(')[" + uni.Lu + r"][\w\']*", Keyword.Type),
- (r"(')\[[^\]]*\]", Keyword.Type), # tuples and lists get special treatment in GHC
- (r"(')\([^)]*\)", Keyword.Type), # ..
- # Operators
- (r'\\(?![:!#$%&*+.\\/<=>?@^|~-]+)', Name.Function), # lambda operator
- (r'(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials
- (r':[:!#$%&*+.\\/<=>?@^|~-]*', Keyword.Type), # Constructor operators
- (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), # Other operators
- # Numbers
- (r'0[xX]_*[\da-fA-F](_*[\da-fA-F])*_*[pP][+-]?\d(_*\d)*', Number.Float),
- (r'0[xX]_*[\da-fA-F](_*[\da-fA-F])*\.[\da-fA-F](_*[\da-fA-F])*'
- r'(_*[pP][+-]?\d(_*\d)*)?', Number.Float),
- (r'\d(_*\d)*_*[eE][+-]?\d(_*\d)*', Number.Float),
- (r'\d(_*\d)*\.\d(_*\d)*(_*[eE][+-]?\d(_*\d)*)?', Number.Float),
- (r'0[bB]_*[01](_*[01])*', Number.Bin),
- (r'0[oO]_*[0-7](_*[0-7])*', Number.Oct),
- (r'0[xX]_*[\da-fA-F](_*[\da-fA-F])*', Number.Hex),
- (r'\d(_*\d)*', Number.Integer),
- # Character/String Literals
- (r"'", String.Char, 'character'),
- (r'"', String, 'string'),
- # Special
- (r'\[\]', Keyword.Type),
- (r'\(\)', Name.Builtin),
- (r'[][(),;`{}]', Punctuation),
- ],
- 'import': [
- # Import statements
- (r'\s+', Text),
- (r'"', String, 'string'),
- # after "funclist" state
- (r'\)', Punctuation, '#pop'),
- (r'qualified\b', Keyword),
- # import X as Y
- (r'([' + uni.Lu + r'][\w.]*)(\s+)(as)(\s+)([' + uni.Lu + r'][\w.]*)',
- bygroups(Name.Namespace, Text, Keyword, Text, Name), '#pop'),
- # import X hiding (functions)
- (r'([' + uni.Lu + r'][\w.]*)(\s+)(hiding)(\s+)(\()',
- bygroups(Name.Namespace, Text, Keyword, Text, Punctuation), 'funclist'),
- # import X (functions)
- (r'([' + uni.Lu + r'][\w.]*)(\s+)(\()',
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
- # import X
- (r'[\w.]+', Name.Namespace, '#pop'),
- ],
- 'module': [
- (r'\s+', Text),
- (r'([' + uni.Lu + r'][\w.]*)(\s+)(\()',
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
- (r'[' + uni.Lu + r'][\w.]*', Name.Namespace, '#pop'),
- ],
- 'funclist': [
- (r'\s+', Text),
- (r'[' + uni.Lu + r']\w*', Keyword.Type),
- (r'(_[\w\']+|[' + uni.Ll + r'][\w\']*)', Name.Function),
- (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single),
- (r'\{-', Comment.Multiline, 'comment'),
- (r',', Punctuation),
- (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator),
- # (HACK, but it makes sense to push two instances, believe me)
- (r'\(', Punctuation, ('funclist', 'funclist')),
- (r'\)', Punctuation, '#pop:2'),
- ],
- # NOTE: the next four states are shared in the AgdaLexer; make sure
- # any change is compatible with Agda as well or copy over and change
- 'comment': [
- # Multiline Comments
- (r'[^-{}]+', Comment.Multiline),
- (r'\{-', Comment.Multiline, '#push'),
- (r'-\}', Comment.Multiline, '#pop'),
- (r'[-{}]', Comment.Multiline),
- ],
- 'character': [
- # Allows multi-chars, incorrectly.
- (r"[^\\']'", String.Char, '#pop'),
- (r"\\", String.Escape, 'escape'),
- ("'", String.Char, '#pop'),
- ],
- 'string': [
- (r'[^\\"]+', String),
- (r"\\", String.Escape, 'escape'),
- ('"', String, '#pop'),
- ],
- 'escape': [
- (r'[abfnrtv"\'&\\]', String.Escape, '#pop'),
- (r'\^[][' + uni.Lu + r'@^_]', String.Escape, '#pop'),
- ('|'.join(ascii), String.Escape, '#pop'),
- (r'o[0-7]+', String.Escape, '#pop'),
- (r'x[\da-fA-F]+', String.Escape, '#pop'),
- (r'\d+', String.Escape, '#pop'),
- (r'\s+\\', String.Escape, '#pop'),
- ],
- }
-
-
-class HspecLexer(HaskellLexer):
- """
- A Haskell lexer with support for Hspec constructs.
-
- .. versionadded:: 2.4.0
- """
-
- name = 'Hspec'
- aliases = ['hspec']
- filenames = []
- mimetypes = []
-
- tokens = {
- 'root': [
- (r'(it\s*)("[^"]*")', bygroups(Text, String.Doc)),
- (r'(describe\s*)("[^"]*")', bygroups(Text, String.Doc)),
- (r'(context\s*)("[^"]*")', bygroups(Text, String.Doc)),
- inherit,
- ],
- }
-
-
-class IdrisLexer(RegexLexer):
- """
- A lexer for the dependently typed programming language Idris.
-
- Based on the Haskell and Agda Lexer.
-
- .. versionadded:: 2.0
- """
- name = 'Idris'
- aliases = ['idris', 'idr']
- filenames = ['*.idr']
- mimetypes = ['text/x-idris']
-
- reserved = ('case', 'class', 'data', 'default', 'using', 'do', 'else',
- 'if', 'in', 'infix[lr]?', 'instance', 'rewrite', 'auto',
- 'namespace', 'codata', 'mutual', 'private', 'public', 'abstract',
- 'total', 'partial',
- 'let', 'proof', 'of', 'then', 'static', 'where', '_', 'with',
- 'pattern', 'term', 'syntax', 'prefix',
- 'postulate', 'parameters', 'record', 'dsl', 'impossible', 'implicit',
- 'tactics', 'intros', 'intro', 'compute', 'refine', 'exact', 'trivial')
-
- ascii = ('NUL', 'SOH', '[SE]TX', 'EOT', 'ENQ', 'ACK',
- 'BEL', 'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'S[OI]', 'DLE',
- 'DC[1-4]', 'NAK', 'SYN', 'ETB', 'CAN',
- 'EM', 'SUB', 'ESC', '[FGRU]S', 'SP', 'DEL')
-
- directives = ('lib', 'link', 'flag', 'include', 'hide', 'freeze', 'access',
- 'default', 'logging', 'dynamic', 'name', 'error_handlers', 'language')
-
- tokens = {
- 'root': [
- # Comments
- (r'^(\s*)(%%%s)' % '|'.join(directives),
- bygroups(Text, Keyword.Reserved)),
- (r'(\s*)(--(?![!#$%&*+./<=>?@^|_~:\\]).*?)$', bygroups(Text, Comment.Single)),
- (r'(\s*)(\|{3}.*?)$', bygroups(Text, Comment.Single)),
- (r'(\s*)(\{-)', bygroups(Text, Comment.Multiline), 'comment'),
- # Declaration
- (r'^(\s*)([^\s(){}]+)(\s*)(:)(\s*)',
- bygroups(Text, Name.Function, Text, Operator.Word, Text)),
- # Identifiers
- (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved),
- (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Text), 'module'),
- (r"('')?[A-Z][\w\']*", Keyword.Type),
- (r'[a-z][\w\']*', Text),
- # Special Symbols
- (r'(<-|::|->|=>|=)', Operator.Word), # specials
- (r'([(){}\[\]:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials
- # Numbers
- (r'\d+[eE][+-]?\d+', Number.Float),
- (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float),
- (r'0[xX][\da-fA-F]+', Number.Hex),
- (r'\d+', Number.Integer),
- # Strings
- (r"'", String.Char, 'character'),
- (r'"', String, 'string'),
- (r'[^\s(){}]+', Text),
- (r'\s+?', Text), # Whitespace
- ],
- 'module': [
- (r'\s+', Text),
- (r'([A-Z][\w.]*)(\s+)(\()',
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
- (r'[A-Z][\w.]*', Name.Namespace, '#pop'),
- ],
- 'funclist': [
- (r'\s+', Text),
- (r'[A-Z]\w*', Keyword.Type),
- (r'(_[\w\']+|[a-z][\w\']*)', Name.Function),
- (r'--.*$', Comment.Single),
- (r'\{-', Comment.Multiline, 'comment'),
- (r',', Punctuation),
- (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator),
- # (HACK, but it makes sense to push two instances, believe me)
- (r'\(', Punctuation, ('funclist', 'funclist')),
- (r'\)', Punctuation, '#pop:2'),
- ],
- # NOTE: the next four states are shared in the AgdaLexer; make sure
- # any change is compatible with Agda as well or copy over and change
- 'comment': [
- # Multiline Comments
- (r'[^-{}]+', Comment.Multiline),
- (r'\{-', Comment.Multiline, '#push'),
- (r'-\}', Comment.Multiline, '#pop'),
- (r'[-{}]', Comment.Multiline),
- ],
- 'character': [
- # Allows multi-chars, incorrectly.
- (r"[^\\']", String.Char),
- (r"\\", String.Escape, 'escape'),
- ("'", String.Char, '#pop'),
- ],
- 'string': [
- (r'[^\\"]+', String),
- (r"\\", String.Escape, 'escape'),
- ('"', String, '#pop'),
- ],
- 'escape': [
- (r'[abfnrtv"\'&\\]', String.Escape, '#pop'),
- (r'\^[][A-Z@^_]', String.Escape, '#pop'),
- ('|'.join(ascii), String.Escape, '#pop'),
- (r'o[0-7]+', String.Escape, '#pop'),
- (r'x[\da-fA-F]+', String.Escape, '#pop'),
- (r'\d+', String.Escape, '#pop'),
- (r'\s+\\', String.Escape, '#pop')
- ],
- }
-
-
-class AgdaLexer(RegexLexer):
- """
- For the `Agda <http://wiki.portal.chalmers.se/agda/pmwiki.php>`_
- dependently typed functional programming language and proof assistant.
-
- .. versionadded:: 2.0
- """
-
- name = 'Agda'
- aliases = ['agda']
- filenames = ['*.agda']
- mimetypes = ['text/x-agda']
-
- reserved = ['abstract', 'codata', 'coinductive', 'constructor', 'data',
- 'field', 'forall', 'hiding', 'in', 'inductive', 'infix',
- 'infixl', 'infixr', 'instance', 'let', 'mutual', 'open',
- 'pattern', 'postulate', 'primitive', 'private',
- 'quote', 'quoteGoal', 'quoteTerm',
- 'record', 'renaming', 'rewrite', 'syntax', 'tactic',
- 'unquote', 'unquoteDecl', 'using', 'where', 'with']
-
- tokens = {
- 'root': [
- # Declaration
- (r'^(\s*)([^\s(){}]+)(\s*)(:)(\s*)',
- bygroups(Text, Name.Function, Text, Operator.Word, Text)),
- # Comments
- (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single),
- (r'\{-', Comment.Multiline, 'comment'),
- # Holes
- (r'\{!', Comment.Directive, 'hole'),
- # Lexemes:
- # Identifiers
- (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved),
- (r'(import|module)(\s+)', bygroups(Keyword.Reserved, Text), 'module'),
- (r'\b(Set|Prop)\b', Keyword.Type),
- # Special Symbols
- (r'(\(|\)|\{|\})', Operator),
- (u'(\\.{1,3}|\\||\u039B|\u2200|\u2192|:|=|->)', Operator.Word),
- # Numbers
- (r'\d+[eE][+-]?\d+', Number.Float),
- (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float),
- (r'0[xX][\da-fA-F]+', Number.Hex),
- (r'\d+', Number.Integer),
- # Strings
- (r"'", String.Char, 'character'),
- (r'"', String, 'string'),
- (r'[^\s(){}]+', Text),
- (r'\s+?', Text), # Whitespace
- ],
- 'hole': [
- # Holes
- (r'[^!{}]+', Comment.Directive),
- (r'\{!', Comment.Directive, '#push'),
- (r'!\}', Comment.Directive, '#pop'),
- (r'[!{}]', Comment.Directive),
- ],
- 'module': [
- (r'\{-', Comment.Multiline, 'comment'),
- (r'[a-zA-Z][\w.]*', Name, '#pop'),
- (r'[\W0-9_]+', Text)
- ],
- 'comment': HaskellLexer.tokens['comment'],
- 'character': HaskellLexer.tokens['character'],
- 'string': HaskellLexer.tokens['string'],
- 'escape': HaskellLexer.tokens['escape']
- }
-
-
-class CryptolLexer(RegexLexer):
- """
- FIXME: A Cryptol2 lexer based on the lexemes defined in the Haskell 98 Report.
-
- .. versionadded:: 2.0
- """
- name = 'Cryptol'
- aliases = ['cryptol', 'cry']
- filenames = ['*.cry']
- mimetypes = ['text/x-cryptol']
-
- reserved = ('Arith', 'Bit', 'Cmp', 'False', 'Inf', 'True', 'else',
- 'export', 'extern', 'fin', 'if', 'import', 'inf', 'lg2',
- 'max', 'min', 'module', 'newtype', 'pragma', 'property',
- 'then', 'type', 'where', 'width')
- ascii = ('NUL', 'SOH', '[SE]TX', 'EOT', 'ENQ', 'ACK',
- 'BEL', 'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'S[OI]', 'DLE',
- 'DC[1-4]', 'NAK', 'SYN', 'ETB', 'CAN',
- 'EM', 'SUB', 'ESC', '[FGRU]S', 'SP', 'DEL')
-
- tokens = {
- 'root': [
- # Whitespace:
- (r'\s+', Text),
- # (r'--\s*|.*$', Comment.Doc),
- (r'//.*$', Comment.Single),
- (r'/\*', Comment.Multiline, 'comment'),
- # Lexemes:
- # Identifiers
- (r'\bimport\b', Keyword.Reserved, 'import'),
- (r'\bmodule\b', Keyword.Reserved, 'module'),
- (r'\berror\b', Name.Exception),
- (r'\b(%s)(?!\')\b' % '|'.join(reserved), Keyword.Reserved),
- (r'^[_a-z][\w\']*', Name.Function),
- (r"'?[_a-z][\w']*", Name),
- (r"('')?[A-Z][\w\']*", Keyword.Type),
- # Operators
- (r'\\(?![:!#$%&*+.\\/<=>?@^|~-]+)', Name.Function), # lambda operator
- (r'(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials
- (r':[:!#$%&*+.\\/<=>?@^|~-]*', Keyword.Type), # Constructor operators
- (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), # Other operators
- # Numbers
- (r'\d+[eE][+-]?\d+', Number.Float),
- (r'\d+\.\d+([eE][+-]?\d+)?', Number.Float),
- (r'0[oO][0-7]+', Number.Oct),
- (r'0[xX][\da-fA-F]+', Number.Hex),
- (r'\d+', Number.Integer),
- # Character/String Literals
- (r"'", String.Char, 'character'),
- (r'"', String, 'string'),
- # Special
- (r'\[\]', Keyword.Type),
- (r'\(\)', Name.Builtin),
- (r'[][(),;`{}]', Punctuation),
- ],
- 'import': [
- # Import statements
- (r'\s+', Text),
- (r'"', String, 'string'),
- # after "funclist" state
- (r'\)', Punctuation, '#pop'),
- (r'qualified\b', Keyword),
- # import X as Y
- (r'([A-Z][\w.]*)(\s+)(as)(\s+)([A-Z][\w.]*)',
- bygroups(Name.Namespace, Text, Keyword, Text, Name), '#pop'),
- # import X hiding (functions)
- (r'([A-Z][\w.]*)(\s+)(hiding)(\s+)(\()',
- bygroups(Name.Namespace, Text, Keyword, Text, Punctuation), 'funclist'),
- # import X (functions)
- (r'([A-Z][\w.]*)(\s+)(\()',
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
- # import X
- (r'[\w.]+', Name.Namespace, '#pop'),
- ],
- 'module': [
- (r'\s+', Text),
- (r'([A-Z][\w.]*)(\s+)(\()',
- bygroups(Name.Namespace, Text, Punctuation), 'funclist'),
- (r'[A-Z][\w.]*', Name.Namespace, '#pop'),
- ],
- 'funclist': [
- (r'\s+', Text),
- (r'[A-Z]\w*', Keyword.Type),
- (r'(_[\w\']+|[a-z][\w\']*)', Name.Function),
- # TODO: these don't match the comments in docs, remove.
- # (r'--(?![!#$%&*+./<=>?@^|_~:\\]).*?$', Comment.Single),
- # (r'{-', Comment.Multiline, 'comment'),
- (r',', Punctuation),
- (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator),
- # (HACK, but it makes sense to push two instances, believe me)
- (r'\(', Punctuation, ('funclist', 'funclist')),
- (r'\)', Punctuation, '#pop:2'),
- ],
- 'comment': [
- # Multiline Comments
- (r'[^/*]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline),
- ],
- 'character': [
- # Allows multi-chars, incorrectly.
- (r"[^\\']'", String.Char, '#pop'),
- (r"\\", String.Escape, 'escape'),
- ("'", String.Char, '#pop'),
- ],
- 'string': [
- (r'[^\\"]+', String),
- (r"\\", String.Escape, 'escape'),
- ('"', String, '#pop'),
- ],
- 'escape': [
- (r'[abfnrtv"\'&\\]', String.Escape, '#pop'),
- (r'\^[][A-Z@^_]', String.Escape, '#pop'),
- ('|'.join(ascii), String.Escape, '#pop'),
- (r'o[0-7]+', String.Escape, '#pop'),
- (r'x[\da-fA-F]+', String.Escape, '#pop'),
- (r'\d+', String.Escape, '#pop'),
- (r'\s+\\', String.Escape, '#pop'),
- ],
- }
-
- EXTRA_KEYWORDS = set(('join', 'split', 'reverse', 'transpose', 'width',
- 'length', 'tail', '<<', '>>', '<<<', '>>>', 'const',
- 'reg', 'par', 'seq', 'ASSERT', 'undefined', 'error',
- 'trace'))
-
- def get_tokens_unprocessed(self, text):
- stack = ['root']
- for index, token, value in \
- RegexLexer.get_tokens_unprocessed(self, text, stack):
- if token is Name and value in self.EXTRA_KEYWORDS:
- yield index, Name.Builtin, value
- else:
- yield index, token, value
-
-
-class LiterateLexer(Lexer):
- """
- Base class for lexers of literate file formats based on LaTeX or Bird-style
- (prefixing each code line with ">").
-
- Additional options accepted:
-
- `litstyle`
- If given, must be ``"bird"`` or ``"latex"``. If not given, the style
- is autodetected: if the first non-whitespace character in the source
- is a backslash or percent character, LaTeX is assumed, else Bird.
- """
-
- bird_re = re.compile(r'(>[ \t]*)(.*\n)')
-
- def __init__(self, baselexer, **options):
- self.baselexer = baselexer
- Lexer.__init__(self, **options)
-
- def get_tokens_unprocessed(self, text):
- style = self.options.get('litstyle')
- if style is None:
- style = (text.lstrip()[0:1] in '%\\') and 'latex' or 'bird'
-
- code = ''
- insertions = []
- if style == 'bird':
- # bird-style
- for match in line_re.finditer(text):
- line = match.group()
- m = self.bird_re.match(line)
- if m:
- insertions.append((len(code),
- [(0, Comment.Special, m.group(1))]))
- code += m.group(2)
- else:
- insertions.append((len(code), [(0, Text, line)]))
- else:
- # latex-style
- from pygments.lexers.markup import TexLexer
- lxlexer = TexLexer(**self.options)
- codelines = 0
- latex = ''
- for match in line_re.finditer(text):
- line = match.group()
- if codelines:
- if line.lstrip().startswith('\\end{code}'):
- codelines = 0
- latex += line
- else:
- code += line
- elif line.lstrip().startswith('\\begin{code}'):
- codelines = 1
- latex += line
- insertions.append((len(code),
- list(lxlexer.get_tokens_unprocessed(latex))))
- latex = ''
- else:
- latex += line
- insertions.append((len(code),
- list(lxlexer.get_tokens_unprocessed(latex))))
- for item in do_insertions(insertions, self.baselexer.get_tokens_unprocessed(code)):
- yield item
-
-
-class LiterateHaskellLexer(LiterateLexer):
- """
- For Literate Haskell (Bird-style or LaTeX) source.
-
- Additional options accepted:
-
- `litstyle`
- If given, must be ``"bird"`` or ``"latex"``. If not given, the style
- is autodetected: if the first non-whitespace character in the source
- is a backslash or percent character, LaTeX is assumed, else Bird.
-
- .. versionadded:: 0.9
- """
- name = 'Literate Haskell'
- aliases = ['lhs', 'literate-haskell', 'lhaskell']
- filenames = ['*.lhs']
- mimetypes = ['text/x-literate-haskell']
-
- def __init__(self, **options):
- hslexer = HaskellLexer(**options)
- LiterateLexer.__init__(self, hslexer, **options)
-
-
-class LiterateIdrisLexer(LiterateLexer):
- """
- For Literate Idris (Bird-style or LaTeX) source.
-
- Additional options accepted:
-
- `litstyle`
- If given, must be ``"bird"`` or ``"latex"``. If not given, the style
- is autodetected: if the first non-whitespace character in the source
- is a backslash or percent character, LaTeX is assumed, else Bird.
-
- .. versionadded:: 2.0
- """
- name = 'Literate Idris'
- aliases = ['lidr', 'literate-idris', 'lidris']
- filenames = ['*.lidr']
- mimetypes = ['text/x-literate-idris']
-
- def __init__(self, **options):
- hslexer = IdrisLexer(**options)
- LiterateLexer.__init__(self, hslexer, **options)
-
-
-class LiterateAgdaLexer(LiterateLexer):
- """
- For Literate Agda source.
-
- Additional options accepted:
-
- `litstyle`
- If given, must be ``"bird"`` or ``"latex"``. If not given, the style
- is autodetected: if the first non-whitespace character in the source
- is a backslash or percent character, LaTeX is assumed, else Bird.
-
- .. versionadded:: 2.0
- """
- name = 'Literate Agda'
- aliases = ['lagda', 'literate-agda']
- filenames = ['*.lagda']
- mimetypes = ['text/x-literate-agda']
-
- def __init__(self, **options):
- agdalexer = AgdaLexer(**options)
- LiterateLexer.__init__(self, agdalexer, litstyle='latex', **options)
-
-
-class LiterateCryptolLexer(LiterateLexer):
- """
- For Literate Cryptol (Bird-style or LaTeX) source.
-
- Additional options accepted:
-
- `litstyle`
- If given, must be ``"bird"`` or ``"latex"``. If not given, the style
- is autodetected: if the first non-whitespace character in the source
- is a backslash or percent character, LaTeX is assumed, else Bird.
-
- .. versionadded:: 2.0
- """
- name = 'Literate Cryptol'
- aliases = ['lcry', 'literate-cryptol', 'lcryptol']
- filenames = ['*.lcry']
- mimetypes = ['text/x-literate-cryptol']
-
- def __init__(self, **options):
- crylexer = CryptolLexer(**options)
- LiterateLexer.__init__(self, crylexer, **options)
-
-
-class KokaLexer(RegexLexer):
- """
- Lexer for the `Koka <http://koka.codeplex.com>`_
- language.
-
- .. versionadded:: 1.6
- """
-
- name = 'Koka'
- aliases = ['koka']
- filenames = ['*.kk', '*.kki']
- mimetypes = ['text/x-koka']
-
- keywords = [
- 'infix', 'infixr', 'infixl',
- 'type', 'cotype', 'rectype', 'alias',
- 'struct', 'con',
- 'fun', 'function', 'val', 'var',
- 'external',
- 'if', 'then', 'else', 'elif', 'return', 'match',
- 'private', 'public', 'private',
- 'module', 'import', 'as',
- 'include', 'inline',
- 'rec',
- 'try', 'yield', 'enum',
- 'interface', 'instance',
- ]
-
- # keywords that are followed by a type
- typeStartKeywords = [
- 'type', 'cotype', 'rectype', 'alias', 'struct', 'enum',
- ]
-
- # keywords valid in a type
- typekeywords = [
- 'forall', 'exists', 'some', 'with',
- ]
-
- # builtin names and special names
- builtin = [
- 'for', 'while', 'repeat',
- 'foreach', 'foreach-indexed',
- 'error', 'catch', 'finally',
- 'cs', 'js', 'file', 'ref', 'assigned',
- ]
-
- # symbols that can be in an operator
- symbols = r'[$%&*+@!/\\^~=.:\-?|<>]+'
-
- # symbol boundary: an operator keyword should not be followed by any of these
- sboundary = '(?!' + symbols + ')'
-
- # name boundary: a keyword should not be followed by any of these
- boundary = r'(?![\w/])'
-
- # koka token abstractions
- tokenType = Name.Attribute
- tokenTypeDef = Name.Class
- tokenConstructor = Generic.Emph
-
- # main lexer
- tokens = {
- 'root': [
- include('whitespace'),
-
- # go into type mode
- (r'::?' + sboundary, tokenType, 'type'),
- (r'(alias)(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef),
- 'alias-type'),
- (r'(struct)(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef),
- 'struct-type'),
- ((r'(%s)' % '|'.join(typeStartKeywords)) +
- r'(\s+)([a-z]\w*)?', bygroups(Keyword, Text, tokenTypeDef),
- 'type'),
-
- # special sequences of tokens (we use ?: for non-capturing group as
- # required by 'bygroups')
- (r'(module)(\s+)(interface\s+)?((?:[a-z]\w*/)*[a-z]\w*)',
- bygroups(Keyword, Text, Keyword, Name.Namespace)),
- (r'(import)(\s+)((?:[a-z]\w*/)*[a-z]\w*)'
- r'(?:(\s*)(=)(\s*)((?:qualified\s*)?)'
- r'((?:[a-z]\w*/)*[a-z]\w*))?',
- bygroups(Keyword, Text, Name.Namespace, Text, Keyword, Text,
- Keyword, Name.Namespace)),
-
- (r'(^(?:(?:public|private)\s*)?(?:function|fun|val))'
- r'(\s+)([a-z]\w*|\((?:' + symbols + r'|/)\))',
- bygroups(Keyword, Text, Name.Function)),
- (r'(^(?:(?:public|private)\s*)?external)(\s+)(inline\s+)?'
- r'([a-z]\w*|\((?:' + symbols + r'|/)\))',
- bygroups(Keyword, Text, Keyword, Name.Function)),
-
- # keywords
- (r'(%s)' % '|'.join(typekeywords) + boundary, Keyword.Type),
- (r'(%s)' % '|'.join(keywords) + boundary, Keyword),
- (r'(%s)' % '|'.join(builtin) + boundary, Keyword.Pseudo),
- (r'::?|:=|\->|[=.]' + sboundary, Keyword),
-
- # names
- (r'((?:[a-z]\w*/)*)([A-Z]\w*)',
- bygroups(Name.Namespace, tokenConstructor)),
- (r'((?:[a-z]\w*/)*)([a-z]\w*)', bygroups(Name.Namespace, Name)),
- (r'((?:[a-z]\w*/)*)(\((?:' + symbols + r'|/)\))',
- bygroups(Name.Namespace, Name)),
- (r'_\w*', Name.Variable),
-
- # literal string
- (r'@"', String.Double, 'litstring'),
-
- # operators
- (symbols + "|/(?![*/])", Operator),
- (r'`', Operator),
- (r'[{}()\[\];,]', Punctuation),
-
- # literals. No check for literal characters with len > 1
- (r'[0-9]+\.[0-9]+([eE][\-+]?[0-9]+)?', Number.Float),
- (r'0[xX][0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
-
- (r"'", String.Char, 'char'),
- (r'"', String.Double, 'string'),
- ],
-
- # type started by alias
- 'alias-type': [
- (r'=', Keyword),
- include('type')
- ],
-
- # type started by struct
- 'struct-type': [
- (r'(?=\((?!,*\)))', Punctuation, '#pop'),
- include('type')
- ],
-
- # type started by colon
- 'type': [
- (r'[(\[<]', tokenType, 'type-nested'),
- include('type-content')
- ],
-
- # type nested in brackets: can contain parameters, comma etc.
- 'type-nested': [
- (r'[)\]>]', tokenType, '#pop'),
- (r'[(\[<]', tokenType, 'type-nested'),
- (r',', tokenType),
- (r'([a-z]\w*)(\s*)(:)(?!:)',
- bygroups(Name, Text, tokenType)), # parameter name
- include('type-content')
- ],
-
- # shared contents of a type
- 'type-content': [
- include('whitespace'),
-
- # keywords
- (r'(%s)' % '|'.join(typekeywords) + boundary, Keyword),
- (r'(?=((%s)' % '|'.join(keywords) + boundary + '))',
- Keyword, '#pop'), # need to match because names overlap...
-
- # kinds
- (r'[EPHVX]' + boundary, tokenType),
-
- # type names
- (r'[a-z][0-9]*(?![\w/])', tokenType),
- (r'_\w*', tokenType.Variable), # Generic.Emph
- (r'((?:[a-z]\w*/)*)([A-Z]\w*)',
- bygroups(Name.Namespace, tokenType)),
- (r'((?:[a-z]\w*/)*)([a-z]\w+)',
- bygroups(Name.Namespace, tokenType)),
-
- # type keyword operators
- (r'::|->|[.:|]', tokenType),
-
- # catchall
- default('#pop')
- ],
-
- # comments and literals
- 'whitespace': [
- (r'\n\s*#.*$', Comment.Preproc),
- (r'\s+', Text),
- (r'/\*', Comment.Multiline, 'comment'),
- (r'//.*$', Comment.Single)
- ],
- 'comment': [
- (r'[^/*]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline),
- ],
- 'litstring': [
- (r'[^"]+', String.Double),
- (r'""', String.Escape),
- (r'"', String.Double, '#pop'),
- ],
- 'string': [
- (r'[^\\"\n]+', String.Double),
- include('escape-sequence'),
- (r'["\n]', String.Double, '#pop'),
- ],
- 'char': [
- (r'[^\\\'\n]+', String.Char),
- include('escape-sequence'),
- (r'[\'\n]', String.Char, '#pop'),
- ],
- 'escape-sequence': [
- (r'\\[nrt\\"\']', String.Escape),
- (r'\\x[0-9a-fA-F]{2}', String.Escape),
- (r'\\u[0-9a-fA-F]{4}', String.Escape),
- # Yes, \U literals are 6 hex digits.
- (r'\\U[0-9a-fA-F]{6}', String.Escape)
- ]
- }
diff --git a/pygments/lexers/haxe.py b/pygments/lexers/haxe.py
deleted file mode 100644
index 38578e5b..00000000
--- a/pygments/lexers/haxe.py
+++ /dev/null
@@ -1,936 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.haxe
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Haxe and related stuff.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import ExtendedRegexLexer, RegexLexer, include, bygroups, \
- default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic, Whitespace
-
-__all__ = ['HaxeLexer', 'HxmlLexer']
-
-
-class HaxeLexer(ExtendedRegexLexer):
- """
- For Haxe source code (http://haxe.org/).
-
- .. versionadded:: 1.3
- """
-
- name = 'Haxe'
- aliases = ['hx', 'haxe', 'hxsl']
- filenames = ['*.hx', '*.hxsl']
- mimetypes = ['text/haxe', 'text/x-haxe', 'text/x-hx']
-
- # keywords extracted from lexer.mll in the haxe compiler source
- keyword = (r'(?:function|class|static|var|if|else|while|do|for|'
- r'break|return|continue|extends|implements|import|'
- r'switch|case|default|public|private|try|untyped|'
- r'catch|new|this|throw|extern|enum|in|interface|'
- r'cast|override|dynamic|typedef|package|'
- r'inline|using|null|true|false|abstract)\b')
-
- # idtype in lexer.mll
- typeid = r'_*[A-Z]\w*'
-
- # combined ident and dollar and idtype
- ident = r'(?:_*[a-z]\w*|_+[0-9]\w*|' + typeid + r'|_+|\$\w+)'
-
- binop = (r'(?:%=|&=|\|=|\^=|\+=|\-=|\*=|/=|<<=|>\s*>\s*=|>\s*>\s*>\s*=|==|'
- r'!=|<=|>\s*=|&&|\|\||<<|>>>|>\s*>|\.\.\.|<|>|%|&|\||\^|\+|\*|'
- r'/|\-|=>|=)')
-
- # ident except keywords
- ident_no_keyword = r'(?!' + keyword + ')' + ident
-
- flags = re.DOTALL | re.MULTILINE
-
- preproc_stack = []
-
- def preproc_callback(self, match, ctx):
- proc = match.group(2)
-
- if proc == 'if':
- # store the current stack
- self.preproc_stack.append(ctx.stack[:])
- elif proc in ['else', 'elseif']:
- # restore the stack back to right before #if
- if self.preproc_stack:
- ctx.stack = self.preproc_stack[-1][:]
- elif proc == 'end':
- # remove the saved stack of previous #if
- if self.preproc_stack:
- self.preproc_stack.pop()
-
- # #if and #elseif should follow by an expr
- if proc in ['if', 'elseif']:
- ctx.stack.append('preproc-expr')
-
- # #error can be optionally follow by the error msg
- if proc in ['error']:
- ctx.stack.append('preproc-error')
-
- yield match.start(), Comment.Preproc, '#' + proc
- ctx.pos = match.end()
-
- tokens = {
- 'root': [
- include('spaces'),
- include('meta'),
- (r'(?:package)\b', Keyword.Namespace, ('semicolon', 'package')),
- (r'(?:import)\b', Keyword.Namespace, ('semicolon', 'import')),
- (r'(?:using)\b', Keyword.Namespace, ('semicolon', 'using')),
- (r'(?:extern|private)\b', Keyword.Declaration),
- (r'(?:abstract)\b', Keyword.Declaration, 'abstract'),
- (r'(?:class|interface)\b', Keyword.Declaration, 'class'),
- (r'(?:enum)\b', Keyword.Declaration, 'enum'),
- (r'(?:typedef)\b', Keyword.Declaration, 'typedef'),
-
- # top-level expression
- # although it is not supported in haxe, but it is common to write
- # expression in web pages the positive lookahead here is to prevent
- # an infinite loop at the EOF
- (r'(?=.)', Text, 'expr-statement'),
- ],
-
- # space/tab/comment/preproc
- 'spaces': [
- (r'\s+', Text),
- (r'//[^\n\r]*', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'(#)(if|elseif|else|end|error)\b', preproc_callback),
- ],
-
- 'string-single-interpol': [
- (r'\$\{', String.Interpol, ('string-interpol-close', 'expr')),
- (r'\$\$', String.Escape),
- (r'\$(?=' + ident + ')', String.Interpol, 'ident'),
- include('string-single'),
- ],
-
- 'string-single': [
- (r"'", String.Single, '#pop'),
- (r'\\.', String.Escape),
- (r'.', String.Single),
- ],
-
- 'string-double': [
- (r'"', String.Double, '#pop'),
- (r'\\.', String.Escape),
- (r'.', String.Double),
- ],
-
- 'string-interpol-close': [
- (r'\$'+ident, String.Interpol),
- (r'\}', String.Interpol, '#pop'),
- ],
-
- 'package': [
- include('spaces'),
- (ident, Name.Namespace),
- (r'\.', Punctuation, 'import-ident'),
- default('#pop'),
- ],
-
- 'import': [
- include('spaces'),
- (ident, Name.Namespace),
- (r'\*', Keyword), # wildcard import
- (r'\.', Punctuation, 'import-ident'),
- (r'in', Keyword.Namespace, 'ident'),
- default('#pop'),
- ],
-
- 'import-ident': [
- include('spaces'),
- (r'\*', Keyword, '#pop'), # wildcard import
- (ident, Name.Namespace, '#pop'),
- ],
-
- 'using': [
- include('spaces'),
- (ident, Name.Namespace),
- (r'\.', Punctuation, 'import-ident'),
- default('#pop'),
- ],
-
- 'preproc-error': [
- (r'\s+', Comment.Preproc),
- (r"'", String.Single, ('#pop', 'string-single')),
- (r'"', String.Double, ('#pop', 'string-double')),
- default('#pop'),
- ],
-
- 'preproc-expr': [
- (r'\s+', Comment.Preproc),
- (r'\!', Comment.Preproc),
- (r'\(', Comment.Preproc, ('#pop', 'preproc-parenthesis')),
-
- (ident, Comment.Preproc, '#pop'),
-
- # Float
- (r'\.[0-9]+', Number.Float),
- (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float),
- (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float),
- (r'[0-9]+\.[0-9]+', Number.Float),
- (r'[0-9]+\.(?!' + ident + r'|\.\.)', Number.Float),
-
- # Int
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
-
- # String
- (r"'", String.Single, ('#pop', 'string-single')),
- (r'"', String.Double, ('#pop', 'string-double')),
- ],
-
- 'preproc-parenthesis': [
- (r'\s+', Comment.Preproc),
- (r'\)', Comment.Preproc, '#pop'),
- default('preproc-expr-in-parenthesis'),
- ],
-
- 'preproc-expr-chain': [
- (r'\s+', Comment.Preproc),
- (binop, Comment.Preproc, ('#pop', 'preproc-expr-in-parenthesis')),
- default('#pop'),
- ],
-
- # same as 'preproc-expr' but able to chain 'preproc-expr-chain'
- 'preproc-expr-in-parenthesis': [
- (r'\s+', Comment.Preproc),
- (r'\!', Comment.Preproc),
- (r'\(', Comment.Preproc,
- ('#pop', 'preproc-expr-chain', 'preproc-parenthesis')),
-
- (ident, Comment.Preproc, ('#pop', 'preproc-expr-chain')),
-
- # Float
- (r'\.[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')),
- (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')),
- (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')),
- (r'[0-9]+\.[0-9]+', Number.Float, ('#pop', 'preproc-expr-chain')),
- (r'[0-9]+\.(?!' + ident + r'|\.\.)', Number.Float, ('#pop', 'preproc-expr-chain')),
-
- # Int
- (r'0x[0-9a-fA-F]+', Number.Hex, ('#pop', 'preproc-expr-chain')),
- (r'[0-9]+', Number.Integer, ('#pop', 'preproc-expr-chain')),
-
- # String
- (r"'", String.Single,
- ('#pop', 'preproc-expr-chain', 'string-single')),
- (r'"', String.Double,
- ('#pop', 'preproc-expr-chain', 'string-double')),
- ],
-
- 'abstract': [
- include('spaces'),
- default(('#pop', 'abstract-body', 'abstract-relation',
- 'abstract-opaque', 'type-param-constraint', 'type-name')),
- ],
-
- 'abstract-body': [
- include('spaces'),
- (r'\{', Punctuation, ('#pop', 'class-body')),
- ],
-
- 'abstract-opaque': [
- include('spaces'),
- (r'\(', Punctuation, ('#pop', 'parenthesis-close', 'type')),
- default('#pop'),
- ],
-
- 'abstract-relation': [
- include('spaces'),
- (r'(?:to|from)', Keyword.Declaration, 'type'),
- (r',', Punctuation),
- default('#pop'),
- ],
-
- 'meta': [
- include('spaces'),
- (r'@', Name.Decorator, ('meta-body', 'meta-ident', 'meta-colon')),
- ],
-
- # optional colon
- 'meta-colon': [
- include('spaces'),
- (r':', Name.Decorator, '#pop'),
- default('#pop'),
- ],
-
- # same as 'ident' but set token as Name.Decorator instead of Name
- 'meta-ident': [
- include('spaces'),
- (ident, Name.Decorator, '#pop'),
- ],
-
- 'meta-body': [
- include('spaces'),
- (r'\(', Name.Decorator, ('#pop', 'meta-call')),
- default('#pop'),
- ],
-
- 'meta-call': [
- include('spaces'),
- (r'\)', Name.Decorator, '#pop'),
- default(('#pop', 'meta-call-sep', 'expr')),
- ],
-
- 'meta-call-sep': [
- include('spaces'),
- (r'\)', Name.Decorator, '#pop'),
- (r',', Punctuation, ('#pop', 'meta-call')),
- ],
-
- 'typedef': [
- include('spaces'),
- default(('#pop', 'typedef-body', 'type-param-constraint',
- 'type-name')),
- ],
-
- 'typedef-body': [
- include('spaces'),
- (r'=', Operator, ('#pop', 'optional-semicolon', 'type')),
- ],
-
- 'enum': [
- include('spaces'),
- default(('#pop', 'enum-body', 'bracket-open',
- 'type-param-constraint', 'type-name')),
- ],
-
- 'enum-body': [
- include('spaces'),
- include('meta'),
- (r'\}', Punctuation, '#pop'),
- (ident_no_keyword, Name, ('enum-member', 'type-param-constraint')),
- ],
-
- 'enum-member': [
- include('spaces'),
- (r'\(', Punctuation,
- ('#pop', 'semicolon', 'flag', 'function-param')),
- default(('#pop', 'semicolon', 'flag')),
- ],
-
- 'class': [
- include('spaces'),
- default(('#pop', 'class-body', 'bracket-open', 'extends',
- 'type-param-constraint', 'type-name')),
- ],
-
- 'extends': [
- include('spaces'),
- (r'(?:extends|implements)\b', Keyword.Declaration, 'type'),
- (r',', Punctuation), # the comma is made optional here, since haxe2
- # requires the comma but haxe3 does not allow it
- default('#pop'),
- ],
-
- 'bracket-open': [
- include('spaces'),
- (r'\{', Punctuation, '#pop'),
- ],
-
- 'bracket-close': [
- include('spaces'),
- (r'\}', Punctuation, '#pop'),
- ],
-
- 'class-body': [
- include('spaces'),
- include('meta'),
- (r'\}', Punctuation, '#pop'),
- (r'(?:static|public|private|override|dynamic|inline|macro)\b',
- Keyword.Declaration),
- default('class-member'),
- ],
-
- 'class-member': [
- include('spaces'),
- (r'(var)\b', Keyword.Declaration,
- ('#pop', 'optional-semicolon', 'var')),
- (r'(function)\b', Keyword.Declaration,
- ('#pop', 'optional-semicolon', 'class-method')),
- ],
-
- # local function, anonymous or not
- 'function-local': [
- include('spaces'),
- (ident_no_keyword, Name.Function,
- ('#pop', 'optional-expr', 'flag', 'function-param',
- 'parenthesis-open', 'type-param-constraint')),
- default(('#pop', 'optional-expr', 'flag', 'function-param',
- 'parenthesis-open', 'type-param-constraint')),
- ],
-
- 'optional-expr': [
- include('spaces'),
- include('expr'),
- default('#pop'),
- ],
-
- 'class-method': [
- include('spaces'),
- (ident, Name.Function, ('#pop', 'optional-expr', 'flag',
- 'function-param', 'parenthesis-open',
- 'type-param-constraint')),
- ],
-
- # function arguments
- 'function-param': [
- include('spaces'),
- (r'\)', Punctuation, '#pop'),
- (r'\?', Punctuation),
- (ident_no_keyword, Name,
- ('#pop', 'function-param-sep', 'assign', 'flag')),
- ],
-
- 'function-param-sep': [
- include('spaces'),
- (r'\)', Punctuation, '#pop'),
- (r',', Punctuation, ('#pop', 'function-param')),
- ],
-
- 'prop-get-set': [
- include('spaces'),
- (r'\(', Punctuation, ('#pop', 'parenthesis-close',
- 'prop-get-set-opt', 'comma', 'prop-get-set-opt')),
- default('#pop'),
- ],
-
- 'prop-get-set-opt': [
- include('spaces'),
- (r'(?:default|null|never|dynamic|get|set)\b', Keyword, '#pop'),
- (ident_no_keyword, Text, '#pop'), # custom getter/setter
- ],
-
- 'expr-statement': [
- include('spaces'),
- # makes semicolon optional here, just to avoid checking the last
- # one is bracket or not.
- default(('#pop', 'optional-semicolon', 'expr')),
- ],
-
- 'expr': [
- include('spaces'),
- (r'@', Name.Decorator, ('#pop', 'optional-expr', 'meta-body',
- 'meta-ident', 'meta-colon')),
- (r'(?:\+\+|\-\-|~(?!/)|!|\-)', Operator),
- (r'\(', Punctuation, ('#pop', 'expr-chain', 'parenthesis')),
- (r'(?:static|public|private|override|dynamic|inline)\b',
- Keyword.Declaration),
- (r'(?:function)\b', Keyword.Declaration, ('#pop', 'expr-chain',
- 'function-local')),
- (r'\{', Punctuation, ('#pop', 'expr-chain', 'bracket')),
- (r'(?:true|false|null)\b', Keyword.Constant, ('#pop', 'expr-chain')),
- (r'(?:this)\b', Keyword, ('#pop', 'expr-chain')),
- (r'(?:cast)\b', Keyword, ('#pop', 'expr-chain', 'cast')),
- (r'(?:try)\b', Keyword, ('#pop', 'catch', 'expr')),
- (r'(?:var)\b', Keyword.Declaration, ('#pop', 'var')),
- (r'(?:new)\b', Keyword, ('#pop', 'expr-chain', 'new')),
- (r'(?:switch)\b', Keyword, ('#pop', 'switch')),
- (r'(?:if)\b', Keyword, ('#pop', 'if')),
- (r'(?:do)\b', Keyword, ('#pop', 'do')),
- (r'(?:while)\b', Keyword, ('#pop', 'while')),
- (r'(?:for)\b', Keyword, ('#pop', 'for')),
- (r'(?:untyped|throw)\b', Keyword),
- (r'(?:return)\b', Keyword, ('#pop', 'optional-expr')),
- (r'(?:macro)\b', Keyword, ('#pop', 'macro')),
- (r'(?:continue|break)\b', Keyword, '#pop'),
- (r'(?:\$\s*[a-z]\b|\$(?!'+ident+'))', Name, ('#pop', 'dollar')),
- (ident_no_keyword, Name, ('#pop', 'expr-chain')),
-
- # Float
- (r'\.[0-9]+', Number.Float, ('#pop', 'expr-chain')),
- (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'expr-chain')),
- (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float, ('#pop', 'expr-chain')),
- (r'[0-9]+\.[0-9]+', Number.Float, ('#pop', 'expr-chain')),
- (r'[0-9]+\.(?!' + ident + r'|\.\.)', Number.Float, ('#pop', 'expr-chain')),
-
- # Int
- (r'0x[0-9a-fA-F]+', Number.Hex, ('#pop', 'expr-chain')),
- (r'[0-9]+', Number.Integer, ('#pop', 'expr-chain')),
-
- # String
- (r"'", String.Single, ('#pop', 'expr-chain', 'string-single-interpol')),
- (r'"', String.Double, ('#pop', 'expr-chain', 'string-double')),
-
- # EReg
- (r'~/(\\\\|\\/|[^/\n])*/[gimsu]*', String.Regex, ('#pop', 'expr-chain')),
-
- # Array
- (r'\[', Punctuation, ('#pop', 'expr-chain', 'array-decl')),
- ],
-
- 'expr-chain': [
- include('spaces'),
- (r'(?:\+\+|\-\-)', Operator),
- (binop, Operator, ('#pop', 'expr')),
- (r'(?:in)\b', Keyword, ('#pop', 'expr')),
- (r'\?', Operator, ('#pop', 'expr', 'ternary', 'expr')),
- (r'(\.)(' + ident_no_keyword + ')', bygroups(Punctuation, Name)),
- (r'\[', Punctuation, 'array-access'),
- (r'\(', Punctuation, 'call'),
- default('#pop'),
- ],
-
- # macro reification
- 'macro': [
- include('spaces'),
- include('meta'),
- (r':', Punctuation, ('#pop', 'type')),
-
- (r'(?:extern|private)\b', Keyword.Declaration),
- (r'(?:abstract)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'abstract')),
- (r'(?:class|interface)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'macro-class')),
- (r'(?:enum)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'enum')),
- (r'(?:typedef)\b', Keyword.Declaration, ('#pop', 'optional-semicolon', 'typedef')),
-
- default(('#pop', 'expr')),
- ],
-
- 'macro-class': [
- (r'\{', Punctuation, ('#pop', 'class-body')),
- include('class')
- ],
-
- # cast can be written as "cast expr" or "cast(expr, type)"
- 'cast': [
- include('spaces'),
- (r'\(', Punctuation, ('#pop', 'parenthesis-close',
- 'cast-type', 'expr')),
- default(('#pop', 'expr')),
- ],
-
- # optionally give a type as the 2nd argument of cast()
- 'cast-type': [
- include('spaces'),
- (r',', Punctuation, ('#pop', 'type')),
- default('#pop'),
- ],
-
- 'catch': [
- include('spaces'),
- (r'(?:catch)\b', Keyword, ('expr', 'function-param',
- 'parenthesis-open')),
- default('#pop'),
- ],
-
- # do-while loop
- 'do': [
- include('spaces'),
- default(('#pop', 'do-while', 'expr')),
- ],
-
- # the while after do
- 'do-while': [
- include('spaces'),
- (r'(?:while)\b', Keyword, ('#pop', 'parenthesis',
- 'parenthesis-open')),
- ],
-
- 'while': [
- include('spaces'),
- (r'\(', Punctuation, ('#pop', 'expr', 'parenthesis')),
- ],
-
- 'for': [
- include('spaces'),
- (r'\(', Punctuation, ('#pop', 'expr', 'parenthesis')),
- ],
-
- 'if': [
- include('spaces'),
- (r'\(', Punctuation, ('#pop', 'else', 'optional-semicolon', 'expr',
- 'parenthesis')),
- ],
-
- 'else': [
- include('spaces'),
- (r'(?:else)\b', Keyword, ('#pop', 'expr')),
- default('#pop'),
- ],
-
- 'switch': [
- include('spaces'),
- default(('#pop', 'switch-body', 'bracket-open', 'expr')),
- ],
-
- 'switch-body': [
- include('spaces'),
- (r'(?:case|default)\b', Keyword, ('case-block', 'case')),
- (r'\}', Punctuation, '#pop'),
- ],
-
- 'case': [
- include('spaces'),
- (r':', Punctuation, '#pop'),
- default(('#pop', 'case-sep', 'case-guard', 'expr')),
- ],
-
- 'case-sep': [
- include('spaces'),
- (r':', Punctuation, '#pop'),
- (r',', Punctuation, ('#pop', 'case')),
- ],
-
- 'case-guard': [
- include('spaces'),
- (r'(?:if)\b', Keyword, ('#pop', 'parenthesis', 'parenthesis-open')),
- default('#pop'),
- ],
-
- # optional multiple expr under a case
- 'case-block': [
- include('spaces'),
- (r'(?!(?:case|default)\b|\})', Keyword, 'expr-statement'),
- default('#pop'),
- ],
-
- 'new': [
- include('spaces'),
- default(('#pop', 'call', 'parenthesis-open', 'type')),
- ],
-
- 'array-decl': [
- include('spaces'),
- (r'\]', Punctuation, '#pop'),
- default(('#pop', 'array-decl-sep', 'expr')),
- ],
-
- 'array-decl-sep': [
- include('spaces'),
- (r'\]', Punctuation, '#pop'),
- (r',', Punctuation, ('#pop', 'array-decl')),
- ],
-
- 'array-access': [
- include('spaces'),
- default(('#pop', 'array-access-close', 'expr')),
- ],
-
- 'array-access-close': [
- include('spaces'),
- (r'\]', Punctuation, '#pop'),
- ],
-
- 'comma': [
- include('spaces'),
- (r',', Punctuation, '#pop'),
- ],
-
- 'colon': [
- include('spaces'),
- (r':', Punctuation, '#pop'),
- ],
-
- 'semicolon': [
- include('spaces'),
- (r';', Punctuation, '#pop'),
- ],
-
- 'optional-semicolon': [
- include('spaces'),
- (r';', Punctuation, '#pop'),
- default('#pop'),
- ],
-
- # identity that CAN be a Haxe keyword
- 'ident': [
- include('spaces'),
- (ident, Name, '#pop'),
- ],
-
- 'dollar': [
- include('spaces'),
- (r'\{', Punctuation, ('#pop', 'expr-chain', 'bracket-close', 'expr')),
- default(('#pop', 'expr-chain')),
- ],
-
- 'type-name': [
- include('spaces'),
- (typeid, Name, '#pop'),
- ],
-
- 'type-full-name': [
- include('spaces'),
- (r'\.', Punctuation, 'ident'),
- default('#pop'),
- ],
-
- 'type': [
- include('spaces'),
- (r'\?', Punctuation),
- (ident, Name, ('#pop', 'type-check', 'type-full-name')),
- (r'\{', Punctuation, ('#pop', 'type-check', 'type-struct')),
- (r'\(', Punctuation, ('#pop', 'type-check', 'type-parenthesis')),
- ],
-
- 'type-parenthesis': [
- include('spaces'),
- default(('#pop', 'parenthesis-close', 'type')),
- ],
-
- 'type-check': [
- include('spaces'),
- (r'->', Punctuation, ('#pop', 'type')),
- (r'<(?!=)', Punctuation, 'type-param'),
- default('#pop'),
- ],
-
- 'type-struct': [
- include('spaces'),
- (r'\}', Punctuation, '#pop'),
- (r'\?', Punctuation),
- (r'>', Punctuation, ('comma', 'type')),
- (ident_no_keyword, Name, ('#pop', 'type-struct-sep', 'type', 'colon')),
- include('class-body'),
- ],
-
- 'type-struct-sep': [
- include('spaces'),
- (r'\}', Punctuation, '#pop'),
- (r',', Punctuation, ('#pop', 'type-struct')),
- ],
-
- # type-param can be a normal type or a constant literal...
- 'type-param-type': [
- # Float
- (r'\.[0-9]+', Number.Float, '#pop'),
- (r'[0-9]+[eE][+\-]?[0-9]+', Number.Float, '#pop'),
- (r'[0-9]+\.[0-9]*[eE][+\-]?[0-9]+', Number.Float, '#pop'),
- (r'[0-9]+\.[0-9]+', Number.Float, '#pop'),
- (r'[0-9]+\.(?!' + ident + r'|\.\.)', Number.Float, '#pop'),
-
- # Int
- (r'0x[0-9a-fA-F]+', Number.Hex, '#pop'),
- (r'[0-9]+', Number.Integer, '#pop'),
-
- # String
- (r"'", String.Single, ('#pop', 'string-single')),
- (r'"', String.Double, ('#pop', 'string-double')),
-
- # EReg
- (r'~/(\\\\|\\/|[^/\n])*/[gim]*', String.Regex, '#pop'),
-
- # Array
- (r'\[', Operator, ('#pop', 'array-decl')),
-
- include('type'),
- ],
-
- # type-param part of a type
- # ie. the <A,B> path in Map<A,B>
- 'type-param': [
- include('spaces'),
- default(('#pop', 'type-param-sep', 'type-param-type')),
- ],
-
- 'type-param-sep': [
- include('spaces'),
- (r'>', Punctuation, '#pop'),
- (r',', Punctuation, ('#pop', 'type-param')),
- ],
-
- # optional type-param that may include constraint
- # ie. <T:Constraint, T2:(ConstraintA,ConstraintB)>
- 'type-param-constraint': [
- include('spaces'),
- (r'<(?!=)', Punctuation, ('#pop', 'type-param-constraint-sep',
- 'type-param-constraint-flag', 'type-name')),
- default('#pop'),
- ],
-
- 'type-param-constraint-sep': [
- include('spaces'),
- (r'>', Punctuation, '#pop'),
- (r',', Punctuation, ('#pop', 'type-param-constraint-sep',
- 'type-param-constraint-flag', 'type-name')),
- ],
-
- # the optional constraint inside type-param
- 'type-param-constraint-flag': [
- include('spaces'),
- (r':', Punctuation, ('#pop', 'type-param-constraint-flag-type')),
- default('#pop'),
- ],
-
- 'type-param-constraint-flag-type': [
- include('spaces'),
- (r'\(', Punctuation, ('#pop', 'type-param-constraint-flag-type-sep',
- 'type')),
- default(('#pop', 'type')),
- ],
-
- 'type-param-constraint-flag-type-sep': [
- include('spaces'),
- (r'\)', Punctuation, '#pop'),
- (r',', Punctuation, 'type'),
- ],
-
- # a parenthesis expr that contain exactly one expr
- 'parenthesis': [
- include('spaces'),
- default(('#pop', 'parenthesis-close', 'flag', 'expr')),
- ],
-
- 'parenthesis-open': [
- include('spaces'),
- (r'\(', Punctuation, '#pop'),
- ],
-
- 'parenthesis-close': [
- include('spaces'),
- (r'\)', Punctuation, '#pop'),
- ],
-
- 'var': [
- include('spaces'),
- (ident_no_keyword, Text, ('#pop', 'var-sep', 'assign', 'flag', 'prop-get-set')),
- ],
-
- # optional more var decl.
- 'var-sep': [
- include('spaces'),
- (r',', Punctuation, ('#pop', 'var')),
- default('#pop'),
- ],
-
- # optional assignment
- 'assign': [
- include('spaces'),
- (r'=', Operator, ('#pop', 'expr')),
- default('#pop'),
- ],
-
- # optional type flag
- 'flag': [
- include('spaces'),
- (r':', Punctuation, ('#pop', 'type')),
- default('#pop'),
- ],
-
- # colon as part of a ternary operator (?:)
- 'ternary': [
- include('spaces'),
- (r':', Operator, '#pop'),
- ],
-
- # function call
- 'call': [
- include('spaces'),
- (r'\)', Punctuation, '#pop'),
- default(('#pop', 'call-sep', 'expr')),
- ],
-
- # after a call param
- 'call-sep': [
- include('spaces'),
- (r'\)', Punctuation, '#pop'),
- (r',', Punctuation, ('#pop', 'call')),
- ],
-
- # bracket can be block or object
- 'bracket': [
- include('spaces'),
- (r'(?!(?:\$\s*[a-z]\b|\$(?!'+ident+')))' + ident_no_keyword, Name,
- ('#pop', 'bracket-check')),
- (r"'", String.Single, ('#pop', 'bracket-check', 'string-single')),
- (r'"', String.Double, ('#pop', 'bracket-check', 'string-double')),
- default(('#pop', 'block')),
- ],
-
- 'bracket-check': [
- include('spaces'),
- (r':', Punctuation, ('#pop', 'object-sep', 'expr')), # is object
- default(('#pop', 'block', 'optional-semicolon', 'expr-chain')), # is block
- ],
-
- # code block
- 'block': [
- include('spaces'),
- (r'\}', Punctuation, '#pop'),
- default('expr-statement'),
- ],
-
- # object in key-value pairs
- 'object': [
- include('spaces'),
- (r'\}', Punctuation, '#pop'),
- default(('#pop', 'object-sep', 'expr', 'colon', 'ident-or-string'))
- ],
-
- # a key of an object
- 'ident-or-string': [
- include('spaces'),
- (ident_no_keyword, Name, '#pop'),
- (r"'", String.Single, ('#pop', 'string-single')),
- (r'"', String.Double, ('#pop', 'string-double')),
- ],
-
- # after a key-value pair in object
- 'object-sep': [
- include('spaces'),
- (r'\}', Punctuation, '#pop'),
- (r',', Punctuation, ('#pop', 'object')),
- ],
-
-
-
- }
-
- def analyse_text(text):
- if re.match(r'\w+\s*:\s*\w', text):
- return 0.3
-
-
-class HxmlLexer(RegexLexer):
- """
- Lexer for `haXe build <http://haxe.org/doc/compiler>`_ files.
-
- .. versionadded:: 1.6
- """
- name = 'Hxml'
- aliases = ['haxeml', 'hxml']
- filenames = ['*.hxml']
-
- tokens = {
- 'root': [
- # Seperator
- (r'(--)(next)', bygroups(Punctuation, Generic.Heading)),
- # Compiler switches with one dash
- (r'(-)(prompt|debug|v)', bygroups(Punctuation, Keyword.Keyword)),
- # Compilerswitches with two dashes
- (r'(--)(neko-source|flash-strict|flash-use-stage|no-opt|no-traces|'
- r'no-inline|times|no-output)', bygroups(Punctuation, Keyword)),
- # Targets and other options that take an argument
- (r'(-)(cpp|js|neko|x|as3|swf9?|swf-lib|php|xml|main|lib|D|resource|'
- r'cp|cmd)( +)(.+)',
- bygroups(Punctuation, Keyword, Whitespace, String)),
- # Options that take only numerical arguments
- (r'(-)(swf-version)( +)(\d+)',
- bygroups(Punctuation, Keyword, Number.Integer)),
- # An Option that defines the size, the fps and the background
- # color of an flash movie
- (r'(-)(swf-header)( +)(\d+)(:)(\d+)(:)(\d+)(:)([A-Fa-f0-9]{6})',
- bygroups(Punctuation, Keyword, Whitespace, Number.Integer,
- Punctuation, Number.Integer, Punctuation, Number.Integer,
- Punctuation, Number.Hex)),
- # options with two dashes that takes arguments
- (r'(--)(js-namespace|php-front|php-lib|remap|gen-hx-classes)( +)'
- r'(.+)', bygroups(Punctuation, Keyword, Whitespace, String)),
- # Single line comment, multiline ones are not allowed.
- (r'#.*', Comment.Single)
- ]
- }
diff --git a/pygments/lexers/hdl.py b/pygments/lexers/hdl.py
deleted file mode 100644
index e7c7617b..00000000
--- a/pygments/lexers/hdl.py
+++ /dev/null
@@ -1,382 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.hdl
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for hardware descriptor languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, include, using, this, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-
-__all__ = ['VerilogLexer', 'SystemVerilogLexer', 'VhdlLexer']
-
-
-class VerilogLexer(RegexLexer):
- """
- For verilog source code with preprocessor directives.
-
- .. versionadded:: 1.4
- """
- name = 'verilog'
- aliases = ['verilog', 'v']
- filenames = ['*.v']
- mimetypes = ['text/x-verilog']
-
- #: optional Comment or Whitespace
- _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
-
- tokens = {
- 'root': [
- (r'^\s*`define', Comment.Preproc, 'macro'),
- (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)[01]+', Number.Bin),
- (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_]\w*', Name.Constant),
-
- (r'^(\s*)(package)(\s+)', bygroups(Text, Keyword.Namespace, Text)),
- (r'^(\s*)(import)(\s+)', bygroups(Text, Keyword.Namespace, Text),
- 'import'),
-
- (words((
- 'always', 'always_comb', 'always_ff', 'always_latch', 'and',
- 'assign', 'automatic', 'begin', 'break', 'buf', 'bufif0', 'bufif1',
- 'case', 'casex', 'casez', 'cmos', 'const', 'continue', 'deassign',
- 'default', 'defparam', 'disable', 'do', 'edge', 'else', 'end', 'endcase',
- 'endfunction', 'endgenerate', 'endmodule', 'endpackage', 'endprimitive',
- 'endspecify', 'endtable', 'endtask', 'enum', 'event', 'final', 'for',
- 'force', 'forever', 'fork', 'function', 'generate', 'genvar', 'highz0',
- 'highz1', 'if', 'initial', 'inout', 'input', 'integer', 'join', 'large',
- 'localparam', 'macromodule', 'medium', 'module', 'nand', 'negedge',
- 'nmos', 'nor', 'not', 'notif0', 'notif1', 'or', 'output', 'packed',
- 'parameter', 'pmos', 'posedge', 'primitive', 'pull0', 'pull1',
- 'pulldown', 'pullup', 'rcmos', 'ref', 'release', 'repeat', 'return',
- 'rnmos', 'rpmos', 'rtran', 'rtranif0', 'rtranif1', 'scalared', 'signed',
- 'small', 'specify', 'specparam', 'strength', 'string', 'strong0',
- 'strong1', 'struct', 'table', 'task', 'tran', 'tranif0', 'tranif1',
- 'type', 'typedef', 'unsigned', 'var', 'vectored', 'void', 'wait',
- 'weak0', 'weak1', 'while', 'xnor', 'xor'), suffix=r'\b'),
- Keyword),
-
- (words((
- 'accelerate', 'autoexpand_vectornets', 'celldefine', 'default_nettype',
- 'else', 'elsif', 'endcelldefine', 'endif', 'endprotect', 'endprotected',
- 'expand_vectornets', 'ifdef', 'ifndef', 'include', 'noaccelerate',
- 'noexpand_vectornets', 'noremove_gatenames', 'noremove_netnames',
- 'nounconnected_drive', 'protect', 'protected', 'remove_gatenames',
- 'remove_netnames', 'resetall', 'timescale', 'unconnected_drive',
- 'undef'), prefix=r'`', suffix=r'\b'),
- Comment.Preproc),
-
- (words((
- 'bits', 'bitstoreal', 'bitstoshortreal', 'countdrivers', 'display', 'fclose',
- 'fdisplay', 'finish', 'floor', 'fmonitor', 'fopen', 'fstrobe', 'fwrite',
- 'getpattern', 'history', 'incsave', 'input', 'itor', 'key', 'list', 'log',
- 'monitor', 'monitoroff', 'monitoron', 'nokey', 'nolog', 'printtimescale',
- 'random', 'readmemb', 'readmemh', 'realtime', 'realtobits', 'reset',
- 'reset_count', 'reset_value', 'restart', 'rtoi', 'save', 'scale', 'scope',
- 'shortrealtobits', 'showscopes', 'showvariables', 'showvars', 'sreadmemb',
- 'sreadmemh', 'stime', 'stop', 'strobe', 'time', 'timeformat', 'write'),
- prefix=r'\$', suffix=r'\b'),
- Name.Builtin),
-
- (words((
- 'byte', 'shortint', 'int', 'longint', 'integer', 'time',
- 'bit', 'logic', 'reg', 'supply0', 'supply1', 'tri', 'triand',
- 'trior', 'tri0', 'tri1', 'trireg', 'uwire', 'wire', 'wand', 'wo'
- 'shortreal', 'real', 'realtime'), suffix=r'\b'),
- Keyword.Type),
- (r'[a-zA-Z_]\w*:(?!:)', Name.Label),
- (r'\$?[a-zA-Z_]\w*', 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'[\w:]+\*?', 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.
-
- .. versionadded:: 1.5
- """
- name = 'systemverilog'
- aliases = ['systemverilog', '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)[01]+', Number.Bin),
- (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_]\w*', Name.Constant),
-
- (words((
- 'accept_on', 'alias', 'always', 'always_comb', 'always_ff', 'always_latch',
- 'and', 'assert', 'assign', 'assume', 'automatic', 'before', 'begin', 'bind', 'bins',
- 'binsof', 'bit', 'break', 'buf', 'bufif0', 'bufif1', 'byte', 'case', 'casex', 'casez',
- 'cell', 'chandle', 'checker', 'class', 'clocking', 'cmos', 'config', 'const', 'constraint',
- 'context', 'continue', 'cover', 'covergroup', 'coverpoint', 'cross', 'deassign',
- 'default', 'defparam', 'design', 'disable', 'dist', 'do', 'edge', 'else', 'end', 'endcase',
- 'endchecker', 'endclass', 'endclocking', 'endconfig', 'endfunction', 'endgenerate',
- 'endgroup', 'endinterface', 'endmodule', 'endpackage', 'endprimitive',
- 'endprogram', 'endproperty', 'endsequence', 'endspecify', 'endtable',
- 'endtask', 'enum', 'event', 'eventually', 'expect', 'export', 'extends', 'extern',
- 'final', 'first_match', 'for', 'force', 'foreach', 'forever', 'fork', 'forkjoin',
- 'function', 'generate', 'genvar', 'global', 'highz0', 'highz1', 'if', 'iff', 'ifnone',
- 'ignore_bins', 'illegal_bins', 'implies', 'import', 'incdir', 'include',
- 'initial', 'inout', 'input', 'inside', 'instance', 'int', 'integer', 'interface',
- 'intersect', 'join', 'join_any', 'join_none', 'large', 'let', 'liblist', 'library',
- 'local', 'localparam', 'logic', 'longint', 'macromodule', 'matches', 'medium',
- 'modport', 'module', 'nand', 'negedge', 'new', 'nexttime', 'nmos', 'nor', 'noshowcancelled',
- 'not', 'notif0', 'notif1', 'null', 'or', 'output', 'package', 'packed', 'parameter',
- 'pmos', 'posedge', 'primitive', 'priority', 'program', 'property', 'protected',
- 'pull0', 'pull1', 'pulldown', 'pullup', 'pulsestyle_ondetect', 'pulsestyle_onevent',
- 'pure', 'rand', 'randc', 'randcase', 'randsequence', 'rcmos', 'real', 'realtime',
- 'ref', 'reg', 'reject_on', 'release', 'repeat', 'restrict', 'return', 'rnmos',
- 'rpmos', 'rtran', 'rtranif0', 'rtranif1', 's_always', 's_eventually', 's_nexttime',
- 's_until', 's_until_with', 'scalared', 'sequence', 'shortint', 'shortreal',
- 'showcancelled', 'signed', 'small', 'solve', 'specify', 'specparam', 'static',
- 'string', 'strong', 'strong0', 'strong1', 'struct', 'super', 'supply0', 'supply1',
- 'sync_accept_on', 'sync_reject_on', 'table', 'tagged', 'task', 'this', 'throughout',
- 'time', 'timeprecision', 'timeunit', 'tran', 'tranif0', 'tranif1', 'tri', 'tri0',
- 'tri1', 'triand', 'trior', 'trireg', 'type', 'typedef', 'union', 'unique', 'unique0',
- 'unsigned', 'until', 'until_with', 'untyped', 'use', 'uwire', 'var', 'vectored',
- 'virtual', 'void', 'wait', 'wait_order', 'wand', 'weak', 'weak0', 'weak1', 'while',
- 'wildcard', 'wire', 'with', 'within', 'wor', 'xnor', 'xor'), suffix=r'\b'),
- Keyword),
-
- (words((
- '`__FILE__', '`__LINE__', '`begin_keywords', '`celldefine', '`default_nettype',
- '`define', '`else', '`elsif', '`end_keywords', '`endcelldefine', '`endif',
- '`ifdef', '`ifndef', '`include', '`line', '`nounconnected_drive', '`pragma',
- '`resetall', '`timescale', '`unconnected_drive', '`undef', '`undefineall'),
- suffix=r'\b'),
- Comment.Preproc),
-
- (words((
- '$display', '$displayb', '$displayh', '$displayo', '$dumpall', '$dumpfile',
- '$dumpflush', '$dumplimit', '$dumpoff', '$dumpon', '$dumpports',
- '$dumpportsall', '$dumpportsflush', '$dumpportslimit', '$dumpportsoff',
- '$dumpportson', '$dumpvars', '$fclose', '$fdisplay', '$fdisplayb',
- '$fdisplayh', '$fdisplayo', '$feof', '$ferror', '$fflush', '$fgetc',
- '$fgets', '$finish', '$fmonitor', '$fmonitorb', '$fmonitorh', '$fmonitoro',
- '$fopen', '$fread', '$fscanf', '$fseek', '$fstrobe', '$fstrobeb', '$fstrobeh',
- '$fstrobeo', '$ftell', '$fwrite', '$fwriteb', '$fwriteh', '$fwriteo',
- '$monitor', '$monitorb', '$monitorh', '$monitoro', '$monitoroff',
- '$monitoron', '$plusargs', '$random', '$readmemb', '$readmemh', '$rewind',
- '$sformat', '$sformatf', '$sscanf', '$strobe', '$strobeb', '$strobeh', '$strobeo',
- '$swrite', '$swriteb', '$swriteh', '$swriteo', '$test', '$ungetc',
- '$value$plusargs', '$write', '$writeb', '$writeh', '$writememb',
- '$writememh', '$writeo'), suffix=r'\b'),
- Name.Builtin),
-
- (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
- (words((
- 'byte', 'shortint', 'int', 'longint', 'integer', 'time',
- 'bit', 'logic', 'reg', 'supply0', 'supply1', 'tri', 'triand',
- 'trior', 'tri0', 'tri1', 'trireg', 'uwire', 'wire', 'wand', 'wo'
- 'shortreal', 'real', 'realtime'), suffix=r'\b'),
- Keyword.Type),
- (r'[a-zA-Z_]\w*:(?!:)', Name.Label),
- (r'\$?[a-zA-Z_]\w*', Name),
- ],
- 'classname': [
- (r'[a-zA-Z_]\w*', Name.Class, '#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'),
- ],
- 'import': [
- (r'[\w:]+\*?', 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 VhdlLexer(RegexLexer):
- """
- For VHDL source code.
-
- .. versionadded:: 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-z_]\w*", Name.Attribute),
- (r'[()\[\],.;\']', Punctuation),
- (r'"[^\n\\"]*"', String),
-
- (r'(library)(\s+)([a-z_]\w*)',
- bygroups(Keyword, Text, Name.Namespace)),
- (r'(use)(\s+)(entity)', bygroups(Keyword, Text, Keyword)),
- (r'(use)(\s+)([a-z_][\w.]*\.)(all)',
- bygroups(Keyword, Text, Name.Namespace, Keyword)),
- (r'(use)(\s+)([a-z_][\w.]*)',
- bygroups(Keyword, Text, Name.Namespace)),
- (r'(std|ieee)(\.[a-z_]\w*)',
- bygroups(Name.Namespace, Name.Namespace)),
- (words(('std', 'ieee', 'work'), suffix=r'\b'),
- Name.Namespace),
- (r'(entity|component)(\s+)([a-z_]\w*)',
- bygroups(Keyword, Text, Name.Class)),
- (r'(architecture|configuration)(\s+)([a-z_]\w*)(\s+)'
- r'(of)(\s+)([a-z_]\w*)(\s+)(is)',
- bygroups(Keyword, Text, Name.Class, Text, Keyword, Text,
- Name.Class, Text, Keyword)),
- (r'([a-z_]\w*)(:)(\s+)(process|for)',
- bygroups(Name.Class, Operator, Text, Keyword)),
- (r'(end)(\s+)', bygroups(using(this), Text), 'endblock'),
-
- include('types'),
- include('keywords'),
- include('numbers'),
-
- (r'[a-z_]\w*', Name),
- ],
- 'endblock': [
- include('keywords'),
- (r'[a-z_]\w*', Name.Class),
- (r'(\s+)', Text),
- (r';', Punctuation, '#pop'),
- ],
- 'types': [
- (words((
- 'boolean', 'bit', 'character', 'severity_level', 'integer', 'time',
- 'delay_length', 'natural', 'positive', 'string', 'bit_vector',
- 'file_open_kind', 'file_open_status', 'std_ulogic', 'std_ulogic_vector',
- 'std_logic', 'std_logic_vector', 'signed', 'unsigned'), suffix=r'\b'),
- Keyword.Type),
- ],
- 'keywords': [
- (words((
- 'abs', 'access', 'after', 'alias', 'all', 'and',
- 'architecture', 'array', 'assert', 'attribute', 'begin', 'block',
- 'body', 'buffer', 'bus', 'case', 'component', 'configuration',
- 'constant', 'disconnect', 'downto', 'else', 'elsif', 'end',
- 'entity', 'exit', 'file', 'for', 'function', 'generate',
- 'generic', 'group', 'guarded', 'if', 'impure', 'in',
- 'inertial', 'inout', 'is', 'label', 'library', 'linkage',
- 'literal', 'loop', 'map', 'mod', 'nand', 'new',
- 'next', 'nor', 'not', 'null', 'of', 'on',
- 'open', 'or', 'others', 'out', 'package', 'port',
- 'postponed', 'procedure', 'process', 'pure', 'range', 'record',
- 'register', 'reject', 'rem', 'return', 'rol', 'ror', 'select',
- 'severity', 'signal', 'shared', 'sla', 'sll', 'sra',
- 'srl', 'subtype', 'then', 'to', 'transport', 'type',
- 'units', 'until', 'use', 'variable', 'wait', 'when',
- 'while', 'with', 'xnor', 'xor'), suffix=r'\b'),
- Keyword),
- ],
- 'numbers': [
- (r'\d{1,2}#[0-9a-f_]+#?', Number.Integer),
- (r'\d+', Number.Integer),
- (r'(\d+\.\d*|\.\d+|\d+)E[+-]?\d+', Number.Float),
- (r'X"[0-9a-f_]+"', Number.Hex),
- (r'O"[0-7_]+"', Number.Oct),
- (r'B"[01_]+"', Number.Bin),
- ],
- }
diff --git a/pygments/lexers/hexdump.py b/pygments/lexers/hexdump.py
deleted file mode 100644
index da285432..00000000
--- a/pygments/lexers/hexdump.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.hexdump
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for hexadecimal dumps.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups, include
-from pygments.token import Text, Name, Number, String, Punctuation
-
-__all__ = ['HexdumpLexer']
-
-
-class HexdumpLexer(RegexLexer):
- """
- For typical hex dump output formats by the UNIX and GNU/Linux tools ``hexdump``,
- ``hd``, ``hexcat``, ``od`` and ``xxd``, and the DOS tool ``DEBUG``. For example:
-
- .. sourcecode:: hexdump
-
- 00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
- 00000010 02 00 3e 00 01 00 00 00 c5 48 40 00 00 00 00 00 |..>......H@.....|
-
- The specific supported formats are the outputs of:
-
- * ``hexdump FILE``
- * ``hexdump -C FILE`` -- the `canonical` format used in the example.
- * ``hd FILE`` -- same as ``hexdump -C FILE``.
- * ``hexcat FILE``
- * ``od -t x1z FILE``
- * ``xxd FILE``
- * ``DEBUG.EXE FILE.COM`` and entering ``d`` to the prompt.
-
- .. versionadded:: 2.1
- """
- name = 'Hexdump'
- aliases = ['hexdump']
-
- hd = r'[0-9A-Ha-h]'
-
- tokens = {
- 'root': [
- (r'\n', Text),
- include('offset'),
- (r'('+hd+r'{2})(\-)('+hd+r'{2})',
- bygroups(Number.Hex, Punctuation, Number.Hex)),
- (hd+r'{2}', Number.Hex),
- (r'(\s{2,3})(\>)(.{16})(\<)$',
- bygroups(Text, Punctuation, String, Punctuation), 'bracket-strings'),
- (r'(\s{2,3})(\|)(.{16})(\|)$',
- bygroups(Text, Punctuation, String, Punctuation), 'piped-strings'),
- (r'(\s{2,3})(\>)(.{1,15})(\<)$',
- bygroups(Text, Punctuation, String, Punctuation)),
- (r'(\s{2,3})(\|)(.{1,15})(\|)$',
- bygroups(Text, Punctuation, String, Punctuation)),
- (r'(\s{2,3})(.{1,15})$', bygroups(Text, String)),
- (r'(\s{2,3})(.{16}|.{20})$', bygroups(Text, String), 'nonpiped-strings'),
- (r'\s', Text),
- (r'^\*', Punctuation),
- ],
- 'offset': [
- (r'^('+hd+'+)(:)', bygroups(Name.Label, Punctuation), 'offset-mode'),
- (r'^'+hd+'+', Name.Label),
- ],
- 'offset-mode': [
- (r'\s', Text, '#pop'),
- (hd+'+', Name.Label),
- (r':', Punctuation)
- ],
- 'piped-strings': [
- (r'\n', Text),
- include('offset'),
- (hd+r'{2}', Number.Hex),
- (r'(\s{2,3})(\|)(.{1,16})(\|)$',
- bygroups(Text, Punctuation, String, Punctuation)),
- (r'\s', Text),
- (r'^\*', Punctuation),
- ],
- 'bracket-strings': [
- (r'\n', Text),
- include('offset'),
- (hd+r'{2}', Number.Hex),
- (r'(\s{2,3})(\>)(.{1,16})(\<)$',
- bygroups(Text, Punctuation, String, Punctuation)),
- (r'\s', Text),
- (r'^\*', Punctuation),
- ],
- 'nonpiped-strings': [
- (r'\n', Text),
- include('offset'),
- (r'('+hd+r'{2})(\-)('+hd+r'{2})',
- bygroups(Number.Hex, Punctuation, Number.Hex)),
- (hd+r'{2}', Number.Hex),
- (r'(\s{19,})(.{1,20}?)$', bygroups(Text, String)),
- (r'(\s{2,3})(.{1,20})$', bygroups(Text, String)),
- (r'\s', Text),
- (r'^\*', Punctuation),
- ],
- }
diff --git a/pygments/lexers/html.py b/pygments/lexers/html.py
deleted file mode 100644
index ae38167c..00000000
--- a/pygments/lexers/html.py
+++ /dev/null
@@ -1,602 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.html
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for HTML, XML and related markup.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
- default, using
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Punctuation
-from pygments.util import looks_like_xml, html_doctype_matches
-
-from pygments.lexers.javascript import JavascriptLexer
-from pygments.lexers.jvm import ScalaLexer
-from pygments.lexers.css import CssLexer, _indentation, _starts_block
-from pygments.lexers.ruby import RubyLexer
-
-__all__ = ['HtmlLexer', 'DtdLexer', 'XmlLexer', 'XsltLexer', 'HamlLexer',
- 'ScamlLexer', 'PugLexer']
-
-
-class HtmlLexer(RegexLexer):
- """
- For HTML 4 and XHTML 1 markup. Nested JavaScript and CSS is highlighted
- by the appropriate lexer.
- """
-
- name = 'HTML'
- aliases = ['html']
- filenames = ['*.html', '*.htm', '*.xhtml', '*.xslt']
- mimetypes = ['text/html', 'application/xhtml+xml']
-
- flags = re.IGNORECASE | re.DOTALL
- tokens = {
- 'root': [
- ('[^<&]+', Text),
- (r'&\S*?;', Name.Entity),
- (r'\<\!\[CDATA\[.*?\]\]\>', Comment.Preproc),
- ('<!--', Comment, 'comment'),
- (r'<\?.*?\?>', Comment.Preproc),
- ('<![^>]*>', Comment.Preproc),
- (r'(<)(\s*)(script)(\s*)',
- bygroups(Punctuation, Text, Name.Tag, Text),
- ('script-content', 'tag')),
- (r'(<)(\s*)(style)(\s*)',
- bygroups(Punctuation, Text, Name.Tag, Text),
- ('style-content', 'tag')),
- # note: this allows tag names not used in HTML like <x:with-dash>,
- # this is to support yet-unknown template engines and the like
- (r'(<)(\s*)([\w:.-]+)',
- bygroups(Punctuation, Text, Name.Tag), 'tag'),
- (r'(<)(\s*)(/)(\s*)([\w:.-]+)(\s*)(>)',
- bygroups(Punctuation, Text, Punctuation, Text, Name.Tag, Text,
- Punctuation)),
- ],
- 'comment': [
- ('[^-]+', Comment),
- ('-->', Comment, '#pop'),
- ('-', Comment),
- ],
- 'tag': [
- (r'\s+', Text),
- (r'([\w:-]+\s*)(=)(\s*)', bygroups(Name.Attribute, Operator, Text),
- 'attr'),
- (r'[\w:-]+', Name.Attribute),
- (r'(/?)(\s*)(>)', bygroups(Punctuation, Text, Punctuation), '#pop'),
- ],
- 'script-content': [
- (r'(<)(\s*)(/)(\s*)(script)(\s*)(>)',
- bygroups(Punctuation, Text, Punctuation, Text, Name.Tag, Text,
- Punctuation), '#pop'),
- (r'.+?(?=<\s*/\s*script\s*>)', using(JavascriptLexer)),
- ],
- 'style-content': [
- (r'(<)(\s*)(/)(\s*)(style)(\s*)(>)',
- bygroups(Punctuation, Text, Punctuation, Text, Name.Tag, Text,
- Punctuation),'#pop'),
- (r'.+?(?=<\s*/\s*style\s*>)', using(CssLexer)),
- ],
- 'attr': [
- ('".*?"', String, '#pop'),
- ("'.*?'", String, '#pop'),
- (r'[^\s>]+', String, '#pop'),
- ],
- }
-
- def analyse_text(text):
- if html_doctype_matches(text):
- return 0.5
-
-
-class DtdLexer(RegexLexer):
- """
- A lexer for DTDs (Document Type Definitions).
-
- .. versionadded:: 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).
- """
-
- flags = re.MULTILINE | re.DOTALL | re.UNICODE
-
- name = 'XML'
- aliases = ['xml']
- filenames = ['*.xml', '*.xsl', '*.rss', '*.xslt', '*.xsd',
- '*.wsdl', '*.wsf']
- mimetypes = ['text/xml', 'application/xml', 'image/svg+xml',
- 'application/rss+xml', 'application/atom+xml']
-
- tokens = {
- 'root': [
- ('[^<&]+', Text),
- (r'&\S*?;', Name.Entity),
- (r'\<\!\[CDATA\[.*?\]\]\>', Comment.Preproc),
- ('<!--', Comment, 'comment'),
- (r'<\?.*?\?>', Comment.Preproc),
- ('<![^>]*>', Comment.Preproc),
- (r'<\s*[\w:.-]+', Name.Tag, 'tag'),
- (r'<\s*/\s*[\w:.-]+\s*>', Name.Tag),
- ],
- 'comment': [
- ('[^-]+', Comment),
- ('-->', Comment, '#pop'),
- ('-', Comment),
- ],
- 'tag': [
- (r'\s+', Text),
- (r'[\w.:-]+\s*=', Name.Attribute, 'attr'),
- (r'/?\s*>', Name.Tag, '#pop'),
- ],
- 'attr': [
- (r'\s+', Text),
- ('".*?"', String, '#pop'),
- ("'.*?'", String, '#pop'),
- (r'[^\s>]+', String, '#pop'),
- ],
- }
-
- def analyse_text(text):
- if looks_like_xml(text):
- return 0.45 # less than HTML
-
-
-class XsltLexer(XmlLexer):
- """
- A lexer for XSLT.
-
- .. versionadded:: 0.10
- """
-
- name = 'XSLT'
- aliases = ['xslt']
- filenames = ['*.xsl', '*.xslt', '*.xpl'] # xpl is XProc
- mimetypes = ['application/xsl+xml', 'application/xslt+xml']
-
- EXTRA_KEYWORDS = set((
- 'apply-imports', 'apply-templates', 'attribute',
- 'attribute-set', 'call-template', 'choose', 'comment',
- 'copy', 'copy-of', 'decimal-format', 'element', 'fallback',
- 'for-each', 'if', 'import', 'include', 'key', 'message',
- 'namespace-alias', 'number', 'otherwise', 'output', 'param',
- 'preserve-space', 'processing-instruction', 'sort',
- 'strip-space', 'stylesheet', 'template', 'text', 'transform',
- 'value-of', 'variable', 'when', 'with-param'
- ))
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in XmlLexer.get_tokens_unprocessed(self, text):
- m = re.match('</?xsl:([^>]*)/?>?', value)
-
- if token is Name.Tag and m and m.group(1) in self.EXTRA_KEYWORDS:
- yield index, Keyword, value
- else:
- yield index, token, value
-
- def analyse_text(text):
- if looks_like_xml(text) and '<xsl' in text:
- return 0.8
-
-
-class HamlLexer(ExtendedRegexLexer):
- """
- For Haml markup.
-
- .. versionadded:: 1.3
- """
-
- name = 'Haml'
- aliases = ['haml']
- filenames = ['*.haml']
- mimetypes = ['text/x-haml']
-
- flags = re.IGNORECASE
- # Haml can include " |\n" anywhere,
- # which is ignored and used to wrap long lines.
- # To accomodate this, use this custom faux dot instead.
- _dot = r'(?: \|\n(?=.* \|)|.)'
-
- # In certain places, a comma at the end of the line
- # allows line wrapping as well.
- _comma_dot = r'(?:,\s*\n|' + _dot + ')'
- tokens = {
- 'root': [
- (r'[ \t]*\n', Text),
- (r'[ \t]*', _indentation),
- ],
-
- 'css': [
- (r'\.[\w:-]+', Name.Class, 'tag'),
- (r'\#[\w:-]+', Name.Function, 'tag'),
- ],
-
- 'eval-or-plain': [
- (r'[&!]?==', Punctuation, 'plain'),
- (r'([&!]?[=~])(' + _comma_dot + r'*\n)',
- bygroups(Punctuation, using(RubyLexer)),
- 'root'),
- default('plain'),
- ],
-
- 'content': [
- include('css'),
- (r'%[\w:-]+', Name.Tag, 'tag'),
- (r'!!!' + _dot + r'*\n', Name.Namespace, '#pop'),
- (r'(/)(\[' + _dot + r'*?\])(' + _dot + r'*\n)',
- bygroups(Comment, Comment.Special, Comment),
- '#pop'),
- (r'/' + _dot + r'*\n', _starts_block(Comment, 'html-comment-block'),
- '#pop'),
- (r'-#' + _dot + r'*\n', _starts_block(Comment.Preproc,
- 'haml-comment-block'), '#pop'),
- (r'(-)(' + _comma_dot + r'*\n)',
- bygroups(Punctuation, using(RubyLexer)),
- '#pop'),
- (r':' + _dot + r'*\n', _starts_block(Name.Decorator, 'filter-block'),
- '#pop'),
- include('eval-or-plain'),
- ],
-
- 'tag': [
- include('css'),
- (r'\{(,\n|' + _dot + r')*?\}', using(RubyLexer)),
- (r'\[' + _dot + r'*?\]', using(RubyLexer)),
- (r'\(', Text, 'html-attributes'),
- (r'/[ \t]*\n', Punctuation, '#pop:2'),
- (r'[<>]{1,2}(?=[ \t=])', Punctuation),
- include('eval-or-plain'),
- ],
-
- 'plain': [
- (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Text),
- (r'(#\{)(' + _dot + r'*?)(\})',
- bygroups(String.Interpol, using(RubyLexer), String.Interpol)),
- (r'\n', Text, 'root'),
- ],
-
- 'html-attributes': [
- (r'\s+', Text),
- (r'[\w:-]+[ \t]*=', Name.Attribute, 'html-attribute-value'),
- (r'[\w:-]+', Name.Attribute),
- (r'\)', Text, '#pop'),
- ],
-
- 'html-attribute-value': [
- (r'[ \t]+', Text),
- (r'\w+', Name.Variable, '#pop'),
- (r'@\w+', Name.Variable.Instance, '#pop'),
- (r'\$\w+', Name.Variable.Global, '#pop'),
- (r"'(\\\\|\\'|[^'\n])*'", String, '#pop'),
- (r'"(\\\\|\\"|[^"\n])*"', String, '#pop'),
- ],
-
- 'html-comment-block': [
- (_dot + '+', Comment),
- (r'\n', Text, 'root'),
- ],
-
- 'haml-comment-block': [
- (_dot + '+', Comment.Preproc),
- (r'\n', Text, 'root'),
- ],
-
- 'filter-block': [
- (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Name.Decorator),
- (r'(#\{)(' + _dot + r'*?)(\})',
- bygroups(String.Interpol, using(RubyLexer), String.Interpol)),
- (r'\n', Text, 'root'),
- ],
- }
-
-
-class ScamlLexer(ExtendedRegexLexer):
- """
- For `Scaml markup <http://scalate.fusesource.org/>`_. Scaml is Haml for Scala.
-
- .. versionadded:: 1.4
- """
-
- name = 'Scaml'
- aliases = ['scaml']
- filenames = ['*.scaml']
- mimetypes = ['text/x-scaml']
-
- flags = re.IGNORECASE
- # Scaml does not yet support the " |\n" notation to
- # wrap long lines. Once it does, use the custom faux
- # dot instead.
- # _dot = r'(?: \|\n(?=.* \|)|.)'
- _dot = r'.'
-
- tokens = {
- 'root': [
- (r'[ \t]*\n', Text),
- (r'[ \t]*', _indentation),
- ],
-
- 'css': [
- (r'\.[\w:-]+', Name.Class, 'tag'),
- (r'\#[\w:-]+', Name.Function, 'tag'),
- ],
-
- 'eval-or-plain': [
- (r'[&!]?==', Punctuation, 'plain'),
- (r'([&!]?[=~])(' + _dot + r'*\n)',
- bygroups(Punctuation, using(ScalaLexer)),
- 'root'),
- default('plain'),
- ],
-
- 'content': [
- include('css'),
- (r'%[\w:-]+', Name.Tag, 'tag'),
- (r'!!!' + _dot + r'*\n', Name.Namespace, '#pop'),
- (r'(/)(\[' + _dot + r'*?\])(' + _dot + r'*\n)',
- bygroups(Comment, Comment.Special, Comment),
- '#pop'),
- (r'/' + _dot + r'*\n', _starts_block(Comment, 'html-comment-block'),
- '#pop'),
- (r'-#' + _dot + r'*\n', _starts_block(Comment.Preproc,
- 'scaml-comment-block'), '#pop'),
- (r'(-@\s*)(import)?(' + _dot + r'*\n)',
- bygroups(Punctuation, Keyword, using(ScalaLexer)),
- '#pop'),
- (r'(-)(' + _dot + r'*\n)',
- bygroups(Punctuation, using(ScalaLexer)),
- '#pop'),
- (r':' + _dot + r'*\n', _starts_block(Name.Decorator, 'filter-block'),
- '#pop'),
- include('eval-or-plain'),
- ],
-
- 'tag': [
- include('css'),
- (r'\{(,\n|' + _dot + r')*?\}', using(ScalaLexer)),
- (r'\[' + _dot + r'*?\]', using(ScalaLexer)),
- (r'\(', Text, 'html-attributes'),
- (r'/[ \t]*\n', Punctuation, '#pop:2'),
- (r'[<>]{1,2}(?=[ \t=])', Punctuation),
- include('eval-or-plain'),
- ],
-
- 'plain': [
- (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Text),
- (r'(#\{)(' + _dot + r'*?)(\})',
- bygroups(String.Interpol, using(ScalaLexer), String.Interpol)),
- (r'\n', Text, 'root'),
- ],
-
- 'html-attributes': [
- (r'\s+', Text),
- (r'[\w:-]+[ \t]*=', Name.Attribute, 'html-attribute-value'),
- (r'[\w:-]+', Name.Attribute),
- (r'\)', Text, '#pop'),
- ],
-
- 'html-attribute-value': [
- (r'[ \t]+', Text),
- (r'\w+', Name.Variable, '#pop'),
- (r'@\w+', Name.Variable.Instance, '#pop'),
- (r'\$\w+', Name.Variable.Global, '#pop'),
- (r"'(\\\\|\\'|[^'\n])*'", String, '#pop'),
- (r'"(\\\\|\\"|[^"\n])*"', String, '#pop'),
- ],
-
- 'html-comment-block': [
- (_dot + '+', Comment),
- (r'\n', Text, 'root'),
- ],
-
- 'scaml-comment-block': [
- (_dot + '+', Comment.Preproc),
- (r'\n', Text, 'root'),
- ],
-
- 'filter-block': [
- (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Name.Decorator),
- (r'(#\{)(' + _dot + r'*?)(\})',
- bygroups(String.Interpol, using(ScalaLexer), String.Interpol)),
- (r'\n', Text, 'root'),
- ],
- }
-
-
-class PugLexer(ExtendedRegexLexer):
- """
- For Pug markup.
- Pug is a variant of Scaml, see:
- http://scalate.fusesource.org/documentation/scaml-reference.html
-
- .. versionadded:: 1.4
- """
-
- name = 'Pug'
- aliases = ['pug', 'jade']
- filenames = ['*.pug', '*.jade']
- mimetypes = ['text/x-pug', 'text/x-jade']
-
- flags = re.IGNORECASE
- _dot = r'.'
-
- tokens = {
- 'root': [
- (r'[ \t]*\n', Text),
- (r'[ \t]*', _indentation),
- ],
-
- 'css': [
- (r'\.[\w:-]+', Name.Class, 'tag'),
- (r'\#[\w:-]+', Name.Function, 'tag'),
- ],
-
- 'eval-or-plain': [
- (r'[&!]?==', Punctuation, 'plain'),
- (r'([&!]?[=~])(' + _dot + r'*\n)',
- bygroups(Punctuation, using(ScalaLexer)), 'root'),
- default('plain'),
- ],
-
- 'content': [
- include('css'),
- (r'!!!' + _dot + r'*\n', Name.Namespace, '#pop'),
- (r'(/)(\[' + _dot + r'*?\])(' + _dot + r'*\n)',
- bygroups(Comment, Comment.Special, Comment),
- '#pop'),
- (r'/' + _dot + r'*\n', _starts_block(Comment, 'html-comment-block'),
- '#pop'),
- (r'-#' + _dot + r'*\n', _starts_block(Comment.Preproc,
- 'scaml-comment-block'), '#pop'),
- (r'(-@\s*)(import)?(' + _dot + r'*\n)',
- bygroups(Punctuation, Keyword, using(ScalaLexer)),
- '#pop'),
- (r'(-)(' + _dot + r'*\n)',
- bygroups(Punctuation, using(ScalaLexer)),
- '#pop'),
- (r':' + _dot + r'*\n', _starts_block(Name.Decorator, 'filter-block'),
- '#pop'),
- (r'[\w:-]+', Name.Tag, 'tag'),
- (r'\|', Text, 'eval-or-plain'),
- ],
-
- 'tag': [
- include('css'),
- (r'\{(,\n|' + _dot + r')*?\}', using(ScalaLexer)),
- (r'\[' + _dot + r'*?\]', using(ScalaLexer)),
- (r'\(', Text, 'html-attributes'),
- (r'/[ \t]*\n', Punctuation, '#pop:2'),
- (r'[<>]{1,2}(?=[ \t=])', Punctuation),
- include('eval-or-plain'),
- ],
-
- 'plain': [
- (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Text),
- (r'(#\{)(' + _dot + r'*?)(\})',
- bygroups(String.Interpol, using(ScalaLexer), String.Interpol)),
- (r'\n', Text, 'root'),
- ],
-
- 'html-attributes': [
- (r'\s+', Text),
- (r'[\w:-]+[ \t]*=', Name.Attribute, 'html-attribute-value'),
- (r'[\w:-]+', Name.Attribute),
- (r'\)', Text, '#pop'),
- ],
-
- 'html-attribute-value': [
- (r'[ \t]+', Text),
- (r'\w+', Name.Variable, '#pop'),
- (r'@\w+', Name.Variable.Instance, '#pop'),
- (r'\$\w+', Name.Variable.Global, '#pop'),
- (r"'(\\\\|\\'|[^'\n])*'", String, '#pop'),
- (r'"(\\\\|\\"|[^"\n])*"', String, '#pop'),
- ],
-
- 'html-comment-block': [
- (_dot + '+', Comment),
- (r'\n', Text, 'root'),
- ],
-
- 'scaml-comment-block': [
- (_dot + '+', Comment.Preproc),
- (r'\n', Text, 'root'),
- ],
-
- 'filter-block': [
- (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Name.Decorator),
- (r'(#\{)(' + _dot + r'*?)(\})',
- bygroups(String.Interpol, using(ScalaLexer), String.Interpol)),
- (r'\n', Text, 'root'),
- ],
- }
-JadeLexer = PugLexer # compat
diff --git a/pygments/lexers/idl.py b/pygments/lexers/idl.py
deleted file mode 100644
index 292f2de7..00000000
--- a/pygments/lexers/idl.py
+++ /dev/null
@@ -1,270 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.idl
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for IDL.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, Number, String
-
-__all__ = ['IDLLexer']
-
-
-class IDLLexer(RegexLexer):
- """
- Pygments Lexer for IDL (Interactive Data Language).
-
- .. versionadded:: 1.6
- """
- name = 'IDL'
- aliases = ['idl']
- filenames = ['*.pro']
- mimetypes = ['text/idl']
-
- flags = re.IGNORECASE | re.MULTILINE
-
- _RESERVED = (
- 'and', 'begin', 'break', 'case', 'common', 'compile_opt',
- 'continue', 'do', 'else', 'end', 'endcase', 'elseelse',
- 'endfor', 'endforeach', 'endif', 'endrep', 'endswitch',
- 'endwhile', 'eq', 'for', 'foreach', 'forward_function',
- 'function', 'ge', 'goto', 'gt', 'if', 'inherits', 'le',
- 'lt', 'mod', 'ne', 'not', 'of', 'on_ioerror', 'or', 'pro',
- 'repeat', 'switch', 'then', 'until', 'while', 'xor')
- """Reserved words from: http://www.exelisvis.com/docs/reswords.html"""
-
- _BUILTIN_LIB = (
- 'abs', 'acos', 'adapt_hist_equal', 'alog', 'alog10',
- 'amoeba', 'annotate', 'app_user_dir', 'app_user_dir_query',
- 'arg_present', 'array_equal', 'array_indices', 'arrow',
- 'ascii_template', 'asin', 'assoc', 'atan', 'axis',
- 'a_correlate', 'bandpass_filter', 'bandreject_filter',
- 'barplot', 'bar_plot', 'beseli', 'beselj', 'beselk',
- 'besely', 'beta', 'bilinear', 'binary_template', 'bindgen',
- 'binomial', 'bin_date', 'bit_ffs', 'bit_population',
- 'blas_axpy', 'blk_con', 'box_cursor', 'breakpoint',
- 'broyden', 'butterworth', 'bytarr', 'byte', 'byteorder',
- 'bytscl', 'caldat', 'calendar', 'call_external',
- 'call_function', 'call_method', 'call_procedure', 'canny',
- 'catch', 'cd', r'cdf_\w*', 'ceil', 'chebyshev',
- 'check_math',
- 'chisqr_cvf', 'chisqr_pdf', 'choldc', 'cholsol', 'cindgen',
- 'cir_3pnt', 'close', 'cluster', 'cluster_tree', 'clust_wts',
- 'cmyk_convert', 'colorbar', 'colorize_sample',
- 'colormap_applicable', 'colormap_gradient',
- 'colormap_rotation', 'colortable', 'color_convert',
- 'color_exchange', 'color_quan', 'color_range_map', 'comfit',
- 'command_line_args', 'complex', 'complexarr', 'complexround',
- 'compute_mesh_normals', 'cond', 'congrid', 'conj',
- 'constrained_min', 'contour', 'convert_coord', 'convol',
- 'convol_fft', 'coord2to3', 'copy_lun', 'correlate', 'cos',
- 'cosh', 'cpu', 'cramer', 'create_cursor', 'create_struct',
- 'create_view', 'crossp', 'crvlength', 'cti_test',
- 'ct_luminance', 'cursor', 'curvefit', 'cvttobm', 'cv_coord',
- 'cw_animate', 'cw_animate_getp', 'cw_animate_load',
- 'cw_animate_run', 'cw_arcball', 'cw_bgroup', 'cw_clr_index',
- 'cw_colorsel', 'cw_defroi', 'cw_field', 'cw_filesel',
- 'cw_form', 'cw_fslider', 'cw_light_editor',
- 'cw_light_editor_get', 'cw_light_editor_set', 'cw_orient',
- 'cw_palette_editor', 'cw_palette_editor_get',
- 'cw_palette_editor_set', 'cw_pdmenu', 'cw_rgbslider',
- 'cw_tmpl', 'cw_zoom', 'c_correlate', 'dblarr', 'db_exists',
- 'dcindgen', 'dcomplex', 'dcomplexarr', 'define_key',
- 'define_msgblk', 'define_msgblk_from_file', 'defroi',
- 'defsysv', 'delvar', 'dendrogram', 'dendro_plot', 'deriv',
- 'derivsig', 'determ', 'device', 'dfpmin', 'diag_matrix',
- 'dialog_dbconnect', 'dialog_message', 'dialog_pickfile',
- 'dialog_printersetup', 'dialog_printjob',
- 'dialog_read_image', 'dialog_write_image', 'digital_filter',
- 'dilate', 'dindgen', 'dissolve', 'dist', 'distance_measure',
- 'dlm_load', 'dlm_register', 'doc_library', 'double',
- 'draw_roi', 'edge_dog', 'efont', 'eigenql', 'eigenvec',
- 'ellipse', 'elmhes', 'emboss', 'empty', 'enable_sysrtn',
- 'eof', r'eos_\w*', 'erase', 'erf', 'erfc', 'erfcx',
- 'erode', 'errorplot', 'errplot', 'estimator_filter',
- 'execute', 'exit', 'exp', 'expand', 'expand_path', 'expint',
- 'extrac', 'extract_slice', 'factorial', 'fft', 'filepath',
- 'file_basename', 'file_chmod', 'file_copy', 'file_delete',
- 'file_dirname', 'file_expand_path', 'file_info',
- 'file_lines', 'file_link', 'file_mkdir', 'file_move',
- 'file_poll_input', 'file_readlink', 'file_same',
- 'file_search', 'file_test', 'file_which', 'findgen',
- 'finite', 'fix', 'flick', 'float', 'floor', 'flow3',
- 'fltarr', 'flush', 'format_axis_values', 'free_lun',
- 'fstat', 'fulstr', 'funct', 'fv_test', 'fx_root',
- 'fz_roots', 'f_cvf', 'f_pdf', 'gamma', 'gamma_ct',
- 'gauss2dfit', 'gaussfit', 'gaussian_function', 'gaussint',
- 'gauss_cvf', 'gauss_pdf', 'gauss_smooth', 'getenv',
- 'getwindows', 'get_drive_list', 'get_dxf_objects',
- 'get_kbrd', 'get_login_info', 'get_lun', 'get_screen_size',
- 'greg2jul', r'grib_\w*', 'grid3', 'griddata',
- 'grid_input', 'grid_tps', 'gs_iter',
- r'h5[adfgirst]_\w*', 'h5_browser', 'h5_close',
- 'h5_create', 'h5_get_libversion', 'h5_open', 'h5_parse',
- 'hanning', 'hash', r'hdf_\w*', 'heap_free',
- 'heap_gc', 'heap_nosave', 'heap_refcount', 'heap_save',
- 'help', 'hilbert', 'histogram', 'hist_2d', 'hist_equal',
- 'hls', 'hough', 'hqr', 'hsv', 'h_eq_ct', 'h_eq_int',
- 'i18n_multibytetoutf8', 'i18n_multibytetowidechar',
- 'i18n_utf8tomultibyte', 'i18n_widechartomultibyte',
- 'ibeta', 'icontour', 'iconvertcoord', 'idelete', 'identity',
- 'idlexbr_assistant', 'idlitsys_createtool', 'idl_base64',
- 'idl_validname', 'iellipse', 'igamma', 'igetcurrent',
- 'igetdata', 'igetid', 'igetproperty', 'iimage', 'image',
- 'image_cont', 'image_statistics', 'imaginary', 'imap',
- 'indgen', 'intarr', 'interpol', 'interpolate',
- 'interval_volume', 'int_2d', 'int_3d', 'int_tabulated',
- 'invert', 'ioctl', 'iopen', 'iplot', 'ipolygon',
- 'ipolyline', 'iputdata', 'iregister', 'ireset', 'iresolve',
- 'irotate', 'ir_filter', 'isa', 'isave', 'iscale',
- 'isetcurrent', 'isetproperty', 'ishft', 'isocontour',
- 'isosurface', 'isurface', 'itext', 'itranslate', 'ivector',
- 'ivolume', 'izoom', 'i_beta', 'journal', 'json_parse',
- 'json_serialize', 'jul2greg', 'julday', 'keyword_set',
- 'krig2d', 'kurtosis', 'kw_test', 'l64indgen', 'label_date',
- 'label_region', 'ladfit', 'laguerre', 'laplacian',
- 'la_choldc', 'la_cholmprove', 'la_cholsol', 'la_determ',
- 'la_eigenproblem', 'la_eigenql', 'la_eigenvec', 'la_elmhes',
- 'la_gm_linear_model', 'la_hqr', 'la_invert',
- 'la_least_squares', 'la_least_square_equality',
- 'la_linear_equation', 'la_ludc', 'la_lumprove', 'la_lusol',
- 'la_svd', 'la_tridc', 'la_trimprove', 'la_triql',
- 'la_trired', 'la_trisol', 'least_squares_filter', 'leefilt',
- 'legend', 'legendre', 'linbcg', 'lindgen', 'linfit',
- 'linkimage', 'list', 'll_arc_distance', 'lmfit', 'lmgr',
- 'lngamma', 'lnp_test', 'loadct', 'locale_get',
- 'logical_and', 'logical_or', 'logical_true', 'lon64arr',
- 'lonarr', 'long', 'long64', 'lsode', 'ludc', 'lumprove',
- 'lusol', 'lu_complex', 'machar', 'make_array', 'make_dll',
- 'make_rt', 'map', 'mapcontinents', 'mapgrid', 'map_2points',
- 'map_continents', 'map_grid', 'map_image', 'map_patch',
- 'map_proj_forward', 'map_proj_image', 'map_proj_info',
- 'map_proj_init', 'map_proj_inverse', 'map_set',
- 'matrix_multiply', 'matrix_power', 'max', 'md_test',
- 'mean', 'meanabsdev', 'mean_filter', 'median', 'memory',
- 'mesh_clip', 'mesh_decimate', 'mesh_issolid', 'mesh_merge',
- 'mesh_numtriangles', 'mesh_obj', 'mesh_smooth',
- 'mesh_surfacearea', 'mesh_validate', 'mesh_volume',
- 'message', 'min', 'min_curve_surf', 'mk_html_help',
- 'modifyct', 'moment', 'morph_close', 'morph_distance',
- 'morph_gradient', 'morph_hitormiss', 'morph_open',
- 'morph_thin', 'morph_tophat', 'multi', 'm_correlate',
- r'ncdf_\w*', 'newton', 'noise_hurl', 'noise_pick',
- 'noise_scatter', 'noise_slur', 'norm', 'n_elements',
- 'n_params', 'n_tags', 'objarr', 'obj_class', 'obj_destroy',
- 'obj_hasmethod', 'obj_isa', 'obj_new', 'obj_valid',
- 'online_help', 'on_error', 'open', 'oplot', 'oploterr',
- 'parse_url', 'particle_trace', 'path_cache', 'path_sep',
- 'pcomp', 'plot', 'plot3d', 'ploterr', 'plots', 'plot_3dbox',
- 'plot_field', 'pnt_line', 'point_lun', 'polarplot',
- 'polar_contour', 'polar_surface', 'poly', 'polyfill',
- 'polyfillv', 'polygon', 'polyline', 'polyshade', 'polywarp',
- 'poly_2d', 'poly_area', 'poly_fit', 'popd', 'powell',
- 'pref_commit', 'pref_get', 'pref_set', 'prewitt', 'primes',
- 'print', 'printd', 'product', 'profile', 'profiler',
- 'profiles', 'project_vol', 'psafm', 'pseudo',
- 'ps_show_fonts', 'ptrarr', 'ptr_free', 'ptr_new',
- 'ptr_valid', 'pushd', 'p_correlate', 'qgrid3', 'qhull',
- 'qromb', 'qromo', 'qsimp', 'query_ascii', 'query_bmp',
- 'query_csv', 'query_dicom', 'query_gif', 'query_image',
- 'query_jpeg', 'query_jpeg2000', 'query_mrsid', 'query_pict',
- 'query_png', 'query_ppm', 'query_srf', 'query_tiff',
- 'query_wav', 'radon', 'randomn', 'randomu', 'ranks',
- 'rdpix', 'read', 'reads', 'readu', 'read_ascii',
- 'read_binary', 'read_bmp', 'read_csv', 'read_dicom',
- 'read_gif', 'read_image', 'read_interfile', 'read_jpeg',
- 'read_jpeg2000', 'read_mrsid', 'read_pict', 'read_png',
- 'read_ppm', 'read_spr', 'read_srf', 'read_sylk',
- 'read_tiff', 'read_wav', 'read_wave', 'read_x11_bitmap',
- 'read_xwd', 'real_part', 'rebin', 'recall_commands',
- 'recon3', 'reduce_colors', 'reform', 'region_grow',
- 'register_cursor', 'regress', 'replicate',
- 'replicate_inplace', 'resolve_all', 'resolve_routine',
- 'restore', 'retall', 'return', 'reverse', 'rk4', 'roberts',
- 'rot', 'rotate', 'round', 'routine_filepath',
- 'routine_info', 'rs_test', 'r_correlate', 'r_test',
- 'save', 'savgol', 'scale3', 'scale3d', 'scope_level',
- 'scope_traceback', 'scope_varfetch', 'scope_varname',
- 'search2d', 'search3d', 'sem_create', 'sem_delete',
- 'sem_lock', 'sem_release', 'setenv', 'set_plot',
- 'set_shading', 'sfit', 'shade_surf', 'shade_surf_irr',
- 'shade_volume', 'shift', 'shift_diff', 'shmdebug', 'shmmap',
- 'shmunmap', 'shmvar', 'show3', 'showfont', 'simplex', 'sin',
- 'sindgen', 'sinh', 'size', 'skewness', 'skip_lun',
- 'slicer3', 'slide_image', 'smooth', 'sobel', 'socket',
- 'sort', 'spawn', 'spher_harm', 'sph_4pnt', 'sph_scat',
- 'spline', 'spline_p', 'spl_init', 'spl_interp', 'sprsab',
- 'sprsax', 'sprsin', 'sprstp', 'sqrt', 'standardize',
- 'stddev', 'stop', 'strarr', 'strcmp', 'strcompress',
- 'streamline', 'stregex', 'stretch', 'string', 'strjoin',
- 'strlen', 'strlowcase', 'strmatch', 'strmessage', 'strmid',
- 'strpos', 'strput', 'strsplit', 'strtrim', 'struct_assign',
- 'struct_hide', 'strupcase', 'surface', 'surfr', 'svdc',
- 'svdfit', 'svsol', 'swap_endian', 'swap_endian_inplace',
- 'symbol', 'systime', 's_test', 't3d', 'tag_names', 'tan',
- 'tanh', 'tek_color', 'temporary', 'tetra_clip',
- 'tetra_surface', 'tetra_volume', 'text', 'thin', 'threed',
- 'timegen', 'time_test2', 'tm_test', 'total', 'trace',
- 'transpose', 'triangulate', 'trigrid', 'triql', 'trired',
- 'trisol', 'tri_surf', 'truncate_lun', 'ts_coef', 'ts_diff',
- 'ts_fcast', 'ts_smooth', 'tv', 'tvcrs', 'tvlct', 'tvrd',
- 'tvscl', 'typename', 't_cvt', 't_pdf', 'uindgen', 'uint',
- 'uintarr', 'ul64indgen', 'ulindgen', 'ulon64arr', 'ulonarr',
- 'ulong', 'ulong64', 'uniq', 'unsharp_mask', 'usersym',
- 'value_locate', 'variance', 'vector', 'vector_field', 'vel',
- 'velovect', 'vert_t3d', 'voigt', 'voronoi', 'voxel_proj',
- 'wait', 'warp_tri', 'watershed', 'wdelete', 'wf_draw',
- 'where', 'widget_base', 'widget_button', 'widget_combobox',
- 'widget_control', 'widget_displaycontextmen', 'widget_draw',
- 'widget_droplist', 'widget_event', 'widget_info',
- 'widget_label', 'widget_list', 'widget_propertysheet',
- 'widget_slider', 'widget_tab', 'widget_table',
- 'widget_text', 'widget_tree', 'widget_tree_move',
- 'widget_window', 'wiener_filter', 'window', 'writeu',
- 'write_bmp', 'write_csv', 'write_gif', 'write_image',
- 'write_jpeg', 'write_jpeg2000', 'write_nrif', 'write_pict',
- 'write_png', 'write_ppm', 'write_spr', 'write_srf',
- 'write_sylk', 'write_tiff', 'write_wav', 'write_wave',
- 'wset', 'wshow', 'wtn', 'wv_applet', 'wv_cwt',
- 'wv_cw_wavelet', 'wv_denoise', 'wv_dwt', 'wv_fn_coiflet',
- 'wv_fn_daubechies', 'wv_fn_gaussian', 'wv_fn_haar',
- 'wv_fn_morlet', 'wv_fn_paul', 'wv_fn_symlet',
- 'wv_import_data', 'wv_import_wavelet', 'wv_plot3d_wps',
- 'wv_plot_multires', 'wv_pwt', 'wv_tool_denoise',
- 'xbm_edit', 'xdisplayfile', 'xdxf', 'xfont',
- 'xinteranimate', 'xloadct', 'xmanager', 'xmng_tmpl',
- 'xmtool', 'xobjview', 'xobjview_rotate',
- 'xobjview_write_image', 'xpalette', 'xpcolor', 'xplot3d',
- 'xregistered', 'xroi', 'xsq_test', 'xsurface', 'xvaredit',
- 'xvolume', 'xvolume_rotate', 'xvolume_write_image',
- 'xyouts', 'zoom', 'zoom_24')
- """Functions from: http://www.exelisvis.com/docs/routines-1.html"""
-
- tokens = {
- 'root': [
- (r'^\s*;.*?\n', Comment.Single),
- (words(_RESERVED, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(_BUILTIN_LIB, prefix=r'\b', suffix=r'\b'), Name.Builtin),
- (r'\+=|-=|\^=|\*=|/=|#=|##=|<=|>=|=', Operator),
- (r'\+\+|--|->|\+|-|##|#|\*|/|<|>|&&|\^|~|\|\|\?|:', Operator),
- (r'\b(mod=|lt=|le=|eq=|ne=|ge=|gt=|not=|and=|or=|xor=)', Operator),
- (r'\b(mod|lt|le|eq|ne|ge|gt|not|and|or|xor)\b', Operator),
- (r'"[^\"]*"', String.Double),
- (r"'[^\']*'", String.Single),
- (r'\b[+\-]?([0-9]*\.[0-9]+|[0-9]+\.[0-9]*)(D|E)?([+\-]?[0-9]+)?\b',
- Number.Float),
- (r'\b\'[+\-]?[0-9A-F]+\'X(U?(S?|L{1,2})|B)\b', Number.Hex),
- (r'\b\'[+\-]?[0-7]+\'O(U?(S?|L{1,2})|B)\b', Number.Oct),
- (r'\b[+\-]?[0-9]+U?L{1,2}\b', Number.Integer.Long),
- (r'\b[+\-]?[0-9]+U?S?\b', Number.Integer),
- (r'\b[+\-]?[0-9]+B\b', Number),
- (r'.', Text),
- ]
- }
diff --git a/pygments/lexers/igor.py b/pygments/lexers/igor.py
deleted file mode 100644
index f4a22e1e..00000000
--- a/pygments/lexers/igor.py
+++ /dev/null
@@ -1,425 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.igor
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Igor Pro.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, words
-from pygments.token import Text, Comment, Keyword, Name, String
-
-__all__ = ['IgorLexer']
-
-
-class IgorLexer(RegexLexer):
- """
- Pygments Lexer for Igor Pro procedure files (.ipf).
- See http://www.wavemetrics.com/ and http://www.igorexchange.com/.
-
- .. versionadded:: 2.0
- """
-
- name = 'Igor'
- aliases = ['igor', 'igorpro']
- filenames = ['*.ipf']
- mimetypes = ['text/ipf']
-
- flags = re.IGNORECASE | re.MULTILINE
-
- flowControl = (
- 'if', 'else', 'elseif', 'endif', 'for', 'endfor', 'strswitch', 'switch',
- 'case', 'default', 'endswitch', 'do', 'while', 'try', 'catch', 'endtry',
- 'break', 'continue', 'return', 'AbortOnRTE', 'AbortOnValue'
- )
- types = (
- 'variable', 'string', 'constant', 'strconstant', 'NVAR', 'SVAR', 'WAVE',
- 'STRUCT', 'dfref', 'funcref', 'char', 'uchar', 'int16', 'uint16', 'int32',
- 'uint32', 'int64', 'uint64', 'float', 'double'
- )
- keywords = (
- 'override', 'ThreadSafe', 'MultiThread', 'static', 'Proc',
- 'Picture', 'Prompt', 'DoPrompt', 'macro', 'window', 'function', 'end',
- 'Structure', 'EndStructure', 'EndMacro', 'Menu', 'SubMenu'
- )
- operations = (
- 'Abort', 'AddFIFOData', 'AddFIFOVectData', 'AddMovieAudio', 'AddMovieFrame',
- 'AddWavesToBoxPlot', 'AddWavesToViolinPlot', 'AdoptFiles', 'APMath', 'Append',
- 'AppendBoxPlot', 'AppendImage', 'AppendLayoutObject', 'AppendMatrixContour',
- 'AppendText', 'AppendToGizmo', 'AppendToGraph', 'AppendToLayout', 'AppendToTable',
- 'AppendViolinPlot', 'AppendXYZContour', 'AutoPositionWindow',
- 'AxonTelegraphFindServers', 'BackgroundInfo', 'Beep', 'BoundingBall', 'BoxSmooth',
- 'BrowseURL', 'BuildMenu', 'Button', 'cd', 'Chart', 'CheckBox', 'CheckDisplayed',
- 'ChooseColor', 'Close', 'CloseHelp', 'CloseMovie', 'CloseProc', 'ColorScale',
- 'ColorTab2Wave', 'Concatenate', 'ControlBar', 'ControlInfo', 'ControlUpdate',
- 'ConvertGlobalStringTextEncoding', 'ConvexHull', 'Convolve', 'CopyDimLabels',
- 'CopyFile', 'CopyFolder', 'CopyScales', 'Correlate', 'CreateAliasShortcut',
- 'CreateBrowser', 'Cross', 'CtrlBackground', 'CtrlFIFO', 'CtrlNamedBackground',
- 'Cursor', 'CurveFit', 'CustomControl', 'CWT', 'DAQmx_AI_SetupReader',
- 'DAQmx_AO_SetOutputs', 'DAQmx_CTR_CountEdges', 'DAQmx_CTR_OutputPulse',
- 'DAQmx_CTR_Period', 'DAQmx_CTR_PulseWidth', 'DAQmx_DIO_Config',
- 'DAQmx_DIO_WriteNewData', 'DAQmx_Scan', 'DAQmx_WaveformGen', 'Debugger',
- 'DebuggerOptions', 'DefaultFont', 'DefaultGuiControls', 'DefaultGuiFont',
- 'DefaultTextEncoding', 'DefineGuide', 'DelayUpdate', 'DeleteAnnotations',
- 'DeleteFile', 'DeleteFolder', 'DeletePoints', 'Differentiate', 'dir', 'Display',
- 'DisplayHelpTopic', 'DisplayProcedure', 'DoAlert', 'DoIgorMenu', 'DoUpdate',
- 'DoWindow', 'DoXOPIdle', 'DPSS', 'DrawAction', 'DrawArc', 'DrawBezier',
- 'DrawLine', 'DrawOval', 'DrawPICT', 'DrawPoly', 'DrawRect', 'DrawRRect',
- 'DrawText', 'DrawUserShape', 'DSPDetrend', 'DSPPeriodogram', 'Duplicate',
- 'DuplicateDataFolder', 'DWT', 'EdgeStats', 'Edit', 'ErrorBars',
- 'EstimatePeakSizes', 'Execute', 'ExecuteScriptText', 'ExperimentInfo',
- 'ExperimentModified', 'ExportGizmo', 'Extract', 'FastGaussTransform', 'FastOp',
- 'FBinRead', 'FBinWrite', 'FFT', 'FGetPos', 'FIFOStatus', 'FIFO2Wave', 'FilterFIR',
- 'FilterIIR', 'FindAPeak', 'FindContour', 'FindDuplicates', 'FindLevel',
- 'FindLevels', 'FindPeak', 'FindPointsInPoly', 'FindRoots', 'FindSequence',
- 'FindValue', 'FMaxFlat', 'FPClustering', 'fprintf', 'FReadLine', 'FSetPos',
- 'FStatus', 'FTPCreateDirectory', 'FTPDelete', 'FTPDownload', 'FTPUpload',
- 'FuncFit', 'FuncFitMD', 'GBLoadWave', 'GetAxis', 'GetCamera', 'GetFileFolderInfo',
- 'GetGizmo', 'GetLastUserMenuInfo', 'GetMarquee', 'GetMouse', 'GetSelection',
- 'GetWindow', 'GISCreateVectorLayer', 'GISGetRasterInfo',
- 'GISGetRegisteredFileInfo', 'GISGetVectorLayerInfo', 'GISLoadRasterData',
- 'GISLoadVectorData', 'GISRasterizeVectorData', 'GISRegisterFile',
- 'GISTransformCoords', 'GISUnRegisterFile', 'GISWriteFieldData',
- 'GISWriteGeometryData', 'GISWriteRaster', 'GPIBReadBinaryWave2',
- 'GPIBReadBinary2', 'GPIBReadWave2', 'GPIBRead2', 'GPIBWriteBinaryWave2',
- 'GPIBWriteBinary2', 'GPIBWriteWave2', 'GPIBWrite2', 'GPIB2', 'GraphNormal',
- 'GraphWaveDraw', 'GraphWaveEdit', 'Grep', 'GroupBox', 'Hanning', 'HDFInfo',
- 'HDFReadImage', 'HDFReadSDS', 'HDFReadVset', 'HDF5CloseFile', 'HDF5CloseGroup',
- 'HDF5ConvertColors', 'HDF5CreateFile', 'HDF5CreateGroup', 'HDF5CreateLink',
- 'HDF5Dump', 'HDF5DumpErrors', 'HDF5DumpState', 'HDF5FlushFile',
- 'HDF5ListAttributes', 'HDF5ListGroup', 'HDF5LoadData', 'HDF5LoadGroup',
- 'HDF5LoadImage', 'HDF5OpenFile', 'HDF5OpenGroup', 'HDF5SaveData', 'HDF5SaveGroup',
- 'HDF5SaveImage', 'HDF5TestOperation', 'HDF5UnlinkObject', 'HideIgorMenus',
- 'HideInfo', 'HideProcedures', 'HideTools', 'HilbertTransform', 'Histogram', 'ICA',
- 'IFFT', 'ImageAnalyzeParticles', 'ImageBlend', 'ImageBoundaryToMask',
- 'ImageComposite', 'ImageEdgeDetection', 'ImageFileInfo', 'ImageFilter',
- 'ImageFocus', 'ImageFromXYZ', 'ImageGenerateROIMask', 'ImageGLCM',
- 'ImageHistModification', 'ImageHistogram', 'ImageInterpolate', 'ImageLineProfile',
- 'ImageLoad', 'ImageMorphology', 'ImageRegistration', 'ImageRemoveBackground',
- 'ImageRestore', 'ImageRotate', 'ImageSave', 'ImageSeedFill', 'ImageSkeleton3d',
- 'ImageSnake', 'ImageStats', 'ImageThreshold', 'ImageTransform',
- 'ImageUnwrapPhase', 'ImageWindow', 'IndexSort', 'InsertPoints', 'Integrate',
- 'IntegrateODE', 'Integrate2D', 'Interpolate2', 'Interpolate3D', 'Interp3DPath',
- 'ITCCloseAll2', 'ITCCloseDevice2', 'ITCConfigAllChannels2',
- 'ITCConfigChannelReset2', 'ITCConfigChannelUpload2', 'ITCConfigChannel2',
- 'ITCFIFOAvailableAll2', 'ITCFIFOAvailable2', 'ITCGetAllChannelsConfig2',
- 'ITCGetChannelConfig2', 'ITCGetCurrentDevice2', 'ITCGetDeviceInfo2',
- 'ITCGetDevices2', 'ITCGetErrorString2', 'ITCGetSerialNumber2', 'ITCGetState2',
- 'ITCGetVersions2', 'ITCInitialize2', 'ITCOpenDevice2', 'ITCReadADC2',
- 'ITCReadDigital2', 'ITCReadTimer2', 'ITCSelectDevice2', 'ITCSetDAC2',
- 'ITCSetGlobals2', 'ITCSetModes2', 'ITCSetState2', 'ITCStartAcq2', 'ITCStopAcq2',
- 'ITCUpdateFIFOPositionAll2', 'ITCUpdateFIFOPosition2', 'ITCWriteDigital2',
- 'JCAMPLoadWave', 'JointHistogram', 'KillBackground', 'KillControl',
- 'KillDataFolder', 'KillFIFO', 'KillFreeAxis', 'KillPath', 'KillPICTs',
- 'KillStrings', 'KillVariables', 'KillWaves', 'KillWindow', 'KMeans', 'Label',
- 'Layout', 'LayoutPageAction', 'LayoutSlideShow', 'Legend',
- 'LinearFeedbackShiftRegister', 'ListBox', 'LoadData', 'LoadPackagePreferences',
- 'LoadPICT', 'LoadWave', 'Loess', 'LombPeriodogram', 'Make', 'MakeIndex',
- 'MarkPerfTestTime', 'MatrixConvolve', 'MatrixCorr', 'MatrixEigenV',
- 'MatrixFilter', 'MatrixGaussJ', 'MatrixGLM', 'MatrixInverse', 'MatrixLinearSolve',
- 'MatrixLinearSolveTD', 'MatrixLLS', 'MatrixLUBkSub', 'MatrixLUD', 'MatrixLUDTD',
- 'MatrixMultiply', 'MatrixOP', 'MatrixSchur', 'MatrixSolve', 'MatrixSVBkSub',
- 'MatrixSVD', 'MatrixTranspose', 'MCC_FindServers', 'MeasureStyledText',
- 'MFR_CheckForNewBricklets',
- 'MFR_CloseResultFile', 'MFR_CreateOverviewTable', 'MFR_GetBrickletCount',
- 'MFR_GetBrickletData', 'MFR_GetBrickletDeployData', 'MFR_GetBrickletMetaData',
- 'MFR_GetBrickletRawData', 'MFR_GetReportTemplate', 'MFR_GetResultFileMetaData',
- 'MFR_GetResultFileName', 'MFR_GetVernissageVersion', 'MFR_GetVersion',
- 'MFR_GetXOPErrorMessage', 'MFR_OpenResultFile',
- 'MLLoadWave', 'Modify', 'ModifyBoxPlot', 'ModifyBrowser', 'ModifyCamera',
- 'ModifyContour', 'ModifyControl', 'ModifyControlList', 'ModifyFreeAxis',
- 'ModifyGizmo', 'ModifyGraph', 'ModifyImage', 'ModifyLayout', 'ModifyPanel',
- 'ModifyTable', 'ModifyViolinPlot', 'ModifyWaterfall', 'MoveDataFolder',
- 'MoveFile', 'MoveFolder', 'MoveString', 'MoveSubwindow', 'MoveVariable',
- 'MoveWave', 'MoveWindow', 'MultiTaperPSD', 'MultiThreadingControl',
- 'NC_CloseFile', 'NC_DumpErrors', 'NC_Inquire', 'NC_ListAttributes',
- 'NC_ListObjects', 'NC_LoadData', 'NC_OpenFile', 'NeuralNetworkRun',
- 'NeuralNetworkTrain', 'NewCamera', 'NewDataFolder', 'NewFIFO', 'NewFIFOChan',
- 'NewFreeAxis', 'NewGizmo', 'NewImage', 'NewLayout', 'NewMovie', 'NewNotebook',
- 'NewPanel', 'NewPath', 'NewWaterfall', 'NILoadWave', 'NI4882', 'Note', 'Notebook',
- 'NotebookAction', 'Open', 'OpenHelp', 'OpenNotebook', 'Optimize',
- 'ParseOperationTemplate', 'PathInfo', 'PauseForUser', 'PauseUpdate', 'PCA',
- 'PlayMovie', 'PlayMovieAction', 'PlaySound', 'PopupContextualMenu', 'PopupMenu',
- 'Preferences', 'PrimeFactors', 'Print', 'printf', 'PrintGraphs', 'PrintLayout',
- 'PrintNotebook', 'PrintSettings', 'PrintTable', 'Project', 'PulseStats',
- 'PutScrapText', 'pwd', 'Quit', 'RatioFromNumber', 'Redimension', 'Remez',
- 'Remove', 'RemoveContour', 'RemoveFromGizmo', 'RemoveFromGraph',
- 'RemoveFromLayout', 'RemoveFromTable', 'RemoveImage', 'RemoveLayoutObjects',
- 'RemovePath', 'Rename', 'RenameDataFolder', 'RenamePath', 'RenamePICT',
- 'RenameWindow', 'ReorderImages', 'ReorderTraces', 'ReplaceText', 'ReplaceWave',
- 'Resample', 'ResumeUpdate', 'Reverse', 'Rotate', 'Save', 'SaveData',
- 'SaveExperiment', 'SaveGizmoCopy', 'SaveGraphCopy', 'SaveNotebook',
- 'SavePackagePreferences', 'SavePICT', 'SaveTableCopy', 'SetActiveSubwindow',
- 'SetAxis', 'SetBackground', 'SetDashPattern', 'SetDataFolder', 'SetDimLabel',
- 'SetDrawEnv', 'SetDrawLayer', 'SetFileFolderInfo', 'SetFormula', 'SetIdlePeriod',
- 'SetIgorHook', 'SetIgorMenuMode', 'SetIgorOption', 'SetMarquee',
- 'SetProcessSleep', 'SetRandomSeed', 'SetScale', 'SetVariable', 'SetWaveLock',
- 'SetWaveTextEncoding', 'SetWindow', 'ShowIgorMenus', 'ShowInfo', 'ShowTools',
- 'Silent', 'Sleep', 'Slider', 'Smooth', 'SmoothCustom', 'Sort', 'SortColumns',
- 'SoundInRecord', 'SoundInSet', 'SoundInStartChart', 'SoundInStatus',
- 'SoundInStopChart', 'SoundLoadWave', 'SoundSaveWave', 'SphericalInterpolate',
- 'SphericalTriangulate', 'SplitString', 'SplitWave', 'sprintf', 'SQLHighLevelOp',
- 'sscanf', 'Stack', 'StackWindows', 'StatsAngularDistanceTest', 'StatsANOVA1Test',
- 'StatsANOVA2NRTest', 'StatsANOVA2RMTest', 'StatsANOVA2Test', 'StatsChiTest',
- 'StatsCircularCorrelationTest', 'StatsCircularMeans', 'StatsCircularMoments',
- 'StatsCircularTwoSampleTest', 'StatsCochranTest', 'StatsContingencyTable',
- 'StatsDIPTest', 'StatsDunnettTest', 'StatsFriedmanTest', 'StatsFTest',
- 'StatsHodgesAjneTest', 'StatsJBTest', 'StatsKDE', 'StatsKendallTauTest',
- 'StatsKSTest', 'StatsKWTest', 'StatsLinearCorrelationTest',
- 'StatsLinearRegression', 'StatsMultiCorrelationTest', 'StatsNPMCTest',
- 'StatsNPNominalSRTest', 'StatsQuantiles', 'StatsRankCorrelationTest',
- 'StatsResample', 'StatsSample', 'StatsScheffeTest', 'StatsShapiroWilkTest',
- 'StatsSignTest', 'StatsSRTest', 'StatsTTest', 'StatsTukeyTest',
- 'StatsVariancesTest', 'StatsWatsonUSquaredTest', 'StatsWatsonWilliamsTest',
- 'StatsWheelerWatsonTest', 'StatsWilcoxonRankTest', 'StatsWRCorrelationTest',
- 'STFT', 'String', 'StructFill', 'StructGet', 'StructPut', 'SumDimension',
- 'SumSeries', 'TabControl', 'Tag', 'TDMLoadData', 'TDMSaveData', 'TextBox',
- 'ThreadGroupPutDF', 'ThreadStart', 'TickWavesFromAxis', 'Tile', 'TileWindows',
- 'TitleBox', 'ToCommandLine', 'ToolsGrid', 'Triangulate3d', 'Unwrap', 'URLRequest',
- 'ValDisplay', 'Variable', 'VDTClosePort2', 'VDTGetPortList2', 'VDTGetStatus2',
- 'VDTOpenPort2', 'VDTOperationsPort2', 'VDTReadBinaryWave2', 'VDTReadBinary2',
- 'VDTReadHexWave2', 'VDTReadHex2', 'VDTReadWave2', 'VDTRead2', 'VDTTerminalPort2',
- 'VDTWriteBinaryWave2', 'VDTWriteBinary2', 'VDTWriteHexWave2', 'VDTWriteHex2',
- 'VDTWriteWave2', 'VDTWrite2', 'VDT2', 'VISAControl', 'VISARead', 'VISAReadBinary',
- 'VISAReadBinaryWave', 'VISAReadWave', 'VISAWrite', 'VISAWriteBinary',
- 'VISAWriteBinaryWave', 'VISAWriteWave', 'WaveMeanStdv', 'WaveStats',
- 'WaveTransform', 'wfprintf', 'WignerTransform', 'WindowFunction', 'XLLoadWave'
- )
- functions = (
- 'abs', 'acos', 'acosh', 'AddListItem', 'AiryA', 'AiryAD', 'AiryB', 'AiryBD',
- 'alog', 'AnnotationInfo', 'AnnotationList', 'area', 'areaXY', 'asin', 'asinh',
- 'atan', 'atanh', 'atan2', 'AxisInfo', 'AxisList', 'AxisValFromPixel',
- 'AxonTelegraphAGetDataNum', 'AxonTelegraphAGetDataString',
- 'AxonTelegraphAGetDataStruct', 'AxonTelegraphGetDataNum',
- 'AxonTelegraphGetDataString', 'AxonTelegraphGetDataStruct',
- 'AxonTelegraphGetTimeoutMs', 'AxonTelegraphSetTimeoutMs', 'Base64Decode',
- 'Base64Encode', 'Besseli', 'Besselj', 'Besselk', 'Bessely', 'beta', 'betai',
- 'BinarySearch', 'BinarySearchInterp', 'binomial', 'binomialln', 'binomialNoise',
- 'cabs', 'CaptureHistory', 'CaptureHistoryStart', 'ceil', 'cequal', 'char2num',
- 'chebyshev', 'chebyshevU', 'CheckName', 'ChildWindowList', 'CleanupName', 'cmplx',
- 'cmpstr', 'conj', 'ContourInfo', 'ContourNameList', 'ContourNameToWaveRef',
- 'ContourZ', 'ControlNameList', 'ConvertTextEncoding', 'cos', 'cosh',
- 'cosIntegral', 'cot', 'coth', 'CountObjects', 'CountObjectsDFR', 'cpowi',
- 'CreationDate', 'csc', 'csch', 'CsrInfo', 'CsrWave', 'CsrWaveRef', 'CsrXWave',
- 'CsrXWaveRef', 'CTabList', 'DataFolderDir', 'DataFolderExists',
- 'DataFolderRefsEqual', 'DataFolderRefStatus', 'date', 'datetime', 'DateToJulian',
- 'date2secs', 'Dawson', 'defined', 'deltax', 'digamma', 'dilogarithm', 'DimDelta',
- 'DimOffset', 'DimSize', 'ei', 'enoise', 'equalWaves', 'erf', 'erfc', 'erfcw',
- 'exists', 'exp', 'expInt', 'expIntegralE1', 'expNoise', 'factorial', 'Faddeeva',
- 'fakedata', 'faverage', 'faverageXY', 'fDAQmx_AI_GetReader',
- 'fDAQmx_AO_UpdateOutputs', 'fDAQmx_ConnectTerminals', 'fDAQmx_CTR_Finished',
- 'fDAQmx_CTR_IsFinished', 'fDAQmx_CTR_IsPulseFinished', 'fDAQmx_CTR_ReadCounter',
- 'fDAQmx_CTR_ReadWithOptions', 'fDAQmx_CTR_SetPulseFrequency', 'fDAQmx_CTR_Start',
- 'fDAQmx_DeviceNames', 'fDAQmx_DIO_Finished', 'fDAQmx_DIO_PortWidth',
- 'fDAQmx_DIO_Read', 'fDAQmx_DIO_Write', 'fDAQmx_DisconnectTerminals',
- 'fDAQmx_ErrorString', 'fDAQmx_ExternalCalDate', 'fDAQmx_NumAnalogInputs',
- 'fDAQmx_NumAnalogOutputs', 'fDAQmx_NumCounters', 'fDAQmx_NumDIOPorts',
- 'fDAQmx_ReadChan', 'fDAQmx_ReadNamedChan', 'fDAQmx_ResetDevice',
- 'fDAQmx_ScanGetAvailable', 'fDAQmx_ScanGetNextIndex', 'fDAQmx_ScanStart',
- 'fDAQmx_ScanStop', 'fDAQmx_ScanWait', 'fDAQmx_ScanWaitWithTimeout',
- 'fDAQmx_SelfCalDate', 'fDAQmx_SelfCalibration', 'fDAQmx_WaveformStart',
- 'fDAQmx_WaveformStop', 'fDAQmx_WF_IsFinished', 'fDAQmx_WF_WaitUntilFinished',
- 'fDAQmx_WriteChan', 'FetchURL', 'FindDimLabel', 'FindListItem', 'floor',
- 'FontList', 'FontSizeHeight', 'FontSizeStringWidth', 'FresnelCos', 'FresnelSin',
- 'FuncRefInfo', 'FunctionInfo', 'FunctionList', 'FunctionPath', 'gamma',
- 'gammaEuler', 'gammaInc', 'gammaNoise', 'gammln', 'gammp', 'gammq', 'Gauss',
- 'Gauss1D', 'Gauss2D', 'gcd', 'GetBrowserLine', 'GetBrowserSelection',
- 'GetDataFolder', 'GetDataFolderDFR', 'GetDefaultFont', 'GetDefaultFontSize',
- 'GetDefaultFontStyle', 'GetDimLabel', 'GetEnvironmentVariable', 'GetErrMessage',
- 'GetFormula', 'GetIndependentModuleName', 'GetIndexedObjName',
- 'GetIndexedObjNameDFR', 'GetKeyState', 'GetRTErrMessage', 'GetRTError',
- 'GetRTLocation', 'GetRTLocInfo', 'GetRTStackInfo', 'GetScrapText', 'GetUserData',
- 'GetWavesDataFolder', 'GetWavesDataFolderDFR', 'GISGetAllFileFormats',
- 'GISSRefsAreEqual', 'GizmoInfo', 'GizmoScale', 'gnoise', 'GrepList', 'GrepString',
- 'GuideInfo', 'GuideNameList', 'Hash', 'hcsr', 'HDF5AttributeInfo',
- 'HDF5DatasetInfo', 'HDF5LibraryInfo', 'HDF5TypeInfo', 'hermite', 'hermiteGauss',
- 'HyperGNoise', 'HyperGPFQ', 'HyperG0F1', 'HyperG1F1', 'HyperG2F1', 'IgorInfo',
- 'IgorVersion', 'imag', 'ImageInfo', 'ImageNameList', 'ImageNameToWaveRef',
- 'IndependentModuleList', 'IndexedDir', 'IndexedFile', 'IndexToScale', 'Inf',
- 'Integrate1D', 'interp', 'Interp2D', 'Interp3D', 'inverseERF', 'inverseERFC',
- 'ItemsInList', 'JacobiCn', 'JacobiSn', 'JulianToDate', 'Laguerre', 'LaguerreA',
- 'LaguerreGauss', 'LambertW', 'LayoutInfo', 'leftx', 'LegendreA', 'limit',
- 'ListMatch', 'ListToTextWave', 'ListToWaveRefWave', 'ln', 'log', 'logNormalNoise',
- 'lorentzianNoise', 'LowerStr', 'MacroList', 'magsqr', 'MandelbrotPoint',
- 'MarcumQ', 'MatrixCondition', 'MatrixDet', 'MatrixDot', 'MatrixRank',
- 'MatrixTrace', 'max', 'MCC_AutoBridgeBal', 'MCC_AutoFastComp',
- 'MCC_AutoPipetteOffset', 'MCC_AutoSlowComp', 'MCC_AutoWholeCellComp',
- 'MCC_GetBridgeBalEnable', 'MCC_GetBridgeBalResist', 'MCC_GetFastCompCap',
- 'MCC_GetFastCompTau', 'MCC_GetHolding', 'MCC_GetHoldingEnable', 'MCC_GetMode',
- 'MCC_GetNeutralizationCap', 'MCC_GetNeutralizationEnable',
- 'MCC_GetOscKillerEnable', 'MCC_GetPipetteOffset', 'MCC_GetPrimarySignalGain',
- 'MCC_GetPrimarySignalHPF', 'MCC_GetPrimarySignalLPF', 'MCC_GetRsCompBandwidth',
- 'MCC_GetRsCompCorrection', 'MCC_GetRsCompEnable', 'MCC_GetRsCompPrediction',
- 'MCC_GetSecondarySignalGain', 'MCC_GetSecondarySignalLPF', 'MCC_GetSlowCompCap',
- 'MCC_GetSlowCompTau', 'MCC_GetSlowCompTauX20Enable',
- 'MCC_GetSlowCurrentInjEnable', 'MCC_GetSlowCurrentInjLevel',
- 'MCC_GetSlowCurrentInjSetlTime', 'MCC_GetWholeCellCompCap',
- 'MCC_GetWholeCellCompEnable', 'MCC_GetWholeCellCompResist',
- 'MCC_SelectMultiClamp700B', 'MCC_SetBridgeBalEnable', 'MCC_SetBridgeBalResist',
- 'MCC_SetFastCompCap', 'MCC_SetFastCompTau', 'MCC_SetHolding',
- 'MCC_SetHoldingEnable', 'MCC_SetMode', 'MCC_SetNeutralizationCap',
- 'MCC_SetNeutralizationEnable', 'MCC_SetOscKillerEnable', 'MCC_SetPipetteOffset',
- 'MCC_SetPrimarySignalGain', 'MCC_SetPrimarySignalHPF', 'MCC_SetPrimarySignalLPF',
- 'MCC_SetRsCompBandwidth', 'MCC_SetRsCompCorrection', 'MCC_SetRsCompEnable',
- 'MCC_SetRsCompPrediction', 'MCC_SetSecondarySignalGain',
- 'MCC_SetSecondarySignalLPF', 'MCC_SetSlowCompCap', 'MCC_SetSlowCompTau',
- 'MCC_SetSlowCompTauX20Enable', 'MCC_SetSlowCurrentInjEnable',
- 'MCC_SetSlowCurrentInjLevel', 'MCC_SetSlowCurrentInjSetlTime', 'MCC_SetTimeoutMs',
- 'MCC_SetWholeCellCompCap', 'MCC_SetWholeCellCompEnable',
- 'MCC_SetWholeCellCompResist', 'mean', 'median', 'min', 'mod', 'ModDate',
- 'MPFXEMGPeak', 'MPFXExpConvExpPeak', 'MPFXGaussPeak', 'MPFXLorenzianPeak',
- 'MPFXVoigtPeak', 'NameOfWave', 'NaN', 'NewFreeDataFolder', 'NewFreeWave', 'norm',
- 'NormalizeUnicode', 'note', 'NumberByKey', 'numpnts', 'numtype',
- 'NumVarOrDefault', 'num2char', 'num2istr', 'num2str', 'NVAR_Exists',
- 'OperationList', 'PadString', 'PanelResolution', 'ParamIsDefault',
- 'ParseFilePath', 'PathList', 'pcsr', 'Pi', 'PICTInfo', 'PICTList',
- 'PixelFromAxisVal', 'pnt2x', 'poissonNoise', 'poly', 'PolygonArea', 'poly2D',
- 'PossiblyQuoteName', 'ProcedureText', 'p2rect', 'qcsr', 'real', 'RemoveByKey',
- 'RemoveEnding', 'RemoveFromList', 'RemoveListItem', 'ReplaceNumberByKey',
- 'ReplaceString', 'ReplaceStringByKey', 'rightx', 'round', 'r2polar', 'sawtooth',
- 'scaleToIndex', 'ScreenResolution', 'sec', 'sech', 'Secs2Date', 'Secs2Time',
- 'SelectNumber', 'SelectString', 'SetEnvironmentVariable', 'sign', 'sin', 'sinc',
- 'sinh', 'sinIntegral', 'SortList', 'SpecialCharacterInfo', 'SpecialCharacterList',
- 'SpecialDirPath', 'SphericalBessJ', 'SphericalBessJD', 'SphericalBessY',
- 'SphericalBessYD', 'SphericalHarmonics', 'SQLAllocHandle', 'SQLAllocStmt',
- 'SQLBinaryWavesToTextWave', 'SQLBindCol', 'SQLBindParameter', 'SQLBrowseConnect',
- 'SQLBulkOperations', 'SQLCancel', 'SQLCloseCursor', 'SQLColAttributeNum',
- 'SQLColAttributeStr', 'SQLColumnPrivileges', 'SQLColumns', 'SQLConnect',
- 'SQLDataSources', 'SQLDescribeCol', 'SQLDescribeParam', 'SQLDisconnect',
- 'SQLDriverConnect', 'SQLDrivers', 'SQLEndTran', 'SQLError', 'SQLExecDirect',
- 'SQLExecute', 'SQLFetch', 'SQLFetchScroll', 'SQLForeignKeys', 'SQLFreeConnect',
- 'SQLFreeEnv', 'SQLFreeHandle', 'SQLFreeStmt', 'SQLGetConnectAttrNum',
- 'SQLGetConnectAttrStr', 'SQLGetCursorName', 'SQLGetDataNum', 'SQLGetDataStr',
- 'SQLGetDescFieldNum', 'SQLGetDescFieldStr', 'SQLGetDescRec', 'SQLGetDiagFieldNum',
- 'SQLGetDiagFieldStr', 'SQLGetDiagRec', 'SQLGetEnvAttrNum', 'SQLGetEnvAttrStr',
- 'SQLGetFunctions', 'SQLGetInfoNum', 'SQLGetInfoStr', 'SQLGetStmtAttrNum',
- 'SQLGetStmtAttrStr', 'SQLGetTypeInfo', 'SQLMoreResults', 'SQLNativeSql',
- 'SQLNumParams', 'SQLNumResultCols', 'SQLNumResultRowsIfKnown',
- 'SQLNumRowsFetched', 'SQLParamData', 'SQLPrepare', 'SQLPrimaryKeys',
- 'SQLProcedureColumns', 'SQLProcedures', 'SQLPutData', 'SQLReinitialize',
- 'SQLRowCount', 'SQLSetConnectAttrNum', 'SQLSetConnectAttrStr', 'SQLSetCursorName',
- 'SQLSetDescFieldNum', 'SQLSetDescFieldStr', 'SQLSetDescRec', 'SQLSetEnvAttrNum',
- 'SQLSetEnvAttrStr', 'SQLSetPos', 'SQLSetStmtAttrNum', 'SQLSetStmtAttrStr',
- 'SQLSpecialColumns', 'SQLStatistics', 'SQLTablePrivileges', 'SQLTables',
- 'SQLTextWaveToBinaryWaves', 'SQLTextWaveTo2DBinaryWave', 'SQLUpdateBoundValues',
- 'SQLXOPCheckState', 'SQL2DBinaryWaveToTextWave', 'sqrt', 'StartMSTimer',
- 'StatsBetaCDF', 'StatsBetaPDF', 'StatsBinomialCDF', 'StatsBinomialPDF',
- 'StatsCauchyCDF', 'StatsCauchyPDF', 'StatsChiCDF', 'StatsChiPDF', 'StatsCMSSDCDF',
- 'StatsCorrelation', 'StatsDExpCDF', 'StatsDExpPDF', 'StatsErlangCDF',
- 'StatsErlangPDF', 'StatsErrorPDF', 'StatsEValueCDF', 'StatsEValuePDF',
- 'StatsExpCDF', 'StatsExpPDF', 'StatsFCDF', 'StatsFPDF', 'StatsFriedmanCDF',
- 'StatsGammaCDF', 'StatsGammaPDF', 'StatsGeometricCDF', 'StatsGeometricPDF',
- 'StatsGEVCDF', 'StatsGEVPDF', 'StatsHyperGCDF', 'StatsHyperGPDF',
- 'StatsInvBetaCDF', 'StatsInvBinomialCDF', 'StatsInvCauchyCDF', 'StatsInvChiCDF',
- 'StatsInvCMSSDCDF', 'StatsInvDExpCDF', 'StatsInvEValueCDF', 'StatsInvExpCDF',
- 'StatsInvFCDF', 'StatsInvFriedmanCDF', 'StatsInvGammaCDF', 'StatsInvGeometricCDF',
- 'StatsInvKuiperCDF', 'StatsInvLogisticCDF', 'StatsInvLogNormalCDF',
- 'StatsInvMaxwellCDF', 'StatsInvMooreCDF', 'StatsInvNBinomialCDF',
- 'StatsInvNCChiCDF', 'StatsInvNCFCDF', 'StatsInvNormalCDF', 'StatsInvParetoCDF',
- 'StatsInvPoissonCDF', 'StatsInvPowerCDF', 'StatsInvQCDF', 'StatsInvQpCDF',
- 'StatsInvRayleighCDF', 'StatsInvRectangularCDF', 'StatsInvSpearmanCDF',
- 'StatsInvStudentCDF', 'StatsInvTopDownCDF', 'StatsInvTriangularCDF',
- 'StatsInvUsquaredCDF', 'StatsInvVonMisesCDF', 'StatsInvWeibullCDF',
- 'StatsKuiperCDF', 'StatsLogisticCDF', 'StatsLogisticPDF', 'StatsLogNormalCDF',
- 'StatsLogNormalPDF', 'StatsMaxwellCDF', 'StatsMaxwellPDF', 'StatsMedian',
- 'StatsMooreCDF', 'StatsNBinomialCDF', 'StatsNBinomialPDF', 'StatsNCChiCDF',
- 'StatsNCChiPDF', 'StatsNCFCDF', 'StatsNCFPDF', 'StatsNCTCDF', 'StatsNCTPDF',
- 'StatsNormalCDF', 'StatsNormalPDF', 'StatsParetoCDF', 'StatsParetoPDF',
- 'StatsPermute', 'StatsPoissonCDF', 'StatsPoissonPDF', 'StatsPowerCDF',
- 'StatsPowerNoise', 'StatsPowerPDF', 'StatsQCDF', 'StatsQpCDF', 'StatsRayleighCDF',
- 'StatsRayleighPDF', 'StatsRectangularCDF', 'StatsRectangularPDF', 'StatsRunsCDF',
- 'StatsSpearmanRhoCDF', 'StatsStudentCDF', 'StatsStudentPDF', 'StatsTopDownCDF',
- 'StatsTriangularCDF', 'StatsTriangularPDF', 'StatsTrimmedMean',
- 'StatsUSquaredCDF', 'StatsVonMisesCDF', 'StatsVonMisesNoise', 'StatsVonMisesPDF',
- 'StatsWaldCDF', 'StatsWaldPDF', 'StatsWeibullCDF', 'StatsWeibullPDF',
- 'StopMSTimer', 'StringByKey', 'stringCRC', 'StringFromList', 'StringList',
- 'stringmatch', 'strlen', 'strsearch', 'StrVarOrDefault', 'str2num', 'StudentA',
- 'StudentT', 'sum', 'SVAR_Exists', 'TableInfo', 'TagVal', 'TagWaveRef', 'tan',
- 'tango_close_device', 'tango_command_inout', 'tango_compute_image_proj',
- 'tango_get_dev_attr_list', 'tango_get_dev_black_box', 'tango_get_dev_cmd_list',
- 'tango_get_dev_status', 'tango_get_dev_timeout', 'tango_get_error_stack',
- 'tango_open_device', 'tango_ping_device', 'tango_read_attribute',
- 'tango_read_attributes', 'tango_reload_dev_interface',
- 'tango_resume_attr_monitor', 'tango_set_attr_monitor_period',
- 'tango_set_dev_timeout', 'tango_start_attr_monitor', 'tango_stop_attr_monitor',
- 'tango_suspend_attr_monitor', 'tango_write_attribute', 'tango_write_attributes',
- 'tanh', 'TDMAddChannel', 'TDMAddGroup', 'TDMAppendDataValues',
- 'TDMAppendDataValuesTime', 'TDMChannelPropertyExists', 'TDMCloseChannel',
- 'TDMCloseFile', 'TDMCloseGroup', 'TDMCreateChannelProperty', 'TDMCreateFile',
- 'TDMCreateFileProperty', 'TDMCreateGroupProperty', 'TDMFilePropertyExists',
- 'TDMGetChannelPropertyNames', 'TDMGetChannelPropertyNum',
- 'TDMGetChannelPropertyStr', 'TDMGetChannelPropertyTime',
- 'TDMGetChannelPropertyType', 'TDMGetChannels', 'TDMGetChannelStringPropertyLen',
- 'TDMGetDataType', 'TDMGetDataValues', 'TDMGetDataValuesTime',
- 'TDMGetFilePropertyNames', 'TDMGetFilePropertyNum', 'TDMGetFilePropertyStr',
- 'TDMGetFilePropertyTime', 'TDMGetFilePropertyType', 'TDMGetFileStringPropertyLen',
- 'TDMGetGroupPropertyNames', 'TDMGetGroupPropertyNum', 'TDMGetGroupPropertyStr',
- 'TDMGetGroupPropertyTime', 'TDMGetGroupPropertyType', 'TDMGetGroups',
- 'TDMGetGroupStringPropertyLen', 'TDMGetLibraryErrorDescription',
- 'TDMGetNumChannelProperties', 'TDMGetNumChannels', 'TDMGetNumDataValues',
- 'TDMGetNumFileProperties', 'TDMGetNumGroupProperties', 'TDMGetNumGroups',
- 'TDMGroupPropertyExists', 'TDMOpenFile', 'TDMOpenFileEx', 'TDMRemoveChannel',
- 'TDMRemoveGroup', 'TDMReplaceDataValues', 'TDMReplaceDataValuesTime',
- 'TDMSaveFile', 'TDMSetChannelPropertyNum', 'TDMSetChannelPropertyStr',
- 'TDMSetChannelPropertyTime', 'TDMSetDataValues', 'TDMSetDataValuesTime',
- 'TDMSetFilePropertyNum', 'TDMSetFilePropertyStr', 'TDMSetFilePropertyTime',
- 'TDMSetGroupPropertyNum', 'TDMSetGroupPropertyStr', 'TDMSetGroupPropertyTime',
- 'TextEncodingCode', 'TextEncodingName', 'TextFile', 'ThreadGroupCreate',
- 'ThreadGroupGetDF', 'ThreadGroupGetDFR', 'ThreadGroupRelease', 'ThreadGroupWait',
- 'ThreadProcessorCount', 'ThreadReturnValue', 'ticks', 'time', 'TraceFromPixel',
- 'TraceInfo', 'TraceNameList', 'TraceNameToWaveRef', 'TrimString', 'trunc',
- 'UniqueName', 'UnPadString', 'UnsetEnvironmentVariable', 'UpperStr', 'URLDecode',
- 'URLEncode', 'VariableList', 'Variance', 'vcsr', 'viAssertIntrSignal',
- 'viAssertTrigger', 'viAssertUtilSignal', 'viClear', 'viClose', 'viDisableEvent',
- 'viDiscardEvents', 'viEnableEvent', 'viFindNext', 'viFindRsrc', 'viGetAttribute',
- 'viGetAttributeString', 'viGpibCommand', 'viGpibControlATN', 'viGpibControlREN',
- 'viGpibPassControl', 'viGpibSendIFC', 'viIn8', 'viIn16', 'viIn32', 'viLock',
- 'viMapAddress', 'viMapTrigger', 'viMemAlloc', 'viMemFree', 'viMoveIn8',
- 'viMoveIn16', 'viMoveIn32', 'viMoveOut8', 'viMoveOut16', 'viMoveOut32', 'viOpen',
- 'viOpenDefaultRM', 'viOut8', 'viOut16', 'viOut32', 'viPeek8', 'viPeek16',
- 'viPeek32', 'viPoke8', 'viPoke16', 'viPoke32', 'viRead', 'viReadSTB',
- 'viSetAttribute', 'viSetAttributeString', 'viStatusDesc', 'viTerminate',
- 'viUnlock', 'viUnmapAddress', 'viUnmapTrigger', 'viUsbControlIn',
- 'viUsbControlOut', 'viVxiCommandQuery', 'viWaitOnEvent', 'viWrite', 'VoigtFunc',
- 'VoigtPeak', 'WaveCRC', 'WaveDims', 'WaveExists', 'WaveHash', 'WaveInfo',
- 'WaveList', 'WaveMax', 'WaveMin', 'WaveName', 'WaveRefIndexed',
- 'WaveRefIndexedDFR', 'WaveRefsEqual', 'WaveRefWaveToList', 'WaveTextEncoding',
- 'WaveType', 'WaveUnits', 'WhichListItem', 'WinList', 'WinName', 'WinRecreation',
- 'WinType', 'wnoise', 'xcsr', 'XWaveName', 'XWaveRefFromTrace', 'x2pnt', 'zcsr',
- 'ZernikeR', 'zeromq_client_connect', 'zeromq_client_connect',
- 'zeromq_client_recv', 'zeromq_client_recv', 'zeromq_client_send',
- 'zeromq_client_send', 'zeromq_handler_start', 'zeromq_handler_start',
- 'zeromq_handler_stop', 'zeromq_handler_stop', 'zeromq_server_bind',
- 'zeromq_server_bind', 'zeromq_server_recv', 'zeromq_server_recv',
- 'zeromq_server_send', 'zeromq_server_send', 'zeromq_set', 'zeromq_set',
- 'zeromq_stop', 'zeromq_stop', 'zeromq_test_callfunction',
- 'zeromq_test_callfunction', 'zeromq_test_serializeWave',
- 'zeromq_test_serializeWave', 'zeta'
- )
-
- tokens = {
- 'root': [
- (r'//.*$', Comment.Single),
- (r'"([^"\\]|\\.)*"', String),
- # Flow Control.
- (words(flowControl, prefix=r'\b', suffix=r'\b'), Keyword),
- # Types.
- (words(types, prefix=r'\b', suffix=r'\b'), Keyword.Type),
- # Keywords.
- (words(keywords, prefix=r'\b', suffix=r'\b'), Keyword.Reserved),
- # Built-in operations.
- (words(operations, prefix=r'\b', suffix=r'\b'), Name.Class),
- # Built-in functions.
- (words(functions, prefix=r'\b', suffix=r'\b'), Name.Function),
- # Compiler directives.
- (r'^#(include|pragma|define|undef|ifdef|ifndef|if|elif|else|endif)',
- Name.Decorator),
- (r'[^a-z"/]+$', Text),
- (r'.', Text),
- ],
- }
diff --git a/pygments/lexers/inferno.py b/pygments/lexers/inferno.py
deleted file mode 100644
index f29808cf..00000000
--- a/pygments/lexers/inferno.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.inferno
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Inferno os and all the related stuff.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, default
-from pygments.token import Punctuation, Text, Comment, Operator, Keyword, \
- Name, String, Number
-
-__all__ = ['LimboLexer']
-
-
-class LimboLexer(RegexLexer):
- """
- Lexer for `Limbo programming language <http://www.vitanuova.com/inferno/limbo.html>`_
-
- TODO:
- - maybe implement better var declaration highlighting
- - some simple syntax error highlighting
-
- .. versionadded:: 2.0
- """
- name = 'Limbo'
- aliases = ['limbo']
- filenames = ['*.b']
- mimetypes = ['text/limbo']
-
- tokens = {
- 'whitespace': [
- (r'^(\s*)([a-zA-Z_]\w*:(\s*)\n)',
- bygroups(Text, Name.Label)),
- (r'\n', Text),
- (r'\s+', Text),
- (r'#(\n|(.|\n)*?[^\\]\n)', Comment.Single),
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|'
- r'u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})', String.Escape),
- (r'[^\\"\n]+', String), # all other characters
- (r'\\', String), # stray backslash
- ],
- 'statements': [
- (r'"', String, 'string'),
- (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
- (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float),
- (r'(\d+\.\d*|\.\d+|\d+[fF])', Number.Float),
- (r'16r[0-9a-fA-F]+', Number.Hex),
- (r'8r[0-7]+', Number.Oct),
- (r'((([1-3]\d)|([2-9]))r)?(\d+)', Number.Integer),
- (r'[()\[\],.]', Punctuation),
- (r'[~!%^&*+=|?:<>/-]|(->)|(<-)|(=>)|(::)', Operator),
- (r'(alt|break|case|continue|cyclic|do|else|exit'
- r'for|hd|if|implement|import|include|len|load|or'
- r'pick|return|spawn|tagof|tl|to|while)\b', Keyword),
- (r'(byte|int|big|real|string|array|chan|list|adt'
- r'|fn|ref|of|module|self|type)\b', Keyword.Type),
- (r'(con|iota|nil)\b', Keyword.Constant),
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'statement' : [
- include('whitespace'),
- include('statements'),
- ('[{}]', Punctuation),
- (';', Punctuation, '#pop'),
- ],
- 'root': [
- include('whitespace'),
- default('statement'),
- ],
- }
-
- def analyse_text(text):
- # Any limbo module implements something
- if re.search(r'^implement \w+;', text, re.MULTILINE):
- return 0.7
-
-# TODO:
-# - Make lexers for:
-# - asm sources
-# - man pages
-# - mkfiles
-# - module definitions
-# - namespace definitions
-# - shell scripts
-# - maybe keyfiles and fonts
-# they all seem to be quite similar to their equivalents
-# from unix world, so there should not be a lot of problems
diff --git a/pygments/lexers/installers.py b/pygments/lexers/installers.py
deleted file mode 100644
index 8c8c39c8..00000000
--- a/pygments/lexers/installers.py
+++ /dev/null
@@ -1,322 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.installers
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for installer/packager DSLs and formats.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, using, this, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Punctuation, Generic, Number, Whitespace
-
-__all__ = ['NSISLexer', 'RPMSpecLexer', 'SourcesListLexer',
- 'DebianControlLexer']
-
-
-class NSISLexer(RegexLexer):
- """
- For `NSIS <http://nsis.sourceforge.net/>`_ scripts.
-
- .. versionadded:: 1.6
- """
- name = 'NSIS'
- aliases = ['nsis', 'nsi', 'nsh']
- filenames = ['*.nsi', '*.nsh']
- mimetypes = ['text/x-nsis']
-
- flags = re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'[;#].*\n', Comment),
- (r"'.*?'", String.Single),
- (r'"', String.Double, 'str_double'),
- (r'`', String.Backtick, 'str_backtick'),
- include('macro'),
- include('interpol'),
- include('basic'),
- (r'\$\{[a-z_|][\w|]*\}', Keyword.Pseudo),
- (r'/[a-z_]\w*', Name.Attribute),
- ('.', Text),
- ],
- 'basic': [
- (r'(\n)(Function)(\s+)([._a-z][.\w]*)\b',
- bygroups(Text, Keyword, Text, Name.Function)),
- (r'\b([_a-z]\w*)(::)([a-z][a-z0-9]*)\b',
- bygroups(Keyword.Namespace, Punctuation, Name.Function)),
- (r'\b([_a-z]\w*)(:)', bygroups(Name.Label, Punctuation)),
- (r'(\b[ULS]|\B)([!<>=]?=|\<\>?|\>)\B', Operator),
- (r'[|+-]', Operator),
- (r'\\', Punctuation),
- (r'\b(Abort|Add(?:BrandingImage|Size)|'
- r'Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|'
- r'BG(?:Font|Gradient)|BrandingText|BringToFront|Call(?:InstDLL)?|'
- r'(?:Sub)?Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|'
- r'ComponentText|CopyFiles|CRCCheck|'
- r'Create(?:Directory|Font|Shortcut)|Delete(?:INI(?:Sec|Str)|'
- r'Reg(?:Key|Value))?|DetailPrint|DetailsButtonText|'
- r'Dir(?:Show|Text|Var|Verify)|(?:Disabled|Enabled)Bitmap|'
- r'EnableWindow|EnumReg(?:Key|Value)|Exch|Exec(?:Shell|Wait)?|'
- r'ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|'
- r'Read(?:Byte)?|Seek|Write(?:Byte)?)?|'
- r'Find(?:Close|First|Next|Window)|FlushINI|Function(?:End)?|'
- r'Get(?:CurInstType|CurrentAddress|DlgItem|DLLVersion(?:Local)?|'
- r'ErrorLevel|FileTime(?:Local)?|FullPathName|FunctionAddress|'
- r'InstDirError|LabelAddress|TempFileName)|'
- r'Goto|HideWindow|Icon|'
- r'If(?:Abort|Errors|FileExists|RebootFlag|Silent)|'
- r'InitPluginsDir|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|'
- r'Inst(?:ProgressFlags|Type(?:[GS]etText)?)|Int(?:CmpU?|Fmt|Op)|'
- r'IsWindow|LangString(?:UP)?|'
- r'License(?:BkColor|Data|ForceSelection|LangString|Text)|'
- r'LoadLanguageFile|LockWindow|Log(?:Set|Text)|MessageBox|'
- r'MiscButtonText|Name|Nop|OutFile|(?:Uninst)?Page(?:Ex(?:End)?)?|'
- r'PluginDir|Pop|Push|Quit|Read(?:(?:Env|INI|Reg)Str|RegDWORD)|'
- r'Reboot|(?:Un)?RegDLL|Rename|RequestExecutionLevel|ReserveFile|'
- r'Return|RMDir|SearchPath|Section(?:Divider|End|'
- r'(?:(?:Get|Set)(?:Flags|InstTypes|Size|Text))|Group(?:End)?|In)?|'
- r'SendMessage|Set(?:AutoClose|BrandingImage|Compress(?:ionLevel|'
- r'or(?:DictSize)?)?|CtlColors|CurInstType|DatablockOptimize|'
- r'DateSave|Details(?:Print|View)|Error(?:s|Level)|FileAttributes|'
- r'Font|OutPath|Overwrite|PluginUnload|RebootFlag|ShellVarContext|'
- r'Silent|StaticBkColor)|'
- r'Show(?:(?:I|Uni)nstDetails|Window)|Silent(?:Un)?Install|Sleep|'
- r'SpaceTexts|Str(?:CmpS?|Cpy|Len)|SubSection(?:End)?|'
- r'Uninstall(?:ButtonText|(?:Sub)?Caption|EXEName|Icon|Text)|'
- r'UninstPage|Var|VI(?:AddVersionKey|ProductVersion)|WindowIcon|'
- r'Write(?:INIStr|Reg(:?Bin|DWORD|(?:Expand)?Str)|Uninstaller)|'
- r'XPStyle)\b', Keyword),
- (r'\b(CUR|END|(?:FILE_ATTRIBUTE_)?'
- r'(?:ARCHIVE|HIDDEN|NORMAL|OFFLINE|READONLY|SYSTEM|TEMPORARY)|'
- r'HK(CC|CR|CU|DD|LM|PD|U)|'
- r'HKEY_(?:CLASSES_ROOT|CURRENT_(?:CONFIG|USER)|DYN_DATA|'
- r'LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|'
- r'ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|'
- r'MB_(?:ABORTRETRYIGNORE|DEFBUTTON[1-4]|'
- r'ICON(?:EXCLAMATION|INFORMATION|QUESTION|STOP)|'
- r'OK(?:CANCEL)?|RETRYCANCEL|RIGHT|SETFOREGROUND|TOPMOST|USERICON|'
- r'YESNO(?:CANCEL)?)|SET|SHCTX|'
- r'SW_(?:HIDE|SHOW(?:MAXIMIZED|MINIMIZED|NORMAL))|'
- r'admin|all|auto|both|bottom|bzip2|checkbox|colored|current|false|'
- r'force|hide|highest|if(?:diff|newer)|lastused|leave|left|'
- r'listonly|lzma|nevershow|none|normal|off|on|pop|push|'
- r'radiobuttons|right|show|silent|silentlog|smooth|textonly|top|'
- r'true|try|user|zlib)\b', Name.Constant),
- ],
- 'macro': [
- (r'\!(addincludedir(?:dir)?|addplugindir|appendfile|cd|define|'
- r'delfilefile|echo(?:message)?|else|endif|error|execute|'
- r'if(?:macro)?n?(?:def)?|include|insertmacro|macro(?:end)?|packhdr|'
- r'search(?:parse|replace)|system|tempfilesymbol|undef|verbose|'
- r'warning)\b', Comment.Preproc),
- ],
- 'interpol': [
- (r'\$(R?[0-9])', Name.Builtin.Pseudo), # registers
- (r'\$(ADMINTOOLS|APPDATA|CDBURN_AREA|COOKIES|COMMONFILES(?:32|64)|'
- r'DESKTOP|DOCUMENTS|EXE(?:DIR|FILE|PATH)|FAVORITES|FONTS|HISTORY|'
- r'HWNDPARENT|INTERNET_CACHE|LOCALAPPDATA|MUSIC|NETHOOD|PICTURES|'
- r'PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES(?:32|64)|QUICKLAUNCH|'
- r'RECENT|RESOURCES(?:_LOCALIZED)?|SENDTO|SM(?:PROGRAMS|STARTUP)|'
- r'STARTMENU|SYSDIR|TEMP(?:LATES)?|VIDEOS|WINDIR|\{NSISDIR\})',
- Name.Builtin),
- (r'\$(CMDLINE|INSTDIR|OUTDIR|LANGUAGE)', Name.Variable.Global),
- (r'\$[a-z_]\w*', Name.Variable),
- ],
- 'str_double': [
- (r'"', String, '#pop'),
- (r'\$(\\[nrt"]|\$)', String.Escape),
- include('interpol'),
- (r'.', String.Double),
- ],
- 'str_backtick': [
- (r'`', String, '#pop'),
- (r'\$(\\[nrt"]|\$)', String.Escape),
- include('interpol'),
- (r'.', String.Double),
- ],
- }
-
-
-class RPMSpecLexer(RegexLexer):
- """
- For RPM ``.spec`` files.
-
- .. versionadded:: 1.6
- """
-
- name = 'RPMSpec'
- aliases = ['spec']
- filenames = ['*.spec']
- mimetypes = ['text/x-rpm-spec']
-
- _directives = ('(?:package|prep|build|install|clean|check|pre[a-z]*|'
- 'post[a-z]*|trigger[a-z]*|files)')
-
- tokens = {
- 'root': [
- (r'#.*\n', Comment),
- include('basic'),
- ],
- 'description': [
- (r'^(%' + _directives + ')(.*)$',
- bygroups(Name.Decorator, Text), '#pop'),
- (r'\n', Text),
- (r'.', Text),
- ],
- 'changelog': [
- (r'\*.*\n', Generic.Subheading),
- (r'^(%' + _directives + ')(.*)$',
- bygroups(Name.Decorator, Text), '#pop'),
- (r'\n', Text),
- (r'.', Text),
- ],
- 'string': [
- (r'"', String.Double, '#pop'),
- (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
- include('interpol'),
- (r'.', String.Double),
- ],
- 'basic': [
- include('macro'),
- (r'(?i)^(Name|Version|Release|Epoch|Summary|Group|License|Packager|'
- r'Vendor|Icon|URL|Distribution|Prefix|Patch[0-9]*|Source[0-9]*|'
- r'Requires\(?[a-z]*\)?|[a-z]+Req|Obsoletes|Suggests|Provides|Conflicts|'
- r'Build[a-z]+|[a-z]+Arch|Auto[a-z]+)(:)(.*)$',
- bygroups(Generic.Heading, Punctuation, using(this))),
- (r'^%description', Name.Decorator, 'description'),
- (r'^%changelog', Name.Decorator, 'changelog'),
- (r'^(%' + _directives + ')(.*)$', bygroups(Name.Decorator, Text)),
- (r'%(attr|defattr|dir|doc(?:dir)?|setup|config(?:ure)?|'
- r'make(?:install)|ghost|patch[0-9]+|find_lang|exclude|verify)',
- Keyword),
- include('interpol'),
- (r"'.*?'", String.Single),
- (r'"', String.Double, 'string'),
- (r'.', Text),
- ],
- 'macro': [
- (r'%define.*\n', Comment.Preproc),
- (r'%\{\!\?.*%define.*\}', Comment.Preproc),
- (r'(%(?:if(?:n?arch)?|else(?:if)?|endif))(.*)$',
- bygroups(Comment.Preproc, Text)),
- ],
- 'interpol': [
- (r'%\{?__[a-z_]+\}?', Name.Function),
- (r'%\{?_([a-z_]+dir|[a-z_]+path|prefix)\}?', Keyword.Pseudo),
- (r'%\{\?\w+\}', Name.Variable),
- (r'\$\{?RPM_[A-Z0-9_]+\}?', Name.Variable.Global),
- (r'%\{[a-zA-Z]\w+\}', Keyword.Constant),
- ]
- }
-
-
-class SourcesListLexer(RegexLexer):
- """
- Lexer that highlights debian sources.list files.
-
- .. versionadded:: 0.7
- """
-
- name = 'Debian Sourcelist'
- aliases = ['sourceslist', 'sources.list', 'debsources']
- filenames = ['sources.list']
- mimetype = ['application/x-debian-sourceslist']
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'#.*?$', Comment),
- (r'^(deb(?:-src)?)(\s+)',
- bygroups(Keyword, Text), 'distribution')
- ],
- 'distribution': [
- (r'#.*?$', Comment, '#pop'),
- (r'\$\(ARCH\)', Name.Variable),
- (r'[^\s$[]+', String),
- (r'\[', String.Other, 'escaped-distribution'),
- (r'\$', String),
- (r'\s+', Text, 'components')
- ],
- 'escaped-distribution': [
- (r'\]', String.Other, '#pop'),
- (r'\$\(ARCH\)', Name.Variable),
- (r'[^\]$]+', String.Other),
- (r'\$', String.Other)
- ],
- 'components': [
- (r'#.*?$', Comment, '#pop:2'),
- (r'$', Text, '#pop:2'),
- (r'\s+', Text),
- (r'\S+', Keyword.Pseudo),
- ]
- }
-
- def analyse_text(text):
- for line in text.splitlines():
- line = line.strip()
- if line.startswith('deb ') or line.startswith('deb-src '):
- return True
-
-
-class DebianControlLexer(RegexLexer):
- """
- Lexer for Debian ``control`` files and ``apt-cache show <pkg>`` outputs.
-
- .. versionadded:: 0.9
- """
- name = 'Debian Control file'
- aliases = ['control', 'debcontrol']
- filenames = ['control']
-
- tokens = {
- 'root': [
- (r'^(Description)', Keyword, 'description'),
- (r'^(Maintainer)(:\s*)', bygroups(Keyword, Text), 'maintainer'),
- (r'^((Build-)?Depends)', Keyword, 'depends'),
- (r'^((?:Python-)?Version)(:\s*)(\S+)$',
- bygroups(Keyword, Text, Number)),
- (r'^((?:Installed-)?Size)(:\s*)(\S+)$',
- bygroups(Keyword, Text, Number)),
- (r'^(MD5Sum|SHA1|SHA256)(:\s*)(\S+)$',
- bygroups(Keyword, Text, Number)),
- (r'^([a-zA-Z\-0-9\.]*?)(:\s*)(.*?)$',
- bygroups(Keyword, Whitespace, String)),
- ],
- 'maintainer': [
- (r'<[^>]+>', Generic.Strong),
- (r'<[^>]+>$', Generic.Strong, '#pop'),
- (r',\n?', Text),
- (r'.', Text),
- ],
- 'description': [
- (r'(.*)(Homepage)(: )(\S+)',
- bygroups(Text, String, Name, Name.Class)),
- (r':.*\n', Generic.Strong),
- (r' .*\n', Text),
- default('#pop'),
- ],
- 'depends': [
- (r':\s*', Text),
- (r'(\$)(\{)(\w+\s*:\s*\w+)', bygroups(Operator, Text, Name.Entity)),
- (r'\(', Text, 'depend_vers'),
- (r',', Text),
- (r'\|', Operator),
- (r'[\s]+', Text),
- (r'[})]\s*$', Text, '#pop'),
- (r'\}', Text),
- (r'[^,]$', Name.Function, '#pop'),
- (r'([+.a-zA-Z0-9-])(\s*)', bygroups(Name.Function, Text)),
- (r'\[.*?\]', Name.Entity),
- ],
- 'depend_vers': [
- (r'\),', Text, '#pop'),
- (r'\)[^,]', Text, '#pop:2'),
- (r'([><=]+)(\s*)([^)]+)', bygroups(Operator, Text, Number))
- ]
- }
diff --git a/pygments/lexers/int_fiction.py b/pygments/lexers/int_fiction.py
deleted file mode 100644
index 89d5bccc..00000000
--- a/pygments/lexers/int_fiction.py
+++ /dev/null
@@ -1,1343 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.int_fiction
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for interactive fiction languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, using, \
- this, default, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error, Generic
-
-__all__ = ['Inform6Lexer', 'Inform6TemplateLexer', 'Inform7Lexer',
- 'Tads3Lexer']
-
-
-class Inform6Lexer(RegexLexer):
- """
- For `Inform 6 <http://inform-fiction.org/>`_ source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'Inform 6'
- aliases = ['inform6', 'i6']
- filenames = ['*.inf']
-
- flags = re.MULTILINE | re.DOTALL | re.UNICODE
-
- _name = r'[a-zA-Z_]\w*'
-
- # Inform 7 maps these four character classes to their ASCII
- # equivalents. To support Inform 6 inclusions within Inform 7,
- # Inform6Lexer maps them too.
- _dash = u'\\-\u2010-\u2014'
- _dquote = u'"\u201c\u201d'
- _squote = u"'\u2018\u2019"
- _newline = u'\\n\u0085\u2028\u2029'
-
- tokens = {
- 'root': [
- (r'\A(!%%[^%s]*[%s])+' % (_newline, _newline), Comment.Preproc,
- 'directive'),
- default('directive')
- ],
- '_whitespace': [
- (r'\s+', Text),
- (r'![^%s]*' % _newline, Comment.Single)
- ],
- 'default': [
- include('_whitespace'),
- (r'\[', Punctuation, 'many-values'), # Array initialization
- (r':|(?=;)', Punctuation, '#pop'),
- (r'<', Punctuation), # Second angle bracket in an action statement
- default(('expression', '_expression'))
- ],
-
- # Expressions
- '_expression': [
- include('_whitespace'),
- (r'(?=sp\b)', Text, '#pop'),
- (r'(?=[%s%s$0-9#a-zA-Z_])' % (_dquote, _squote), Text,
- ('#pop', 'value')),
- (r'\+\+|[%s]{1,2}(?!>)|~~?' % _dash, Operator),
- (r'(?=[()\[%s,?@{:;])' % _dash, Text, '#pop')
- ],
- 'expression': [
- include('_whitespace'),
- (r'\(', Punctuation, ('expression', '_expression')),
- (r'\)', Punctuation, '#pop'),
- (r'\[', Punctuation, ('#pop', 'statements', 'locals')),
- (r'>(?=(\s+|(![^%s]*))*[>;])' % _newline, Punctuation),
- (r'\+\+|[%s]{2}(?!>)' % _dash, Operator),
- (r',', Punctuation, '_expression'),
- (r'&&?|\|\|?|[=~><]?=|[%s]{1,2}>?|\.\.?[&#]?|::|[<>+*/%%]' % _dash,
- Operator, '_expression'),
- (r'(has|hasnt|in|notin|ofclass|or|provides)\b', Operator.Word,
- '_expression'),
- (r'sp\b', Name),
- (r'\?~?', Name.Label, 'label?'),
- (r'[@{]', Error),
- default('#pop')
- ],
- '_assembly-expression': [
- (r'\(', Punctuation, ('#push', '_expression')),
- (r'[\[\]]', Punctuation),
- (r'[%s]>' % _dash, Punctuation, '_expression'),
- (r'sp\b', Keyword.Pseudo),
- (r';', Punctuation, '#pop:3'),
- include('expression')
- ],
- '_for-expression': [
- (r'\)', Punctuation, '#pop:2'),
- (r':', Punctuation, '#pop'),
- include('expression')
- ],
- '_keyword-expression': [
- (r'(from|near|to)\b', Keyword, '_expression'),
- include('expression')
- ],
- '_list-expression': [
- (r',', Punctuation, '#pop'),
- include('expression')
- ],
- '_object-expression': [
- (r'has\b', Keyword.Declaration, '#pop'),
- include('_list-expression')
- ],
-
- # Values
- 'value': [
- include('_whitespace'),
- # Strings
- (r'[%s][^@][%s]' % (_squote, _squote), String.Char, '#pop'),
- (r'([%s])(@\{[0-9a-fA-F]{1,4}\})([%s])' % (_squote, _squote),
- bygroups(String.Char, String.Escape, String.Char), '#pop'),
- (r'([%s])(@.{2})([%s])' % (_squote, _squote),
- bygroups(String.Char, String.Escape, String.Char), '#pop'),
- (r'[%s]' % _squote, String.Single, ('#pop', 'dictionary-word')),
- (r'[%s]' % _dquote, String.Double, ('#pop', 'string')),
- # Numbers
- (r'\$[+%s][0-9]*\.?[0-9]*([eE][+%s]?[0-9]+)?' % (_dash, _dash),
- Number.Float, '#pop'),
- (r'\$[0-9a-fA-F]+', Number.Hex, '#pop'),
- (r'\$\$[01]+', Number.Bin, '#pop'),
- (r'[0-9]+', Number.Integer, '#pop'),
- # Values prefixed by hashes
- (r'(##|#a\$)(%s)' % _name, bygroups(Operator, Name), '#pop'),
- (r'(#g\$)(%s)' % _name,
- bygroups(Operator, Name.Variable.Global), '#pop'),
- (r'#[nw]\$', Operator, ('#pop', 'obsolete-dictionary-word')),
- (r'(#r\$)(%s)' % _name, bygroups(Operator, Name.Function), '#pop'),
- (r'#', Name.Builtin, ('#pop', 'system-constant')),
- # System functions
- (words((
- 'child', 'children', 'elder', 'eldest', 'glk', 'indirect', 'metaclass',
- 'parent', 'random', 'sibling', 'younger', 'youngest'), suffix=r'\b'),
- Name.Builtin, '#pop'),
- # Metaclasses
- (r'(?i)(Class|Object|Routine|String)\b', Name.Builtin, '#pop'),
- # Veneer routines
- (words((
- 'Box__Routine', 'CA__Pr', 'CDefArt', 'CInDefArt', 'Cl__Ms',
- 'Copy__Primitive', 'CP__Tab', 'DA__Pr', 'DB__Pr', 'DefArt', 'Dynam__String',
- 'EnglishNumber', 'Glk__Wrap', 'IA__Pr', 'IB__Pr', 'InDefArt', 'Main__',
- 'Meta__class', 'OB__Move', 'OB__Remove', 'OC__Cl', 'OP__Pr', 'Print__Addr',
- 'Print__PName', 'PrintShortName', 'RA__Pr', 'RA__Sc', 'RL__Pr', 'R_Process',
- 'RT__ChG', 'RT__ChGt', 'RT__ChLDB', 'RT__ChLDW', 'RT__ChPR', 'RT__ChPrintA',
- 'RT__ChPrintC', 'RT__ChPrintO', 'RT__ChPrintS', 'RT__ChPS', 'RT__ChR',
- 'RT__ChSTB', 'RT__ChSTW', 'RT__ChT', 'RT__Err', 'RT__TrPS', 'RV__Pr',
- 'Symb__Tab', 'Unsigned__Compare', 'WV__Pr', 'Z__Region'),
- prefix='(?i)', suffix=r'\b'),
- Name.Builtin, '#pop'),
- # Other built-in symbols
- (words((
- 'call', 'copy', 'create', 'DEBUG', 'destroy', 'DICT_CHAR_SIZE',
- 'DICT_ENTRY_BYTES', 'DICT_IS_UNICODE', 'DICT_WORD_SIZE', 'false',
- 'FLOAT_INFINITY', 'FLOAT_NAN', 'FLOAT_NINFINITY', 'GOBJFIELD_CHAIN',
- 'GOBJFIELD_CHILD', 'GOBJFIELD_NAME', 'GOBJFIELD_PARENT',
- 'GOBJFIELD_PROPTAB', 'GOBJFIELD_SIBLING', 'GOBJ_EXT_START',
- 'GOBJ_TOTAL_LENGTH', 'Grammar__Version', 'INDIV_PROP_START', 'INFIX',
- 'infix__watching', 'MODULE_MODE', 'name', 'nothing', 'NUM_ATTR_BYTES', 'print',
- 'print_to_array', 'recreate', 'remaining', 'self', 'sender', 'STRICT_MODE',
- 'sw__var', 'sys__glob0', 'sys__glob1', 'sys__glob2', 'sys_statusline_flag',
- 'TARGET_GLULX', 'TARGET_ZCODE', 'temp__global2', 'temp__global3',
- 'temp__global4', 'temp_global', 'true', 'USE_MODULES', 'WORDSIZE'),
- prefix='(?i)', suffix=r'\b'),
- Name.Builtin, '#pop'),
- # Other values
- (_name, Name, '#pop')
- ],
- # Strings
- 'dictionary-word': [
- (r'[~^]+', String.Escape),
- (r'[^~^\\@({%s]+' % _squote, String.Single),
- (r'[({]', String.Single),
- (r'@\{[0-9a-fA-F]{,4}\}', String.Escape),
- (r'@.{2}', String.Escape),
- (r'[%s]' % _squote, String.Single, '#pop')
- ],
- 'string': [
- (r'[~^]+', String.Escape),
- (r'[^~^\\@({%s]+' % _dquote, String.Double),
- (r'[({]', String.Double),
- (r'\\', String.Escape),
- (r'@(\\\s*[%s]\s*)*@((\\\s*[%s]\s*)*[0-9])*' %
- (_newline, _newline), String.Escape),
- (r'@(\\\s*[%s]\s*)*\{((\\\s*[%s]\s*)*[0-9a-fA-F]){,4}'
- r'(\\\s*[%s]\s*)*\}' % (_newline, _newline, _newline),
- String.Escape),
- (r'@(\\\s*[%s]\s*)*.(\\\s*[%s]\s*)*.' % (_newline, _newline),
- String.Escape),
- (r'[%s]' % _dquote, String.Double, '#pop')
- ],
- 'plain-string': [
- (r'[^~^\\({\[\]%s]+' % _dquote, String.Double),
- (r'[~^({\[\]]', String.Double),
- (r'\\', String.Escape),
- (r'[%s]' % _dquote, String.Double, '#pop')
- ],
- # Names
- '_constant': [
- include('_whitespace'),
- (_name, Name.Constant, '#pop'),
- include('value')
- ],
- '_global': [
- include('_whitespace'),
- (_name, Name.Variable.Global, '#pop'),
- include('value')
- ],
- 'label?': [
- include('_whitespace'),
- (_name, Name.Label, '#pop'),
- default('#pop')
- ],
- 'variable?': [
- include('_whitespace'),
- (_name, Name.Variable, '#pop'),
- default('#pop')
- ],
- # Values after hashes
- 'obsolete-dictionary-word': [
- (r'\S\w*', String.Other, '#pop')
- ],
- 'system-constant': [
- include('_whitespace'),
- (_name, Name.Builtin, '#pop')
- ],
-
- # Directives
- 'directive': [
- include('_whitespace'),
- (r'#', Punctuation),
- (r';', Punctuation, '#pop'),
- (r'\[', Punctuation,
- ('default', 'statements', 'locals', 'routine-name?')),
- (words((
- 'abbreviate', 'endif', 'dictionary', 'ifdef', 'iffalse', 'ifndef', 'ifnot',
- 'iftrue', 'ifv3', 'ifv5', 'release', 'serial', 'switches', 'system_file',
- 'version'), prefix='(?i)', suffix=r'\b'),
- Keyword, 'default'),
- (r'(?i)(array|global)\b', Keyword,
- ('default', 'directive-keyword?', '_global')),
- (r'(?i)attribute\b', Keyword, ('default', 'alias?', '_constant')),
- (r'(?i)class\b', Keyword,
- ('object-body', 'duplicates', 'class-name')),
- (r'(?i)(constant|default)\b', Keyword,
- ('default', 'expression', '_constant')),
- (r'(?i)(end\b)(.*)', bygroups(Keyword, Text)),
- (r'(?i)(extend|verb)\b', Keyword, 'grammar'),
- (r'(?i)fake_action\b', Keyword, ('default', '_constant')),
- (r'(?i)import\b', Keyword, 'manifest'),
- (r'(?i)(include|link)\b', Keyword,
- ('default', 'before-plain-string')),
- (r'(?i)(lowstring|undef)\b', Keyword, ('default', '_constant')),
- (r'(?i)message\b', Keyword, ('default', 'diagnostic')),
- (r'(?i)(nearby|object)\b', Keyword,
- ('object-body', '_object-head')),
- (r'(?i)property\b', Keyword,
- ('default', 'alias?', '_constant', 'property-keyword*')),
- (r'(?i)replace\b', Keyword,
- ('default', 'routine-name?', 'routine-name?')),
- (r'(?i)statusline\b', Keyword, ('default', 'directive-keyword?')),
- (r'(?i)stub\b', Keyword, ('default', 'routine-name?')),
- (r'(?i)trace\b', Keyword,
- ('default', 'trace-keyword?', 'trace-keyword?')),
- (r'(?i)zcharacter\b', Keyword,
- ('default', 'directive-keyword?', 'directive-keyword?')),
- (_name, Name.Class, ('object-body', '_object-head'))
- ],
- # [, Replace, Stub
- 'routine-name?': [
- include('_whitespace'),
- (_name, Name.Function, '#pop'),
- default('#pop')
- ],
- 'locals': [
- include('_whitespace'),
- (r';', Punctuation, '#pop'),
- (r'\*', Punctuation),
- (r'"', String.Double, 'plain-string'),
- (_name, Name.Variable)
- ],
- # Array
- 'many-values': [
- include('_whitespace'),
- (r';', Punctuation),
- (r'\]', Punctuation, '#pop'),
- (r':', Error),
- default(('expression', '_expression'))
- ],
- # Attribute, Property
- 'alias?': [
- include('_whitespace'),
- (r'alias\b', Keyword, ('#pop', '_constant')),
- default('#pop')
- ],
- # Class, Object, Nearby
- 'class-name': [
- include('_whitespace'),
- (r'(?=[,;]|(class|has|private|with)\b)', Text, '#pop'),
- (_name, Name.Class, '#pop')
- ],
- 'duplicates': [
- include('_whitespace'),
- (r'\(', Punctuation, ('#pop', 'expression', '_expression')),
- default('#pop')
- ],
- '_object-head': [
- (r'[%s]>' % _dash, Punctuation),
- (r'(class|has|private|with)\b', Keyword.Declaration, '#pop'),
- include('_global')
- ],
- 'object-body': [
- include('_whitespace'),
- (r';', Punctuation, '#pop:2'),
- (r',', Punctuation),
- (r'class\b', Keyword.Declaration, 'class-segment'),
- (r'(has|private|with)\b', Keyword.Declaration),
- (r':', Error),
- default(('_object-expression', '_expression'))
- ],
- 'class-segment': [
- include('_whitespace'),
- (r'(?=[,;]|(class|has|private|with)\b)', Text, '#pop'),
- (_name, Name.Class),
- default('value')
- ],
- # Extend, Verb
- 'grammar': [
- include('_whitespace'),
- (r'=', Punctuation, ('#pop', 'default')),
- (r'\*', Punctuation, ('#pop', 'grammar-line')),
- default('_directive-keyword')
- ],
- 'grammar-line': [
- include('_whitespace'),
- (r';', Punctuation, '#pop'),
- (r'[/*]', Punctuation),
- (r'[%s]>' % _dash, Punctuation, 'value'),
- (r'(noun|scope)\b', Keyword, '=routine'),
- default('_directive-keyword')
- ],
- '=routine': [
- include('_whitespace'),
- (r'=', Punctuation, 'routine-name?'),
- default('#pop')
- ],
- # Import
- 'manifest': [
- include('_whitespace'),
- (r';', Punctuation, '#pop'),
- (r',', Punctuation),
- (r'(?i)global\b', Keyword, '_global'),
- default('_global')
- ],
- # Include, Link, Message
- 'diagnostic': [
- include('_whitespace'),
- (r'[%s]' % _dquote, String.Double, ('#pop', 'message-string')),
- default(('#pop', 'before-plain-string', 'directive-keyword?'))
- ],
- 'before-plain-string': [
- include('_whitespace'),
- (r'[%s]' % _dquote, String.Double, ('#pop', 'plain-string'))
- ],
- 'message-string': [
- (r'[~^]+', String.Escape),
- include('plain-string')
- ],
-
- # Keywords used in directives
- '_directive-keyword!': [
- include('_whitespace'),
- (words((
- 'additive', 'alias', 'buffer', 'class', 'creature', 'data', 'error', 'fatalerror',
- 'first', 'has', 'held', 'initial', 'initstr', 'last', 'long', 'meta', 'multi',
- 'multiexcept', 'multiheld', 'multiinside', 'noun', 'number', 'only', 'private',
- 'replace', 'reverse', 'scope', 'score', 'special', 'string', 'table', 'terminating',
- 'time', 'topic', 'warning', 'with'), suffix=r'\b'),
- Keyword, '#pop'),
- (r'[%s]{1,2}>|[+=]' % _dash, Punctuation, '#pop')
- ],
- '_directive-keyword': [
- include('_directive-keyword!'),
- include('value')
- ],
- 'directive-keyword?': [
- include('_directive-keyword!'),
- default('#pop')
- ],
- 'property-keyword*': [
- include('_whitespace'),
- (r'(additive|long)\b', Keyword),
- default('#pop')
- ],
- 'trace-keyword?': [
- include('_whitespace'),
- (words((
- 'assembly', 'dictionary', 'expressions', 'lines', 'linker',
- 'objects', 'off', 'on', 'symbols', 'tokens', 'verbs'), suffix=r'\b'),
- Keyword, '#pop'),
- default('#pop')
- ],
-
- # Statements
- 'statements': [
- include('_whitespace'),
- (r'\]', Punctuation, '#pop'),
- (r'[;{}]', Punctuation),
- (words((
- 'box', 'break', 'continue', 'default', 'give', 'inversion',
- 'new_line', 'quit', 'read', 'remove', 'return', 'rfalse', 'rtrue',
- 'spaces', 'string', 'until'), suffix=r'\b'),
- Keyword, 'default'),
- (r'(do|else)\b', Keyword),
- (r'(font|style)\b', Keyword,
- ('default', 'miscellaneous-keyword?')),
- (r'for\b', Keyword, ('for', '(?')),
- (r'(if|switch|while)', Keyword,
- ('expression', '_expression', '(?')),
- (r'(jump|save|restore)\b', Keyword, ('default', 'label?')),
- (r'objectloop\b', Keyword,
- ('_keyword-expression', 'variable?', '(?')),
- (r'print(_ret)?\b|(?=[%s])' % _dquote, Keyword, 'print-list'),
- (r'\.', Name.Label, 'label?'),
- (r'@', Keyword, 'opcode'),
- (r'#(?![agrnw]\$|#)', Punctuation, 'directive'),
- (r'<', Punctuation, 'default'),
- (r'move\b', Keyword,
- ('default', '_keyword-expression', '_expression')),
- default(('default', '_keyword-expression', '_expression'))
- ],
- 'miscellaneous-keyword?': [
- include('_whitespace'),
- (r'(bold|fixed|from|near|off|on|reverse|roman|to|underline)\b',
- Keyword, '#pop'),
- (r'(a|A|an|address|char|name|number|object|property|string|the|'
- r'The)\b(?=(\s+|(![^%s]*))*\))' % _newline, Keyword.Pseudo,
- '#pop'),
- (r'%s(?=(\s+|(![^%s]*))*\))' % (_name, _newline), Name.Function,
- '#pop'),
- default('#pop')
- ],
- '(?': [
- include('_whitespace'),
- (r'\(', Punctuation, '#pop'),
- default('#pop')
- ],
- 'for': [
- include('_whitespace'),
- (r';', Punctuation, ('_for-expression', '_expression')),
- default(('_for-expression', '_expression'))
- ],
- 'print-list': [
- include('_whitespace'),
- (r';', Punctuation, '#pop'),
- (r':', Error),
- default(('_list-expression', '_expression', '_list-expression', 'form'))
- ],
- 'form': [
- include('_whitespace'),
- (r'\(', Punctuation, ('#pop', 'miscellaneous-keyword?')),
- default('#pop')
- ],
-
- # Assembly
- 'opcode': [
- include('_whitespace'),
- (r'[%s]' % _dquote, String.Double, ('operands', 'plain-string')),
- (_name, Keyword, 'operands')
- ],
- 'operands': [
- (r':', Error),
- default(('_assembly-expression', '_expression'))
- ]
- }
-
- def get_tokens_unprocessed(self, text):
- # 'in' is either a keyword or an operator.
- # If the token two tokens after 'in' is ')', 'in' is a keyword:
- # objectloop(a in b)
- # Otherwise, it is an operator:
- # objectloop(a in b && true)
- objectloop_queue = []
- objectloop_token_count = -1
- previous_token = None
- for index, token, value in RegexLexer.get_tokens_unprocessed(self,
- text):
- if previous_token is Name.Variable and value == 'in':
- objectloop_queue = [[index, token, value]]
- objectloop_token_count = 2
- elif objectloop_token_count > 0:
- if token not in Comment and token not in Text:
- objectloop_token_count -= 1
- objectloop_queue.append((index, token, value))
- else:
- if objectloop_token_count == 0:
- if objectloop_queue[-1][2] == ')':
- objectloop_queue[0][1] = Keyword
- while objectloop_queue:
- yield objectloop_queue.pop(0)
- objectloop_token_count = -1
- yield index, token, value
- if token not in Comment and token not in Text:
- previous_token = token
- while objectloop_queue:
- yield objectloop_queue.pop(0)
-
-
-class Inform7Lexer(RegexLexer):
- """
- For `Inform 7 <http://inform7.com/>`_ source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'Inform 7'
- aliases = ['inform7', 'i7']
- filenames = ['*.ni', '*.i7x']
-
- flags = re.MULTILINE | re.DOTALL | re.UNICODE
-
- _dash = Inform6Lexer._dash
- _dquote = Inform6Lexer._dquote
- _newline = Inform6Lexer._newline
- _start = r'\A|(?<=[%s])' % _newline
-
- # There are three variants of Inform 7, differing in how to
- # interpret at signs and braces in I6T. In top-level inclusions, at
- # signs in the first column are inweb syntax. In phrase definitions
- # and use options, tokens in braces are treated as I7. Use options
- # also interpret "{N}".
- tokens = {}
- token_variants = ['+i6t-not-inline', '+i6t-inline', '+i6t-use-option']
-
- for level in token_variants:
- tokens[level] = {
- '+i6-root': list(Inform6Lexer.tokens['root']),
- '+i6t-root': [ # For Inform6TemplateLexer
- (r'[^%s]*' % Inform6Lexer._newline, Comment.Preproc,
- ('directive', '+p'))
- ],
- 'root': [
- (r'(\|?\s)+', Text),
- (r'\[', Comment.Multiline, '+comment'),
- (r'[%s]' % _dquote, Generic.Heading,
- ('+main', '+titling', '+titling-string')),
- default(('+main', '+heading?'))
- ],
- '+titling-string': [
- (r'[^%s]+' % _dquote, Generic.Heading),
- (r'[%s]' % _dquote, Generic.Heading, '#pop')
- ],
- '+titling': [
- (r'\[', Comment.Multiline, '+comment'),
- (r'[^%s.;:|%s]+' % (_dquote, _newline), Generic.Heading),
- (r'[%s]' % _dquote, Generic.Heading, '+titling-string'),
- (r'[%s]{2}|(?<=[\s%s])\|[\s%s]' % (_newline, _dquote, _dquote),
- Text, ('#pop', '+heading?')),
- (r'[.;:]|(?<=[\s%s])\|' % _dquote, Text, '#pop'),
- (r'[|%s]' % _newline, Generic.Heading)
- ],
- '+main': [
- (r'(?i)[^%s:a\[(|%s]+' % (_dquote, _newline), Text),
- (r'[%s]' % _dquote, String.Double, '+text'),
- (r':', Text, '+phrase-definition'),
- (r'(?i)\bas\b', Text, '+use-option'),
- (r'\[', Comment.Multiline, '+comment'),
- (r'(\([%s])(.*?)([%s]\))' % (_dash, _dash),
- bygroups(Punctuation,
- using(this, state=('+i6-root', 'directive'),
- i6t='+i6t-not-inline'), Punctuation)),
- (r'(%s|(?<=[\s;:.%s]))\|\s|[%s]{2,}' %
- (_start, _dquote, _newline), Text, '+heading?'),
- (r'(?i)[a(|%s]' % _newline, Text)
- ],
- '+phrase-definition': [
- (r'\s+', Text),
- (r'\[', Comment.Multiline, '+comment'),
- (r'(\([%s])(.*?)([%s]\))' % (_dash, _dash),
- bygroups(Punctuation,
- using(this, state=('+i6-root', 'directive',
- 'default', 'statements'),
- i6t='+i6t-inline'), Punctuation), '#pop'),
- default('#pop')
- ],
- '+use-option': [
- (r'\s+', Text),
- (r'\[', Comment.Multiline, '+comment'),
- (r'(\([%s])(.*?)([%s]\))' % (_dash, _dash),
- bygroups(Punctuation,
- using(this, state=('+i6-root', 'directive'),
- i6t='+i6t-use-option'), Punctuation), '#pop'),
- default('#pop')
- ],
- '+comment': [
- (r'[^\[\]]+', Comment.Multiline),
- (r'\[', Comment.Multiline, '#push'),
- (r'\]', Comment.Multiline, '#pop')
- ],
- '+text': [
- (r'[^\[%s]+' % _dquote, String.Double),
- (r'\[.*?\]', String.Interpol),
- (r'[%s]' % _dquote, String.Double, '#pop')
- ],
- '+heading?': [
- (r'(\|?\s)+', Text),
- (r'\[', Comment.Multiline, '+comment'),
- (r'[%s]{4}\s+' % _dash, Text, '+documentation-heading'),
- (r'[%s]{1,3}' % _dash, Text),
- (r'(?i)(volume|book|part|chapter|section)\b[^%s]*' % _newline,
- Generic.Heading, '#pop'),
- default('#pop')
- ],
- '+documentation-heading': [
- (r'\s+', Text),
- (r'\[', Comment.Multiline, '+comment'),
- (r'(?i)documentation\s+', Text, '+documentation-heading2'),
- default('#pop')
- ],
- '+documentation-heading2': [
- (r'\s+', Text),
- (r'\[', Comment.Multiline, '+comment'),
- (r'[%s]{4}\s' % _dash, Text, '+documentation'),
- default('#pop:2')
- ],
- '+documentation': [
- (r'(?i)(%s)\s*(chapter|example)\s*:[^%s]*' %
- (_start, _newline), Generic.Heading),
- (r'(?i)(%s)\s*section\s*:[^%s]*' % (_start, _newline),
- Generic.Subheading),
- (r'((%s)\t.*?[%s])+' % (_start, _newline),
- using(this, state='+main')),
- (r'[^%s\[]+|[%s\[]' % (_newline, _newline), Text),
- (r'\[', Comment.Multiline, '+comment'),
- ],
- '+i6t-not-inline': [
- (r'(%s)@c( .*?)?([%s]|\Z)' % (_start, _newline),
- Comment.Preproc),
- (r'(%s)@([%s]+|Purpose:)[^%s]*' % (_start, _dash, _newline),
- Comment.Preproc),
- (r'(%s)@p( .*?)?([%s]|\Z)' % (_start, _newline),
- Generic.Heading, '+p')
- ],
- '+i6t-use-option': [
- include('+i6t-not-inline'),
- (r'(\{)(N)(\})', bygroups(Punctuation, Text, Punctuation))
- ],
- '+i6t-inline': [
- (r'(\{)(\S[^}]*)?(\})',
- bygroups(Punctuation, using(this, state='+main'),
- Punctuation))
- ],
- '+i6t': [
- (r'(\{[%s])(![^}]*)(\}?)' % _dash,
- bygroups(Punctuation, Comment.Single, Punctuation)),
- (r'(\{[%s])(lines)(:)([^}]*)(\}?)' % _dash,
- bygroups(Punctuation, Keyword, Punctuation, Text,
- Punctuation), '+lines'),
- (r'(\{[%s])([^:}]*)(:?)([^}]*)(\}?)' % _dash,
- bygroups(Punctuation, Keyword, Punctuation, Text,
- Punctuation)),
- (r'(\(\+)(.*?)(\+\)|\Z)',
- bygroups(Punctuation, using(this, state='+main'),
- Punctuation))
- ],
- '+p': [
- (r'[^@]+', Comment.Preproc),
- (r'(%s)@c( .*?)?([%s]|\Z)' % (_start, _newline),
- Comment.Preproc, '#pop'),
- (r'(%s)@([%s]|Purpose:)' % (_start, _dash), Comment.Preproc),
- (r'(%s)@p( .*?)?([%s]|\Z)' % (_start, _newline),
- Generic.Heading),
- (r'@', Comment.Preproc)
- ],
- '+lines': [
- (r'(%s)@c( .*?)?([%s]|\Z)' % (_start, _newline),
- Comment.Preproc),
- (r'(%s)@([%s]|Purpose:)[^%s]*' % (_start, _dash, _newline),
- Comment.Preproc),
- (r'(%s)@p( .*?)?([%s]|\Z)' % (_start, _newline),
- Generic.Heading, '+p'),
- (r'(%s)@\w*[ %s]' % (_start, _newline), Keyword),
- (r'![^%s]*' % _newline, Comment.Single),
- (r'(\{)([%s]endlines)(\})' % _dash,
- bygroups(Punctuation, Keyword, Punctuation), '#pop'),
- (r'[^@!{]+?([%s]|\Z)|.' % _newline, Text)
- ]
- }
- # Inform 7 can include snippets of Inform 6 template language,
- # so all of Inform6Lexer's states are copied here, with
- # modifications to account for template syntax. Inform7Lexer's
- # own states begin with '+' to avoid name conflicts. Some of
- # Inform6Lexer's states begin with '_': these are not modified.
- # They deal with template syntax either by including modified
- # states, or by matching r'' then pushing to modified states.
- for token in Inform6Lexer.tokens:
- if token == 'root':
- continue
- tokens[level][token] = list(Inform6Lexer.tokens[token])
- if not token.startswith('_'):
- tokens[level][token][:0] = [include('+i6t'), include(level)]
-
- def __init__(self, **options):
- level = options.get('i6t', '+i6t-not-inline')
- if level not in self._all_tokens:
- self._tokens = self.__class__.process_tokendef(level)
- else:
- self._tokens = self._all_tokens[level]
- RegexLexer.__init__(self, **options)
-
-
-class Inform6TemplateLexer(Inform7Lexer):
- """
- For `Inform 6 template
- <http://inform7.com/sources/src/i6template/Woven/index.html>`_ code.
-
- .. versionadded:: 2.0
- """
-
- name = 'Inform 6 template'
- aliases = ['i6t']
- filenames = ['*.i6t']
-
- def get_tokens_unprocessed(self, text, stack=('+i6t-root',)):
- return Inform7Lexer.get_tokens_unprocessed(self, text, stack)
-
-
-class Tads3Lexer(RegexLexer):
- """
- For `TADS 3 <http://www.tads.org/>`_ source code.
- """
-
- name = 'TADS 3'
- aliases = ['tads3']
- filenames = ['*.t']
-
- flags = re.DOTALL | re.MULTILINE
-
- _comment_single = r'(?://(?:[^\\\n]|\\+[\w\W])*$)'
- _comment_multiline = r'(?:/\*(?:[^*]|\*(?!/))*\*/)'
- _escape = (r'(?:\\(?:[\n\\<>"\'^v bnrt]|u[\da-fA-F]{,4}|x[\da-fA-F]{,2}|'
- r'[0-3]?[0-7]{1,2}))')
- _name = r'(?:[_a-zA-Z]\w*)'
- _no_quote = r'(?=\s|\\?>)'
- _operator = (r'(?:&&|\|\||\+\+|--|\?\?|::|[.,@\[\]~]|'
- r'(?:[=+\-*/%!&|^]|<<?|>>?>?)=?)')
- _ws = r'(?:\\|\s|%s|%s)' % (_comment_single, _comment_multiline)
- _ws_pp = r'(?:\\\n|[^\S\n]|%s|%s)' % (_comment_single, _comment_multiline)
-
- def _make_string_state(triple, double, verbatim=None, _escape=_escape):
- if verbatim:
- verbatim = ''.join(['(?:%s|%s)' % (re.escape(c.lower()),
- re.escape(c.upper()))
- for c in verbatim])
- char = r'"' if double else r"'"
- token = String.Double if double else String.Single
- escaped_quotes = r'+|%s(?!%s{2})' % (char, char) if triple else r''
- prefix = '%s%s' % ('t' if triple else '', 'd' if double else 's')
- tag_state_name = '%sqt' % prefix
- state = []
- if triple:
- state += [
- (r'%s{3,}' % char, token, '#pop'),
- (r'\\%s+' % char, String.Escape),
- (char, token)
- ]
- else:
- state.append((char, token, '#pop'))
- state += [
- include('s/verbatim'),
- (r'[^\\<&{}%s]+' % char, token)
- ]
- if verbatim:
- # This regex can't use `(?i)` because escape sequences are
- # case-sensitive. `<\XMP>` works; `<\xmp>` doesn't.
- state.append((r'\\?<(/|\\\\|(?!%s)\\)%s(?=[\s=>])' %
- (_escape, verbatim),
- Name.Tag, ('#pop', '%sqs' % prefix, tag_state_name)))
- else:
- state += [
- (r'\\?<!([^><\\%s]|<(?!<)|\\%s%s|%s|\\.)*>?' %
- (char, char, escaped_quotes, _escape), Comment.Multiline),
- (r'(?i)\\?<listing(?=[\s=>]|\\>)', Name.Tag,
- ('#pop', '%sqs/listing' % prefix, tag_state_name)),
- (r'(?i)\\?<xmp(?=[\s=>]|\\>)', Name.Tag,
- ('#pop', '%sqs/xmp' % prefix, tag_state_name)),
- (r'\\?<([^\s=><\\%s]|<(?!<)|\\%s%s|%s|\\.)*' %
- (char, char, escaped_quotes, _escape), Name.Tag,
- tag_state_name),
- include('s/entity')
- ]
- state += [
- include('s/escape'),
- (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' %
- (char, char, escaped_quotes, _escape), String.Interpol),
- (r'[\\&{}<]', token)
- ]
- return state
-
- def _make_tag_state(triple, double, _escape=_escape):
- char = r'"' if double else r"'"
- quantifier = r'{3,}' if triple else r''
- state_name = '%s%sqt' % ('t' if triple else '', 'd' if double else 's')
- token = String.Double if double else String.Single
- escaped_quotes = r'+|%s(?!%s{2})' % (char, char) if triple else r''
- return [
- (r'%s%s' % (char, quantifier), token, '#pop:2'),
- (r'(\s|\\\n)+', Text),
- (r'(=)(\\?")', bygroups(Punctuation, String.Double),
- 'dqs/%s' % state_name),
- (r"(=)(\\?')", bygroups(Punctuation, String.Single),
- 'sqs/%s' % state_name),
- (r'=', Punctuation, 'uqs/%s' % state_name),
- (r'\\?>', Name.Tag, '#pop'),
- (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' %
- (char, char, escaped_quotes, _escape), String.Interpol),
- (r'([^\s=><\\%s]|<(?!<)|\\%s%s|%s|\\.)+' %
- (char, char, escaped_quotes, _escape), Name.Attribute),
- include('s/escape'),
- include('s/verbatim'),
- include('s/entity'),
- (r'[\\{}&]', Name.Attribute)
- ]
-
- def _make_attribute_value_state(terminator, host_triple, host_double,
- _escape=_escape):
- token = (String.Double if terminator == r'"' else
- String.Single if terminator == r"'" else String.Other)
- host_char = r'"' if host_double else r"'"
- host_quantifier = r'{3,}' if host_triple else r''
- host_token = String.Double if host_double else String.Single
- escaped_quotes = (r'+|%s(?!%s{2})' % (host_char, host_char)
- if host_triple else r'')
- return [
- (r'%s%s' % (host_char, host_quantifier), host_token, '#pop:3'),
- (r'%s%s' % (r'' if token is String.Other else r'\\?', terminator),
- token, '#pop'),
- include('s/verbatim'),
- include('s/entity'),
- (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' %
- (host_char, host_char, escaped_quotes, _escape), String.Interpol),
- (r'([^\s"\'<%s{}\\&])+' % (r'>' if token is String.Other else r''),
- token),
- include('s/escape'),
- (r'["\'\s&{<}\\]', token)
- ]
-
- tokens = {
- 'root': [
- (u'\ufeff', Text),
- (r'\{', Punctuation, 'object-body'),
- (r';+', Punctuation),
- (r'(?=(argcount|break|case|catch|continue|default|definingobj|'
- r'delegated|do|else|for|foreach|finally|goto|if|inherited|'
- r'invokee|local|nil|new|operator|replaced|return|self|switch|'
- r'targetobj|targetprop|throw|true|try|while)\b)', Text, 'block'),
- (r'(%s)(%s*)(\()' % (_name, _ws),
- bygroups(Name.Function, using(this, state='whitespace'),
- Punctuation),
- ('block?/root', 'more/parameters', 'main/parameters')),
- include('whitespace'),
- (r'\++', Punctuation),
- (r'[^\s!"%-(*->@-_a-z{-~]+', Error), # Averts an infinite loop
- (r'(?!\Z)', Text, 'main/root')
- ],
- 'main/root': [
- include('main/basic'),
- default(('#pop', 'object-body/no-braces', 'classes', 'class'))
- ],
- 'object-body/no-braces': [
- (r';', Punctuation, '#pop'),
- (r'\{', Punctuation, ('#pop', 'object-body')),
- include('object-body')
- ],
- 'object-body': [
- (r';', Punctuation),
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- (r':', Punctuation, ('classes', 'class')),
- (r'(%s?)(%s*)(\()' % (_name, _ws),
- bygroups(Name.Function, using(this, state='whitespace'),
- Punctuation),
- ('block?', 'more/parameters', 'main/parameters')),
- (r'(%s)(%s*)(\{)' % (_name, _ws),
- bygroups(Name.Function, using(this, state='whitespace'),
- Punctuation), 'block'),
- (r'(%s)(%s*)(:)' % (_name, _ws),
- bygroups(Name.Variable, using(this, state='whitespace'),
- Punctuation),
- ('object-body/no-braces', 'classes', 'class')),
- include('whitespace'),
- (r'->|%s' % _operator, Punctuation, 'main'),
- default('main/object-body')
- ],
- 'main/object-body': [
- include('main/basic'),
- (r'(%s)(%s*)(=?)' % (_name, _ws),
- bygroups(Name.Variable, using(this, state='whitespace'),
- Punctuation), ('#pop', 'more', 'main')),
- default('#pop:2')
- ],
- 'block?/root': [
- (r'\{', Punctuation, ('#pop', 'block')),
- include('whitespace'),
- (r'(?=[\[\'"<(:])', Text, # It might be a VerbRule macro.
- ('#pop', 'object-body/no-braces', 'grammar', 'grammar-rules')),
- # It might be a macro like DefineAction.
- default(('#pop', 'object-body/no-braces'))
- ],
- 'block?': [
- (r'\{', Punctuation, ('#pop', 'block')),
- include('whitespace'),
- default('#pop')
- ],
- 'block/basic': [
- (r'[;:]+', Punctuation),
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- (r'default\b', Keyword.Reserved),
- (r'(%s)(%s*)(:)' % (_name, _ws),
- bygroups(Name.Label, using(this, state='whitespace'),
- Punctuation)),
- include('whitespace')
- ],
- 'block': [
- include('block/basic'),
- (r'(?!\Z)', Text, ('more', 'main'))
- ],
- 'block/embed': [
- (r'>>', String.Interpol, '#pop'),
- include('block/basic'),
- (r'(?!\Z)', Text, ('more/embed', 'main'))
- ],
- 'main/basic': [
- include('whitespace'),
- (r'\(', Punctuation, ('#pop', 'more', 'main')),
- (r'\[', Punctuation, ('#pop', 'more/list', 'main')),
- (r'\{', Punctuation, ('#pop', 'more/inner', 'main/inner',
- 'more/parameters', 'main/parameters')),
- (r'\*|\.{3}', Punctuation, '#pop'),
- (r'(?i)0x[\da-f]+', Number.Hex, '#pop'),
- (r'(\d+\.(?!\.)\d*|\.\d+)([eE][-+]?\d+)?|\d+[eE][-+]?\d+',
- Number.Float, '#pop'),
- (r'0[0-7]+', Number.Oct, '#pop'),
- (r'\d+', Number.Integer, '#pop'),
- (r'"""', String.Double, ('#pop', 'tdqs')),
- (r"'''", String.Single, ('#pop', 'tsqs')),
- (r'"', String.Double, ('#pop', 'dqs')),
- (r"'", String.Single, ('#pop', 'sqs')),
- (r'R"""', String.Regex, ('#pop', 'tdqr')),
- (r"R'''", String.Regex, ('#pop', 'tsqr')),
- (r'R"', String.Regex, ('#pop', 'dqr')),
- (r"R'", String.Regex, ('#pop', 'sqr')),
- # Two-token keywords
- (r'(extern)(%s+)(object\b)' % _ws,
- bygroups(Keyword.Reserved, using(this, state='whitespace'),
- Keyword.Reserved)),
- (r'(function|method)(%s*)(\()' % _ws,
- bygroups(Keyword.Reserved, using(this, state='whitespace'),
- Punctuation),
- ('#pop', 'block?', 'more/parameters', 'main/parameters')),
- (r'(modify)(%s+)(grammar\b)' % _ws,
- bygroups(Keyword.Reserved, using(this, state='whitespace'),
- Keyword.Reserved),
- ('#pop', 'object-body/no-braces', ':', 'grammar')),
- (r'(new)(%s+(?=(?:function|method)\b))' % _ws,
- bygroups(Keyword.Reserved, using(this, state='whitespace'))),
- (r'(object)(%s+)(template\b)' % _ws,
- bygroups(Keyword.Reserved, using(this, state='whitespace'),
- Keyword.Reserved), ('#pop', 'template')),
- (r'(string)(%s+)(template\b)' % _ws,
- bygroups(Keyword, using(this, state='whitespace'),
- Keyword.Reserved), ('#pop', 'function-name')),
- # Keywords
- (r'(argcount|definingobj|invokee|replaced|targetobj|targetprop)\b',
- Name.Builtin, '#pop'),
- (r'(break|continue|goto)\b', Keyword.Reserved, ('#pop', 'label')),
- (r'(case|extern|if|intrinsic|return|static|while)\b',
- Keyword.Reserved),
- (r'catch\b', Keyword.Reserved, ('#pop', 'catch')),
- (r'class\b', Keyword.Reserved,
- ('#pop', 'object-body/no-braces', 'class')),
- (r'(default|do|else|finally|try)\b', Keyword.Reserved, '#pop'),
- (r'(dictionary|property)\b', Keyword.Reserved,
- ('#pop', 'constants')),
- (r'enum\b', Keyword.Reserved, ('#pop', 'enum')),
- (r'export\b', Keyword.Reserved, ('#pop', 'main')),
- (r'(for|foreach)\b', Keyword.Reserved,
- ('#pop', 'more/inner', 'main/inner')),
- (r'(function|method)\b', Keyword.Reserved,
- ('#pop', 'block?', 'function-name')),
- (r'grammar\b', Keyword.Reserved,
- ('#pop', 'object-body/no-braces', 'grammar')),
- (r'inherited\b', Keyword.Reserved, ('#pop', 'inherited')),
- (r'local\b', Keyword.Reserved,
- ('#pop', 'more/local', 'main/local')),
- (r'(modify|replace|switch|throw|transient)\b', Keyword.Reserved,
- '#pop'),
- (r'new\b', Keyword.Reserved, ('#pop', 'class')),
- (r'(nil|true)\b', Keyword.Constant, '#pop'),
- (r'object\b', Keyword.Reserved, ('#pop', 'object-body/no-braces')),
- (r'operator\b', Keyword.Reserved, ('#pop', 'operator')),
- (r'propertyset\b', Keyword.Reserved,
- ('#pop', 'propertyset', 'main')),
- (r'self\b', Name.Builtin.Pseudo, '#pop'),
- (r'template\b', Keyword.Reserved, ('#pop', 'template')),
- # Operators
- (r'(__objref|defined)(%s*)(\()' % _ws,
- bygroups(Operator.Word, using(this, state='whitespace'),
- Operator), ('#pop', 'more/__objref', 'main')),
- (r'delegated\b', Operator.Word),
- # Compiler-defined macros and built-in properties
- (r'(__DATE__|__DEBUG|__LINE__|__FILE__|'
- r'__TADS_MACRO_FORMAT_VERSION|__TADS_SYS_\w*|__TADS_SYSTEM_NAME|'
- r'__TADS_VERSION_MAJOR|__TADS_VERSION_MINOR|__TADS3|__TIME__|'
- r'construct|finalize|grammarInfo|grammarTag|lexicalParent|'
- r'miscVocab|sourceTextGroup|sourceTextGroupName|'
- r'sourceTextGroupOrder|sourceTextOrder)\b', Name.Builtin, '#pop')
- ],
- 'main': [
- include('main/basic'),
- (_name, Name, '#pop'),
- default('#pop')
- ],
- 'more/basic': [
- (r'\(', Punctuation, ('more/list', 'main')),
- (r'\[', Punctuation, ('more', 'main')),
- (r'\.{3}', Punctuation),
- (r'->|\.\.', Punctuation, 'main'),
- (r'(?=;)|[:)\]]', Punctuation, '#pop'),
- include('whitespace'),
- (_operator, Operator, 'main'),
- (r'\?', Operator, ('main', 'more/conditional', 'main')),
- (r'(is|not)(%s+)(in\b)' % _ws,
- bygroups(Operator.Word, using(this, state='whitespace'),
- Operator.Word)),
- (r'[^\s!"%-_a-z{-~]+', Error) # Averts an infinite loop
- ],
- 'more': [
- include('more/basic'),
- default('#pop')
- ],
- # Then expression (conditional operator)
- 'more/conditional': [
- (r':(?!:)', Operator, '#pop'),
- include('more')
- ],
- # Embedded expressions
- 'more/embed': [
- (r'>>', String.Interpol, '#pop:2'),
- include('more')
- ],
- # For/foreach loop initializer or short-form anonymous function
- 'main/inner': [
- (r'\(', Punctuation, ('#pop', 'more/inner', 'main/inner')),
- (r'local\b', Keyword.Reserved, ('#pop', 'main/local')),
- include('main')
- ],
- 'more/inner': [
- (r'\}', Punctuation, '#pop'),
- (r',', Punctuation, 'main/inner'),
- (r'(in|step)\b', Keyword, 'main/inner'),
- include('more')
- ],
- # Local
- 'main/local': [
- (_name, Name.Variable, '#pop'),
- include('whitespace')
- ],
- 'more/local': [
- (r',', Punctuation, 'main/local'),
- include('more')
- ],
- # List
- 'more/list': [
- (r'[,:]', Punctuation, 'main'),
- include('more')
- ],
- # Parameter list
- 'main/parameters': [
- (r'(%s)(%s*)(?=:)' % (_name, _ws),
- bygroups(Name.Variable, using(this, state='whitespace')), '#pop'),
- (r'(%s)(%s+)(%s)' % (_name, _ws, _name),
- bygroups(Name.Class, using(this, state='whitespace'),
- Name.Variable), '#pop'),
- (r'\[+', Punctuation),
- include('main/basic'),
- (_name, Name.Variable, '#pop'),
- default('#pop')
- ],
- 'more/parameters': [
- (r'(:)(%s*(?=[?=,:)]))' % _ws,
- bygroups(Punctuation, using(this, state='whitespace'))),
- (r'[?\]]+', Punctuation),
- (r'[:)]', Punctuation, ('#pop', 'multimethod?')),
- (r',', Punctuation, 'main/parameters'),
- (r'=', Punctuation, ('more/parameter', 'main')),
- include('more')
- ],
- 'more/parameter': [
- (r'(?=[,)])', Text, '#pop'),
- include('more')
- ],
- 'multimethod?': [
- (r'multimethod\b', Keyword, '#pop'),
- include('whitespace'),
- default('#pop')
- ],
-
- # Statements and expressions
- 'more/__objref': [
- (r',', Punctuation, 'mode'),
- (r'\)', Operator, '#pop'),
- include('more')
- ],
- 'mode': [
- (r'(error|warn)\b', Keyword, '#pop'),
- include('whitespace')
- ],
- 'catch': [
- (r'\(+', Punctuation),
- (_name, Name.Exception, ('#pop', 'variables')),
- include('whitespace')
- ],
- 'enum': [
- include('whitespace'),
- (r'token\b', Keyword, ('#pop', 'constants')),
- default(('#pop', 'constants'))
- ],
- 'grammar': [
- (r'\)+', Punctuation),
- (r'\(', Punctuation, 'grammar-tag'),
- (r':', Punctuation, 'grammar-rules'),
- (_name, Name.Class),
- include('whitespace')
- ],
- 'grammar-tag': [
- include('whitespace'),
- (r'"""([^\\"<]|""?(?!")|\\"+|\\.|<(?!<))+("{3,}|<<)|'
- r'R"""([^\\"]|""?(?!")|\\"+|\\.)+"{3,}|'
- r"'''([^\\'<]|''?(?!')|\\'+|\\.|<(?!<))+('{3,}|<<)|"
- r"R'''([^\\']|''?(?!')|\\'+|\\.)+'{3,}|"
- r'"([^\\"<]|\\.|<(?!<))+("|<<)|R"([^\\"]|\\.)+"|'
- r"'([^\\'<]|\\.|<(?!<))+('|<<)|R'([^\\']|\\.)+'|"
- r"([^)\s\\/]|/(?![/*]))+|\)", String.Other, '#pop')
- ],
- 'grammar-rules': [
- include('string'),
- include('whitespace'),
- (r'(\[)(%s*)(badness)' % _ws,
- bygroups(Punctuation, using(this, state='whitespace'), Keyword),
- 'main'),
- (r'->|%s|[()]' % _operator, Punctuation),
- (_name, Name.Constant),
- default('#pop:2')
- ],
- ':': [
- (r':', Punctuation, '#pop')
- ],
- 'function-name': [
- (r'(<<([^>]|>>>|>(?!>))*>>)+', String.Interpol),
- (r'(?=%s?%s*[({])' % (_name, _ws), Text, '#pop'),
- (_name, Name.Function, '#pop'),
- include('whitespace')
- ],
- 'inherited': [
- (r'<', Punctuation, ('#pop', 'classes', 'class')),
- include('whitespace'),
- (_name, Name.Class, '#pop'),
- default('#pop')
- ],
- 'operator': [
- (r'negate\b', Operator.Word, '#pop'),
- include('whitespace'),
- (_operator, Operator),
- default('#pop')
- ],
- 'propertyset': [
- (r'\(', Punctuation, ('more/parameters', 'main/parameters')),
- (r'\{', Punctuation, ('#pop', 'object-body')),
- include('whitespace')
- ],
- 'template': [
- (r'(?=;)', Text, '#pop'),
- include('string'),
- (r'inherited\b', Keyword.Reserved),
- include('whitespace'),
- (r'->|\?|%s' % _operator, Punctuation),
- (_name, Name.Variable)
- ],
-
- # Identifiers
- 'class': [
- (r'\*|\.{3}', Punctuation, '#pop'),
- (r'object\b', Keyword.Reserved, '#pop'),
- (r'transient\b', Keyword.Reserved),
- (_name, Name.Class, '#pop'),
- include('whitespace'),
- default('#pop')
- ],
- 'classes': [
- (r'[:,]', Punctuation, 'class'),
- include('whitespace'),
- (r'>', Punctuation, '#pop'),
- default('#pop')
- ],
- 'constants': [
- (r',+', Punctuation),
- (r';', Punctuation, '#pop'),
- (r'property\b', Keyword.Reserved),
- (_name, Name.Constant),
- include('whitespace')
- ],
- 'label': [
- (_name, Name.Label, '#pop'),
- include('whitespace'),
- default('#pop')
- ],
- 'variables': [
- (r',+', Punctuation),
- (r'\)', Punctuation, '#pop'),
- include('whitespace'),
- (_name, Name.Variable)
- ],
-
- # Whitespace and comments
- 'whitespace': [
- (r'^%s*#(%s|[^\n]|(?<=\\)\n)*\n?' % (_ws_pp, _comment_multiline),
- Comment.Preproc),
- (_comment_single, Comment.Single),
- (_comment_multiline, Comment.Multiline),
- (r'\\+\n+%s*#?|\n+|([^\S\n]|\\)+' % _ws_pp, Text)
- ],
-
- # Strings
- 'string': [
- (r'"""', String.Double, 'tdqs'),
- (r"'''", String.Single, 'tsqs'),
- (r'"', String.Double, 'dqs'),
- (r"'", String.Single, 'sqs')
- ],
- 's/escape': [
- (r'\{\{|\}\}|%s' % _escape, String.Escape)
- ],
- 's/verbatim': [
- (r'<<\s*(as\s+decreasingly\s+likely\s+outcomes|cycling|else|end|'
- r'first\s+time|one\s+of|only|or|otherwise|'
- r'(sticky|(then\s+)?(purely\s+)?at)\s+random|stopping|'
- r'(then\s+)?(half\s+)?shuffled|\|\|)\s*>>', String.Interpol),
- (r'<<(%%(_(%s|\\?.)|[\-+ ,#]|\[\d*\]?)*\d*\.?\d*(%s|\\?.)|'
- r'\s*((else|otherwise)\s+)?(if|unless)\b)?' % (_escape, _escape),
- String.Interpol, ('block/embed', 'more/embed', 'main'))
- ],
- 's/entity': [
- (r'(?i)&(#(x[\da-f]+|\d+)|[a-z][\da-z]*);?', Name.Entity)
- ],
- 'tdqs': _make_string_state(True, True),
- 'tsqs': _make_string_state(True, False),
- 'dqs': _make_string_state(False, True),
- 'sqs': _make_string_state(False, False),
- 'tdqs/listing': _make_string_state(True, True, 'listing'),
- 'tsqs/listing': _make_string_state(True, False, 'listing'),
- 'dqs/listing': _make_string_state(False, True, 'listing'),
- 'sqs/listing': _make_string_state(False, False, 'listing'),
- 'tdqs/xmp': _make_string_state(True, True, 'xmp'),
- 'tsqs/xmp': _make_string_state(True, False, 'xmp'),
- 'dqs/xmp': _make_string_state(False, True, 'xmp'),
- 'sqs/xmp': _make_string_state(False, False, 'xmp'),
-
- # Tags
- 'tdqt': _make_tag_state(True, True),
- 'tsqt': _make_tag_state(True, False),
- 'dqt': _make_tag_state(False, True),
- 'sqt': _make_tag_state(False, False),
- 'dqs/tdqt': _make_attribute_value_state(r'"', True, True),
- 'dqs/tsqt': _make_attribute_value_state(r'"', True, False),
- 'dqs/dqt': _make_attribute_value_state(r'"', False, True),
- 'dqs/sqt': _make_attribute_value_state(r'"', False, False),
- 'sqs/tdqt': _make_attribute_value_state(r"'", True, True),
- 'sqs/tsqt': _make_attribute_value_state(r"'", True, False),
- 'sqs/dqt': _make_attribute_value_state(r"'", False, True),
- 'sqs/sqt': _make_attribute_value_state(r"'", False, False),
- 'uqs/tdqt': _make_attribute_value_state(_no_quote, True, True),
- 'uqs/tsqt': _make_attribute_value_state(_no_quote, True, False),
- 'uqs/dqt': _make_attribute_value_state(_no_quote, False, True),
- 'uqs/sqt': _make_attribute_value_state(_no_quote, False, False),
-
- # Regular expressions
- 'tdqr': [
- (r'[^\\"]+', String.Regex),
- (r'\\"*', String.Regex),
- (r'"{3,}', String.Regex, '#pop'),
- (r'"', String.Regex)
- ],
- 'tsqr': [
- (r"[^\\']+", String.Regex),
- (r"\\'*", String.Regex),
- (r"'{3,}", String.Regex, '#pop'),
- (r"'", String.Regex)
- ],
- 'dqr': [
- (r'[^\\"]+', String.Regex),
- (r'\\"?', String.Regex),
- (r'"', String.Regex, '#pop')
- ],
- 'sqr': [
- (r"[^\\']+", String.Regex),
- (r"\\'?", String.Regex),
- (r"'", String.Regex, '#pop')
- ]
- }
-
- def get_tokens_unprocessed(self, text, **kwargs):
- pp = r'^%s*#%s*' % (self._ws_pp, self._ws_pp)
- if_false_level = 0
- for index, token, value in (
- RegexLexer.get_tokens_unprocessed(self, text, **kwargs)):
- if if_false_level == 0: # Not in a false #if
- if (token is Comment.Preproc and
- re.match(r'%sif%s+(0|nil)%s*$\n?' %
- (pp, self._ws_pp, self._ws_pp), value)):
- if_false_level = 1
- else: # In a false #if
- if token is Comment.Preproc:
- if (if_false_level == 1 and
- re.match(r'%sel(if|se)\b' % pp, value)):
- if_false_level = 0
- elif re.match(r'%sif' % pp, value):
- if_false_level += 1
- elif re.match(r'%sendif\b' % pp, value):
- if_false_level -= 1
- else:
- token = Comment
- yield index, token, value
diff --git a/pygments/lexers/iolang.py b/pygments/lexers/iolang.py
deleted file mode 100644
index f33c8713..00000000
--- a/pygments/lexers/iolang.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.iolang
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Io language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number
-
-__all__ = ['IoLexer']
-
-
-class IoLexer(RegexLexer):
- """
- For `Io <http://iolanguage.com/>`_ (a small, prototype-based
- programming language) source.
-
- .. versionadded:: 0.10
- """
- name = 'Io'
- filenames = ['*.io']
- aliases = ['io']
- mimetypes = ['text/x-iosrc']
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'\s+', Text),
- # Comments
- (r'//(.*?)\n', Comment.Single),
- (r'#(.*?)\n', Comment.Single),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
- (r'/\+', Comment.Multiline, 'nestedcomment'),
- # DoubleQuotedString
- (r'"(\\\\|\\"|[^"])*"', String),
- # Operators
- (r'::=|:=|=|\(|\)|;|,|\*|-|\+|>|<|@|!|/|\||\^|\.|%|&|\[|\]|\{|\}',
- Operator),
- # keywords
- (r'(clone|do|doFile|doString|method|for|if|else|elseif|then)\b',
- Keyword),
- # constants
- (r'(nil|false|true)\b', Name.Constant),
- # names
- (r'(Object|list|List|Map|args|Sequence|Coroutine|File)\b',
- Name.Builtin),
- (r'[a-zA-Z_]\w*', Name),
- # numbers
- (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
- (r'\d+', Number.Integer)
- ],
- 'nestedcomment': [
- (r'[^+/]+', Comment.Multiline),
- (r'/\+', Comment.Multiline, '#push'),
- (r'\+/', Comment.Multiline, '#pop'),
- (r'[+/]', Comment.Multiline),
- ]
- }
diff --git a/pygments/lexers/j.py b/pygments/lexers/j.py
deleted file mode 100644
index baec89ef..00000000
--- a/pygments/lexers/j.py
+++ /dev/null
@@ -1,146 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.j
- ~~~~~~~~~~~~~~~~~
-
- Lexer for the J programming language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, words, include
-from pygments.token import Comment, Keyword, Name, Number, Operator, Punctuation, \
- String, Text
-
-__all__ = ['JLexer']
-
-
-class JLexer(RegexLexer):
- """
- For `J <http://jsoftware.com/>`_ source code.
-
- .. versionadded:: 2.1
- """
-
- name = 'J'
- aliases = ['j']
- filenames = ['*.ijs']
- mimetypes = ['text/x-j']
-
- validName = r'\b[a-zA-Z]\w*'
-
- tokens = {
- 'root': [
- # Shebang script
- (r'#!.*$', Comment.Preproc),
-
- # Comments
- (r'NB\..*', Comment.Single),
- (r'\n+\s*Note', Comment.Multiline, 'comment'),
- (r'\s*Note.*', Comment.Single),
-
- # Whitespace
- (r'\s+', Text),
-
- # Strings
- (r"'", String, 'singlequote'),
-
- # Definitions
- (r'0\s+:\s*0|noun\s+define\s*$', Name.Entity, 'nounDefinition'),
- (r'(([1-4]|13)\s+:\s*0|(adverb|conjunction|dyad|monad|verb)\s+define)\b',
- Name.Function, 'explicitDefinition'),
-
- # Flow Control
- (words(('for_', 'goto_', 'label_'), suffix=validName+r'\.'), Name.Label),
- (words((
- 'assert', 'break', 'case', 'catch', 'catchd',
- 'catcht', 'continue', 'do', 'else', 'elseif',
- 'end', 'fcase', 'for', 'if', 'return',
- 'select', 'throw', 'try', 'while', 'whilst',
- ), suffix=r'\.'), Name.Label),
-
- # Variable Names
- (validName, Name.Variable),
-
- # Standard Library
- (words((
- 'ARGV', 'CR', 'CRLF', 'DEL', 'Debug',
- 'EAV', 'EMPTY', 'FF', 'JVERSION', 'LF',
- 'LF2', 'Note', 'TAB', 'alpha17', 'alpha27',
- 'apply', 'bind', 'boxopen', 'boxxopen', 'bx',
- 'clear', 'cutLF', 'cutopen', 'datatype', 'def',
- 'dfh', 'drop', 'each', 'echo', 'empty',
- 'erase', 'every', 'evtloop', 'exit', 'expand',
- 'fetch', 'file2url', 'fixdotdot', 'fliprgb', 'getargs',
- 'getenv', 'hfd', 'inv', 'inverse', 'iospath',
- 'isatty', 'isutf8', 'items', 'leaf', 'list',
- 'nameclass', 'namelist', 'names', 'nc',
- 'nl', 'on', 'pick', 'rows',
- 'script', 'scriptd', 'sign', 'sminfo', 'smoutput',
- 'sort', 'split', 'stderr', 'stdin', 'stdout',
- 'table', 'take', 'timespacex', 'timex', 'tmoutput',
- 'toCRLF', 'toHOST', 'toJ', 'tolower', 'toupper',
- 'type', 'ucp', 'ucpcount', 'usleep', 'utf8',
- 'uucp',
- )), Name.Function),
-
- # Copula
- (r'=[.:]', Operator),
-
- # Builtins
- (r'[-=+*#$%@!~`^&";:.,<>{}\[\]\\|/]', Operator),
-
- # Short Keywords
- (r'[abCdDeEfHiIjLMoprtT]\.', Keyword.Reserved),
- (r'[aDiLpqsStux]\:', Keyword.Reserved),
- (r'(_[0-9])\:', Keyword.Constant),
-
- # Parens
- (r'\(', Punctuation, 'parentheses'),
-
- # Numbers
- include('numbers'),
- ],
-
- 'comment': [
- (r'[^)]', Comment.Multiline),
- (r'^\)', Comment.Multiline, '#pop'),
- (r'[)]', Comment.Multiline),
- ],
-
- 'explicitDefinition': [
- (r'\b[nmuvxy]\b', Name.Decorator),
- include('root'),
- (r'[^)]', Name),
- (r'^\)', Name.Label, '#pop'),
- (r'[)]', Name),
- ],
-
- 'numbers': [
- (r'\b_{1,2}\b', Number),
- (r'_?\d+(\.\d+)?(\s*[ejr]\s*)_?\d+(\.?=\d+)?', Number),
- (r'_?\d+\.(?=\d+)', Number.Float),
- (r'_?\d+x', Number.Integer.Long),
- (r'_?\d+', Number.Integer),
- ],
-
- 'nounDefinition': [
- (r'[^)]', String),
- (r'^\)', Name.Label, '#pop'),
- (r'[)]', String),
- ],
-
- 'parentheses': [
- (r'\)', Punctuation, '#pop'),
- # include('nounDefinition'),
- include('explicitDefinition'),
- include('root'),
- ],
-
- 'singlequote': [
- (r"[^']", String),
- (r"''", String),
- (r"'", String, '#pop'),
- ],
- }
diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py
deleted file mode 100644
index e61c451e..00000000
--- a/pygments/lexers/javascript.py
+++ /dev/null
@@ -1,1525 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.javascript
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for JavaScript and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, default, using, \
- this, words, combined
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Other
-from pygments.util import get_bool_opt, iteritems
-import pygments.unistring as uni
-
-__all__ = ['JavascriptLexer', 'KalLexer', 'LiveScriptLexer', 'DartLexer',
- 'TypeScriptLexer', 'LassoLexer', 'ObjectiveJLexer',
- 'CoffeeScriptLexer', 'MaskLexer', 'EarlGreyLexer', 'JuttleLexer']
-
-JS_IDENT_START = ('(?:[$_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') +
- ']|\\\\u[a-fA-F0-9]{4})')
-JS_IDENT_PART = ('(?:[$' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl',
- 'Mn', 'Mc', 'Nd', 'Pc') +
- u'\u200c\u200d]|\\\\u[a-fA-F0-9]{4})')
-JS_IDENT = JS_IDENT_START + '(?:' + JS_IDENT_PART + ')*'
-
-
-class JavascriptLexer(RegexLexer):
- """
- For JavaScript source code.
- """
-
- name = 'JavaScript'
- aliases = ['js', 'javascript']
- filenames = ['*.js', '*.jsm']
- mimetypes = ['application/javascript', 'application/x-javascript',
- 'text/x-javascript', 'text/javascript']
-
- flags = re.DOTALL | re.UNICODE | re.MULTILINE
-
- tokens = {
- 'commentsandwhitespace': [
- (r'\s+', Text),
- (r'<!--', Comment),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline)
- ],
- 'slashstartsregex': [
- include('commentsandwhitespace'),
- (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gimuy]+\b|\B)', String.Regex, '#pop'),
- (r'(?=/)', Text, ('#pop', 'badregex')),
- default('#pop')
- ],
- 'badregex': [
- (r'\n', Text, '#pop')
- ],
- 'root': [
- (r'\A#! ?/.*?\n', Comment.Hashbang), # recognized by node.js
- (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
- include('commentsandwhitespace'),
- (r'(\.\d+|[0-9]+\.[0-9]*)([eE][-+]?[0-9]+)?', Number.Float),
- (r'0[bB][01]+', Number.Bin),
- (r'0[oO][0-7]+', Number.Oct),
- (r'0[xX][0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
- (r'\.\.\.|=>', Punctuation),
- (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
- r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
- (r'(for|in|while|do|break|return|continue|switch|case|default|if|else|'
- r'throw|try|catch|finally|new|delete|typeof|instanceof|void|yield|'
- r'this|of)\b', Keyword, '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|'
- r'transient|volatile)\b', Keyword.Reserved),
- (r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
- (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
- r'Number|Object|Packages|RegExp|String|Promise|Proxy|sun|decodeURI|'
- r'decodeURIComponent|encodeURI|encodeURIComponent|'
- r'Error|eval|isFinite|isNaN|isSafeInteger|parseFloat|parseInt|'
- r'document|this|window)\b', Name.Builtin),
- (JS_IDENT, Name.Other),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r'`', String.Backtick, 'interp'),
- ],
- 'interp': [
- (r'`', String.Backtick, '#pop'),
- (r'\\\\', String.Backtick),
- (r'\\`', String.Backtick),
- (r'\$\{', String.Interpol, 'interp-inside'),
- (r'\$', String.Backtick),
- (r'[^`\\$]+', String.Backtick),
- ],
- 'interp-inside': [
- # TODO: should this include single-line comments and allow nesting strings?
- (r'\}', String.Interpol, '#pop'),
- include('root'),
- ],
- # (\\\\|\\`|[^`])*`', String.Backtick),
- }
-
-
-class KalLexer(RegexLexer):
- """
- For `Kal`_ source code.
-
- .. _Kal: http://rzimmerman.github.io/kal
-
-
- .. versionadded:: 2.0
- """
-
- name = 'Kal'
- aliases = ['kal']
- filenames = ['*.kal']
- mimetypes = ['text/kal', 'application/kal']
-
- flags = re.DOTALL
- tokens = {
- 'commentsandwhitespace': [
- (r'\s+', Text),
- (r'###[^#].*?###', Comment.Multiline),
- (r'#(?!##[^#]).*?\n', Comment.Single),
- ],
- 'functiondef': [
- (r'[$a-zA-Z_][\w$]*\s*', Name.Function, '#pop'),
- include('commentsandwhitespace'),
- ],
- 'classdef': [
- (r'\binherits\s+from\b', Keyword),
- (r'[$a-zA-Z_][\w$]*\s*\n', Name.Class, '#pop'),
- (r'[$a-zA-Z_][\w$]*\s*', Name.Class),
- include('commentsandwhitespace'),
- ],
- 'listcomprehension': [
- (r'\]', Punctuation, '#pop'),
- (r'\b(property|value)\b', Keyword),
- include('root'),
- ],
- 'waitfor': [
- (r'\n', Punctuation, '#pop'),
- (r'\bfrom\b', Keyword),
- include('root'),
- ],
- 'root': [
- include('commentsandwhitespace'),
- (r'/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex),
- (r'\?|:|_(?=\n)|==?|!=|-(?!>)|[<>+*/-]=?',
- Operator),
- (r'\b(and|or|isnt|is|not|but|bitwise|mod|\^|xor|exists|'
- r'doesnt\s+exist)\b', Operator.Word),
- (r'(?:\([^()]+\))?\s*>', Name.Function),
- (r'[{(]', Punctuation),
- (r'\[', Punctuation, 'listcomprehension'),
- (r'[})\].,]', Punctuation),
- (r'\b(function|method|task)\b', Keyword.Declaration, 'functiondef'),
- (r'\bclass\b', Keyword.Declaration, 'classdef'),
- (r'\b(safe\s+)?wait\s+for\b', Keyword, 'waitfor'),
- (r'\b(me|this)(\.[$a-zA-Z_][\w.$]*)?\b', Name.Variable.Instance),
- (r'(?<![.$])(for(\s+(parallel|series))?|in|of|while|until|'
- r'break|return|continue|'
- r'when|if|unless|else|otherwise|except\s+when|'
- r'throw|raise|fail\s+with|try|catch|finally|new|delete|'
- r'typeof|instanceof|super|run\s+in\s+parallel|'
- r'inherits\s+from)\b', Keyword),
- (r'(?<![.$])(true|false|yes|no|on|off|null|nothing|none|'
- r'NaN|Infinity|undefined)\b',
- Keyword.Constant),
- (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
- r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
- r'decodeURIComponent|encodeURI|encodeURIComponent|'
- r'eval|isFinite|isNaN|isSafeInteger|parseFloat|parseInt|document|'
- r'window|'
- r'print)\b',
- Name.Builtin),
- (r'[$a-zA-Z_][\w.$]*\s*(:|[+\-*/]?\=)?\b', Name.Variable),
- (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),
- ('"""', String, 'tdqs'),
- ("'''", String, 'tsqs'),
- ('"', String, 'dqs'),
- ("'", String, 'sqs'),
- ],
- 'strings': [
- (r'[^#\\\'"]+', String),
- # note that all kal 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 LiveScriptLexer(RegexLexer):
- """
- For `LiveScript`_ source code.
-
- .. _LiveScript: http://gkz.github.com/LiveScript/
-
- .. versionadded:: 1.6
- """
-
- name = 'LiveScript'
- aliases = ['live-script', 'livescript']
- filenames = ['*.ls']
- mimetypes = ['text/livescript']
-
- flags = re.DOTALL
- 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'//', String.Regex, ('#pop', 'multilineregex')),
- (r'/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
- default('#pop'),
- ],
- 'root': [
- # this next expr leads to infinite loops root -> slashstartsregex
- # (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
- include('commentsandwhitespace'),
- (r'(?:\([^()]+\))?[ ]*[~-]{1,2}>|'
- r'(?:\(?[^()\n]+\)?)?[ ]*<[~-]{1,2}', Name.Function),
- (r'\+\+|&&|(?<![.$])\b(?:and|x?or|is|isnt|not)\b|\?|:|=|'
- r'\|\||\\(?=\n)|(<<|>>>?|==?|!=?|'
- r'~(?!\~?>)|-(?!\-?>)|<(?!\[)|(?<!\])>|'
- r'[+*`%&|^/])=?',
- Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
- (r'(?<![.$])(for|own|in|of|while|until|loop|break|'
- r'return|continue|switch|when|then|if|unless|else|'
- r'throw|try|catch|finally|new|delete|typeof|instanceof|super|'
- r'extends|this|class|by|const|var|to|til)\b', Keyword,
- 'slashstartsregex'),
- (r'(?<![.$])(true|false|yes|no|on|off|'
- r'null|NaN|Infinity|undefined|void)\b',
- Keyword.Constant),
- (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
- r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
- r'decodeURIComponent|encodeURI|encodeURIComponent|'
- r'eval|isFinite|isNaN|parseFloat|parseInt|document|window)\b',
- Name.Builtin),
- (r'[$a-zA-Z_][\w.\-:$]*\s*[:=]\s', Name.Variable,
- 'slashstartsregex'),
- (r'@[$a-zA-Z_][\w.\-:$]*\s*[:=]\s', Name.Variable.Instance,
- 'slashstartsregex'),
- (r'@', Name.Other, 'slashstartsregex'),
- (r'@?[$a-zA-Z_][\w-]*', Name.Other, 'slashstartsregex'),
- (r'[0-9]+\.[0-9]+([eE][0-9]+)?[fd]?(?:[a-zA-Z_]+)?', Number.Float),
- (r'[0-9]+(~[0-9a-z]+)?(?:[a-zA-Z_]+)?', Number.Integer),
- ('"""', String, 'tdqs'),
- ("'''", String, 'tsqs'),
- ('"', String, 'dqs'),
- ("'", String, 'sqs'),
- (r'\\\S+', String),
- (r'<\[.*?\]>', String),
- ],
- '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"),
- (r'#', 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"),
- (r'#', String),
- include('strings'),
- ],
- 'tsqs': [
- (r"'''", String, '#pop'),
- (r'#|\\.|\'|"', String), # no need to escape quotes in triple-strings
- include('strings')
- ],
- }
-
-
-class DartLexer(RegexLexer):
- """
- For `Dart <http://dartlang.org/>`_ source code.
-
- .. versionadded:: 1.5
- """
-
- name = 'Dart'
- aliases = ['dart']
- filenames = ['*.dart']
- mimetypes = ['text/x-dart']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- include('string_literal'),
- (r'#!(.*?)$', Comment.Preproc),
- (r'\b(import|export)\b', Keyword, 'import_decl'),
- (r'\b(library|source|part of|part)\b', Keyword),
- (r'[^\S\n]+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'\b(class)\b(\s+)',
- bygroups(Keyword.Declaration, Text), 'class'),
- (r'\b(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'\b(abstract|async|await|const|extends|factory|final|get|'
- r'implements|native|operator|set|static|sync|typedef|var|with|'
- r'yield)\b', Keyword.Declaration),
- (r'\b(bool|double|dynamic|int|num|Object|String|void)\b', Keyword.Type),
- (r'\b(false|null|true)\b', Keyword.Constant),
- (r'[~!%^&*+=|?:<>/-]|as\b', Operator),
- (r'[a-zA-Z_$]\w*:', Name.Label),
- (r'[a-zA-Z_$]\w*', Name),
- (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_$]\w*', Name.Class, '#pop')
- ],
- 'import_decl': [
- include('string_literal'),
- (r'\s+', Text),
- (r'\b(as|show|hide)\b', Keyword),
- (r'[a-zA-Z_$]\w*', Name),
- (r'\,', Punctuation),
- (r'\;', Punctuation, '#pop')
- ],
- 'string_literal': [
- # Raw strings.
- (r'r"""([\w\W]*?)"""', String.Double),
- (r"r'''([\w\W]*?)'''", String.Single),
- (r'r"(.*?)"', String.Double),
- (r"r'(.*?)'", String.Single),
- # Normal Strings.
- (r'"""', String.Double, 'string_double_multiline'),
- (r"'''", String.Single, 'string_single_multiline'),
- (r'"', String.Double, 'string_double'),
- (r"'", String.Single, 'string_single')
- ],
- 'string_common': [
- (r"\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]*\}|[a-z'\"$\\])",
- String.Escape),
- (r'(\$)([a-zA-Z_]\w*)', bygroups(String.Interpol, Name)),
- (r'(\$\{)(.*?)(\})',
- bygroups(String.Interpol, using(this), String.Interpol))
- ],
- 'string_double': [
- (r'"', String.Double, '#pop'),
- (r'[^"$\\\n]+', String.Double),
- include('string_common'),
- (r'\$+', String.Double)
- ],
- 'string_double_multiline': [
- (r'"""', String.Double, '#pop'),
- (r'[^"$\\]+', String.Double),
- include('string_common'),
- (r'(\$|\")+', String.Double)
- ],
- 'string_single': [
- (r"'", String.Single, '#pop'),
- (r"[^'$\\\n]+", String.Single),
- include('string_common'),
- (r'\$+', String.Single)
- ],
- 'string_single_multiline': [
- (r"'''", String.Single, '#pop'),
- (r'[^\'$\\]+', String.Single),
- include('string_common'),
- (r'(\$|\')+', String.Single)
- ]
- }
-
-
-class TypeScriptLexer(RegexLexer):
- """
- For `TypeScript <http://typescriptlang.org/>`_ source code.
-
- .. versionadded:: 1.6
- """
-
- name = 'TypeScript'
- aliases = ['ts', 'typescript']
- filenames = ['*.ts', '*.tsx']
- mimetypes = ['text/x-typescript']
-
- flags = re.DOTALL | re.MULTILINE
-
- # Higher priority than the TypoScriptLexer, as TypeScript is far more
- # common these days
- priority = 0.5
-
- tokens = {
- 'commentsandwhitespace': [
- (r'\s+', Text),
- (r'<!--', Comment),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline)
- ],
- 'slashstartsregex': [
- include('commentsandwhitespace'),
- (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
- (r'(?=/)', Text, ('#pop', 'badregex')),
- default('#pop')
- ],
- 'badregex': [
- (r'\n', Text, '#pop')
- ],
- 'root': [
- (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
- include('commentsandwhitespace'),
- (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
- r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
- (r'(for|in|while|do|break|return|continue|switch|case|default|if|else|'
- r'throw|try|catch|finally|new|delete|typeof|instanceof|void|of|'
- r'this)\b', Keyword, '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|'
- r'transient|volatile)\b', Keyword.Reserved),
- (r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
- (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
- r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
- r'decodeURIComponent|encodeURI|encodeURIComponent|'
- r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
- r'window)\b', Name.Builtin),
- # Match stuff like: module name {...}
- (r'\b(module)(\s*)(\s*[\w?.$][\w?.$]*)(\s*)',
- bygroups(Keyword.Reserved, Text, Name.Other, Text), 'slashstartsregex'),
- # Match variable type keywords
- (r'\b(string|bool|number)\b', Keyword.Type),
- # Match stuff like: constructor
- (r'\b(constructor|declare|interface|as|AS)\b', Keyword.Reserved),
- # Match stuff like: super(argument, list)
- (r'(super)(\s*)(\([\w,?.$\s]+\s*\))',
- bygroups(Keyword.Reserved, Text), 'slashstartsregex'),
- # Match stuff like: function() {...}
- (r'([a-zA-Z_?.$][\w?.$]*)\(\) \{', Name.Other, 'slashstartsregex'),
- # Match stuff like: (function: return type)
- (r'([\w?.$][\w?.$]*)(\s*:\s*)([\w?.$][\w?.$]*)',
- bygroups(Name.Other, Text, Keyword.Type)),
- (r'[$a-zA-Z_]\w*', 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),
- (r'`', String.Backtick, 'interp'),
- # Match stuff like: Decorators
- (r'@\w+', Keyword.Declaration),
- ],
-
- # The 'interp*' rules match those in JavascriptLexer. Changes made
- # there should be reflected here as well.
- 'interp': [
- (r'`', String.Backtick, '#pop'),
- (r'\\\\', String.Backtick),
- (r'\\`', String.Backtick),
- (r'\$\{', String.Interpol, 'interp-inside'),
- (r'\$', String.Backtick),
- (r'[^`\\$]+', String.Backtick),
- ],
- 'interp-inside': [
- # TODO: should this include single-line comments and allow nesting strings?
- (r'\}', String.Interpol, '#pop'),
- include('root'),
- ],
- }
-
-
-class LassoLexer(RegexLexer):
- """
- For `Lasso <http://www.lassosoft.com/>`_ source code, covering both Lasso 9
- syntax and LassoScript for Lasso 8.6 and earlier. For Lasso embedded in
- HTML, use the `LassoHtmlLexer`.
-
- Additional options accepted:
-
- `builtinshighlighting`
- If given and ``True``, highlight builtin types, traits, methods, and
- members (default: ``True``).
- `requiredelimiters`
- If given and ``True``, only highlight code between delimiters as Lasso
- (default: ``False``).
-
- .. versionadded:: 1.6
- """
-
- name = 'Lasso'
- aliases = ['lasso', 'lassoscript']
- filenames = ['*.lasso', '*.lasso[89]']
- alias_filenames = ['*.incl', '*.inc', '*.las']
- mimetypes = ['text/x-lasso']
- flags = re.IGNORECASE | re.DOTALL | re.MULTILINE
-
- tokens = {
- 'root': [
- (r'^#![ \S]+lasso9\b', Comment.Preproc, 'lasso'),
- (r'(?=\[|<)', Other, 'delimiters'),
- (r'\s+', Other),
- default(('delimiters', 'lassofile')),
- ],
- 'delimiters': [
- (r'\[no_square_brackets\]', Comment.Preproc, 'nosquarebrackets'),
- (r'\[noprocess\]', Comment.Preproc, 'noprocess'),
- (r'\[', Comment.Preproc, 'squarebrackets'),
- (r'<\?(lasso(script)?|=)', Comment.Preproc, 'anglebrackets'),
- (r'<(!--.*?-->)?', Other),
- (r'[^[<]+', Other),
- ],
- 'nosquarebrackets': [
- (r'\[noprocess\]', Comment.Preproc, 'noprocess'),
- (r'\[', Other),
- (r'<\?(lasso(script)?|=)', Comment.Preproc, 'anglebrackets'),
- (r'<(!--.*?-->)?', Other),
- (r'[^[<]+', Other),
- ],
- 'noprocess': [
- (r'\[/noprocess\]', Comment.Preproc, '#pop'),
- (r'\[', Other),
- (r'[^[]', Other),
- ],
- 'squarebrackets': [
- (r'\]', Comment.Preproc, '#pop'),
- include('lasso'),
- ],
- 'anglebrackets': [
- (r'\?>', Comment.Preproc, '#pop'),
- include('lasso'),
- ],
- 'lassofile': [
- (r'\]|\?>', Comment.Preproc, '#pop'),
- include('lasso'),
- ],
- 'whitespacecomments': [
- (r'\s+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*\*!.*?\*/', String.Doc),
- (r'/\*.*?\*/', Comment.Multiline),
- ],
- 'lasso': [
- # whitespace/comments
- include('whitespacecomments'),
-
- # literals
- (r'\d*\.\d+(e[+-]?\d+)?', Number.Float),
- (r'0x[\da-f]+', Number.Hex),
- (r'\d+', Number.Integer),
- (r'(infinity|NaN)\b', Number),
- (r"'", String.Single, 'singlestring'),
- (r'"', String.Double, 'doublestring'),
- (r'`[^`]*`', String.Backtick),
-
- # names
- (r'\$[a-z_][\w.]*', Name.Variable),
- (r'#([a-z_][\w.]*|\d+\b)', Name.Variable.Instance),
- (r"(\.\s*)('[a-z_][\w.]*')",
- bygroups(Name.Builtin.Pseudo, Name.Variable.Class)),
- (r"(self)(\s*->\s*)('[a-z_][\w.]*')",
- bygroups(Name.Builtin.Pseudo, Operator, Name.Variable.Class)),
- (r'(\.\.?\s*)([a-z_][\w.]*(=(?!=))?)',
- bygroups(Name.Builtin.Pseudo, Name.Other.Member)),
- (r'(->\\?\s*|&\s*)([a-z_][\w.]*(=(?!=))?)',
- bygroups(Operator, Name.Other.Member)),
- (r'(?<!->)(self|inherited|currentcapture|givenblock)\b',
- Name.Builtin.Pseudo),
- (r'-(?!infinity)[a-z_][\w.]*', Name.Attribute),
- (r'::\s*[a-z_][\w.]*', Name.Label),
- (r'(error_(code|msg)_\w+|Error_AddError|Error_ColumnRestriction|'
- r'Error_DatabaseConnectionUnavailable|Error_DatabaseTimeout|'
- r'Error_DeleteError|Error_FieldRestriction|Error_FileNotFound|'
- r'Error_InvalidDatabase|Error_InvalidPassword|'
- r'Error_InvalidUsername|Error_ModuleNotFound|'
- r'Error_NoError|Error_NoPermission|Error_OutOfMemory|'
- r'Error_ReqColumnMissing|Error_ReqFieldMissing|'
- r'Error_RequiredColumnMissing|Error_RequiredFieldMissing|'
- r'Error_UpdateError)\b', Name.Exception),
-
- # definitions
- (r'(define)(\s+)([a-z_][\w.]*)(\s*=>\s*)(type|trait|thread)\b',
- bygroups(Keyword.Declaration, Text, Name.Class, Operator, Keyword)),
- (r'(define)(\s+)([a-z_][\w.]*)(\s*->\s*)([a-z_][\w.]*=?|[-+*/%])',
- bygroups(Keyword.Declaration, Text, Name.Class, Operator,
- Name.Function), 'signature'),
- (r'(define)(\s+)([a-z_][\w.]*)',
- bygroups(Keyword.Declaration, Text, Name.Function), 'signature'),
- (r'(public|protected|private|provide)(\s+)(([a-z_][\w.]*=?|[-+*/%])'
- r'(?=\s*\())', bygroups(Keyword, Text, Name.Function),
- 'signature'),
- (r'(public|protected|private|provide)(\s+)([a-z_][\w.]*)',
- bygroups(Keyword, Text, Name.Function)),
-
- # keywords
- (r'(true|false|none|minimal|full|all|void)\b', Keyword.Constant),
- (r'(local|var|variable|global|data(?=\s))\b', Keyword.Declaration),
- (r'(array|date|decimal|duration|integer|map|pair|string|tag|xml|'
- r'null|boolean|bytes|keyword|list|locale|queue|set|stack|'
- r'staticarray)\b', Keyword.Type),
- (r'([a-z_][\w.]*)(\s+)(in)\b', bygroups(Name, Text, Keyword)),
- (r'(let|into)(\s+)([a-z_][\w.]*)', bygroups(Keyword, Text, Name)),
- (r'require\b', Keyword, 'requiresection'),
- (r'(/?)(Namespace_Using)\b', bygroups(Punctuation, Keyword.Namespace)),
- (r'(/?)(Cache|Database_Names|Database_SchemaNames|'
- r'Database_TableNames|Define_Tag|Define_Type|Email_Batch|'
- r'Encode_Set|HTML_Comment|Handle|Handle_Error|Header|If|Inline|'
- r'Iterate|LJAX_Target|Link|Link_CurrentAction|Link_CurrentGroup|'
- r'Link_CurrentRecord|Link_Detail|Link_FirstGroup|Link_FirstRecord|'
- r'Link_LastGroup|Link_LastRecord|Link_NextGroup|Link_NextRecord|'
- r'Link_PrevGroup|Link_PrevRecord|Log|Loop|Output_None|Portal|'
- r'Private|Protect|Records|Referer|Referrer|Repeating|ResultSet|'
- r'Rows|Search_Args|Search_Arguments|Select|Sort_Args|'
- r'Sort_Arguments|Thread_Atomic|Value_List|While|Abort|Case|Else|'
- r'Fail_If|Fail_IfNot|Fail|If_Empty|If_False|If_Null|If_True|'
- r'Loop_Abort|Loop_Continue|Loop_Count|Params|Params_Up|Return|'
- r'Return_Value|Run_Children|SOAP_DefineTag|SOAP_LastRequest|'
- r'SOAP_LastResponse|Tag_Name|ascending|average|by|define|'
- r'descending|do|equals|frozen|group|handle_failure|import|in|into|'
- r'join|let|match|max|min|on|order|parent|protected|provide|public|'
- r'require|returnhome|skip|split_thread|sum|take|thread|to|trait|'
- r'type|where|with|yield|yieldhome)\b',
- bygroups(Punctuation, Keyword)),
-
- # other
- (r',', Punctuation, 'commamember'),
- (r'(and|or|not)\b', Operator.Word),
- (r'([a-z_][\w.]*)(\s*::\s*[a-z_][\w.]*)?(\s*=(?!=))',
- bygroups(Name, Name.Label, Operator)),
- (r'(/?)([\w.]+)', bygroups(Punctuation, Name.Other)),
- (r'(=)(n?bw|n?ew|n?cn|lte?|gte?|n?eq|n?rx|ft)\b',
- bygroups(Operator, Operator.Word)),
- (r':=|[-+*/%=<>&|!?\\]+', Operator),
- (r'[{}():;,@^]', Punctuation),
- ],
- 'singlestring': [
- (r"'", String.Single, '#pop'),
- (r"[^'\\]+", String.Single),
- include('escape'),
- (r"\\", String.Single),
- ],
- 'doublestring': [
- (r'"', String.Double, '#pop'),
- (r'[^"\\]+', String.Double),
- include('escape'),
- (r'\\', String.Double),
- ],
- 'escape': [
- (r'\\(U[\da-f]{8}|u[\da-f]{4}|x[\da-f]{1,2}|[0-7]{1,3}|:[^:\n\r]+:|'
- r'[abefnrtv?"\'\\]|$)', String.Escape),
- ],
- 'signature': [
- (r'=>', Operator, '#pop'),
- (r'\)', Punctuation, '#pop'),
- (r'[(,]', Punctuation, 'parameter'),
- include('lasso'),
- ],
- 'parameter': [
- (r'\)', Punctuation, '#pop'),
- (r'-?[a-z_][\w.]*', Name.Attribute, '#pop'),
- (r'\.\.\.', Name.Builtin.Pseudo),
- include('lasso'),
- ],
- 'requiresection': [
- (r'(([a-z_][\w.]*=?|[-+*/%])(?=\s*\())', Name, 'requiresignature'),
- (r'(([a-z_][\w.]*=?|[-+*/%])(?=(\s*::\s*[\w.]+)?\s*,))', Name),
- (r'[a-z_][\w.]*=?|[-+*/%]', Name, '#pop'),
- (r'::\s*[a-z_][\w.]*', Name.Label),
- (r',', Punctuation),
- include('whitespacecomments'),
- ],
- 'requiresignature': [
- (r'(\)(?=(\s*::\s*[\w.]+)?\s*,))', Punctuation, '#pop'),
- (r'\)', Punctuation, '#pop:2'),
- (r'-?[a-z_][\w.]*', Name.Attribute),
- (r'::\s*[a-z_][\w.]*', Name.Label),
- (r'\.\.\.', Name.Builtin.Pseudo),
- (r'[(,]', Punctuation),
- include('whitespacecomments'),
- ],
- 'commamember': [
- (r'(([a-z_][\w.]*=?|[-+*/%])'
- r'(?=\s*(\(([^()]*\([^()]*\))*[^)]*\)\s*)?(::[\w.\s]+)?=>))',
- Name.Function, 'signature'),
- include('whitespacecomments'),
- default('#pop'),
- ],
- }
-
- def __init__(self, **options):
- self.builtinshighlighting = get_bool_opt(
- options, 'builtinshighlighting', True)
- self.requiredelimiters = get_bool_opt(
- options, 'requiredelimiters', False)
-
- self._builtins = set()
- self._members = set()
- if self.builtinshighlighting:
- from pygments.lexers._lasso_builtins import BUILTINS, MEMBERS
- for key, value in iteritems(BUILTINS):
- self._builtins.update(value)
- for key, value in iteritems(MEMBERS):
- self._members.update(value)
- RegexLexer.__init__(self, **options)
-
- def get_tokens_unprocessed(self, text):
- stack = ['root']
- if self.requiredelimiters:
- stack.append('delimiters')
- for index, token, value in \
- RegexLexer.get_tokens_unprocessed(self, text, stack):
- if (token is Name.Other and value.lower() in self._builtins or
- token is Name.Other.Member and
- value.lower().rstrip('=') in self._members):
- yield index, Name.Builtin, value
- continue
- yield index, token, value
-
- def analyse_text(text):
- rv = 0.0
- if 'bin/lasso9' in text:
- rv += 0.8
- if re.search(r'<\?lasso', text, re.I):
- rv += 0.4
- if re.search(r'local\(', text, re.I):
- rv += 0.4
- return rv
-
-
-class ObjectiveJLexer(RegexLexer):
- """
- For Objective-J source code with preprocessor directives.
-
- .. versionadded:: 1.3
- """
-
- name = 'Objective-J'
- aliases = ['objective-j', 'objectivej', 'obj-j', 'objj']
- filenames = ['*.j']
- mimetypes = ['text/x-objective-j']
-
- #: optional Comment or Whitespace
- _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)*'
-
- flags = re.DOTALL | re.MULTILINE
-
- tokens = {
- 'root': [
- include('whitespace'),
-
- # function definition
- (r'^(' + _ws + r'[+-]' + _ws + r')([(a-zA-Z_].*?[^(])(' + _ws + r'\{)',
- bygroups(using(this), using(this, state='function_signature'),
- using(this))),
-
- # class definition
- (r'(@interface|@implementation)(\s+)', bygroups(Keyword, Text),
- 'classname'),
- (r'(@class|@protocol)(\s*)', bygroups(Keyword, Text),
- 'forward_classname'),
- (r'(\s*)(@end)(\s*)', bygroups(Text, Keyword, Text)),
-
- include('statements'),
- ('[{()}]', Punctuation),
- (';', Punctuation),
- ],
- 'whitespace': [
- (r'(@import)(\s+)("(?:\\\\|\\"|[^"])*")',
- bygroups(Comment.Preproc, Text, String.Double)),
- (r'(@import)(\s+)(<(?:\\\\|\\>|[^>])*>)',
- bygroups(Comment.Preproc, Text, String.Double)),
- (r'(#(?:include|import))(\s+)("(?:\\\\|\\"|[^"])*")',
- bygroups(Comment.Preproc, Text, String.Double)),
- (r'(#(?:include|import))(\s+)(<(?:\\\\|\\>|[^>])*>)',
- bygroups(Comment.Preproc, Text, String.Double)),
-
- (r'#if\s+0', Comment.Preproc, 'if0'),
- (r'#', Comment.Preproc, 'macro'),
-
- (r'\n', Text),
- (r'\s+', Text),
- (r'\\\n', Text), # line continuation
- (r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
- (r'<!--', Comment),
- ],
- 'slashstartsregex': [
- include('whitespace'),
- (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
- (r'(?=/)', Text, ('#pop', 'badregex')),
- default('#pop'),
- ],
- 'badregex': [
- (r'\n', Text, '#pop'),
- ],
- 'statements': [
- (r'(L|@)?"', String, 'string'),
- (r"(L|@)?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'",
- String.Char),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
- (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
- (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
- (r'0[0-7]+[Ll]?', Number.Oct),
- (r'\d+[Ll]?', Number.Integer),
-
- (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
-
- (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
- r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?',
- Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
-
- (r'(for|in|while|do|break|return|continue|switch|case|default|if|'
- r'else|throw|try|catch|finally|new|delete|typeof|instanceof|void|'
- r'prototype|__proto__)\b', Keyword, 'slashstartsregex'),
-
- (r'(var|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
-
- (r'(@selector|@private|@protected|@public|@encode|'
- r'@synchronized|@try|@throw|@catch|@finally|@end|@property|'
- r'@synthesize|@dynamic|@for|@accessors|new)\b', Keyword),
-
- (r'(int|long|float|short|double|char|unsigned|signed|void|'
- r'id|BOOL|bool|boolean|IBOutlet|IBAction|SEL|@outlet|@action)\b',
- Keyword.Type),
-
- (r'(self|super)\b', Name.Builtin),
-
- (r'(TRUE|YES|FALSE|NO|Nil|nil|NULL)\b', Keyword.Constant),
- (r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
- (r'(ABS|ASIN|ACOS|ATAN|ATAN2|SIN|COS|TAN|EXP|POW|CEIL|FLOOR|ROUND|'
- r'MIN|MAX|RAND|SQRT|E|LN2|LN10|LOG2E|LOG10E|PI|PI2|PI_2|SQRT1_2|'
- r'SQRT2)\b', Keyword.Constant),
-
- (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
- r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
- r'decodeURIComponent|encodeURI|encodeURIComponent|'
- r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
- r'window)\b', Name.Builtin),
-
- (r'([$a-zA-Z_]\w*)(' + _ws + r')(?=\()',
- bygroups(Name.Function, using(this))),
-
- (r'[$a-zA-Z_]\w*', Name),
- ],
- 'classname': [
- # interface definition that inherits
- (r'([a-zA-Z_]\w*)(' + _ws + r':' + _ws +
- r')([a-zA-Z_]\w*)?',
- bygroups(Name.Class, using(this), Name.Class), '#pop'),
- # interface definition for a category
- (r'([a-zA-Z_]\w*)(' + _ws + r'\()([a-zA-Z_]\w*)(\))',
- bygroups(Name.Class, using(this), Name.Label, Text), '#pop'),
- # simple interface / implementation
- (r'([a-zA-Z_]\w*)', Name.Class, '#pop'),
- ],
- 'forward_classname': [
- (r'([a-zA-Z_]\w*)(\s*,\s*)',
- bygroups(Name.Class, Text), '#push'),
- (r'([a-zA-Z_]\w*)(\s*;?)',
- bygroups(Name.Class, Text), '#pop'),
- ],
- 'function_signature': [
- include('whitespace'),
-
- # start of a selector w/ parameters
- (r'(\(' + _ws + r')' # open paren
- r'([a-zA-Z_]\w+)' # return type
- r'(' + _ws + r'\)' + _ws + r')' # close paren
- r'([$a-zA-Z_]\w+' + _ws + r':)', # function name
- bygroups(using(this), Keyword.Type, using(this),
- Name.Function), 'function_parameters'),
-
- # no-param function
- (r'(\(' + _ws + r')' # open paren
- r'([a-zA-Z_]\w+)' # return type
- r'(' + _ws + r'\)' + _ws + r')' # close paren
- r'([$a-zA-Z_]\w+)', # function name
- bygroups(using(this), Keyword.Type, using(this),
- Name.Function), "#pop"),
-
- # no return type given, start of a selector w/ parameters
- (r'([$a-zA-Z_]\w+' + _ws + r':)', # function name
- bygroups(Name.Function), 'function_parameters'),
-
- # no return type given, no-param function
- (r'([$a-zA-Z_]\w+)', # function name
- bygroups(Name.Function), "#pop"),
-
- default('#pop'),
- ],
- 'function_parameters': [
- include('whitespace'),
-
- # parameters
- (r'(\(' + _ws + ')' # open paren
- r'([^)]+)' # type
- r'(' + _ws + r'\)' + _ws + r')' # close paren
- r'([$a-zA-Z_]\w+)', # param name
- bygroups(using(this), Keyword.Type, using(this), Text)),
-
- # one piece of a selector name
- (r'([$a-zA-Z_]\w+' + _ws + r':)', # function name
- Name.Function),
-
- # smallest possible selector piece
- (r'(:)', Name.Function),
-
- # var args
- (r'(,' + _ws + r'\.\.\.)', using(this)),
-
- # param name
- (r'([$a-zA-Z_]\w+)', Text),
- ],
- 'expression': [
- (r'([$a-zA-Z_]\w*)(\()', bygroups(Name.Function,
- Punctuation)),
- (r'(\))', Punctuation, "#pop"),
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
- (r'[^\\"\n]+', String), # all other characters
- (r'\\\n', String), # line continuation
- (r'\\', String), # stray backslash
- ],
- 'macro': [
- (r'[^/\n]+', Comment.Preproc),
- (r'/[*](.|\n)*?[*]/', Comment.Multiline),
- (r'//.*?\n', Comment.Single, '#pop'),
- (r'/', Comment.Preproc),
- (r'(?<=\\)\n', Comment.Preproc),
- (r'\n', Comment.Preproc, '#pop'),
- ],
- 'if0': [
- (r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
- (r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
- (r'.*?\n', Comment),
- ]
- }
-
- def analyse_text(text):
- if re.search(r'^\s*@import\s+[<"]', text, re.MULTILINE):
- # special directive found in most Objective-J files
- return True
- return False
-
-
-class CoffeeScriptLexer(RegexLexer):
- """
- For `CoffeeScript`_ source code.
-
- .. _CoffeeScript: http://coffeescript.org
-
- .. versionadded:: 1.3
- """
-
- name = 'CoffeeScript'
- aliases = ['coffee-script', 'coffeescript', 'coffee']
- filenames = ['*.coffee']
- mimetypes = ['text/coffeescript']
-
-
- _operator_re = (
- r'\+\+|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\?|:|'
- r'\|\||\\(?=\n)|'
- r'(<<|>>>?|==?(?!>)|!=?|=(?!>)|-(?!>)|[<>+*`%&\|\^/])=?')
-
- flags = re.DOTALL
- tokens = {
- 'commentsandwhitespace': [
- (r'\s+', Text),
- (r'###[^#].*?###', Comment.Multiline),
- (r'#(?!##[^#]).*?\n', Comment.Single),
- ],
- 'multilineregex': [
- (r'[^/#]+', String.Regex),
- (r'///([gim]+\b|\B)', String.Regex, '#pop'),
- (r'#\{', String.Interpol, 'interpoling_string'),
- (r'[/#]', String.Regex),
- ],
- 'slashstartsregex': [
- include('commentsandwhitespace'),
- (r'///', String.Regex, ('#pop', 'multilineregex')),
- (r'/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
- # This isn't really guarding against mishighlighting well-formed
- # code, just the ability to infinite-loop between root and
- # slashstartsregex.
- (r'/', Operator),
- default('#pop'),
- ],
- 'root': [
- include('commentsandwhitespace'),
- (r'^(?=\s|/)', Text, 'slashstartsregex'),
- (_operator_re, Operator, 'slashstartsregex'),
- (r'(?:\([^()]*\))?\s*[=-]>', Name.Function, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
- (r'(?<![.$])(for|own|in|of|while|until|'
- r'loop|break|return|continue|'
- r'switch|when|then|if|unless|else|'
- r'throw|try|catch|finally|new|delete|typeof|instanceof|super|'
- r'extends|this|class|by)\b', Keyword, 'slashstartsregex'),
- (r'(?<![.$])(true|false|yes|no|on|off|null|'
- r'NaN|Infinity|undefined)\b',
- Keyword.Constant),
- (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
- r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
- r'decodeURIComponent|encodeURI|encodeURIComponent|'
- r'eval|isFinite|isNaN|parseFloat|parseInt|document|window)\b',
- Name.Builtin),
- (r'[$a-zA-Z_][\w.:$]*\s*[:=]\s', Name.Variable,
- 'slashstartsregex'),
- (r'@[$a-zA-Z_][\w.:$]*\s*[:=]\s', Name.Variable.Instance,
- 'slashstartsregex'),
- (r'@', Name.Other, 'slashstartsregex'),
- (r'@?[$a-zA-Z_][\w$]*', 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),
- ('"""', 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"),
- (r'#', 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"),
- (r'#', String),
- include('strings'),
- ],
- 'tsqs': [
- (r"'''", String, '#pop'),
- (r'#|\\.|\'|"', String), # no need to escape quotes in triple-strings
- include('strings')
- ],
- }
-
-
-class MaskLexer(RegexLexer):
- """
- For `Mask <http://github.com/atmajs/MaskJS>`__ markup.
-
- .. versionadded:: 2.0
- """
- name = 'Mask'
- aliases = ['mask']
- filenames = ['*.mask']
- mimetypes = ['text/x-mask']
-
- flags = re.MULTILINE | re.IGNORECASE | re.DOTALL
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'[{};>]', Punctuation),
- (r"'''", String, 'string-trpl-single'),
- (r'"""', String, 'string-trpl-double'),
- (r"'", String, 'string-single'),
- (r'"', String, 'string-double'),
- (r'([\w-]+)', Name.Tag, 'node'),
- (r'([^.#;{>\s]+)', Name.Class, 'node'),
- (r'(#[\w-]+)', Name.Function, 'node'),
- (r'(\.[\w-]+)', Name.Variable.Class, 'node')
- ],
- 'string-base': [
- (r'\\.', String.Escape),
- (r'~\[', String.Interpol, 'interpolation'),
- (r'.', String.Single),
- ],
- 'string-single': [
- (r"'", String.Single, '#pop'),
- include('string-base')
- ],
- 'string-double': [
- (r'"', String.Single, '#pop'),
- include('string-base')
- ],
- 'string-trpl-single': [
- (r"'''", String.Single, '#pop'),
- include('string-base')
- ],
- 'string-trpl-double': [
- (r'"""', String.Single, '#pop'),
- include('string-base')
- ],
- 'interpolation': [
- (r'\]', String.Interpol, '#pop'),
- (r'\s*:', String.Interpol, 'expression'),
- (r'\s*\w+:', Name.Other),
- (r'[^\]]+', String.Interpol)
- ],
- 'expression': [
- (r'[^\]]+', using(JavascriptLexer), '#pop')
- ],
- 'node': [
- (r'\s+', Text),
- (r'\.', Name.Variable.Class, 'node-class'),
- (r'\#', Name.Function, 'node-id'),
- (r'style[ \t]*=', Name.Attribute, 'node-attr-style-value'),
- (r'[\w:-]+[ \t]*=', Name.Attribute, 'node-attr-value'),
- (r'[\w:-]+', Name.Attribute),
- (r'[>{;]', Punctuation, '#pop')
- ],
- 'node-class': [
- (r'[\w-]+', Name.Variable.Class),
- (r'~\[', String.Interpol, 'interpolation'),
- default('#pop')
- ],
- 'node-id': [
- (r'[\w-]+', Name.Function),
- (r'~\[', String.Interpol, 'interpolation'),
- default('#pop')
- ],
- 'node-attr-value': [
- (r'\s+', Text),
- (r'\w+', Name.Variable, '#pop'),
- (r"'", String, 'string-single-pop2'),
- (r'"', String, 'string-double-pop2'),
- default('#pop')
- ],
- 'node-attr-style-value': [
- (r'\s+', Text),
- (r"'", String.Single, 'css-single-end'),
- (r'"', String.Single, 'css-double-end'),
- include('node-attr-value')
- ],
- 'css-base': [
- (r'\s+', Text),
- (r";", Punctuation),
- (r"[\w\-]+\s*:", Name.Builtin)
- ],
- 'css-single-end': [
- include('css-base'),
- (r"'", String.Single, '#pop:2'),
- (r"[^;']+", Name.Entity)
- ],
- 'css-double-end': [
- include('css-base'),
- (r'"', String.Single, '#pop:2'),
- (r'[^;"]+', Name.Entity)
- ],
- 'string-single-pop2': [
- (r"'", String.Single, '#pop:2'),
- include('string-base')
- ],
- 'string-double-pop2': [
- (r'"', String.Single, '#pop:2'),
- include('string-base')
- ],
- }
-
-
-class EarlGreyLexer(RegexLexer):
- """
- For `Earl-Grey`_ source code.
-
- .. _Earl-Grey: https://breuleux.github.io/earl-grey/
-
- .. versionadded: 2.1
- """
-
- name = 'Earl Grey'
- aliases = ['earl-grey', 'earlgrey', 'eg']
- filenames = ['*.eg']
- mimetypes = ['text/x-earl-grey']
-
- tokens = {
- 'root': [
- (r'\n', Text),
- include('control'),
- (r'[^\S\n]+', Text),
- (r';;.*\n', Comment),
- (r'[\[\]{}:(),;]', Punctuation),
- (r'\\\n', Text),
- (r'\\', Text),
- include('errors'),
- (words((
- 'with', 'where', 'when', 'and', 'not', 'or', 'in',
- 'as', 'of', 'is'),
- prefix=r'(?<=\s|\[)', suffix=r'(?![\w$\-])'),
- Operator.Word),
- (r'[*@]?->', Name.Function),
- (r'[+\-*/~^<>%&|?!@#.]*=', Operator.Word),
- (r'\.{2,3}', Operator.Word), # Range Operator
- (r'([+*/~^<>&|?!]+)|([#\-](?=\s))|@@+(?=\s)|=+', Operator),
- (r'(?<![\w$\-])(var|let)(?:[^\w$])', Keyword.Declaration),
- include('keywords'),
- include('builtins'),
- include('assignment'),
- (r'''(?x)
- (?:()([a-zA-Z$_](?:[\w$\-]*[\w$])?)|
- (?<=[\s{\[(])(\.)([a-zA-Z$_](?:[\w$\-]*[\w$])?))
- (?=.*%)''',
- bygroups(Punctuation, Name.Tag, Punctuation, Name.Class.Start), 'dbs'),
- (r'[rR]?`', String.Backtick, 'bt'),
- (r'[rR]?```', String.Backtick, 'tbt'),
- (r'(?<=[\s\[{(,;])\.([a-zA-Z$_](?:[\w$\-]*[\w$])?)'
- r'(?=[\s\]}),;])', String.Symbol),
- include('nested'),
- (r'(?:[rR]|[rR]\.[gmi]{1,3})?"', String, combined('stringescape', 'dqs')),
- (r'(?:[rR]|[rR]\.[gmi]{1,3})?\'', String, combined('stringescape', 'sqs')),
- (r'"""', String, combined('stringescape', 'tdqs')),
- include('tuple'),
- include('import_paths'),
- include('name'),
- include('numbers'),
- ],
- 'dbs': [
- (r'(\.)([a-zA-Z$_](?:[\w$\-]*[\w$])?)(?=[.\[\s])',
- bygroups(Punctuation, Name.Class.DBS)),
- (r'(\[)([\^#][a-zA-Z$_](?:[\w$\-]*[\w$])?)(\])',
- bygroups(Punctuation, Name.Entity.DBS, Punctuation)),
- (r'\s+', Text),
- (r'%', Operator.DBS, '#pop'),
- ],
- 'import_paths': [
- (r'(?<=[\s:;,])(\.{1,3}(?:[\w\-]*/)*)(\w(?:[\w\-]*\w)*)(?=[\s;,])',
- bygroups(Text.Whitespace, Text)),
- ],
- 'assignment': [
- (r'(\.)?([a-zA-Z$_](?:[\w$\-]*[\w$])?)'
- r'(?=\s+[+\-*/~^<>%&|?!@#.]*\=\s)',
- bygroups(Punctuation, Name.Variable))
- ],
- 'errors': [
- (words(('Error', 'TypeError', 'ReferenceError'),
- prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$.])'),
- Name.Exception),
- (r'''(?x)
- (?<![\w$])
- E\.[\w$](?:[\w$\-]*[\w$])?
- (?:\.[\w$](?:[\w$\-]*[\w$])?)*
- (?=[({\[?!\s])''',
- Name.Exception),
- ],
- 'control': [
- (r'''(?x)
- ([a-zA-Z$_](?:[\w$-]*[\w$])?)
- (?!\n)\s+
- (?!and|as|each\*|each|in|is|mod|of|or|when|where|with)
- (?=(?:[+\-*/~^<>%&|?!@#.])?[a-zA-Z$_](?:[\w$-]*[\w$])?)''',
- Keyword.Control),
- (r'([a-zA-Z$_](?:[\w$-]*[\w$])?)(?!\n)\s+(?=[\'"\d{\[(])',
- Keyword.Control),
- (r'''(?x)
- (?:
- (?<=[%=])|
- (?<=[=\-]>)|
- (?<=with|each|with)|
- (?<=each\*|where)
- )(\s+)
- ([a-zA-Z$_](?:[\w$-]*[\w$])?)(:)''',
- bygroups(Text, Keyword.Control, Punctuation)),
- (r'''(?x)
- (?<![+\-*/~^<>%&|?!@#.])(\s+)
- ([a-zA-Z$_](?:[\w$-]*[\w$])?)(:)''',
- bygroups(Text, Keyword.Control, Punctuation)),
- ],
- 'nested': [
- (r'''(?x)
- (?<=[\w$\]})])(\.)
- ([a-zA-Z$_](?:[\w$-]*[\w$])?)
- (?=\s+with(?:\s|\n))''',
- bygroups(Punctuation, Name.Function)),
- (r'''(?x)
- (?<!\s)(\.)
- ([a-zA-Z$_](?:[\w$-]*[\w$])?)
- (?=[}\]).,;:\s])''',
- bygroups(Punctuation, Name.Field)),
- (r'''(?x)
- (?<=[\w$\]})])(\.)
- ([a-zA-Z$_](?:[\w$-]*[\w$])?)
- (?=[\[{(:])''',
- bygroups(Punctuation, Name.Function)),
- ],
- 'keywords': [
- (words((
- 'each', 'each*', 'mod', 'await', 'break', 'chain',
- 'continue', 'elif', 'expr-value', 'if', 'match',
- 'return', 'yield', 'pass', 'else', 'require', 'var',
- 'let', 'async', 'method', 'gen'),
- prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$.])'),
- Keyword.Pseudo),
- (words(('this', 'self', '@'),
- prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$])'),
- Keyword.Constant),
- (words((
- 'Function', 'Object', 'Array', 'String', 'Number',
- 'Boolean', 'ErrorFactory', 'ENode', 'Promise'),
- prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$])'),
- Keyword.Type),
- ],
- 'builtins': [
- (words((
- 'send', 'object', 'keys', 'items', 'enumerate', 'zip',
- 'product', 'neighbours', 'predicate', 'equal',
- 'nequal', 'contains', 'repr', 'clone', 'range',
- 'getChecker', 'get-checker', 'getProperty', 'get-property',
- 'getProjector', 'get-projector', 'consume', 'take',
- 'promisify', 'spawn', 'constructor'),
- prefix=r'(?<![\w\-#.])', suffix=r'(?![\w\-.])'),
- Name.Builtin),
- (words((
- 'true', 'false', 'null', 'undefined'),
- prefix=r'(?<![\w\-$.])', suffix=r'(?![\w\-$.])'),
- Name.Constant),
- ],
- 'name': [
- (r'@([a-zA-Z$_](?:[\w$-]*[\w$])?)', Name.Variable.Instance),
- (r'([a-zA-Z$_](?:[\w$-]*[\w$])?)(\+\+|\-\-)?',
- bygroups(Name.Symbol, Operator.Word))
- ],
- 'tuple': [
- (r'#[a-zA-Z_][\w\-]*(?=[\s{(,;])', Name.Namespace)
- ],
- 'interpoling_string': [
- (r'\}', String.Interpol, '#pop'),
- include('root')
- ],
- 'stringescape': [
- (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
- r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
- ],
- 'strings': [
- (r'[^\\\'"]', String),
- (r'[\'"\\]', String),
- (r'\n', String) # All strings are multiline in EG
- ],
- 'dqs': [
- (r'"', String, '#pop'),
- (r'\\\\|\\"|\\\n', String.Escape),
- include('strings')
- ],
- 'sqs': [
- (r"'", String, '#pop'),
- (r"\\\\|\\'|\\\n", String.Escape),
- (r'\{', String.Interpol, 'interpoling_string'),
- include('strings')
- ],
- 'tdqs': [
- (r'"""', String, '#pop'),
- include('strings'),
- ],
- 'bt': [
- (r'`', String.Backtick, '#pop'),
- (r'(?<!`)\n', String.Backtick),
- (r'\^=?', String.Escape),
- (r'.+', String.Backtick),
- ],
- 'tbt': [
- (r'```', String.Backtick, '#pop'),
- (r'\n', String.Backtick),
- (r'\^=?', String.Escape),
- (r'[^`]+', String.Backtick),
- ],
- 'numbers': [
- (r'\d+\.(?!\.)\d*([eE][+-]?[0-9]+)?', Number.Float),
- (r'\d+[eE][+-]?[0-9]+', Number.Float),
- (r'8r[0-7]+', Number.Oct),
- (r'2r[01]+', Number.Bin),
- (r'16r[a-fA-F0-9]+', Number.Hex),
- (r'([3-79]|[12][0-9]|3[0-6])r[a-zA-Z\d]+(\.[a-zA-Z\d]+)?', Number.Radix),
- (r'\d+', Number.Integer)
- ],
- }
-
-class JuttleLexer(RegexLexer):
- """
- For `Juttle`_ source code.
-
- .. _Juttle: https://github.com/juttle/juttle
-
- """
-
- name = 'Juttle'
- aliases = ['juttle', 'juttle']
- filenames = ['*.juttle']
- mimetypes = ['application/juttle', 'application/x-juttle',
- 'text/x-juttle', 'text/juttle']
-
- flags = re.DOTALL | re.UNICODE | re.MULTILINE
-
- tokens = {
- 'commentsandwhitespace': [
- (r'\s+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline)
- ],
- 'slashstartsregex': [
- include('commentsandwhitespace'),
- (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
- (r'(?=/)', Text, ('#pop', 'badregex')),
- default('#pop')
- ],
- 'badregex': [
- (r'\n', Text, '#pop')
- ],
- 'root': [
- (r'^(?=\s|/)', Text, 'slashstartsregex'),
- include('commentsandwhitespace'),
- (r':\d{2}:\d{2}:\d{2}(\.\d*)?:', String.Moment),
- (r':(now|beginning|end|forever|yesterday|today|tomorrow|'
- r'(\d+(\.\d*)?|\.\d+)(ms|[smhdwMy])?):', String.Moment),
- (r':\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d*)?)?'
- r'(Z|[+-]\d{2}:\d{2}|[+-]\d{4})?:', String.Moment),
- (r':((\d+(\.\d*)?|\.\d+)[ ]+)?(millisecond|second|minute|hour|day|week|month|year)[s]?'
- r'(([ ]+and[ ]+(\d+[ ]+)?(millisecond|second|minute|hour|day|week|month|year)[s]?)'
- r'|[ ]+(ago|from[ ]+now))*:', String.Moment),
- (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
- r'(==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
- (r'(import|return|continue|if|else)\b', Keyword, 'slashstartsregex'),
- (r'(var|const|function|reducer|sub|input)\b', Keyword.Declaration, 'slashstartsregex'),
- (r'(batch|emit|filter|head|join|keep|pace|pass|put|read|reduce|remove|'
- r'sequence|skip|sort|split|tail|unbatch|uniq|view|write)\b', Keyword.Reserved),
- (r'(true|false|null|Infinity)\b', Keyword.Constant),
- (r'(Array|Date|Juttle|Math|Number|Object|RegExp|String)\b', Name.Builtin),
- (JS_IDENT, Name.Other),
- (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'[0-9]+', Number.Integer),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single)
- ]
-
- }
diff --git a/pygments/lexers/julia.py b/pygments/lexers/julia.py
deleted file mode 100644
index aa1609da..00000000
--- a/pygments/lexers/julia.py
+++ /dev/null
@@ -1,335 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.julia
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Julia language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, \
- words, include
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic
-from pygments.util import shebang_matches, unirange
-
-__all__ = ['JuliaLexer', 'JuliaConsoleLexer']
-
-allowed_variable = (
- u'(?:[a-zA-Z_\u00A1-\uffff]|%s)(?:[a-zA-Z_0-9\u00A1-\uffff]|%s)*!*' %
- ((unirange(0x10000, 0x10ffff),) * 2))
-
-
-class JuliaLexer(RegexLexer):
- """
- For `Julia <http://julialang.org/>`_ source code.
-
- .. versionadded:: 1.6
- """
-
- name = 'Julia'
- aliases = ['julia', 'jl']
- filenames = ['*.jl']
- mimetypes = ['text/x-julia', 'application/x-julia']
-
- flags = re.MULTILINE | re.UNICODE
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'[^\S\n]+', Text),
- (r'#=', Comment.Multiline, "blockcomment"),
- (r'#.*$', Comment),
- (r'[\[\]{}(),;]', Punctuation),
-
- # keywords
- (r'in\b', Keyword.Pseudo),
- (r'isa\b', Keyword.Pseudo),
- (r'(true|false)\b', Keyword.Constant),
- (r'(local|global|const)\b', Keyword.Declaration),
- (words([
- 'function', 'type', 'typealias', 'abstract', 'immutable',
- 'baremodule', 'begin', 'bitstype', 'break', 'catch', 'ccall',
- 'continue', 'do', 'else', 'elseif', 'end', 'export', 'finally',
- 'for', 'if', 'import', 'importall', 'let', 'macro', 'module',
- 'mutable', 'primitive', 'quote', 'return', 'struct', 'try',
- 'using', 'while'],
- suffix=r'\b'), Keyword),
-
- # NOTE
- # Patterns below work only for definition sites and thus hardly reliable.
- #
- # functions
- # (r'(function)(\s+)(' + allowed_variable + ')',
- # bygroups(Keyword, Text, Name.Function)),
- #
- # types
- # (r'(type|typealias|abstract|immutable)(\s+)(' + allowed_variable + ')',
- # bygroups(Keyword, Text, Name.Class)),
-
- # type names
- (words([
- 'ANY', 'ASCIIString', 'AbstractArray', 'AbstractChannel',
- 'AbstractFloat', 'AbstractMatrix', 'AbstractRNG',
- 'AbstractSparseArray', 'AbstractSparseMatrix',
- 'AbstractSparseVector', 'AbstractString', 'AbstractVecOrMat',
- 'AbstractVector', 'Any', 'ArgumentError', 'Array',
- 'AssertionError', 'Associative', 'Base64DecodePipe',
- 'Base64EncodePipe', 'Bidiagonal', 'BigFloat', 'BigInt',
- 'BitArray', 'BitMatrix', 'BitVector', 'Bool', 'BoundsError',
- 'Box', 'BufferStream', 'CapturedException', 'CartesianIndex',
- 'CartesianRange', 'Cchar', 'Cdouble', 'Cfloat', 'Channel',
- 'Char', 'Cint', 'Cintmax_t', 'Clong', 'Clonglong',
- 'ClusterManager', 'Cmd', 'Coff_t', 'Colon', 'Complex',
- 'Complex128', 'Complex32', 'Complex64', 'CompositeException',
- 'Condition', 'Cptrdiff_t', 'Cshort', 'Csize_t', 'Cssize_t',
- 'Cstring', 'Cuchar', 'Cuint', 'Cuintmax_t', 'Culong',
- 'Culonglong', 'Cushort', 'Cwchar_t', 'Cwstring', 'DataType',
- 'Date', 'DateTime', 'DenseArray', 'DenseMatrix',
- 'DenseVecOrMat', 'DenseVector', 'Diagonal', 'Dict',
- 'DimensionMismatch', 'Dims', 'DirectIndexString', 'Display',
- 'DivideError', 'DomainError', 'EOFError', 'EachLine', 'Enum',
- 'Enumerate', 'ErrorException', 'Exception', 'Expr',
- 'Factorization', 'FileMonitor', 'FileOffset', 'Filter',
- 'Float16', 'Float32', 'Float64', 'FloatRange', 'Function',
- 'GenSym', 'GlobalRef', 'GotoNode', 'HTML', 'Hermitian', 'IO',
- 'IOBuffer', 'IOStream', 'IPv4', 'IPv6', 'InexactError',
- 'InitError', 'Int', 'Int128', 'Int16', 'Int32', 'Int64', 'Int8',
- 'IntSet', 'Integer', 'InterruptException', 'IntrinsicFunction',
- 'InvalidStateException', 'Irrational', 'KeyError', 'LabelNode',
- 'LambdaStaticData', 'LinSpace', 'LineNumberNode', 'LoadError',
- 'LocalProcess', 'LowerTriangular', 'MIME', 'Matrix',
- 'MersenneTwister', 'Method', 'MethodError', 'MethodTable',
- 'Module', 'NTuple', 'NewvarNode', 'NullException', 'Nullable',
- 'Number', 'ObjectIdDict', 'OrdinalRange', 'OutOfMemoryError',
- 'OverflowError', 'Pair', 'ParseError', 'PartialQuickSort',
- 'Pipe', 'PollingFileWatcher', 'ProcessExitedException',
- 'ProcessGroup', 'Ptr', 'QuoteNode', 'RandomDevice', 'Range',
- 'Rational', 'RawFD', 'ReadOnlyMemoryError', 'Real',
- 'ReentrantLock', 'Ref', 'Regex', 'RegexMatch',
- 'RemoteException', 'RemoteRef', 'RepString', 'RevString',
- 'RopeString', 'RoundingMode', 'SegmentationFault',
- 'SerializationState', 'Set', 'SharedArray', 'SharedMatrix',
- 'SharedVector', 'Signed', 'SimpleVector', 'SparseMatrixCSC',
- 'StackOverflowError', 'StatStruct', 'StepRange', 'StridedArray',
- 'StridedMatrix', 'StridedVecOrMat', 'StridedVector', 'SubArray',
- 'SubString', 'SymTridiagonal', 'Symbol', 'SymbolNode',
- 'Symmetric', 'SystemError', 'TCPSocket', 'Task', 'Text',
- 'TextDisplay', 'Timer', 'TopNode', 'Tridiagonal', 'Tuple',
- 'Type', 'TypeConstructor', 'TypeError', 'TypeName', 'TypeVar',
- 'UDPSocket', 'UInt', 'UInt128', 'UInt16', 'UInt32', 'UInt64',
- 'UInt8', 'UTF16String', 'UTF32String', 'UTF8String',
- 'UndefRefError', 'UndefVarError', 'UnicodeError', 'UniformScaling',
- 'Union', 'UnitRange', 'Unsigned', 'UpperTriangular', 'Val',
- 'Vararg', 'VecOrMat', 'Vector', 'VersionNumber', 'Void', 'WString',
- 'WeakKeyDict', 'WeakRef', 'WorkerConfig', 'Zip'], suffix=r'\b'),
- Keyword.Type),
-
- # builtins
- (words([
- u'ARGS', u'CPU_CORES', u'C_NULL', u'DevNull', u'ENDIAN_BOM',
- u'ENV', u'I', u'Inf', u'Inf16', u'Inf32', u'Inf64',
- u'InsertionSort', u'JULIA_HOME', u'LOAD_PATH', u'MergeSort',
- u'NaN', u'NaN16', u'NaN32', u'NaN64', u'OS_NAME',
- u'QuickSort', u'RoundDown', u'RoundFromZero', u'RoundNearest',
- u'RoundNearestTiesAway', u'RoundNearestTiesUp',
- u'RoundToZero', u'RoundUp', u'STDERR', u'STDIN', u'STDOUT',
- u'VERSION', u'WORD_SIZE', u'catalan', u'e', u'eu',
- u'eulergamma', u'golden', u'im', u'nothing', u'pi', u'γ',
- u'π', u'φ'],
- suffix=r'\b'), Name.Builtin),
-
- # operators
- # see: https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm
- (words([
- # prec-assignment
- u'=', u':=', u'+=', u'-=', u'*=', u'/=', u'//=', u'.//=', u'.*=', u'./=',
- u'\\=', u'.\\=', u'^=', u'.^=', u'÷=', u'.÷=', u'%=', u'.%=', u'|=', u'&=',
- u'$=', u'=>', u'<<=', u'>>=', u'>>>=', u'~', u'.+=', u'.-=',
- # prec-conditional
- u'?',
- # prec-arrow
- u'--', u'-->',
- # prec-lazy-or
- u'||',
- # prec-lazy-and
- u'&&',
- # prec-comparison
- u'>', u'<', u'>=', u'≥', u'<=', u'≤', u'==', u'===', u'≡', u'!=', u'≠',
- u'!==', u'≢', u'.>', u'.<', u'.>=', u'.≥', u'.<=', u'.≤', u'.==', u'.!=',
- u'.≠', u'.=', u'.!', u'<:', u'>:', u'∈', u'∉', u'∋', u'∌', u'⊆',
- u'⊈', u'⊂',
- u'⊄', u'⊊',
- # prec-pipe
- u'|>', u'<|',
- # prec-colon
- u':',
- # prec-plus
- u'+', u'-', u'.+', u'.-', u'|', u'∪', u'$',
- # prec-bitshift
- u'<<', u'>>', u'>>>', u'.<<', u'.>>', u'.>>>',
- # prec-times
- u'*', u'/', u'./', u'÷', u'.÷', u'%', u'⋅', u'.%', u'.*', u'\\', u'.\\', u'&', u'∩',
- # prec-rational
- u'//', u'.//',
- # prec-power
- u'^', u'.^',
- # prec-decl
- u'::',
- # prec-dot
- u'.',
- # unary op
- u'+', u'-', u'!', u'√', u'∛', u'∜'
- ]), Operator),
-
- # chars
- (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,3}|\\u[a-fA-F0-9]{1,4}|"
- r"\\U[a-fA-F0-9]{1,6}|[^\\\'\n])'", String.Char),
-
- # try to match trailing transpose
- (r'(?<=[.\w)\]])\'+', Operator),
-
- # strings
- (r'"""', String, 'tqstring'),
- (r'"', String, 'string'),
-
- # regular expressions
- (r'r"""', String.Regex, 'tqregex'),
- (r'r"', String.Regex, 'regex'),
-
- # backticks
- (r'`', String.Backtick, 'command'),
-
- # names
- (allowed_variable, Name),
- (r'@' + allowed_variable, Name.Decorator),
-
- # numbers
- (r'(\d+(_\d+)+\.\d*|\d*\.\d+(_\d+)+)([eEf][+-]?[0-9]+)?', Number.Float),
- (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
- (r'\d+(_\d+)+[eEf][+-]?[0-9]+', Number.Float),
- (r'\d+[eEf][+-]?[0-9]+', Number.Float),
- (r'0b[01]+(_[01]+)+', Number.Bin),
- (r'0b[01]+', Number.Bin),
- (r'0o[0-7]+(_[0-7]+)+', Number.Oct),
- (r'0o[0-7]+', Number.Oct),
- (r'0x[a-fA-F0-9]+(_[a-fA-F0-9]+)+', Number.Hex),
- (r'0x[a-fA-F0-9]+', Number.Hex),
- (r'\d+(_\d+)+', Number.Integer),
- (r'\d+', Number.Integer)
- ],
-
- "blockcomment": [
- (r'[^=#]', Comment.Multiline),
- (r'#=', Comment.Multiline, '#push'),
- (r'=#', Comment.Multiline, '#pop'),
- (r'[=#]', Comment.Multiline),
- ],
-
- 'string': [
- (r'"', String, '#pop'),
- # FIXME: This escape pattern is not perfect.
- (r'\\([\\"\'$nrbtfav]|(x|u|U)[a-fA-F0-9]+|\d+)', String.Escape),
- # Interpolation is defined as "$" followed by the shortest full
- # expression, which is something we can't parse.
- # Include the most common cases here: $word, and $(paren'd expr).
- (r'\$' + allowed_variable, String.Interpol),
- # (r'\$[a-zA-Z_]+', String.Interpol),
- (r'(\$)(\()', bygroups(String.Interpol, Punctuation), 'in-intp'),
- # @printf and @sprintf formats
- (r'%[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]',
- String.Interpol),
- (r'.|\s', String),
- ],
-
- 'tqstring': [
- (r'"""', String, '#pop'),
- (r'\\([\\"\'$nrbtfav]|(x|u|U)[a-fA-F0-9]+|\d+)', String.Escape),
- (r'\$' + allowed_variable, String.Interpol),
- (r'(\$)(\()', bygroups(String.Interpol, Punctuation), 'in-intp'),
- (r'.|\s', String),
- ],
-
- 'regex': [
- (r'"', String.Regex, '#pop'),
- (r'\\"', String.Regex),
- (r'.|\s', String.Regex),
- ],
-
- 'tqregex': [
- (r'"""', String.Regex, '#pop'),
- (r'.|\s', String.Regex),
- ],
-
- 'command': [
- (r'`', String.Backtick, '#pop'),
- (r'\$' + allowed_variable, String.Interpol),
- (r'(\$)(\()', bygroups(String.Interpol, Punctuation), 'in-intp'),
- (r'.|\s', String.Backtick)
- ],
-
- 'in-intp': [
- (r'\(', Punctuation, '#push'),
- (r'\)', Punctuation, '#pop'),
- include('root'),
- ]
- }
-
- def analyse_text(text):
- return shebang_matches(text, r'julia')
-
-
-class JuliaConsoleLexer(Lexer):
- """
- For Julia console sessions. Modeled after MatlabSessionLexer.
-
- .. versionadded:: 1.6
- """
- name = 'Julia console'
- aliases = ['jlcon']
-
- def get_tokens_unprocessed(self, text):
- jllexer = JuliaLexer(**self.options)
- start = 0
- curcode = ''
- insertions = []
- output = False
- error = False
-
- for line in text.splitlines(True):
- if line.startswith('julia>'):
- insertions.append((len(curcode), [(0, Generic.Prompt, line[:6])]))
- curcode += line[6:]
- output = False
- error = False
- elif line.startswith('help?>') or line.startswith('shell>'):
- yield start, Generic.Prompt, line[:6]
- yield start + 6, Text, line[6:]
- output = False
- error = False
- elif line.startswith(' ') and not output:
- insertions.append((len(curcode), [(0, Text, line[:6])]))
- curcode += line[6:]
- else:
- if curcode:
- for item in do_insertions(
- insertions, jllexer.get_tokens_unprocessed(curcode)):
- yield item
- curcode = ''
- insertions = []
- if line.startswith('ERROR: ') or error:
- yield start, Generic.Error, line
- error = True
- else:
- yield start, Generic.Output, line
- output = True
- start += len(line)
-
- if curcode:
- for item in do_insertions(
- insertions, jllexer.get_tokens_unprocessed(curcode)):
- yield item
diff --git a/pygments/lexers/jvm.py b/pygments/lexers/jvm.py
deleted file mode 100644
index d01b96fc..00000000
--- a/pygments/lexers/jvm.py
+++ /dev/null
@@ -1,1654 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.jvm
- ~~~~~~~~~~~~~~~~~~~
-
- Pygments lexers for JVM languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
- this, combined, default, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-from pygments.util import shebang_matches
-from pygments import unistring as uni
-
-__all__ = ['JavaLexer', 'ScalaLexer', 'GosuLexer', 'GosuTemplateLexer',
- 'GroovyLexer', 'IokeLexer', 'ClojureLexer', 'ClojureScriptLexer',
- 'KotlinLexer', 'XtendLexer', 'AspectJLexer', 'CeylonLexer',
- 'PigLexer', 'GoloLexer', 'JasminLexer', 'SarlLexer']
-
-
-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 | re.UNICODE
-
- tokens = {
- 'root': [
- (r'[^\S\n]+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- # keywords: go before method names to avoid lexing "throw new XYZ"
- # as a method signature
- (r'(assert|break|case|catch|continue|default|do|else|finally|for|'
- r'if|goto|instanceof|new|return|switch|this|throw|try|while)\b',
- Keyword),
- # method names
- (r'((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)' # return arguments
- r'((?:[^\W\d]|\$)[\w$]*)' # method name
- r'(\s*)(\()', # signature start
- bygroups(using(this), Name.Function, Text, Operator)),
- (r'@[^\W\d][\w.]*', Name.Decorator),
- (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), 'import'),
- (r'(true|false|null)\b', Keyword.Constant),
- (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text),
- 'class'),
- (r'(import(?:\s+static)?)(\s+)', bygroups(Keyword.Namespace, Text),
- 'import'),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char),
- (r'(\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Operator, Name.Attribute)),
- (r'^\s*([^\W\d]|\$)[\w$]*:', Name.Label),
- (r'([^\W\d]|\$)[\w$]*', Name),
- (r'([0-9][0-9_]*\.([0-9][0-9_]*)?|'
- r'\.[0-9][0-9_]*)'
- r'([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|'
- r'[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|'
- r'[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|'
- r'0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|'
- r'([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)'
- r'[pP][+\-]?[0-9][0-9_]*[fFdD]?', Number.Float),
- (r'0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?', Number.Hex),
- (r'0[bB][01][01_]*[lL]?', Number.Bin),
- (r'0[0-7_]+[lL]?', Number.Oct),
- (r'0|[1-9][0-9_]*[lL]?', Number.Integer),
- (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator),
- (r'\n', Text)
- ],
- 'class': [
- (r'([^\W\d]|\$)[\w$]*', Name.Class, '#pop')
- ],
- 'import': [
- (r'[\w.]+\*?', Name.Namespace, '#pop')
- ],
- }
-
-
-class AspectJLexer(JavaLexer):
- """
- For `AspectJ <http://www.eclipse.org/aspectj/>`_ source code.
-
- .. versionadded:: 1.6
- """
-
- name = 'AspectJ'
- aliases = ['aspectj']
- filenames = ['*.aj']
- mimetypes = ['text/x-aspectj']
-
- aj_keywords = set((
- 'aspect', 'pointcut', 'privileged', 'call', 'execution',
- 'initialization', 'preinitialization', 'handler', 'get', 'set',
- 'staticinitialization', 'target', 'args', 'within', 'withincode',
- 'cflow', 'cflowbelow', 'annotation', 'before', 'after', 'around',
- 'proceed', 'throwing', 'returning', 'adviceexecution', 'declare',
- 'parents', 'warning', 'error', 'soft', 'precedence', 'thisJoinPoint',
- 'thisJoinPointStaticPart', 'thisEnclosingJoinPointStaticPart',
- 'issingleton', 'perthis', 'pertarget', 'percflow', 'percflowbelow',
- 'pertypewithin', 'lock', 'unlock', 'thisAspectInstance'
- ))
- aj_inter_type = set(('parents:', 'warning:', 'error:', 'soft:', 'precedence:'))
- aj_inter_type_annotation = set(('@type', '@method', '@constructor', '@field'))
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in JavaLexer.get_tokens_unprocessed(self, text):
- if token is Name and value in self.aj_keywords:
- yield index, Keyword, value
- elif token is Name.Label and value in self.aj_inter_type:
- yield index, Keyword, value[:-1]
- yield index, Operator, value[-1]
- elif token is Name.Decorator and value in self.aj_inter_type_annotation:
- yield index, Keyword, value
- else:
- yield index, token, value
-
-
-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
-
- # don't use raw unicode strings!
- op = (u'[-~\\^\\*!%&\\\\<>\\|+=:/?@\u00a6-\u00a7\u00a9\u00ac\u00ae\u00b0-\u00b1'
- u'\u00b6\u00d7\u00f7\u03f6\u0482\u0606-\u0608\u060e-\u060f\u06e9'
- u'\u06fd-\u06fe\u07f6\u09fa\u0b70\u0bf3-\u0bf8\u0bfa\u0c7f\u0cf1-\u0cf2'
- u'\u0d79\u0f01-\u0f03\u0f13-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38'
- u'\u0fbe-\u0fc5\u0fc7-\u0fcf\u109e-\u109f\u1360\u1390-\u1399\u1940'
- u'\u19e0-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2044\u2052\u207a-\u207c'
- u'\u208a-\u208c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118'
- u'\u211e-\u2123\u2125\u2127\u2129\u212e\u213a-\u213b\u2140-\u2144'
- u'\u214a-\u214d\u214f\u2190-\u2328\u232b-\u244a\u249c-\u24e9\u2500-\u2767'
- u'\u2794-\u27c4\u27c7-\u27e5\u27f0-\u2982\u2999-\u29d7\u29dc-\u29fb'
- u'\u29fe-\u2b54\u2ce5-\u2cea\u2e80-\u2ffb\u3004\u3012-\u3013\u3020'
- u'\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3'
- u'\u3200-\u321e\u322a-\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u33ff'
- u'\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ufb29\ufdfd\ufe62\ufe64-\ufe66'
- u'\uff0b\uff1c-\uff1e\uff5c\uff5e\uffe2\uffe4\uffe8-\uffee\ufffc-\ufffd]+')
-
- letter = (u'[a-zA-Z\\$_\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6'
- u'\u00f8-\u02af\u0370-\u0373\u0376-\u0377\u037b-\u037d\u0386'
- u'\u0388-\u03f5\u03f7-\u0481\u048a-\u0556\u0561-\u0587\u05d0-\u05f2'
- u'\u0621-\u063f\u0641-\u064a\u066e-\u066f\u0671-\u06d3\u06d5'
- u'\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5'
- u'\u07b1\u07ca-\u07ea\u0904-\u0939\u093d\u0950\u0958-\u0961'
- u'\u0972-\u097f\u0985-\u09b9\u09bd\u09ce\u09dc-\u09e1\u09f0-\u09f1'
- u'\u0a05-\u0a39\u0a59-\u0a5e\u0a72-\u0a74\u0a85-\u0ab9\u0abd'
- u'\u0ad0-\u0ae1\u0b05-\u0b39\u0b3d\u0b5c-\u0b61\u0b71\u0b83-\u0bb9'
- u'\u0bd0\u0c05-\u0c3d\u0c58-\u0c61\u0c85-\u0cb9\u0cbd\u0cde-\u0ce1'
- u'\u0d05-\u0d3d\u0d60-\u0d61\u0d7a-\u0d7f\u0d85-\u0dc6\u0e01-\u0e30'
- u'\u0e32-\u0e33\u0e40-\u0e45\u0e81-\u0eb0\u0eb2-\u0eb3\u0ebd-\u0ec4'
- u'\u0edc-\u0f00\u0f40-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f'
- u'\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070'
- u'\u1075-\u1081\u108e\u10a0-\u10fa\u1100-\u135a\u1380-\u138f'
- u'\u13a0-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u16ee-\u1711'
- u'\u1720-\u1731\u1740-\u1751\u1760-\u1770\u1780-\u17b3\u17dc'
- u'\u1820-\u1842\u1844-\u18a8\u18aa-\u191c\u1950-\u19a9\u19c1-\u19c7'
- u'\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf'
- u'\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c77\u1d00-\u1d2b\u1d62-\u1d77'
- u'\u1d79-\u1d9a\u1e00-\u1fbc\u1fbe\u1fc2-\u1fcc\u1fd0-\u1fdb'
- u'\u1fe0-\u1fec\u1ff2-\u1ffc\u2071\u207f\u2102\u2107\u210a-\u2113'
- u'\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139'
- u'\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c7c'
- u'\u2c80-\u2ce4\u2d00-\u2d65\u2d80-\u2dde\u3006-\u3007\u3021-\u3029'
- u'\u3038-\u303a\u303c\u3041-\u3096\u309f\u30a1-\u30fa\u30ff-\u318e'
- u'\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\ua014\ua016-\ua48c'
- u'\ua500-\ua60b\ua610-\ua61f\ua62a-\ua66e\ua680-\ua697\ua722-\ua76f'
- u'\ua771-\ua787\ua78b-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822'
- u'\ua840-\ua873\ua882-\ua8b3\ua90a-\ua925\ua930-\ua946\uaa00-\uaa28'
- u'\uaa40-\uaa42\uaa44-\uaa4b\uac00-\ud7a3\uf900-\ufb1d\ufb1f-\ufb28'
- u'\ufb2a-\ufd3d\ufd50-\ufdfb\ufe70-\ufefc\uff21-\uff3a\uff41-\uff5a'
- u'\uff66-\uff6f\uff71-\uff9d\uffa0-\uffdc]')
-
- upper = (u'[A-Z\\$_\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108'
- u'\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c'
- u'\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130'
- u'\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145'
- u'\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a'
- u'\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e'
- u'\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182'
- u'\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194'
- u'\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7'
- u'\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc'
- u'\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9'
- u'\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee'
- u'\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204'
- u'\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218'
- u'\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c'
- u'\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246'
- u'\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038f'
- u'\u0391-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0'
- u'\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7'
- u'\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a'
- u'\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e'
- u'\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a'
- u'\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae'
- u'\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1'
- u'\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6'
- u'\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea'
- u'\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe'
- u'\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512'
- u'\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0531-\u0556'
- u'\u10a0-\u10c5\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e'
- u'\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22'
- u'\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36'
- u'\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a'
- u'\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e'
- u'\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72'
- u'\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86'
- u'\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2'
- u'\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6'
- u'\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca'
- u'\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede'
- u'\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2'
- u'\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d'
- u'\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59-\u1f5f'
- u'\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb'
- u'\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112'
- u'\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133'
- u'\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67'
- u'\u2c69\u2c6b\u2c6d-\u2c6f\u2c72\u2c75\u2c80\u2c82\u2c84\u2c86'
- u'\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a'
- u'\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae'
- u'\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2'
- u'\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6'
- u'\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\ua640\ua642\ua644\ua646'
- u'\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a'
- u'\ua65c\ua65e\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682'
- u'\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696'
- u'\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736'
- u'\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a'
- u'\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e'
- u'\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b'
- u'\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\uff21-\uff3a]')
-
- idrest = u'%s(?:%s|[0-9])*(?:(?<=_)%s)?' % (letter, letter, op)
- letter_letter_digit = u'%s(?:%s|\\d)*' % (letter, letter)
-
- tokens = {
- 'root': [
- # method names
- (r'(class|trait|object)(\s+)', bygroups(Keyword, Text), 'class'),
- (r'[^\S\n]+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*', Comment.Multiline, 'comment'),
- (u'@%s' % idrest, Name.Decorator),
- (u'(abstract|ca(?:se|tch)|d(?:ef|o)|e(?:lse|xtends)|'
- u'f(?:inal(?:ly)?|or(?:Some)?)|i(?:f|mplicit)|'
- u'lazy|match|new|override|pr(?:ivate|otected)'
- u'|re(?:quires|turn)|s(?:ealed|uper)|'
- u't(?:h(?:is|row)|ry)|va[lr]|w(?:hile|ith)|yield)\\b|'
- u'(<[%:-]|=>|>:|[#=@_\u21D2\u2190])(\\b|(?=\\s)|$)', Keyword),
- (u':(?!%s)' % op, Keyword, 'type'),
- (u'%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-fA-F]{4}'", String.Char),
- (u"'%s" % idrest, Text.Symbol),
- (r'[fs]"""', String, 'interptriplestring'), # interpolated strings
- (r'[fs]"', String, 'interpstring'), # interpolated strings
- (r'raw"(\\\\|\\"|[^"])*"', String), # raw strings
- # (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-fA-F]+', Number.Hex),
- (r'[0-9]+L?', Number.Integer),
- (r'\n', Text)
- ],
- 'class': [
- (u'(%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'),
- (u'%s|%s|`[^`]+`' % (idrest, op), Name.Class, '#pop'),
- ],
- 'type': [
- (r'\s+', Text),
- (r'<[%:]|>:|[#_]|forSome|type', Keyword),
- (u'([,);}]|=>|=|\u21d2)(\\s*)', bygroups(Operator, Text), '#pop'),
- (r'[({]', Operator, '#push'),
- (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)(\\[)' %
- (idrest, op, idrest, op),
- bygroups(Keyword.Type, Text, Operator), ('#pop', 'typeparam')),
- (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)$' %
- (idrest, op, idrest, op),
- bygroups(Keyword.Type, Text), '#pop'),
- (r'//.*?\n', Comment.Single, '#pop'),
- (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type)
- ],
- 'typeparam': [
- (r'[\s,]+', Text),
- (u'<[%:]|=>|>:|[#_\u21D2]|forSome|type', Keyword),
- (r'([\])}])', Operator, '#pop'),
- (r'[(\[{]', Operator, '#push'),
- (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type)
- ],
- 'comment': [
- (r'[^/*]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ],
- 'import': [
- (u'(%s|\\.)+' % idrest, Name.Namespace, '#pop')
- ],
- 'interpstringcommon': [
- (r'[^"$\\]+', String),
- (r'\$\$', String),
- (r'\$' + letter_letter_digit, String.Interpol),
- (r'\$\{', String.Interpol, 'interpbrace'),
- (r'\\.', String),
- ],
- 'interptriplestring': [
- (r'"""(?!")', String, '#pop'),
- (r'"', String),
- include('interpstringcommon'),
- ],
- 'interpstring': [
- (r'"', String, '#pop'),
- include('interpstringcommon'),
- ],
- 'interpbrace': [
- (r'\}', String.Interpol, '#pop'),
- (r'\{', String.Interpol, '#push'),
- include('root'),
- ],
- }
-
-
-class GosuLexer(RegexLexer):
- """
- For Gosu source code.
-
- .. versionadded:: 1.5
- """
-
- name = 'Gosu'
- aliases = ['gosu']
- filenames = ['*.gs', '*.gsx', '*.gsp', '*.vark']
- mimetypes = ['text/x-gosu']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- # method names
- (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # modifiers etc.
- r'([a-zA-Z_]\w*)' # 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_][\w.]*', 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_]\w*)',
- bygroups(Keyword.Declaration, Text, Name.Class)),
- (r'(uses)(\s+)([\w.]+\*?)',
- bygroups(Keyword.Namespace, Text, Name.Namespace)),
- (r'"', String, 'string'),
- (r'(\??[.#])([a-zA-Z_]\w*)',
- bygroups(Operator, Name.Attribute)),
- (r'(:)([a-zA-Z_]\w*)',
- bygroups(Operator, Name.Attribute)),
- (r'[a-zA-Z_$]\w*', 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.
-
- .. versionadded:: 1.5
- """
-
- name = 'Gosu Template'
- aliases = ['gst']
- filenames = ['*.gst']
- mimetypes = ['text/x-gosu-template']
-
- def get_tokens_unprocessed(self, text):
- lexer = GosuLexer()
- stack = ['templateText']
- for item in lexer.get_tokens_unprocessed(text, stack):
- yield item
-
-
-class GroovyLexer(RegexLexer):
- """
- For `Groovy <http://groovy.codehaus.org/>`_ source code.
-
- .. versionadded:: 1.5
- """
-
- name = 'Groovy'
- aliases = ['groovy']
- filenames = ['*.groovy','*.gradle']
- mimetypes = ['text/x-groovy']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- # Groovy allows a file to start with a shebang
- (r'#!(.*?)$', Comment.Preproc, 'base'),
- default('base'),
- ],
- 'base': [
- # method names
- (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments
- r'([a-zA-Z_]\w*)' # 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_][\w.]*', 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.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r'\$/((?!/\$).)*/\$', String),
- (r'/(\\\\|\\"|[^/])*/', String),
- (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char),
- (r'(\.)([a-zA-Z_]\w*)', bygroups(Operator, Name.Attribute)),
- (r'[a-zA-Z_]\w*:', Name.Label),
- (r'[a-zA-Z_$]\w*', Name),
- (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator),
- (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+L?', Number.Integer),
- (r'\n', Text)
- ],
- 'class': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop')
- ],
- 'import': [
- (r'[\w.]+\*?', Name.Namespace, '#pop')
- ],
- }
-
- def analyse_text(text):
- return shebang_matches(text, r'groovy')
-
-
-class IokeLexer(RegexLexer):
- """
- For `Ioke <http://ioke.org/>`_ (a strongly typed, dynamic,
- prototype based programming language) source.
-
- .. versionadded:: 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'(?<!\\)/[im-psux]*', String.Regex, '#pop'),
- include('interpolatableText'),
- (r'\\/', String.Regex),
- (r'[^/]', String.Regex)
- ],
-
- 'squareRegexp': [
- (r'(?<!\\)][im-psux]*', 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':[\w!:?]+', String.Symbol),
- (r'[\w!:?]+:(?![\w!?])', 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'\w[\w!:?]+(?=\s*=.*mimic\s)', Name.Entity),
-
- # Assignment
- (r'[a-zA-Z_][\w!:?]*(?=[\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)(?![\w!:?])', Keyword.Reserved),
-
- # Origin
- (r'(eval|mimic|print|println)(?![\w!:?])', Keyword),
-
- # Base
- (r'(cell\?|cellNames|cellOwner\?|cellOwner|cells|cell|'
- r'documentation|hash|identity|mimic|removeCell\!|undefineCell\!)'
- r'(?![\w!:?])', Keyword),
-
- # Ground
- (r'(stackTraceAsText)(?![\w!:?])', Keyword),
-
- # DefaultBehaviour Literals
- (r'(dict|list|message|set)(?![\w!:?])', Keyword.Reserved),
-
- # DefaultBehaviour Case
- (r'(case|case:and|case:else|case:nand|case:nor|case:not|case:or|'
- r'case:otherwise|case:xor)(?![\w!:?])', 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'(?![\w!:?])', Keyword),
-
- # DefaultBehaviour Aspects
- (r'(after|around|before)(?![\w!:?])', Keyword.Reserved),
-
- # DefaultBehaviour
- (r'(kind|cellDescriptionDict|cellSummary|genSym|inspect|notice)'
- r'(?![\w!:?])', Keyword),
- (r'(use|destructuring)', Keyword.Reserved),
-
- # DefaultBehavior BaseBehavior
- (r'(cell\?|cellOwner\?|cellOwner|cellNames|cells|cell|'
- r'documentation|identity|removeCell!|undefineCell)'
- r'(?![\w!:?])', Keyword),
-
- # DefaultBehavior Internal
- (r'(internal:compositeRegexp|internal:concatenateText|'
- r'internal:createDecimal|internal:createNumber|'
- r'internal:createRegexp|internal:createText)'
- r'(?![\w!:?])', Keyword.Reserved),
-
- # DefaultBehaviour Conditions
- (r'(availableRestarts|bind|error\!|findRestart|handle|'
- r'invokeRestart|rescue|restart|signal\!|warn\!)'
- r'(?![\w!:?])', Keyword.Reserved),
-
- # constants
- (r'(nil|false|true)(?![\w!:?])', 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)(?![\w!:?])', Name.Builtin),
-
- # functions
- (u'(generateMatchMethod|aliasMethod|\u03bb|\u028E|fnx|fn|method|'
- u'dmacro|dlecro|syntax|macro|dlecrox|lecrox|lecro|syntax)'
- u'(?![\\w!:?])', 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
- (r'(&&>>|\|\|>>|\*\*>>|:::|::|\.\.\.|===|\*\*>|\*\*=|&&>|&&=|'
- r'\|\|>|\|\|=|\->>|\+>>|!>>|<>>>|<>>|&>>|%>>|#>>|@>>|/>>|\*>>|'
- r'\?>>|\|>>|\^>>|~>>|\$>>|=>>|<<=|>>=|<=>|<\->|=~|!~|=>|\+\+|'
- r'\-\-|<=|>=|==|!=|&&|\.\.|\+=|\-=|\*=|\/=|%=|&=|\^=|\|=|<\-|'
- r'\+>|!>|<>|&>|%>|#>|\@>|\/>|\*>|\?>|\|>|\^>|~>|\$>|<\->|\->|'
- r'<<|>>|\*\*|\?\||\?&|\|\||>|<|\*|\/|%|\+|\-|&|\^|\||=|\$|!|~|'
- u'\\?|#|\u2260|\u2218|\u2208|\u2209)', Operator),
- (r'(and|nand|or|xor|nor|return|import)(?![\w!?])',
- Operator),
-
- # Punctuation
- (r'(\`\`|\`|\'\'|\'|\.|\,|@@|@|\[|\]|\(|\)|\{|\})', Punctuation),
-
- # kinds
- (r'[A-Z][\w!:?]*', Name.Class),
-
- # default cellnames
- (r'[a-z_][\w!:?]*', Name)
- ]
- }
-
-
-class ClojureLexer(RegexLexer):
- """
- Lexer for `Clojure <http://clojure.org/>`_ source code.
-
- .. versionadded:: 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!$%*+<=>?/.#|-]+'
-
- 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
- (words(special_forms, suffix=' '), 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.
- (words(declarations, suffix=' '), Keyword.Declaration),
-
- # highlight the builtins
- (words(builtins, suffix=' '), 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 ClojureScriptLexer(ClojureLexer):
- """
- Lexer for `ClojureScript <http://clojure.org/clojurescript>`_
- source code.
-
- .. versionadded:: 2.0
- """
- name = 'ClojureScript'
- aliases = ['clojurescript', 'cljs']
- filenames = ['*.cljs']
- mimetypes = ['text/x-clojurescript', 'application/x-clojurescript']
-
-
-class TeaLangLexer(RegexLexer):
- """
- For `Tea <http://teatrove.org/>`_ source code. Only used within a
- TeaTemplateLexer.
-
- .. versionadded:: 1.5
- """
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- # method names
- (r'^(\s*(?:[a-zA-Z_][\w\.\[\]]*\s+)+?)' # return arguments
- r'([a-zA-Z_]\w*)' # 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_][\w\.]*', 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_]\w*)', bygroups(Operator, Name.Attribute)),
- (r'[a-zA-Z_]\w*:', Name.Label),
- (r'[a-zA-Z_\$]\w*', Name),
- (r'(isa|[.]{3}|[.]{2}|[=#!<>+-/%&;,.\*\\\(\)\[\]\{\}])', Operator),
- (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+L?', Number.Integer),
- (r'\n', Text)
- ],
- 'template': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop')
- ],
- 'import': [
- (r'[\w.]+\*?', Name.Namespace, '#pop')
- ],
- }
-
-
-class CeylonLexer(RegexLexer):
- """
- For `Ceylon <http://ceylon-lang.org/>`_ source code.
-
- .. versionadded:: 1.6
- """
-
- name = 'Ceylon'
- aliases = ['ceylon']
- filenames = ['*.ceylon']
- mimetypes = ['text/x-ceylon']
-
- flags = re.MULTILINE | re.DOTALL
-
- #: optional Comment or Whitespace
- _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
-
- tokens = {
- 'root': [
- # method names
- (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments
- r'([a-zA-Z_]\w*)' # method name
- r'(\s*)(\()', # signature start
- bygroups(using(this), Name.Function, Text, Operator)),
- (r'[^\S\n]+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*', Comment.Multiline, 'comment'),
- (r'(shared|abstract|formal|default|actual|variable|deprecated|small|'
- r'late|literal|doc|by|see|throws|optional|license|tagged|final|native|'
- r'annotation|sealed)\b', Name.Decorator),
- (r'(break|case|catch|continue|else|finally|for|in|'
- r'if|return|switch|this|throw|try|while|is|exists|dynamic|'
- r'nonempty|then|outer|assert|let)\b', Keyword),
- (r'(abstracts|extends|satisfies|'
- r'super|given|of|out|assign)\b', Keyword.Declaration),
- (r'(function|value|void|new)\b',
- Keyword.Type),
- (r'(assembly|module|package)(\s+)', bygroups(Keyword.Namespace, Text)),
- (r'(true|false|null)\b', Keyword.Constant),
- (r'(class|interface|object|alias)(\s+)',
- bygroups(Keyword.Declaration, Text), 'class'),
- (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'", String.Char),
- (r'".*``.*``.*"', String.Interpol),
- (r'(\.)([a-z_]\w*)',
- bygroups(Operator, Name.Attribute)),
- (r'[a-zA-Z_]\w*:', Name.Label),
- (r'[a-zA-Z_]\w*', Name),
- (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator),
- (r'\d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float),
- (r'\d{1,3}(_\d{3})+\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?',
- Number.Float),
- (r'[0-9][0-9]*\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float),
- (r'[0-9][0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?',
- Number.Float),
- (r'#([0-9a-fA-F]{4})(_[0-9a-fA-F]{4})+', Number.Hex),
- (r'#[0-9a-fA-F]+', Number.Hex),
- (r'\$([01]{4})(_[01]{4})+', Number.Bin),
- (r'\$[01]+', Number.Bin),
- (r'\d{1,3}(_\d{3})+[kMGTP]?', Number.Integer),
- (r'[0-9]+[kMGTP]?', Number.Integer),
- (r'\n', Text)
- ],
- 'class': [
- (r'[A-Za-z_]\w*', Name.Class, '#pop')
- ],
- 'import': [
- (r'[a-z][\w.]*',
- Name.Namespace, '#pop')
- ],
- 'comment': [
- (r'[^*/]', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ],
- }
-
-
-class KotlinLexer(RegexLexer):
- """
- For `Kotlin <http://kotlinlang.org/>`_
- source code.
-
- .. versionadded:: 1.5
- """
-
- name = 'Kotlin'
- aliases = ['kotlin']
- filenames = ['*.kt']
- mimetypes = ['text/x-kotlin']
-
- flags = re.MULTILINE | re.DOTALL | re.UNICODE
-
- kt_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' +
- '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf',
- 'Mn', 'Mc') + ']*')
-
- kt_space_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' +
- '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf',
- 'Mn', 'Mc', 'Zs') + ',-]*')
-
- kt_id = '(' + kt_name + '|`' + kt_space_name + '`)'
-
- tokens = {
- 'root': [
- (r'^\s*\[.*?\]', Name.Attribute),
- (r'[^\S\n]+', Text),
- (r'\s+', Text),
- (r'\\\n', Text), # line continuation
- (r'//.*?\n', Comment.Single),
- (r'/[*].*?[*]/', Comment.Multiline),
- (r'""".*?"""', String),
- (r'\n', Text),
- (r'::|!!|\?[:.]', Operator),
- (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
- (r'[{}]', Punctuation),
- (r'@"(""|[^"])*"', String),
- (r'"(\\\\|\\"|[^"\n])*["\n]', String),
- (r"'\\.'|'[^\\]'", String.Char),
- (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFL]?|"
- r"0[xX][0-9a-fA-F]+[Ll]?", Number),
- (r'(object)(\s+)(:)(\s+)', bygroups(Keyword, Text, Punctuation, Text), 'class'),
- (r'(companion)(\s+)(object)', bygroups(Keyword, Text, Keyword)),
- (r'(class|interface|object)(\s+)', bygroups(Keyword, Text), 'class'),
- (r'(package|import)(\s+)', bygroups(Keyword, Text), 'package'),
- (r'(val|var)(\s+)([(])', bygroups(Keyword, Text, Punctuation), 'property_dec'),
- (r'(val|var)(\s+)', bygroups(Keyword, Text), 'property'),
- (r'(fun)(\s+)', bygroups(Keyword, Text), 'function'),
- (r'(inline fun)(\s+)', bygroups(Keyword, Text), 'function'),
- (r'(abstract|annotation|as|break|by|catch|class|companion|const|'
- r'constructor|continue|crossinline|data|do|dynamic|else|enum|'
- r'external|false|final|finally|for|fun|get|if|import|in|infix|'
- r'inline|inner|interface|internal|is|lateinit|noinline|null|'
- r'object|open|operator|out|override|package|private|protected|'
- r'public|reified|return|sealed|set|super|tailrec|this|throw|'
- r'true|try|val|var|vararg|when|where|while)\b', Keyword),
- (kt_id, Name),
- ],
- 'package': [
- (r'\S+', Name.Namespace, '#pop')
- ],
- 'class': [
- (kt_id, Name.Class, '#pop')
- ],
- 'property': [
- (kt_id, Name.Property, '#pop')
- ],
- 'property_dec': [
- (r'(,)(\s*)', bygroups(Punctuation, Text)),
- (r'(:)(\s*)', bygroups(Punctuation, Text)),
- (r'<', Punctuation, 'generic'),
- (r'([)])', Punctuation, '#pop'),
- (kt_id, Name.Property)
- ],
- 'function': [
- (r'<', Punctuation, 'generic'),
- (r''+kt_id+'([.])'+kt_id, bygroups(Name.Class, Punctuation, Name.Function), '#pop'),
- (kt_id, Name.Function, '#pop')
- ],
- 'generic': [
- (r'(>)(\s*)', bygroups(Punctuation, Text), '#pop'),
- (r':',Punctuation),
- (r'(reified|out|in)\b', Keyword),
- (r',',Text),
- (r'\s+',Text),
- (kt_id,Name)
- ]
- }
-
-
-class XtendLexer(RegexLexer):
- """
- For `Xtend <http://xtend-lang.org/>`_ source code.
-
- .. versionadded:: 1.6
- """
-
- name = 'Xtend'
- aliases = ['xtend']
- filenames = ['*.xtend']
- mimetypes = ['text/x-xtend']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- # method names
- (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments
- r'([a-zA-Z_$][\w$]*)' # 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_][\w.]*', Name.Decorator),
- (r'(assert|break|case|catch|continue|default|do|else|finally|for|'
- r'if|goto|instanceof|new|return|switch|this|throw|try|while|IF|'
- r'ELSE|ELSEIF|ENDIF|FOR|ENDFOR|SEPARATOR|BEFORE|AFTER)\b',
- Keyword),
- (r'(def|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, 'template'),
- (u'(\u00BB)', String, 'template'),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'(\\\\|\\'|[^'])*'", String),
- (r'[a-zA-Z_]\w*:', Name.Label),
- (r'[a-zA-Z_$]\w*', Name),
- (r'[~^*!%&\[\](){}<>\|+=:;,./?-]', Operator),
- (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+L?', Number.Integer),
- (r'\n', Text)
- ],
- 'class': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop')
- ],
- 'import': [
- (r'[\w.]+\*?', Name.Namespace, '#pop')
- ],
- 'template': [
- (r"'''", String, '#pop'),
- (u'\u00AB', String, '#pop'),
- (r'.', String)
- ],
- }
-
-
-class PigLexer(RegexLexer):
- """
- For `Pig Latin <https://pig.apache.org/>`_ source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'Pig'
- aliases = ['pig']
- filenames = ['*.pig']
- mimetypes = ['text/x-pig']
-
- flags = re.MULTILINE | re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'--.*', Comment),
- (r'/\*[\w\W]*?\*/', Comment.Multiline),
- (r'\\\n', Text),
- (r'\\', Text),
- (r'\'(?:\\[ntbrf\\\']|\\u[0-9a-f]{4}|[^\'\\\n\r])*\'', String),
- include('keywords'),
- include('types'),
- include('builtins'),
- include('punct'),
- include('operators'),
- (r'[0-9]*\.[0-9]+(e[0-9]+)?[fd]?', Number.Float),
- (r'0x[0-9a-f]+', Number.Hex),
- (r'[0-9]+L?', Number.Integer),
- (r'\n', Text),
- (r'([a-z_]\w*)(\s*)(\()',
- bygroups(Name.Function, Text, Punctuation)),
- (r'[()#:]', Text),
- (r'[^(:#\'")\s]+', Text),
- (r'\S+\s+', Text) # TODO: make tests pass without \s+
- ],
- 'keywords': [
- (r'(assert|and|any|all|arrange|as|asc|bag|by|cache|CASE|cat|cd|cp|'
- r'%declare|%default|define|dense|desc|describe|distinct|du|dump|'
- r'eval|exex|explain|filter|flatten|foreach|full|generate|group|'
- r'help|if|illustrate|import|inner|input|into|is|join|kill|left|'
- r'limit|load|ls|map|matches|mkdir|mv|not|null|onschema|or|order|'
- r'outer|output|parallel|pig|pwd|quit|register|returns|right|rm|'
- r'rmf|rollup|run|sample|set|ship|split|stderr|stdin|stdout|store|'
- r'stream|through|union|using|void)\b', Keyword)
- ],
- 'builtins': [
- (r'(AVG|BinStorage|cogroup|CONCAT|copyFromLocal|copyToLocal|COUNT|'
- r'cross|DIFF|MAX|MIN|PigDump|PigStorage|SIZE|SUM|TextLoader|'
- r'TOKENIZE)\b', Name.Builtin)
- ],
- 'types': [
- (r'(bytearray|BIGINTEGER|BIGDECIMAL|chararray|datetime|double|float|'
- r'int|long|tuple)\b', Keyword.Type)
- ],
- 'punct': [
- (r'[;(){}\[\]]', Punctuation),
- ],
- 'operators': [
- (r'[#=,./%+\-?]', Operator),
- (r'(eq|gt|lt|gte|lte|neq|matches)\b', Operator),
- (r'(==|<=|<|>=|>|!=)', Operator),
- ],
- }
-
-
-class GoloLexer(RegexLexer):
- """
- For `Golo <http://golo-lang.org/>`_ source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'Golo'
- filenames = ['*.golo']
- aliases = ['golo']
-
- tokens = {
- 'root': [
- (r'[^\S\n]+', Text),
-
- (r'#.*$', Comment),
-
- (r'(\^|\.\.\.|:|\?:|->|==|!=|=|\+|\*|%|/|<=|<|>=|>|=|\.)',
- Operator),
- (r'(?<=[^-])(-)(?=[^-])', Operator),
-
- (r'(?<=[^`])(is|isnt|and|or|not|oftype|in|orIfNull)\b', Operator.Word),
- (r'[]{}|(),[]', Punctuation),
-
- (r'(module|import)(\s+)',
- bygroups(Keyword.Namespace, Text),
- 'modname'),
- (r'\b([a-zA-Z_][\w$.]*)(::)', bygroups(Name.Namespace, Punctuation)),
- (r'\b([a-zA-Z_][\w$]*(?:\.[a-zA-Z_][\w$]*)+)\b', Name.Namespace),
-
- (r'(let|var)(\s+)',
- bygroups(Keyword.Declaration, Text),
- 'varname'),
- (r'(struct)(\s+)',
- bygroups(Keyword.Declaration, Text),
- 'structname'),
- (r'(function)(\s+)',
- bygroups(Keyword.Declaration, Text),
- 'funcname'),
-
- (r'(null|true|false)\b', Keyword.Constant),
- (r'(augment|pimp'
- r'|if|else|case|match|return'
- r'|case|when|then|otherwise'
- r'|while|for|foreach'
- r'|try|catch|finally|throw'
- r'|local'
- r'|continue|break)\b', Keyword),
-
- (r'(map|array|list|set|vector|tuple)(\[)',
- bygroups(Name.Builtin, Punctuation)),
- (r'(print|println|readln|raise|fun'
- r'|asInterfaceInstance)\b', Name.Builtin),
- (r'(`?[a-zA-Z_][\w$]*)(\()',
- bygroups(Name.Function, Punctuation)),
-
- (r'-?[\d_]*\.[\d_]*([eE][+-]?\d[\d_]*)?F?', Number.Float),
- (r'0[0-7]+j?', Number.Oct),
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
- (r'-?\d[\d_]*L', Number.Integer.Long),
- (r'-?\d[\d_]*', Number.Integer),
-
- (r'`?[a-zA-Z_][\w$]*', Name),
- (r'@[a-zA-Z_][\w$.]*', Name.Decorator),
-
- (r'"""', String, combined('stringescape', 'triplestring')),
- (r'"', String, combined('stringescape', 'doublestring')),
- (r"'", String, combined('stringescape', 'singlestring')),
- (r'----((.|\n)*?)----', String.Doc)
-
- ],
-
- 'funcname': [
- (r'`?[a-zA-Z_][\w$]*', Name.Function, '#pop'),
- ],
- 'modname': [
- (r'[a-zA-Z_][\w$.]*\*?', Name.Namespace, '#pop')
- ],
- 'structname': [
- (r'`?[\w.]+\*?', Name.Class, '#pop')
- ],
- 'varname': [
- (r'`?[a-zA-Z_][\w$]*', Name.Variable, '#pop'),
- ],
- 'string': [
- (r'[^\\\'"\n]+', String),
- (r'[\'"\\]', String)
- ],
- 'stringescape': [
- (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
- r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
- ],
- 'triplestring': [
- (r'"""', String, '#pop'),
- include('string'),
- (r'\n', String),
- ],
- 'doublestring': [
- (r'"', String.Double, '#pop'),
- include('string'),
- ],
- 'singlestring': [
- (r"'", String, '#pop'),
- include('string'),
- ],
- 'operators': [
- (r'[#=,./%+\-?]', Operator),
- (r'(eq|gt|lt|gte|lte|neq|matches)\b', Operator),
- (r'(==|<=|<|>=|>|!=)', Operator),
- ],
- }
-
-
-class JasminLexer(RegexLexer):
- """
- For `Jasmin <http://jasmin.sourceforge.net/>`_ assembly code.
-
- .. versionadded:: 2.0
- """
-
- name = 'Jasmin'
- aliases = ['jasmin', 'jasminxt']
- filenames = ['*.j']
-
- _whitespace = r' \n\t\r'
- _ws = r'(?:[%s]+)' % _whitespace
- _separator = r'%s:=' % _whitespace
- _break = r'(?=[%s]|$)' % _separator
- _name = r'[^%s]+' % _separator
- _unqualified_name = r'(?:[^%s.;\[/]+)' % _separator
-
- tokens = {
- 'default': [
- (r'\n', Text, '#pop'),
- (r"'", String.Single, ('#pop', 'quote')),
- (r'"', String.Double, 'string'),
- (r'=', Punctuation),
- (r':', Punctuation, 'label'),
- (_ws, Text),
- (r';.*', Comment.Single),
- (r'(\$[-+])?0x-?[\da-fA-F]+%s' % _break, Number.Hex),
- (r'(\$[-+]|\+)?-?\d+%s' % _break, Number.Integer),
- (r'-?(\d+\.\d*|\.\d+)([eE][-+]?\d+)?[fFdD]?'
- r'[\x00-\x08\x0b\x0c\x0e-\x1f]*%s' % _break, Number.Float),
- (r'\$%s' % _name, Name.Variable),
-
- # Directives
- (r'\.annotation%s' % _break, Keyword.Reserved, 'annotation'),
- (r'(\.attribute|\.bytecode|\.debug|\.deprecated|\.enclosing|'
- r'\.interface|\.line|\.signature|\.source|\.stack|\.var|abstract|'
- r'annotation|bridge|class|default|enum|field|final|fpstrict|'
- r'interface|native|private|protected|public|signature|static|'
- r'synchronized|synthetic|transient|varargs|volatile)%s' % _break,
- Keyword.Reserved),
- (r'\.catch%s' % _break, Keyword.Reserved, 'caught-exception'),
- (r'(\.class|\.implements|\.inner|\.super|inner|invisible|'
- r'invisibleparam|outer|visible|visibleparam)%s' % _break,
- Keyword.Reserved, 'class/convert-dots'),
- (r'\.field%s' % _break, Keyword.Reserved,
- ('descriptor/convert-dots', 'field')),
- (r'(\.end|\.limit|use)%s' % _break, Keyword.Reserved,
- 'no-verification'),
- (r'\.method%s' % _break, Keyword.Reserved, 'method'),
- (r'\.set%s' % _break, Keyword.Reserved, 'var'),
- (r'\.throws%s' % _break, Keyword.Reserved, 'exception'),
- (r'(from|offset|to|using)%s' % _break, Keyword.Reserved, 'label'),
- (r'is%s' % _break, Keyword.Reserved,
- ('descriptor/convert-dots', 'var')),
- (r'(locals|stack)%s' % _break, Keyword.Reserved, 'verification'),
- (r'method%s' % _break, Keyword.Reserved, 'enclosing-method'),
-
- # Instructions
- (words((
- 'aaload', 'aastore', 'aconst_null', 'aload', 'aload_0', 'aload_1', 'aload_2',
- 'aload_3', 'aload_w', 'areturn', 'arraylength', 'astore', 'astore_0', 'astore_1',
- 'astore_2', 'astore_3', 'astore_w', 'athrow', 'baload', 'bastore', 'bipush',
- 'breakpoint', 'caload', 'castore', 'd2f', 'd2i', 'd2l', 'dadd', 'daload', 'dastore',
- 'dcmpg', 'dcmpl', 'dconst_0', 'dconst_1', 'ddiv', 'dload', 'dload_0', 'dload_1',
- 'dload_2', 'dload_3', 'dload_w', 'dmul', 'dneg', 'drem', 'dreturn', 'dstore', 'dstore_0',
- 'dstore_1', 'dstore_2', 'dstore_3', 'dstore_w', 'dsub', 'dup', 'dup2', 'dup2_x1',
- 'dup2_x2', 'dup_x1', 'dup_x2', 'f2d', 'f2i', 'f2l', 'fadd', 'faload', 'fastore', 'fcmpg',
- 'fcmpl', 'fconst_0', 'fconst_1', 'fconst_2', 'fdiv', 'fload', 'fload_0', 'fload_1',
- 'fload_2', 'fload_3', 'fload_w', 'fmul', 'fneg', 'frem', 'freturn', 'fstore', 'fstore_0',
- 'fstore_1', 'fstore_2', 'fstore_3', 'fstore_w', 'fsub', 'i2b', 'i2c', 'i2d', 'i2f', 'i2l',
- 'i2s', 'iadd', 'iaload', 'iand', 'iastore', 'iconst_0', 'iconst_1', 'iconst_2',
- 'iconst_3', 'iconst_4', 'iconst_5', 'iconst_m1', 'idiv', 'iinc', 'iinc_w', 'iload',
- 'iload_0', 'iload_1', 'iload_2', 'iload_3', 'iload_w', 'imul', 'ineg', 'int2byte',
- 'int2char', 'int2short', 'ior', 'irem', 'ireturn', 'ishl', 'ishr', 'istore', 'istore_0',
- 'istore_1', 'istore_2', 'istore_3', 'istore_w', 'isub', 'iushr', 'ixor', 'l2d', 'l2f',
- 'l2i', 'ladd', 'laload', 'land', 'lastore', 'lcmp', 'lconst_0', 'lconst_1', 'ldc2_w',
- 'ldiv', 'lload', 'lload_0', 'lload_1', 'lload_2', 'lload_3', 'lload_w', 'lmul', 'lneg',
- 'lookupswitch', 'lor', 'lrem', 'lreturn', 'lshl', 'lshr', 'lstore', 'lstore_0',
- 'lstore_1', 'lstore_2', 'lstore_3', 'lstore_w', 'lsub', 'lushr', 'lxor',
- 'monitorenter', 'monitorexit', 'nop', 'pop', 'pop2', 'ret', 'ret_w', 'return', 'saload',
- 'sastore', 'sipush', 'swap'), suffix=_break), Keyword.Reserved),
- (r'(anewarray|checkcast|instanceof|ldc|ldc_w|new)%s' % _break,
- Keyword.Reserved, 'class/no-dots'),
- (r'invoke(dynamic|interface|nonvirtual|special|'
- r'static|virtual)%s' % _break, Keyword.Reserved,
- 'invocation'),
- (r'(getfield|putfield)%s' % _break, Keyword.Reserved,
- ('descriptor/no-dots', 'field')),
- (r'(getstatic|putstatic)%s' % _break, Keyword.Reserved,
- ('descriptor/no-dots', 'static')),
- (words((
- 'goto', 'goto_w', 'if_acmpeq', 'if_acmpne', 'if_icmpeq',
- 'if_icmpge', 'if_icmpgt', 'if_icmple', 'if_icmplt', 'if_icmpne',
- 'ifeq', 'ifge', 'ifgt', 'ifle', 'iflt', 'ifne', 'ifnonnull',
- 'ifnull', 'jsr', 'jsr_w'), suffix=_break),
- Keyword.Reserved, 'label'),
- (r'(multianewarray|newarray)%s' % _break, Keyword.Reserved,
- 'descriptor/convert-dots'),
- (r'tableswitch%s' % _break, Keyword.Reserved, 'table')
- ],
- 'quote': [
- (r"'", String.Single, '#pop'),
- (r'\\u[\da-fA-F]{4}', String.Escape),
- (r"[^'\\]+", String.Single)
- ],
- 'string': [
- (r'"', String.Double, '#pop'),
- (r'\\([nrtfb"\'\\]|u[\da-fA-F]{4}|[0-3]?[0-7]{1,2})',
- String.Escape),
- (r'[^"\\]+', String.Double)
- ],
- 'root': [
- (r'\n+', Text),
- (r"'", String.Single, 'quote'),
- include('default'),
- (r'(%s)([ \t\r]*)(:)' % _name,
- bygroups(Name.Label, Text, Punctuation)),
- (_name, String.Other)
- ],
- 'annotation': [
- (r'\n', Text, ('#pop', 'annotation-body')),
- (r'default%s' % _break, Keyword.Reserved,
- ('#pop', 'annotation-default')),
- include('default')
- ],
- 'annotation-body': [
- (r'\n+', Text),
- (r'\.end%s' % _break, Keyword.Reserved, '#pop'),
- include('default'),
- (_name, String.Other, ('annotation-items', 'descriptor/no-dots'))
- ],
- 'annotation-default': [
- (r'\n+', Text),
- (r'\.end%s' % _break, Keyword.Reserved, '#pop'),
- include('default'),
- default(('annotation-items', 'descriptor/no-dots'))
- ],
- 'annotation-items': [
- (r"'", String.Single, 'quote'),
- include('default'),
- (_name, String.Other)
- ],
- 'caught-exception': [
- (r'all%s' % _break, Keyword, '#pop'),
- include('exception')
- ],
- 'class/convert-dots': [
- include('default'),
- (r'(L)((?:%s[/.])*)(%s)(;)' % (_unqualified_name, _name),
- bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation),
- '#pop'),
- (r'((?:%s[/.])*)(%s)' % (_unqualified_name, _name),
- bygroups(Name.Namespace, Name.Class), '#pop')
- ],
- 'class/no-dots': [
- include('default'),
- (r'\[+', Punctuation, ('#pop', 'descriptor/no-dots')),
- (r'(L)((?:%s/)*)(%s)(;)' % (_unqualified_name, _name),
- bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation),
- '#pop'),
- (r'((?:%s/)*)(%s)' % (_unqualified_name, _name),
- bygroups(Name.Namespace, Name.Class), '#pop')
- ],
- 'descriptor/convert-dots': [
- include('default'),
- (r'\[+', Punctuation),
- (r'(L)((?:%s[/.])*)(%s?)(;)' % (_unqualified_name, _name),
- bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation),
- '#pop'),
- (r'[^%s\[)L]+' % _separator, Keyword.Type, '#pop'),
- default('#pop')
- ],
- 'descriptor/no-dots': [
- include('default'),
- (r'\[+', Punctuation),
- (r'(L)((?:%s/)*)(%s)(;)' % (_unqualified_name, _name),
- bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation),
- '#pop'),
- (r'[^%s\[)L]+' % _separator, Keyword.Type, '#pop'),
- default('#pop')
- ],
- 'descriptors/convert-dots': [
- (r'\)', Punctuation, '#pop'),
- default('descriptor/convert-dots')
- ],
- 'enclosing-method': [
- (_ws, Text),
- (r'(?=[^%s]*\()' % _separator, Text, ('#pop', 'invocation')),
- default(('#pop', 'class/convert-dots'))
- ],
- 'exception': [
- include('default'),
- (r'((?:%s[/.])*)(%s)' % (_unqualified_name, _name),
- bygroups(Name.Namespace, Name.Exception), '#pop')
- ],
- 'field': [
- (r'static%s' % _break, Keyword.Reserved, ('#pop', 'static')),
- include('default'),
- (r'((?:%s[/.](?=[^%s]*[/.]))*)(%s[/.])?(%s)' %
- (_unqualified_name, _separator, _unqualified_name, _name),
- bygroups(Name.Namespace, Name.Class, Name.Variable.Instance),
- '#pop')
- ],
- 'invocation': [
- include('default'),
- (r'((?:%s[/.](?=[^%s(]*[/.]))*)(%s[/.])?(%s)(\()' %
- (_unqualified_name, _separator, _unqualified_name, _name),
- bygroups(Name.Namespace, Name.Class, Name.Function, Punctuation),
- ('#pop', 'descriptor/convert-dots', 'descriptors/convert-dots',
- 'descriptor/convert-dots'))
- ],
- 'label': [
- include('default'),
- (_name, Name.Label, '#pop')
- ],
- 'method': [
- include('default'),
- (r'(%s)(\()' % _name, bygroups(Name.Function, Punctuation),
- ('#pop', 'descriptor/convert-dots', 'descriptors/convert-dots',
- 'descriptor/convert-dots'))
- ],
- 'no-verification': [
- (r'(locals|method|stack)%s' % _break, Keyword.Reserved, '#pop'),
- include('default')
- ],
- 'static': [
- include('default'),
- (r'((?:%s[/.](?=[^%s]*[/.]))*)(%s[/.])?(%s)' %
- (_unqualified_name, _separator, _unqualified_name, _name),
- bygroups(Name.Namespace, Name.Class, Name.Variable.Class), '#pop')
- ],
- 'table': [
- (r'\n+', Text),
- (r'default%s' % _break, Keyword.Reserved, '#pop'),
- include('default'),
- (_name, Name.Label)
- ],
- 'var': [
- include('default'),
- (_name, Name.Variable, '#pop')
- ],
- 'verification': [
- include('default'),
- (r'(Double|Float|Integer|Long|Null|Top|UninitializedThis)%s' %
- _break, Keyword, '#pop'),
- (r'Object%s' % _break, Keyword, ('#pop', 'class/no-dots')),
- (r'Uninitialized%s' % _break, Keyword, ('#pop', 'label'))
- ]
- }
-
- def analyse_text(text):
- score = 0
- if re.search(r'^\s*\.class\s', text, re.MULTILINE):
- score += 0.5
- if re.search(r'^\s*[a-z]+_[a-z]+\b', text, re.MULTILINE):
- score += 0.3
- if re.search(r'^\s*\.(attribute|bytecode|debug|deprecated|enclosing|'
- r'inner|interface|limit|set|signature|stack)\b', text,
- re.MULTILINE):
- score += 0.6
- return score
-
-
-class SarlLexer(RegexLexer):
- """
- For `SARL <http://www.sarl.io>`_ source code.
-
- .. versionadded:: 2.4
- """
-
- name = 'SARL'
- aliases = ['sarl']
- filenames = ['*.sarl']
- mimetypes = ['text/x-sarl']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- # method names
- (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments
- r'([a-zA-Z_$][\w$]*)' # 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_][\w.]*', Name.Decorator),
- (r'(as|break|case|catch|default|do|else|extends|extension|finally|fires|for|if|implements|instanceof|new|on|requires|return|super|switch|throw|throws|try|typeof|uses|while|with)\b',
- Keyword),
- (r'(abstract|def|dispatch|final|native|override|private|protected|public|static|strictfp|synchronized|transient|val|var|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'(false|it|null|occurrence|this|true|void)\b', Keyword.Constant),
- (r'(agent|annotation|artifact|behavior|capacity|class|enum|event|interface|skill|space)(\s+)', bygroups(Keyword.Declaration, Text),
- 'class'),
- (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'(\\\\|\\'|[^'])*'", String),
- (r'[a-zA-Z_]\w*:', Name.Label),
- (r'[a-zA-Z_$]\w*', Name),
- (r'[~^*!%&\[\](){}<>\|+=:;,./?-]', Operator),
- (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+L?', Number.Integer),
- (r'\n', Text)
- ],
- 'class': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop')
- ],
- 'import': [
- (r'[\w.]+\*?', Name.Namespace, '#pop')
- ],
- }
diff --git a/pygments/lexers/lisp.py b/pygments/lexers/lisp.py
deleted file mode 100644
index 169d7a9e..00000000
--- a/pygments/lexers/lisp.py
+++ /dev/null
@@ -1,2693 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.lisp
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Lispy languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, words, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Literal, Error
-
-from pygments.lexers.python import PythonLexer
-
-__all__ = ['SchemeLexer', 'CommonLispLexer', 'HyLexer', 'RacketLexer',
- 'NewLispLexer', 'EmacsLispLexer', 'ShenLexer', 'CPSALexer',
- 'XtlangLexer', 'FennelLexer']
-
-
-class SchemeLexer(RegexLexer):
- """
- A Scheme lexer, parsing a stream and outputting the tokens
- needed to highlight scheme code.
- This lexer could be most probably easily subclassed to parse
- other LISP-Dialects like Common Lisp, Emacs Lisp or AutoLisp.
-
- This parser is checked with pastes from the LISP pastebin
- at http://paste.lisp.org/ to cover as much syntax as possible.
-
- It supports the full Scheme syntax as defined in R5RS.
-
- .. versionadded:: 0.6
- """
- name = 'Scheme'
- aliases = ['scheme', 'scm']
- filenames = ['*.scm', '*.ss']
- mimetypes = ['text/x-scheme', 'application/x-scheme']
-
- # list of known keywords and builtins taken form vim 6.4 scheme.vim
- # syntax file.
- keywords = (
- 'lambda', 'define', 'if', 'else', 'cond', 'and', 'or', 'case', 'let',
- 'let*', 'letrec', 'begin', 'do', 'delay', 'set!', '=>', 'quote',
- 'quasiquote', 'unquote', 'unquote-splicing', 'define-syntax',
- 'let-syntax', 'letrec-syntax', 'syntax-rules'
- )
- builtins = (
- '*', '+', '-', '/', '<', '<=', '=', '>', '>=', 'abs', 'acos', 'angle',
- 'append', 'apply', 'asin', 'assoc', 'assq', 'assv', 'atan',
- 'boolean?', 'caaaar', 'caaadr', 'caaar', 'caadar', 'caaddr', 'caadr',
- 'caar', 'cadaar', 'cadadr', 'cadar', 'caddar', 'cadddr', 'caddr',
- 'cadr', 'call-with-current-continuation', 'call-with-input-file',
- 'call-with-output-file', 'call-with-values', 'call/cc', 'car',
- 'cdaaar', 'cdaadr', 'cdaar', 'cdadar', 'cdaddr', 'cdadr', 'cdar',
- 'cddaar', 'cddadr', 'cddar', 'cdddar', 'cddddr', 'cdddr', 'cddr',
- 'cdr', 'ceiling', 'char->integer', 'char-alphabetic?', 'char-ci<=?',
- 'char-ci<?', 'char-ci=?', 'char-ci>=?', 'char-ci>?', 'char-downcase',
- 'char-lower-case?', 'char-numeric?', 'char-ready?', 'char-upcase',
- 'char-upper-case?', 'char-whitespace?', 'char<=?', 'char<?', 'char=?',
- 'char>=?', 'char>?', 'char?', 'close-input-port', 'close-output-port',
- 'complex?', 'cons', 'cos', 'current-input-port', 'current-output-port',
- 'denominator', 'display', 'dynamic-wind', 'eof-object?', 'eq?',
- 'equal?', 'eqv?', 'eval', 'even?', 'exact->inexact', 'exact?', 'exp',
- 'expt', 'floor', 'for-each', 'force', 'gcd', 'imag-part',
- 'inexact->exact', 'inexact?', 'input-port?', 'integer->char',
- 'integer?', 'interaction-environment', 'lcm', 'length', 'list',
- 'list->string', 'list->vector', 'list-ref', 'list-tail', 'list?',
- 'load', 'log', 'magnitude', 'make-polar', 'make-rectangular',
- 'make-string', 'make-vector', 'map', 'max', 'member', 'memq', 'memv',
- 'min', 'modulo', 'negative?', 'newline', 'not', 'null-environment',
- 'null?', 'number->string', 'number?', 'numerator', 'odd?',
- 'open-input-file', 'open-output-file', 'output-port?', 'pair?',
- 'peek-char', 'port?', 'positive?', 'procedure?', 'quotient',
- 'rational?', 'rationalize', 'read', 'read-char', 'real-part', 'real?',
- 'remainder', 'reverse', 'round', 'scheme-report-environment',
- 'set-car!', 'set-cdr!', 'sin', 'sqrt', 'string', 'string->list',
- 'string->number', 'string->symbol', 'string-append', 'string-ci<=?',
- 'string-ci<?', 'string-ci=?', 'string-ci>=?', 'string-ci>?',
- 'string-copy', 'string-fill!', 'string-length', 'string-ref',
- 'string-set!', 'string<=?', 'string<?', 'string=?', 'string>=?',
- 'string>?', 'string?', 'substring', 'symbol->string', 'symbol?',
- 'tan', 'transcript-off', 'transcript-on', 'truncate', 'values',
- 'vector', 'vector->list', 'vector-fill!', 'vector-length',
- 'vector-ref', 'vector-set!', 'vector?', 'with-input-from-file',
- 'with-output-to-file', 'write', 'write-char', 'zero?'
- )
-
- # valid names for identifiers
- # well, names can only not consist fully of numbers
- # but this should be good enough for now
- valid_name = r'[\w!$%&*+,/:<=>?@^~|-]+'
-
- tokens = {
- 'root': [
- # the comments
- # and going to the end of the line
- (r';.*$', Comment.Single),
- # multi-line comment
- (r'#\|', Comment.Multiline, 'multiline-comment'),
- # commented form (entire sexpr folliwng)
- (r'#;\s*\(', Comment, 'commented-form'),
- # signifies that the program text that follows is written with the
- # lexical and datum syntax described in r6rs
- (r'#!r6rs', Comment),
-
- # 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"#\\([()/'\"._!§$%& ?=+-]|[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
- (r"(?<=\()(%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),
-
- # the famous parentheses!
- (r'(\(|\))', Punctuation),
- (r'(\[|\])', Punctuation),
- ],
- 'multiline-comment': [
- (r'#\|', Comment.Multiline, '#push'),
- (r'\|#', Comment.Multiline, '#pop'),
- (r'[^|#]+', Comment.Multiline),
- (r'[|#]', Comment.Multiline),
- ],
- 'commented-form': [
- (r'\(', Comment, '#push'),
- (r'\)', Comment, '#pop'),
- (r'[^()]+', Comment),
- ],
- }
-
-
-class CommonLispLexer(RegexLexer):
- """
- A Common Lisp lexer.
-
- .. versionadded:: 0.9
- """
- name = 'Common Lisp'
- aliases = ['common-lisp', 'cl', 'lisp']
- filenames = ['*.cl', '*.lisp']
- mimetypes = ['text/x-common-lisp']
-
- flags = re.IGNORECASE | re.MULTILINE
-
- # couple of useful regexes
-
- # characters that are not macro-characters and can be used to begin a symbol
- nonmacro = r'\\.|[\w!$%&*+-/<=>?@\[\]^{}~]'
- constituent = nonmacro + '|[#.:]'
- terminated = r'(?=[ "()\'\n,;`])' # whitespace or terminating macro characters
-
- # symbol token, reverse-engineered from hyperspec
- # Take a deep breath...
- symbol = r'(\|[^|]+\||(?:%s)(?:%s)*)' % (nonmacro, constituent)
-
- def __init__(self, **options):
- from pygments.lexers._cl_builtins import BUILTIN_FUNCTIONS, \
- SPECIAL_FORMS, MACROS, LAMBDA_LIST_KEYWORDS, DECLARATIONS, \
- BUILTIN_TYPES, BUILTIN_CLASSES
- self.builtin_function = BUILTIN_FUNCTIONS
- self.special_forms = SPECIAL_FORMS
- self.macros = MACROS
- self.lambda_list_keywords = LAMBDA_LIST_KEYWORDS
- self.declarations = DECLARATIONS
- self.builtin_types = BUILTIN_TYPES
- self.builtin_classes = BUILTIN_CLASSES
- RegexLexer.__init__(self, **options)
-
- def get_tokens_unprocessed(self, text):
- stack = ['root']
- for index, token, value in RegexLexer.get_tokens_unprocessed(self, text, stack):
- if token is Name.Variable:
- if value in self.builtin_function:
- yield index, Name.Builtin, value
- continue
- if value in self.special_forms:
- yield index, Keyword, value
- continue
- if value in self.macros:
- yield index, Name.Builtin, value
- continue
- if value in self.lambda_list_keywords:
- yield index, Keyword, value
- continue
- if value in self.declarations:
- yield index, Keyword, value
- continue
- if value in self.builtin_types:
- yield index, Keyword.Type, value
- continue
- if value in self.builtin_classes:
- yield index, Name.Class, value
- continue
- yield index, token, value
-
- tokens = {
- 'root': [
- default('body'),
- ],
- 'multiline-comment': [
- (r'#\|', Comment.Multiline, '#push'), # (cf. Hyperspec 2.4.8.19)
- (r'\|#', Comment.Multiline, '#pop'),
- (r'[^|#]+', Comment.Multiline),
- (r'[|#]', Comment.Multiline),
- ],
- 'commented-form': [
- (r'\(', Comment.Preproc, '#push'),
- (r'\)', Comment.Preproc, '#pop'),
- (r'[^()]+', Comment.Preproc),
- ],
- 'body': [
- # whitespace
- (r'\s+', Text),
-
- # single-line comment
- (r';.*$', Comment.Single),
-
- # multi-line comment
- (r'#\|', Comment.Multiline, 'multiline-comment'),
-
- # encoding comment (?)
- (r'#\d*Y.*$', Comment.Special),
-
- # strings and characters
- (r'"(\\.|\\\n|[^"\\])*"', String),
- # quoting
- (r":" + symbol, String.Symbol),
- (r"::" + symbol, String.Symbol),
- (r":#" + symbol, String.Symbol),
- (r"'" + symbol, String.Symbol),
- (r"'", Operator),
- (r"`", Operator),
-
- # decimal numbers
- (r'[-+]?\d+\.?' + terminated, Number.Integer),
- (r'[-+]?\d+/\d+' + terminated, Number),
- (r'[-+]?(\d*\.\d+([defls][-+]?\d+)?|\d+(\.\d*)?[defls][-+]?\d+)' +
- terminated, Number.Float),
-
- # sharpsign strings and characters
- (r"#\\." + terminated, String.Char),
- (r"#\\" + symbol, String.Char),
-
- # vector
- (r'#\(', Operator, 'body'),
-
- # bitstring
- (r'#\d*\*[01]*', Literal.Other),
-
- # uninterned symbol
- (r'#:' + symbol, String.Symbol),
-
- # read-time and load-time evaluation
- (r'#[.,]', Operator),
-
- # function shorthand
- (r'#\'', Name.Function),
-
- # binary rational
- (r'#b[+-]?[01]+(/[01]+)?', Number.Bin),
-
- # octal rational
- (r'#o[+-]?[0-7]+(/[0-7]+)?', Number.Oct),
-
- # hex rational
- (r'#x[+-]?[0-9a-f]+(/[0-9a-f]+)?', Number.Hex),
-
- # radix rational
- (r'#\d+r[+-]?[0-9a-z]+(/[0-9a-z]+)?', Number),
-
- # complex
- (r'(#c)(\()', bygroups(Number, Punctuation), 'body'),
-
- # array
- (r'(#\d+a)(\()', bygroups(Literal.Other, Punctuation), 'body'),
-
- # structure
- (r'(#s)(\()', bygroups(Literal.Other, Punctuation), 'body'),
-
- # path
- (r'#p?"(\\.|[^"])*"', Literal.Other),
-
- # reference
- (r'#\d+=', Operator),
- (r'#\d+#', Operator),
-
- # read-time comment
- (r'#+nil' + terminated + r'\s*\(', Comment.Preproc, 'commented-form'),
-
- # read-time conditional
- (r'#[+-]', Operator),
-
- # special operators that should have been parsed already
- (r'(,@|,|\.)', Operator),
-
- # special constants
- (r'(t|nil)' + terminated, Name.Constant),
-
- # functions and variables
- (r'\*' + symbol + r'\*', Name.Variable.Global),
- (symbol, Name.Variable),
-
- # parentheses
- (r'\(', Punctuation, 'body'),
- (r'\)', Punctuation, '#pop'),
- ],
- }
-
-
-class HyLexer(RegexLexer):
- """
- Lexer for `Hy <http://hylang.org/>`_ source code.
-
- .. versionadded:: 2.0
- """
- name = 'Hy'
- aliases = ['hylang']
- filenames = ['*.hy']
- mimetypes = ['text/x-hy', 'application/x-hy']
-
- special_forms = (
- 'cond', 'for', '->', '->>', 'car',
- 'cdr', 'first', 'rest', 'let', 'when', 'unless',
- 'import', 'do', 'progn', 'get', 'slice', 'assoc', 'with-decorator',
- ',', 'list_comp', 'kwapply', '~', 'is', 'in', 'is-not', 'not-in',
- 'quasiquote', 'unquote', 'unquote-splice', 'quote', '|', '<<=', '>>=',
- 'foreach', 'while',
- 'eval-and-compile', 'eval-when-compile'
- )
-
- declarations = (
- 'def', 'defn', 'defun', 'defmacro', 'defclass', 'lambda', 'fn', 'setv'
- )
-
- hy_builtins = ()
-
- hy_core = (
- 'cycle', 'dec', 'distinct', 'drop', 'even?', 'filter', 'inc',
- 'instance?', 'iterable?', 'iterate', 'iterator?', 'neg?',
- 'none?', 'nth', 'numeric?', 'odd?', 'pos?', 'remove', 'repeat',
- 'repeatedly', 'take', 'take_nth', 'take_while', 'zero?'
- )
-
- builtins = hy_builtins + hy_core
-
- # valid names for identifiers
- # well, names can only not consist fully of numbers
- # but this should be good enough for now
- valid_name = r'(?!#)[\w!$%*+<=>?/.#-:]+'
-
- def _multi_escape(entries):
- return words(entries, suffix=' ')
-
- 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'0[0-7]+j?', Number.Oct),
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
-
- # strings, symbols and characters
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'" + valid_name, String.Symbol),
- (r"\\(.|[a-z]+)", String.Char),
- (r'^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")', bygroups(Text, String.Doc)),
- (r"^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')", bygroups(Text, String.Doc)),
-
- # keywords
- (r'::?' + valid_name, String.Symbol),
-
- # special operators
- (r'~@|[`\'#^~&@]', Operator),
-
- include('py-keywords'),
- include('py-builtins'),
-
- # 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),
-
- # Hy accepts vector notation
- (r'(\[|\])', Punctuation),
-
- # Hy accepts map notation
- (r'(\{|\})', Punctuation),
-
- # the famous parentheses!
- (r'(\(|\))', Punctuation),
-
- ],
- 'py-keywords': PythonLexer.tokens['keywords'],
- 'py-builtins': PythonLexer.tokens['builtins'],
- }
-
- def analyse_text(text):
- if '(import ' in text or '(defn ' in text:
- return 0.9
-
-
-class RacketLexer(RegexLexer):
- """
- Lexer for `Racket <http://racket-lang.org/>`_ source code (formerly
- known as PLT Scheme).
-
- .. versionadded:: 1.6
- """
-
- name = 'Racket'
- aliases = ['racket', 'rkt']
- filenames = ['*.rkt', '*.rktd', '*.rktl']
- mimetypes = ['text/x-racket', 'application/x-racket']
-
- # Generated by example.rkt
- _keywords = (
- u'#%app', u'#%datum', u'#%declare', u'#%expression', u'#%module-begin',
- u'#%plain-app', u'#%plain-lambda', u'#%plain-module-begin',
- u'#%printing-module-begin', u'#%provide', u'#%require',
- u'#%stratified-body', u'#%top', u'#%top-interaction',
- u'#%variable-reference', u'->', u'->*', u'->*m', u'->d', u'->dm', u'->i',
- u'->m', u'...', u':do-in', u'==', u'=>', u'_', u'absent', u'abstract',
- u'all-defined-out', u'all-from-out', u'and', u'any', u'augment', u'augment*',
- u'augment-final', u'augment-final*', u'augride', u'augride*', u'begin',
- u'begin-for-syntax', u'begin0', u'case', u'case->', u'case->m',
- u'case-lambda', u'class', u'class*', u'class-field-accessor',
- u'class-field-mutator', u'class/c', u'class/derived', u'combine-in',
- u'combine-out', u'command-line', u'compound-unit', u'compound-unit/infer',
- u'cond', u'cons/dc', u'contract', u'contract-out', u'contract-struct',
- u'contracted', u'define', u'define-compound-unit',
- u'define-compound-unit/infer', u'define-contract-struct',
- u'define-custom-hash-types', u'define-custom-set-types',
- u'define-for-syntax', u'define-local-member-name', u'define-logger',
- u'define-match-expander', u'define-member-name',
- u'define-module-boundary-contract', u'define-namespace-anchor',
- u'define-opt/c', u'define-sequence-syntax', u'define-serializable-class',
- u'define-serializable-class*', u'define-signature',
- u'define-signature-form', u'define-struct', u'define-struct/contract',
- u'define-struct/derived', u'define-syntax', u'define-syntax-rule',
- u'define-syntaxes', u'define-unit', u'define-unit-binding',
- u'define-unit-from-context', u'define-unit/contract',
- u'define-unit/new-import-export', u'define-unit/s', u'define-values',
- u'define-values-for-export', u'define-values-for-syntax',
- u'define-values/invoke-unit', u'define-values/invoke-unit/infer',
- u'define/augment', u'define/augment-final', u'define/augride',
- u'define/contract', u'define/final-prop', u'define/match',
- u'define/overment', u'define/override', u'define/override-final',
- u'define/private', u'define/public', u'define/public-final',
- u'define/pubment', u'define/subexpression-pos-prop',
- u'define/subexpression-pos-prop/name', u'delay', u'delay/idle',
- u'delay/name', u'delay/strict', u'delay/sync', u'delay/thread', u'do',
- u'else', u'except', u'except-in', u'except-out', u'export', u'extends',
- u'failure-cont', u'false', u'false/c', u'field', u'field-bound?', u'file',
- u'flat-murec-contract', u'flat-rec-contract', u'for', u'for*', u'for*/and',
- u'for*/async', u'for*/first', u'for*/fold', u'for*/fold/derived',
- u'for*/hash', u'for*/hasheq', u'for*/hasheqv', u'for*/last', u'for*/list',
- u'for*/lists', u'for*/mutable-set', u'for*/mutable-seteq',
- u'for*/mutable-seteqv', u'for*/or', u'for*/product', u'for*/set',
- u'for*/seteq', u'for*/seteqv', u'for*/stream', u'for*/sum', u'for*/vector',
- u'for*/weak-set', u'for*/weak-seteq', u'for*/weak-seteqv', u'for-label',
- u'for-meta', u'for-syntax', u'for-template', u'for/and', u'for/async',
- u'for/first', u'for/fold', u'for/fold/derived', u'for/hash', u'for/hasheq',
- u'for/hasheqv', u'for/last', u'for/list', u'for/lists', u'for/mutable-set',
- u'for/mutable-seteq', u'for/mutable-seteqv', u'for/or', u'for/product',
- u'for/set', u'for/seteq', u'for/seteqv', u'for/stream', u'for/sum',
- u'for/vector', u'for/weak-set', u'for/weak-seteq', u'for/weak-seteqv',
- u'gen:custom-write', u'gen:dict', u'gen:equal+hash', u'gen:set',
- u'gen:stream', u'generic', u'get-field', u'hash/dc', u'if', u'implies',
- u'import', u'include', u'include-at/relative-to',
- u'include-at/relative-to/reader', u'include/reader', u'inherit',
- u'inherit-field', u'inherit/inner', u'inherit/super', u'init',
- u'init-depend', u'init-field', u'init-rest', u'inner', u'inspect',
- u'instantiate', u'interface', u'interface*', u'invariant-assertion',
- u'invoke-unit', u'invoke-unit/infer', u'lambda', u'lazy', u'let', u'let*',
- u'let*-values', u'let-syntax', u'let-syntaxes', u'let-values', u'let/cc',
- u'let/ec', u'letrec', u'letrec-syntax', u'letrec-syntaxes',
- u'letrec-syntaxes+values', u'letrec-values', u'lib', u'link', u'local',
- u'local-require', u'log-debug', u'log-error', u'log-fatal', u'log-info',
- u'log-warning', u'match', u'match*', u'match*/derived', u'match-define',
- u'match-define-values', u'match-lambda', u'match-lambda*',
- u'match-lambda**', u'match-let', u'match-let*', u'match-let*-values',
- u'match-let-values', u'match-letrec', u'match-letrec-values',
- u'match/derived', u'match/values', u'member-name-key', u'mixin', u'module',
- u'module*', u'module+', u'nand', u'new', u'nor', u'object-contract',
- u'object/c', u'only', u'only-in', u'only-meta-in', u'open', u'opt/c', u'or',
- u'overment', u'overment*', u'override', u'override*', u'override-final',
- u'override-final*', u'parameterize', u'parameterize*',
- u'parameterize-break', u'parametric->/c', u'place', u'place*',
- u'place/context', u'planet', u'prefix', u'prefix-in', u'prefix-out',
- u'private', u'private*', u'prompt-tag/c', u'protect-out', u'provide',
- u'provide-signature-elements', u'provide/contract', u'public', u'public*',
- u'public-final', u'public-final*', u'pubment', u'pubment*', u'quasiquote',
- u'quasisyntax', u'quasisyntax/loc', u'quote', u'quote-syntax',
- u'quote-syntax/prune', u'recontract-out', u'recursive-contract',
- u'relative-in', u'rename', u'rename-in', u'rename-inner', u'rename-out',
- u'rename-super', u'require', u'send', u'send*', u'send+', u'send-generic',
- u'send/apply', u'send/keyword-apply', u'set!', u'set!-values',
- u'set-field!', u'shared', u'stream', u'stream*', u'stream-cons', u'struct',
- u'struct*', u'struct-copy', u'struct-field-index', u'struct-out',
- u'struct/c', u'struct/ctc', u'struct/dc', u'submod', u'super',
- u'super-instantiate', u'super-make-object', u'super-new', u'syntax',
- u'syntax-case', u'syntax-case*', u'syntax-id-rules', u'syntax-rules',
- u'syntax/loc', u'tag', u'this', u'this%', u'thunk', u'thunk*', u'time',
- u'unconstrained-domain->', u'unit', u'unit-from-context', u'unit/c',
- u'unit/new-import-export', u'unit/s', u'unless', u'unquote',
- u'unquote-splicing', u'unsyntax', u'unsyntax-splicing', u'values/drop',
- u'when', u'with-continuation-mark', u'with-contract',
- u'with-contract-continuation-mark', u'with-handlers', u'with-handlers*',
- u'with-method', u'with-syntax', u'λ'
- )
-
- # Generated by example.rkt
- _builtins = (
- u'*', u'*list/c', u'+', u'-', u'/', u'<', u'</c', u'<=', u'<=/c', u'=', u'=/c',
- u'>', u'>/c', u'>=', u'>=/c', u'abort-current-continuation', u'abs',
- u'absolute-path?', u'acos', u'add-between', u'add1', u'alarm-evt',
- u'always-evt', u'and/c', u'andmap', u'angle', u'any/c', u'append', u'append*',
- u'append-map', u'apply', u'argmax', u'argmin', u'arithmetic-shift',
- u'arity-at-least', u'arity-at-least-value', u'arity-at-least?',
- u'arity-checking-wrapper', u'arity-includes?', u'arity=?',
- u'arrow-contract-info', u'arrow-contract-info-accepts-arglist',
- u'arrow-contract-info-chaperone-procedure',
- u'arrow-contract-info-check-first-order', u'arrow-contract-info?',
- u'asin', u'assf', u'assoc', u'assq', u'assv', u'atan',
- u'bad-number-of-results', u'banner', u'base->-doms/c', u'base->-rngs/c',
- u'base->?', u'between/c', u'bitwise-and', u'bitwise-bit-field',
- u'bitwise-bit-set?', u'bitwise-ior', u'bitwise-not', u'bitwise-xor',
- u'blame-add-car-context', u'blame-add-cdr-context', u'blame-add-context',
- u'blame-add-missing-party', u'blame-add-nth-arg-context',
- u'blame-add-range-context', u'blame-add-unknown-context',
- u'blame-context', u'blame-contract', u'blame-fmt->-string',
- u'blame-missing-party?', u'blame-negative', u'blame-original?',
- u'blame-positive', u'blame-replace-negative', u'blame-source',
- u'blame-swap', u'blame-swapped?', u'blame-update', u'blame-value',
- u'blame?', u'boolean=?', u'boolean?', u'bound-identifier=?', u'box',
- u'box-cas!', u'box-immutable', u'box-immutable/c', u'box/c', u'box?',
- u'break-enabled', u'break-parameterization?', u'break-thread',
- u'build-chaperone-contract-property', u'build-compound-type-name',
- u'build-contract-property', u'build-flat-contract-property',
- u'build-list', u'build-path', u'build-path/convention-type',
- u'build-string', u'build-vector', u'byte-pregexp', u'byte-pregexp?',
- u'byte-ready?', u'byte-regexp', u'byte-regexp?', u'byte?', u'bytes',
- u'bytes->immutable-bytes', u'bytes->list', u'bytes->path',
- u'bytes->path-element', u'bytes->string/latin-1', u'bytes->string/locale',
- u'bytes->string/utf-8', u'bytes-append', u'bytes-append*',
- u'bytes-close-converter', u'bytes-convert', u'bytes-convert-end',
- u'bytes-converter?', u'bytes-copy', u'bytes-copy!',
- u'bytes-environment-variable-name?', u'bytes-fill!', u'bytes-join',
- u'bytes-length', u'bytes-no-nuls?', u'bytes-open-converter', u'bytes-ref',
- u'bytes-set!', u'bytes-utf-8-index', u'bytes-utf-8-length',
- u'bytes-utf-8-ref', u'bytes<?', u'bytes=?', u'bytes>?', u'bytes?', u'caaaar',
- u'caaadr', u'caaar', u'caadar', u'caaddr', u'caadr', u'caar', u'cadaar',
- u'cadadr', u'cadar', u'caddar', u'cadddr', u'caddr', u'cadr',
- u'call-in-nested-thread', u'call-with-atomic-output-file',
- u'call-with-break-parameterization',
- u'call-with-composable-continuation', u'call-with-continuation-barrier',
- u'call-with-continuation-prompt', u'call-with-current-continuation',
- u'call-with-default-reading-parameterization',
- u'call-with-escape-continuation', u'call-with-exception-handler',
- u'call-with-file-lock/timeout', u'call-with-immediate-continuation-mark',
- u'call-with-input-bytes', u'call-with-input-file',
- u'call-with-input-file*', u'call-with-input-string',
- u'call-with-output-bytes', u'call-with-output-file',
- u'call-with-output-file*', u'call-with-output-string',
- u'call-with-parameterization', u'call-with-semaphore',
- u'call-with-semaphore/enable-break', u'call-with-values', u'call/cc',
- u'call/ec', u'car', u'cartesian-product', u'cdaaar', u'cdaadr', u'cdaar',
- u'cdadar', u'cdaddr', u'cdadr', u'cdar', u'cddaar', u'cddadr', u'cddar',
- u'cdddar', u'cddddr', u'cdddr', u'cddr', u'cdr', u'ceiling', u'channel-get',
- u'channel-put', u'channel-put-evt', u'channel-put-evt?',
- u'channel-try-get', u'channel/c', u'channel?', u'chaperone-box',
- u'chaperone-channel', u'chaperone-continuation-mark-key',
- u'chaperone-contract-property?', u'chaperone-contract?', u'chaperone-evt',
- u'chaperone-hash', u'chaperone-hash-set', u'chaperone-of?',
- u'chaperone-procedure', u'chaperone-procedure*', u'chaperone-prompt-tag',
- u'chaperone-struct', u'chaperone-struct-type', u'chaperone-vector',
- u'chaperone?', u'char->integer', u'char-alphabetic?', u'char-blank?',
- u'char-ci<=?', u'char-ci<?', u'char-ci=?', u'char-ci>=?', u'char-ci>?',
- u'char-downcase', u'char-foldcase', u'char-general-category',
- u'char-graphic?', u'char-in', u'char-in/c', u'char-iso-control?',
- u'char-lower-case?', u'char-numeric?', u'char-punctuation?',
- u'char-ready?', u'char-symbolic?', u'char-title-case?', u'char-titlecase',
- u'char-upcase', u'char-upper-case?', u'char-utf-8-length',
- u'char-whitespace?', u'char<=?', u'char<?', u'char=?', u'char>=?', u'char>?',
- u'char?', u'check-duplicate-identifier', u'check-duplicates',
- u'checked-procedure-check-and-extract', u'choice-evt',
- u'class->interface', u'class-info', u'class-seal', u'class-unseal',
- u'class?', u'cleanse-path', u'close-input-port', u'close-output-port',
- u'coerce-chaperone-contract', u'coerce-chaperone-contracts',
- u'coerce-contract', u'coerce-contract/f', u'coerce-contracts',
- u'coerce-flat-contract', u'coerce-flat-contracts', u'collect-garbage',
- u'collection-file-path', u'collection-path', u'combinations', u'compile',
- u'compile-allow-set!-undefined', u'compile-context-preservation-enabled',
- u'compile-enforce-module-constants', u'compile-syntax',
- u'compiled-expression-recompile', u'compiled-expression?',
- u'compiled-module-expression?', u'complete-path?', u'complex?', u'compose',
- u'compose1', u'conjoin', u'conjugate', u'cons', u'cons/c', u'cons?', u'const',
- u'continuation-mark-key/c', u'continuation-mark-key?',
- u'continuation-mark-set->context', u'continuation-mark-set->list',
- u'continuation-mark-set->list*', u'continuation-mark-set-first',
- u'continuation-mark-set?', u'continuation-marks',
- u'continuation-prompt-available?', u'continuation-prompt-tag?',
- u'continuation?', u'contract-continuation-mark-key',
- u'contract-custom-write-property-proc', u'contract-exercise',
- u'contract-first-order', u'contract-first-order-passes?',
- u'contract-late-neg-projection', u'contract-name', u'contract-proc',
- u'contract-projection', u'contract-property?',
- u'contract-random-generate', u'contract-random-generate-fail',
- u'contract-random-generate-fail?',
- u'contract-random-generate-get-current-environment',
- u'contract-random-generate-stash', u'contract-random-generate/choose',
- u'contract-stronger?', u'contract-struct-exercise',
- u'contract-struct-generate', u'contract-struct-late-neg-projection',
- u'contract-struct-list-contract?', u'contract-val-first-projection',
- u'contract?', u'convert-stream', u'copy-directory/files', u'copy-file',
- u'copy-port', u'cos', u'cosh', u'count', u'current-blame-format',
- u'current-break-parameterization', u'current-code-inspector',
- u'current-command-line-arguments', u'current-compile',
- u'current-compiled-file-roots', u'current-continuation-marks',
- u'current-contract-region', u'current-custodian', u'current-directory',
- u'current-directory-for-user', u'current-drive',
- u'current-environment-variables', u'current-error-port', u'current-eval',
- u'current-evt-pseudo-random-generator',
- u'current-force-delete-permissions', u'current-future',
- u'current-gc-milliseconds', u'current-get-interaction-input-port',
- u'current-inexact-milliseconds', u'current-input-port',
- u'current-inspector', u'current-library-collection-links',
- u'current-library-collection-paths', u'current-load',
- u'current-load-extension', u'current-load-relative-directory',
- u'current-load/use-compiled', u'current-locale', u'current-logger',
- u'current-memory-use', u'current-milliseconds',
- u'current-module-declare-name', u'current-module-declare-source',
- u'current-module-name-resolver', u'current-module-path-for-load',
- u'current-namespace', u'current-output-port', u'current-parameterization',
- u'current-plumber', u'current-preserved-thread-cell-values',
- u'current-print', u'current-process-milliseconds', u'current-prompt-read',
- u'current-pseudo-random-generator', u'current-read-interaction',
- u'current-reader-guard', u'current-readtable', u'current-seconds',
- u'current-security-guard', u'current-subprocess-custodian-mode',
- u'current-thread', u'current-thread-group',
- u'current-thread-initial-stack-size',
- u'current-write-relative-directory', u'curry', u'curryr',
- u'custodian-box-value', u'custodian-box?', u'custodian-limit-memory',
- u'custodian-managed-list', u'custodian-memory-accounting-available?',
- u'custodian-require-memory', u'custodian-shutdown-all', u'custodian?',
- u'custom-print-quotable-accessor', u'custom-print-quotable?',
- u'custom-write-accessor', u'custom-write-property-proc', u'custom-write?',
- u'date', u'date*', u'date*-nanosecond', u'date*-time-zone-name', u'date*?',
- u'date-day', u'date-dst?', u'date-hour', u'date-minute', u'date-month',
- u'date-second', u'date-time-zone-offset', u'date-week-day', u'date-year',
- u'date-year-day', u'date?', u'datum->syntax', u'datum-intern-literal',
- u'default-continuation-prompt-tag', u'degrees->radians',
- u'delete-directory', u'delete-directory/files', u'delete-file',
- u'denominator', u'dict->list', u'dict-can-functional-set?',
- u'dict-can-remove-keys?', u'dict-clear', u'dict-clear!', u'dict-copy',
- u'dict-count', u'dict-empty?', u'dict-for-each', u'dict-has-key?',
- u'dict-implements/c', u'dict-implements?', u'dict-iter-contract',
- u'dict-iterate-first', u'dict-iterate-key', u'dict-iterate-next',
- u'dict-iterate-value', u'dict-key-contract', u'dict-keys', u'dict-map',
- u'dict-mutable?', u'dict-ref', u'dict-ref!', u'dict-remove',
- u'dict-remove!', u'dict-set', u'dict-set!', u'dict-set*', u'dict-set*!',
- u'dict-update', u'dict-update!', u'dict-value-contract', u'dict-values',
- u'dict?', u'directory-exists?', u'directory-list', u'disjoin', u'display',
- u'display-lines', u'display-lines-to-file', u'display-to-file',
- u'displayln', u'double-flonum?', u'drop', u'drop-common-prefix',
- u'drop-right', u'dropf', u'dropf-right', u'dump-memory-stats',
- u'dup-input-port', u'dup-output-port', u'dynamic->*', u'dynamic-get-field',
- u'dynamic-object/c', u'dynamic-place', u'dynamic-place*',
- u'dynamic-require', u'dynamic-require-for-syntax', u'dynamic-send',
- u'dynamic-set-field!', u'dynamic-wind', u'eighth', u'empty',
- u'empty-sequence', u'empty-stream', u'empty?',
- u'environment-variables-copy', u'environment-variables-names',
- u'environment-variables-ref', u'environment-variables-set!',
- u'environment-variables?', u'eof', u'eof-evt', u'eof-object?',
- u'ephemeron-value', u'ephemeron?', u'eprintf', u'eq-contract-val',
- u'eq-contract?', u'eq-hash-code', u'eq?', u'equal-contract-val',
- u'equal-contract?', u'equal-hash-code', u'equal-secondary-hash-code',
- u'equal<%>', u'equal?', u'equal?/recur', u'eqv-hash-code', u'eqv?', u'error',
- u'error-display-handler', u'error-escape-handler',
- u'error-print-context-length', u'error-print-source-location',
- u'error-print-width', u'error-value->string-handler', u'eval',
- u'eval-jit-enabled', u'eval-syntax', u'even?', u'evt/c', u'evt?',
- u'exact->inexact', u'exact-ceiling', u'exact-floor', u'exact-integer?',
- u'exact-nonnegative-integer?', u'exact-positive-integer?', u'exact-round',
- u'exact-truncate', u'exact?', u'executable-yield-handler', u'exit',
- u'exit-handler', u'exn', u'exn-continuation-marks', u'exn-message',
- u'exn:break', u'exn:break-continuation', u'exn:break:hang-up',
- u'exn:break:hang-up?', u'exn:break:terminate', u'exn:break:terminate?',
- u'exn:break?', u'exn:fail', u'exn:fail:contract',
- u'exn:fail:contract:arity', u'exn:fail:contract:arity?',
- u'exn:fail:contract:blame', u'exn:fail:contract:blame-object',
- u'exn:fail:contract:blame?', u'exn:fail:contract:continuation',
- u'exn:fail:contract:continuation?', u'exn:fail:contract:divide-by-zero',
- u'exn:fail:contract:divide-by-zero?',
- u'exn:fail:contract:non-fixnum-result',
- u'exn:fail:contract:non-fixnum-result?', u'exn:fail:contract:variable',
- u'exn:fail:contract:variable-id', u'exn:fail:contract:variable?',
- u'exn:fail:contract?', u'exn:fail:filesystem',
- u'exn:fail:filesystem:errno', u'exn:fail:filesystem:errno-errno',
- u'exn:fail:filesystem:errno?', u'exn:fail:filesystem:exists',
- u'exn:fail:filesystem:exists?', u'exn:fail:filesystem:missing-module',
- u'exn:fail:filesystem:missing-module-path',
- u'exn:fail:filesystem:missing-module?', u'exn:fail:filesystem:version',
- u'exn:fail:filesystem:version?', u'exn:fail:filesystem?',
- u'exn:fail:network', u'exn:fail:network:errno',
- u'exn:fail:network:errno-errno', u'exn:fail:network:errno?',
- u'exn:fail:network?', u'exn:fail:object', u'exn:fail:object?',
- u'exn:fail:out-of-memory', u'exn:fail:out-of-memory?', u'exn:fail:read',
- u'exn:fail:read-srclocs', u'exn:fail:read:eof', u'exn:fail:read:eof?',
- u'exn:fail:read:non-char', u'exn:fail:read:non-char?', u'exn:fail:read?',
- u'exn:fail:syntax', u'exn:fail:syntax-exprs',
- u'exn:fail:syntax:missing-module',
- u'exn:fail:syntax:missing-module-path',
- u'exn:fail:syntax:missing-module?', u'exn:fail:syntax:unbound',
- u'exn:fail:syntax:unbound?', u'exn:fail:syntax?', u'exn:fail:unsupported',
- u'exn:fail:unsupported?', u'exn:fail:user', u'exn:fail:user?',
- u'exn:fail?', u'exn:misc:match?', u'exn:missing-module-accessor',
- u'exn:missing-module?', u'exn:srclocs-accessor', u'exn:srclocs?', u'exn?',
- u'exp', u'expand', u'expand-once', u'expand-syntax', u'expand-syntax-once',
- u'expand-syntax-to-top-form', u'expand-to-top-form', u'expand-user-path',
- u'explode-path', u'expt', u'externalizable<%>', u'failure-result/c',
- u'false?', u'field-names', u'fifth', u'file->bytes', u'file->bytes-lines',
- u'file->lines', u'file->list', u'file->string', u'file->value',
- u'file-exists?', u'file-name-from-path', u'file-or-directory-identity',
- u'file-or-directory-modify-seconds', u'file-or-directory-permissions',
- u'file-position', u'file-position*', u'file-size',
- u'file-stream-buffer-mode', u'file-stream-port?', u'file-truncate',
- u'filename-extension', u'filesystem-change-evt',
- u'filesystem-change-evt-cancel', u'filesystem-change-evt?',
- u'filesystem-root-list', u'filter', u'filter-map', u'filter-not',
- u'filter-read-input-port', u'find-executable-path', u'find-files',
- u'find-library-collection-links', u'find-library-collection-paths',
- u'find-relative-path', u'find-system-path', u'findf', u'first',
- u'first-or/c', u'fixnum?', u'flat-contract', u'flat-contract-predicate',
- u'flat-contract-property?', u'flat-contract?', u'flat-named-contract',
- u'flatten', u'floating-point-bytes->real', u'flonum?', u'floor',
- u'flush-output', u'fold-files', u'foldl', u'foldr', u'for-each', u'force',
- u'format', u'fourth', u'fprintf', u'free-identifier=?',
- u'free-label-identifier=?', u'free-template-identifier=?',
- u'free-transformer-identifier=?', u'fsemaphore-count', u'fsemaphore-post',
- u'fsemaphore-try-wait?', u'fsemaphore-wait', u'fsemaphore?', u'future',
- u'future?', u'futures-enabled?', u'gcd', u'generate-member-key',
- u'generate-temporaries', u'generic-set?', u'generic?', u'gensym',
- u'get-output-bytes', u'get-output-string', u'get-preference',
- u'get/build-late-neg-projection', u'get/build-val-first-projection',
- u'getenv', u'global-port-print-handler', u'group-by', u'group-execute-bit',
- u'group-read-bit', u'group-write-bit', u'guard-evt', u'handle-evt',
- u'handle-evt?', u'has-blame?', u'has-contract?', u'hash', u'hash->list',
- u'hash-clear', u'hash-clear!', u'hash-copy', u'hash-copy-clear',
- u'hash-count', u'hash-empty?', u'hash-eq?', u'hash-equal?', u'hash-eqv?',
- u'hash-for-each', u'hash-has-key?', u'hash-iterate-first',
- u'hash-iterate-key', u'hash-iterate-key+value', u'hash-iterate-next',
- u'hash-iterate-pair', u'hash-iterate-value', u'hash-keys', u'hash-map',
- u'hash-placeholder?', u'hash-ref', u'hash-ref!', u'hash-remove',
- u'hash-remove!', u'hash-set', u'hash-set!', u'hash-set*', u'hash-set*!',
- u'hash-update', u'hash-update!', u'hash-values', u'hash-weak?', u'hash/c',
- u'hash?', u'hasheq', u'hasheqv', u'identifier-binding',
- u'identifier-binding-symbol', u'identifier-label-binding',
- u'identifier-prune-lexical-context',
- u'identifier-prune-to-source-module',
- u'identifier-remove-from-definition-context',
- u'identifier-template-binding', u'identifier-transformer-binding',
- u'identifier?', u'identity', u'if/c', u'imag-part', u'immutable?',
- u'impersonate-box', u'impersonate-channel',
- u'impersonate-continuation-mark-key', u'impersonate-hash',
- u'impersonate-hash-set', u'impersonate-procedure',
- u'impersonate-procedure*', u'impersonate-prompt-tag',
- u'impersonate-struct', u'impersonate-vector', u'impersonator-contract?',
- u'impersonator-ephemeron', u'impersonator-of?',
- u'impersonator-prop:application-mark', u'impersonator-prop:blame',
- u'impersonator-prop:contracted',
- u'impersonator-property-accessor-procedure?', u'impersonator-property?',
- u'impersonator?', u'implementation?', u'implementation?/c', u'in-bytes',
- u'in-bytes-lines', u'in-combinations', u'in-cycle', u'in-dict',
- u'in-dict-keys', u'in-dict-pairs', u'in-dict-values', u'in-directory',
- u'in-hash', u'in-hash-keys', u'in-hash-pairs', u'in-hash-values',
- u'in-immutable-hash', u'in-immutable-hash-keys',
- u'in-immutable-hash-pairs', u'in-immutable-hash-values',
- u'in-immutable-set', u'in-indexed', u'in-input-port-bytes',
- u'in-input-port-chars', u'in-lines', u'in-list', u'in-mlist',
- u'in-mutable-hash', u'in-mutable-hash-keys', u'in-mutable-hash-pairs',
- u'in-mutable-hash-values', u'in-mutable-set', u'in-naturals',
- u'in-parallel', u'in-permutations', u'in-port', u'in-producer', u'in-range',
- u'in-sequences', u'in-set', u'in-slice', u'in-stream', u'in-string',
- u'in-syntax', u'in-value', u'in-values*-sequence', u'in-values-sequence',
- u'in-vector', u'in-weak-hash', u'in-weak-hash-keys', u'in-weak-hash-pairs',
- u'in-weak-hash-values', u'in-weak-set', u'inexact->exact',
- u'inexact-real?', u'inexact?', u'infinite?', u'input-port-append',
- u'input-port?', u'inspector?', u'instanceof/c', u'integer->char',
- u'integer->integer-bytes', u'integer-bytes->integer', u'integer-in',
- u'integer-length', u'integer-sqrt', u'integer-sqrt/remainder', u'integer?',
- u'interface->method-names', u'interface-extension?', u'interface?',
- u'internal-definition-context-binding-identifiers',
- u'internal-definition-context-introduce',
- u'internal-definition-context-seal', u'internal-definition-context?',
- u'is-a?', u'is-a?/c', u'keyword->string', u'keyword-apply', u'keyword<?',
- u'keyword?', u'keywords-match', u'kill-thread', u'last', u'last-pair',
- u'lcm', u'length', u'liberal-define-context?', u'link-exists?', u'list',
- u'list*', u'list*of', u'list->bytes', u'list->mutable-set',
- u'list->mutable-seteq', u'list->mutable-seteqv', u'list->set',
- u'list->seteq', u'list->seteqv', u'list->string', u'list->vector',
- u'list->weak-set', u'list->weak-seteq', u'list->weak-seteqv',
- u'list-contract?', u'list-prefix?', u'list-ref', u'list-set', u'list-tail',
- u'list-update', u'list/c', u'list?', u'listen-port-number?', u'listof',
- u'load', u'load-extension', u'load-on-demand-enabled', u'load-relative',
- u'load-relative-extension', u'load/cd', u'load/use-compiled',
- u'local-expand', u'local-expand/capture-lifts',
- u'local-transformer-expand', u'local-transformer-expand/capture-lifts',
- u'locale-string-encoding', u'log', u'log-all-levels', u'log-level-evt',
- u'log-level?', u'log-max-level', u'log-message', u'log-receiver?',
- u'logger-name', u'logger?', u'magnitude', u'make-arity-at-least',
- u'make-base-empty-namespace', u'make-base-namespace', u'make-bytes',
- u'make-channel', u'make-chaperone-contract',
- u'make-continuation-mark-key', u'make-continuation-prompt-tag',
- u'make-contract', u'make-custodian', u'make-custodian-box',
- u'make-custom-hash', u'make-custom-hash-types', u'make-custom-set',
- u'make-custom-set-types', u'make-date', u'make-date*',
- u'make-derived-parameter', u'make-directory', u'make-directory*',
- u'make-do-sequence', u'make-empty-namespace',
- u'make-environment-variables', u'make-ephemeron', u'make-exn',
- u'make-exn:break', u'make-exn:break:hang-up', u'make-exn:break:terminate',
- u'make-exn:fail', u'make-exn:fail:contract',
- u'make-exn:fail:contract:arity', u'make-exn:fail:contract:blame',
- u'make-exn:fail:contract:continuation',
- u'make-exn:fail:contract:divide-by-zero',
- u'make-exn:fail:contract:non-fixnum-result',
- u'make-exn:fail:contract:variable', u'make-exn:fail:filesystem',
- u'make-exn:fail:filesystem:errno', u'make-exn:fail:filesystem:exists',
- u'make-exn:fail:filesystem:missing-module',
- u'make-exn:fail:filesystem:version', u'make-exn:fail:network',
- u'make-exn:fail:network:errno', u'make-exn:fail:object',
- u'make-exn:fail:out-of-memory', u'make-exn:fail:read',
- u'make-exn:fail:read:eof', u'make-exn:fail:read:non-char',
- u'make-exn:fail:syntax', u'make-exn:fail:syntax:missing-module',
- u'make-exn:fail:syntax:unbound', u'make-exn:fail:unsupported',
- u'make-exn:fail:user', u'make-file-or-directory-link',
- u'make-flat-contract', u'make-fsemaphore', u'make-generic',
- u'make-handle-get-preference-locked', u'make-hash',
- u'make-hash-placeholder', u'make-hasheq', u'make-hasheq-placeholder',
- u'make-hasheqv', u'make-hasheqv-placeholder',
- u'make-immutable-custom-hash', u'make-immutable-hash',
- u'make-immutable-hasheq', u'make-immutable-hasheqv',
- u'make-impersonator-property', u'make-input-port',
- u'make-input-port/read-to-peek', u'make-inspector',
- u'make-keyword-procedure', u'make-known-char-range-list',
- u'make-limited-input-port', u'make-list', u'make-lock-file-name',
- u'make-log-receiver', u'make-logger', u'make-mixin-contract',
- u'make-mutable-custom-set', u'make-none/c', u'make-object',
- u'make-output-port', u'make-parameter', u'make-parent-directory*',
- u'make-phantom-bytes', u'make-pipe', u'make-pipe-with-specials',
- u'make-placeholder', u'make-plumber', u'make-polar', u'make-prefab-struct',
- u'make-primitive-class', u'make-proj-contract',
- u'make-pseudo-random-generator', u'make-reader-graph', u'make-readtable',
- u'make-rectangular', u'make-rename-transformer',
- u'make-resolved-module-path', u'make-security-guard', u'make-semaphore',
- u'make-set!-transformer', u'make-shared-bytes', u'make-sibling-inspector',
- u'make-special-comment', u'make-srcloc', u'make-string',
- u'make-struct-field-accessor', u'make-struct-field-mutator',
- u'make-struct-type', u'make-struct-type-property',
- u'make-syntax-delta-introducer', u'make-syntax-introducer',
- u'make-temporary-file', u'make-tentative-pretty-print-output-port',
- u'make-thread-cell', u'make-thread-group', u'make-vector',
- u'make-weak-box', u'make-weak-custom-hash', u'make-weak-custom-set',
- u'make-weak-hash', u'make-weak-hasheq', u'make-weak-hasheqv',
- u'make-will-executor', u'map', u'match-equality-test',
- u'matches-arity-exactly?', u'max', u'mcar', u'mcdr', u'mcons', u'member',
- u'member-name-key-hash-code', u'member-name-key=?', u'member-name-key?',
- u'memf', u'memq', u'memv', u'merge-input', u'method-in-interface?', u'min',
- u'mixin-contract', u'module->exports', u'module->imports',
- u'module->language-info', u'module->namespace',
- u'module-compiled-cross-phase-persistent?', u'module-compiled-exports',
- u'module-compiled-imports', u'module-compiled-language-info',
- u'module-compiled-name', u'module-compiled-submodules',
- u'module-declared?', u'module-path-index-join',
- u'module-path-index-resolve', u'module-path-index-split',
- u'module-path-index-submodule', u'module-path-index?', u'module-path?',
- u'module-predefined?', u'module-provide-protected?', u'modulo', u'mpair?',
- u'mutable-set', u'mutable-seteq', u'mutable-seteqv', u'n->th',
- u'nack-guard-evt', u'namespace-anchor->empty-namespace',
- u'namespace-anchor->namespace', u'namespace-anchor?',
- u'namespace-attach-module', u'namespace-attach-module-declaration',
- u'namespace-base-phase', u'namespace-mapped-symbols',
- u'namespace-module-identifier', u'namespace-module-registry',
- u'namespace-require', u'namespace-require/constant',
- u'namespace-require/copy', u'namespace-require/expansion-time',
- u'namespace-set-variable-value!', u'namespace-symbol->identifier',
- u'namespace-syntax-introduce', u'namespace-undefine-variable!',
- u'namespace-unprotect-module', u'namespace-variable-value', u'namespace?',
- u'nan?', u'natural-number/c', u'negate', u'negative?', u'never-evt',
- u'new-∀/c', u'new-∃/c', u'newline', u'ninth', u'non-empty-listof',
- u'non-empty-string?', u'none/c', u'normal-case-path', u'normalize-arity',
- u'normalize-path', u'normalized-arity?', u'not', u'not/c', u'null', u'null?',
- u'number->string', u'number?', u'numerator', u'object%', u'object->vector',
- u'object-info', u'object-interface', u'object-method-arity-includes?',
- u'object-name', u'object-or-false=?', u'object=?', u'object?', u'odd?',
- u'one-of/c', u'open-input-bytes', u'open-input-file',
- u'open-input-output-file', u'open-input-string', u'open-output-bytes',
- u'open-output-file', u'open-output-nowhere', u'open-output-string',
- u'or/c', u'order-of-magnitude', u'ormap', u'other-execute-bit',
- u'other-read-bit', u'other-write-bit', u'output-port?', u'pair?',
- u'parameter-procedure=?', u'parameter/c', u'parameter?',
- u'parameterization?', u'parse-command-line', u'partition', u'path->bytes',
- u'path->complete-path', u'path->directory-path', u'path->string',
- u'path-add-suffix', u'path-convention-type', u'path-element->bytes',
- u'path-element->string', u'path-element?', u'path-for-some-system?',
- u'path-list-string->path-list', u'path-only', u'path-replace-suffix',
- u'path-string?', u'path<?', u'path?', u'pathlist-closure', u'peek-byte',
- u'peek-byte-or-special', u'peek-bytes', u'peek-bytes!', u'peek-bytes!-evt',
- u'peek-bytes-avail!', u'peek-bytes-avail!*', u'peek-bytes-avail!-evt',
- u'peek-bytes-avail!/enable-break', u'peek-bytes-evt', u'peek-char',
- u'peek-char-or-special', u'peek-string', u'peek-string!',
- u'peek-string!-evt', u'peek-string-evt', u'peeking-input-port',
- u'permutations', u'phantom-bytes?', u'pi', u'pi.f', u'pipe-content-length',
- u'place-break', u'place-channel', u'place-channel-get',
- u'place-channel-put', u'place-channel-put/get', u'place-channel?',
- u'place-dead-evt', u'place-enabled?', u'place-kill', u'place-location?',
- u'place-message-allowed?', u'place-sleep', u'place-wait', u'place?',
- u'placeholder-get', u'placeholder-set!', u'placeholder?',
- u'plumber-add-flush!', u'plumber-flush-all',
- u'plumber-flush-handle-remove!', u'plumber-flush-handle?', u'plumber?',
- u'poll-guard-evt', u'port->bytes', u'port->bytes-lines', u'port->lines',
- u'port->list', u'port->string', u'port-closed-evt', u'port-closed?',
- u'port-commit-peeked', u'port-count-lines!', u'port-count-lines-enabled',
- u'port-counts-lines?', u'port-display-handler', u'port-file-identity',
- u'port-file-unlock', u'port-next-location', u'port-number?',
- u'port-print-handler', u'port-progress-evt',
- u'port-provides-progress-evts?', u'port-read-handler',
- u'port-try-file-lock?', u'port-write-handler', u'port-writes-atomic?',
- u'port-writes-special?', u'port?', u'positive?', u'predicate/c',
- u'prefab-key->struct-type', u'prefab-key?', u'prefab-struct-key',
- u'preferences-lock-file-mode', u'pregexp', u'pregexp?', u'pretty-display',
- u'pretty-format', u'pretty-print', u'pretty-print-.-symbol-without-bars',
- u'pretty-print-abbreviate-read-macros', u'pretty-print-columns',
- u'pretty-print-current-style-table', u'pretty-print-depth',
- u'pretty-print-exact-as-decimal', u'pretty-print-extend-style-table',
- u'pretty-print-handler', u'pretty-print-newline',
- u'pretty-print-post-print-hook', u'pretty-print-pre-print-hook',
- u'pretty-print-print-hook', u'pretty-print-print-line',
- u'pretty-print-remap-stylable', u'pretty-print-show-inexactness',
- u'pretty-print-size-hook', u'pretty-print-style-table?',
- u'pretty-printing', u'pretty-write', u'primitive-closure?',
- u'primitive-result-arity', u'primitive?', u'print', u'print-as-expression',
- u'print-boolean-long-form', u'print-box', u'print-graph',
- u'print-hash-table', u'print-mpair-curly-braces',
- u'print-pair-curly-braces', u'print-reader-abbreviations',
- u'print-struct', u'print-syntax-width', u'print-unreadable',
- u'print-vector-length', u'printable/c', u'printable<%>', u'printf',
- u'println', u'procedure->method', u'procedure-arity',
- u'procedure-arity-includes/c', u'procedure-arity-includes?',
- u'procedure-arity?', u'procedure-closure-contents-eq?',
- u'procedure-extract-target', u'procedure-keywords',
- u'procedure-reduce-arity', u'procedure-reduce-keyword-arity',
- u'procedure-rename', u'procedure-result-arity', u'procedure-specialize',
- u'procedure-struct-type?', u'procedure?', u'process', u'process*',
- u'process*/ports', u'process/ports', u'processor-count', u'progress-evt?',
- u'promise-forced?', u'promise-running?', u'promise/c', u'promise/name?',
- u'promise?', u'prop:arity-string', u'prop:arrow-contract',
- u'prop:arrow-contract-get-info', u'prop:arrow-contract?', u'prop:blame',
- u'prop:chaperone-contract', u'prop:checked-procedure', u'prop:contract',
- u'prop:contracted', u'prop:custom-print-quotable', u'prop:custom-write',
- u'prop:dict', u'prop:dict/contract', u'prop:equal+hash', u'prop:evt',
- u'prop:exn:missing-module', u'prop:exn:srclocs',
- u'prop:expansion-contexts', u'prop:flat-contract',
- u'prop:impersonator-of', u'prop:input-port',
- u'prop:liberal-define-context', u'prop:object-name',
- u'prop:opt-chaperone-contract', u'prop:opt-chaperone-contract-get-test',
- u'prop:opt-chaperone-contract?', u'prop:orc-contract',
- u'prop:orc-contract-get-subcontracts', u'prop:orc-contract?',
- u'prop:output-port', u'prop:place-location', u'prop:procedure',
- u'prop:recursive-contract', u'prop:recursive-contract-unroll',
- u'prop:recursive-contract?', u'prop:rename-transformer', u'prop:sequence',
- u'prop:set!-transformer', u'prop:stream', u'proper-subset?',
- u'pseudo-random-generator->vector', u'pseudo-random-generator-vector?',
- u'pseudo-random-generator?', u'put-preferences', u'putenv', u'quotient',
- u'quotient/remainder', u'radians->degrees', u'raise',
- u'raise-argument-error', u'raise-arguments-error', u'raise-arity-error',
- u'raise-blame-error', u'raise-contract-error', u'raise-mismatch-error',
- u'raise-not-cons-blame-error', u'raise-range-error',
- u'raise-result-error', u'raise-syntax-error', u'raise-type-error',
- u'raise-user-error', u'random', u'random-seed', u'range', u'rational?',
- u'rationalize', u'read', u'read-accept-bar-quote', u'read-accept-box',
- u'read-accept-compiled', u'read-accept-dot', u'read-accept-graph',
- u'read-accept-infix-dot', u'read-accept-lang', u'read-accept-quasiquote',
- u'read-accept-reader', u'read-byte', u'read-byte-or-special',
- u'read-bytes', u'read-bytes!', u'read-bytes!-evt', u'read-bytes-avail!',
- u'read-bytes-avail!*', u'read-bytes-avail!-evt',
- u'read-bytes-avail!/enable-break', u'read-bytes-evt', u'read-bytes-line',
- u'read-bytes-line-evt', u'read-case-sensitive', u'read-cdot', u'read-char',
- u'read-char-or-special', u'read-curly-brace-as-paren',
- u'read-curly-brace-with-tag', u'read-decimal-as-inexact',
- u'read-eval-print-loop', u'read-language', u'read-line', u'read-line-evt',
- u'read-on-demand-source', u'read-square-bracket-as-paren',
- u'read-square-bracket-with-tag', u'read-string', u'read-string!',
- u'read-string!-evt', u'read-string-evt', u'read-syntax',
- u'read-syntax/recursive', u'read/recursive', u'readtable-mapping',
- u'readtable?', u'real->decimal-string', u'real->double-flonum',
- u'real->floating-point-bytes', u'real->single-flonum', u'real-in',
- u'real-part', u'real?', u'reencode-input-port', u'reencode-output-port',
- u'regexp', u'regexp-match', u'regexp-match*', u'regexp-match-evt',
- u'regexp-match-exact?', u'regexp-match-peek',
- u'regexp-match-peek-immediate', u'regexp-match-peek-positions',
- u'regexp-match-peek-positions*',
- u'regexp-match-peek-positions-immediate',
- u'regexp-match-peek-positions-immediate/end',
- u'regexp-match-peek-positions/end', u'regexp-match-positions',
- u'regexp-match-positions*', u'regexp-match-positions/end',
- u'regexp-match/end', u'regexp-match?', u'regexp-max-lookbehind',
- u'regexp-quote', u'regexp-replace', u'regexp-replace*',
- u'regexp-replace-quote', u'regexp-replaces', u'regexp-split',
- u'regexp-try-match', u'regexp?', u'relative-path?', u'relocate-input-port',
- u'relocate-output-port', u'remainder', u'remf', u'remf*', u'remove',
- u'remove*', u'remove-duplicates', u'remq', u'remq*', u'remv', u'remv*',
- u'rename-contract', u'rename-file-or-directory',
- u'rename-transformer-target', u'rename-transformer?', u'replace-evt',
- u'reroot-path', u'resolve-path', u'resolved-module-path-name',
- u'resolved-module-path?', u'rest', u'reverse', u'round', u'second',
- u'seconds->date', u'security-guard?', u'semaphore-peek-evt',
- u'semaphore-peek-evt?', u'semaphore-post', u'semaphore-try-wait?',
- u'semaphore-wait', u'semaphore-wait/enable-break', u'semaphore?',
- u'sequence->list', u'sequence->stream', u'sequence-add-between',
- u'sequence-andmap', u'sequence-append', u'sequence-count',
- u'sequence-filter', u'sequence-fold', u'sequence-for-each',
- u'sequence-generate', u'sequence-generate*', u'sequence-length',
- u'sequence-map', u'sequence-ormap', u'sequence-ref', u'sequence-tail',
- u'sequence/c', u'sequence?', u'set', u'set!-transformer-procedure',
- u'set!-transformer?', u'set->list', u'set->stream', u'set-add', u'set-add!',
- u'set-box!', u'set-clear', u'set-clear!', u'set-copy', u'set-copy-clear',
- u'set-count', u'set-empty?', u'set-eq?', u'set-equal?', u'set-eqv?',
- u'set-first', u'set-for-each', u'set-implements/c', u'set-implements?',
- u'set-intersect', u'set-intersect!', u'set-map', u'set-mcar!', u'set-mcdr!',
- u'set-member?', u'set-mutable?', u'set-phantom-bytes!',
- u'set-port-next-location!', u'set-remove', u'set-remove!', u'set-rest',
- u'set-some-basic-contracts!', u'set-subtract', u'set-subtract!',
- u'set-symmetric-difference', u'set-symmetric-difference!', u'set-union',
- u'set-union!', u'set-weak?', u'set/c', u'set=?', u'set?', u'seteq', u'seteqv',
- u'seventh', u'sgn', u'shared-bytes', u'shell-execute', u'shrink-path-wrt',
- u'shuffle', u'simple-form-path', u'simplify-path', u'sin',
- u'single-flonum?', u'sinh', u'sixth', u'skip-projection-wrapper?', u'sleep',
- u'some-system-path->string', u'sort', u'special-comment-value',
- u'special-comment?', u'special-filter-input-port', u'split-at',
- u'split-at-right', u'split-common-prefix', u'split-path', u'splitf-at',
- u'splitf-at-right', u'sqr', u'sqrt', u'srcloc', u'srcloc->string',
- u'srcloc-column', u'srcloc-line', u'srcloc-position', u'srcloc-source',
- u'srcloc-span', u'srcloc?', u'stop-after', u'stop-before', u'stream->list',
- u'stream-add-between', u'stream-andmap', u'stream-append', u'stream-count',
- u'stream-empty?', u'stream-filter', u'stream-first', u'stream-fold',
- u'stream-for-each', u'stream-length', u'stream-map', u'stream-ormap',
- u'stream-ref', u'stream-rest', u'stream-tail', u'stream/c', u'stream?',
- u'string', u'string->bytes/latin-1', u'string->bytes/locale',
- u'string->bytes/utf-8', u'string->immutable-string', u'string->keyword',
- u'string->list', u'string->number', u'string->path',
- u'string->path-element', u'string->some-system-path', u'string->symbol',
- u'string->uninterned-symbol', u'string->unreadable-symbol',
- u'string-append', u'string-append*', u'string-ci<=?', u'string-ci<?',
- u'string-ci=?', u'string-ci>=?', u'string-ci>?', u'string-contains?',
- u'string-copy', u'string-copy!', u'string-downcase',
- u'string-environment-variable-name?', u'string-fill!', u'string-foldcase',
- u'string-join', u'string-len/c', u'string-length', u'string-locale-ci<?',
- u'string-locale-ci=?', u'string-locale-ci>?', u'string-locale-downcase',
- u'string-locale-upcase', u'string-locale<?', u'string-locale=?',
- u'string-locale>?', u'string-no-nuls?', u'string-normalize-nfc',
- u'string-normalize-nfd', u'string-normalize-nfkc',
- u'string-normalize-nfkd', u'string-normalize-spaces', u'string-port?',
- u'string-prefix?', u'string-ref', u'string-replace', u'string-set!',
- u'string-split', u'string-suffix?', u'string-titlecase', u'string-trim',
- u'string-upcase', u'string-utf-8-length', u'string<=?', u'string<?',
- u'string=?', u'string>=?', u'string>?', u'string?', u'struct->vector',
- u'struct-accessor-procedure?', u'struct-constructor-procedure?',
- u'struct-info', u'struct-mutator-procedure?',
- u'struct-predicate-procedure?', u'struct-type-info',
- u'struct-type-make-constructor', u'struct-type-make-predicate',
- u'struct-type-property-accessor-procedure?', u'struct-type-property/c',
- u'struct-type-property?', u'struct-type?', u'struct:arity-at-least',
- u'struct:arrow-contract-info', u'struct:date', u'struct:date*',
- u'struct:exn', u'struct:exn:break', u'struct:exn:break:hang-up',
- u'struct:exn:break:terminate', u'struct:exn:fail',
- u'struct:exn:fail:contract', u'struct:exn:fail:contract:arity',
- u'struct:exn:fail:contract:blame',
- u'struct:exn:fail:contract:continuation',
- u'struct:exn:fail:contract:divide-by-zero',
- u'struct:exn:fail:contract:non-fixnum-result',
- u'struct:exn:fail:contract:variable', u'struct:exn:fail:filesystem',
- u'struct:exn:fail:filesystem:errno',
- u'struct:exn:fail:filesystem:exists',
- u'struct:exn:fail:filesystem:missing-module',
- u'struct:exn:fail:filesystem:version', u'struct:exn:fail:network',
- u'struct:exn:fail:network:errno', u'struct:exn:fail:object',
- u'struct:exn:fail:out-of-memory', u'struct:exn:fail:read',
- u'struct:exn:fail:read:eof', u'struct:exn:fail:read:non-char',
- u'struct:exn:fail:syntax', u'struct:exn:fail:syntax:missing-module',
- u'struct:exn:fail:syntax:unbound', u'struct:exn:fail:unsupported',
- u'struct:exn:fail:user', u'struct:srcloc',
- u'struct:wrapped-extra-arg-arrow', u'struct?', u'sub1', u'subbytes',
- u'subclass?', u'subclass?/c', u'subprocess', u'subprocess-group-enabled',
- u'subprocess-kill', u'subprocess-pid', u'subprocess-status',
- u'subprocess-wait', u'subprocess?', u'subset?', u'substring', u'suggest/c',
- u'symbol->string', u'symbol-interned?', u'symbol-unreadable?', u'symbol<?',
- u'symbol=?', u'symbol?', u'symbols', u'sync', u'sync/enable-break',
- u'sync/timeout', u'sync/timeout/enable-break', u'syntax->datum',
- u'syntax->list', u'syntax-arm', u'syntax-column', u'syntax-debug-info',
- u'syntax-disarm', u'syntax-e', u'syntax-line',
- u'syntax-local-bind-syntaxes', u'syntax-local-certifier',
- u'syntax-local-context', u'syntax-local-expand-expression',
- u'syntax-local-get-shadower', u'syntax-local-identifier-as-binding',
- u'syntax-local-introduce', u'syntax-local-lift-context',
- u'syntax-local-lift-expression', u'syntax-local-lift-module',
- u'syntax-local-lift-module-end-declaration',
- u'syntax-local-lift-provide', u'syntax-local-lift-require',
- u'syntax-local-lift-values-expression',
- u'syntax-local-make-definition-context',
- u'syntax-local-make-delta-introducer',
- u'syntax-local-module-defined-identifiers',
- u'syntax-local-module-exports',
- u'syntax-local-module-required-identifiers', u'syntax-local-name',
- u'syntax-local-phase-level', u'syntax-local-submodules',
- u'syntax-local-transforming-module-provides?', u'syntax-local-value',
- u'syntax-local-value/immediate', u'syntax-original?', u'syntax-position',
- u'syntax-property', u'syntax-property-preserved?',
- u'syntax-property-symbol-keys', u'syntax-protect', u'syntax-rearm',
- u'syntax-recertify', u'syntax-shift-phase-level', u'syntax-source',
- u'syntax-source-module', u'syntax-span', u'syntax-taint',
- u'syntax-tainted?', u'syntax-track-origin',
- u'syntax-transforming-module-expression?',
- u'syntax-transforming-with-lifts?', u'syntax-transforming?', u'syntax/c',
- u'syntax?', u'system', u'system*', u'system*/exit-code',
- u'system-big-endian?', u'system-idle-evt', u'system-language+country',
- u'system-library-subpath', u'system-path-convention-type', u'system-type',
- u'system/exit-code', u'tail-marks-match?', u'take', u'take-common-prefix',
- u'take-right', u'takef', u'takef-right', u'tan', u'tanh',
- u'tcp-abandon-port', u'tcp-accept', u'tcp-accept-evt',
- u'tcp-accept-ready?', u'tcp-accept/enable-break', u'tcp-addresses',
- u'tcp-close', u'tcp-connect', u'tcp-connect/enable-break', u'tcp-listen',
- u'tcp-listener?', u'tcp-port?', u'tentative-pretty-print-port-cancel',
- u'tentative-pretty-print-port-transfer', u'tenth', u'terminal-port?',
- u'the-unsupplied-arg', u'third', u'thread', u'thread-cell-ref',
- u'thread-cell-set!', u'thread-cell-values?', u'thread-cell?',
- u'thread-dead-evt', u'thread-dead?', u'thread-group?', u'thread-receive',
- u'thread-receive-evt', u'thread-resume', u'thread-resume-evt',
- u'thread-rewind-receive', u'thread-running?', u'thread-send',
- u'thread-suspend', u'thread-suspend-evt', u'thread-try-receive',
- u'thread-wait', u'thread/suspend-to-kill', u'thread?', u'time-apply',
- u'touch', u'transplant-input-port', u'transplant-output-port', u'true',
- u'truncate', u'udp-addresses', u'udp-bind!', u'udp-bound?', u'udp-close',
- u'udp-connect!', u'udp-connected?', u'udp-multicast-interface',
- u'udp-multicast-join-group!', u'udp-multicast-leave-group!',
- u'udp-multicast-loopback?', u'udp-multicast-set-interface!',
- u'udp-multicast-set-loopback!', u'udp-multicast-set-ttl!',
- u'udp-multicast-ttl', u'udp-open-socket', u'udp-receive!',
- u'udp-receive!*', u'udp-receive!-evt', u'udp-receive!/enable-break',
- u'udp-receive-ready-evt', u'udp-send', u'udp-send*', u'udp-send-evt',
- u'udp-send-ready-evt', u'udp-send-to', u'udp-send-to*', u'udp-send-to-evt',
- u'udp-send-to/enable-break', u'udp-send/enable-break', u'udp?', u'unbox',
- u'uncaught-exception-handler', u'unit?', u'unspecified-dom',
- u'unsupplied-arg?', u'use-collection-link-paths',
- u'use-compiled-file-paths', u'use-user-specific-search-paths',
- u'user-execute-bit', u'user-read-bit', u'user-write-bit', u'value-blame',
- u'value-contract', u'values', u'variable-reference->empty-namespace',
- u'variable-reference->module-base-phase',
- u'variable-reference->module-declaration-inspector',
- u'variable-reference->module-path-index',
- u'variable-reference->module-source', u'variable-reference->namespace',
- u'variable-reference->phase',
- u'variable-reference->resolved-module-path',
- u'variable-reference-constant?', u'variable-reference?', u'vector',
- u'vector->immutable-vector', u'vector->list',
- u'vector->pseudo-random-generator', u'vector->pseudo-random-generator!',
- u'vector->values', u'vector-append', u'vector-argmax', u'vector-argmin',
- u'vector-copy', u'vector-copy!', u'vector-count', u'vector-drop',
- u'vector-drop-right', u'vector-fill!', u'vector-filter',
- u'vector-filter-not', u'vector-immutable', u'vector-immutable/c',
- u'vector-immutableof', u'vector-length', u'vector-map', u'vector-map!',
- u'vector-member', u'vector-memq', u'vector-memv', u'vector-ref',
- u'vector-set!', u'vector-set*!', u'vector-set-performance-stats!',
- u'vector-split-at', u'vector-split-at-right', u'vector-take',
- u'vector-take-right', u'vector/c', u'vector?', u'vectorof', u'version',
- u'void', u'void?', u'weak-box-value', u'weak-box?', u'weak-set',
- u'weak-seteq', u'weak-seteqv', u'will-execute', u'will-executor?',
- u'will-register', u'will-try-execute', u'with-input-from-bytes',
- u'with-input-from-file', u'with-input-from-string',
- u'with-output-to-bytes', u'with-output-to-file', u'with-output-to-string',
- u'would-be-future', u'wrap-evt', u'wrapped-extra-arg-arrow',
- u'wrapped-extra-arg-arrow-extra-neg-party-argument',
- u'wrapped-extra-arg-arrow-real-func', u'wrapped-extra-arg-arrow?',
- u'writable<%>', u'write', u'write-byte', u'write-bytes',
- u'write-bytes-avail', u'write-bytes-avail*', u'write-bytes-avail-evt',
- u'write-bytes-avail/enable-break', u'write-char', u'write-special',
- u'write-special-avail*', u'write-special-evt', u'write-string',
- u'write-to-file', u'writeln', u'xor', u'zero?', u'~.a', u'~.s', u'~.v', u'~a',
- u'~e', u'~r', u'~s', u'~v'
- )
-
- _opening_parenthesis = r'[([{]'
- _closing_parenthesis = r'[)\]}]'
- _delimiters = r'()[\]{}",\'`;\s'
- _symbol = r'(?:\|[^|]*\||\\[\w\W]|[^|\\%s]+)+' % _delimiters
- _exact_decimal_prefix = r'(?:#e)?(?:#d)?(?:#e)?'
- _exponent = r'(?:[defls][-+]?\d+)'
- _inexact_simple_no_hashes = r'(?:\d+(?:/\d+|\.\d*)?|\.\d+)'
- _inexact_simple = (r'(?:%s|(?:\d+#+(?:\.#*|/\d+#*)?|\.\d+#+|'
- r'\d+(?:\.\d*#+|/\d+#+)))' % _inexact_simple_no_hashes)
- _inexact_normal_no_hashes = r'(?:%s%s?)' % (_inexact_simple_no_hashes,
- _exponent)
- _inexact_normal = r'(?:%s%s?)' % (_inexact_simple, _exponent)
- _inexact_special = r'(?:(?:inf|nan)\.[0f])'
- _inexact_real = r'(?:[-+]?%s|[-+]%s)' % (_inexact_normal,
- _inexact_special)
- _inexact_unsigned = r'(?:%s|%s)' % (_inexact_normal, _inexact_special)
-
- tokens = {
- 'root': [
- (_closing_parenthesis, Error),
- (r'(?!\Z)', Text, 'unquoted-datum')
- ],
- 'datum': [
- (r'(?s)#;|#![ /]([^\\\n]|\\.)*', Comment),
- (u';[^\\n\\r\x85\u2028\u2029]*', Comment.Single),
- (r'#\|', Comment.Multiline, 'block-comment'),
-
- # Whitespaces
- (r'(?u)\s+', Text),
-
- # Numbers: Keep in mind Racket reader hash prefixes, which
- # can denote the base or the type. These don't map neatly
- # onto Pygments token types; some judgment calls here.
-
- # #d or no prefix
- (r'(?i)%s[-+]?\d+(?=[%s])' % (_exact_decimal_prefix, _delimiters),
- Number.Integer, '#pop'),
- (r'(?i)%s[-+]?(\d+(\.\d*)?|\.\d+)([deflst][-+]?\d+)?(?=[%s])' %
- (_exact_decimal_prefix, _delimiters), Number.Float, '#pop'),
- (r'(?i)%s[-+]?(%s([-+]%s?i)?|[-+]%s?i)(?=[%s])' %
- (_exact_decimal_prefix, _inexact_normal_no_hashes,
- _inexact_normal_no_hashes, _inexact_normal_no_hashes,
- _delimiters), Number, '#pop'),
-
- # Inexact without explicit #i
- (r'(?i)(#d)?(%s([-+]%s?i)?|[-+]%s?i|%s@%s)(?=[%s])' %
- (_inexact_real, _inexact_unsigned, _inexact_unsigned,
- _inexact_real, _inexact_real, _delimiters), Number.Float,
- '#pop'),
-
- # The remaining extflonums
- (r'(?i)(([-+]?%st[-+]?\d+)|[-+](inf|nan)\.t)(?=[%s])' %
- (_inexact_simple, _delimiters), Number.Float, '#pop'),
-
- # #b
- (r'(?iu)(#[ei])?#b%s' % _symbol, Number.Bin, '#pop'),
-
- # #o
- (r'(?iu)(#[ei])?#o%s' % _symbol, Number.Oct, '#pop'),
-
- # #x
- (r'(?iu)(#[ei])?#x%s' % _symbol, Number.Hex, '#pop'),
-
- # #i is always inexact, i.e. float
- (r'(?iu)(#d)?#i%s' % _symbol, Number.Float, '#pop'),
-
- # Strings and characters
- (r'#?"', String.Double, ('#pop', 'string')),
- (r'#<<(.+)\n(^(?!\1$).*$\n)*^\1$', String.Heredoc, '#pop'),
- (r'#\\(u[\da-fA-F]{1,4}|U[\da-fA-F]{1,8})', String.Char, '#pop'),
- (r'(?is)#\\([0-7]{3}|[a-z]+|.)', String.Char, '#pop'),
- (r'(?s)#[pr]x#?"(\\?.)*?"', String.Regex, '#pop'),
-
- # Constants
- (r'#(true|false|[tTfF])', Name.Constant, '#pop'),
-
- # Keyword argument names (e.g. #:keyword)
- (r'(?u)#:%s' % _symbol, Keyword.Declaration, '#pop'),
-
- # Reader extensions
- (r'(#lang |#!)(\S+)',
- bygroups(Keyword.Namespace, Name.Namespace)),
- (r'#reader', Keyword.Namespace, 'quoted-datum'),
-
- # Other syntax
- (r"(?i)\.(?=[%s])|#c[is]|#['`]|#,@?" % _delimiters, Operator),
- (r"'|#[s&]|#hash(eqv?)?|#\d*(?=%s)" % _opening_parenthesis,
- Operator, ('#pop', 'quoted-datum'))
- ],
- 'datum*': [
- (r'`|,@?', Operator),
- (_symbol, String.Symbol, '#pop'),
- (r'[|\\]', Error),
- default('#pop')
- ],
- 'list': [
- (_closing_parenthesis, Punctuation, '#pop')
- ],
- 'unquoted-datum': [
- include('datum'),
- (r'quote(?=[%s])' % _delimiters, Keyword,
- ('#pop', 'quoted-datum')),
- (r'`', Operator, ('#pop', 'quasiquoted-datum')),
- (r'quasiquote(?=[%s])' % _delimiters, Keyword,
- ('#pop', 'quasiquoted-datum')),
- (_opening_parenthesis, Punctuation, ('#pop', 'unquoted-list')),
- (words(_keywords, prefix='(?u)', suffix='(?=[%s])' % _delimiters),
- Keyword, '#pop'),
- (words(_builtins, prefix='(?u)', suffix='(?=[%s])' % _delimiters),
- Name.Builtin, '#pop'),
- (_symbol, Name, '#pop'),
- include('datum*')
- ],
- 'unquoted-list': [
- include('list'),
- (r'(?!\Z)', Text, 'unquoted-datum')
- ],
- 'quasiquoted-datum': [
- include('datum'),
- (r',@?', Operator, ('#pop', 'unquoted-datum')),
- (r'unquote(-splicing)?(?=[%s])' % _delimiters, Keyword,
- ('#pop', 'unquoted-datum')),
- (_opening_parenthesis, Punctuation, ('#pop', 'quasiquoted-list')),
- include('datum*')
- ],
- 'quasiquoted-list': [
- include('list'),
- (r'(?!\Z)', Text, 'quasiquoted-datum')
- ],
- 'quoted-datum': [
- include('datum'),
- (_opening_parenthesis, Punctuation, ('#pop', 'quoted-list')),
- include('datum*')
- ],
- 'quoted-list': [
- include('list'),
- (r'(?!\Z)', Text, 'quoted-datum')
- ],
- 'block-comment': [
- (r'#\|', Comment.Multiline, '#push'),
- (r'\|#', Comment.Multiline, '#pop'),
- (r'[^#|]+|.', Comment.Multiline)
- ],
- 'string': [
- (r'"', String.Double, '#pop'),
- (r'(?s)\\([0-7]{1,3}|x[\da-fA-F]{1,2}|u[\da-fA-F]{1,4}|'
- r'U[\da-fA-F]{1,8}|.)', String.Escape),
- (r'[^\\"]+', String.Double)
- ]
- }
-
-
-class NewLispLexer(RegexLexer):
- """
- For `newLISP. <http://www.newlisp.org/>`_ source code (version 10.3.0).
-
- .. versionadded:: 1.5
- """
-
- name = 'NewLisp'
- aliases = ['newlisp']
- filenames = ['*.lsp', '*.nl', '*.kif']
- 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', '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',
- 'beta', 'betai', 'bind', 'binomial', 'bits', 'callback',
- 'case', 'catch', 'ceil', 'change-dir', 'char', 'chop', 'Class', 'clean',
- 'close', 'command-event', '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',
- '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', 'letex', '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', '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',
- 'xfer-event', 'xml-error', 'xml-parse', 'xml-type-tags', 'zero?',
- )
-
- # valid names
- valid_name = r'([\w!$%&*+.,/<=>?@^~|-])+|(\[.*?\])+'
-
- 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
- (words(builtins, suffix=r'\b'),
- Keyword),
-
- # the remaining functions
- (r'(?<=\()' + valid_name, Name.Variable),
-
- # the remaining variables
- (valid_name, String.Symbol),
-
- # parentheses
- (r'(\(|\))', Punctuation),
- ],
-
- # braced strings...
- 'bracestring': [
- (r'\{', String, "#push"),
- (r'\}', String, "#pop"),
- ('[^{}]+', String),
- ],
-
- # tagged [text]...[/text] delimited strings...
- 'tagstring': [
- (r'(?s)(.*?)(\[/text\])', String, '#pop'),
- ],
- }
-
-
-class EmacsLispLexer(RegexLexer):
- """
- An ELisp lexer, parsing a stream and outputting the tokens
- needed to highlight elisp code.
-
- .. versionadded:: 2.1
- """
- name = 'EmacsLisp'
- aliases = ['emacs', 'elisp', 'emacs-lisp']
- filenames = ['*.el']
- mimetypes = ['text/x-elisp', 'application/x-elisp']
-
- flags = re.MULTILINE
-
- # couple of useful regexes
-
- # characters that are not macro-characters and can be used to begin a symbol
- nonmacro = r'\\.|[\w!$%&*+-/<=>?@^{}~|]'
- constituent = nonmacro + '|[#.:]'
- terminated = r'(?=[ "()\]\'\n,;`])' # whitespace or terminating macro characters
-
- # symbol token, reverse-engineered from hyperspec
- # Take a deep breath...
- symbol = r'((?:%s)(?:%s)*)' % (nonmacro, constituent)
-
- macros = set((
- 'atomic-change-group', 'case', 'block', 'cl-block', 'cl-callf', 'cl-callf2',
- 'cl-case', 'cl-decf', 'cl-declaim', 'cl-declare',
- 'cl-define-compiler-macro', 'cl-defmacro', 'cl-defstruct',
- 'cl-defsubst', 'cl-deftype', 'cl-defun', 'cl-destructuring-bind',
- 'cl-do', 'cl-do*', 'cl-do-all-symbols', 'cl-do-symbols', 'cl-dolist',
- 'cl-dotimes', 'cl-ecase', 'cl-etypecase', 'eval-when', 'cl-eval-when', 'cl-flet',
- 'cl-flet*', 'cl-function', 'cl-incf', 'cl-labels', 'cl-letf',
- 'cl-letf*', 'cl-load-time-value', 'cl-locally', 'cl-loop',
- 'cl-macrolet', 'cl-multiple-value-bind', 'cl-multiple-value-setq',
- 'cl-progv', 'cl-psetf', 'cl-psetq', 'cl-pushnew', 'cl-remf',
- 'cl-return', 'cl-return-from', 'cl-rotatef', 'cl-shiftf',
- 'cl-symbol-macrolet', 'cl-tagbody', 'cl-the', 'cl-typecase',
- 'combine-after-change-calls', 'condition-case-unless-debug', 'decf',
- 'declaim', 'declare', 'declare-function', 'def-edebug-spec',
- 'defadvice', 'defclass', 'defcustom', 'defface', 'defgeneric',
- 'defgroup', 'define-advice', 'define-alternatives',
- 'define-compiler-macro', 'define-derived-mode', 'define-generic-mode',
- 'define-global-minor-mode', 'define-globalized-minor-mode',
- 'define-minor-mode', 'define-modify-macro',
- 'define-obsolete-face-alias', 'define-obsolete-function-alias',
- 'define-obsolete-variable-alias', 'define-setf-expander',
- 'define-skeleton', 'defmacro', 'defmethod', 'defsetf', 'defstruct',
- 'defsubst', 'deftheme', 'deftype', 'defun', 'defvar-local',
- 'delay-mode-hooks', 'destructuring-bind', 'do', 'do*',
- 'do-all-symbols', 'do-symbols', 'dolist', 'dont-compile', 'dotimes',
- 'dotimes-with-progress-reporter', 'ecase', 'ert-deftest', 'etypecase',
- 'eval-and-compile', 'eval-when-compile', 'flet', 'ignore-errors',
- 'incf', 'labels', 'lambda', 'letrec', 'lexical-let', 'lexical-let*',
- 'loop', 'multiple-value-bind', 'multiple-value-setq', 'noreturn',
- 'oref', 'oref-default', 'oset', 'oset-default', 'pcase',
- 'pcase-defmacro', 'pcase-dolist', 'pcase-exhaustive', 'pcase-let',
- 'pcase-let*', 'pop', 'psetf', 'psetq', 'push', 'pushnew', 'remf',
- 'return', 'rotatef', 'rx', 'save-match-data', 'save-selected-window',
- 'save-window-excursion', 'setf', 'setq-local', 'shiftf',
- 'track-mouse', 'typecase', 'unless', 'use-package', 'when',
- 'while-no-input', 'with-case-table', 'with-category-table',
- 'with-coding-priority', 'with-current-buffer', 'with-demoted-errors',
- 'with-eval-after-load', 'with-file-modes', 'with-local-quit',
- 'with-output-to-string', 'with-output-to-temp-buffer',
- 'with-parsed-tramp-file-name', 'with-selected-frame',
- 'with-selected-window', 'with-silent-modifications', 'with-slots',
- 'with-syntax-table', 'with-temp-buffer', 'with-temp-file',
- 'with-temp-message', 'with-timeout', 'with-tramp-connection-property',
- 'with-tramp-file-property', 'with-tramp-progress-reporter',
- 'with-wrapper-hook', 'load-time-value', 'locally', 'macrolet', 'progv',
- 'return-from',
- ))
-
- special_forms = set((
- 'and', 'catch', 'cond', 'condition-case', 'defconst', 'defvar',
- 'function', 'if', 'interactive', 'let', 'let*', 'or', 'prog1',
- 'prog2', 'progn', 'quote', 'save-current-buffer', 'save-excursion',
- 'save-restriction', 'setq', 'setq-default', 'subr-arity',
- 'unwind-protect', 'while',
- ))
-
- builtin_function = set((
- '%', '*', '+', '-', '/', '/=', '1+', '1-', '<', '<=', '=', '>', '>=',
- 'Snarf-documentation', 'abort-recursive-edit', 'abs',
- 'accept-process-output', 'access-file', 'accessible-keymaps', 'acos',
- 'active-minibuffer-window', 'add-face-text-property',
- 'add-name-to-file', 'add-text-properties', 'all-completions',
- 'append', 'apply', 'apropos-internal', 'aref', 'arrayp', 'aset',
- 'ash', 'asin', 'assoc', 'assoc-string', 'assq', 'atan', 'atom',
- 'autoload', 'autoload-do-load', 'backtrace', 'backtrace--locals',
- 'backtrace-debug', 'backtrace-eval', 'backtrace-frame',
- 'backward-char', 'backward-prefix-chars', 'barf-if-buffer-read-only',
- 'base64-decode-region', 'base64-decode-string',
- 'base64-encode-region', 'base64-encode-string', 'beginning-of-line',
- 'bidi-find-overridden-directionality', 'bidi-resolved-levels',
- 'bitmap-spec-p', 'bobp', 'bolp', 'bool-vector',
- 'bool-vector-count-consecutive', 'bool-vector-count-population',
- 'bool-vector-exclusive-or', 'bool-vector-intersection',
- 'bool-vector-not', 'bool-vector-p', 'bool-vector-set-difference',
- 'bool-vector-subsetp', 'bool-vector-union', 'boundp',
- 'buffer-base-buffer', 'buffer-chars-modified-tick',
- 'buffer-enable-undo', 'buffer-file-name', 'buffer-has-markers-at',
- 'buffer-list', 'buffer-live-p', 'buffer-local-value',
- 'buffer-local-variables', 'buffer-modified-p', 'buffer-modified-tick',
- 'buffer-name', 'buffer-size', 'buffer-string', 'buffer-substring',
- 'buffer-substring-no-properties', 'buffer-swap-text', 'bufferp',
- 'bury-buffer-internal', 'byte-code', 'byte-code-function-p',
- 'byte-to-position', 'byte-to-string', 'byteorder',
- 'call-interactively', 'call-last-kbd-macro', 'call-process',
- 'call-process-region', 'cancel-kbd-macro-events', 'capitalize',
- 'capitalize-region', 'capitalize-word', 'car', 'car-less-than-car',
- 'car-safe', 'case-table-p', 'category-docstring',
- 'category-set-mnemonics', 'category-table', 'category-table-p',
- 'ccl-execute', 'ccl-execute-on-string', 'ccl-program-p', 'cdr',
- 'cdr-safe', 'ceiling', 'char-after', 'char-before',
- 'char-category-set', 'char-charset', 'char-equal', 'char-or-string-p',
- 'char-resolve-modifiers', 'char-syntax', 'char-table-extra-slot',
- 'char-table-p', 'char-table-parent', 'char-table-range',
- 'char-table-subtype', 'char-to-string', 'char-width', 'characterp',
- 'charset-after', 'charset-id-internal', 'charset-plist',
- 'charset-priority-list', 'charsetp', 'check-coding-system',
- 'check-coding-systems-region', 'clear-buffer-auto-save-failure',
- 'clear-charset-maps', 'clear-face-cache', 'clear-font-cache',
- 'clear-image-cache', 'clear-string', 'clear-this-command-keys',
- 'close-font', 'clrhash', 'coding-system-aliases',
- 'coding-system-base', 'coding-system-eol-type', 'coding-system-p',
- 'coding-system-plist', 'coding-system-priority-list',
- 'coding-system-put', 'color-distance', 'color-gray-p',
- 'color-supported-p', 'combine-after-change-execute',
- 'command-error-default-function', 'command-remapping', 'commandp',
- 'compare-buffer-substrings', 'compare-strings',
- 'compare-window-configurations', 'completing-read',
- 'compose-region-internal', 'compose-string-internal',
- 'composition-get-gstring', 'compute-motion', 'concat', 'cons',
- 'consp', 'constrain-to-field', 'continue-process',
- 'controlling-tty-p', 'coordinates-in-window-p', 'copy-alist',
- 'copy-category-table', 'copy-file', 'copy-hash-table', 'copy-keymap',
- 'copy-marker', 'copy-sequence', 'copy-syntax-table', 'copysign',
- 'cos', 'current-active-maps', 'current-bidi-paragraph-direction',
- 'current-buffer', 'current-case-table', 'current-column',
- 'current-global-map', 'current-idle-time', 'current-indentation',
- 'current-input-mode', 'current-local-map', 'current-message',
- 'current-minor-mode-maps', 'current-time', 'current-time-string',
- 'current-time-zone', 'current-window-configuration',
- 'cygwin-convert-file-name-from-windows',
- 'cygwin-convert-file-name-to-windows', 'daemon-initialized',
- 'daemonp', 'dbus--init-bus', 'dbus-get-unique-name',
- 'dbus-message-internal', 'debug-timer-check', 'declare-equiv-charset',
- 'decode-big5-char', 'decode-char', 'decode-coding-region',
- 'decode-coding-string', 'decode-sjis-char', 'decode-time',
- 'default-boundp', 'default-file-modes', 'default-printer-name',
- 'default-toplevel-value', 'default-value', 'define-category',
- 'define-charset-alias', 'define-charset-internal',
- 'define-coding-system-alias', 'define-coding-system-internal',
- 'define-fringe-bitmap', 'define-hash-table-test', 'define-key',
- 'define-prefix-command', 'delete',
- 'delete-all-overlays', 'delete-and-extract-region', 'delete-char',
- 'delete-directory-internal', 'delete-field', 'delete-file',
- 'delete-frame', 'delete-other-windows-internal', 'delete-overlay',
- 'delete-process', 'delete-region', 'delete-terminal',
- 'delete-window-internal', 'delq', 'describe-buffer-bindings',
- 'describe-vector', 'destroy-fringe-bitmap', 'detect-coding-region',
- 'detect-coding-string', 'ding', 'directory-file-name',
- 'directory-files', 'directory-files-and-attributes', 'discard-input',
- 'display-supports-face-attributes-p', 'do-auto-save', 'documentation',
- 'documentation-property', 'downcase', 'downcase-region',
- 'downcase-word', 'draw-string', 'dump-colors', 'dump-emacs',
- 'dump-face', 'dump-frame-glyph-matrix', 'dump-glyph-matrix',
- 'dump-glyph-row', 'dump-redisplay-history', 'dump-tool-bar-row',
- 'elt', 'emacs-pid', 'encode-big5-char', 'encode-char',
- 'encode-coding-region', 'encode-coding-string', 'encode-sjis-char',
- 'encode-time', 'end-kbd-macro', 'end-of-line', 'eobp', 'eolp', 'eq',
- 'eql', 'equal', 'equal-including-properties', 'erase-buffer',
- 'error-message-string', 'eval', 'eval-buffer', 'eval-region',
- 'event-convert-list', 'execute-kbd-macro', 'exit-recursive-edit',
- 'exp', 'expand-file-name', 'expt', 'external-debugging-output',
- 'face-attribute-relative-p', 'face-attributes-as-vector', 'face-font',
- 'fboundp', 'fceiling', 'fetch-bytecode', 'ffloor',
- 'field-beginning', 'field-end', 'field-string',
- 'field-string-no-properties', 'file-accessible-directory-p',
- 'file-acl', 'file-attributes', 'file-attributes-lessp',
- 'file-directory-p', 'file-executable-p', 'file-exists-p',
- 'file-locked-p', 'file-modes', 'file-name-absolute-p',
- 'file-name-all-completions', 'file-name-as-directory',
- 'file-name-completion', 'file-name-directory',
- 'file-name-nondirectory', 'file-newer-than-file-p', 'file-readable-p',
- 'file-regular-p', 'file-selinux-context', 'file-symlink-p',
- 'file-system-info', 'file-system-info', 'file-writable-p',
- 'fillarray', 'find-charset-region', 'find-charset-string',
- 'find-coding-systems-region-internal', 'find-composition-internal',
- 'find-file-name-handler', 'find-font', 'find-operation-coding-system',
- 'float', 'float-time', 'floatp', 'floor', 'fmakunbound',
- 'following-char', 'font-at', 'font-drive-otf', 'font-face-attributes',
- 'font-family-list', 'font-get', 'font-get-glyphs',
- 'font-get-system-font', 'font-get-system-normal-font', 'font-info',
- 'font-match-p', 'font-otf-alternates', 'font-put',
- 'font-shape-gstring', 'font-spec', 'font-variation-glyphs',
- 'font-xlfd-name', 'fontp', 'fontset-font', 'fontset-info',
- 'fontset-list', 'fontset-list-all', 'force-mode-line-update',
- 'force-window-update', 'format', 'format-mode-line',
- 'format-network-address', 'format-time-string', 'forward-char',
- 'forward-comment', 'forward-line', 'forward-word',
- 'frame-border-width', 'frame-bottom-divider-width',
- 'frame-can-run-window-configuration-change-hook', 'frame-char-height',
- 'frame-char-width', 'frame-face-alist', 'frame-first-window',
- 'frame-focus', 'frame-font-cache', 'frame-fringe-width', 'frame-list',
- 'frame-live-p', 'frame-or-buffer-changed-p', 'frame-parameter',
- 'frame-parameters', 'frame-pixel-height', 'frame-pixel-width',
- 'frame-pointer-visible-p', 'frame-right-divider-width',
- 'frame-root-window', 'frame-scroll-bar-height',
- 'frame-scroll-bar-width', 'frame-selected-window', 'frame-terminal',
- 'frame-text-cols', 'frame-text-height', 'frame-text-lines',
- 'frame-text-width', 'frame-total-cols', 'frame-total-lines',
- 'frame-visible-p', 'framep', 'frexp', 'fringe-bitmaps-at-pos',
- 'fround', 'fset', 'ftruncate', 'funcall', 'funcall-interactively',
- 'function-equal', 'functionp', 'gap-position', 'gap-size',
- 'garbage-collect', 'gc-status', 'generate-new-buffer-name', 'get',
- 'get-buffer', 'get-buffer-create', 'get-buffer-process',
- 'get-buffer-window', 'get-byte', 'get-char-property',
- 'get-char-property-and-overlay', 'get-file-buffer', 'get-file-char',
- 'get-internal-run-time', 'get-load-suffixes', 'get-pos-property',
- 'get-process', 'get-screen-color', 'get-text-property',
- 'get-unicode-property-internal', 'get-unused-category',
- 'get-unused-iso-final-char', 'getenv-internal', 'gethash',
- 'gfile-add-watch', 'gfile-rm-watch', 'global-key-binding',
- 'gnutls-available-p', 'gnutls-boot', 'gnutls-bye', 'gnutls-deinit',
- 'gnutls-error-fatalp', 'gnutls-error-string', 'gnutls-errorp',
- 'gnutls-get-initstage', 'gnutls-peer-status',
- 'gnutls-peer-status-warning-describe', 'goto-char', 'gpm-mouse-start',
- 'gpm-mouse-stop', 'group-gid', 'group-real-gid',
- 'handle-save-session', 'handle-switch-frame', 'hash-table-count',
- 'hash-table-p', 'hash-table-rehash-size',
- 'hash-table-rehash-threshold', 'hash-table-size', 'hash-table-test',
- 'hash-table-weakness', 'iconify-frame', 'identity', 'image-flush',
- 'image-mask-p', 'image-metadata', 'image-size', 'imagemagick-types',
- 'imagep', 'indent-to', 'indirect-function', 'indirect-variable',
- 'init-image-library', 'inotify-add-watch', 'inotify-rm-watch',
- 'input-pending-p', 'insert', 'insert-and-inherit',
- 'insert-before-markers', 'insert-before-markers-and-inherit',
- 'insert-buffer-substring', 'insert-byte', 'insert-char',
- 'insert-file-contents', 'insert-startup-screen', 'int86',
- 'integer-or-marker-p', 'integerp', 'interactive-form', 'intern',
- 'intern-soft', 'internal--track-mouse', 'internal-char-font',
- 'internal-complete-buffer', 'internal-copy-lisp-face',
- 'internal-default-process-filter',
- 'internal-default-process-sentinel', 'internal-describe-syntax-value',
- 'internal-event-symbol-parse-modifiers',
- 'internal-face-x-get-resource', 'internal-get-lisp-face-attribute',
- 'internal-lisp-face-attribute-values', 'internal-lisp-face-empty-p',
- 'internal-lisp-face-equal-p', 'internal-lisp-face-p',
- 'internal-make-lisp-face', 'internal-make-var-non-special',
- 'internal-merge-in-global-face',
- 'internal-set-alternative-font-family-alist',
- 'internal-set-alternative-font-registry-alist',
- 'internal-set-font-selection-order',
- 'internal-set-lisp-face-attribute',
- 'internal-set-lisp-face-attribute-from-resource',
- 'internal-show-cursor', 'internal-show-cursor-p', 'interrupt-process',
- 'invisible-p', 'invocation-directory', 'invocation-name', 'isnan',
- 'iso-charset', 'key-binding', 'key-description',
- 'keyboard-coding-system', 'keymap-parent', 'keymap-prompt', 'keymapp',
- 'keywordp', 'kill-all-local-variables', 'kill-buffer', 'kill-emacs',
- 'kill-local-variable', 'kill-process', 'last-nonminibuffer-frame',
- 'lax-plist-get', 'lax-plist-put', 'ldexp', 'length',
- 'libxml-parse-html-region', 'libxml-parse-xml-region',
- 'line-beginning-position', 'line-end-position', 'line-pixel-height',
- 'list', 'list-fonts', 'list-system-processes', 'listp', 'load',
- 'load-average', 'local-key-binding', 'local-variable-if-set-p',
- 'local-variable-p', 'locale-info', 'locate-file-internal',
- 'lock-buffer', 'log', 'logand', 'logb', 'logior', 'lognot', 'logxor',
- 'looking-at', 'lookup-image', 'lookup-image-map', 'lookup-key',
- 'lower-frame', 'lsh', 'macroexpand', 'make-bool-vector',
- 'make-byte-code', 'make-category-set', 'make-category-table',
- 'make-char', 'make-char-table', 'make-directory-internal',
- 'make-frame-invisible', 'make-frame-visible', 'make-hash-table',
- 'make-indirect-buffer', 'make-keymap', 'make-list',
- 'make-local-variable', 'make-marker', 'make-network-process',
- 'make-overlay', 'make-serial-process', 'make-sparse-keymap',
- 'make-string', 'make-symbol', 'make-symbolic-link', 'make-temp-name',
- 'make-terminal-frame', 'make-variable-buffer-local',
- 'make-variable-frame-local', 'make-vector', 'makunbound',
- 'map-char-table', 'map-charset-chars', 'map-keymap',
- 'map-keymap-internal', 'mapatoms', 'mapc', 'mapcar', 'mapconcat',
- 'maphash', 'mark-marker', 'marker-buffer', 'marker-insertion-type',
- 'marker-position', 'markerp', 'match-beginning', 'match-data',
- 'match-end', 'matching-paren', 'max', 'max-char', 'md5', 'member',
- 'memory-info', 'memory-limit', 'memory-use-counts', 'memq', 'memql',
- 'menu-bar-menu-at-x-y', 'menu-or-popup-active-p',
- 'menu-or-popup-active-p', 'merge-face-attribute', 'message',
- 'message-box', 'message-or-box', 'min',
- 'minibuffer-completion-contents', 'minibuffer-contents',
- 'minibuffer-contents-no-properties', 'minibuffer-depth',
- 'minibuffer-prompt', 'minibuffer-prompt-end',
- 'minibuffer-selected-window', 'minibuffer-window', 'minibufferp',
- 'minor-mode-key-binding', 'mod', 'modify-category-entry',
- 'modify-frame-parameters', 'modify-syntax-entry',
- 'mouse-pixel-position', 'mouse-position', 'move-overlay',
- 'move-point-visually', 'move-to-column', 'move-to-window-line',
- 'msdos-downcase-filename', 'msdos-long-file-names', 'msdos-memget',
- 'msdos-memput', 'msdos-mouse-disable', 'msdos-mouse-enable',
- 'msdos-mouse-init', 'msdos-mouse-p', 'msdos-remember-default-colors',
- 'msdos-set-keyboard', 'msdos-set-mouse-buttons',
- 'multibyte-char-to-unibyte', 'multibyte-string-p', 'narrow-to-region',
- 'natnump', 'nconc', 'network-interface-info',
- 'network-interface-list', 'new-fontset', 'newline-cache-check',
- 'next-char-property-change', 'next-frame', 'next-overlay-change',
- 'next-property-change', 'next-read-file-uses-dialog-p',
- 'next-single-char-property-change', 'next-single-property-change',
- 'next-window', 'nlistp', 'nreverse', 'nth', 'nthcdr', 'null',
- 'number-or-marker-p', 'number-to-string', 'numberp',
- 'open-dribble-file', 'open-font', 'open-termscript',
- 'optimize-char-table', 'other-buffer', 'other-window-for-scrolling',
- 'overlay-buffer', 'overlay-end', 'overlay-get', 'overlay-lists',
- 'overlay-properties', 'overlay-put', 'overlay-recenter',
- 'overlay-start', 'overlayp', 'overlays-at', 'overlays-in',
- 'parse-partial-sexp', 'play-sound-internal', 'plist-get',
- 'plist-member', 'plist-put', 'point', 'point-marker', 'point-max',
- 'point-max-marker', 'point-min', 'point-min-marker',
- 'pos-visible-in-window-p', 'position-bytes', 'posix-looking-at',
- 'posix-search-backward', 'posix-search-forward', 'posix-string-match',
- 'posn-at-point', 'posn-at-x-y', 'preceding-char',
- 'prefix-numeric-value', 'previous-char-property-change',
- 'previous-frame', 'previous-overlay-change',
- 'previous-property-change', 'previous-single-char-property-change',
- 'previous-single-property-change', 'previous-window', 'prin1',
- 'prin1-to-string', 'princ', 'print', 'process-attributes',
- 'process-buffer', 'process-coding-system', 'process-command',
- 'process-connection', 'process-contact', 'process-datagram-address',
- 'process-exit-status', 'process-filter', 'process-filter-multibyte-p',
- 'process-id', 'process-inherit-coding-system-flag', 'process-list',
- 'process-mark', 'process-name', 'process-plist',
- 'process-query-on-exit-flag', 'process-running-child-p',
- 'process-send-eof', 'process-send-region', 'process-send-string',
- 'process-sentinel', 'process-status', 'process-tty-name',
- 'process-type', 'processp', 'profiler-cpu-log',
- 'profiler-cpu-running-p', 'profiler-cpu-start', 'profiler-cpu-stop',
- 'profiler-memory-log', 'profiler-memory-running-p',
- 'profiler-memory-start', 'profiler-memory-stop', 'propertize',
- 'purecopy', 'put', 'put-text-property',
- 'put-unicode-property-internal', 'puthash', 'query-font',
- 'query-fontset', 'quit-process', 'raise-frame', 'random', 'rassoc',
- 'rassq', 're-search-backward', 're-search-forward', 'read',
- 'read-buffer', 'read-char', 'read-char-exclusive',
- 'read-coding-system', 'read-command', 'read-event',
- 'read-from-minibuffer', 'read-from-string', 'read-function',
- 'read-key-sequence', 'read-key-sequence-vector',
- 'read-no-blanks-input', 'read-non-nil-coding-system', 'read-string',
- 'read-variable', 'recent-auto-save-p', 'recent-doskeys',
- 'recent-keys', 'recenter', 'recursion-depth', 'recursive-edit',
- 'redirect-debugging-output', 'redirect-frame-focus', 'redisplay',
- 'redraw-display', 'redraw-frame', 'regexp-quote', 'region-beginning',
- 'region-end', 'register-ccl-program', 'register-code-conversion-map',
- 'remhash', 'remove-list-of-text-properties', 'remove-text-properties',
- 'rename-buffer', 'rename-file', 'replace-match',
- 'reset-this-command-lengths', 'resize-mini-window-internal',
- 'restore-buffer-modified-p', 'resume-tty', 'reverse', 'round',
- 'run-hook-with-args', 'run-hook-with-args-until-failure',
- 'run-hook-with-args-until-success', 'run-hook-wrapped', 'run-hooks',
- 'run-window-configuration-change-hook', 'run-window-scroll-functions',
- 'safe-length', 'scan-lists', 'scan-sexps', 'scroll-down',
- 'scroll-left', 'scroll-other-window', 'scroll-right', 'scroll-up',
- 'search-backward', 'search-forward', 'secure-hash', 'select-frame',
- 'select-window', 'selected-frame', 'selected-window',
- 'self-insert-command', 'send-string-to-terminal', 'sequencep',
- 'serial-process-configure', 'set', 'set-buffer',
- 'set-buffer-auto-saved', 'set-buffer-major-mode',
- 'set-buffer-modified-p', 'set-buffer-multibyte', 'set-case-table',
- 'set-category-table', 'set-char-table-extra-slot',
- 'set-char-table-parent', 'set-char-table-range', 'set-charset-plist',
- 'set-charset-priority', 'set-coding-system-priority',
- 'set-cursor-size', 'set-default', 'set-default-file-modes',
- 'set-default-toplevel-value', 'set-file-acl', 'set-file-modes',
- 'set-file-selinux-context', 'set-file-times', 'set-fontset-font',
- 'set-frame-height', 'set-frame-position', 'set-frame-selected-window',
- 'set-frame-size', 'set-frame-width', 'set-fringe-bitmap-face',
- 'set-input-interrupt-mode', 'set-input-meta-mode', 'set-input-mode',
- 'set-keyboard-coding-system-internal', 'set-keymap-parent',
- 'set-marker', 'set-marker-insertion-type', 'set-match-data',
- 'set-message-beep', 'set-minibuffer-window',
- 'set-mouse-pixel-position', 'set-mouse-position',
- 'set-network-process-option', 'set-output-flow-control',
- 'set-process-buffer', 'set-process-coding-system',
- 'set-process-datagram-address', 'set-process-filter',
- 'set-process-filter-multibyte',
- 'set-process-inherit-coding-system-flag', 'set-process-plist',
- 'set-process-query-on-exit-flag', 'set-process-sentinel',
- 'set-process-window-size', 'set-quit-char',
- 'set-safe-terminal-coding-system-internal', 'set-screen-color',
- 'set-standard-case-table', 'set-syntax-table',
- 'set-terminal-coding-system-internal', 'set-terminal-local-value',
- 'set-terminal-parameter', 'set-text-properties', 'set-time-zone-rule',
- 'set-visited-file-modtime', 'set-window-buffer',
- 'set-window-combination-limit', 'set-window-configuration',
- 'set-window-dedicated-p', 'set-window-display-table',
- 'set-window-fringes', 'set-window-hscroll', 'set-window-margins',
- 'set-window-new-normal', 'set-window-new-pixel',
- 'set-window-new-total', 'set-window-next-buffers',
- 'set-window-parameter', 'set-window-point', 'set-window-prev-buffers',
- 'set-window-redisplay-end-trigger', 'set-window-scroll-bars',
- 'set-window-start', 'set-window-vscroll', 'setcar', 'setcdr',
- 'setplist', 'show-face-resources', 'signal', 'signal-process', 'sin',
- 'single-key-description', 'skip-chars-backward', 'skip-chars-forward',
- 'skip-syntax-backward', 'skip-syntax-forward', 'sleep-for', 'sort',
- 'sort-charsets', 'special-variable-p', 'split-char',
- 'split-window-internal', 'sqrt', 'standard-case-table',
- 'standard-category-table', 'standard-syntax-table', 'start-kbd-macro',
- 'start-process', 'stop-process', 'store-kbd-macro-event', 'string',
- 'string-as-multibyte', 'string-as-unibyte', 'string-bytes',
- 'string-collate-equalp', 'string-collate-lessp', 'string-equal',
- 'string-lessp', 'string-make-multibyte', 'string-make-unibyte',
- 'string-match', 'string-to-char', 'string-to-multibyte',
- 'string-to-number', 'string-to-syntax', 'string-to-unibyte',
- 'string-width', 'stringp', 'subr-name', 'subrp',
- 'subst-char-in-region', 'substitute-command-keys',
- 'substitute-in-file-name', 'substring', 'substring-no-properties',
- 'suspend-emacs', 'suspend-tty', 'suspicious-object', 'sxhash',
- 'symbol-function', 'symbol-name', 'symbol-plist', 'symbol-value',
- 'symbolp', 'syntax-table', 'syntax-table-p', 'system-groups',
- 'system-move-file-to-trash', 'system-name', 'system-users', 'tan',
- 'terminal-coding-system', 'terminal-list', 'terminal-live-p',
- 'terminal-local-value', 'terminal-name', 'terminal-parameter',
- 'terminal-parameters', 'terpri', 'test-completion',
- 'text-char-description', 'text-properties-at', 'text-property-any',
- 'text-property-not-all', 'this-command-keys',
- 'this-command-keys-vector', 'this-single-command-keys',
- 'this-single-command-raw-keys', 'time-add', 'time-less-p',
- 'time-subtract', 'tool-bar-get-system-style', 'tool-bar-height',
- 'tool-bar-pixel-width', 'top-level', 'trace-redisplay',
- 'trace-to-stderr', 'translate-region-internal', 'transpose-regions',
- 'truncate', 'try-completion', 'tty-display-color-cells',
- 'tty-display-color-p', 'tty-no-underline',
- 'tty-suppress-bold-inverse-default-colors', 'tty-top-frame',
- 'tty-type', 'type-of', 'undo-boundary', 'unencodable-char-position',
- 'unhandled-file-name-directory', 'unibyte-char-to-multibyte',
- 'unibyte-string', 'unicode-property-table-internal', 'unify-charset',
- 'unintern', 'unix-sync', 'unlock-buffer', 'upcase', 'upcase-initials',
- 'upcase-initials-region', 'upcase-region', 'upcase-word',
- 'use-global-map', 'use-local-map', 'user-full-name',
- 'user-login-name', 'user-real-login-name', 'user-real-uid',
- 'user-uid', 'variable-binding-locus', 'vconcat', 'vector',
- 'vector-or-char-table-p', 'vectorp', 'verify-visited-file-modtime',
- 'vertical-motion', 'visible-frame-list', 'visited-file-modtime',
- 'w16-get-clipboard-data', 'w16-selection-exists-p',
- 'w16-set-clipboard-data', 'w32-battery-status',
- 'w32-default-color-map', 'w32-define-rgb-color',
- 'w32-display-monitor-attributes-list', 'w32-frame-menu-bar-size',
- 'w32-frame-rect', 'w32-get-clipboard-data',
- 'w32-get-codepage-charset', 'w32-get-console-codepage',
- 'w32-get-console-output-codepage', 'w32-get-current-locale-id',
- 'w32-get-default-locale-id', 'w32-get-keyboard-layout',
- 'w32-get-locale-info', 'w32-get-valid-codepages',
- 'w32-get-valid-keyboard-layouts', 'w32-get-valid-locale-ids',
- 'w32-has-winsock', 'w32-long-file-name', 'w32-reconstruct-hot-key',
- 'w32-register-hot-key', 'w32-registered-hot-keys',
- 'w32-selection-exists-p', 'w32-send-sys-command',
- 'w32-set-clipboard-data', 'w32-set-console-codepage',
- 'w32-set-console-output-codepage', 'w32-set-current-locale',
- 'w32-set-keyboard-layout', 'w32-set-process-priority',
- 'w32-shell-execute', 'w32-short-file-name', 'w32-toggle-lock-key',
- 'w32-unload-winsock', 'w32-unregister-hot-key', 'w32-window-exists-p',
- 'w32notify-add-watch', 'w32notify-rm-watch',
- 'waiting-for-user-input-p', 'where-is-internal', 'widen',
- 'widget-apply', 'widget-get', 'widget-put',
- 'window-absolute-pixel-edges', 'window-at', 'window-body-height',
- 'window-body-width', 'window-bottom-divider-width', 'window-buffer',
- 'window-combination-limit', 'window-configuration-frame',
- 'window-configuration-p', 'window-dedicated-p',
- 'window-display-table', 'window-edges', 'window-end', 'window-frame',
- 'window-fringes', 'window-header-line-height', 'window-hscroll',
- 'window-inside-absolute-pixel-edges', 'window-inside-edges',
- 'window-inside-pixel-edges', 'window-left-child',
- 'window-left-column', 'window-line-height', 'window-list',
- 'window-list-1', 'window-live-p', 'window-margins',
- 'window-minibuffer-p', 'window-mode-line-height', 'window-new-normal',
- 'window-new-pixel', 'window-new-total', 'window-next-buffers',
- 'window-next-sibling', 'window-normal-size', 'window-old-point',
- 'window-parameter', 'window-parameters', 'window-parent',
- 'window-pixel-edges', 'window-pixel-height', 'window-pixel-left',
- 'window-pixel-top', 'window-pixel-width', 'window-point',
- 'window-prev-buffers', 'window-prev-sibling',
- 'window-redisplay-end-trigger', 'window-resize-apply',
- 'window-resize-apply-total', 'window-right-divider-width',
- 'window-scroll-bar-height', 'window-scroll-bar-width',
- 'window-scroll-bars', 'window-start', 'window-system',
- 'window-text-height', 'window-text-pixel-size', 'window-text-width',
- 'window-top-child', 'window-top-line', 'window-total-height',
- 'window-total-width', 'window-use-time', 'window-valid-p',
- 'window-vscroll', 'windowp', 'write-char', 'write-region',
- 'x-backspace-delete-keys-p', 'x-change-window-property',
- 'x-change-window-property', 'x-close-connection',
- 'x-close-connection', 'x-create-frame', 'x-create-frame',
- 'x-delete-window-property', 'x-delete-window-property',
- 'x-disown-selection-internal', 'x-display-backing-store',
- 'x-display-backing-store', 'x-display-color-cells',
- 'x-display-color-cells', 'x-display-grayscale-p',
- 'x-display-grayscale-p', 'x-display-list', 'x-display-list',
- 'x-display-mm-height', 'x-display-mm-height', 'x-display-mm-width',
- 'x-display-mm-width', 'x-display-monitor-attributes-list',
- 'x-display-pixel-height', 'x-display-pixel-height',
- 'x-display-pixel-width', 'x-display-pixel-width', 'x-display-planes',
- 'x-display-planes', 'x-display-save-under', 'x-display-save-under',
- 'x-display-screens', 'x-display-screens', 'x-display-visual-class',
- 'x-display-visual-class', 'x-family-fonts', 'x-file-dialog',
- 'x-file-dialog', 'x-file-dialog', 'x-focus-frame', 'x-frame-geometry',
- 'x-frame-geometry', 'x-get-atom-name', 'x-get-resource',
- 'x-get-selection-internal', 'x-hide-tip', 'x-hide-tip',
- 'x-list-fonts', 'x-load-color-file', 'x-menu-bar-open-internal',
- 'x-menu-bar-open-internal', 'x-open-connection', 'x-open-connection',
- 'x-own-selection-internal', 'x-parse-geometry', 'x-popup-dialog',
- 'x-popup-menu', 'x-register-dnd-atom', 'x-select-font',
- 'x-select-font', 'x-selection-exists-p', 'x-selection-owner-p',
- 'x-send-client-message', 'x-server-max-request-size',
- 'x-server-max-request-size', 'x-server-vendor', 'x-server-vendor',
- 'x-server-version', 'x-server-version', 'x-show-tip', 'x-show-tip',
- 'x-synchronize', 'x-synchronize', 'x-uses-old-gtk-dialog',
- 'x-window-property', 'x-window-property', 'x-wm-set-size-hint',
- 'xw-color-defined-p', 'xw-color-defined-p', 'xw-color-values',
- 'xw-color-values', 'xw-display-color-p', 'xw-display-color-p',
- 'yes-or-no-p', 'zlib-available-p', 'zlib-decompress-region',
- 'forward-point',
- ))
-
- builtin_function_highlighted = set((
- 'defvaralias', 'provide', 'require',
- 'with-no-warnings', 'define-widget', 'with-electric-help',
- 'throw', 'defalias', 'featurep'
- ))
-
- lambda_list_keywords = set((
- '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional',
- '&rest', '&whole',
- ))
-
- error_keywords = set((
- 'cl-assert', 'cl-check-type', 'error', 'signal',
- 'user-error', 'warn',
- ))
-
- def get_tokens_unprocessed(self, text):
- stack = ['root']
- for index, token, value in RegexLexer.get_tokens_unprocessed(self, text, stack):
- if token is Name.Variable:
- if value in EmacsLispLexer.builtin_function:
- yield index, Name.Function, value
- continue
- if value in EmacsLispLexer.special_forms:
- yield index, Keyword, value
- continue
- if value in EmacsLispLexer.error_keywords:
- yield index, Name.Exception, value
- continue
- if value in EmacsLispLexer.builtin_function_highlighted:
- yield index, Name.Builtin, value
- continue
- if value in EmacsLispLexer.macros:
- yield index, Name.Builtin, value
- continue
- if value in EmacsLispLexer.lambda_list_keywords:
- yield index, Keyword.Pseudo, value
- continue
- yield index, token, value
-
- tokens = {
- 'root': [
- default('body'),
- ],
- 'body': [
- # whitespace
- (r'\s+', Text),
-
- # single-line comment
- (r';.*$', Comment.Single),
-
- # strings and characters
- (r'"', String, 'string'),
- (r'\?([^\\]|\\.)', String.Char),
- # quoting
- (r":" + symbol, Name.Builtin),
- (r"::" + symbol, String.Symbol),
- (r"'" + symbol, String.Symbol),
- (r"'", Operator),
- (r"`", Operator),
-
- # decimal numbers
- (r'[-+]?\d+\.?' + terminated, Number.Integer),
- (r'[-+]?\d+/\d+' + terminated, Number),
- (r'[-+]?(\d*\.\d+([defls][-+]?\d+)?|\d+(\.\d*)?[defls][-+]?\d+)' +
- terminated, Number.Float),
-
- # vectors
- (r'\[|\]', Punctuation),
-
- # uninterned symbol
- (r'#:' + symbol, String.Symbol),
-
- # read syntax for char tables
- (r'#\^\^?', Operator),
-
- # function shorthand
- (r'#\'', Name.Function),
-
- # binary rational
- (r'#[bB][+-]?[01]+(/[01]+)?', Number.Bin),
-
- # octal rational
- (r'#[oO][+-]?[0-7]+(/[0-7]+)?', Number.Oct),
-
- # hex rational
- (r'#[xX][+-]?[0-9a-fA-F]+(/[0-9a-fA-F]+)?', Number.Hex),
-
- # radix rational
- (r'#\d+r[+-]?[0-9a-zA-Z]+(/[0-9a-zA-Z]+)?', Number),
-
- # reference
- (r'#\d+=', Operator),
- (r'#\d+#', Operator),
-
- # special operators that should have been parsed already
- (r'(,@|,|\.|:)', Operator),
-
- # special constants
- (r'(t|nil)' + terminated, Name.Constant),
-
- # functions and variables
- (r'\*' + symbol + r'\*', Name.Variable.Global),
- (symbol, Name.Variable),
-
- # parentheses
- (r'#\(', Operator, 'body'),
- (r'\(', Punctuation, 'body'),
- (r'\)', Punctuation, '#pop'),
- ],
- 'string': [
- (r'[^"\\`]+', String),
- (r'`%s\'' % symbol, String.Symbol),
- (r'`', String),
- (r'\\.', String),
- (r'\\\n', String),
- (r'"', String, '#pop'),
- ],
- }
-
-
-class ShenLexer(RegexLexer):
- """
- Lexer for `Shen <http://shenlanguage.org/>`_ source code.
-
- .. versionadded:: 2.1
- """
- name = 'Shen'
- aliases = ['shen']
- filenames = ['*.shen']
- mimetypes = ['text/x-shen', 'application/x-shen']
-
- DECLARATIONS = (
- 'datatype', 'define', 'defmacro', 'defprolog', 'defcc',
- 'synonyms', 'declare', 'package', 'type', 'function',
- )
-
- SPECIAL_FORMS = (
- 'lambda', 'get', 'let', 'if', 'cases', 'cond', 'put', 'time', 'freeze',
- 'value', 'load', '$', 'protect', 'or', 'and', 'not', 'do', 'output',
- 'prolog?', 'trap-error', 'error', 'make-string', '/.', 'set', '@p',
- '@s', '@v',
- )
-
- BUILTINS = (
- '==', '=', '*', '+', '-', '/', '<', '>', '>=', '<=', '<-address',
- '<-vector', 'abort', 'absvector', 'absvector?', 'address->', 'adjoin',
- 'append', 'arity', 'assoc', 'bind', 'boolean?', 'bound?', 'call', 'cd',
- 'close', 'cn', 'compile', 'concat', 'cons', 'cons?', 'cut', 'destroy',
- 'difference', 'element?', 'empty?', 'enable-type-theory',
- 'error-to-string', 'eval', 'eval-kl', 'exception', 'explode', 'external',
- 'fail', 'fail-if', 'file', 'findall', 'fix', 'fst', 'fwhen', 'gensym',
- 'get-time', 'hash', 'hd', 'hdstr', 'hdv', 'head', 'identical',
- 'implementation', 'in', 'include', 'include-all-but', 'inferences',
- 'input', 'input+', 'integer?', 'intern', 'intersection', 'is', 'kill',
- 'language', 'length', 'limit', 'lineread', 'loaded', 'macro', 'macroexpand',
- 'map', 'mapcan', 'maxinferences', 'mode', 'n->string', 'nl', 'nth', 'null',
- 'number?', 'occurrences', 'occurs-check', 'open', 'os', 'out', 'port',
- 'porters', 'pos', 'pr', 'preclude', 'preclude-all-but', 'print', 'profile',
- 'profile-results', 'ps', 'quit', 'read', 'read+', 'read-byte', 'read-file',
- 'read-file-as-bytelist', 'read-file-as-string', 'read-from-string',
- 'release', 'remove', 'return', 'reverse', 'run', 'save', 'set',
- 'simple-error', 'snd', 'specialise', 'spy', 'step', 'stinput', 'stoutput',
- 'str', 'string->n', 'string->symbol', 'string?', 'subst', 'symbol?',
- 'systemf', 'tail', 'tc', 'tc?', 'thaw', 'tl', 'tlstr', 'tlv', 'track',
- 'tuple?', 'undefmacro', 'unify', 'unify!', 'union', 'unprofile',
- 'unspecialise', 'untrack', 'variable?', 'vector', 'vector->', 'vector?',
- 'verified', 'version', 'warn', 'when', 'write-byte', 'write-to-file',
- 'y-or-n?',
- )
-
- BUILTINS_ANYWHERE = ('where', 'skip', '>>', '_', '!', '<e>', '<!>')
-
- MAPPINGS = dict((s, Keyword) for s in DECLARATIONS)
- MAPPINGS.update((s, Name.Builtin) for s in BUILTINS)
- MAPPINGS.update((s, Keyword) for s in SPECIAL_FORMS)
-
- valid_symbol_chars = r'[\w!$%*+,<=>?/.\'@&#:-]'
- valid_name = '%s+' % valid_symbol_chars
- symbol_name = r'[a-z!$%%*+,<=>?/.\'@&#_-]%s*' % valid_symbol_chars
- variable = r'[A-Z]%s*' % valid_symbol_chars
-
- tokens = {
- 'string': [
- (r'"', String, '#pop'),
- (r'c#\d{1,3};', String.Escape),
- (r'~[ARS%]', String.Interpol),
- (r'(?s).', String),
- ],
-
- 'root': [
- (r'(?s)\\\*.*?\*\\', Comment.Multiline), # \* ... *\
- (r'\\\\.*', Comment.Single), # \\ ...
- (r'\s+', Text),
- (r'_{5,}', Punctuation),
- (r'={5,}', Punctuation),
- (r'(;|:=|\||--?>|<--?)', Punctuation),
- (r'(:-|:|\{|\})', Literal),
- (r'[+-]*\d*\.\d+(e[+-]?\d+)?', Number.Float),
- (r'[+-]*\d+', Number.Integer),
- (r'"', String, 'string'),
- (variable, Name.Variable),
- (r'(true|false|<>|\[\])', Keyword.Pseudo),
- (symbol_name, Literal),
- (r'(\[|\]|\(|\))', Punctuation),
- ],
- }
-
- def get_tokens_unprocessed(self, text):
- tokens = RegexLexer.get_tokens_unprocessed(self, text)
- tokens = self._process_symbols(tokens)
- tokens = self._process_declarations(tokens)
- return tokens
-
- def _relevant(self, token):
- return token not in (Text, Comment.Single, Comment.Multiline)
-
- def _process_declarations(self, tokens):
- opening_paren = False
- for index, token, value in tokens:
- yield index, token, value
- if self._relevant(token):
- if opening_paren and token == Keyword and value in self.DECLARATIONS:
- declaration = value
- for index, token, value in \
- self._process_declaration(declaration, tokens):
- yield index, token, value
- opening_paren = value == '(' and token == Punctuation
-
- def _process_symbols(self, tokens):
- opening_paren = False
- for index, token, value in tokens:
- if opening_paren and token in (Literal, Name.Variable):
- token = self.MAPPINGS.get(value, Name.Function)
- elif token == Literal and value in self.BUILTINS_ANYWHERE:
- token = Name.Builtin
- opening_paren = value == '(' and token == Punctuation
- yield index, token, value
-
- def _process_declaration(self, declaration, tokens):
- for index, token, value in tokens:
- if self._relevant(token):
- break
- yield index, token, value
-
- if declaration == 'datatype':
- prev_was_colon = False
- token = Keyword.Type if token == Literal else token
- yield index, token, value
- for index, token, value in tokens:
- if prev_was_colon and token == Literal:
- token = Keyword.Type
- yield index, token, value
- if self._relevant(token):
- prev_was_colon = token == Literal and value == ':'
- elif declaration == 'package':
- token = Name.Namespace if token == Literal else token
- yield index, token, value
- elif declaration == 'define':
- token = Name.Function if token == Literal else token
- yield index, token, value
- for index, token, value in tokens:
- if self._relevant(token):
- break
- yield index, token, value
- if value == '{' and token == Literal:
- yield index, Punctuation, value
- for index, token, value in self._process_signature(tokens):
- yield index, token, value
- else:
- yield index, token, value
- else:
- token = Name.Function if token == Literal else token
- yield index, token, value
-
- return
-
- def _process_signature(self, tokens):
- for index, token, value in tokens:
- if token == Literal and value == '}':
- yield index, Punctuation, value
- return
- elif token in (Literal, Name.Function):
- token = Name.Variable if value.istitle() else Keyword.Type
- yield index, token, value
-
-
-class CPSALexer(SchemeLexer):
- """
- A CPSA lexer based on the CPSA language as of version 2.2.12
-
- .. versionadded:: 2.1
- """
- name = 'CPSA'
- aliases = ['cpsa']
- filenames = ['*.cpsa']
- mimetypes = []
-
- # list of known keywords and builtins taken form vim 6.4 scheme.vim
- # syntax file.
- _keywords = (
- 'herald', 'vars', 'defmacro', 'include', 'defprotocol', 'defrole',
- 'defskeleton', 'defstrand', 'deflistener', 'non-orig', 'uniq-orig',
- 'pen-non-orig', 'precedes', 'trace', 'send', 'recv', 'name', 'text',
- 'skey', 'akey', 'data', 'mesg',
- )
- _builtins = (
- 'cat', 'enc', 'hash', 'privk', 'pubk', 'invk', 'ltk', 'gen', 'exp',
- )
-
- # valid names for identifiers
- # well, names can only not consist fully of numbers
- # but this should be good enough for now
- valid_name = r'[\w!$%&*+,/:<=>?@^~|-]+'
-
- 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"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char),
-
- # constants
- (r'(#t|#f)', Name.Constant),
-
- # special operators
- (r"('|#|`|,@|,|\.)", Operator),
-
- # highlight the keywords
- (words(_keywords, suffix=r'\b'), 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
- (words(_builtins, prefix=r'(?<=\()', suffix=r'\b'), Name.Builtin),
-
- # the remaining functions
- (r'(?<=\()' + valid_name, Name.Function),
- # find the remaining variables
- (valid_name, Name.Variable),
-
- # the famous parentheses!
- (r'(\(|\))', Punctuation),
- (r'(\[|\])', Punctuation),
- ],
- }
-
-
-class XtlangLexer(RegexLexer):
- """An xtlang lexer for the `Extempore programming environment
- <http://extempore.moso.com.au>`_.
-
- This is a mixture of Scheme and xtlang, really. Keyword lists are
- taken from the Extempore Emacs mode
- (https://github.com/extemporelang/extempore-emacs-mode)
-
- .. versionadded:: 2.2
- """
- name = 'xtlang'
- aliases = ['extempore']
- filenames = ['*.xtm']
- mimetypes = []
-
- common_keywords = (
- 'lambda', 'define', 'if', 'else', 'cond', 'and',
- 'or', 'let', 'begin', 'set!', 'map', 'for-each',
- )
- scheme_keywords = (
- 'do', 'delay', 'quasiquote', 'unquote', 'unquote-splicing', 'eval',
- 'case', 'let*', 'letrec', 'quote',
- )
- xtlang_bind_keywords = (
- 'bind-func', 'bind-val', 'bind-lib', 'bind-type', 'bind-alias',
- 'bind-poly', 'bind-dylib', 'bind-lib-func', 'bind-lib-val',
- )
- xtlang_keywords = (
- 'letz', 'memzone', 'cast', 'convert', 'dotimes', 'doloop',
- )
- common_functions = (
- '*', '+', '-', '/', '<', '<=', '=', '>', '>=', '%', 'abs', 'acos',
- 'angle', 'append', 'apply', 'asin', 'assoc', 'assq', 'assv',
- 'atan', 'boolean?', 'caaaar', 'caaadr', 'caaar', 'caadar',
- 'caaddr', 'caadr', 'caar', 'cadaar', 'cadadr', 'cadar',
- 'caddar', 'cadddr', 'caddr', 'cadr', 'car', 'cdaaar',
- 'cdaadr', 'cdaar', 'cdadar', 'cdaddr', 'cdadr', 'cdar',
- 'cddaar', 'cddadr', 'cddar', 'cdddar', 'cddddr', 'cdddr',
- 'cddr', 'cdr', 'ceiling', 'cons', 'cos', 'floor', 'length',
- 'list', 'log', 'max', 'member', 'min', 'modulo', 'not',
- 'reverse', 'round', 'sin', 'sqrt', 'substring', 'tan',
- 'println', 'random', 'null?', 'callback', 'now',
- )
- scheme_functions = (
- 'call-with-current-continuation', 'call-with-input-file',
- 'call-with-output-file', 'call-with-values', 'call/cc',
- 'char->integer', 'char-alphabetic?', 'char-ci<=?', 'char-ci<?',
- 'char-ci=?', 'char-ci>=?', 'char-ci>?', 'char-downcase',
- 'char-lower-case?', 'char-numeric?', 'char-ready?',
- 'char-upcase', 'char-upper-case?', 'char-whitespace?',
- 'char<=?', 'char<?', 'char=?', 'char>=?', 'char>?', 'char?',
- 'close-input-port', 'close-output-port', 'complex?',
- 'current-input-port', 'current-output-port', 'denominator',
- 'display', 'dynamic-wind', 'eof-object?', 'eq?', 'equal?',
- 'eqv?', 'even?', 'exact->inexact', 'exact?', 'exp', 'expt',
- 'force', 'gcd', 'imag-part', 'inexact->exact', 'inexact?',
- 'input-port?', 'integer->char', 'integer?',
- 'interaction-environment', 'lcm', 'list->string',
- 'list->vector', 'list-ref', 'list-tail', 'list?', 'load',
- 'magnitude', 'make-polar', 'make-rectangular', 'make-string',
- 'make-vector', 'memq', 'memv', 'negative?', 'newline',
- 'null-environment', 'number->string', 'number?',
- 'numerator', 'odd?', 'open-input-file', 'open-output-file',
- 'output-port?', 'pair?', 'peek-char', 'port?', 'positive?',
- 'procedure?', 'quotient', 'rational?', 'rationalize', 'read',
- 'read-char', 'real-part', 'real?',
- 'remainder', 'scheme-report-environment', 'set-car!', 'set-cdr!',
- 'string', 'string->list', 'string->number', 'string->symbol',
- 'string-append', 'string-ci<=?', 'string-ci<?', 'string-ci=?',
- 'string-ci>=?', 'string-ci>?', 'string-copy', 'string-fill!',
- 'string-length', 'string-ref', 'string-set!', 'string<=?',
- 'string<?', 'string=?', 'string>=?', 'string>?', 'string?',
- 'symbol->string', 'symbol?', 'transcript-off', 'transcript-on',
- 'truncate', 'values', 'vector', 'vector->list', 'vector-fill!',
- 'vector-length', 'vector?',
- 'with-input-from-file', 'with-output-to-file', 'write',
- 'write-char', 'zero?',
- )
- xtlang_functions = (
- 'toString', 'afill!', 'pfill!', 'tfill!', 'tbind', 'vfill!',
- 'array-fill!', 'pointer-fill!', 'tuple-fill!', 'vector-fill!', 'free',
- 'array', 'tuple', 'list', '~', 'cset!', 'cref', '&', 'bor',
- 'ang-names', '<<', '>>', 'nil', 'printf', 'sprintf', 'null', 'now',
- 'pset!', 'pref-ptr', 'vset!', 'vref', 'aset!', 'aref', 'aref-ptr',
- 'tset!', 'tref', 'tref-ptr', 'salloc', 'halloc', 'zalloc', 'alloc',
- 'schedule', 'exp', 'log', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan',
- 'sqrt', 'expt', 'floor', 'ceiling', 'truncate', 'round',
- 'llvm_printf', 'push_zone', 'pop_zone', 'memzone', 'callback',
- 'llvm_sprintf', 'make-array', 'array-set!', 'array-ref',
- 'array-ref-ptr', 'pointer-set!', 'pointer-ref', 'pointer-ref-ptr',
- 'stack-alloc', 'heap-alloc', 'zone-alloc', 'make-tuple', 'tuple-set!',
- 'tuple-ref', 'tuple-ref-ptr', 'closure-set!', 'closure-ref', 'pref',
- 'pdref', 'impc_null', 'bitcast', 'void', 'ifret', 'ret->', 'clrun->',
- 'make-env-zone', 'make-env', '<>', 'dtof', 'ftod', 'i1tof',
- 'i1tod', 'i1toi8', 'i1toi32', 'i1toi64', 'i8tof', 'i8tod',
- 'i8toi1', 'i8toi32', 'i8toi64', 'i32tof', 'i32tod', 'i32toi1',
- 'i32toi8', 'i32toi64', 'i64tof', 'i64tod', 'i64toi1',
- 'i64toi8', 'i64toi32',
- )
-
- # valid names for Scheme identifiers (names cannot consist fully
- # of numbers, but this should be good enough for now)
- valid_scheme_name = r'[\w!$%&*+,/:<=>?@^~|-]+'
-
- # valid characters in xtlang names & types
- valid_xtlang_name = r'[\w.!-]+'
- valid_xtlang_type = r'[]{}[\w<>,*/|!-]+'
-
- tokens = {
- # keep track of when we're exiting the xtlang form
- 'xtlang': [
- (r'\(', Punctuation, '#push'),
- (r'\)', Punctuation, '#pop'),
-
- (r'(?<=bind-func\s)' + valid_xtlang_name, Name.Function),
- (r'(?<=bind-val\s)' + valid_xtlang_name, Name.Function),
- (r'(?<=bind-type\s)' + valid_xtlang_name, Name.Function),
- (r'(?<=bind-alias\s)' + valid_xtlang_name, Name.Function),
- (r'(?<=bind-poly\s)' + valid_xtlang_name, Name.Function),
- (r'(?<=bind-lib\s)' + valid_xtlang_name, Name.Function),
- (r'(?<=bind-dylib\s)' + valid_xtlang_name, Name.Function),
- (r'(?<=bind-lib-func\s)' + valid_xtlang_name, Name.Function),
- (r'(?<=bind-lib-val\s)' + valid_xtlang_name, Name.Function),
-
- # type annotations
- (r':' + valid_xtlang_type, Keyword.Type),
-
- # types
- (r'(<' + valid_xtlang_type + r'>|\|' + valid_xtlang_type + r'\||/' +
- valid_xtlang_type + r'/|' + valid_xtlang_type + r'\*)\**',
- Keyword.Type),
-
- # keywords
- (words(xtlang_keywords, prefix=r'(?<=\()'), Keyword),
-
- # builtins
- (words(xtlang_functions, prefix=r'(?<=\()'), Name.Function),
-
- include('common'),
-
- # variables
- (valid_xtlang_name, Name.Variable),
- ],
- 'scheme': [
- # quoted symbols
- (r"'" + valid_scheme_name, String.Symbol),
-
- # char literals
- (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char),
-
- # special operators
- (r"('|#|`|,@|,|\.)", Operator),
-
- # keywords
- (words(scheme_keywords, prefix=r'(?<=\()'), Keyword),
-
- # builtins
- (words(scheme_functions, prefix=r'(?<=\()'), Name.Function),
-
- include('common'),
-
- # variables
- (valid_scheme_name, Name.Variable),
- ],
- # common to both xtlang and Scheme
- 'common': [
- # comments
- (r';.*$', Comment.Single),
-
- # whitespaces - usually not relevant
- (r'\s+', Text),
-
- # numbers
- (r'-?\d+\.\d+', Number.Float),
- (r'-?\d+', Number.Integer),
-
- # binary/oct/hex literals
- (r'(#b|#o|#x)[\d.]+', Number),
-
- # strings
- (r'"(\\\\|\\"|[^"])*"', String),
-
- # true/false constants
- (r'(#t|#f)', Name.Constant),
-
- # keywords
- (words(common_keywords, prefix=r'(?<=\()'), Keyword),
-
- # builtins
- (words(common_functions, prefix=r'(?<=\()'), Name.Function),
-
- # the famous parentheses!
- (r'(\(|\))', Punctuation),
- ],
- 'root': [
- # go into xtlang mode
- (words(xtlang_bind_keywords, prefix=r'(?<=\()', suffix=r'\b'),
- Keyword, 'xtlang'),
-
- include('scheme')
- ],
- }
-
-
-class FennelLexer(RegexLexer):
- """A lexer for the `Fennel programming language <https://fennel-lang.org>`_.
-
- Fennel compiles to Lua, so all the Lua builtins are recognized as well
- as the special forms that are particular to the Fennel compiler.
-
- .. versionadded:: 2.3
- """
- name = 'Fennel'
- aliases = ['fennel', 'fnl']
- filenames = ['*.fnl']
-
- # these two lists are taken from fennel-mode.el:
- # https://gitlab.com/technomancy/fennel-mode
- # this list is current as of Fennel version 0.1.0.
- special_forms = (
- u'require-macros', u'eval-compiler',
- u'do', u'values', u'if', u'when', u'each', u'for', u'fn', u'lambda',
- u'λ', u'set', u'global', u'var', u'local', u'let', u'tset', u'doto',
- u'set-forcibly!', u'defn', u'partial', u'while', u'or', u'and', u'true',
- u'false', u'nil', u'.', u'+', u'..', u'^', u'-', u'*', u'%', u'/', u'>',
- u'<', u'>=', u'<=', u'=', u'~=', u'#', u'...', u':', u'->', u'->>',
- )
-
- # Might be nicer to use the list from _lua_builtins.py but it's unclear how?
- builtins = (
- u'_G', u'_VERSION', u'arg', u'assert', u'bit32', u'collectgarbage',
- u'coroutine', u'debug', u'dofile', u'error', u'getfenv',
- u'getmetatable', u'io', u'ipairs', u'load', u'loadfile', u'loadstring',
- u'math', u'next', u'os', u'package', u'pairs', u'pcall', u'print',
- u'rawequal', u'rawget', u'rawlen', u'rawset', u'require', u'select',
- u'setfenv', u'setmetatable', u'string', u'table', u'tonumber',
- u'tostring', u'type', u'unpack', u'xpcall'
- )
-
- # based on the scheme definition, but disallowing leading digits and commas
- valid_name = r'[a-zA-Z_!$%&*+/:<=>?@^~|-][\w!$%&*+/:<=>?@^~|\.-]*'
-
- tokens = {
- 'root': [
- # the only comment form is a semicolon; goes to the end of the line
- (r';.*$', Comment.Single),
-
- (r'[,\s]+', Text),
- (r'-?\d+\.\d+', Number.Float),
- (r'-?\d+', Number.Integer),
-
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'(\\\\|\\'|[^'])*'", String),
-
- # these are technically strings, but it's worth visually
- # distinguishing them because their intent is different
- # from regular strings.
- (r':' + valid_name, String.Symbol),
-
- # special forms are keywords
- (words(special_forms, suffix=' '), Keyword),
- # lua standard library are builtins
- (words(builtins, suffix=' '), Name.Builtin),
- # special-case the vararg symbol
- (r'\.\.\.', Name.Variable),
- # regular identifiers
- (valid_name, Name.Variable),
-
- # all your normal paired delimiters for your programming enjoyment
- (r'(\(|\))', Punctuation),
- (r'(\[|\])', Punctuation),
- (r'(\{|\})', Punctuation),
- ]
- }
diff --git a/pygments/lexers/make.py b/pygments/lexers/make.py
deleted file mode 100644
index f67f1095..00000000
--- a/pygments/lexers/make.py
+++ /dev/null
@@ -1,202 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.make
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Makefiles and similar.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, include, bygroups, \
- do_insertions, using
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Punctuation
-from pygments.lexers.shell import BashLexer
-
-__all__ = ['MakefileLexer', 'BaseMakefileLexer', 'CMakeLexer']
-
-
-class MakefileLexer(Lexer):
- """
- Lexer for BSD and GNU make extensions (lenient enough to handle both in
- the same file even).
-
- *Rewritten in Pygments 0.10.*
- """
-
- name = 'Makefile'
- aliases = ['make', 'makefile', 'mf', 'bsdmake']
- filenames = ['*.mak', '*.mk', 'Makefile', 'makefile', 'Makefile.*', 'GNUmakefile']
- mimetypes = ['text/x-makefile']
-
- r_special = re.compile(
- r'^(?:'
- # BSD Make
- r'\.\s*(include|undef|error|warning|if|else|elif|endif|for|endfor)|'
- # GNU Make
- r'\s*(ifeq|ifneq|ifdef|ifndef|else|endif|-?include|define|endef|:|vpath)|'
- # GNU Automake
- r'\s*(if|else|endif))(?=\s)')
- r_comment = re.compile(r'^\s*@?#')
-
- def get_tokens_unprocessed(self, text):
- ins = []
- lines = text.splitlines(True)
- done = ''
- lex = BaseMakefileLexer(**self.options)
- backslashflag = False
- for line in lines:
- if self.r_special.match(line) or backslashflag:
- ins.append((len(done), [(0, Comment.Preproc, line)]))
- backslashflag = line.strip().endswith('\\')
- elif self.r_comment.match(line):
- ins.append((len(done), [(0, Comment, line)]))
- else:
- done += line
- for item in do_insertions(ins, lex.get_tokens_unprocessed(done)):
- yield item
-
- def analyse_text(text):
- # Many makefiles have $(BIG_CAPS) style variables
- if re.search(r'\$\([A-Z_]+\)', text):
- return 0.1
-
-
-class BaseMakefileLexer(RegexLexer):
- """
- Lexer for simple Makefiles (no preprocessing).
-
- .. versionadded:: 0.10
- """
-
- name = 'Base Makefile'
- aliases = ['basemake']
- filenames = []
- mimetypes = []
-
- tokens = {
- 'root': [
- # recipes (need to allow spaces because of expandtabs)
- (r'^(?:[\t ]+.*\n|\n)+', using(BashLexer)),
- # special variables
- (r'\$[<@$+%?|*]', Keyword),
- (r'\s+', Text),
- (r'#.*?\n', Comment),
- (r'(export)(\s+)(?=[\w${}\t -]+\n)',
- bygroups(Keyword, Text), 'export'),
- (r'export\s+', Keyword),
- # assignment
- (r'([\w${}().-]+)(\s*)([!?:+]?=)([ \t]*)((?:.*\\\n)+|.*\n)',
- bygroups(Name.Variable, Text, Operator, Text, using(BashLexer))),
- # strings
- (r'(?s)"(\\\\|\\.|[^"\\])*"', String.Double),
- (r"(?s)'(\\\\|\\.|[^'\\])*'", String.Single),
- # targets
- (r'([^\n:]+)(:+)([ \t]*)', bygroups(Name.Function, Operator, Text),
- 'block-header'),
- # expansions
- (r'\$\(', Keyword, 'expansion'),
- ],
- 'expansion': [
- (r'[^\w$().-]+', Text),
- (r'[\w.-]+', Name.Variable),
- (r'\$', Keyword),
- (r'\(', Keyword, '#push'),
- (r'\)', Keyword, '#pop'),
- ],
- 'export': [
- (r'[\w${}-]+', Name.Variable),
- (r'\n', Text, '#pop'),
- (r'\s+', Text),
- ],
- 'block-header': [
- (r'[,|]', Punctuation),
- (r'#.*?\n', Comment, '#pop'),
- (r'\\\n', Text), # line continuation
- (r'\$\(', Keyword, 'expansion'),
- (r'[a-zA-Z_]+', Name),
- (r'\n', Text, '#pop'),
- (r'.', Text),
- ],
- }
-
-
-class CMakeLexer(RegexLexer):
- """
- Lexer for `CMake <http://cmake.org/Wiki/CMake>`_ files.
-
- .. versionadded:: 1.2
- """
- name = 'CMake'
- aliases = ['cmake']
- filenames = ['*.cmake', 'CMakeLists.txt']
- mimetypes = ['text/x-cmake']
-
- tokens = {
- 'root': [
- # (r'(ADD_CUSTOM_COMMAND|ADD_CUSTOM_TARGET|ADD_DEFINITIONS|'
- # r'ADD_DEPENDENCIES|ADD_EXECUTABLE|ADD_LIBRARY|ADD_SUBDIRECTORY|'
- # r'ADD_TEST|AUX_SOURCE_DIRECTORY|BUILD_COMMAND|BUILD_NAME|'
- # r'CMAKE_MINIMUM_REQUIRED|CONFIGURE_FILE|CREATE_TEST_SOURCELIST|'
- # r'ELSE|ELSEIF|ENABLE_LANGUAGE|ENABLE_TESTING|ENDFOREACH|'
- # r'ENDFUNCTION|ENDIF|ENDMACRO|ENDWHILE|EXEC_PROGRAM|'
- # r'EXECUTE_PROCESS|EXPORT_LIBRARY_DEPENDENCIES|FILE|FIND_FILE|'
- # r'FIND_LIBRARY|FIND_PACKAGE|FIND_PATH|FIND_PROGRAM|FLTK_WRAP_UI|'
- # r'FOREACH|FUNCTION|GET_CMAKE_PROPERTY|GET_DIRECTORY_PROPERTY|'
- # r'GET_FILENAME_COMPONENT|GET_SOURCE_FILE_PROPERTY|'
- # r'GET_TARGET_PROPERTY|GET_TEST_PROPERTY|IF|INCLUDE|'
- # r'INCLUDE_DIRECTORIES|INCLUDE_EXTERNAL_MSPROJECT|'
- # r'INCLUDE_REGULAR_EXPRESSION|INSTALL|INSTALL_FILES|'
- # r'INSTALL_PROGRAMS|INSTALL_TARGETS|LINK_DIRECTORIES|'
- # r'LINK_LIBRARIES|LIST|LOAD_CACHE|LOAD_COMMAND|MACRO|'
- # r'MAKE_DIRECTORY|MARK_AS_ADVANCED|MATH|MESSAGE|OPTION|'
- # r'OUTPUT_REQUIRED_FILES|PROJECT|QT_WRAP_CPP|QT_WRAP_UI|REMOVE|'
- # r'REMOVE_DEFINITIONS|SEPARATE_ARGUMENTS|SET|'
- # r'SET_DIRECTORY_PROPERTIES|SET_SOURCE_FILES_PROPERTIES|'
- # r'SET_TARGET_PROPERTIES|SET_TESTS_PROPERTIES|SITE_NAME|'
- # r'SOURCE_GROUP|STRING|SUBDIR_DEPENDS|SUBDIRS|'
- # r'TARGET_LINK_LIBRARIES|TRY_COMPILE|TRY_RUN|UNSET|'
- # r'USE_MANGLED_MESA|UTILITY_SOURCE|VARIABLE_REQUIRES|'
- # r'VTK_MAKE_INSTANTIATOR|VTK_WRAP_JAVA|VTK_WRAP_PYTHON|'
- # r'VTK_WRAP_TCL|WHILE|WRITE_FILE|'
- # r'COUNTARGS)\b', Name.Builtin, 'args'),
- (r'\b(\w+)([ \t]*)(\()', bygroups(Name.Builtin, Text,
- Punctuation), 'args'),
- include('keywords'),
- include('ws')
- ],
- 'args': [
- (r'\(', Punctuation, '#push'),
- (r'\)', Punctuation, '#pop'),
- (r'(\$\{)(.+?)(\})', bygroups(Operator, Name.Variable, Operator)),
- (r'(\$ENV\{)(.+?)(\})', bygroups(Operator, Name.Variable, Operator)),
- (r'(\$<)(.+?)(>)', bygroups(Operator, Name.Variable, Operator)),
- (r'(?s)".*?"', String.Double),
- (r'\\\S+', String),
- (r'[^)$"# \t\n]+', String),
- (r'\n', Text), # explicitly legal
- include('keywords'),
- include('ws')
- ],
- 'string': [
-
- ],
- 'keywords': [
- (r'\b(WIN32|UNIX|APPLE|CYGWIN|BORLAND|MINGW|MSVC|MSVC_IDE|MSVC60|'
- r'MSVC70|MSVC71|MSVC80|MSVC90)\b', Keyword),
- ],
- 'ws': [
- (r'[ \t]+', Text),
- (r'#.*\n', Comment),
- ]
- }
-
- def analyse_text(text):
- exp = r'^ *CMAKE_MINIMUM_REQUIRED *\( *VERSION *\d(\.\d)* *( FATAL_ERROR)? *\) *$'
- if re.search(exp, text, flags=re.MULTILINE | re.IGNORECASE):
- return 0.8
- return 0.0
diff --git a/pygments/lexers/markup.py b/pygments/lexers/markup.py
deleted file mode 100644
index 2eb669e4..00000000
--- a/pygments/lexers/markup.py
+++ /dev/null
@@ -1,599 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.markup
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for non-HTML markup languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexers.html import HtmlLexer, XmlLexer
-from pygments.lexers.javascript import JavascriptLexer
-from pygments.lexers.css import CssLexer
-
-from pygments.lexer import RegexLexer, DelegatingLexer, include, bygroups, \
- using, this, do_insertions, default, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic, Other
-from pygments.util import get_bool_opt, ClassNotFound
-
-__all__ = ['BBCodeLexer', 'MoinWikiLexer', 'RstLexer', 'TexLexer', 'GroffLexer',
- 'MozPreprocHashLexer', 'MozPreprocPercentLexer',
- 'MozPreprocXulLexer', 'MozPreprocJavascriptLexer',
- 'MozPreprocCssLexer', 'MarkdownLexer']
-
-
-class BBCodeLexer(RegexLexer):
- """
- A lexer that highlights BBCode(-like) syntax.
-
- .. versionadded:: 0.6
- """
-
- name = 'BBCode'
- aliases = ['bbcode']
- mimetypes = ['text/x-bbcode']
-
- tokens = {
- 'root': [
- (r'[^[]+', Text),
- # tag/end tag begin
- (r'\[/?\w+', Keyword, 'tag'),
- # stray bracket
- (r'\[', Text),
- ],
- 'tag': [
- (r'\s+', Text),
- # attribute with value
- (r'(\w+)(=)("?[^\s"\]]+"?)',
- bygroups(Name.Attribute, Operator, String)),
- # tag argument (a la [color=green])
- (r'(=)("?[^\s"\]]+"?)',
- bygroups(Operator, String)),
- # tag end
- (r'\]', Keyword, '#pop'),
- ],
- }
-
-
-class MoinWikiLexer(RegexLexer):
- """
- For MoinMoin (and Trac) Wiki markup.
-
- .. versionadded:: 0.7
- """
-
- name = 'MoinMoin/Trac Wiki markup'
- aliases = ['trac-wiki', 'moin']
- filenames = []
- mimetypes = ['text/x-trac-wiki']
- flags = re.MULTILINE | re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'^#.*$', Comment),
- (r'(!)(\S+)', bygroups(Keyword, Text)), # Ignore-next
- # Titles
- (r'^(=+)([^=]+)(=+)(\s*#.+)?$',
- bygroups(Generic.Heading, using(this), Generic.Heading, String)),
- # Literal code blocks, with optional shebang
- (r'(\{\{\{)(\n#!.+)?', bygroups(Name.Builtin, Name.Namespace), 'codeblock'),
- (r'(\'\'\'?|\|\||`|__|~~|\^|,,|::)', Comment), # Formatting
- # Lists
- (r'^( +)([.*-])( )', bygroups(Text, Name.Builtin, Text)),
- (r'^( +)([a-z]{1,5}\.)( )', bygroups(Text, Name.Builtin, Text)),
- # Other Formatting
- (r'\[\[\w+.*?\]\]', Keyword), # Macro
- (r'(\[[^\s\]]+)(\s+[^\]]+?)?(\])',
- bygroups(Keyword, String, Keyword)), # Link
- (r'^----+$', Keyword), # Horizontal rules
- (r'[^\n\'\[{!_~^,|]+', Text),
- (r'\n', Text),
- (r'.', Text),
- ],
- 'codeblock': [
- (r'\}\}\}', Name.Builtin, '#pop'),
- # these blocks are allowed to be nested in Trac, but not MoinMoin
- (r'\{\{\{', Text, '#push'),
- (r'[^{}]+', Comment.Preproc), # slurp boring text
- (r'.', Comment.Preproc), # allow loose { or }
- ],
- }
-
-
-class RstLexer(RegexLexer):
- """
- For `reStructuredText <http://docutils.sf.net/rst.html>`_ markup.
-
- .. versionadded:: 0.7
-
- Additional options accepted:
-
- `handlecodeblocks`
- Highlight the contents of ``.. sourcecode:: language``,
- ``.. code:: language`` and ``.. code-block:: language``
- directives with a lexer for the given language (default:
- ``True``).
-
- .. versionadded:: 0.8
- """
- name = 'reStructuredText'
- aliases = ['rst', 'rest', 'restructuredtext']
- filenames = ['*.rst', '*.rest']
- mimetypes = ["text/x-rst", "text/prs.fallenstein.rst"]
- flags = re.MULTILINE
-
- def _handle_sourcecode(self, match):
- from pygments.lexers import get_lexer_by_name
-
- # section header
- yield match.start(1), Punctuation, match.group(1)
- yield match.start(2), Text, match.group(2)
- yield match.start(3), Operator.Word, match.group(3)
- yield match.start(4), Punctuation, match.group(4)
- yield match.start(5), Text, match.group(5)
- yield match.start(6), Keyword, match.group(6)
- yield match.start(7), Text, match.group(7)
-
- # lookup lexer if wanted and existing
- lexer = None
- if self.handlecodeblocks:
- try:
- lexer = get_lexer_by_name(match.group(6).strip())
- except ClassNotFound:
- pass
- indention = match.group(8)
- indention_size = len(indention)
- code = (indention + match.group(9) + match.group(10) + match.group(11))
-
- # no lexer for this language. handle it like it was a code block
- if lexer is None:
- yield match.start(8), String, code
- return
-
- # highlight the lines with the lexer.
- ins = []
- codelines = code.splitlines(True)
- code = ''
- for line in codelines:
- if len(line) > indention_size:
- ins.append((len(code), [(0, Text, line[:indention_size])]))
- code += line[indention_size:]
- else:
- code += line
- 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
- (r'^(=+|-+|`+|:+|\.+|\'+|"+|~+|\^+|_+|\*+|\++|#+)([ \t]*\n)'
- r'(.+)(\n)(\1)(\n)',
- bygroups(Generic.Heading, Text, Generic.Heading,
- Text, Generic.Heading, Text)),
- # Plain heading
- (r'^(\S.*)(\n)(={3,}|-{3,}|`{3,}|:{3,}|\.{3,}|\'{3,}|"{3,}|'
- r'~{3,}|\^{3,}|_{3,}|\*{3,}|\+{3,}|#{3,})(\n)',
- bygroups(Generic.Heading, Text, Generic.Heading, Text)),
- # Bulleted lists
- (r'^(\s*)([-*+])( .+\n(?:\1 .+\n)*)',
- bygroups(Text, Number, using(this, state='inline'))),
- # Numbered lists
- (r'^(\s*)([0-9#ivxlcmIVXLCM]+\.)( .+\n(?:\1 .+\n)*)',
- bygroups(Text, Number, using(this, state='inline'))),
- (r'^(\s*)(\(?[0-9#ivxlcmIVXLCM]+\))( .+\n(?:\1 .+\n)*)',
- bygroups(Text, Number, using(this, state='inline'))),
- # Numbered, but keep words at BOL from becoming lists
- (r'^(\s*)([A-Z]+\.)( .+\n(?:\1 .+\n)+)',
- bygroups(Text, Number, using(this, state='inline'))),
- (r'^(\s*)(\(?[A-Za-z]+\))( .+\n(?:\1 .+\n)+)',
- bygroups(Text, Number, using(this, state='inline'))),
- # Line blocks
- (r'^(\s*)(\|)( .+\n(?:\| .+\n)*)',
- bygroups(Text, Operator, using(this, state='inline'))),
- # Sourcecode directives
- (r'^( *\.\.)(\s*)((?:source)?code(?:-block)?)(::)([ \t]*)([^\n]+)'
- r'(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\8.*|)\n)+)',
- _handle_sourcecode),
- # A directive
- (r'^( *\.\.)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))',
- bygroups(Punctuation, Text, Operator.Word, Punctuation, Text,
- using(this, state='inline'))),
- # A reference target
- (r'^( *\.\.)(\s*)(_(?:[^:\\]|\\.)+:)(.*?)$',
- bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
- # A footnote/citation target
- (r'^( *\.\.)(\s*)(\[.+\])(.*?)$',
- bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
- # A substitution def
- (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))',
- bygroups(Punctuation, Text, Name.Tag, Text, Operator.Word,
- Punctuation, Text, using(this, state='inline'))),
- # Comments
- (r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment.Preproc),
- # Field list
- (r'^( *)(:[a-zA-Z-]+:)(\s*)$', bygroups(Text, Name.Class, Text)),
- (r'^( *)(:.*?:)([ \t]+)(.*?)$',
- bygroups(Text, Name.Class, Text, Name.Function)),
- # Definition list
- (r'^(\S.*(?<!::)\n)((?:(?: +.*)\n)+)',
- bygroups(using(this, state='inline'), using(this, state='inline'))),
- # Code blocks
- (r'(::)(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\3.*|)\n)+)',
- bygroups(String.Escape, Text, String, String, Text, String)),
- include('inline'),
- ],
- 'inline': [
- (r'\\.', Text), # escape
- (r'``', String, 'literal'), # code
- (r'(`.+?)(<.+?>)(`__?)', # reference with inline target
- bygroups(String, String.Interpol, String)),
- (r'`.+?`__?', String), # reference
- (r'(`.+?`)(:[a-zA-Z0-9:-]+?:)?',
- bygroups(Name.Variable, Name.Attribute)), # role
- (r'(:[a-zA-Z0-9:-]+?:)(`.+?`)',
- bygroups(Name.Attribute, Name.Variable)), # role (content first)
- (r'\*\*.+?\*\*', Generic.Strong), # Strong emphasis
- (r'\*.+?\*', Generic.Emph), # Emphasis
- (r'\[.*?\]_', String), # Footnote or citation
- (r'<.+?>', Name.Tag), # Hyperlink
- (r'[^\\\n\[*`:]+', Text),
- (r'.', Text),
- ],
- 'literal': [
- (r'[^`]+', String),
- (r'``' + end_string_suffix, String, '#pop'),
- (r'`', String),
- ]
- }
-
- def __init__(self, **options):
- self.handlecodeblocks = get_bool_opt(options, 'handlecodeblocks', True)
- RegexLexer.__init__(self, **options)
-
- def analyse_text(text):
- if text[:2] == '..' and text[2:3] != '.':
- return 0.3
- p1 = text.find("\n")
- p2 = text.find("\n", p1 + 1)
- if (p2 > -1 and # has two lines
- p1 * 2 + 1 == p2 and # they are the same length
- text[p1+1] in '-=' and # the next line both starts and ends with
- text[p1+1] == text[p2-1]): # ...a sufficiently high header
- return 0.5
-
-
-class TexLexer(RegexLexer):
- """
- Lexer for the TeX and LaTeX typesetting languages.
- """
-
- name = 'TeX'
- aliases = ['tex', 'latex']
- filenames = ['*.tex', '*.aux', '*.toc']
- mimetypes = ['text/x-tex', 'text/x-latex']
-
- tokens = {
- 'general': [
- (r'%.*?\n', Comment),
- (r'[{}]', Name.Builtin),
- (r'[&_^]', Name.Builtin),
- ],
- 'root': [
- (r'\\\[', String.Backtick, 'displaymath'),
- (r'\\\(', String, 'inlinemath'),
- (r'\$\$', String.Backtick, 'displaymath'),
- (r'\$', String, 'inlinemath'),
- (r'\\([a-zA-Z]+|.)', Keyword, 'command'),
- (r'\\$', Keyword),
- include('general'),
- (r'[^\\$%&_^{}]+', Text),
- ],
- 'math': [
- (r'\\([a-zA-Z]+|.)', Name.Variable),
- include('general'),
- (r'[0-9]+', Number),
- (r'[-=!+*/()\[\]]', Operator),
- (r'[^=!+*/()\[\]\\$%&_^{}0-9-]+', Name.Builtin),
- ],
- 'inlinemath': [
- (r'\\\)', String, '#pop'),
- (r'\$', String, '#pop'),
- include('math'),
- ],
- 'displaymath': [
- (r'\\\]', String, '#pop'),
- (r'\$\$', String, '#pop'),
- (r'\$', Name.Builtin),
- include('math'),
- ],
- 'command': [
- (r'\[.*?\]', Name.Attribute),
- (r'\*', Keyword),
- default('#pop'),
- ],
- }
-
- def analyse_text(text):
- for start in ("\\documentclass", "\\input", "\\documentstyle",
- "\\relax"):
- if text[:len(start)] == start:
- return True
-
-
-class GroffLexer(RegexLexer):
- """
- Lexer for the (g)roff typesetting language, supporting groff
- extensions. Mainly useful for highlighting manpage sources.
-
- .. versionadded:: 0.6
- """
-
- name = 'Groff'
- aliases = ['groff', 'nroff', 'man']
- filenames = ['*.[1234567]', '*.man']
- mimetypes = ['application/x-troff', 'text/troff']
-
- tokens = {
- 'root': [
- (r'(\.)(\w+)', bygroups(Text, Keyword), 'request'),
- (r'\.', Punctuation, 'request'),
- # Regular characters, slurp till we find a backslash or newline
- (r'[^\\\n]+', Text, 'textline'),
- default('textline'),
- ],
- 'textline': [
- include('escapes'),
- (r'[^\\\n]+', Text),
- (r'\n', Text, '#pop'),
- ],
- 'escapes': [
- # groff has many ways to write escapes.
- (r'\\"[^\n]*', Comment),
- (r'\\[fn]\w', String.Escape),
- (r'\\\(.{2}', String.Escape),
- (r'\\.\[.*\]', String.Escape),
- (r'\\.', String.Escape),
- (r'\\\n', Text, 'request'),
- ],
- 'request': [
- (r'\n', Text, '#pop'),
- include('escapes'),
- (r'"[^\n"]+"', String.Double),
- (r'\d+', Number),
- (r'\S+', String),
- (r'\s+', Text),
- ],
- }
-
- def analyse_text(text):
- if text[:1] != '.':
- return False
- if text[:3] == '.\\"':
- return True
- if text[:4] == '.TH ':
- return True
- if text[1:3].isalnum() and text[3].isspace():
- return 0.9
-
-
-class MozPreprocHashLexer(RegexLexer):
- """
- Lexer for Mozilla Preprocessor files (with '#' as the marker).
-
- Other data is left untouched.
-
- .. versionadded:: 2.0
- """
- name = 'mozhashpreproc'
- aliases = [name]
- filenames = []
- mimetypes = []
-
- tokens = {
- 'root': [
- (r'^#', Comment.Preproc, ('expr', 'exprstart')),
- (r'.+', Other),
- ],
- 'exprstart': [
- (r'(literal)(.*)', bygroups(Comment.Preproc, Text), '#pop:2'),
- (words((
- 'define', 'undef', 'if', 'ifdef', 'ifndef', 'else', 'elif',
- 'elifdef', 'elifndef', 'endif', 'expand', 'filter', 'unfilter',
- 'include', 'includesubst', 'error')),
- Comment.Preproc, '#pop'),
- ],
- 'expr': [
- (words(('!', '!=', '==', '&&', '||')), Operator),
- (r'(defined)(\()', bygroups(Keyword, Punctuation)),
- (r'\)', Punctuation),
- (r'[0-9]+', Number.Decimal),
- (r'__\w+?__', Name.Variable),
- (r'@\w+?@', Name.Class),
- (r'\w+', Name),
- (r'\n', Text, '#pop'),
- (r'\s+', Text),
- (r'\S', Punctuation),
- ],
- }
-
-
-class MozPreprocPercentLexer(MozPreprocHashLexer):
- """
- Lexer for Mozilla Preprocessor files (with '%' as the marker).
-
- Other data is left untouched.
-
- .. versionadded:: 2.0
- """
- name = 'mozpercentpreproc'
- aliases = [name]
- filenames = []
- mimetypes = []
-
- tokens = {
- 'root': [
- (r'^%', Comment.Preproc, ('expr', 'exprstart')),
- (r'.+', Other),
- ],
- }
-
-
-class MozPreprocXulLexer(DelegatingLexer):
- """
- Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the
- `XmlLexer`.
-
- .. versionadded:: 2.0
- """
- name = "XUL+mozpreproc"
- aliases = ['xul+mozpreproc']
- filenames = ['*.xul.in']
- mimetypes = []
-
- def __init__(self, **options):
- super(MozPreprocXulLexer, self).__init__(
- XmlLexer, MozPreprocHashLexer, **options)
-
-
-class MozPreprocJavascriptLexer(DelegatingLexer):
- """
- Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the
- `JavascriptLexer`.
-
- .. versionadded:: 2.0
- """
- name = "Javascript+mozpreproc"
- aliases = ['javascript+mozpreproc']
- filenames = ['*.js.in']
- mimetypes = []
-
- def __init__(self, **options):
- super(MozPreprocJavascriptLexer, self).__init__(
- JavascriptLexer, MozPreprocHashLexer, **options)
-
-
-class MozPreprocCssLexer(DelegatingLexer):
- """
- Subclass of the `MozPreprocHashLexer` that highlights unlexed data with the
- `CssLexer`.
-
- .. versionadded:: 2.0
- """
- name = "CSS+mozpreproc"
- aliases = ['css+mozpreproc']
- filenames = ['*.css.in']
- mimetypes = []
-
- def __init__(self, **options):
- super(MozPreprocCssLexer, self).__init__(
- CssLexer, MozPreprocPercentLexer, **options)
-
-
-class MarkdownLexer(RegexLexer):
- """
- For `Markdown <https://help.github.com/categories/writing-on-github/>`_ markup.
-
- .. versionadded:: 2.2
- """
- name = 'markdown'
- aliases = ['md']
- filenames = ['*.md']
- mimetypes = ["text/x-markdown"]
- flags = re.MULTILINE
-
- def _handle_codeblock(self, match):
- """
- match args: 1:backticks, 2:lang_name, 3:newline, 4:code, 5:backticks
- """
- from pygments.lexers import get_lexer_by_name
-
- # section header
- yield match.start(1), String , match.group(1)
- yield match.start(2), String , match.group(2)
- yield match.start(3), Text , match.group(3)
-
- # lookup lexer if wanted and existing
- lexer = None
- if self.handlecodeblocks:
- try:
- lexer = get_lexer_by_name( match.group(2).strip() )
- except ClassNotFound:
- pass
- code = match.group(4)
-
- # no lexer for this language. handle it like it was a code block
- if lexer is None:
- yield match.start(4), String, code
- else:
- for item in do_insertions([], lexer.get_tokens_unprocessed(code)):
- yield item
-
- yield match.start(5), String , match.group(5)
-
- tokens = {
- 'root': [
- # heading with pound prefix
- (r'^(#)([^#].+\n)', bygroups(Generic.Heading, Text)),
- (r'^(#{2,6})(.+\n)', bygroups(Generic.Subheading, Text)),
- # task list
- (r'^(\s*)([*-] )(\[[ xX]\])( .+\n)',
- bygroups(Text, Keyword, Keyword, using(this, state='inline'))),
- # bulleted lists
- (r'^(\s*)([*-])(\s)(.+\n)',
- bygroups(Text, Keyword, Text, using(this, state='inline'))),
- # numbered lists
- (r'^(\s*)([0-9]+\.)( .+\n)',
- bygroups(Text, Keyword, using(this, state='inline'))),
- # quote
- (r'^(\s*>\s)(.+\n)', bygroups(Keyword, Generic.Emph)),
- # text block
- (r'^(```\n)([\w\W]*?)(^```$)', bygroups(String, Text, String)),
- # code block with language
- (r'^(```)(\w+)(\n)([\w\W]*?)(^```$)', _handle_codeblock),
-
- include('inline'),
- ],
- 'inline': [
- # escape
- (r'\\.', Text),
- # italics
- (r'(\s)([*_][^*_]+[*_])(\W|\n)', bygroups(Text, Generic.Emph, Text)),
- # bold
- # warning: the following rule eats internal tags. eg. **foo _bar_ baz** bar is not italics
- (r'(\s)((\*\*|__).*\3)((?=\W|\n))', bygroups(Text, Generic.Strong, None, Text)),
- # "proper way" (r'(\s)([*_]{2}[^*_]+[*_]{2})((?=\W|\n))', bygroups(Text, Generic.Strong, Text)),
- # strikethrough
- (r'(\s)(~~[^~]+~~)((?=\W|\n))', bygroups(Text, Generic.Deleted, Text)),
- # inline code
- (r'`[^`]+`', String.Backtick),
- # mentions and topics (twitter and github stuff)
- (r'[@#][\w/:]+', Name.Entity),
- # (image?) links eg: ![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png)
- (r'(!?\[)([^]]+)(\])(\()([^)]+)(\))', bygroups(Text, Name.Tag, Text, Text, Name.Attribute, Text)),
- # reference-style links, e.g.:
- # [an example][id]
- # [id]: http://example.com/
- (r'(\[)([^]]+)(\])(\[)([^]]*)(\])', bygroups(Text, Name.Tag, Text, Text, Name.Label, Text)),
- (r'^(\s*\[)([^]]*)(\]:\s*)(.+)', bygroups(Text, Name.Label, Text, Name.Attribute)),
-
- # general text, must come last!
- (r'[^\\\s]+', Text),
- (r'.', Text),
- ],
- }
-
- def __init__(self, **options):
- self.handlecodeblocks = get_bool_opt(options, 'handlecodeblocks', True)
- RegexLexer.__init__(self, **options)
diff --git a/pygments/lexers/math.py b/pygments/lexers/math.py
deleted file mode 100644
index 73115082..00000000
--- a/pygments/lexers/math.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.math
- ~~~~~~~~~~~~~~~~~~~~
-
- Just export lexers that were contained in this module.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexers.python import NumPyLexer
-from pygments.lexers.matlab import MatlabLexer, MatlabSessionLexer, \
- OctaveLexer, ScilabLexer
-from pygments.lexers.julia import JuliaLexer, JuliaConsoleLexer
-from pygments.lexers.r import RConsoleLexer, SLexer, RdLexer
-from pygments.lexers.modeling import BugsLexer, JagsLexer, StanLexer
-from pygments.lexers.idl import IDLLexer
-from pygments.lexers.algebra import MuPADLexer
-
-__all__ = []
diff --git a/pygments/lexers/matlab.py b/pygments/lexers/matlab.py
deleted file mode 100644
index fd3897ad..00000000
--- a/pygments/lexers/matlab.py
+++ /dev/null
@@ -1,663 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.matlab
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Matlab and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic, Whitespace
-
-from pygments.lexers import _scilab_builtins
-
-__all__ = ['MatlabLexer', 'MatlabSessionLexer', 'OctaveLexer', 'ScilabLexer']
-
-
-class MatlabLexer(RegexLexer):
- """
- For Matlab source code.
-
- .. versionadded:: 0.10
- """
- name = 'Matlab'
- aliases = ['matlab']
- filenames = ['*.m']
- mimetypes = ['text/matlab']
-
- #
- # These lists are generated automatically.
- # Run the following in bash shell:
- #
- # for f in elfun specfun elmat; do
- # echo -n "$f = "
- # matlab -nojvm -r "help $f;exit;" | perl -ne \
- # 'push(@c,$1) if /^ (\w+)\s+-/; END {print q{["}.join(q{","},@c).qq{"]\n};}'
- # done
- #
- # elfun: Elementary math functions
- # specfun: Special Math functions
- # elmat: Elementary matrices and matrix manipulation
- #
- # taken from Matlab version 7.4.0.336 (R2007a)
- #
- elfun = ("sin", "sind", "sinh", "asin", "asind", "asinh", "cos", "cosd", "cosh",
- "acos", "acosd", "acosh", "tan", "tand", "tanh", "atan", "atand", "atan2",
- "atanh", "sec", "secd", "sech", "asec", "asecd", "asech", "csc", "cscd",
- "csch", "acsc", "acscd", "acsch", "cot", "cotd", "coth", "acot", "acotd",
- "acoth", "hypot", "exp", "expm1", "log", "log1p", "log10", "log2", "pow2",
- "realpow", "reallog", "realsqrt", "sqrt", "nthroot", "nextpow2", "abs",
- "angle", "complex", "conj", "imag", "real", "unwrap", "isreal", "cplxpair",
- "fix", "floor", "ceil", "round", "mod", "rem", "sign")
- specfun = ("airy", "besselj", "bessely", "besselh", "besseli", "besselk", "beta",
- "betainc", "betaln", "ellipj", "ellipke", "erf", "erfc", "erfcx",
- "erfinv", "expint", "gamma", "gammainc", "gammaln", "psi", "legendre",
- "cross", "dot", "factor", "isprime", "primes", "gcd", "lcm", "rat",
- "rats", "perms", "nchoosek", "factorial", "cart2sph", "cart2pol",
- "pol2cart", "sph2cart", "hsv2rgb", "rgb2hsv")
- elmat = ("zeros", "ones", "eye", "repmat", "rand", "randn", "linspace", "logspace",
- "freqspace", "meshgrid", "accumarray", "size", "length", "ndims", "numel",
- "disp", "isempty", "isequal", "isequalwithequalnans", "cat", "reshape",
- "diag", "blkdiag", "tril", "triu", "fliplr", "flipud", "flipdim", "rot90",
- "find", "end", "sub2ind", "ind2sub", "bsxfun", "ndgrid", "permute",
- "ipermute", "shiftdim", "circshift", "squeeze", "isscalar", "isvector",
- "ans", "eps", "realmax", "realmin", "pi", "i", "inf", "nan", "isnan",
- "isinf", "isfinite", "j", "why", "compan", "gallery", "hadamard", "hankel",
- "hilb", "invhilb", "magic", "pascal", "rosser", "toeplitz", "vander",
- "wilkinson")
-
- tokens = {
- 'root': [
- # line starting with '!' is sent as a system command. not sure what
- # label to use...
- (r'^!.*', String.Other),
- (r'%\{\s*\n', Comment.Multiline, 'blockcomment'),
- (r'%.*$', Comment),
- (r'^\s*function', Keyword, 'deffunc'),
-
- # from 'iskeyword' on version 7.11 (R2010):
- (words((
- 'break', 'case', 'catch', 'classdef', 'continue', 'else', 'elseif',
- 'end', 'enumerated', 'events', 'for', 'function', 'global', 'if',
- 'methods', 'otherwise', 'parfor', 'persistent', 'properties',
- 'return', 'spmd', 'switch', 'try', 'while'), suffix=r'\b'),
- Keyword),
-
- ("(" + "|".join(elfun + specfun + elmat) + r')\b', Name.Builtin),
-
- # line continuation with following comment:
- (r'\.\.\..*$', Comment),
-
- # operators:
- (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator),
- # operators requiring escape for re:
- (r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator),
-
- # punctuation:
- (r'\[|\]|\(|\)|\{|\}|:|@|\.|,', Punctuation),
- (r'=|:|;', Punctuation),
-
- # quote can be transpose, instead of string:
- # (not great, but handles common cases...)
- (r'(?<=[\w)\].])\'+', Operator),
-
- (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
- (r'\d+[eEf][+-]?[0-9]+', Number.Float),
- (r'\d+', Number.Integer),
-
- (r'(?<![\w)\].])\'', String, 'string'),
- (r'[a-zA-Z_]\w*', Name),
- (r'.', Text),
- ],
- 'string': [
- (r'[^\']*\'', String, '#pop')
- ],
- 'blockcomment': [
- (r'^\s*%\}', Comment.Multiline, '#pop'),
- (r'^.*\n', Comment.Multiline),
- (r'.', Comment.Multiline),
- ],
- 'deffunc': [
- (r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
- bygroups(Whitespace, Text, Whitespace, Punctuation,
- Whitespace, Name.Function, Punctuation, Text,
- Punctuation, Whitespace), '#pop'),
- # function with no args
- (r'(\s*)([a-zA-Z_]\w*)', bygroups(Text, Name.Function), '#pop'),
- ],
- }
-
- def analyse_text(text):
- if re.match(r'^\s*%', text, re.M): # comment
- return 0.2
- elif re.match(r'^!\w+', text, re.M): # system cmd
- return 0.2
-
-
-line_re = re.compile('.*?\n')
-
-
-class MatlabSessionLexer(Lexer):
- """
- For Matlab sessions. Modeled after PythonConsoleLexer.
- Contributed by Ken Schutte <kschutte@csail.mit.edu>.
-
- .. versionadded:: 0.10
- """
- name = 'Matlab session'
- aliases = ['matlabsession']
-
- def get_tokens_unprocessed(self, text):
- mlexer = MatlabLexer(**self.options)
-
- curcode = ''
- insertions = []
-
- for match in line_re.finditer(text):
- line = match.group()
-
- if line.startswith('>> '):
- insertions.append((len(curcode),
- [(0, Generic.Prompt, line[:3])]))
- curcode += line[3:]
-
- elif line.startswith('>>'):
- insertions.append((len(curcode),
- [(0, Generic.Prompt, line[:2])]))
- curcode += line[2:]
-
- elif line.startswith('???'):
-
- idx = len(curcode)
-
- # without is showing error on same line as before...?
- # line = "\n" + line
- token = (0, Generic.Traceback, line)
- insertions.append((idx, [token]))
-
- else:
- if curcode:
- for item in do_insertions(
- insertions, mlexer.get_tokens_unprocessed(curcode)):
- yield item
- curcode = ''
- insertions = []
-
- yield match.start(), Generic.Output, line
-
- if curcode: # or item:
- for item in do_insertions(
- insertions, mlexer.get_tokens_unprocessed(curcode)):
- yield item
-
-
-class OctaveLexer(RegexLexer):
- """
- For GNU Octave source code.
-
- .. versionadded:: 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
- (words((
- '__FILE__', '__LINE__', 'break', 'case', 'catch', 'classdef', 'continue', 'do', 'else',
- 'elseif', 'end', 'end_try_catch', 'end_unwind_protect', 'endclassdef',
- 'endevents', 'endfor', 'endfunction', 'endif', 'endmethods', 'endproperties',
- 'endswitch', 'endwhile', 'events', 'for', 'function', 'get', 'global', 'if', 'methods',
- 'otherwise', 'persistent', 'properties', 'return', 'set', 'static', 'switch', 'try',
- 'until', 'unwind_protect', 'unwind_protect_cleanup', 'while'), suffix=r'\b'),
- Keyword),
-
- (words(builtin_kw + command_kw + function_kw + loadable_kw + mapping_kw,
- suffix=r'\b'), Name.Builtin),
-
- (words(builtin_consts, suffix=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),
-
- (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
- (r'\d+[eEf][+-]?[0-9]+', Number.Float),
- (r'\d+', Number.Integer),
-
- # quote can be transpose, instead of string:
- # (not great, but handles common cases...)
- (r'(?<=[\w)\].])\'+', Operator),
- (r'(?<![\w)\].])\'', String, 'string'),
-
- (r'[a-zA-Z_]\w*', Name),
- (r'.', Text),
- ],
- 'string': [
- (r"[^']*'", String, '#pop'),
- ],
- 'deffunc': [
- (r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
- bygroups(Whitespace, Text, Whitespace, Punctuation,
- Whitespace, Name.Function, Punctuation, Text,
- Punctuation, Whitespace), '#pop'),
- # function with no args
- (r'(\s*)([a-zA-Z_]\w*)', bygroups(Text, Name.Function), '#pop'),
- ],
- }
-
-
-class ScilabLexer(RegexLexer):
- """
- For Scilab source code.
-
- .. versionadded:: 1.5
- """
- name = 'Scilab'
- aliases = ['scilab']
- filenames = ['*.sci', '*.sce', '*.tst']
- mimetypes = ['text/scilab']
-
- tokens = {
- 'root': [
- (r'//.*?$', Comment.Single),
- (r'^\s*function', Keyword, 'deffunc'),
-
- (words((
- '__FILE__', '__LINE__', 'break', 'case', 'catch', 'classdef', 'continue', 'do', 'else',
- 'elseif', 'end', 'end_try_catch', 'end_unwind_protect', 'endclassdef',
- 'endevents', 'endfor', 'endfunction', 'endif', 'endmethods', 'endproperties',
- 'endswitch', 'endwhile', 'events', 'for', 'function', 'get', 'global', 'if', 'methods',
- 'otherwise', 'persistent', 'properties', 'return', 'set', 'static', 'switch', 'try',
- 'until', 'unwind_protect', 'unwind_protect_cleanup', 'while'), suffix=r'\b'),
- Keyword),
-
- (words(_scilab_builtins.functions_kw +
- _scilab_builtins.commands_kw +
- _scilab_builtins.macros_kw, suffix=r'\b'), Name.Builtin),
-
- (words(_scilab_builtins.variables_kw, suffix=r'\b'), 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'),
-
- (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
- (r'\d+[eEf][+-]?[0-9]+', Number.Float),
- (r'\d+', Number.Integer),
-
- (r'[a-zA-Z_]\w*', Name),
- (r'.', Text),
- ],
- 'string': [
- (r"[^']*'", String, '#pop'),
- (r'.', String, '#pop'),
- ],
- 'deffunc': [
- (r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
- bygroups(Whitespace, Text, Whitespace, Punctuation,
- Whitespace, Name.Function, Punctuation, Text,
- Punctuation, Whitespace), '#pop'),
- # function with no args
- (r'(\s*)([a-zA-Z_]\w*)', bygroups(Text, Name.Function), '#pop'),
- ],
- }
diff --git a/pygments/lexers/ml.py b/pygments/lexers/ml.py
deleted file mode 100644
index aff8160d..00000000
--- a/pygments/lexers/ml.py
+++ /dev/null
@@ -1,769 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.ml
- ~~~~~~~~~~~~~~~~~~
-
- Lexers for ML family languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, default, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-
-__all__ = ['SMLLexer', 'OcamlLexer', 'OpaLexer']
-
-
-class SMLLexer(RegexLexer):
- """
- For the Standard ML language.
-
- .. versionadded:: 1.5
- """
-
- name = 'Standard ML'
- aliases = ['sml']
- filenames = ['*.sml', '*.sig', '*.fun']
- mimetypes = ['text/x-standardml', 'application/x-standardml']
-
- alphanumid_reserved = set((
- # 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 = set((
- # Core
- ':', r'\|', '=', '=>', '->', '#',
- # Modules
- ':>',
- ))
-
- nonid_reserved = set(('(', ')', '[', ']', '{', '}', ',', ';', '...', '_'))
-
- alphanumid_re = r"[a-zA-Z][\w']*"
- 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'\'[\w\']*', 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': [
- default('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),
- default('#pop'),
- ],
-
- # Dealing with what comes after the 'fun' (or 'and' or '|') keyword
- 'fname': [
- include('whitespace'),
- (r'\'[\w\']*', 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) = ..."
- default('#pop'),
- ],
-
- # Dealing with what comes after the 'val' (or 'and') keyword
- 'vname': [
- include('whitespace'),
- (r'\'[\w\']*', 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)'
- default('#pop'),
- ],
-
- # Dealing with what comes after the 'type' (or 'and') keyword
- 'tname': [
- include('whitespace'),
- include('breakout'),
-
- (r'\'[\w\']*', 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'\'[\w\']*', 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'\'[\w\']*', 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.
-
- .. versionadded:: 0.7
- """
-
- name = 'OCaml'
- aliases = ['ocaml']
- filenames = ['*.ml', '*.mli', '*.mll', '*.mly']
- mimetypes = ['text/x-ocaml']
-
- keywords = (
- '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', 'value', 'val', 'virtual', 'when', 'while', 'with',
- )
- keyopts = (
- '!=', '#', '&', '&&', r'\(', r'\)', r'\*', r'\+', ',', '-',
- r'-\.', '->', r'\.', r'\.\.', ':', '::', ':=', ':>', ';', ';;', '<',
- '<-', '=', '>', '>]', r'>\}', r'\?', r'\?\?', r'\[', r'\[<', r'\[>',
- r'\[\|', ']', '_', '`', r'\{', r'\{<', r'\|', r'\|]', r'\}', '~'
- )
-
- 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 = {
- '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][\w\']*)(?=\s*\.)', Name.Namespace, 'dotted'),
- (r'\b([A-Z][\w\']*)', Name.Class),
- (r'\(\*(?![)])', Comment, 'comment'),
- (r'\b(%s)\b' % '|'.join(keywords), Keyword),
- (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_]*(.[\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.Bin),
- (r'\d[\d_]*', Number.Integer),
-
- (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][\w\']*(?=\s*\.)', Name.Namespace),
- (r'[A-Z][\w\']*', Name.Class, '#pop'),
- (r'[a-z_][\w\']*', Name, '#pop'),
- default('#pop'),
- ],
- }
-
-
-class OpaLexer(RegexLexer):
- """
- Lexer for the Opa language (http://opalang.org).
-
- .. versionadded:: 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', 'case', 'client', 'css', 'database', 'db', 'do',
- 'else', 'end', 'external', 'forall', 'function', 'if', 'import',
- 'match', 'module', 'or', '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
- (words(keywords, prefix=r'\b', suffix=r'\b'), 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.Bin),
- (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),
- default(('#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
- default('#pop'),
- ],
-
- # type-with-slash is either:
- # * type-1
- # * type-1 (/ type-1)+
- 'type-with-slash': [
- include('comments-and-spaces'),
- default(('#pop', 'slash-type-1', 'type-1')),
- ],
- 'slash-type-1': [
- include('comments-and-spaces'),
- ('/', Keyword.Type, ('#pop', 'type-1')),
- # same remark as above
- default('#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')),
- default('#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
- default('#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'),
- # default(('#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 copy 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'[^"\'{`=<>]+', String.Single, '#pop'),
- (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'[^<{]+', String.Single),
- ],
-
- 'html-comment': [
- (r'-->', Comment, '#pop'),
- (r'[^\-]+|-', Comment),
- ],
- }
diff --git a/pygments/lexers/modeling.py b/pygments/lexers/modeling.py
deleted file mode 100644
index c03907ba..00000000
--- a/pygments/lexers/modeling.py
+++ /dev/null
@@ -1,366 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.modeling
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for modeling languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, using, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Whitespace
-
-from pygments.lexers.html import HtmlLexer
-from pygments.lexers import _stan_builtins
-
-__all__ = ['ModelicaLexer', 'BugsLexer', 'JagsLexer', 'StanLexer']
-
-
-class ModelicaLexer(RegexLexer):
- """
- For `Modelica <http://www.modelica.org/>`_ source code.
-
- .. versionadded:: 1.1
- """
- name = 'Modelica'
- aliases = ['modelica']
- filenames = ['*.mo']
- mimetypes = ['text/x-modelica']
-
- flags = re.DOTALL | re.MULTILINE
-
- _name = r"(?:'(?:[^\\']|\\.)+'|[a-zA-Z_]\w*)"
-
- tokens = {
- 'whitespace': [
- (u'[\\s\ufeff]+', Text),
- (r'//[^\n]*\n?', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline)
- ],
- 'root': [
- include('whitespace'),
- (r'"', String.Double, 'string'),
- (r'[()\[\]{},;]+', Punctuation),
- (r'\.?[*^/+-]|\.|<>|[<>:=]=?', Operator),
- (r'\d+(\.?\d*[eE][-+]?\d+|\.\d*)', Number.Float),
- (r'\d+', Number.Integer),
- (r'(abs|acos|actualStream|array|asin|assert|AssertionLevel|atan|'
- r'atan2|backSample|Boolean|cardinality|cat|ceil|change|Clock|'
- r'Connections|cos|cosh|cross|delay|diagonal|div|edge|exp|'
- r'ExternalObject|fill|floor|getInstanceName|hold|homotopy|'
- r'identity|inStream|integer|Integer|interval|inverse|isPresent|'
- r'linspace|log|log10|matrix|max|min|mod|ndims|noClock|noEvent|'
- r'ones|outerProduct|pre|previous|product|Real|reinit|rem|rooted|'
- r'sample|scalar|semiLinear|shiftSample|sign|sin|sinh|size|skew|'
- r'smooth|spatialDistribution|sqrt|StateSelect|String|subSample|'
- r'sum|superSample|symmetric|tan|tanh|terminal|terminate|time|'
- r'transpose|vector|zeros)\b', Name.Builtin),
- (r'(algorithm|annotation|break|connect|constant|constrainedby|der|'
- r'discrete|each|else|elseif|elsewhen|encapsulated|enumeration|'
- r'equation|exit|expandable|extends|external|final|flow|for|if|'
- r'import|impure|in|initial|inner|input|loop|nondiscrete|outer|'
- r'output|parameter|partial|protected|public|pure|redeclare|'
- r'replaceable|return|stream|then|when|while)\b',
- Keyword.Reserved),
- (r'(and|not|or)\b', Operator.Word),
- (r'(block|class|connector|end|function|model|operator|package|'
- r'record|type)\b', Keyword.Reserved, 'class'),
- (r'(false|true)\b', Keyword.Constant),
- (r'within\b', Keyword.Reserved, 'package-prefix'),
- (_name, Name)
- ],
- 'class': [
- include('whitespace'),
- (r'(function|record)\b', Keyword.Reserved),
- (r'(if|for|when|while)\b', Keyword.Reserved, '#pop'),
- (_name, Name.Class, '#pop'),
- default('#pop')
- ],
- 'package-prefix': [
- include('whitespace'),
- (_name, Name.Namespace, '#pop'),
- default('#pop')
- ],
- 'string': [
- (r'"', String.Double, '#pop'),
- (r'\\[\'"?\\abfnrtv]', String.Escape),
- (r'(?i)<\s*html\s*>([^\\"]|\\.)+?(<\s*/\s*html\s*>|(?="))',
- using(HtmlLexer)),
- (r'<|\\?[^"\\<]+', String.Double)
- ]
- }
-
-
-class BugsLexer(RegexLexer):
- """
- Pygments Lexer for `OpenBugs <http://www.openbugs.net/>`_ and WinBugs
- models.
-
- .. versionadded:: 1.6
- """
-
- name = 'BUGS'
- aliases = ['bugs', 'winbugs', 'openbugs']
- filenames = ['*.bug']
-
- _FUNCTIONS = (
- # Scalar functions
- 'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh',
- 'cloglog', 'cos', 'cosh', 'cumulative', 'cut', 'density', 'deviance',
- 'equals', 'expr', 'gammap', 'ilogit', 'icloglog', 'integral', 'log',
- 'logfact', 'loggam', 'logit', 'max', 'min', 'phi', 'post.p.value',
- 'pow', 'prior.p.value', 'probit', 'replicate.post', 'replicate.prior',
- 'round', 'sin', 'sinh', 'solution', 'sqrt', 'step', 'tan', 'tanh',
- 'trunc',
- # Vector functions
- 'inprod', 'interp.lin', 'inverse', 'logdet', 'mean', 'eigen.vals',
- 'ode', 'prod', 'p.valueM', 'rank', 'ranked', 'replicate.postM',
- 'sd', 'sort', 'sum',
- # Special
- 'D', 'I', 'F', 'T', 'C')
- """ OpenBUGS built-in functions
-
- From http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAII
-
- This also includes
-
- - T, C, I : Truncation and censoring.
- ``T`` and ``C`` are in OpenBUGS. ``I`` in WinBUGS.
- - D : ODE
- - F : Functional http://www.openbugs.info/Examples/Functionals.html
-
- """
-
- _DISTRIBUTIONS = ('dbern', 'dbin', 'dcat', 'dnegbin', 'dpois',
- 'dhyper', 'dbeta', 'dchisqr', 'ddexp', 'dexp',
- 'dflat', 'dgamma', 'dgev', 'df', 'dggamma', 'dgpar',
- 'dloglik', 'dlnorm', 'dlogis', 'dnorm', 'dpar',
- 'dt', 'dunif', 'dweib', 'dmulti', 'ddirch', 'dmnorm',
- 'dmt', 'dwish')
- """ OpenBUGS built-in distributions
-
- Functions from
- http://www.openbugs.info/Manuals/ModelSpecification.html#ContentsAI
- """
-
- tokens = {
- 'whitespace': [
- (r"\s+", Text),
- ],
- 'comments': [
- # Comments
- (r'#.*$', Comment.Single),
- ],
- 'root': [
- # Comments
- include('comments'),
- include('whitespace'),
- # Block start
- (r'(model)(\s+)(\{)',
- bygroups(Keyword.Namespace, Text, Punctuation)),
- # Reserved Words
- (r'(for|in)(?![\w.])', Keyword.Reserved),
- # Built-in Functions
- (r'(%s)(?=\s*\()'
- % r'|'.join(_FUNCTIONS + _DISTRIBUTIONS),
- Name.Builtin),
- # Regular variable names
- (r'[A-Za-z][\w.]*', Name),
- # Number Literals
- (r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number),
- # Punctuation
- (r'\[|\]|\(|\)|:|,|;', Punctuation),
- # Assignment operators
- # SLexer makes these tokens Operators.
- (r'<-|~', Operator),
- # Infix and prefix operators
- (r'\+|-|\*|/', Operator),
- # Block
- (r'[{}]', Punctuation),
- ]
- }
-
- def analyse_text(text):
- if re.search(r"^\s*model\s*{", text, re.M):
- return 0.7
- else:
- return 0.0
-
-
-class JagsLexer(RegexLexer):
- """
- Pygments Lexer for JAGS.
-
- .. versionadded:: 1.6
- """
-
- name = 'JAGS'
- aliases = ['jags']
- filenames = ['*.jag', '*.bug']
-
- # JAGS
- _FUNCTIONS = (
- 'abs', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctanh',
- 'cos', 'cosh', 'cloglog',
- 'equals', 'exp', 'icloglog', 'ifelse', 'ilogit', 'log', 'logfact',
- 'loggam', 'logit', 'phi', 'pow', 'probit', 'round', 'sin', 'sinh',
- 'sqrt', 'step', 'tan', 'tanh', 'trunc', 'inprod', 'interp.lin',
- 'logdet', 'max', 'mean', 'min', 'prod', 'sum', 'sd', 'inverse',
- 'rank', 'sort', 't', 'acos', 'acosh', 'asin', 'asinh', 'atan',
- # Truncation/Censoring (should I include)
- 'T', 'I')
- # Distributions with density, probability and quartile functions
- _DISTRIBUTIONS = tuple('[dpq]%s' % x for x in
- ('bern', 'beta', 'dchiqsqr', 'ddexp', 'dexp',
- 'df', 'gamma', 'gen.gamma', 'logis', 'lnorm',
- 'negbin', 'nchisqr', 'norm', 'par', 'pois', 'weib'))
- # Other distributions without density and probability
- _OTHER_DISTRIBUTIONS = (
- 'dt', 'dunif', 'dbetabin', 'dbern', 'dbin', 'dcat', 'dhyper',
- 'ddirch', 'dmnorm', 'dwish', 'dmt', 'dmulti', 'dbinom', 'dchisq',
- 'dnbinom', 'dweibull', 'ddirich')
-
- tokens = {
- 'whitespace': [
- (r"\s+", Text),
- ],
- 'names': [
- # Regular variable names
- (r'[a-zA-Z][\w.]*\b', Name),
- ],
- 'comments': [
- # do not use stateful comments
- (r'(?s)/\*.*?\*/', Comment.Multiline),
- # Comments
- (r'#.*$', Comment.Single),
- ],
- 'root': [
- # Comments
- include('comments'),
- include('whitespace'),
- # Block start
- (r'(model|data)(\s+)(\{)',
- bygroups(Keyword.Namespace, Text, Punctuation)),
- (r'var(?![\w.])', Keyword.Declaration),
- # Reserved Words
- (r'(for|in)(?![\w.])', Keyword.Reserved),
- # Builtins
- # Need to use lookahead because . is a valid char
- (r'(%s)(?=\s*\()' % r'|'.join(_FUNCTIONS
- + _DISTRIBUTIONS
- + _OTHER_DISTRIBUTIONS),
- Name.Builtin),
- # Names
- include('names'),
- # Number Literals
- (r'[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?', Number),
- (r'\[|\]|\(|\)|:|,|;', Punctuation),
- # Assignment operators
- (r'<-|~', Operator),
- # # JAGS includes many more than OpenBUGS
- (r'\+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%', Operator),
- (r'[{}]', Punctuation),
- ]
- }
-
- def analyse_text(text):
- if re.search(r'^\s*model\s*\{', text, re.M):
- if re.search(r'^\s*data\s*\{', text, re.M):
- return 0.9
- elif re.search(r'^\s*var', text, re.M):
- return 0.9
- else:
- return 0.3
- else:
- return 0
-
-
-class StanLexer(RegexLexer):
- """Pygments Lexer for Stan models.
-
- The Stan modeling language is specified in the *Stan Modeling Language
- User's Guide and Reference Manual, v2.17.0*,
- `pdf <https://github.com/stan-dev/stan/releases/download/v2.17.0/stan-reference-2.17.0.pdf>`__.
-
- .. versionadded:: 1.6
- """
-
- name = 'Stan'
- aliases = ['stan']
- filenames = ['*.stan']
-
- tokens = {
- 'whitespace': [
- (r"\s+", Text),
- ],
- 'comments': [
- (r'(?s)/\*.*?\*/', Comment.Multiline),
- # Comments
- (r'(//|#).*$', Comment.Single),
- ],
- 'root': [
- # Stan is more restrictive on strings than this regex
- (r'"[^"]*"', String),
- # Comments
- include('comments'),
- # block start
- include('whitespace'),
- # Block start
- (r'(%s)(\s*)(\{)' %
- r'|'.join(('functions', 'data', r'transformed\s+?data',
- 'parameters', r'transformed\s+parameters',
- 'model', r'generated\s+quantities')),
- bygroups(Keyword.Namespace, Text, Punctuation)),
- # target keyword
- (r'target\s*\+=', Keyword),
- # Reserved Words
- (r'(%s)\b' % r'|'.join(_stan_builtins.KEYWORDS), Keyword),
- # Truncation
- (r'T(?=\s*\[)', Keyword),
- # Data types
- (r'(%s)\b' % r'|'.join(_stan_builtins.TYPES), Keyword.Type),
- # < should be punctuation, but elsewhere I can't tell if it is in
- # a range constraint
- (r'(<)(\s*)(upper|lower)(\s*)(=)',
- bygroups(Operator, Whitespace, Keyword, Whitespace, Punctuation)),
- (r'(,)(\s*)(upper)(\s*)(=)',
- bygroups(Punctuation, Whitespace, Keyword, Whitespace, Punctuation)),
- # Punctuation
- (r"[;,\[\]()]", Punctuation),
- # Builtin
- (r'(%s)(?=\s*\()' % '|'.join(_stan_builtins.FUNCTIONS), Name.Builtin),
- (r'(~)(\s*)(%s)(?=\s*\()' % '|'.join(_stan_builtins.DISTRIBUTIONS),
- bygroups(Operator, Whitespace, Name.Builtin)),
- # Special names ending in __, like lp__
- (r'[A-Za-z]\w*__\b', Name.Builtin.Pseudo),
- (r'(%s)\b' % r'|'.join(_stan_builtins.RESERVED), Keyword.Reserved),
- # user-defined functions
- (r'[A-Za-z]\w*(?=\s*\()]', Name.Function),
- # Regular variable names
- (r'[A-Za-z]\w*\b', Name),
- # Real Literals
- (r'[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?', Number.Float),
- (r'\.[0-9]+([eE][+-]?[0-9]+)?', Number.Float),
- # Integer Literals
- (r'[0-9]+', Number.Integer),
- # Assignment operators
- (r'<-|(?:\+|-|\.?/|\.?\*|=)?=|~', Operator),
- # Infix, prefix and postfix operators (and = )
- (r"\+|-|\.?\*|\.?/|\\|'|\^|!=?|<=?|>=?|\|\||&&|%|\?|:", Operator),
- # Block delimiters
- (r'[{}]', Punctuation),
- # Distribution |
- (r'\|', Punctuation)
- ]
- }
-
- def analyse_text(text):
- if re.search(r'^\s*parameters\s*\{', text, re.M):
- return 1.0
- else:
- return 0.0
diff --git a/pygments/lexers/modula2.py b/pygments/lexers/modula2.py
deleted file mode 100644
index 4fd84dab..00000000
--- a/pygments/lexers/modula2.py
+++ /dev/null
@@ -1,1561 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.modula2
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Multi-Dialect Lexer for Modula-2.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include
-from pygments.util import get_bool_opt, get_list_opt
-from pygments.token import Text, Comment, Operator, Keyword, Name, \
- String, Number, Punctuation, Error
-
-__all__ = ['Modula2Lexer']
-
-
-# Multi-Dialect Modula-2 Lexer
-class Modula2Lexer(RegexLexer):
- """
- For `Modula-2 <http://www.modula2.org/>`_ source code.
-
- The Modula-2 lexer supports several dialects. By default, it operates in
- fallback mode, recognising the *combined* literals, punctuation symbols
- and operators of all supported dialects, and the *combined* reserved words
- and builtins of PIM Modula-2, ISO Modula-2 and Modula-2 R10, while not
- differentiating between library defined identifiers.
-
- To select a specific dialect, a dialect option may be passed
- or a dialect tag may be embedded into a source file.
-
- Dialect Options:
-
- `m2pim`
- Select PIM Modula-2 dialect.
- `m2iso`
- Select ISO Modula-2 dialect.
- `m2r10`
- Select Modula-2 R10 dialect.
- `objm2`
- Select Objective Modula-2 dialect.
-
- The PIM and ISO dialect options may be qualified with a language extension.
-
- Language Extensions:
-
- `+aglet`
- Select Aglet Modula-2 extensions, available with m2iso.
- `+gm2`
- Select GNU Modula-2 extensions, available with m2pim.
- `+p1`
- Select p1 Modula-2 extensions, available with m2iso.
- `+xds`
- Select XDS Modula-2 extensions, available with m2iso.
-
-
- Passing a Dialect Option via Unix Commandline Interface
-
- Dialect options may be passed to the lexer using the `dialect` key.
- Only one such option should be passed. If multiple dialect options are
- passed, the first valid option is used, any subsequent options are ignored.
-
- Examples:
-
- `$ pygmentize -O full,dialect=m2iso -f html -o /path/to/output /path/to/input`
- Use ISO dialect to render input to HTML output
- `$ pygmentize -O full,dialect=m2iso+p1 -f rtf -o /path/to/output /path/to/input`
- Use ISO dialect with p1 extensions to render input to RTF output
-
-
- Embedding a Dialect Option within a source file
-
- A dialect option may be embedded in a source file in form of a dialect
- tag, a specially formatted comment that specifies a dialect option.
-
- Dialect Tag EBNF::
-
- dialectTag :
- OpeningCommentDelim Prefix dialectOption ClosingCommentDelim ;
-
- dialectOption :
- 'm2pim' | 'm2iso' | 'm2r10' | 'objm2' |
- 'm2iso+aglet' | 'm2pim+gm2' | 'm2iso+p1' | 'm2iso+xds' ;
-
- Prefix : '!' ;
-
- OpeningCommentDelim : '(*' ;
-
- ClosingCommentDelim : '*)' ;
-
- No whitespace is permitted between the tokens of a dialect tag.
-
- In the event that a source file contains multiple dialect tags, the first
- tag that contains a valid dialect option will be used and any subsequent
- dialect tags will be ignored. Ideally, a dialect tag should be placed
- at the beginning of a source file.
-
- An embedded dialect tag overrides a dialect option set via command line.
-
- Examples:
-
- ``(*!m2r10*) DEFINITION MODULE Foobar; ...``
- Use Modula2 R10 dialect to render this source file.
- ``(*!m2pim+gm2*) DEFINITION MODULE Bazbam; ...``
- Use PIM dialect with GNU extensions to render this source file.
-
-
- Algol Publication Mode:
-
- In Algol publication mode, source text is rendered for publication of
- algorithms in scientific papers and academic texts, following the format
- of the Revised Algol-60 Language Report. It is activated by passing
- one of two corresponding styles as an option:
-
- `algol`
- render reserved words lowercase underline boldface
- and builtins lowercase boldface italic
- `algol_nu`
- render reserved words lowercase boldface (no underlining)
- and builtins lowercase boldface italic
-
- The lexer automatically performs the required lowercase conversion when
- this mode is activated.
-
- Example:
-
- ``$ pygmentize -O full,style=algol -f latex -o /path/to/output /path/to/input``
- Render input file in Algol publication mode to LaTeX output.
-
-
- Rendering Mode of First Class ADT Identifiers:
-
- The rendering of standard library first class ADT identifiers is controlled
- by option flag "treat_stdlib_adts_as_builtins".
-
- When this option is turned on, standard library ADT identifiers are rendered
- as builtins. When it is turned off, they are rendered as ordinary library
- identifiers.
-
- `treat_stdlib_adts_as_builtins` (default: On)
-
- The option is useful for dialects that support ADTs as first class objects
- and provide ADTs in the standard library that would otherwise be built-in.
-
- At present, only Modula-2 R10 supports library ADTs as first class objects
- and therefore, no ADT identifiers are defined for any other dialects.
-
- Example:
-
- ``$ pygmentize -O full,dialect=m2r10,treat_stdlib_adts_as_builtins=Off ...``
- Render standard library ADTs as ordinary library types.
-
- .. versionadded:: 1.3
-
- .. versionchanged:: 2.1
- Added multi-dialect support.
- """
- name = 'Modula-2'
- aliases = ['modula2', 'm2']
- filenames = ['*.def', '*.mod']
- mimetypes = ['text/x-modula2']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'whitespace': [
- (r'\n+', Text), # blank lines
- (r'\s+', Text), # whitespace
- ],
- 'dialecttags': [
- # PIM Dialect Tag
- (r'\(\*!m2pim\*\)', Comment.Special),
- # ISO Dialect Tag
- (r'\(\*!m2iso\*\)', Comment.Special),
- # M2R10 Dialect Tag
- (r'\(\*!m2r10\*\)', Comment.Special),
- # ObjM2 Dialect Tag
- (r'\(\*!objm2\*\)', Comment.Special),
- # Aglet Extensions Dialect Tag
- (r'\(\*!m2iso\+aglet\*\)', Comment.Special),
- # GNU Extensions Dialect Tag
- (r'\(\*!m2pim\+gm2\*\)', Comment.Special),
- # p1 Extensions Dialect Tag
- (r'\(\*!m2iso\+p1\*\)', Comment.Special),
- # XDS Extensions Dialect Tag
- (r'\(\*!m2iso\+xds\*\)', Comment.Special),
- ],
- 'identifiers': [
- (r'([a-zA-Z_$][\w$]*)', Name),
- ],
- 'prefixed_number_literals': [
- #
- # Base-2, whole number
- (r'0b[01]+(\'[01]+)*', Number.Bin),
- #
- # Base-16, whole number
- (r'0[ux][0-9A-F]+(\'[0-9A-F]+)*', Number.Hex),
- ],
- 'plain_number_literals': [
- #
- # Base-10, real number with exponent
- (r'[0-9]+(\'[0-9]+)*' # integral part
- r'\.[0-9]+(\'[0-9]+)*' # fractional part
- r'[eE][+-]?[0-9]+(\'[0-9]+)*', # exponent
- Number.Float),
- #
- # Base-10, real number without exponent
- (r'[0-9]+(\'[0-9]+)*' # integral part
- r'\.[0-9]+(\'[0-9]+)*', # fractional part
- Number.Float),
- #
- # Base-10, whole number
- (r'[0-9]+(\'[0-9]+)*', Number.Integer),
- ],
- 'suffixed_number_literals': [
- #
- # Base-8, whole number
- (r'[0-7]+B', Number.Oct),
- #
- # Base-8, character code
- (r'[0-7]+C', Number.Oct),
- #
- # Base-16, number
- (r'[0-9A-F]+H', Number.Hex),
- ],
- 'string_literals': [
- (r"'(\\\\|\\'|[^'])*'", String), # single quoted string
- (r'"(\\\\|\\"|[^"])*"', String), # double quoted string
- ],
- 'digraph_operators': [
- # Dot Product Operator
- (r'\*\.', Operator),
- # Array Concatenation Operator
- (r'\+>', Operator), # M2R10 + ObjM2
- # Inequality Operator
- (r'<>', Operator), # ISO + PIM
- # Less-Or-Equal, Subset
- (r'<=', Operator),
- # Greater-Or-Equal, Superset
- (r'>=', Operator),
- # Identity Operator
- (r'==', Operator), # M2R10 + ObjM2
- # Type Conversion Operator
- (r'::', Operator), # M2R10 + ObjM2
- # Assignment Symbol
- (r':=', Operator),
- # Postfix Increment Mutator
- (r'\+\+', Operator), # M2R10 + ObjM2
- # Postfix Decrement Mutator
- (r'--', Operator), # M2R10 + ObjM2
- ],
- 'unigraph_operators': [
- # Arithmetic Operators
- (r'[+-]', Operator),
- (r'[*/]', Operator),
- # ISO 80000-2 compliant Set Difference Operator
- (r'\\', Operator), # M2R10 + ObjM2
- # Relational Operators
- (r'[=#<>]', Operator),
- # Dereferencing Operator
- (r'\^', Operator),
- # Dereferencing Operator Synonym
- (r'@', Operator), # ISO
- # Logical AND Operator Synonym
- (r'&', Operator), # PIM + ISO
- # Logical NOT Operator Synonym
- (r'~', Operator), # PIM + ISO
- # Smalltalk Message Prefix
- (r'`', Operator), # ObjM2
- ],
- 'digraph_punctuation': [
- # Range Constructor
- (r'\.\.', Punctuation),
- # Opening Chevron Bracket
- (r'<<', Punctuation), # M2R10 + ISO
- # Closing Chevron Bracket
- (r'>>', Punctuation), # M2R10 + ISO
- # Blueprint Punctuation
- (r'->', Punctuation), # M2R10 + ISO
- # Distinguish |# and # in M2 R10
- (r'\|#', Punctuation),
- # Distinguish ## and # in M2 R10
- (r'##', Punctuation),
- # Distinguish |* and * in M2 R10
- (r'\|\*', Punctuation),
- ],
- 'unigraph_punctuation': [
- # Common Punctuation
- (r'[()\[\]{},.:;|]', Punctuation),
- # Case Label Separator Synonym
- (r'!', Punctuation), # ISO
- # Blueprint Punctuation
- (r'\?', Punctuation), # M2R10 + ObjM2
- ],
- 'comments': [
- # Single Line Comment
- (r'^//.*?\n', Comment.Single), # M2R10 + ObjM2
- # Block Comment
- (r'\(\*([^$].*?)\*\)', Comment.Multiline),
- # Template Block Comment
- (r'/\*(.*?)\*/', Comment.Multiline), # M2R10 + ObjM2
- ],
- 'pragmas': [
- # ISO Style Pragmas
- (r'<\*.*?\*>', Comment.Preproc), # ISO, M2R10 + ObjM2
- # Pascal Style Pragmas
- (r'\(\*\$.*?\*\)', Comment.Preproc), # PIM
- ],
- 'root': [
- include('whitespace'),
- include('dialecttags'),
- include('pragmas'),
- include('comments'),
- include('identifiers'),
- include('suffixed_number_literals'), # PIM + ISO
- include('prefixed_number_literals'), # M2R10 + ObjM2
- include('plain_number_literals'),
- include('string_literals'),
- include('digraph_punctuation'),
- include('digraph_operators'),
- include('unigraph_punctuation'),
- include('unigraph_operators'),
- ]
- }
-
-# C o m m o n D a t a s e t s
-
- # Common Reserved Words Dataset
- common_reserved_words = (
- # 37 common reserved words
- 'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', 'DIV',
- 'DO', 'ELSE', 'ELSIF', 'END', 'EXIT', 'FOR', 'FROM', 'IF',
- 'IMPLEMENTATION', 'IMPORT', 'IN', 'LOOP', 'MOD', 'MODULE', 'NOT',
- 'OF', 'OR', 'POINTER', 'PROCEDURE', 'RECORD', 'REPEAT', 'RETURN',
- 'SET', 'THEN', 'TO', 'TYPE', 'UNTIL', 'VAR', 'WHILE',
- )
-
- # Common Builtins Dataset
- common_builtins = (
- # 16 common builtins
- 'ABS', 'BOOLEAN', 'CARDINAL', 'CHAR', 'CHR', 'FALSE', 'INTEGER',
- 'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NIL', 'ODD', 'ORD', 'REAL',
- 'TRUE',
- )
-
- # Common Pseudo-Module Builtins Dataset
- common_pseudo_builtins = (
- # 4 common pseudo builtins
- 'ADDRESS', 'BYTE', 'WORD', 'ADR'
- )
-
-# P I M M o d u l a - 2 D a t a s e t s
-
- # Lexemes to Mark as Error Tokens for PIM Modula-2
- pim_lexemes_to_reject = (
- '!', '`', '@', '$', '%', '?', '\\', '==', '++', '--', '::', '*.',
- '+>', '->', '<<', '>>', '|#', '##',
- )
-
- # PIM Modula-2 Additional Reserved Words Dataset
- pim_additional_reserved_words = (
- # 3 additional reserved words
- 'EXPORT', 'QUALIFIED', 'WITH',
- )
-
- # PIM Modula-2 Additional Builtins Dataset
- pim_additional_builtins = (
- # 16 additional builtins
- 'BITSET', 'CAP', 'DEC', 'DISPOSE', 'EXCL', 'FLOAT', 'HALT', 'HIGH',
- 'INC', 'INCL', 'NEW', 'NIL', 'PROC', 'SIZE', 'TRUNC', 'VAL',
- )
-
- # PIM Modula-2 Additional Pseudo-Module Builtins Dataset
- pim_additional_pseudo_builtins = (
- # 5 additional pseudo builtins
- 'SYSTEM', 'PROCESS', 'TSIZE', 'NEWPROCESS', 'TRANSFER',
- )
-
-# I S O M o d u l a - 2 D a t a s e t s
-
- # Lexemes to Mark as Error Tokens for ISO Modula-2
- iso_lexemes_to_reject = (
- '`', '$', '%', '?', '\\', '==', '++', '--', '::', '*.', '+>', '->',
- '<<', '>>', '|#', '##',
- )
-
- # ISO Modula-2 Additional Reserved Words Dataset
- iso_additional_reserved_words = (
- # 9 additional reserved words (ISO 10514-1)
- 'EXCEPT', 'EXPORT', 'FINALLY', 'FORWARD', 'PACKEDSET', 'QUALIFIED',
- 'REM', 'RETRY', 'WITH',
- # 10 additional reserved words (ISO 10514-2 & ISO 10514-3)
- 'ABSTRACT', 'AS', 'CLASS', 'GUARD', 'INHERIT', 'OVERRIDE', 'READONLY',
- 'REVEAL', 'TRACED', 'UNSAFEGUARDED',
- )
-
- # ISO Modula-2 Additional Builtins Dataset
- iso_additional_builtins = (
- # 26 additional builtins (ISO 10514-1)
- 'BITSET', 'CAP', 'CMPLX', 'COMPLEX', 'DEC', 'DISPOSE', 'EXCL', 'FLOAT',
- 'HALT', 'HIGH', 'IM', 'INC', 'INCL', 'INT', 'INTERRUPTIBLE', 'LENGTH',
- 'LFLOAT', 'LONGCOMPLEX', 'NEW', 'PROC', 'PROTECTION', 'RE', 'SIZE',
- 'TRUNC', 'UNINTERRUBTIBLE', 'VAL',
- # 5 additional builtins (ISO 10514-2 & ISO 10514-3)
- 'CREATE', 'DESTROY', 'EMPTY', 'ISMEMBER', 'SELF',
- )
-
- # ISO Modula-2 Additional Pseudo-Module Builtins Dataset
- iso_additional_pseudo_builtins = (
- # 14 additional builtins (SYSTEM)
- 'SYSTEM', 'BITSPERLOC', 'LOCSPERBYTE', 'LOCSPERWORD', 'LOC',
- 'ADDADR', 'SUBADR', 'DIFADR', 'MAKEADR', 'ADR',
- 'ROTATE', 'SHIFT', 'CAST', 'TSIZE',
- # 13 additional builtins (COROUTINES)
- 'COROUTINES', 'ATTACH', 'COROUTINE', 'CURRENT', 'DETACH', 'HANDLER',
- 'INTERRUPTSOURCE', 'IOTRANSFER', 'IsATTACHED', 'LISTEN',
- 'NEWCOROUTINE', 'PROT', 'TRANSFER',
- # 9 additional builtins (EXCEPTIONS)
- 'EXCEPTIONS', 'AllocateSource', 'CurrentNumber', 'ExceptionNumber',
- 'ExceptionSource', 'GetMessage', 'IsCurrentSource',
- 'IsExceptionalExecution', 'RAISE',
- # 3 additional builtins (TERMINATION)
- 'TERMINATION', 'IsTerminating', 'HasHalted',
- # 4 additional builtins (M2EXCEPTION)
- 'M2EXCEPTION', 'M2Exceptions', 'M2Exception', 'IsM2Exception',
- 'indexException', 'rangeException', 'caseSelectException',
- 'invalidLocation', 'functionException', 'wholeValueException',
- 'wholeDivException', 'realValueException', 'realDivException',
- 'complexValueException', 'complexDivException', 'protException',
- 'sysException', 'coException', 'exException',
- )
-
-# M o d u l a - 2 R 1 0 D a t a s e t s
-
- # Lexemes to Mark as Error Tokens for Modula-2 R10
- m2r10_lexemes_to_reject = (
- '!', '`', '@', '$', '%', '&', '<>',
- )
-
- # Modula-2 R10 reserved words in addition to the common set
- m2r10_additional_reserved_words = (
- # 12 additional reserved words
- 'ALIAS', 'ARGLIST', 'BLUEPRINT', 'COPY', 'GENLIB', 'INDETERMINATE',
- 'NEW', 'NONE', 'OPAQUE', 'REFERENTIAL', 'RELEASE', 'RETAIN',
- # 2 additional reserved words with symbolic assembly option
- 'ASM', 'REG',
- )
-
- # Modula-2 R10 builtins in addition to the common set
- m2r10_additional_builtins = (
- # 26 additional builtins
- 'CARDINAL', 'COUNT', 'EMPTY', 'EXISTS', 'INSERT', 'LENGTH', 'LONGCARD',
- 'OCTET', 'PTR', 'PRED', 'READ', 'READNEW', 'REMOVE', 'RETRIEVE', 'SORT',
- 'STORE', 'SUBSET', 'SUCC', 'TLIMIT', 'TMAX', 'TMIN', 'TRUE', 'TSIZE',
- 'UNICHAR', 'WRITE', 'WRITEF',
- )
-
- # Modula-2 R10 Additional Pseudo-Module Builtins Dataset
- m2r10_additional_pseudo_builtins = (
- # 13 additional builtins (TPROPERTIES)
- 'TPROPERTIES', 'PROPERTY', 'LITERAL', 'TPROPERTY', 'TLITERAL',
- 'TBUILTIN', 'TDYN', 'TREFC', 'TNIL', 'TBASE', 'TPRECISION',
- 'TMAXEXP', 'TMINEXP',
- # 4 additional builtins (CONVERSION)
- 'CONVERSION', 'TSXFSIZE', 'SXF', 'VAL',
- # 35 additional builtins (UNSAFE)
- 'UNSAFE', 'CAST', 'INTRINSIC', 'AVAIL', 'ADD', 'SUB', 'ADDC', 'SUBC',
- 'FETCHADD', 'FETCHSUB', 'SHL', 'SHR', 'ASHR', 'ROTL', 'ROTR', 'ROTLC',
- 'ROTRC', 'BWNOT', 'BWAND', 'BWOR', 'BWXOR', 'BWNAND', 'BWNOR',
- 'SETBIT', 'TESTBIT', 'LSBIT', 'MSBIT', 'CSBITS', 'BAIL', 'HALT',
- 'TODO', 'FFI', 'ADDR', 'VARGLIST', 'VARGC',
- # 11 additional builtins (ATOMIC)
- 'ATOMIC', 'INTRINSIC', 'AVAIL', 'SWAP', 'CAS', 'INC', 'DEC', 'BWAND',
- 'BWNAND', 'BWOR', 'BWXOR',
- # 7 additional builtins (COMPILER)
- 'COMPILER', 'DEBUG', 'MODNAME', 'PROCNAME', 'LINENUM', 'DEFAULT',
- 'HASH',
- # 5 additional builtins (ASSEMBLER)
- 'ASSEMBLER', 'REGISTER', 'SETREG', 'GETREG', 'CODE',
- )
-
-# O b j e c t i v e M o d u l a - 2 D a t a s e t s
-
- # Lexemes to Mark as Error Tokens for Objective Modula-2
- objm2_lexemes_to_reject = (
- '!', '$', '%', '&', '<>',
- )
-
- # Objective Modula-2 Extensions
- # reserved words in addition to Modula-2 R10
- objm2_additional_reserved_words = (
- # 16 additional reserved words
- 'BYCOPY', 'BYREF', 'CLASS', 'CONTINUE', 'CRITICAL', 'INOUT', 'METHOD',
- 'ON', 'OPTIONAL', 'OUT', 'PRIVATE', 'PROTECTED', 'PROTOCOL', 'PUBLIC',
- 'SUPER', 'TRY',
- )
-
- # Objective Modula-2 Extensions
- # builtins in addition to Modula-2 R10
- objm2_additional_builtins = (
- # 3 additional builtins
- 'OBJECT', 'NO', 'YES',
- )
-
- # Objective Modula-2 Extensions
- # pseudo-module builtins in addition to Modula-2 R10
- objm2_additional_pseudo_builtins = (
- # None
- )
-
-# A g l e t M o d u l a - 2 D a t a s e t s
-
- # Aglet Extensions
- # reserved words in addition to ISO Modula-2
- aglet_additional_reserved_words = (
- # None
- )
-
- # Aglet Extensions
- # builtins in addition to ISO Modula-2
- aglet_additional_builtins = (
- # 9 additional builtins
- 'BITSET8', 'BITSET16', 'BITSET32', 'CARDINAL8', 'CARDINAL16',
- 'CARDINAL32', 'INTEGER8', 'INTEGER16', 'INTEGER32',
- )
-
- # Aglet Modula-2 Extensions
- # pseudo-module builtins in addition to ISO Modula-2
- aglet_additional_pseudo_builtins = (
- # None
- )
-
-# G N U M o d u l a - 2 D a t a s e t s
-
- # GNU Extensions
- # reserved words in addition to PIM Modula-2
- gm2_additional_reserved_words = (
- # 10 additional reserved words
- 'ASM', '__ATTRIBUTE__', '__BUILTIN__', '__COLUMN__', '__DATE__',
- '__FILE__', '__FUNCTION__', '__LINE__', '__MODULE__', 'VOLATILE',
- )
-
- # GNU Extensions
- # builtins in addition to PIM Modula-2
- gm2_additional_builtins = (
- # 21 additional builtins
- 'BITSET8', 'BITSET16', 'BITSET32', 'CARDINAL8', 'CARDINAL16',
- 'CARDINAL32', 'CARDINAL64', 'COMPLEX32', 'COMPLEX64', 'COMPLEX96',
- 'COMPLEX128', 'INTEGER8', 'INTEGER16', 'INTEGER32', 'INTEGER64',
- 'REAL8', 'REAL16', 'REAL32', 'REAL96', 'REAL128', 'THROW',
- )
-
- # GNU Extensions
- # pseudo-module builtins in addition to PIM Modula-2
- gm2_additional_pseudo_builtins = (
- # None
- )
-
-# p 1 M o d u l a - 2 D a t a s e t s
-
- # p1 Extensions
- # reserved words in addition to ISO Modula-2
- p1_additional_reserved_words = (
- # None
- )
-
- # p1 Extensions
- # builtins in addition to ISO Modula-2
- p1_additional_builtins = (
- # None
- )
-
- # p1 Modula-2 Extensions
- # pseudo-module builtins in addition to ISO Modula-2
- p1_additional_pseudo_builtins = (
- # 1 additional builtin
- 'BCD',
- )
-
-# X D S M o d u l a - 2 D a t a s e t s
-
- # XDS Extensions
- # reserved words in addition to ISO Modula-2
- xds_additional_reserved_words = (
- # 1 additional reserved word
- 'SEQ',
- )
-
- # XDS Extensions
- # builtins in addition to ISO Modula-2
- xds_additional_builtins = (
- # 9 additional builtins
- 'ASH', 'ASSERT', 'DIFFADR_TYPE', 'ENTIER', 'INDEX', 'LEN',
- 'LONGCARD', 'SHORTCARD', 'SHORTINT',
- )
-
- # XDS Modula-2 Extensions
- # pseudo-module builtins in addition to ISO Modula-2
- xds_additional_pseudo_builtins = (
- # 22 additional builtins (SYSTEM)
- 'PROCESS', 'NEWPROCESS', 'BOOL8', 'BOOL16', 'BOOL32', 'CARD8',
- 'CARD16', 'CARD32', 'INT8', 'INT16', 'INT32', 'REF', 'MOVE',
- 'FILL', 'GET', 'PUT', 'CC', 'int', 'unsigned', 'size_t', 'void'
- # 3 additional builtins (COMPILER)
- 'COMPILER', 'OPTION', 'EQUATION'
- )
-
-# P I M S t a n d a r d L i b r a r y D a t a s e t s
-
- # PIM Modula-2 Standard Library Modules Dataset
- pim_stdlib_module_identifiers = (
- 'Terminal', 'FileSystem', 'InOut', 'RealInOut', 'MathLib0', 'Storage',
- )
-
- # PIM Modula-2 Standard Library Types Dataset
- pim_stdlib_type_identifiers = (
- 'Flag', 'FlagSet', 'Response', 'Command', 'Lock', 'Permission',
- 'MediumType', 'File', 'FileProc', 'DirectoryProc', 'FileCommand',
- 'DirectoryCommand',
- )
-
- # PIM Modula-2 Standard Library Procedures Dataset
- pim_stdlib_proc_identifiers = (
- 'Read', 'BusyRead', 'ReadAgain', 'Write', 'WriteString', 'WriteLn',
- 'Create', 'Lookup', 'Close', 'Delete', 'Rename', 'SetRead', 'SetWrite',
- 'SetModify', 'SetOpen', 'Doio', 'SetPos', 'GetPos', 'Length', 'Reset',
- 'Again', 'ReadWord', 'WriteWord', 'ReadChar', 'WriteChar',
- 'CreateMedium', 'DeleteMedium', 'AssignName', 'DeassignName',
- 'ReadMedium', 'LookupMedium', 'OpenInput', 'OpenOutput', 'CloseInput',
- 'CloseOutput', 'ReadString', 'ReadInt', 'ReadCard', 'ReadWrd',
- 'WriteInt', 'WriteCard', 'WriteOct', 'WriteHex', 'WriteWrd',
- 'ReadReal', 'WriteReal', 'WriteFixPt', 'WriteRealOct', 'sqrt', 'exp',
- 'ln', 'sin', 'cos', 'arctan', 'entier', 'ALLOCATE', 'DEALLOCATE',
- )
-
- # PIM Modula-2 Standard Library Variables Dataset
- pim_stdlib_var_identifiers = (
- 'Done', 'termCH', 'in', 'out'
- )
-
- # PIM Modula-2 Standard Library Constants Dataset
- pim_stdlib_const_identifiers = (
- 'EOL',
- )
-
-# I S O S t a n d a r d L i b r a r y D a t a s e t s
-
- # ISO Modula-2 Standard Library Modules Dataset
- iso_stdlib_module_identifiers = (
- # TO DO
- )
-
- # ISO Modula-2 Standard Library Types Dataset
- iso_stdlib_type_identifiers = (
- # TO DO
- )
-
- # ISO Modula-2 Standard Library Procedures Dataset
- iso_stdlib_proc_identifiers = (
- # TO DO
- )
-
- # ISO Modula-2 Standard Library Variables Dataset
- iso_stdlib_var_identifiers = (
- # TO DO
- )
-
- # ISO Modula-2 Standard Library Constants Dataset
- iso_stdlib_const_identifiers = (
- # TO DO
- )
-
-# M 2 R 1 0 S t a n d a r d L i b r a r y D a t a s e t s
-
- # Modula-2 R10 Standard Library ADTs Dataset
- m2r10_stdlib_adt_identifiers = (
- 'BCD', 'LONGBCD', 'BITSET', 'SHORTBITSET', 'LONGBITSET',
- 'LONGLONGBITSET', 'COMPLEX', 'LONGCOMPLEX', 'SHORTCARD', 'LONGLONGCARD',
- 'SHORTINT', 'LONGLONGINT', 'POSINT', 'SHORTPOSINT', 'LONGPOSINT',
- 'LONGLONGPOSINT', 'BITSET8', 'BITSET16', 'BITSET32', 'BITSET64',
- 'BITSET128', 'BS8', 'BS16', 'BS32', 'BS64', 'BS128', 'CARDINAL8',
- 'CARDINAL16', 'CARDINAL32', 'CARDINAL64', 'CARDINAL128', 'CARD8',
- 'CARD16', 'CARD32', 'CARD64', 'CARD128', 'INTEGER8', 'INTEGER16',
- 'INTEGER32', 'INTEGER64', 'INTEGER128', 'INT8', 'INT16', 'INT32',
- 'INT64', 'INT128', 'STRING', 'UNISTRING',
- )
-
- # Modula-2 R10 Standard Library Blueprints Dataset
- m2r10_stdlib_blueprint_identifiers = (
- 'ProtoRoot', 'ProtoComputational', 'ProtoNumeric', 'ProtoScalar',
- 'ProtoNonScalar', 'ProtoCardinal', 'ProtoInteger', 'ProtoReal',
- 'ProtoComplex', 'ProtoVector', 'ProtoTuple', 'ProtoCompArray',
- 'ProtoCollection', 'ProtoStaticArray', 'ProtoStaticSet',
- 'ProtoStaticString', 'ProtoArray', 'ProtoString', 'ProtoSet',
- 'ProtoMultiSet', 'ProtoDictionary', 'ProtoMultiDict', 'ProtoExtension',
- 'ProtoIO', 'ProtoCardMath', 'ProtoIntMath', 'ProtoRealMath',
- )
-
- # Modula-2 R10 Standard Library Modules Dataset
- m2r10_stdlib_module_identifiers = (
- 'ASCII', 'BooleanIO', 'CharIO', 'UnicharIO', 'OctetIO',
- 'CardinalIO', 'LongCardIO', 'IntegerIO', 'LongIntIO', 'RealIO',
- 'LongRealIO', 'BCDIO', 'LongBCDIO', 'CardMath', 'LongCardMath',
- 'IntMath', 'LongIntMath', 'RealMath', 'LongRealMath', 'BCDMath',
- 'LongBCDMath', 'FileIO', 'FileSystem', 'Storage', 'IOSupport',
- )
-
- # Modula-2 R10 Standard Library Types Dataset
- m2r10_stdlib_type_identifiers = (
- 'File', 'Status',
- # TO BE COMPLETED
- )
-
- # Modula-2 R10 Standard Library Procedures Dataset
- m2r10_stdlib_proc_identifiers = (
- 'ALLOCATE', 'DEALLOCATE', 'SIZE',
- # TO BE COMPLETED
- )
-
- # Modula-2 R10 Standard Library Variables Dataset
- m2r10_stdlib_var_identifiers = (
- 'stdIn', 'stdOut', 'stdErr',
- )
-
- # Modula-2 R10 Standard Library Constants Dataset
- m2r10_stdlib_const_identifiers = (
- 'pi', 'tau',
- )
-
-# D i a l e c t s
-
- # Dialect modes
- dialects = (
- 'unknown',
- 'm2pim', 'm2iso', 'm2r10', 'objm2',
- 'm2iso+aglet', 'm2pim+gm2', 'm2iso+p1', 'm2iso+xds',
- )
-
-# D a t a b a s e s
-
- # Lexemes to Mark as Errors Database
- lexemes_to_reject_db = {
- # Lexemes to reject for unknown dialect
- 'unknown': (
- # LEAVE THIS EMPTY
- ),
- # Lexemes to reject for PIM Modula-2
- 'm2pim': (
- pim_lexemes_to_reject,
- ),
- # Lexemes to reject for ISO Modula-2
- 'm2iso': (
- iso_lexemes_to_reject,
- ),
- # Lexemes to reject for Modula-2 R10
- 'm2r10': (
- m2r10_lexemes_to_reject,
- ),
- # Lexemes to reject for Objective Modula-2
- 'objm2': (
- objm2_lexemes_to_reject,
- ),
- # Lexemes to reject for Aglet Modula-2
- 'm2iso+aglet': (
- iso_lexemes_to_reject,
- ),
- # Lexemes to reject for GNU Modula-2
- 'm2pim+gm2': (
- pim_lexemes_to_reject,
- ),
- # Lexemes to reject for p1 Modula-2
- 'm2iso+p1': (
- iso_lexemes_to_reject,
- ),
- # Lexemes to reject for XDS Modula-2
- 'm2iso+xds': (
- iso_lexemes_to_reject,
- ),
- }
-
- # Reserved Words Database
- reserved_words_db = {
- # Reserved words for unknown dialect
- 'unknown': (
- common_reserved_words,
- pim_additional_reserved_words,
- iso_additional_reserved_words,
- m2r10_additional_reserved_words,
- ),
-
- # Reserved words for PIM Modula-2
- 'm2pim': (
- common_reserved_words,
- pim_additional_reserved_words,
- ),
-
- # Reserved words for Modula-2 R10
- 'm2iso': (
- common_reserved_words,
- iso_additional_reserved_words,
- ),
-
- # Reserved words for ISO Modula-2
- 'm2r10': (
- common_reserved_words,
- m2r10_additional_reserved_words,
- ),
-
- # Reserved words for Objective Modula-2
- 'objm2': (
- common_reserved_words,
- m2r10_additional_reserved_words,
- objm2_additional_reserved_words,
- ),
-
- # Reserved words for Aglet Modula-2 Extensions
- 'm2iso+aglet': (
- common_reserved_words,
- iso_additional_reserved_words,
- aglet_additional_reserved_words,
- ),
-
- # Reserved words for GNU Modula-2 Extensions
- 'm2pim+gm2': (
- common_reserved_words,
- pim_additional_reserved_words,
- gm2_additional_reserved_words,
- ),
-
- # Reserved words for p1 Modula-2 Extensions
- 'm2iso+p1': (
- common_reserved_words,
- iso_additional_reserved_words,
- p1_additional_reserved_words,
- ),
-
- # Reserved words for XDS Modula-2 Extensions
- 'm2iso+xds': (
- common_reserved_words,
- iso_additional_reserved_words,
- xds_additional_reserved_words,
- ),
- }
-
- # Builtins Database
- builtins_db = {
- # Builtins for unknown dialect
- 'unknown': (
- common_builtins,
- pim_additional_builtins,
- iso_additional_builtins,
- m2r10_additional_builtins,
- ),
-
- # Builtins for PIM Modula-2
- 'm2pim': (
- common_builtins,
- pim_additional_builtins,
- ),
-
- # Builtins for ISO Modula-2
- 'm2iso': (
- common_builtins,
- iso_additional_builtins,
- ),
-
- # Builtins for ISO Modula-2
- 'm2r10': (
- common_builtins,
- m2r10_additional_builtins,
- ),
-
- # Builtins for Objective Modula-2
- 'objm2': (
- common_builtins,
- m2r10_additional_builtins,
- objm2_additional_builtins,
- ),
-
- # Builtins for Aglet Modula-2 Extensions
- 'm2iso+aglet': (
- common_builtins,
- iso_additional_builtins,
- aglet_additional_builtins,
- ),
-
- # Builtins for GNU Modula-2 Extensions
- 'm2pim+gm2': (
- common_builtins,
- pim_additional_builtins,
- gm2_additional_builtins,
- ),
-
- # Builtins for p1 Modula-2 Extensions
- 'm2iso+p1': (
- common_builtins,
- iso_additional_builtins,
- p1_additional_builtins,
- ),
-
- # Builtins for XDS Modula-2 Extensions
- 'm2iso+xds': (
- common_builtins,
- iso_additional_builtins,
- xds_additional_builtins,
- ),
- }
-
- # Pseudo-Module Builtins Database
- pseudo_builtins_db = {
- # Builtins for unknown dialect
- 'unknown': (
- common_pseudo_builtins,
- pim_additional_pseudo_builtins,
- iso_additional_pseudo_builtins,
- m2r10_additional_pseudo_builtins,
- ),
-
- # Builtins for PIM Modula-2
- 'm2pim': (
- common_pseudo_builtins,
- pim_additional_pseudo_builtins,
- ),
-
- # Builtins for ISO Modula-2
- 'm2iso': (
- common_pseudo_builtins,
- iso_additional_pseudo_builtins,
- ),
-
- # Builtins for ISO Modula-2
- 'm2r10': (
- common_pseudo_builtins,
- m2r10_additional_pseudo_builtins,
- ),
-
- # Builtins for Objective Modula-2
- 'objm2': (
- common_pseudo_builtins,
- m2r10_additional_pseudo_builtins,
- objm2_additional_pseudo_builtins,
- ),
-
- # Builtins for Aglet Modula-2 Extensions
- 'm2iso+aglet': (
- common_pseudo_builtins,
- iso_additional_pseudo_builtins,
- aglet_additional_pseudo_builtins,
- ),
-
- # Builtins for GNU Modula-2 Extensions
- 'm2pim+gm2': (
- common_pseudo_builtins,
- pim_additional_pseudo_builtins,
- gm2_additional_pseudo_builtins,
- ),
-
- # Builtins for p1 Modula-2 Extensions
- 'm2iso+p1': (
- common_pseudo_builtins,
- iso_additional_pseudo_builtins,
- p1_additional_pseudo_builtins,
- ),
-
- # Builtins for XDS Modula-2 Extensions
- 'm2iso+xds': (
- common_pseudo_builtins,
- iso_additional_pseudo_builtins,
- xds_additional_pseudo_builtins,
- ),
- }
-
- # Standard Library ADTs Database
- stdlib_adts_db = {
- # Empty entry for unknown dialect
- 'unknown': (
- # LEAVE THIS EMPTY
- ),
- # Standard Library ADTs for PIM Modula-2
- 'm2pim': (
- # No first class library types
- ),
-
- # Standard Library ADTs for ISO Modula-2
- 'm2iso': (
- # No first class library types
- ),
-
- # Standard Library ADTs for Modula-2 R10
- 'm2r10': (
- m2r10_stdlib_adt_identifiers,
- ),
-
- # Standard Library ADTs for Objective Modula-2
- 'objm2': (
- m2r10_stdlib_adt_identifiers,
- ),
-
- # Standard Library ADTs for Aglet Modula-2
- 'm2iso+aglet': (
- # No first class library types
- ),
-
- # Standard Library ADTs for GNU Modula-2
- 'm2pim+gm2': (
- # No first class library types
- ),
-
- # Standard Library ADTs for p1 Modula-2
- 'm2iso+p1': (
- # No first class library types
- ),
-
- # Standard Library ADTs for XDS Modula-2
- 'm2iso+xds': (
- # No first class library types
- ),
- }
-
- # Standard Library Modules Database
- stdlib_modules_db = {
- # Empty entry for unknown dialect
- 'unknown': (
- # LEAVE THIS EMPTY
- ),
- # Standard Library Modules for PIM Modula-2
- 'm2pim': (
- pim_stdlib_module_identifiers,
- ),
-
- # Standard Library Modules for ISO Modula-2
- 'm2iso': (
- iso_stdlib_module_identifiers,
- ),
-
- # Standard Library Modules for Modula-2 R10
- 'm2r10': (
- m2r10_stdlib_blueprint_identifiers,
- m2r10_stdlib_module_identifiers,
- m2r10_stdlib_adt_identifiers,
- ),
-
- # Standard Library Modules for Objective Modula-2
- 'objm2': (
- m2r10_stdlib_blueprint_identifiers,
- m2r10_stdlib_module_identifiers,
- ),
-
- # Standard Library Modules for Aglet Modula-2
- 'm2iso+aglet': (
- iso_stdlib_module_identifiers,
- ),
-
- # Standard Library Modules for GNU Modula-2
- 'm2pim+gm2': (
- pim_stdlib_module_identifiers,
- ),
-
- # Standard Library Modules for p1 Modula-2
- 'm2iso+p1': (
- iso_stdlib_module_identifiers,
- ),
-
- # Standard Library Modules for XDS Modula-2
- 'm2iso+xds': (
- iso_stdlib_module_identifiers,
- ),
- }
-
- # Standard Library Types Database
- stdlib_types_db = {
- # Empty entry for unknown dialect
- 'unknown': (
- # LEAVE THIS EMPTY
- ),
- # Standard Library Types for PIM Modula-2
- 'm2pim': (
- pim_stdlib_type_identifiers,
- ),
-
- # Standard Library Types for ISO Modula-2
- 'm2iso': (
- iso_stdlib_type_identifiers,
- ),
-
- # Standard Library Types for Modula-2 R10
- 'm2r10': (
- m2r10_stdlib_type_identifiers,
- ),
-
- # Standard Library Types for Objective Modula-2
- 'objm2': (
- m2r10_stdlib_type_identifiers,
- ),
-
- # Standard Library Types for Aglet Modula-2
- 'm2iso+aglet': (
- iso_stdlib_type_identifiers,
- ),
-
- # Standard Library Types for GNU Modula-2
- 'm2pim+gm2': (
- pim_stdlib_type_identifiers,
- ),
-
- # Standard Library Types for p1 Modula-2
- 'm2iso+p1': (
- iso_stdlib_type_identifiers,
- ),
-
- # Standard Library Types for XDS Modula-2
- 'm2iso+xds': (
- iso_stdlib_type_identifiers,
- ),
- }
-
- # Standard Library Procedures Database
- stdlib_procedures_db = {
- # Empty entry for unknown dialect
- 'unknown': (
- # LEAVE THIS EMPTY
- ),
- # Standard Library Procedures for PIM Modula-2
- 'm2pim': (
- pim_stdlib_proc_identifiers,
- ),
-
- # Standard Library Procedures for ISO Modula-2
- 'm2iso': (
- iso_stdlib_proc_identifiers,
- ),
-
- # Standard Library Procedures for Modula-2 R10
- 'm2r10': (
- m2r10_stdlib_proc_identifiers,
- ),
-
- # Standard Library Procedures for Objective Modula-2
- 'objm2': (
- m2r10_stdlib_proc_identifiers,
- ),
-
- # Standard Library Procedures for Aglet Modula-2
- 'm2iso+aglet': (
- iso_stdlib_proc_identifiers,
- ),
-
- # Standard Library Procedures for GNU Modula-2
- 'm2pim+gm2': (
- pim_stdlib_proc_identifiers,
- ),
-
- # Standard Library Procedures for p1 Modula-2
- 'm2iso+p1': (
- iso_stdlib_proc_identifiers,
- ),
-
- # Standard Library Procedures for XDS Modula-2
- 'm2iso+xds': (
- iso_stdlib_proc_identifiers,
- ),
- }
-
- # Standard Library Variables Database
- stdlib_variables_db = {
- # Empty entry for unknown dialect
- 'unknown': (
- # LEAVE THIS EMPTY
- ),
- # Standard Library Variables for PIM Modula-2
- 'm2pim': (
- pim_stdlib_var_identifiers,
- ),
-
- # Standard Library Variables for ISO Modula-2
- 'm2iso': (
- iso_stdlib_var_identifiers,
- ),
-
- # Standard Library Variables for Modula-2 R10
- 'm2r10': (
- m2r10_stdlib_var_identifiers,
- ),
-
- # Standard Library Variables for Objective Modula-2
- 'objm2': (
- m2r10_stdlib_var_identifiers,
- ),
-
- # Standard Library Variables for Aglet Modula-2
- 'm2iso+aglet': (
- iso_stdlib_var_identifiers,
- ),
-
- # Standard Library Variables for GNU Modula-2
- 'm2pim+gm2': (
- pim_stdlib_var_identifiers,
- ),
-
- # Standard Library Variables for p1 Modula-2
- 'm2iso+p1': (
- iso_stdlib_var_identifiers,
- ),
-
- # Standard Library Variables for XDS Modula-2
- 'm2iso+xds': (
- iso_stdlib_var_identifiers,
- ),
- }
-
- # Standard Library Constants Database
- stdlib_constants_db = {
- # Empty entry for unknown dialect
- 'unknown': (
- # LEAVE THIS EMPTY
- ),
- # Standard Library Constants for PIM Modula-2
- 'm2pim': (
- pim_stdlib_const_identifiers,
- ),
-
- # Standard Library Constants for ISO Modula-2
- 'm2iso': (
- iso_stdlib_const_identifiers,
- ),
-
- # Standard Library Constants for Modula-2 R10
- 'm2r10': (
- m2r10_stdlib_const_identifiers,
- ),
-
- # Standard Library Constants for Objective Modula-2
- 'objm2': (
- m2r10_stdlib_const_identifiers,
- ),
-
- # Standard Library Constants for Aglet Modula-2
- 'm2iso+aglet': (
- iso_stdlib_const_identifiers,
- ),
-
- # Standard Library Constants for GNU Modula-2
- 'm2pim+gm2': (
- pim_stdlib_const_identifiers,
- ),
-
- # Standard Library Constants for p1 Modula-2
- 'm2iso+p1': (
- iso_stdlib_const_identifiers,
- ),
-
- # Standard Library Constants for XDS Modula-2
- 'm2iso+xds': (
- iso_stdlib_const_identifiers,
- ),
- }
-
-# M e t h o d s
-
- # initialise a lexer instance
- def __init__(self, **options):
- #
- # check dialect options
- #
- dialects = get_list_opt(options, 'dialect', [])
- #
- for dialect_option in dialects:
- if dialect_option in self.dialects[1:-1]:
- # valid dialect option found
- self.set_dialect(dialect_option)
- break
- #
- # Fallback Mode (DEFAULT)
- else:
- # no valid dialect option
- self.set_dialect('unknown')
- #
- self.dialect_set_by_tag = False
- #
- # check style options
- #
- styles = get_list_opt(options, 'style', [])
- #
- # use lowercase mode for Algol style
- if 'algol' in styles or 'algol_nu' in styles:
- self.algol_publication_mode = True
- else:
- self.algol_publication_mode = False
- #
- # Check option flags
- #
- self.treat_stdlib_adts_as_builtins = get_bool_opt(
- options, 'treat_stdlib_adts_as_builtins', True)
- #
- # call superclass initialiser
- RegexLexer.__init__(self, **options)
-
- # Set lexer to a specified dialect
- def set_dialect(self, dialect_id):
- #
- # if __debug__:
- # print 'entered set_dialect with arg: ', dialect_id
- #
- # check dialect name against known dialects
- if dialect_id not in self.dialects:
- dialect = 'unknown' # default
- else:
- dialect = dialect_id
- #
- # compose lexemes to reject set
- lexemes_to_reject_set = set()
- # add each list of reject lexemes for this dialect
- for list in self.lexemes_to_reject_db[dialect]:
- lexemes_to_reject_set.update(set(list))
- #
- # compose reserved words set
- reswords_set = set()
- # add each list of reserved words for this dialect
- for list in self.reserved_words_db[dialect]:
- reswords_set.update(set(list))
- #
- # compose builtins set
- builtins_set = set()
- # add each list of builtins for this dialect excluding reserved words
- for list in self.builtins_db[dialect]:
- builtins_set.update(set(list).difference(reswords_set))
- #
- # compose pseudo-builtins set
- pseudo_builtins_set = set()
- # add each list of builtins for this dialect excluding reserved words
- for list in self.pseudo_builtins_db[dialect]:
- pseudo_builtins_set.update(set(list).difference(reswords_set))
- #
- # compose ADTs set
- adts_set = set()
- # add each list of ADTs for this dialect excluding reserved words
- for list in self.stdlib_adts_db[dialect]:
- adts_set.update(set(list).difference(reswords_set))
- #
- # compose modules set
- modules_set = set()
- # add each list of builtins for this dialect excluding builtins
- for list in self.stdlib_modules_db[dialect]:
- modules_set.update(set(list).difference(builtins_set))
- #
- # compose types set
- types_set = set()
- # add each list of types for this dialect excluding builtins
- for list in self.stdlib_types_db[dialect]:
- types_set.update(set(list).difference(builtins_set))
- #
- # compose procedures set
- procedures_set = set()
- # add each list of procedures for this dialect excluding builtins
- for list in self.stdlib_procedures_db[dialect]:
- procedures_set.update(set(list).difference(builtins_set))
- #
- # compose variables set
- variables_set = set()
- # add each list of variables for this dialect excluding builtins
- for list in self.stdlib_variables_db[dialect]:
- variables_set.update(set(list).difference(builtins_set))
- #
- # compose constants set
- constants_set = set()
- # add each list of constants for this dialect excluding builtins
- for list in self.stdlib_constants_db[dialect]:
- constants_set.update(set(list).difference(builtins_set))
- #
- # update lexer state
- self.dialect = dialect
- self.lexemes_to_reject = lexemes_to_reject_set
- self.reserved_words = reswords_set
- self.builtins = builtins_set
- self.pseudo_builtins = pseudo_builtins_set
- self.adts = adts_set
- self.modules = modules_set
- self.types = types_set
- self.procedures = procedures_set
- self.variables = variables_set
- self.constants = constants_set
- #
- # if __debug__:
- # print 'exiting set_dialect'
- # print ' self.dialect: ', self.dialect
- # print ' self.lexemes_to_reject: ', self.lexemes_to_reject
- # print ' self.reserved_words: ', self.reserved_words
- # print ' self.builtins: ', self.builtins
- # print ' self.pseudo_builtins: ', self.pseudo_builtins
- # print ' self.adts: ', self.adts
- # print ' self.modules: ', self.modules
- # print ' self.types: ', self.types
- # print ' self.procedures: ', self.procedures
- # print ' self.variables: ', self.variables
- # print ' self.types: ', self.types
- # print ' self.constants: ', self.constants
-
- # Extracts a dialect name from a dialect tag comment string and checks
- # the extracted name against known dialects. If a match is found, the
- # matching name is returned, otherwise dialect id 'unknown' is returned
- def get_dialect_from_dialect_tag(self, dialect_tag):
- #
- # if __debug__:
- # print 'entered get_dialect_from_dialect_tag with arg: ', dialect_tag
- #
- # constants
- left_tag_delim = '(*!'
- right_tag_delim = '*)'
- left_tag_delim_len = len(left_tag_delim)
- right_tag_delim_len = len(right_tag_delim)
- indicator_start = left_tag_delim_len
- indicator_end = -(right_tag_delim_len)
- #
- # check comment string for dialect indicator
- if len(dialect_tag) > (left_tag_delim_len + right_tag_delim_len) \
- and dialect_tag.startswith(left_tag_delim) \
- and dialect_tag.endswith(right_tag_delim):
- #
- # if __debug__:
- # print 'dialect tag found'
- #
- # extract dialect indicator
- indicator = dialect_tag[indicator_start:indicator_end]
- #
- # if __debug__:
- # print 'extracted: ', indicator
- #
- # check against known dialects
- for index in range(1, len(self.dialects)):
- #
- # if __debug__:
- # print 'dialects[', index, ']: ', self.dialects[index]
- #
- if indicator == self.dialects[index]:
- #
- # if __debug__:
- # print 'matching dialect found'
- #
- # indicator matches known dialect
- return indicator
- else:
- # indicator does not match any dialect
- return 'unknown' # default
- else:
- # invalid indicator string
- return 'unknown' # default
-
- # intercept the token stream, modify token attributes and return them
- def get_tokens_unprocessed(self, text):
- for index, token, value in RegexLexer.get_tokens_unprocessed(self, text):
- #
- # check for dialect tag if dialect has not been set by tag
- if not self.dialect_set_by_tag and token == Comment.Special:
- indicated_dialect = self.get_dialect_from_dialect_tag(value)
- if indicated_dialect != 'unknown':
- # token is a dialect indicator
- # reset reserved words and builtins
- self.set_dialect(indicated_dialect)
- self.dialect_set_by_tag = True
- #
- # check for reserved words, predefined and stdlib identifiers
- if token is Name:
- if value in self.reserved_words:
- token = Keyword.Reserved
- if self.algol_publication_mode:
- value = value.lower()
- #
- elif value in self.builtins:
- token = Name.Builtin
- if self.algol_publication_mode:
- value = value.lower()
- #
- elif value in self.pseudo_builtins:
- token = Name.Builtin.Pseudo
- if self.algol_publication_mode:
- value = value.lower()
- #
- elif value in self.adts:
- if not self.treat_stdlib_adts_as_builtins:
- token = Name.Namespace
- else:
- token = Name.Builtin.Pseudo
- if self.algol_publication_mode:
- value = value.lower()
- #
- elif value in self.modules:
- token = Name.Namespace
- #
- elif value in self.types:
- token = Name.Class
- #
- elif value in self.procedures:
- token = Name.Function
- #
- elif value in self.variables:
- token = Name.Variable
- #
- elif value in self.constants:
- token = Name.Constant
- #
- elif token in Number:
- #
- # mark prefix number literals as error for PIM and ISO dialects
- if self.dialect not in ('unknown', 'm2r10', 'objm2'):
- if "'" in value or value[0:2] in ('0b', '0x', '0u'):
- token = Error
- #
- elif self.dialect in ('m2r10', 'objm2'):
- # mark base-8 number literals as errors for M2 R10 and ObjM2
- if token is Number.Oct:
- token = Error
- # mark suffix base-16 literals as errors for M2 R10 and ObjM2
- elif token is Number.Hex and 'H' in value:
- token = Error
- # mark real numbers with E as errors for M2 R10 and ObjM2
- elif token is Number.Float and 'E' in value:
- token = Error
- #
- elif token in Comment:
- #
- # mark single line comment as error for PIM and ISO dialects
- if token is Comment.Single:
- if self.dialect not in ('unknown', 'm2r10', 'objm2'):
- token = Error
- #
- if token is Comment.Preproc:
- # mark ISO pragma as error for PIM dialects
- if value.startswith('<*') and \
- self.dialect.startswith('m2pim'):
- token = Error
- # mark PIM pragma as comment for other dialects
- elif value.startswith('(*$') and \
- self.dialect != 'unknown' and \
- not self.dialect.startswith('m2pim'):
- token = Comment.Multiline
- #
- else: # token is neither Name nor Comment
- #
- # mark lexemes matching the dialect's error token set as errors
- if value in self.lexemes_to_reject:
- token = Error
- #
- # substitute lexemes when in Algol mode
- if self.algol_publication_mode:
- if value == '#':
- value = u'≠'
- elif value == '<=':
- value = u'≤'
- elif value == '>=':
- value = u'≥'
- elif value == '==':
- value = u'≡'
- elif value == '*.':
- value = u'•'
-
- # return result
- yield index, token, value
diff --git a/pygments/lexers/monte.py b/pygments/lexers/monte.py
deleted file mode 100644
index e181c940..00000000
--- a/pygments/lexers/monte.py
+++ /dev/null
@@ -1,204 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.monte
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Monte programming language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.token import Comment, Error, Keyword, Name, Number, Operator, \
- Punctuation, String, Whitespace
-from pygments.lexer import RegexLexer, include, words
-
-__all__ = ['MonteLexer']
-
-
-# `var` handled separately
-# `interface` handled separately
-_declarations = ['bind', 'def', 'fn', 'object']
-_methods = ['method', 'to']
-_keywords = [
- 'as', 'break', 'catch', 'continue', 'else', 'escape', 'exit', 'exports',
- 'extends', 'finally', 'for', 'guards', 'if', 'implements', 'import',
- 'in', 'match', 'meta', 'pass', 'return', 'switch', 'try', 'via', 'when',
- 'while',
-]
-_operators = [
- # Unary
- '~', '!',
- # Binary
- '+', '-', '*', '/', '%', '**', '&', '|', '^', '<<', '>>',
- # Binary augmented
- '+=', '-=', '*=', '/=', '%=', '**=', '&=', '|=', '^=', '<<=', '>>=',
- # Comparison
- '==', '!=', '<', '<=', '>', '>=', '<=>',
- # Patterns and assignment
- ':=', '?', '=~', '!~', '=>',
- # Calls and sends
- '.', '<-', '->',
-]
-_escape_pattern = (
- r'(?:\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|'
- r'\\["\'\\bftnr])')
-# _char = _escape_chars + [('.', String.Char)]
-_identifier = r'[_a-zA-Z]\w*'
-
-_constants = [
- # Void constants
- 'null',
- # Bool constants
- 'false', 'true',
- # Double constants
- 'Infinity', 'NaN',
- # Special objects
- 'M', 'Ref', 'throw', 'traceln',
-]
-
-_guards = [
- 'Any', 'Binding', 'Bool', 'Bytes', 'Char', 'DeepFrozen', 'Double',
- 'Empty', 'Int', 'List', 'Map', 'Near', 'NullOk', 'Same', 'Selfless',
- 'Set', 'Str', 'SubrangeGuard', 'Transparent', 'Void',
-]
-
-_safeScope = [
- '_accumulateList', '_accumulateMap', '_auditedBy', '_bind',
- '_booleanFlow', '_comparer', '_equalizer', '_iterForever', '_loop',
- '_makeBytes', '_makeDouble', '_makeFinalSlot', '_makeInt', '_makeList',
- '_makeMap', '_makeMessageDesc', '_makeOrderedSpace', '_makeParamDesc',
- '_makeProtocolDesc', '_makeSourceSpan', '_makeString', '_makeVarSlot',
- '_makeVerbFacet', '_mapExtract', '_matchSame', '_quasiMatcher',
- '_slotToBinding', '_splitList', '_suchThat', '_switchFailed',
- '_validateFor', 'b__quasiParser', 'eval', 'import', 'm__quasiParser',
- 'makeBrandPair', 'makeLazySlot', 'safeScope', 'simple__quasiParser',
-]
-
-
-class MonteLexer(RegexLexer):
- """
- Lexer for the `Monte <https://monte.readthedocs.io/>`_ programming language.
-
- .. versionadded:: 2.2
- """
- name = 'Monte'
- aliases = ['monte']
- filenames = ['*.mt']
-
- tokens = {
- 'root': [
- # Comments
- (r'#[^\n]*\n', Comment),
-
- # Docstrings
- # Apologies for the non-greedy matcher here.
- (r'/\*\*.*?\*/', String.Doc),
-
- # `var` declarations
- (r'\bvar\b', Keyword.Declaration, 'var'),
-
- # `interface` declarations
- (r'\binterface\b', Keyword.Declaration, 'interface'),
-
- # method declarations
- (words(_methods, prefix='\\b', suffix='\\b'),
- Keyword, 'method'),
-
- # All other declarations
- (words(_declarations, prefix='\\b', suffix='\\b'),
- Keyword.Declaration),
-
- # Keywords
- (words(_keywords, prefix='\\b', suffix='\\b'), Keyword),
-
- # Literals
- ('[+-]?0x[_0-9a-fA-F]+', Number.Hex),
- (r'[+-]?[_0-9]+\.[_0-9]*([eE][+-]?[_0-9]+)?', Number.Float),
- ('[+-]?[_0-9]+', Number.Integer),
- ("'", String.Double, 'char'),
- ('"', String.Double, 'string'),
-
- # Quasiliterals
- ('`', String.Backtick, 'ql'),
-
- # Operators
- (words(_operators), Operator),
-
- # Verb operators
- (_identifier + '=', Operator.Word),
-
- # Safe scope constants
- (words(_constants, prefix='\\b', suffix='\\b'),
- Keyword.Pseudo),
-
- # Safe scope guards
- (words(_guards, prefix='\\b', suffix='\\b'), Keyword.Type),
-
- # All other safe scope names
- (words(_safeScope, prefix='\\b', suffix='\\b'),
- Name.Builtin),
-
- # Identifiers
- (_identifier, Name),
-
- # Punctuation
- (r'\(|\)|\{|\}|\[|\]|:|,', Punctuation),
-
- # Whitespace
- (' +', Whitespace),
-
- # Definite lexer errors
- ('=', Error),
- ],
- 'char': [
- # It is definitely an error to have a char of width == 0.
- ("'", Error, 'root'),
- (_escape_pattern, String.Escape, 'charEnd'),
- ('.', String.Char, 'charEnd'),
- ],
- 'charEnd': [
- ("'", String.Char, '#pop:2'),
- # It is definitely an error to have a char of width > 1.
- ('.', Error),
- ],
- # The state of things coming into an interface.
- 'interface': [
- (' +', Whitespace),
- (_identifier, Name.Class, '#pop'),
- include('root'),
- ],
- # The state of things coming into a method.
- 'method': [
- (' +', Whitespace),
- (_identifier, Name.Function, '#pop'),
- include('root'),
- ],
- 'string': [
- ('"', String.Double, 'root'),
- (_escape_pattern, String.Escape),
- (r'\n', String.Double),
- ('.', String.Double),
- ],
- 'ql': [
- ('`', String.Backtick, 'root'),
- (r'\$' + _escape_pattern, String.Escape),
- (r'\$\$', String.Escape),
- (r'@@', String.Escape),
- (r'\$\{', String.Interpol, 'qlNest'),
- (r'@\{', String.Interpol, 'qlNest'),
- (r'\$' + _identifier, Name),
- ('@' + _identifier, Name),
- ('.', String.Backtick),
- ],
- 'qlNest': [
- (r'\}', String.Interpol, '#pop'),
- include('root'),
- ],
- # The state of things immediately following `var`.
- 'var': [
- (' +', Whitespace),
- (_identifier, Name.Variable, '#pop'),
- include('root'),
- ],
- }
diff --git a/pygments/lexers/ncl.py b/pygments/lexers/ncl.py
deleted file mode 100644
index e2edd6cc..00000000
--- a/pygments/lexers/ncl.py
+++ /dev/null
@@ -1,894 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.ncl
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for NCAR Command Language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['NCLLexer']
-
-
-class NCLLexer(RegexLexer):
- """
- Lexer for NCL code.
-
- .. versionadded:: 2.2
- """
- name = 'NCL'
- aliases = ['ncl']
- filenames = ['*.ncl']
- mimetypes = ['text/ncl']
- flags = re.MULTILINE
-
- tokens = {
- 'root': [
- (r';.*\n', Comment),
- include('strings'),
- include('core'),
- (r'[a-zA-Z_]\w*', Name),
- include('nums'),
- (r'[\s]+', Text),
- ],
- 'core': [
- # Statements
- (words((
- 'begin', 'break', 'continue', 'create', 'defaultapp', 'do',
- 'else', 'end', 'external', 'exit', 'True', 'False', 'file', 'function',
- 'getvalues', 'graphic', 'group', 'if', 'list', 'load', 'local',
- 'new', '_Missing', 'Missing', 'noparent', 'procedure',
- 'quit', 'QUIT', 'Quit', 'record', 'return', 'setvalues', 'stop',
- 'then', 'while'), prefix=r'\b', suffix=r'\s*\b'),
- Keyword),
-
- # Data Types
- (words((
- 'ubyte', 'uint', 'uint64', 'ulong', 'string', 'byte',
- 'character', 'double', 'float', 'integer', 'int64', 'logical',
- 'long', 'short', 'ushort', 'enumeric', 'numeric', 'snumeric'),
- prefix=r'\b', suffix=r'\s*\b'),
- Keyword.Type),
-
- # Operators
- (r'[\%^*+\-/<>]', Operator),
-
- # punctuation:
- (r'[\[\]():@$!&|.,\\{}]', Punctuation),
- (r'[=:]', Punctuation),
-
- # Intrinsics
- (words((
- 'abs', 'acos', 'addfile', 'addfiles', 'all', 'angmom_atm', 'any',
- 'area_conserve_remap', 'area_hi2lores', 'area_poly_sphere',
- 'asciiread', 'asciiwrite', 'asin', 'atan', 'atan2', 'attsetvalues',
- 'avg', 'betainc', 'bin_avg', 'bin_sum', 'bw_bandpass_filter',
- 'cancor', 'cbinread', 'cbinwrite', 'cd_calendar', 'cd_inv_calendar',
- 'cdfbin_p', 'cdfbin_pr', 'cdfbin_s', 'cdfbin_xn', 'cdfchi_p',
- 'cdfchi_x', 'cdfgam_p', 'cdfgam_x', 'cdfnor_p', 'cdfnor_x',
- 'cdft_p', 'cdft_t', 'ceil', 'center_finite_diff',
- 'center_finite_diff_n', 'cfftb', 'cfftf', 'cfftf_frq_reorder',
- 'charactertodouble', 'charactertofloat', 'charactertointeger',
- 'charactertolong', 'charactertoshort', 'charactertostring',
- 'chartodouble', 'chartofloat', 'chartoint', 'chartointeger',
- 'chartolong', 'chartoshort', 'chartostring', 'chiinv', 'clear',
- 'color_index_to_rgba', 'conform', 'conform_dims', 'cos', 'cosh',
- 'count_unique_values', 'covcorm', 'covcorm_xy', 'craybinnumrec',
- 'craybinrecread', 'create_graphic', 'csa1', 'csa1d', 'csa1s',
- 'csa1x', 'csa1xd', 'csa1xs', 'csa2', 'csa2d', 'csa2l', 'csa2ld',
- 'csa2ls', 'csa2lx', 'csa2lxd', 'csa2lxs', 'csa2s', 'csa2x',
- 'csa2xd', 'csa2xs', 'csa3', 'csa3d', 'csa3l', 'csa3ld', 'csa3ls',
- 'csa3lx', 'csa3lxd', 'csa3lxs', 'csa3s', 'csa3x', 'csa3xd',
- 'csa3xs', 'csc2s', 'csgetp', 'css2c', 'cssetp', 'cssgrid', 'csstri',
- 'csvoro', 'cumsum', 'cz2ccm', 'datatondc', 'day_of_week',
- 'day_of_year', 'days_in_month', 'default_fillvalue', 'delete',
- 'depth_to_pres', 'destroy', 'determinant', 'dewtemp_trh',
- 'dgeevx_lapack', 'dim_acumrun_n', 'dim_avg', 'dim_avg_n',
- 'dim_avg_wgt', 'dim_avg_wgt_n', 'dim_cumsum', 'dim_cumsum_n',
- 'dim_gamfit_n', 'dim_gbits', 'dim_max', 'dim_max_n', 'dim_median',
- 'dim_median_n', 'dim_min', 'dim_min_n', 'dim_num', 'dim_num_n',
- 'dim_numrun_n', 'dim_pqsort', 'dim_pqsort_n', 'dim_product',
- 'dim_product_n', 'dim_rmsd', 'dim_rmsd_n', 'dim_rmvmean',
- 'dim_rmvmean_n', 'dim_rmvmed', 'dim_rmvmed_n', 'dim_spi_n',
- 'dim_standardize', 'dim_standardize_n', 'dim_stat4', 'dim_stat4_n',
- 'dim_stddev', 'dim_stddev_n', 'dim_sum', 'dim_sum_n', 'dim_sum_wgt',
- 'dim_sum_wgt_n', 'dim_variance', 'dim_variance_n', 'dimsizes',
- 'doubletobyte', 'doubletochar', 'doubletocharacter',
- 'doubletofloat', 'doubletoint', 'doubletointeger', 'doubletolong',
- 'doubletoshort', 'dpres_hybrid_ccm', 'dpres_plevel', 'draw',
- 'draw_color_palette', 'dsgetp', 'dsgrid2', 'dsgrid2d', 'dsgrid2s',
- 'dsgrid3', 'dsgrid3d', 'dsgrid3s', 'dspnt2', 'dspnt2d', 'dspnt2s',
- 'dspnt3', 'dspnt3d', 'dspnt3s', 'dssetp', 'dtrend', 'dtrend_msg',
- 'dtrend_msg_n', 'dtrend_n', 'dtrend_quadratic',
- 'dtrend_quadratic_msg_n', 'dv2uvf', 'dv2uvg', 'dz_height',
- 'echo_off', 'echo_on', 'eof2data', 'eof_varimax', 'eofcor',
- 'eofcor_pcmsg', 'eofcor_ts', 'eofcov', 'eofcov_pcmsg', 'eofcov_ts',
- 'eofunc', 'eofunc_ts', 'eofunc_varimax', 'equiv_sample_size', 'erf',
- 'erfc', 'esacr', 'esacv', 'esccr', 'esccv', 'escorc', 'escorc_n',
- 'escovc', 'exit', 'exp', 'exp_tapersh', 'exp_tapersh_wgts',
- 'exp_tapershC', 'ezfftb', 'ezfftb_n', 'ezfftf', 'ezfftf_n',
- 'f2fosh', 'f2foshv', 'f2fsh', 'f2fshv', 'f2gsh', 'f2gshv', 'fabs',
- 'fbindirread', 'fbindirwrite', 'fbinnumrec', 'fbinread',
- 'fbinrecread', 'fbinrecwrite', 'fbinwrite', 'fft2db', 'fft2df',
- 'fftshift', 'fileattdef', 'filechunkdimdef', 'filedimdef',
- 'fileexists', 'filegrpdef', 'filevarattdef', 'filevarchunkdef',
- 'filevarcompressleveldef', 'filevardef', 'filevardimsizes',
- 'filwgts_lancos', 'filwgts_lanczos', 'filwgts_normal',
- 'floattobyte', 'floattochar', 'floattocharacter', 'floattoint',
- 'floattointeger', 'floattolong', 'floattoshort', 'floor',
- 'fluxEddy', 'fo2fsh', 'fo2fshv', 'fourier_info', 'frame', 'fspan',
- 'ftcurv', 'ftcurvd', 'ftcurvi', 'ftcurvp', 'ftcurvpi', 'ftcurvps',
- 'ftcurvs', 'ftest', 'ftgetp', 'ftkurv', 'ftkurvd', 'ftkurvp',
- 'ftkurvpd', 'ftsetp', 'ftsurf', 'g2fsh', 'g2fshv', 'g2gsh',
- 'g2gshv', 'gamma', 'gammainc', 'gaus', 'gaus_lobat',
- 'gaus_lobat_wgt', 'gc_aangle', 'gc_clkwise', 'gc_dangle',
- 'gc_inout', 'gc_latlon', 'gc_onarc', 'gc_pnt2gc', 'gc_qarea',
- 'gc_tarea', 'generate_2d_array', 'get_color_index',
- 'get_color_rgba', 'get_cpu_time', 'get_isolines', 'get_ncl_version',
- 'get_script_name', 'get_script_prefix_name', 'get_sphere_radius',
- 'get_unique_values', 'getbitsone', 'getenv', 'getfiledimsizes',
- 'getfilegrpnames', 'getfilepath', 'getfilevaratts',
- 'getfilevarchunkdimsizes', 'getfilevardims', 'getfilevardimsizes',
- 'getfilevarnames', 'getfilevartypes', 'getvaratts', 'getvardims',
- 'gradsf', 'gradsg', 'greg2jul', 'grid2triple', 'hlsrgb', 'hsvrgb',
- 'hydro', 'hyi2hyo', 'idsfft', 'igradsf', 'igradsg', 'ilapsf',
- 'ilapsg', 'ilapvf', 'ilapvg', 'ind', 'ind_resolve', 'int2p',
- 'int2p_n', 'integertobyte', 'integertochar', 'integertocharacter',
- 'integertoshort', 'inttobyte', 'inttochar', 'inttoshort',
- 'inverse_matrix', 'isatt', 'isbigendian', 'isbyte', 'ischar',
- 'iscoord', 'isdefined', 'isdim', 'isdimnamed', 'isdouble',
- 'isenumeric', 'isfile', 'isfilepresent', 'isfilevar',
- 'isfilevaratt', 'isfilevarcoord', 'isfilevardim', 'isfloat',
- 'isfunc', 'isgraphic', 'isint', 'isint64', 'isinteger',
- 'isleapyear', 'islogical', 'islong', 'ismissing', 'isnan_ieee',
- 'isnumeric', 'ispan', 'isproc', 'isshort', 'issnumeric', 'isstring',
- 'isubyte', 'isuint', 'isuint64', 'isulong', 'isunlimited',
- 'isunsigned', 'isushort', 'isvar', 'jul2greg', 'kmeans_as136',
- 'kolsm2_n', 'kron_product', 'lapsf', 'lapsg', 'lapvf', 'lapvg',
- 'latlon2utm', 'lclvl', 'lderuvf', 'lderuvg', 'linint1', 'linint1_n',
- 'linint2', 'linint2_points', 'linmsg', 'linmsg_n', 'linrood_latwgt',
- 'linrood_wgt', 'list_files', 'list_filevars', 'list_hlus',
- 'list_procfuncs', 'list_vars', 'ListAppend', 'ListCount',
- 'ListGetType', 'ListIndex', 'ListIndexFromName', 'ListPop',
- 'ListPush', 'ListSetType', 'loadscript', 'local_max', 'local_min',
- 'log', 'log10', 'longtobyte', 'longtochar', 'longtocharacter',
- 'longtoint', 'longtointeger', 'longtoshort', 'lspoly', 'lspoly_n',
- 'mask', 'max', 'maxind', 'min', 'minind', 'mixed_layer_depth',
- 'mixhum_ptd', 'mixhum_ptrh', 'mjo_cross_coh2pha',
- 'mjo_cross_segment', 'moc_globe_atl', 'monthday', 'natgrid',
- 'natgridd', 'natgrids', 'ncargpath', 'ncargversion', 'ndctodata',
- 'ndtooned', 'new', 'NewList', 'ngezlogo', 'nggcog', 'nggetp',
- 'nglogo', 'ngsetp', 'NhlAddAnnotation', 'NhlAddData',
- 'NhlAddOverlay', 'NhlAddPrimitive', 'NhlAppGetDefaultParentId',
- 'NhlChangeWorkstation', 'NhlClassName', 'NhlClearWorkstation',
- 'NhlDataPolygon', 'NhlDataPolyline', 'NhlDataPolymarker',
- 'NhlDataToNDC', 'NhlDestroy', 'NhlDraw', 'NhlFrame', 'NhlFreeColor',
- 'NhlGetBB', 'NhlGetClassResources', 'NhlGetErrorObjectId',
- 'NhlGetNamedColorIndex', 'NhlGetParentId',
- 'NhlGetParentWorkstation', 'NhlGetWorkspaceObjectId',
- 'NhlIsAllocatedColor', 'NhlIsApp', 'NhlIsDataComm', 'NhlIsDataItem',
- 'NhlIsDataSpec', 'NhlIsTransform', 'NhlIsView', 'NhlIsWorkstation',
- 'NhlName', 'NhlNDCPolygon', 'NhlNDCPolyline', 'NhlNDCPolymarker',
- 'NhlNDCToData', 'NhlNewColor', 'NhlNewDashPattern', 'NhlNewMarker',
- 'NhlPalGetDefined', 'NhlRemoveAnnotation', 'NhlRemoveData',
- 'NhlRemoveOverlay', 'NhlRemovePrimitive', 'NhlSetColor',
- 'NhlSetDashPattern', 'NhlSetMarker', 'NhlUpdateData',
- 'NhlUpdateWorkstation', 'nice_mnmxintvl', 'nngetaspectd',
- 'nngetaspects', 'nngetp', 'nngetsloped', 'nngetslopes', 'nngetwts',
- 'nngetwtsd', 'nnpnt', 'nnpntd', 'nnpntend', 'nnpntendd',
- 'nnpntinit', 'nnpntinitd', 'nnpntinits', 'nnpnts', 'nnsetp', 'num',
- 'obj_anal_ic', 'omega_ccm', 'onedtond', 'overlay', 'paleo_outline',
- 'pdfxy_bin', 'poisson_grid_fill', 'pop_remap', 'potmp_insitu_ocn',
- 'prcwater_dp', 'pres2hybrid', 'pres_hybrid_ccm', 'pres_sigma',
- 'print', 'print_table', 'printFileVarSummary', 'printVarSummary',
- 'product', 'pslec', 'pslhor', 'pslhyp', 'qsort', 'rand',
- 'random_chi', 'random_gamma', 'random_normal', 'random_setallseed',
- 'random_uniform', 'rcm2points', 'rcm2rgrid', 'rdsstoi',
- 'read_colormap_file', 'reg_multlin', 'regcoef', 'regCoef_n',
- 'regline', 'relhum', 'replace_ieeenan', 'reshape', 'reshape_ind',
- 'rgba_to_color_index', 'rgbhls', 'rgbhsv', 'rgbyiq', 'rgrid2rcm',
- 'rhomb_trunc', 'rip_cape_2d', 'rip_cape_3d', 'round', 'rtest',
- 'runave', 'runave_n', 'set_default_fillvalue', 'set_sphere_radius',
- 'setfileoption', 'sfvp2uvf', 'sfvp2uvg', 'shaec', 'shagc',
- 'shgetnp', 'shgetp', 'shgrid', 'shorttobyte', 'shorttochar',
- 'shorttocharacter', 'show_ascii', 'shsec', 'shsetp', 'shsgc',
- 'shsgc_R42', 'sigma2hybrid', 'simpeq', 'simpne', 'sin',
- 'sindex_yrmo', 'sinh', 'sizeof', 'sleep', 'smth9', 'snindex_yrmo',
- 'solve_linsys', 'span_color_indexes', 'span_color_rgba',
- 'sparse_matrix_mult', 'spcorr', 'spcorr_n', 'specx_anal',
- 'specxy_anal', 'spei', 'sprintf', 'sprinti', 'sqrt', 'sqsort',
- 'srand', 'stat2', 'stat4', 'stat_medrng', 'stat_trim',
- 'status_exit', 'stdatmus_p2tdz', 'stdatmus_z2tdp', 'stddev',
- 'str_capital', 'str_concat', 'str_fields_count', 'str_get_cols',
- 'str_get_dq', 'str_get_field', 'str_get_nl', 'str_get_sq',
- 'str_get_tab', 'str_index_of_substr', 'str_insert', 'str_is_blank',
- 'str_join', 'str_left_strip', 'str_lower', 'str_match',
- 'str_match_ic', 'str_match_ic_regex', 'str_match_ind',
- 'str_match_ind_ic', 'str_match_ind_ic_regex', 'str_match_ind_regex',
- 'str_match_regex', 'str_right_strip', 'str_split',
- 'str_split_by_length', 'str_split_csv', 'str_squeeze', 'str_strip',
- 'str_sub_str', 'str_switch', 'str_upper', 'stringtochar',
- 'stringtocharacter', 'stringtodouble', 'stringtofloat',
- 'stringtoint', 'stringtointeger', 'stringtolong', 'stringtoshort',
- 'strlen', 'student_t', 'sum', 'svd_lapack', 'svdcov', 'svdcov_sv',
- 'svdstd', 'svdstd_sv', 'system', 'systemfunc', 'tan', 'tanh',
- 'taper', 'taper_n', 'tdclrs', 'tdctri', 'tdcudp', 'tdcurv',
- 'tddtri', 'tdez2d', 'tdez3d', 'tdgetp', 'tdgrds', 'tdgrid',
- 'tdgtrs', 'tdinit', 'tditri', 'tdlbla', 'tdlblp', 'tdlbls',
- 'tdline', 'tdlndp', 'tdlnpa', 'tdlpdp', 'tdmtri', 'tdotri',
- 'tdpara', 'tdplch', 'tdprpa', 'tdprpi', 'tdprpt', 'tdsetp',
- 'tdsort', 'tdstri', 'tdstrs', 'tdttri', 'thornthwaite', 'tobyte',
- 'tochar', 'todouble', 'tofloat', 'toint', 'toint64', 'tointeger',
- 'tolong', 'toshort', 'tosigned', 'tostring', 'tostring_with_format',
- 'totype', 'toubyte', 'touint', 'touint64', 'toulong', 'tounsigned',
- 'toushort', 'trend_manken', 'tri_trunc', 'triple2grid',
- 'triple2grid2d', 'trop_wmo', 'ttest', 'typeof', 'undef',
- 'unique_string', 'update', 'ushorttoint', 'ut_calendar',
- 'ut_inv_calendar', 'utm2latlon', 'uv2dv_cfd', 'uv2dvf', 'uv2dvg',
- 'uv2sfvpf', 'uv2sfvpg', 'uv2vr_cfd', 'uv2vrdvf', 'uv2vrdvg',
- 'uv2vrf', 'uv2vrg', 'v5d_close', 'v5d_create', 'v5d_setLowLev',
- 'v5d_setUnits', 'v5d_write', 'v5d_write_var', 'variance', 'vhaec',
- 'vhagc', 'vhsec', 'vhsgc', 'vibeta', 'vinth2p', 'vinth2p_ecmwf',
- 'vinth2p_ecmwf_nodes', 'vinth2p_nodes', 'vintp2p_ecmwf', 'vr2uvf',
- 'vr2uvg', 'vrdv2uvf', 'vrdv2uvg', 'wavelet', 'wavelet_default',
- 'weibull', 'wgt_area_smooth', 'wgt_areaave', 'wgt_areaave2',
- 'wgt_arearmse', 'wgt_arearmse2', 'wgt_areasum2', 'wgt_runave',
- 'wgt_runave_n', 'wgt_vert_avg_beta', 'wgt_volave', 'wgt_volave_ccm',
- 'wgt_volrmse', 'wgt_volrmse_ccm', 'where', 'wk_smooth121', 'wmbarb',
- 'wmbarbmap', 'wmdrft', 'wmgetp', 'wmlabs', 'wmsetp', 'wmstnm',
- 'wmvect', 'wmvectmap', 'wmvlbl', 'wrf_avo', 'wrf_cape_2d',
- 'wrf_cape_3d', 'wrf_dbz', 'wrf_eth', 'wrf_helicity', 'wrf_ij_to_ll',
- 'wrf_interp_1d', 'wrf_interp_2d_xy', 'wrf_interp_3d_z',
- 'wrf_latlon_to_ij', 'wrf_ll_to_ij', 'wrf_omega', 'wrf_pvo',
- 'wrf_rh', 'wrf_slp', 'wrf_smooth_2d', 'wrf_td', 'wrf_tk',
- 'wrf_updraft_helicity', 'wrf_uvmet', 'wrf_virtual_temp',
- 'wrf_wetbulb', 'wrf_wps_close_int', 'wrf_wps_open_int',
- 'wrf_wps_rddata_int', 'wrf_wps_rdhead_int', 'wrf_wps_read_int',
- 'wrf_wps_write_int', 'write_matrix', 'write_table', 'yiqrgb',
- 'z2geouv', 'zonal_mpsi', 'addfiles_GetVar', 'advect_variable',
- 'area_conserve_remap_Wrap', 'area_hi2lores_Wrap',
- 'array_append_record', 'assignFillValue', 'byte2flt',
- 'byte2flt_hdf', 'calcDayAnomTLL', 'calcMonAnomLLLT',
- 'calcMonAnomLLT', 'calcMonAnomTLL', 'calcMonAnomTLLL',
- 'calculate_monthly_values', 'cd_convert', 'changeCase',
- 'changeCaseChar', 'clmDayTLL', 'clmDayTLLL', 'clmMon2clmDay',
- 'clmMonLLLT', 'clmMonLLT', 'clmMonTLL', 'clmMonTLLL', 'closest_val',
- 'copy_VarAtts', 'copy_VarCoords', 'copy_VarCoords_1',
- 'copy_VarCoords_2', 'copy_VarMeta', 'copyatt', 'crossp3',
- 'cshstringtolist', 'cssgrid_Wrap', 'dble2flt', 'decimalPlaces',
- 'delete_VarAtts', 'dim_avg_n_Wrap', 'dim_avg_wgt_n_Wrap',
- 'dim_avg_wgt_Wrap', 'dim_avg_Wrap', 'dim_cumsum_n_Wrap',
- 'dim_cumsum_Wrap', 'dim_max_n_Wrap', 'dim_min_n_Wrap',
- 'dim_rmsd_n_Wrap', 'dim_rmsd_Wrap', 'dim_rmvmean_n_Wrap',
- 'dim_rmvmean_Wrap', 'dim_rmvmed_n_Wrap', 'dim_rmvmed_Wrap',
- 'dim_standardize_n_Wrap', 'dim_standardize_Wrap',
- 'dim_stddev_n_Wrap', 'dim_stddev_Wrap', 'dim_sum_n_Wrap',
- 'dim_sum_wgt_n_Wrap', 'dim_sum_wgt_Wrap', 'dim_sum_Wrap',
- 'dim_variance_n_Wrap', 'dim_variance_Wrap', 'dpres_plevel_Wrap',
- 'dtrend_leftdim', 'dv2uvF_Wrap', 'dv2uvG_Wrap', 'eof_north',
- 'eofcor_Wrap', 'eofcov_Wrap', 'eofunc_north', 'eofunc_ts_Wrap',
- 'eofunc_varimax_reorder', 'eofunc_varimax_Wrap', 'eofunc_Wrap',
- 'epsZero', 'f2fosh_Wrap', 'f2foshv_Wrap', 'f2fsh_Wrap',
- 'f2fshv_Wrap', 'f2gsh_Wrap', 'f2gshv_Wrap', 'fbindirSwap',
- 'fbinseqSwap1', 'fbinseqSwap2', 'flt2dble', 'flt2string',
- 'fo2fsh_Wrap', 'fo2fshv_Wrap', 'g2fsh_Wrap', 'g2fshv_Wrap',
- 'g2gsh_Wrap', 'g2gshv_Wrap', 'generate_resample_indices',
- 'generate_sample_indices', 'generate_unique_indices',
- 'genNormalDist', 'get1Dindex', 'get1Dindex_Collapse',
- 'get1Dindex_Exclude', 'get_file_suffix', 'GetFillColor',
- 'GetFillColorIndex', 'getFillValue', 'getind_latlon2d',
- 'getVarDimNames', 'getVarFillValue', 'grib_stime2itime',
- 'hyi2hyo_Wrap', 'ilapsF_Wrap', 'ilapsG_Wrap', 'ind_nearest_coord',
- 'indStrSubset', 'int2dble', 'int2flt', 'int2p_n_Wrap', 'int2p_Wrap',
- 'isMonotonic', 'isStrSubset', 'latGau', 'latGauWgt', 'latGlobeF',
- 'latGlobeFo', 'latRegWgt', 'linint1_n_Wrap', 'linint1_Wrap',
- 'linint2_points_Wrap', 'linint2_Wrap', 'local_max_1d',
- 'local_min_1d', 'lonFlip', 'lonGlobeF', 'lonGlobeFo', 'lonPivot',
- 'merge_levels_sfc', 'mod', 'month_to_annual',
- 'month_to_annual_weighted', 'month_to_season', 'month_to_season12',
- 'month_to_seasonN', 'monthly_total_to_daily_mean', 'nameDim',
- 'natgrid_Wrap', 'NewCosWeight', 'niceLatLon2D', 'NormCosWgtGlobe',
- 'numAsciiCol', 'numAsciiRow', 'numeric2int',
- 'obj_anal_ic_deprecated', 'obj_anal_ic_Wrap', 'omega_ccm_driver',
- 'omega_to_w', 'oneDtostring', 'pack_values', 'pattern_cor', 'pdfx',
- 'pdfxy', 'pdfxy_conform', 'pot_temp', 'pot_vort_hybrid',
- 'pot_vort_isobaric', 'pres2hybrid_Wrap', 'print_clock',
- 'printMinMax', 'quadroots', 'rcm2points_Wrap', 'rcm2rgrid_Wrap',
- 'readAsciiHead', 'readAsciiTable', 'reg_multlin_stats',
- 'region_ind', 'regline_stats', 'relhum_ttd', 'replaceSingleChar',
- 'RGBtoCmap', 'rgrid2rcm_Wrap', 'rho_mwjf', 'rm_single_dims',
- 'rmAnnCycle1D', 'rmInsufData', 'rmMonAnnCycLLLT', 'rmMonAnnCycLLT',
- 'rmMonAnnCycTLL', 'runave_n_Wrap', 'runave_Wrap', 'short2flt',
- 'short2flt_hdf', 'shsgc_R42_Wrap', 'sign_f90', 'sign_matlab',
- 'smth9_Wrap', 'smthClmDayTLL', 'smthClmDayTLLL', 'SqrtCosWeight',
- 'stat_dispersion', 'static_stability', 'stdMonLLLT', 'stdMonLLT',
- 'stdMonTLL', 'stdMonTLLL', 'symMinMaxPlt', 'table_attach_columns',
- 'table_attach_rows', 'time_to_newtime', 'transpose',
- 'triple2grid_Wrap', 'ut_convert', 'uv2dvF_Wrap', 'uv2dvG_Wrap',
- 'uv2vrF_Wrap', 'uv2vrG_Wrap', 'vr2uvF_Wrap', 'vr2uvG_Wrap',
- 'w_to_omega', 'wallClockElapseTime', 'wave_number_spc',
- 'wgt_areaave_Wrap', 'wgt_runave_leftdim', 'wgt_runave_n_Wrap',
- 'wgt_runave_Wrap', 'wgt_vertical_n', 'wind_component',
- 'wind_direction', 'yyyyddd_to_yyyymmdd', 'yyyymm_time',
- 'yyyymm_to_yyyyfrac', 'yyyymmdd_time', 'yyyymmdd_to_yyyyddd',
- 'yyyymmdd_to_yyyyfrac', 'yyyymmddhh_time', 'yyyymmddhh_to_yyyyfrac',
- 'zonal_mpsi_Wrap', 'zonalAve', 'calendar_decode2', 'cd_string',
- 'kf_filter', 'run_cor', 'time_axis_labels', 'ut_string',
- 'wrf_contour', 'wrf_map', 'wrf_map_overlay', 'wrf_map_overlays',
- 'wrf_map_resources', 'wrf_map_zoom', 'wrf_overlay', 'wrf_overlays',
- 'wrf_user_getvar', 'wrf_user_ij_to_ll', 'wrf_user_intrp2d',
- 'wrf_user_intrp3d', 'wrf_user_latlon_to_ij', 'wrf_user_list_times',
- 'wrf_user_ll_to_ij', 'wrf_user_unstagger', 'wrf_user_vert_interp',
- 'wrf_vector', 'gsn_add_annotation', 'gsn_add_polygon',
- 'gsn_add_polyline', 'gsn_add_polymarker',
- 'gsn_add_shapefile_polygons', 'gsn_add_shapefile_polylines',
- 'gsn_add_shapefile_polymarkers', 'gsn_add_text', 'gsn_attach_plots',
- 'gsn_blank_plot', 'gsn_contour', 'gsn_contour_map',
- 'gsn_contour_shade', 'gsn_coordinates', 'gsn_create_labelbar',
- 'gsn_create_legend', 'gsn_create_text',
- 'gsn_csm_attach_zonal_means', 'gsn_csm_blank_plot',
- 'gsn_csm_contour', 'gsn_csm_contour_map', 'gsn_csm_contour_map_ce',
- 'gsn_csm_contour_map_overlay', 'gsn_csm_contour_map_polar',
- 'gsn_csm_hov', 'gsn_csm_lat_time', 'gsn_csm_map', 'gsn_csm_map_ce',
- 'gsn_csm_map_polar', 'gsn_csm_pres_hgt',
- 'gsn_csm_pres_hgt_streamline', 'gsn_csm_pres_hgt_vector',
- 'gsn_csm_streamline', 'gsn_csm_streamline_contour_map',
- 'gsn_csm_streamline_contour_map_ce',
- 'gsn_csm_streamline_contour_map_polar', 'gsn_csm_streamline_map',
- 'gsn_csm_streamline_map_ce', 'gsn_csm_streamline_map_polar',
- 'gsn_csm_streamline_scalar', 'gsn_csm_streamline_scalar_map',
- 'gsn_csm_streamline_scalar_map_ce',
- 'gsn_csm_streamline_scalar_map_polar', 'gsn_csm_time_lat',
- 'gsn_csm_vector', 'gsn_csm_vector_map', 'gsn_csm_vector_map_ce',
- 'gsn_csm_vector_map_polar', 'gsn_csm_vector_scalar',
- 'gsn_csm_vector_scalar_map', 'gsn_csm_vector_scalar_map_ce',
- 'gsn_csm_vector_scalar_map_polar', 'gsn_csm_x2y', 'gsn_csm_x2y2',
- 'gsn_csm_xy', 'gsn_csm_xy2', 'gsn_csm_xy3', 'gsn_csm_y',
- 'gsn_define_colormap', 'gsn_draw_colormap', 'gsn_draw_named_colors',
- 'gsn_histogram', 'gsn_labelbar_ndc', 'gsn_legend_ndc', 'gsn_map',
- 'gsn_merge_colormaps', 'gsn_open_wks', 'gsn_panel', 'gsn_polygon',
- 'gsn_polygon_ndc', 'gsn_polyline', 'gsn_polyline_ndc',
- 'gsn_polymarker', 'gsn_polymarker_ndc', 'gsn_retrieve_colormap',
- 'gsn_reverse_colormap', 'gsn_streamline', 'gsn_streamline_map',
- 'gsn_streamline_scalar', 'gsn_streamline_scalar_map', 'gsn_table',
- 'gsn_text', 'gsn_text_ndc', 'gsn_vector', 'gsn_vector_map',
- 'gsn_vector_scalar', 'gsn_vector_scalar_map', 'gsn_xy', 'gsn_y',
- 'hsv2rgb', 'maximize_output', 'namedcolor2rgb', 'namedcolor2rgba',
- 'reset_device_coordinates', 'span_named_colors'), prefix=r'\b'),
- Name.Builtin),
-
- # Resources
- (words((
- 'amDataXF', 'amDataYF', 'amJust', 'amOn', 'amOrthogonalPosF',
- 'amParallelPosF', 'amResizeNotify', 'amSide', 'amTrackData',
- 'amViewId', 'amZone', 'appDefaultParent', 'appFileSuffix',
- 'appResources', 'appSysDir', 'appUsrDir', 'caCopyArrays',
- 'caXArray', 'caXCast', 'caXMaxV', 'caXMinV', 'caXMissingV',
- 'caYArray', 'caYCast', 'caYMaxV', 'caYMinV', 'caYMissingV',
- 'cnCellFillEdgeColor', 'cnCellFillMissingValEdgeColor',
- 'cnConpackParams', 'cnConstFEnableFill', 'cnConstFLabelAngleF',
- 'cnConstFLabelBackgroundColor', 'cnConstFLabelConstantSpacingF',
- 'cnConstFLabelFont', 'cnConstFLabelFontAspectF',
- 'cnConstFLabelFontColor', 'cnConstFLabelFontHeightF',
- 'cnConstFLabelFontQuality', 'cnConstFLabelFontThicknessF',
- 'cnConstFLabelFormat', 'cnConstFLabelFuncCode', 'cnConstFLabelJust',
- 'cnConstFLabelOn', 'cnConstFLabelOrthogonalPosF',
- 'cnConstFLabelParallelPosF', 'cnConstFLabelPerimColor',
- 'cnConstFLabelPerimOn', 'cnConstFLabelPerimSpaceF',
- 'cnConstFLabelPerimThicknessF', 'cnConstFLabelSide',
- 'cnConstFLabelString', 'cnConstFLabelTextDirection',
- 'cnConstFLabelZone', 'cnConstFUseInfoLabelRes',
- 'cnExplicitLabelBarLabelsOn', 'cnExplicitLegendLabelsOn',
- 'cnExplicitLineLabelsOn', 'cnFillBackgroundColor', 'cnFillColor',
- 'cnFillColors', 'cnFillDotSizeF', 'cnFillDrawOrder', 'cnFillMode',
- 'cnFillOn', 'cnFillOpacityF', 'cnFillPalette', 'cnFillPattern',
- 'cnFillPatterns', 'cnFillScaleF', 'cnFillScales', 'cnFixFillBleed',
- 'cnGridBoundFillColor', 'cnGridBoundFillPattern',
- 'cnGridBoundFillScaleF', 'cnGridBoundPerimColor',
- 'cnGridBoundPerimDashPattern', 'cnGridBoundPerimOn',
- 'cnGridBoundPerimThicknessF', 'cnHighLabelAngleF',
- 'cnHighLabelBackgroundColor', 'cnHighLabelConstantSpacingF',
- 'cnHighLabelCount', 'cnHighLabelFont', 'cnHighLabelFontAspectF',
- 'cnHighLabelFontColor', 'cnHighLabelFontHeightF',
- 'cnHighLabelFontQuality', 'cnHighLabelFontThicknessF',
- 'cnHighLabelFormat', 'cnHighLabelFuncCode', 'cnHighLabelPerimColor',
- 'cnHighLabelPerimOn', 'cnHighLabelPerimSpaceF',
- 'cnHighLabelPerimThicknessF', 'cnHighLabelString', 'cnHighLabelsOn',
- 'cnHighLowLabelOverlapMode', 'cnHighUseLineLabelRes',
- 'cnInfoLabelAngleF', 'cnInfoLabelBackgroundColor',
- 'cnInfoLabelConstantSpacingF', 'cnInfoLabelFont',
- 'cnInfoLabelFontAspectF', 'cnInfoLabelFontColor',
- 'cnInfoLabelFontHeightF', 'cnInfoLabelFontQuality',
- 'cnInfoLabelFontThicknessF', 'cnInfoLabelFormat',
- 'cnInfoLabelFuncCode', 'cnInfoLabelJust', 'cnInfoLabelOn',
- 'cnInfoLabelOrthogonalPosF', 'cnInfoLabelParallelPosF',
- 'cnInfoLabelPerimColor', 'cnInfoLabelPerimOn',
- 'cnInfoLabelPerimSpaceF', 'cnInfoLabelPerimThicknessF',
- 'cnInfoLabelSide', 'cnInfoLabelString', 'cnInfoLabelTextDirection',
- 'cnInfoLabelZone', 'cnLabelBarEndLabelsOn', 'cnLabelBarEndStyle',
- 'cnLabelDrawOrder', 'cnLabelMasking', 'cnLabelScaleFactorF',
- 'cnLabelScaleValueF', 'cnLabelScalingMode', 'cnLegendLevelFlags',
- 'cnLevelCount', 'cnLevelFlag', 'cnLevelFlags', 'cnLevelSelectionMode',
- 'cnLevelSpacingF', 'cnLevels', 'cnLineColor', 'cnLineColors',
- 'cnLineDashPattern', 'cnLineDashPatterns', 'cnLineDashSegLenF',
- 'cnLineDrawOrder', 'cnLineLabelAngleF', 'cnLineLabelBackgroundColor',
- 'cnLineLabelConstantSpacingF', 'cnLineLabelCount',
- 'cnLineLabelDensityF', 'cnLineLabelFont', 'cnLineLabelFontAspectF',
- 'cnLineLabelFontColor', 'cnLineLabelFontColors',
- 'cnLineLabelFontHeightF', 'cnLineLabelFontQuality',
- 'cnLineLabelFontThicknessF', 'cnLineLabelFormat',
- 'cnLineLabelFuncCode', 'cnLineLabelInterval', 'cnLineLabelPerimColor',
- 'cnLineLabelPerimOn', 'cnLineLabelPerimSpaceF',
- 'cnLineLabelPerimThicknessF', 'cnLineLabelPlacementMode',
- 'cnLineLabelStrings', 'cnLineLabelsOn', 'cnLinePalette',
- 'cnLineThicknessF', 'cnLineThicknesses', 'cnLinesOn',
- 'cnLowLabelAngleF', 'cnLowLabelBackgroundColor',
- 'cnLowLabelConstantSpacingF', 'cnLowLabelCount', 'cnLowLabelFont',
- 'cnLowLabelFontAspectF', 'cnLowLabelFontColor',
- 'cnLowLabelFontHeightF', 'cnLowLabelFontQuality',
- 'cnLowLabelFontThicknessF', 'cnLowLabelFormat', 'cnLowLabelFuncCode',
- 'cnLowLabelPerimColor', 'cnLowLabelPerimOn', 'cnLowLabelPerimSpaceF',
- 'cnLowLabelPerimThicknessF', 'cnLowLabelString', 'cnLowLabelsOn',
- 'cnLowUseHighLabelRes', 'cnMaxDataValueFormat', 'cnMaxLevelCount',
- 'cnMaxLevelValF', 'cnMaxPointDistanceF', 'cnMinLevelValF',
- 'cnMissingValFillColor', 'cnMissingValFillPattern',
- 'cnMissingValFillScaleF', 'cnMissingValPerimColor',
- 'cnMissingValPerimDashPattern', 'cnMissingValPerimGridBoundOn',
- 'cnMissingValPerimOn', 'cnMissingValPerimThicknessF',
- 'cnMonoFillColor', 'cnMonoFillPattern', 'cnMonoFillScale',
- 'cnMonoLevelFlag', 'cnMonoLineColor', 'cnMonoLineDashPattern',
- 'cnMonoLineLabelFontColor', 'cnMonoLineThickness', 'cnNoDataLabelOn',
- 'cnNoDataLabelString', 'cnOutOfRangeFillColor',
- 'cnOutOfRangeFillPattern', 'cnOutOfRangeFillScaleF',
- 'cnOutOfRangePerimColor', 'cnOutOfRangePerimDashPattern',
- 'cnOutOfRangePerimOn', 'cnOutOfRangePerimThicknessF',
- 'cnRasterCellSizeF', 'cnRasterMinCellSizeF', 'cnRasterModeOn',
- 'cnRasterSampleFactorF', 'cnRasterSmoothingOn', 'cnScalarFieldData',
- 'cnSmoothingDistanceF', 'cnSmoothingOn', 'cnSmoothingTensionF',
- 'cnSpanFillPalette', 'cnSpanLinePalette', 'ctCopyTables',
- 'ctXElementSize', 'ctXMaxV', 'ctXMinV', 'ctXMissingV', 'ctXTable',
- 'ctXTableLengths', 'ctXTableType', 'ctYElementSize', 'ctYMaxV',
- 'ctYMinV', 'ctYMissingV', 'ctYTable', 'ctYTableLengths',
- 'ctYTableType', 'dcDelayCompute', 'errBuffer',
- 'errFileName', 'errFilePtr', 'errLevel', 'errPrint', 'errUnitNumber',
- 'gsClipOn', 'gsColors', 'gsEdgeColor', 'gsEdgeDashPattern',
- 'gsEdgeDashSegLenF', 'gsEdgeThicknessF', 'gsEdgesOn',
- 'gsFillBackgroundColor', 'gsFillColor', 'gsFillDotSizeF',
- 'gsFillIndex', 'gsFillLineThicknessF', 'gsFillOpacityF',
- 'gsFillScaleF', 'gsFont', 'gsFontAspectF', 'gsFontColor',
- 'gsFontHeightF', 'gsFontOpacityF', 'gsFontQuality',
- 'gsFontThicknessF', 'gsLineColor', 'gsLineDashPattern',
- 'gsLineDashSegLenF', 'gsLineLabelConstantSpacingF', 'gsLineLabelFont',
- 'gsLineLabelFontAspectF', 'gsLineLabelFontColor',
- 'gsLineLabelFontHeightF', 'gsLineLabelFontQuality',
- 'gsLineLabelFontThicknessF', 'gsLineLabelFuncCode',
- 'gsLineLabelString', 'gsLineOpacityF', 'gsLineThicknessF',
- 'gsMarkerColor', 'gsMarkerIndex', 'gsMarkerOpacityF', 'gsMarkerSizeF',
- 'gsMarkerThicknessF', 'gsSegments', 'gsTextAngleF',
- 'gsTextConstantSpacingF', 'gsTextDirection', 'gsTextFuncCode',
- 'gsTextJustification', 'gsnAboveYRefLineBarColors',
- 'gsnAboveYRefLineBarFillScales', 'gsnAboveYRefLineBarPatterns',
- 'gsnAboveYRefLineColor', 'gsnAddCyclic', 'gsnAttachBorderOn',
- 'gsnAttachPlotsXAxis', 'gsnBelowYRefLineBarColors',
- 'gsnBelowYRefLineBarFillScales', 'gsnBelowYRefLineBarPatterns',
- 'gsnBelowYRefLineColor', 'gsnBoxMargin', 'gsnCenterString',
- 'gsnCenterStringFontColor', 'gsnCenterStringFontHeightF',
- 'gsnCenterStringFuncCode', 'gsnCenterStringOrthogonalPosF',
- 'gsnCenterStringParallelPosF', 'gsnContourLineThicknessesScale',
- 'gsnContourNegLineDashPattern', 'gsnContourPosLineDashPattern',
- 'gsnContourZeroLineThicknessF', 'gsnDebugWriteFileName', 'gsnDraw',
- 'gsnFrame', 'gsnHistogramBarWidthPercent', 'gsnHistogramBinIntervals',
- 'gsnHistogramBinMissing', 'gsnHistogramBinWidth',
- 'gsnHistogramClassIntervals', 'gsnHistogramCompare',
- 'gsnHistogramComputePercentages',
- 'gsnHistogramComputePercentagesNoMissing',
- 'gsnHistogramDiscreteBinValues', 'gsnHistogramDiscreteClassValues',
- 'gsnHistogramHorizontal', 'gsnHistogramMinMaxBinsOn',
- 'gsnHistogramNumberOfBins', 'gsnHistogramPercentSign',
- 'gsnHistogramSelectNiceIntervals', 'gsnLeftString',
- 'gsnLeftStringFontColor', 'gsnLeftStringFontHeightF',
- 'gsnLeftStringFuncCode', 'gsnLeftStringOrthogonalPosF',
- 'gsnLeftStringParallelPosF', 'gsnMajorLatSpacing',
- 'gsnMajorLonSpacing', 'gsnMaskLambertConformal',
- 'gsnMaskLambertConformalOutlineOn', 'gsnMaximize',
- 'gsnMinorLatSpacing', 'gsnMinorLonSpacing', 'gsnPanelBottom',
- 'gsnPanelCenter', 'gsnPanelDebug', 'gsnPanelFigureStrings',
- 'gsnPanelFigureStringsBackgroundFillColor',
- 'gsnPanelFigureStringsFontHeightF', 'gsnPanelFigureStringsJust',
- 'gsnPanelFigureStringsPerimOn', 'gsnPanelLabelBar', 'gsnPanelLeft',
- 'gsnPanelMainFont', 'gsnPanelMainFontColor',
- 'gsnPanelMainFontHeightF', 'gsnPanelMainString', 'gsnPanelRight',
- 'gsnPanelRowSpec', 'gsnPanelScalePlotIndex', 'gsnPanelTop',
- 'gsnPanelXF', 'gsnPanelXWhiteSpacePercent', 'gsnPanelYF',
- 'gsnPanelYWhiteSpacePercent', 'gsnPaperHeight', 'gsnPaperMargin',
- 'gsnPaperOrientation', 'gsnPaperWidth', 'gsnPolar',
- 'gsnPolarLabelDistance', 'gsnPolarLabelFont',
- 'gsnPolarLabelFontHeightF', 'gsnPolarLabelSpacing', 'gsnPolarTime',
- 'gsnPolarUT', 'gsnRightString', 'gsnRightStringFontColor',
- 'gsnRightStringFontHeightF', 'gsnRightStringFuncCode',
- 'gsnRightStringOrthogonalPosF', 'gsnRightStringParallelPosF',
- 'gsnScalarContour', 'gsnScale', 'gsnShape', 'gsnSpreadColorEnd',
- 'gsnSpreadColorStart', 'gsnSpreadColors', 'gsnStringFont',
- 'gsnStringFontColor', 'gsnStringFontHeightF', 'gsnStringFuncCode',
- 'gsnTickMarksOn', 'gsnXAxisIrregular2Linear', 'gsnXAxisIrregular2Log',
- 'gsnXRefLine', 'gsnXRefLineColor', 'gsnXRefLineDashPattern',
- 'gsnXRefLineThicknessF', 'gsnXYAboveFillColors', 'gsnXYBarChart',
- 'gsnXYBarChartBarWidth', 'gsnXYBarChartColors',
- 'gsnXYBarChartColors2', 'gsnXYBarChartFillDotSizeF',
- 'gsnXYBarChartFillLineThicknessF', 'gsnXYBarChartFillOpacityF',
- 'gsnXYBarChartFillScaleF', 'gsnXYBarChartOutlineOnly',
- 'gsnXYBarChartOutlineThicknessF', 'gsnXYBarChartPatterns',
- 'gsnXYBarChartPatterns2', 'gsnXYBelowFillColors', 'gsnXYFillColors',
- 'gsnXYFillOpacities', 'gsnXYLeftFillColors', 'gsnXYRightFillColors',
- 'gsnYAxisIrregular2Linear', 'gsnYAxisIrregular2Log', 'gsnYRefLine',
- 'gsnYRefLineColor', 'gsnYRefLineColors', 'gsnYRefLineDashPattern',
- 'gsnYRefLineDashPatterns', 'gsnYRefLineThicknessF',
- 'gsnYRefLineThicknesses', 'gsnZonalMean', 'gsnZonalMeanXMaxF',
- 'gsnZonalMeanXMinF', 'gsnZonalMeanYRefLine', 'lbAutoManage',
- 'lbBottomMarginF', 'lbBoxCount', 'lbBoxEndCapStyle', 'lbBoxFractions',
- 'lbBoxLineColor', 'lbBoxLineDashPattern', 'lbBoxLineDashSegLenF',
- 'lbBoxLineThicknessF', 'lbBoxLinesOn', 'lbBoxMajorExtentF',
- 'lbBoxMinorExtentF', 'lbBoxSeparatorLinesOn', 'lbBoxSizing',
- 'lbFillBackground', 'lbFillColor', 'lbFillColors', 'lbFillDotSizeF',
- 'lbFillLineThicknessF', 'lbFillPattern', 'lbFillPatterns',
- 'lbFillScaleF', 'lbFillScales', 'lbJustification', 'lbLabelAlignment',
- 'lbLabelAngleF', 'lbLabelAutoStride', 'lbLabelBarOn',
- 'lbLabelConstantSpacingF', 'lbLabelDirection', 'lbLabelFont',
- 'lbLabelFontAspectF', 'lbLabelFontColor', 'lbLabelFontHeightF',
- 'lbLabelFontQuality', 'lbLabelFontThicknessF', 'lbLabelFuncCode',
- 'lbLabelJust', 'lbLabelOffsetF', 'lbLabelPosition', 'lbLabelStride',
- 'lbLabelStrings', 'lbLabelsOn', 'lbLeftMarginF', 'lbMaxLabelLenF',
- 'lbMinLabelSpacingF', 'lbMonoFillColor', 'lbMonoFillPattern',
- 'lbMonoFillScale', 'lbOrientation', 'lbPerimColor',
- 'lbPerimDashPattern', 'lbPerimDashSegLenF', 'lbPerimFill',
- 'lbPerimFillColor', 'lbPerimOn', 'lbPerimThicknessF',
- 'lbRasterFillOn', 'lbRightMarginF', 'lbTitleAngleF',
- 'lbTitleConstantSpacingF', 'lbTitleDirection', 'lbTitleExtentF',
- 'lbTitleFont', 'lbTitleFontAspectF', 'lbTitleFontColor',
- 'lbTitleFontHeightF', 'lbTitleFontQuality', 'lbTitleFontThicknessF',
- 'lbTitleFuncCode', 'lbTitleJust', 'lbTitleOffsetF', 'lbTitleOn',
- 'lbTitlePosition', 'lbTitleString', 'lbTopMarginF', 'lgAutoManage',
- 'lgBottomMarginF', 'lgBoxBackground', 'lgBoxLineColor',
- 'lgBoxLineDashPattern', 'lgBoxLineDashSegLenF', 'lgBoxLineThicknessF',
- 'lgBoxLinesOn', 'lgBoxMajorExtentF', 'lgBoxMinorExtentF',
- 'lgDashIndex', 'lgDashIndexes', 'lgItemCount', 'lgItemOrder',
- 'lgItemPlacement', 'lgItemPositions', 'lgItemType', 'lgItemTypes',
- 'lgJustification', 'lgLabelAlignment', 'lgLabelAngleF',
- 'lgLabelAutoStride', 'lgLabelConstantSpacingF', 'lgLabelDirection',
- 'lgLabelFont', 'lgLabelFontAspectF', 'lgLabelFontColor',
- 'lgLabelFontHeightF', 'lgLabelFontQuality', 'lgLabelFontThicknessF',
- 'lgLabelFuncCode', 'lgLabelJust', 'lgLabelOffsetF', 'lgLabelPosition',
- 'lgLabelStride', 'lgLabelStrings', 'lgLabelsOn', 'lgLeftMarginF',
- 'lgLegendOn', 'lgLineColor', 'lgLineColors', 'lgLineDashSegLenF',
- 'lgLineDashSegLens', 'lgLineLabelConstantSpacingF', 'lgLineLabelFont',
- 'lgLineLabelFontAspectF', 'lgLineLabelFontColor',
- 'lgLineLabelFontColors', 'lgLineLabelFontHeightF',
- 'lgLineLabelFontHeights', 'lgLineLabelFontQuality',
- 'lgLineLabelFontThicknessF', 'lgLineLabelFuncCode',
- 'lgLineLabelStrings', 'lgLineLabelsOn', 'lgLineThicknessF',
- 'lgLineThicknesses', 'lgMarkerColor', 'lgMarkerColors',
- 'lgMarkerIndex', 'lgMarkerIndexes', 'lgMarkerSizeF', 'lgMarkerSizes',
- 'lgMarkerThicknessF', 'lgMarkerThicknesses', 'lgMonoDashIndex',
- 'lgMonoItemType', 'lgMonoLineColor', 'lgMonoLineDashSegLen',
- 'lgMonoLineLabelFontColor', 'lgMonoLineLabelFontHeight',
- 'lgMonoLineThickness', 'lgMonoMarkerColor', 'lgMonoMarkerIndex',
- 'lgMonoMarkerSize', 'lgMonoMarkerThickness', 'lgOrientation',
- 'lgPerimColor', 'lgPerimDashPattern', 'lgPerimDashSegLenF',
- 'lgPerimFill', 'lgPerimFillColor', 'lgPerimOn', 'lgPerimThicknessF',
- 'lgRightMarginF', 'lgTitleAngleF', 'lgTitleConstantSpacingF',
- 'lgTitleDirection', 'lgTitleExtentF', 'lgTitleFont',
- 'lgTitleFontAspectF', 'lgTitleFontColor', 'lgTitleFontHeightF',
- 'lgTitleFontQuality', 'lgTitleFontThicknessF', 'lgTitleFuncCode',
- 'lgTitleJust', 'lgTitleOffsetF', 'lgTitleOn', 'lgTitlePosition',
- 'lgTitleString', 'lgTopMarginF', 'mpAreaGroupCount',
- 'mpAreaMaskingOn', 'mpAreaNames', 'mpAreaTypes', 'mpBottomAngleF',
- 'mpBottomMapPosF', 'mpBottomNDCF', 'mpBottomNPCF',
- 'mpBottomPointLatF', 'mpBottomPointLonF', 'mpBottomWindowF',
- 'mpCenterLatF', 'mpCenterLonF', 'mpCenterRotF', 'mpCountyLineColor',
- 'mpCountyLineDashPattern', 'mpCountyLineDashSegLenF',
- 'mpCountyLineThicknessF', 'mpDataBaseVersion', 'mpDataResolution',
- 'mpDataSetName', 'mpDefaultFillColor', 'mpDefaultFillPattern',
- 'mpDefaultFillScaleF', 'mpDynamicAreaGroups', 'mpEllipticalBoundary',
- 'mpFillAreaSpecifiers', 'mpFillBoundarySets', 'mpFillColor',
- 'mpFillColors', 'mpFillColors-default', 'mpFillDotSizeF',
- 'mpFillDrawOrder', 'mpFillOn', 'mpFillPatternBackground',
- 'mpFillPattern', 'mpFillPatterns', 'mpFillPatterns-default',
- 'mpFillScaleF', 'mpFillScales', 'mpFillScales-default',
- 'mpFixedAreaGroups', 'mpGeophysicalLineColor',
- 'mpGeophysicalLineDashPattern', 'mpGeophysicalLineDashSegLenF',
- 'mpGeophysicalLineThicknessF', 'mpGreatCircleLinesOn',
- 'mpGridAndLimbDrawOrder', 'mpGridAndLimbOn', 'mpGridLatSpacingF',
- 'mpGridLineColor', 'mpGridLineDashPattern', 'mpGridLineDashSegLenF',
- 'mpGridLineThicknessF', 'mpGridLonSpacingF', 'mpGridMaskMode',
- 'mpGridMaxLatF', 'mpGridPolarLonSpacingF', 'mpGridSpacingF',
- 'mpInlandWaterFillColor', 'mpInlandWaterFillPattern',
- 'mpInlandWaterFillScaleF', 'mpLabelDrawOrder', 'mpLabelFontColor',
- 'mpLabelFontHeightF', 'mpLabelsOn', 'mpLambertMeridianF',
- 'mpLambertParallel1F', 'mpLambertParallel2F', 'mpLandFillColor',
- 'mpLandFillPattern', 'mpLandFillScaleF', 'mpLeftAngleF',
- 'mpLeftCornerLatF', 'mpLeftCornerLonF', 'mpLeftMapPosF',
- 'mpLeftNDCF', 'mpLeftNPCF', 'mpLeftPointLatF',
- 'mpLeftPointLonF', 'mpLeftWindowF', 'mpLimbLineColor',
- 'mpLimbLineDashPattern', 'mpLimbLineDashSegLenF',
- 'mpLimbLineThicknessF', 'mpLimitMode', 'mpMaskAreaSpecifiers',
- 'mpMaskOutlineSpecifiers', 'mpMaxLatF', 'mpMaxLonF',
- 'mpMinLatF', 'mpMinLonF', 'mpMonoFillColor', 'mpMonoFillPattern',
- 'mpMonoFillScale', 'mpNationalLineColor', 'mpNationalLineDashPattern',
- 'mpNationalLineThicknessF', 'mpOceanFillColor', 'mpOceanFillPattern',
- 'mpOceanFillScaleF', 'mpOutlineBoundarySets', 'mpOutlineDrawOrder',
- 'mpOutlineMaskingOn', 'mpOutlineOn', 'mpOutlineSpecifiers',
- 'mpPerimDrawOrder', 'mpPerimLineColor', 'mpPerimLineDashPattern',
- 'mpPerimLineDashSegLenF', 'mpPerimLineThicknessF', 'mpPerimOn',
- 'mpPolyMode', 'mpProjection', 'mpProvincialLineColor',
- 'mpProvincialLineDashPattern', 'mpProvincialLineDashSegLenF',
- 'mpProvincialLineThicknessF', 'mpRelativeCenterLat',
- 'mpRelativeCenterLon', 'mpRightAngleF', 'mpRightCornerLatF',
- 'mpRightCornerLonF', 'mpRightMapPosF', 'mpRightNDCF',
- 'mpRightNPCF', 'mpRightPointLatF', 'mpRightPointLonF',
- 'mpRightWindowF', 'mpSatelliteAngle1F', 'mpSatelliteAngle2F',
- 'mpSatelliteDistF', 'mpShapeMode', 'mpSpecifiedFillColors',
- 'mpSpecifiedFillDirectIndexing', 'mpSpecifiedFillPatterns',
- 'mpSpecifiedFillPriority', 'mpSpecifiedFillScales',
- 'mpTopAngleF', 'mpTopMapPosF', 'mpTopNDCF', 'mpTopNPCF',
- 'mpTopPointLatF', 'mpTopPointLonF', 'mpTopWindowF',
- 'mpUSStateLineColor', 'mpUSStateLineDashPattern',
- 'mpUSStateLineDashSegLenF', 'mpUSStateLineThicknessF',
- 'pmAnnoManagers', 'pmAnnoViews', 'pmLabelBarDisplayMode',
- 'pmLabelBarHeightF', 'pmLabelBarKeepAspect', 'pmLabelBarOrthogonalPosF',
- 'pmLabelBarParallelPosF', 'pmLabelBarSide', 'pmLabelBarWidthF',
- 'pmLabelBarZone', 'pmLegendDisplayMode', 'pmLegendHeightF',
- 'pmLegendKeepAspect', 'pmLegendOrthogonalPosF',
- 'pmLegendParallelPosF', 'pmLegendSide', 'pmLegendWidthF',
- 'pmLegendZone', 'pmOverlaySequenceIds', 'pmTickMarkDisplayMode',
- 'pmTickMarkZone', 'pmTitleDisplayMode', 'pmTitleZone',
- 'prGraphicStyle', 'prPolyType', 'prXArray', 'prYArray',
- 'sfCopyData', 'sfDataArray', 'sfDataMaxV', 'sfDataMinV',
- 'sfElementNodes', 'sfExchangeDimensions', 'sfFirstNodeIndex',
- 'sfMissingValueV', 'sfXArray', 'sfXCActualEndF', 'sfXCActualStartF',
- 'sfXCEndIndex', 'sfXCEndSubsetV', 'sfXCEndV', 'sfXCStartIndex',
- 'sfXCStartSubsetV', 'sfXCStartV', 'sfXCStride', 'sfXCellBounds',
- 'sfYArray', 'sfYCActualEndF', 'sfYCActualStartF', 'sfYCEndIndex',
- 'sfYCEndSubsetV', 'sfYCEndV', 'sfYCStartIndex', 'sfYCStartSubsetV',
- 'sfYCStartV', 'sfYCStride', 'sfYCellBounds', 'stArrowLengthF',
- 'stArrowStride', 'stCrossoverCheckCount',
- 'stExplicitLabelBarLabelsOn', 'stLabelBarEndLabelsOn',
- 'stLabelFormat', 'stLengthCheckCount', 'stLevelColors',
- 'stLevelCount', 'stLevelPalette', 'stLevelSelectionMode',
- 'stLevelSpacingF', 'stLevels', 'stLineColor', 'stLineOpacityF',
- 'stLineStartStride', 'stLineThicknessF', 'stMapDirection',
- 'stMaxLevelCount', 'stMaxLevelValF', 'stMinArrowSpacingF',
- 'stMinDistanceF', 'stMinLevelValF', 'stMinLineSpacingF',
- 'stMinStepFactorF', 'stMonoLineColor', 'stNoDataLabelOn',
- 'stNoDataLabelString', 'stScalarFieldData', 'stScalarMissingValColor',
- 'stSpanLevelPalette', 'stStepSizeF', 'stStreamlineDrawOrder',
- 'stUseScalarArray', 'stVectorFieldData', 'stZeroFLabelAngleF',
- 'stZeroFLabelBackgroundColor', 'stZeroFLabelConstantSpacingF',
- 'stZeroFLabelFont', 'stZeroFLabelFontAspectF',
- 'stZeroFLabelFontColor', 'stZeroFLabelFontHeightF',
- 'stZeroFLabelFontQuality', 'stZeroFLabelFontThicknessF',
- 'stZeroFLabelFuncCode', 'stZeroFLabelJust', 'stZeroFLabelOn',
- 'stZeroFLabelOrthogonalPosF', 'stZeroFLabelParallelPosF',
- 'stZeroFLabelPerimColor', 'stZeroFLabelPerimOn',
- 'stZeroFLabelPerimSpaceF', 'stZeroFLabelPerimThicknessF',
- 'stZeroFLabelSide', 'stZeroFLabelString', 'stZeroFLabelTextDirection',
- 'stZeroFLabelZone', 'tfDoNDCOverlay', 'tfPlotManagerOn',
- 'tfPolyDrawList', 'tfPolyDrawOrder', 'tiDeltaF', 'tiMainAngleF',
- 'tiMainConstantSpacingF', 'tiMainDirection', 'tiMainFont',
- 'tiMainFontAspectF', 'tiMainFontColor', 'tiMainFontHeightF',
- 'tiMainFontQuality', 'tiMainFontThicknessF', 'tiMainFuncCode',
- 'tiMainJust', 'tiMainOffsetXF', 'tiMainOffsetYF', 'tiMainOn',
- 'tiMainPosition', 'tiMainSide', 'tiMainString', 'tiUseMainAttributes',
- 'tiXAxisAngleF', 'tiXAxisConstantSpacingF', 'tiXAxisDirection',
- 'tiXAxisFont', 'tiXAxisFontAspectF', 'tiXAxisFontColor',
- 'tiXAxisFontHeightF', 'tiXAxisFontQuality', 'tiXAxisFontThicknessF',
- 'tiXAxisFuncCode', 'tiXAxisJust', 'tiXAxisOffsetXF',
- 'tiXAxisOffsetYF', 'tiXAxisOn', 'tiXAxisPosition', 'tiXAxisSide',
- 'tiXAxisString', 'tiYAxisAngleF', 'tiYAxisConstantSpacingF',
- 'tiYAxisDirection', 'tiYAxisFont', 'tiYAxisFontAspectF',
- 'tiYAxisFontColor', 'tiYAxisFontHeightF', 'tiYAxisFontQuality',
- 'tiYAxisFontThicknessF', 'tiYAxisFuncCode', 'tiYAxisJust',
- 'tiYAxisOffsetXF', 'tiYAxisOffsetYF', 'tiYAxisOn', 'tiYAxisPosition',
- 'tiYAxisSide', 'tiYAxisString', 'tmBorderLineColor',
- 'tmBorderThicknessF', 'tmEqualizeXYSizes', 'tmLabelAutoStride',
- 'tmSciNoteCutoff', 'tmXBAutoPrecision', 'tmXBBorderOn',
- 'tmXBDataLeftF', 'tmXBDataRightF', 'tmXBFormat', 'tmXBIrrTensionF',
- 'tmXBIrregularPoints', 'tmXBLabelAngleF', 'tmXBLabelConstantSpacingF',
- 'tmXBLabelDeltaF', 'tmXBLabelDirection', 'tmXBLabelFont',
- 'tmXBLabelFontAspectF', 'tmXBLabelFontColor', 'tmXBLabelFontHeightF',
- 'tmXBLabelFontQuality', 'tmXBLabelFontThicknessF',
- 'tmXBLabelFuncCode', 'tmXBLabelJust', 'tmXBLabelStride', 'tmXBLabels',
- 'tmXBLabelsOn', 'tmXBMajorLengthF', 'tmXBMajorLineColor',
- 'tmXBMajorOutwardLengthF', 'tmXBMajorThicknessF', 'tmXBMaxLabelLenF',
- 'tmXBMaxTicks', 'tmXBMinLabelSpacingF', 'tmXBMinorLengthF',
- 'tmXBMinorLineColor', 'tmXBMinorOn', 'tmXBMinorOutwardLengthF',
- 'tmXBMinorPerMajor', 'tmXBMinorThicknessF', 'tmXBMinorValues',
- 'tmXBMode', 'tmXBOn', 'tmXBPrecision', 'tmXBStyle', 'tmXBTickEndF',
- 'tmXBTickSpacingF', 'tmXBTickStartF', 'tmXBValues', 'tmXMajorGrid',
- 'tmXMajorGridLineColor', 'tmXMajorGridLineDashPattern',
- 'tmXMajorGridThicknessF', 'tmXMinorGrid', 'tmXMinorGridLineColor',
- 'tmXMinorGridLineDashPattern', 'tmXMinorGridThicknessF',
- 'tmXTAutoPrecision', 'tmXTBorderOn', 'tmXTDataLeftF',
- 'tmXTDataRightF', 'tmXTFormat', 'tmXTIrrTensionF',
- 'tmXTIrregularPoints', 'tmXTLabelAngleF', 'tmXTLabelConstantSpacingF',
- 'tmXTLabelDeltaF', 'tmXTLabelDirection', 'tmXTLabelFont',
- 'tmXTLabelFontAspectF', 'tmXTLabelFontColor', 'tmXTLabelFontHeightF',
- 'tmXTLabelFontQuality', 'tmXTLabelFontThicknessF',
- 'tmXTLabelFuncCode', 'tmXTLabelJust', 'tmXTLabelStride', 'tmXTLabels',
- 'tmXTLabelsOn', 'tmXTMajorLengthF', 'tmXTMajorLineColor',
- 'tmXTMajorOutwardLengthF', 'tmXTMajorThicknessF', 'tmXTMaxLabelLenF',
- 'tmXTMaxTicks', 'tmXTMinLabelSpacingF', 'tmXTMinorLengthF',
- 'tmXTMinorLineColor', 'tmXTMinorOn', 'tmXTMinorOutwardLengthF',
- 'tmXTMinorPerMajor', 'tmXTMinorThicknessF', 'tmXTMinorValues',
- 'tmXTMode', 'tmXTOn', 'tmXTPrecision', 'tmXTStyle', 'tmXTTickEndF',
- 'tmXTTickSpacingF', 'tmXTTickStartF', 'tmXTValues', 'tmXUseBottom',
- 'tmYLAutoPrecision', 'tmYLBorderOn', 'tmYLDataBottomF',
- 'tmYLDataTopF', 'tmYLFormat', 'tmYLIrrTensionF',
- 'tmYLIrregularPoints', 'tmYLLabelAngleF', 'tmYLLabelConstantSpacingF',
- 'tmYLLabelDeltaF', 'tmYLLabelDirection', 'tmYLLabelFont',
- 'tmYLLabelFontAspectF', 'tmYLLabelFontColor', 'tmYLLabelFontHeightF',
- 'tmYLLabelFontQuality', 'tmYLLabelFontThicknessF',
- 'tmYLLabelFuncCode', 'tmYLLabelJust', 'tmYLLabelStride', 'tmYLLabels',
- 'tmYLLabelsOn', 'tmYLMajorLengthF', 'tmYLMajorLineColor',
- 'tmYLMajorOutwardLengthF', 'tmYLMajorThicknessF', 'tmYLMaxLabelLenF',
- 'tmYLMaxTicks', 'tmYLMinLabelSpacingF', 'tmYLMinorLengthF',
- 'tmYLMinorLineColor', 'tmYLMinorOn', 'tmYLMinorOutwardLengthF',
- 'tmYLMinorPerMajor', 'tmYLMinorThicknessF', 'tmYLMinorValues',
- 'tmYLMode', 'tmYLOn', 'tmYLPrecision', 'tmYLStyle', 'tmYLTickEndF',
- 'tmYLTickSpacingF', 'tmYLTickStartF', 'tmYLValues', 'tmYMajorGrid',
- 'tmYMajorGridLineColor', 'tmYMajorGridLineDashPattern',
- 'tmYMajorGridThicknessF', 'tmYMinorGrid', 'tmYMinorGridLineColor',
- 'tmYMinorGridLineDashPattern', 'tmYMinorGridThicknessF',
- 'tmYRAutoPrecision', 'tmYRBorderOn', 'tmYRDataBottomF',
- 'tmYRDataTopF', 'tmYRFormat', 'tmYRIrrTensionF',
- 'tmYRIrregularPoints', 'tmYRLabelAngleF', 'tmYRLabelConstantSpacingF',
- 'tmYRLabelDeltaF', 'tmYRLabelDirection', 'tmYRLabelFont',
- 'tmYRLabelFontAspectF', 'tmYRLabelFontColor', 'tmYRLabelFontHeightF',
- 'tmYRLabelFontQuality', 'tmYRLabelFontThicknessF',
- 'tmYRLabelFuncCode', 'tmYRLabelJust', 'tmYRLabelStride', 'tmYRLabels',
- 'tmYRLabelsOn', 'tmYRMajorLengthF', 'tmYRMajorLineColor',
- 'tmYRMajorOutwardLengthF', 'tmYRMajorThicknessF', 'tmYRMaxLabelLenF',
- 'tmYRMaxTicks', 'tmYRMinLabelSpacingF', 'tmYRMinorLengthF',
- 'tmYRMinorLineColor', 'tmYRMinorOn', 'tmYRMinorOutwardLengthF',
- 'tmYRMinorPerMajor', 'tmYRMinorThicknessF', 'tmYRMinorValues',
- 'tmYRMode', 'tmYROn', 'tmYRPrecision', 'tmYRStyle', 'tmYRTickEndF',
- 'tmYRTickSpacingF', 'tmYRTickStartF', 'tmYRValues', 'tmYUseLeft',
- 'trGridType', 'trLineInterpolationOn',
- 'trXAxisType', 'trXCoordPoints', 'trXInterPoints', 'trXLog',
- 'trXMaxF', 'trXMinF', 'trXReverse', 'trXSamples', 'trXTensionF',
- 'trYAxisType', 'trYCoordPoints', 'trYInterPoints', 'trYLog',
- 'trYMaxF', 'trYMinF', 'trYReverse', 'trYSamples', 'trYTensionF',
- 'txAngleF', 'txBackgroundFillColor', 'txConstantSpacingF', 'txDirection',
- 'txFont', 'HLU-Fonts', 'txFontAspectF', 'txFontColor',
- 'txFontHeightF', 'txFontOpacityF', 'txFontQuality',
- 'txFontThicknessF', 'txFuncCode', 'txJust', 'txPerimColor',
- 'txPerimDashLengthF', 'txPerimDashPattern', 'txPerimOn',
- 'txPerimSpaceF', 'txPerimThicknessF', 'txPosXF', 'txPosYF',
- 'txString', 'vcExplicitLabelBarLabelsOn', 'vcFillArrowEdgeColor',
- 'vcFillArrowEdgeThicknessF', 'vcFillArrowFillColor',
- 'vcFillArrowHeadInteriorXF', 'vcFillArrowHeadMinFracXF',
- 'vcFillArrowHeadMinFracYF', 'vcFillArrowHeadXF', 'vcFillArrowHeadYF',
- 'vcFillArrowMinFracWidthF', 'vcFillArrowWidthF', 'vcFillArrowsOn',
- 'vcFillOverEdge', 'vcGlyphOpacityF', 'vcGlyphStyle',
- 'vcLabelBarEndLabelsOn', 'vcLabelFontColor', 'vcLabelFontHeightF',
- 'vcLabelsOn', 'vcLabelsUseVectorColor', 'vcLevelColors',
- 'vcLevelCount', 'vcLevelPalette', 'vcLevelSelectionMode',
- 'vcLevelSpacingF', 'vcLevels', 'vcLineArrowColor',
- 'vcLineArrowHeadMaxSizeF', 'vcLineArrowHeadMinSizeF',
- 'vcLineArrowThicknessF', 'vcMagnitudeFormat',
- 'vcMagnitudeScaleFactorF', 'vcMagnitudeScaleValueF',
- 'vcMagnitudeScalingMode', 'vcMapDirection', 'vcMaxLevelCount',
- 'vcMaxLevelValF', 'vcMaxMagnitudeF', 'vcMinAnnoAngleF',
- 'vcMinAnnoArrowAngleF', 'vcMinAnnoArrowEdgeColor',
- 'vcMinAnnoArrowFillColor', 'vcMinAnnoArrowLineColor',
- 'vcMinAnnoArrowMinOffsetF', 'vcMinAnnoArrowSpaceF',
- 'vcMinAnnoArrowUseVecColor', 'vcMinAnnoBackgroundColor',
- 'vcMinAnnoConstantSpacingF', 'vcMinAnnoExplicitMagnitudeF',
- 'vcMinAnnoFont', 'vcMinAnnoFontAspectF', 'vcMinAnnoFontColor',
- 'vcMinAnnoFontHeightF', 'vcMinAnnoFontQuality',
- 'vcMinAnnoFontThicknessF', 'vcMinAnnoFuncCode', 'vcMinAnnoJust',
- 'vcMinAnnoOn', 'vcMinAnnoOrientation', 'vcMinAnnoOrthogonalPosF',
- 'vcMinAnnoParallelPosF', 'vcMinAnnoPerimColor', 'vcMinAnnoPerimOn',
- 'vcMinAnnoPerimSpaceF', 'vcMinAnnoPerimThicknessF', 'vcMinAnnoSide',
- 'vcMinAnnoString1', 'vcMinAnnoString1On', 'vcMinAnnoString2',
- 'vcMinAnnoString2On', 'vcMinAnnoTextDirection', 'vcMinAnnoZone',
- 'vcMinDistanceF', 'vcMinFracLengthF', 'vcMinLevelValF',
- 'vcMinMagnitudeF', 'vcMonoFillArrowEdgeColor',
- 'vcMonoFillArrowFillColor', 'vcMonoLineArrowColor',
- 'vcMonoWindBarbColor', 'vcNoDataLabelOn', 'vcNoDataLabelString',
- 'vcPositionMode', 'vcRefAnnoAngleF', 'vcRefAnnoArrowAngleF',
- 'vcRefAnnoArrowEdgeColor', 'vcRefAnnoArrowFillColor',
- 'vcRefAnnoArrowLineColor', 'vcRefAnnoArrowMinOffsetF',
- 'vcRefAnnoArrowSpaceF', 'vcRefAnnoArrowUseVecColor',
- 'vcRefAnnoBackgroundColor', 'vcRefAnnoConstantSpacingF',
- 'vcRefAnnoExplicitMagnitudeF', 'vcRefAnnoFont',
- 'vcRefAnnoFontAspectF', 'vcRefAnnoFontColor', 'vcRefAnnoFontHeightF',
- 'vcRefAnnoFontQuality', 'vcRefAnnoFontThicknessF',
- 'vcRefAnnoFuncCode', 'vcRefAnnoJust', 'vcRefAnnoOn',
- 'vcRefAnnoOrientation', 'vcRefAnnoOrthogonalPosF',
- 'vcRefAnnoParallelPosF', 'vcRefAnnoPerimColor', 'vcRefAnnoPerimOn',
- 'vcRefAnnoPerimSpaceF', 'vcRefAnnoPerimThicknessF', 'vcRefAnnoSide',
- 'vcRefAnnoString1', 'vcRefAnnoString1On', 'vcRefAnnoString2',
- 'vcRefAnnoString2On', 'vcRefAnnoTextDirection', 'vcRefAnnoZone',
- 'vcRefLengthF', 'vcRefMagnitudeF', 'vcScalarFieldData',
- 'vcScalarMissingValColor', 'vcScalarValueFormat',
- 'vcScalarValueScaleFactorF', 'vcScalarValueScaleValueF',
- 'vcScalarValueScalingMode', 'vcSpanLevelPalette', 'vcUseRefAnnoRes',
- 'vcUseScalarArray', 'vcVectorDrawOrder', 'vcVectorFieldData',
- 'vcWindBarbCalmCircleSizeF', 'vcWindBarbColor',
- 'vcWindBarbLineThicknessF', 'vcWindBarbScaleFactorF',
- 'vcWindBarbTickAngleF', 'vcWindBarbTickLengthF',
- 'vcWindBarbTickSpacingF', 'vcZeroFLabelAngleF',
- 'vcZeroFLabelBackgroundColor', 'vcZeroFLabelConstantSpacingF',
- 'vcZeroFLabelFont', 'vcZeroFLabelFontAspectF',
- 'vcZeroFLabelFontColor', 'vcZeroFLabelFontHeightF',
- 'vcZeroFLabelFontQuality', 'vcZeroFLabelFontThicknessF',
- 'vcZeroFLabelFuncCode', 'vcZeroFLabelJust', 'vcZeroFLabelOn',
- 'vcZeroFLabelOrthogonalPosF', 'vcZeroFLabelParallelPosF',
- 'vcZeroFLabelPerimColor', 'vcZeroFLabelPerimOn',
- 'vcZeroFLabelPerimSpaceF', 'vcZeroFLabelPerimThicknessF',
- 'vcZeroFLabelSide', 'vcZeroFLabelString', 'vcZeroFLabelTextDirection',
- 'vcZeroFLabelZone', 'vfCopyData', 'vfDataArray',
- 'vfExchangeDimensions', 'vfExchangeUVData', 'vfMagMaxV', 'vfMagMinV',
- 'vfMissingUValueV', 'vfMissingVValueV', 'vfPolarData',
- 'vfSingleMissingValue', 'vfUDataArray', 'vfUMaxV', 'vfUMinV',
- 'vfVDataArray', 'vfVMaxV', 'vfVMinV', 'vfXArray', 'vfXCActualEndF',
- 'vfXCActualStartF', 'vfXCEndIndex', 'vfXCEndSubsetV', 'vfXCEndV',
- 'vfXCStartIndex', 'vfXCStartSubsetV', 'vfXCStartV', 'vfXCStride',
- 'vfYArray', 'vfYCActualEndF', 'vfYCActualStartF', 'vfYCEndIndex',
- 'vfYCEndSubsetV', 'vfYCEndV', 'vfYCStartIndex', 'vfYCStartSubsetV',
- 'vfYCStartV', 'vfYCStride', 'vpAnnoManagerId', 'vpClipOn',
- 'vpHeightF', 'vpKeepAspect', 'vpOn', 'vpUseSegments', 'vpWidthF',
- 'vpXF', 'vpYF', 'wkAntiAlias', 'wkBackgroundColor', 'wkBackgroundOpacityF',
- 'wkColorMapLen', 'wkColorMap', 'wkColorModel', 'wkDashTableLength',
- 'wkDefGraphicStyleId', 'wkDeviceLowerX', 'wkDeviceLowerY',
- 'wkDeviceUpperX', 'wkDeviceUpperY', 'wkFileName', 'wkFillTableLength',
- 'wkForegroundColor', 'wkFormat', 'wkFullBackground', 'wkGksWorkId',
- 'wkHeight', 'wkMarkerTableLength', 'wkMetaName', 'wkOrientation',
- 'wkPDFFileName', 'wkPDFFormat', 'wkPDFResolution', 'wkPSFileName',
- 'wkPSFormat', 'wkPSResolution', 'wkPaperHeightF', 'wkPaperSize',
- 'wkPaperWidthF', 'wkPause', 'wkTopLevelViews', 'wkViews',
- 'wkVisualType', 'wkWidth', 'wkWindowId', 'wkXColorMode', 'wsCurrentSize',
- 'wsMaximumSize', 'wsThresholdSize', 'xyComputeXMax',
- 'xyComputeXMin', 'xyComputeYMax', 'xyComputeYMin', 'xyCoordData',
- 'xyCoordDataSpec', 'xyCurveDrawOrder', 'xyDashPattern',
- 'xyDashPatterns', 'xyExplicitLabels', 'xyExplicitLegendLabels',
- 'xyLabelMode', 'xyLineColor', 'xyLineColors', 'xyLineDashSegLenF',
- 'xyLineLabelConstantSpacingF', 'xyLineLabelFont',
- 'xyLineLabelFontAspectF', 'xyLineLabelFontColor',
- 'xyLineLabelFontColors', 'xyLineLabelFontHeightF',
- 'xyLineLabelFontQuality', 'xyLineLabelFontThicknessF',
- 'xyLineLabelFuncCode', 'xyLineThicknessF', 'xyLineThicknesses',
- 'xyMarkLineMode', 'xyMarkLineModes', 'xyMarker', 'xyMarkerColor',
- 'xyMarkerColors', 'xyMarkerSizeF', 'xyMarkerSizes',
- 'xyMarkerThicknessF', 'xyMarkerThicknesses', 'xyMarkers',
- 'xyMonoDashPattern', 'xyMonoLineColor', 'xyMonoLineLabelFontColor',
- 'xyMonoLineThickness', 'xyMonoMarkLineMode', 'xyMonoMarker',
- 'xyMonoMarkerColor', 'xyMonoMarkerSize', 'xyMonoMarkerThickness',
- 'xyXIrrTensionF', 'xyXIrregularPoints', 'xyXStyle', 'xyYIrrTensionF',
- 'xyYIrregularPoints', 'xyYStyle'), prefix=r'\b'),
- Name.Builtin),
-
- # Booleans
- (r'\.(True|False)\.', Name.Builtin),
- # Comparing Operators
- (r'\.(eq|ne|lt|le|gt|ge|not|and|or|xor)\.', Operator.Word),
- ],
-
- 'strings': [
- (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
- ],
-
- 'nums': [
- (r'\d+(?![.e])(_[a-z]\w+)?', Number.Integer),
- (r'[+-]?\d*\.\d+(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float),
- (r'[+-]?\d+\.\d*(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float),
- ],
- }
diff --git a/pygments/lexers/nimrod.py b/pygments/lexers/nimrod.py
deleted file mode 100644
index 4c1bccf0..00000000
--- a/pygments/lexers/nimrod.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.nimrod
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Nim language (formerly known as Nimrod).
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-
-__all__ = ['NimrodLexer']
-
-
-class NimrodLexer(RegexLexer):
- """
- For `Nim <http://nim-lang.org/>`_ source code.
-
- .. versionadded:: 1.5
- """
-
- name = 'Nimrod'
- aliases = ['nim', 'nimrod']
- filenames = ['*.nim', '*.nimrod']
- mimetypes = ['text/x-nim']
-
- 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', 'concept', 'const', 'continue', 'converter', 'defer', 'discard',
- 'distinct', 'div', 'do', 'elif', 'else', 'end', 'enum', 'except',
- 'export', 'finally', 'for', 'func', 'if', 'in', 'yield', 'interface',
- 'is', 'isnot', 'iterator', 'let', 'macro', 'method', 'mixin', 'mod',
- 'not', 'notin', 'object', 'of', 'or', 'out', 'proc', 'ptr', 'raise',
- 'ref', 'return', 'shared', 'shl', 'shr', 'static', '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_]*(?=([e.]|\'f(32|64)))',
- Number.Float, ('float-suffix', 'float-number')),
- (r'0x[a-f0-9][a-f0-9_]*', Number.Hex, 'int-suffix'),
- (r'0b[01][01_]*', Number.Bin, '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-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-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'e[+-]?[0-9][0-9_]*', Number.Float),
- default('#pop')
- ],
- 'float-suffix': [
- (r'\'f(32|64)', Number.Float),
- default('#pop')
- ],
- 'int-suffix': [
- (r'\'i(32|64)', Number.Integer.Long),
- (r'\'i(8|16)', Number.Integer),
- default('#pop')
- ],
- }
diff --git a/pygments/lexers/nit.py b/pygments/lexers/nit.py
deleted file mode 100644
index 42167ece..00000000
--- a/pygments/lexers/nit.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.nit
- ~~~~~~~~~~~~~~~~~~~
-
- Lexer for the Nit language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['NitLexer']
-
-
-class NitLexer(RegexLexer):
- """
- For `nit <http://nitlanguage.org>`_ source.
-
- .. versionadded:: 2.0
- """
-
- name = 'Nit'
- aliases = ['nit']
- filenames = ['*.nit']
- tokens = {
- 'root': [
- (r'#.*?$', Comment.Single),
- (words((
- 'package', 'module', 'import', 'class', 'abstract', 'interface',
- 'universal', 'enum', 'end', 'fun', 'type', 'init', 'redef',
- 'isa', 'do', 'readable', 'writable', 'var', 'intern', 'extern',
- 'public', 'protected', 'private', 'intrude', 'if', 'then',
- 'else', 'while', 'loop', 'for', 'in', 'and', 'or', 'not',
- 'implies', 'return', 'continue', 'break', 'abort', 'assert',
- 'new', 'is', 'once', 'super', 'self', 'true', 'false', 'nullable',
- 'null', 'as', 'isset', 'label', '__debug__'), suffix=r'(?=[\r\n\t( ])'),
- Keyword),
- (r'[A-Z]\w*', Name.Class),
- (r'"""(([^\'\\]|\\.)|\\r|\\n)*((\{\{?)?(""?\{\{?)*""""*)', String), # Simple long string
- (r'\'\'\'(((\\.|[^\'\\])|\\r|\\n)|\'((\\.|[^\'\\])|\\r|\\n)|'
- r'\'\'((\\.|[^\'\\])|\\r|\\n))*\'\'\'', String), # Simple long string alt
- (r'"""(([^\'\\]|\\.)|\\r|\\n)*((""?)?(\{\{?""?)*\{\{\{\{*)', String), # Start long string
- (r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(""?)?(\{\{?""?)*\{\{\{\{*', String), # Mid long string
- (r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(\{\{?)?(""?\{\{?)*""""*', String), # End long string
- (r'"(\\.|([^"}{\\]))*"', String), # Simple String
- (r'"(\\.|([^"}{\\]))*\{', String), # Start string
- (r'\}(\\.|([^"}{\\]))*\{', String), # Mid String
- (r'\}(\\.|([^"}{\\]))*"', String), # End String
- (r'(\'[^\'\\]\')|(\'\\.\')', String.Char),
- (r'[0-9]+', Number.Integer),
- (r'[0-9]*.[0-9]+', Number.Float),
- (r'0(x|X)[0-9A-Fa-f]+', Number.Hex),
- (r'[a-z]\w*', Name),
- (r'_\w+', Name.Variable.Instance),
- (r'==|!=|<==>|>=|>>|>|<=|<<|<|\+|-|=|/|\*|%|\+=|-=|!|@', Operator),
- (r'\(|\)|\[|\]|,|\.\.\.|\.\.|\.|::|:', Punctuation),
- (r'`\{[^`]*`\}', Text), # Extern blocks won't be Lexed by Nit
- (r'[\r\n\t ]+', Text),
- ],
- }
diff --git a/pygments/lexers/nix.py b/pygments/lexers/nix.py
deleted file mode 100644
index 50210c48..00000000
--- a/pygments/lexers/nix.py
+++ /dev/null
@@ -1,136 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.nix
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for the NixOS Nix language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Literal
-
-__all__ = ['NixLexer']
-
-
-class NixLexer(RegexLexer):
- """
- For the `Nix language <http://nixos.org/nix/>`_.
-
- .. versionadded:: 2.0
- """
-
- name = 'Nix'
- aliases = ['nixos', 'nix']
- filenames = ['*.nix']
- mimetypes = ['text/x-nix']
-
- flags = re.MULTILINE | re.UNICODE
-
- keywords = ['rec', 'with', 'let', 'in', 'inherit', 'assert', 'if',
- 'else', 'then', '...']
- builtins = ['import', 'abort', 'baseNameOf', 'dirOf', 'isNull', 'builtins',
- 'map', 'removeAttrs', 'throw', 'toString', 'derivation']
- operators = ['++', '+', '?', '.', '!', '//', '==',
- '!=', '&&', '||', '->', '=']
-
- punctuations = ["(", ")", "[", "]", ";", "{", "}", ":", ",", "@"]
-
- tokens = {
- 'root': [
- # comments starting with #
- (r'#.*$', Comment.Single),
-
- # multiline comments
- (r'/\*', Comment.Multiline, 'comment'),
-
- # whitespace
- (r'\s+', Text),
-
- # keywords
- ('(%s)' % '|'.join(re.escape(entry) + '\\b' for entry in keywords), Keyword),
-
- # highlight the builtins
- ('(%s)' % '|'.join(re.escape(entry) + '\\b' for entry in builtins),
- Name.Builtin),
-
- (r'\b(true|false|null)\b', Name.Constant),
-
- # operators
- ('(%s)' % '|'.join(re.escape(entry) for entry in operators),
- Operator),
-
- # word operators
- (r'\b(or|and)\b', Operator.Word),
-
- # punctuations
- ('(%s)' % '|'.join(re.escape(entry) for entry in punctuations), Punctuation),
-
- # integers
- (r'[0-9]+', Number.Integer),
-
- # strings
- (r'"', String.Double, 'doublequote'),
- (r"''", String.Single, 'singlequote'),
-
- # paths
- (r'[\w.+-]*(\/[\w.+-]+)+', Literal),
- (r'\<[\w.+-]+(\/[\w.+-]+)*\>', Literal),
-
- # urls
- (r'[a-zA-Z][a-zA-Z0-9\+\-\.]*\:[\w%/?:@&=+$,\\.!~*\'-]+', Literal),
-
- # names of variables
- (r'[\w-]+\s*=', String.Symbol),
- (r'[a-zA-Z_][\w\'-]*', Text),
-
- ],
- 'comment': [
- (r'[^/*]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline),
- ],
- 'singlequote': [
- (r"'''", String.Escape),
- (r"''\$\{", String.Escape),
- (r"''\n", String.Escape),
- (r"''\r", String.Escape),
- (r"''\t", String.Escape),
- (r"''", String.Single, '#pop'),
- (r'\$\{', String.Interpol, 'antiquote'),
- (r"[^']", String.Single),
- ],
- 'doublequote': [
- (r'\\', String.Escape),
- (r'\\"', String.Escape),
- (r'\\$\{', String.Escape),
- (r'"', String.Double, '#pop'),
- (r'\$\{', String.Interpol, 'antiquote'),
- (r'[^"]', String.Double),
- ],
- 'antiquote': [
- (r"\}", String.Interpol, '#pop'),
- # TODO: we should probably escape also here ''${ \${
- (r"\$\{", String.Interpol, '#push'),
- include('root'),
- ],
- }
-
- def analyse_text(text):
- rv = 0.0
- # TODO: let/in
- if re.search(r'import.+?<[^>]+>', text):
- rv += 0.4
- if re.search(r'mkDerivation\s+(\(|\{|rec)', text):
- rv += 0.4
- if re.search(r'=\s+mkIf\s+', text):
- rv += 0.4
- if re.search(r'\{[a-zA-Z,\s]+\}:', text):
- rv += 0.1
- return rv
diff --git a/pygments/lexers/oberon.py b/pygments/lexers/oberon.py
deleted file mode 100644
index 1c18488a..00000000
--- a/pygments/lexers/oberon.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.oberon
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Oberon family languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['ComponentPascalLexer']
-
-
-class ComponentPascalLexer(RegexLexer):
- """
- For `Component Pascal <http://www.oberon.ch/pdf/CP-Lang.pdf>`_ source code.
-
- .. versionadded:: 2.1
- """
- name = 'Component Pascal'
- aliases = ['componentpascal', 'cp']
- filenames = ['*.cp', '*.cps']
- mimetypes = ['text/x-component-pascal']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- include('whitespace'),
- include('comments'),
- include('punctuation'),
- include('numliterals'),
- include('strings'),
- include('operators'),
- include('builtins'),
- include('identifiers'),
- ],
- 'whitespace': [
- (r'\n+', Text), # blank lines
- (r'\s+', Text), # whitespace
- ],
- 'comments': [
- (r'\(\*([^$].*?)\*\)', Comment.Multiline),
- # TODO: nested comments (* (* ... *) ... (* ... *) *) not supported!
- ],
- 'punctuation': [
- (r'[()\[\]{},.:;|]', Punctuation),
- ],
- 'numliterals': [
- (r'[0-9A-F]+X\b', Number.Hex), # char code
- (r'[0-9A-F]+[HL]\b', Number.Hex), # hexadecimal number
- (r'[0-9]+\.[0-9]+E[+-][0-9]+', Number.Float), # real number
- (r'[0-9]+\.[0-9]+', Number.Float), # real number
- (r'[0-9]+', Number.Integer), # decimal whole number
- ],
- 'strings': [
- (r"'[^\n']*'", String), # single quoted string
- (r'"[^\n"]*"', String), # double quoted string
- ],
- 'operators': [
- # Arithmetic Operators
- (r'[+-]', Operator),
- (r'[*/]', Operator),
- # Relational Operators
- (r'[=#<>]', Operator),
- # Dereferencing Operator
- (r'\^', Operator),
- # Logical AND Operator
- (r'&', Operator),
- # Logical NOT Operator
- (r'~', Operator),
- # Assignment Symbol
- (r':=', Operator),
- # Range Constructor
- (r'\.\.', Operator),
- (r'\$', Operator),
- ],
- 'identifiers': [
- (r'([a-zA-Z_$][\w$]*)', Name),
- ],
- 'builtins': [
- (words((
- 'ANYPTR', 'ANYREC', 'BOOLEAN', 'BYTE', 'CHAR', 'INTEGER', 'LONGINT',
- 'REAL', 'SET', 'SHORTCHAR', 'SHORTINT', 'SHORTREAL'
- ), suffix=r'\b'), Keyword.Type),
- (words((
- 'ABS', 'ABSTRACT', 'ARRAY', 'ASH', 'ASSERT', 'BEGIN', 'BITS', 'BY',
- 'CAP', 'CASE', 'CHR', 'CLOSE', 'CONST', 'DEC', 'DIV', 'DO', 'ELSE',
- 'ELSIF', 'EMPTY', 'END', 'ENTIER', 'EXCL', 'EXIT', 'EXTENSIBLE', 'FOR',
- 'HALT', 'IF', 'IMPORT', 'IN', 'INC', 'INCL', 'IS', 'LEN', 'LIMITED',
- 'LONG', 'LOOP', 'MAX', 'MIN', 'MOD', 'MODULE', 'NEW', 'ODD', 'OF',
- 'OR', 'ORD', 'OUT', 'POINTER', 'PROCEDURE', 'RECORD', 'REPEAT', 'RETURN',
- 'SHORT', 'SHORTCHAR', 'SHORTINT', 'SIZE', 'THEN', 'TYPE', 'TO', 'UNTIL',
- 'VAR', 'WHILE', 'WITH'
- ), suffix=r'\b'), Keyword.Reserved),
- (r'(TRUE|FALSE|NIL|INF)\b', Keyword.Constant),
- ]
- }
diff --git a/pygments/lexers/objective.py b/pygments/lexers/objective.py
deleted file mode 100644
index 777d8d4d..00000000
--- a/pygments/lexers/objective.py
+++ /dev/null
@@ -1,504 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.objective
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Objective-C family languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, using, this, words, \
- inherit, default
-from pygments.token import Text, Keyword, Name, String, Operator, \
- Number, Punctuation, Literal, Comment
-
-from pygments.lexers.c_cpp import CLexer, CppLexer
-
-__all__ = ['ObjectiveCLexer', 'ObjectiveCppLexer', 'LogosLexer', 'SwiftLexer']
-
-
-def objective(baselexer):
- """
- Generate a subclass of baselexer that accepts the Objective-C syntax
- extensions.
- """
-
- # Have to be careful not to accidentally match JavaDoc/Doxygen syntax here,
- # since that's quite common in ordinary C/C++ files. It's OK to match
- # JavaDoc/Doxygen keywords that only apply to Objective-C, mind.
- #
- # The upshot of this is that we CANNOT match @class or @interface
- _oc_keywords = re.compile(r'@(?:end|implementation|protocol)')
-
- # Matches [ <ws>? identifier <ws> ( identifier <ws>? ] | identifier? : )
- # (note the identifier is *optional* when there is a ':'!)
- _oc_message = re.compile(r'\[\s*[a-zA-Z_]\w*\s+'
- r'(?:[a-zA-Z_]\w*\s*\]|'
- r'(?:[a-zA-Z_]\w*)?:)')
-
- class GeneratedObjectiveCVariant(baselexer):
- """
- Implements Objective-C syntax on top of an existing C family lexer.
- """
-
- tokens = {
- 'statements': [
- (r'@"', String, 'string'),
- (r'@(YES|NO)', Number),
- (r"@'(\\.|\\[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'@0x[0-9a-fA-F]+[Ll]?', Number.Hex),
- (r'@0[0-7]+[Ll]?', Number.Oct),
- (r'@\d+[Ll]?', Number.Integer),
- (r'@\(', Literal, 'literal_number'),
- (r'@\[', Literal, 'literal_array'),
- (r'@\{', Literal, 'literal_dictionary'),
- (words((
- '@selector', '@private', '@protected', '@public', '@encode',
- '@synchronized', '@try', '@throw', '@catch', '@finally',
- '@end', '@property', '@synthesize', '__bridge', '__bridge_transfer',
- '__autoreleasing', '__block', '__weak', '__strong', 'weak', 'strong',
- 'copy', 'retain', 'assign', 'unsafe_unretained', 'atomic', 'nonatomic',
- 'readonly', 'readwrite', 'setter', 'getter', 'typeof', 'in',
- 'out', 'inout', 'release', 'class', '@dynamic', '@optional',
- '@required', '@autoreleasepool', '@import'), suffix=r'\b'),
- Keyword),
- (words(('id', 'instancetype', 'Class', 'IMP', 'SEL', 'BOOL',
- 'IBOutlet', 'IBAction', 'unichar'), suffix=r'\b'),
- Keyword.Type),
- (r'@(true|false|YES|NO)\n', Name.Builtin),
- (r'(YES|NO|nil|self|super)\b', Name.Builtin),
- # Carbon types
- (r'(Boolean|UInt8|SInt8|UInt16|SInt16|UInt32|SInt32)\b', Keyword.Type),
- # Carbon built-ins
- (r'(TRUE|FALSE)\b', Name.Builtin),
- (r'(@interface|@implementation)(\s+)', bygroups(Keyword, Text),
- ('#pop', 'oc_classname')),
- (r'(@class|@protocol)(\s+)', bygroups(Keyword, Text),
- ('#pop', 'oc_forward_classname')),
- # @ can also prefix other expressions like @{...} or @(...)
- (r'@', Punctuation),
- inherit,
- ],
- 'oc_classname': [
- # interface definition that inherits
- (r'([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)(\{)',
- bygroups(Name.Class, Text, Name.Class, Text, Punctuation),
- ('#pop', 'oc_ivars')),
- (r'([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?',
- bygroups(Name.Class, Text, Name.Class), '#pop'),
- # interface definition for a category
- (r'([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)(\{)',
- bygroups(Name.Class, Text, Name.Label, Text, Punctuation),
- ('#pop', 'oc_ivars')),
- (r'([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))',
- bygroups(Name.Class, Text, Name.Label), '#pop'),
- # simple interface / implementation
- (r'([a-zA-Z$_][\w$]*)(\s*)(\{)',
- bygroups(Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')),
- (r'([a-zA-Z$_][\w$]*)', Name.Class, '#pop')
- ],
- 'oc_forward_classname': [
- (r'([a-zA-Z$_][\w$]*)(\s*,\s*)',
- bygroups(Name.Class, Text), 'oc_forward_classname'),
- (r'([a-zA-Z$_][\w$]*)(\s*;?)',
- bygroups(Name.Class, Text), '#pop')
- ],
- 'oc_ivars': [
- include('whitespace'),
- include('statements'),
- (';', Punctuation),
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- ],
- 'root': [
- # methods
- (r'^([-+])(\s*)' # method marker
- r'(\(.*?\))?(\s*)' # return type
- r'([a-zA-Z$_][\w$]*:?)', # begin of method name
- bygroups(Punctuation, Text, using(this),
- Text, Name.Function),
- 'method'),
- inherit,
- ],
- 'method': [
- include('whitespace'),
- # TODO unsure if ellipses are allowed elsewhere, see
- # discussion in Issue 789
- (r',', Punctuation),
- (r'\.\.\.', Punctuation),
- (r'(\(.*?\))(\s*)([a-zA-Z$_][\w$]*)',
- bygroups(using(this), Text, Name.Variable)),
- (r'[a-zA-Z$_][\w$]*:', Name.Function),
- (';', Punctuation, '#pop'),
- (r'\{', Punctuation, 'function'),
- default('#pop'),
- ],
- 'literal_number': [
- (r'\(', Punctuation, 'literal_number_inner'),
- (r'\)', Literal, '#pop'),
- include('statement'),
- ],
- 'literal_number_inner': [
- (r'\(', Punctuation, '#push'),
- (r'\)', Punctuation, '#pop'),
- include('statement'),
- ],
- 'literal_array': [
- (r'\[', Punctuation, 'literal_array_inner'),
- (r'\]', Literal, '#pop'),
- include('statement'),
- ],
- 'literal_array_inner': [
- (r'\[', Punctuation, '#push'),
- (r'\]', Punctuation, '#pop'),
- include('statement'),
- ],
- 'literal_dictionary': [
- (r'\}', Literal, '#pop'),
- include('statement'),
- ],
- }
-
- def analyse_text(text):
- if _oc_keywords.search(text):
- return 1.0
- elif '@"' in text: # strings
- return 0.8
- elif re.search('@[0-9]+', text):
- return 0.7
- elif _oc_message.search(text):
- return 0.8
- return 0
-
- def get_tokens_unprocessed(self, text):
- from pygments.lexers._cocoa_builtins import COCOA_INTERFACES, \
- COCOA_PROTOCOLS, COCOA_PRIMITIVES
-
- for index, token, value in \
- baselexer.get_tokens_unprocessed(self, text):
- if token is Name or token is Name.Class:
- if value in COCOA_INTERFACES or value in COCOA_PROTOCOLS \
- or value in COCOA_PRIMITIVES:
- token = Name.Builtin.Pseudo
-
- yield index, token, value
-
- return GeneratedObjectiveCVariant
-
-
-class ObjectiveCLexer(objective(CLexer)):
- """
- For Objective-C source code with preprocessor directives.
- """
-
- name = 'Objective-C'
- aliases = ['objective-c', 'objectivec', 'obj-c', 'objc']
- filenames = ['*.m', '*.h']
- mimetypes = ['text/x-objective-c']
- priority = 0.05 # Lower than C
-
-
-class ObjectiveCppLexer(objective(CppLexer)):
- """
- For Objective-C++ source code with preprocessor directives.
- """
-
- name = 'Objective-C++'
- aliases = ['objective-c++', 'objectivec++', 'obj-c++', 'objc++']
- filenames = ['*.mm', '*.hh']
- mimetypes = ['text/x-objective-c++']
- priority = 0.05 # Lower than C++
-
-
-class LogosLexer(ObjectiveCppLexer):
- """
- For Logos + Objective-C source code with preprocessor directives.
-
- .. versionadded:: 1.6
- """
-
- name = 'Logos'
- aliases = ['logos']
- filenames = ['*.x', '*.xi', '*.xm', '*.xmi']
- mimetypes = ['text/x-logos']
- priority = 0.25
-
- tokens = {
- 'statements': [
- (r'(%orig|%log)\b', Keyword),
- (r'(%c)\b(\()(\s*)([a-zA-Z$_][\w$]*)(\s*)(\))',
- bygroups(Keyword, Punctuation, Text, Name.Class, Text, Punctuation)),
- (r'(%init)\b(\()',
- bygroups(Keyword, Punctuation), 'logos_init_directive'),
- (r'(%init)(?=\s*;)', bygroups(Keyword)),
- (r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)',
- bygroups(Keyword, Text, Name.Class), '#pop'),
- (r'(%subclass)(\s+)', bygroups(Keyword, Text),
- ('#pop', 'logos_classname')),
- inherit,
- ],
- 'logos_init_directive': [
- (r'\s+', Text),
- (',', Punctuation, ('logos_init_directive', '#pop')),
- (r'([a-zA-Z$_][\w$]*)(\s*)(=)(\s*)([^);]*)',
- bygroups(Name.Class, Text, Punctuation, Text, Text)),
- (r'([a-zA-Z$_][\w$]*)', Name.Class),
- (r'\)', Punctuation, '#pop'),
- ],
- 'logos_classname': [
- (r'([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?',
- bygroups(Name.Class, Text, Name.Class), '#pop'),
- (r'([a-zA-Z$_][\w$]*)', Name.Class, '#pop')
- ],
- 'root': [
- (r'(%subclass)(\s+)', bygroups(Keyword, Text),
- 'logos_classname'),
- (r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)',
- bygroups(Keyword, Text, Name.Class)),
- (r'(%config)(\s*\(\s*)(\w+)(\s*=\s*)(.*?)(\s*\)\s*)',
- bygroups(Keyword, Text, Name.Variable, Text, String, Text)),
- (r'(%ctor)(\s*)(\{)', bygroups(Keyword, Text, Punctuation),
- 'function'),
- (r'(%new)(\s*)(\()(\s*.*?\s*)(\))',
- bygroups(Keyword, Text, Keyword, String, Keyword)),
- (r'(\s*)(%end)(\s*)', bygroups(Text, Keyword, Text)),
- inherit,
- ],
- }
-
- _logos_keywords = re.compile(r'%(?:hook|ctor|init|c\()')
-
- def analyse_text(text):
- if LogosLexer._logos_keywords.search(text):
- return 1.0
- return 0
-
-
-class SwiftLexer(RegexLexer):
- """
- For `Swift <https://developer.apple.com/swift/>`_ source.
-
- .. versionadded:: 2.0
- """
- name = 'Swift'
- filenames = ['*.swift']
- aliases = ['swift']
- mimetypes = ['text/x-swift']
-
- tokens = {
- 'root': [
- # Whitespace and Comments
- (r'\n', Text),
- (r'\s+', Text),
- (r'//', Comment.Single, 'comment-single'),
- (r'/\*', Comment.Multiline, 'comment-multi'),
- (r'#(if|elseif|else|endif|available)\b', Comment.Preproc, 'preproc'),
-
- # Keywords
- include('keywords'),
-
- # Global Types
- (words((
- 'Array', 'AutoreleasingUnsafeMutablePointer', 'BidirectionalReverseView',
- 'Bit', 'Bool', 'CFunctionPointer', 'COpaquePointer', 'CVaListPointer',
- 'Character', 'ClosedInterval', 'CollectionOfOne', 'ContiguousArray',
- 'Dictionary', 'DictionaryGenerator', 'DictionaryIndex', 'Double',
- 'EmptyCollection', 'EmptyGenerator', 'EnumerateGenerator',
- 'EnumerateSequence', 'FilterCollectionView',
- 'FilterCollectionViewIndex', 'FilterGenerator', 'FilterSequenceView',
- 'Float', 'Float80', 'FloatingPointClassification', 'GeneratorOf',
- 'GeneratorOfOne', 'GeneratorSequence', 'HalfOpenInterval', 'HeapBuffer',
- 'HeapBufferStorage', 'ImplicitlyUnwrappedOptional', 'IndexingGenerator',
- 'Int', 'Int16', 'Int32', 'Int64', 'Int8', 'LazyBidirectionalCollection',
- 'LazyForwardCollection', 'LazyRandomAccessCollection',
- 'LazySequence', 'MapCollectionView', 'MapSequenceGenerator',
- 'MapSequenceView', 'MirrorDisposition', 'ObjectIdentifier', 'OnHeap',
- 'Optional', 'PermutationGenerator', 'QuickLookObject',
- 'RandomAccessReverseView', 'Range', 'RangeGenerator', 'RawByte', 'Repeat',
- 'ReverseBidirectionalIndex', 'ReverseRandomAccessIndex', 'SequenceOf',
- 'SinkOf', 'Slice', 'StaticString', 'StrideThrough', 'StrideThroughGenerator',
- 'StrideTo', 'StrideToGenerator', 'String', 'UInt', 'UInt16', 'UInt32',
- 'UInt64', 'UInt8', 'UTF16', 'UTF32', 'UTF8', 'UnicodeDecodingResult',
- 'UnicodeScalar', 'Unmanaged', 'UnsafeBufferPointer',
- 'UnsafeBufferPointerGenerator', 'UnsafeMutableBufferPointer',
- 'UnsafeMutablePointer', 'UnsafePointer', 'Zip2', 'ZipGenerator2',
- # Protocols
- 'AbsoluteValuable', 'AnyObject', 'ArrayLiteralConvertible',
- 'BidirectionalIndexType', 'BitwiseOperationsType',
- 'BooleanLiteralConvertible', 'BooleanType', 'CVarArgType',
- 'CollectionType', 'Comparable', 'DebugPrintable',
- 'DictionaryLiteralConvertible', 'Equatable',
- 'ExtendedGraphemeClusterLiteralConvertible',
- 'ExtensibleCollectionType', 'FloatLiteralConvertible',
- 'FloatingPointType', 'ForwardIndexType', 'GeneratorType', 'Hashable',
- 'IntegerArithmeticType', 'IntegerLiteralConvertible', 'IntegerType',
- 'IntervalType', 'MirrorType', 'MutableCollectionType', 'MutableSliceable',
- 'NilLiteralConvertible', 'OutputStreamType', 'Printable',
- 'RandomAccessIndexType', 'RangeReplaceableCollectionType',
- 'RawOptionSetType', 'RawRepresentable', 'Reflectable', 'SequenceType',
- 'SignedIntegerType', 'SignedNumberType', 'SinkType', 'Sliceable',
- 'Streamable', 'Strideable', 'StringInterpolationConvertible',
- 'StringLiteralConvertible', 'UnicodeCodecType',
- 'UnicodeScalarLiteralConvertible', 'UnsignedIntegerType',
- '_ArrayBufferType', '_BidirectionalIndexType', '_CocoaStringType',
- '_CollectionType', '_Comparable', '_ExtensibleCollectionType',
- '_ForwardIndexType', '_Incrementable', '_IntegerArithmeticType',
- '_IntegerType', '_ObjectiveCBridgeable', '_RandomAccessIndexType',
- '_RawOptionSetType', '_SequenceType', '_Sequence_Type',
- '_SignedIntegerType', '_SignedNumberType', '_Sliceable', '_Strideable',
- '_SwiftNSArrayRequiredOverridesType', '_SwiftNSArrayType',
- '_SwiftNSCopyingType', '_SwiftNSDictionaryRequiredOverridesType',
- '_SwiftNSDictionaryType', '_SwiftNSEnumeratorType',
- '_SwiftNSFastEnumerationType', '_SwiftNSStringRequiredOverridesType',
- '_SwiftNSStringType', '_UnsignedIntegerType',
- # Variables
- 'C_ARGC', 'C_ARGV', 'Process',
- # Typealiases
- 'Any', 'AnyClass', 'BooleanLiteralType', 'CBool', 'CChar', 'CChar16',
- 'CChar32', 'CDouble', 'CFloat', 'CInt', 'CLong', 'CLongLong', 'CShort',
- 'CSignedChar', 'CUnsignedInt', 'CUnsignedLong', 'CUnsignedShort',
- 'CWideChar', 'ExtendedGraphemeClusterType', 'Float32', 'Float64',
- 'FloatLiteralType', 'IntMax', 'IntegerLiteralType', 'StringLiteralType',
- 'UIntMax', 'UWord', 'UnicodeScalarType', 'Void', 'Word',
- # Foundation/Cocoa
- 'NSErrorPointer', 'NSObjectProtocol', 'Selector'), suffix=r'\b'),
- Name.Builtin),
- # Functions
- (words((
- 'abs', 'advance', 'alignof', 'alignofValue', 'assert', 'assertionFailure',
- 'contains', 'count', 'countElements', 'debugPrint', 'debugPrintln',
- 'distance', 'dropFirst', 'dropLast', 'dump', 'enumerate', 'equal',
- 'extend', 'fatalError', 'filter', 'find', 'first', 'getVaList', 'indices',
- 'insert', 'isEmpty', 'join', 'last', 'lazy', 'lexicographicalCompare',
- 'map', 'max', 'maxElement', 'min', 'minElement', 'numericCast', 'overlaps',
- 'partition', 'precondition', 'preconditionFailure', 'prefix', 'print',
- 'println', 'reduce', 'reflect', 'removeAll', 'removeAtIndex', 'removeLast',
- 'removeRange', 'reverse', 'sizeof', 'sizeofValue', 'sort', 'sorted',
- 'splice', 'split', 'startsWith', 'stride', 'strideof', 'strideofValue',
- 'suffix', 'swap', 'toDebugString', 'toString', 'transcode',
- 'underestimateCount', 'unsafeAddressOf', 'unsafeBitCast', 'unsafeDowncast',
- 'withExtendedLifetime', 'withUnsafeMutablePointer',
- 'withUnsafeMutablePointers', 'withUnsafePointer', 'withUnsafePointers',
- 'withVaList'), suffix=r'\b'),
- Name.Builtin.Pseudo),
-
- # Implicit Block Variables
- (r'\$\d+', Name.Variable),
-
- # Binary Literal
- (r'0b[01_]+', Number.Bin),
- # Octal Literal
- (r'0o[0-7_]+', Number.Oct),
- # Hexadecimal Literal
- (r'0x[0-9a-fA-F_]+', Number.Hex),
- # Decimal Literal
- (r'[0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|'
- r'\.[0-9_]*|[eE][+\-]?[0-9_]+)', Number.Float),
- (r'[0-9][0-9_]*', Number.Integer),
- # String Literal
- (r'"', String, 'string'),
-
- # Operators and Punctuation
- (r'[(){}\[\].,:;=@#`?]|->|[<&?](?=\w)|(?<=\w)[>!?]', Punctuation),
- (r'[/=\-+!*%<>&|^?~]+', Operator),
-
- # Identifier
- (r'[a-zA-Z_]\w*', Name)
- ],
- 'keywords': [
- (words((
- 'as', 'break', 'case', 'catch', 'continue', 'default', 'defer',
- 'do', 'else', 'fallthrough', 'for', 'guard', 'if', 'in', 'is',
- 'repeat', 'return', '#selector', 'switch', 'throw', 'try',
- 'where', 'while'), suffix=r'\b'),
- Keyword),
- (r'@availability\([^)]+\)', Keyword.Reserved),
- (words((
- 'associativity', 'convenience', 'dynamic', 'didSet', 'final',
- 'get', 'indirect', 'infix', 'inout', 'lazy', 'left', 'mutating',
- 'none', 'nonmutating', 'optional', 'override', 'postfix',
- 'precedence', 'prefix', 'Protocol', 'required', 'rethrows',
- 'right', 'set', 'throws', 'Type', 'unowned', 'weak', 'willSet',
- '@availability', '@autoclosure', '@noreturn',
- '@NSApplicationMain', '@NSCopying', '@NSManaged', '@objc',
- '@UIApplicationMain', '@IBAction', '@IBDesignable',
- '@IBInspectable', '@IBOutlet'), suffix=r'\b'),
- Keyword.Reserved),
- (r'(as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__'
- r'|__FILE__|__FUNCTION__|__LINE__|_'
- r'|#(?:file|line|column|function))\b', Keyword.Constant),
- (r'import\b', Keyword.Declaration, 'module'),
- (r'(class|enum|extension|struct|protocol)(\s+)([a-zA-Z_]\w*)',
- bygroups(Keyword.Declaration, Text, Name.Class)),
- (r'(func)(\s+)([a-zA-Z_]\w*)',
- bygroups(Keyword.Declaration, Text, Name.Function)),
- (r'(var|let)(\s+)([a-zA-Z_]\w*)', bygroups(Keyword.Declaration,
- Text, Name.Variable)),
- (words((
- 'class', 'deinit', 'enum', 'extension', 'func', 'import', 'init',
- 'internal', 'let', 'operator', 'private', 'protocol', 'public',
- 'static', 'struct', 'subscript', 'typealias', 'var'), suffix=r'\b'),
- Keyword.Declaration)
- ],
- 'comment': [
- (r':param: [a-zA-Z_]\w*|:returns?:|(FIXME|MARK|TODO):',
- Comment.Special)
- ],
-
- # Nested
- 'comment-single': [
- (r'\n', Text, '#pop'),
- include('comment'),
- (r'[^\n]', Comment.Single)
- ],
- 'comment-multi': [
- include('comment'),
- (r'[^*/]', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ],
- 'module': [
- (r'\n', Text, '#pop'),
- (r'[a-zA-Z_]\w*', Name.Class),
- include('root')
- ],
- 'preproc': [
- (r'\n', Text, '#pop'),
- include('keywords'),
- (r'[A-Za-z]\w*', Comment.Preproc),
- include('root')
- ],
- 'string': [
- (r'\\\(', String.Interpol, 'string-intp'),
- (r'"', String, '#pop'),
- (r"""\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}"""
- r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}""", String.Escape),
- (r'[^\\"]+', String),
- (r'\\', String)
- ],
- 'string-intp': [
- (r'\(', String.Interpol, '#push'),
- (r'\)', String.Interpol, '#pop'),
- include('root')
- ]
- }
-
- def get_tokens_unprocessed(self, text):
- from pygments.lexers._cocoa_builtins import COCOA_INTERFACES, \
- COCOA_PROTOCOLS, COCOA_PRIMITIVES
-
- for index, token, value in \
- RegexLexer.get_tokens_unprocessed(self, text):
- if token is Name or token is Name.Class:
- if value in COCOA_INTERFACES or value in COCOA_PROTOCOLS \
- or value in COCOA_PRIMITIVES:
- token = Name.Builtin.Pseudo
-
- yield index, token, value
diff --git a/pygments/lexers/ooc.py b/pygments/lexers/ooc.py
deleted file mode 100644
index 438719cd..00000000
--- a/pygments/lexers/ooc.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.ooc
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Ooc language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['OocLexer']
-
-
-class OocLexer(RegexLexer):
- """
- For `Ooc <http://ooc-lang.org/>`_ source code
-
- .. versionadded:: 1.2
- """
- name = 'Ooc'
- aliases = ['ooc']
- filenames = ['*.ooc']
- mimetypes = ['text/x-ooc']
-
- tokens = {
- 'root': [
- (words((
- 'class', 'interface', 'implement', 'abstract', 'extends', 'from',
- 'this', 'super', 'new', 'const', 'final', 'static', 'import',
- 'use', 'extern', 'inline', 'proto', 'break', 'continue',
- 'fallthrough', 'operator', 'if', 'else', 'for', 'while', 'do',
- 'switch', 'case', 'as', 'in', 'version', 'return', 'true',
- 'false', 'null'), prefix=r'\b', suffix=r'\b'),
- Keyword),
- (r'include\b', Keyword, 'include'),
- (r'(cover)([ \t]+)(from)([ \t]+)(\w+[*@]?)',
- bygroups(Keyword, Text, Keyword, Text, Name.Class)),
- (r'(func)((?:[ \t]|\\\n)+)(~[a-z_]\w*)',
- bygroups(Keyword, Text, Name.Function)),
- (r'\bfunc\b', Keyword),
- # Note: %= and ^= not listed on http://ooc-lang.org/syntax
- (r'//.*', Comment),
- (r'(?s)/\*.*?\*/', Comment.Multiline),
- (r'(==?|\+=?|-[=>]?|\*=?|/=?|:=|!=?|%=?|\?|>{1,3}=?|<{1,3}=?|\.\.|'
- r'&&?|\|\|?|\^=?)', Operator),
- (r'(\.)([ \t]*)([a-z]\w*)', bygroups(Operator, Text,
- Name.Function)),
- (r'[A-Z][A-Z0-9_]+', Name.Constant),
- (r'[A-Z]\w*([@*]|\[[ \t]*\])?', Name.Class),
-
- (r'([a-z]\w*(?:~[a-z]\w*)?)((?:[ \t]|\\\n)*)(?=\()',
- bygroups(Name.Function, Text)),
- (r'[a-z]\w*', Name.Variable),
-
- # : introduces types
- (r'[:(){}\[\];,]', Punctuation),
-
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'0c[0-9]+', Number.Oct),
- (r'0b[01]+', Number.Bin),
- (r'[0-9_]\.[0-9_]*(?!\.)', Number.Float),
- (r'[0-9_]+', Number.Decimal),
-
- (r'"(?:\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\"])*"',
- String.Double),
- (r"'(?:\\.|\\[0-9]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'",
- String.Char),
- (r'@', Punctuation), # pointer dereference
- (r'\.', Punctuation), # imports or chain operator
-
- (r'\\[ \t\n]', Text),
- (r'[ \t]+', Text),
- ],
- 'include': [
- (r'[\w/]+', Name),
- (r',', Punctuation),
- (r'[ \t]', Text),
- (r'[;\n]', Text, '#pop'),
- ],
- }
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py
deleted file mode 100644
index c3a60cef..00000000
--- a/pygments/lexers/other.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.other
- ~~~~~~~~~~~~~~~~~~~~~
-
- Just export lexer classes previously contained in this module.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexers.sql import SqlLexer, MySqlLexer, SqliteConsoleLexer
-from pygments.lexers.shell import BashLexer, BashSessionLexer, BatchLexer, \
- TcshLexer
-from pygments.lexers.robotframework import RobotFrameworkLexer
-from pygments.lexers.testing import GherkinLexer
-from pygments.lexers.esoteric import BrainfuckLexer, BefungeLexer, RedcodeLexer
-from pygments.lexers.prolog import LogtalkLexer
-from pygments.lexers.snobol import SnobolLexer
-from pygments.lexers.rebol import RebolLexer
-from pygments.lexers.configs import KconfigLexer, Cfengine3Lexer
-from pygments.lexers.modeling import ModelicaLexer
-from pygments.lexers.scripting import AppleScriptLexer, MOOCodeLexer, \
- HybrisLexer
-from pygments.lexers.graphics import PostScriptLexer, GnuplotLexer, \
- AsymptoteLexer, PovrayLexer
-from pygments.lexers.business import ABAPLexer, OpenEdgeLexer, \
- GoodDataCLLexer, MaqlLexer
-from pygments.lexers.automation import AutoItLexer, AutohotkeyLexer
-from pygments.lexers.dsls import ProtoBufLexer, BroLexer, PuppetLexer, \
- MscgenLexer, VGLLexer
-from pygments.lexers.basic import CbmBasicV2Lexer
-from pygments.lexers.pawn import SourcePawnLexer, PawnLexer
-from pygments.lexers.ecl import ECLLexer
-from pygments.lexers.urbi import UrbiscriptLexer
-from pygments.lexers.smalltalk import SmalltalkLexer, NewspeakLexer
-from pygments.lexers.installers import NSISLexer, RPMSpecLexer
-from pygments.lexers.textedit import AwkLexer
-from pygments.lexers.smv import NuSMVLexer
-
-__all__ = []
diff --git a/pygments/lexers/parasail.py b/pygments/lexers/parasail.py
deleted file mode 100644
index 7f8cf073..00000000
--- a/pygments/lexers/parasail.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.parasail
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for ParaSail.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Literal
-
-__all__ = ['ParaSailLexer']
-
-
-class ParaSailLexer(RegexLexer):
- """
- For `ParaSail <http://www.parasail-lang.org>`_ source code.
-
- .. versionadded:: 2.1
- """
-
- name = 'ParaSail'
- aliases = ['parasail']
- filenames = ['*.psi', '*.psl']
- mimetypes = ['text/x-parasail']
-
- flags = re.MULTILINE
-
- tokens = {
- 'root': [
- (r'[^\S\n]+', Text),
- (r'//.*?\n', Comment.Single),
- (r'\b(and|or|xor)=', Operator.Word),
- (r'\b(and(\s+then)?|or(\s+else)?|xor|rem|mod|'
- r'(is|not)\s+null)\b',
- Operator.Word),
- # Keywords
- (r'\b(abs|abstract|all|block|class|concurrent|const|continue|'
- r'each|end|exit|extends|exports|forward|func|global|implements|'
- r'import|in|interface|is|lambda|locked|new|not|null|of|op|'
- r'optional|private|queued|ref|return|reverse|separate|some|'
- r'type|until|var|with|'
- # Control flow
- r'if|then|else|elsif|case|for|while|loop)\b',
- Keyword.Reserved),
- (r'(abstract\s+)?(interface|class|op|func|type)',
- Keyword.Declaration),
- # Literals
- (r'"[^"]*"', String),
- (r'\\[\'ntrf"0]', String.Escape),
- (r'#[a-zA-Z]\w*', Literal), # Enumeration
- include('numbers'),
- (r"'[^']'", String.Char),
- (r'[a-zA-Z]\w*', Name),
- # Operators and Punctuation
- (r'(<==|==>|<=>|\*\*=|<\|=|<<=|>>=|==|!=|=\?|<=|>=|'
- r'\*\*|<<|>>|=>|:=|\+=|-=|\*=|\|=|\||/=|\+|-|\*|/|'
- r'\.\.|<\.\.|\.\.<|<\.\.<)',
- Operator),
- (r'(<|>|\[|\]|\(|\)|\||:|;|,|.|\{|\}|->)',
- Punctuation),
- (r'\n+', Text),
- ],
- 'numbers': [
- (r'\d[0-9_]*#[0-9a-fA-F][0-9a-fA-F_]*#', Number.Hex), # any base
- (r'0[xX][0-9a-fA-F][0-9a-fA-F_]*', Number.Hex), # C-like hex
- (r'0[bB][01][01_]*', Number.Bin), # C-like bin
- (r'\d[0-9_]*\.\d[0-9_]*[eE][+-]\d[0-9_]*', # float exp
- Number.Float),
- (r'\d[0-9_]*\.\d[0-9_]*', Number.Float), # float
- (r'\d[0-9_]*', Number.Integer), # integer
- ],
- }
diff --git a/pygments/lexers/parsers.py b/pygments/lexers/parsers.py
deleted file mode 100644
index 8bcbfc50..00000000
--- a/pygments/lexers/parsers.py
+++ /dev/null
@@ -1,835 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.parsers
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for parser generators.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, DelegatingLexer, \
- include, bygroups, using
-from pygments.token import Punctuation, Other, Text, Comment, Operator, \
- Keyword, Name, String, Number, Whitespace
-from pygments.lexers.jvm import JavaLexer
-from pygments.lexers.c_cpp import CLexer, CppLexer
-from pygments.lexers.objective import ObjectiveCLexer
-from pygments.lexers.d import DLexer
-from pygments.lexers.dotnet import CSharpLexer
-from pygments.lexers.ruby import RubyLexer
-from pygments.lexers.python import PythonLexer
-from pygments.lexers.perl import PerlLexer
-
-__all__ = ['RagelLexer', 'RagelEmbeddedLexer', 'RagelCLexer', 'RagelDLexer',
- 'RagelCppLexer', 'RagelObjectiveCLexer', 'RagelRubyLexer',
- 'RagelJavaLexer', 'AntlrLexer', 'AntlrPythonLexer',
- 'AntlrPerlLexer', 'AntlrRubyLexer', 'AntlrCppLexer',
- # 'AntlrCLexer',
- 'AntlrCSharpLexer', 'AntlrObjectiveCLexer',
- 'AntlrJavaLexer', 'AntlrActionScriptLexer',
- 'TreetopLexer', 'EbnfLexer']
-
-
-class RagelLexer(RegexLexer):
- """
- A pure `Ragel <http://www.complang.org/ragel/>`_ lexer. Use this for
- fragments of Ragel. For ``.rl`` files, use RagelEmbeddedLexer instead
- (or one of the language-specific subclasses).
-
- .. versionadded:: 1.1
- """
-
- name = 'Ragel'
- aliases = ['ragel']
- filenames = []
-
- tokens = {
- 'whitespace': [
- (r'\s+', Whitespace)
- ],
- 'comments': [
- (r'\#.*$', Comment),
- ],
- 'keywords': [
- (r'(access|action|alphtype)\b', Keyword),
- (r'(getkey|write|machine|include)\b', Keyword),
- (r'(any|ascii|extend|alpha|digit|alnum|lower|upper)\b', Keyword),
- (r'(xdigit|cntrl|graph|print|punct|space|zlen|empty)\b', Keyword)
- ],
- 'numbers': [
- (r'0x[0-9A-Fa-f]+', Number.Hex),
- (r'[+-]?[0-9]+', Number.Integer),
- ],
- 'literals': [
- (r'"(\\\\|\\"|[^"])*"', String), # double quote string
- (r"'(\\\\|\\'|[^'])*'", String), # single quote string
- (r'\[(\\\\|\\\]|[^\]])*\]', String), # square bracket literals
- (r'/(?!\*)(\\\\|\\/|[^/])*/', String.Regex), # regular expressions
- ],
- 'identifiers': [
- (r'[a-zA-Z_]\w*', Name.Variable),
- ],
- 'operators': [
- (r',', Operator), # Join
- (r'\||&|--?', Operator), # Union, Intersection and Subtraction
- (r'\.|<:|:>>?', Operator), # Concatention
- (r':', Operator), # Label
- (r'->', Operator), # Epsilon Transition
- (r'(>|\$|%|<|@|<>)(/|eof\b)', Operator), # EOF Actions
- (r'(>|\$|%|<|@|<>)(!|err\b)', Operator), # Global Error Actions
- (r'(>|\$|%|<|@|<>)(\^|lerr\b)', Operator), # Local Error Actions
- (r'(>|\$|%|<|@|<>)(~|to\b)', Operator), # To-State Actions
- (r'(>|\$|%|<|@|<>)(\*|from\b)', Operator), # From-State Actions
- (r'>|@|\$|%', Operator), # Transition Actions and Priorities
- (r'\*|\?|\+|\{[0-9]*,[0-9]*\}', Operator), # Repetition
- (r'!|\^', Operator), # Negation
- (r'\(|\)', Operator), # Grouping
- ],
- 'root': [
- include('literals'),
- include('whitespace'),
- include('comments'),
- include('keywords'),
- include('numbers'),
- include('identifiers'),
- include('operators'),
- (r'\{', Punctuation, 'host'),
- (r'=', Operator),
- (r';', Punctuation),
- ],
- 'host': [
- (r'(' + r'|'.join(( # keep host code in largest possible chunks
- r'[^{}\'"/#]+', # exclude unsafe characters
- r'[^\\]\\[{}]', # allow escaped { or }
-
- # strings and comments may safely contain unsafe characters
- r'"(\\\\|\\"|[^"])*"', # double quote string
- r"'(\\\\|\\'|[^'])*'", # single quote string
- r'//.*$\n?', # single line comment
- r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
- r'\#.*$\n?', # ruby comment
-
- # regular expression: There's no reason for it to start
- # with a * and this stops confusion with comments.
- r'/(?!\*)(\\\\|\\/|[^/])*/',
-
- # / is safe now that we've handled regex and javadoc comments
- r'/',
- )) + r')+', Other),
-
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- ],
- }
-
-
-class RagelEmbeddedLexer(RegexLexer):
- """
- A lexer for `Ragel`_ embedded in a host language file.
-
- This will only highlight Ragel statements. If you want host language
- highlighting then call the language-specific Ragel lexer.
-
- .. versionadded:: 1.1
- """
-
- name = 'Embedded Ragel'
- aliases = ['ragel-em']
- filenames = ['*.rl']
-
- tokens = {
- 'root': [
- (r'(' + r'|'.join(( # keep host code in largest possible chunks
- r'[^%\'"/#]+', # exclude unsafe characters
- r'%(?=[^%]|$)', # a single % sign is okay, just not 2 of them
-
- # strings and comments may safely contain unsafe characters
- r'"(\\\\|\\"|[^"])*"', # double quote string
- r"'(\\\\|\\'|[^'])*'", # single quote string
- r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
- r'//.*$\n?', # single line comment
- r'\#.*$\n?', # ruby/ragel comment
- r'/(?!\*)(\\\\|\\/|[^/])*/', # regular expression
-
- # / is safe now that we've handled regex and javadoc comments
- r'/',
- )) + r')+', Other),
-
- # Single Line FSM.
- # Please don't put a quoted newline in a single line FSM.
- # That's just mean. It will break this.
- (r'(%%)(?![{%])(.*)($|;)(\n?)', bygroups(Punctuation,
- using(RagelLexer),
- Punctuation, Text)),
-
- # Multi Line FSM.
- (r'(%%%%|%%)\{', Punctuation, 'multi-line-fsm'),
- ],
- 'multi-line-fsm': [
- (r'(' + r'|'.join(( # keep ragel code in largest possible chunks.
- r'(' + r'|'.join((
- r'[^}\'"\[/#]', # exclude unsafe characters
- r'\}(?=[^%]|$)', # } is okay as long as it's not followed by %
- r'\}%(?=[^%]|$)', # ...well, one %'s okay, just not two...
- r'[^\\]\\[{}]', # ...and } is okay if it's escaped
-
- # allow / if it's preceded with one of these symbols
- # (ragel EOF actions)
- r'(>|\$|%|<|@|<>)/',
-
- # specifically allow regex followed immediately by *
- # so it doesn't get mistaken for a comment
- r'/(?!\*)(\\\\|\\/|[^/])*/\*',
-
- # allow / as long as it's not followed by another / or by a *
- r'/(?=[^/*]|$)',
-
- # We want to match as many of these as we can in one block.
- # Not sure if we need the + sign here,
- # does it help performance?
- )) + r')+',
-
- # strings and comments may safely contain unsafe characters
- r'"(\\\\|\\"|[^"])*"', # double quote string
- r"'(\\\\|\\'|[^'])*'", # single quote string
- r"\[(\\\\|\\\]|[^\]])*\]", # square bracket literal
- r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
- r'//.*$\n?', # single line comment
- r'\#.*$\n?', # ruby/ragel comment
- )) + r')+', using(RagelLexer)),
-
- (r'\}%%', Punctuation, '#pop'),
- ]
- }
-
- def analyse_text(text):
- return '@LANG: indep' in text
-
-
-class RagelRubyLexer(DelegatingLexer):
- """
- A lexer for `Ragel`_ in a Ruby host file.
-
- .. versionadded:: 1.1
- """
-
- name = 'Ragel in Ruby Host'
- aliases = ['ragel-ruby', 'ragel-rb']
- filenames = ['*.rl']
-
- def __init__(self, **options):
- super(RagelRubyLexer, self).__init__(RubyLexer, RagelEmbeddedLexer,
- **options)
-
- def analyse_text(text):
- return '@LANG: ruby' in text
-
-
-class RagelCLexer(DelegatingLexer):
- """
- A lexer for `Ragel`_ in a C host file.
-
- .. versionadded:: 1.1
- """
-
- name = 'Ragel in C Host'
- aliases = ['ragel-c']
- filenames = ['*.rl']
-
- def __init__(self, **options):
- super(RagelCLexer, self).__init__(CLexer, RagelEmbeddedLexer,
- **options)
-
- def analyse_text(text):
- return '@LANG: c' in text
-
-
-class RagelDLexer(DelegatingLexer):
- """
- A lexer for `Ragel`_ in a D host file.
-
- .. versionadded:: 1.1
- """
-
- name = 'Ragel in D Host'
- aliases = ['ragel-d']
- filenames = ['*.rl']
-
- def __init__(self, **options):
- super(RagelDLexer, self).__init__(DLexer, RagelEmbeddedLexer, **options)
-
- def analyse_text(text):
- return '@LANG: d' in text
-
-
-class RagelCppLexer(DelegatingLexer):
- """
- A lexer for `Ragel`_ in a CPP host file.
-
- .. versionadded:: 1.1
- """
-
- name = 'Ragel in CPP Host'
- aliases = ['ragel-cpp']
- filenames = ['*.rl']
-
- def __init__(self, **options):
- super(RagelCppLexer, self).__init__(CppLexer, RagelEmbeddedLexer, **options)
-
- def analyse_text(text):
- return '@LANG: c++' in text
-
-
-class RagelObjectiveCLexer(DelegatingLexer):
- """
- A lexer for `Ragel`_ in an Objective C host file.
-
- .. versionadded:: 1.1
- """
-
- name = 'Ragel in Objective C Host'
- aliases = ['ragel-objc']
- filenames = ['*.rl']
-
- def __init__(self, **options):
- super(RagelObjectiveCLexer, self).__init__(ObjectiveCLexer,
- RagelEmbeddedLexer,
- **options)
-
- def analyse_text(text):
- return '@LANG: objc' in text
-
-
-class RagelJavaLexer(DelegatingLexer):
- """
- A lexer for `Ragel`_ in a Java host file.
-
- .. versionadded:: 1.1
- """
-
- name = 'Ragel in Java Host'
- aliases = ['ragel-java']
- filenames = ['*.rl']
-
- def __init__(self, **options):
- super(RagelJavaLexer, self).__init__(JavaLexer, RagelEmbeddedLexer,
- **options)
-
- def analyse_text(text):
- return '@LANG: java' in text
-
-
-class AntlrLexer(RegexLexer):
- """
- Generic `ANTLR`_ Lexer.
- Should not be called directly, instead
- use DelegatingLexer for your target language.
-
- .. versionadded:: 1.1
-
- .. _ANTLR: http://www.antlr.org/
- """
-
- name = 'ANTLR'
- aliases = ['antlr']
- filenames = []
-
- _id = r'[A-Za-z]\w*'
- _TOKEN_REF = r'[A-Z]\w*'
- _RULE_REF = r'[a-z]\w*'
- _STRING_LITERAL = r'\'(?:\\\\|\\\'|[^\']*)\''
- _INT = r'[0-9]+'
-
- tokens = {
- 'whitespace': [
- (r'\s+', Whitespace),
- ],
- 'comments': [
- (r'//.*$', Comment),
- (r'/\*(.|\n)*?\*/', Comment),
- ],
- 'root': [
- include('whitespace'),
- include('comments'),
-
- (r'(lexer|parser|tree)?(\s*)(grammar\b)(\s*)(' + _id + ')(;)',
- bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Class,
- Punctuation)),
- # optionsSpec
- (r'options\b', Keyword, 'options'),
- # tokensSpec
- (r'tokens\b', Keyword, 'tokens'),
- # attrScope
- (r'(scope)(\s*)(' + _id + r')(\s*)(\{)',
- bygroups(Keyword, Whitespace, Name.Variable, Whitespace,
- Punctuation), 'action'),
- # exception
- (r'(catch|finally)\b', Keyword, 'exception'),
- # action
- (r'(@' + _id + r')(\s*)(::)?(\s*)(' + _id + r')(\s*)(\{)',
- bygroups(Name.Label, Whitespace, Punctuation, Whitespace,
- Name.Label, Whitespace, Punctuation), 'action'),
- # rule
- (r'((?:protected|private|public|fragment)\b)?(\s*)(' + _id + ')(!)?',
- bygroups(Keyword, Whitespace, Name.Label, Punctuation),
- ('rule-alts', 'rule-prelims')),
- ],
- 'exception': [
- (r'\n', Whitespace, '#pop'),
- (r'\s', Whitespace),
- include('comments'),
-
- (r'\[', Punctuation, 'nested-arg-action'),
- (r'\{', Punctuation, 'action'),
- ],
- 'rule-prelims': [
- include('whitespace'),
- include('comments'),
-
- (r'returns\b', Keyword),
- (r'\[', Punctuation, 'nested-arg-action'),
- (r'\{', Punctuation, 'action'),
- # throwsSpec
- (r'(throws)(\s+)(' + _id + ')',
- bygroups(Keyword, Whitespace, Name.Label)),
- (r'(,)(\s*)(' + _id + ')',
- bygroups(Punctuation, Whitespace, Name.Label)), # Additional throws
- # optionsSpec
- (r'options\b', Keyword, 'options'),
- # ruleScopeSpec - scope followed by target language code or name of action
- # TODO finish implementing other possibilities for scope
- # L173 ANTLRv3.g from ANTLR book
- (r'(scope)(\s+)(\{)', bygroups(Keyword, Whitespace, Punctuation),
- 'action'),
- (r'(scope)(\s+)(' + _id + r')(\s*)(;)',
- bygroups(Keyword, Whitespace, Name.Label, Whitespace, Punctuation)),
- # ruleAction
- (r'(@' + _id + r')(\s*)(\{)',
- bygroups(Name.Label, Whitespace, Punctuation), 'action'),
- # finished prelims, go to rule alts!
- (r':', Punctuation, '#pop')
- ],
- 'rule-alts': [
- include('whitespace'),
- include('comments'),
-
- # These might need to go in a separate 'block' state triggered by (
- (r'options\b', Keyword, 'options'),
- (r':', Punctuation),
-
- # literals
- (r"'(\\\\|\\'|[^'])*'", String),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r'<<([^>]|>[^>])>>', String),
- # identifiers
- # Tokens start with capital letter.
- (r'\$?[A-Z_]\w*', Name.Constant),
- # Rules start with small letter.
- (r'\$?[a-z_]\w*', Name.Variable),
- # operators
- (r'(\+|\||->|=>|=|\(|\)|\.\.|\.|\?|\*|\^|!|\#|~)', Operator),
- (r',', Punctuation),
- (r'\[', Punctuation, 'nested-arg-action'),
- (r'\{', Punctuation, 'action'),
- (r';', Punctuation, '#pop')
- ],
- 'tokens': [
- include('whitespace'),
- include('comments'),
- (r'\{', Punctuation),
- (r'(' + _TOKEN_REF + r')(\s*)(=)?(\s*)(' + _STRING_LITERAL
- + r')?(\s*)(;)',
- bygroups(Name.Label, Whitespace, Punctuation, Whitespace,
- String, Whitespace, Punctuation)),
- (r'\}', Punctuation, '#pop'),
- ],
- 'options': [
- include('whitespace'),
- include('comments'),
- (r'\{', Punctuation),
- (r'(' + _id + r')(\s*)(=)(\s*)(' +
- '|'.join((_id, _STRING_LITERAL, _INT, r'\*')) + r')(\s*)(;)',
- bygroups(Name.Variable, Whitespace, Punctuation, Whitespace,
- Text, Whitespace, Punctuation)),
- (r'\}', Punctuation, '#pop'),
- ],
- 'action': [
- (r'(' + r'|'.join(( # keep host code in largest possible chunks
- r'[^${}\'"/\\]+', # exclude unsafe characters
-
- # strings and comments may safely contain unsafe characters
- r'"(\\\\|\\"|[^"])*"', # double quote string
- r"'(\\\\|\\'|[^'])*'", # single quote string
- r'//.*$\n?', # single line comment
- r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
-
- # regular expression: There's no reason for it to start
- # with a * and this stops confusion with comments.
- r'/(?!\*)(\\\\|\\/|[^/])*/',
-
- # backslashes are okay, as long as we are not backslashing a %
- r'\\(?!%)',
-
- # Now that we've handled regex and javadoc comments
- # it's safe to let / through.
- r'/',
- )) + r')+', Other),
- (r'(\\)(%)', bygroups(Punctuation, Other)),
- (r'(\$[a-zA-Z]+)(\.?)(text|value)?',
- bygroups(Name.Variable, Punctuation, Name.Property)),
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- ],
- 'nested-arg-action': [
- (r'(' + r'|'.join(( # keep host code in largest possible chunks.
- r'[^$\[\]\'"/]+', # exclude unsafe characters
-
- # strings and comments may safely contain unsafe characters
- r'"(\\\\|\\"|[^"])*"', # double quote string
- r"'(\\\\|\\'|[^'])*'", # single quote string
- r'//.*$\n?', # single line comment
- r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
-
- # regular expression: There's no reason for it to start
- # with a * and this stops confusion with comments.
- r'/(?!\*)(\\\\|\\/|[^/])*/',
-
- # Now that we've handled regex and javadoc comments
- # it's safe to let / through.
- r'/',
- )) + r')+', Other),
-
-
- (r'\[', Punctuation, '#push'),
- (r'\]', Punctuation, '#pop'),
- (r'(\$[a-zA-Z]+)(\.?)(text|value)?',
- bygroups(Name.Variable, Punctuation, Name.Property)),
- (r'(\\\\|\\\]|\\\[|[^\[\]])+', Other),
- ]
- }
-
- def analyse_text(text):
- return re.search(r'^\s*grammar\s+[a-zA-Z0-9]+\s*;', text, re.M)
-
-# http://www.antlr.org/wiki/display/ANTLR3/Code+Generation+Targets
-
-# TH: I'm not aware of any language features of C++ that will cause
-# incorrect lexing of C files. Antlr doesn't appear to make a distinction,
-# so just assume they're C++. No idea how to make Objective C work in the
-# future.
-
-# class AntlrCLexer(DelegatingLexer):
-# """
-# ANTLR with C Target
-#
-# .. versionadded:: 1.1
-# """
-#
-# name = 'ANTLR With C Target'
-# aliases = ['antlr-c']
-# filenames = ['*.G', '*.g']
-#
-# def __init__(self, **options):
-# super(AntlrCLexer, self).__init__(CLexer, AntlrLexer, **options)
-#
-# def analyse_text(text):
-# return re.match(r'^\s*language\s*=\s*C\s*;', text)
-
-
-class AntlrCppLexer(DelegatingLexer):
- """
- `ANTLR`_ with CPP Target
-
- .. versionadded:: 1.1
- """
-
- name = 'ANTLR With CPP Target'
- aliases = ['antlr-cpp']
- filenames = ['*.G', '*.g']
-
- def __init__(self, **options):
- super(AntlrCppLexer, self).__init__(CppLexer, AntlrLexer, **options)
-
- def analyse_text(text):
- return AntlrLexer.analyse_text(text) and \
- re.search(r'^\s*language\s*=\s*C\s*;', text, re.M)
-
-
-class AntlrObjectiveCLexer(DelegatingLexer):
- """
- `ANTLR`_ with Objective-C Target
-
- .. versionadded:: 1.1
- """
-
- name = 'ANTLR With ObjectiveC Target'
- aliases = ['antlr-objc']
- filenames = ['*.G', '*.g']
-
- def __init__(self, **options):
- super(AntlrObjectiveCLexer, self).__init__(ObjectiveCLexer,
- AntlrLexer, **options)
-
- def analyse_text(text):
- return AntlrLexer.analyse_text(text) and \
- re.search(r'^\s*language\s*=\s*ObjC\s*;', text)
-
-
-class AntlrCSharpLexer(DelegatingLexer):
- """
- `ANTLR`_ with C# Target
-
- .. versionadded:: 1.1
- """
-
- name = 'ANTLR With C# Target'
- aliases = ['antlr-csharp', 'antlr-c#']
- filenames = ['*.G', '*.g']
-
- def __init__(self, **options):
- super(AntlrCSharpLexer, self).__init__(CSharpLexer, AntlrLexer,
- **options)
-
- def analyse_text(text):
- return AntlrLexer.analyse_text(text) and \
- re.search(r'^\s*language\s*=\s*CSharp2\s*;', text, re.M)
-
-
-class AntlrPythonLexer(DelegatingLexer):
- """
- `ANTLR`_ with Python Target
-
- .. versionadded:: 1.1
- """
-
- name = 'ANTLR With Python Target'
- aliases = ['antlr-python']
- filenames = ['*.G', '*.g']
-
- def __init__(self, **options):
- super(AntlrPythonLexer, self).__init__(PythonLexer, AntlrLexer,
- **options)
-
- def analyse_text(text):
- return AntlrLexer.analyse_text(text) and \
- re.search(r'^\s*language\s*=\s*Python\s*;', text, re.M)
-
-
-class AntlrJavaLexer(DelegatingLexer):
- """
- `ANTLR`_ with Java Target
-
- .. versionadded:: 1.
- """
-
- name = 'ANTLR With Java Target'
- aliases = ['antlr-java']
- filenames = ['*.G', '*.g']
-
- def __init__(self, **options):
- super(AntlrJavaLexer, self).__init__(JavaLexer, AntlrLexer,
- **options)
-
- def analyse_text(text):
- # Antlr language is Java by default
- return AntlrLexer.analyse_text(text) and 0.9
-
-
-class AntlrRubyLexer(DelegatingLexer):
- """
- `ANTLR`_ with Ruby Target
-
- .. versionadded:: 1.1
- """
-
- name = 'ANTLR With Ruby Target'
- aliases = ['antlr-ruby', 'antlr-rb']
- filenames = ['*.G', '*.g']
-
- def __init__(self, **options):
- super(AntlrRubyLexer, self).__init__(RubyLexer, AntlrLexer,
- **options)
-
- def analyse_text(text):
- return AntlrLexer.analyse_text(text) and \
- re.search(r'^\s*language\s*=\s*Ruby\s*;', text, re.M)
-
-
-class AntlrPerlLexer(DelegatingLexer):
- """
- `ANTLR`_ with Perl Target
-
- .. versionadded:: 1.1
- """
-
- name = 'ANTLR With Perl Target'
- aliases = ['antlr-perl']
- filenames = ['*.G', '*.g']
-
- def __init__(self, **options):
- super(AntlrPerlLexer, self).__init__(PerlLexer, AntlrLexer,
- **options)
-
- def analyse_text(text):
- return AntlrLexer.analyse_text(text) and \
- re.search(r'^\s*language\s*=\s*Perl5\s*;', text, re.M)
-
-
-class AntlrActionScriptLexer(DelegatingLexer):
- """
- `ANTLR`_ with ActionScript Target
-
- .. versionadded:: 1.1
- """
-
- name = 'ANTLR With ActionScript Target'
- aliases = ['antlr-as', 'antlr-actionscript']
- filenames = ['*.G', '*.g']
-
- def __init__(self, **options):
- from pygments.lexers.actionscript import ActionScriptLexer
- super(AntlrActionScriptLexer, self).__init__(ActionScriptLexer,
- AntlrLexer, **options)
-
- def analyse_text(text):
- return AntlrLexer.analyse_text(text) and \
- re.search(r'^\s*language\s*=\s*ActionScript\s*;', text, re.M)
-
-
-class TreetopBaseLexer(RegexLexer):
- """
- A base lexer for `Treetop <http://treetop.rubyforge.org/>`_ grammars.
- Not for direct use; use TreetopLexer instead.
-
- .. versionadded:: 1.6
- """
-
- tokens = {
- 'root': [
- include('space'),
- (r'require[ \t]+[^\n\r]+[\n\r]', Other),
- (r'module\b', Keyword.Namespace, 'module'),
- (r'grammar\b', Keyword, 'grammar'),
- ],
- 'module': [
- include('space'),
- include('end'),
- (r'module\b', Keyword, '#push'),
- (r'grammar\b', Keyword, 'grammar'),
- (r'[A-Z]\w*(?:::[A-Z]\w*)*', Name.Namespace),
- ],
- 'grammar': [
- include('space'),
- include('end'),
- (r'rule\b', Keyword, 'rule'),
- (r'include\b', Keyword, 'include'),
- (r'[A-Z]\w*', Name),
- ],
- 'include': [
- include('space'),
- (r'[A-Z]\w*(?:::[A-Z]\w*)*', Name.Class, '#pop'),
- ],
- 'rule': [
- include('space'),
- include('end'),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r'([A-Za-z_]\w*)(:)', bygroups(Name.Label, Punctuation)),
- (r'[A-Za-z_]\w*', Name),
- (r'[()]', Punctuation),
- (r'[?+*/&!~]', Operator),
- (r'\[(?:\\.|\[:\^?[a-z]+:\]|[^\\\]])+\]', String.Regex),
- (r'([0-9]*)(\.\.)([0-9]*)',
- bygroups(Number.Integer, Operator, Number.Integer)),
- (r'(<)([^>]+)(>)', bygroups(Punctuation, Name.Class, Punctuation)),
- (r'\{', Punctuation, 'inline_module'),
- (r'\.', String.Regex),
- ],
- 'inline_module': [
- (r'\{', Other, 'ruby'),
- (r'\}', Punctuation, '#pop'),
- (r'[^{}]+', Other),
- ],
- 'ruby': [
- (r'\{', Other, '#push'),
- (r'\}', Other, '#pop'),
- (r'[^{}]+', Other),
- ],
- 'space': [
- (r'[ \t\n\r]+', Whitespace),
- (r'#[^\n]*', Comment.Single),
- ],
- 'end': [
- (r'end\b', Keyword, '#pop'),
- ],
- }
-
-
-class TreetopLexer(DelegatingLexer):
- """
- A lexer for `Treetop <http://treetop.rubyforge.org/>`_ grammars.
-
- .. versionadded:: 1.6
- """
-
- name = 'Treetop'
- aliases = ['treetop']
- filenames = ['*.treetop', '*.tt']
-
- def __init__(self, **options):
- super(TreetopLexer, self).__init__(RubyLexer, TreetopBaseLexer, **options)
-
-
-class EbnfLexer(RegexLexer):
- """
- Lexer for `ISO/IEC 14977 EBNF
- <http://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form>`_
- grammars.
-
- .. versionadded:: 2.0
- """
-
- name = 'EBNF'
- aliases = ['ebnf']
- filenames = ['*.ebnf']
- mimetypes = ['text/x-ebnf']
-
- tokens = {
- 'root': [
- include('whitespace'),
- include('comment_start'),
- include('identifier'),
- (r'=', Operator, 'production'),
- ],
- 'production': [
- include('whitespace'),
- include('comment_start'),
- include('identifier'),
- (r'"[^"]*"', String.Double),
- (r"'[^']*'", String.Single),
- (r'(\?[^?]*\?)', Name.Entity),
- (r'[\[\]{}(),|]', Punctuation),
- (r'-', Operator),
- (r';', Punctuation, '#pop'),
- (r'\.', Punctuation, '#pop'),
- ],
- 'whitespace': [
- (r'\s+', Text),
- ],
- 'comment_start': [
- (r'\(\*', Comment.Multiline, 'comment'),
- ],
- 'comment': [
- (r'[^*)]', Comment.Multiline),
- include('comment_start'),
- (r'\*\)', Comment.Multiline, '#pop'),
- (r'[*)]', Comment.Multiline),
- ],
- 'identifier': [
- (r'([a-zA-Z][\w \-]*)', Keyword),
- ],
- }
diff --git a/pygments/lexers/pascal.py b/pygments/lexers/pascal.py
deleted file mode 100644
index 251bca2a..00000000
--- a/pygments/lexers/pascal.py
+++ /dev/null
@@ -1,644 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.pascal
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Pascal family languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, include, bygroups, words, \
- using, this, default
-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.scanner import Scanner
-
-# compatibility import
-from pygments.lexers.modula2 import Modula2Lexer
-
-__all__ = ['DelphiLexer', 'AdaLexer']
-
-
-class DelphiLexer(Lexer):
- """
- For `Delphi <http://www.borland.com/delphi/>`_ (Borland Object Pascal),
- Turbo Pascal and Free Pascal source code.
-
- Additional options accepted:
-
- `turbopascal`
- Highlight Turbo Pascal specific keywords (default: ``True``).
- `delphi`
- Highlight Borland Delphi specific keywords (default: ``True``).
- `freepascal`
- Highlight Free Pascal specific keywords (default: ``True``).
- `units`
- A list of units that should be considered builtin, supported are
- ``System``, ``SysUtils``, ``Classes`` and ``Math``.
- Default is to consider all of them builtin.
- """
- name = 'Delphi'
- aliases = ['delphi', 'pas', 'pascal', 'objectpascal']
- filenames = ['*.pas', '*.dpr']
- mimetypes = ['text/x-pascal']
-
- TURBO_PASCAL_KEYWORDS = (
- 'absolute', 'and', 'array', 'asm', 'begin', 'break', 'case',
- 'const', 'constructor', 'continue', 'destructor', 'div', 'do',
- 'downto', 'else', 'end', 'file', 'for', 'function', 'goto',
- 'if', 'implementation', 'in', 'inherited', 'inline', 'interface',
- 'label', 'mod', 'nil', 'not', 'object', 'of', 'on', 'operator',
- 'or', 'packed', 'procedure', 'program', 'record', 'reintroduce',
- 'repeat', 'self', 'set', 'shl', 'shr', 'string', 'then', 'to',
- 'type', 'unit', 'until', 'uses', 'var', 'while', 'with', 'xor'
- )
-
- DELPHI_KEYWORDS = (
- 'as', 'class', 'except', 'exports', 'finalization', 'finally',
- 'initialization', 'is', 'library', 'on', 'property', 'raise',
- 'threadvar', 'try'
- )
-
- FREE_PASCAL_KEYWORDS = (
- 'dispose', 'exit', 'false', 'new', 'true'
- )
-
- BLOCK_KEYWORDS = set((
- 'begin', 'class', 'const', 'constructor', 'destructor', 'end',
- 'finalization', 'function', 'implementation', 'initialization',
- 'label', 'library', 'operator', 'procedure', 'program', 'property',
- 'record', 'threadvar', 'type', 'unit', 'uses', 'var'
- ))
-
- FUNCTION_MODIFIERS = set((
- 'alias', 'cdecl', 'export', 'inline', 'interrupt', 'nostackframe',
- 'pascal', 'register', 'safecall', 'softfloat', 'stdcall',
- 'varargs', 'name', 'dynamic', 'near', 'virtual', 'external',
- 'override', 'assembler'
- ))
-
- # XXX: those aren't global. but currently we know no way for defining
- # them just for the type context.
- DIRECTIVES = set((
- 'absolute', 'abstract', 'assembler', 'cppdecl', 'default', 'far',
- 'far16', 'forward', 'index', 'oldfpccall', 'private', 'protected',
- 'published', 'public'
- ))
-
- BUILTIN_TYPES = set((
- 'ansichar', 'ansistring', 'bool', 'boolean', 'byte', 'bytebool',
- 'cardinal', 'char', 'comp', 'currency', 'double', 'dword',
- 'extended', 'int64', 'integer', 'iunknown', 'longbool', 'longint',
- 'longword', 'pansichar', 'pansistring', 'pbool', 'pboolean',
- 'pbyte', 'pbytearray', 'pcardinal', 'pchar', 'pcomp', 'pcurrency',
- 'pdate', 'pdatetime', 'pdouble', 'pdword', 'pextended', 'phandle',
- 'pint64', 'pinteger', 'plongint', 'plongword', 'pointer',
- 'ppointer', 'pshortint', 'pshortstring', 'psingle', 'psmallint',
- 'pstring', 'pvariant', 'pwidechar', 'pwidestring', 'pword',
- 'pwordarray', 'pwordbool', 'real', 'real48', 'shortint',
- 'shortstring', 'single', 'smallint', 'string', 'tclass', 'tdate',
- 'tdatetime', 'textfile', 'thandle', 'tobject', 'ttime', 'variant',
- 'widechar', 'widestring', 'word', 'wordbool'
- ))
-
- BUILTIN_UNITS = {
- 'System': (
- 'abs', 'acquireexceptionobject', 'addr', 'ansitoutf8',
- 'append', 'arctan', 'assert', 'assigned', 'assignfile',
- 'beginthread', 'blockread', 'blockwrite', 'break', 'chdir',
- 'chr', 'close', 'closefile', 'comptocurrency', 'comptodouble',
- 'concat', 'continue', 'copy', 'cos', 'dec', 'delete',
- 'dispose', 'doubletocomp', 'endthread', 'enummodules',
- 'enumresourcemodules', 'eof', 'eoln', 'erase', 'exceptaddr',
- 'exceptobject', 'exclude', 'exit', 'exp', 'filepos', 'filesize',
- 'fillchar', 'finalize', 'findclasshinstance', 'findhinstance',
- 'findresourcehinstance', 'flush', 'frac', 'freemem',
- 'get8087cw', 'getdir', 'getlasterror', 'getmem',
- 'getmemorymanager', 'getmodulefilename', 'getvariantmanager',
- 'halt', 'hi', 'high', 'inc', 'include', 'initialize', 'insert',
- 'int', 'ioresult', 'ismemorymanagerset', 'isvariantmanagerset',
- 'length', 'ln', 'lo', 'low', 'mkdir', 'move', 'new', 'odd',
- 'olestrtostring', 'olestrtostrvar', 'ord', 'paramcount',
- 'paramstr', 'pi', 'pos', 'pred', 'ptr', 'pucs4chars', 'random',
- 'randomize', 'read', 'readln', 'reallocmem',
- 'releaseexceptionobject', 'rename', 'reset', 'rewrite', 'rmdir',
- 'round', 'runerror', 'seek', 'seekeof', 'seekeoln',
- 'set8087cw', 'setlength', 'setlinebreakstyle',
- 'setmemorymanager', 'setstring', 'settextbuf',
- 'setvariantmanager', 'sin', 'sizeof', 'slice', 'sqr', 'sqrt',
- 'str', 'stringofchar', 'stringtoolestr', 'stringtowidechar',
- 'succ', 'swap', 'trunc', 'truncate', 'typeinfo',
- 'ucs4stringtowidestring', 'unicodetoutf8', 'uniquestring',
- 'upcase', 'utf8decode', 'utf8encode', 'utf8toansi',
- 'utf8tounicode', 'val', 'vararrayredim', 'varclear',
- 'widecharlentostring', 'widecharlentostrvar',
- 'widechartostring', 'widechartostrvar',
- 'widestringtoucs4string', 'write', 'writeln'
- ),
- 'SysUtils': (
- 'abort', 'addexitproc', 'addterminateproc', 'adjustlinebreaks',
- 'allocmem', 'ansicomparefilename', 'ansicomparestr',
- 'ansicomparetext', 'ansidequotedstr', 'ansiextractquotedstr',
- 'ansilastchar', 'ansilowercase', 'ansilowercasefilename',
- 'ansipos', 'ansiquotedstr', 'ansisamestr', 'ansisametext',
- 'ansistrcomp', 'ansistricomp', 'ansistrlastchar', 'ansistrlcomp',
- 'ansistrlicomp', 'ansistrlower', 'ansistrpos', 'ansistrrscan',
- 'ansistrscan', 'ansistrupper', 'ansiuppercase',
- 'ansiuppercasefilename', 'appendstr', 'assignstr', 'beep',
- 'booltostr', 'bytetocharindex', 'bytetocharlen', 'bytetype',
- 'callterminateprocs', 'changefileext', 'charlength',
- 'chartobyteindex', 'chartobytelen', 'comparemem', 'comparestr',
- 'comparetext', 'createdir', 'createguid', 'currentyear',
- 'currtostr', 'currtostrf', 'date', 'datetimetofiledate',
- 'datetimetostr', 'datetimetostring', 'datetimetosystemtime',
- 'datetimetotimestamp', 'datetostr', 'dayofweek', 'decodedate',
- 'decodedatefully', 'decodetime', 'deletefile', 'directoryexists',
- 'diskfree', 'disksize', 'disposestr', 'encodedate', 'encodetime',
- 'exceptionerrormessage', 'excludetrailingbackslash',
- 'excludetrailingpathdelimiter', 'expandfilename',
- 'expandfilenamecase', 'expanduncfilename', 'extractfiledir',
- 'extractfiledrive', 'extractfileext', 'extractfilename',
- 'extractfilepath', 'extractrelativepath', 'extractshortpathname',
- 'fileage', 'fileclose', 'filecreate', 'filedatetodatetime',
- 'fileexists', 'filegetattr', 'filegetdate', 'fileisreadonly',
- 'fileopen', 'fileread', 'filesearch', 'fileseek', 'filesetattr',
- 'filesetdate', 'filesetreadonly', 'filewrite', 'finalizepackage',
- 'findclose', 'findcmdlineswitch', 'findfirst', 'findnext',
- 'floattocurr', 'floattodatetime', 'floattodecimal', 'floattostr',
- 'floattostrf', 'floattotext', 'floattotextfmt', 'fmtloadstr',
- 'fmtstr', 'forcedirectories', 'format', 'formatbuf', 'formatcurr',
- 'formatdatetime', 'formatfloat', 'freeandnil', 'getcurrentdir',
- 'getenvironmentvariable', 'getfileversion', 'getformatsettings',
- 'getlocaleformatsettings', 'getmodulename', 'getpackagedescription',
- 'getpackageinfo', 'gettime', 'guidtostring', 'incamonth',
- 'includetrailingbackslash', 'includetrailingpathdelimiter',
- 'incmonth', 'initializepackage', 'interlockeddecrement',
- 'interlockedexchange', 'interlockedexchangeadd',
- 'interlockedincrement', 'inttohex', 'inttostr', 'isdelimiter',
- 'isequalguid', 'isleapyear', 'ispathdelimiter', 'isvalidident',
- 'languages', 'lastdelimiter', 'loadpackage', 'loadstr',
- 'lowercase', 'msecstotimestamp', 'newstr', 'nextcharindex', 'now',
- 'outofmemoryerror', 'quotedstr', 'raiselastoserror',
- 'raiselastwin32error', 'removedir', 'renamefile', 'replacedate',
- 'replacetime', 'safeloadlibrary', 'samefilename', 'sametext',
- 'setcurrentdir', 'showexception', 'sleep', 'stralloc', 'strbufsize',
- 'strbytetype', 'strcat', 'strcharlength', 'strcomp', 'strcopy',
- 'strdispose', 'strecopy', 'strend', 'strfmt', 'stricomp',
- 'stringreplace', 'stringtoguid', 'strlcat', 'strlcomp', 'strlcopy',
- 'strlen', 'strlfmt', 'strlicomp', 'strlower', 'strmove', 'strnew',
- 'strnextchar', 'strpas', 'strpcopy', 'strplcopy', 'strpos',
- 'strrscan', 'strscan', 'strtobool', 'strtobooldef', 'strtocurr',
- 'strtocurrdef', 'strtodate', 'strtodatedef', 'strtodatetime',
- 'strtodatetimedef', 'strtofloat', 'strtofloatdef', 'strtoint',
- 'strtoint64', 'strtoint64def', 'strtointdef', 'strtotime',
- 'strtotimedef', 'strupper', 'supports', 'syserrormessage',
- 'systemtimetodatetime', 'texttofloat', 'time', 'timestamptodatetime',
- 'timestamptomsecs', 'timetostr', 'trim', 'trimleft', 'trimright',
- 'tryencodedate', 'tryencodetime', 'tryfloattocurr', 'tryfloattodatetime',
- 'trystrtobool', 'trystrtocurr', 'trystrtodate', 'trystrtodatetime',
- 'trystrtofloat', 'trystrtoint', 'trystrtoint64', 'trystrtotime',
- 'unloadpackage', 'uppercase', 'widecomparestr', 'widecomparetext',
- 'widefmtstr', 'wideformat', 'wideformatbuf', 'widelowercase',
- 'widesamestr', 'widesametext', 'wideuppercase', 'win32check',
- 'wraptext'
- ),
- 'Classes': (
- 'activateclassgroup', 'allocatehwnd', 'bintohex', 'checksynchronize',
- 'collectionsequal', 'countgenerations', 'deallocatehwnd', 'equalrect',
- 'extractstrings', 'findclass', 'findglobalcomponent', 'getclass',
- 'groupdescendantswith', 'hextobin', 'identtoint',
- 'initinheritedcomponent', 'inttoident', 'invalidpoint',
- 'isuniqueglobalcomponentname', 'linestart', 'objectbinarytotext',
- 'objectresourcetotext', 'objecttexttobinary', 'objecttexttoresource',
- 'pointsequal', 'readcomponentres', 'readcomponentresex',
- 'readcomponentresfile', 'rect', 'registerclass', 'registerclassalias',
- 'registerclasses', 'registercomponents', 'registerintegerconsts',
- 'registernoicon', 'registernonactivex', 'smallpoint', 'startclassgroup',
- 'teststreamformat', 'unregisterclass', 'unregisterclasses',
- 'unregisterintegerconsts', 'unregistermoduleclasses',
- 'writecomponentresfile'
- ),
- 'Math': (
- 'arccos', 'arccosh', 'arccot', 'arccoth', 'arccsc', 'arccsch', 'arcsec',
- 'arcsech', 'arcsin', 'arcsinh', 'arctan2', 'arctanh', 'ceil',
- 'comparevalue', 'cosecant', 'cosh', 'cot', 'cotan', 'coth', 'csc',
- 'csch', 'cycletodeg', 'cycletograd', 'cycletorad', 'degtocycle',
- 'degtograd', 'degtorad', 'divmod', 'doubledecliningbalance',
- 'ensurerange', 'floor', 'frexp', 'futurevalue', 'getexceptionmask',
- 'getprecisionmode', 'getroundmode', 'gradtocycle', 'gradtodeg',
- 'gradtorad', 'hypot', 'inrange', 'interestpayment', 'interestrate',
- 'internalrateofreturn', 'intpower', 'isinfinite', 'isnan', 'iszero',
- 'ldexp', 'lnxp1', 'log10', 'log2', 'logn', 'max', 'maxintvalue',
- 'maxvalue', 'mean', 'meanandstddev', 'min', 'minintvalue', 'minvalue',
- 'momentskewkurtosis', 'netpresentvalue', 'norm', 'numberofperiods',
- 'payment', 'periodpayment', 'poly', 'popnstddev', 'popnvariance',
- 'power', 'presentvalue', 'radtocycle', 'radtodeg', 'radtograd',
- 'randg', 'randomrange', 'roundto', 'samevalue', 'sec', 'secant',
- 'sech', 'setexceptionmask', 'setprecisionmode', 'setroundmode',
- 'sign', 'simpleroundto', 'sincos', 'sinh', 'slndepreciation', 'stddev',
- 'sum', 'sumint', 'sumofsquares', 'sumsandsquares', 'syddepreciation',
- 'tan', 'tanh', 'totalvariance', 'variance'
- )
- }
-
- ASM_REGISTERS = set((
- 'ah', 'al', 'ax', 'bh', 'bl', 'bp', 'bx', 'ch', 'cl', 'cr0',
- 'cr1', 'cr2', 'cr3', 'cr4', 'cs', 'cx', 'dh', 'di', 'dl', 'dr0',
- 'dr1', 'dr2', 'dr3', 'dr4', 'dr5', 'dr6', 'dr7', 'ds', 'dx',
- 'eax', 'ebp', 'ebx', 'ecx', 'edi', 'edx', 'es', 'esi', 'esp',
- 'fs', 'gs', 'mm0', 'mm1', 'mm2', 'mm3', 'mm4', 'mm5', 'mm6',
- 'mm7', 'si', 'sp', 'ss', 'st0', 'st1', 'st2', 'st3', 'st4', 'st5',
- 'st6', 'st7', 'xmm0', 'xmm1', 'xmm2', 'xmm3', 'xmm4', 'xmm5',
- 'xmm6', 'xmm7'
- ))
-
- ASM_INSTRUCTIONS = set((
- 'aaa', 'aad', 'aam', 'aas', 'adc', 'add', 'and', 'arpl', 'bound',
- 'bsf', 'bsr', 'bswap', 'bt', 'btc', 'btr', 'bts', 'call', 'cbw',
- 'cdq', 'clc', 'cld', 'cli', 'clts', 'cmc', 'cmova', 'cmovae',
- 'cmovb', 'cmovbe', 'cmovc', 'cmovcxz', 'cmove', 'cmovg',
- 'cmovge', 'cmovl', 'cmovle', 'cmovna', 'cmovnae', 'cmovnb',
- 'cmovnbe', 'cmovnc', 'cmovne', 'cmovng', 'cmovnge', 'cmovnl',
- 'cmovnle', 'cmovno', 'cmovnp', 'cmovns', 'cmovnz', 'cmovo',
- 'cmovp', 'cmovpe', 'cmovpo', 'cmovs', 'cmovz', 'cmp', 'cmpsb',
- 'cmpsd', 'cmpsw', 'cmpxchg', 'cmpxchg486', 'cmpxchg8b', 'cpuid',
- 'cwd', 'cwde', 'daa', 'das', 'dec', 'div', 'emms', 'enter', 'hlt',
- 'ibts', 'icebp', 'idiv', 'imul', 'in', 'inc', 'insb', 'insd',
- 'insw', 'int', 'int01', 'int03', 'int1', 'int3', 'into', 'invd',
- 'invlpg', 'iret', 'iretd', 'iretw', 'ja', 'jae', 'jb', 'jbe',
- 'jc', 'jcxz', 'jcxz', 'je', 'jecxz', 'jg', 'jge', 'jl', 'jle',
- 'jmp', 'jna', 'jnae', 'jnb', 'jnbe', 'jnc', 'jne', 'jng', 'jnge',
- 'jnl', 'jnle', 'jno', 'jnp', 'jns', 'jnz', 'jo', 'jp', 'jpe',
- 'jpo', 'js', 'jz', 'lahf', 'lar', 'lcall', 'lds', 'lea', 'leave',
- 'les', 'lfs', 'lgdt', 'lgs', 'lidt', 'ljmp', 'lldt', 'lmsw',
- 'loadall', 'loadall286', 'lock', 'lodsb', 'lodsd', 'lodsw',
- 'loop', 'loope', 'loopne', 'loopnz', 'loopz', 'lsl', 'lss', 'ltr',
- 'mov', 'movd', 'movq', 'movsb', 'movsd', 'movsw', 'movsx',
- 'movzx', 'mul', 'neg', 'nop', 'not', 'or', 'out', 'outsb', 'outsd',
- 'outsw', 'pop', 'popa', 'popad', 'popaw', 'popf', 'popfd', 'popfw',
- 'push', 'pusha', 'pushad', 'pushaw', 'pushf', 'pushfd', 'pushfw',
- 'rcl', 'rcr', 'rdmsr', 'rdpmc', 'rdshr', 'rdtsc', 'rep', 'repe',
- 'repne', 'repnz', 'repz', 'ret', 'retf', 'retn', 'rol', 'ror',
- 'rsdc', 'rsldt', 'rsm', 'sahf', 'sal', 'salc', 'sar', 'sbb',
- 'scasb', 'scasd', 'scasw', 'seta', 'setae', 'setb', 'setbe',
- 'setc', 'setcxz', 'sete', 'setg', 'setge', 'setl', 'setle',
- 'setna', 'setnae', 'setnb', 'setnbe', 'setnc', 'setne', 'setng',
- 'setnge', 'setnl', 'setnle', 'setno', 'setnp', 'setns', 'setnz',
- 'seto', 'setp', 'setpe', 'setpo', 'sets', 'setz', 'sgdt', 'shl',
- 'shld', 'shr', 'shrd', 'sidt', 'sldt', 'smi', 'smint', 'smintold',
- 'smsw', 'stc', 'std', 'sti', 'stosb', 'stosd', 'stosw', 'str',
- 'sub', 'svdc', 'svldt', 'svts', 'syscall', 'sysenter', 'sysexit',
- 'sysret', 'test', 'ud1', 'ud2', 'umov', 'verr', 'verw', 'wait',
- 'wbinvd', 'wrmsr', 'wrshr', 'xadd', 'xbts', 'xchg', 'xlat',
- 'xlatb', 'xor'
- ))
-
- def __init__(self, **options):
- Lexer.__init__(self, **options)
- self.keywords = set()
- if get_bool_opt(options, 'turbopascal', True):
- self.keywords.update(self.TURBO_PASCAL_KEYWORDS)
- if get_bool_opt(options, 'delphi', True):
- self.keywords.update(self.DELPHI_KEYWORDS)
- if get_bool_opt(options, 'freepascal', True):
- self.keywords.update(self.FREE_PASCAL_KEYWORDS)
- self.builtins = set()
- for unit in get_list_opt(options, 'units', list(self.BUILTIN_UNITS)):
- self.builtins.update(self.BUILTIN_UNITS[unit])
-
- def get_tokens_unprocessed(self, text):
- scanner = Scanner(text, re.DOTALL | re.MULTILINE | re.IGNORECASE)
- stack = ['initial']
- in_function_block = False
- in_property_block = False
- was_dot = False
- next_token_is_function = False
- next_token_is_property = False
- collect_labels = False
- block_labels = set()
- brace_balance = [0, 0]
-
- while not scanner.eos:
- token = Error
-
- if stack[-1] == 'initial':
- if scanner.scan(r'\s+'):
- token = Text
- elif scanner.scan(r'\{.*?\}|\(\*.*?\*\)'):
- if scanner.match.startswith('$'):
- token = Comment.Preproc
- else:
- token = Comment.Multiline
- elif scanner.scan(r'//.*?$'):
- token = Comment.Single
- elif scanner.scan(r'[-+*\/=<>:;,.@\^]'):
- token = Operator
- # stop label highlighting on next ";"
- if collect_labels and scanner.match == ';':
- collect_labels = False
- elif scanner.scan(r'[\(\)\[\]]+'):
- token = Punctuation
- # abort function naming ``foo = Function(...)``
- next_token_is_function = False
- # if we are in a function block we count the open
- # braces because ootherwise it's impossible to
- # determine the end of the modifier context
- if in_function_block or in_property_block:
- if scanner.match == '(':
- brace_balance[0] += 1
- elif scanner.match == ')':
- brace_balance[0] -= 1
- elif scanner.match == '[':
- brace_balance[1] += 1
- elif scanner.match == ']':
- brace_balance[1] -= 1
- elif scanner.scan(r'[A-Za-z_][A-Za-z_0-9]*'):
- lowercase_name = scanner.match.lower()
- if lowercase_name == 'result':
- token = Name.Builtin.Pseudo
- elif lowercase_name in self.keywords:
- token = Keyword
- # if we are in a special block and a
- # block ending keyword occours (and the parenthesis
- # is balanced) we end the current block context
- if (in_function_block or in_property_block) and \
- lowercase_name in self.BLOCK_KEYWORDS and \
- brace_balance[0] <= 0 and \
- brace_balance[1] <= 0:
- in_function_block = False
- in_property_block = False
- brace_balance = [0, 0]
- block_labels = set()
- if lowercase_name in ('label', 'goto'):
- collect_labels = True
- elif lowercase_name == 'asm':
- stack.append('asm')
- elif lowercase_name == 'property':
- in_property_block = True
- next_token_is_property = True
- elif lowercase_name in ('procedure', 'operator',
- 'function', 'constructor',
- 'destructor'):
- in_function_block = True
- next_token_is_function = True
- # we are in a function block and the current name
- # is in the set of registered modifiers. highlight
- # it as pseudo keyword
- elif in_function_block and \
- lowercase_name in self.FUNCTION_MODIFIERS:
- token = Keyword.Pseudo
- # if we are in a property highlight some more
- # modifiers
- elif in_property_block and \
- lowercase_name in ('read', 'write'):
- token = Keyword.Pseudo
- next_token_is_function = True
- # if the last iteration set next_token_is_function
- # to true we now want this name highlighted as
- # function. so do that and reset the state
- elif next_token_is_function:
- # Look if the next token is a dot. If yes it's
- # not a function, but a class name and the
- # part after the dot a function name
- if scanner.test(r'\s*\.\s*'):
- token = Name.Class
- # it's not a dot, our job is done
- else:
- token = Name.Function
- next_token_is_function = False
- # same for properties
- elif next_token_is_property:
- token = Name.Property
- next_token_is_property = False
- # Highlight this token as label and add it
- # to the list of known labels
- elif collect_labels:
- token = Name.Label
- block_labels.add(scanner.match.lower())
- # name is in list of known labels
- elif lowercase_name in block_labels:
- token = Name.Label
- elif lowercase_name in self.BUILTIN_TYPES:
- token = Keyword.Type
- elif lowercase_name in self.DIRECTIVES:
- token = Keyword.Pseudo
- # builtins are just builtins if the token
- # before isn't a dot
- elif not was_dot and lowercase_name in self.builtins:
- token = Name.Builtin
- else:
- token = Name
- elif scanner.scan(r"'"):
- token = String
- stack.append('string')
- elif scanner.scan(r'\#(\d+|\$[0-9A-Fa-f]+)'):
- token = String.Char
- elif scanner.scan(r'\$[0-9A-Fa-f]+'):
- token = Number.Hex
- elif scanner.scan(r'\d+(?![eE]|\.[^.])'):
- token = Number.Integer
- elif scanner.scan(r'\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)'):
- token = Number.Float
- else:
- # if the stack depth is deeper than once, pop
- if len(stack) > 1:
- stack.pop()
- scanner.get_char()
-
- elif stack[-1] == 'string':
- if scanner.scan(r"''"):
- token = String.Escape
- elif scanner.scan(r"'"):
- token = String
- stack.pop()
- elif scanner.scan(r"[^']*"):
- token = String
- else:
- scanner.get_char()
- stack.pop()
-
- elif stack[-1] == 'asm':
- if scanner.scan(r'\s+'):
- token = Text
- elif scanner.scan(r'end'):
- token = Keyword
- stack.pop()
- elif scanner.scan(r'\{.*?\}|\(\*.*?\*\)'):
- if scanner.match.startswith('$'):
- token = Comment.Preproc
- else:
- token = Comment.Multiline
- elif scanner.scan(r'//.*?$'):
- token = Comment.Single
- elif scanner.scan(r"'"):
- token = String
- stack.append('string')
- elif scanner.scan(r'@@[A-Za-z_][A-Za-z_0-9]*'):
- token = Name.Label
- elif scanner.scan(r'[A-Za-z_][A-Za-z_0-9]*'):
- lowercase_name = scanner.match.lower()
- if lowercase_name in self.ASM_INSTRUCTIONS:
- token = Keyword
- elif lowercase_name in self.ASM_REGISTERS:
- token = Name.Builtin
- else:
- token = Name
- elif scanner.scan(r'[-+*\/=<>:;,.@\^]+'):
- token = Operator
- elif scanner.scan(r'[\(\)\[\]]+'):
- token = Punctuation
- elif scanner.scan(r'\$[0-9A-Fa-f]+'):
- token = Number.Hex
- elif scanner.scan(r'\d+(?![eE]|\.[^.])'):
- token = Number.Integer
- elif scanner.scan(r'\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)'):
- token = Number.Float
- else:
- scanner.get_char()
- stack.pop()
-
- # save the dot!!!11
- if scanner.match.strip():
- was_dot = scanner.match == '.'
- yield scanner.start_pos, token, scanner.match or ''
-
-
-class AdaLexer(RegexLexer):
- """
- For Ada source code.
-
- .. versionadded:: 1.3
- """
-
- name = 'Ada'
- aliases = ['ada', 'ada95', 'ada2005']
- filenames = ['*.adb', '*.ads', '*.ada']
- mimetypes = ['text/x-ada']
-
- flags = re.MULTILINE | re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'[^\S\n]+', Text),
- (r'--.*?\n', Comment.Single),
- (r'[^\S\n]+', Text),
- (r'function|procedure|entry', Keyword.Declaration, 'subprogram'),
- (r'(subtype|type)(\s+)(\w+)',
- bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'),
- (r'task|protected', Keyword.Declaration),
- (r'(subtype)(\s+)', bygroups(Keyword.Declaration, Text)),
- (r'(end)(\s+)', bygroups(Keyword.Reserved, Text), 'end'),
- (r'(pragma)(\s+)(\w+)', bygroups(Keyword.Reserved, Text,
- Comment.Preproc)),
- (r'(true|false|null)\b', Keyword.Constant),
- (words((
- 'Address', 'Byte', 'Boolean', 'Character', 'Controlled', 'Count',
- 'Cursor', 'Duration', 'File_Mode', 'File_Type', 'Float', 'Generator',
- 'Integer', 'Long_Float', 'Long_Integer', 'Long_Long_Float',
- 'Long_Long_Integer', 'Natural', 'Positive', 'Reference_Type',
- 'Short_Float', 'Short_Integer', 'Short_Short_Float',
- 'Short_Short_Integer', 'String', 'Wide_Character', 'Wide_String'),
- suffix=r'\b'),
- Keyword.Type),
- (r'(and(\s+then)?|in|mod|not|or(\s+else)|rem)\b', Operator.Word),
- (r'generic|private', Keyword.Declaration),
- (r'package', Keyword.Declaration, 'package'),
- (r'array\b', Keyword.Reserved, 'array_def'),
- (r'(with|use)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
- (r'(\w+)(\s*)(:)(\s*)(constant)',
- bygroups(Name.Constant, Text, Punctuation, Text,
- Keyword.Reserved)),
- (r'<<\w+>>', Name.Label),
- (r'(\w+)(\s*)(:)(\s*)(declare|begin|loop|for|while)',
- bygroups(Name.Label, Text, Punctuation, Text, Keyword.Reserved)),
- (words((
- 'abort', 'abs', 'abstract', 'accept', 'access', 'aliased', 'all',
- 'array', 'at', 'begin', 'body', 'case', 'constant', 'declare',
- 'delay', 'delta', 'digits', 'do', 'else', 'elsif', 'end', 'entry',
- 'exception', 'exit', 'interface', 'for', 'goto', 'if', 'is', 'limited',
- 'loop', 'new', 'null', 'of', 'or', 'others', 'out', 'overriding',
- 'pragma', 'protected', 'raise', 'range', 'record', 'renames', 'requeue',
- 'return', 'reverse', 'select', 'separate', 'subtype', 'synchronized',
- 'task', 'tagged', 'terminate', 'then', 'type', 'until', 'when',
- 'while', 'xor'), prefix=r'\b', suffix=r'\b'),
- Keyword.Reserved),
- (r'"[^"]*"', String),
- include('attribute'),
- include('numbers'),
- (r"'[^']'", String.Character),
- (r'(\w+)(\s*|[(,])', bygroups(Name, using(this))),
- (r"(<>|=>|:=|[()|:;,.'])", Punctuation),
- (r'[*<>+=/&-]', Operator),
- (r'\n+', Text),
- ],
- 'numbers': [
- (r'[0-9_]+#[0-9a-f]+#', Number.Hex),
- (r'[0-9_]+\.[0-9_]*', Number.Float),
- (r'[0-9_]+', Number.Integer),
- ],
- 'attribute': [
- (r"(')(\w+)", bygroups(Punctuation, Name.Attribute)),
- ],
- 'subprogram': [
- (r'\(', Punctuation, ('#pop', 'formal_part')),
- (r';', Punctuation, '#pop'),
- (r'is\b', Keyword.Reserved, '#pop'),
- (r'"[^"]+"|\w+', Name.Function),
- include('root'),
- ],
- 'end': [
- ('(if|case|record|loop|select)', Keyword.Reserved),
- (r'"[^"]+"|[\w.]+', Name.Function),
- (r'\s+', Text),
- (';', Punctuation, '#pop'),
- ],
- 'type_def': [
- (r';', Punctuation, '#pop'),
- (r'\(', Punctuation, 'formal_part'),
- (r'with|and|use', Keyword.Reserved),
- (r'array\b', Keyword.Reserved, ('#pop', 'array_def')),
- (r'record\b', Keyword.Reserved, ('record_def')),
- (r'(null record)(;)', bygroups(Keyword.Reserved, Punctuation), '#pop'),
- include('root'),
- ],
- 'array_def': [
- (r';', Punctuation, '#pop'),
- (r'(\w+)(\s+)(range)', bygroups(Keyword.Type, Text, Keyword.Reserved)),
- include('root'),
- ],
- 'record_def': [
- (r'end record', Keyword.Reserved, '#pop'),
- include('root'),
- ],
- 'import': [
- (r'[\w.]+', Name.Namespace, '#pop'),
- default('#pop'),
- ],
- 'formal_part': [
- (r'\)', Punctuation, '#pop'),
- (r'\w+', Name.Variable),
- (r',|:[^=]', Punctuation),
- (r'(in|not|null|out|access)\b', Keyword.Reserved),
- include('root'),
- ],
- 'package': [
- ('body', Keyword.Declaration),
- (r'is\s+new|renames', Keyword.Reserved),
- ('is', Keyword.Reserved, '#pop'),
- (';', Punctuation, '#pop'),
- (r'\(', Punctuation, 'package_instantiation'),
- (r'([\w.]+)', Name.Class),
- include('root'),
- ],
- 'package_instantiation': [
- (r'("[^"]+"|\w+)(\s+)(=>)', bygroups(Name.Variable, Text, Punctuation)),
- (r'[\w.\'"]', Text),
- (r'\)', Punctuation, '#pop'),
- include('root'),
- ],
- }
diff --git a/pygments/lexers/pawn.py b/pygments/lexers/pawn.py
deleted file mode 100644
index 576df424..00000000
--- a/pygments/lexers/pawn.py
+++ /dev/null
@@ -1,199 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.pawn
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Pawn languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-from pygments.util import get_bool_opt
-
-__all__ = ['SourcePawnLexer', 'PawnLexer']
-
-
-class SourcePawnLexer(RegexLexer):
- """
- For SourcePawn source code with preprocessor directives.
-
- .. versionadded:: 1.6
- """
- name = 'SourcePawn'
- aliases = ['sp']
- filenames = ['*.sp']
- mimetypes = ['text/x-sourcepawn']
-
- #: optional Comment or Whitespace
- _ws = r'(?:\s|//.*?\n|/\*.*?\*/)+'
- #: only one /* */ style comment
- _ws1 = r'\s*(?:/[*].*?[*]/\s*)*'
-
- tokens = {
- 'root': [
- # preprocessor directives: without whitespace
- (r'^#if\s+0', Comment.Preproc, 'if0'),
- ('^#', Comment.Preproc, 'macro'),
- # or with whitespace
- ('^' + _ws1 + r'#if\s+0', Comment.Preproc, 'if0'),
- ('^' + _ws1 + '#', Comment.Preproc, 'macro'),
- (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+[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'(case|const|continue|native|'
- r'default|else|enum|for|if|new|operator|'
- r'public|return|sizeof|static|decl|struct|switch)\b', Keyword),
- (r'(bool|Float)\b', Keyword.Type),
- (r'(true|false)\b', Keyword.Constant),
- (r'[a-zA-Z_]\w*', 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'),
- ],
- 'if0': [
- (r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
- (r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
- (r'.*?\n', Comment),
- ]
- }
-
- SM_TYPES = set(('Action', 'bool', 'Float', 'Plugin', 'String', 'any',
- 'AdminFlag', 'OverrideType', 'OverrideRule', 'ImmunityType',
- 'GroupId', 'AdminId', 'AdmAccessMode', 'AdminCachePart',
- 'CookieAccess', 'CookieMenu', 'CookieMenuAction', 'NetFlow',
- 'ConVarBounds', 'QueryCookie', 'ReplySource',
- 'ConVarQueryResult', 'ConVarQueryFinished', 'Function',
- 'Action', 'Identity', 'PluginStatus', 'PluginInfo', 'DBResult',
- 'DBBindType', 'DBPriority', 'PropType', 'PropFieldType',
- 'MoveType', 'RenderMode', 'RenderFx', 'EventHookMode',
- 'EventHook', 'FileType', 'FileTimeMode', 'PathType',
- 'ParamType', 'ExecType', 'DialogType', 'Handle', 'KvDataTypes',
- 'NominateResult', 'MapChange', 'MenuStyle', 'MenuAction',
- 'MenuSource', 'RegexError', 'SDKCallType', 'SDKLibrary',
- 'SDKFuncConfSource', 'SDKType', 'SDKPassMethod', 'RayType',
- 'TraceEntityFilter', 'ListenOverride', 'SortOrder', 'SortType',
- 'SortFunc2D', 'APLRes', 'FeatureType', 'FeatureStatus',
- 'SMCResult', 'SMCError', 'TFClassType', 'TFTeam', 'TFCond',
- 'TFResourceType', 'Timer', 'TopMenuAction', 'TopMenuObjectType',
- 'TopMenuPosition', 'TopMenuObject', 'UserMsg'))
-
- def __init__(self, **options):
- self.smhighlighting = get_bool_opt(options,
- 'sourcemod', True)
-
- self._functions = set()
- if self.smhighlighting:
- from pygments.lexers._sourcemod_builtins import FUNCTIONS
- self._functions.update(FUNCTIONS)
- 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.smhighlighting:
- if value in self.SM_TYPES:
- token = Keyword.Type
- elif value in self._functions:
- token = Name.Builtin
- yield index, token, value
-
-
-class PawnLexer(RegexLexer):
- """
- For Pawn source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'Pawn'
- aliases = ['pawn']
- filenames = ['*.p', '*.pwn', '*.inc']
- mimetypes = ['text/x-pawn']
-
- #: optional Comment or Whitespace
- _ws = r'(?:\s|//.*?\n|/[*][\w\W]*?[*]/)+'
- #: only one /* */ style comment
- _ws1 = r'\s*(?:/[*].*?[*]/\s*)*'
-
- tokens = {
- 'root': [
- # preprocessor directives: without whitespace
- (r'^#if\s+0', Comment.Preproc, 'if0'),
- ('^#', Comment.Preproc, 'macro'),
- # or with whitespace
- ('^' + _ws1 + r'#if\s+0', Comment.Preproc, 'if0'),
- ('^' + _ws1 + '#', Comment.Preproc, 'macro'),
- (r'\n', Text),
- (r'\s+', Text),
- (r'\\\n', Text), # line continuation
- (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
- (r'/(\\\n)?\*[\w\W]*?\*(\\\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+[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'(switch|case|default|const|new|static|char|continue|break|'
- r'if|else|for|while|do|operator|enum|'
- r'public|return|sizeof|tagof|state|goto)\b', Keyword),
- (r'(bool|Float)\b', Keyword.Type),
- (r'(true|false)\b', Keyword.Constant),
- (r'[a-zA-Z_]\w*', 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'),
- ],
- 'if0': [
- (r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
- (r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
- (r'.*?\n', Comment),
- ]
- }
diff --git a/pygments/lexers/perl.py b/pygments/lexers/perl.py
deleted file mode 100644
index 8f30c186..00000000
--- a/pygments/lexers/perl.py
+++ /dev/null
@@ -1,620 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.perl
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Perl and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
- using, this, default, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-from pygments.util import shebang_matches
-
-__all__ = ['PerlLexer', 'Perl6Lexer']
-
-
-class PerlLexer(RegexLexer):
- """
- For `Perl <http://www.perl.org>`_ source code.
- """
-
- name = 'Perl'
- aliases = ['perl', 'pl']
- filenames = ['*.pl', '*.pm', '*.t']
- mimetypes = ['text/x-perl', 'application/x-perl']
-
- flags = re.DOTALL | re.MULTILINE
- # 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'),
- ],
- 'root': [
- (r'\A\#!.+?$', Comment.Hashbang),
- (r'\#.*?$', Comment.Single),
- (r'^=[a-zA-Z0-9]+\s+.*?\n=cut', Comment.Multiline),
- (words((
- 'case', 'continue', 'do', 'else', 'elsif', 'for', 'foreach',
- 'if', 'last', 'my', 'next', 'our', 'redo', 'reset', 'then',
- 'unless', 'until', 'while', 'print', 'new', 'BEGIN',
- 'CHECK', 'INIT', 'END', 'return'), suffix=r'\b'),
- Keyword),
- (r'(format)(\s+)(\w+)(\s*)(=)(\s*\n)',
- 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),
- # 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'm(?=[/!\\{<\[(@%$])', String.Regex, 'balanced-regex'),
- (r'((?<==~)|(?<=\())\s*/(\\\\|\\[^\\]|[^\\/])*/[gcimosx]*',
- String.Regex),
- (r'\s+', Text),
- (words((
- 'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless', 'caller', 'chdir',
- 'chmod', 'chomp', 'chop', 'chown', 'chr', 'chroot', 'close', 'closedir', 'connect',
- 'continue', 'cos', 'crypt', 'dbmclose', 'dbmopen', 'defined', 'delete', 'die',
- 'dump', 'each', 'endgrent', 'endhostent', 'endnetent', 'endprotoent',
- 'endpwent', 'endservent', 'eof', 'eval', 'exec', 'exists', 'exit', 'exp', 'fcntl',
- 'fileno', 'flock', 'fork', 'format', 'formline', 'getc', 'getgrent', 'getgrgid',
- 'getgrnam', 'gethostbyaddr', 'gethostbyname', 'gethostent', 'getlogin',
- 'getnetbyaddr', 'getnetbyname', 'getnetent', 'getpeername', 'getpgrp',
- 'getppid', 'getpriority', 'getprotobyname', 'getprotobynumber',
- 'getprotoent', 'getpwent', 'getpwnam', 'getpwuid', 'getservbyname',
- 'getservbyport', 'getservent', 'getsockname', 'getsockopt', 'glob', 'gmtime',
- 'goto', 'grep', 'hex', 'import', 'index', 'int', 'ioctl', 'join', 'keys', 'kill', 'last',
- 'lc', 'lcfirst', 'length', 'link', 'listen', 'local', 'localtime', 'log', 'lstat',
- 'map', 'mkdir', 'msgctl', 'msgget', 'msgrcv', 'msgsnd', 'my', 'next', 'oct', 'open',
- 'opendir', 'ord', 'our', 'pack', 'pipe', 'pop', 'pos', 'printf',
- 'prototype', 'push', 'quotemeta', 'rand', 'read', 'readdir',
- 'readline', 'readlink', 'readpipe', 'recv', 'redo', 'ref', 'rename',
- 'reverse', 'rewinddir', 'rindex', 'rmdir', 'scalar', 'seek', 'seekdir',
- 'select', 'semctl', 'semget', 'semop', 'send', 'setgrent', 'sethostent', 'setnetent',
- 'setpgrp', 'setpriority', 'setprotoent', 'setpwent', 'setservent',
- 'setsockopt', 'shift', 'shmctl', 'shmget', 'shmread', 'shmwrite', 'shutdown',
- 'sin', 'sleep', 'socket', 'socketpair', 'sort', 'splice', 'split', 'sprintf', 'sqrt',
- 'srand', 'stat', 'study', 'substr', 'symlink', 'syscall', 'sysopen', 'sysread',
- 'sysseek', 'system', 'syswrite', 'tell', 'telldir', 'tie', 'tied', 'time', 'times', 'tr',
- 'truncate', 'uc', 'ucfirst', 'umask', 'undef', 'unlink', 'unpack', 'unshift', 'untie',
- 'utime', 'values', 'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write'), suffix=r'\b'),
- Name.Builtin),
- (r'((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\b', Name.Builtin.Pseudo),
- (r'(<<)([\'"]?)([a-zA-Z_]\w*)(\2;?\n.*?\n)(\3)(\n)',
- bygroups(String, String, String.Delimiter, String, String.Delimiter, Text)),
- (r'__END__', Comment.Preproc, 'end-part'),
- (r'\$\^[ADEFHILMOPSTWX]', Name.Variable.Global),
- (r"\$[\\\"\[\]'&`+*.,;=%~?@$!<>(^|/-](?!\w)", Name.Variable.Global),
- (r'[$@%#]+', Name.Variable, 'varname'),
- (r'0_?[0-7]+(_[0-7]+)*', Number.Oct),
- (r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex),
- (r'0b[01]+(_[01]+)*', Number.Bin),
- (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?',
- Number.Float),
- (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float),
- (r'\d+(_\d+)*', Number.Integer),
- (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'),
- (r'(q|qq|qw|qr|qx)\[', String.Other, 'sb-string'),
- (r'(q|qq|qw|qr|qx)\<', String.Other, 'lt-string'),
- (r'(q|qq|qw|qr|qx)([\W_])(.|\n)*?\2', String.Other),
- (r'(package)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)',
- bygroups(Keyword, Text, Name.Namespace)),
- (r'(use|require|no)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)',
- bygroups(Keyword, Text, Name.Namespace)),
- (r'(sub)(\s+)', bygroups(Keyword, Text), 'funcname'),
- (words((
- 'no', 'package', 'require', 'use'), suffix=r'\b'),
- Keyword),
- (r'(\[\]|\*\*|::|<<|>>|>=|<=>|<=|={3}|!=|=~|'
- r'!~|&&?|\|\||\.{1,3})', Operator),
- (r'[-+/*%=<>&^|!\\~]=?', Operator),
- (r'[()\[\]:;,<>/?{}]', Punctuation), # yes, there's no shortage
- # of punctuation in Perl!
- (r'(?=\w)', Name, 'name'),
- ],
- 'format': [
- (r'\.\n', String.Interpol, '#pop'),
- (r'[^\n]*\n', String.Interpol),
- ],
- 'varname': [
- (r'\s+', Text),
- (r'\{', Punctuation, '#pop'), # hash syntax?
- (r'\)|,', Punctuation, '#pop'), # argument specifier
- (r'\w+::', Name.Namespace),
- (r'[\w:]+', Name.Variable, '#pop'),
- ],
- 'name': [
- (r'[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*(::)?(?=\s*->)', Name.Namespace, '#pop'),
- (r'[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*::', Name.Namespace, '#pop'),
- (r'[\w:]+', Name, '#pop'),
- (r'[A-Z_]+(?=\W)', Name.Constant, '#pop'),
- (r'(?=\W)', Text, '#pop'),
- ],
- 'funcname': [
- (r'[a-zA-Z_]\w*[!?]?', Name.Function),
- (r'\s+', Text),
- # argument declaration
- (r'(\([$@%]*\))(\s*)', bygroups(Punctuation, Text)),
- (r';', Punctuation, '#pop'),
- (r'.*?\{', Punctuation, '#pop'),
- ],
- 'cb-string': [
- (r'\\[{}\\]', String.Other),
- (r'\\', String.Other),
- (r'\{', String.Other, 'cb-string'),
- (r'\}', String.Other, '#pop'),
- (r'[^{}\\]+', String.Other)
- ],
- 'rb-string': [
- (r'\\[()\\]', String.Other),
- (r'\\', String.Other),
- (r'\(', String.Other, 'rb-string'),
- (r'\)', String.Other, '#pop'),
- (r'[^()]+', String.Other)
- ],
- 'sb-string': [
- (r'\\[\[\]\\]', String.Other),
- (r'\\', String.Other),
- (r'\[', String.Other, 'sb-string'),
- (r'\]', String.Other, '#pop'),
- (r'[^\[\]]+', String.Other)
- ],
- 'lt-string': [
- (r'\\[<>\\]', String.Other),
- (r'\\', String.Other),
- (r'\<', String.Other, 'lt-string'),
- (r'\>', String.Other, '#pop'),
- (r'[^<>]+', String.Other)
- ],
- 'end-part': [
- (r'.+', Comment.Preproc, '#pop')
- ]
- }
-
- def analyse_text(text):
- if shebang_matches(text, r'perl'):
- return True
- if re.search(r'(?:my|our)\s+[$@%(]', text):
- return 0.9
-
-
-class Perl6Lexer(ExtendedRegexLexer):
- """
- For `Perl 6 <http://www.perl6.org>`_ source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'Perl6'
- aliases = ['perl6', 'pl6']
- filenames = ['*.pl', '*.pm', '*.nqp', '*.p6', '*.6pl', '*.p6l', '*.pl6',
- '*.6pm', '*.p6m', '*.pm6', '*.t']
- mimetypes = ['text/x-perl6', 'application/x-perl6']
- flags = re.MULTILINE | re.DOTALL | re.UNICODE
-
- PERL6_IDENTIFIER_RANGE = r"['\w:-]"
-
- PERL6_KEYWORDS = (
- 'BEGIN', 'CATCH', 'CHECK', 'CONTROL', 'END', 'ENTER', 'FIRST', 'INIT',
- 'KEEP', 'LAST', 'LEAVE', 'NEXT', 'POST', 'PRE', 'START', 'TEMP',
- 'UNDO', 'as', 'assoc', 'async', 'augment', 'binary', 'break', 'but',
- 'cached', 'category', 'class', 'constant', 'contend', 'continue',
- 'copy', 'deep', 'default', 'defequiv', 'defer', 'die', 'do', 'else',
- 'elsif', 'enum', 'equiv', 'exit', 'export', 'fail', 'fatal', 'for',
- 'gather', 'given', 'goto', 'grammar', 'handles', 'has', 'if', 'inline',
- 'irs', 'is', 'last', 'leave', 'let', 'lift', 'loop', 'looser', 'macro',
- 'make', 'maybe', 'method', 'module', 'multi', 'my', 'next', 'of',
- 'ofs', 'only', 'oo', 'ors', 'our', 'package', 'parsed', 'prec',
- 'proto', 'readonly', 'redo', 'ref', 'regex', 'reparsed', 'repeat',
- 'require', 'required', 'return', 'returns', 'role', 'rule', 'rw',
- 'self', 'slang', 'state', 'sub', 'submethod', 'subset', 'supersede',
- 'take', 'temp', 'tighter', 'token', 'trusts', 'try', 'unary',
- 'unless', 'until', 'use', 'warn', 'when', 'where', 'while', 'will',
- )
-
- PERL6_BUILTINS = (
- 'ACCEPTS', 'HOW', 'REJECTS', 'VAR', 'WHAT', 'WHENCE', 'WHERE', 'WHICH',
- 'WHO', 'abs', 'acos', 'acosec', 'acosech', 'acosh', 'acotan', 'acotanh',
- 'all', 'any', 'approx', 'arity', 'asec', 'asech', 'asin', 'asinh',
- 'assuming', 'atan', 'atan2', 'atanh', 'attr', 'bless', 'body', 'by',
- 'bytes', 'caller', 'callsame', 'callwith', 'can', 'capitalize', 'cat',
- 'ceiling', 'chars', 'chmod', 'chomp', 'chop', 'chr', 'chroot',
- 'circumfix', 'cis', 'classify', 'clone', 'close', 'cmp_ok', 'codes',
- 'comb', 'connect', 'contains', 'context', 'cos', 'cosec', 'cosech',
- 'cosh', 'cotan', 'cotanh', 'count', 'defined', 'delete', 'diag',
- 'dies_ok', 'does', 'e', 'each', 'eager', 'elems', 'end', 'eof', 'eval',
- 'eval_dies_ok', 'eval_elsewhere', 'eval_lives_ok', 'evalfile', 'exists',
- 'exp', 'first', 'flip', 'floor', 'flunk', 'flush', 'fmt', 'force_todo',
- 'fork', 'from', 'getc', 'gethost', 'getlogin', 'getpeername', 'getpw',
- 'gmtime', 'graphs', 'grep', 'hints', 'hyper', 'im', 'index', 'infix',
- 'invert', 'is_approx', 'is_deeply', 'isa', 'isa_ok', 'isnt', 'iterator',
- 'join', 'key', 'keys', 'kill', 'kv', 'lastcall', 'lazy', 'lc', 'lcfirst',
- 'like', 'lines', 'link', 'lives_ok', 'localtime', 'log', 'log10', 'map',
- 'max', 'min', 'minmax', 'name', 'new', 'nextsame', 'nextwith', 'nfc',
- 'nfd', 'nfkc', 'nfkd', 'nok_error', 'nonce', 'none', 'normalize', 'not',
- 'nothing', 'ok', 'once', 'one', 'open', 'opendir', 'operator', 'ord',
- 'p5chomp', 'p5chop', 'pack', 'pair', 'pairs', 'pass', 'perl', 'pi',
- 'pick', 'plan', 'plan_ok', 'polar', 'pop', 'pos', 'postcircumfix',
- 'postfix', 'pred', 'prefix', 'print', 'printf', 'push', 'quasi',
- 'quotemeta', 'rand', 're', 'read', 'readdir', 'readline', 'reduce',
- 'reverse', 'rewind', 'rewinddir', 'rindex', 'roots', 'round',
- 'roundrobin', 'run', 'runinstead', 'sameaccent', 'samecase', 'say',
- 'sec', 'sech', 'sech', 'seek', 'shape', 'shift', 'sign', 'signature',
- 'sin', 'sinh', 'skip', 'skip_rest', 'sleep', 'slurp', 'sort', 'splice',
- 'split', 'sprintf', 'sqrt', 'srand', 'strand', 'subst', 'substr', 'succ',
- 'sum', 'symlink', 'tan', 'tanh', 'throws_ok', 'time', 'times', 'to',
- 'todo', 'trim', 'trim_end', 'trim_start', 'true', 'truncate', 'uc',
- 'ucfirst', 'undef', 'undefine', 'uniq', 'unlike', 'unlink', 'unpack',
- 'unpolar', 'unshift', 'unwrap', 'use_ok', 'value', 'values', 'vec',
- 'version_lt', 'void', 'wait', 'want', 'wrap', 'write', 'zip',
- )
-
- PERL6_BUILTIN_CLASSES = (
- 'Abstraction', 'Any', 'AnyChar', 'Array', 'Associative', 'Bag', 'Bit',
- 'Blob', 'Block', 'Bool', 'Buf', 'Byte', 'Callable', 'Capture', 'Char', 'Class',
- 'Code', 'Codepoint', 'Comparator', 'Complex', 'Decreasing', 'Exception',
- 'Failure', 'False', 'Grammar', 'Grapheme', 'Hash', 'IO', 'Increasing',
- 'Int', 'Junction', 'KeyBag', 'KeyExtractor', 'KeyHash', 'KeySet',
- 'KitchenSink', 'List', 'Macro', 'Mapping', 'Match', 'Matcher', 'Method',
- 'Module', 'Num', 'Object', 'Ordered', 'Ordering', 'OrderingPair',
- 'Package', 'Pair', 'Positional', 'Proxy', 'Range', 'Rat', 'Regex',
- 'Role', 'Routine', 'Scalar', 'Seq', 'Set', 'Signature', 'Str', 'StrLen',
- 'StrPos', 'Sub', 'Submethod', 'True', 'UInt', 'Undef', 'Version', 'Void',
- 'Whatever', 'bit', 'bool', 'buf', 'buf1', 'buf16', 'buf2', 'buf32',
- 'buf4', 'buf64', 'buf8', 'complex', 'int', 'int1', 'int16', 'int2',
- 'int32', 'int4', 'int64', 'int8', 'num', 'rat', 'rat1', 'rat16', 'rat2',
- 'rat32', 'rat4', 'rat64', 'rat8', 'uint', 'uint1', 'uint16', 'uint2',
- 'uint32', 'uint4', 'uint64', 'uint8', 'utf16', 'utf32', 'utf8',
- )
-
- PERL6_OPERATORS = (
- 'X', 'Z', 'after', 'also', 'and', 'andthen', 'before', 'cmp', 'div',
- 'eq', 'eqv', 'extra', 'ff', 'fff', 'ge', 'gt', 'le', 'leg', 'lt', 'm',
- 'mm', 'mod', 'ne', 'or', 'orelse', 'rx', 's', 'tr', 'x', 'xor', 'xx',
- '++', '--', '**', '!', '+', '-', '~', '?', '|', '||', '+^', '~^', '?^',
- '^', '*', '/', '%', '%%', '+&', '+<', '+>', '~&', '~<', '~>', '?&',
- 'gcd', 'lcm', '+', '-', '+|', '+^', '~|', '~^', '?|', '?^',
- '~', '&', '^', 'but', 'does', '<=>', '..', '..^', '^..', '^..^',
- '!=', '==', '<', '<=', '>', '>=', '~~', '===', '!eqv',
- '&&', '||', '^^', '//', 'min', 'max', '??', '!!', 'ff', 'fff', 'so',
- 'not', '<==', '==>', '<<==', '==>>',
- )
-
- # Perl 6 has a *lot* of possible bracketing characters
- # this list was lifted from STD.pm6 (https://github.com/perl6/std)
- PERL6_BRACKETS = {
- u'\u0028': u'\u0029', u'\u003c': u'\u003e', u'\u005b': u'\u005d',
- u'\u007b': u'\u007d', u'\u00ab': u'\u00bb', u'\u0f3a': u'\u0f3b',
- u'\u0f3c': u'\u0f3d', u'\u169b': u'\u169c', u'\u2018': u'\u2019',
- u'\u201a': u'\u2019', u'\u201b': u'\u2019', u'\u201c': u'\u201d',
- u'\u201e': u'\u201d', u'\u201f': u'\u201d', u'\u2039': u'\u203a',
- u'\u2045': u'\u2046', u'\u207d': u'\u207e', u'\u208d': u'\u208e',
- u'\u2208': u'\u220b', u'\u2209': u'\u220c', u'\u220a': u'\u220d',
- u'\u2215': u'\u29f5', u'\u223c': u'\u223d', u'\u2243': u'\u22cd',
- u'\u2252': u'\u2253', u'\u2254': u'\u2255', u'\u2264': u'\u2265',
- u'\u2266': u'\u2267', u'\u2268': u'\u2269', u'\u226a': u'\u226b',
- u'\u226e': u'\u226f', u'\u2270': u'\u2271', u'\u2272': u'\u2273',
- u'\u2274': u'\u2275', u'\u2276': u'\u2277', u'\u2278': u'\u2279',
- u'\u227a': u'\u227b', u'\u227c': u'\u227d', u'\u227e': u'\u227f',
- u'\u2280': u'\u2281', u'\u2282': u'\u2283', u'\u2284': u'\u2285',
- u'\u2286': u'\u2287', u'\u2288': u'\u2289', u'\u228a': u'\u228b',
- u'\u228f': u'\u2290', u'\u2291': u'\u2292', u'\u2298': u'\u29b8',
- u'\u22a2': u'\u22a3', u'\u22a6': u'\u2ade', u'\u22a8': u'\u2ae4',
- u'\u22a9': u'\u2ae3', u'\u22ab': u'\u2ae5', u'\u22b0': u'\u22b1',
- u'\u22b2': u'\u22b3', u'\u22b4': u'\u22b5', u'\u22b6': u'\u22b7',
- u'\u22c9': u'\u22ca', u'\u22cb': u'\u22cc', u'\u22d0': u'\u22d1',
- u'\u22d6': u'\u22d7', u'\u22d8': u'\u22d9', u'\u22da': u'\u22db',
- u'\u22dc': u'\u22dd', u'\u22de': u'\u22df', u'\u22e0': u'\u22e1',
- u'\u22e2': u'\u22e3', u'\u22e4': u'\u22e5', u'\u22e6': u'\u22e7',
- u'\u22e8': u'\u22e9', u'\u22ea': u'\u22eb', u'\u22ec': u'\u22ed',
- u'\u22f0': u'\u22f1', u'\u22f2': u'\u22fa', u'\u22f3': u'\u22fb',
- u'\u22f4': u'\u22fc', u'\u22f6': u'\u22fd', u'\u22f7': u'\u22fe',
- u'\u2308': u'\u2309', u'\u230a': u'\u230b', u'\u2329': u'\u232a',
- u'\u23b4': u'\u23b5', u'\u2768': u'\u2769', u'\u276a': u'\u276b',
- u'\u276c': u'\u276d', u'\u276e': u'\u276f', u'\u2770': u'\u2771',
- u'\u2772': u'\u2773', u'\u2774': u'\u2775', u'\u27c3': u'\u27c4',
- u'\u27c5': u'\u27c6', u'\u27d5': u'\u27d6', u'\u27dd': u'\u27de',
- u'\u27e2': u'\u27e3', u'\u27e4': u'\u27e5', u'\u27e6': u'\u27e7',
- u'\u27e8': u'\u27e9', u'\u27ea': u'\u27eb', u'\u2983': u'\u2984',
- u'\u2985': u'\u2986', u'\u2987': u'\u2988', u'\u2989': u'\u298a',
- u'\u298b': u'\u298c', u'\u298d': u'\u298e', u'\u298f': u'\u2990',
- u'\u2991': u'\u2992', u'\u2993': u'\u2994', u'\u2995': u'\u2996',
- u'\u2997': u'\u2998', u'\u29c0': u'\u29c1', u'\u29c4': u'\u29c5',
- u'\u29cf': u'\u29d0', u'\u29d1': u'\u29d2', u'\u29d4': u'\u29d5',
- u'\u29d8': u'\u29d9', u'\u29da': u'\u29db', u'\u29f8': u'\u29f9',
- u'\u29fc': u'\u29fd', u'\u2a2b': u'\u2a2c', u'\u2a2d': u'\u2a2e',
- u'\u2a34': u'\u2a35', u'\u2a3c': u'\u2a3d', u'\u2a64': u'\u2a65',
- u'\u2a79': u'\u2a7a', u'\u2a7d': u'\u2a7e', u'\u2a7f': u'\u2a80',
- u'\u2a81': u'\u2a82', u'\u2a83': u'\u2a84', u'\u2a8b': u'\u2a8c',
- u'\u2a91': u'\u2a92', u'\u2a93': u'\u2a94', u'\u2a95': u'\u2a96',
- u'\u2a97': u'\u2a98', u'\u2a99': u'\u2a9a', u'\u2a9b': u'\u2a9c',
- u'\u2aa1': u'\u2aa2', u'\u2aa6': u'\u2aa7', u'\u2aa8': u'\u2aa9',
- u'\u2aaa': u'\u2aab', u'\u2aac': u'\u2aad', u'\u2aaf': u'\u2ab0',
- u'\u2ab3': u'\u2ab4', u'\u2abb': u'\u2abc', u'\u2abd': u'\u2abe',
- u'\u2abf': u'\u2ac0', u'\u2ac1': u'\u2ac2', u'\u2ac3': u'\u2ac4',
- u'\u2ac5': u'\u2ac6', u'\u2acd': u'\u2ace', u'\u2acf': u'\u2ad0',
- u'\u2ad1': u'\u2ad2', u'\u2ad3': u'\u2ad4', u'\u2ad5': u'\u2ad6',
- u'\u2aec': u'\u2aed', u'\u2af7': u'\u2af8', u'\u2af9': u'\u2afa',
- u'\u2e02': u'\u2e03', u'\u2e04': u'\u2e05', u'\u2e09': u'\u2e0a',
- u'\u2e0c': u'\u2e0d', u'\u2e1c': u'\u2e1d', u'\u2e20': u'\u2e21',
- u'\u3008': u'\u3009', u'\u300a': u'\u300b', u'\u300c': u'\u300d',
- u'\u300e': u'\u300f', u'\u3010': u'\u3011', u'\u3014': u'\u3015',
- u'\u3016': u'\u3017', u'\u3018': u'\u3019', u'\u301a': u'\u301b',
- u'\u301d': u'\u301e', u'\ufd3e': u'\ufd3f', u'\ufe17': u'\ufe18',
- u'\ufe35': u'\ufe36', u'\ufe37': u'\ufe38', u'\ufe39': u'\ufe3a',
- u'\ufe3b': u'\ufe3c', u'\ufe3d': u'\ufe3e', u'\ufe3f': u'\ufe40',
- u'\ufe41': u'\ufe42', u'\ufe43': u'\ufe44', u'\ufe47': u'\ufe48',
- u'\ufe59': u'\ufe5a', u'\ufe5b': u'\ufe5c', u'\ufe5d': u'\ufe5e',
- u'\uff08': u'\uff09', u'\uff1c': u'\uff1e', u'\uff3b': u'\uff3d',
- u'\uff5b': u'\uff5d', u'\uff5f': u'\uff60', u'\uff62': u'\uff63',
- }
-
- def _build_word_match(words, boundary_regex_fragment=None, prefix='', suffix=''):
- if boundary_regex_fragment is None:
- return r'\b(' + prefix + r'|'.join(re.escape(x) for x in words) + \
- suffix + r')\b'
- else:
- return r'(?<!' + boundary_regex_fragment + r')' + prefix + r'(' + \
- r'|'.join(re.escape(x) for x in words) + r')' + suffix + r'(?!' + \
- boundary_regex_fragment + r')'
-
- def brackets_callback(token_class):
- def callback(lexer, match, context):
- groups = match.groupdict()
- opening_chars = groups['delimiter']
- n_chars = len(opening_chars)
- adverbs = groups.get('adverbs')
-
- closer = Perl6Lexer.PERL6_BRACKETS.get(opening_chars[0])
- text = context.text
-
- if closer is None: # it's not a mirrored character, which means we
- # just need to look for the next occurrence
-
- end_pos = text.find(opening_chars, match.start('delimiter') + n_chars)
- else: # we need to look for the corresponding closing character,
- # keep nesting in mind
- closing_chars = closer * n_chars
- nesting_level = 1
-
- search_pos = match.start('delimiter')
-
- while nesting_level > 0:
- next_open_pos = text.find(opening_chars, search_pos + n_chars)
- next_close_pos = text.find(closing_chars, search_pos + n_chars)
-
- if next_close_pos == -1:
- next_close_pos = len(text)
- nesting_level = 0
- elif next_open_pos != -1 and next_open_pos < next_close_pos:
- nesting_level += 1
- search_pos = next_open_pos
- else: # next_close_pos < next_open_pos
- nesting_level -= 1
- search_pos = next_close_pos
-
- end_pos = next_close_pos
-
- if end_pos < 0: # if we didn't find a closer, just highlight the
- # rest of the text in this class
- end_pos = len(text)
-
- if adverbs is not None and re.search(r':to\b', adverbs):
- heredoc_terminator = text[match.start('delimiter') + n_chars:end_pos]
- end_heredoc = re.search(r'^\s*' + re.escape(heredoc_terminator) +
- r'\s*$', text[end_pos:], re.MULTILINE)
-
- if end_heredoc:
- end_pos += end_heredoc.end()
- else:
- end_pos = len(text)
-
- yield match.start(), token_class, text[match.start():end_pos + n_chars]
- context.pos = end_pos + n_chars
-
- return callback
-
- def opening_brace_callback(lexer, match, context):
- stack = context.stack
-
- yield match.start(), Text, context.text[match.start():match.end()]
- context.pos = match.end()
-
- # if we encounter an opening brace and we're one level
- # below a token state, it means we need to increment
- # the nesting level for braces so we know later when
- # we should return to the token rules.
- if len(stack) > 2 and stack[-2] == 'token':
- context.perl6_token_nesting_level += 1
-
- def closing_brace_callback(lexer, match, context):
- stack = context.stack
-
- yield match.start(), Text, context.text[match.start():match.end()]
- context.pos = match.end()
-
- # if we encounter a free closing brace and we're one level
- # below a token state, it means we need to check the nesting
- # level to see if we need to return to the token state.
- if len(stack) > 2 and stack[-2] == 'token':
- context.perl6_token_nesting_level -= 1
- if context.perl6_token_nesting_level == 0:
- stack.pop()
-
- def embedded_perl6_callback(lexer, match, context):
- context.perl6_token_nesting_level = 1
- yield match.start(), Text, context.text[match.start():match.end()]
- context.pos = match.end()
- context.stack.append('root')
-
- # If you're modifying these rules, be careful if you need to process '{' or '}'
- # characters. We have special logic for processing these characters (due to the fact
- # that you can nest Perl 6 code in regex blocks), so if you need to process one of
- # them, make sure you also process the corresponding one!
- tokens = {
- 'common': [
- (r'#[`|=](?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS) + r'])(?P=first_char)*)',
- brackets_callback(Comment.Multiline)),
- (r'#[^\n]*$', Comment.Single),
- (r'^(\s*)=begin\s+(\w+)\b.*?^\1=end\s+\2', Comment.Multiline),
- (r'^(\s*)=for.*?\n\s*?\n', Comment.Multiline),
- (r'^=.*?\n\s*?\n', Comment.Multiline),
- (r'(regex|token|rule)(\s*' + PERL6_IDENTIFIER_RANGE + '+:sym)',
- bygroups(Keyword, Name), 'token-sym-brackets'),
- (r'(regex|token|rule)(?!' + PERL6_IDENTIFIER_RANGE + r')(\s*' + PERL6_IDENTIFIER_RANGE + '+)?',
- bygroups(Keyword, Name), 'pre-token'),
- # deal with a special case in the Perl 6 grammar (role q { ... })
- (r'(role)(\s+)(q)(\s*)', bygroups(Keyword, Text, Name, Text)),
- (_build_word_match(PERL6_KEYWORDS, PERL6_IDENTIFIER_RANGE), Keyword),
- (_build_word_match(PERL6_BUILTIN_CLASSES, PERL6_IDENTIFIER_RANGE, suffix='(?::[UD])?'),
- Name.Builtin),
- (_build_word_match(PERL6_BUILTINS, PERL6_IDENTIFIER_RANGE), Name.Builtin),
- # copied from PerlLexer
- (r'[$@%&][.^:?=!~]?' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*',
- Name.Variable),
- (r'\$[!/](?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global),
- (r'::\?\w+', Name.Variable.Global),
- (r'[$@%&]\*' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*',
- Name.Variable.Global),
- (r'\$(?:<.*?>)+', Name.Variable),
- (r'(?:q|qq|Q)[a-zA-Z]?\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^0-9a-zA-Z:\s])'
- r'(?P=first_char)*)', brackets_callback(String)),
- # copied from PerlLexer
- (r'0_?[0-7]+(_[0-7]+)*', Number.Oct),
- (r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex),
- (r'0b[01]+(_[01]+)*', Number.Bin),
- (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?',
- Number.Float),
- (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float),
- (r'\d+(_\d+)*', Number.Integer),
- (r'(?<=~~)\s*/(?:\\\\|\\/|.)*?/', String.Regex),
- (r'(?<=[=(,])\s*/(?:\\\\|\\/|.)*?/', String.Regex),
- (r'm\w+(?=\()', Name),
- (r'(?:m|ms|rx)\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^\w:\s])'
- r'(?P=first_char)*)', brackets_callback(String.Regex)),
- (r'(?:s|ss|tr)\s*(?::[\w\s:]+)?\s*/(?:\\\\|\\/|.)*?/(?:\\\\|\\/|.)*?/',
- String.Regex),
- (r'<[^\s=].*?\S>', String),
- (_build_word_match(PERL6_OPERATORS), Operator),
- (r'\w' + PERL6_IDENTIFIER_RANGE + '*', Name),
- (r"'(\\\\|\\[^\\]|[^'\\])*'", String),
- (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
- ],
- 'root': [
- include('common'),
- (r'\{', opening_brace_callback),
- (r'\}', closing_brace_callback),
- (r'.+?', Text),
- ],
- 'pre-token': [
- include('common'),
- (r'\{', Text, ('#pop', 'token')),
- (r'.+?', Text),
- ],
- 'token-sym-brackets': [
- (r'(?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS) + '])(?P=first_char)*)',
- brackets_callback(Name), ('#pop', 'pre-token')),
- default(('#pop', 'pre-token')),
- ],
- 'token': [
- (r'\}', Text, '#pop'),
- (r'(?<=:)(?:my|our|state|constant|temp|let).*?;', using(this)),
- # make sure that quotes in character classes aren't treated as strings
- (r'<(?:[-!?+.]\s*)?\[.*?\]>', String.Regex),
- # make sure that '#' characters in quotes aren't treated as comments
- (r"(?<!\\)'(\\\\|\\[^\\]|[^'\\])*'", String.Regex),
- (r'(?<!\\)"(\\\\|\\[^\\]|[^"\\])*"', String.Regex),
- (r'#.*?$', Comment.Single),
- (r'\{', embedded_perl6_callback),
- ('.+?', String.Regex),
- ],
- }
-
- def analyse_text(text):
- def strip_pod(lines):
- in_pod = False
- stripped_lines = []
-
- for line in lines:
- if re.match(r'^=(?:end|cut)', line):
- in_pod = False
- elif re.match(r'^=\w+', line):
- in_pod = True
- elif not in_pod:
- stripped_lines.append(line)
-
- return stripped_lines
-
- # XXX handle block comments
- lines = text.splitlines()
- lines = strip_pod(lines)
- text = '\n'.join(lines)
-
- if shebang_matches(text, r'perl6|rakudo|niecza|pugs'):
- return True
-
- saw_perl_decl = False
- rating = False
-
- # check for my/our/has declarations
- if re.search(r"(?:my|our|has)\s+(?:" + Perl6Lexer.PERL6_IDENTIFIER_RANGE +
- r"+\s+)?[$@%&(]", text):
- rating = 0.8
- saw_perl_decl = True
-
- for line in lines:
- line = re.sub('#.*', '', line)
- if re.match(r'^\s*$', line):
- continue
-
- # match v6; use v6; use v6.0; use v6.0.0;
- if re.match(r'^\s*(?:use\s+)?v6(?:\.\d(?:\.\d)?)?;', line):
- return True
- # match class, module, role, enum, grammar declarations
- class_decl = re.match(r'^\s*(?:(?P<scope>my|our)\s+)?(?:module|class|role|enum|grammar)', line)
- if class_decl:
- if saw_perl_decl or class_decl.group('scope') is not None:
- return True
- rating = 0.05
- continue
- break
-
- return rating
-
- def __init__(self, **options):
- super(Perl6Lexer, self).__init__(**options)
- self.encoding = options.get('encoding', 'utf-8')
diff --git a/pygments/lexers/php.py b/pygments/lexers/php.py
deleted file mode 100644
index bd4a2376..00000000
--- a/pygments/lexers/php.py
+++ /dev/null
@@ -1,270 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.php
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for PHP and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, default, using, \
- this, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Other
-from pygments.util import get_bool_opt, get_list_opt, iteritems, \
- shebang_matches
-
-__all__ = ['ZephirLexer', 'PhpLexer']
-
-
-class ZephirLexer(RegexLexer):
- """
- For `Zephir language <http://zephir-lang.com/>`_ source code.
-
- Zephir is a compiled high level language aimed
- to the creation of C-extensions for PHP.
-
- .. versionadded:: 2.0
- """
-
- name = 'Zephir'
- aliases = ['zephir']
- filenames = ['*.zep']
-
- zephir_keywords = ['fetch', 'echo', 'isset', 'empty']
- zephir_type = ['bit', 'bits', 'string']
-
- flags = re.DOTALL | re.MULTILINE
-
- tokens = {
- 'commentsandwhitespace': [
- (r'\s+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline)
- ],
- 'slashstartsregex': [
- include('commentsandwhitespace'),
- (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
- default('#pop')
- ],
- 'badregex': [
- (r'\n', Text, '#pop')
- ],
- 'root': [
- (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
- include('commentsandwhitespace'),
- (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
- r'(<<|>>>?|==?|!=?|->|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
- (r'(for|in|while|do|break|return|continue|switch|case|default|if|else|loop|'
- r'require|inline|throw|try|catch|finally|new|delete|typeof|instanceof|void|'
- r'namespace|use|extends|this|fetch|isset|unset|echo|fetch|likely|unlikely|'
- r'empty)\b', Keyword, 'slashstartsregex'),
- (r'(var|let|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
- (r'(abstract|boolean|bool|char|class|const|double|enum|export|extends|final|'
- r'native|goto|implements|import|int|string|interface|long|ulong|char|uchar|'
- r'float|unsigned|private|protected|public|short|static|self|throws|reverse|'
- r'transient|volatile)\b', Keyword.Reserved),
- (r'(true|false|null|undefined)\b', Keyword.Constant),
- (r'(Array|Boolean|Date|_REQUEST|_COOKIE|_SESSION|'
- r'_GET|_POST|_SERVER|this|stdClass|range|count|iterator|'
- r'window)\b', Name.Builtin),
- (r'[$a-zA-Z_][\w\\]*', 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 PhpLexer(RegexLexer):
- """
- For `PHP <http://www.php.net/>`_ source code.
- For PHP embedded in HTML, use the `HtmlPhpLexer`.
-
- Additional options accepted:
-
- `startinline`
- If given and ``True`` the lexer starts highlighting with
- php code (i.e.: no starting ``<?php`` required). The default
- is ``False``.
- `funcnamehighlighting`
- If given and ``True``, highlight builtin function names
- (default: ``True``).
- `disabledmodules`
- If given, must be a list of module names whose function names
- should not be highlighted. By default all modules are highlighted
- except the special ``'unknown'`` module that includes functions
- that are known to php but are undocumented.
-
- To get a list of allowed modules have a look into the
- `_php_builtins` module:
-
- .. sourcecode:: pycon
-
- >>> from pygments.lexers._php_builtins import MODULES
- >>> MODULES.keys()
- ['PHP Options/Info', 'Zip', 'dba', ...]
-
- In fact the names of those modules match the module names from
- the php documentation.
- """
-
- name = 'PHP'
- aliases = ['php', 'php3', 'php4', 'php5']
- filenames = ['*.php', '*.php[345]', '*.inc']
- mimetypes = ['text/x-php']
-
- # Note that a backslash is included in the following two patterns
- # PHP uses a backslash as a namespace separator
- _ident_char = r'[\\\w]|[^\x00-\x7f]'
- _ident_begin = r'(?:[\\_a-z]|[^\x00-\x7f])'
- _ident_end = r'(?:' + _ident_char + ')*'
- _ident_inner = _ident_begin + _ident_end
-
- flags = re.IGNORECASE | re.DOTALL | re.MULTILINE
- tokens = {
- 'root': [
- (r'<\?(php)?', Comment.Preproc, 'php'),
- (r'[^<]+', Other),
- (r'<', Other)
- ],
- 'php': [
- (r'\?>', Comment.Preproc, '#pop'),
- (r'(<<<)([\'"]?)(' + _ident_inner + r')(\2\n.*?\n\s*)(\3)(;?)(\n)',
- bygroups(String, String, String.Delimiter, String, String.Delimiter,
- Punctuation, Text)),
- (r'\s+', Text),
- (r'#.*?\n', Comment.Single),
- (r'//.*?\n', Comment.Single),
- # put the empty comment here, it is otherwise seen as
- # the start of a docstring
- (r'/\*\*/', Comment.Multiline),
- (r'/\*\*.*?\*/', String.Doc),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'(->|::)(\s*)(' + _ident_inner + ')',
- bygroups(Operator, Text, Name.Attribute)),
- (r'[~!%^&*+=|:.<>/@-]+', Operator),
- (r'\?', Operator), # don't add to the charclass above!
- (r'[\[\]{}();,]+', Punctuation),
- (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
- (r'(function)(\s*)(?=\()', bygroups(Keyword, Text)),
- (r'(function)(\s+)(&?)(\s*)',
- bygroups(Keyword, Text, Operator, Text), 'functionname'),
- (r'(const)(\s+)(' + _ident_inner + ')',
- bygroups(Keyword, Text, Name.Constant)),
- (r'(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|'
- r'eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|'
- r'FALSE|print|for|require|continue|foreach|require_once|'
- r'declare|return|default|static|do|switch|die|stdClass|'
- r'echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|'
- r'virtual|endfor|include_once|while|endforeach|global|'
- r'endif|list|endswitch|new|endwhile|not|'
- r'array|E_ALL|NULL|final|php_user_filter|interface|'
- r'implements|public|private|protected|abstract|clone|try|'
- r'catch|throw|this|use|namespace|trait|yield|'
- r'finally)\b', Keyword),
- (r'(true|false|null)\b', Keyword.Constant),
- include('magicconstants'),
- (r'\$\{\$+' + _ident_inner + r'\}', Name.Variable),
- (r'\$+' + _ident_inner, Name.Variable),
- (_ident_inner, Name.Other),
- (r'(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?', Number.Float),
- (r'\d+e[+-]?[0-9]+', Number.Float),
- (r'0[0-7]+', Number.Oct),
- (r'0x[a-f0-9]+', Number.Hex),
- (r'\d+', Number.Integer),
- (r'0b[01]+', Number.Bin),
- (r"'([^'\\]*(?:\\.[^'\\]*)*)'", String.Single),
- (r'`([^`\\]*(?:\\.[^`\\]*)*)`', String.Backtick),
- (r'"', String.Double, 'string'),
- ],
- 'magicfuncs': [
- # source: http://php.net/manual/en/language.oop5.magic.php
- (words((
- '__construct', '__destruct', '__call', '__callStatic', '__get', '__set',
- '__isset', '__unset', '__sleep', '__wakeup', '__toString', '__invoke',
- '__set_state', '__clone', '__debugInfo',), suffix=r'\b'),
- Name.Function.Magic),
- ],
- 'magicconstants': [
- # source: http://php.net/manual/en/language.constants.predefined.php
- (words((
- '__LINE__', '__FILE__', '__DIR__', '__FUNCTION__', '__CLASS__',
- '__TRAIT__', '__METHOD__', '__NAMESPACE__',),
- suffix=r'\b'),
- Name.Constant),
- ],
- 'classname': [
- (_ident_inner, Name.Class, '#pop')
- ],
- 'functionname': [
- include('magicfuncs'),
- (_ident_inner, Name.Function, '#pop'),
- default('#pop')
- ],
- 'string': [
- (r'"', String.Double, '#pop'),
- (r'[^{$"\\]+', String.Double),
- (r'\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})', String.Escape),
- (r'\$' + _ident_inner + r'(\[\S+?\]|->' + _ident_inner + ')?',
- String.Interpol),
- (r'(\{\$\{)(.*?)(\}\})',
- bygroups(String.Interpol, using(this, _startinline=True),
- String.Interpol)),
- (r'(\{)(\$.*?)(\})',
- bygroups(String.Interpol, using(this, _startinline=True),
- String.Interpol)),
- (r'(\$\{)(\S+)(\})',
- bygroups(String.Interpol, Name.Variable, String.Interpol)),
- (r'[${\\]', String.Double)
- ],
- }
-
- def __init__(self, **options):
- self.funcnamehighlighting = get_bool_opt(
- options, 'funcnamehighlighting', True)
- self.disabledmodules = get_list_opt(
- options, 'disabledmodules', ['unknown'])
- self.startinline = get_bool_opt(options, 'startinline', False)
-
- # private option argument for the lexer itself
- if '_startinline' in options:
- self.startinline = options.pop('_startinline')
-
- # collect activated functions in a set
- self._functions = set()
- if self.funcnamehighlighting:
- from pygments.lexers._php_builtins import MODULES
- for key, value in iteritems(MODULES):
- if key not in self.disabledmodules:
- self._functions.update(value)
- RegexLexer.__init__(self, **options)
-
- def get_tokens_unprocessed(self, text):
- stack = ['root']
- if self.startinline:
- stack.append('php')
- for index, token, value in \
- RegexLexer.get_tokens_unprocessed(self, text, stack):
- if token is Name.Other:
- if value in self._functions:
- yield index, Name.Builtin, value
- continue
- yield index, token, value
-
- def analyse_text(text):
- if shebang_matches(text, r'php'):
- return True
- rv = 0.0
- if re.search(r'<\?(?!xml)', text):
- rv += 0.3
- return rv
diff --git a/pygments/lexers/pony.py b/pygments/lexers/pony.py
deleted file mode 100644
index 8f5d4281..00000000
--- a/pygments/lexers/pony.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.pony
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Pony and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['PonyLexer']
-
-
-class PonyLexer(RegexLexer):
- """
- For Pony source code.
-
- .. versionadded:: 2.4
- """
-
- name = 'Pony'
- aliases = ['pony']
- filenames = ['*.pony']
-
- _caps = r'(iso|trn|ref|val|box|tag)'
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'[^\S\n]+', Text),
- (r'//.*\n', Comment.Single),
- (r'/\*', Comment.Multiline, 'nested_comment'),
- (r'"""(?:.|\n)*?"""', String.Doc),
- (r'"', String, 'string'),
- (r'\'.*\'', String.Char),
- (r'=>|[]{}:().~;,|&!^?[]', Punctuation),
- (words((
- 'addressof', 'and', 'as', 'consume', 'digestof', 'is', 'isnt',
- 'not', 'or'),
- suffix=r'\b'),
- Operator.Word),
- (r'!=|==|<<|>>|[-+/*%=<>]', Operator),
- (words((
- 'box', 'break', 'compile_error', 'compile_intrinsic',
- 'continue', 'do', 'else', 'elseif', 'embed', 'end', 'error',
- 'for', 'if', 'ifdef', 'in', 'iso', 'lambda', 'let', 'match',
- 'object', 'recover', 'ref', 'repeat', 'return', 'tag', 'then',
- 'this', 'trn', 'try', 'until', 'use', 'var', 'val', 'where',
- 'while', 'with', '#any', '#read', '#send', '#share'),
- suffix=r'\b'),
- Keyword),
- (r'(actor|class|struct|primitive|interface|trait|type)((?:\s)+)',
- bygroups(Keyword, Text), 'typename'),
- (r'(new|fun|be)((?:\s)+)', bygroups(Keyword, Text), 'methodname'),
- (words((
- 'I8', 'U8', 'I16', 'U16', 'I32', 'U32', 'I64', 'U64', 'I128',
- 'U128', 'ILong', 'ULong', 'ISize', 'USize', 'F32', 'F64',
- 'Bool', 'Pointer', 'None', 'Any', 'Array', 'String',
- 'Iterator'),
- suffix=r'\b'),
- Name.Builtin.Type),
- (r'_?[A-Z]\w*', Name.Type),
- (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'\d+', Number.Integer),
- (r'(true|false)\b', Name.Builtin),
- (r'_\d*', Name),
- (r'_?[a-z][\w\'_]*', Name)
- ],
- 'typename': [
- (_caps + r'?((?:\s)*)(_?[A-Z]\w*)',
- bygroups(Keyword, Text, Name.Class), '#pop')
- ],
- 'methodname': [
- (_caps + r'?((?:\s)*)(_?[a-z]\w*)',
- bygroups(Keyword, Text, Name.Function), '#pop')
- ],
- 'nested_comment': [
- (r'[^*/]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r'\\"', String),
- (r'[^\\"]+', String)
- ]
- }
diff --git a/pygments/lexers/praat.py b/pygments/lexers/praat.py
deleted file mode 100644
index fa91880f..00000000
--- a/pygments/lexers/praat.py
+++ /dev/null
@@ -1,294 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.praat
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for Praat
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, words, bygroups, include
-from pygments.token import Name, Text, Comment, Keyword, String, Punctuation, Number, \
- Operator
-
-__all__ = ['PraatLexer']
-
-
-class PraatLexer(RegexLexer):
- """
- For `Praat <http://www.praat.org>`_ scripts.
-
- .. versionadded:: 2.1
- """
-
- name = 'Praat'
- aliases = ['praat']
- filenames = ['*.praat', '*.proc', '*.psc']
-
- keywords = (
- 'if', 'then', 'else', 'elsif', 'elif', 'endif', 'fi', 'for', 'from', 'to',
- 'endfor', 'endproc', 'while', 'endwhile', 'repeat', 'until', 'select', 'plus',
- 'minus', 'demo', 'assert', 'stopwatch', 'nocheck', 'nowarn', 'noprogress',
- 'editor', 'endeditor', 'clearinfo',
- )
-
- functions_string = (
- 'backslashTrigraphsToUnicode', 'chooseDirectory', 'chooseReadFile',
- 'chooseWriteFile', 'date', 'demoKey', 'do', 'environment', 'extractLine',
- 'extractWord', 'fixed', 'info', 'left', 'mid', 'percent', 'readFile', 'replace',
- 'replace_regex', 'right', 'selected', 'string', 'unicodeToBackslashTrigraphs',
- )
-
- functions_numeric = (
- 'abs', 'appendFile', 'appendFileLine', 'appendInfo', 'appendInfoLine', 'arccos',
- 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'barkToHertz',
- 'beginPause', 'beginSendPraat', 'besselI', 'besselK', 'beta', 'beta2',
- 'binomialP', 'binomialQ', 'boolean', 'ceiling', 'chiSquareP', 'chiSquareQ',
- 'choice', 'comment', 'cos', 'cosh', 'createDirectory', 'deleteFile',
- 'demoClicked', 'demoClickedIn', 'demoCommandKeyPressed',
- 'demoExtraControlKeyPressed', 'demoInput', 'demoKeyPressed',
- 'demoOptionKeyPressed', 'demoShiftKeyPressed', 'demoShow', 'demoWaitForInput',
- 'demoWindowTitle', 'demoX', 'demoY', 'differenceLimensToPhon', 'do', 'editor',
- 'endPause', 'endSendPraat', 'endsWith', 'erb', 'erbToHertz', 'erf', 'erfc',
- 'exitScript', 'exp', 'extractNumber', 'fileReadable', 'fisherP', 'fisherQ',
- 'floor', 'gaussP', 'gaussQ', 'hertzToBark', 'hertzToErb', 'hertzToMel',
- 'hertzToSemitones', 'imax', 'imin', 'incompleteBeta', 'incompleteGammaP', 'index',
- 'index_regex', 'invBinomialP', 'invBinomialQ', 'invChiSquareQ', 'invFisherQ',
- 'invGaussQ', 'invSigmoid', 'invStudentQ', 'length', 'ln', 'lnBeta', 'lnGamma',
- 'log10', 'log2', 'max', 'melToHertz', 'min', 'minusObject', 'natural', 'number',
- 'numberOfColumns', 'numberOfRows', 'numberOfSelected', 'objectsAreIdentical',
- 'option', 'optionMenu', 'pauseScript', 'phonToDifferenceLimens', 'plusObject',
- 'positive', 'randomBinomial', 'randomGauss', 'randomInteger', 'randomPoisson',
- 'randomUniform', 'real', 'readFile', 'removeObject', 'rindex', 'rindex_regex',
- 'round', 'runScript', 'runSystem', 'runSystem_nocheck', 'selectObject',
- 'selected', 'semitonesToHertz', 'sentencetext', 'sigmoid', 'sin', 'sinc',
- 'sincpi', 'sinh', 'soundPressureToPhon', 'sqrt', 'startsWith', 'studentP',
- 'studentQ', 'tan', 'tanh', 'variableExists', 'word', 'writeFile', 'writeFileLine',
- 'writeInfo', 'writeInfoLine',
- )
-
- functions_array = (
- 'linear', 'randomGauss', 'randomInteger', 'randomUniform', 'zero',
- )
-
- objects = (
- 'Activation', 'AffineTransform', 'AmplitudeTier', 'Art', 'Artword',
- 'Autosegment', 'BarkFilter', 'BarkSpectrogram', 'CCA', 'Categories',
- 'Cepstrogram', 'Cepstrum', 'Cepstrumc', 'ChebyshevSeries', 'ClassificationTable',
- 'Cochleagram', 'Collection', 'ComplexSpectrogram', 'Configuration', 'Confusion',
- 'ContingencyTable', 'Corpus', 'Correlation', 'Covariance',
- 'CrossCorrelationTable', 'CrossCorrelationTables', 'DTW', 'DataModeler',
- 'Diagonalizer', 'Discriminant', 'Dissimilarity', 'Distance', 'Distributions',
- 'DurationTier', 'EEG', 'ERP', 'ERPTier', 'EditCostsTable', 'EditDistanceTable',
- 'Eigen', 'Excitation', 'Excitations', 'ExperimentMFC', 'FFNet', 'FeatureWeights',
- 'FileInMemory', 'FilesInMemory', 'Formant', 'FormantFilter', 'FormantGrid',
- 'FormantModeler', 'FormantPoint', 'FormantTier', 'GaussianMixture', 'HMM',
- 'HMM_Observation', 'HMM_ObservationSequence', 'HMM_State', 'HMM_StateSequence',
- 'Harmonicity', 'ISpline', 'Index', 'Intensity', 'IntensityTier', 'IntervalTier',
- 'KNN', 'KlattGrid', 'KlattTable', 'LFCC', 'LPC', 'Label', 'LegendreSeries',
- 'LinearRegression', 'LogisticRegression', 'LongSound', 'Ltas', 'MFCC', 'MSpline',
- 'ManPages', 'Manipulation', 'Matrix', 'MelFilter', 'MelSpectrogram',
- 'MixingMatrix', 'Movie', 'Network', 'OTGrammar', 'OTHistory', 'OTMulti', 'PCA',
- 'PairDistribution', 'ParamCurve', 'Pattern', 'Permutation', 'Photo', 'Pitch',
- 'PitchModeler', 'PitchTier', 'PointProcess', 'Polygon', 'Polynomial',
- 'PowerCepstrogram', 'PowerCepstrum', 'Procrustes', 'RealPoint', 'RealTier',
- 'ResultsMFC', 'Roots', 'SPINET', 'SSCP', 'SVD', 'Salience', 'ScalarProduct',
- 'Similarity', 'SimpleString', 'SortedSetOfString', 'Sound', 'Speaker',
- 'Spectrogram', 'Spectrum', 'SpectrumTier', 'SpeechSynthesizer', 'SpellingChecker',
- 'Strings', 'StringsIndex', 'Table', 'TableOfReal', 'TextGrid', 'TextInterval',
- 'TextPoint', 'TextTier', 'Tier', 'Transition', 'VocalTract', 'VocalTractTier',
- 'Weight', 'WordList',
- )
-
- variables_numeric = (
- 'macintosh', 'windows', 'unix', 'praatVersion', 'pi', 'e', 'undefined',
- )
-
- variables_string = (
- 'praatVersion', 'tab', 'shellDirectory', 'homeDirectory',
- 'preferencesDirectory', 'newline', 'temporaryDirectory',
- 'defaultDirectory',
- )
-
- tokens = {
- 'root': [
- (r'(\s+)(#.*?$)', bygroups(Text, Comment.Single)),
- (r'^#.*?$', Comment.Single),
- (r';[^\n]*', Comment.Single),
- (r'\s+', Text),
-
- (r'\bprocedure\b', Keyword, 'procedure_definition'),
- (r'\bcall\b', Keyword, 'procedure_call'),
- (r'@', Name.Function, 'procedure_call'),
-
- include('function_call'),
-
- (words(keywords, suffix=r'\b'), Keyword),
-
- (r'(\bform\b)(\s+)([^\n]+)',
- bygroups(Keyword, Text, String), 'old_form'),
-
- (r'(print(?:line|tab)?|echo|exit|asserterror|pause|send(?:praat|socket)|'
- r'include|execute|system(?:_nocheck)?)(\s+)',
- bygroups(Keyword, Text), 'string_unquoted'),
-
- (r'(goto|label)(\s+)(\w+)', bygroups(Keyword, Text, Name.Label)),
-
- include('variable_name'),
- include('number'),
-
- (r'"', String, 'string'),
-
- (words((objects), suffix=r'(?=\s+\S+\n)'), Name.Class, 'string_unquoted'),
-
- (r'\b[A-Z]', Keyword, 'command'),
- (r'(\.{3}|[)(,])', Punctuation),
- ],
- 'command': [
- (r'( ?[\w()-]+ ?)', Keyword),
- (r"'(?=.*')", String.Interpol, 'string_interpolated'),
- (r'\.{3}', Keyword, ('#pop', 'old_arguments')),
- (r':', Keyword, ('#pop', 'comma_list')),
- (r'\s', Text, '#pop'),
- ],
- 'procedure_call': [
- (r'\s+', Text),
- (r'([\w.]+)(:|\s*\()',
- bygroups(Name.Function, Text), '#pop'),
- (r'([\w.]+)', Name.Function, ('#pop', 'old_arguments')),
- ],
- 'procedure_definition': [
- (r'\s', Text),
- (r'([\w.]+)(\s*?[(:])',
- bygroups(Name.Function, Text), '#pop'),
- (r'([\w.]+)([^\n]*)',
- bygroups(Name.Function, Text), '#pop'),
- ],
- 'function_call': [
- (words(functions_string, suffix=r'\$(?=\s*[:(])'), Name.Function, 'function'),
- (words(functions_array, suffix=r'#(?=\s*[:(])'), Name.Function, 'function'),
- (words(functions_numeric, suffix=r'(?=\s*[:(])'), Name.Function, 'function'),
- ],
- 'function': [
- (r'\s+', Text),
- (r':', Punctuation, ('#pop', 'comma_list')),
- (r'\s*\(', Punctuation, ('#pop', 'comma_list')),
- ],
- 'comma_list': [
- (r'(\s*\n\s*)(\.{3})', bygroups(Text, Punctuation)),
-
- (r'(\s*[])\n])', Text, '#pop'),
-
- (r'\s+', Text),
- (r'"', String, 'string'),
- (r'\b(if|then|else|fi|endif)\b', Keyword),
-
- include('function_call'),
- include('variable_name'),
- include('operator'),
- include('number'),
-
- (r'[()]', Text),
- (r',', Punctuation),
- ],
- 'old_arguments': [
- (r'\n', Text, '#pop'),
-
- include('variable_name'),
- include('operator'),
- include('number'),
-
- (r'"', String, 'string'),
- (r'[^\n]', Text),
- ],
- 'number': [
- (r'\n', Text, '#pop'),
- (r'\b\d+(\.\d*)?([eE][-+]?\d+)?%?', Number),
- ],
- 'object_attributes': [
- (r'\.?(n(col|row)|[xy]min|[xy]max|[nd][xy])\b', Name.Builtin, '#pop'),
- (r'(\.?(?:col|row)\$)(\[)',
- bygroups(Name.Builtin, Text), 'variable_name'),
- (r'(\$?)(\[)',
- bygroups(Name.Builtin, Text), ('#pop', 'comma_list')),
- ],
- 'variable_name': [
- include('operator'),
- include('number'),
-
- (words(variables_string, suffix=r'\$'), Name.Variable.Global),
- (words(variables_numeric, suffix=r'\b'), Name.Variable.Global),
-
- (r'\bObject_\w+', Name.Builtin, 'object_attributes'),
- (words(objects, prefix=r'\b', suffix=r'_\w+'),
- Name.Builtin, 'object_attributes'),
-
- (r"\b(Object_)(')",
- bygroups(Name.Builtin, String.Interpol),
- ('object_attributes', 'string_interpolated')),
- (words(objects, prefix=r'\b', suffix=r"(_)(')"),
- bygroups(Name.Builtin, Name.Builtin, String.Interpol),
- ('object_attributes', 'string_interpolated')),
-
- (r'\.?_?[a-z][\w.]*(\$|#)?', Text),
- (r'[\[\]]', Punctuation, 'comma_list'),
- (r"'(?=.*')", String.Interpol, 'string_interpolated'),
- ],
- 'operator': [
- (r'([+\/*<>=!-]=?|[&*|][&*|]?|\^|<>)', Operator),
- (r'(?<![\w.])(and|or|not|div|mod)(?![\w.])', Operator.Word),
- ],
- 'string_interpolated': [
- (r'\.?[_a-z][\w.]*[$#]?(?:\[[a-zA-Z0-9,]+\])?(:[0-9]+)?',
- String.Interpol),
- (r"'", String.Interpol, '#pop'),
- ],
- 'string_unquoted': [
- (r'(\n\s*)(\.{3})', bygroups(Text, Punctuation)),
-
- (r'\n', Text, '#pop'),
- (r'\s', Text),
- (r"'(?=.*')", String.Interpol, 'string_interpolated'),
- (r"'", String),
- (r"[^'\n]+", String),
- ],
- 'string': [
- (r'(\n\s*)(\.{3})', bygroups(Text, Punctuation)),
-
- (r'"', String, '#pop'),
- (r"'(?=.*')", String.Interpol, 'string_interpolated'),
- (r"'", String),
- (r'[^\'"\n]+', String),
- ],
- 'old_form': [
- (r'\s+', Text),
-
- (r'(optionmenu|choice)([ \t]+\S+:[ \t]+)',
- bygroups(Keyword, Text), 'number'),
-
- (r'(option|button)([ \t]+)',
- bygroups(Keyword, Text), 'string_unquoted'),
-
- (r'(sentence|text)([ \t]+\S+)',
- bygroups(Keyword, Text), 'string_unquoted'),
-
- (r'(word)([ \t]+\S+[ \t]*)(\S+)?([ \t]+.*)?',
- bygroups(Keyword, Text, String, Text)),
-
- (r'(boolean)(\s+\S+\s*)(0|1|"?(?:yes|no)"?)',
- bygroups(Keyword, Text, Name.Variable)),
-
- # Ideally processing of the number would happend in the 'number'
- # but that doesn't seem to work
- (r'(real|natural|positive|integer)([ \t]+\S+[ \t]*)([+-]?)(\d+(?:\.\d*)?'
- r'(?:[eE][-+]?\d+)?%?)',
- bygroups(Keyword, Text, Operator, Number)),
-
- (r'(comment)(\s+)',
- bygroups(Keyword, Text), 'string_unquoted'),
-
- (r'\bendform\b', Keyword, '#pop'),
- ]
- }
diff --git a/pygments/lexers/prolog.py b/pygments/lexers/prolog.py
deleted file mode 100644
index 8dbbc6d4..00000000
--- a/pygments/lexers/prolog.py
+++ /dev/null
@@ -1,305 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.prolog
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Prolog and Prolog-like languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['PrologLexer', 'LogtalkLexer']
-
-
-class PrologLexer(RegexLexer):
- """
- Lexer for Prolog files.
- """
- name = 'Prolog'
- aliases = ['prolog']
- filenames = ['*.ecl', '*.prolog', '*.pro', '*.pl']
- mimetypes = ['text/x-prolog']
-
- flags = re.UNICODE | re.MULTILINE
-
- tokens = {
- 'root': [
- (r'/\*', Comment.Multiline, 'nested-comment'),
- (r'%.*', Comment.Single),
- # character literal
- (r'0\'.', String.Char),
- (r'0b[01]+', Number.Bin),
- (r'0o[0-7]+', Number.Oct),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- # literal with prepended base
- (r'\d\d?\'[a-zA-Z0-9]+', Number.Integer),
- (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
- (r'\d+', Number.Integer),
- (r'[\[\](){}|.,;!]', Punctuation),
- (r':-|-->', Punctuation),
- (r'"(?:\\x[0-9a-fA-F]+\\|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|'
- r'\\[0-7]+\\|\\["\nabcefnrstv]|[^\\"])*"', String.Double),
- (r"'(?:''|[^'])*'", String.Atom), # quoted atom
- # Needs to not be followed by an atom.
- # (r'=(?=\s|[a-zA-Z\[])', Operator),
- (r'is\b', Operator),
- (r'(<|>|=<|>=|==|=:=|=|/|//|\*|\+|-)(?=\s|[a-zA-Z0-9\[])',
- Operator),
- (r'(mod|div|not)\b', Operator),
- (r'_', Keyword), # The don't-care variable
- (r'([a-z]+)(:)', bygroups(Name.Namespace, Punctuation)),
- (u'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]'
- u'[\\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)'
- u'(\\s*)(:-|-->)',
- bygroups(Name.Function, Text, Operator)), # function defn
- (u'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]'
- u'[\\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)'
- u'(\\s*)(\\()',
- bygroups(Name.Function, Text, Punctuation)),
- (u'[a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]'
- u'[\\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*',
- String.Atom), # atom, characters
- # This one includes !
- (u'[#&*+\\-./:<=>?@\\\\^~\u00a1-\u00bf\u2010-\u303f]+',
- String.Atom), # atom, graphics
- (r'[A-Z_]\w*', Name.Variable),
- (u'\\s+|[\u2000-\u200f\ufff0-\ufffe\uffef]', Text),
- ],
- 'nested-comment': [
- (r'\*/', Comment.Multiline, '#pop'),
- (r'/\*', Comment.Multiline, '#push'),
- (r'[^*/]+', Comment.Multiline),
- (r'[*/]', Comment.Multiline),
- ],
- }
-
- def analyse_text(text):
- return ':-' in text
-
-
-class LogtalkLexer(RegexLexer):
- """
- For `Logtalk <http://logtalk.org/>`_ source code.
-
- .. versionadded:: 0.10
- """
-
- name = 'Logtalk'
- aliases = ['logtalk']
- filenames = ['*.lgt', '*.logtalk']
- mimetypes = ['text/x-logtalk']
-
- tokens = {
- 'root': [
- # Directives
- (r'^\s*:-\s', Punctuation, 'directive'),
- # Comments
- (r'%.*?\n', Comment),
- (r'/\*(.|\n)*?\*/', Comment),
- # Whitespace
- (r'\n', Text),
- (r'\s+', Text),
- # Numbers
- (r"0'.", Number),
- (r'0b[01]+', Number.Bin),
- (r'0o[0-7]+', Number.Oct),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number),
- # Variables
- (r'([A-Z_]\w*)', Name.Variable),
- # Event handlers
- (r'(after|before)(?=[(])', Keyword),
- # Message forwarding handler
- (r'forward(?=[(])', Keyword),
- # Execution-context methods
- (r'(parameter|this|se(lf|nder))(?=[(])', Keyword),
- # Reflection
- (r'(current_predicate|predicate_property)(?=[(])', Keyword),
- # DCGs and term expansion
- (r'(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])', Keyword),
- # Entity
- (r'(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])', Keyword),
- (r'(object|protocol|category)_property(?=[(])', Keyword),
- # Entity relations
- (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),
- # Events
- (r'(current_event|(abolish|define)_events)(?=[(])', Keyword),
- # Flags
- (r'(current|set)_logtalk_flag(?=[(])', Keyword),
- # Compiling, loading, and library paths
- (r'logtalk_(compile|l(ibrary_path|oad|oad_context)|make)(?=[(])', Keyword),
- (r'\blogtalk_make\b', Keyword),
- # Database
- (r'(clause|retract(all)?)(?=[(])', Keyword),
- (r'a(bolish|ssert(a|z))(?=[(])', Keyword),
- # Control constructs
- (r'(ca(ll|tch)|throw)(?=[(])', Keyword),
- (r'(fa(il|lse)|true)\b', Keyword),
- # All solutions
- (r'((bag|set)of|f(ind|or)all)(?=[(])', Keyword),
- # Multi-threading meta-predicates
- (r'threaded(_(call|once|ignore|exit|peek|wait|notify))?(?=[(])', Keyword),
- # Term unification
- (r'(subsumes_term|unify_with_occurs_check)(?=[(])', Keyword),
- # Term creation and decomposition
- (r'(functor|arg|copy_term|numbervars|term_variables)(?=[(])', Keyword),
- # Evaluable functors
- (r'(div|rem|m(ax|in|od)|abs|sign)(?=[(])', Keyword),
- (r'float(_(integer|fractional)_part)?(?=[(])', Keyword),
- (r'(floor|t(an|runcate)|round|ceiling)(?=[(])', Keyword),
- # Other arithmetic functors
- (r'(cos|a(cos|sin|tan|tan2)|exp|log|s(in|qrt)|xor)(?=[(])', Keyword),
- # Term testing
- (r'(var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|'
- r'ground|acyclic_term)(?=[(])', Keyword),
- # Term comparison
- (r'compare(?=[(])', Keyword),
- # Stream selection and control
- (r'(curren|se)t_(in|out)put(?=[(])', Keyword),
- (r'(open|close)(?=[(])', Keyword),
- (r'flush_output(?=[(])', Keyword),
- (r'(at_end_of_stream|flush_output)\b', Keyword),
- (r'(stream_property|at_end_of_stream|set_stream_position)(?=[(])', Keyword),
- # Character and byte input/output
- (r'(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])', Keyword),
- (r'\bnl\b', Keyword),
- # Term input/output
- (r'read(_term)?(?=[(])', Keyword),
- (r'write(q|_(canonical|term))?(?=[(])', Keyword),
- (r'(current_)?op(?=[(])', Keyword),
- (r'(current_)?char_conversion(?=[(])', Keyword),
- # Atomic term processing
- (r'atom_(length|c(hars|o(ncat|des)))(?=[(])', Keyword),
- (r'(char_code|sub_atom)(?=[(])', Keyword),
- (r'number_c(har|ode)s(?=[(])', Keyword),
- # Implementation defined hooks functions
- (r'(se|curren)t_prolog_flag(?=[(])', Keyword),
- (r'\bhalt\b', Keyword),
- (r'halt(?=[(])', Keyword),
- # Message sending operators
- (r'(::|:|\^\^)', Operator),
- # External call
- (r'[{}]', Keyword),
- # Logic and control
- (r'(ignore|once)(?=[(])', Keyword),
- (r'\brepeat\b', Keyword),
- # Sorting
- (r'(key)?sort(?=[(])', Keyword),
- # Bitwise functors
- (r'(>>|<<|/\\|\\\\|\\)', Operator),
- # Predicate aliases
- (r'\bas\b', Operator),
- # Arithemtic evaluation
- (r'\bis\b', Keyword),
- # Arithemtic comparison
- (r'(=:=|=\\=|<|=<|>=|>)', Operator),
- # Term creation and decomposition
- (r'=\.\.', Operator),
- # Term unification
- (r'(=|\\=)', Operator),
- # Term comparison
- (r'(==|\\==|@=<|@<|@>=|@>)', Operator),
- # Evaluable functors
- (r'(//|[-+*/])', Operator),
- (r'\b(e|pi|div|mod|rem)\b', Operator),
- # Other arithemtic functors
- (r'\b\*\*\b', Operator),
- # DCG rules
- (r'-->', Operator),
- # Control constructs
- (r'([!;]|->)', Operator),
- # Logic and control
- (r'\\+', Operator),
- # Mode operators
- (r'[?@]', Operator),
- # Existential quantifier
- (r'\^', Operator),
- # Strings
- (r'"(\\\\|\\"|[^"])*"', String),
- # Ponctuation
- (r'[()\[\],.|]', Text),
- # Atoms
- (r"[a-z]\w*", Text),
- (r"'", String, 'quoted_atom'),
- ],
-
- 'quoted_atom': [
- (r"''", String),
- (r"'", String, '#pop'),
- (r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape),
- (r"[^\\'\n]+", String),
- (r'\\', String),
- ],
-
- 'directive': [
- # Conditional compilation directives
- (r'(el)?if(?=[(])', Keyword, 'root'),
- (r'(e(lse|ndif))[.]', Keyword, 'root'),
- # Entity directives
- (r'(category|object|protocol)(?=[(])', Keyword, 'entityrelations'),
- (r'(end_(category|object|protocol))[.]', Keyword, 'root'),
- # Predicate scope directives
- (r'(public|protected|private)(?=[(])', Keyword, 'root'),
- # Other directives
- (r'e(n(coding|sure_loaded)|xport)(?=[(])', Keyword, 'root'),
- (r'in(clude|itialization|fo)(?=[(])', Keyword, 'root'),
- (r'(built_in|dynamic|synchronized|threaded)[.]', Keyword, 'root'),
- (r'(alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|ode|ultifile)|'
- r's(et_(logtalk|prolog)_flag|ynchronized))(?=[(])', Keyword, 'root'),
- (r'op(?=[(])', Keyword, 'root'),
- (r'(c(alls|oinductive)|module|reexport|use(s|_module))(?=[(])', Keyword, 'root'),
- (r'[a-z]\w*(?=[(])', Text, 'root'),
- (r'[a-z]\w*[.]', Text, 'root'),
- ],
-
- 'entityrelations': [
- (r'(complements|extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])', Keyword),
- # Numbers
- (r"0'.", Number),
- (r'0b[01]+', Number.Bin),
- (r'0o[0-7]+', Number.Oct),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number),
- # Variables
- (r'([A-Z_]\w*)', Name.Variable),
- # Atoms
- (r"[a-z]\w*", Text),
- (r"'", String, 'quoted_atom'),
- # Strings
- (r'"(\\\\|\\"|[^"])*"', String),
- # End of entity-opening directive
- (r'([)]\.)', Text, 'root'),
- # Scope operator
- (r'(::)', Operator),
- # Ponctuation
- (r'[()\[\],.|]', Text),
- # Comments
- (r'%.*?\n', Comment),
- (r'/\*(.|\n)*?\*/', Comment),
- # Whitespace
- (r'\n', Text),
- (r'\s+', Text),
- ]
- }
-
- def analyse_text(text):
- if ':- object(' in text:
- return 1.0
- elif ':- protocol(' in text:
- return 1.0
- elif ':- category(' in text:
- return 1.0
- elif re.search(r'^:-\s[a-z]', text, re.M):
- return 0.9
- else:
- return 0.0
diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py
deleted file mode 100644
index 0f9c4d41..00000000
--- a/pygments/lexers/python.py
+++ /dev/null
@@ -1,941 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.python
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Python and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
- default, words, combined, do_insertions
-from pygments.util import get_bool_opt, shebang_matches
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic, Other, Error
-from pygments import unistring as uni
-
-__all__ = ['PythonLexer', 'PythonConsoleLexer', 'PythonTracebackLexer',
- 'Python3Lexer', 'Python3TracebackLexer', 'CythonLexer',
- 'DgLexer', 'NumPyLexer']
-
-line_re = re.compile('.*?\n')
-
-
-class PythonLexer(RegexLexer):
- """
- For `Python <http://www.python.org>`_ source code.
- """
-
- name = 'Python'
- aliases = ['python', 'py', 'sage']
- filenames = ['*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac', '*.sage']
- mimetypes = ['text/x-python', 'application/x-python']
-
- def innerstring_rules(ttype):
- return [
- # the old style '%s' % (...) string formatting
- (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
- '[hlL]?[E-GXc-giorsux%]', String.Interpol),
- # backslashes, quotes and formatting signs must be parsed one at a time
- (r'[^\\\'"%\n]+', ttype),
- (r'[\'"\\]', ttype),
- # unhandled string formatting sign
- (r'%', ttype),
- # newlines are an error (use "nl" state)
- ]
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")',
- bygroups(Text, String.Affix, String.Doc)),
- (r"^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')",
- bygroups(Text, String.Affix, String.Doc)),
- (r'[^\S\n]+', Text),
- (r'\A#!.+$', Comment.Hashbang),
- (r'#.*$', Comment.Single),
- (r'[]{}:(),;[]', Punctuation),
- (r'\\\n', Text),
- (r'\\', Text),
- (r'(in|is|and|or|not)\b', Operator.Word),
- (r'!=|==|<<|>>|[-~+/*%=<>&^|.]', Operator),
- 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'),
- include('builtins'),
- include('magicfuncs'),
- include('magicvars'),
- include('backtick'),
- ('([rR]|[uUbB][rR]|[rR][uUbB])(""")',
- bygroups(String.Affix, String.Double), 'tdqs'),
- ("([rR]|[uUbB][rR]|[rR][uUbB])(''')",
- bygroups(String.Affix, String.Single), 'tsqs'),
- ('([rR]|[uUbB][rR]|[rR][uUbB])(")',
- bygroups(String.Affix, String.Double), 'dqs'),
- ("([rR]|[uUbB][rR]|[rR][uUbB])(')",
- bygroups(String.Affix, String.Single), 'sqs'),
- ('([uUbB]?)(""")', bygroups(String.Affix, String.Double),
- combined('stringescape', 'tdqs')),
- ("([uUbB]?)(''')", bygroups(String.Affix, String.Single),
- combined('stringescape', 'tsqs')),
- ('([uUbB]?)(")', bygroups(String.Affix, String.Double),
- combined('stringescape', 'dqs')),
- ("([uUbB]?)(')", bygroups(String.Affix, String.Single),
- combined('stringescape', 'sqs')),
- include('name'),
- include('numbers'),
- ],
- 'keywords': [
- (words((
- 'assert', 'break', 'continue', 'del', 'elif', 'else', 'except',
- 'exec', 'finally', 'for', 'global', 'if', 'lambda', 'pass',
- 'print', 'raise', 'return', 'try', 'while', 'yield',
- 'yield from', 'as', 'with'), suffix=r'\b'),
- Keyword),
- ],
- 'builtins': [
- (words((
- '__import__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin',
- 'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod',
- 'cmp', 'coerce', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod',
- 'enumerate', 'eval', 'execfile', 'exit', 'file', 'filter', 'float',
- 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'hex', 'id',
- 'input', 'int', 'intern', 'isinstance', 'issubclass', 'iter', 'len',
- 'list', 'locals', 'long', 'map', 'max', 'min', 'next', 'object',
- 'oct', 'open', 'ord', 'pow', 'property', 'range', 'raw_input', 'reduce',
- 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
- 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type',
- 'unichr', 'unicode', 'vars', 'xrange', 'zip'),
- prefix=r'(?<!\.)', suffix=r'\b'),
- Name.Builtin),
- (r'(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|cls'
- r')\b', Name.Builtin.Pseudo),
- (words((
- 'ArithmeticError', 'AssertionError', 'AttributeError',
- 'BaseException', 'DeprecationWarning', 'EOFError', 'EnvironmentError',
- 'Exception', 'FloatingPointError', 'FutureWarning', 'GeneratorExit',
- 'IOError', 'ImportError', 'ImportWarning', 'IndentationError',
- 'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError',
- 'MemoryError', 'ModuleNotFoundError', 'NameError', 'NotImplemented', 'NotImplementedError',
- 'OSError', 'OverflowError', 'OverflowWarning', 'PendingDeprecationWarning',
- 'RecursionError', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', 'StandardError',
- 'StopIteration', 'StopAsyncIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError',
- 'SystemExit', 'TabError', 'TypeError', 'UnboundLocalError',
- 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError',
- 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning',
- 'ValueError', 'VMSError', 'Warning', 'WindowsError',
- 'ZeroDivisionError'), prefix=r'(?<!\.)', suffix=r'\b'),
- Name.Exception),
- ],
- 'magicfuncs': [
- (words((
- '__abs__', '__add__', '__and__', '__call__', '__cmp__', '__coerce__',
- '__complex__', '__contains__', '__del__', '__delattr__', '__delete__',
- '__delitem__', '__delslice__', '__div__', '__divmod__', '__enter__',
- '__eq__', '__exit__', '__float__', '__floordiv__', '__ge__', '__get__',
- '__getattr__', '__getattribute__', '__getitem__', '__getslice__', '__gt__',
- '__hash__', '__hex__', '__iadd__', '__iand__', '__idiv__', '__ifloordiv__',
- '__ilshift__', '__imod__', '__imul__', '__index__', '__init__',
- '__instancecheck__', '__int__', '__invert__', '__iop__', '__ior__',
- '__ipow__', '__irshift__', '__isub__', '__iter__', '__itruediv__',
- '__ixor__', '__le__', '__len__', '__long__', '__lshift__', '__lt__',
- '__missing__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__',
- '__nonzero__', '__oct__', '__op__', '__or__', '__pos__', '__pow__',
- '__radd__', '__rand__', '__rcmp__', '__rdiv__', '__rdivmod__', '__repr__',
- '__reversed__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__',
- '__rop__', '__ror__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__',
- '__rtruediv__', '__rxor__', '__set__', '__setattr__', '__setitem__',
- '__setslice__', '__str__', '__sub__', '__subclasscheck__', '__truediv__',
- '__unicode__', '__xor__'), suffix=r'\b'),
- Name.Function.Magic),
- ],
- 'magicvars': [
- (words((
- '__bases__', '__class__', '__closure__', '__code__', '__defaults__',
- '__dict__', '__doc__', '__file__', '__func__', '__globals__',
- '__metaclass__', '__module__', '__mro__', '__name__', '__self__',
- '__slots__', '__weakref__'),
- suffix=r'\b'),
- Name.Variable.Magic),
- ],
- 'numbers': [
- (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[bB][01]+', Number.Bin),
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
- (r'\d+L', Number.Integer.Long),
- (r'\d+j?', Number.Integer)
- ],
- 'backtick': [
- ('`.*?`', String.Backtick),
- ],
- 'name': [
- (r'@[\w.]+', Name.Decorator),
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'funcname': [
- include('magicfuncs'),
- (r'[a-zA-Z_]\w*', Name.Function, '#pop'),
- default('#pop'),
- ],
- 'classname': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop')
- ],
- 'import': [
- (r'(?:[ \t]|\\\n)+', Text),
- (r'as\b', Keyword.Namespace),
- (r',', Operator),
- (r'[a-zA-Z_][\w.]*', Name.Namespace),
- default('#pop') # all else: go back
- ],
- 'fromimport': [
- (r'(?:[ \t]|\\\n)+', Text),
- (r'import\b', Keyword.Namespace, '#pop'),
- # if None occurs here, it's "raise x from None", since None can
- # never be a module name
- (r'None\b', Name.Builtin.Pseudo, '#pop'),
- # sadly, in "raise x from y" y will be highlighted as namespace too
- (r'[a-zA-Z_.][\w.]*', Name.Namespace),
- # anything else here also means "raise x from y" and is therefore
- # not an error
- default('#pop'),
- ],
- 'stringescape': [
- (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
- r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
- ],
- 'strings-single': innerstring_rules(String.Single),
- 'strings-double': innerstring_rules(String.Double),
- 'dqs': [
- (r'"', String.Double, '#pop'),
- (r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
- include('strings-double')
- ],
- 'sqs': [
- (r"'", String.Single, '#pop'),
- (r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
- include('strings-single')
- ],
- 'tdqs': [
- (r'"""', String.Double, '#pop'),
- include('strings-double'),
- (r'\n', String.Double)
- ],
- 'tsqs': [
- (r"'''", String.Single, '#pop'),
- include('strings-single'),
- (r'\n', String.Single)
- ],
- }
-
- def analyse_text(text):
- return shebang_matches(text, r'pythonw?(2(\.\d)?)?') or \
- 'import ' in text[:1000]
-
-
-class Python3Lexer(RegexLexer):
- """
- For `Python <http://www.python.org>`_ source code (version 3.0).
-
- .. versionadded:: 0.10
- """
-
- name = 'Python 3'
- aliases = ['python3', 'py3']
- filenames = [] # Nothing until Python 3 gets widespread
- mimetypes = ['text/x-python3', 'application/x-python3']
-
- flags = re.MULTILINE | re.UNICODE
-
- uni_name = "[%s][%s]*" % (uni.xid_start, uni.xid_continue)
-
- def innerstring_rules(ttype):
- return [
- # the old style '%s' % (...) string formatting (still valid in Py3)
- (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
- '[hlL]?[E-GXc-giorsaux%]', String.Interpol),
- # the new style '{}'.format(...) string formatting
- (r'\{'
- r'((\w+)((\.\w+)|(\[[^\]]+\]))*)?' # field name
- r'(\![sra])?' # conversion
- r'(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?'
- r'\}', String.Interpol),
-
- # backslashes, quotes and formatting signs must be parsed one at a time
- (r'[^\\\'"%{\n]+', ttype),
- (r'[\'"\\]', ttype),
- # unhandled string formatting sign
- (r'%|(\{{1,2})', ttype)
- # newlines are an error (use "nl" state)
- ]
-
- tokens = PythonLexer.tokens.copy()
- tokens['keywords'] = [
- (words((
- 'assert', 'async', 'await', 'break', 'continue', 'del', 'elif',
- 'else', 'except', 'finally', 'for', 'global', 'if', 'lambda', 'pass',
- 'raise', 'nonlocal', 'return', 'try', 'while', 'yield', 'yield from',
- 'as', 'with'), suffix=r'\b'),
- Keyword),
- (words((
- 'True', 'False', 'None'), suffix=r'\b'),
- Keyword.Constant),
- ]
- tokens['builtins'] = [
- (words((
- '__import__', 'abs', 'all', 'any', 'bin', 'bool', 'bytearray', 'bytes',
- 'chr', 'classmethod', 'cmp', 'compile', 'complex', 'delattr', 'dict',
- 'dir', 'divmod', 'enumerate', 'eval', 'filter', 'float', 'format',
- 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'hex', 'id',
- 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list',
- 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct',
- 'open', 'ord', 'pow', 'print', 'property', 'range', 'repr', 'reversed',
- 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str',
- 'sum', 'super', 'tuple', 'type', 'vars', 'zip'), prefix=r'(?<!\.)',
- suffix=r'\b'),
- Name.Builtin),
- (r'(?<!\.)(self|Ellipsis|NotImplemented|cls)\b', Name.Builtin.Pseudo),
- (words((
- 'ArithmeticError', 'AssertionError', 'AttributeError',
- 'BaseException', 'BufferError', 'BytesWarning', 'DeprecationWarning',
- 'EOFError', 'EnvironmentError', 'Exception', 'FloatingPointError',
- 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError',
- 'ImportWarning', 'IndentationError', 'IndexError', 'KeyError',
- 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError',
- 'NotImplementedError', 'OSError', 'OverflowError',
- 'PendingDeprecationWarning', 'ReferenceError', 'ResourceWarning',
- 'RuntimeError', 'RuntimeWarning', 'StopIteration',
- 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError',
- 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',
- 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError',
- 'UnicodeWarning', 'UserWarning', 'ValueError', 'VMSError', 'Warning',
- 'WindowsError', 'ZeroDivisionError',
- # new builtin exceptions from PEP 3151
- 'BlockingIOError', 'ChildProcessError', 'ConnectionError',
- 'BrokenPipeError', 'ConnectionAbortedError', 'ConnectionRefusedError',
- 'ConnectionResetError', 'FileExistsError', 'FileNotFoundError',
- 'InterruptedError', 'IsADirectoryError', 'NotADirectoryError',
- 'PermissionError', 'ProcessLookupError', 'TimeoutError'),
- prefix=r'(?<!\.)', suffix=r'\b'),
- Name.Exception),
- ]
- tokens['magicfuncs'] = [
- (words((
- '__abs__', '__add__', '__aenter__', '__aexit__', '__aiter__', '__and__',
- '__anext__', '__await__', '__bool__', '__bytes__', '__call__',
- '__complex__', '__contains__', '__del__', '__delattr__', '__delete__',
- '__delitem__', '__dir__', '__divmod__', '__enter__', '__eq__', '__exit__',
- '__float__', '__floordiv__', '__format__', '__ge__', '__get__',
- '__getattr__', '__getattribute__', '__getitem__', '__gt__', '__hash__',
- '__iadd__', '__iand__', '__ifloordiv__', '__ilshift__', '__imatmul__',
- '__imod__', '__import__', '__imul__', '__index__', '__init__',
- '__instancecheck__', '__int__', '__invert__', '__ior__', '__ipow__',
- '__irshift__', '__isub__', '__iter__', '__itruediv__', '__ixor__',
- '__le__', '__len__', '__length_hint__', '__lshift__', '__lt__',
- '__matmul__', '__missing__', '__mod__', '__mul__', '__ne__', '__neg__',
- '__new__', '__next__', '__or__', '__pos__', '__pow__', '__prepare__',
- '__radd__', '__rand__', '__rdivmod__', '__repr__', '__reversed__',
- '__rfloordiv__', '__rlshift__', '__rmatmul__', '__rmod__', '__rmul__',
- '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__',
- '__rsub__', '__rtruediv__', '__rxor__', '__set__', '__setattr__',
- '__setitem__', '__str__', '__sub__', '__subclasscheck__', '__truediv__',
- '__xor__'), suffix=r'\b'),
- Name.Function.Magic),
- ]
- tokens['magicvars'] = [
- (words((
- '__annotations__', '__bases__', '__class__', '__closure__', '__code__',
- '__defaults__', '__dict__', '__doc__', '__file__', '__func__',
- '__globals__', '__kwdefaults__', '__module__', '__mro__', '__name__',
- '__objclass__', '__qualname__', '__self__', '__slots__', '__weakref__'),
- suffix=r'\b'),
- Name.Variable.Magic),
- ]
- tokens['numbers'] = [
- (r'(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)'
- r'([eE][+-]?\d(?:_?\d)*)?', Number.Float),
- (r'\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?', Number.Float),
- (r'0[oO](?:_?[0-7])+', Number.Oct),
- (r'0[bB](?:_?[01])+', Number.Bin),
- (r'0[xX](?:_?[a-fA-F0-9])+', Number.Hex),
- (r'\d(?:_?\d)*', Number.Integer)
- ]
- tokens['backtick'] = []
- tokens['name'] = [
- (r'@\w+', Name.Decorator),
- (r'@', Operator), # new matrix multiplication operator
- (uni_name, Name),
- ]
- tokens['funcname'] = [
- (uni_name, Name.Function, '#pop')
- ]
- tokens['classname'] = [
- (uni_name, Name.Class, '#pop')
- ]
- tokens['import'] = [
- (r'(\s+)(as)(\s+)', bygroups(Text, Keyword, Text)),
- (r'\.', Name.Namespace),
- (uni_name, Name.Namespace),
- (r'(\s*)(,)(\s*)', bygroups(Text, Operator, Text)),
- default('#pop') # all else: go back
- ]
- tokens['fromimport'] = [
- (r'(\s+)(import)\b', bygroups(Text, Keyword), '#pop'),
- (r'\.', Name.Namespace),
- (uni_name, Name.Namespace),
- default('#pop'),
- ]
- tokens['strings-single'] = innerstring_rules(String.Single)
- tokens['strings-double'] = innerstring_rules(String.Double)
-
-
- def analyse_text(text):
- return shebang_matches(text, r'pythonw?3(\.\d)?')
-
-
-class PythonConsoleLexer(Lexer):
- """
- For Python console output or doctests, such as:
-
- .. sourcecode:: pycon
-
- >>> a = 'foo'
- >>> print a
- foo
- >>> 1 / 0
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- ZeroDivisionError: integer division or modulo by zero
-
- Additional options:
-
- `python3`
- Use Python 3 lexer for code. Default is ``False``.
-
- .. versionadded:: 1.0
- """
- name = 'Python console session'
- aliases = ['pycon']
- mimetypes = ['text/x-python-doctest']
-
- def __init__(self, **options):
- self.python3 = get_bool_opt(options, 'python3', False)
- Lexer.__init__(self, **options)
-
- def get_tokens_unprocessed(self, text):
- if self.python3:
- pylexer = Python3Lexer(**self.options)
- tblexer = Python3TracebackLexer(**self.options)
- else:
- pylexer = PythonLexer(**self.options)
- tblexer = PythonTracebackLexer(**self.options)
-
- curcode = ''
- insertions = []
- curtb = ''
- tbindex = 0
- tb = 0
- for match in line_re.finditer(text):
- line = match.group()
- if line.startswith(u'>>> ') or line.startswith(u'... '):
- tb = 0
- insertions.append((len(curcode),
- [(0, Generic.Prompt, line[:4])]))
- curcode += line[4:]
- elif line.rstrip() == u'...' and not tb:
- # only a new >>> prompt can end an exception block
- # otherwise an ellipsis in place of the traceback frames
- # will be mishandled
- insertions.append((len(curcode),
- [(0, Generic.Prompt, u'...')]))
- curcode += line[3:]
- else:
- if curcode:
- for item in do_insertions(
- insertions, pylexer.get_tokens_unprocessed(curcode)):
- yield item
- curcode = ''
- insertions = []
- if (line.startswith(u'Traceback (most recent call last):') or
- re.match(u' File "[^"]+", line \\d+\\n$', line)):
- tb = 1
- curtb = line
- tbindex = match.start()
- elif line == 'KeyboardInterrupt\n':
- yield match.start(), Name.Class, line
- elif tb:
- curtb += line
- if not (line.startswith(' ') or line.strip() == u'...'):
- tb = 0
- for i, t, v in tblexer.get_tokens_unprocessed(curtb):
- yield tbindex+i, t, v
- curtb = ''
- else:
- yield match.start(), Generic.Output, line
- if curcode:
- for item in do_insertions(insertions,
- pylexer.get_tokens_unprocessed(curcode)):
- yield item
- if curtb:
- for i, t, v in tblexer.get_tokens_unprocessed(curtb):
- yield tbindex+i, t, v
-
-
-class PythonTracebackLexer(RegexLexer):
- """
- For Python tracebacks.
-
- .. versionadded:: 0.7
- """
-
- name = 'Python Traceback'
- aliases = ['pytb']
- filenames = ['*.pytb']
- mimetypes = ['text/x-python-traceback']
-
- tokens = {
- 'root': [
- # Cover both (most recent call last) and (innermost last)
- # The optional ^C allows us to catch keyboard interrupt signals.
- (r'^(\^C)?(Traceback.*\n)',
- bygroups(Text, Generic.Traceback), 'intb'),
- # SyntaxError starts with this.
- (r'^(?= File "[^"]+", line \d+)', Generic.Traceback, 'intb'),
- (r'^.*\n', Other),
- ],
- 'intb': [
- (r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)',
- bygroups(Text, Name.Builtin, Text, Number, Text, Name, Text)),
- (r'^( File )("[^"]+")(, line )(\d+)(\n)',
- bygroups(Text, Name.Builtin, Text, Number, Text)),
- (r'^( )(.+)(\n)',
- bygroups(Text, using(PythonLexer), Text)),
- (r'^([ \t]*)(\.\.\.)(\n)',
- bygroups(Text, Comment, Text)), # for doctests...
- (r'^([^:]+)(: )(.+)(\n)',
- bygroups(Generic.Error, Text, Name, Text), '#pop'),
- (r'^([a-zA-Z_]\w*)(:?\n)',
- bygroups(Generic.Error, Text), '#pop')
- ],
- }
-
-
-class Python3TracebackLexer(RegexLexer):
- """
- For Python 3.0 tracebacks, with support for chained exceptions.
-
- .. versionadded:: 1.0
- """
-
- name = 'Python 3.0 Traceback'
- aliases = ['py3tb']
- filenames = ['*.py3tb']
- mimetypes = ['text/x-python3-traceback']
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'^Traceback \(most recent call last\):\n', Generic.Traceback, 'intb'),
- (r'^During handling of the above exception, another '
- r'exception occurred:\n\n', Generic.Traceback),
- (r'^The above exception was the direct cause of the '
- r'following exception:\n\n', Generic.Traceback),
- (r'^(?= File "[^"]+", line \d+)', Generic.Traceback, 'intb'),
- ],
- 'intb': [
- (r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)',
- bygroups(Text, Name.Builtin, Text, Number, Text, Name, Text)),
- (r'^( File )("[^"]+")(, line )(\d+)(\n)',
- bygroups(Text, Name.Builtin, Text, Number, Text)),
- (r'^( )(.+)(\n)',
- bygroups(Text, using(Python3Lexer), Text)),
- (r'^([ \t]*)(\.\.\.)(\n)',
- bygroups(Text, Comment, Text)), # for doctests...
- (r'^([^:]+)(: )(.+)(\n)',
- bygroups(Generic.Error, Text, Name, Text), '#pop'),
- (r'^([a-zA-Z_]\w*)(:?\n)',
- bygroups(Generic.Error, Text), '#pop')
- ],
- }
-
-
-class CythonLexer(RegexLexer):
- """
- For Pyrex and `Cython <http://cython.org>`_ source code.
-
- .. versionadded:: 1.1
- """
-
- name = 'Cython'
- aliases = ['cython', 'pyx', 'pyrex']
- filenames = ['*.pyx', '*.pxd', '*.pxi']
- mimetypes = ['text/x-cython', 'application/x-cython']
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'^(\s*)("""(?:.|\n)*?""")', bygroups(Text, String.Doc)),
- (r"^(\s*)('''(?:.|\n)*?''')", bygroups(Text, String.Doc)),
- (r'[^\S\n]+', Text),
- (r'#.*$', Comment),
- (r'[]{}:(),;[]', Punctuation),
- (r'\\\n', Text),
- (r'\\', Text),
- (r'(in|is|and|or|not)\b', Operator.Word),
- (r'(<)([a-zA-Z0-9.?]+)(>)',
- bygroups(Punctuation, Keyword.Type, Punctuation)),
- (r'!=|==|<<|>>|[-~+/*%=<>&^|.?]', Operator),
- (r'(from)(\d+)(<=)(\s+)(<)(\d+)(:)',
- bygroups(Keyword, Number.Integer, Operator, Name, Operator,
- Name, Punctuation)),
- include('keywords'),
- (r'(def|property)(\s+)', bygroups(Keyword, Text), 'funcname'),
- (r'(cp?def)(\s+)', bygroups(Keyword, Text), 'cdef'),
- # (should actually start a block with only cdefs)
- (r'(cdef)(:)', bygroups(Keyword, Punctuation)),
- (r'(class|struct)(\s+)', bygroups(Keyword, Text), 'classname'),
- (r'(from)(\s+)', bygroups(Keyword, Text), 'fromimport'),
- (r'(c?import)(\s+)', bygroups(Keyword, Text), 'import'),
- include('builtins'),
- include('backtick'),
- ('(?:[rR]|[uU][rR]|[rR][uU])"""', String, 'tdqs'),
- ("(?:[rR]|[uU][rR]|[rR][uU])'''", String, 'tsqs'),
- ('(?:[rR]|[uU][rR]|[rR][uU])"', String, 'dqs'),
- ("(?:[rR]|[uU][rR]|[rR][uU])'", String, 'sqs'),
- ('[uU]?"""', String, combined('stringescape', 'tdqs')),
- ("[uU]?'''", String, combined('stringescape', 'tsqs')),
- ('[uU]?"', String, combined('stringescape', 'dqs')),
- ("[uU]?'", String, combined('stringescape', 'sqs')),
- include('name'),
- include('numbers'),
- ],
- 'keywords': [
- (words((
- 'assert', 'break', 'by', 'continue', 'ctypedef', 'del', 'elif',
- 'else', 'except', 'except?', 'exec', 'finally', 'for', 'fused', 'gil',
- 'global', 'if', 'include', 'lambda', 'nogil', 'pass', 'print',
- 'raise', 'return', 'try', 'while', 'yield', 'as', 'with'), suffix=r'\b'),
- Keyword),
- (r'(DEF|IF|ELIF|ELSE)\b', Comment.Preproc),
- ],
- 'builtins': [
- (words((
- '__import__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin',
- 'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr',
- 'classmethod', 'cmp', 'coerce', 'compile', 'complex', 'delattr',
- 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', 'exit',
- 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals',
- 'hasattr', 'hash', 'hex', 'id', 'input', 'int', 'intern', 'isinstance',
- 'issubclass', 'iter', 'len', 'list', 'locals', 'long', 'map', 'max',
- 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'property',
- 'range', 'raw_input', 'reduce', 'reload', 'repr', 'reversed',
- 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod',
- 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', 'unsigned',
- 'vars', 'xrange', 'zip'), prefix=r'(?<!\.)', suffix=r'\b'),
- Name.Builtin),
- (r'(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|NULL'
- r')\b', Name.Builtin.Pseudo),
- (words((
- 'ArithmeticError', 'AssertionError', 'AttributeError',
- 'BaseException', 'DeprecationWarning', 'EOFError', 'EnvironmentError',
- 'Exception', 'FloatingPointError', 'FutureWarning', 'GeneratorExit',
- 'IOError', 'ImportError', 'ImportWarning', 'IndentationError',
- 'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError',
- 'MemoryError', 'NameError', 'NotImplemented', 'NotImplementedError',
- 'OSError', 'OverflowError', 'OverflowWarning',
- 'PendingDeprecationWarning', 'ReferenceError', 'RuntimeError',
- 'RuntimeWarning', 'StandardError', 'StopIteration', 'SyntaxError',
- 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError',
- 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',
- 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError',
- 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning',
- 'ZeroDivisionError'), prefix=r'(?<!\.)', suffix=r'\b'),
- Name.Exception),
- ],
- 'numbers': [
- (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
- (r'0\d+', Number.Oct),
- (r'0[xX][a-fA-F0-9]+', Number.Hex),
- (r'\d+L', Number.Integer.Long),
- (r'\d+', Number.Integer)
- ],
- 'backtick': [
- ('`.*?`', String.Backtick),
- ],
- 'name': [
- (r'@\w+', Name.Decorator),
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'funcname': [
- (r'[a-zA-Z_]\w*', Name.Function, '#pop')
- ],
- 'cdef': [
- (r'(public|readonly|extern|api|inline)\b', Keyword.Reserved),
- (r'(struct|enum|union|class)\b', Keyword),
- (r'([a-zA-Z_]\w*)(\s*)(?=[(:#=]|$)',
- bygroups(Name.Function, Text), '#pop'),
- (r'([a-zA-Z_]\w*)(\s*)(,)',
- bygroups(Name.Function, Text, Punctuation)),
- (r'from\b', Keyword, '#pop'),
- (r'as\b', Keyword),
- (r':', Punctuation, '#pop'),
- (r'(?=["\'])', Text, '#pop'),
- (r'[a-zA-Z_]\w*', Keyword.Type),
- (r'.', Text),
- ],
- 'classname': [
- (r'[a-zA-Z_]\w*', Name.Class, '#pop')
- ],
- 'import': [
- (r'(\s+)(as)(\s+)', bygroups(Text, Keyword, Text)),
- (r'[a-zA-Z_][\w.]*', Name.Namespace),
- (r'(\s*)(,)(\s*)', bygroups(Text, Operator, Text)),
- default('#pop') # all else: go back
- ],
- 'fromimport': [
- (r'(\s+)(c?import)\b', bygroups(Text, Keyword), '#pop'),
- (r'[a-zA-Z_.][\w.]*', Name.Namespace),
- # ``cdef foo from "header"``, or ``for foo from 0 < i < 10``
- default('#pop'),
- ],
- 'stringescape': [
- (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
- r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
- ],
- 'strings': [
- (r'%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
- '[hlL]?[E-GXc-giorsux%]', String.Interpol),
- (r'[^\\\'"%\n]+', String),
- # quotes, percents and backslashes must be parsed one at a time
- (r'[\'"\\]', String),
- # unhandled string formatting sign
- (r'%', String)
- # newlines are an error (use "nl" state)
- ],
- 'nl': [
- (r'\n', String)
- ],
- 'dqs': [
- (r'"', String, '#pop'),
- (r'\\\\|\\"|\\\n', String.Escape), # included here again for raw strings
- include('strings')
- ],
- 'sqs': [
- (r"'", String, '#pop'),
- (r"\\\\|\\'|\\\n", String.Escape), # included here again for raw strings
- include('strings')
- ],
- 'tdqs': [
- (r'"""', String, '#pop'),
- include('strings'),
- include('nl')
- ],
- 'tsqs': [
- (r"'''", String, '#pop'),
- include('strings'),
- include('nl')
- ],
- }
-
-
-class DgLexer(RegexLexer):
- """
- Lexer for `dg <http://pyos.github.com/dg>`_,
- a functional and object-oriented programming language
- running on the CPython 3 VM.
-
- .. versionadded:: 1.6
- """
- name = 'dg'
- aliases = ['dg']
- filenames = ['*.dg']
- mimetypes = ['text/x-dg']
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'#.*?$', Comment.Single),
-
- (r'(?i)0b[01]+', Number.Bin),
- (r'(?i)0o[0-7]+', Number.Oct),
- (r'(?i)0x[0-9a-f]+', Number.Hex),
- (r'(?i)[+-]?[0-9]+\.[0-9]+(e[+-]?[0-9]+)?j?', Number.Float),
- (r'(?i)[+-]?[0-9]+e[+-]?\d+j?', Number.Float),
- (r'(?i)[+-]?[0-9]+j?', Number.Integer),
-
- (r"(?i)(br|r?b?)'''", String, combined('stringescape', 'tsqs', 'string')),
- (r'(?i)(br|r?b?)"""', String, combined('stringescape', 'tdqs', 'string')),
- (r"(?i)(br|r?b?)'", String, combined('stringescape', 'sqs', 'string')),
- (r'(?i)(br|r?b?)"', String, combined('stringescape', 'dqs', 'string')),
-
- (r"`\w+'*`", Operator),
- (r'\b(and|in|is|or|where)\b', Operator.Word),
- (r'[!$%&*+\-./:<-@\\^|~;,]+', Operator),
-
- (words((
- 'bool', 'bytearray', 'bytes', 'classmethod', 'complex', 'dict', 'dict\'',
- 'float', 'frozenset', 'int', 'list', 'list\'', 'memoryview', 'object',
- 'property', 'range', 'set', 'set\'', 'slice', 'staticmethod', 'str',
- 'super', 'tuple', 'tuple\'', 'type'),
- prefix=r'(?<!\.)', suffix=r'(?![\'\w])'),
- Name.Builtin),
- (words((
- '__import__', 'abs', 'all', 'any', 'bin', 'bind', 'chr', 'cmp', 'compile',
- 'complex', 'delattr', 'dir', 'divmod', 'drop', 'dropwhile', 'enumerate',
- 'eval', 'exhaust', 'filter', 'flip', 'foldl1?', 'format', 'fst',
- 'getattr', 'globals', 'hasattr', 'hash', 'head', 'hex', 'id', 'init',
- 'input', 'isinstance', 'issubclass', 'iter', 'iterate', 'last', 'len',
- 'locals', 'map', 'max', 'min', 'next', 'oct', 'open', 'ord', 'pow',
- 'print', 'repr', 'reversed', 'round', 'setattr', 'scanl1?', 'snd',
- 'sorted', 'sum', 'tail', 'take', 'takewhile', 'vars', 'zip'),
- prefix=r'(?<!\.)', suffix=r'(?![\'\w])'),
- Name.Builtin),
- (r"(?<!\.)(self|Ellipsis|NotImplemented|None|True|False)(?!['\w])",
- Name.Builtin.Pseudo),
-
- (r"(?<!\.)[A-Z]\w*(Error|Exception|Warning)'*(?!['\w])",
- Name.Exception),
- (r"(?<!\.)(Exception|GeneratorExit|KeyboardInterrupt|StopIteration|"
- r"SystemExit)(?!['\w])", Name.Exception),
-
- (r"(?<![\w.])(except|finally|for|if|import|not|otherwise|raise|"
- r"subclass|while|with|yield)(?!['\w])", Keyword.Reserved),
-
- (r"[A-Z_]+'*(?!['\w])", Name),
- (r"[A-Z]\w+'*(?!['\w])", Keyword.Type),
- (r"\w+'*", Name),
-
- (r'[()]', Punctuation),
- (r'.', Error),
- ],
- 'stringescape': [
- (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
- r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
- ],
- 'string': [
- (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
- '[hlL]?[E-GXc-giorsux%]', String.Interpol),
- (r'[^\\\'"%\n]+', String),
- # quotes, percents and backslashes must be parsed one at a time
- (r'[\'"\\]', String),
- # unhandled string formatting sign
- (r'%', String),
- (r'\n', String)
- ],
- 'dqs': [
- (r'"', String, '#pop')
- ],
- 'sqs': [
- (r"'", String, '#pop')
- ],
- 'tdqs': [
- (r'"""', String, '#pop')
- ],
- 'tsqs': [
- (r"'''", String, '#pop')
- ],
- }
-
-
-class NumPyLexer(PythonLexer):
- """
- A Python lexer recognizing Numerical Python builtins.
-
- .. versionadded:: 0.10
- """
-
- name = 'NumPy'
- aliases = ['numpy']
-
- # override the mimetypes to not inherit them from python
- mimetypes = []
- filenames = []
-
- EXTRA_KEYWORDS = set((
- 'abs', 'absolute', 'accumulate', 'add', 'alen', 'all', 'allclose',
- 'alltrue', 'alterdot', 'amax', 'amin', 'angle', 'any', 'append',
- 'apply_along_axis', 'apply_over_axes', 'arange', 'arccos', 'arccosh',
- 'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'argmax', 'argmin',
- 'argsort', 'argwhere', 'around', 'array', 'array2string', 'array_equal',
- 'array_equiv', 'array_repr', 'array_split', 'array_str', 'arrayrange',
- 'asanyarray', 'asarray', 'asarray_chkfinite', 'ascontiguousarray',
- 'asfarray', 'asfortranarray', 'asmatrix', 'asscalar', 'astype',
- 'atleast_1d', 'atleast_2d', 'atleast_3d', 'average', 'bartlett',
- 'base_repr', 'beta', 'binary_repr', 'bincount', 'binomial',
- 'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'blackman',
- 'bmat', 'broadcast', 'byte_bounds', 'bytes', 'byteswap', 'c_',
- 'can_cast', 'ceil', 'choose', 'clip', 'column_stack', 'common_type',
- 'compare_chararrays', 'compress', 'concatenate', 'conj', 'conjugate',
- 'convolve', 'copy', 'corrcoef', 'correlate', 'cos', 'cosh', 'cov',
- 'cross', 'cumprod', 'cumproduct', 'cumsum', 'delete', 'deprecate',
- 'diag', 'diagflat', 'diagonal', 'diff', 'digitize', 'disp', 'divide',
- 'dot', 'dsplit', 'dstack', 'dtype', 'dump', 'dumps', 'ediff1d', 'empty',
- 'empty_like', 'equal', 'exp', 'expand_dims', 'expm1', 'extract', 'eye',
- 'fabs', 'fastCopyAndTranspose', 'fft', 'fftfreq', 'fftshift', 'fill',
- 'finfo', 'fix', 'flat', 'flatnonzero', 'flatten', 'fliplr', 'flipud',
- 'floor', 'floor_divide', 'fmod', 'frexp', 'fromarrays', 'frombuffer',
- 'fromfile', 'fromfunction', 'fromiter', 'frompyfunc', 'fromstring',
- 'generic', 'get_array_wrap', 'get_include', 'get_numarray_include',
- 'get_numpy_include', 'get_printoptions', 'getbuffer', 'getbufsize',
- 'geterr', 'geterrcall', 'geterrobj', 'getfield', 'gradient', 'greater',
- 'greater_equal', 'gumbel', 'hamming', 'hanning', 'histogram',
- 'histogram2d', 'histogramdd', 'hsplit', 'hstack', 'hypot', 'i0',
- 'identity', 'ifft', 'imag', 'index_exp', 'indices', 'inf', 'info',
- 'inner', 'insert', 'int_asbuffer', 'interp', 'intersect1d',
- 'intersect1d_nu', 'inv', 'invert', 'iscomplex', 'iscomplexobj',
- 'isfinite', 'isfortran', 'isinf', 'isnan', 'isneginf', 'isposinf',
- 'isreal', 'isrealobj', 'isscalar', 'issctype', 'issubclass_',
- 'issubdtype', 'issubsctype', 'item', 'itemset', 'iterable', 'ix_',
- 'kaiser', 'kron', 'ldexp', 'left_shift', 'less', 'less_equal', 'lexsort',
- 'linspace', 'load', 'loads', 'loadtxt', 'log', 'log10', 'log1p', 'log2',
- 'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'logspace',
- 'lstsq', 'mat', 'matrix', 'max', 'maximum', 'maximum_sctype',
- 'may_share_memory', 'mean', 'median', 'meshgrid', 'mgrid', 'min',
- 'minimum', 'mintypecode', 'mod', 'modf', 'msort', 'multiply', 'nan',
- 'nan_to_num', 'nanargmax', 'nanargmin', 'nanmax', 'nanmin', 'nansum',
- 'ndenumerate', 'ndim', 'ndindex', 'negative', 'newaxis', 'newbuffer',
- 'newbyteorder', 'nonzero', 'not_equal', 'obj2sctype', 'ogrid', 'ones',
- 'ones_like', 'outer', 'permutation', 'piecewise', 'pinv', 'pkgload',
- 'place', 'poisson', 'poly', 'poly1d', 'polyadd', 'polyder', 'polydiv',
- 'polyfit', 'polyint', 'polymul', 'polysub', 'polyval', 'power', 'prod',
- 'product', 'ptp', 'put', 'putmask', 'r_', 'randint', 'random_integers',
- 'random_sample', 'ranf', 'rank', 'ravel', 'real', 'real_if_close',
- 'recarray', 'reciprocal', 'reduce', 'remainder', 'repeat', 'require',
- 'reshape', 'resize', 'restoredot', 'right_shift', 'rint', 'roll',
- 'rollaxis', 'roots', 'rot90', 'round', 'round_', 'row_stack', 's_',
- 'sample', 'savetxt', 'sctype2char', 'searchsorted', 'seed', 'select',
- 'set_numeric_ops', 'set_printoptions', 'set_string_function',
- 'setbufsize', 'setdiff1d', 'seterr', 'seterrcall', 'seterrobj',
- 'setfield', 'setflags', 'setmember1d', 'setxor1d', 'shape',
- 'show_config', 'shuffle', 'sign', 'signbit', 'sin', 'sinc', 'sinh',
- 'size', 'slice', 'solve', 'sometrue', 'sort', 'sort_complex', 'source',
- 'split', 'sqrt', 'square', 'squeeze', 'standard_normal', 'std',
- 'subtract', 'sum', 'svd', 'swapaxes', 'take', 'tan', 'tanh', 'tensordot',
- 'test', 'tile', 'tofile', 'tolist', 'tostring', 'trace', 'transpose',
- 'trapz', 'tri', 'tril', 'trim_zeros', 'triu', 'true_divide', 'typeDict',
- 'typename', 'uniform', 'union1d', 'unique', 'unique1d', 'unravel_index',
- 'unwrap', 'vander', 'var', 'vdot', 'vectorize', 'view', 'vonmises',
- 'vsplit', 'vstack', 'weibull', 'where', 'who', 'zeros', 'zeros_like'
- ))
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in \
- PythonLexer.get_tokens_unprocessed(self, text):
- if token is Name and value in self.EXTRA_KEYWORDS:
- yield index, Keyword.Pseudo, value
- else:
- yield index, token, value
-
- def analyse_text(text):
- return (shebang_matches(text, r'pythonw?(2(\.\d)?)?') or
- 'import ' in text[:1000]) \
- and ('import numpy' in text or 'from numpy import' in text)
diff --git a/pygments/lexers/qvt.py b/pygments/lexers/qvt.py
deleted file mode 100644
index b1c1495c..00000000
--- a/pygments/lexers/qvt.py
+++ /dev/null
@@ -1,152 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.qvt
- ~~~~~~~~~~~~~~~~~~~
-
- Lexer for QVT Operational language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups, include, combined, default, \
- words
-from pygments.token import Text, Comment, Operator, Keyword, Punctuation, \
- Name, String, Number
-
-__all__ = ['QVToLexer']
-
-
-class QVToLexer(RegexLexer):
- u"""
- For the `QVT Operational Mapping language <http://www.omg.org/spec/QVT/1.1/>`_.
-
- Reference for implementing this: «Meta Object Facility (MOF) 2.0
- Query/View/Transformation Specification», Version 1.1 - January 2011
- (http://www.omg.org/spec/QVT/1.1/), see §8.4, «Concrete Syntax» in
- particular.
-
- Notable tokens assignments:
-
- - Name.Class is assigned to the identifier following any of the following
- keywords: metamodel, class, exception, primitive, enum, transformation
- or library
-
- - Name.Function is assigned to the names of mappings and queries
-
- - Name.Builtin.Pseudo is assigned to the pre-defined variables 'this',
- 'self' and 'result'.
- """
- # With obvious borrowings & inspiration from the Java, Python and C lexers
-
- name = 'QVTO'
- aliases = ['qvto', 'qvt']
- filenames = ['*.qvto']
-
- tokens = {
- 'root': [
- (r'\n', Text),
- (r'[^\S\n]+', Text),
- (r'(--|//)(\s*)(directive:)?(.*)$',
- bygroups(Comment, Comment, Comment.Preproc, Comment)),
- # Uncomment the following if you want to distinguish between
- # '/*' and '/**', à la javadoc
- # (r'/[*]{2}(.|\n)*?[*]/', Comment.Multiline),
- (r'/[*](.|\n)*?[*]/', Comment.Multiline),
- (r'\\\n', Text),
- (r'(and|not|or|xor|##?)\b', Operator.Word),
- (r'(:{1,2}=|[-+]=)\b', Operator.Word),
- (r'(@|<<|>>)\b', Keyword), # stereotypes
- (r'!=|<>|==|=|!->|->|>=|<=|[.]{3}|[+/*%=<>&|.~]', Operator),
- (r'[]{}:(),;[]', Punctuation),
- (r'(true|false|unlimited|null)\b', Keyword.Constant),
- (r'(this|self|result)\b', Name.Builtin.Pseudo),
- (r'(var)\b', Keyword.Declaration),
- (r'(from|import)\b', Keyword.Namespace, 'fromimport'),
- (r'(metamodel|class|exception|primitive|enum|transformation|'
- r'library)(\s+)(\w+)',
- bygroups(Keyword.Word, Text, Name.Class)),
- (r'(exception)(\s+)(\w+)',
- bygroups(Keyword.Word, Text, Name.Exception)),
- (r'(main)\b', Name.Function),
- (r'(mapping|helper|query)(\s+)',
- bygroups(Keyword.Declaration, Text), 'operation'),
- (r'(assert)(\s+)\b', bygroups(Keyword, Text), 'assert'),
- (r'(Bag|Collection|Dict|OrderedSet|Sequence|Set|Tuple|List)\b',
- Keyword.Type),
- include('keywords'),
- ('"', String, combined('stringescape', 'dqs')),
- ("'", String, combined('stringescape', 'sqs')),
- include('name'),
- include('numbers'),
- # (r'([a-zA-Z_]\w*)(::)([a-zA-Z_]\w*)',
- # bygroups(Text, Text, Text)),
- ],
-
- 'fromimport': [
- (r'(?:[ \t]|\\\n)+', Text),
- (r'[a-zA-Z_][\w.]*', Name.Namespace),
- default('#pop'),
- ],
-
- 'operation': [
- (r'::', Text),
- (r'(.*::)([a-zA-Z_]\w*)([ \t]*)(\()',
- bygroups(Text, Name.Function, Text, Punctuation), '#pop')
- ],
-
- 'assert': [
- (r'(warning|error|fatal)\b', Keyword, '#pop'),
- default('#pop'), # all else: go back
- ],
-
- 'keywords': [
- (words((
- 'abstract', 'access', 'any', 'assert', 'blackbox', 'break',
- 'case', 'collect', 'collectNested', 'collectOne', 'collectselect',
- 'collectselectOne', 'composes', 'compute', 'configuration',
- 'constructor', 'continue', 'datatype', 'default', 'derived',
- 'disjuncts', 'do', 'elif', 'else', 'end', 'endif', 'except',
- 'exists', 'extends', 'forAll', 'forEach', 'forOne', 'from', 'if',
- 'implies', 'in', 'inherits', 'init', 'inout', 'intermediate',
- 'invresolve', 'invresolveIn', 'invresolveone', 'invresolveoneIn',
- 'isUnique', 'iterate', 'late', 'let', 'literal', 'log', 'map',
- 'merges', 'modeltype', 'new', 'object', 'one', 'ordered', 'out',
- 'package', 'population', 'property', 'raise', 'readonly',
- 'references', 'refines', 'reject', 'resolve', 'resolveIn',
- 'resolveone', 'resolveoneIn', 'return', 'select', 'selectOne',
- 'sortedBy', 'static', 'switch', 'tag', 'then', 'try', 'typedef',
- 'unlimited', 'uses', 'when', 'where', 'while', 'with', 'xcollect',
- 'xmap', 'xselect'), suffix=r'\b'), Keyword),
- ],
-
- # There is no need to distinguish between String.Single and
- # String.Double: 'strings' is factorised for 'dqs' and 'sqs'
- 'strings': [
- (r'[^\\\'"\n]+', String),
- # quotes, percents and backslashes must be parsed one at a time
- (r'[\'"\\]', String),
- ],
- 'stringescape': [
- (r'\\([\\btnfr"\']|u[0-3][0-7]{2}|u[0-7]{1,2})', String.Escape)
- ],
- 'dqs': [ # double-quoted string
- (r'"', String, '#pop'),
- (r'\\\\|\\"', String.Escape),
- include('strings')
- ],
- 'sqs': [ # single-quoted string
- (r"'", String, '#pop'),
- (r"\\\\|\\'", String.Escape),
- include('strings')
- ],
- 'name': [
- (r'[a-zA-Z_]\w*', Name),
- ],
- # numbers: excerpt taken from the python lexer
- 'numbers': [
- (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
- (r'\d+[eE][+-]?[0-9]+', Number.Float),
- (r'\d+', Number.Integer)
- ],
- }
diff --git a/pygments/lexers/r.py b/pygments/lexers/r.py
deleted file mode 100644
index 8e744599..00000000
--- a/pygments/lexers/r.py
+++ /dev/null
@@ -1,193 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.r
- ~~~~~~~~~~~~~~~~~
-
- Lexers for the R/S languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, include, do_insertions, bygroups
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic
-
-__all__ = ['RConsoleLexer', 'SLexer', 'RdLexer']
-
-
-line_re = re.compile('.*?\n')
-
-
-class RConsoleLexer(Lexer):
- """
- For R console transcripts or R CMD BATCH output files.
- """
-
- name = 'RConsole'
- aliases = ['rconsole', 'rout']
- filenames = ['*.Rout']
-
- def get_tokens_unprocessed(self, text):
- slexer = SLexer(**self.options)
-
- current_code_block = ''
- insertions = []
-
- for match in line_re.finditer(text):
- line = match.group()
- if line.startswith('>') or line.startswith('+'):
- # Colorize the prompt as such,
- # then put rest of line into current_code_block
- insertions.append((len(current_code_block),
- [(0, Generic.Prompt, line[:2])]))
- current_code_block += line[2:]
- else:
- # We have reached a non-prompt line!
- # If we have stored prompt lines, need to process them first.
- if current_code_block:
- # Weave together the prompts and highlight code.
- for item in do_insertions(
- insertions, slexer.get_tokens_unprocessed(current_code_block)):
- yield item
- # Reset vars for next code block.
- current_code_block = ''
- insertions = []
- # Now process the actual line itself, this is output from R.
- yield match.start(), Generic.Output, line
-
- # If we happen to end on a code block with nothing after it, need to
- # process the last code block. This is neither elegant nor DRY so
- # should be changed.
- if current_code_block:
- for item in do_insertions(
- insertions, slexer.get_tokens_unprocessed(current_code_block)):
- yield item
-
-
-class SLexer(RegexLexer):
- """
- For S, S-plus, and R source code.
-
- .. versionadded:: 0.10
- """
-
- name = 'S'
- aliases = ['splus', 's', 'r']
- filenames = ['*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron']
- mimetypes = ['text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r',
- 'text/x-R', 'text/x-r-history', 'text/x-r-profile']
-
- valid_name = r'(?:`[^`\\]*(?:\\.[^`\\]*)*`)|(?:(?:[a-zA-z]|[_.][^0-9])[\w_.]*)'
- tokens = {
- 'comments': [
- (r'#.*$', Comment.Single),
- ],
- 'valid_name': [
- (valid_name, Name),
- ],
- 'punctuation': [
- (r'\[{1,2}|\]{1,2}|\(|\)|;|,', Punctuation),
- ],
- 'keywords': [
- (r'(if|else|for|while|repeat|in|next|break|return|switch|function)'
- r'(?![\w.])',
- Keyword.Reserved),
- ],
- 'operators': [
- (r'<<?-|->>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\?', Operator),
- (r'\*|\+|\^|/|!|%[^%]*%|=|~|\$|@|:{1,3}', Operator),
- ],
- 'builtin_symbols': [
- (r'(NULL|NA(_(integer|real|complex|character)_)?|'
- r'letters|LETTERS|Inf|TRUE|FALSE|NaN|pi|\.\.(\.|[0-9]+))'
- r'(?![\w.])',
- Keyword.Constant),
- (r'(T|F)\b', Name.Builtin.Pseudo),
- ],
- 'numbers': [
- # hex number
- (r'0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?', Number.Hex),
- # decimal number
- (r'[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)([eE][+-]?[0-9]+)?[Li]?',
- Number),
- ],
- 'statements': [
- include('comments'),
- # whitespaces
- (r'\s+', Text),
- (r'\'', String, 'string_squote'),
- (r'\"', String, 'string_dquote'),
- include('builtin_symbols'),
- include('valid_name'),
- include('numbers'),
- include('keywords'),
- include('punctuation'),
- include('operators'),
- ],
- 'root': [
- # calls:
- (r'(%s)\s*(?=\()' % valid_name, Name.Function),
- include('statements'),
- # blocks:
- (r'\{|\}', Punctuation),
- # (r'\{', Punctuation, 'block'),
- (r'.', Text),
- ],
- # 'block': [
- # include('statements'),
- # ('\{', Punctuation, '#push'),
- # ('\}', Punctuation, '#pop')
- # ],
- 'string_squote': [
- (r'([^\'\\]|\\.)*\'', String, '#pop'),
- ],
- 'string_dquote': [
- (r'([^"\\]|\\.)*"', String, '#pop'),
- ],
- }
-
- def analyse_text(text):
- if re.search(r'[a-z0-9_\])\s]<-(?!-)', text):
- return 0.11
-
-
-class RdLexer(RegexLexer):
- """
- Pygments Lexer for R documentation (Rd) files
-
- This is a very minimal implementation, highlighting little more
- than the macros. A description of Rd syntax is found in `Writing R
- Extensions <http://cran.r-project.org/doc/manuals/R-exts.html>`_
- and `Parsing Rd files <http://developer.r-project.org/parseRd.pdf>`_.
-
- .. versionadded:: 1.6
- """
- name = 'Rd'
- aliases = ['rd']
- filenames = ['*.Rd']
- mimetypes = ['text/x-r-doc']
-
- # To account for verbatim / LaTeX-like / and R-like areas
- # would require parsing.
- tokens = {
- 'root': [
- # catch escaped brackets and percent sign
- (r'\\[\\{}%]', String.Escape),
- # comments
- (r'%.*$', Comment),
- # special macros with no arguments
- (r'\\(?:cr|l?dots|R|tab)\b', Keyword.Constant),
- # macros
- (r'\\[a-zA-Z]+\b', Keyword),
- # special preprocessor macros
- (r'^\s*#(?:ifn?def|endif).*\b', Comment.Preproc),
- # non-escaped brackets
- (r'[{}]', Name.Builtin),
- # everything else
- (r'[^\\%\n{}]+', Text),
- (r'.', Text),
- ]
- }
diff --git a/pygments/lexers/rdf.py b/pygments/lexers/rdf.py
deleted file mode 100644
index 5927a686..00000000
--- a/pygments/lexers/rdf.py
+++ /dev/null
@@ -1,423 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.rdf
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for semantic web and RDF query languages and markup.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, default
-from pygments.token import Keyword, Punctuation, String, Number, Operator, Generic, \
- Whitespace, Name, Literal, Comment, Text
-
-__all__ = ['SparqlLexer', 'TurtleLexer', 'ShExCLexer']
-
-
-class SparqlLexer(RegexLexer):
- """
- Lexer for `SPARQL <http://www.w3.org/TR/rdf-sparql-query/>`_ query language.
-
- .. versionadded:: 2.0
- """
- name = 'SPARQL'
- aliases = ['sparql']
- filenames = ['*.rq', '*.sparql']
- mimetypes = ['application/sparql-query']
-
- # character group definitions ::
-
- PN_CHARS_BASE_GRP = (u'a-zA-Z'
- u'\u00c0-\u00d6'
- u'\u00d8-\u00f6'
- u'\u00f8-\u02ff'
- u'\u0370-\u037d'
- u'\u037f-\u1fff'
- u'\u200c-\u200d'
- u'\u2070-\u218f'
- u'\u2c00-\u2fef'
- u'\u3001-\ud7ff'
- u'\uf900-\ufdcf'
- u'\ufdf0-\ufffd')
-
- PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_')
-
- PN_CHARS_GRP = (PN_CHARS_U_GRP +
- r'\-' +
- r'0-9' +
- u'\u00b7' +
- u'\u0300-\u036f' +
- u'\u203f-\u2040')
-
- HEX_GRP = '0-9A-Fa-f'
-
- PN_LOCAL_ESC_CHARS_GRP = r' _~.\-!$&"()*+,;=/?#@%'
-
- # terminal productions ::
-
- PN_CHARS_BASE = '[' + PN_CHARS_BASE_GRP + ']'
-
- PN_CHARS_U = '[' + PN_CHARS_U_GRP + ']'
-
- PN_CHARS = '[' + PN_CHARS_GRP + ']'
-
- HEX = '[' + HEX_GRP + ']'
-
- PN_LOCAL_ESC_CHARS = '[' + PN_LOCAL_ESC_CHARS_GRP + ']'
-
- IRIREF = r'<(?:[^<>"{}|^`\\\x00-\x20])*>'
-
- BLANK_NODE_LABEL = '_:[0-9' + PN_CHARS_U_GRP + '](?:[' + PN_CHARS_GRP + \
- '.]*' + PN_CHARS + ')?'
-
- PN_PREFIX = PN_CHARS_BASE + '(?:[' + PN_CHARS_GRP + '.]*' + PN_CHARS + ')?'
-
- VARNAME = u'[0-9' + PN_CHARS_U_GRP + '][' + PN_CHARS_U_GRP + \
- u'0-9\u00b7\u0300-\u036f\u203f-\u2040]*'
-
- PERCENT = '%' + HEX + HEX
-
- PN_LOCAL_ESC = r'\\' + PN_LOCAL_ESC_CHARS
-
- PLX = '(?:' + PERCENT + ')|(?:' + PN_LOCAL_ESC + ')'
-
- PN_LOCAL = ('(?:[' + PN_CHARS_U_GRP + ':0-9' + ']|' + PLX + ')' +
- '(?:(?:[' + PN_CHARS_GRP + '.:]|' + PLX + ')*(?:[' +
- PN_CHARS_GRP + ':]|' + PLX + '))?')
-
- EXPONENT = r'[eE][+-]?\d+'
-
- # Lexer token definitions ::
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- # keywords ::
- (r'(?i)(select|construct|describe|ask|where|filter|group\s+by|minus|'
- r'distinct|reduced|from\s+named|from|order\s+by|desc|asc|limit|'
- r'offset|bindings|load|clear|drop|create|add|move|copy|'
- r'insert\s+data|delete\s+data|delete\s+where|delete|insert|'
- r'using\s+named|using|graph|default|named|all|optional|service|'
- r'silent|bind|union|not\s+in|in|as|having|to|prefix|base)\b', Keyword),
- (r'(a)\b', Keyword),
- # IRIs ::
- ('(' + IRIREF + ')', Name.Label),
- # blank nodes ::
- ('(' + BLANK_NODE_LABEL + ')', Name.Label),
- # # variables ::
- ('[?$]' + VARNAME, Name.Variable),
- # prefixed names ::
- (r'(' + PN_PREFIX + r')?(\:)(' + PN_LOCAL + r')?',
- bygroups(Name.Namespace, Punctuation, Name.Tag)),
- # function names ::
- (r'(?i)(str|lang|langmatches|datatype|bound|iri|uri|bnode|rand|abs|'
- r'ceil|floor|round|concat|strlen|ucase|lcase|encode_for_uri|'
- r'contains|strstarts|strends|strbefore|strafter|year|month|day|'
- r'hours|minutes|seconds|timezone|tz|now|md5|sha1|sha256|sha384|'
- r'sha512|coalesce|if|strlang|strdt|sameterm|isiri|isuri|isblank|'
- r'isliteral|isnumeric|regex|substr|replace|exists|not\s+exists|'
- r'count|sum|min|max|avg|sample|group_concat|separator)\b',
- Name.Function),
- # boolean literals ::
- (r'(true|false)', Keyword.Constant),
- # double literals ::
- (r'[+\-]?(\d+\.\d*' + EXPONENT + r'|\.?\d+' + EXPONENT + ')', Number.Float),
- # decimal literals ::
- (r'[+\-]?(\d+\.\d*|\.\d+)', Number.Float),
- # integer literals ::
- (r'[+\-]?\d+', Number.Integer),
- # operators ::
- (r'(\|\||&&|=|\*|\-|\+|/|!=|<=|>=|!|<|>)', Operator),
- # punctuation characters ::
- (r'[(){}.;,:^\[\]]', Punctuation),
- # line comments ::
- (r'#[^\n]*', Comment),
- # strings ::
- (r'"""', String, 'triple-double-quoted-string'),
- (r'"', String, 'single-double-quoted-string'),
- (r"'''", String, 'triple-single-quoted-string'),
- (r"'", String, 'single-single-quoted-string'),
- ],
- 'triple-double-quoted-string': [
- (r'"""', String, 'end-of-string'),
- (r'[^\\]+', String),
- (r'\\', String, 'string-escape'),
- ],
- 'single-double-quoted-string': [
- (r'"', String, 'end-of-string'),
- (r'[^"\\\n]+', String),
- (r'\\', String, 'string-escape'),
- ],
- 'triple-single-quoted-string': [
- (r"'''", String, 'end-of-string'),
- (r'[^\\]+', String),
- (r'\\', String.Escape, 'string-escape'),
- ],
- 'single-single-quoted-string': [
- (r"'", String, 'end-of-string'),
- (r"[^'\\\n]+", String),
- (r'\\', String, 'string-escape'),
- ],
- 'string-escape': [
- (r'u' + HEX + '{4}', String.Escape, '#pop'),
- (r'U' + HEX + '{8}', String.Escape, '#pop'),
- (r'.', String.Escape, '#pop'),
- ],
- 'end-of-string': [
- (r'(@)([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)',
- bygroups(Operator, Name.Function), '#pop:2'),
- (r'\^\^', Operator, '#pop:2'),
- default('#pop:2'),
- ],
- }
-
-
-class TurtleLexer(RegexLexer):
- """
- Lexer for `Turtle <http://www.w3.org/TR/turtle/>`_ data language.
-
- .. versionadded:: 2.1
- """
- name = 'Turtle'
- aliases = ['turtle']
- filenames = ['*.ttl']
- mimetypes = ['text/turtle', 'application/x-turtle']
-
- flags = re.IGNORECASE
-
- patterns = {
- 'PNAME_NS': r'((?:[a-z][\w-]*)?\:)', # Simplified character range
- 'IRIREF': r'(<[^<>"{}|^`\\\x00-\x20]*>)'
- }
-
- # PNAME_NS PN_LOCAL (with simplified character range)
- patterns['PrefixedName'] = r'%(PNAME_NS)s([a-z][\w-]*)' % patterns
-
- tokens = {
- 'root': [
- (r'\s+', Whitespace),
-
- # Base / prefix
- (r'(@base|BASE)(\s+)%(IRIREF)s(\s*)(\.?)' % patterns,
- bygroups(Keyword, Whitespace, Name.Variable, Whitespace,
- Punctuation)),
- (r'(@prefix|PREFIX)(\s+)%(PNAME_NS)s(\s+)%(IRIREF)s(\s*)(\.?)' % patterns,
- bygroups(Keyword, Whitespace, Name.Namespace, Whitespace,
- Name.Variable, Whitespace, Punctuation)),
-
- # The shorthand predicate 'a'
- (r'(?<=\s)a(?=\s)', Keyword.Type),
-
- # IRIREF
- (r'%(IRIREF)s' % patterns, Name.Variable),
-
- # PrefixedName
- (r'%(PrefixedName)s' % patterns,
- bygroups(Name.Namespace, Name.Tag)),
-
- # Comment
- (r'#[^\n]+', Comment),
-
- (r'\b(true|false)\b', Literal),
- (r'[+\-]?\d*\.\d+', Number.Float),
- (r'[+\-]?\d*(:?\.\d+)?E[+\-]?\d+', Number.Float),
- (r'[+\-]?\d+', Number.Integer),
- (r'[\[\](){}.;,:^]', Punctuation),
-
- (r'"""', String, 'triple-double-quoted-string'),
- (r'"', String, 'single-double-quoted-string'),
- (r"'''", String, 'triple-single-quoted-string'),
- (r"'", String, 'single-single-quoted-string'),
- ],
- 'triple-double-quoted-string': [
- (r'"""', String, 'end-of-string'),
- (r'[^\\]+', String),
- (r'\\', String, 'string-escape'),
- ],
- 'single-double-quoted-string': [
- (r'"', String, 'end-of-string'),
- (r'[^"\\\n]+', String),
- (r'\\', String, 'string-escape'),
- ],
- 'triple-single-quoted-string': [
- (r"'''", String, 'end-of-string'),
- (r'[^\\]+', String),
- (r'\\', String, 'string-escape'),
- ],
- 'single-single-quoted-string': [
- (r"'", String, 'end-of-string'),
- (r"[^'\\\n]+", String),
- (r'\\', String, 'string-escape'),
- ],
- 'string-escape': [
- (r'.', String, '#pop'),
- ],
- 'end-of-string': [
- (r'(@)([a-z]+(:?-[a-z0-9]+)*)',
- bygroups(Operator, Generic.Emph), '#pop:2'),
-
- (r'(\^\^)%(IRIREF)s' % patterns, bygroups(Operator, Generic.Emph), '#pop:2'),
- (r'(\^\^)%(PrefixedName)s' % patterns,
- bygroups(Operator, Generic.Emph, Generic.Emph), '#pop:2'),
-
- default('#pop:2'),
-
- ],
- }
-
- # Turtle and Tera Term macro files share the same file extension
- # but each has a recognizable and distinct syntax.
- def analyse_text(text):
- for t in ('@base ', 'BASE ', '@prefix ', 'PREFIX '):
- if re.search(r'^\s*%s' % t, text):
- return 0.80
-
-
-class ShExCLexer(RegexLexer):
- """
- Lexer for `ShExC <https://shex.io/shex-semantics/#shexc>`_ shape expressions language syntax.
- """
- name = 'ShExC'
- aliases = ['shexc', 'shex']
- filenames = ['*.shex']
- mimetypes = ['text/shex']
-
- # character group definitions ::
-
- PN_CHARS_BASE_GRP = (u'a-zA-Z'
- u'\u00c0-\u00d6'
- u'\u00d8-\u00f6'
- u'\u00f8-\u02ff'
- u'\u0370-\u037d'
- u'\u037f-\u1fff'
- u'\u200c-\u200d'
- u'\u2070-\u218f'
- u'\u2c00-\u2fef'
- u'\u3001-\ud7ff'
- u'\uf900-\ufdcf'
- u'\ufdf0-\ufffd')
-
- PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_')
-
- PN_CHARS_GRP = (PN_CHARS_U_GRP +
- r'\-' +
- r'0-9' +
- u'\u00b7' +
- u'\u0300-\u036f' +
- u'\u203f-\u2040')
-
- HEX_GRP = '0-9A-Fa-f'
-
- PN_LOCAL_ESC_CHARS_GRP = r"_~.\-!$&'()*+,;=/?#@%"
-
- # terminal productions ::
-
- PN_CHARS_BASE = '[' + PN_CHARS_BASE_GRP + ']'
-
- PN_CHARS_U = '[' + PN_CHARS_U_GRP + ']'
-
- PN_CHARS = '[' + PN_CHARS_GRP + ']'
-
- HEX = '[' + HEX_GRP + ']'
-
- PN_LOCAL_ESC_CHARS = '[' + PN_LOCAL_ESC_CHARS_GRP + ']'
-
- UCHAR_NO_BACKSLASH = '(?:u' + HEX + '{4}|U' + HEX + '{8})'
-
- UCHAR = r'\\' + UCHAR_NO_BACKSLASH
-
- IRIREF = r'<(?:[^\x00-\x20<>"{}|^`\\]|' + UCHAR + ')*>'
-
- BLANK_NODE_LABEL = '_:[0-9' + PN_CHARS_U_GRP + '](?:[' + PN_CHARS_GRP + \
- '.]*' + PN_CHARS + ')?'
-
- PN_PREFIX = PN_CHARS_BASE + '(?:[' + PN_CHARS_GRP + '.]*' + PN_CHARS + ')?'
-
- PERCENT = '%' + HEX + HEX
-
- PN_LOCAL_ESC = r'\\' + PN_LOCAL_ESC_CHARS
-
- PLX = '(?:' + PERCENT + ')|(?:' + PN_LOCAL_ESC + ')'
-
- PN_LOCAL = ('(?:[' + PN_CHARS_U_GRP + ':0-9' + ']|' + PLX + ')' +
- '(?:(?:[' + PN_CHARS_GRP + '.:]|' + PLX + ')*(?:[' +
- PN_CHARS_GRP + ':]|' + PLX + '))?')
-
- EXPONENT = r'[eE][+-]?\d+'
-
- # Lexer token definitions ::
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- # keywords ::
- (r'(?i)(base|prefix|start|external|'
- r'literal|iri|bnode|nonliteral|length|minlength|maxlength|'
- r'mininclusive|minexclusive|maxinclusive|maxexclusive|'
- r'totaldigits|fractiondigits|'
- r'closed|extra)\b', Keyword),
- (r'(a)\b', Keyword),
- # IRIs ::
- ('(' + IRIREF + ')', Name.Label),
- # blank nodes ::
- ('(' + BLANK_NODE_LABEL + ')', Name.Label),
- # prefixed names ::
- (r'(' + PN_PREFIX + r')?(\:)(' + PN_LOCAL + ')?',
- bygroups(Name.Namespace, Punctuation, Name.Tag)),
- # boolean literals ::
- (r'(true|false)', Keyword.Constant),
- # double literals ::
- (r'[+\-]?(\d+\.\d*' + EXPONENT + r'|\.?\d+' + EXPONENT + ')', Number.Float),
- # decimal literals ::
- (r'[+\-]?(\d+\.\d*|\.\d+)', Number.Float),
- # integer literals ::
- (r'[+\-]?\d+', Number.Integer),
- # operators ::
- (r'[@|$&=*+?^\-~]', Operator),
- # operator keywords ::
- (r'(?i)(and|or|not)\b', Operator.Word),
- # punctuation characters ::
- (r'[(){}.;,:^\[\]]', Punctuation),
- # line comments ::
- (r'#[^\n]*', Comment),
- # strings ::
- (r'"""', String, 'triple-double-quoted-string'),
- (r'"', String, 'single-double-quoted-string'),
- (r"'''", String, 'triple-single-quoted-string'),
- (r"'", String, 'single-single-quoted-string'),
- ],
- 'triple-double-quoted-string': [
- (r'"""', String, 'end-of-string'),
- (r'[^\\]+', String),
- (r'\\', String, 'string-escape'),
- ],
- 'single-double-quoted-string': [
- (r'"', String, 'end-of-string'),
- (r'[^"\\\n]+', String),
- (r'\\', String, 'string-escape'),
- ],
- 'triple-single-quoted-string': [
- (r"'''", String, 'end-of-string'),
- (r'[^\\]+', String),
- (r'\\', String.Escape, 'string-escape'),
- ],
- 'single-single-quoted-string': [
- (r"'", String, 'end-of-string'),
- (r"[^'\\\n]+", String),
- (r'\\', String, 'string-escape'),
- ],
- 'string-escape': [
- (UCHAR_NO_BACKSLASH, String.Escape, '#pop'),
- (r'.', String.Escape, '#pop'),
- ],
- 'end-of-string': [
- (r'(@)([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)',
- bygroups(Operator, Name.Function), '#pop:2'),
- (r'\^\^', Operator, '#pop:2'),
- default('#pop:2'),
- ],
- }
diff --git a/pygments/lexers/rebol.py b/pygments/lexers/rebol.py
deleted file mode 100644
index 1b3d90f5..00000000
--- a/pygments/lexers/rebol.py
+++ /dev/null
@@ -1,431 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.rebol
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the REBOL and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Generic, Whitespace
-
-__all__ = ['RebolLexer', 'RedLexer']
-
-
-class RebolLexer(RegexLexer):
- """
- A `REBOL <http://www.rebol.com/>`_ lexer.
-
- .. versionadded:: 1.1
- """
- name = 'REBOL'
- aliases = ['rebol']
- filenames = ['*.r', '*.r3', '*.reb']
- mimetypes = ['text/x-rebol']
-
- flags = re.IGNORECASE | re.MULTILINE
-
- escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)'
-
- def word_callback(lexer, match):
- word = match.group()
-
- if re.match(".*:$", word):
- yield match.start(), Generic.Subheading, word
- elif re.match(
- r'(native|alias|all|any|as-string|as-binary|bind|bound\?|case|'
- r'catch|checksum|comment|debase|dehex|exclude|difference|disarm|'
- r'either|else|enbase|foreach|remove-each|form|free|get|get-env|if|'
- r'in|intersect|loop|minimum-of|maximum-of|mold|new-line|'
- r'new-line\?|not|now|prin|print|reduce|compose|construct|repeat|'
- r'reverse|save|script\?|set|shift|switch|throw|to-hex|trace|try|'
- r'type\?|union|unique|unless|unprotect|unset|until|use|value\?|'
- r'while|compress|decompress|secure|open|close|read|read-io|'
- r'write-io|write|update|query|wait|input\?|exp|log-10|log-2|'
- r'log-e|square-root|cosine|sine|tangent|arccosine|arcsine|'
- r'arctangent|protect|lowercase|uppercase|entab|detab|connected\?|'
- r'browse|launch|stats|get-modes|set-modes|to-local-file|'
- r'to-rebol-file|encloak|decloak|create-link|do-browser|bind\?|'
- r'hide|draw|show|size-text|textinfo|offset-to-caret|'
- r'caret-to-offset|local-request-file|rgb-to-hsv|hsv-to-rgb|'
- r'crypt-strength\?|dh-make-key|dh-generate-key|dh-compute-key|'
- r'dsa-make-key|dsa-generate-key|dsa-make-signature|'
- r'dsa-verify-signature|rsa-make-key|rsa-generate-key|'
- r'rsa-encrypt)$', word):
- yield match.start(), Name.Builtin, word
- elif re.match(
- r'(add|subtract|multiply|divide|remainder|power|and~|or~|xor~|'
- r'minimum|maximum|negate|complement|absolute|random|head|tail|'
- r'next|back|skip|at|pick|first|second|third|fourth|fifth|sixth|'
- r'seventh|eighth|ninth|tenth|last|path|find|select|make|to|copy\*|'
- r'insert|remove|change|poke|clear|trim|sort|min|max|abs|cp|'
- r'copy)$', word):
- yield match.start(), Name.Function, word
- elif re.match(
- r'(error|source|input|license|help|install|echo|Usage|with|func|'
- r'throw-on-error|function|does|has|context|probe|\?\?|as-pair|'
- r'mod|modulo|round|repend|about|set-net|append|join|rejoin|reform|'
- r'remold|charset|array|replace|move|extract|forskip|forall|alter|'
- r'first+|also|take|for|forever|dispatch|attempt|what-dir|'
- r'change-dir|clean-path|list-dir|dirize|rename|split-path|delete|'
- r'make-dir|delete-dir|in-dir|confirm|dump-obj|upgrade|what|'
- r'build-tag|process-source|build-markup|decode-cgi|read-cgi|'
- r'write-user|save-user|set-user-name|protect-system|parse-xml|'
- r'cvs-date|cvs-version|do-boot|get-net-info|desktop|layout|'
- r'scroll-para|get-face|alert|set-face|uninstall|unfocus|'
- r'request-dir|center-face|do-events|net-error|decode-url|'
- r'parse-header|parse-header-date|parse-email-addrs|import-email|'
- r'send|build-attach-body|resend|show-popup|hide-popup|open-events|'
- r'find-key-face|do-face|viewtop|confine|find-window|'
- r'insert-event-func|remove-event-func|inform|dump-pane|dump-face|'
- r'flag-face|deflag-face|clear-fields|read-net|vbug|path-thru|'
- r'read-thru|load-thru|do-thru|launch-thru|load-image|'
- r'request-download|do-face-alt|set-font|set-para|get-style|'
- r'set-style|make-face|stylize|choose|hilight-text|hilight-all|'
- r'unlight-text|focus|scroll-drag|clear-face|reset-face|scroll-face|'
- r'resize-face|load-stock|load-stock-block|notify|request|flash|'
- r'request-color|request-pass|request-text|request-list|'
- r'request-date|request-file|dbug|editor|link-relative-path|'
- r'emailer|parse-error)$', word):
- yield match.start(), Keyword.Namespace, word
- elif re.match(
- r'(halt|quit|do|load|q|recycle|call|run|ask|parse|view|unview|'
- r'return|exit|break)$', word):
- yield match.start(), Name.Exception, word
- elif re.match('REBOL$', word):
- yield match.start(), Generic.Heading, word
- elif re.match("to-.*", word):
- yield match.start(), Keyword, word
- elif re.match(r'(\+|-|\*|/|//|\*\*|and|or|xor|=\?|=|==|<>|<|>|<=|>=)$',
- word):
- yield match.start(), Operator, word
- elif re.match(r".*\?$", word):
- yield match.start(), Keyword, word
- elif re.match(r".*\!$", word):
- yield match.start(), Keyword.Type, word
- elif re.match("'.*", word):
- yield match.start(), Name.Variable.Instance, word # lit-word
- elif re.match("#.*", word):
- yield match.start(), Name.Label, word # issue
- elif re.match("%.*", word):
- yield match.start(), Name.Decorator, word # file
- else:
- yield match.start(), Name.Variable, word
-
- tokens = {
- 'root': [
- (r'[^R]+', Comment),
- (r'REBOL\s+\[', Generic.Strong, 'script'),
- (r'R', Comment)
- ],
- 'script': [
- (r'\s+', Text),
- (r'#"', String.Char, 'char'),
- (r'#\{[0-9a-f]*\}', Number.Hex),
- (r'2#\{', Number.Hex, 'bin2'),
- (r'64#\{[0-9a-z+/=\s]*\}', Number.Hex),
- (r'"', String, 'string'),
- (r'\{', String, 'string2'),
- (r';#+.*\n', Comment.Special),
- (r';\*+.*\n', Comment.Preproc),
- (r';.*\n', Comment),
- (r'%"', Name.Decorator, 'stringFile'),
- (r'%[^(^{")\s\[\]]+', Name.Decorator),
- (r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money
- (r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time
- (r'\d+[\-/][0-9a-z]+[\-/]\d+(\/\d+\:\d+((\:\d+)?'
- r'([.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date
- (r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple
- (r'\d+X\d+', Keyword.Constant), # pair
- (r'[+-]?\d+(\'\d+)?([.,]\d*)?E[+-]?\d+', Number.Float),
- (r'[+-]?\d+(\'\d+)?[.,]\d*', Number.Float),
- (r'[+-]?\d+(\'\d+)?', Number),
- (r'[\[\]()]', Generic.Strong),
- (r'[a-z]+[^(^{"\s:)]*://[^(^{"\s)]*', Name.Decorator), # url
- (r'mailto:[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # url
- (r'[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # email
- (r'comment\s"', Comment, 'commentString1'),
- (r'comment\s\{', Comment, 'commentString2'),
- (r'comment\s\[', Comment, 'commentBlock'),
- (r'comment\s[^(\s{"\[]+', Comment),
- (r'/[^(^{")\s/[\]]*', Name.Attribute),
- (r'([^(^{")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback),
- (r'<[\w:.-]*>', Name.Tag),
- (r'<[^(<>\s")]+', Name.Tag, 'tag'),
- (r'([^(^{")\s]+)', Text),
- ],
- 'string': [
- (r'[^(^")]+', String),
- (escape_re, String.Escape),
- (r'[(|)]+', String),
- (r'\^.', String.Escape),
- (r'"', String, '#pop'),
- ],
- 'string2': [
- (r'[^(^{})]+', String),
- (escape_re, String.Escape),
- (r'[(|)]+', String),
- (r'\^.', String.Escape),
- (r'\{', String, '#push'),
- (r'\}', String, '#pop'),
- ],
- 'stringFile': [
- (r'[^(^")]+', Name.Decorator),
- (escape_re, Name.Decorator),
- (r'\^.', Name.Decorator),
- (r'"', Name.Decorator, '#pop'),
- ],
- 'char': [
- (escape_re + '"', String.Char, '#pop'),
- (r'\^."', String.Char, '#pop'),
- (r'."', String.Char, '#pop'),
- ],
- 'tag': [
- (escape_re, Name.Tag),
- (r'"', Name.Tag, 'tagString'),
- (r'[^(<>\r\n")]+', Name.Tag),
- (r'>', Name.Tag, '#pop'),
- ],
- 'tagString': [
- (r'[^(^")]+', Name.Tag),
- (escape_re, Name.Tag),
- (r'[(|)]+', Name.Tag),
- (r'\^.', Name.Tag),
- (r'"', Name.Tag, '#pop'),
- ],
- 'tuple': [
- (r'(\d+\.)+', Keyword.Constant),
- (r'\d+', Keyword.Constant, '#pop'),
- ],
- 'bin2': [
- (r'\s+', Number.Hex),
- (r'([01]\s*){8}', Number.Hex),
- (r'\}', Number.Hex, '#pop'),
- ],
- 'commentString1': [
- (r'[^(^")]+', Comment),
- (escape_re, Comment),
- (r'[(|)]+', Comment),
- (r'\^.', Comment),
- (r'"', Comment, '#pop'),
- ],
- 'commentString2': [
- (r'[^(^{})]+', Comment),
- (escape_re, Comment),
- (r'[(|)]+', Comment),
- (r'\^.', Comment),
- (r'\{', Comment, '#push'),
- (r'\}', Comment, '#pop'),
- ],
- 'commentBlock': [
- (r'\[', Comment, '#push'),
- (r'\]', Comment, '#pop'),
- (r'"', Comment, "commentString1"),
- (r'\{', Comment, "commentString2"),
- (r'[^(\[\]"{)]+', Comment),
- ],
- }
-
- def analyse_text(text):
- """
- Check if code contains REBOL header and so it probably not R code
- """
- if re.match(r'^\s*REBOL\s*\[', text, re.IGNORECASE):
- # The code starts with REBOL header
- return 1.0
- elif re.search(r'\s*REBOL\s*\[', text, re.IGNORECASE):
- # The code contains REBOL header but also some text before it
- return 0.5
-
-
-class RedLexer(RegexLexer):
- """
- A `Red-language <http://www.red-lang.org/>`_ lexer.
-
- .. versionadded:: 2.0
- """
- name = 'Red'
- aliases = ['red', 'red/system']
- filenames = ['*.red', '*.reds']
- mimetypes = ['text/x-red', 'text/x-red-system']
-
- flags = re.IGNORECASE | re.MULTILINE
-
- escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)'
-
- def word_callback(lexer, match):
- word = match.group()
-
- if re.match(".*:$", word):
- yield match.start(), Generic.Subheading, word
- elif re.match(r'(if|unless|either|any|all|while|until|loop|repeat|'
- r'foreach|forall|func|function|does|has|switch|'
- r'case|reduce|compose|get|set|print|prin|equal\?|'
- r'not-equal\?|strict-equal\?|lesser\?|greater\?|lesser-or-equal\?|'
- r'greater-or-equal\?|same\?|not|type\?|stats|'
- r'bind|union|replace|charset|routine)$', word):
- yield match.start(), Name.Builtin, word
- elif re.match(r'(make|random|reflect|to|form|mold|absolute|add|divide|multiply|negate|'
- r'power|remainder|round|subtract|even\?|odd\?|and~|complement|or~|xor~|'
- r'append|at|back|change|clear|copy|find|head|head\?|index\?|insert|'
- r'length\?|next|pick|poke|remove|reverse|select|sort|skip|swap|tail|tail\?|'
- r'take|trim|create|close|delete|modify|open|open\?|query|read|rename|'
- r'update|write)$', word):
- yield match.start(), Name.Function, word
- elif re.match(r'(yes|on|no|off|true|false|tab|cr|lf|newline|escape|slash|sp|space|null|'
- r'none|crlf|dot|null-byte)$', word):
- yield match.start(), Name.Builtin.Pseudo, word
- elif re.match(r'(#system-global|#include|#enum|#define|#either|#if|#import|#export|'
- r'#switch|#default|#get-definition)$', word):
- yield match.start(), Keyword.Namespace, word
- elif re.match(r'(system|halt|quit|quit-return|do|load|q|recycle|call|run|ask|parse|'
- r'raise-error|return|exit|break|alias|push|pop|probe|\?\?|spec-of|body-of|'
- r'quote|forever)$', word):
- yield match.start(), Name.Exception, word
- elif re.match(r'(action\?|block\?|char\?|datatype\?|file\?|function\?|get-path\?|zero\?|'
- r'get-word\?|integer\?|issue\?|lit-path\?|lit-word\?|logic\?|native\?|'
- r'op\?|paren\?|path\?|refinement\?|set-path\?|set-word\?|string\?|unset\?|'
- r'any-struct\?|none\?|word\?|any-series\?)$', word):
- yield match.start(), Keyword, word
- elif re.match(r'(JNICALL|stdcall|cdecl|infix)$', word):
- yield match.start(), Keyword.Namespace, word
- elif re.match("to-.*", word):
- yield match.start(), Keyword, word
- elif re.match(r'(\+|-\*\*|-|\*\*|//|/|\*|and|or|xor|=\?|===|==|=|<>|<=|>=|'
- r'<<<|>>>|<<|>>|<|>%)$', word):
- yield match.start(), Operator, word
- elif re.match(r".*\!$", word):
- yield match.start(), Keyword.Type, word
- elif re.match("'.*", word):
- yield match.start(), Name.Variable.Instance, word # lit-word
- elif re.match("#.*", word):
- yield match.start(), Name.Label, word # issue
- elif re.match("%.*", word):
- yield match.start(), Name.Decorator, word # file
- elif re.match(":.*", word):
- yield match.start(), Generic.Subheading, word # get-word
- else:
- yield match.start(), Name.Variable, word
-
- tokens = {
- 'root': [
- (r'[^R]+', Comment),
- (r'Red/System\s+\[', Generic.Strong, 'script'),
- (r'Red\s+\[', Generic.Strong, 'script'),
- (r'R', Comment)
- ],
- 'script': [
- (r'\s+', Text),
- (r'#"', String.Char, 'char'),
- (r'#\{[0-9a-f\s]*\}', Number.Hex),
- (r'2#\{', Number.Hex, 'bin2'),
- (r'64#\{[0-9a-z+/=\s]*\}', Number.Hex),
- (r'([0-9a-f]+)(h)((\s)|(?=[\[\]{}"()]))',
- bygroups(Number.Hex, Name.Variable, Whitespace)),
- (r'"', String, 'string'),
- (r'\{', String, 'string2'),
- (r';#+.*\n', Comment.Special),
- (r';\*+.*\n', Comment.Preproc),
- (r';.*\n', Comment),
- (r'%"', Name.Decorator, 'stringFile'),
- (r'%[^(^{")\s\[\]]+', Name.Decorator),
- (r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money
- (r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time
- (r'\d+[\-/][0-9a-z]+[\-/]\d+(/\d+:\d+((:\d+)?'
- r'([\.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date
- (r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple
- (r'\d+X\d+', Keyword.Constant), # pair
- (r'[+-]?\d+(\'\d+)?([.,]\d*)?E[+-]?\d+', Number.Float),
- (r'[+-]?\d+(\'\d+)?[.,]\d*', Number.Float),
- (r'[+-]?\d+(\'\d+)?', Number),
- (r'[\[\]()]', Generic.Strong),
- (r'[a-z]+[^(^{"\s:)]*://[^(^{"\s)]*', Name.Decorator), # url
- (r'mailto:[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # url
- (r'[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # email
- (r'comment\s"', Comment, 'commentString1'),
- (r'comment\s\{', Comment, 'commentString2'),
- (r'comment\s\[', Comment, 'commentBlock'),
- (r'comment\s[^(\s{"\[]+', Comment),
- (r'/[^(^{^")\s/[\]]*', Name.Attribute),
- (r'([^(^{^")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback),
- (r'<[\w:.-]*>', Name.Tag),
- (r'<[^(<>\s")]+', Name.Tag, 'tag'),
- (r'([^(^{")\s]+)', Text),
- ],
- 'string': [
- (r'[^(^")]+', String),
- (escape_re, String.Escape),
- (r'[(|)]+', String),
- (r'\^.', String.Escape),
- (r'"', String, '#pop'),
- ],
- 'string2': [
- (r'[^(^{})]+', String),
- (escape_re, String.Escape),
- (r'[(|)]+', String),
- (r'\^.', String.Escape),
- (r'\{', String, '#push'),
- (r'\}', String, '#pop'),
- ],
- 'stringFile': [
- (r'[^(^")]+', Name.Decorator),
- (escape_re, Name.Decorator),
- (r'\^.', Name.Decorator),
- (r'"', Name.Decorator, '#pop'),
- ],
- 'char': [
- (escape_re + '"', String.Char, '#pop'),
- (r'\^."', String.Char, '#pop'),
- (r'."', String.Char, '#pop'),
- ],
- 'tag': [
- (escape_re, Name.Tag),
- (r'"', Name.Tag, 'tagString'),
- (r'[^(<>\r\n")]+', Name.Tag),
- (r'>', Name.Tag, '#pop'),
- ],
- 'tagString': [
- (r'[^(^")]+', Name.Tag),
- (escape_re, Name.Tag),
- (r'[(|)]+', Name.Tag),
- (r'\^.', Name.Tag),
- (r'"', Name.Tag, '#pop'),
- ],
- 'tuple': [
- (r'(\d+\.)+', Keyword.Constant),
- (r'\d+', Keyword.Constant, '#pop'),
- ],
- 'bin2': [
- (r'\s+', Number.Hex),
- (r'([01]\s*){8}', Number.Hex),
- (r'\}', Number.Hex, '#pop'),
- ],
- 'commentString1': [
- (r'[^(^")]+', Comment),
- (escape_re, Comment),
- (r'[(|)]+', Comment),
- (r'\^.', Comment),
- (r'"', Comment, '#pop'),
- ],
- 'commentString2': [
- (r'[^(^{})]+', Comment),
- (escape_re, Comment),
- (r'[(|)]+', Comment),
- (r'\^.', Comment),
- (r'\{', Comment, '#push'),
- (r'\}', Comment, '#pop'),
- ],
- 'commentBlock': [
- (r'\[', Comment, '#push'),
- (r'\]', Comment, '#pop'),
- (r'"', Comment, "commentString1"),
- (r'\{', Comment, "commentString2"),
- (r'[^(\[\]"{)]+', Comment),
- ],
- }
diff --git a/pygments/lexers/resource.py b/pygments/lexers/resource.py
deleted file mode 100644
index 6cc88b95..00000000
--- a/pygments/lexers/resource.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.resource
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for resource definition files.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups, words
-from pygments.token import Comment, String, Number, Operator, Text, \
- Keyword, Name
-
-__all__ = ['ResourceLexer']
-
-
-class ResourceLexer(RegexLexer):
- """Lexer for `ICU Resource bundles
- <http://userguide.icu-project.org/locale/resources>`_.
-
- .. versionadded:: 2.0
- """
- name = 'ResourceBundle'
- aliases = ['resource', 'resourcebundle']
- filenames = ['*.txt']
-
- _types = (':table', ':array', ':string', ':bin', ':import', ':intvector',
- ':int', ':alias')
-
- flags = re.MULTILINE | re.IGNORECASE
- tokens = {
- 'root': [
- (r'//.*?$', Comment),
- (r'"', String, 'string'),
- (r'-?\d+', Number.Integer),
- (r'[,{}]', Operator),
- (r'([^\s{:]+)(\s*)(%s?)' % '|'.join(_types),
- bygroups(Name, Text, Keyword)),
- (r'\s+', Text),
- (words(_types), Keyword),
- ],
- 'string': [
- (r'(\\x[0-9a-f]{2}|\\u[0-9a-f]{4}|\\U00[0-9a-f]{6}|'
- r'\\[0-7]{1,3}|\\c.|\\[abtnvfre\'"?\\]|\\\{|[^"{\\])+', String),
- (r'\{', String.Escape, 'msgname'),
- (r'"', String, '#pop')
- ],
- 'msgname': [
- (r'([^{},]+)(\s*)', bygroups(Name, String.Escape), ('#pop', 'message'))
- ],
- 'message': [
- (r'\{', String.Escape, 'msgname'),
- (r'\}', String.Escape, '#pop'),
- (r'(,)(\s*)([a-z]+)(\s*\})',
- bygroups(Operator, String.Escape, Keyword, String.Escape), '#pop'),
- (r'(,)(\s*)([a-z]+)(\s*)(,)(\s*)(offset)(\s*)(:)(\s*)(-?\d+)(\s*)',
- bygroups(Operator, String.Escape, Keyword, String.Escape, Operator,
- String.Escape, Operator.Word, String.Escape, Operator,
- String.Escape, Number.Integer, String.Escape), 'choice'),
- (r'(,)(\s*)([a-z]+)(\s*)(,)(\s*)',
- bygroups(Operator, String.Escape, Keyword, String.Escape, Operator,
- String.Escape), 'choice'),
- (r'\s+', String.Escape)
- ],
- 'choice': [
- (r'(=|<|>|<=|>=|!=)(-?\d+)(\s*\{)',
- bygroups(Operator, Number.Integer, String.Escape), 'message'),
- (r'([a-z]+)(\s*\{)', bygroups(Keyword.Type, String.Escape), 'str'),
- (r'\}', String.Escape, ('#pop', '#pop')),
- (r'\s+', String.Escape)
- ],
- 'str': [
- (r'\}', String.Escape, '#pop'),
- (r'\{', String.Escape, 'msgname'),
- (r'[^{}]+', String)
- ]
- }
-
- def analyse_text(text):
- if text.startswith('root:table'):
- return 1.0
diff --git a/pygments/lexers/rnc.py b/pygments/lexers/rnc.py
deleted file mode 100644
index 8f0ba5cf..00000000
--- a/pygments/lexers/rnc.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.rnc
- ~~~~~~~~~~~~~~~~~~~
-
- Lexer for Relax-NG Compact syntax
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Punctuation
-
-__all__ = ['RNCCompactLexer']
-
-
-class RNCCompactLexer(RegexLexer):
- """
- For `RelaxNG-compact <http://relaxng.org>`_ syntax.
-
- .. versionadded:: 2.2
- """
-
- name = 'Relax-NG Compact'
- aliases = ['rnc', 'rng-compact']
- filenames = ['*.rnc']
-
- tokens = {
- 'root': [
- (r'namespace\b', Keyword.Namespace),
- (r'(?:default|datatypes)\b', Keyword.Declaration),
- (r'##.*$', Comment.Preproc),
- (r'#.*$', Comment.Single),
- (r'"[^"]*"', String.Double),
- # TODO single quoted strings and escape sequences outside of
- # double-quoted strings
- (r'(?:element|attribute|mixed)\b', Keyword.Declaration, 'variable'),
- (r'(text\b|xsd:[^ ]+)', Keyword.Type, 'maybe_xsdattributes'),
- (r'[,?&*=|~]|>>', Operator),
- (r'[(){}]', Punctuation),
- (r'.', Text),
- ],
-
- # a variable has been declared using `element` or `attribute`
- 'variable': [
- (r'[^{]+', Name.Variable),
- (r'\{', Punctuation, '#pop'),
- ],
-
- # after an xsd:<datatype> declaration there may be attributes
- 'maybe_xsdattributes': [
- (r'\{', Punctuation, 'xsdattributes'),
- (r'\}', Punctuation, '#pop'),
- (r'.', Text),
- ],
-
- # attributes take the form { key1 = value1 key2 = value2 ... }
- 'xsdattributes': [
- (r'[^ =}]', Name.Attribute),
- (r'=', Operator),
- (r'"[^"]*"', String.Double),
- (r'\}', Punctuation, '#pop'),
- (r'.', Text),
- ],
- }
diff --git a/pygments/lexers/roboconf.py b/pygments/lexers/roboconf.py
deleted file mode 100644
index f820fe1e..00000000
--- a/pygments/lexers/roboconf.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.roboconf
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Roboconf DSL.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, words, re
-from pygments.token import Text, Operator, Keyword, Name, Comment
-
-__all__ = ['RoboconfGraphLexer', 'RoboconfInstancesLexer']
-
-
-class RoboconfGraphLexer(RegexLexer):
- """
- Lexer for `Roboconf <http://roboconf.net/en/roboconf.html>`_ graph files.
-
- .. versionadded:: 2.1
- """
- name = 'Roboconf Graph'
- aliases = ['roboconf-graph']
- filenames = ['*.graph']
-
- flags = re.IGNORECASE | re.MULTILINE
- tokens = {
- 'root': [
- # Skip white spaces
- (r'\s+', Text),
-
- # There is one operator
- (r'=', Operator),
-
- # Keywords
- (words(('facet', 'import'), suffix=r'\s*\b', prefix=r'\b'), Keyword),
- (words((
- 'installer', 'extends', 'exports', 'imports', 'facets',
- 'children'), suffix=r'\s*:?', prefix=r'\b'), Name),
-
- # Comments
- (r'#.*\n', Comment),
-
- # Default
- (r'[^#]', Text),
- (r'.*\n', Text)
- ]
- }
-
-
-class RoboconfInstancesLexer(RegexLexer):
- """
- Lexer for `Roboconf <http://roboconf.net/en/roboconf.html>`_ instances files.
-
- .. versionadded:: 2.1
- """
- name = 'Roboconf Instances'
- aliases = ['roboconf-instances']
- filenames = ['*.instances']
-
- flags = re.IGNORECASE | re.MULTILINE
- tokens = {
- 'root': [
-
- # Skip white spaces
- (r'\s+', Text),
-
- # Keywords
- (words(('instance of', 'import'), suffix=r'\s*\b', prefix=r'\b'), Keyword),
- (words(('name', 'count'), suffix=r's*:?', prefix=r'\b'), Name),
- (r'\s*[\w.-]+\s*:', Name),
-
- # Comments
- (r'#.*\n', Comment),
-
- # Default
- (r'[^#]', Text),
- (r'.*\n', Text)
- ]
- }
diff --git a/pygments/lexers/robotframework.py b/pygments/lexers/robotframework.py
deleted file mode 100644
index 1288da8d..00000000
--- a/pygments/lexers/robotframework.py
+++ /dev/null
@@ -1,560 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.robotframework
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for Robot Framework.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# Copyright 2012 Nokia Siemens Networks Oyj
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import re
-
-from pygments.lexer import Lexer
-from pygments.token import Token
-from pygments.util import text_type
-
-__all__ = ['RobotFrameworkLexer']
-
-
-HEADING = Token.Generic.Heading
-SETTING = Token.Keyword.Namespace
-IMPORT = Token.Name.Namespace
-TC_KW_NAME = Token.Generic.Subheading
-KEYWORD = Token.Name.Function
-ARGUMENT = Token.String
-VARIABLE = Token.Name.Variable
-COMMENT = Token.Comment
-SEPARATOR = Token.Punctuation
-SYNTAX = Token.Punctuation
-GHERKIN = Token.Generic.Emph
-ERROR = Token.Error
-
-
-def normalize(string, remove=''):
- string = string.lower()
- for char in remove + ' ':
- if char in string:
- string = string.replace(char, '')
- return string
-
-
-class RobotFrameworkLexer(Lexer):
- """
- For `Robot Framework <http://robotframework.org>`_ test data.
-
- Supports both space and pipe separated plain text formats.
-
- .. versionadded:: 1.6
- """
- name = 'RobotFramework'
- aliases = ['robotframework']
- filenames = ['*.txt', '*.robot']
- mimetypes = ['text/x-robotframework']
-
- def __init__(self, **options):
- options['tabsize'] = 2
- options['encoding'] = 'UTF-8'
- Lexer.__init__(self, **options)
-
- def get_tokens_unprocessed(self, text):
- row_tokenizer = RowTokenizer()
- var_tokenizer = VariableTokenizer()
- index = 0
- for row in text.splitlines():
- for value, token in row_tokenizer.tokenize(row):
- for value, token in var_tokenizer.tokenize(value, token):
- if value:
- yield index, token, text_type(value)
- index += len(value)
-
-
-class VariableTokenizer(object):
-
- def tokenize(self, string, token):
- var = VariableSplitter(string, identifiers='$@%&')
- if var.start < 0 or token in (COMMENT, ERROR):
- yield string, token
- return
- for value, token in self._tokenize(var, string, token):
- if value:
- yield value, token
-
- def _tokenize(self, var, string, orig_token):
- before = string[:var.start]
- yield before, orig_token
- yield var.identifier + '{', SYNTAX
- for value, token in self.tokenize(var.base, VARIABLE):
- yield value, token
- yield '}', SYNTAX
- if var.index:
- yield '[', SYNTAX
- for value, token in self.tokenize(var.index, VARIABLE):
- yield value, token
- yield ']', SYNTAX
- for value, token in self.tokenize(string[var.end:], orig_token):
- yield value, token
-
-
-class RowTokenizer(object):
-
- def __init__(self):
- self._table = UnknownTable()
- self._splitter = RowSplitter()
- testcases = TestCaseTable()
- settings = SettingTable(testcases.set_default_template)
- variables = VariableTable()
- keywords = KeywordTable()
- self._tables = {'settings': settings, 'setting': settings,
- 'metadata': settings,
- 'variables': variables, 'variable': variables,
- 'testcases': testcases, 'testcase': testcases,
- 'keywords': keywords, 'keyword': keywords,
- 'userkeywords': keywords, 'userkeyword': keywords}
-
- def tokenize(self, row):
- commented = False
- heading = False
- for index, value in enumerate(self._splitter.split(row)):
- # First value, and every second after that, is a separator.
- index, separator = divmod(index-1, 2)
- if value.startswith('#'):
- commented = True
- elif index == 0 and value.startswith('*'):
- self._table = self._start_table(value)
- heading = True
- for value, token in self._tokenize(value, index, commented,
- separator, heading):
- yield value, token
- self._table.end_row()
-
- def _start_table(self, header):
- name = normalize(header, remove='*')
- return self._tables.get(name, UnknownTable())
-
- def _tokenize(self, value, index, commented, separator, heading):
- if commented:
- yield value, COMMENT
- elif separator:
- yield value, SEPARATOR
- elif heading:
- yield value, HEADING
- else:
- for value, token in self._table.tokenize(value, index):
- yield value, token
-
-
-class RowSplitter(object):
- _space_splitter = re.compile('( {2,})')
- _pipe_splitter = re.compile(r'((?:^| +)\|(?: +|$))')
-
- def split(self, row):
- splitter = (row.startswith('| ') and self._split_from_pipes
- or self._split_from_spaces)
- for value in splitter(row):
- yield value
- yield '\n'
-
- def _split_from_spaces(self, row):
- yield '' # Start with (pseudo)separator similarly as with pipes
- for value in self._space_splitter.split(row):
- yield value
-
- def _split_from_pipes(self, row):
- _, separator, rest = self._pipe_splitter.split(row, 1)
- yield separator
- while self._pipe_splitter.search(rest):
- cell, separator, rest = self._pipe_splitter.split(rest, 1)
- yield cell
- yield separator
- yield rest
-
-
-class Tokenizer(object):
- _tokens = None
-
- def __init__(self):
- self._index = 0
-
- def tokenize(self, value):
- values_and_tokens = self._tokenize(value, self._index)
- self._index += 1
- if isinstance(values_and_tokens, type(Token)):
- values_and_tokens = [(value, values_and_tokens)]
- return values_and_tokens
-
- def _tokenize(self, value, index):
- index = min(index, len(self._tokens) - 1)
- return self._tokens[index]
-
- def _is_assign(self, value):
- if value.endswith('='):
- value = value[:-1].strip()
- var = VariableSplitter(value, identifiers='$@&')
- return var.start == 0 and var.end == len(value)
-
-
-class Comment(Tokenizer):
- _tokens = (COMMENT,)
-
-
-class Setting(Tokenizer):
- _tokens = (SETTING, ARGUMENT)
- _keyword_settings = ('suitesetup', 'suiteprecondition', 'suiteteardown',
- 'suitepostcondition', 'testsetup', 'testprecondition',
- 'testteardown', 'testpostcondition', 'testtemplate')
- _import_settings = ('library', 'resource', 'variables')
- _other_settings = ('documentation', 'metadata', 'forcetags', 'defaulttags',
- 'testtimeout')
- _custom_tokenizer = None
-
- def __init__(self, template_setter=None):
- Tokenizer.__init__(self)
- self._template_setter = template_setter
-
- def _tokenize(self, value, index):
- if index == 1 and self._template_setter:
- self._template_setter(value)
- if index == 0:
- normalized = normalize(value)
- if normalized in self._keyword_settings:
- self._custom_tokenizer = KeywordCall(support_assign=False)
- elif normalized in self._import_settings:
- self._custom_tokenizer = ImportSetting()
- elif normalized not in self._other_settings:
- return ERROR
- elif self._custom_tokenizer:
- return self._custom_tokenizer.tokenize(value)
- return Tokenizer._tokenize(self, value, index)
-
-
-class ImportSetting(Tokenizer):
- _tokens = (IMPORT, ARGUMENT)
-
-
-class TestCaseSetting(Setting):
- _keyword_settings = ('setup', 'precondition', 'teardown', 'postcondition',
- 'template')
- _import_settings = ()
- _other_settings = ('documentation', 'tags', 'timeout')
-
- def _tokenize(self, value, index):
- if index == 0:
- type = Setting._tokenize(self, value[1:-1], index)
- return [('[', SYNTAX), (value[1:-1], type), (']', SYNTAX)]
- return Setting._tokenize(self, value, index)
-
-
-class KeywordSetting(TestCaseSetting):
- _keyword_settings = ('teardown',)
- _other_settings = ('documentation', 'arguments', 'return', 'timeout', 'tags')
-
-
-class Variable(Tokenizer):
- _tokens = (SYNTAX, ARGUMENT)
-
- def _tokenize(self, value, index):
- if index == 0 and not self._is_assign(value):
- return ERROR
- return Tokenizer._tokenize(self, value, index)
-
-
-class KeywordCall(Tokenizer):
- _tokens = (KEYWORD, ARGUMENT)
-
- def __init__(self, support_assign=True):
- Tokenizer.__init__(self)
- self._keyword_found = not support_assign
- self._assigns = 0
-
- def _tokenize(self, value, index):
- if not self._keyword_found and self._is_assign(value):
- self._assigns += 1
- return SYNTAX # VariableTokenizer tokenizes this later.
- if self._keyword_found:
- return Tokenizer._tokenize(self, value, index - self._assigns)
- self._keyword_found = True
- return GherkinTokenizer().tokenize(value, KEYWORD)
-
-
-class GherkinTokenizer(object):
- _gherkin_prefix = re.compile('^(Given|When|Then|And) ', re.IGNORECASE)
-
- def tokenize(self, value, token):
- match = self._gherkin_prefix.match(value)
- if not match:
- return [(value, token)]
- end = match.end()
- return [(value[:end], GHERKIN), (value[end:], token)]
-
-
-class TemplatedKeywordCall(Tokenizer):
- _tokens = (ARGUMENT,)
-
-
-class ForLoop(Tokenizer):
-
- def __init__(self):
- Tokenizer.__init__(self)
- self._in_arguments = False
-
- def _tokenize(self, value, index):
- token = self._in_arguments and ARGUMENT or SYNTAX
- if value.upper() in ('IN', 'IN RANGE'):
- self._in_arguments = True
- return token
-
-
-class _Table(object):
- _tokenizer_class = None
-
- def __init__(self, prev_tokenizer=None):
- self._tokenizer = self._tokenizer_class()
- self._prev_tokenizer = prev_tokenizer
- self._prev_values_on_row = []
-
- def tokenize(self, value, index):
- if self._continues(value, index):
- self._tokenizer = self._prev_tokenizer
- yield value, SYNTAX
- else:
- for value_and_token in self._tokenize(value, index):
- yield value_and_token
- self._prev_values_on_row.append(value)
-
- def _continues(self, value, index):
- return value == '...' and all(self._is_empty(t)
- for t in self._prev_values_on_row)
-
- def _is_empty(self, value):
- return value in ('', '\\')
-
- def _tokenize(self, value, index):
- return self._tokenizer.tokenize(value)
-
- def end_row(self):
- self.__init__(prev_tokenizer=self._tokenizer)
-
-
-class UnknownTable(_Table):
- _tokenizer_class = Comment
-
- def _continues(self, value, index):
- return False
-
-
-class VariableTable(_Table):
- _tokenizer_class = Variable
-
-
-class SettingTable(_Table):
- _tokenizer_class = Setting
-
- def __init__(self, template_setter, prev_tokenizer=None):
- _Table.__init__(self, prev_tokenizer)
- self._template_setter = template_setter
-
- def _tokenize(self, value, index):
- if index == 0 and normalize(value) == 'testtemplate':
- self._tokenizer = Setting(self._template_setter)
- return _Table._tokenize(self, value, index)
-
- def end_row(self):
- self.__init__(self._template_setter, prev_tokenizer=self._tokenizer)
-
-
-class TestCaseTable(_Table):
- _setting_class = TestCaseSetting
- _test_template = None
- _default_template = None
-
- @property
- def _tokenizer_class(self):
- if self._test_template or (self._default_template and
- self._test_template is not False):
- return TemplatedKeywordCall
- return KeywordCall
-
- def _continues(self, value, index):
- return index > 0 and _Table._continues(self, value, index)
-
- def _tokenize(self, value, index):
- if index == 0:
- if value:
- self._test_template = None
- return GherkinTokenizer().tokenize(value, TC_KW_NAME)
- if index == 1 and self._is_setting(value):
- if self._is_template(value):
- self._test_template = False
- self._tokenizer = self._setting_class(self.set_test_template)
- else:
- self._tokenizer = self._setting_class()
- if index == 1 and self._is_for_loop(value):
- self._tokenizer = ForLoop()
- if index == 1 and self._is_empty(value):
- return [(value, SYNTAX)]
- return _Table._tokenize(self, value, index)
-
- def _is_setting(self, value):
- return value.startswith('[') and value.endswith(']')
-
- def _is_template(self, value):
- return normalize(value) == '[template]'
-
- def _is_for_loop(self, value):
- return value.startswith(':') and normalize(value, remove=':') == 'for'
-
- def set_test_template(self, template):
- self._test_template = self._is_template_set(template)
-
- def set_default_template(self, template):
- self._default_template = self._is_template_set(template)
-
- def _is_template_set(self, template):
- return normalize(template) not in ('', '\\', 'none', '${empty}')
-
-
-class KeywordTable(TestCaseTable):
- _tokenizer_class = KeywordCall
- _setting_class = KeywordSetting
-
- def _is_template(self, value):
- return False
-
-
-# Following code copied directly from Robot Framework 2.7.5.
-
-class VariableSplitter:
-
- def __init__(self, string, identifiers):
- self.identifier = None
- self.base = None
- self.index = None
- self.start = -1
- self.end = -1
- self._identifiers = identifiers
- self._may_have_internal_variables = False
- try:
- self._split(string)
- except ValueError:
- pass
- else:
- self._finalize()
-
- def get_replaced_base(self, variables):
- if self._may_have_internal_variables:
- return variables.replace_string(self.base)
- return self.base
-
- def _finalize(self):
- self.identifier = self._variable_chars[0]
- self.base = ''.join(self._variable_chars[2:-1])
- self.end = self.start + len(self._variable_chars)
- if self._has_list_or_dict_variable_index():
- self.index = ''.join(self._list_and_dict_variable_index_chars[1:-1])
- self.end += len(self._list_and_dict_variable_index_chars)
-
- def _has_list_or_dict_variable_index(self):
- return self._list_and_dict_variable_index_chars\
- and self._list_and_dict_variable_index_chars[-1] == ']'
-
- def _split(self, string):
- start_index, max_index = self._find_variable(string)
- self.start = start_index
- self._open_curly = 1
- self._state = self._variable_state
- self._variable_chars = [string[start_index], '{']
- self._list_and_dict_variable_index_chars = []
- self._string = string
- start_index += 2
- for index, char in enumerate(string[start_index:]):
- index += start_index # Giving start to enumerate only in Py 2.6+
- try:
- self._state(char, index)
- except StopIteration:
- return
- if index == max_index and not self._scanning_list_variable_index():
- return
-
- def _scanning_list_variable_index(self):
- return self._state in [self._waiting_list_variable_index_state,
- self._list_variable_index_state]
-
- def _find_variable(self, string):
- max_end_index = string.rfind('}')
- if max_end_index == -1:
- raise ValueError('No variable end found')
- if self._is_escaped(string, max_end_index):
- return self._find_variable(string[:max_end_index])
- start_index = self._find_start_index(string, 1, max_end_index)
- if start_index == -1:
- raise ValueError('No variable start found')
- return start_index, max_end_index
-
- def _find_start_index(self, string, start, end):
- index = string.find('{', start, end) - 1
- if index < 0:
- return -1
- if self._start_index_is_ok(string, index):
- return index
- return self._find_start_index(string, index+2, end)
-
- def _start_index_is_ok(self, string, index):
- return string[index] in self._identifiers\
- and not self._is_escaped(string, index)
-
- def _is_escaped(self, string, index):
- escaped = False
- while index > 0 and string[index-1] == '\\':
- index -= 1
- escaped = not escaped
- return escaped
-
- def _variable_state(self, char, index):
- self._variable_chars.append(char)
- if char == '}' and not self._is_escaped(self._string, index):
- self._open_curly -= 1
- if self._open_curly == 0:
- if not self._is_list_or_dict_variable():
- raise StopIteration
- self._state = self._waiting_list_variable_index_state
- elif char in self._identifiers:
- self._state = self._internal_variable_start_state
-
- def _is_list_or_dict_variable(self):
- return self._variable_chars[0] in ('@','&')
-
- def _internal_variable_start_state(self, char, index):
- self._state = self._variable_state
- if char == '{':
- self._variable_chars.append(char)
- self._open_curly += 1
- self._may_have_internal_variables = True
- else:
- self._variable_state(char, index)
-
- def _waiting_list_variable_index_state(self, char, index):
- if char != '[':
- raise StopIteration
- self._list_and_dict_variable_index_chars.append(char)
- self._state = self._list_variable_index_state
-
- def _list_variable_index_state(self, char, index):
- self._list_and_dict_variable_index_chars.append(char)
- if char == ']':
- raise StopIteration
diff --git a/pygments/lexers/ruby.py b/pygments/lexers/ruby.py
deleted file mode 100644
index 723895d1..00000000
--- a/pygments/lexers/ruby.py
+++ /dev/null
@@ -1,519 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.ruby
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Ruby and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, include, \
- bygroups, default, LexerContext, do_insertions, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error, Generic
-from pygments.util import shebang_matches
-
-__all__ = ['RubyLexer', 'RubyConsoleLexer', 'FancyLexer']
-
-line_re = re.compile('.*?\n')
-
-
-RUBY_OPERATORS = (
- '*', '**', '-', '+', '-@', '+@', '/', '%', '&', '|', '^', '`', '~',
- '[]', '[]=', '<<', '>>', '<', '<>', '<=>', '>', '>=', '==', '==='
-)
-
-
-class RubyLexer(ExtendedRegexLexer):
- """
- For `Ruby <http://www.ruby-lang.org>`_ source code.
- """
-
- name = 'Ruby'
- aliases = ['rb', 'ruby', 'duby']
- filenames = ['*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec',
- '*.rbx', '*.duby', 'Gemfile']
- mimetypes = ['text/x-ruby', 'application/x-ruby']
-
- flags = re.DOTALL | re.MULTILINE
-
- def heredoc_callback(self, match, ctx):
- # okay, this is the hardest part of parsing Ruby...
- # match: 1 = <<-?, 2 = quote? 3 = name 4 = quote? 5 = rest of line
-
- start = match.start(1)
- yield start, Operator, match.group(1) # <<-?
- yield match.start(2), String.Heredoc, match.group(2) # quote ", ', `
- yield match.start(3), String.Delimiter, match.group(3) # heredoc name
- yield match.start(4), String.Heredoc, match.group(4) # quote again
-
- heredocstack = ctx.__dict__.setdefault('heredocstack', [])
- outermost = not bool(heredocstack)
- heredocstack.append((match.group(1) == '<<-', match.group(3)))
-
- ctx.pos = match.start(5)
- ctx.end = match.end(5)
- # this may find other heredocs
- for i, t, v in self.get_tokens_unprocessed(context=ctx):
- yield i, t, v
- ctx.pos = match.end()
-
- if outermost:
- # this is the outer heredoc again, now we can process them all
- for tolerant, hdname in heredocstack:
- lines = []
- for match in line_re.finditer(ctx.text, ctx.pos):
- if tolerant:
- check = match.group().strip()
- else:
- check = match.group().rstrip()
- if check == hdname:
- for amatch in lines:
- yield amatch.start(), String.Heredoc, amatch.group()
- yield match.start(), String.Delimiter, match.group()
- ctx.pos = match.end()
- break
- else:
- lines.append(match)
- else:
- # end of heredoc not found -- error!
- for amatch in lines:
- yield amatch.start(), Error, amatch.group()
- ctx.end = len(ctx.text)
- del heredocstack[:]
-
- def gen_rubystrings_rules():
- def intp_regex_callback(self, match, ctx):
- 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]*
- ctx.pos = match.end()
-
- def intp_string_callback(self, match, ctx):
- yield match.start(1), String.Other, match.group(1)
- 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
- ctx.pos = match.end()
-
- states = {}
- states['strings'] = [
- # easy ones
- (r'\:@{0,2}[a-zA-Z_]\w*[!?]?', String.Symbol),
- (words(RUBY_OPERATORS, prefix=r'\:@{0,2}'), String.Symbol),
- (r":'(\\\\|\\'|[^'])*'", String.Symbol),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r':"', String.Symbol, 'simple-sym'),
- (r'([a-zA-Z_]\w*)(:)(?!:)',
- bygroups(String.Symbol, Punctuation)), # Since Ruby 1.9
- (r'"', String.Double, 'simple-string'),
- (r'(?<!\.)`', String.Backtick, 'simple-backtick'),
- ]
-
- # double-quoted string and symbol
- for name, ttype, end in ('string', String.Double, '"'), \
- ('sym', String.Symbol, '"'), \
- ('backtick', String.Backtick, '`'):
- states['simple-'+name] = [
- include('string-intp-escaped'),
- (r'[^\\%s#]+' % end, ttype),
- (r'[\\#]', ttype),
- (end, ttype, '#pop'),
- ]
-
- # braced quoted strings
- for lbrace, rbrace, bracecc, name in \
- ('\\{', '\\}', '{}', 'cb'), \
- ('\\[', '\\]', '\\[\\]', 'sb'), \
- ('\\(', '\\)', '()', 'pa'), \
- ('<', '>', '<>', 'ab'):
- states[name+'-intp-string'] = [
- (r'\\[\\' + bracecc + ']', String.Other),
- (lbrace, String.Other, '#push'),
- (rbrace, String.Other, '#pop'),
- include('string-intp-escaped'),
- (r'[\\#' + bracecc + ']', String.Other),
- (r'[^\\#' + bracecc + ']+', String.Other),
- ]
- states['strings'].append((r'%[QWx]?' + lbrace, String.Other,
- name+'-intp-string'))
- states[name+'-string'] = [
- (r'\\[\\' + bracecc + ']', String.Other),
- (lbrace, String.Other, '#push'),
- (rbrace, String.Other, '#pop'),
- (r'[\\#' + bracecc + ']', String.Other),
- (r'[^\\#' + bracecc + ']+', String.Other),
- ]
- states['strings'].append((r'%[qsw]' + lbrace, String.Other,
- name+'-string'))
- states[name+'-regex'] = [
- (r'\\[\\' + bracecc + ']', String.Regex),
- (lbrace, String.Regex, '#push'),
- (rbrace + '[mixounse]*', String.Regex, '#pop'),
- include('string-intp'),
- (r'[\\#' + bracecc + ']', String.Regex),
- (r'[^\\#' + bracecc + ']+', String.Regex),
- ]
- states['strings'].append((r'%r' + lbrace, String.Regex,
- name+'-regex'))
-
- # these must come after %<brace>!
- states['strings'] += [
- # %r regex
- (r'(%r([\W_]))((?:\\\2|(?!\2).)*)(\2[mixounse]*)',
- intp_regex_callback),
- # regular fancy strings with qsw
- (r'%[qsw]([\W_])((?:\\\1|(?!\1).)*)\1', String.Other),
- (r'(%[QWx]([\W_]))((?:\\\2|(?!\2).)*)(\2)',
- intp_string_callback),
- # special forms of fancy strings after operators or
- # in method calls with braces
- (r'(?<=[-+/*%=<>&!^|~,(])(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)',
- bygroups(Text, String.Other, None)),
- # and because of fixed width lookbehinds the whole thing a
- # second time for line startings...
- (r'^(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)',
- bygroups(Text, String.Other, None)),
- # all regular fancy strings without qsw
- (r'(%([^a-zA-Z0-9\s]))((?:\\\2|(?!\2).)*)(\2)',
- intp_string_callback),
- ]
-
- return states
-
- tokens = {
- 'root': [
- (r'\A#!.+?$', Comment.Hashbang),
- (r'#.*?$', Comment.Single),
- (r'=begin\s.*?\n=end.*?$', Comment.Multiline),
- # keywords
- (words((
- 'BEGIN', 'END', 'alias', 'begin', 'break', 'case', 'defined?',
- 'do', 'else', 'elsif', 'end', 'ensure', 'for', 'if', 'in', 'next', 'redo',
- 'rescue', 'raise', 'retry', 'return', 'super', 'then', 'undef',
- 'unless', 'until', 'when', 'while', 'yield'), suffix=r'\b'),
- Keyword),
- # start of function, class and module names
- (r'(module)(\s+)([a-zA-Z_]\w*'
- r'(?:::[a-zA-Z_]\w*)*)',
- bygroups(Keyword, Text, Name.Namespace)),
- (r'(def)(\s+)', bygroups(Keyword, Text), 'funcname'),
- (r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'),
- (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
- # special methods
- (words((
- 'initialize', 'new', 'loop', 'include', 'extend', 'raise', 'attr_reader',
- 'attr_writer', 'attr_accessor', 'attr', 'catch', 'throw', 'private',
- 'module_function', 'public', 'protected', 'true', 'false', 'nil'),
- suffix=r'\b'),
- Keyword.Pseudo),
- (r'(not|and|or)\b', Operator.Word),
- (words((
- 'autoload', 'block_given', 'const_defined', 'eql', 'equal', 'frozen', 'include',
- 'instance_of', 'is_a', 'iterator', 'kind_of', 'method_defined', 'nil',
- 'private_method_defined', 'protected_method_defined',
- 'public_method_defined', 'respond_to', 'tainted'), suffix=r'\?'),
- Name.Builtin),
- (r'(chomp|chop|exit|gsub|sub)!', Name.Builtin),
- (words((
- 'Array', 'Float', 'Integer', 'String', '__id__', '__send__', 'abort',
- 'ancestors', 'at_exit', 'autoload', 'binding', 'callcc', 'caller',
- 'catch', 'chomp', 'chop', 'class_eval', 'class_variables',
- 'clone', 'const_defined?', 'const_get', 'const_missing', 'const_set',
- 'constants', 'display', 'dup', 'eval', 'exec', 'exit', 'extend', 'fail', 'fork',
- 'format', 'freeze', 'getc', 'gets', 'global_variables', 'gsub',
- 'hash', 'id', 'included_modules', 'inspect', 'instance_eval',
- 'instance_method', 'instance_methods',
- 'instance_variable_get', 'instance_variable_set', 'instance_variables',
- 'lambda', 'load', 'local_variables', 'loop',
- 'method', 'method_missing', 'methods', 'module_eval', 'name',
- 'object_id', 'open', 'p', 'print', 'printf', 'private_class_method',
- 'private_instance_methods',
- 'private_methods', 'proc', 'protected_instance_methods',
- 'protected_methods', 'public_class_method',
- 'public_instance_methods', 'public_methods',
- 'putc', 'puts', 'raise', 'rand', 'readline', 'readlines', 'require',
- 'scan', 'select', 'self', 'send', 'set_trace_func', 'singleton_methods', 'sleep',
- 'split', 'sprintf', 'srand', 'sub', 'syscall', 'system', 'taint',
- 'test', 'throw', 'to_a', 'to_s', 'trace_var', 'trap', 'untaint',
- 'untrace_var', 'warn'), prefix=r'(?<!\.)', suffix=r'\b'),
- Name.Builtin),
- (r'__(FILE|LINE)__\b', Name.Builtin.Pseudo),
- # normal heredocs
- (r'(?<!\w)(<<-?)(["`\']?)([a-zA-Z_]\w*)(\2)(.*?\n)',
- heredoc_callback),
- # empty string heredocs
- (r'(<<-?)("|\')()(\2)(.*?\n)', heredoc_callback),
- (r'__END__', Comment.Preproc, 'end-part'),
- # multiline regex (after keywords or assignments)
- (r'(?:^|(?<=[=<>~!:])|'
- r'(?<=(?:\s|;)when\s)|'
- r'(?<=(?:\s|;)or\s)|'
- r'(?<=(?:\s|;)and\s)|'
- r'(?<=\.index\s)|'
- r'(?<=\.scan\s)|'
- r'(?<=\.sub\s)|'
- r'(?<=\.sub!\s)|'
- r'(?<=\.gsub\s)|'
- r'(?<=\.gsub!\s)|'
- r'(?<=\.match\s)|'
- r'(?<=(?:\s|;)if\s)|'
- r'(?<=(?:\s|;)elsif\s)|'
- r'(?<=^when\s)|'
- r'(?<=^index\s)|'
- r'(?<=^scan\s)|'
- r'(?<=^sub\s)|'
- r'(?<=^gsub\s)|'
- r'(?<=^sub!\s)|'
- r'(?<=^gsub!\s)|'
- r'(?<=^match\s)|'
- r'(?<=^if\s)|'
- r'(?<=^elsif\s)'
- r')(\s*)(/)', bygroups(Text, 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=])', 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?)
- # since pygments 0.7 we also eat a "?" operator after numbers
- # so that the char operator does not work. Chars are not allowed
- # there so that you can use the ternary operator.
- # stupid example:
- # x>=0?n[x]:""
- (r'(0_?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?',
- bygroups(Number.Oct, Text, Operator)),
- (r'(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?',
- bygroups(Number.Hex, Text, Operator)),
- (r'(0b[01]+(?:_[01]+)*)(\s*)([/?])?',
- bygroups(Number.Bin, Text, Operator)),
- (r'([\d]+(?:_\d+)*)(\s*)([/?])?',
- bygroups(Number.Integer, Text, Operator)),
- # Names
- (r'@@[a-zA-Z_]\w*', Name.Variable.Class),
- (r'@[a-zA-Z_]\w*', Name.Variable.Instance),
- (r'\$\w+', Name.Variable.Global),
- (r'\$[!@&`\'+~=/\\,;.<>_*$?:"^-]', Name.Variable.Global),
- (r'\$-[0adFiIlpvw]', Name.Variable.Global),
- (r'::', Operator),
- include('strings'),
- # chars
- (r'\?(\\[MC]-)*' # modifiers
- r'(\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)'
- r'(?!\w)',
- String.Char),
- (r'[A-Z]\w+', Name.Constant),
- # this is needed because ruby attributes can look
- # like keywords (class) or like this: ` ?!?
- (words(RUBY_OPERATORS, prefix=r'(\.|::)'),
- bygroups(Operator, Name.Operator)),
- (r'(\.|::)([a-zA-Z_]\w*[!?]?|[*%&^`~+\-/\[<>=])',
- bygroups(Operator, Name)),
- (r'[a-zA-Z_]\w*[!?]?', Name),
- (r'(\[|\]|\*\*|<<?|>>?|>=|<=|<=>|=~|={3}|'
- r'!~|&&?|\|\||\.{1,3})', Operator),
- (r'[-+/*%=<>&!^|~]=?', Operator),
- (r'[(){};,/?:\\]', Punctuation),
- (r'\s+', Text)
- ],
- 'funcname': [
- (r'\(', Punctuation, 'defexpr'),
- (r'(?:([a-zA-Z_]\w*)(\.))?'
- r'([a-zA-Z_]\w*[!?]?|\*\*?|[-+]@?|'
- r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)',
- bygroups(Name.Class, Operator, Name.Function), '#pop'),
- default('#pop')
- ],
- 'classname': [
- (r'\(', Punctuation, 'defexpr'),
- (r'<<', Operator, '#pop'),
- (r'[A-Z_]\w*', Name.Class, '#pop'),
- default('#pop')
- ],
- 'defexpr': [
- (r'(\))(\.|::)?', bygroups(Punctuation, Operator), '#pop'),
- (r'\(', Operator, '#push'),
- include('root')
- ],
- 'in-intp': [
- (r'\{', String.Interpol, '#push'),
- (r'\}', String.Interpol, '#pop'),
- include('root'),
- ],
- 'string-intp': [
- (r'#\{', String.Interpol, 'in-intp'),
- (r'#@@?[a-zA-Z_]\w*', String.Interpol),
- (r'#\$[a-zA-Z_]\w*', String.Interpol)
- ],
- 'string-intp-escaped': [
- include('string-intp'),
- (r'\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})',
- String.Escape)
- ],
- 'interpolated-regex': [
- include('string-intp'),
- (r'[\\#]', String.Regex),
- (r'[^\\#]+', String.Regex),
- ],
- 'interpolated-string': [
- include('string-intp'),
- (r'[\\#]', String.Other),
- (r'[^\\#]+', String.Other),
- ],
- 'multiline-regex': [
- include('string-intp'),
- (r'\\\\', String.Regex),
- (r'\\/', String.Regex),
- (r'[\\#]', String.Regex),
- (r'[^\\/#]+', String.Regex),
- (r'/[mixounse]*', String.Regex, '#pop'),
- ],
- 'end-part': [
- (r'.+', Comment.Preproc, '#pop')
- ]
- }
- tokens.update(gen_rubystrings_rules())
-
- def analyse_text(text):
- return shebang_matches(text, r'ruby(1\.\d)?')
-
-
-class RubyConsoleLexer(Lexer):
- """
- For Ruby interactive console (**irb**) output like:
-
- .. sourcecode:: rbcon
-
- irb(main):001:0> a = 1
- => 1
- irb(main):002:0> puts a
- 1
- => nil
- """
- name = 'Ruby irb session'
- aliases = ['rbcon', 'irb']
- mimetypes = ['text/x-ruby-shellsession']
-
- _prompt_re = re.compile(r'irb\([a-zA-Z_]\w*\):\d{3}:\d+[>*"\'] '
- r'|>> |\?> ')
-
- def get_tokens_unprocessed(self, text):
- rblexer = RubyLexer(**self.options)
-
- curcode = ''
- insertions = []
- for match in line_re.finditer(text):
- line = match.group()
- 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, rblexer.get_tokens_unprocessed(curcode)):
- yield item
- curcode = ''
- insertions = []
- yield match.start(), Generic.Output, line
- if curcode:
- for item in do_insertions(
- insertions, rblexer.get_tokens_unprocessed(curcode)):
- yield item
-
-
-class FancyLexer(RegexLexer):
- """
- Pygments Lexer For `Fancy <http://www.fancy-lang.org/>`_.
-
- Fancy is a self-hosted, pure object-oriented, dynamic,
- class-based, concurrent general-purpose programming language
- running on Rubinius, the Ruby VM.
-
- .. versionadded:: 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'\s+', Text),
-
- # 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'(def|class|try|catch|finally|retry|return|return_local|match|'
- r'case|->|=>)\b', Keyword),
- # constants
- (r'(self|super|nil|false|true)\b', Name.Constant),
- (r'[(){};,/?|:\\]', Punctuation),
- # names
- (words((
- 'Object', 'Array', 'Hash', 'Directory', 'File', 'Class', 'String',
- 'Number', 'Enumerable', 'FancyEnumerable', 'Block', 'TrueClass',
- 'NilClass', 'FalseClass', 'Tuple', 'Symbol', 'Stack', 'Set',
- 'FancySpec', 'Method', 'Package', 'Range'), suffix=r'\b'),
- Name.Builtin),
- # functions
- (r'[a-zA-Z](\w|[-+?!=*/^><%])*:', Name.Function),
- # operators, must be below functions
- (r'[-+*/~,<>=&!?%^\[\].$]+', Operator),
- (r'[A-Z]\w*', Name.Constant),
- (r'@[a-zA-Z_]\w*', Name.Variable.Instance),
- (r'@@[a-zA-Z_]\w*', Name.Variable.Class),
- ('@@?', Operator),
- (r'[a-zA-Z_]\w*', 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)
- ]
- }
diff --git a/pygments/lexers/rust.py b/pygments/lexers/rust.py
deleted file mode 100644
index f731785f..00000000
--- a/pygments/lexers/rust.py
+++ /dev/null
@@ -1,220 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.rust
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Rust language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, bygroups, words, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Whitespace
-
-__all__ = ['RustLexer']
-
-
-class RustLexer(RegexLexer):
- """
- Lexer for the Rust programming language (version 1.10).
-
- .. versionadded:: 1.6
- """
- name = 'Rust'
- filenames = ['*.rs', '*.rs.in']
- aliases = ['rust', 'rs']
- mimetypes = ['text/rust']
-
- keyword_types = (
- words(('u8', 'u16', 'u32', 'u64', 'i8', 'i16', 'i32', 'i64',
- 'i128', 'u128', 'usize', 'isize', 'f32', 'f64', 'str', 'bool'),
- suffix=r'\b'),
- Keyword.Type)
-
- builtin_types = (words((
- # Reexported core operators
- 'Copy', 'Send', 'Sized', 'Sync',
- 'Drop', 'Fn', 'FnMut', 'FnOnce',
-
- # Reexported types and traits
- 'Box',
- 'ToOwned',
- 'Clone',
- 'PartialEq', 'PartialOrd', 'Eq', 'Ord',
- 'AsRef', 'AsMut', 'Into', 'From',
- 'Default',
- 'Iterator', 'Extend', 'IntoIterator',
- 'DoubleEndedIterator', 'ExactSizeIterator',
- 'Option',
- 'Some', 'None',
- 'Result',
- 'Ok', 'Err',
- 'SliceConcatExt',
- 'String', 'ToString',
- 'Vec'), suffix=r'\b'),
- Name.Builtin)
-
- tokens = {
- 'root': [
- # rust allows a file to start with a shebang, but if the first line
- # starts with #![ then it's not a shebang but a crate attribute.
- (r'#![^[\r\n].*$', Comment.Preproc),
- default('base'),
- ],
- 'base': [
- # Whitespace and Comments
- (r'\n', Whitespace),
- (r'\s+', Whitespace),
- (r'//!.*?\n', String.Doc),
- (r'///(\n|[^/].*?\n)', String.Doc),
- (r'//(.*?)\n', Comment.Single),
- (r'/\*\*(\n|[^/*])', String.Doc, 'doccomment'),
- (r'/\*!', String.Doc, 'doccomment'),
- (r'/\*', Comment.Multiline, 'comment'),
-
- # Macro parameters
- (r"""\$([a-zA-Z_]\w*|\(,?|\),?|,?)""", Comment.Preproc),
- # Keywords
- (words((
- 'as', 'async', 'await', 'box', 'const', 'crate', 'else',
- 'extern', 'for', 'if', 'impl', 'in', 'loop', 'match', 'move',
- 'mut', 'pub', 'ref', 'return', 'static', 'super', 'trait',
- 'try', 'unsafe', 'use', 'where', 'while'), suffix=r'\b'),
- Keyword),
- (words(('abstract', 'alignof', 'become', 'do', 'final', 'macro',
- 'offsetof', 'override', 'priv', 'proc', 'pure', 'sizeof',
- 'typeof', 'unsized', 'virtual', 'yield'), suffix=r'\b'),
- Keyword.Reserved),
- (r'(true|false)\b', Keyword.Constant),
- (r'mod\b', Keyword, 'modname'),
- (r'let\b', Keyword.Declaration),
- (r'fn\b', Keyword, 'funcname'),
- (r'(struct|enum|type|union)\b', Keyword, 'typename'),
- (r'(default)(\s+)(type|fn)\b', bygroups(Keyword, Text, Keyword)),
- keyword_types,
- (r'self\b', Name.Builtin.Pseudo),
- # Prelude (taken from Rust's src/libstd/prelude.rs)
- builtin_types,
- # Path seperators, so types don't catch them.
- (r'::\b', Text),
- # Types in positions.
- (r'(?::|->)', Text, 'typename'),
- # Labels
- (r'(break|continue)(\s*)(\'[A-Za-z_]\w*)?',
- bygroups(Keyword, Text.Whitespace, Name.Label)),
- # Character Literal
- (r"""'(\\['"\\nrt]|\\x[0-7][0-9a-fA-F]|\\0"""
- r"""|\\u\{[0-9a-fA-F]{1,6}\}|.)'""",
- String.Char),
- (r"""b'(\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\0"""
- r"""|\\u\{[0-9a-fA-F]{1,6}\}|.)'""",
- String.Char),
- # Binary Literal
- (r'0b[01_]+', Number.Bin, 'number_lit'),
- # Octal Literal
- (r'0o[0-7_]+', Number.Oct, 'number_lit'),
- # Hexadecimal Literal
- (r'0[xX][0-9a-fA-F_]+', Number.Hex, 'number_lit'),
- # Decimal Literal
- (r'[0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|'
- r'\.[0-9_]*(?!\.)|[eE][+\-]?[0-9_]+)', Number.Float,
- 'number_lit'),
- (r'[0-9][0-9_]*', Number.Integer, 'number_lit'),
- # String Literal
- (r'b"', String, 'bytestring'),
- (r'"', String, 'string'),
- (r'b?r(#*)".*?"\1', String),
-
- # Lifetime
- (r"""'static""", Name.Builtin),
- (r"""'[a-zA-Z_]\w*""", Name.Attribute),
-
- # Operators and Punctuation
- (r'[{}()\[\],.;]', Punctuation),
- (r'[+\-*/%&|<>^!~@=:?]', Operator),
-
- # Identifier
- (r'[a-zA-Z_]\w*', Name),
-
- # Attributes
- (r'#!?\[', Comment.Preproc, 'attribute['),
- # Macros
- (r'([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\s*)(\{)',
- bygroups(Comment.Preproc, Punctuation, Whitespace, Name,
- Whitespace, Punctuation), 'macro{'),
- (r'([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\()',
- bygroups(Comment.Preproc, Punctuation, Whitespace, Name,
- Punctuation), 'macro('),
- ],
- 'comment': [
- (r'[^*/]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline),
- ],
- 'doccomment': [
- (r'[^*/]+', String.Doc),
- (r'/\*', String.Doc, '#push'),
- (r'\*/', String.Doc, '#pop'),
- (r'[*/]', String.Doc),
- ],
- 'modname': [
- (r'\s+', Text),
- (r'[a-zA-Z_]\w*', Name.Namespace, '#pop'),
- default('#pop'),
- ],
- 'funcname': [
- (r'\s+', Text),
- (r'[a-zA-Z_]\w*', Name.Function, '#pop'),
- default('#pop'),
- ],
- 'typename': [
- (r'\s+', Text),
- (r'&', Keyword.Pseudo),
- builtin_types,
- keyword_types,
- (r'[a-zA-Z_]\w*', Name.Class, '#pop'),
- default('#pop'),
- ],
- 'number_lit': [
- (r'[ui](8|16|32|64|size)', Keyword, '#pop'),
- (r'f(32|64)', Keyword, '#pop'),
- default('#pop'),
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r"""\\['"\\nrt]|\\x[0-7][0-9a-fA-F]|\\0"""
- r"""|\\u\{[0-9a-fA-F]{1,6}\}""", String.Escape),
- (r'[^\\"]+', String),
- (r'\\', String),
- ],
- 'bytestring': [
- (r"""\\x[89a-fA-F][0-9a-fA-F]""", String.Escape),
- include('string'),
- ],
- 'macro{': [
- (r'\{', Operator, '#push'),
- (r'\}', Operator, '#pop'),
- ],
- 'macro(': [
- (r'\(', Operator, '#push'),
- (r'\)', Operator, '#pop'),
- ],
- 'attribute_common': [
- (r'"', String, 'string'),
- (r'\[', Comment.Preproc, 'attribute['),
- (r'\(', Comment.Preproc, 'attribute('),
- ],
- 'attribute[': [
- include('attribute_common'),
- (r'\];?', Comment.Preproc, '#pop'),
- (r'[^"\]]+', Comment.Preproc),
- ],
- 'attribute(': [
- include('attribute_common'),
- (r'\);?', Comment.Preproc, '#pop'),
- (r'[^")]+', Comment.Preproc),
- ],
- }
diff --git a/pygments/lexers/sas.py b/pygments/lexers/sas.py
deleted file mode 100644
index 38d80774..00000000
--- a/pygments/lexers/sas.py
+++ /dev/null
@@ -1,228 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.sas
- ~~~~~~~~~~~~~~~~~~~
-
- Lexer for SAS.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Comment, Keyword, Name, Number, String, Text, \
- Other, Generic
-
-__all__ = ['SASLexer']
-
-
-class SASLexer(RegexLexer):
- """
- For `SAS <http://www.sas.com/>`_ files.
-
- .. versionadded:: 2.2
- """
- # Syntax from syntax/sas.vim by James Kidd <james.kidd@covance.com>
-
- name = 'SAS'
- aliases = ['sas']
- filenames = ['*.SAS', '*.sas']
- mimetypes = ['text/x-sas', 'text/sas', 'application/x-sas']
- flags = re.IGNORECASE | re.MULTILINE
-
- builtins_macros = (
- "bquote", "nrbquote", "cmpres", "qcmpres", "compstor", "datatyp",
- "display", "do", "else", "end", "eval", "global", "goto", "if",
- "index", "input", "keydef", "label", "left", "length", "let",
- "local", "lowcase", "macro", "mend", "nrquote",
- "nrstr", "put", "qleft", "qlowcase", "qscan",
- "qsubstr", "qsysfunc", "qtrim", "quote", "qupcase", "scan",
- "str", "substr", "superq", "syscall", "sysevalf", "sysexec",
- "sysfunc", "sysget", "syslput", "sysprod", "sysrc", "sysrput",
- "then", "to", "trim", "unquote", "until", "upcase", "verify",
- "while", "window"
- )
-
- builtins_conditionals = (
- "do", "if", "then", "else", "end", "until", "while"
- )
-
- builtins_statements = (
- "abort", "array", "attrib", "by", "call", "cards", "cards4",
- "catname", "continue", "datalines", "datalines4", "delete", "delim",
- "delimiter", "display", "dm", "drop", "endsas", "error", "file",
- "filename", "footnote", "format", "goto", "in", "infile", "informat",
- "input", "keep", "label", "leave", "length", "libname", "link",
- "list", "lostcard", "merge", "missing", "modify", "options", "output",
- "out", "page", "put", "redirect", "remove", "rename", "replace",
- "retain", "return", "select", "set", "skip", "startsas", "stop",
- "title", "update", "waitsas", "where", "window", "x", "systask"
- )
-
- builtins_sql = (
- "add", "and", "alter", "as", "cascade", "check", "create",
- "delete", "describe", "distinct", "drop", "foreign", "from",
- "group", "having", "index", "insert", "into", "in", "key", "like",
- "message", "modify", "msgtype", "not", "null", "on", "or",
- "order", "primary", "references", "reset", "restrict", "select",
- "set", "table", "unique", "update", "validate", "view", "where"
- )
-
- builtins_functions = (
- "abs", "addr", "airy", "arcos", "arsin", "atan", "attrc",
- "attrn", "band", "betainv", "blshift", "bnot", "bor",
- "brshift", "bxor", "byte", "cdf", "ceil", "cexist", "cinv",
- "close", "cnonct", "collate", "compbl", "compound",
- "compress", "cos", "cosh", "css", "curobs", "cv", "daccdb",
- "daccdbsl", "daccsl", "daccsyd", "dacctab", "dairy", "date",
- "datejul", "datepart", "datetime", "day", "dclose", "depdb",
- "depdbsl", "depsl", "depsyd",
- "deptab", "dequote", "dhms", "dif", "digamma",
- "dim", "dinfo", "dnum", "dopen", "doptname", "doptnum",
- "dread", "dropnote", "dsname", "erf", "erfc", "exist", "exp",
- "fappend", "fclose", "fcol", "fdelete", "fetch", "fetchobs",
- "fexist", "fget", "fileexist", "filename", "fileref",
- "finfo", "finv", "fipname", "fipnamel", "fipstate", "floor",
- "fnonct", "fnote", "fopen", "foptname", "foptnum", "fpoint",
- "fpos", "fput", "fread", "frewind", "frlen", "fsep", "fuzz",
- "fwrite", "gaminv", "gamma", "getoption", "getvarc", "getvarn",
- "hbound", "hms", "hosthelp", "hour", "ibessel", "index",
- "indexc", "indexw", "input", "inputc", "inputn", "int",
- "intck", "intnx", "intrr", "irr", "jbessel", "juldate",
- "kurtosis", "lag", "lbound", "left", "length", "lgamma",
- "libname", "libref", "log", "log10", "log2", "logpdf", "logpmf",
- "logsdf", "lowcase", "max", "mdy", "mean", "min", "minute",
- "mod", "month", "mopen", "mort", "n", "netpv", "nmiss",
- "normal", "note", "npv", "open", "ordinal", "pathname",
- "pdf", "peek", "peekc", "pmf", "point", "poisson", "poke",
- "probbeta", "probbnml", "probchi", "probf", "probgam",
- "probhypr", "probit", "probnegb", "probnorm", "probt",
- "put", "putc", "putn", "qtr", "quote", "ranbin", "rancau",
- "ranexp", "rangam", "range", "rank", "rannor", "ranpoi",
- "rantbl", "rantri", "ranuni", "repeat", "resolve", "reverse",
- "rewind", "right", "round", "saving", "scan", "sdf", "second",
- "sign", "sin", "sinh", "skewness", "soundex", "spedis",
- "sqrt", "std", "stderr", "stfips", "stname", "stnamel",
- "substr", "sum", "symget", "sysget", "sysmsg", "sysprod",
- "sysrc", "system", "tan", "tanh", "time", "timepart", "tinv",
- "tnonct", "today", "translate", "tranwrd", "trigamma",
- "trim", "trimn", "trunc", "uniform", "upcase", "uss", "var",
- "varfmt", "varinfmt", "varlabel", "varlen", "varname",
- "varnum", "varray", "varrayx", "vartype", "verify", "vformat",
- "vformatd", "vformatdx", "vformatn", "vformatnx", "vformatw",
- "vformatwx", "vformatx", "vinarray", "vinarrayx", "vinformat",
- "vinformatd", "vinformatdx", "vinformatn", "vinformatnx",
- "vinformatw", "vinformatwx", "vinformatx", "vlabel",
- "vlabelx", "vlength", "vlengthx", "vname", "vnamex", "vtype",
- "vtypex", "weekday", "year", "yyq", "zipfips", "zipname",
- "zipnamel", "zipstate"
- )
-
- tokens = {
- 'root': [
- include('comments'),
- include('proc-data'),
- include('cards-datalines'),
- include('logs'),
- include('general'),
- (r'.', Text),
- ],
- # SAS is multi-line regardless, but * is ended by ;
- 'comments': [
- (r'^\s*\*.*?;', Comment),
- (r'/\*.*?\*/', Comment),
- (r'^\s*\*(.|\n)*?;', Comment.Multiline),
- (r'/[*](.|\n)*?[*]/', Comment.Multiline),
- ],
- # Special highlight for proc, data, quit, run
- 'proc-data': [
- (r'(^|;)\s*(proc \w+|data|run|quit)[\s;]',
- Keyword.Reserved),
- ],
- # Special highlight cards and datalines
- 'cards-datalines': [
- (r'^\s*(datalines|cards)\s*;\s*$', Keyword, 'data'),
- ],
- 'data': [
- (r'(.|\n)*^\s*;\s*$', Other, '#pop'),
- ],
- # Special highlight for put NOTE|ERROR|WARNING (order matters)
- 'logs': [
- (r'\n?^\s*%?put ', Keyword, 'log-messages'),
- ],
- 'log-messages': [
- (r'NOTE(:|-).*', Generic, '#pop'),
- (r'WARNING(:|-).*', Generic.Emph, '#pop'),
- (r'ERROR(:|-).*', Generic.Error, '#pop'),
- include('general'),
- ],
- 'general': [
- include('keywords'),
- include('vars-strings'),
- include('special'),
- include('numbers'),
- ],
- # Keywords, statements, functions, macros
- 'keywords': [
- (words(builtins_statements,
- prefix = r'\b',
- suffix = r'\b'),
- Keyword),
- (words(builtins_sql,
- prefix = r'\b',
- suffix = r'\b'),
- Keyword),
- (words(builtins_conditionals,
- prefix = r'\b',
- suffix = r'\b'),
- Keyword),
- (words(builtins_macros,
- prefix = r'%',
- suffix = r'\b'),
- Name.Builtin),
- (words(builtins_functions,
- prefix = r'\b',
- suffix = r'\('),
- Name.Builtin),
- ],
- # Strings and user-defined variables and macros (order matters)
- 'vars-strings': [
- (r'&[a-z_]\w{0,31}\.?', Name.Variable),
- (r'%[a-z_]\w{0,31}', Name.Function),
- (r'\'', String, 'string_squote'),
- (r'"', String, 'string_dquote'),
- ],
- 'string_squote': [
- ('\'', String, '#pop'),
- (r'\\\\|\\"|\\\n', String.Escape),
- # AFAIK, macro variables are not evaluated in single quotes
- # (r'&', Name.Variable, 'validvar'),
- (r'[^$\'\\]+', String),
- (r'[$\'\\]', String),
- ],
- 'string_dquote': [
- (r'"', String, '#pop'),
- (r'\\\\|\\"|\\\n', String.Escape),
- (r'&', Name.Variable, 'validvar'),
- (r'[^$&"\\]+', String),
- (r'[$"\\]', String),
- ],
- 'validvar': [
- (r'[a-z_]\w{0,31}\.?', Name.Variable, '#pop'),
- ],
- # SAS numbers and special variables
- 'numbers': [
- (r'\b[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)(E[+-]?[0-9]+)?i?\b',
- Number),
- ],
- 'special': [
- (r'(null|missing|_all_|_automatic_|_character_|_n_|'
- r'_infile_|_name_|_null_|_numeric_|_user_|_webout_)',
- Keyword.Constant),
- ],
- # 'operators': [
- # (r'(-|=|<=|>=|<|>|<>|&|!=|'
- # r'\||\*|\+|\^|/|!|~|~=)', Operator)
- # ],
- }
diff --git a/pygments/lexers/scripting.py b/pygments/lexers/scripting.py
deleted file mode 100644
index a340f8e0..00000000
--- a/pygments/lexers/scripting.py
+++ /dev/null
@@ -1,1222 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.scripting
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for scripting and embedded languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, default, combined, \
- words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error, Whitespace, Other
-from pygments.util import get_bool_opt, get_list_opt, iteritems
-
-__all__ = ['LuaLexer', 'MoonScriptLexer', 'ChaiscriptLexer', 'LSLLexer',
- 'AppleScriptLexer', 'RexxLexer', 'MOOCodeLexer', 'HybrisLexer',
- 'EasytrieveLexer', 'JclLexer']
-
-
-class LuaLexer(RegexLexer):
- """
- For `Lua <http://www.lua.org>`_ source code.
-
- Additional options accepted:
-
- `func_name_highlighting`
- If given and ``True``, highlight builtin function names
- (default: ``True``).
- `disabled_modules`
- If given, must be a list of module names whose function names
- should not be highlighted. By default all modules are highlighted.
-
- To get a list of allowed modules have a look into the
- `_lua_builtins` module:
-
- .. sourcecode:: pycon
-
- >>> from pygments.lexers._lua_builtins import MODULES
- >>> MODULES.keys()
- ['string', 'coroutine', 'modules', 'io', 'basic', ...]
- """
-
- name = 'Lua'
- aliases = ['lua']
- filenames = ['*.lua', '*.wlua']
- mimetypes = ['text/x-lua', 'application/x-lua']
-
- _comment_multiline = r'(?:--\[(?P<level>=*)\[[\w\W]*?\](?P=level)\])'
- _comment_single = r'(?:--.*$)'
- _space = r'(?:\s+)'
- _s = r'(?:%s|%s|%s)' % (_comment_multiline, _comment_single, _space)
- _name = r'(?:[^\W\d]\w*)'
-
- tokens = {
- 'root': [
- # Lua allows a file to start with a shebang.
- (r'#!.*', Comment.Preproc),
- default('base'),
- ],
- 'ws': [
- (_comment_multiline, Comment.Multiline),
- (_comment_single, Comment.Single),
- (_space, Text),
- ],
- 'base': [
- include('ws'),
-
- (r'(?i)0x[\da-f]*(\.[\da-f]*)?(p[+-]?\d+)?', Number.Hex),
- (r'(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?', Number.Float),
- (r'(?i)\d+e[+-]?\d+', Number.Float),
- (r'\d+', Number.Integer),
-
- # multiline strings
- (r'(?s)\[(=*)\[.*?\]\1\]', String),
-
- (r'::', Punctuation, 'label'),
- (r'\.{3}', Punctuation),
- (r'[=<>|~&+\-*/%#^]+|\.\.', Operator),
- (r'[\[\]{}().,:;]', Punctuation),
- (r'(and|or|not)\b', Operator.Word),
-
- ('(break|do|else|elseif|end|for|if|in|repeat|return|then|until|'
- r'while)\b', Keyword.Reserved),
- (r'goto\b', Keyword.Reserved, 'goto'),
- (r'(local)\b', Keyword.Declaration),
- (r'(true|false|nil)\b', Keyword.Constant),
-
- (r'(function)\b', Keyword.Reserved, 'funcname'),
-
- (r'[A-Za-z_]\w*(\.[A-Za-z_]\w*)?', Name),
-
- ("'", String.Single, combined('stringescape', 'sqs')),
- ('"', String.Double, combined('stringescape', 'dqs'))
- ],
-
- 'funcname': [
- include('ws'),
- (r'[.:]', Punctuation),
- (r'%s(?=%s*[.:])' % (_name, _s), Name.Class),
- (_name, Name.Function, '#pop'),
- # inline function
- (r'\(', Punctuation, '#pop'),
- ],
-
- 'goto': [
- include('ws'),
- (_name, Name.Label, '#pop'),
- ],
-
- 'label': [
- include('ws'),
- (r'::', Punctuation, '#pop'),
- (_name, Name.Label),
- ],
-
- 'stringescape': [
- (r'\\([abfnrtv\\"\']|[\r\n]{1,2}|z\s*|x[0-9a-fA-F]{2}|\d{1,3}|'
- r'u\{[0-9a-fA-F]+\})', String.Escape),
- ],
-
- 'sqs': [
- (r"'", String.Single, '#pop'),
- (r"[^\\']+", String.Single),
- ],
-
- 'dqs': [
- (r'"', String.Double, '#pop'),
- (r'[^\\"]+', String.Double),
- ]
- }
-
- def __init__(self, **options):
- self.func_name_highlighting = get_bool_opt(
- options, 'func_name_highlighting', True)
- self.disabled_modules = get_list_opt(options, 'disabled_modules', [])
-
- self._functions = set()
- if self.func_name_highlighting:
- from pygments.lexers._lua_builtins import MODULES
- for mod, func in iteritems(MODULES):
- if mod not in self.disabled_modules:
- self._functions.update(func)
- 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 value in self._functions:
- yield index, Name.Builtin, value
- continue
- elif '.' in value:
- a, b = value.split('.')
- yield index, Name, a
- yield index + len(a), Punctuation, u'.'
- yield index + len(a) + 1, Name, b
- continue
- yield index, token, value
-
-
-class MoonScriptLexer(LuaLexer):
- """
- For `MoonScript <http://moonscript.org>`_ source code.
-
- .. versionadded:: 1.5
- """
-
- name = "MoonScript"
- aliases = ["moon", "moonscript"]
- filenames = ["*.moon"]
- mimetypes = ['text/x-moonscript', 'application/x-moonscript']
-
- tokens = {
- 'root': [
- (r'#!(.*?)$', Comment.Preproc),
- default('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_]\w*', Name.Variable),
- (r'(==|!=|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#!.\\:])', Operator),
- (r'[;,]', Punctuation),
- (r'[\[\]{}()]', Keyword.Type),
- (r'[a-zA-Z_]\w*:', Name.Variable),
- (words((
- 'class', 'extends', 'if', 'then', 'super', 'do', 'with',
- 'import', 'export', 'while', 'elseif', 'return', 'for', 'in',
- 'from', 'when', 'using', 'else', 'and', 'or', 'not', 'switch',
- 'break'), suffix=r'\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_]\w*)?', Name.Variable.Class),
- (r'[A-Z]\w*', Name.Class), # proper name
- (r'[A-Za-z_]\w*(\.[A-Za-z_]\w*)?', 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 ChaiscriptLexer(RegexLexer):
- """
- For `ChaiScript <http://chaiscript.com/>`_ source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'ChaiScript'
- aliases = ['chai', 'chaiscript']
- filenames = ['*.chai']
- mimetypes = ['text/x-chaiscript', 'application/x-chaiscript']
-
- flags = re.DOTALL | re.MULTILINE
-
- tokens = {
- 'commentsandwhitespace': [
- (r'\s+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'^\#.*?\n', Comment.Single)
- ],
- 'slashstartsregex': [
- include('commentsandwhitespace'),
- (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
- (r'(?=/)', Text, ('#pop', 'badregex')),
- default('#pop')
- ],
- 'badregex': [
- (r'\n', Text, '#pop')
- ],
- 'root': [
- include('commentsandwhitespace'),
- (r'\n', Text),
- (r'[^\S\n]+', Text),
- (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|\.\.'
- r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
- (r'[=+\-*/]', Operator),
- (r'(for|in|while|do|break|return|continue|if|else|'
- r'throw|try|catch'
- r')\b', Keyword, 'slashstartsregex'),
- (r'(var)\b', Keyword.Declaration, 'slashstartsregex'),
- (r'(attr|def|fun)\b', Keyword.Reserved),
- (r'(true|false)\b', Keyword.Constant),
- (r'(eval|throw)\b', Name.Builtin),
- (r'`\S+`', Name.Builtin),
- (r'[$a-zA-Z_]\w*', 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, 'dqstring'),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- ],
- 'dqstring': [
- (r'\$\{[^"}]+?\}', String.Interpol),
- (r'\$', String.Double),
- (r'\\\\', String.Double),
- (r'\\"', String.Double),
- (r'[^\\"$]+', String.Double),
- (r'"', String.Double, '#pop'),
- ],
- }
-
-
-class LSLLexer(RegexLexer):
- """
- For Second Life's Linden Scripting Language source code.
-
- .. versionadded:: 2.0
- """
-
- name = 'LSL'
- aliases = ['lsl']
- filenames = ['*.lsl']
- mimetypes = ['text/x-lsl']
-
- flags = re.MULTILINE
-
- lsl_keywords = r'\b(?:do|else|for|if|jump|return|while)\b'
- lsl_types = r'\b(?:float|integer|key|list|quaternion|rotation|string|vector)\b'
- lsl_states = r'\b(?:(?:state)\s+\w+|default)\b'
- lsl_events = r'\b(?:state_(?:entry|exit)|touch(?:_(?:start|end))?|(?:land_)?collision(?:_(?:start|end))?|timer|listen|(?:no_)?sensor|control|(?:not_)?at_(?:rot_)?target|money|email|run_time_permissions|changed|attach|dataserver|moving_(?:start|end)|link_message|(?:on|object)_rez|remote_data|http_re(?:sponse|quest)|path_update|transaction_result)\b'
- lsl_functions_builtin = r'\b(?:ll(?:ReturnObjectsBy(?:ID|Owner)|Json(?:2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(?:Mag|Norm|Dist)|Rot(?:Between|2(?:Euler|Fwd|Left|Up))|(?:Euler|Axes)2Rot|Whisper|(?:Region|Owner)?Say|Shout|Listen(?:Control|Remove)?|Sensor(?:Repeat|Remove)?|Detected(?:Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|(?:[GS]et)(?:AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(?:Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(?:Scale|Offset|Rotate)Texture|(?:Rot)?Target(?:Remove)?|(?:Stop)?MoveToTarget|Apply(?:Rotational)?Impulse|Set(?:KeyframedMotion|ContentType|RegionPos|(?:Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(?:Queueing|Radius)|Vehicle(?:Type|(?:Float|Vector|Rotation)Param)|(?:Touch|Sit)?Text|Camera(?:Eye|At)Offset|PrimitiveParams|ClickAction|Link(?:Alpha|Color|PrimitiveParams(?:Fast)?|Texture(?:Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get(?:(?:Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(?:PrimitiveParams|Number(?:OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(?:Details|PermMask|PrimCount)|Parcel(?:MaxPrims|Details|Prim(?:Count|Owners))|Attached|(?:SPMax|Free|Used)Memory|Region(?:Name|TimeDilation|FPS|Corner|AgentCount)|Root(?:Position|Rotation)|UnixTime|(?:Parcel|Region)Flags|(?:Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(?:Prims|NotecardLines|Sides)|Animation(?:List)?|(?:Camera|Local)(?:Pos|Rot)|Vel|Accel|Omega|Time(?:stamp|OfDay)|(?:Object|CenterOf)?Mass|MassMKS|Energy|Owner|(?:Owner)?Key|SunDirection|Texture(?:Offset|Scale|Rot)|Inventory(?:Number|Name|Key|Type|Creator|PermMask)|Permissions(?:Key)?|StartParameter|List(?:Length|EntryType)|Date|Agent(?:Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(?:Name|State))|(?:Get|Reset|GetAndReset)Time|PlaySound(?:Slave)?|LoopSound(?:Master|Slave)?|(?:Trigger|Stop|Preload)Sound|(?:(?:Get|Delete)Sub|Insert)String|To(?:Upper|Lower)|Give(?:InventoryList|Money)|RezObject|(?:Stop)?LookAt|Sleep|CollisionFilter|(?:Take|Release)Controls|DetachFromAvatar|AttachToAvatar(?:Temp)?|InstantMessage|(?:GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(?:Length|Trim)|(?:Start|Stop)Animation|TargetOmega|RequestPermissions|(?:Create|Break)Link|BreakAllLinks|(?:Give|Remove)Inventory|Water|PassTouches|Request(?:Agent|Inventory)Data|TeleportAgent(?:Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(?:Axis|Angle)|A(?:cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(?:CSV|Integer|Json|Float|String|Key|Vector|Rot|List(?:Strided)?)|DeleteSubList|List(?:Statistics|Sort|Randomize|(?:Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(?:CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(?:Slope|Normal|Contour)|GroundRepel|(?:Set|Remove)VehicleFlags|(?:AvatarOn)?(?:Link)?SitTarget|Script(?:Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(?:Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(?:Integer|String)ToBase64|XorBase64|Log(?:10)?|Base64To(?:String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(?:Load|Release|(?:E|Une)scape)URL|ParcelMedia(?:CommandList|Query)|ModPow|MapDestination|(?:RemoveFrom|AddTo|Reset)Land(?:Pass|Ban)List|(?:Set|Clear)CameraParams|HTTP(?:Request|Response)|TextBox|DetectedTouch(?:UV|Face|Pos|(?:N|Bin)ormal|ST)|(?:MD5|SHA1|DumpList2)String|Request(?:Secure)?URL|Clear(?:Prim|Link)Media|(?:Link)?ParticleSystem|(?:Get|Request)(?:Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(?:Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\b'
- lsl_constants_float = r'\b(?:DEG_TO_RAD|PI(?:_BY_TWO)?|RAD_TO_DEG|SQRT2|TWO_PI)\b'
- lsl_constants_integer = r'\b(?:JSON_APPEND|STATUS_(?:PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(?:_OBJECT)?|(?:DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(?:FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(?:_(?:BY_(?:LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(?:PARCEL(?:_OWNER)?|REGION)))?|CAMERA_(?:PITCH|DISTANCE|BEHINDNESS_(?:ANGLE|LAG)|(?:FOCUS|POSITION)(?:_(?:THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(?:ROOT|SET|ALL_(?:OTHERS|CHILDREN)|THIS)|ACTIVE|PASSIVE|SCRIPTED|CONTROL_(?:FWD|BACK|(?:ROT_)?(?:LEFT|RIGHT)|UP|DOWN|(?:ML_)?LBUTTON)|PERMISSION_(?:RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(?:CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(?:TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(?:INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(?:_START)?|TELEPORT|MEDIA)|OBJECT_(?:(?:PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_ON_REZ|NAME|DESC|POS|PRIM_EQUIVALENCE|RETURN_(?:PARCEL(?:_OWNER)?|REGION)|ROO?T|VELOCITY|OWNER|GROUP|CREATOR|ATTACHED_POINT|RENDER_WEIGHT|PATHFINDING_TYPE|(?:RUNNING|TOTAL)_SCRIPT_COUNT|SCRIPT_(?:MEMORY|TIME))|TYPE_(?:INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(?:DEBUG|PUBLIC)_CHANNEL|ATTACH_(?:AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](?:SHOULDER|HAND|FOOT|EAR|EYE|[UL](?:ARM|LEG)|HIP)|(?:LEFT|RIGHT)_PEC|HUD_(?:CENTER_[12]|TOP_(?:RIGHT|CENTER|LEFT)|BOTTOM(?:_(?:RIGHT|LEFT))?))|LAND_(?:LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(?:ONLINE|NAME|BORN|SIM_(?:POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(?:ON_FILE|USED)|REMOTE_DATA_(?:CHANNEL|REQUEST|REPLY)|PSYS_(?:PART_(?:BF_(?:ZERO|ONE(?:_MINUS_(?:DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(?:START|END)_(?:COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(?:RIBBON|WIND|INTERP_(?:COLOR|SCALE)|BOUNCE|FOLLOW_(?:SRC|VELOCITY)|TARGET_(?:POS|LINEAR)|EMISSIVE)_MASK)|SRC_(?:MAX_AGE|PATTERN|ANGLE_(?:BEGIN|END)|BURST_(?:RATE|PART_COUNT|RADIUS|SPEED_(?:MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(?:DROP|EXPLODE|ANGLE(?:_CONE(?:_EMPTY)?)?)))|VEHICLE_(?:REFERENCE_FRAME|TYPE_(?:NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(?:LINEAR|ANGULAR)_(?:FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(?:HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(?:LINEAR|ANGULAR)_(?:DEFLECTION_(?:EFFICIENCY|TIMESCALE)|MOTOR_(?:DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(?:EFFICIENCY|TIMESCALE)|BANKING_(?:EFFICIENCY|MIX|TIMESCALE)|FLAG_(?:NO_DEFLECTION_UP|LIMIT_(?:ROLL_ONLY|MOTOR_UP)|HOVER_(?:(?:WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(?:STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(?:TYPE(?:_(?:BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(?:DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(?:_(?:STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(?:NONE|LOW|MEDIUM|HIGH)|BUMP_(?:NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(?:DEFAULT|PLANAR)|SCULPT_(?:TYPE_(?:SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(?:MIRROR|INVERT))|PHYSICS(?:_(?:SHAPE_(?:CONVEX|NONE|PRIM|TYPE)))?|(?:POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(?:ALT_IMAGE_ENABLE|CONTROLS|(?:CURRENT|HOME)_URL|AUTO_(?:LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(?:WIDTH|HEIGHT)_PIXELS|WHITELIST(?:_ENABLE)?|PERMS_(?:INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(?:STANDARD|MINI)|PERM_(?:NONE|OWNER|GROUP|ANYONE)|MAX_(?:URL_LENGTH|WHITELIST_(?:SIZE|COUNT)|(?:WIDTH|HEIGHT)_PIXELS)))|MASK_(?:BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(?:TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(?:MEDIA_COMMAND_(?:STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(?:ALLOW_(?:FLY|(?:GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(?:GROUP_)?OBJECTS)|USE_(?:ACCESS_(?:GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(?:GROUP|ALL)_OBJECT_ENTRY)|COUNT_(?:TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(?:NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(?:MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(?:_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(?:HIDE|DEFAULT)|REGION_FLAG_(?:ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(?:COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(?:METHOD|MIMETYPE|BODY_(?:MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|STRING_(?:TRIM(?:_(?:HEAD|TAIL))?)|CLICK_ACTION_(?:NONE|TOUCH|SIT|BUY|PAY|OPEN(?:_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(?:NONE|SCRIPT_MEMORY)|RC_(?:DATA_FLAGS|DETECT_PHANTOM|GET_(?:LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(?:TYPES|AGENTS|(?:NON)?PHYSICAL|LAND))|RCERR_(?:CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(?:ALLOWED_(?:AGENT|GROUP)_(?:ADD|REMOVE)|BANNED_AGENT_(?:ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(?:COMMAND|CMD_(?:PLAY|STOP|PAUSE|SET_MODE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(?:GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(?:CMD_(?:(?:SMOOTH_)?STOP|JUMP)|DESIRED_(?:TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(?:_(?:[A-D]|NONE))?|MAX_(?:DECEL|TURN_RADIUS|(?:ACCEL|SPEED)))|PURSUIT_(?:OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(?:CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(?:EVADE_(?:HIDDEN|SPOTTED)|FAILURE_(?:DYNAMIC_PATHFINDING_DISABLED|INVALID_(?:GOAL|START)|NO_(?:NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(?:PARCEL_)?UNREACHABLE)|(?:GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(?:_(?:FAST|NONE|SLOW))?|CONTENT_TYPE_(?:ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(?:RADIUS|STATIC)|(?:PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(?:AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\b'
- lsl_constants_integer_boolean = r'\b(?:FALSE|TRUE)\b'
- lsl_constants_rotation = r'\b(?:ZERO_ROTATION)\b'
- lsl_constants_string = r'\b(?:EOF|JSON_(?:ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(?:BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(?:GRANTED|DENIED))\b'
- lsl_constants_vector = r'\b(?:TOUCH_INVALID_(?:TEXCOORD|VECTOR)|ZERO_VECTOR)\b'
- lsl_invalid_broken = r'\b(?:LAND_(?:LARGE|MEDIUM|SMALL)_BRUSH)\b'
- lsl_invalid_deprecated = r'\b(?:ATTACH_[LR]PEC|DATA_RATING|OBJECT_ATTACHMENT_(?:GEOMETRY_BYTES|SURFACE_AREA)|PRIM_(?:CAST_SHADOWS|MATERIAL_LIGHT|TYPE_LEGACY)|PSYS_SRC_(?:INNER|OUTER)ANGLE|VEHICLE_FLAG_NO_FLY_UP|ll(?:Cloud|Make(?:Explosion|Fountain|Smoke|Fire)|RemoteDataSetRegion|Sound(?:Preload)?|XorBase64Strings(?:Correct)?))\b'
- lsl_invalid_illegal = r'\b(?:event)\b'
- lsl_invalid_unimplemented = r'\b(?:CHARACTER_(?:MAX_ANGULAR_(?:ACCEL|SPEED)|TURN_SPEED_MULTIPLIER)|PERMISSION_(?:CHANGE_(?:JOINTS|PERMISSIONS)|RELEASE_OWNERSHIP|REMAP_CONTROLS)|PRIM_PHYSICS_MATERIAL|PSYS_SRC_OBJ_REL_MASK|ll(?:CollisionSprite|(?:Stop)?PointAt|(?:(?:Refresh|Set)Prim)URL|(?:Take|Release)Camera|RemoteLoadScript))\b'
- lsl_reserved_godmode = r'\b(?:ll(?:GodLikeRezObject|Set(?:Inventory|Object)PermMask))\b'
- lsl_reserved_log = r'\b(?:print)\b'
- lsl_operators = r'\+\+|\-\-|<<|>>|&&?|\|\|?|\^|~|[!%<>=*+\-/]=?'
-
- tokens = {
- 'root':
- [
- (r'//.*?\n', Comment.Single),
- (r'/\*', Comment.Multiline, 'comment'),
- (r'"', String.Double, 'string'),
- (lsl_keywords, Keyword),
- (lsl_types, Keyword.Type),
- (lsl_states, Name.Class),
- (lsl_events, Name.Builtin),
- (lsl_functions_builtin, Name.Function),
- (lsl_constants_float, Keyword.Constant),
- (lsl_constants_integer, Keyword.Constant),
- (lsl_constants_integer_boolean, Keyword.Constant),
- (lsl_constants_rotation, Keyword.Constant),
- (lsl_constants_string, Keyword.Constant),
- (lsl_constants_vector, Keyword.Constant),
- (lsl_invalid_broken, Error),
- (lsl_invalid_deprecated, Error),
- (lsl_invalid_illegal, Error),
- (lsl_invalid_unimplemented, Error),
- (lsl_reserved_godmode, Keyword.Reserved),
- (lsl_reserved_log, Keyword.Reserved),
- (r'\b([a-zA-Z_]\w*)\b', Name.Variable),
- (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d*', Number.Float),
- (r'(\d+\.\d*|\.\d+)', Number.Float),
- (r'0[xX][0-9a-fA-F]+', Number.Hex),
- (r'\d+', Number.Integer),
- (lsl_operators, Operator),
- (r':=?', Error),
- (r'[,;{}()\[\]]', Punctuation),
- (r'\n+', Whitespace),
- (r'\s+', Whitespace)
- ],
- 'comment':
- [
- (r'[^*/]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ],
- 'string':
- [
- (r'\\([nt"\\])', String.Escape),
- (r'"', String.Double, '#pop'),
- (r'\\.', Error),
- (r'[^"\\]+', String.Double),
- ]
- }
-
-
-class AppleScriptLexer(RegexLexer):
- """
- For `AppleScript source code
- <http://developer.apple.com/documentation/AppleScript/
- Conceptual/AppleScriptLangGuide>`_,
- including `AppleScript Studio
- <http://developer.apple.com/documentation/AppleScript/
- Reference/StudioReference>`_.
- Contributed by Andreas Amann <aamann@mac.com>.
-
- .. versionadded:: 1.0
- """
-
- name = 'AppleScript'
- aliases = ['applescript']
- filenames = ['*.applescript']
-
- flags = re.MULTILINE | re.DOTALL
-
- Identifiers = r'[a-zA-Z]\w*'
-
- # XXX: use words() for all of these
- Literals = ('AppleScript', 'current application', 'false', 'linefeed',
- 'missing value', 'pi', 'quote', 'result', 'return', 'space',
- 'tab', 'text item delimiters', 'true', 'version')
- 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')
- BuiltIn = ('attachment', 'attribute run', 'character', 'day', 'month',
- 'paragraph', 'word', 'year')
- HandlerParams = ('about', 'above', 'against', 'apart from', 'around',
- 'aside from', 'at', 'below', 'beneath', 'beside',
- 'between', 'for', 'given', 'instead of', 'on', 'onto',
- 'out of', 'over', 'since')
- Commands = ('ASCII (character|number)', 'activate', 'beep', 'choose URL',
- 'choose application', 'choose color', 'choose file( name)?',
- 'choose folder', 'choose from list',
- 'choose remote application', 'clipboard info',
- 'close( access)?', 'copy', 'count', 'current date', 'delay',
- 'delete', 'display (alert|dialog)', 'do shell script',
- 'duplicate', 'exists', 'get eof', 'get volume settings',
- 'info for', 'launch', 'list (disks|folder)', 'load script',
- 'log', 'make', 'mount volume', 'new', 'offset',
- 'open( (for access|location))?', 'path to', 'print', 'quit',
- 'random number', 'read', 'round', 'run( script)?',
- 'say', 'scripting components',
- 'set (eof|the clipboard to|volume)', 'store script',
- 'summarize', 'system attribute', 'system info',
- 'the clipboard', 'time to GMT', 'write', 'quoted form')
- References = ('(in )?back of', '(in )?front of', '[0-9]+(st|nd|rd|th)',
- 'first', 'second', 'third', 'fourth', 'fifth', 'sixth',
- 'seventh', 'eighth', 'ninth', 'tenth', 'after', 'back',
- 'before', 'behind', 'every', 'front', 'index', 'last',
- 'middle', 'some', 'that', 'through', 'thru', 'where', 'whose')
- Operators = ("and", "or", "is equal", "equals", "(is )?equal to", "is not",
- "isn't", "isn't equal( to)?", "is not equal( to)?",
- "doesn't equal", "does not equal", "(is )?greater than",
- "comes after", "is not less than or equal( to)?",
- "isn't less than or equal( to)?", "(is )?less than",
- "comes before", "is not greater than or equal( to)?",
- "isn't greater than or equal( to)?",
- "(is )?greater than or equal( to)?", "is not less than",
- "isn't less than", "does not come before",
- "doesn't come before", "(is )?less than or equal( to)?",
- "is not greater than", "isn't greater than",
- "does not come after", "doesn't come after", "starts? with",
- "begins? with", "ends? with", "contains?", "does not contain",
- "doesn't contain", "is in", "is contained by", "is not in",
- "is not contained by", "isn't contained by", "div", "mod",
- "not", "(a )?(ref( to)?|reference to)", "is", "does")
- Control = ('considering', 'else', 'error', 'exit', 'from', 'if',
- 'ignoring', 'in', 'repeat', 'tell', 'then', 'times', 'to',
- 'try', 'until', 'using terms from', 'while', 'whith',
- 'with timeout( of)?', 'with transaction', 'by', 'continue',
- 'end', 'its?', 'me', 'my', 'return', 'of', 'as')
- Declarations = ('global', 'local', 'prop(erty)?', 'set', 'get')
- Reserved = ('but', 'put', 'returning', 'the')
- StudioClasses = ('action cell', 'alert reply', 'application', 'box',
- 'browser( cell)?', 'bundle', 'button( cell)?', 'cell',
- 'clip view', 'color well', 'color-panel',
- 'combo box( item)?', 'control',
- 'data( (cell|column|item|row|source))?', 'default entry',
- 'dialog reply', 'document', 'drag info', 'drawer',
- 'event', 'font(-panel)?', 'formatter',
- 'image( (cell|view))?', 'matrix', 'menu( item)?', 'item',
- 'movie( view)?', 'open-panel', 'outline view', 'panel',
- 'pasteboard', 'plugin', 'popup button',
- 'progress indicator', 'responder', 'save-panel',
- 'scroll view', 'secure text field( cell)?', 'slider',
- 'sound', 'split view', 'stepper', 'tab view( item)?',
- 'table( (column|header cell|header view|view))',
- 'text( (field( cell)?|view))?', 'toolbar( item)?',
- 'user-defaults', 'view', 'window')
- StudioEvents = ('accept outline drop', 'accept table drop', 'action',
- 'activated', 'alert ended', 'awake from nib', 'became key',
- 'became main', 'begin editing', 'bounds changed',
- 'cell value', 'cell value changed', 'change cell value',
- 'change item value', 'changed', 'child of item',
- 'choose menu item', 'clicked', 'clicked toolbar item',
- 'closed', 'column clicked', 'column moved',
- 'column resized', 'conclude drop', 'data representation',
- 'deminiaturized', 'dialog ended', 'document nib name',
- 'double clicked', 'drag( (entered|exited|updated))?',
- 'drop', 'end editing', 'exposed', 'idle', 'item expandable',
- 'item value', 'item value changed', 'items changed',
- 'keyboard down', 'keyboard up', 'launched',
- 'load data representation', 'miniaturized', 'mouse down',
- 'mouse dragged', 'mouse entered', 'mouse exited',
- 'mouse moved', 'mouse up', 'moved',
- 'number of browser rows', 'number of items',
- 'number of rows', 'open untitled', 'opened', 'panel ended',
- 'parameters updated', 'plugin loaded', 'prepare drop',
- 'prepare outline drag', 'prepare outline drop',
- 'prepare table drag', 'prepare table drop',
- 'read from file', 'resigned active', 'resigned key',
- 'resigned main', 'resized( sub views)?',
- 'right mouse down', 'right mouse dragged',
- 'right mouse up', 'rows changed', 'scroll wheel',
- 'selected tab view item', 'selection changed',
- 'selection changing', 'should begin editing',
- 'should close', 'should collapse item',
- 'should end editing', 'should expand item',
- 'should open( untitled)?',
- 'should quit( after last window closed)?',
- 'should select column', 'should select item',
- 'should select row', 'should select tab view item',
- 'should selection change', 'should zoom', 'shown',
- 'update menu item', 'update parameters',
- 'update toolbar item', 'was hidden', 'was miniaturized',
- 'will become active', 'will close', 'will dismiss',
- 'will display browser cell', 'will display cell',
- 'will display item cell', 'will display outline cell',
- 'will finish launching', 'will hide', 'will miniaturize',
- 'will move', 'will open', 'will pop up', 'will quit',
- 'will resign active', 'will resize( sub views)?',
- 'will select tab view item', 'will show', 'will zoom',
- 'write to file', 'zoomed')
- StudioCommands = ('animate', 'append', 'call method', 'center',
- 'close drawer', 'close panel', 'display',
- 'display alert', 'display dialog', 'display panel', 'go',
- 'hide', 'highlight', 'increment', 'item for',
- 'load image', 'load movie', 'load nib', 'load panel',
- 'load sound', 'localized string', 'lock focus', 'log',
- 'open drawer', 'path for', 'pause', 'perform action',
- 'play', 'register', 'resume', 'scroll', 'select( all)?',
- 'show', 'size to fit', 'start', 'step back',
- 'step forward', 'stop', 'synchronize', 'unlock focus',
- 'update')
- StudioProperties = ('accepts arrow key', 'action method', 'active',
- 'alignment', 'allowed identifiers',
- 'allows branch selection', 'allows column reordering',
- 'allows column resizing', 'allows column selection',
- 'allows customization',
- 'allows editing text attributes',
- 'allows empty selection', 'allows mixed state',
- 'allows multiple selection', 'allows reordering',
- 'allows undo', 'alpha( value)?', 'alternate image',
- 'alternate increment value', 'alternate title',
- 'animation delay', 'associated file name',
- 'associated object', 'auto completes', 'auto display',
- 'auto enables items', 'auto repeat',
- 'auto resizes( outline column)?',
- 'auto save expanded items', 'auto save name',
- 'auto save table columns', 'auto saves configuration',
- 'auto scroll', 'auto sizes all columns to fit',
- 'auto sizes cells', 'background color', 'bezel state',
- 'bezel style', 'bezeled', 'border rect', 'border type',
- 'bordered', 'bounds( rotation)?', 'box type',
- 'button returned', 'button type',
- 'can choose directories', 'can choose files',
- 'can draw', 'can hide',
- 'cell( (background color|size|type))?', 'characters',
- 'class', 'click count', 'clicked( data)? column',
- 'clicked data item', 'clicked( data)? row',
- 'closeable', 'collating', 'color( (mode|panel))',
- 'command key down', 'configuration',
- 'content(s| (size|view( margins)?))?', 'context',
- 'continuous', 'control key down', 'control size',
- 'control tint', 'control view',
- 'controller visible', 'coordinate system',
- 'copies( on scroll)?', 'corner view', 'current cell',
- 'current column', 'current( field)? editor',
- 'current( menu)? item', 'current row',
- 'current tab view item', 'data source',
- 'default identifiers', 'delta (x|y|z)',
- 'destination window', 'directory', 'display mode',
- 'displayed cell', 'document( (edited|rect|view))?',
- 'double value', 'dragged column', 'dragged distance',
- 'dragged items', 'draws( cell)? background',
- 'draws grid', 'dynamically scrolls', 'echos bullets',
- 'edge', 'editable', 'edited( data)? column',
- 'edited data item', 'edited( data)? row', 'enabled',
- 'enclosing scroll view', 'ending page',
- 'error handling', 'event number', 'event type',
- 'excluded from windows menu', 'executable path',
- 'expanded', 'fax number', 'field editor', 'file kind',
- 'file name', 'file type', 'first responder',
- 'first visible column', 'flipped', 'floating',
- 'font( panel)?', 'formatter', 'frameworks path',
- 'frontmost', 'gave up', 'grid color', 'has data items',
- 'has horizontal ruler', 'has horizontal scroller',
- 'has parent data item', 'has resize indicator',
- 'has shadow', 'has sub menu', 'has vertical ruler',
- 'has vertical scroller', 'header cell', 'header view',
- 'hidden', 'hides when deactivated', 'highlights by',
- 'horizontal line scroll', 'horizontal page scroll',
- 'horizontal ruler view', 'horizontally resizable',
- 'icon image', 'id', 'identifier',
- 'ignores multiple clicks',
- 'image( (alignment|dims when disabled|frame style|scaling))?',
- 'imports graphics', 'increment value',
- 'indentation per level', 'indeterminate', 'index',
- 'integer value', 'intercell spacing', 'item height',
- 'key( (code|equivalent( modifier)?|window))?',
- 'knob thickness', 'label', 'last( visible)? column',
- 'leading offset', 'leaf', 'level', 'line scroll',
- 'loaded', 'localized sort', 'location', 'loop mode',
- 'main( (bunde|menu|window))?', 'marker follows cell',
- 'matrix mode', 'maximum( content)? size',
- 'maximum visible columns',
- 'menu( form representation)?', 'miniaturizable',
- 'miniaturized', 'minimized image', 'minimized title',
- 'minimum column width', 'minimum( content)? size',
- 'modal', 'modified', 'mouse down state',
- 'movie( (controller|file|rect))?', 'muted', 'name',
- 'needs display', 'next state', 'next text',
- 'number of tick marks', 'only tick mark values',
- 'opaque', 'open panel', 'option key down',
- 'outline table column', 'page scroll', 'pages across',
- 'pages down', 'palette label', 'pane splitter',
- 'parent data item', 'parent window', 'pasteboard',
- 'path( (names|separator))?', 'playing',
- 'plays every frame', 'plays selection only', 'position',
- 'preferred edge', 'preferred type', 'pressure',
- 'previous text', 'prompt', 'properties',
- 'prototype cell', 'pulls down', 'rate',
- 'released when closed', 'repeated',
- 'requested print time', 'required file type',
- 'resizable', 'resized column', 'resource path',
- 'returns records', 'reuses columns', 'rich text',
- 'roll over', 'row height', 'rulers visible',
- 'save panel', 'scripts path', 'scrollable',
- 'selectable( identifiers)?', 'selected cell',
- 'selected( data)? columns?', 'selected data items?',
- 'selected( data)? rows?', 'selected item identifier',
- 'selection by rect', 'send action on arrow key',
- 'sends action when done editing', 'separates columns',
- 'separator item', 'sequence number', 'services menu',
- 'shared frameworks path', 'shared support path',
- 'sheet', 'shift key down', 'shows alpha',
- 'shows state by', 'size( mode)?',
- 'smart insert delete enabled', 'sort case sensitivity',
- 'sort column', 'sort order', 'sort type',
- 'sorted( data rows)?', 'sound', 'source( mask)?',
- 'spell checking enabled', 'starting page', 'state',
- 'string value', 'sub menu', 'super menu', 'super view',
- 'tab key traverses cells', 'tab state', 'tab type',
- 'tab view', 'table view', 'tag', 'target( printer)?',
- 'text color', 'text container insert',
- 'text container origin', 'text returned',
- 'tick mark position', 'time stamp',
- 'title(d| (cell|font|height|position|rect))?',
- 'tool tip', 'toolbar', 'trailing offset', 'transparent',
- 'treat packages as directories', 'truncated labels',
- 'types', 'unmodified characters', 'update views',
- 'use sort indicator', 'user defaults',
- 'uses data source', 'uses ruler',
- 'uses threaded animation',
- 'uses title from previous column', 'value wraps',
- 'version',
- 'vertical( (line scroll|page scroll|ruler view))?',
- 'vertically resizable', 'view',
- 'visible( document rect)?', 'volume', 'width', 'window',
- 'windows menu', 'wraps', 'zoomable', 'zoomed')
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (u'¬\\n', String.Escape),
- (r"'s\s+", Text), # This is a possessive, consider moving
- (r'(--|#).*?$', Comment),
- (r'\(\*', Comment.Multiline, 'comment'),
- (r'[(){}!,.:]', Punctuation),
- (u'(«)([^»]+)(»)',
- bygroups(Text, Name.Builtin, Text)),
- (r'\b((?:considering|ignoring)\s*)'
- r'(application responses|case|diacriticals|hyphens|'
- r'numeric strings|punctuation|white space)',
- bygroups(Keyword, Name.Builtin)),
- (u'(-|\\*|\\+|&|≠|>=?|<=?|=|≥|≤|/|÷|\\^)', Operator),
- (r"\b(%s)\b" % '|'.join(Operators), Operator.Word),
- (r'^(\s*(?:on|end)\s+)'
- 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),
- bygroups(Keyword, Name.Class)),
- (r'\b(%s)\b' % '|'.join(Literals), Name.Constant),
- (r'\b(%s)\b' % '|'.join(Commands), Name.Builtin),
- (r'\b(%s)\b' % '|'.join(Control), Keyword),
- (r'\b(%s)\b' % '|'.join(Declarations), Keyword),
- (r'\b(%s)\b' % '|'.join(Reserved), Name.Builtin),
- (r'\b(%s)s?\b' % '|'.join(BuiltIn), Name.Builtin),
- (r'\b(%s)\b' % '|'.join(HandlerParams), Name.Builtin),
- (r'\b(%s)\b' % '|'.join(StudioProperties), Name.Attribute),
- (r'\b(%s)s?\b' % '|'.join(StudioClasses), Name.Builtin),
- (r'\b(%s)\b' % '|'.join(StudioCommands), Name.Builtin),
- (r'\b(%s)\b' % '|'.join(References), Name.Builtin),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r'\b(%s)\b' % Identifiers, Name.Variable),
- (r'[-+]?(\d+\.\d*|\d*\.\d+)(E[-+][0-9]+)?', Number.Float),
- (r'[-+]?\d+', Number.Integer),
- ],
- 'comment': [
- (r'\(\*', Comment.Multiline, '#push'),
- (r'\*\)', Comment.Multiline, '#pop'),
- ('[^*(]+', Comment.Multiline),
- ('[*(]', Comment.Multiline),
- ],
- }
-
-
-class RexxLexer(RegexLexer):
- """
- `Rexx <http://www.rexxinfo.org/>`_ is a scripting language available for
- a wide range of different platforms with its roots found on mainframe
- systems. It is popular for I/O- and data based tasks and can act as glue
- language to bind different applications together.
-
- .. versionadded:: 2.0
- """
- name = 'Rexx'
- aliases = ['rexx', 'arexx']
- filenames = ['*.rexx', '*.rex', '*.rx', '*.arexx']
- mimetypes = ['text/x-rexx']
- flags = re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'\s', Whitespace),
- (r'/\*', Comment.Multiline, 'comment'),
- (r'"', String, 'string_double'),
- (r"'", String, 'string_single'),
- (r'[0-9]+(\.[0-9]+)?(e[+-]?[0-9])?', Number),
- (r'([a-z_]\w*)(\s*)(:)(\s*)(procedure)\b',
- bygroups(Name.Function, Whitespace, Operator, Whitespace,
- Keyword.Declaration)),
- (r'([a-z_]\w*)(\s*)(:)',
- bygroups(Name.Label, Whitespace, Operator)),
- include('function'),
- include('keyword'),
- include('operator'),
- (r'[a-z_]\w*', Text),
- ],
- 'function': [
- (words((
- 'abbrev', 'abs', 'address', 'arg', 'b2x', 'bitand', 'bitor', 'bitxor',
- 'c2d', 'c2x', 'center', 'charin', 'charout', 'chars', 'compare',
- 'condition', 'copies', 'd2c', 'd2x', 'datatype', 'date', 'delstr',
- 'delword', 'digits', 'errortext', 'form', 'format', 'fuzz', 'insert',
- 'lastpos', 'left', 'length', 'linein', 'lineout', 'lines', 'max',
- 'min', 'overlay', 'pos', 'queued', 'random', 'reverse', 'right', 'sign',
- 'sourceline', 'space', 'stream', 'strip', 'substr', 'subword', 'symbol',
- 'time', 'trace', 'translate', 'trunc', 'value', 'verify', 'word',
- 'wordindex', 'wordlength', 'wordpos', 'words', 'x2b', 'x2c', 'x2d',
- 'xrange'), suffix=r'(\s*)(\()'),
- bygroups(Name.Builtin, Whitespace, Operator)),
- ],
- 'keyword': [
- (r'(address|arg|by|call|do|drop|else|end|exit|for|forever|if|'
- r'interpret|iterate|leave|nop|numeric|off|on|options|parse|'
- r'pull|push|queue|return|say|select|signal|to|then|trace|until|'
- r'while)\b', Keyword.Reserved),
- ],
- 'operator': [
- (r'(-|//|/|\(|\)|\*\*|\*|\\<<|\\<|\\==|\\=|\\>>|\\>|\\|\|\||\||'
- r'&&|&|%|\+|<<=|<<|<=|<>|<|==|=|><|>=|>>=|>>|>|¬<<|¬<|¬==|¬=|'
- r'¬>>|¬>|¬|\.|,)', Operator),
- ],
- 'string_double': [
- (r'[^"\n]+', String),
- (r'""', String),
- (r'"', String, '#pop'),
- (r'\n', Text, '#pop'), # Stray linefeed also terminates strings.
- ],
- 'string_single': [
- (r'[^\'\n]', String),
- (r'\'\'', String),
- (r'\'', String, '#pop'),
- (r'\n', Text, '#pop'), # Stray linefeed also terminates strings.
- ],
- 'comment': [
- (r'[^*]+', Comment.Multiline),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'\*', Comment.Multiline),
- ]
- }
-
- _c = lambda s: re.compile(s, re.MULTILINE)
- _ADDRESS_COMMAND_PATTERN = _c(r'^\s*address\s+command\b')
- _ADDRESS_PATTERN = _c(r'^\s*address\s+')
- _DO_WHILE_PATTERN = _c(r'^\s*do\s+while\b')
- _IF_THEN_DO_PATTERN = _c(r'^\s*if\b.+\bthen\s+do\s*$')
- _PROCEDURE_PATTERN = _c(r'^\s*([a-z_]\w*)(\s*)(:)(\s*)(procedure)\b')
- _ELSE_DO_PATTERN = _c(r'\belse\s+do\s*$')
- _PARSE_ARG_PATTERN = _c(r'^\s*parse\s+(upper\s+)?(arg|value)\b')
- PATTERNS_AND_WEIGHTS = (
- (_ADDRESS_COMMAND_PATTERN, 0.2),
- (_ADDRESS_PATTERN, 0.05),
- (_DO_WHILE_PATTERN, 0.1),
- (_ELSE_DO_PATTERN, 0.1),
- (_IF_THEN_DO_PATTERN, 0.1),
- (_PROCEDURE_PATTERN, 0.5),
- (_PARSE_ARG_PATTERN, 0.2),
- )
-
- def analyse_text(text):
- """
- Check for inital comment and patterns that distinguish Rexx from other
- C-like languages.
- """
- if re.search(r'/\*\**\s*rexx', text, re.IGNORECASE):
- # Header matches MVS Rexx requirements, this is certainly a Rexx
- # script.
- return 1.0
- elif text.startswith('/*'):
- # Header matches general Rexx requirements; the source code might
- # still be any language using C comments such as C++, C# or Java.
- lowerText = text.lower()
- result = sum(weight
- for (pattern, weight) in RexxLexer.PATTERNS_AND_WEIGHTS
- if pattern.search(lowerText)) + 0.01
- return min(result, 1.0)
-
-
-class MOOCodeLexer(RegexLexer):
- """
- For `MOOCode <http://www.moo.mud.org/>`_ (the MOO scripting
- language).
-
- .. versionadded:: 0.9
- """
- name = 'MOOCode'
- filenames = ['*.moo']
- aliases = ['moocode', 'moo']
- mimetypes = ['text/x-moocode']
-
- tokens = {
- 'root': [
- # Numbers
- (r'(0|[1-9][0-9_]*)', Number.Integer),
- # Strings
- (r'"(\\\\|\\"|[^"])*"', String),
- # exceptions
- (r'(E_PERM|E_DIV)', Name.Exception),
- # db-refs
- (r'((#[-0-9]+)|(\$\w+))', Name.Entity),
- # Keywords
- (r'\b(if|else|elseif|endif|for|endfor|fork|endfork|while'
- r'|endwhile|break|continue|return|try'
- r'|except|endtry|finally|in)\b', Keyword),
- # builtins
- (r'(random|length)', Name.Builtin),
- # special variables
- (r'(player|caller|this|args)', Name.Variable.Instance),
- # skip whitespace
- (r'\s+', Text),
- (r'\n', Text),
- # other operators
- (r'([!;=,{}&|:.\[\]@()<>?]+)', Operator),
- # function call
- (r'(\w+)(\()', bygroups(Name.Function, Operator)),
- # variables
- (r'(\w+)', Text),
- ]
- }
-
-
-class HybrisLexer(RegexLexer):
- """
- For `Hybris <http://www.hybris-lang.org>`_ source code.
-
- .. versionadded:: 1.4
- """
-
- name = 'Hybris'
- aliases = ['hybris', 'hy']
- filenames = ['*.hy', '*.hyb']
- mimetypes = ['text/x-hybris', 'application/x-hybris']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- # method names
- (r'^(\s*(?:function|method|operator\s+)+?)'
- r'([a-zA-Z_]\w*)'
- r'(\s*)(\()', bygroups(Keyword, Name.Function, Text, Operator)),
- (r'[^\S\n]+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline),
- (r'@[a-zA-Z_][\w.]*', Name.Decorator),
- (r'(break|case|catch|next|default|do|else|finally|for|foreach|of|'
- r'unless|if|new|return|switch|me|throw|try|while)\b', Keyword),
- (r'(extends|private|protected|public|static|throws|function|method|'
- r'operator)\b', Keyword.Declaration),
- (r'(true|false|null|__FILE__|__LINE__|__VERSION__|__LIB_PATH__|'
- r'__INC_PATH__)\b', Keyword.Constant),
- (r'(class|struct)(\s+)',
- bygroups(Keyword.Declaration, Text), 'class'),
- (r'(import|include)(\s+)',
- bygroups(Keyword.Namespace, Text), 'import'),
- (words((
- 'gc_collect', 'gc_mm_items', 'gc_mm_usage', 'gc_collect_threshold',
- 'urlencode', 'urldecode', 'base64encode', 'base64decode', 'sha1', 'crc32',
- 'sha2', 'md5', 'md5_file', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos',
- 'cosh', 'exp', 'fabs', 'floor', 'fmod', 'log', 'log10', 'pow', 'sin',
- 'sinh', 'sqrt', 'tan', 'tanh', 'isint', 'isfloat', 'ischar', 'isstring',
- 'isarray', 'ismap', 'isalias', 'typeof', 'sizeof', 'toint', 'tostring',
- 'fromxml', 'toxml', 'binary', 'pack', 'load', 'eval', 'var_names',
- 'var_values', 'user_functions', 'dyn_functions', 'methods', 'call',
- 'call_method', 'mknod', 'mkfifo', 'mount', 'umount2', 'umount', 'ticks',
- 'usleep', 'sleep', 'time', 'strtime', 'strdate', 'dllopen', 'dlllink',
- 'dllcall', 'dllcall_argv', 'dllclose', 'env', 'exec', 'fork', 'getpid',
- 'wait', 'popen', 'pclose', 'exit', 'kill', 'pthread_create',
- 'pthread_create_argv', 'pthread_exit', 'pthread_join', 'pthread_kill',
- 'smtp_send', 'http_get', 'http_post', 'http_download', 'socket', 'bind',
- 'listen', 'accept', 'getsockname', 'getpeername', 'settimeout', 'connect',
- 'server', 'recv', 'send', 'close', 'print', 'println', 'printf', 'input',
- 'readline', 'serial_open', 'serial_fcntl', 'serial_get_attr',
- 'serial_get_ispeed', 'serial_get_ospeed', 'serial_set_attr',
- 'serial_set_ispeed', 'serial_set_ospeed', 'serial_write', 'serial_read',
- 'serial_close', 'xml_load', 'xml_parse', 'fopen', 'fseek', 'ftell',
- 'fsize', 'fread', 'fwrite', 'fgets', 'fclose', 'file', 'readdir',
- 'pcre_replace', 'size', 'pop', 'unmap', 'has', 'keys', 'values',
- 'length', 'find', 'substr', 'replace', 'split', 'trim', 'remove',
- 'contains', 'join'), suffix=r'\b'),
- Name.Builtin),
- (words((
- 'MethodReference', 'Runner', 'Dll', 'Thread', 'Pipe', 'Process',
- 'Runnable', 'CGI', 'ClientSocket', 'Socket', 'ServerSocket',
- 'File', 'Console', 'Directory', 'Exception'), suffix=r'\b'),
- Keyword.Type),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
- (r'(\.)([a-zA-Z_]\w*)',
- bygroups(Operator, Name.Attribute)),
- (r'[a-zA-Z_]\w*:', Name.Label),
- (r'[a-zA-Z_$]\w*', 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_]\w*', Name.Class, '#pop')
- ],
- 'import': [
- (r'[\w.]+\*?', Name.Namespace, '#pop')
- ],
- }
-
-
-class EasytrieveLexer(RegexLexer):
- """
- Easytrieve Plus is a programming language for extracting, filtering and
- converting sequential data. Furthermore it can layout data for reports.
- It is mainly used on mainframe platforms and can access several of the
- mainframe's native file formats. It is somewhat comparable to awk.
-
- .. versionadded:: 2.1
- """
- name = 'Easytrieve'
- aliases = ['easytrieve']
- filenames = ['*.ezt', '*.mac']
- mimetypes = ['text/x-easytrieve']
- flags = 0
-
- # Note: We cannot use r'\b' at the start and end of keywords because
- # Easytrieve Plus delimiter characters are:
- #
- # * space ( )
- # * apostrophe (')
- # * period (.)
- # * comma (,)
- # * paranthesis ( and )
- # * colon (:)
- #
- # Additionally words end once a '*' appears, indicatins a comment.
- _DELIMITERS = r' \'.,():\n'
- _DELIMITERS_OR_COMENT = _DELIMITERS + '*'
- _DELIMITER_PATTERN = '[' + _DELIMITERS + ']'
- _DELIMITER_PATTERN_CAPTURE = '(' + _DELIMITER_PATTERN + ')'
- _NON_DELIMITER_OR_COMMENT_PATTERN = '[^' + _DELIMITERS_OR_COMENT + ']'
- _OPERATORS_PATTERN = u'[.+\\-/=\\[\\](){}<>;,&%¬]'
- _KEYWORDS = [
- 'AFTER-BREAK', 'AFTER-LINE', 'AFTER-SCREEN', 'AIM', 'AND', 'ATTR',
- 'BEFORE', 'BEFORE-BREAK', 'BEFORE-LINE', 'BEFORE-SCREEN', 'BUSHU',
- 'BY', 'CALL', 'CASE', 'CHECKPOINT', 'CHKP', 'CHKP-STATUS', 'CLEAR',
- 'CLOSE', 'COL', 'COLOR', 'COMMIT', 'CONTROL', 'COPY', 'CURSOR', 'D',
- 'DECLARE', 'DEFAULT', 'DEFINE', 'DELETE', 'DENWA', 'DISPLAY', 'DLI',
- 'DO', 'DUPLICATE', 'E', 'ELSE', 'ELSE-IF', 'END', 'END-CASE',
- 'END-DO', 'END-IF', 'END-PROC', 'ENDPAGE', 'ENDTABLE', 'ENTER', 'EOF',
- 'EQ', 'ERROR', 'EXIT', 'EXTERNAL', 'EZLIB', 'F1', 'F10', 'F11', 'F12',
- 'F13', 'F14', 'F15', 'F16', 'F17', 'F18', 'F19', 'F2', 'F20', 'F21',
- 'F22', 'F23', 'F24', 'F25', 'F26', 'F27', 'F28', 'F29', 'F3', 'F30',
- 'F31', 'F32', 'F33', 'F34', 'F35', 'F36', 'F4', 'F5', 'F6', 'F7',
- 'F8', 'F9', 'FETCH', 'FILE-STATUS', 'FILL', 'FINAL', 'FIRST',
- 'FIRST-DUP', 'FOR', 'GE', 'GET', 'GO', 'GOTO', 'GQ', 'GR', 'GT',
- 'HEADING', 'HEX', 'HIGH-VALUES', 'IDD', 'IDMS', 'IF', 'IN', 'INSERT',
- 'JUSTIFY', 'KANJI-DATE', 'KANJI-DATE-LONG', 'KANJI-TIME', 'KEY',
- 'KEY-PRESSED', 'KOKUGO', 'KUN', 'LAST-DUP', 'LE', 'LEVEL', 'LIKE',
- 'LINE', 'LINE-COUNT', 'LINE-NUMBER', 'LINK', 'LIST', 'LOW-VALUES',
- 'LQ', 'LS', 'LT', 'MACRO', 'MASK', 'MATCHED', 'MEND', 'MESSAGE',
- 'MOVE', 'MSTART', 'NE', 'NEWPAGE', 'NOMASK', 'NOPRINT', 'NOT',
- 'NOTE', 'NOVERIFY', 'NQ', 'NULL', 'OF', 'OR', 'OTHERWISE', 'PA1',
- 'PA2', 'PA3', 'PAGE-COUNT', 'PAGE-NUMBER', 'PARM-REGISTER',
- 'PATH-ID', 'PATTERN', 'PERFORM', 'POINT', 'POS', 'PRIMARY', 'PRINT',
- 'PROCEDURE', 'PROGRAM', 'PUT', 'READ', 'RECORD', 'RECORD-COUNT',
- 'RECORD-LENGTH', 'REFRESH', 'RELEASE', 'RENUM', 'REPEAT', 'REPORT',
- 'REPORT-INPUT', 'RESHOW', 'RESTART', 'RETRIEVE', 'RETURN-CODE',
- 'ROLLBACK', 'ROW', 'S', 'SCREEN', 'SEARCH', 'SECONDARY', 'SELECT',
- 'SEQUENCE', 'SIZE', 'SKIP', 'SOKAKU', 'SORT', 'SQL', 'STOP', 'SUM',
- 'SYSDATE', 'SYSDATE-LONG', 'SYSIN', 'SYSIPT', 'SYSLST', 'SYSPRINT',
- 'SYSSNAP', 'SYSTIME', 'TALLY', 'TERM-COLUMNS', 'TERM-NAME',
- 'TERM-ROWS', 'TERMINATION', 'TITLE', 'TO', 'TRANSFER', 'TRC',
- 'UNIQUE', 'UNTIL', 'UPDATE', 'UPPERCASE', 'USER', 'USERID', 'VALUE',
- 'VERIFY', 'W', 'WHEN', 'WHILE', 'WORK', 'WRITE', 'X', 'XDM', 'XRST'
- ]
-
- tokens = {
- 'root': [
- (r'\*.*\n', Comment.Single),
- (r'\n+', Whitespace),
- # Macro argument
- (r'&' + _NON_DELIMITER_OR_COMMENT_PATTERN + r'+\.', Name.Variable,
- 'after_macro_argument'),
- # Macro call
- (r'%' + _NON_DELIMITER_OR_COMMENT_PATTERN + r'+', Name.Variable),
- (r'(FILE|MACRO|REPORT)(\s+)',
- bygroups(Keyword.Declaration, Whitespace), 'after_declaration'),
- (r'(JOB|PARM)' + r'(' + _DELIMITER_PATTERN + r')',
- bygroups(Keyword.Declaration, Operator)),
- (words(_KEYWORDS, suffix=_DELIMITER_PATTERN_CAPTURE),
- bygroups(Keyword.Reserved, Operator)),
- (_OPERATORS_PATTERN, Operator),
- # Procedure declaration
- (r'(' + _NON_DELIMITER_OR_COMMENT_PATTERN + r'+)(\s*)(\.?)(\s*)(PROC)(\s*\n)',
- bygroups(Name.Function, Whitespace, Operator, Whitespace,
- Keyword.Declaration, Whitespace)),
- (r'[0-9]+\.[0-9]*', Number.Float),
- (r'[0-9]+', Number.Integer),
- (r"'(''|[^'])*'", String),
- (r'\s+', Whitespace),
- # Everything else just belongs to a name
- (_NON_DELIMITER_OR_COMMENT_PATTERN + r'+', Name),
- ],
- 'after_declaration': [
- (_NON_DELIMITER_OR_COMMENT_PATTERN + r'+', Name.Function),
- default('#pop'),
- ],
- 'after_macro_argument': [
- (r'\*.*\n', Comment.Single, '#pop'),
- (r'\s+', Whitespace, '#pop'),
- (_OPERATORS_PATTERN, Operator, '#pop'),
- (r"'(''|[^'])*'", String, '#pop'),
- # Everything else just belongs to a name
- (_NON_DELIMITER_OR_COMMENT_PATTERN + r'+', Name),
- ],
- }
- _COMMENT_LINE_REGEX = re.compile(r'^\s*\*')
- _MACRO_HEADER_REGEX = re.compile(r'^\s*MACRO')
-
- def analyse_text(text):
- """
- Perform a structural analysis for basic Easytrieve constructs.
- """
- result = 0.0
- lines = text.split('\n')
- hasEndProc = False
- hasHeaderComment = False
- hasFile = False
- hasJob = False
- hasProc = False
- hasParm = False
- hasReport = False
-
- def isCommentLine(line):
- return EasytrieveLexer._COMMENT_LINE_REGEX.match(lines[0]) is not None
-
- def isEmptyLine(line):
- return not bool(line.strip())
-
- # Remove possible empty lines and header comments.
- while lines and (isEmptyLine(lines[0]) or isCommentLine(lines[0])):
- if not isEmptyLine(lines[0]):
- hasHeaderComment = True
- del lines[0]
-
- if EasytrieveLexer._MACRO_HEADER_REGEX.match(lines[0]):
- # Looks like an Easytrieve macro.
- result = 0.4
- if hasHeaderComment:
- result += 0.4
- else:
- # Scan the source for lines starting with indicators.
- for line in lines:
- words = line.split()
- if (len(words) >= 2):
- firstWord = words[0]
- if not hasReport:
- if not hasJob:
- if not hasFile:
- if not hasParm:
- if firstWord == 'PARM':
- hasParm = True
- if firstWord == 'FILE':
- hasFile = True
- if firstWord == 'JOB':
- hasJob = True
- elif firstWord == 'PROC':
- hasProc = True
- elif firstWord == 'END-PROC':
- hasEndProc = True
- elif firstWord == 'REPORT':
- hasReport = True
-
- # Weight the findings.
- if hasJob and (hasProc == hasEndProc):
- if hasHeaderComment:
- result += 0.1
- if hasParm:
- if hasProc:
- # Found PARM, JOB and PROC/END-PROC:
- # pretty sure this is Easytrieve.
- result += 0.8
- else:
- # Found PARAM and JOB: probably this is Easytrieve
- result += 0.5
- else:
- # Found JOB and possibly other keywords: might be Easytrieve
- result += 0.11
- if hasParm:
- # Note: PARAM is not a proper English word, so this is
- # regarded a much better indicator for Easytrieve than
- # the other words.
- result += 0.2
- if hasFile:
- result += 0.01
- if hasReport:
- result += 0.01
- assert 0.0 <= result <= 1.0
- return result
-
-
-class JclLexer(RegexLexer):
- """
- `Job Control Language (JCL)
- <http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B570/CCONTENTS>`_
- is a scripting language used on mainframe platforms to instruct the system
- on how to run a batch job or start a subsystem. It is somewhat
- comparable to MS DOS batch and Unix shell scripts.
-
- .. versionadded:: 2.1
- """
- name = 'JCL'
- aliases = ['jcl']
- filenames = ['*.jcl']
- mimetypes = ['text/x-jcl']
- flags = re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'//\*.*\n', Comment.Single),
- (r'//', Keyword.Pseudo, 'statement'),
- (r'/\*', Keyword.Pseudo, 'jes2_statement'),
- # TODO: JES3 statement
- (r'.*\n', Other) # Input text or inline code in any language.
- ],
- 'statement': [
- (r'\s*\n', Whitespace, '#pop'),
- (r'([a-z]\w*)(\s+)(exec|job)(\s*)',
- bygroups(Name.Label, Whitespace, Keyword.Reserved, Whitespace),
- 'option'),
- (r'[a-z]\w*', Name.Variable, 'statement_command'),
- (r'\s+', Whitespace, 'statement_command'),
- ],
- 'statement_command': [
- (r'\s+(command|cntl|dd|endctl|endif|else|include|jcllib|'
- r'output|pend|proc|set|then|xmit)\s+', Keyword.Reserved, 'option'),
- include('option')
- ],
- 'jes2_statement': [
- (r'\s*\n', Whitespace, '#pop'),
- (r'\$', Keyword, 'option'),
- (r'\b(jobparam|message|netacct|notify|output|priority|route|'
- r'setup|signoff|xeq|xmit)\b', Keyword, 'option'),
- ],
- 'option': [
- # (r'\n', Text, 'root'),
- (r'\*', Name.Builtin),
- (r'[\[\](){}<>;,]', Punctuation),
- (r'[-+*/=&%]', Operator),
- (r'[a-z_]\w*', Name),
- (r'\d+\.\d*', Number.Float),
- (r'\.\d+', Number.Float),
- (r'\d+', Number.Integer),
- (r"'", String, 'option_string'),
- (r'[ \t]+', Whitespace, 'option_comment'),
- (r'\.', Punctuation),
- ],
- 'option_string': [
- (r"(\n)(//)", bygroups(Text, Keyword.Pseudo)),
- (r"''", String),
- (r"[^']", String),
- (r"'", String, '#pop'),
- ],
- 'option_comment': [
- # (r'\n', Text, 'root'),
- (r'.+', Comment.Single),
- ]
- }
-
- _JOB_HEADER_PATTERN = re.compile(r'^//[a-z#$@][a-z0-9#$@]{0,7}\s+job(\s+.*)?$',
- re.IGNORECASE)
-
- def analyse_text(text):
- """
- Recognize JCL job by header.
- """
- result = 0.0
- lines = text.split('\n')
- if len(lines) > 0:
- if JclLexer._JOB_HEADER_PATTERN.match(lines[0]):
- result = 1.0
- assert 0.0 <= result <= 1.0
- return result
diff --git a/pygments/lexers/sgf.py b/pygments/lexers/sgf.py
deleted file mode 100644
index fed864a6..00000000
--- a/pygments/lexers/sgf.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.sgf
- ~~~~~~~~~~~~~~~~~~~
-
- Lexer for Smart Game Format (sgf) file format.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups
-from pygments.token import Name, Literal, String, Text, Punctuation
-
-__all__ = ["SmartGameFormatLexer"]
-
-
-class SmartGameFormatLexer(RegexLexer):
- """
- Lexer for Smart Game Format (sgf) file format.
-
- The format is used to store game records of board games for two players
- (mainly Go game).
- For more information about the definition of the format, see:
- https://www.red-bean.com/sgf/
-
- .. versionadded:: 2.4
- """
- name = 'SmartGameFormat'
- aliases = ['sgf']
- filenames = ['*.sgf']
-
- tokens = {
- 'root': [
- (r'[\s():;]', Punctuation),
- # tokens:
- (r'(A[BW]|AE|AN|AP|AR|AS|[BW]L|BM|[BW]R|[BW]S|[BW]T|CA|CH|CP|CR|'
- r'DD|DM|DO|DT|EL|EV|EX|FF|FG|G[BW]|GC|GM|GN|HA|HO|ID|IP|IT|IY|KM|'
- r'KO|LB|LN|LT|L|MA|MN|M|N|OB|OM|ON|OP|OT|OV|P[BW]|PC|PL|PM|RE|RG|'
- r'RO|RU|SO|SC|SE|SI|SL|SO|SQ|ST|SU|SZ|T[BW]|TC|TE|TM|TR|UC|US|VW|'
- r'V|[BW]|C)',
- Name.Builtin),
- # number:
- (r'(\[)([0-9.]+)(\])',
- bygroups(Punctuation, Literal.Number, Punctuation)),
- # date:
- (r'(\[)([0-9]{4}-[0-9]{2}-[0-9]{2})(\])',
- bygroups(Punctuation, Literal.Date, Punctuation)),
- # point:
- (r'(\[)([a-z]{2})(\])',
- bygroups(Punctuation, String, Punctuation)),
- # double points:
- (r'(\[)([a-z]{2})(:)([a-z]{2})(\])',
- bygroups(Punctuation, String, Punctuation, String, Punctuation)),
-
- (r'(\[)([\w\s#()+,\-.:?]+)(\])',
- bygroups(Punctuation, String, Punctuation)),
- (r'(\[)(\s.*)(\])',
- bygroups(Punctuation, Text, Punctuation)),
- ],
- }
diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py
deleted file mode 100644
index 972c4004..00000000
--- a/pygments/lexers/shell.py
+++ /dev/null
@@ -1,833 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.shell
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for various shells.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, \
- include, default, this, using, words
-from pygments.token import Punctuation, \
- Text, Comment, Operator, Keyword, Name, String, Number, Generic
-from pygments.util import shebang_matches
-
-
-__all__ = ['BashLexer', 'BashSessionLexer', 'TcshLexer', 'BatchLexer',
- 'SlurmBashLexer', 'MSDOSSessionLexer', 'PowerShellLexer',
- 'PowerShellSessionLexer', 'TcshSessionLexer', 'FishShellLexer']
-
-line_re = re.compile('.*?\n')
-
-
-class BashLexer(RegexLexer):
- """
- Lexer for (ba|k|z|)sh shell scripts.
-
- .. versionadded:: 0.6
- """
-
- name = 'Bash'
- aliases = ['bash', 'sh', 'ksh', 'zsh', 'shell']
- filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass',
- '*.exheres-0', '*.exlib', '*.zsh',
- '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc',
- 'PKGBUILD']
- mimetypes = ['application/x-sh', 'application/x-shellscript', 'text/x-shellscript']
-
- tokens = {
- 'root': [
- include('basic'),
- (r'`', String.Backtick, 'backticks'),
- include('data'),
- include('interp'),
- ],
- 'interp': [
- (r'\$\(\(', Keyword, 'math'),
- (r'\$\(', Keyword, 'paren'),
- (r'\$\{#?', String.Interpol, 'curly'),
- (r'\$[a-zA-Z_]\w*', Name.Variable), # user variable
- (r'\$(?:\d+|[#$?!_*@-])', Name.Variable), # builtin
- (r'\$', Text),
- ],
- 'basic': [
- (r'\b(if|fi|else|while|do|done|for|then|return|function|case|'
- r'select|continue|until|esac|elif)(\s*)\b',
- bygroups(Keyword, Text)),
- (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)`])',
- Name.Builtin),
- (r'\A#!.+\n', Comment.Hashbang),
- (r'#.*\n', Comment.Single),
- (r'\\[\w\W]', String.Escape),
- (r'(\b\w+)(\s*)(\+?=)', bygroups(Name.Variable, Text, Operator)),
- (r'[\[\]{}()=]', Operator),
- (r'<<<', Operator), # here-string
- (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String),
- (r'&&|\|\|', Operator),
- ],
- 'data': [
- (r'(?s)\$?"(\\.|[^"\\$])*"', String.Double),
- (r'"', String.Double, 'string'),
- (r"(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
- (r"(?s)'.*?'", String.Single),
- (r';', Punctuation),
- (r'&', Punctuation),
- (r'\|', Punctuation),
- (r'\s+', Text),
- (r'\d+\b', Number),
- (r'[^=\s\[\]{}()$"\'`\\<&|;]+', Text),
- (r'<', Text),
- ],
- 'string': [
- (r'"', String.Double, '#pop'),
- (r'(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+', String.Double),
- include('interp'),
- ],
- 'curly': [
- (r'\}', String.Interpol, '#pop'),
- (r':-', Keyword),
- (r'\w+', Name.Variable),
- (r'[^}:"\'`$\\]+', Punctuation),
- (r':', Punctuation),
- include('root'),
- ],
- 'paren': [
- (r'\)', Keyword, '#pop'),
- include('root'),
- ],
- 'math': [
- (r'\)\)', Keyword, '#pop'),
- (r'[-+*/%^|&]|\*\*|\|\|', Operator),
- (r'\d+#\d+', Number),
- (r'\d+#(?! )', Number),
- (r'\d+', Number),
- include('root'),
- ],
- 'backticks': [
- (r'`', String.Backtick, '#pop'),
- include('root'),
- ],
- }
-
- def analyse_text(text):
- if shebang_matches(text, r'(ba|z|)sh'):
- return 1
- if text.startswith('$ '):
- return 0.2
-
-
-class SlurmBashLexer(BashLexer):
- """
- Lexer for (ba|k|z|)sh Slurm scripts.
-
- .. versionadded:: 2.4
- """
-
- name = 'Slurm'
- aliases = ['slurm', 'sbatch']
- filenames = ['*.sl']
- mimetypes = []
- EXTRA_KEYWORDS = {'srun'}
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in BashLexer.get_tokens_unprocessed(self, text):
- if token is Text and value in self.EXTRA_KEYWORDS:
- yield index, Name.Builtin, value
- elif token is Comment.Single and 'SBATCH' in value:
- yield index, Keyword.Pseudo, value
- else:
- yield index, token, value
-
-class ShellSessionBaseLexer(Lexer):
- """
- Base lexer for simplistic shell sessions.
-
- .. versionadded:: 2.1
- """
- def get_tokens_unprocessed(self, text):
- innerlexer = self._innerLexerCls(**self.options)
-
- pos = 0
- curcode = ''
- insertions = []
- backslash_continuation = False
-
- for match in line_re.finditer(text):
- line = match.group()
- m = re.match(self._ps1rgx, line)
- if backslash_continuation:
- curcode += line
- backslash_continuation = curcode.endswith('\\\n')
- elif 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)
- backslash_continuation = curcode.endswith('\\\n')
- elif line.startswith(self._ps2):
- insertions.append((len(curcode),
- [(0, Generic.Prompt, line[:len(self._ps2)])]))
- curcode += line[len(self._ps2):]
- backslash_continuation = curcode.endswith('\\\n')
- else:
- if insertions:
- toks = innerlexer.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,
- innerlexer.get_tokens_unprocessed(curcode)):
- yield pos+i, t, v
-
-
-class BashSessionLexer(ShellSessionBaseLexer):
- """
- Lexer for simplistic shell sessions.
-
- .. versionadded:: 1.1
- """
-
- name = 'Bash Session'
- aliases = ['console', 'shell-session']
- filenames = ['*.sh-session', '*.shell-session']
- mimetypes = ['application/x-shell-session', 'application/x-sh-session']
-
- _innerLexerCls = BashLexer
- _ps1rgx = \
- r'^((?:(?:\[.*?\])|(?:\(\S+\))?(?:| |sh\S*?|\w+\S+[@:]\S+(?:\s+\S+)' \
- r'?|\[\S+[@:][^\n]+\].+))\s*[$#%])(.*\n?)'
- _ps2 = '>'
-
-
-class BatchLexer(RegexLexer):
- """
- Lexer for the DOS/Windows Batch file format.
-
- .. versionadded:: 0.7
- """
- name = 'Batchfile'
- aliases = ['bat', 'batch', 'dosbatch', 'winbatch']
- filenames = ['*.bat', '*.cmd']
- mimetypes = ['application/x-dos-batch']
-
- flags = re.MULTILINE | re.IGNORECASE
-
- _nl = r'\n\x1a'
- _punct = r'&<>|'
- _ws = r'\t\v\f\r ,;=\xa0'
- _space = r'(?:(?:(?:\^[%s])?[%s])+)' % (_nl, _ws)
- _keyword_terminator = (r'(?=(?:\^[%s]?)?[%s+./:[\\\]]|[%s%s(])' %
- (_nl, _ws, _nl, _punct))
- _token_terminator = r'(?=\^?[%s]|[%s%s])' % (_ws, _punct, _nl)
- _start_label = r'((?:(?<=^[^:])|^[^:]?)[%s]*)(:)' % _ws
- _label = r'(?:(?:[^%s%s%s+:^]|\^[%s]?[\w\W])*)' % (_nl, _punct, _ws, _nl)
- _label_compound = (r'(?:(?:[^%s%s%s+:^)]|\^[%s]?[^)])*)' %
- (_nl, _punct, _ws, _nl))
- _number = r'(?:-?(?:0[0-7]+|0x[\da-f]+|\d+)%s)' % _token_terminator
- _opword = r'(?:equ|geq|gtr|leq|lss|neq)'
- _string = r'(?:"[^%s"]*(?:"|(?=[%s])))' % (_nl, _nl)
- _variable = (r'(?:(?:%%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|'
- r'[^%%:%s]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%%%s^]|'
- r'\^[^%%%s])[^=%s]*=(?:[^%%%s^]|\^[^%%%s])*)?)?%%))|'
- r'(?:\^?![^!:%s]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:'
- r'[^!%s^]|\^[^!%s])[^=%s]*=(?:[^!%s^]|\^[^!%s])*)?)?\^?!))' %
- (_nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl))
- _core_token = r'(?:(?:(?:\^[%s]?)?[^"%s%s%s])+)' % (_nl, _nl, _punct, _ws)
- _core_token_compound = r'(?:(?:(?:\^[%s]?)?[^"%s%s%s)])+)' % (_nl, _nl,
- _punct, _ws)
- _token = r'(?:[%s]+|%s)' % (_punct, _core_token)
- _token_compound = r'(?:[%s]+|%s)' % (_punct, _core_token_compound)
- _stoken = (r'(?:[%s]+|(?:%s|%s|%s)+)' %
- (_punct, _string, _variable, _core_token))
-
- def _make_begin_state(compound, _core_token=_core_token,
- _core_token_compound=_core_token_compound,
- _keyword_terminator=_keyword_terminator,
- _nl=_nl, _punct=_punct, _string=_string,
- _space=_space, _start_label=_start_label,
- _stoken=_stoken, _token_terminator=_token_terminator,
- _variable=_variable, _ws=_ws):
- rest = '(?:%s|%s|[^"%%%s%s%s])*' % (_string, _variable, _nl, _punct,
- ')' if compound else '')
- rest_of_line = r'(?:(?:[^%s^]|\^[%s]?[\w\W])*)' % (_nl, _nl)
- rest_of_line_compound = r'(?:(?:[^%s^)]|\^[%s]?[^)])*)' % (_nl, _nl)
- set_space = r'((?:(?:\^[%s]?)?[^\S\n])*)' % _nl
- suffix = ''
- if compound:
- _keyword_terminator = r'(?:(?=\))|%s)' % _keyword_terminator
- _token_terminator = r'(?:(?=\))|%s)' % _token_terminator
- suffix = '/compound'
- return [
- ((r'\)', Punctuation, '#pop') if compound else
- (r'\)((?=\()|%s)%s' % (_token_terminator, rest_of_line),
- Comment.Single)),
- (r'(?=%s)' % _start_label, Text, 'follow%s' % suffix),
- (_space, using(this, state='text')),
- include('redirect%s' % suffix),
- (r'[%s]+' % _nl, Text),
- (r'\(', Punctuation, 'root/compound'),
- (r'@+', Punctuation),
- (r'((?:for|if|rem)(?:(?=(?:\^[%s]?)?/)|(?:(?!\^)|'
- r'(?<=m))(?:(?=\()|%s)))(%s?%s?(?:\^[%s]?)?/(?:\^[%s]?)?\?)' %
- (_nl, _token_terminator, _space,
- _core_token_compound if compound else _core_token, _nl, _nl),
- bygroups(Keyword, using(this, state='text')),
- 'follow%s' % suffix),
- (r'(goto%s)(%s(?:\^[%s]?)?/(?:\^[%s]?)?\?%s)' %
- (_keyword_terminator, rest, _nl, _nl, rest),
- bygroups(Keyword, using(this, state='text')),
- 'follow%s' % suffix),
- (words(('assoc', 'break', 'cd', 'chdir', 'cls', 'color', 'copy',
- 'date', 'del', 'dir', 'dpath', 'echo', 'endlocal', 'erase',
- 'exit', 'ftype', 'keys', 'md', 'mkdir', 'mklink', 'move',
- 'path', 'pause', 'popd', 'prompt', 'pushd', 'rd', 'ren',
- 'rename', 'rmdir', 'setlocal', 'shift', 'start', 'time',
- 'title', 'type', 'ver', 'verify', 'vol'),
- suffix=_keyword_terminator), Keyword, 'follow%s' % suffix),
- (r'(call)(%s?)(:)' % _space,
- bygroups(Keyword, using(this, state='text'), Punctuation),
- 'call%s' % suffix),
- (r'call%s' % _keyword_terminator, Keyword),
- (r'(for%s(?!\^))(%s)(/f%s)' %
- (_token_terminator, _space, _token_terminator),
- bygroups(Keyword, using(this, state='text'), Keyword),
- ('for/f', 'for')),
- (r'(for%s(?!\^))(%s)(/l%s)' %
- (_token_terminator, _space, _token_terminator),
- bygroups(Keyword, using(this, state='text'), Keyword),
- ('for/l', 'for')),
- (r'for%s(?!\^)' % _token_terminator, Keyword, ('for2', 'for')),
- (r'(goto%s)(%s?)(:?)' % (_keyword_terminator, _space),
- bygroups(Keyword, using(this, state='text'), Punctuation),
- 'label%s' % suffix),
- (r'(if(?:(?=\()|%s)(?!\^))(%s?)((?:/i%s)?)(%s?)((?:not%s)?)(%s?)' %
- (_token_terminator, _space, _token_terminator, _space,
- _token_terminator, _space),
- bygroups(Keyword, using(this, state='text'), Keyword,
- using(this, state='text'), Keyword,
- using(this, state='text')), ('(?', 'if')),
- (r'rem(((?=\()|%s)%s?%s?.*|%s%s)' %
- (_token_terminator, _space, _stoken, _keyword_terminator,
- rest_of_line_compound if compound else rest_of_line),
- Comment.Single, 'follow%s' % suffix),
- (r'(set%s)%s(/a)' % (_keyword_terminator, set_space),
- bygroups(Keyword, using(this, state='text'), Keyword),
- 'arithmetic%s' % suffix),
- (r'(set%s)%s((?:/p)?)%s((?:(?:(?:\^[%s]?)?[^"%s%s^=%s]|'
- r'\^[%s]?[^"=])+)?)((?:(?:\^[%s]?)?=)?)' %
- (_keyword_terminator, set_space, set_space, _nl, _nl, _punct,
- ')' if compound else '', _nl, _nl),
- bygroups(Keyword, using(this, state='text'), Keyword,
- using(this, state='text'), using(this, state='variable'),
- Punctuation),
- 'follow%s' % suffix),
- default('follow%s' % suffix)
- ]
-
- def _make_follow_state(compound, _label=_label,
- _label_compound=_label_compound, _nl=_nl,
- _space=_space, _start_label=_start_label,
- _token=_token, _token_compound=_token_compound,
- _ws=_ws):
- suffix = '/compound' if compound else ''
- state = []
- if compound:
- state.append((r'(?=\))', Text, '#pop'))
- state += [
- (r'%s([%s]*)(%s)(.*)' %
- (_start_label, _ws, _label_compound if compound else _label),
- bygroups(Text, Punctuation, Text, Name.Label, Comment.Single)),
- include('redirect%s' % suffix),
- (r'(?=[%s])' % _nl, Text, '#pop'),
- (r'\|\|?|&&?', Punctuation, '#pop'),
- include('text')
- ]
- return state
-
- def _make_arithmetic_state(compound, _nl=_nl, _punct=_punct,
- _string=_string, _variable=_variable, _ws=_ws):
- op = r'=+\-*/!~'
- state = []
- if compound:
- state.append((r'(?=\))', Text, '#pop'))
- state += [
- (r'0[0-7]+', Number.Oct),
- (r'0x[\da-f]+', Number.Hex),
- (r'\d+', Number.Integer),
- (r'[(),]+', Punctuation),
- (r'([%s]|%%|\^\^)+' % op, Operator),
- (r'(%s|%s|(\^[%s]?)?[^()%s%%^"%s%s%s]|\^[%s%s]?%s)+' %
- (_string, _variable, _nl, op, _nl, _punct, _ws, _nl, _ws,
- r'[^)]' if compound else r'[\w\W]'),
- using(this, state='variable')),
- (r'(?=[\x00|&])', Text, '#pop'),
- include('follow')
- ]
- return state
-
- def _make_call_state(compound, _label=_label,
- _label_compound=_label_compound):
- state = []
- if compound:
- state.append((r'(?=\))', Text, '#pop'))
- state.append((r'(:?)(%s)' % (_label_compound if compound else _label),
- bygroups(Punctuation, Name.Label), '#pop'))
- return state
-
- def _make_label_state(compound, _label=_label,
- _label_compound=_label_compound, _nl=_nl,
- _punct=_punct, _string=_string, _variable=_variable):
- state = []
- if compound:
- state.append((r'(?=\))', Text, '#pop'))
- state.append((r'(%s?)((?:%s|%s|\^[%s]?%s|[^"%%^%s%s%s])*)' %
- (_label_compound if compound else _label, _string,
- _variable, _nl, r'[^)]' if compound else r'[\w\W]', _nl,
- _punct, r')' if compound else ''),
- bygroups(Name.Label, Comment.Single), '#pop'))
- return state
-
- def _make_redirect_state(compound,
- _core_token_compound=_core_token_compound,
- _nl=_nl, _punct=_punct, _stoken=_stoken,
- _string=_string, _space=_space,
- _variable=_variable, _ws=_ws):
- stoken_compound = (r'(?:[%s]+|(?:%s|%s|%s)+)' %
- (_punct, _string, _variable, _core_token_compound))
- return [
- (r'((?:(?<=[%s%s])\d)?)(>>?&|<&)([%s%s]*)(\d)' %
- (_nl, _ws, _nl, _ws),
- bygroups(Number.Integer, Punctuation, Text, Number.Integer)),
- (r'((?:(?<=[%s%s])(?<!\^[%s])\d)?)(>>?|<)(%s?%s)' %
- (_nl, _ws, _nl, _space, stoken_compound if compound else _stoken),
- bygroups(Number.Integer, Punctuation, using(this, state='text')))
- ]
-
- tokens = {
- 'root': _make_begin_state(False),
- 'follow': _make_follow_state(False),
- 'arithmetic': _make_arithmetic_state(False),
- 'call': _make_call_state(False),
- 'label': _make_label_state(False),
- 'redirect': _make_redirect_state(False),
- 'root/compound': _make_begin_state(True),
- 'follow/compound': _make_follow_state(True),
- 'arithmetic/compound': _make_arithmetic_state(True),
- 'call/compound': _make_call_state(True),
- 'label/compound': _make_label_state(True),
- 'redirect/compound': _make_redirect_state(True),
- 'variable-or-escape': [
- (_variable, Name.Variable),
- (r'%%%%|\^[%s]?(\^!|[\w\W])' % _nl, String.Escape)
- ],
- 'string': [
- (r'"', String.Double, '#pop'),
- (_variable, Name.Variable),
- (r'\^!|%%', String.Escape),
- (r'[^"%%^%s]+|[%%^]' % _nl, String.Double),
- default('#pop')
- ],
- 'sqstring': [
- include('variable-or-escape'),
- (r'[^%]+|%', String.Single)
- ],
- 'bqstring': [
- include('variable-or-escape'),
- (r'[^%]+|%', String.Backtick)
- ],
- 'text': [
- (r'"', String.Double, 'string'),
- include('variable-or-escape'),
- (r'[^"%%^%s%s%s\d)]+|.' % (_nl, _punct, _ws), Text)
- ],
- 'variable': [
- (r'"', String.Double, 'string'),
- include('variable-or-escape'),
- (r'[^"%%^%s]+|.' % _nl, Name.Variable)
- ],
- 'for': [
- (r'(%s)(in)(%s)(\()' % (_space, _space),
- bygroups(using(this, state='text'), Keyword,
- using(this, state='text'), Punctuation), '#pop'),
- include('follow')
- ],
- 'for2': [
- (r'\)', Punctuation),
- (r'(%s)(do%s)' % (_space, _token_terminator),
- bygroups(using(this, state='text'), Keyword), '#pop'),
- (r'[%s]+' % _nl, Text),
- include('follow')
- ],
- 'for/f': [
- (r'(")((?:%s|[^"])*?")([%s%s]*)(\))' % (_variable, _nl, _ws),
- bygroups(String.Double, using(this, state='string'), Text,
- Punctuation)),
- (r'"', String.Double, ('#pop', 'for2', 'string')),
- (r"('(?:%%%%|%s|[\w\W])*?')([%s%s]*)(\))" % (_variable, _nl, _ws),
- bygroups(using(this, state='sqstring'), Text, Punctuation)),
- (r'(`(?:%%%%|%s|[\w\W])*?`)([%s%s]*)(\))' % (_variable, _nl, _ws),
- bygroups(using(this, state='bqstring'), Text, Punctuation)),
- include('for2')
- ],
- 'for/l': [
- (r'-?\d+', Number.Integer),
- include('for2')
- ],
- 'if': [
- (r'((?:cmdextversion|errorlevel)%s)(%s)(\d+)' %
- (_token_terminator, _space),
- bygroups(Keyword, using(this, state='text'),
- Number.Integer), '#pop'),
- (r'(defined%s)(%s)(%s)' % (_token_terminator, _space, _stoken),
- bygroups(Keyword, using(this, state='text'),
- using(this, state='variable')), '#pop'),
- (r'(exist%s)(%s%s)' % (_token_terminator, _space, _stoken),
- bygroups(Keyword, using(this, state='text')), '#pop'),
- (r'(%s%s)(%s)(%s%s)' % (_number, _space, _opword, _space, _number),
- bygroups(using(this, state='arithmetic'), Operator.Word,
- using(this, state='arithmetic')), '#pop'),
- (_stoken, using(this, state='text'), ('#pop', 'if2')),
- ],
- 'if2': [
- (r'(%s?)(==)(%s?%s)' % (_space, _space, _stoken),
- bygroups(using(this, state='text'), Operator,
- using(this, state='text')), '#pop'),
- (r'(%s)(%s)(%s%s)' % (_space, _opword, _space, _stoken),
- bygroups(using(this, state='text'), Operator.Word,
- using(this, state='text')), '#pop')
- ],
- '(?': [
- (_space, using(this, state='text')),
- (r'\(', Punctuation, ('#pop', 'else?', 'root/compound')),
- default('#pop')
- ],
- 'else?': [
- (_space, using(this, state='text')),
- (r'else%s' % _token_terminator, Keyword, '#pop'),
- default('#pop')
- ]
- }
-
-
-class MSDOSSessionLexer(ShellSessionBaseLexer):
- """
- Lexer for simplistic MSDOS sessions.
-
- .. versionadded:: 2.1
- """
-
- name = 'MSDOS Session'
- aliases = ['doscon']
- filenames = []
- mimetypes = []
-
- _innerLexerCls = BatchLexer
- _ps1rgx = r'^([^>]*>)(.*\n?)'
- _ps2 = 'More? '
-
-
-class TcshLexer(RegexLexer):
- """
- Lexer for tcsh scripts.
-
- .. versionadded:: 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'#.*', 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';', Punctuation),
- ],
- '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'\w+', Name.Variable),
- (r'[^}:"\'`$]+', Punctuation),
- (r':', Punctuation),
- include('root'),
- ],
- 'paren': [
- (r'\)', Keyword, '#pop'),
- include('root'),
- ],
- 'backticks': [
- (r'`', String.Backtick, '#pop'),
- include('root'),
- ],
- }
-
-
-class TcshSessionLexer(ShellSessionBaseLexer):
- """
- Lexer for Tcsh sessions.
-
- .. versionadded:: 2.1
- """
-
- name = 'Tcsh Session'
- aliases = ['tcshcon']
- filenames = []
- mimetypes = []
-
- _innerLexerCls = TcshLexer
- _ps1rgx = r'^([^>]+>)(.*\n?)'
- _ps2 = '? '
-
-
-class PowerShellLexer(RegexLexer):
- """
- For Windows PowerShell code.
-
- .. versionadded:: 1.5
- """
- name = 'PowerShell'
- aliases = ['powershell', 'posh', 'ps1', 'psm1']
- filenames = ['*.ps1', '*.psm1']
- 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 throw').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 watch wait use update unregister unpublish unprotect '
- 'unlock uninstall undo unblock trace test tee take sync switch '
- 'suspend submit stop step start split sort skip show set send select '
- 'search scroll save revoke resume restore restart resolve resize '
- 'reset request repair rename remove register redo receive read push '
- 'publish protect pop ping out optimize open new move mount merge '
- 'measure lock limit join invoke install initialize import hide group '
- 'grant get format foreach find export expand exit enter enable edit '
- 'dismount disconnect disable deny debug cxnew copy convertto '
- 'convertfrom convert connect confirm compress complete compare close '
- 'clear checkpoint block backup assert approve aggregate add').split()
-
- aliases_ = (
- 'ac asnp cat cd cfs chdir clc clear clhy cli clp cls clv cnsn '
- 'compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo epal '
- 'epcsv epsn erase etsn exsn fc fhx fl foreach ft fw gal gbp gc gci gcm '
- 'gcs gdr ghy gi gjb gl gm gmo gp gps gpv group gsn gsnp gsv gu gv gwmi '
- 'h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp '
- 'ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv '
- 'oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo '
- 'rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc select '
- 'set shcm si sl sleep sls sort sp spjb spps spsv start sujb sv swmi tee '
- 'trcm type wget where wjb write').split()
-
- commenthelp = (
- 'component description example externalhelp forwardhelpcategory '
- 'forwardhelptargetname functionality inputs link '
- 'notes outputs parameter remotehelprunspace role synopsis').split()
-
- tokens = {
- 'root': [
- # we need to count pairs of parentheses for correct highlight
- # of '$(...)' blocks in strings
- (r'\(', Punctuation, 'child'),
- (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', String.Heredoc, 'heredoc-double'),
- (r"@'\n.*?\n'@", String.Heredoc),
- # escaped syntax
- (r'`[\'"$@-]', Punctuation),
- (r'"', String.Double, 'string'),
- (r"'([^']|'')*'", String.Single),
- (r'(\$|@@|@)((global|script|private|env):)?\w+',
- Name.Variable),
- (r'(%s)\b' % '|'.join(keywords), Keyword),
- (r'-(%s)\b' % '|'.join(operators), Operator),
- (r'(%s)-[a-z_]\w*\b' % '|'.join(verbs), Name.Builtin),
- (r'(%s)\s' % '|'.join(aliases_), Name.Builtin),
- (r'\[[a-z_\[][\w. `,\[\]]*\]', Name.Constant), # .net [type]s
- (r'-[a-z_]\w*', Name),
- (r'\w+', Name),
- (r'[.,;@{}\[\]$()=+*/\\&%!~?^`|<>-]|::', Punctuation),
- ],
- 'child': [
- (r'\)', Punctuation, '#pop'),
- include('root'),
- ],
- 'multline': [
- (r'[^#&.]+', Comment.Multiline),
- (r'#(>|&gt;)', Comment.Multiline, '#pop'),
- (r'\.(%s)' % '|'.join(commenthelp), String.Doc),
- (r'[#&.]', Comment.Multiline),
- ],
- 'string': [
- (r"`[0abfnrtv'\"$`]", String.Escape),
- (r'[^$`"]+', String.Double),
- (r'\$\(', Punctuation, 'child'),
- (r'""', String.Double),
- (r'[`$]', String.Double),
- (r'"', String.Double, '#pop'),
- ],
- 'heredoc-double': [
- (r'\n"@', String.Heredoc, '#pop'),
- (r'\$\(', Punctuation, 'child'),
- (r'[^@\n]+"]', String.Heredoc),
- (r".", String.Heredoc),
- ]
- }
-
-
-class PowerShellSessionLexer(ShellSessionBaseLexer):
- """
- Lexer for simplistic Windows PowerShell sessions.
-
- .. versionadded:: 2.1
- """
-
- name = 'PowerShell Session'
- aliases = ['ps1con']
- filenames = []
- mimetypes = []
-
- _innerLexerCls = PowerShellLexer
- _ps1rgx = r'^(PS [^>]+> )(.*\n?)'
- _ps2 = '>> '
-
-
-class FishShellLexer(RegexLexer):
- """
- Lexer for Fish shell scripts.
-
- .. versionadded:: 2.1
- """
-
- name = 'Fish'
- aliases = ['fish', 'fishshell']
- filenames = ['*.fish', '*.load']
- mimetypes = ['application/x-fish']
-
- tokens = {
- 'root': [
- include('basic'),
- include('data'),
- include('interp'),
- ],
- 'interp': [
- (r'\$\(\(', Keyword, 'math'),
- (r'\(', Keyword, 'paren'),
- (r'\$#?(\w+|.)', Name.Variable),
- ],
- 'basic': [
- (r'\b(begin|end|if|else|while|break|for|in|return|function|block|'
- r'case|continue|switch|not|and|or|set|echo|exit|pwd|true|false|'
- r'cd|count|test)(\s*)\b',
- bygroups(Keyword, Text)),
- (r'\b(alias|bg|bind|breakpoint|builtin|command|commandline|'
- r'complete|contains|dirh|dirs|emit|eval|exec|fg|fish|fish_config|'
- r'fish_indent|fish_pager|fish_prompt|fish_right_prompt|'
- r'fish_update_completions|fishd|funced|funcsave|functions|help|'
- r'history|isatty|jobs|math|mimedb|nextd|open|popd|prevd|psub|'
- r'pushd|random|read|set_color|source|status|trap|type|ulimit|'
- r'umask|vared|fc|getopts|hash|kill|printf|time|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),
- ],
- 'data': [
- (r'(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\$])*"', String.Double),
- (r'"', String.Double, 'string'),
- (r"(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
- (r"(?s)'.*?'", String.Single),
- (r';', Punctuation),
- (r'&|\||\^|<|>', Operator),
- (r'\s+', Text),
- (r'\d+(?= |\Z)', Number),
- (r'[^=\s\[\]{}()$"\'`\\<&|;]+', Text),
- ],
- 'string': [
- (r'"', String.Double, '#pop'),
- (r'(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+', String.Double),
- include('interp'),
- ],
- 'paren': [
- (r'\)', Keyword, '#pop'),
- include('root'),
- ],
- 'math': [
- (r'\)\)', Keyword, '#pop'),
- (r'[-+*/%^|&]|\*\*|\|\|', Operator),
- (r'\d+#\d+', Number),
- (r'\d+#(?! )', Number),
- (r'\d+', Number),
- include('root'),
- ],
- }
diff --git a/pygments/lexers/slash.py b/pygments/lexers/slash.py
deleted file mode 100644
index b6314105..00000000
--- a/pygments/lexers/slash.py
+++ /dev/null
@@ -1,185 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.slash
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for the `Slash <https://github.com/arturadib/Slash-A>`_ programming
- language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import ExtendedRegexLexer, bygroups, DelegatingLexer
-from pygments.token import Name, Number, String, Comment, Punctuation, \
- Other, Keyword, Operator, Whitespace
-
-__all__ = ['SlashLexer']
-
-
-class SlashLanguageLexer(ExtendedRegexLexer):
- _nkw = r'(?=[^a-zA-Z_0-9])'
-
- def move_state(new_state):
- return ("#pop", new_state)
-
- def right_angle_bracket(lexer, match, ctx):
- if len(ctx.stack) > 1 and ctx.stack[-2] == "string":
- ctx.stack.pop()
- yield match.start(), String.Interpol, "}"
- ctx.pos = match.end()
- pass
-
- tokens = {
- "root": [
- (r"<%=", Comment.Preproc, move_state("slash")),
- (r"<%!!", Comment.Preproc, move_state("slash")),
- (r"<%#.*?%>", Comment.Multiline),
- (r"<%", Comment.Preproc, move_state("slash")),
- (r".|\n", Other),
- ],
- "string": [
- (r"\\", String.Escape, move_state("string_e")),
- (r"\"", String, move_state("slash")),
- (r"#\{", String.Interpol, "slash"),
- (r'.|\n', String),
- ],
- "string_e": [
- (r'n', String.Escape, move_state("string")),
- (r't', String.Escape, move_state("string")),
- (r'r', String.Escape, move_state("string")),
- (r'e', String.Escape, move_state("string")),
- (r'x[a-fA-F0-9]{2}', String.Escape, move_state("string")),
- (r'.', String.Escape, move_state("string")),
- ],
- "regexp": [
- (r'}[a-z]*', String.Regex, move_state("slash")),
- (r'\\(.|\n)', String.Regex),
- (r'{', String.Regex, "regexp_r"),
- (r'.|\n', String.Regex),
- ],
- "regexp_r": [
- (r'}[a-z]*', String.Regex, "#pop"),
- (r'\\(.|\n)', String.Regex),
- (r'{', String.Regex, "regexp_r"),
- ],
- "slash": [
- (r"%>", Comment.Preproc, move_state("root")),
- (r"\"", String, move_state("string")),
- (r"'[a-zA-Z0-9_]+", String),
- (r'%r{', String.Regex, move_state("regexp")),
- (r'/\*.*?\*/', Comment.Multiline),
- (r"(#|//).*?\n", Comment.Single),
- (r'-?[0-9]+e[+-]?[0-9]+', Number.Float),
- (r'-?[0-9]+\.[0-9]+(e[+-]?[0-9]+)?', Number.Float),
- (r'-?[0-9]+', Number.Integer),
- (r'nil'+_nkw, Name.Builtin),
- (r'true'+_nkw, Name.Builtin),
- (r'false'+_nkw, Name.Builtin),
- (r'self'+_nkw, Name.Builtin),
- (r'(class)(\s+)([A-Z][a-zA-Z0-9_\']*)',
- bygroups(Keyword, Whitespace, Name.Class)),
- (r'class'+_nkw, Keyword),
- (r'extends'+_nkw, Keyword),
- (r'(def)(\s+)(self)(\s*)(\.)(\s*)([a-z_][a-zA-Z0-9_\']*=?|<<|>>|==|<=>|<=|<|>=|>|\+|-(self)?|~(self)?|\*|/|%|^|&&|&|\||\[\]=?)',
- bygroups(Keyword, Whitespace, Name.Builtin, Whitespace, Punctuation, Whitespace, Name.Function)),
- (r'(def)(\s+)([a-z_][a-zA-Z0-9_\']*=?|<<|>>|==|<=>|<=|<|>=|>|\+|-(self)?|~(self)?|\*|/|%|^|&&|&|\||\[\]=?)',
- bygroups(Keyword, Whitespace, Name.Function)),
- (r'def'+_nkw, Keyword),
- (r'if'+_nkw, Keyword),
- (r'elsif'+_nkw, Keyword),
- (r'else'+_nkw, Keyword),
- (r'unless'+_nkw, Keyword),
- (r'for'+_nkw, Keyword),
- (r'in'+_nkw, Keyword),
- (r'while'+_nkw, Keyword),
- (r'until'+_nkw, Keyword),
- (r'and'+_nkw, Keyword),
- (r'or'+_nkw, Keyword),
- (r'not'+_nkw, Keyword),
- (r'lambda'+_nkw, Keyword),
- (r'try'+_nkw, Keyword),
- (r'catch'+_nkw, Keyword),
- (r'return'+_nkw, Keyword),
- (r'next'+_nkw, Keyword),
- (r'last'+_nkw, Keyword),
- (r'throw'+_nkw, Keyword),
- (r'use'+_nkw, Keyword),
- (r'switch'+_nkw, Keyword),
- (r'\\', Keyword),
- (r'λ', Keyword),
- (r'__FILE__'+_nkw, Name.Builtin.Pseudo),
- (r'__LINE__'+_nkw, Name.Builtin.Pseudo),
- (r'[A-Z][a-zA-Z0-9_\']*'+_nkw, Name.Constant),
- (r'[a-z_][a-zA-Z0-9_\']*'+_nkw, Name),
- (r'@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Instance),
- (r'@@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Class),
- (r'\(', Punctuation),
- (r'\)', Punctuation),
- (r'\[', Punctuation),
- (r'\]', Punctuation),
- (r'\{', Punctuation),
- (r'\}', right_angle_bracket),
- (r';', Punctuation),
- (r',', Punctuation),
- (r'<<=', Operator),
- (r'>>=', Operator),
- (r'<<', Operator),
- (r'>>', Operator),
- (r'==', Operator),
- (r'!=', Operator),
- (r'=>', Operator),
- (r'=', Operator),
- (r'<=>', Operator),
- (r'<=', Operator),
- (r'>=', Operator),
- (r'<', Operator),
- (r'>', Operator),
- (r'\+\+', Operator),
- (r'\+=', Operator),
- (r'-=', Operator),
- (r'\*\*=', Operator),
- (r'\*=', Operator),
- (r'\*\*', Operator),
- (r'\*', Operator),
- (r'/=', Operator),
- (r'\+', Operator),
- (r'-', Operator),
- (r'/', Operator),
- (r'%=', Operator),
- (r'%', Operator),
- (r'^=', Operator),
- (r'&&=', Operator),
- (r'&=', Operator),
- (r'&&', Operator),
- (r'&', Operator),
- (r'\|\|=', Operator),
- (r'\|=', Operator),
- (r'\|\|', Operator),
- (r'\|', Operator),
- (r'!', Operator),
- (r'\.\.\.', Operator),
- (r'\.\.', Operator),
- (r'\.', Operator),
- (r'::', Operator),
- (r':', Operator),
- (r'(\s|\n)+', Whitespace),
- (r'[a-z_][a-zA-Z0-9_\']*', Name.Variable),
- ],
- }
-
-
-class SlashLexer(DelegatingLexer):
- """
- Lexer for the Slash programming language.
-
- .. versionadded:: 2.4
- """
-
- name = 'Slash'
- aliases = ['slash']
- filenames = ['*.sl']
-
- def __init__(self, **options):
- from pygments.lexers.web import HtmlLexer
- super(SlashLexer, self).__init__(HtmlLexer, SlashLanguageLexer, **options)
diff --git a/pygments/lexers/smalltalk.py b/pygments/lexers/smalltalk.py
deleted file mode 100644
index 0e4584f3..00000000
--- a/pygments/lexers/smalltalk.py
+++ /dev/null
@@ -1,195 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.smalltalk
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Smalltalk and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, bygroups, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['SmalltalkLexer', 'NewspeakLexer']
-
-
-class SmalltalkLexer(RegexLexer):
- """
- For `Smalltalk <http://www.smalltalk.org/>`_ syntax.
- Contributed by Stefan Matthias Aust.
- Rewritten by Nils Winter.
-
- .. versionadded:: 0.10
- """
- name = 'Smalltalk'
- filenames = ['*.st']
- aliases = ['smalltalk', 'squeak', 'st']
- mimetypes = ['text/x-smalltalk']
-
- tokens = {
- 'root': [
- (r'(<)(\w+:)(.*?)(>)', bygroups(Text, Keyword, Text, Text)),
- include('squeak fileout'),
- include('whitespaces'),
- include('method definition'),
- (r'(\|)([\w\s]*)(\|)', bygroups(Operator, Name.Variable, Operator)),
- include('objects'),
- (r'\^|\:=|\_', Operator),
- # temporaries
- (r'[\]({}.;!]', Text),
- ],
- 'method definition': [
- # Not perfect can't allow whitespaces at the beginning and the
- # without breaking everything
- (r'([a-zA-Z]+\w*:)(\s*)(\w+)',
- bygroups(Name.Function, Text, Name.Variable)),
- (r'^(\b[a-zA-Z]+\w*\b)(\s*)$', bygroups(Name.Function, Text)),
- (r'^([-+*/\\~<>=|&!?,@%]+)(\s*)(\w+)(\s*)$',
- bygroups(Name.Function, Text, Name.Variable, Text)),
- ],
- 'blockvariables': [
- include('whitespaces'),
- (r'(:)(\s*)(\w+)',
- bygroups(Operator, Text, Name.Variable)),
- (r'\|', Operator, '#pop'),
- default('#pop'), # else pop
- ],
- 'literals': [
- (r"'(''|[^'])*'", String, 'afterobject'),
- (r'\$.', String.Char, 'afterobject'),
- (r'#\(', String.Symbol, 'parenth'),
- (r'\)', Text, 'afterobject'),
- (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number, 'afterobject'),
- ],
- '_parenth_helper': [
- include('whitespaces'),
- (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number),
- (r'[-+*/\\~<>=|&#!?,@%\w:]+', String.Symbol),
- # literals
- (r"'(''|[^'])*'", String),
- (r'\$.', String.Char),
- (r'#*\(', String.Symbol, 'inner_parenth'),
- ],
- 'parenth': [
- # This state is a bit tricky since
- # we can't just pop this state
- (r'\)', String.Symbol, ('root', 'afterobject')),
- include('_parenth_helper'),
- ],
- 'inner_parenth': [
- (r'\)', String.Symbol, '#pop'),
- include('_parenth_helper'),
- ],
- 'whitespaces': [
- # skip whitespace and comments
- (r'\s+', Text),
- (r'"(""|[^"])*"', Comment),
- ],
- 'objects': [
- (r'\[', Text, 'blockvariables'),
- (r'\]', Text, 'afterobject'),
- (r'\b(self|super|true|false|nil|thisContext)\b',
- Name.Builtin.Pseudo, 'afterobject'),
- (r'\b[A-Z]\w*(?!:)\b', Name.Class, 'afterobject'),
- (r'\b[a-z]\w*(?!:)\b', Name.Variable, 'afterobject'),
- (r'#("(""|[^"])*"|[-+*/\\~<>=|&!?,@%]+|[\w:]+)',
- String.Symbol, 'afterobject'),
- include('literals'),
- ],
- 'afterobject': [
- (r'! !$', Keyword, '#pop'), # squeak chunk delimiter
- include('whitespaces'),
- (r'\b(ifTrue:|ifFalse:|whileTrue:|whileFalse:|timesRepeat:)',
- Name.Builtin, '#pop'),
- (r'\b(new\b(?!:))', Name.Builtin),
- (r'\:=|\_', Operator, '#pop'),
- (r'\b[a-zA-Z]+\w*:', Name.Function, '#pop'),
- (r'\b[a-zA-Z]+\w*', Name.Function),
- (r'\w+:?|[-+*/\\~<>=|&!?,@%]+', Name.Function, '#pop'),
- (r'\.', Punctuation, '#pop'),
- (r';', Punctuation),
- (r'[\])}]', Text),
- (r'[\[({]', Text, '#pop'),
- ],
- 'squeak fileout': [
- # Squeak fileout format (optional)
- (r'^"(""|[^"])*"!', Keyword),
- (r"^'(''|[^'])*'!", Keyword),
- (r'^(!)(\w+)( commentStamp: )(.*?)( prior: .*?!\n)(.*?)(!)',
- bygroups(Keyword, Name.Class, Keyword, String, Keyword, Text, Keyword)),
- (r"^(!)(\w+(?: class)?)( methodsFor: )('(?:''|[^'])*')(.*?!)",
- bygroups(Keyword, Name.Class, Keyword, String, Keyword)),
- (r'^(\w+)( subclass: )(#\w+)'
- r'(\s+instanceVariableNames: )(.*?)'
- r'(\s+classVariableNames: )(.*?)'
- r'(\s+poolDictionaries: )(.*?)'
- r'(\s+category: )(.*?)(!)',
- bygroups(Name.Class, Keyword, String.Symbol, Keyword, String, Keyword,
- String, Keyword, String, Keyword, String, Keyword)),
- (r'^(\w+(?: class)?)(\s+instanceVariableNames: )(.*?)(!)',
- bygroups(Name.Class, Keyword, String, Keyword)),
- (r'(!\n)(\].*)(! !)$', bygroups(Keyword, Text, Keyword)),
- (r'! !$', Keyword),
- ],
- }
-
-
-class NewspeakLexer(RegexLexer):
- """
- For `Newspeak <http://newspeaklanguage.org/>` syntax.
-
- .. versionadded:: 1.1
- """
- name = 'Newspeak'
- filenames = ['*.ns2']
- aliases = ['newspeak', ]
- mimetypes = ['text/x-newspeak']
-
- tokens = {
- 'root': [
- (r'\b(Newsqueak2)\b', Keyword.Declaration),
- (r"'[^']*'", String),
- (r'\b(class)(\s+)(\w+)(\s*)',
- bygroups(Keyword.Declaration, Text, Name.Class, Text)),
- (r'\b(mixin|self|super|private|public|protected|nil|true|false)\b',
- Keyword),
- (r'(\w+\:)(\s*)([a-zA-Z_]\w+)',
- bygroups(Name.Function, Text, Name.Variable)),
- (r'(\w+)(\s*)(=)',
- bygroups(Name.Attribute, Text, Operator)),
- (r'<\w+>', Comment.Special),
- include('expressionstat'),
- include('whitespace')
- ],
-
- 'expressionstat': [
- (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
- (r'\d+', Number.Integer),
- (r':\w+', Name.Variable),
- (r'(\w+)(::)', bygroups(Name.Variable, Operator)),
- (r'\w+:', Name.Function),
- (r'\w+', Name.Variable),
- (r'\(|\)', Punctuation),
- (r'\[|\]', Punctuation),
- (r'\{|\}', Punctuation),
-
- (r'(\^|\+|\/|~|\*|<|>|=|@|%|\||&|\?|!|,|-|:)', Operator),
- (r'\.|;', Punctuation),
- include('whitespace'),
- include('literals'),
- ],
- 'literals': [
- (r'\$.', String),
- (r"'[^']*'", String),
- (r"#'[^']*'", String.Symbol),
- (r"#\w+:?", String.Symbol),
- (r"#(\+|\/|~|\*|<|>|=|@|%|\||&|\?|!|,|-)+", String.Symbol)
- ],
- 'whitespace': [
- (r'\s+', Text),
- (r'"[^"]*"', Comment)
- ],
- }
diff --git a/pygments/lexers/smv.py b/pygments/lexers/smv.py
deleted file mode 100644
index 2d97c2c5..00000000
--- a/pygments/lexers/smv.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.smv
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for the SMV languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, words
-from pygments.token import Comment, Generic, Keyword, Name, Number, \
- Operator, Punctuation, Text
-
-__all__ = ['NuSMVLexer']
-
-
-class NuSMVLexer(RegexLexer):
- """
- Lexer for the NuSMV language.
-
- .. versionadded:: 2.2
- """
-
- name = 'NuSMV'
- aliases = ['nusmv']
- filenames = ['*.smv']
- mimetypes = []
-
- tokens = {
- 'root': [
- # Comments
- (r'(?s)\/\-\-.*?\-\-/', Comment),
- (r'--.*\n', Comment),
-
- # Reserved
- (words(('MODULE', 'DEFINE', 'MDEFINE', 'CONSTANTS', 'VAR', 'IVAR',
- 'FROZENVAR', 'INIT', 'TRANS', 'INVAR', 'SPEC', 'CTLSPEC',
- 'LTLSPEC', 'PSLSPEC', 'COMPUTE', 'NAME', 'INVARSPEC',
- 'FAIRNESS', 'JUSTICE', 'COMPASSION', 'ISA', 'ASSIGN',
- 'CONSTRAINT', 'SIMPWFF', 'CTLWFF', 'LTLWFF', 'PSLWFF',
- 'COMPWFF', 'IN', 'MIN', 'MAX', 'MIRROR', 'PRED',
- 'PREDICATES'), suffix=r'(?![\w$#-])'),
- Keyword.Declaration),
- (r'process(?![\w$#-])', Keyword),
- (words(('array', 'of', 'boolean', 'integer', 'real', 'word'),
- suffix=r'(?![\w$#-])'), Keyword.Type),
- (words(('case', 'esac'), suffix=r'(?![\w$#-])'), Keyword),
- (words(('word1', 'bool', 'signed', 'unsigned', 'extend', 'resize',
- 'sizeof', 'uwconst', 'swconst', 'init', 'self', 'count',
- 'abs', 'max', 'min'), suffix=r'(?![\w$#-])'),
- Name.Builtin),
- (words(('EX', 'AX', 'EF', 'AF', 'EG', 'AG', 'E', 'F', 'O', 'G',
- 'H', 'X', 'Y', 'Z', 'A', 'U', 'S', 'V', 'T', 'BU', 'EBF',
- 'ABF', 'EBG', 'ABG', 'next', 'mod', 'union', 'in', 'xor',
- 'xnor'), suffix=r'(?![\w$#-])'),
- Operator.Word),
- (words(('TRUE', 'FALSE'), suffix=r'(?![\w$#-])'), Keyword.Constant),
-
- # Names
- (r'[a-zA-Z_][\w$#-]*', Name.Variable),
-
- # Operators
- (r':=', Operator),
- (r'[-&|+*/<>!=]', Operator),
-
- # Literals
- (r'\-?\d+\b', Number.Integer),
- (r'0[su][bB]\d*_[01_]+', Number.Bin),
- (r'0[su][oO]\d*_[0-7_]+', Number.Oct),
- (r'0[su][dD]\d*_[\d_]+', Number.Dec),
- (r'0[su][hH]\d*_[\da-fA-F_]+', Number.Hex),
-
- # Whitespace, punctuation and the rest
- (r'\s+', Text.Whitespace),
- (r'[()\[\]{};?:.,]', Punctuation),
- ],
- }
diff --git a/pygments/lexers/snobol.py b/pygments/lexers/snobol.py
deleted file mode 100644
index ce52f7c7..00000000
--- a/pygments/lexers/snobol.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.snobol
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the SNOBOL language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['SnobolLexer']
-
-
-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.
-
- .. versionadded:: 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)
- ]
- }
diff --git a/pygments/lexers/special.py b/pygments/lexers/special.py
deleted file mode 100644
index 1b3e9724..00000000
--- a/pygments/lexers/special.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.special
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Special lexers.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer
-from pygments.token import Token, Error, Text
-from pygments.util import get_choice_opt, text_type, BytesIO
-
-
-__all__ = ['TextLexer', 'RawTokenLexer']
-
-
-class TextLexer(Lexer):
- """
- "Null" lexer, doesn't highlight anything.
- """
- name = 'Text only'
- aliases = ['text']
- filenames = ['*.txt']
- mimetypes = ['text/plain']
- priority = 0.01
-
- def get_tokens_unprocessed(self, text):
- yield 0, Text, text
-
- def analyse_text(text):
- return TextLexer.priority
-
-_ttype_cache = {}
-
-line_re = re.compile(b'.*?\n')
-
-
-class RawTokenLexer(Lexer):
- """
- Recreate a token stream formatted with the `RawTokenFormatter`. This
- lexer raises exceptions during parsing if the token stream in the
- file is malformed.
-
- Additional options accepted:
-
- `compress`
- If set to ``"gz"`` or ``"bz2"``, decompress the token stream with
- the given compression algorithm before lexing (default: ``""``).
- """
- name = 'Raw token data'
- aliases = ['raw']
- filenames = []
- mimetypes = ['application/x-pygments-tokens']
-
- def __init__(self, **options):
- self.compress = get_choice_opt(options, 'compress',
- ['', 'none', 'gz', 'bz2'], '')
- Lexer.__init__(self, **options)
-
- def get_tokens(self, text):
- if isinstance(text, text_type):
- # raw token stream never has any non-ASCII characters
- text = text.encode('ascii')
- if self.compress == 'gz':
- import gzip
- gzipfile = gzip.GzipFile('', 'rb', 9, BytesIO(text))
- text = gzipfile.read()
- elif self.compress == 'bz2':
- import bz2
- text = bz2.decompress(text)
-
- # do not call Lexer.get_tokens() because we do not want Unicode
- # decoding to occur, and stripping is not optional.
- text = text.strip(b'\n') + b'\n'
- for i, t, v in self.get_tokens_unprocessed(text):
- yield t, v
-
- def get_tokens_unprocessed(self, text):
- length = 0
- for match in line_re.finditer(text):
- try:
- ttypestr, val = match.group().split(b'\t', 1)
- except ValueError:
- val = match.group().decode('ascii', 'replace')
- ttype = Error
- else:
- ttype = _ttype_cache.get(ttypestr)
- if not ttype:
- ttype = Token
- ttypes = ttypestr.split('.')[1:]
- for ttype_ in ttypes:
- if not ttype_ or not ttype_[0].isupper():
- raise ValueError('malformed token name')
- ttype = getattr(ttype, ttype_)
- _ttype_cache[ttypestr] = ttype
- val = val[2:-2].decode('unicode-escape')
- yield length, ttype, val
- length += len(val)
diff --git a/pygments/lexers/sql.py b/pygments/lexers/sql.py
deleted file mode 100644
index d789052d..00000000
--- a/pygments/lexers/sql.py
+++ /dev/null
@@ -1,729 +0,0 @@
-# -*- 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-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, words
-from pygments.token import Punctuation, Whitespace, Error, \
- Text, Comment, Operator, Keyword, Name, String, Number, Generic
-from pygments.lexers import get_lexer_by_name, ClassNotFound
-from pygments.util import iteritems
-
-from pygments.lexers._postgres_builtins import KEYWORDS, DATATYPES, \
- PSEUDO_TYPES, PLPGSQL_KEYWORDS
-from pygments.lexers import _tsql_builtins
-
-
-__all__ = ['PostgresLexer', 'PlPgsqlLexer', 'PostgresConsoleLexer',
- 'SqlLexer', 'TransactSqlLexer', 'MySqlLexer',
- 'SqliteConsoleLexer', 'RqlLexer']
-
-line_re = re.compile('.*?\n')
-
-language_re = re.compile(r"\s+LANGUAGE\s+'?(\w+)'?", re.IGNORECASE)
-
-do_re = re.compile(r'\bDO\b', re.IGNORECASE)
-
-# Regular expressions for analyse_text()
-name_between_bracket_re = re.compile(r'\[[a-zA-Z_]\w*\]')
-name_between_backtick_re = re.compile(r'`[a-zA-Z_]\w*`')
-tsql_go_re = re.compile(r'\bgo\b', re.IGNORECASE)
-tsql_declare_re = re.compile(r'\bdeclare\s+@', re.IGNORECASE)
-tsql_variable_re = re.compile(r'@[a-zA-Z_]\w*\b')
-
-
-def language_callback(lexer, match):
- """Parse the content of a $-string using a lexer
-
- The lexer is chosen looking for a nearby LANGUAGE or assumed as
- plpgsql if inside a DO statement and no LANGUAGE has been found.
- """
- 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))
- else:
- m = list(do_re.finditer(
- lexer.text[max(0, match.start()-25):match.start()]))
- if m:
- l = lexer._get_lexer('plpgsql')
-
- # 1 = $, 2 = delimiter, 3 = $
- yield (match.start(1), String, match.group(1))
- yield (match.start(2), String.Delimiter, match.group(2))
- yield (match.start(3), String, match.group(3))
- # 4 = string contents
- if l:
- for x in l.get_tokens_unprocessed(match.group(4)):
- yield x
- else:
- yield (match.start(4), String, match.group(4))
- # 5 = $, 6 = delimiter, 7 = $
- yield (match.start(5), String, match.group(5))
- yield (match.start(6), String.Delimiter, match.group(6))
- yield (match.start(7), String, match.group(7))
-
-
-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.
- """
- 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.
-
- .. versionadded:: 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(" ", r"\s+")
- for s in DATATYPES + PSEUDO_TYPES)
- + r')\b', Name.Builtin),
- (words(KEYWORDS, suffix=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&)?)(')", bygroups(String.Affix, String.Single), 'string'),
- # quoted identifier
- (r'((?:U&)?)(")', bygroups(String.Affix, String.Name), 'quoted-ident'),
- (r'(?s)(\$)([^$]*)(\$)(.*?)(\$)(\2)(\$)', language_callback),
- (r'[a-z_]\w*', Name),
-
- # psql variable in SQL
- (r""":(['"]?)[a-z]\w*\b\1""", Name.Variable),
-
- (r'[;:()\[\]{},.]', Punctuation),
- ],
- 'multiline-comments': [
- (r'/\*', Comment.Multiline, 'multiline-comments'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[^/*]+', Comment.Multiline),
- (r'[/*]', Comment.Multiline)
- ],
- 'string': [
- (r"[^']+", String.Single),
- (r"''", String.Single),
- (r"'", String.Single, '#pop'),
- ],
- 'quoted-ident': [
- (r'[^"]+', String.Name),
- (r'""', String.Name),
- (r'"', String.Name, '#pop'),
- ],
- }
-
-
-class PlPgsqlLexer(PostgresBase, RegexLexer):
- """
- Handle the extra syntax in Pl/pgSQL language.
-
- .. versionadded:: 1.5
- """
- name = 'PL/pgSQL'
- aliases = ['plpgsql']
- mimetypes = ['text/x-plpgsql']
-
- flags = re.IGNORECASE
- tokens = dict((k, l[:]) for (k, l) in iteritems(PostgresLexer.tokens))
-
- # extend the keywords list
- for i, pattern in enumerate(tokens['root']):
- if pattern[1] == Keyword:
- tokens['root'][i] = (
- words(KEYWORDS + PLPGSQL_KEYWORDS, suffix=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]\w*\b', Name.Builtin), # actually, a datatype
- (r':=', Operator),
- (r'\<\<[a-z]\w*\>\>', Name.Label),
- (r'\#[a-z]\w*\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 = dict((k, l[:]) for (k, l) in iteritems(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]\w*\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 next(self.iter)
- next = __next__
-
-
-class PostgresConsoleLexer(Lexer):
- """
- Lexer for psql sessions.
-
- .. versionadded:: 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 = []
- for line in lines:
- # 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
- for line in lines:
- 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)
- else:
- return
-
-
-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'),
- (words((
- 'ABORT', 'ABS', 'ABSOLUTE', 'ACCESS', 'ADA', 'ADD', 'ADMIN', 'AFTER', 'AGGREGATE',
- 'ALIAS', 'ALL', 'ALLOCATE', 'ALTER', 'ANALYSE', 'ANALYZE', 'AND', 'ANY', 'ARE', 'AS',
- 'ASC', 'ASENSITIVE', 'ASSERTION', 'ASSIGNMENT', 'ASYMMETRIC', 'AT', 'ATOMIC',
- 'AUTHORIZATION', 'AVG', 'BACKWARD', 'BEFORE', 'BEGIN', 'BETWEEN', 'BITVAR',
- 'BIT_LENGTH', 'BOTH', 'BREADTH', 'BY', 'C', 'CACHE', 'CALL', 'CALLED', 'CARDINALITY',
- 'CASCADE', 'CASCADED', 'CASE', 'CAST', 'CATALOG', 'CATALOG_NAME', 'CHAIN',
- 'CHARACTERISTICS', 'CHARACTER_LENGTH', 'CHARACTER_SET_CATALOG',
- 'CHARACTER_SET_NAME', 'CHARACTER_SET_SCHEMA', 'CHAR_LENGTH', 'CHECK',
- 'CHECKED', 'CHECKPOINT', 'CLASS', 'CLASS_ORIGIN', 'CLOB', 'CLOSE', 'CLUSTER',
- 'COALSECE', 'COBOL', 'COLLATE', 'COLLATION', 'COLLATION_CATALOG',
- 'COLLATION_NAME', 'COLLATION_SCHEMA', 'COLUMN', 'COLUMN_NAME',
- 'COMMAND_FUNCTION', 'COMMAND_FUNCTION_CODE', 'COMMENT', 'COMMIT',
- 'COMMITTED', 'COMPLETION', 'CONDITION_NUMBER', 'CONNECT', 'CONNECTION',
- 'CONNECTION_NAME', 'CONSTRAINT', 'CONSTRAINTS', 'CONSTRAINT_CATALOG',
- 'CONSTRAINT_NAME', 'CONSTRAINT_SCHEMA', 'CONSTRUCTOR', 'CONTAINS',
- 'CONTINUE', 'CONVERSION', 'CONVERT', 'COPY', 'CORRESPONTING', 'COUNT',
- 'CREATE', 'CREATEDB', 'CREATEUSER', 'CROSS', 'CUBE', 'CURRENT', 'CURRENT_DATE',
- 'CURRENT_PATH', 'CURRENT_ROLE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP',
- 'CURRENT_USER', 'CURSOR', 'CURSOR_NAME', 'CYCLE', 'DATA', 'DATABASE',
- 'DATETIME_INTERVAL_CODE', 'DATETIME_INTERVAL_PRECISION', 'DAY',
- 'DEALLOCATE', 'DECLARE', 'DEFAULT', 'DEFAULTS', 'DEFERRABLE', 'DEFERRED',
- 'DEFINED', 'DEFINER', 'DELETE', 'DELIMITER', 'DELIMITERS', 'DEREF', 'DESC',
- 'DESCRIBE', 'DESCRIPTOR', 'DESTROY', 'DESTRUCTOR', 'DETERMINISTIC',
- 'DIAGNOSTICS', 'DICTIONARY', 'DISCONNECT', 'DISPATCH', 'DISTINCT', 'DO',
- 'DOMAIN', 'DROP', 'DYNAMIC', 'DYNAMIC_FUNCTION', 'DYNAMIC_FUNCTION_CODE', 'EACH',
- 'ELSE', 'ELSIF', 'ENCODING', 'ENCRYPTED', 'END', 'END-EXEC', 'EQUALS', 'ESCAPE', 'EVERY',
- 'EXCEPTION', 'EXCEPT', 'EXCLUDING', 'EXCLUSIVE', 'EXEC', 'EXECUTE', 'EXISTING',
- 'EXISTS', 'EXPLAIN', 'EXTERNAL', 'EXTRACT', 'FALSE', 'FETCH', 'FINAL', 'FIRST', 'FOR',
- 'FORCE', 'FOREIGN', 'FORTRAN', 'FORWARD', 'FOUND', 'FREE', 'FREEZE', 'FROM', 'FULL',
- 'FUNCTION', 'G', 'GENERAL', 'GENERATED', 'GET', 'GLOBAL', 'GO', 'GOTO', 'GRANT', 'GRANTED',
- 'GROUP', 'GROUPING', 'HANDLER', 'HAVING', 'HIERARCHY', 'HOLD', 'HOST', 'IDENTITY', 'IF',
- 'IGNORE', 'ILIKE', 'IMMEDIATE', 'IMMUTABLE', 'IMPLEMENTATION', 'IMPLICIT', 'IN',
- 'INCLUDING', 'INCREMENT', 'INDEX', 'INDITCATOR', 'INFIX', 'INHERITS', 'INITIALIZE',
- 'INITIALLY', 'INNER', 'INOUT', 'INPUT', 'INSENSITIVE', 'INSERT', 'INSTANTIABLE',
- 'INSTEAD', 'INTERSECT', 'INTO', 'INVOKER', 'IS', 'ISNULL', 'ISOLATION', 'ITERATE', 'JOIN',
- 'KEY', 'KEY_MEMBER', 'KEY_TYPE', 'LANCOMPILER', 'LANGUAGE', 'LARGE', 'LAST',
- 'LATERAL', 'LEADING', 'LEFT', 'LENGTH', 'LESS', 'LEVEL', 'LIKE', 'LIMIT', 'LISTEN', 'LOAD',
- 'LOCAL', 'LOCALTIME', 'LOCALTIMESTAMP', 'LOCATION', 'LOCATOR', 'LOCK', 'LOWER',
- 'MAP', 'MATCH', 'MAX', 'MAXVALUE', 'MESSAGE_LENGTH', 'MESSAGE_OCTET_LENGTH',
- 'MESSAGE_TEXT', 'METHOD', 'MIN', 'MINUTE', 'MINVALUE', 'MOD', 'MODE', 'MODIFIES',
- 'MODIFY', 'MONTH', 'MORE', 'MOVE', 'MUMPS', 'NAMES', 'NATIONAL', 'NATURAL', 'NCHAR',
- 'NCLOB', 'NEW', 'NEXT', 'NO', 'NOCREATEDB', 'NOCREATEUSER', 'NONE', 'NOT', 'NOTHING',
- 'NOTIFY', 'NOTNULL', 'NULL', 'NULLABLE', 'NULLIF', 'OBJECT', 'OCTET_LENGTH', 'OF', 'OFF',
- 'OFFSET', 'OIDS', 'OLD', 'ON', 'ONLY', 'OPEN', 'OPERATION', 'OPERATOR', 'OPTION', 'OPTIONS',
- 'OR', 'ORDER', 'ORDINALITY', 'OUT', 'OUTER', 'OUTPUT', 'OVERLAPS', 'OVERLAY', 'OVERRIDING',
- 'OWNER', 'PAD', 'PARAMETER', 'PARAMETERS', 'PARAMETER_MODE', 'PARAMATER_NAME',
- 'PARAMATER_ORDINAL_POSITION', 'PARAMETER_SPECIFIC_CATALOG',
- 'PARAMETER_SPECIFIC_NAME', 'PARAMATER_SPECIFIC_SCHEMA', 'PARTIAL',
- 'PASCAL', 'PENDANT', 'PLACING', 'PLI', 'POSITION', 'POSTFIX', 'PRECISION', 'PREFIX',
- 'PREORDER', 'PREPARE', 'PRESERVE', 'PRIMARY', 'PRIOR', 'PRIVILEGES', 'PROCEDURAL',
- 'PROCEDURE', 'PUBLIC', 'READ', 'READS', 'RECHECK', 'RECURSIVE', 'REF', 'REFERENCES',
- 'REFERENCING', 'REINDEX', 'RELATIVE', 'RENAME', 'REPEATABLE', 'REPLACE', 'RESET',
- 'RESTART', 'RESTRICT', 'RESULT', 'RETURN', 'RETURNED_LENGTH',
- 'RETURNED_OCTET_LENGTH', 'RETURNED_SQLSTATE', 'RETURNS', 'REVOKE', 'RIGHT',
- 'ROLE', 'ROLLBACK', 'ROLLUP', 'ROUTINE', 'ROUTINE_CATALOG', 'ROUTINE_NAME',
- 'ROUTINE_SCHEMA', 'ROW', 'ROWS', 'ROW_COUNT', 'RULE', 'SAVE_POINT', 'SCALE', 'SCHEMA',
- 'SCHEMA_NAME', 'SCOPE', 'SCROLL', 'SEARCH', 'SECOND', 'SECURITY', 'SELECT', 'SELF',
- 'SENSITIVE', 'SERIALIZABLE', 'SERVER_NAME', 'SESSION', 'SESSION_USER', 'SET',
- 'SETOF', 'SETS', 'SHARE', 'SHOW', 'SIMILAR', 'SIMPLE', 'SIZE', 'SOME', 'SOURCE', 'SPACE',
- 'SPECIFIC', 'SPECIFICTYPE', 'SPECIFIC_NAME', 'SQL', 'SQLCODE', 'SQLERROR',
- 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNINIG', 'STABLE', 'START', 'STATE', 'STATEMENT',
- 'STATIC', 'STATISTICS', 'STDIN', 'STDOUT', 'STORAGE', 'STRICT', 'STRUCTURE', 'STYPE',
- 'SUBCLASS_ORIGIN', 'SUBLIST', 'SUBSTRING', 'SUM', 'SYMMETRIC', 'SYSID', 'SYSTEM',
- 'SYSTEM_USER', 'TABLE', 'TABLE_NAME', ' TEMP', 'TEMPLATE', 'TEMPORARY', 'TERMINATE',
- 'THAN', 'THEN', 'TIMESTAMP', 'TIMEZONE_HOUR', 'TIMEZONE_MINUTE', 'TO', 'TOAST',
- 'TRAILING', 'TRANSATION', 'TRANSACTIONS_COMMITTED',
- 'TRANSACTIONS_ROLLED_BACK', 'TRANSATION_ACTIVE', 'TRANSFORM',
- 'TRANSFORMS', 'TRANSLATE', 'TRANSLATION', 'TREAT', 'TRIGGER', 'TRIGGER_CATALOG',
- 'TRIGGER_NAME', 'TRIGGER_SCHEMA', 'TRIM', 'TRUE', 'TRUNCATE', 'TRUSTED', 'TYPE',
- 'UNCOMMITTED', 'UNDER', 'UNENCRYPTED', 'UNION', 'UNIQUE', 'UNKNOWN', 'UNLISTEN',
- 'UNNAMED', 'UNNEST', 'UNTIL', 'UPDATE', 'UPPER', 'USAGE', 'USER',
- 'USER_DEFINED_TYPE_CATALOG', 'USER_DEFINED_TYPE_NAME',
- 'USER_DEFINED_TYPE_SCHEMA', 'USING', 'VACUUM', 'VALID', 'VALIDATOR', 'VALUES',
- 'VARIABLE', 'VERBOSE', 'VERSION', 'VIEW', 'VOLATILE', 'WHEN', 'WHENEVER', 'WHERE',
- 'WITH', 'WITHOUT', 'WORK', 'WRITE', 'YEAR', 'ZONE'), suffix=r'\b'),
- Keyword),
- (words((
- 'ARRAY', 'BIGINT', 'BINARY', 'BIT', 'BLOB', 'BOOLEAN', 'CHAR', 'CHARACTER', 'DATE',
- 'DEC', 'DECIMAL', 'FLOAT', 'INT', 'INTEGER', 'INTERVAL', 'NUMBER', 'NUMERIC', 'REAL',
- 'SERIAL', 'SMALLINT', 'VARCHAR', 'VARYING', 'INT8', 'SERIAL8', 'TEXT'), suffix=r'\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-z_][\w$]*', Name), # allow $s in strings for Oracle
- (r'[;:()\[\],.]', Punctuation)
- ],
- 'multiline-comments': [
- (r'/\*', Comment.Multiline, 'multiline-comments'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[^/*]+', Comment.Multiline),
- (r'[/*]', Comment.Multiline)
- ]
- }
-
- def analyse_text(text):
- return 0.01
-
-
-class TransactSqlLexer(RegexLexer):
- """
- Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to
- SQL.
-
- The list of keywords includes ODBC and keywords reserved for future use..
- """
-
- name = 'Transact-SQL'
- aliases = ['tsql', 't-sql']
- filenames = ['*.sql']
- mimetypes = ['text/x-tsql']
-
- # Use re.UNICODE to allow non ASCII letters in names.
- flags = re.IGNORECASE | re.UNICODE
- tokens = {
- 'root': [
- (r'\s+', Whitespace),
- (r'(?m)--.*?$\n?', Comment.Single),
- (r'/\*', Comment.Multiline, 'multiline-comments'),
- (words(_tsql_builtins.OPERATORS), Operator),
- (words(_tsql_builtins.OPERATOR_WORDS, suffix=r'\b'), Operator.Word),
- (words(_tsql_builtins.TYPES, suffix=r'\b'), Name.Class),
- (words(_tsql_builtins.FUNCTIONS, suffix=r'\b'), Name.Function),
- (r'(goto)(\s+)(\w+\b)', bygroups(Keyword, Whitespace, Name.Label)),
- (words(_tsql_builtins.KEYWORDS, suffix=r'\b'), Keyword),
- (r'(\[)([^]]+)(\])', bygroups(Operator, Name, Operator)),
- (r'0x[0-9a-f]+', Number.Hex),
- # Float variant 1, for example: 1., 1.e2, 1.2e3
- (r'[0-9]+\.[0-9]*(e[+-]?[0-9]+)?', Number.Float),
- # Float variant 2, for example: .1, .1e2
- (r'\.[0-9]+(e[+-]?[0-9]+)?', Number.Float),
- # Float variant 3, for example: 123e45
- (r'[0-9]+e[+-]?[0-9]+', Number.Float),
- (r'[0-9]+', Number.Integer),
- (r"'(''|[^'])*'", String.Single),
- (r'"(""|[^"])*"', String.Symbol),
- (r'[;(),.]', Punctuation),
- # Below we use \w even for the first "real" character because
- # tokens starting with a digit have already been recognized
- # as Number above.
- (r'@@\w+', Name.Builtin),
- (r'@\w+', Name.Variable),
- (r'(\w+)(:)', bygroups(Name.Label, Punctuation)),
- (r'#?#?\w+', Name), # names for temp tables and anything else
- (r'\?', Name.Variable.Magic), # parameter for prepared statements
- ],
- 'multiline-comments': [
- (r'/\*', Comment.Multiline, 'multiline-comments'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[^/*]+', Comment.Multiline),
- (r'[/*]', Comment.Multiline)
- ]
- }
-
- def analyse_text(text):
- rating = 0
- if tsql_declare_re.search(text):
- # Found T-SQL variable declaration.
- rating = 1.0
- else:
- name_between_backtick_count = len(
- name_between_backtick_re.findall((text)))
- name_between_bracket_count = len(
- name_between_bracket_re.findall(text))
- # We need to check if there are any names using
- # backticks or brackets, as otherwise both are 0
- # and 0 >= 2 * 0, so we would always assume it's true
- dialect_name_count = name_between_backtick_count + name_between_bracket_count
- if dialect_name_count >= 1 and name_between_bracket_count >= 2 * name_between_backtick_count:
- # Found at least twice as many [name] as `name`.
- rating += 0.5
- elif name_between_bracket_count > name_between_backtick_count:
- rating += 0.2
- elif name_between_bracket_count > 0:
- rating += 0.1
- if tsql_variable_re.search(text) is not None:
- rating += 0.1
- if tsql_go_re.search(text) is not None:
- rating += 0.1
- return rating
-
-
-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),
- (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|flush|float|float4|'
- r'float8|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-z_]\w*)(\s*)(\()',
- bygroups(Name.Function, Text, Punctuation)),
- (r'[a-z_]\w*', Name),
- (r'@[a-z0-9]*[._]*[a-z0-9]*', Name.Variable),
- (r'[;:()\[\],.]', Punctuation)
- ],
- 'multiline-comments': [
- (r'/\*', Comment.Multiline, 'multiline-comments'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[^/*]+', Comment.Multiline),
- (r'[/*]', Comment.Multiline)
- ]
- }
-
- def analyse_text(text):
- rating = 0
- name_between_backtick_count = len(
- name_between_backtick_re.findall((text)))
- name_between_bracket_count = len(
- name_between_bracket_re.findall(text))
- # Same logic as above in the TSQL analysis
- dialect_name_count = name_between_backtick_count + name_between_bracket_count
- if dialect_name_count >= 1 and name_between_backtick_count >= 2 * name_between_bracket_count:
- # Found at least twice as many `name` as [name].
- rating += 0.5
- elif name_between_backtick_count > name_between_bracket_count:
- rating += 0.2
- elif name_between_backtick_count > 0:
- rating += 0.1
- return rating
-
-
-class SqliteConsoleLexer(Lexer):
- """
- Lexer for example sessions using sqlite3.
-
- .. versionadded:: 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 RqlLexer(RegexLexer):
- """
- Lexer for Relation Query Language.
-
- `RQL <http://www.logilab.org/project/rql>`_
-
- .. versionadded:: 2.0
- """
- name = 'RQL'
- aliases = ['rql']
- filenames = ['*.rql']
- mimetypes = ['text/x-rql']
-
- flags = re.IGNORECASE
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'(DELETE|SET|INSERT|UNION|DISTINCT|WITH|WHERE|BEING|OR'
- r'|AND|NOT|GROUPBY|HAVING|ORDERBY|ASC|DESC|LIMIT|OFFSET'
- r'|TODAY|NOW|TRUE|FALSE|NULL|EXISTS)\b', Keyword),
- (r'[+*/<>=%-]', Operator),
- (r'(Any|is|instance_of|CWEType|CWRelation)\b', Name.Builtin),
- (r'[0-9]+', Number.Integer),
- (r'[A-Z_]\w*\??', Name),
- (r"'(''|[^'])*'", String.Single),
- (r'"(""|[^"])*"', String.Single),
- (r'[;:()\[\],.]', Punctuation)
- ],
- }
diff --git a/pygments/lexers/stata.py b/pygments/lexers/stata.py
deleted file mode 100644
index b7b22edb..00000000
--- a/pygments/lexers/stata.py
+++ /dev/null
@@ -1,171 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.stata
- ~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for Stata
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Comment, Keyword, Name, Number, \
- String, Text, Operator
-
-from pygments.lexers._stata_builtins import builtins_base, builtins_functions
-
-__all__ = ['StataLexer']
-
-
-class StataLexer(RegexLexer):
- """
- For `Stata <http://www.stata.com/>`_ do files.
-
- .. versionadded:: 2.2
- """
- # Syntax based on
- # - http://fmwww.bc.edu/RePEc/bocode/s/synlightlist.ado
- # - http://github.com/isagalaev/highlight.js/blob/master/src/languages/stata.js
- # - http://github.com/jpitblado/vim-stata/blob/master/syntax/stata.vim
-
- name = 'Stata'
- aliases = ['stata', 'do']
- filenames = ['*.do', '*.ado']
- mimetypes = ['text/x-stata', 'text/stata', 'application/x-stata']
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- include('comments'),
- include('strings'),
- include('macros'),
- include('numbers'),
- include('keywords'),
- include('operators'),
- include('format'),
- (r'.', Text),
- ],
- # Comments are a complicated beast in Stata because they can be
- # nested and there are a few corner cases with that. See:
- # - github.com/kylebarron/language-stata/issues/90
- # - statalist.org/forums/forum/general-stata-discussion/general/1448244
- 'comments': [
- (r'(^//|(?<=\s)//)(?!/)', Comment.Single, 'comments-double-slash'),
- (r'^\s*\*', Comment.Single, 'comments-star'),
- (r'/\*', Comment.Multiline, 'comments-block'),
- (r'(^///|(?<=\s)///)', Comment.Special, 'comments-triple-slash')
- ],
- 'comments-block': [
- (r'/\*', Comment.Multiline, '#push'),
- # this ends and restarts a comment block. but need to catch this so
- # that it doesn\'t start _another_ level of comment blocks
- (r'\*/\*', Comment.Multiline),
- (r'(\*/\s+\*(?!/)[^\n]*)|(\*/)', Comment.Multiline, '#pop'),
- # Match anything else as a character inside the comment
- (r'.', Comment.Multiline),
- ],
- 'comments-star': [
- (r'///.*?\n', Comment.Single,
- ('#pop', 'comments-triple-slash')),
- (r'(^//|(?<=\s)//)(?!/)', Comment.Single,
- ('#pop', 'comments-double-slash')),
- (r'/\*', Comment.Multiline, 'comments-block'),
- (r'.(?=\n)', Comment.Single, '#pop'),
- (r'.', Comment.Single),
- ],
- 'comments-triple-slash': [
- (r'\n', Comment.Special, '#pop'),
- # A // breaks out of a comment for the rest of the line
- (r'//.*?(?=\n)', Comment.Single, '#pop'),
- (r'.', Comment.Special),
- ],
- 'comments-double-slash': [
- (r'\n', Text, '#pop'),
- (r'.', Comment.Single),
- ],
- # `"compound string"' and regular "string"; note the former are
- # nested.
- 'strings': [
- (r'`"', String, 'string-compound'),
- (r'(?<!`)"', String, 'string-regular'),
- ],
- 'string-compound': [
- (r'`"', String, '#push'),
- (r'"\'', String, '#pop'),
- (r'\\\\|\\"|\\\$|\\`|\\\n', String.Escape),
- include('macros'),
- (r'.', String)
- ],
- 'string-regular': [
- (r'(")(?!\')|(?=\n)', String, '#pop'),
- (r'\\\\|\\"|\\\$|\\`|\\\n', String.Escape),
- include('macros'),
- (r'.', String)
- ],
- # A local is usually
- # `\w{0,31}'
- # `:extended macro'
- # `=expression'
- # `[rsen](results)'
- # `(++--)scalar(++--)'
- #
- # However, there are all sorts of weird rules wrt edge
- # cases. Instead of writing 27 exceptions, anything inside
- # `' is a local.
- #
- # A global is more restricted, so we do follow rules. Note only
- # locals explicitly enclosed ${} can be nested.
- 'macros': [
- (r'\$(\{|(?=[\$`]))', Name.Variable.Global, 'macro-global-nested'),
- (r'\$', Name.Variable.Global, 'macro-global-name'),
- (r'`', Name.Variable, 'macro-local'),
- ],
- 'macro-local': [
- (r'`', Name.Variable, '#push'),
- (r"'", Name.Variable, '#pop'),
- (r'\$(\{|(?=[\$`]))', Name.Variable.Global, 'macro-global-nested'),
- (r'\$', Name.Variable.Global, 'macro-global-name'),
- (r'.', Name.Variable), # fallback
- ],
- 'macro-global-nested': [
- (r'\$(\{|(?=[\$`]))', Name.Variable.Global, '#push'),
- (r'\}', Name.Variable.Global, '#pop'),
- (r'\$', Name.Variable.Global, 'macro-global-name'),
- (r'`', Name.Variable, 'macro-local'),
- (r'\w', Name.Variable.Global), # fallback
- (r'(?!\w)', Name.Variable.Global, '#pop'),
- ],
- 'macro-global-name': [
- (r'\$(\{|(?=[\$`]))', Name.Variable.Global, 'macro-global-nested', '#pop'),
- (r'\$', Name.Variable.Global, 'macro-global-name', '#pop'),
- (r'`', Name.Variable, 'macro-local', '#pop'),
- (r'\w{1,32}', Name.Variable.Global, '#pop'),
- ],
- # Built in functions and statements
- 'keywords': [
- (words(builtins_functions, prefix = r'\b', suffix = r'(?=\()'),
- Name.Function),
- (words(builtins_base, prefix = r'(^\s*|\s)', suffix = r'\b'),
- Keyword),
- ],
- # http://www.stata.com/help.cgi?operators
- 'operators': [
- (r'-|==|<=|>=|<|>|&|!=', Operator),
- (r'\*|\+|\^|/|!|~|==|~=', Operator)
- ],
- # Stata numbers
- 'numbers': [
- # decimal number
- (r'\b[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)([eE][+-]?[0-9]+)?[i]?\b',
- Number),
- ],
- # Stata formats
- 'format': [
- (r'%-?\d{1,2}(\.\d{1,2})?[gfe]c?', Name.Other),
- (r'%(21x|16H|16L|8H|8L)', Name.Other),
- (r'%-?(tc|tC|td|tw|tm|tq|th|ty|tg)\S{0,32}', Name.Other),
- (r'%[-~]?\d{1,4}s', Name.Other),
- ]
- }
diff --git a/pygments/lexers/supercollider.py b/pygments/lexers/supercollider.py
deleted file mode 100644
index d0d033a0..00000000
--- a/pygments/lexers/supercollider.py
+++ /dev/null
@@ -1,90 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.supercollider
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for SuperCollider
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, words, default
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['SuperColliderLexer']
-
-
-class SuperColliderLexer(RegexLexer):
- """
- For `SuperCollider <http://supercollider.github.io/>`_ source code.
-
- .. versionadded:: 2.1
- """
-
- name = 'SuperCollider'
- aliases = ['sc', 'supercollider']
- filenames = ['*.sc', '*.scd']
- mimetypes = ['application/supercollider', 'text/supercollider', ]
-
- flags = re.DOTALL | re.MULTILINE
- tokens = {
- 'commentsandwhitespace': [
- (r'\s+', Text),
- (r'<!--', Comment),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline)
- ],
- 'slashstartsregex': [
- include('commentsandwhitespace'),
- (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
- (r'(?=/)', Text, ('#pop', 'badregex')),
- default('#pop'),
- ],
- 'badregex': [
- (r'\n', Text, '#pop')
- ],
- 'root': [
- (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
- include('commentsandwhitespace'),
- (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
- r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
- (words((
- 'for', 'in', 'while', 'do', 'break', 'return', 'continue',
- 'switch', 'case', 'default', 'if', 'else', 'throw', 'try',
- 'catch', 'finally', 'new', 'delete', 'typeof', 'instanceof',
- 'void'), suffix=r'\b'),
- Keyword, 'slashstartsregex'),
- (words(('var', 'let', 'with', 'function', 'arg'), suffix=r'\b'),
- Keyword.Declaration, 'slashstartsregex'),
- (words((
- '(abstract', 'boolean', 'byte', 'char', 'class', 'const',
- 'debugger', 'double', 'enum', 'export', 'extends', 'final',
- 'float', 'goto', 'implements', 'import', 'int', 'interface',
- 'long', 'native', 'package', 'private', 'protected', 'public',
- 'short', 'static', 'super', 'synchronized', 'throws',
- 'transient', 'volatile'), suffix=r'\b'),
- Keyword.Reserved),
- (words(('true', 'false', 'nil', 'inf'), suffix=r'\b'), Keyword.Constant),
- (words((
- 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Number',
- 'Object', 'Packages', 'RegExp', 'String',
- 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'super',
- 'thisFunctionDef', 'thisFunction', 'thisMethod', 'thisProcess',
- 'thisThread', 'this'), suffix=r'\b'),
- Name.Builtin),
- (r'[$a-zA-Z_]\w*', Name.Other),
- (r'\\?[$a-zA-Z_]\w*', String.Symbol),
- (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),
- ]
- }
diff --git a/pygments/lexers/tcl.py b/pygments/lexers/tcl.py
deleted file mode 100644
index ea37c824..00000000
--- a/pygments/lexers/tcl.py
+++ /dev/null
@@ -1,145 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.tcl
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for Tcl and related languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number
-from pygments.util import shebang_matches
-
-__all__ = ['TclLexer']
-
-
-class TclLexer(RegexLexer):
- """
- For Tcl source code.
-
- .. versionadded:: 0.10
- """
-
- keyword_cmds_re = words((
- 'after', 'apply', 'array', 'break', 'catch', 'continue', 'elseif', 'else', 'error',
- 'eval', 'expr', 'for', 'foreach', 'global', 'if', 'namespace', 'proc', 'rename', 'return',
- 'set', 'switch', 'then', 'trace', 'unset', 'update', 'uplevel', 'upvar', 'variable',
- 'vwait', 'while'), prefix=r'\b', suffix=r'\b')
-
- builtin_cmds_re = words((
- 'append', 'bgerror', 'binary', 'cd', 'chan', 'clock', 'close', 'concat', 'dde', 'dict',
- 'encoding', 'eof', 'exec', 'exit', 'fblocked', 'fconfigure', 'fcopy', 'file',
- 'fileevent', 'flush', 'format', 'gets', 'glob', 'history', 'http', 'incr', 'info', 'interp',
- 'join', 'lappend', 'lassign', 'lindex', 'linsert', 'list', 'llength', 'load', 'loadTk',
- 'lrange', 'lrepeat', 'lreplace', 'lreverse', 'lsearch', 'lset', 'lsort', 'mathfunc',
- 'mathop', 'memory', 'msgcat', 'open', 'package', 'pid', 'pkg::create', 'pkg_mkIndex',
- 'platform', 'platform::shell', 'puts', 'pwd', 're_syntax', 'read', 'refchan',
- 'regexp', 'registry', 'regsub', 'scan', 'seek', 'socket', 'source', 'split', 'string',
- 'subst', 'tell', 'time', 'tm', 'unknown', 'unload'), prefix=r'\b', suffix=r'\b')
-
- name = 'Tcl'
- aliases = ['tcl']
- filenames = ['*.tcl', '*.rvt']
- mimetypes = ['text/x-tcl', 'text/x-script.tcl', 'application/x-tcl']
-
- def _gen_command_rules(keyword_cmds_re, builtin_cmds_re, context=""):
- return [
- (keyword_cmds_re, Keyword, 'params' + context),
- (builtin_cmds_re, Name.Builtin, 'params' + context),
- (r'([\w.-]+)', Name.Variable, 'params' + context),
- (r'#', Comment, 'comment'),
- ]
-
- tokens = {
- 'root': [
- include('command'),
- include('basic'),
- include('data'),
- (r'\}', Keyword), # HACK: somehow we miscounted our braces
- ],
- 'command': _gen_command_rules(keyword_cmds_re, builtin_cmds_re),
- 'command-in-brace': _gen_command_rules(keyword_cmds_re,
- builtin_cmds_re,
- "-in-brace"),
- 'command-in-bracket': _gen_command_rules(keyword_cmds_re,
- builtin_cmds_re,
- "-in-bracket"),
- 'command-in-paren': _gen_command_rules(keyword_cmds_re,
- builtin_cmds_re,
- "-in-paren"),
- 'basic': [
- (r'\(', Keyword, 'paren'),
- (r'\[', Keyword, 'bracket'),
- (r'\{', Keyword, 'brace'),
- (r'"', String.Double, 'string'),
- (r'(eq|ne|in|ni)\b', Operator.Word),
- (r'!=|==|<<|>>|<=|>=|&&|\|\||\*\*|[-+~!*/%<>&^|?:]', Operator),
- ],
- 'data': [
- (r'\s+', Text),
- (r'0x[a-fA-F0-9]+', Number.Hex),
- (r'0[0-7]+', Number.Oct),
- (r'\d+\.\d+', Number.Float),
- (r'\d+', Number.Integer),
- (r'\$([\w.:-]+)', Name.Variable),
- (r'([\w.:-]+)', Text),
- ],
- 'params': [
- (r';', Keyword, '#pop'),
- (r'\n', Text, '#pop'),
- (r'(else|elseif|then)\b', Keyword),
- include('basic'),
- include('data'),
- ],
- 'params-in-brace': [
- (r'\}', Keyword, ('#pop', '#pop')),
- include('params')
- ],
- 'params-in-paren': [
- (r'\)', Keyword, ('#pop', '#pop')),
- include('params')
- ],
- 'params-in-bracket': [
- (r'\]', Keyword, ('#pop', '#pop')),
- include('params')
- ],
- 'string': [
- (r'\[', String.Double, 'string-square'),
- (r'(?s)(\\\\|\\[0-7]+|\\.|[^"\\])', String.Double),
- (r'"', String.Double, '#pop')
- ],
- 'string-square': [
- (r'\[', String.Double, 'string-square'),
- (r'(?s)(\\\\|\\[0-7]+|\\.|\\\n|[^\]\\])', String.Double),
- (r'\]', String.Double, '#pop')
- ],
- 'brace': [
- (r'\}', Keyword, '#pop'),
- include('command-in-brace'),
- include('basic'),
- include('data'),
- ],
- 'paren': [
- (r'\)', Keyword, '#pop'),
- include('command-in-paren'),
- include('basic'),
- include('data'),
- ],
- 'bracket': [
- (r'\]', Keyword, '#pop'),
- include('command-in-bracket'),
- include('basic'),
- include('data'),
- ],
- 'comment': [
- (r'.*[^\\]\n', Comment, '#pop'),
- (r'.*\\\n', Comment),
- ],
- }
-
- def analyse_text(text):
- return shebang_matches(text, r'(tcl)')
diff --git a/pygments/lexers/templates.py b/pygments/lexers/templates.py
deleted file mode 100644
index 498613e0..00000000
--- a/pygments/lexers/templates.py
+++ /dev/null
@@ -1,2282 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.templates
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for various template engines' markup.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexers.html import HtmlLexer, XmlLexer
-from pygments.lexers.javascript import JavascriptLexer, LassoLexer
-from pygments.lexers.css import CssLexer
-from pygments.lexers.php import PhpLexer
-from pygments.lexers.python import PythonLexer
-from pygments.lexers.perl import PerlLexer
-from pygments.lexers.jvm import JavaLexer, TeaLangLexer
-from pygments.lexers.data import YamlLexer
-from pygments.lexer import Lexer, DelegatingLexer, RegexLexer, bygroups, \
- include, using, this, default, combined
-from pygments.token import Error, Punctuation, Whitespace, \
- Text, Comment, Operator, Keyword, Name, String, Number, Other, Token
-from pygments.util import html_doctype_matches, looks_like_xml
-
-__all__ = ['HtmlPhpLexer', 'XmlPhpLexer', 'CssPhpLexer',
- 'JavascriptPhpLexer', 'ErbLexer', 'RhtmlLexer',
- 'XmlErbLexer', 'CssErbLexer', 'JavascriptErbLexer',
- 'SmartyLexer', 'HtmlSmartyLexer', 'XmlSmartyLexer',
- 'CssSmartyLexer', 'JavascriptSmartyLexer', 'DjangoLexer',
- 'HtmlDjangoLexer', 'CssDjangoLexer', 'XmlDjangoLexer',
- 'JavascriptDjangoLexer', 'GenshiLexer', 'HtmlGenshiLexer',
- 'GenshiTextLexer', 'CssGenshiLexer', 'JavascriptGenshiLexer',
- 'MyghtyLexer', 'MyghtyHtmlLexer', 'MyghtyXmlLexer',
- 'MyghtyCssLexer', 'MyghtyJavascriptLexer', 'MasonLexer', 'MakoLexer',
- 'MakoHtmlLexer', 'MakoXmlLexer', 'MakoJavascriptLexer',
- 'MakoCssLexer', 'JspLexer', 'CheetahLexer', 'CheetahHtmlLexer',
- 'CheetahXmlLexer', 'CheetahJavascriptLexer', 'EvoqueLexer',
- 'EvoqueHtmlLexer', 'EvoqueXmlLexer', 'ColdfusionLexer',
- 'ColdfusionHtmlLexer', 'ColdfusionCFCLexer', 'VelocityLexer',
- 'VelocityHtmlLexer', 'VelocityXmlLexer', 'SspLexer',
- 'TeaTemplateLexer', 'LassoHtmlLexer', 'LassoXmlLexer',
- 'LassoCssLexer', 'LassoJavascriptLexer', 'HandlebarsLexer',
- 'HandlebarsHtmlLexer', 'YamlJinjaLexer', 'LiquidLexer',
- 'TwigLexer', 'TwigHtmlLexer', 'Angular2Lexer', 'Angular2HtmlLexer']
-
-
-class ErbLexer(Lexer):
- """
- Generic `ERB <http://ruby-doc.org/core/classes/ERB.html>`_ (Ruby Templating)
- lexer.
-
- Just highlights ruby code between the preprocessor directives, other data
- is left untouched by the lexer.
-
- All options are also forwarded to the `RubyLexer`.
- """
-
- name = 'ERB'
- aliases = ['erb']
- mimetypes = ['application/x-ruby-templating']
-
- _block_re = re.compile(r'(<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$)', re.M)
-
- def __init__(self, **options):
- from pygments.lexers.ruby import RubyLexer
- self.ruby_lexer = RubyLexer(**options)
- Lexer.__init__(self, **options)
-
- def get_tokens_unprocessed(self, text):
- """
- Since ERB doesn't allow "<%" and other tags inside of ruby
- blocks we have to use a split approach here that fails for
- that too.
- """
- tokens = self._block_re.split(text)
- tokens.reverse()
- state = idx = 0
- try:
- while True:
- # text
- if state == 0:
- val = tokens.pop()
- yield idx, Other, val
- idx += len(val)
- state = 1
- # block starts
- elif state == 1:
- tag = tokens.pop()
- # literals
- if tag in ('<%%', '%%>'):
- yield idx, Other, tag
- idx += 3
- state = 0
- # comment
- elif tag == '<%#':
- yield idx, Comment.Preproc, tag
- val = tokens.pop()
- yield idx + 3, Comment, val
- idx += 3 + len(val)
- state = 2
- # blocks or output
- elif tag in ('<%', '<%=', '<%-'):
- yield idx, Comment.Preproc, tag
- idx += len(tag)
- data = tokens.pop()
- r_idx = 0
- for r_idx, r_token, r_value in \
- self.ruby_lexer.get_tokens_unprocessed(data):
- yield r_idx + idx, r_token, r_value
- idx += len(data)
- state = 2
- elif tag in ('%>', '-%>'):
- yield idx, Error, tag
- idx += len(tag)
- state = 0
- # % raw ruby statements
- else:
- yield idx, Comment.Preproc, tag[0]
- r_idx = 0
- for r_idx, r_token, r_value in \
- self.ruby_lexer.get_tokens_unprocessed(tag[1:]):
- yield idx + 1 + r_idx, r_token, r_value
- idx += len(tag)
- state = 0
- # block ends
- elif state == 2:
- tag = tokens.pop()
- if tag not in ('%>', '-%>'):
- yield idx, Other, tag
- else:
- yield idx, Comment.Preproc, tag
- idx += len(tag)
- state = 0
- except IndexError:
- return
-
- def analyse_text(text):
- if '<%' in text and '%>' in text:
- return 0.4
-
-
-class SmartyLexer(RegexLexer):
- """
- Generic `Smarty <http://smarty.php.net/>`_ template lexer.
-
- Just highlights smarty code between the preprocessor directives, other
- data is left untouched by the lexer.
- """
-
- name = 'Smarty'
- aliases = ['smarty']
- filenames = ['*.tpl']
- mimetypes = ['application/x-smarty']
-
- flags = re.MULTILINE | re.DOTALL
-
- tokens = {
- 'root': [
- (r'[^{]+', Other),
- (r'(\{)(\*.*?\*)(\})',
- bygroups(Comment.Preproc, Comment, Comment.Preproc)),
- (r'(\{php\})(.*?)(\{/php\})',
- bygroups(Comment.Preproc, using(PhpLexer, startinline=True),
- Comment.Preproc)),
- (r'(\{)(/?[a-zA-Z_]\w*)(\s*)',
- bygroups(Comment.Preproc, Name.Function, Text), 'smarty'),
- (r'\{', Comment.Preproc, 'smarty')
- ],
- 'smarty': [
- (r'\s+', Text),
- (r'\{', Comment.Preproc, '#push'),
- (r'\}', Comment.Preproc, '#pop'),
- (r'#[a-zA-Z_]\w*#', Name.Variable),
- (r'\$[a-zA-Z_]\w*(\.\w+)*', Name.Variable),
- (r'[~!%^&*()+=|\[\]:;,.<>/?@-]', Operator),
- (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),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r'[a-zA-Z_]\w*', Name.Attribute)
- ]
- }
-
- def analyse_text(text):
- rv = 0.0
- if re.search(r'\{if\s+.*?\}.*?\{/if\}', text):
- rv += 0.15
- if re.search(r'\{include\s+file=.*?\}', text):
- rv += 0.15
- if re.search(r'\{foreach\s+.*?\}.*?\{/foreach\}', text):
- rv += 0.15
- if re.search(r'\{\$.*?\}', text):
- rv += 0.01
- return rv
-
-
-class VelocityLexer(RegexLexer):
- """
- Generic `Velocity <http://velocity.apache.org/>`_ template lexer.
-
- Just highlights velocity directives and variable references, other
- data is left untouched by the lexer.
- """
-
- name = 'Velocity'
- aliases = ['velocity']
- filenames = ['*.vm', '*.fhtml']
-
- flags = re.MULTILINE | re.DOTALL
-
- identifier = r'[a-zA-Z_]\w*'
-
- tokens = {
- 'root': [
- (r'[^{#$]+', Other),
- (r'(#)(\*.*?\*)(#)',
- bygroups(Comment.Preproc, Comment, Comment.Preproc)),
- (r'(##)(.*?$)',
- bygroups(Comment.Preproc, Comment)),
- (r'(#\{?)(' + identifier + r')(\}?)(\s?\()',
- bygroups(Comment.Preproc, Name.Function, Comment.Preproc, Punctuation),
- 'directiveparams'),
- (r'(#\{?)(' + identifier + r')(\}|\b)',
- bygroups(Comment.Preproc, Name.Function, Comment.Preproc)),
- (r'\$\{?', Punctuation, 'variable')
- ],
- 'variable': [
- (identifier, Name.Variable),
- (r'\(', Punctuation, 'funcparams'),
- (r'(\.)(' + identifier + r')',
- bygroups(Punctuation, Name.Variable), '#push'),
- (r'\}', Punctuation, '#pop'),
- default('#pop')
- ],
- 'directiveparams': [
- (r'(&&|\|\||==?|!=?|[-<>+*%&|^/])|\b(eq|ne|gt|lt|ge|le|not|in)\b',
- Operator),
- (r'\[', Operator, 'rangeoperator'),
- (r'\b' + identifier + r'\b', Name.Function),
- include('funcparams')
- ],
- 'rangeoperator': [
- (r'\.\.', Operator),
- include('funcparams'),
- (r'\]', Operator, '#pop')
- ],
- 'funcparams': [
- (r'\$\{?', Punctuation, 'variable'),
- (r'\s+', Text),
- (r'[,:]', Punctuation),
- (r'"(\\\\|\\"|[^"])*"', String.Double),
- (r"'(\\\\|\\'|[^'])*'", String.Single),
- (r"0[xX][0-9a-fA-F]+[Ll]?", Number),
- (r"\b[0-9]+\b", Number),
- (r'(true|false|null)\b', Keyword.Constant),
- (r'\(', Punctuation, '#push'),
- (r'\)', Punctuation, '#pop'),
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- (r'\[', Punctuation, '#push'),
- (r'\]', Punctuation, '#pop'),
- ]
- }
-
- def analyse_text(text):
- rv = 0.0
- if re.search(r'#\{?macro\}?\(.*?\).*?#\{?end\}?', text):
- rv += 0.25
- if re.search(r'#\{?if\}?\(.+?\).*?#\{?end\}?', text):
- rv += 0.15
- if re.search(r'#\{?foreach\}?\(.+?\).*?#\{?end\}?', text):
- rv += 0.15
- if re.search(r'\$\{?[a-zA-Z_]\w*(\([^)]*\))?'
- r'(\.\w+(\([^)]*\))?)*\}?', text):
- rv += 0.01
- return rv
-
-
-class VelocityHtmlLexer(DelegatingLexer):
- """
- Subclass of the `VelocityLexer` that highlights unlexed data
- with the `HtmlLexer`.
-
- """
-
- name = 'HTML+Velocity'
- aliases = ['html+velocity']
- alias_filenames = ['*.html', '*.fhtml']
- mimetypes = ['text/html+velocity']
-
- def __init__(self, **options):
- super(VelocityHtmlLexer, self).__init__(HtmlLexer, VelocityLexer,
- **options)
-
-
-class VelocityXmlLexer(DelegatingLexer):
- """
- Subclass of the `VelocityLexer` that highlights unlexed data
- with the `XmlLexer`.
-
- """
-
- name = 'XML+Velocity'
- aliases = ['xml+velocity']
- alias_filenames = ['*.xml', '*.vm']
- mimetypes = ['application/xml+velocity']
-
- def __init__(self, **options):
- super(VelocityXmlLexer, self).__init__(XmlLexer, VelocityLexer,
- **options)
-
- def analyse_text(text):
- rv = VelocityLexer.analyse_text(text) - 0.01
- if looks_like_xml(text):
- rv += 0.4
- return rv
-
-
-class DjangoLexer(RegexLexer):
- """
- Generic `django <http://www.djangoproject.com/documentation/templates/>`_
- and `jinja <http://wsgiarea.pocoo.org/jinja/>`_ template lexer.
-
- It just highlights django/jinja code between the preprocessor directives,
- other data is left untouched by the lexer.
- """
-
- name = 'Django/Jinja'
- aliases = ['django', 'jinja']
- mimetypes = ['application/x-django-templating', 'application/x-jinja']
-
- flags = re.M | re.S
-
- tokens = {
- 'root': [
- (r'[^{]+', Other),
- (r'\{\{', Comment.Preproc, 'var'),
- # jinja/django comments
- (r'\{[*#].*?[*#]\}', Comment),
- # django comments
- (r'(\{%)(-?\s*)(comment)(\s*-?)(%\})(.*?)'
- r'(\{%)(-?\s*)(endcomment)(\s*-?)(%\})',
- bygroups(Comment.Preproc, Text, Keyword, Text, Comment.Preproc,
- Comment, Comment.Preproc, Text, Keyword, Text,
- Comment.Preproc)),
- # raw jinja blocks
- (r'(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)'
- r'(\{%)(-?\s*)(endraw)(\s*-?)(%\})',
- bygroups(Comment.Preproc, Text, Keyword, Text, Comment.Preproc,
- Text, Comment.Preproc, Text, Keyword, Text,
- Comment.Preproc)),
- # filter blocks
- (r'(\{%)(-?\s*)(filter)(\s+)([a-zA-Z_]\w*)',
- bygroups(Comment.Preproc, Text, Keyword, Text, Name.Function),
- 'block'),
- (r'(\{%)(-?\s*)([a-zA-Z_]\w*)',
- bygroups(Comment.Preproc, Text, Keyword), 'block'),
- (r'\{', Other)
- ],
- 'varnames': [
- (r'(\|)(\s*)([a-zA-Z_]\w*)',
- bygroups(Operator, Text, Name.Function)),
- (r'(is)(\s+)(not)?(\s+)?([a-zA-Z_]\w*)',
- bygroups(Keyword, Text, Keyword, Text, Name.Function)),
- (r'(_|true|false|none|True|False|None)\b', Keyword.Pseudo),
- (r'(in|as|reversed|recursive|not|and|or|is|if|else|import|'
- r'with(?:(?:out)?\s*context)?|scoped|ignore\s+missing)\b',
- Keyword),
- (r'(loop|block|super|forloop)\b', Name.Builtin),
- (r'[a-zA-Z_][\w-]*', Name.Variable),
- (r'\.\w+', Name.Variable),
- (r':?"(\\\\|\\"|[^"])*"', String.Double),
- (r":?'(\\\\|\\'|[^'])*'", String.Single),
- (r'([{}()\[\]+\-*/%,:~]|[><=]=?|!=)', Operator),
- (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
- r"0[xX][0-9a-fA-F]+[Ll]?", Number),
- ],
- 'var': [
- (r'\s+', Text),
- (r'(-?)(\}\})', bygroups(Text, Comment.Preproc), '#pop'),
- include('varnames')
- ],
- 'block': [
- (r'\s+', Text),
- (r'(-?)(%\})', bygroups(Text, Comment.Preproc), '#pop'),
- include('varnames'),
- (r'.', Punctuation)
- ]
- }
-
- def analyse_text(text):
- rv = 0.0
- if re.search(r'\{%\s*(block|extends)', text) is not None:
- rv += 0.4
- if re.search(r'\{%\s*if\s*.*?%\}', text) is not None:
- rv += 0.1
- if re.search(r'\{\{.*?\}\}', text) is not None:
- rv += 0.1
- return rv
-
-
-class MyghtyLexer(RegexLexer):
- """
- Generic `myghty templates`_ lexer. Code that isn't Myghty
- markup is yielded as `Token.Other`.
-
- .. versionadded:: 0.6
-
- .. _myghty templates: http://www.myghty.org/
- """
-
- name = 'Myghty'
- aliases = ['myghty']
- filenames = ['*.myt', 'autodelegate']
- mimetypes = ['application/x-myghty']
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'(?s)(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)',
- bygroups(Name.Tag, Text, Name.Function, Name.Tag,
- using(this), Name.Tag)),
- (r'(?s)(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)',
- bygroups(Name.Tag, Name.Function, Name.Tag,
- using(PythonLexer), Name.Tag)),
- (r'(<&[^|])(.*?)(,.*?)?(&>)',
- bygroups(Name.Tag, Name.Function, using(PythonLexer), Name.Tag)),
- (r'(?s)(<&\|)(.*?)(,.*?)?(&>)',
- bygroups(Name.Tag, Name.Function, using(PythonLexer), Name.Tag)),
- (r'</&>', Name.Tag),
- (r'(?s)(<%!?)(.*?)(%>)',
- bygroups(Name.Tag, using(PythonLexer), Name.Tag)),
- (r'(?<=^)#[^\n]*(\n|\Z)', Comment),
- (r'(?<=^)(%)([^\n]*)(\n|\Z)',
- bygroups(Name.Tag, using(PythonLexer), Other)),
- (r"""(?sx)
- (.+?) # anything, followed by:
- (?:
- (?<=\n)(?=[%#]) | # an eval or comment line
- (?=</?[%&]) | # a substitution or block or
- # call start or end
- # - don't consume
- (\\\n) | # an escaped newline
- \Z # end of string
- )""", bygroups(Other, Operator)),
- ]
- }
-
-
-class MyghtyHtmlLexer(DelegatingLexer):
- """
- Subclass of the `MyghtyLexer` that highlights unlexed data
- with the `HtmlLexer`.
-
- .. versionadded:: 0.6
- """
-
- name = 'HTML+Myghty'
- aliases = ['html+myghty']
- mimetypes = ['text/html+myghty']
-
- def __init__(self, **options):
- super(MyghtyHtmlLexer, self).__init__(HtmlLexer, MyghtyLexer,
- **options)
-
-
-class MyghtyXmlLexer(DelegatingLexer):
- """
- Subclass of the `MyghtyLexer` that highlights unlexed data
- with the `XmlLexer`.
-
- .. versionadded:: 0.6
- """
-
- name = 'XML+Myghty'
- aliases = ['xml+myghty']
- mimetypes = ['application/xml+myghty']
-
- def __init__(self, **options):
- super(MyghtyXmlLexer, self).__init__(XmlLexer, MyghtyLexer,
- **options)
-
-
-class MyghtyJavascriptLexer(DelegatingLexer):
- """
- Subclass of the `MyghtyLexer` that highlights unlexed data
- with the `JavascriptLexer`.
-
- .. versionadded:: 0.6
- """
-
- name = 'JavaScript+Myghty'
- aliases = ['js+myghty', 'javascript+myghty']
- mimetypes = ['application/x-javascript+myghty',
- 'text/x-javascript+myghty',
- 'text/javascript+mygthy']
-
- def __init__(self, **options):
- super(MyghtyJavascriptLexer, self).__init__(JavascriptLexer,
- MyghtyLexer, **options)
-
-
-class MyghtyCssLexer(DelegatingLexer):
- """
- Subclass of the `MyghtyLexer` that highlights unlexed data
- with the `CssLexer`.
-
- .. versionadded:: 0.6
- """
-
- name = 'CSS+Myghty'
- aliases = ['css+myghty']
- mimetypes = ['text/css+myghty']
-
- def __init__(self, **options):
- super(MyghtyCssLexer, self).__init__(CssLexer, MyghtyLexer,
- **options)
-
-
-class MasonLexer(RegexLexer):
- """
- Generic `mason templates`_ lexer. Stolen from Myghty lexer. Code that isn't
- Mason markup is HTML.
-
- .. _mason templates: http://www.masonhq.com/
-
- .. versionadded:: 1.4
- """
- name = 'Mason'
- aliases = ['mason']
- filenames = ['*.m', '*.mhtml', '*.mc', '*.mi', 'autohandler', 'dhandler']
- mimetypes = ['application/x-mason']
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'(?s)(<%doc>)(.*?)(</%doc>)',
- bygroups(Name.Tag, Comment.Multiline, Name.Tag)),
- (r'(?s)(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)',
- bygroups(Name.Tag, Text, Name.Function, Name.Tag,
- using(this), Name.Tag)),
- (r'(?s)(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)',
- bygroups(Name.Tag, Name.Function, Name.Tag,
- using(PerlLexer), Name.Tag)),
- (r'(?s)(<&[^|])(.*?)(,.*?)?(&>)',
- bygroups(Name.Tag, Name.Function, using(PerlLexer), Name.Tag)),
- (r'(?s)(<&\|)(.*?)(,.*?)?(&>)',
- bygroups(Name.Tag, Name.Function, using(PerlLexer), Name.Tag)),
- (r'</&>', Name.Tag),
- (r'(?s)(<%!?)(.*?)(%>)',
- bygroups(Name.Tag, using(PerlLexer), Name.Tag)),
- (r'(?<=^)#[^\n]*(\n|\Z)', Comment),
- (r'(?<=^)(%)([^\n]*)(\n|\Z)',
- bygroups(Name.Tag, using(PerlLexer), Other)),
- (r"""(?sx)
- (.+?) # anything, followed by:
- (?:
- (?<=\n)(?=[%#]) | # an eval or comment line
- (?=</?[%&]) | # a substitution or block or
- # call start or end
- # - don't consume
- (\\\n) | # an escaped newline
- \Z # end of string
- )""", bygroups(using(HtmlLexer), Operator)),
- ]
- }
-
- def analyse_text(text):
- result = 0.0
- if re.search(r'</%(class|doc|init)%>', text) is not None:
- result = 1.0
- elif re.search(r'<&.+&>', text, re.DOTALL) is not None:
- result = 0.11
- return result
-
-
-class MakoLexer(RegexLexer):
- """
- Generic `mako templates`_ lexer. Code that isn't Mako
- markup is yielded as `Token.Other`.
-
- .. versionadded:: 0.7
-
- .. _mako templates: http://www.makotemplates.org/
- """
-
- name = 'Mako'
- aliases = ['mako']
- filenames = ['*.mao']
- mimetypes = ['application/x-mako']
-
- tokens = {
- 'root': [
- (r'(\s*)(%)(\s*end(?:\w+))(\n|\Z)',
- bygroups(Text, Comment.Preproc, Keyword, Other)),
- (r'(\s*)(%)([^\n]*)(\n|\Z)',
- bygroups(Text, Comment.Preproc, using(PythonLexer), Other)),
- (r'(\s*)(##[^\n]*)(\n|\Z)',
- bygroups(Text, Comment.Preproc, Other)),
- (r'(?s)<%doc>.*?</%doc>', Comment.Preproc),
- (r'(<%)([\w.:]+)',
- bygroups(Comment.Preproc, Name.Builtin), 'tag'),
- (r'(</%)([\w.:]+)(>)',
- bygroups(Comment.Preproc, Name.Builtin, Comment.Preproc)),
- (r'<%(?=([\w.:]+))', Comment.Preproc, 'ondeftags'),
- (r'(?s)(<%(?:!?))(.*?)(%>)',
- bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),
- (r'(\$\{)(.*?)(\})',
- bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),
- (r'''(?sx)
- (.+?) # anything, followed by:
- (?:
- (?<=\n)(?=%|\#\#) | # an eval or comment line
- (?=\#\*) | # multiline comment
- (?=</?%) | # a python block
- # call start or end
- (?=\$\{) | # a substitution
- (?<=\n)(?=\s*%) |
- # - don't consume
- (\\\n) | # an escaped newline
- \Z # end of string
- )
- ''', bygroups(Other, Operator)),
- (r'\s+', Text),
- ],
- 'ondeftags': [
- (r'<%', Comment.Preproc),
- (r'(?<=<%)(include|inherit|namespace|page)', Name.Builtin),
- include('tag'),
- ],
- 'tag': [
- (r'((?:\w+)\s*=)(\s*)(".*?")',
- bygroups(Name.Attribute, Text, String)),
- (r'/?\s*>', Comment.Preproc, '#pop'),
- (r'\s+', Text),
- ],
- 'attr': [
- ('".*?"', String, '#pop'),
- ("'.*?'", String, '#pop'),
- (r'[^\s>]+', String, '#pop'),
- ],
- }
-
-
-class MakoHtmlLexer(DelegatingLexer):
- """
- Subclass of the `MakoLexer` that highlights unlexed data
- with the `HtmlLexer`.
-
- .. versionadded:: 0.7
- """
-
- name = 'HTML+Mako'
- aliases = ['html+mako']
- mimetypes = ['text/html+mako']
-
- def __init__(self, **options):
- super(MakoHtmlLexer, self).__init__(HtmlLexer, MakoLexer,
- **options)
-
-
-class MakoXmlLexer(DelegatingLexer):
- """
- Subclass of the `MakoLexer` that highlights unlexed data
- with the `XmlLexer`.
-
- .. versionadded:: 0.7
- """
-
- name = 'XML+Mako'
- aliases = ['xml+mako']
- mimetypes = ['application/xml+mako']
-
- def __init__(self, **options):
- super(MakoXmlLexer, self).__init__(XmlLexer, MakoLexer,
- **options)
-
-
-class MakoJavascriptLexer(DelegatingLexer):
- """
- Subclass of the `MakoLexer` that highlights unlexed data
- with the `JavascriptLexer`.
-
- .. versionadded:: 0.7
- """
-
- name = 'JavaScript+Mako'
- aliases = ['js+mako', 'javascript+mako']
- mimetypes = ['application/x-javascript+mako',
- 'text/x-javascript+mako',
- 'text/javascript+mako']
-
- def __init__(self, **options):
- super(MakoJavascriptLexer, self).__init__(JavascriptLexer,
- MakoLexer, **options)
-
-
-class MakoCssLexer(DelegatingLexer):
- """
- Subclass of the `MakoLexer` that highlights unlexed data
- with the `CssLexer`.
-
- .. versionadded:: 0.7
- """
-
- name = 'CSS+Mako'
- aliases = ['css+mako']
- mimetypes = ['text/css+mako']
-
- def __init__(self, **options):
- super(MakoCssLexer, self).__init__(CssLexer, MakoLexer,
- **options)
-
-
-# Genshi and Cheetah lexers courtesy of Matt Good.
-
-class CheetahPythonLexer(Lexer):
- """
- Lexer for handling Cheetah's special $ tokens in Python syntax.
- """
-
- def get_tokens_unprocessed(self, text):
- pylexer = PythonLexer(**self.options)
- for pos, type_, value in pylexer.get_tokens_unprocessed(text):
- if type_ == Token.Error and value == '$':
- type_ = Comment.Preproc
- yield pos, type_, value
-
-
-class CheetahLexer(RegexLexer):
- """
- Generic `cheetah templates`_ lexer. Code that isn't Cheetah
- markup is yielded as `Token.Other`. This also works for
- `spitfire templates`_ which use the same syntax.
-
- .. _cheetah templates: http://www.cheetahtemplate.org/
- .. _spitfire templates: http://code.google.com/p/spitfire/
- """
-
- name = 'Cheetah'
- aliases = ['cheetah', 'spitfire']
- filenames = ['*.tmpl', '*.spt']
- mimetypes = ['application/x-cheetah', 'application/x-spitfire']
-
- tokens = {
- 'root': [
- (r'(##[^\n]*)$',
- (bygroups(Comment))),
- (r'#[*](.|\n)*?[*]#', Comment),
- (r'#end[^#\n]*(?:#|$)', Comment.Preproc),
- (r'#slurp$', Comment.Preproc),
- (r'(#[a-zA-Z]+)([^#\n]*)(#|$)',
- (bygroups(Comment.Preproc, using(CheetahPythonLexer),
- Comment.Preproc))),
- # TODO support other Python syntax like $foo['bar']
- (r'(\$)([a-zA-Z_][\w.]*\w)',
- bygroups(Comment.Preproc, using(CheetahPythonLexer))),
- (r'(?s)(\$\{!?)(.*?)(\})',
- bygroups(Comment.Preproc, using(CheetahPythonLexer),
- Comment.Preproc)),
- (r'''(?sx)
- (.+?) # anything, followed by:
- (?:
- (?=\#[#a-zA-Z]*) | # an eval comment
- (?=\$[a-zA-Z_{]) | # a substitution
- \Z # end of string
- )
- ''', Other),
- (r'\s+', Text),
- ],
- }
-
-
-class CheetahHtmlLexer(DelegatingLexer):
- """
- Subclass of the `CheetahLexer` that highlights unlexed data
- with the `HtmlLexer`.
- """
-
- name = 'HTML+Cheetah'
- aliases = ['html+cheetah', 'html+spitfire', 'htmlcheetah']
- mimetypes = ['text/html+cheetah', 'text/html+spitfire']
-
- def __init__(self, **options):
- super(CheetahHtmlLexer, self).__init__(HtmlLexer, CheetahLexer,
- **options)
-
-
-class CheetahXmlLexer(DelegatingLexer):
- """
- Subclass of the `CheetahLexer` that highlights unlexed data
- with the `XmlLexer`.
- """
-
- name = 'XML+Cheetah'
- aliases = ['xml+cheetah', 'xml+spitfire']
- mimetypes = ['application/xml+cheetah', 'application/xml+spitfire']
-
- def __init__(self, **options):
- super(CheetahXmlLexer, self).__init__(XmlLexer, CheetahLexer,
- **options)
-
-
-class CheetahJavascriptLexer(DelegatingLexer):
- """
- Subclass of the `CheetahLexer` that highlights unlexed data
- with the `JavascriptLexer`.
- """
-
- name = 'JavaScript+Cheetah'
- aliases = ['js+cheetah', 'javascript+cheetah',
- 'js+spitfire', 'javascript+spitfire']
- mimetypes = ['application/x-javascript+cheetah',
- 'text/x-javascript+cheetah',
- 'text/javascript+cheetah',
- 'application/x-javascript+spitfire',
- 'text/x-javascript+spitfire',
- 'text/javascript+spitfire']
-
- def __init__(self, **options):
- super(CheetahJavascriptLexer, self).__init__(JavascriptLexer,
- CheetahLexer, **options)
-
-
-class GenshiTextLexer(RegexLexer):
- """
- A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ text
- templates.
- """
-
- name = 'Genshi Text'
- aliases = ['genshitext']
- mimetypes = ['application/x-genshi-text', 'text/x-genshi']
-
- tokens = {
- 'root': [
- (r'[^#$\s]+', Other),
- (r'^(\s*)(##.*)$', bygroups(Text, Comment)),
- (r'^(\s*)(#)', bygroups(Text, Comment.Preproc), 'directive'),
- include('variable'),
- (r'[#$\s]', Other),
- ],
- 'directive': [
- (r'\n', Text, '#pop'),
- (r'(?:def|for|if)\s+.*', using(PythonLexer), '#pop'),
- (r'(choose|when|with)([^\S\n]+)(.*)',
- bygroups(Keyword, Text, using(PythonLexer)), '#pop'),
- (r'(choose|otherwise)\b', Keyword, '#pop'),
- (r'(end\w*)([^\S\n]*)(.*)', bygroups(Keyword, Text, Comment), '#pop'),
- ],
- 'variable': [
- (r'(?<!\$)(\$\{)(.+?)(\})',
- bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),
- (r'(?<!\$)(\$)([a-zA-Z_][\w.]*)',
- Name.Variable),
- ]
- }
-
-
-class GenshiMarkupLexer(RegexLexer):
- """
- Base lexer for Genshi markup, used by `HtmlGenshiLexer` and
- `GenshiLexer`.
- """
-
- flags = re.DOTALL
-
- tokens = {
- 'root': [
- (r'[^<$]+', Other),
- (r'(<\?python)(.*?)(\?>)',
- bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),
- # yield style and script blocks as Other
- (r'<\s*(script|style)\s*.*?>.*?<\s*/\1\s*>', Other),
- (r'<\s*py:[a-zA-Z0-9]+', Name.Tag, 'pytag'),
- (r'<\s*[a-zA-Z0-9:.]+', Name.Tag, 'tag'),
- include('variable'),
- (r'[<$]', Other),
- ],
- 'pytag': [
- (r'\s+', Text),
- (r'[\w:-]+\s*=', Name.Attribute, 'pyattr'),
- (r'/?\s*>', Name.Tag, '#pop'),
- ],
- 'pyattr': [
- ('(")(.*?)(")', bygroups(String, using(PythonLexer), String), '#pop'),
- ("(')(.*?)(')", bygroups(String, using(PythonLexer), String), '#pop'),
- (r'[^\s>]+', String, '#pop'),
- ],
- 'tag': [
- (r'\s+', Text),
- (r'py:[\w-]+\s*=', Name.Attribute, 'pyattr'),
- (r'[\w:-]+\s*=', Name.Attribute, 'attr'),
- (r'/?\s*>', Name.Tag, '#pop'),
- ],
- 'attr': [
- ('"', String, 'attr-dstring'),
- ("'", String, 'attr-sstring'),
- (r'[^\s>]*', String, '#pop')
- ],
- 'attr-dstring': [
- ('"', String, '#pop'),
- include('strings'),
- ("'", String)
- ],
- 'attr-sstring': [
- ("'", String, '#pop'),
- include('strings'),
- ("'", String)
- ],
- 'strings': [
- ('[^"\'$]+', String),
- include('variable')
- ],
- 'variable': [
- (r'(?<!\$)(\$\{)(.+?)(\})',
- bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),
- (r'(?<!\$)(\$)([a-zA-Z_][\w\.]*)',
- Name.Variable),
- ]
- }
-
-
-class HtmlGenshiLexer(DelegatingLexer):
- """
- A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and
- `kid <http://kid-templating.org/>`_ kid HTML templates.
- """
-
- name = 'HTML+Genshi'
- aliases = ['html+genshi', 'html+kid']
- alias_filenames = ['*.html', '*.htm', '*.xhtml']
- mimetypes = ['text/html+genshi']
-
- def __init__(self, **options):
- super(HtmlGenshiLexer, self).__init__(HtmlLexer, GenshiMarkupLexer,
- **options)
-
- def analyse_text(text):
- rv = 0.0
- if re.search(r'\$\{.*?\}', text) is not None:
- rv += 0.2
- if re.search(r'py:(.*?)=["\']', text) is not None:
- rv += 0.2
- return rv + HtmlLexer.analyse_text(text) - 0.01
-
-
-class GenshiLexer(DelegatingLexer):
- """
- A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and
- `kid <http://kid-templating.org/>`_ kid XML templates.
- """
-
- name = 'Genshi'
- aliases = ['genshi', 'kid', 'xml+genshi', 'xml+kid']
- filenames = ['*.kid']
- alias_filenames = ['*.xml']
- mimetypes = ['application/x-genshi', 'application/x-kid']
-
- def __init__(self, **options):
- super(GenshiLexer, self).__init__(XmlLexer, GenshiMarkupLexer,
- **options)
-
- def analyse_text(text):
- rv = 0.0
- if re.search(r'\$\{.*?\}', text) is not None:
- rv += 0.2
- if re.search(r'py:(.*?)=["\']', text) is not None:
- rv += 0.2
- return rv + XmlLexer.analyse_text(text) - 0.01
-
-
-class JavascriptGenshiLexer(DelegatingLexer):
- """
- A lexer that highlights javascript code in genshi text templates.
- """
-
- name = 'JavaScript+Genshi Text'
- aliases = ['js+genshitext', 'js+genshi', 'javascript+genshitext',
- 'javascript+genshi']
- alias_filenames = ['*.js']
- mimetypes = ['application/x-javascript+genshi',
- 'text/x-javascript+genshi',
- 'text/javascript+genshi']
-
- def __init__(self, **options):
- super(JavascriptGenshiLexer, self).__init__(JavascriptLexer,
- GenshiTextLexer,
- **options)
-
- def analyse_text(text):
- return GenshiLexer.analyse_text(text) - 0.05
-
-
-class CssGenshiLexer(DelegatingLexer):
- """
- A lexer that highlights CSS definitions in genshi text templates.
- """
-
- name = 'CSS+Genshi Text'
- aliases = ['css+genshitext', 'css+genshi']
- alias_filenames = ['*.css']
- mimetypes = ['text/css+genshi']
-
- def __init__(self, **options):
- super(CssGenshiLexer, self).__init__(CssLexer, GenshiTextLexer,
- **options)
-
- def analyse_text(text):
- return GenshiLexer.analyse_text(text) - 0.05
-
-
-class RhtmlLexer(DelegatingLexer):
- """
- Subclass of the ERB lexer that highlights the unlexed data with the
- html lexer.
-
- Nested Javascript and CSS is highlighted too.
- """
-
- name = 'RHTML'
- aliases = ['rhtml', 'html+erb', 'html+ruby']
- filenames = ['*.rhtml']
- alias_filenames = ['*.html', '*.htm', '*.xhtml']
- mimetypes = ['text/html+ruby']
-
- def __init__(self, **options):
- super(RhtmlLexer, self).__init__(HtmlLexer, ErbLexer, **options)
-
- def analyse_text(text):
- rv = ErbLexer.analyse_text(text) - 0.01
- if html_doctype_matches(text):
- # one more than the XmlErbLexer returns
- rv += 0.5
- return rv
-
-
-class XmlErbLexer(DelegatingLexer):
- """
- Subclass of `ErbLexer` which highlights data outside preprocessor
- directives with the `XmlLexer`.
- """
-
- name = 'XML+Ruby'
- aliases = ['xml+erb', 'xml+ruby']
- alias_filenames = ['*.xml']
- mimetypes = ['application/xml+ruby']
-
- def __init__(self, **options):
- super(XmlErbLexer, self).__init__(XmlLexer, ErbLexer, **options)
-
- def analyse_text(text):
- rv = ErbLexer.analyse_text(text) - 0.01
- if looks_like_xml(text):
- rv += 0.4
- return rv
-
-
-class CssErbLexer(DelegatingLexer):
- """
- Subclass of `ErbLexer` which highlights unlexed data with the `CssLexer`.
- """
-
- name = 'CSS+Ruby'
- aliases = ['css+erb', 'css+ruby']
- alias_filenames = ['*.css']
- mimetypes = ['text/css+ruby']
-
- def __init__(self, **options):
- super(CssErbLexer, self).__init__(CssLexer, ErbLexer, **options)
-
- def analyse_text(text):
- return ErbLexer.analyse_text(text) - 0.05
-
-
-class JavascriptErbLexer(DelegatingLexer):
- """
- Subclass of `ErbLexer` which highlights unlexed data with the
- `JavascriptLexer`.
- """
-
- name = 'JavaScript+Ruby'
- aliases = ['js+erb', 'javascript+erb', 'js+ruby', 'javascript+ruby']
- alias_filenames = ['*.js']
- mimetypes = ['application/x-javascript+ruby',
- 'text/x-javascript+ruby',
- 'text/javascript+ruby']
-
- def __init__(self, **options):
- super(JavascriptErbLexer, self).__init__(JavascriptLexer, ErbLexer,
- **options)
-
- def analyse_text(text):
- return ErbLexer.analyse_text(text) - 0.05
-
-
-class HtmlPhpLexer(DelegatingLexer):
- """
- Subclass of `PhpLexer` that highlights unhandled data with the `HtmlLexer`.
-
- Nested Javascript and CSS is highlighted too.
- """
-
- name = 'HTML+PHP'
- aliases = ['html+php']
- filenames = ['*.phtml']
- alias_filenames = ['*.php', '*.html', '*.htm', '*.xhtml',
- '*.php[345]']
- mimetypes = ['application/x-php',
- 'application/x-httpd-php', 'application/x-httpd-php3',
- 'application/x-httpd-php4', 'application/x-httpd-php5']
-
- def __init__(self, **options):
- super(HtmlPhpLexer, self).__init__(HtmlLexer, PhpLexer, **options)
-
- def analyse_text(text):
- rv = PhpLexer.analyse_text(text) - 0.01
- if html_doctype_matches(text):
- rv += 0.5
- return rv
-
-
-class XmlPhpLexer(DelegatingLexer):
- """
- Subclass of `PhpLexer` that highlights unhandled data with the `XmlLexer`.
- """
-
- name = 'XML+PHP'
- aliases = ['xml+php']
- alias_filenames = ['*.xml', '*.php', '*.php[345]']
- mimetypes = ['application/xml+php']
-
- def __init__(self, **options):
- super(XmlPhpLexer, self).__init__(XmlLexer, PhpLexer, **options)
-
- def analyse_text(text):
- rv = PhpLexer.analyse_text(text) - 0.01
- if looks_like_xml(text):
- rv += 0.4
- return rv
-
-
-class CssPhpLexer(DelegatingLexer):
- """
- Subclass of `PhpLexer` which highlights unmatched data with the `CssLexer`.
- """
-
- name = 'CSS+PHP'
- aliases = ['css+php']
- alias_filenames = ['*.css']
- mimetypes = ['text/css+php']
-
- def __init__(self, **options):
- super(CssPhpLexer, self).__init__(CssLexer, PhpLexer, **options)
-
- def analyse_text(text):
- return PhpLexer.analyse_text(text) - 0.05
-
-
-class JavascriptPhpLexer(DelegatingLexer):
- """
- Subclass of `PhpLexer` which highlights unmatched data with the
- `JavascriptLexer`.
- """
-
- name = 'JavaScript+PHP'
- aliases = ['js+php', 'javascript+php']
- alias_filenames = ['*.js']
- mimetypes = ['application/x-javascript+php',
- 'text/x-javascript+php',
- 'text/javascript+php']
-
- def __init__(self, **options):
- super(JavascriptPhpLexer, self).__init__(JavascriptLexer, PhpLexer,
- **options)
-
- def analyse_text(text):
- return PhpLexer.analyse_text(text)
-
-
-class HtmlSmartyLexer(DelegatingLexer):
- """
- Subclass of the `SmartyLexer` that highlights unlexed data with the
- `HtmlLexer`.
-
- Nested Javascript and CSS is highlighted too.
- """
-
- name = 'HTML+Smarty'
- aliases = ['html+smarty']
- alias_filenames = ['*.html', '*.htm', '*.xhtml', '*.tpl']
- mimetypes = ['text/html+smarty']
-
- def __init__(self, **options):
- super(HtmlSmartyLexer, self).__init__(HtmlLexer, SmartyLexer, **options)
-
- def analyse_text(text):
- rv = SmartyLexer.analyse_text(text) - 0.01
- if html_doctype_matches(text):
- rv += 0.5
- return rv
-
-
-class XmlSmartyLexer(DelegatingLexer):
- """
- Subclass of the `SmartyLexer` that highlights unlexed data with the
- `XmlLexer`.
- """
-
- name = 'XML+Smarty'
- aliases = ['xml+smarty']
- alias_filenames = ['*.xml', '*.tpl']
- mimetypes = ['application/xml+smarty']
-
- def __init__(self, **options):
- super(XmlSmartyLexer, self).__init__(XmlLexer, SmartyLexer, **options)
-
- def analyse_text(text):
- rv = SmartyLexer.analyse_text(text) - 0.01
- if looks_like_xml(text):
- rv += 0.4
- return rv
-
-
-class CssSmartyLexer(DelegatingLexer):
- """
- Subclass of the `SmartyLexer` that highlights unlexed data with the
- `CssLexer`.
- """
-
- name = 'CSS+Smarty'
- aliases = ['css+smarty']
- alias_filenames = ['*.css', '*.tpl']
- mimetypes = ['text/css+smarty']
-
- def __init__(self, **options):
- super(CssSmartyLexer, self).__init__(CssLexer, SmartyLexer, **options)
-
- def analyse_text(text):
- return SmartyLexer.analyse_text(text) - 0.05
-
-
-class JavascriptSmartyLexer(DelegatingLexer):
- """
- Subclass of the `SmartyLexer` that highlights unlexed data with the
- `JavascriptLexer`.
- """
-
- name = 'JavaScript+Smarty'
- aliases = ['js+smarty', 'javascript+smarty']
- alias_filenames = ['*.js', '*.tpl']
- mimetypes = ['application/x-javascript+smarty',
- 'text/x-javascript+smarty',
- 'text/javascript+smarty']
-
- def __init__(self, **options):
- super(JavascriptSmartyLexer, self).__init__(JavascriptLexer, SmartyLexer,
- **options)
-
- def analyse_text(text):
- return SmartyLexer.analyse_text(text) - 0.05
-
-
-class HtmlDjangoLexer(DelegatingLexer):
- """
- Subclass of the `DjangoLexer` that highlights unlexed data with the
- `HtmlLexer`.
-
- Nested Javascript and CSS is highlighted too.
- """
-
- name = 'HTML+Django/Jinja'
- aliases = ['html+django', 'html+jinja', 'htmldjango']
- alias_filenames = ['*.html', '*.htm', '*.xhtml']
- mimetypes = ['text/html+django', 'text/html+jinja']
-
- def __init__(self, **options):
- super(HtmlDjangoLexer, self).__init__(HtmlLexer, DjangoLexer, **options)
-
- def analyse_text(text):
- rv = DjangoLexer.analyse_text(text) - 0.01
- if html_doctype_matches(text):
- rv += 0.5
- return rv
-
-
-class XmlDjangoLexer(DelegatingLexer):
- """
- Subclass of the `DjangoLexer` that highlights unlexed data with the
- `XmlLexer`.
- """
-
- name = 'XML+Django/Jinja'
- aliases = ['xml+django', 'xml+jinja']
- alias_filenames = ['*.xml']
- mimetypes = ['application/xml+django', 'application/xml+jinja']
-
- def __init__(self, **options):
- super(XmlDjangoLexer, self).__init__(XmlLexer, DjangoLexer, **options)
-
- def analyse_text(text):
- rv = DjangoLexer.analyse_text(text) - 0.01
- if looks_like_xml(text):
- rv += 0.4
- return rv
-
-
-class CssDjangoLexer(DelegatingLexer):
- """
- Subclass of the `DjangoLexer` that highlights unlexed data with the
- `CssLexer`.
- """
-
- name = 'CSS+Django/Jinja'
- aliases = ['css+django', 'css+jinja']
- alias_filenames = ['*.css']
- mimetypes = ['text/css+django', 'text/css+jinja']
-
- def __init__(self, **options):
- super(CssDjangoLexer, self).__init__(CssLexer, DjangoLexer, **options)
-
- def analyse_text(text):
- return DjangoLexer.analyse_text(text) - 0.05
-
-
-class JavascriptDjangoLexer(DelegatingLexer):
- """
- Subclass of the `DjangoLexer` that highlights unlexed data with the
- `JavascriptLexer`.
- """
-
- name = 'JavaScript+Django/Jinja'
- aliases = ['js+django', 'javascript+django',
- 'js+jinja', 'javascript+jinja']
- alias_filenames = ['*.js']
- mimetypes = ['application/x-javascript+django',
- 'application/x-javascript+jinja',
- 'text/x-javascript+django',
- 'text/x-javascript+jinja',
- 'text/javascript+django',
- 'text/javascript+jinja']
-
- def __init__(self, **options):
- super(JavascriptDjangoLexer, self).__init__(JavascriptLexer, DjangoLexer,
- **options)
-
- def analyse_text(text):
- return DjangoLexer.analyse_text(text) - 0.05
-
-
-class JspRootLexer(RegexLexer):
- """
- Base for the `JspLexer`. Yields `Token.Other` for area outside of
- JSP tags.
-
- .. versionadded:: 0.7
- """
-
- tokens = {
- 'root': [
- (r'<%\S?', Keyword, 'sec'),
- # FIXME: I want to make these keywords but still parse attributes.
- (r'</?jsp:(forward|getProperty|include|plugin|setProperty|useBean).*?>',
- Keyword),
- (r'[^<]+', Other),
- (r'<', Other),
- ],
- 'sec': [
- (r'%>', Keyword, '#pop'),
- # note: '\w\W' != '.' without DOTALL.
- (r'[\w\W]+?(?=%>|\Z)', using(JavaLexer)),
- ],
- }
-
-
-class JspLexer(DelegatingLexer):
- """
- Lexer for Java Server Pages.
-
- .. versionadded:: 0.7
- """
- name = 'Java Server Page'
- aliases = ['jsp']
- filenames = ['*.jsp']
- mimetypes = ['application/x-jsp']
-
- def __init__(self, **options):
- super(JspLexer, self).__init__(XmlLexer, JspRootLexer, **options)
-
- def analyse_text(text):
- rv = JavaLexer.analyse_text(text) - 0.01
- if looks_like_xml(text):
- rv += 0.4
- if '<%' in text and '%>' in text:
- rv += 0.1
- return rv
-
-
-class EvoqueLexer(RegexLexer):
- """
- For files using the Evoque templating system.
-
- .. versionadded:: 1.1
- """
- name = 'Evoque'
- aliases = ['evoque']
- filenames = ['*.evoque']
- mimetypes = ['application/x-evoque']
-
- flags = re.DOTALL
-
- tokens = {
- 'root': [
- (r'[^#$]+', Other),
- (r'#\[', Comment.Multiline, 'comment'),
- (r'\$\$', Other),
- # svn keywords
- (r'\$\w+:[^$\n]*\$', Comment.Multiline),
- # directives: begin, end
- (r'(\$)(begin|end)(\{(%)?)(.*?)((?(4)%)\})',
- bygroups(Punctuation, Name.Builtin, 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}
- # should be using(PythonLexer), not passed out as String
- (r'(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+[^=,%}]+?)?'
- r'(.*?)((?(4)%)\})',
- bygroups(Punctuation, Name.Builtin, Punctuation, None,
- String, using(PythonLexer), Punctuation)),
- # directives: if, for, prefer, test
- (r'(\$)(\w+)(\{(%)?)(.*?)((?(4)%)\})',
- bygroups(Punctuation, Name.Builtin, 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)),
- (r'#', Other),
- ],
- 'comment': [
- (r'[^\]#]', Comment.Multiline),
- (r'#\[', Comment.Multiline, '#push'),
- (r'\]#', Comment.Multiline, '#pop'),
- (r'[\]#]', Comment.Multiline)
- ],
- }
-
-
-class EvoqueHtmlLexer(DelegatingLexer):
- """
- Subclass of the `EvoqueLexer` that highlights unlexed data with the
- `HtmlLexer`.
-
- .. versionadded:: 1.1
- """
- name = 'HTML+Evoque'
- aliases = ['html+evoque']
- filenames = ['*.html']
- mimetypes = ['text/html+evoque']
-
- def __init__(self, **options):
- super(EvoqueHtmlLexer, self).__init__(HtmlLexer, EvoqueLexer,
- **options)
-
-
-class EvoqueXmlLexer(DelegatingLexer):
- """
- Subclass of the `EvoqueLexer` that highlights unlexed data with the
- `XmlLexer`.
-
- .. versionadded:: 1.1
- """
- name = 'XML+Evoque'
- aliases = ['xml+evoque']
- filenames = ['*.xml']
- mimetypes = ['application/xml+evoque']
-
- def __init__(self, **options):
- super(EvoqueXmlLexer, self).__init__(XmlLexer, EvoqueLexer,
- **options)
-
-
-class ColdfusionLexer(RegexLexer):
- """
- Coldfusion statements
- """
- name = 'cfstatement'
- aliases = ['cfs']
- filenames = []
- mimetypes = []
- flags = re.IGNORECASE
-
- tokens = {
- 'root': [
- (r'//.*?\n', Comment.Single),
- (r'/\*(?:.|\n)*?\*/', Comment.Multiline),
- (r'\+\+|--', Operator),
- (r'[-+*/^&=!]', Operator),
- (r'<=|>=|<|>|==', Operator),
- (r'mod\b', Operator),
- (r'(eq|lt|gt|lte|gte|not|is|and|or)\b', Operator),
- (r'\|\||&&', Operator),
- (r'\?', Operator),
- (r'"', String.Double, 'string'),
- # There is a special rule for allowing html in single quoted
- # strings, evidently.
- (r"'.*?'", String.Single),
- (r'\d+', Number),
- (r'(if|else|len|var|xml|default|break|switch|component|property|function|do|'
- r'try|catch|in|continue|for|return|while|required|any|array|binary|boolean|'
- r'component|date|guid|numeric|query|string|struct|uuid|case)\b', Keyword),
- (r'(true|false|null)\b', Keyword.Constant),
- (r'(application|session|client|cookie|super|this|variables|arguments)\b',
- Name.Constant),
- (r'([a-z_$][\w.]*)(\s*)(\()',
- bygroups(Name.Function, Text, Punctuation)),
- (r'[a-z_$][\w.]*', Name.Variable),
- (r'[()\[\]{};:,.\\]', Punctuation),
- (r'\s+', Text),
- ],
- 'string': [
- (r'""', String.Double),
- (r'#.+?#', String.Interp),
- (r'[^"#]+', String.Double),
- (r'#', String.Double),
- (r'"', String.Double, '#pop'),
- ],
- }
-
-
-class ColdfusionMarkupLexer(RegexLexer):
- """
- Coldfusion markup only
- """
- name = 'Coldfusion'
- aliases = ['cf']
- filenames = []
- mimetypes = []
-
- tokens = {
- 'root': [
- (r'[^<]+', Other),
- include('tags'),
- (r'<[^<>]*', Other),
- ],
- 'tags': [
- (r'<!---', Comment.Multiline, 'cfcomment'),
- (r'(?s)<!--.*?-->', Comment),
- (r'<cfoutput.*?>', Name.Builtin, 'cfoutput'),
- (r'(?s)(<cfscript.*?>)(.+?)(</cfscript.*?>)',
- bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
- # negative lookbehind is for strings with embedded >
- (r'(?s)(</?cf(?:component|include|if|else|elseif|loop|return|'
- r'dbinfo|dump|abort|location|invoke|throw|file|savecontent|'
- r'mailpart|mail|header|content|zip|image|lock|argument|try|'
- r'catch|break|directory|http|set|function|param)\b)(.*?)((?<!\\)>)',
- bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
- ],
- 'cfoutput': [
- (r'[^#<]+', Other),
- (r'(#)(.*?)(#)', bygroups(Punctuation, using(ColdfusionLexer),
- Punctuation)),
- # (r'<cfoutput.*?>', Name.Builtin, '#push'),
- (r'</cfoutput.*?>', Name.Builtin, '#pop'),
- include('tags'),
- (r'(?s)<[^<>]*', Other),
- (r'#', Other),
- ],
- 'cfcomment': [
- (r'<!---', Comment.Multiline, '#push'),
- (r'--->', Comment.Multiline, '#pop'),
- (r'([^<-]|<(?!!---)|-(?!-->))+', Comment.Multiline),
- ],
- }
-
-
-class ColdfusionHtmlLexer(DelegatingLexer):
- """
- Coldfusion markup in html
- """
- name = 'Coldfusion HTML'
- aliases = ['cfm']
- filenames = ['*.cfm', '*.cfml']
- mimetypes = ['application/x-coldfusion']
-
- def __init__(self, **options):
- super(ColdfusionHtmlLexer, self).__init__(HtmlLexer, ColdfusionMarkupLexer,
- **options)
-
-
-class ColdfusionCFCLexer(DelegatingLexer):
- """
- Coldfusion markup/script components
-
- .. versionadded:: 2.0
- """
- name = 'Coldfusion CFC'
- aliases = ['cfc']
- filenames = ['*.cfc']
- mimetypes = []
-
- def __init__(self, **options):
- super(ColdfusionCFCLexer, self).__init__(ColdfusionHtmlLexer, ColdfusionLexer,
- **options)
-
-
-class SspLexer(DelegatingLexer):
- """
- Lexer for Scalate Server Pages.
-
- .. versionadded:: 1.4
- """
- name = 'Scalate Server Page'
- aliases = ['ssp']
- filenames = ['*.ssp']
- mimetypes = ['application/x-ssp']
-
- def __init__(self, **options):
- super(SspLexer, self).__init__(XmlLexer, JspRootLexer, **options)
-
- def analyse_text(text):
- rv = 0.0
- if re.search(r'val \w+\s*:', text):
- rv += 0.6
- if looks_like_xml(text):
- rv += 0.2
- 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.
-
- .. versionadded:: 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/>`_.
-
- .. versionadded:: 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
-
-
-class LassoHtmlLexer(DelegatingLexer):
- """
- Subclass of the `LassoLexer` which highlights unhandled data with the
- `HtmlLexer`.
-
- Nested JavaScript and CSS is also highlighted.
-
- .. versionadded:: 1.6
- """
-
- name = 'HTML+Lasso'
- aliases = ['html+lasso']
- alias_filenames = ['*.html', '*.htm', '*.xhtml', '*.lasso', '*.lasso[89]',
- '*.incl', '*.inc', '*.las']
- mimetypes = ['text/html+lasso',
- 'application/x-httpd-lasso',
- 'application/x-httpd-lasso[89]']
-
- def __init__(self, **options):
- super(LassoHtmlLexer, self).__init__(HtmlLexer, LassoLexer, **options)
-
- def analyse_text(text):
- rv = LassoLexer.analyse_text(text) - 0.01
- if html_doctype_matches(text): # same as HTML lexer
- rv += 0.5
- return rv
-
-
-class LassoXmlLexer(DelegatingLexer):
- """
- Subclass of the `LassoLexer` which highlights unhandled data with the
- `XmlLexer`.
-
- .. versionadded:: 1.6
- """
-
- name = 'XML+Lasso'
- aliases = ['xml+lasso']
- alias_filenames = ['*.xml', '*.lasso', '*.lasso[89]',
- '*.incl', '*.inc', '*.las']
- mimetypes = ['application/xml+lasso']
-
- def __init__(self, **options):
- super(LassoXmlLexer, self).__init__(XmlLexer, LassoLexer, **options)
-
- def analyse_text(text):
- rv = LassoLexer.analyse_text(text) - 0.01
- if looks_like_xml(text):
- rv += 0.4
- return rv
-
-
-class LassoCssLexer(DelegatingLexer):
- """
- Subclass of the `LassoLexer` which highlights unhandled data with the
- `CssLexer`.
-
- .. versionadded:: 1.6
- """
-
- name = 'CSS+Lasso'
- aliases = ['css+lasso']
- alias_filenames = ['*.css']
- mimetypes = ['text/css+lasso']
-
- def __init__(self, **options):
- options['requiredelimiters'] = True
- super(LassoCssLexer, self).__init__(CssLexer, LassoLexer, **options)
-
- def analyse_text(text):
- rv = LassoLexer.analyse_text(text) - 0.05
- if re.search(r'\w+:.+?;', text):
- rv += 0.1
- if 'padding:' in text:
- rv += 0.1
- return rv
-
-
-class LassoJavascriptLexer(DelegatingLexer):
- """
- Subclass of the `LassoLexer` which highlights unhandled data with the
- `JavascriptLexer`.
-
- .. versionadded:: 1.6
- """
-
- name = 'JavaScript+Lasso'
- aliases = ['js+lasso', 'javascript+lasso']
- alias_filenames = ['*.js']
- mimetypes = ['application/x-javascript+lasso',
- 'text/x-javascript+lasso',
- 'text/javascript+lasso']
-
- def __init__(self, **options):
- options['requiredelimiters'] = True
- super(LassoJavascriptLexer, self).__init__(JavascriptLexer, LassoLexer,
- **options)
-
- def analyse_text(text):
- rv = LassoLexer.analyse_text(text) - 0.05
- return rv
-
-
-class HandlebarsLexer(RegexLexer):
- """
- Generic `handlebars <http://handlebarsjs.com/>` template lexer.
-
- Highlights only the Handlebars template tags (stuff between `{{` and `}}`).
- Everything else is left for a delegating lexer.
-
- .. versionadded:: 2.0
- """
-
- name = "Handlebars"
- aliases = ['handlebars']
-
- tokens = {
- 'root': [
- (r'[^{]+', Other),
-
- # Comment start {{! }} or {{!--
- (r'\{\{!.*\}\}', Comment),
-
- # HTML Escaping open {{{expression
- (r'(\{\{\{)(\s*)', bygroups(Comment.Special, Text), 'tag'),
-
- # {{blockOpen {{#blockOpen {{/blockClose with optional tilde ~
- (r'(\{\{)([#~/]+)([^\s}]*)', bygroups(Comment.Preproc, Number.Attribute,Number.Attribute), 'tag'),
- (r'(\{\{)(\s*)', bygroups(Comment.Preproc, Text), 'tag'),
- ],
-
- 'tag': [
- (r'\s+', Text),
- # HTML Escaping close }}}
- (r'\}\}\}', Comment.Special, '#pop'),
- # blockClose}}, includes optional tilde ~
- (r'(~?)(\}\})', bygroups(Number, Comment.Preproc), '#pop'),
-
- # {{opt=something}}
- (r'([^\s}]+)(=)', bygroups(Name.Attribute, Operator)),
-
- # Partials {{> ...}}
- (r'(>)(\s*)(@partial-block)', bygroups(Keyword, Text, Keyword)),
- (r'(#?>)(\s*)([\w-]+)', bygroups(Keyword, Text, Name.Variable)),
- (r'(>)(\s*)(\()', bygroups(Keyword, Text, Punctuation),
- 'dynamic-partial'),
-
- include('generic'),
- ],
- 'dynamic-partial': [
- (r'\s+', Text),
- (r'\)', Punctuation, '#pop'),
-
- (r'(lookup)(\s+)(\.|this)(\s+)', bygroups(Keyword, Text,
- Name.Variable, Text)),
- (r'(lookup)(\s+)(\S+)', bygroups(Keyword, Text,
- using(this, state='variable'))),
- (r'[\w-]+', Name.Function),
-
- include('generic'),
- ],
- 'variable': [
- (r'[()/@a-zA-Z][\w-]*', Name.Variable),
- (r'\.[\w-]+', Name.Variable),
- (r'(this\/|\.\/|(\.\.\/)+)[\w-]+', Name.Variable),
- ],
- 'generic': [
- include('variable'),
-
- # borrowed from DjangoLexer
- (r':?"(\\\\|\\"|[^"])*"', String.Double),
- (r":?'(\\\\|\\'|[^'])*'", String.Single),
- (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
- r"0[xX][0-9a-fA-F]+[Ll]?", Number),
- ]
- }
-
-
-class HandlebarsHtmlLexer(DelegatingLexer):
- """
- Subclass of the `HandlebarsLexer` that highlights unlexed data with the
- `HtmlLexer`.
-
- .. versionadded:: 2.0
- """
-
- name = "HTML+Handlebars"
- aliases = ["html+handlebars"]
- filenames = ['*.handlebars', '*.hbs']
- mimetypes = ['text/html+handlebars', 'text/x-handlebars-template']
-
- def __init__(self, **options):
- super(HandlebarsHtmlLexer, self).__init__(HtmlLexer, HandlebarsLexer, **options)
-
-
-class YamlJinjaLexer(DelegatingLexer):
- """
- Subclass of the `DjangoLexer` that highlights unlexed data with the
- `YamlLexer`.
-
- Commonly used in Saltstack salt states.
-
- .. versionadded:: 2.0
- """
-
- name = 'YAML+Jinja'
- aliases = ['yaml+jinja', 'salt', 'sls']
- filenames = ['*.sls']
- mimetypes = ['text/x-yaml+jinja', 'text/x-sls']
-
- def __init__(self, **options):
- super(YamlJinjaLexer, self).__init__(YamlLexer, DjangoLexer, **options)
-
-
-class LiquidLexer(RegexLexer):
- """
- Lexer for `Liquid templates
- <http://www.rubydoc.info/github/Shopify/liquid>`_.
-
- .. versionadded:: 2.0
- """
- name = 'liquid'
- aliases = ['liquid']
- filenames = ['*.liquid']
-
- tokens = {
- 'root': [
- (r'[^{]+', Text),
- # tags and block tags
- (r'(\{%)(\s*)', bygroups(Punctuation, Whitespace), 'tag-or-block'),
- # output tags
- (r'(\{\{)(\s*)([^\s}]+)',
- bygroups(Punctuation, Whitespace, using(this, state = 'generic')),
- 'output'),
- (r'\{', Text)
- ],
-
- 'tag-or-block': [
- # builtin logic blocks
- (r'(if|unless|elsif|case)(?=\s+)', Keyword.Reserved, 'condition'),
- (r'(when)(\s+)', bygroups(Keyword.Reserved, Whitespace),
- combined('end-of-block', 'whitespace', 'generic')),
- (r'(else)(\s*)(%\})',
- bygroups(Keyword.Reserved, Whitespace, Punctuation), '#pop'),
-
- # other builtin blocks
- (r'(capture)(\s+)([^\s%]+)(\s*)(%\})',
- bygroups(Name.Tag, Whitespace, using(this, state = 'variable'),
- Whitespace, Punctuation), '#pop'),
- (r'(comment)(\s*)(%\})',
- bygroups(Name.Tag, Whitespace, Punctuation), 'comment'),
- (r'(raw)(\s*)(%\})',
- bygroups(Name.Tag, Whitespace, Punctuation), 'raw'),
-
- # end of block
- (r'(end(case|unless|if))(\s*)(%\})',
- bygroups(Keyword.Reserved, None, Whitespace, Punctuation), '#pop'),
- (r'(end([^\s%]+))(\s*)(%\})',
- bygroups(Name.Tag, None, Whitespace, Punctuation), '#pop'),
-
- # builtin tags (assign and include are handled together with usual tags)
- (r'(cycle)(\s+)(?:([^\s:]*)(:))?(\s*)',
- bygroups(Name.Tag, Whitespace,
- using(this, state='generic'), Punctuation, Whitespace),
- 'variable-tag-markup'),
-
- # other tags or blocks
- (r'([^\s%]+)(\s*)', bygroups(Name.Tag, Whitespace), 'tag-markup')
- ],
-
- 'output': [
- include('whitespace'),
- (r'\}\}', Punctuation, '#pop'), # end of output
-
- (r'\|', Punctuation, 'filters')
- ],
-
- 'filters': [
- include('whitespace'),
- (r'\}\}', Punctuation, ('#pop', '#pop')), # end of filters and output
-
- (r'([^\s|:]+)(:?)(\s*)',
- bygroups(Name.Function, Punctuation, Whitespace), 'filter-markup')
- ],
-
- 'filter-markup': [
- (r'\|', Punctuation, '#pop'),
- include('end-of-tag'),
- include('default-param-markup')
- ],
-
- 'condition': [
- include('end-of-block'),
- include('whitespace'),
-
- (r'([^\s=!><]+)(\s*)([=!><]=?)(\s*)(\S+)(\s*)(%\})',
- bygroups(using(this, state = 'generic'), Whitespace, Operator,
- Whitespace, using(this, state = 'generic'), Whitespace,
- Punctuation)),
- (r'\b!', Operator),
- (r'\bnot\b', Operator.Word),
- (r'([\w.\'"]+)(\s+)(contains)(\s+)([\w.\'"]+)',
- bygroups(using(this, state = 'generic'), Whitespace, Operator.Word,
- Whitespace, using(this, state = 'generic'))),
-
- include('generic'),
- include('whitespace')
- ],
-
- 'generic-value': [
- include('generic'),
- include('end-at-whitespace')
- ],
-
- 'operator': [
- (r'(\s*)((=|!|>|<)=?)(\s*)',
- bygroups(Whitespace, Operator, None, Whitespace), '#pop'),
- (r'(\s*)(\bcontains\b)(\s*)',
- bygroups(Whitespace, Operator.Word, Whitespace), '#pop'),
- ],
-
- 'end-of-tag': [
- (r'\}\}', Punctuation, '#pop')
- ],
-
- 'end-of-block': [
- (r'%\}', Punctuation, ('#pop', '#pop'))
- ],
-
- 'end-at-whitespace': [
- (r'\s+', Whitespace, '#pop')
- ],
-
- # states for unknown markup
- 'param-markup': [
- include('whitespace'),
- # params with colons or equals
- (r'([^\s=:]+)(\s*)(=|:)',
- bygroups(Name.Attribute, Whitespace, Operator)),
- # explicit variables
- (r'(\{\{)(\s*)([^\s}])(\s*)(\}\})',
- bygroups(Punctuation, Whitespace, using(this, state = 'variable'),
- Whitespace, Punctuation)),
-
- include('string'),
- include('number'),
- include('keyword'),
- (r',', Punctuation)
- ],
-
- 'default-param-markup': [
- include('param-markup'),
- (r'.', Text) # fallback for switches / variables / un-quoted strings / ...
- ],
-
- 'variable-param-markup': [
- include('param-markup'),
- include('variable'),
- (r'.', Text) # fallback
- ],
-
- 'tag-markup': [
- (r'%\}', Punctuation, ('#pop', '#pop')), # end of tag
- include('default-param-markup')
- ],
-
- 'variable-tag-markup': [
- (r'%\}', Punctuation, ('#pop', '#pop')), # end of tag
- include('variable-param-markup')
- ],
-
- # states for different values types
- 'keyword': [
- (r'\b(false|true)\b', Keyword.Constant)
- ],
-
- 'variable': [
- (r'[a-zA-Z_]\w*', Name.Variable),
- (r'(?<=\w)\.(?=\w)', Punctuation)
- ],
-
- 'string': [
- (r"'[^']*'", String.Single),
- (r'"[^"]*"', String.Double)
- ],
-
- 'number': [
- (r'\d+\.\d+', Number.Float),
- (r'\d+', Number.Integer)
- ],
-
- 'generic': [ # decides for variable, string, keyword or number
- include('keyword'),
- include('string'),
- include('number'),
- include('variable')
- ],
-
- 'whitespace': [
- (r'[ \t]+', Whitespace)
- ],
-
- # states for builtin blocks
- 'comment': [
- (r'(\{%)(\s*)(endcomment)(\s*)(%\})',
- bygroups(Punctuation, Whitespace, Name.Tag, Whitespace,
- Punctuation), ('#pop', '#pop')),
- (r'.', Comment)
- ],
-
- 'raw': [
- (r'[^{]+', Text),
- (r'(\{%)(\s*)(endraw)(\s*)(%\})',
- bygroups(Punctuation, Whitespace, Name.Tag, Whitespace,
- Punctuation), '#pop'),
- (r'\{', Text)
- ],
- }
-
-
-class TwigLexer(RegexLexer):
- """
- `Twig <http://twig.sensiolabs.org/>`_ template lexer.
-
- It just highlights Twig code between the preprocessor directives,
- other data is left untouched by the lexer.
-
- .. versionadded:: 2.0
- """
-
- name = 'Twig'
- aliases = ['twig']
- mimetypes = ['application/x-twig']
-
- flags = re.M | re.S
-
- # Note that a backslash is included in the following two patterns
- # PHP uses a backslash as a namespace separator
- _ident_char = r'[\\\w-]|[^\x00-\x7f]'
- _ident_begin = r'(?:[\\_a-z]|[^\x00-\x7f])'
- _ident_end = r'(?:' + _ident_char + ')*'
- _ident_inner = _ident_begin + _ident_end
-
- tokens = {
- 'root': [
- (r'[^{]+', Other),
- (r'\{\{', Comment.Preproc, 'var'),
- # twig comments
- (r'\{\#.*?\#\}', Comment),
- # raw twig blocks
- (r'(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)'
- r'(\{%)(-?\s*)(endraw)(\s*-?)(%\})',
- bygroups(Comment.Preproc, Text, Keyword, Text, Comment.Preproc,
- Other, Comment.Preproc, Text, Keyword, Text,
- Comment.Preproc)),
- (r'(\{%)(-?\s*)(verbatim)(\s*-?)(%\})(.*?)'
- r'(\{%)(-?\s*)(endverbatim)(\s*-?)(%\})',
- bygroups(Comment.Preproc, Text, Keyword, Text, Comment.Preproc,
- Other, Comment.Preproc, Text, Keyword, Text,
- Comment.Preproc)),
- # filter blocks
- (r'(\{%%)(-?\s*)(filter)(\s+)(%s)' % _ident_inner,
- bygroups(Comment.Preproc, Text, Keyword, Text, Name.Function),
- 'tag'),
- (r'(\{%)(-?\s*)([a-zA-Z_]\w*)',
- bygroups(Comment.Preproc, Text, Keyword), 'tag'),
- (r'\{', Other),
- ],
- 'varnames': [
- (r'(\|)(\s*)(%s)' % _ident_inner,
- bygroups(Operator, Text, Name.Function)),
- (r'(is)(\s+)(not)?(\s*)(%s)' % _ident_inner,
- bygroups(Keyword, Text, Keyword, Text, Name.Function)),
- (r'(?i)(true|false|none|null)\b', Keyword.Pseudo),
- (r'(in|not|and|b-and|or|b-or|b-xor|is'
- r'if|elseif|else|import'
- r'constant|defined|divisibleby|empty|even|iterable|odd|sameas'
- r'matches|starts\s+with|ends\s+with)\b',
- Keyword),
- (r'(loop|block|parent)\b', Name.Builtin),
- (_ident_inner, Name.Variable),
- (r'\.' + _ident_inner, Name.Variable),
- (r'\.[0-9]+', Number),
- (r':?"(\\\\|\\"|[^"])*"', String.Double),
- (r":?'(\\\\|\\'|[^'])*'", String.Single),
- (r'([{}()\[\]+\-*/,:~%]|\.\.|\?|:|\*\*|\/\/|!=|[><=]=?)', Operator),
- (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
- r"0[xX][0-9a-fA-F]+[Ll]?", Number),
- ],
- 'var': [
- (r'\s+', Text),
- (r'(-?)(\}\})', bygroups(Text, Comment.Preproc), '#pop'),
- include('varnames')
- ],
- 'tag': [
- (r'\s+', Text),
- (r'(-?)(%\})', bygroups(Text, Comment.Preproc), '#pop'),
- include('varnames'),
- (r'.', Punctuation),
- ],
- }
-
-
-class TwigHtmlLexer(DelegatingLexer):
- """
- Subclass of the `TwigLexer` that highlights unlexed data with the
- `HtmlLexer`.
-
- .. versionadded:: 2.0
- """
-
- name = "HTML+Twig"
- aliases = ["html+twig"]
- filenames = ['*.twig']
- mimetypes = ['text/html+twig']
-
- def __init__(self, **options):
- super(TwigHtmlLexer, self).__init__(HtmlLexer, TwigLexer, **options)
-
-
-class Angular2Lexer(RegexLexer):
- """
- Generic
- `angular2 <http://victorsavkin.com/post/119943127151/angular-2-template-syntax>`_
- template lexer.
-
- Highlights only the Angular template tags (stuff between `{{` and `}}` and
- special attributes: '(event)=', '[property]=', '[(twoWayBinding)]=').
- Everything else is left for a delegating lexer.
-
- .. versionadded:: 2.1
- """
-
- name = "Angular2"
- aliases = ['ng2']
-
- tokens = {
- 'root': [
- (r'[^{([*#]+', Other),
-
- # {{meal.name}}
- (r'(\{\{)(\s*)', bygroups(Comment.Preproc, Text), 'ngExpression'),
-
- # (click)="deleteOrder()"; [value]="test"; [(twoWayTest)]="foo.bar"
- (r'([([]+)([\w:.-]+)([\])]+)(\s*)(=)(\s*)',
- bygroups(Punctuation, Name.Attribute, Punctuation, Text, Operator, Text),
- 'attr'),
- (r'([([]+)([\w:.-]+)([\])]+)(\s*)',
- bygroups(Punctuation, Name.Attribute, Punctuation, Text)),
-
- # *ngIf="..."; #f="ngForm"
- (r'([*#])([\w:.-]+)(\s*)(=)(\s*)',
- bygroups(Punctuation, Name.Attribute, Punctuation, Operator), 'attr'),
- (r'([*#])([\w:.-]+)(\s*)',
- bygroups(Punctuation, Name.Attribute, Punctuation)),
- ],
-
- 'ngExpression': [
- (r'\s+(\|\s+)?', Text),
- (r'\}\}', Comment.Preproc, '#pop'),
-
- # Literals
- (r':?(true|false)', String.Boolean),
- (r':?"(\\\\|\\"|[^"])*"', String.Double),
- (r":?'(\\\\|\\'|[^'])*'", String.Single),
- (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
- r"0[xX][0-9a-fA-F]+[Ll]?", Number),
-
- # Variabletext
- (r'[a-zA-Z][\w-]*(\(.*\))?', Name.Variable),
- (r'\.[\w-]+(\(.*\))?', Name.Variable),
-
- # inline If
- (r'(\?)(\s*)([^}\s]+)(\s*)(:)(\s*)([^}\s]+)(\s*)',
- bygroups(Operator, Text, String, Text, Operator, Text, String, Text)),
- ],
- 'attr': [
- ('".*?"', String, '#pop'),
- ("'.*?'", String, '#pop'),
- (r'[^\s>]+', String, '#pop'),
- ],
- }
-
-
-class Angular2HtmlLexer(DelegatingLexer):
- """
- Subclass of the `Angular2Lexer` that highlights unlexed data with the
- `HtmlLexer`.
-
- .. versionadded:: 2.0
- """
-
- name = "HTML + Angular2"
- aliases = ["html+ng2"]
- filenames = ['*.ng2']
-
- def __init__(self, **options):
- super(Angular2HtmlLexer, self).__init__(HtmlLexer, Angular2Lexer, **options)
diff --git a/pygments/lexers/teraterm.py b/pygments/lexers/teraterm.py
deleted file mode 100644
index 0fd1778a..00000000
--- a/pygments/lexers/teraterm.py
+++ /dev/null
@@ -1,158 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.teraterm
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for Tera Term macro files.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups
-from pygments.token import Text, Comment, Operator, Name, String, \
- Number, Keyword
-
-__all__ = ['TeraTermLexer']
-
-
-class TeraTermLexer(RegexLexer):
- """
- For `Tera Term <https://ttssh2.osdn.jp/>`_ macro source code.
-
- .. versionadded:: 2.4
- """
- name = 'Tera Term macro'
- aliases = ['ttl', 'teraterm', 'teratermmacro']
- filenames = ['*.ttl']
- mimetypes = ['text/x-teratermmacro']
-
- tokens = {
- 'root': [
- include('comments'),
- include('labels'),
- include('commands'),
- include('builtin-variables'),
- include('user-variables'),
- include('operators'),
- include('numeric-literals'),
- include('string-literals'),
- include('all-whitespace'),
- (r'[^\s]', Text),
- ],
- 'comments': [
- (r';[^\r\n]*', Comment.Single),
- (r'/\*', Comment.Multiline, 'in-comment'),
- ],
- 'in-comment': [
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[^*/]+', Comment.Multiline),
- (r'[*/]', Comment.Multiline)
- ],
- 'labels': [
- (r'(?i)^(\s*)(:[0-9a-z_]+)', bygroups(Text, Name.Label)),
- ],
- 'commands': [
- (
- r'(?i)\b('
- r'basename|beep|bplusrecv|bplussend|break|bringupbox|'
- r'callmenu|changedir|checksum16|checksum16file|'
- r'checksum32|checksum32file|checksum8|checksum8file|'
- r'clearscreen|clipb2var|closesbox|closett|code2str|'
- r'connect|continue|crc16|crc16file|crc32|crc32file|'
- r'cygconnect|delpassword|dirname|dirnamebox|disconnect|'
- r'dispstr|do|else|elseif|enablekeyb|end|endif|enduntil|'
- r'endwhile|exec|execcmnd|exit|expandenv|fileclose|'
- r'fileconcat|filecopy|filecreate|filedelete|filelock|'
- r'filemarkptr|filenamebox|fileopen|fileread|filereadln|'
- r'filerename|filesearch|fileseek|fileseekback|filestat|'
- r'filestrseek|filestrseek2|filetruncate|fileunlock|'
- r'filewrite|filewriteln|findclose|findfirst|findnext|'
- r'flushrecv|foldercreate|folderdelete|foldersearch|for|'
- r'getdate|getdir|getenv|getfileattr|gethostname|'
- r'getipv4addr|getipv6addr|getmodemstatus|getpassword|'
- r'getspecialfolder|gettime|gettitle|getttdir|getver|'
- r'if|ifdefined|include|inputbox|int2str|intdim|'
- r'ispassword|kmtfinish|kmtget|kmtrecv|kmtsend|listbox|'
- r'loadkeymap|logautoclosemode|logclose|loginfo|logopen|'
- r'logpause|logrotate|logstart|logwrite|loop|makepath|'
- r'messagebox|mpause|next|passwordbox|pause|quickvanrecv|'
- r'quickvansend|random|recvln|regexoption|restoresetup|'
- r'return|rotateleft|rotateright|scprecv|scpsend|send|'
- r'sendbreak|sendbroadcast|sendfile|sendkcode|sendln|'
- r'sendlnbroadcast|sendlnmulticast|sendmulticast|setbaud|'
- r'setdate|setdebug|setdir|setdlgpos|setdtr|setecho|'
- r'setenv|setexitcode|setfileattr|setflowctrl|'
- r'setmulticastname|setpassword|setrts|setsync|settime|'
- r'settitle|show|showtt|sprintf|sprintf2|statusbox|'
- r'str2code|str2int|strcompare|strconcat|strcopy|strdim|'
- r'strinsert|strjoin|strlen|strmatch|strremove|'
- r'strreplace|strscan|strspecial|strsplit|strtrim|'
- r'testlink|then|tolower|toupper|unlink|until|uptime|'
- r'var2clipb|wait|wait4all|waitevent|waitln|waitn|'
- r'waitrecv|waitregex|while|xmodemrecv|xmodemsend|'
- r'yesnobox|ymodemrecv|ymodemsend|zmodemrecv|zmodemsend'
- r')\b',
- Keyword,
- ),
- (
- r'(?i)(call|goto)([ \t]+)([0-9a-z_]+)',
- bygroups(Keyword, Text, Name.Label),
- )
- ],
- 'builtin-variables': [
- (
- r'(?i)('
- r'groupmatchstr1|groupmatchstr2|groupmatchstr3|'
- r'groupmatchstr4|groupmatchstr5|groupmatchstr6|'
- r'groupmatchstr7|groupmatchstr8|groupmatchstr9|'
- r'param1|param2|param3|param4|param5|param6|'
- r'param7|param8|param9|paramcnt|params|'
- r'inputstr|matchstr|mtimeout|result|timeout'
- r')\b',
- Name.Builtin
- ),
- ],
- 'user-variables': [
- (r'(?i)[A-Z_][A-Z0-9_]*', Name.Variable),
- ],
- 'numeric-literals': [
- (r'(-?)([0-9]+)', bygroups(Operator, Number.Integer)),
- (r'(?i)\$[0-9a-f]+', Number.Hex),
- ],
- 'string-literals': [
- (r'(?i)#(?:[0-9]+|\$[0-9a-f]+)', String.Char),
- (r"'", String.Single, 'in-single-string'),
- (r'"', String.Double, 'in-double-string'),
- ],
- 'in-general-string': [
- (r'[\\][\\nt]', String.Escape), # Only three escapes are supported.
- (r'.', String),
- ],
- 'in-single-string': [
- (r"'", String.Single, '#pop'),
- include('in-general-string'),
- ],
- 'in-double-string': [
- (r'"', String.Double, '#pop'),
- include('in-general-string'),
- ],
- 'operators': [
- (r'and|not|or|xor', Operator.Word),
- (r'[!%&*+<=>^~\|\/-]+', Operator),
- (r'[()]', String.Symbol),
- ],
- 'all-whitespace': [
- (r'[\s]+', Text),
- ],
- }
-
- # Turtle and Tera Term macro files share the same file extension
- # but each has a recognizable and distinct syntax.
- def analyse_text(text):
- result = 0.0
- if re.search(TeraTermLexer.tokens['commands'][0][0], text):
- result += 0.60
- return result
diff --git a/pygments/lexers/testing.py b/pygments/lexers/testing.py
deleted file mode 100644
index 9288b5b4..00000000
--- a/pygments/lexers/testing.py
+++ /dev/null
@@ -1,207 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.testing
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for testing languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, bygroups
-from pygments.token import Comment, Keyword, Name, String, Number, Generic, Text
-
-__all__ = ['GherkinLexer', 'TAPLexer']
-
-
-class GherkinLexer(RegexLexer):
- """
- For `Gherkin <http://github.com/aslakhellesoy/gherkin/>` syntax.
-
- .. versionadded:: 1.2
- """
- name = 'Gherkin'
- aliases = ['cucumber', 'gherkin']
- filenames = ['*.feature']
- mimetypes = ['text/x-gherkin']
-
- feature_keywords = u'^(기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Фича|Особина|Могућност|Özellik|Właściwość|Tính năng|Trajto|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd)(:)(.*)$'
- feature_element_keywords = u'^(\\s*)(시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|剧本大纲|剧本|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|سيناريو مخطط|سيناريو|الخلفية|תרחיש|תבנית תרחיש|רקע|Тарих|Сценарій|Сценарио|Сценарий структураси|Сценарий|Структура сценарію|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Пример|Предыстория|Предистория|Позадина|Передумова|Основа|Концепт|Контекст|Założenia|Wharrimean is|Tình huống|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenaro|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus šablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Konturo de la scenaro|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Fono|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l\'escenari|Escenario|Escenari|Dis is what went down|Dasar|Contexto|Contexte|Contesto|Condiţii|Conditii|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y\'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$'
- examples_keywords = u'^(\\s*)(예|例子|例|サンプル|امثلة|דוגמאות|Сценарији|Примери|Приклади|Мисоллар|Значения|Örnekler|Voorbeelden|Variantai|Tapaukset|Scenarios|Scenariji|Scenarijai|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Piemēri|Pavyzdžiai|Paraugs|Juhtumid|Exemplos|Exemples|Exemplele|Exempel|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Contoh|Cobber|Beispiele)(:)(.*)$'
- step_keywords = u'^(\\s*)(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假设|假如|假定|但是|但し|並且|并且|同時|同时|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо, що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y\'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y\'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kaj |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y\'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Anrhegedig a |Angenommen |And y\'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\\* )'
-
- tokens = {
- 'comments': [
- (r'^\s*#.*$', Comment),
- ],
- 'feature_elements': [
- (step_keywords, Keyword, "step_content_stack"),
- include('comments'),
- (r"(\s|.)", Name.Function),
- ],
- 'feature_elements_on_stack': [
- (step_keywords, Keyword, "#pop:2"),
- include('comments'),
- (r"(\s|.)", Name.Function),
- ],
- 'examples_table': [
- (r"\s+\|", Keyword, 'examples_table_header'),
- include('comments'),
- (r"(\s|.)", Name.Function),
- ],
- 'examples_table_header': [
- (r"\s+\|\s*$", Keyword, "#pop:2"),
- include('comments'),
- (r"\\\|", Name.Variable),
- (r"\s*\|", Keyword),
- (r"[^|]", Name.Variable),
- ],
- 'scenario_sections_on_stack': [
- (feature_element_keywords,
- bygroups(Name.Function, Keyword, Keyword, Name.Function),
- "feature_elements_on_stack"),
- ],
- 'narrative': [
- include('scenario_sections_on_stack'),
- include('comments'),
- (r"(\s|.)", Name.Function),
- ],
- 'table_vars': [
- (r'(<[^>]+>)', Name.Variable),
- ],
- 'numbers': [
- (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', String),
- ],
- 'string': [
- include('table_vars'),
- (r'(\s|.)', String),
- ],
- 'py_string': [
- (r'"""', Keyword, "#pop"),
- include('string'),
- ],
- 'step_content_root': [
- (r"$", Keyword, "#pop"),
- include('step_content'),
- ],
- 'step_content_stack': [
- (r"$", Keyword, "#pop:2"),
- include('step_content'),
- ],
- 'step_content': [
- (r'"', Name.Function, "double_string"),
- include('table_vars'),
- include('numbers'),
- include('comments'),
- (r'(\s|.)', Name.Function),
- ],
- 'table_content': [
- (r"\s+\|\s*$", Keyword, "#pop"),
- include('comments'),
- (r"\\\|", String),
- (r"\s*\|", Keyword),
- include('string'),
- ],
- 'double_string': [
- (r'"', Name.Function, "#pop"),
- include('string'),
- ],
- 'root': [
- (r'\n', Name.Function),
- include('comments'),
- (r'"""', Keyword, "py_string"),
- (r'\s+\|', Keyword, 'table_content'),
- (r'"', Name.Function, "double_string"),
- include('table_vars'),
- include('numbers'),
- (r'(\s*)(@[^@\r\n\t ]+)', bygroups(Name.Function, Name.Tag)),
- (step_keywords, bygroups(Name.Function, Keyword),
- 'step_content_root'),
- (feature_keywords, bygroups(Keyword, Keyword, Name.Function),
- 'narrative'),
- (feature_element_keywords,
- bygroups(Name.Function, Keyword, Keyword, Name.Function),
- 'feature_elements'),
- (examples_keywords,
- bygroups(Name.Function, Keyword, Keyword, Name.Function),
- 'examples_table'),
- (r'(\s|.)', Name.Function),
- ]
- }
-
-
-class TAPLexer(RegexLexer):
- """
- For Test Anything Protocol (TAP) output.
-
- .. versionadded:: 2.1
- """
- name = 'TAP'
- aliases = ['tap']
- filenames = ['*.tap']
-
- tokens = {
- 'root': [
- # A TAP version may be specified.
- (r'^TAP version \d+\n', Name.Namespace),
-
- # Specify a plan with a plan line.
- (r'^1\.\.\d+', Keyword.Declaration, 'plan'),
-
- # A test failure
- (r'^(not ok)([^\S\n]*)(\d*)',
- bygroups(Generic.Error, Text, Number.Integer), 'test'),
-
- # A test success
- (r'^(ok)([^\S\n]*)(\d*)',
- bygroups(Keyword.Reserved, Text, Number.Integer), 'test'),
-
- # Diagnostics start with a hash.
- (r'^#.*\n', Comment),
-
- # TAP's version of an abort statement.
- (r'^Bail out!.*\n', Generic.Error),
-
- # TAP ignores any unrecognized lines.
- (r'^.*\n', Text),
- ],
- 'plan': [
- # Consume whitespace (but not newline).
- (r'[^\S\n]+', Text),
-
- # A plan may have a directive with it.
- (r'#', Comment, 'directive'),
-
- # Or it could just end.
- (r'\n', Comment, '#pop'),
-
- # Anything else is wrong.
- (r'.*\n', Generic.Error, '#pop'),
- ],
- 'test': [
- # Consume whitespace (but not newline).
- (r'[^\S\n]+', Text),
-
- # A test may have a directive with it.
- (r'#', Comment, 'directive'),
-
- (r'\S+', Text),
-
- (r'\n', Text, '#pop'),
- ],
- 'directive': [
- # Consume whitespace (but not newline).
- (r'[^\S\n]+', Comment),
-
- # Extract todo items.
- (r'(?i)\bTODO\b', Comment.Preproc),
-
- # Extract skip items.
- (r'(?i)\bSKIP\S*', Comment.Preproc),
-
- (r'\S+', Comment),
-
- (r'\n', Comment, '#pop:2'),
- ],
- }
diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py
deleted file mode 100644
index 6b431f69..00000000
--- a/pygments/lexers/text.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.text
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for non-source code file types.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexers.configs import ApacheConfLexer, NginxConfLexer, \
- SquidConfLexer, LighttpdConfLexer, IniLexer, RegeditLexer, PropertiesLexer
-from pygments.lexers.console import PyPyLogLexer
-from pygments.lexers.textedit import VimLexer
-from pygments.lexers.markup import BBCodeLexer, MoinWikiLexer, RstLexer, \
- TexLexer, GroffLexer
-from pygments.lexers.installers import DebianControlLexer, SourcesListLexer
-from pygments.lexers.make import MakefileLexer, BaseMakefileLexer, CMakeLexer
-from pygments.lexers.haxe import HxmlLexer
-from pygments.lexers.sgf import SmartGameFormatLexer
-from pygments.lexers.diff import DiffLexer, DarcsPatchLexer
-from pygments.lexers.data import YamlLexer
-from pygments.lexers.textfmts import IrcLogsLexer, GettextLexer, HttpLexer
-
-__all__ = []
diff --git a/pygments/lexers/textedit.py b/pygments/lexers/textedit.py
deleted file mode 100644
index 66b36924..00000000
--- a/pygments/lexers/textedit.py
+++ /dev/null
@@ -1,169 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.textedit
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for languages related to text processing.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-from bisect import bisect
-
-from pygments.lexer import RegexLexer, include, default, bygroups, using, this
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-from pygments.lexers.python import PythonLexer
-
-__all__ = ['AwkLexer', 'VimLexer']
-
-
-class AwkLexer(RegexLexer):
- """
- For Awk scripts.
-
- .. versionadded:: 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')),
- default('#pop')
- ],
- 'badregex': [
- (r'\n', Text, '#pop')
- ],
- 'root': [
- (r'^(?=\s|/)', Text, 'slashstartsregex'),
- include('commentsandwhitespace'),
- (r'\+\+|--|\|\||&&|in\b|\$|!?~|'
- r'(\*\*|[-<>+*%\^/!=|])=?', Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
- (r'(break|continue|do|while|exit|for|if|else|'
- 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|BEGIN|CONVFMT|ENVIRON|END|ERRNO|FIELDWIDTHS|'
- r'FILENAME|FNR|FS|IGNORECASE|NF|NR|OFMT|OFS|ORFS|RLENGTH|RS|'
- r'RSTART|RT|SUBSEP)\b', Name.Builtin),
- (r'[$a-zA-Z_]\w*', 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 VimLexer(RegexLexer):
- """
- Lexer for VimL script files.
-
- .. versionadded:: 0.8
- """
- name = 'VimL'
- aliases = ['vim']
- filenames = ['*.vim', '.vimrc', '.exrc', '.gvimrc',
- '_vimrc', '_exrc', '_gvimrc', 'vimrc', 'gvimrc']
- mimetypes = ['text/x-vim']
- flags = re.MULTILINE
-
- _python = r'py(?:t(?:h(?:o(?:n)?)?)?)?'
-
- tokens = {
- 'root': [
- (r'^([ \t:]*)(' + _python + r')([ \t]*)(<<)([ \t]*)(.*)((?:\n|.)*)(\6)',
- bygroups(using(this), Keyword, Text, Operator, Text, Text,
- using(PythonLexer), Text)),
- (r'^([ \t:]*)(' + _python + r')([ \t])(.*)',
- bygroups(using(this), Keyword, Text, using(PythonLexer))),
-
- (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),
- (r'[()<>+=!|,~-]', Punctuation), # Inexact list. Looks decent.
- (r'\b(let|if|else|endif|elseif|fun|function|endfunction)\b',
- Keyword),
- (r'\b(NONE|bold|italic|underline|dark|light)\b', Name.Builtin),
- (r'\b\w+\b', Name.Other), # These are postprocessed below
- (r'.', Text),
- ],
- }
-
- def __init__(self, **options):
- from pygments.lexers._vim_builtins import command, option, auto
- self._cmd = command
- self._opt = option
- self._aut = auto
-
- RegexLexer.__init__(self, **options)
-
- def is_in(self, w, mapping):
- r"""
- It's kind of difficult to decide if something might be a keyword
- in VimL because it allows you to abbreviate them. In fact,
- 'ab[breviate]' is a good example. :ab, :abbre, or :abbreviate are
- valid ways to call it so rather than making really awful regexps
- like::
-
- \bab(?:b(?:r(?:e(?:v(?:i(?:a(?:t(?:e)?)?)?)?)?)?)?)?\b
-
- we match `\b\w+\b` and then call is_in() on those tokens. See
- `scripts/get_vimkw.py` for how the lists are extracted.
- """
- p = bisect(mapping, (w,))
- if p > 0:
- if mapping[p-1][0] == w[:len(mapping[p-1][0])] and \
- mapping[p-1][1][:len(w)] == w:
- return True
- if p < len(mapping):
- return mapping[p][0] == w[:len(mapping[p][0])] and \
- mapping[p][1][:len(w)] == w
- return False
-
- def get_tokens_unprocessed(self, text):
- # TODO: builtins are only subsequent tokens on lines
- # and 'keywords' only happen at the beginning except
- # for :au ones
- for index, token, value in \
- RegexLexer.get_tokens_unprocessed(self, text):
- if token is Name.Other:
- if self.is_in(value, self._cmd):
- yield index, Keyword, value
- elif self.is_in(value, self._opt) or \
- self.is_in(value, self._aut):
- yield index, Name.Builtin, value
- else:
- yield index, Text, value
- else:
- yield index, token, value
diff --git a/pygments/lexers/textfmts.py b/pygments/lexers/textfmts.py
deleted file mode 100644
index a3aed0c0..00000000
--- a/pygments/lexers/textfmts.py
+++ /dev/null
@@ -1,297 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.textfmts
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for various text formats.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, bygroups
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Generic, Literal
-from pygments.util import ClassNotFound
-
-__all__ = ['IrcLogsLexer', 'TodotxtLexer', 'HttpLexer', 'GettextLexer']
-
-
-class IrcLogsLexer(RegexLexer):
- """
- Lexer for IRC logs in *irssi*, *xchat* or *weechat* style.
- """
-
- name = 'IRC logs'
- aliases = ['irc']
- filenames = ['*.weechatlog']
- mimetypes = ['text/x-irclog']
-
- flags = re.VERBOSE | re.MULTILINE
- timestamp = r"""
- (
- # irssi / xchat and others
- (?: \[|\()? # Opening bracket or paren for the timestamp
- (?: # Timestamp
- (?: (?:\d{1,4} [-/])* # Date as - or /-separated groups of digits
- (?:\d{1,4})
- [T ])? # Date/time separator: T or space
- (?: \d?\d [:.])* # Time as :/.-separated groups of 1 or 2 digits
- (?: \d?\d)
- )
- (?: \]|\))?\s+ # Closing bracket or paren for the timestamp
- |
- # weechat
- \d{4}\s\w{3}\s\d{2}\s # Date
- \d{2}:\d{2}:\d{2}\s+ # Time + Whitespace
- |
- # xchat
- \w{3}\s\d{2}\s # Date
- \d{2}:\d{2}:\d{2}\s+ # Time + Whitespace
- )?
- """
- tokens = {
- 'root': [
- # log start/end
- (r'^\*\*\*\*(.*)\*\*\*\*$', Comment),
- # hack
- ("^" + timestamp + r'(\s*<[^>]*>\s*)$', bygroups(Comment.Preproc, Name.Tag)),
- # normal msgs
- ("^" + timestamp + r"""
- (\s*<.*?>\s*) # Nick """,
- bygroups(Comment.Preproc, Name.Tag), 'msg'),
- # /me msgs
- ("^" + timestamp + r"""
- (\s*[*]\s+) # Star
- (\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
- (.*?\n) # Rest of message """,
- bygroups(Comment.Preproc, Keyword, String, Comment)),
- (r"^.*?\n", Text),
- ],
- 'msg': [
- (r"\S+:(?!//)", Name.Attribute), # Prefix
- (r".*\n", Text, '#pop'),
- ],
- }
-
-
-class GettextLexer(RegexLexer):
- """
- Lexer for Gettext catalog files.
-
- .. versionadded:: 0.9
- """
- name = 'Gettext Catalog'
- aliases = ['pot', 'po']
- filenames = ['*.pot', '*.po']
- mimetypes = ['application/x-gettext', 'text/x-gettext', 'text/gettext']
-
- tokens = {
- 'root': [
- (r'^#,\s.*?$', Keyword.Type),
- (r'^#:\s.*?$', Keyword.Declaration),
- # (r'^#$', Comment),
- (r'^(#|#\.\s|#\|\s|#~\s|#\s).*$', Comment.Single),
- (r'^(")([A-Za-z-]+:)(.*")$',
- bygroups(String, Name.Property, String)),
- (r'^".*"$', String),
- (r'^(msgid|msgid_plural|msgstr|msgctxt)(\s+)(".*")$',
- bygroups(Name.Variable, Text, String)),
- (r'^(msgstr\[)(\d)(\])(\s+)(".*")$',
- bygroups(Name.Variable, Number.Integer, Name.Variable, Text, String)),
- ]
- }
-
-
-class HttpLexer(RegexLexer):
- """
- Lexer for HTTP sessions.
-
- .. versionadded:: 1.5
- """
-
- name = 'HTTP'
- aliases = ['http']
-
- flags = re.DOTALL
-
- def get_tokens_unprocessed(self, text, stack=('root',)):
- """Reset the content-type state."""
- self.content_type = None
- return RegexLexer.get_tokens_unprocessed(self, text, stack)
-
- 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 continuous_header_callback(self, match):
- yield match.start(1), Text, match.group(1)
- yield match.start(2), Literal, match.group(2)
- yield match.start(3), Text, match.group(3)
-
- 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
- possible_lexer_mimetypes = [content_type]
- if '+' in content_type:
- # application/calendar+xml can be treated as application/xml
- # if there's not a better match.
- general_type = re.sub(r'^(.*)/.*\+(.*)$', r'\1/\2',
- content_type)
- possible_lexer_mimetypes.append(general_type)
-
- for i in possible_lexer_mimetypes:
- try:
- lexer = get_lexer_for_mimetype(i)
- 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|PATCH)( +)([^ ]+)( +)'
- r'(HTTP)(/)(1\.[01])(\r?\n|\Z)',
- bygroups(Name.Function, Text, Name.Namespace, Text,
- Keyword.Reserved, Operator, Number, Text),
- 'headers'),
- (r'(HTTP)(/)(1\.[01])( +)(\d{3})( +)([^\r\n]+)(\r?\n|\Z)',
- bygroups(Keyword.Reserved, Operator, Number, Text, Number,
- Text, Name.Exception, Text),
- 'headers'),
- ],
- 'headers': [
- (r'([^\s:]+)( *)(:)( *)([^\r\n]+)(\r?\n|\Z)', header_callback),
- (r'([\t ]+)([^\r\n]+)(\r?\n|\Z)', continuous_header_callback),
- (r'\r?\n', Text, 'content')
- ],
- 'content': [
- (r'.+', content_callback)
- ]
- }
-
- def analyse_text(text):
- return text.startswith(('GET /', 'POST /', 'PUT /', 'DELETE /', 'HEAD /',
- 'OPTIONS /', 'TRACE /', 'PATCH /'))
-
-
-class TodotxtLexer(RegexLexer):
- """
- Lexer for `Todo.txt <http://todotxt.com/>`_ todo list format.
-
- .. versionadded:: 2.0
- """
-
- name = 'Todotxt'
- aliases = ['todotxt']
- # *.todotxt is not a standard extension for Todo.txt files; including it
- # makes testing easier, and also makes autodetecting file type easier.
- filenames = ['todo.txt', '*.todotxt']
- mimetypes = ['text/x-todo']
-
- # Aliases mapping standard token types of Todo.txt format concepts
- CompleteTaskText = Operator # Chosen to de-emphasize complete tasks
- IncompleteTaskText = Text # Incomplete tasks should look like plain text
-
- # Priority should have most emphasis to indicate importance of tasks
- Priority = Generic.Heading
- # Dates should have next most emphasis because time is important
- Date = Generic.Subheading
-
- # Project and context should have equal weight, and be in different colors
- Project = Generic.Error
- Context = String
-
- # If tag functionality is added, it should have the same weight as Project
- # and Context, and a different color. Generic.Traceback would work well.
-
- # Regex patterns for building up rules; dates, priorities, projects, and
- # contexts are all atomic
- # TODO: Make date regex more ISO 8601 compliant
- date_regex = r'\d{4,}-\d{2}-\d{2}'
- priority_regex = r'\([A-Z]\)'
- project_regex = r'\+\S+'
- context_regex = r'@\S+'
-
- # Compound regex expressions
- complete_one_date_regex = r'(x )(' + date_regex + r')'
- complete_two_date_regex = (complete_one_date_regex + r'( )(' +
- date_regex + r')')
- priority_date_regex = r'(' + priority_regex + r')( )(' + date_regex + r')'
-
- tokens = {
- # Should parse starting at beginning of line; each line is a task
- 'root': [
- # Complete task entry points: two total:
- # 1. Complete task with two dates
- (complete_two_date_regex, bygroups(CompleteTaskText, Date,
- CompleteTaskText, Date),
- 'complete'),
- # 2. Complete task with one date
- (complete_one_date_regex, bygroups(CompleteTaskText, Date),
- 'complete'),
-
- # Incomplete task entry points: six total:
- # 1. Priority plus date
- (priority_date_regex, bygroups(Priority, IncompleteTaskText, Date),
- 'incomplete'),
- # 2. Priority only
- (priority_regex, Priority, 'incomplete'),
- # 3. Leading date
- (date_regex, Date, 'incomplete'),
- # 4. Leading context
- (context_regex, Context, 'incomplete'),
- # 5. Leading project
- (project_regex, Project, 'incomplete'),
- # 6. Non-whitespace catch-all
- (r'\S+', IncompleteTaskText, 'incomplete'),
- ],
-
- # Parse a complete task
- 'complete': [
- # Newline indicates end of task, should return to root
- (r'\s*\n', CompleteTaskText, '#pop'),
- # Tokenize contexts and projects
- (context_regex, Context),
- (project_regex, Project),
- # Tokenize non-whitespace text
- (r'\S+', CompleteTaskText),
- # Tokenize whitespace not containing a newline
- (r'\s+', CompleteTaskText),
- ],
-
- # Parse an incomplete task
- 'incomplete': [
- # Newline indicates end of task, should return to root
- (r'\s*\n', IncompleteTaskText, '#pop'),
- # Tokenize contexts and projects
- (context_regex, Context),
- (project_regex, Project),
- # Tokenize non-whitespace text
- (r'\S+', IncompleteTaskText),
- # Tokenize whitespace not containing a newline
- (r'\s+', IncompleteTaskText),
- ],
- }
diff --git a/pygments/lexers/theorem.py b/pygments/lexers/theorem.py
deleted file mode 100644
index a26a173f..00000000
--- a/pygments/lexers/theorem.py
+++ /dev/null
@@ -1,456 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.theorem
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for theorem-proving languages.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, default, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic
-
-__all__ = ['CoqLexer', 'IsabelleLexer', 'LeanLexer']
-
-
-class CoqLexer(RegexLexer):
- """
- For the `Coq <http://coq.inria.fr/>`_ theorem prover.
-
- .. versionadded:: 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', 'Check', 'Global', 'Instance', 'Class', 'Existing',
- 'Universe', 'Polymorphic', 'Monomorphic', 'Context'
- )
- 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', 'tauto', 'setoid_rewrite',
- 'intuition', 'eauto', 'eapply', 'econstructor', 'etransitivity',
- 'constructor', 'erewrite', 'red', 'cbv', 'lazy', 'vm_compute',
- 'native_compute', 'subst',
- )
- keywords5 = (
- # Terminators
- 'by', 'done', 'exact', 'reflexivity', 'tauto', 'romega', 'omega',
- 'assumption', 'solve', 'contradiction', 'discriminate',
- 'congruence',
- )
- 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'\|', r'\|]', r'\}', '~', '=>',
- r'/\\', r'\\/', r'\{\|', r'\|\}',
- u'Π', u'λ',
- )
- operators = r'[!$%&*+\./:<=>?@^|~-]'
- prefix_syms = r'[!?~]'
- infix_syms = r'[=<>@^|&+\*/$%-]'
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'false|true|\(\)|\[\]', Name.Builtin.Pseudo),
- (r'\(\*', Comment, 'comment'),
- (words(keywords1, prefix=r'\b', suffix=r'\b'), Keyword.Namespace),
- (words(keywords2, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(keywords3, prefix=r'\b', suffix=r'\b'), Keyword.Type),
- (words(keywords4, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(keywords5, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo),
- (words(keywords6, prefix=r'\b', suffix=r'\b'), Keyword.Reserved),
- # (r'\b([A-Z][\w\']*)(\.)', Name.Namespace, 'dotted'),
- (r'\b([A-Z][\w\']*)', Name),
- (r'(%s)' % '|'.join(keyopts[::-1]), Operator),
- (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator),
-
- (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.Bin),
- (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),
- ],
- '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][\w\']*(?=\s*\.)', Name.Namespace),
- (r'[A-Z][\w\']*', Name.Class, '#pop'),
- (r'[a-z][a-z0-9_\']*', Name, '#pop'),
- default('#pop')
- ],
- }
-
- def analyse_text(text):
- if text.startswith('(*'):
- return True
-
-
-class IsabelleLexer(RegexLexer):
- """
- For the `Isabelle <http://isabelle.in.tum.de/>`_ proof assistant.
-
- .. versionadded:: 2.0
- """
-
- name = 'Isabelle'
- aliases = ['isabelle']
- filenames = ['*.thy']
- mimetypes = ['text/x-isabelle']
-
- keyword_minor = (
- 'and', 'assumes', 'attach', 'avoids', 'binder', 'checking',
- 'class_instance', 'class_relation', 'code_module', 'congs',
- 'constant', 'constrains', 'datatypes', 'defines', 'file', 'fixes',
- 'for', 'functions', 'hints', 'identifier', 'if', 'imports', 'in',
- 'includes', 'infix', 'infixl', 'infixr', 'is', 'keywords', 'lazy',
- 'module_name', 'monos', 'morphisms', 'no_discs_sels', 'notes',
- 'obtains', 'open', 'output', 'overloaded', 'parametric', 'permissive',
- 'pervasive', 'rep_compat', 'shows', 'structure', 'type_class',
- 'type_constructor', 'unchecked', 'unsafe', 'where',
- )
-
- keyword_diag = (
- 'ML_command', 'ML_val', 'class_deps', 'code_deps', 'code_thms',
- 'display_drafts', 'find_consts', 'find_theorems', 'find_unused_assms',
- 'full_prf', 'help', 'locale_deps', 'nitpick', 'pr', 'prf',
- 'print_abbrevs', 'print_antiquotations', 'print_attributes',
- 'print_binds', 'print_bnfs', 'print_bundles',
- 'print_case_translations', 'print_cases', 'print_claset',
- 'print_classes', 'print_codeproc', 'print_codesetup',
- 'print_coercions', 'print_commands', 'print_context',
- 'print_defn_rules', 'print_dependencies', 'print_facts',
- 'print_induct_rules', 'print_inductives', 'print_interps',
- 'print_locale', 'print_locales', 'print_methods', 'print_options',
- 'print_orders', 'print_quot_maps', 'print_quotconsts',
- 'print_quotients', 'print_quotientsQ3', 'print_quotmapsQ3',
- 'print_rules', 'print_simpset', 'print_state', 'print_statement',
- 'print_syntax', 'print_theorems', 'print_theory', 'print_trans_rules',
- 'prop', 'pwd', 'quickcheck', 'refute', 'sledgehammer', 'smt_status',
- 'solve_direct', 'spark_status', 'term', 'thm', 'thm_deps', 'thy_deps',
- 'try', 'try0', 'typ', 'unused_thms', 'value', 'values', 'welcome',
- 'print_ML_antiquotations', 'print_term_bindings', 'values_prolog',
- )
-
- keyword_thy = ('theory', 'begin', 'end')
-
- keyword_section = ('header', 'chapter')
-
- keyword_subsection = (
- 'section', 'subsection', 'subsubsection', 'sect', 'subsect',
- 'subsubsect',
- )
-
- keyword_theory_decl = (
- 'ML', 'ML_file', 'abbreviation', 'adhoc_overloading', 'arities',
- 'atom_decl', 'attribute_setup', 'axiomatization', 'bundle',
- 'case_of_simps', 'class', 'classes', 'classrel', 'codatatype',
- 'code_abort', 'code_class', 'code_const', 'code_datatype',
- 'code_identifier', 'code_include', 'code_instance', 'code_modulename',
- 'code_monad', 'code_printing', 'code_reflect', 'code_reserved',
- 'code_type', 'coinductive', 'coinductive_set', 'consts', 'context',
- 'datatype', 'datatype_new', 'datatype_new_compat', 'declaration',
- 'declare', 'default_sort', 'defer_recdef', 'definition', 'defs',
- 'domain', 'domain_isomorphism', 'domaindef', 'equivariance',
- 'export_code', 'extract', 'extract_type', 'fixrec', 'fun',
- 'fun_cases', 'hide_class', 'hide_const', 'hide_fact', 'hide_type',
- 'import_const_map', 'import_file', 'import_tptp', 'import_type_map',
- 'inductive', 'inductive_set', 'instantiation', 'judgment', 'lemmas',
- 'lifting_forget', 'lifting_update', 'local_setup', 'locale',
- 'method_setup', 'nitpick_params', 'no_adhoc_overloading',
- 'no_notation', 'no_syntax', 'no_translations', 'no_type_notation',
- 'nominal_datatype', 'nonterminal', 'notation', 'notepad', 'oracle',
- 'overloading', 'parse_ast_translation', 'parse_translation',
- 'partial_function', 'primcorec', 'primrec', 'primrec_new',
- 'print_ast_translation', 'print_translation', 'quickcheck_generator',
- 'quickcheck_params', 'realizability', 'realizers', 'recdef', 'record',
- 'refute_params', 'setup', 'setup_lifting', 'simproc_setup',
- 'simps_of_case', 'sledgehammer_params', 'spark_end', 'spark_open',
- 'spark_open_siv', 'spark_open_vcg', 'spark_proof_functions',
- 'spark_types', 'statespace', 'syntax', 'syntax_declaration', 'text',
- 'text_raw', 'theorems', 'translations', 'type_notation',
- 'type_synonym', 'typed_print_translation', 'typedecl', 'hoarestate',
- 'install_C_file', 'install_C_types', 'wpc_setup', 'c_defs', 'c_types',
- 'memsafe', 'SML_export', 'SML_file', 'SML_import', 'approximate',
- 'bnf_axiomatization', 'cartouche', 'datatype_compat',
- 'free_constructors', 'functor', 'nominal_function',
- 'nominal_termination', 'permanent_interpretation',
- 'binds', 'defining', 'smt2_status', 'term_cartouche',
- 'boogie_file', 'text_cartouche',
- )
-
- keyword_theory_script = ('inductive_cases', 'inductive_simps')
-
- keyword_theory_goal = (
- 'ax_specification', 'bnf', 'code_pred', 'corollary', 'cpodef',
- 'crunch', 'crunch_ignore',
- 'enriched_type', 'function', 'instance', 'interpretation', 'lemma',
- 'lift_definition', 'nominal_inductive', 'nominal_inductive2',
- 'nominal_primrec', 'pcpodef', 'primcorecursive',
- 'quotient_definition', 'quotient_type', 'recdef_tc', 'rep_datatype',
- 'schematic_corollary', 'schematic_lemma', 'schematic_theorem',
- 'spark_vc', 'specification', 'subclass', 'sublocale', 'termination',
- 'theorem', 'typedef', 'wrap_free_constructors',
- )
-
- keyword_qed = ('by', 'done', 'qed')
- keyword_abandon_proof = ('sorry', 'oops')
-
- keyword_proof_goal = ('have', 'hence', 'interpret')
-
- keyword_proof_block = ('next', 'proof')
-
- keyword_proof_chain = (
- 'finally', 'from', 'then', 'ultimately', 'with',
- )
-
- keyword_proof_decl = (
- 'ML_prf', 'also', 'include', 'including', 'let', 'moreover', 'note',
- 'txt', 'txt_raw', 'unfolding', 'using', 'write',
- )
-
- keyword_proof_asm = ('assume', 'case', 'def', 'fix', 'presume')
-
- keyword_proof_asm_goal = ('guess', 'obtain', 'show', 'thus')
-
- keyword_proof_script = (
- 'apply', 'apply_end', 'apply_trace', 'back', 'defer', 'prefer',
- )
-
- operators = (
- '::', ':', '(', ')', '[', ']', '_', '=', ',', '|',
- '+', '-', '!', '?',
- )
-
- proof_operators = ('{', '}', '.', '..')
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'\(\*', Comment, 'comment'),
- (r'\{\*', Comment, 'text'),
-
- (words(operators), Operator),
- (words(proof_operators), Operator.Word),
-
- (words(keyword_minor, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo),
-
- (words(keyword_diag, prefix=r'\b', suffix=r'\b'), Keyword.Type),
-
- (words(keyword_thy, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(keyword_theory_decl, prefix=r'\b', suffix=r'\b'), Keyword),
-
- (words(keyword_section, prefix=r'\b', suffix=r'\b'), Generic.Heading),
- (words(keyword_subsection, prefix=r'\b', suffix=r'\b'), Generic.Subheading),
-
- (words(keyword_theory_goal, prefix=r'\b', suffix=r'\b'), Keyword.Namespace),
- (words(keyword_theory_script, prefix=r'\b', suffix=r'\b'), Keyword.Namespace),
-
- (words(keyword_abandon_proof, prefix=r'\b', suffix=r'\b'), Generic.Error),
-
- (words(keyword_qed, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(keyword_proof_goal, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(keyword_proof_block, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(keyword_proof_decl, prefix=r'\b', suffix=r'\b'), Keyword),
-
- (words(keyword_proof_chain, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(keyword_proof_asm, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(keyword_proof_asm_goal, prefix=r'\b', suffix=r'\b'), Keyword),
-
- (words(keyword_proof_script, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo),
-
- (r'\\<\w*>', Text.Symbol),
-
- (r"[^\W\d][.\w']*", Name),
- (r"\?[^\W\d][.\w']*", Name),
- (r"'[^\W\d][.\w']*", Name.Type),
-
- (r'\d[\d_]*', Name), # display numbers as name
- (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.Bin),
-
- (r'"', String, 'string'),
- (r'`', String.Other, 'fact'),
- ],
- 'comment': [
- (r'[^(*)]+', Comment),
- (r'\(\*', Comment, '#push'),
- (r'\*\)', Comment, '#pop'),
- (r'[(*)]', Comment),
- ],
- 'text': [
- (r'[^*}]+', Comment),
- (r'\*\}', Comment, '#pop'),
- (r'\*', Comment),
- (r'\}', Comment),
- ],
- 'string': [
- (r'[^"\\]+', String),
- (r'\\<\w*>', String.Symbol),
- (r'\\"', String),
- (r'\\', String),
- (r'"', String, '#pop'),
- ],
- 'fact': [
- (r'[^`\\]+', String.Other),
- (r'\\<\w*>', String.Symbol),
- (r'\\`', String.Other),
- (r'\\', String.Other),
- (r'`', String.Other, '#pop'),
- ],
- }
-
-
-class LeanLexer(RegexLexer):
- """
- For the `Lean <https://github.com/leanprover/lean>`_
- theorem prover.
-
- .. versionadded:: 2.0
- """
- name = 'Lean'
- aliases = ['lean']
- filenames = ['*.lean']
- mimetypes = ['text/x-lean']
-
- flags = re.MULTILINE | re.UNICODE
-
- keywords1 = (
- 'import', 'abbreviation', 'opaque_hint', 'tactic_hint', 'definition',
- 'renaming', 'inline', 'hiding', 'exposing', 'parameter', 'parameters',
- 'conjecture', 'hypothesis', 'lemma', 'corollary', 'variable', 'variables',
- 'theorem', 'axiom', 'inductive', 'structure', 'universe', 'alias',
- 'help', 'options', 'precedence', 'postfix', 'prefix', 'calc_trans',
- 'calc_subst', 'calc_refl', 'infix', 'infixl', 'infixr', 'notation', 'eval',
- 'check', 'exit', 'coercion', 'end', 'private', 'using', 'namespace',
- 'including', 'instance', 'section', 'context', 'protected', 'expose',
- 'export', 'set_option', 'add_rewrite', 'extends', 'open', 'example',
- 'constant', 'constants', 'print', 'opaque', 'reducible', 'irreducible',
- )
-
- keywords2 = (
- 'forall', 'fun', 'Pi', 'obtain', 'from', 'have', 'show', 'assume',
- 'take', 'let', 'if', 'else', 'then', 'by', 'in', 'with', 'begin',
- 'proof', 'qed', 'calc', 'match',
- )
-
- keywords3 = (
- # Sorts
- 'Type', 'Prop',
- )
-
- operators = (
- u'!=', u'#', u'&', u'&&', u'*', u'+', u'-', u'/', u'@', u'!', u'`',
- u'-.', u'->', u'.', u'..', u'...', u'::', u':>', u';', u';;', u'<',
- u'<-', u'=', u'==', u'>', u'_', u'|', u'||', u'~', u'=>', u'<=', u'>=',
- u'/\\', u'\\/', u'∀', u'Π', u'λ', u'↔', u'∧', u'∨', u'≠', u'≤', u'≥',
- u'¬', u'⁻¹', u'⬝', u'▸', u'→', u'∃', u'ℕ', u'ℤ', u'≈', u'×', u'⌞',
- u'⌟', u'≡', u'⟨', u'⟩',
- )
-
- punctuation = (u'(', u')', u':', u'{', u'}', u'[', u']', u'⦃', u'⦄',
- u':=', u',')
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'/-', Comment, 'comment'),
- (r'--.*?$', Comment.Single),
- (words(keywords1, prefix=r'\b', suffix=r'\b'), Keyword.Namespace),
- (words(keywords2, prefix=r'\b', suffix=r'\b'), Keyword),
- (words(keywords3, prefix=r'\b', suffix=r'\b'), Keyword.Type),
- (words(operators), Name.Builtin.Pseudo),
- (words(punctuation), Operator),
- (u"[A-Za-z_\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2100-\u214f]"
- u"[A-Za-z_'\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2070-\u2079"
- u"\u207f-\u2089\u2090-\u209c\u2100-\u214f0-9]*", Name),
- (r'\d+', Number.Integer),
- (r'"', String.Double, 'string'),
- (r'[~?][a-z][\w\']*:', Name.Variable)
- ],
- 'comment': [
- # Multiline Comments
- (r'[^/-]', Comment.Multiline),
- (r'/-', Comment.Multiline, '#push'),
- (r'-/', Comment.Multiline, '#pop'),
- (r'[/-]', Comment.Multiline)
- ],
- 'string': [
- (r'[^\\"]+', String.Double),
- (r'\\[n"\\]', String.Escape),
- ('"', String.Double, '#pop'),
- ],
- }
diff --git a/pygments/lexers/trafficscript.py b/pygments/lexers/trafficscript.py
deleted file mode 100644
index 9b767253..00000000
--- a/pygments/lexers/trafficscript.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.trafficscript
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for RiverBed's TrafficScript (RTS) language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer
-from pygments.token import String, Number, Name, Keyword, Operator, Text, Comment
-
-__all__ = ['RtsLexer']
-
-
-class RtsLexer(RegexLexer):
- """
- For `Riverbed Stingray Traffic Manager <http://www.riverbed.com/stingray>`_
-
- .. versionadded:: 2.1
- """
- name = 'TrafficScript'
- aliases = ['rts','trafficscript']
- filenames = ['*.rts']
-
- tokens = {
- 'root' : [
- (r"'(\\\\|\\[^\\]|[^'\\])*'", String),
- (r'"', String, 'escapable-string'),
- (r'(0x[0-9a-fA-F]+|\d+)', Number),
- (r'\d+\.\d+', Number.Float),
- (r'\$[a-zA-Z](\w|_)*', Name.Variable),
- (r'(if|else|for(each)?|in|while|do|break|sub|return|import)', Keyword),
- (r'[a-zA-Z][\w.]*', Name.Function),
- (r'[-+*/%=,;(){}<>^.!~|&\[\]\?\:]', Operator),
- (r'(>=|<=|==|!=|'
- r'&&|\|\||'
- r'\+=|.=|-=|\*=|/=|%=|<<=|>>=|&=|\|=|\^=|'
- r'>>|<<|'
- r'\+\+|--|=>)', Operator),
- (r'[ \t\r]+', Text),
- (r'#[^\n]*', Comment),
- ],
- 'escapable-string' : [
- (r'\\[tsn]', String.Escape),
- (r'[^"]', String),
- (r'"', String, '#pop'),
- ],
-
- }
diff --git a/pygments/lexers/typoscript.py b/pygments/lexers/typoscript.py
deleted file mode 100644
index 745292bd..00000000
--- a/pygments/lexers/typoscript.py
+++ /dev/null
@@ -1,219 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.typoscript
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for TypoScript
-
- `TypoScriptLexer`
- A TypoScript lexer.
-
- `TypoScriptCssDataLexer`
- Lexer that highlights markers, constants and registers within css.
-
- `TypoScriptHtmlDataLexer`
- Lexer that highlights markers, constants and registers within html tags.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, using
-from pygments.token import Text, Comment, Name, String, Number, \
- Operator, Punctuation
-
-__all__ = ['TypoScriptLexer', 'TypoScriptCssDataLexer', 'TypoScriptHtmlDataLexer']
-
-
-class TypoScriptCssDataLexer(RegexLexer):
- """
- Lexer that highlights markers, constants and registers within css blocks.
-
- .. versionadded:: 2.2
- """
-
- name = 'TypoScriptCssData'
- aliases = ['typoscriptcssdata']
-
- tokens = {
- 'root': [
- # marker: ###MARK###
- (r'(.*)(###\w+###)(.*)', bygroups(String, Name.Constant, String)),
- # constant: {$some.constant}
- (r'(\{)(\$)((?:[\w\-]+\.)*)([\w\-]+)(\})',
- bygroups(String.Symbol, Operator, Name.Constant,
- Name.Constant, String.Symbol)), # constant
- # constant: {register:somevalue}
- (r'(.*)(\{)([\w\-]+)(\s*:\s*)([\w\-]+)(\})(.*)',
- bygroups(String, String.Symbol, Name.Constant, Operator,
- Name.Constant, String.Symbol, String)), # constant
- # whitespace
- (r'\s+', Text),
- # comments
- (r'/\*(?:(?!\*/).)*\*/', Comment),
- (r'(?<!(#|\'|"))(?:#(?!(?:[a-fA-F0-9]{6}|[a-fA-F0-9]{3}))[^\n#]+|//[^\n]*)',
- Comment),
- # other
- (r'[<>,:=.*%+|]', String),
- (r'[\w"\-!/&;(){}]+', String),
- ]
- }
-
-
-class TypoScriptHtmlDataLexer(RegexLexer):
- """
- Lexer that highlights markers, constants and registers within html tags.
-
- .. versionadded:: 2.2
- """
-
- name = 'TypoScriptHtmlData'
- aliases = ['typoscripthtmldata']
-
- tokens = {
- 'root': [
- # INCLUDE_TYPOSCRIPT
- (r'(INCLUDE_TYPOSCRIPT)', Name.Class),
- # Language label or extension resource FILE:... or LLL:... or EXT:...
- (r'(EXT|FILE|LLL):[^}\n"]*', String),
- # marker: ###MARK###
- (r'(.*)(###\w+###)(.*)', bygroups(String, Name.Constant, String)),
- # constant: {$some.constant}
- (r'(\{)(\$)((?:[\w\-]+\.)*)([\w\-]+)(\})',
- bygroups(String.Symbol, Operator, Name.Constant,
- Name.Constant, String.Symbol)), # constant
- # constant: {register:somevalue}
- (r'(.*)(\{)([\w\-]+)(\s*:\s*)([\w\-]+)(\})(.*)',
- bygroups(String, String.Symbol, Name.Constant, Operator,
- Name.Constant, String.Symbol, String)), # constant
- # whitespace
- (r'\s+', Text),
- # other
- (r'[<>,:=.*%+|]', String),
- (r'[\w"\-!/&;(){}#]+', String),
- ]
- }
-
-
-class TypoScriptLexer(RegexLexer):
- """
- Lexer for TypoScript code.
-
- http://docs.typo3.org/typo3cms/TyposcriptReference/
-
- .. versionadded:: 2.2
- """
-
- name = 'TypoScript'
- aliases = ['typoscript']
- filenames = ['*.typoscript']
- mimetypes = ['text/x-typoscript']
-
- flags = re.DOTALL | re.MULTILINE
-
- tokens = {
- 'root': [
- include('comment'),
- include('constant'),
- include('html'),
- include('label'),
- include('whitespace'),
- include('keywords'),
- include('punctuation'),
- include('operator'),
- include('structure'),
- include('literal'),
- include('other'),
- ],
- 'keywords': [
- # Conditions
- (r'(?i)(\[)(browser|compatVersion|dayofmonth|dayofweek|dayofyear|'
- r'device|ELSE|END|GLOBAL|globalString|globalVar|hostname|hour|IP|'
- r'language|loginUser|loginuser|minute|month|page|PIDinRootline|'
- r'PIDupinRootline|system|treeLevel|useragent|userFunc|usergroup|'
- r'version)([^\]]*)(\])',
- bygroups(String.Symbol, Name.Constant, Text, String.Symbol)),
- # Functions
- (r'(?=[\w\-])(HTMLparser|HTMLparser_tags|addParams|cache|encapsLines|'
- r'filelink|if|imageLinkWrap|imgResource|makelinks|numRows|numberFormat|'
- r'parseFunc|replacement|round|select|split|stdWrap|strPad|tableStyle|'
- r'tags|textStyle|typolink)(?![\w\-])', Name.Function),
- # Toplevel objects and _*
- (r'(?:(=?\s*<?\s+|^\s*))(cObj|field|config|content|constants|FEData|'
- r'file|frameset|includeLibs|lib|page|plugin|register|resources|sitemap|'
- r'sitetitle|styles|temp|tt_[^:.\s]*|types|xmlnews|INCLUDE_TYPOSCRIPT|'
- r'_CSS_DEFAULT_STYLE|_DEFAULT_PI_VARS|_LOCAL_LANG)(?![\w\-])',
- bygroups(Operator, Name.Builtin)),
- # Content objects
- (r'(?=[\w\-])(CASE|CLEARGIF|COA|COA_INT|COBJ_ARRAY|COLUMNS|CONTENT|'
- r'CTABLE|EDITPANEL|FILE|FILES|FLUIDTEMPLATE|FORM|HMENU|HRULER|HTML|'
- r'IMAGE|IMGTEXT|IMG_RESOURCE|LOAD_REGISTER|MEDIA|MULTIMEDIA|OTABLE|'
- r'PAGE|QTOBJECT|RECORDS|RESTORE_REGISTER|SEARCHRESULT|SVG|SWFOBJECT|'
- r'TEMPLATE|TEXT|USER|USER_INT)(?![\w\-])', Name.Class),
- # Menu states
- (r'(?=[\w\-])(ACTIFSUBRO|ACTIFSUB|ACTRO|ACT|CURIFSUBRO|CURIFSUB|CURRO|'
- r'CUR|IFSUBRO|IFSUB|NO|SPC|USERDEF1RO|USERDEF1|USERDEF2RO|USERDEF2|'
- r'USRRO|USR)', Name.Class),
- # Menu objects
- (r'(?=[\w\-])(GMENU_FOLDOUT|GMENU_LAYERS|GMENU|IMGMENUITEM|IMGMENU|'
- r'JSMENUITEM|JSMENU|TMENUITEM|TMENU_LAYERS|TMENU)', Name.Class),
- # PHP objects
- (r'(?=[\w\-])(PHP_SCRIPT(_EXT|_INT)?)', Name.Class),
- (r'(?=[\w\-])(userFunc)(?![\w\-])', Name.Function),
- ],
- 'whitespace': [
- (r'\s+', Text),
- ],
- 'html': [
- (r'<\S[^\n>]*>', using(TypoScriptHtmlDataLexer)),
- (r'&[^;\n]*;', String),
- (r'(?s)(_CSS_DEFAULT_STYLE)(\s*)(\()(.*(?=\n\)))',
- bygroups(Name.Class, Text, String.Symbol, using(TypoScriptCssDataLexer))),
- ],
- 'literal': [
- (r'0x[0-9A-Fa-f]+t?', Number.Hex),
- # (r'[0-9]*\.[0-9]+([eE][0-9]+)?[fd]?\s*(?:[^=])', Number.Float),
- (r'[0-9]+', Number.Integer),
- (r'(###\w+###)', Name.Constant),
- ],
- 'label': [
- # Language label or extension resource FILE:... or LLL:... or EXT:...
- (r'(EXT|FILE|LLL):[^}\n"]*', String),
- # Path to a resource
- (r'(?![^\w\-])([\w\-]+(?:/[\w\-]+)+/?)(\S*\n)',
- bygroups(String, String)),
- ],
- 'punctuation': [
- (r'[,.]', Punctuation),
- ],
- 'operator': [
- (r'[<>,:=.*%+|]', Operator),
- ],
- 'structure': [
- # Brackets and braces
- (r'[{}()\[\]\\]', String.Symbol),
- ],
- 'constant': [
- # Constant: {$some.constant}
- (r'(\{)(\$)((?:[\w\-]+\.)*)([\w\-]+)(\})',
- bygroups(String.Symbol, Operator, Name.Constant,
- Name.Constant, String.Symbol)), # constant
- # Constant: {register:somevalue}
- (r'(\{)([\w\-]+)(\s*:\s*)([\w\-]+)(\})',
- bygroups(String.Symbol, Name.Constant, Operator,
- Name.Constant, String.Symbol)), # constant
- # Hex color: #ff0077
- (r'(#[a-fA-F0-9]{6}\b|#[a-fA-F0-9]{3}\b)', String.Char)
- ],
- 'comment': [
- (r'(?<!(#|\'|"))(?:#(?!(?:[a-fA-F0-9]{6}|[a-fA-F0-9]{3}))[^\n#]+|//[^\n]*)',
- Comment),
- (r'/\*(?:(?!\*/).)*\*/', Comment),
- (r'(\s*#\s*\n)', Comment),
- ],
- 'other': [
- (r'[\w"\-!/&;]+', Text),
- ],
- }
diff --git a/pygments/lexers/unicon.py b/pygments/lexers/unicon.py
deleted file mode 100644
index b67c6895..00000000
--- a/pygments/lexers/unicon.py
+++ /dev/null
@@ -1,390 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.unicon
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Icon and Unicon languages, including ucode VM.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, include, bygroups, words, using, this
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['IconLexer', 'UcodeLexer', 'UniconLexer']
-
-
-class UniconLexer(RegexLexer):
- """
- For Unicon source code.
-
- .. versionadded:: 2.4
- """
-
- name = 'Unicon'
- aliases = ['unicon']
- filenames = ['*.icn']
- mimetypes = ['text/unicon']
-
- flags = re.MULTILINE
-
- tokens = {
- 'root': [
- (r'[^\S\n]+', Text),
- (r'#.*?\n', Comment.Single),
- (r'[^\S\n]+', Text),
- (r'class|method|procedure', Keyword.Declaration, 'subprogram'),
- (r'(record)(\s+)(\w+)',
- bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'),
- (r'(#line|\$C|\$Cend|\$define|\$else|\$endif|\$error|\$ifdef|'
- r'\$ifndef|\$include|\$line|\$undef)\b', Keyword.PreProc),
- (r'(&null|&fail)\b', Keyword.Constant),
- (r'&allocated|&ascii|&clock|&collections|&column|&col|&control|'
- r'&cset|&current|&dateline|&date|&digits|&dump|'
- r'&errno|&errornumber|&errortext|&errorvalue|&error|&errout|'
- r'&eventcode|&eventvalue|&eventsource|&e|'
- r'&features|&file|&host|&input|&interval|&lcase|&letters|'
- r'&level|&line|&ldrag|&lpress|&lrelease|'
- r'&main|&mdrag|&meta|&mpress|&mrelease|&now|&output|'
- r'&phi|&pick|&pi|&pos|&progname|'
- r'&random|&rdrag|&regions|&resize|&row|&rpress|&rrelease|'
- r'&shift|&source|&storage|&subject|'
- r'&time|&trace|&ucase|&version|'
- r'&window|&x|&y', Keyword.Reserved),
- (r'(by|of|not|to)\b', Keyword.Reserved),
- (r'(global|local|static|abstract)\b', Keyword.Reserved),
- (r'package|link|import', Keyword.Declaration),
- (words((
- 'break', 'case', 'create', 'critical', 'default', 'end', 'all',
- 'do', 'else', 'every', 'fail', 'if', 'import', 'initial',
- 'initially', 'invocable', 'next',
- 'repeat', 'return', 'suspend',
- 'then', 'thread', 'until', 'while'), prefix=r'\b', suffix=r'\b'),
- Keyword.Reserved),
- (words((
- 'Abort', 'abs', 'acos', 'Active', 'Alert', 'any', 'Any', 'Arb',
- 'Arbno', 'args', 'array', 'asin', 'atan', 'atanh', 'Attrib',
- 'Bal', 'bal', 'Bg', 'Break', 'Breakx',
- 'callout', 'center', 'char', 'chdir', 'chmod', 'chown', 'chroot',
- 'classname', 'Clip', 'Clone', 'close', 'cofail', 'collect',
- 'Color', 'ColorValue', 'condvar', 'constructor', 'copy',
- 'CopyArea', 'cos', 'Couple', 'crypt', 'cset', 'ctime',
- 'dbcolumns', 'dbdriver', 'dbkeys', 'dblimits', 'dbproduct',
- 'dbtables', 'delay', 'delete', 'detab', 'display', 'DrawArc',
- 'DrawCircle', 'DrawCube', 'DrawCurve', 'DrawCylinder',
- 'DrawDisk', 'DrawImage', 'DrawLine', 'DrawPoint', 'DrawPolygon',
- 'DrawRectangle', 'DrawSegment', 'DrawSphere', 'DrawString',
- 'DrawTorus', 'dtor',
- 'entab', 'EraseArea', 'errorclear', 'Event', 'eventmask',
- 'EvGet', 'EvSend', 'exec', 'exit', 'exp', 'Eye',
- 'Fail', 'fcntl', 'fdup', 'Fence', 'fetch', 'Fg', 'fieldnames',
- 'filepair', 'FillArc', 'FillCircle', 'FillPolygon',
- 'FillRectangle', 'find', 'flock', 'flush', 'Font', 'fork',
- 'FreeColor', 'FreeSpace', 'function',
- 'get', 'getch', 'getche', 'getegid', 'getenv', 'geteuid',
- 'getgid', 'getgr', 'gethost', 'getpgrp', 'getpid', 'getppid',
- 'getpw', 'getrusage', 'getserv', 'GetSpace', 'gettimeofday',
- 'getuid', 'globalnames', 'GotoRC', 'GotoXY', 'gtime', 'hardlink',
- 'iand', 'icom', 'IdentityMatrix', 'image', 'InPort', 'insert',
- 'Int86', 'integer', 'ioctl', 'ior', 'ishift', 'istate', 'ixor',
- 'kbhit', 'key', 'keyword', 'kill',
- 'left', 'Len', 'list', 'load', 'loadfunc', 'localnames',
- 'lock', 'log', 'Lower', 'lstat',
- 'many', 'map', 'match', 'MatrixMode', 'max', 'member',
- 'membernames', 'methodnames', 'methods', 'min', 'mkdir', 'move',
- 'MultMatrix', 'mutex',
- 'name', 'NewColor', 'Normals', 'NotAny', 'numeric',
- 'open', 'opencl', 'oprec', 'ord', 'OutPort',
- 'PaletteChars', 'PaletteColor', 'PaletteKey', 'paramnames',
- 'parent', 'Pattern', 'Peek', 'Pending', 'pipe', 'Pixel',
- 'PlayAudio', 'Poke', 'pop', 'PopMatrix', 'Pos', 'pos',
- 'proc', 'pull', 'push', 'PushMatrix', 'PushRotate', 'PushScale',
- 'PushTranslate', 'put',
- 'QueryPointer',
- 'Raise', 'read', 'ReadImage', 'readlink', 'reads', 'ready',
- 'real', 'receive', 'Refresh', 'Rem', 'remove', 'rename',
- 'repl', 'reverse', 'right', 'rmdir', 'Rotate', 'Rpos',
- 'Rtab', 'rtod', 'runerr',
- 'save', 'Scale', 'seek', 'select', 'send', 'seq',
- 'serial', 'set', 'setenv', 'setgid', 'setgrent',
- 'sethostent', 'setpgrp', 'setpwent', 'setservent',
- 'setuid', 'signal', 'sin', 'sort', 'sortf', 'Span',
- 'spawn', 'sql', 'sqrt', 'stat', 'staticnames', 'stop',
- 'StopAudio', 'string', 'structure', 'Succeed', 'Swi',
- 'symlink', 'sys_errstr', 'system', 'syswrite',
- 'Tab', 'tab', 'table', 'tan',
- 'Texcoord', 'Texture', 'TextWidth', 'Translate',
- 'trap', 'trim', 'truncate', 'trylock', 'type',
- 'umask', 'Uncouple', 'unlock', 'upto', 'utime',
- 'variable', 'VAttrib',
- 'wait', 'WAttrib', 'WDefault', 'WFlush', 'where',
- 'WinAssociate', 'WinButton', 'WinColorDialog', 'WindowContents',
- 'WinEditRegion', 'WinFontDialog', 'WinMenuBar', 'WinOpenDialog',
- 'WinPlayMedia', 'WinSaveDialog', 'WinScrollBar', 'WinSelectDialog',
- 'write', 'WriteImage', 'writes', 'WSection',
- 'WSync'), prefix=r'\b', suffix=r'\b'),
- Name.Function),
- include('numbers'),
- (r'<@|<<@|>@|>>@|\.>|\->', Operator),
- (r'\*\*|\+\+|\-\-|\.|\=|\~\=|<\=|>\=|\=\=|\~\=\=|<<|<<\=|>>|>>\=', Operator),
- (r':\=|:\=:|\->|<\->|\+:\=|\|', Operator),
- (r'\=\=\=|\~\=\=\=', Operator),
- (r'"(?:[^\\"]|\\.)*"', String),
- (r"'(?:[^\\']|\\.)*'", String.Character),
- (r'[*<>+=/&!?@~\\-]', Operator),
- (r'\^', Operator),
- (r'(\w+)(\s*|[(,])', bygroups(Name, using(this))),
- (r"([\[\]])", Punctuation),
- (r"(<>|=>|[()|:;,.'`]|[{}]|[%]|[&?])", Punctuation),
- (r'\n+', Text),
- ],
- 'numbers': [
- (r'\b([+-]?([2-9]|[12][0-9]|3[0-6])[rR][0-9a-zA-Z]+)\b', Number.Hex),
- (r'[+-]?[0-9]*\.([0-9]*)([Ee][+-]?[0-9]*)?', Number.Float),
- (r'\b([+-]?[0-9]+[KMGTPkmgtp]?)\b', Number.Integer),
- ],
- 'subprogram': [
- (r'\(', Punctuation, ('#pop', 'formal_part')),
- (r';', Punctuation, '#pop'),
- (r'"[^"]+"|\w+', Name.Function),
- include('root'),
- ],
- 'type_def': [
- (r'\(', Punctuation, 'formal_part'),
- ],
- 'formal_part': [
- (r'\)', Punctuation, '#pop'),
- (r'\w+', Name.Variable),
- (r',', Punctuation),
- (r'(:string|:integer|:real)\b', Keyword.Reserved),
- include('root'),
- ],
- }
-
-
-class IconLexer(RegexLexer):
- """
- Lexer for Icon.
-
- .. versionadded:: 1.6
- """
- name = 'Icon'
- aliases = ['icon']
- filenames = ['*.icon', '*.ICON']
- mimetypes = []
- flags = re.MULTILINE
-
- tokens = {
- 'root': [
- (r'[^\S\n]+', Text),
- (r'#.*?\n', Comment.Single),
- (r'[^\S\n]+', Text),
- (r'class|method|procedure', Keyword.Declaration, 'subprogram'),
- (r'(record)(\s+)(\w+)',
- bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'),
- (r'(#line|\$C|\$Cend|\$define|\$else|\$endif|\$error|\$ifdef|'
- r'\$ifndef|\$include|\$line|\$undef)\b', Keyword.PreProc),
- (r'(&null|&fail)\b', Keyword.Constant),
- (r'&allocated|&ascii|&clock|&collections|&column|&col|&control|'
- r'&cset|&current|&dateline|&date|&digits|&dump|'
- r'&errno|&errornumber|&errortext|&errorvalue|&error|&errout|'
- r'&eventcode|&eventvalue|&eventsource|&e|'
- r'&features|&file|&host|&input|&interval|&lcase|&letters|'
- r'&level|&line|&ldrag|&lpress|&lrelease|'
- r'&main|&mdrag|&meta|&mpress|&mrelease|&now|&output|'
- r'&phi|&pick|&pi|&pos|&progname|'
- r'&random|&rdrag|&regions|&resize|&row|&rpress|&rrelease|'
- r'&shift|&source|&storage|&subject|'
- r'&time|&trace|&ucase|&version|'
- r'&window|&x|&y', Keyword.Reserved),
- (r'(by|of|not|to)\b', Keyword.Reserved),
- (r'(global|local|static)\b', Keyword.Reserved),
- (r'link', Keyword.Declaration),
- (words((
- 'break', 'case', 'create', 'default', 'end', 'all',
- 'do', 'else', 'every', 'fail', 'if', 'initial',
- 'invocable', 'next',
- 'repeat', 'return', 'suspend',
- 'then', 'until', 'while'), prefix=r'\b', suffix=r'\b'),
- Keyword.Reserved),
- (words((
- 'abs', 'acos', 'Active', 'Alert', 'any',
- 'args', 'array', 'asin', 'atan', 'atanh', 'Attrib',
- 'bal', 'Bg',
- 'callout', 'center', 'char', 'chdir', 'chmod', 'chown', 'chroot',
- 'Clip', 'Clone', 'close', 'cofail', 'collect',
- 'Color', 'ColorValue', 'condvar', 'copy',
- 'CopyArea', 'cos', 'Couple', 'crypt', 'cset', 'ctime',
- 'delay', 'delete', 'detab', 'display', 'DrawArc',
- 'DrawCircle', 'DrawCube', 'DrawCurve', 'DrawCylinder',
- 'DrawDisk', 'DrawImage', 'DrawLine', 'DrawPoint', 'DrawPolygon',
- 'DrawRectangle', 'DrawSegment', 'DrawSphere', 'DrawString',
- 'DrawTorus', 'dtor',
- 'entab', 'EraseArea', 'errorclear', 'Event', 'eventmask',
- 'EvGet', 'EvSend', 'exec', 'exit', 'exp', 'Eye',
- 'fcntl', 'fdup', 'fetch', 'Fg', 'fieldnames',
- 'FillArc', 'FillCircle', 'FillPolygon',
- 'FillRectangle', 'find', 'flock', 'flush', 'Font',
- 'FreeColor', 'FreeSpace', 'function',
- 'get', 'getch', 'getche', 'getenv',
- 'GetSpace', 'gettimeofday',
- 'getuid', 'globalnames', 'GotoRC', 'GotoXY', 'gtime', 'hardlink',
- 'iand', 'icom', 'IdentityMatrix', 'image', 'InPort', 'insert',
- 'Int86', 'integer', 'ioctl', 'ior', 'ishift', 'istate', 'ixor',
- 'kbhit', 'key', 'keyword', 'kill',
- 'left', 'Len', 'list', 'load', 'loadfunc', 'localnames',
- 'lock', 'log', 'Lower', 'lstat',
- 'many', 'map', 'match', 'MatrixMode', 'max', 'member',
- 'membernames', 'methodnames', 'methods', 'min', 'mkdir', 'move',
- 'MultMatrix', 'mutex',
- 'name', 'NewColor', 'Normals', 'numeric',
- 'open', 'opencl', 'oprec', 'ord', 'OutPort',
- 'PaletteChars', 'PaletteColor', 'PaletteKey', 'paramnames',
- 'parent', 'Pattern', 'Peek', 'Pending', 'pipe', 'Pixel',
- 'Poke', 'pop', 'PopMatrix', 'Pos', 'pos',
- 'proc', 'pull', 'push', 'PushMatrix', 'PushRotate', 'PushScale',
- 'PushTranslate', 'put',
- 'QueryPointer',
- 'Raise', 'read', 'ReadImage', 'readlink', 'reads', 'ready',
- 'real', 'receive', 'Refresh', 'Rem', 'remove', 'rename',
- 'repl', 'reverse', 'right', 'rmdir', 'Rotate', 'Rpos',
- 'rtod', 'runerr',
- 'save', 'Scale', 'seek', 'select', 'send', 'seq',
- 'serial', 'set', 'setenv',
- 'setuid', 'signal', 'sin', 'sort', 'sortf',
- 'spawn', 'sql', 'sqrt', 'stat', 'staticnames', 'stop',
- 'string', 'structure', 'Swi',
- 'symlink', 'sys_errstr', 'system', 'syswrite',
- 'tab', 'table', 'tan',
- 'Texcoord', 'Texture', 'TextWidth', 'Translate',
- 'trap', 'trim', 'truncate', 'trylock', 'type',
- 'umask', 'Uncouple', 'unlock', 'upto', 'utime',
- 'variable',
- 'wait', 'WAttrib', 'WDefault', 'WFlush', 'where',
- 'WinAssociate', 'WinButton', 'WinColorDialog', 'WindowContents',
- 'WinEditRegion', 'WinFontDialog', 'WinMenuBar', 'WinOpenDialog',
- 'WinPlayMedia', 'WinSaveDialog', 'WinScrollBar', 'WinSelectDialog',
- 'write', 'WriteImage', 'writes', 'WSection',
- 'WSync'), prefix=r'\b', suffix=r'\b'),
- Name.Function),
- include('numbers'),
- (r'\*\*|\+\+|\-\-|\.|\=|\~\=|<\=|>\=|\=\=|\~\=\=|<<|<<\=|>>|>>\=', Operator),
- (r':\=|:\=:|<\-|<\->|\+:\=|\||\|\|', Operator),
- (r'\=\=\=|\~\=\=\=', Operator),
- (r'"(?:[^\\"]|\\.)*"', String),
- (r"'(?:[^\\']|\\.)*'", String.Character),
- (r'[*<>+=/&!?@~\\-]', Operator),
- (r'(\w+)(\s*|[(,])', bygroups(Name, using(this))),
- (r"([\[\]])", Punctuation),
- (r"(<>|=>|[()|:;,.'`]|[{}]|[%^]|[&?])", Punctuation),
- (r'\n+', Text),
- ],
- 'numbers': [
- (r'\b([+-]?([2-9]|[12][0-9]|3[0-6])[rR][0-9a-zA-Z]+)\b', Number.Hex),
- (r'[+-]?[0-9]*\.([0-9]*)([Ee][+-]?[0-9]*)?', Number.Float),
- (r'\b([+-]?[0-9]+[KMGTPkmgtp]?)\b', Number.Integer),
- ],
- 'subprogram': [
- (r'\(', Punctuation, ('#pop', 'formal_part')),
- (r';', Punctuation, '#pop'),
- (r'"[^"]+"|\w+', Name.Function),
- include('root'),
- ],
- 'type_def': [
- (r'\(', Punctuation, 'formal_part'),
- ],
- 'formal_part': [
- (r'\)', Punctuation, '#pop'),
- (r'\w+', Name.Variable),
- (r',', Punctuation),
- (r'(:string|:integer|:real)\b', Keyword.Reserved),
- include('root'),
- ],
- }
-
-
-class UcodeLexer(RegexLexer):
- """
- Lexer for Icon ucode files.
-
- .. versionadded:: 2.4
- """
- name = 'ucode'
- aliases = ['ucode']
- filenames = ['*.u', '*.u1', '*.u2']
- mimetypes = []
- flags = re.MULTILINE
-
- tokens = {
- 'root': [
- (r'(#.*\n)', Comment),
- (words((
- 'con', 'declend', 'end',
- 'global',
- 'impl', 'invocable',
- 'lab', 'link', 'local',
- 'record',
- 'uid', 'unions',
- 'version'),
- prefix=r'\b', suffix=r'\b'),
- Name.Function),
- (words((
- 'colm', 'filen', 'line', 'synt'),
- prefix=r'\b', suffix=r'\b'),
- Comment),
- (words((
- 'asgn',
- 'bang', 'bscan',
- 'cat', 'ccase', 'chfail',
- 'coact', 'cofail', 'compl',
- 'coret', 'create', 'cset',
- 'diff', 'div', 'dup',
- 'efail', 'einit', 'end', 'eqv', 'eret',
- 'error', 'escan', 'esusp',
- 'field',
- 'goto',
- 'init', 'int', 'inter',
- 'invoke',
- 'keywd',
- 'lconcat', 'lexeq', 'lexge',
- 'lexgt', 'lexle', 'lexlt', 'lexne',
- 'limit', 'llist', 'lsusp',
- 'mark', 'mark0', 'minus', 'mod', 'mult',
- 'neg', 'neqv', 'nonnull', 'noop', 'null',
- 'number', 'numeq', 'numge', 'numgt',
- 'numle', 'numlt', 'numne',
- 'pfail', 'plus', 'pnull', 'pop', 'power',
- 'pret', 'proc', 'psusp', 'push1', 'pushn1',
- 'random', 'rasgn', 'rcv', 'rcvbk', 'real',
- 'refresh', 'rswap',
- 'sdup', 'sect', 'size', 'snd', 'sndbk',
- 'str', 'subsc', 'swap',
- 'tabmat', 'tally', 'toby', 'trace',
- 'unmark',
- 'value', 'var'), prefix=r'\b', suffix=r'\b'),
- Keyword.Declaration),
- (words((
- 'any',
- 'case',
- 'endcase', 'endevery', 'endif',
- 'endifelse', 'endrepeat', 'endsuspend',
- 'enduntil', 'endwhile', 'every',
- 'if', 'ifelse',
- 'repeat',
- 'suspend',
- 'until',
- 'while'),
- prefix=r'\b', suffix=r'\b'),
- Name.Constant),
- (r'\d+(\s*|\.$|$)', Number.Integer),
- (r'[+-]?\d*\.\d+(E[-+]?\d+)?', Number.Float),
- (r'[+-]?\d+\.\d*(E[-+]?\d+)?', Number.Float),
- (r"(<>|=>|[()|:;,.'`]|[{}]|[%^]|[&?])", Punctuation),
- (r'\s+\b', Text),
- (r'[\w-]+', Text),
- ],
- }
diff --git a/pygments/lexers/urbi.py b/pygments/lexers/urbi.py
deleted file mode 100644
index 72349cbd..00000000
--- a/pygments/lexers/urbi.py
+++ /dev/null
@@ -1,133 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.urbi
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for UrbiScript language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import ExtendedRegexLexer, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
-
-__all__ = ['UrbiscriptLexer']
-
-
-class UrbiscriptLexer(ExtendedRegexLexer):
- """
- For UrbiScript source code.
-
- .. versionadded:: 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),
- (words((
- 'assert', 'at', 'break', 'case', 'catch', 'closure', 'compl',
- 'continue', 'default', 'else', 'enum', 'every', 'external',
- 'finally', 'for', 'freezeif', 'if', 'new', 'onleave', 'return',
- 'stopif', 'switch', 'this', 'throw', 'timeout', 'try',
- 'waituntil', 'whenever', 'while'), suffix=r'\b'),
- Keyword),
- (words((
- 'asm', 'auto', 'bool', 'char', 'const_cast', 'delete', 'double',
- 'dynamic_cast', 'explicit', 'export', 'extern', 'float', 'friend',
- 'goto', 'inline', 'int', 'long', 'mutable', 'namespace', 'register',
- 'reinterpret_cast', 'short', 'signed', 'sizeof', 'static_cast',
- 'struct', 'template', 'typedef', 'typeid', 'typename', 'union',
- 'unsigned', 'using', 'virtual', 'volatile', 'wchar_t'), suffix=r'\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),
- (words((
- 'Barrier', 'Binary', 'Boolean', 'CallMessage', 'Channel', 'Code',
- 'Comparable', 'Container', 'Control', 'Date', 'Dictionary', 'Directory',
- 'Duration', 'Enumeration', 'Event', 'Exception', 'Executable', 'File',
- 'Finalizable', 'Float', 'FormatInfo', 'Formatter', 'Global', 'Group',
- 'Hash', 'InputStream', 'IoService', 'Job', 'Kernel', 'Lazy', 'List',
- 'Loadable', 'Lobby', 'Location', 'Logger', 'Math', 'Mutex', 'nil',
- 'Object', 'Orderable', 'OutputStream', 'Pair', 'Path', 'Pattern',
- 'Position', 'Primitive', 'Process', 'Profile', 'PseudoLazy', 'PubSub',
- 'RangeIterable', 'Regexp', 'Semaphore', 'Server', 'Singleton', 'Socket',
- 'StackFrame', 'Stream', 'String', 'System', 'Tag', 'Timeout',
- 'Traceable', 'TrajectoryGenerator', 'Triplet', 'Tuple', 'UObject',
- 'UValue', 'UVar'), suffix=r'\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_]\w*', 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),
- ]
- }
diff --git a/pygments/lexers/varnish.py b/pygments/lexers/varnish.py
deleted file mode 100644
index 4db74e3c..00000000
--- a/pygments/lexers/varnish.py
+++ /dev/null
@@ -1,190 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.varnish
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Varnish configuration
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, bygroups, using, this, \
- inherit, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Literal
-
-__all__ = ['VCLLexer', 'VCLSnippetLexer']
-
-
-class VCLLexer(RegexLexer):
- """
- For Varnish Configuration Language (VCL).
-
- .. versionadded:: 2.2
- """
- name = 'VCL'
- aliases = ['vcl']
- filenames = ['*.vcl']
- mimetypes = ['text/x-vclsrc']
-
- def analyse_text(text):
- # If the very first line is 'vcl 4.0;' it's pretty much guaranteed
- # that this is VCL
- if text.startswith('vcl 4.0;'):
- return 1.0
- # Skip over comments and blank lines
- # This is accurate enough that returning 0.9 is reasonable.
- # Almost no VCL files start without some comments.
- elif '\nvcl 4.0;' in text[:1000]:
- return 0.9
-
- tokens = {
- 'probe': [
- include('whitespace'),
- include('comments'),
- (r'(\.\w+)(\s*=\s*)([^;]*)(;)',
- bygroups(Name.Attribute, Operator, using(this), Punctuation)),
- (r'\}', Punctuation, '#pop'),
- ],
- 'acl': [
- include('whitespace'),
- include('comments'),
- (r'[!/]+', Operator),
- (r';', Punctuation),
- (r'\d+', Number),
- (r'\}', Punctuation, '#pop'),
- ],
- 'backend': [
- include('whitespace'),
- (r'(\.probe)(\s*=\s*)(\w+)(;)',
- bygroups(Name.Attribute, Operator, Name.Variable.Global, Punctuation)),
- (r'(\.probe)(\s*=\s*)(\{)',
- bygroups(Name.Attribute, Operator, Punctuation), 'probe'),
- (r'(\.\w+\b)(\s*=\s*)([^;]*)(\s*;)',
- bygroups(Name.Attribute, Operator, using(this), Punctuation)),
- (r'\{', Punctuation, '#push'),
- (r'\}', Punctuation, '#pop'),
- ],
- 'statements': [
- (r'(\d\.)?\d+[sdwhmy]', Literal.Date),
- (r'(\d\.)?\d+ms', Literal.Date),
- (r'(vcl_pass|vcl_hash|vcl_hit|vcl_init|vcl_backend_fetch|vcl_pipe|'
- r'vcl_backend_response|vcl_synth|vcl_deliver|vcl_backend_error|'
- r'vcl_fini|vcl_recv|vcl_purge|vcl_miss)\b', Name.Function),
- (r'(pipe|retry|hash|synth|deliver|purge|abandon|lookup|pass|fail|ok|'
- r'miss|fetch|restart)\b', Name.Constant),
- (r'(beresp|obj|resp|req|req_top|bereq)\.http\.[a-zA-Z_-]+\b', Name.Variable),
- (words((
- 'obj.status', 'req.hash_always_miss', 'beresp.backend', 'req.esi_level',
- 'req.can_gzip', 'beresp.ttl', 'obj.uncacheable', 'req.ttl', 'obj.hits',
- 'client.identity', 'req.hash_ignore_busy', 'obj.reason', 'req.xid',
- 'req_top.proto', 'beresp.age', 'obj.proto', 'obj.age', 'local.ip',
- 'beresp.uncacheable', 'req.method', 'beresp.backend.ip', 'now',
- 'obj.grace', 'req.restarts', 'beresp.keep', 'req.proto', 'resp.proto',
- 'bereq.xid', 'bereq.between_bytes_timeout', 'req.esi',
- 'bereq.first_byte_timeout', 'bereq.method', 'bereq.connect_timeout',
- 'beresp.do_gzip', 'resp.status', 'beresp.do_gunzip',
- 'beresp.storage_hint', 'resp.is_streaming', 'beresp.do_stream',
- 'req_top.method', 'bereq.backend', 'beresp.backend.name', 'beresp.status',
- 'req.url', 'obj.keep', 'obj.ttl', 'beresp.reason', 'bereq.retries',
- 'resp.reason', 'bereq.url', 'beresp.do_esi', 'beresp.proto', 'client.ip',
- 'bereq.proto', 'server.hostname', 'remote.ip', 'req.backend_hint',
- 'server.identity', 'req_top.url', 'beresp.grace', 'beresp.was_304',
- 'server.ip', 'bereq.uncacheable'), suffix=r'\b'),
- Name.Variable),
- (r'[!%&+*\-,/<.}{>=|~]+', Operator),
- (r'[();]', Punctuation),
-
- (r'[,]+', Punctuation),
- (words(('hash_data', 'regsub', 'regsuball', 'if', 'else',
- 'elsif', 'elif', 'synth', 'synthetic', 'ban',
- 'return', 'set', 'unset', 'import', 'include', 'new',
- 'rollback', 'call'), suffix=r'\b'),
- Keyword),
- (r'storage\.\w+\.\w+\b', Name.Variable),
- (words(('true', 'false')), Name.Builtin),
- (r'\d+\b', Number),
- (r'(backend)(\s+\w+)(\s*\{)',
- bygroups(Keyword, Name.Variable.Global, Punctuation), 'backend'),
- (r'(probe\s)(\s*\w+\s)(\{)',
- bygroups(Keyword, Name.Variable.Global, Punctuation), 'probe'),
- (r'(acl\s)(\s*\w+\s)(\{)',
- bygroups(Keyword, Name.Variable.Global, Punctuation), 'acl'),
- (r'(vcl )(4.0)(;)$',
- bygroups(Keyword.Reserved, Name.Constant, Punctuation)),
- (r'(sub\s+)([a-zA-Z]\w*)(\s*\{)',
- bygroups(Keyword, Name.Function, Punctuation)),
- (r'([a-zA-Z_]\w*)'
- r'(\.)'
- r'([a-zA-Z_]\w*)'
- r'(\s*\(.*\))',
- bygroups(Name.Function, Punctuation, Name.Function, using(this))),
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'comment': [
- (r'[^*/]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline),
- ],
- 'comments': [
- (r'#.*$', Comment),
- (r'/\*', Comment.Multiline, 'comment'),
- (r'//.*$', Comment),
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r'[^"\n]+', String), # all other characters
- ],
- 'multistring': [
- (r'[^"}]', String),
- (r'"\}', String, '#pop'),
- (r'["}]', String),
- ],
- 'whitespace': [
- (r'L?"', String, 'string'),
- (r'\{"', String, 'multistring'),
- (r'\n', Text),
- (r'\s+', Text),
- (r'\\\n', Text), # line continuation
- ],
- 'root': [
- include('whitespace'),
- include('comments'),
- include('statements'),
- (r'\s+', Text),
- ],
- }
-
-
-class VCLSnippetLexer(VCLLexer):
- """
- For Varnish Configuration Language snippets.
-
- .. versionadded:: 2.2
- """
- name = 'VCLSnippets'
- aliases = ['vclsnippets', 'vclsnippet']
- mimetypes = ['text/x-vclsnippet']
- filenames = []
-
- def analyse_text(text):
- # override method inherited from VCLLexer
- return 0
-
- tokens = {
- 'snippetspre': [
- (r'\.\.\.+', Comment),
- (r'(bereq|req|req_top|resp|beresp|obj|client|server|local|remote|'
- r'storage)($|\.\*)', Name.Variable),
- ],
- 'snippetspost': [
- (r'(backend)\b', Keyword.Reserved),
- ],
- 'root': [
- include('snippetspre'),
- inherit,
- include('snippetspost'),
- ],
- }
diff --git a/pygments/lexers/verification.py b/pygments/lexers/verification.py
deleted file mode 100644
index f6530726..00000000
--- a/pygments/lexers/verification.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.verification
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexer for Intermediate Verification Languages (IVLs).
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, include, words
-from pygments.token import Comment, Operator, Keyword, Name, Number, \
- Punctuation, Whitespace
-
-__all__ = ['BoogieLexer', 'SilverLexer']
-
-
-class BoogieLexer(RegexLexer):
- """
- For `Boogie <https://boogie.codeplex.com/>`_ source code.
-
- .. versionadded:: 2.1
- """
- name = 'Boogie'
- aliases = ['boogie']
- filenames = ['*.bpl']
-
- tokens = {
- 'root': [
- # Whitespace and Comments
- (r'\n', Whitespace),
- (r'\s+', Whitespace),
- (r'//[/!](.*?)\n', Comment.Doc),
- (r'//(.*?)\n', Comment.Single),
- (r'/\*', Comment.Multiline, 'comment'),
-
- (words((
- 'axiom', 'break', 'call', 'ensures', 'else', 'exists', 'function',
- 'forall', 'if', 'invariant', 'modifies', 'procedure', 'requires',
- 'then', 'var', 'while'),
- suffix=r'\b'), Keyword),
- (words(('const',), suffix=r'\b'), Keyword.Reserved),
-
- (words(('bool', 'int', 'ref'), suffix=r'\b'), Keyword.Type),
- include('numbers'),
- (r"(>=|<=|:=|!=|==>|&&|\|\||[+/\-=>*<\[\]])", Operator),
- (r"([{}():;,.])", Punctuation),
- # Identifier
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'comment': [
- (r'[^*/]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline),
- ],
- 'numbers': [
- (r'[0-9]+', Number.Integer),
- ],
- }
-
-
-class SilverLexer(RegexLexer):
- """
- For `Silver <https://bitbucket.org/viperproject/silver>`_ source code.
-
- .. versionadded:: 2.2
- """
- name = 'Silver'
- aliases = ['silver']
- filenames = ['*.sil', '*.vpr']
-
- tokens = {
- 'root': [
- # Whitespace and Comments
- (r'\n', Whitespace),
- (r'\s+', Whitespace),
- (r'//[/!](.*?)\n', Comment.Doc),
- (r'//(.*?)\n', Comment.Single),
- (r'/\*', Comment.Multiline, 'comment'),
-
- (words((
- 'result', 'true', 'false', 'null', 'method', 'function',
- 'predicate', 'program', 'domain', 'axiom', 'var', 'returns',
- 'field', 'define', 'requires', 'ensures', 'invariant',
- 'fold', 'unfold', 'inhale', 'exhale', 'new', 'assert',
- 'assume', 'goto', 'while', 'if', 'elseif', 'else', 'fresh',
- 'constraining', 'Seq', 'Set', 'Multiset', 'union', 'intersection',
- 'setminus', 'subset', 'unfolding', 'in', 'old', 'forall', 'exists',
- 'acc', 'wildcard', 'write', 'none', 'epsilon', 'perm', 'unique',
- 'apply', 'package', 'folding', 'label', 'forperm'),
- suffix=r'\b'), Keyword),
- (words(('Int', 'Perm', 'Bool', 'Ref'), suffix=r'\b'), Keyword.Type),
- include('numbers'),
-
- (r'[!%&*+=|?:<>/\-\[\]]', Operator),
- (r'([{}():;,.])', Punctuation),
- # Identifier
- (r'[\w$]\w*', Name),
- ],
- 'comment': [
- (r'[^*/]+', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline),
- ],
- 'numbers': [
- (r'[0-9]+', Number.Integer),
- ],
- }
diff --git a/pygments/lexers/web.py b/pygments/lexers/web.py
deleted file mode 100644
index 587b0cde..00000000
--- a/pygments/lexers/web.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.web
- ~~~~~~~~~~~~~~~~~~~
-
- Just export previously exported lexers.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexers.html import HtmlLexer, DtdLexer, XmlLexer, XsltLexer, \
- HamlLexer, ScamlLexer, JadeLexer
-from pygments.lexers.css import CssLexer, SassLexer, ScssLexer
-from pygments.lexers.javascript import JavascriptLexer, LiveScriptLexer, \
- DartLexer, TypeScriptLexer, LassoLexer, ObjectiveJLexer, CoffeeScriptLexer
-from pygments.lexers.actionscript import ActionScriptLexer, \
- ActionScript3Lexer, MxmlLexer
-from pygments.lexers.php import PhpLexer
-from pygments.lexers.webmisc import DuelLexer, XQueryLexer, SlimLexer, QmlLexer
-from pygments.lexers.data import JsonLexer
-JSONLexer = JsonLexer # for backwards compatibility with Pygments 1.5
-
-__all__ = []
diff --git a/pygments/lexers/webmisc.py b/pygments/lexers/webmisc.py
deleted file mode 100644
index b39334bc..00000000
--- a/pygments/lexers/webmisc.py
+++ /dev/null
@@ -1,989 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.webmisc
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for misc. web stuff.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
- default, using
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Literal
-from pygments.util import unirange
-
-from pygments.lexers.css import _indentation, _starts_block
-from pygments.lexers.html import HtmlLexer
-from pygments.lexers.javascript import JavascriptLexer
-from pygments.lexers.ruby import RubyLexer
-
-__all__ = ['DuelLexer', 'SlimLexer', 'XQueryLexer', 'QmlLexer', 'CirruLexer']
-
-
-class DuelLexer(RegexLexer):
- """
- Lexer for Duel Views Engine (formerly JBST) markup with JavaScript code blocks.
- See http://duelengine.org/.
- See http://jsonml.org/jbst/.
-
- .. versionadded:: 1.4
- """
-
- name = 'Duel'
- aliases = ['duel', 'jbst', 'jsonml+bst']
- filenames = ['*.duel', '*.jbst']
- mimetypes = ['text/x-duel', 'text/x-jbst']
-
- flags = re.DOTALL
-
- tokens = {
- 'root': [
- (r'(<%[@=#!:]?)(.*?)(%>)',
- bygroups(Name.Tag, using(JavascriptLexer), Name.Tag)),
- (r'(<%\$)(.*?)(:)(.*?)(%>)',
- bygroups(Name.Tag, Name.Function, Punctuation, String, Name.Tag)),
- (r'(<%--)(.*?)(--%>)',
- bygroups(Name.Tag, Comment.Multiline, Name.Tag)),
- (r'(<script.*?>)(.*?)(</script>)',
- bygroups(using(HtmlLexer),
- using(JavascriptLexer), using(HtmlLexer))),
- (r'(.+?)(?=<)', using(HtmlLexer)),
- (r'.+', using(HtmlLexer)),
- ],
- }
-
-
-class XQueryLexer(ExtendedRegexLexer):
- """
- An XQuery lexer, parsing a stream and outputting the tokens needed to
- highlight xquery code.
-
- .. versionadded:: 1.4
- """
- name = 'XQuery'
- aliases = ['xquery', 'xqy', 'xq', 'xql', 'xqm']
- filenames = ['*.xqy', '*.xquery', '*.xq', '*.xql', '*.xqm']
- mimetypes = ['text/xquery', 'application/xquery']
-
- xquery_parse_state = []
-
- # FIX UNICODE LATER
- # ncnamestartchar = (
- # ur"[A-Z]|_|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|"
- # ur"[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|"
- # ur"[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD]|"
- # ur"[\u10000-\uEFFFF]"
- # )
- ncnamestartchar = r"(?:[A-Z]|_|[a-z])"
- # FIX UNICODE LATER
- # ncnamechar = ncnamestartchar + (ur"|-|\.|[0-9]|\u00B7|[\u0300-\u036F]|"
- # ur"[\u203F-\u2040]")
- ncnamechar = r"(?:" + ncnamestartchar + r"|-|\.|[0-9])"
- ncname = "(?:%s+%s*)" % (ncnamestartchar, ncnamechar)
- pitarget_namestartchar = r"(?:[A-KN-WYZ]|_|:|[a-kn-wyz])"
- 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)
-
- 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"|''|[^&'])*')"
-
- # FIX UNICODE LATER
- # elementcontentchar = (ur'\t|\r|\n|[\u0020-\u0025]|[\u0028-\u003b]|'
- # ur'[\u003d-\u007a]|\u007c|[\u007e-\u007F]')
- elementcontentchar = r'[A-Za-z]|\s|\d|[!"#$%()*+,\-./:;=?@\[\\\]^_\'`|~]'
- # quotattrcontentchar = (ur'\t|\r|\n|[\u0020-\u0021]|[\u0023-\u0025]|'
- # ur'[\u0027-\u003b]|[\u003d-\u007a]|\u007c|[\u007e-\u007F]')
- quotattrcontentchar = r'[A-Za-z]|\s|\d|[!#$%()*+,\-./:;=?@\[\\\]^_\'`|~]'
- # aposattrcontentchar = (ur'\t|\r|\n|[\u0020-\u0025]|[\u0028-\u003b]|'
- # ur'[\u003d-\u007a]|\u007c|[\u007e-\u007F]')
- aposattrcontentchar = r'[A-Za-z]|\s|\d|[!"#$%()*+,\-./:;=?@\[\\\]^_`|~]'
-
- # CHAR elements - fix the above elementcontentchar, quotattrcontentchar,
- # aposattrcontentchar
- # x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
-
- 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
- ctx.stack = ['root']
- ctx.pos = match.end()
-
- def popstate_tag_callback(lexer, match, ctx):
- yield match.start(), Name.Tag, match.group(1)
- ctx.stack.append(lexer.xquery_parse_state.pop())
- ctx.pos = match.end()
-
- def popstate_xmlcomment_callback(lexer, match, ctx):
- yield match.start(), String.Doc, match.group(1)
- ctx.stack.append(lexer.xquery_parse_state.pop())
- ctx.pos = match.end()
-
- def popstate_kindtest_callback(lexer, match, ctx):
- yield match.start(), Punctuation, match.group(1)
- next_state = lexer.xquery_parse_state.pop()
- if next_state == 'occurrenceindicator':
- if re.match("[?*+]+", match.group(2)):
- yield match.start(), Punctuation, match.group(2)
- ctx.stack.append('operator')
- ctx.pos = match.end()
- else:
- ctx.stack.append('operator')
- ctx.pos = match.end(1)
- else:
- ctx.stack.append(next_state)
- ctx.pos = match.end(1)
-
- def popstate_callback(lexer, match, ctx):
- yield match.start(), Punctuation, match.group(1)
- # if we have run out of our state stack, pop whatever is on the pygments
- # state stack
- if len(lexer.xquery_parse_state) == 0:
- ctx.stack.pop()
- elif len(ctx.stack) > 1:
- ctx.stack.append(lexer.xquery_parse_state.pop())
- else:
- # i don't know if i'll need this, but in case, default back to root
- ctx.stack = ['root']
- ctx.pos = match.end()
-
- def pushstate_element_content_starttag_callback(lexer, match, ctx):
- yield match.start(), Name.Tag, match.group(1)
- lexer.xquery_parse_state.append('element_content')
- ctx.stack.append('start_tag')
- ctx.pos = match.end()
-
- def pushstate_cdata_section_callback(lexer, match, ctx):
- yield match.start(), String.Doc, match.group(1)
- ctx.stack.append('cdata_section')
- lexer.xquery_parse_state.append(ctx.state.pop)
- ctx.pos = match.end()
-
- def pushstate_starttag_callback(lexer, match, ctx):
- yield match.start(), Name.Tag, match.group(1)
- lexer.xquery_parse_state.append(ctx.state.pop)
- ctx.stack.append('start_tag')
- ctx.pos = match.end()
-
- def pushstate_operator_order_callback(lexer, match, ctx):
- yield match.start(), Keyword, match.group(1)
- yield match.start(), Text, match.group(2)
- yield match.start(), Punctuation, match.group(3)
- ctx.stack = ['root']
- lexer.xquery_parse_state.append('operator')
- ctx.pos = match.end()
-
- def pushstate_operator_map_callback(lexer, match, ctx):
- yield match.start(), Keyword, match.group(1)
- yield match.start(), Text, match.group(2)
- yield match.start(), Punctuation, match.group(3)
- ctx.stack = ['root']
- lexer.xquery_parse_state.append('operator')
- ctx.pos = match.end()
-
- def pushstate_operator_root_validate(lexer, match, ctx):
- yield match.start(), Keyword, match.group(1)
- yield match.start(), Text, match.group(2)
- yield match.start(), Punctuation, match.group(3)
- ctx.stack = ['root']
- lexer.xquery_parse_state.append('operator')
- ctx.pos = match.end()
-
- def pushstate_operator_root_validate_withmode(lexer, match, ctx):
- yield match.start(), Keyword, match.group(1)
- yield match.start(), Text, match.group(2)
- yield match.start(), Keyword, match.group(3)
- ctx.stack = ['root']
- lexer.xquery_parse_state.append('operator')
- ctx.pos = match.end()
-
- def pushstate_operator_processing_instruction_callback(lexer, match, ctx):
- yield match.start(), String.Doc, match.group(1)
- ctx.stack.append('processing_instruction')
- lexer.xquery_parse_state.append('operator')
- ctx.pos = match.end()
-
- def pushstate_element_content_processing_instruction_callback(lexer, match, ctx):
- yield match.start(), String.Doc, match.group(1)
- ctx.stack.append('processing_instruction')
- lexer.xquery_parse_state.append('element_content')
- ctx.pos = match.end()
-
- def pushstate_element_content_cdata_section_callback(lexer, match, ctx):
- yield match.start(), String.Doc, match.group(1)
- ctx.stack.append('cdata_section')
- lexer.xquery_parse_state.append('element_content')
- ctx.pos = match.end()
-
- def pushstate_operator_cdata_section_callback(lexer, match, ctx):
- yield match.start(), String.Doc, match.group(1)
- ctx.stack.append('cdata_section')
- lexer.xquery_parse_state.append('operator')
- ctx.pos = match.end()
-
- def pushstate_element_content_xmlcomment_callback(lexer, match, ctx):
- yield match.start(), String.Doc, match.group(1)
- ctx.stack.append('xml_comment')
- lexer.xquery_parse_state.append('element_content')
- ctx.pos = match.end()
-
- def pushstate_operator_xmlcomment_callback(lexer, match, ctx):
- yield match.start(), String.Doc, match.group(1)
- ctx.stack.append('xml_comment')
- lexer.xquery_parse_state.append('operator')
- ctx.pos = match.end()
-
- def pushstate_kindtest_callback(lexer, match, ctx):
- yield match.start(), Keyword, match.group(1)
- yield match.start(), Text, match.group(2)
- yield match.start(), Punctuation, match.group(3)
- lexer.xquery_parse_state.append('kindtest')
- ctx.stack.append('kindtest')
- ctx.pos = match.end()
-
- def pushstate_operator_kindtestforpi_callback(lexer, match, ctx):
- yield match.start(), Keyword, match.group(1)
- yield match.start(), Text, match.group(2)
- yield match.start(), Punctuation, match.group(3)
- lexer.xquery_parse_state.append('operator')
- ctx.stack.append('kindtestforpi')
- ctx.pos = match.end()
-
- def pushstate_operator_kindtest_callback(lexer, match, ctx):
- yield match.start(), Keyword, match.group(1)
- yield match.start(), Text, match.group(2)
- yield match.start(), Punctuation, match.group(3)
- lexer.xquery_parse_state.append('operator')
- ctx.stack.append('kindtest')
- ctx.pos = match.end()
-
- def pushstate_occurrenceindicator_kindtest_callback(lexer, match, ctx):
- yield match.start(), Name.Tag, match.group(1)
- yield match.start(), Text, match.group(2)
- yield match.start(), Punctuation, match.group(3)
- lexer.xquery_parse_state.append('occurrenceindicator')
- ctx.stack.append('kindtest')
- ctx.pos = match.end()
-
- def pushstate_operator_starttag_callback(lexer, match, ctx):
- yield match.start(), Name.Tag, match.group(1)
- lexer.xquery_parse_state.append('operator')
- ctx.stack.append('start_tag')
- ctx.pos = match.end()
-
- def pushstate_operator_root_callback(lexer, match, ctx):
- yield match.start(), Punctuation, match.group(1)
- lexer.xquery_parse_state.append('operator')
- ctx.stack = ['root']
- ctx.pos = match.end()
-
- def pushstate_operator_root_construct_callback(lexer, match, ctx):
- yield match.start(), Keyword, match.group(1)
- yield match.start(), Text, match.group(2)
- yield match.start(), Punctuation, match.group(3)
- lexer.xquery_parse_state.append('operator')
- ctx.stack = ['root']
- ctx.pos = match.end()
-
- def pushstate_root_callback(lexer, match, ctx):
- yield match.start(), Punctuation, match.group(1)
- cur_state = ctx.stack.pop()
- lexer.xquery_parse_state.append(cur_state)
- ctx.stack = ['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)
- yield match.start(), Punctuation, match.group(3)
- lexer.xquery_parse_state.append('operator')
- ctx.pos = match.end()
-
- tokens = {
- 'comment': [
- # xquery comments
- (r'(:\))', Comment, '#pop'),
- (r'(\(:)', Comment, '#push'),
- (r'[^:)]', Comment),
- (r'([^:)]|:|\))', Comment),
- ],
- 'whitespace': [
- (r'\s+', Text),
- ],
- 'operator': [
- include('whitespace'),
- (r'(\})', popstate_callback),
- (r'\(:', Comment, 'comment'),
-
- (r'(\{)', pushstate_root_callback),
- (r'then|else|external|at|div|except', Keyword, 'root'),
- (r'order by', Keyword, 'root'),
- (r'group 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|count|preserve\s+strip',
- Keyword, 'root'),
- (r'(>=|>>|>|<=|<<|<|-|\*|!=|\+|\|\||\||:=|=|!)',
- operator_root_callback),
- (r'(::|:|;|\[|//|/|,)',
- punctuation_root_callback),
- (r'(castable|cast)(\s+)(as)\b',
- bygroups(Keyword, Text, Keyword), 'singletype'),
- (r'(instance)(\s+)(of)\b',
- bygroups(Keyword, Text, Keyword), 'itemtype'),
- (r'(treat)(\s+)(as)\b',
- bygroups(Keyword, Text, Keyword), 'itemtype'),
- (r'(case)(\s+)(' + stringdouble + ')',
- bygroups(Keyword, Text, String.Double), 'itemtype'),
- (r'(case)(\s+)(' + stringsingle + ')',
- bygroups(Keyword, Text, String.Single), 'itemtype'),
- (r'(case|as)\b', Keyword, 'itemtype'),
- (r'(\))(\s*)(as)',
- bygroups(Punctuation, Text, Keyword), 'itemtype'),
- (r'\$', Name.Variable, 'varname'),
- (r'(for|let|previous|next)(\s+)(\$)',
- bygroups(Keyword, Text, Name.Variable), 'varname'),
- (r'(for)(\s+)(tumbling|sliding)(\s+)(window)(\s+)(\$)',
- bygroups(Keyword, Text, Keyword, Text, Keyword, Text, Name.Variable),
- 'varname'),
- # (r'\)|\?|\]', Punctuation, '#push'),
- (r'\)|\?|\]', Punctuation),
- (r'(empty)(\s+)(greatest|least)', bygroups(Keyword, Text, Keyword)),
- (r'ascending|descending|default', Keyword, '#push'),
- (r'(allowing)(\s+)(empty)', bygroups(Keyword, Text, Keyword)),
- (r'external', Keyword),
- (r'(start|when|end)', Keyword, 'root'),
- (r'(only)(\s+)(end)', bygroups(Keyword, Text, Keyword), 'root'),
- (r'collation', Keyword, 'uritooperator'),
-
- # eXist specific XQUF
- (r'(into|following|preceding|with)', Keyword, 'root'),
-
- # support for current context on rhs of Simple Map Operator
- (r'\.', Operator),
-
- # finally catch all string literals and stay in operator state
- (stringdouble, String.Double),
- (stringsingle, String.Single),
-
- (r'(catch)(\s*)', bygroups(Keyword, Text), 'root'),
- ],
- 'uritooperator': [
- (stringdouble, String.Double, '#pop'),
- (stringsingle, String.Single, '#pop'),
- ],
- 'namespacedecl': [
- include('whitespace'),
- (r'\(:', Comment, 'comment'),
- (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),
- (r'=', Operator),
- (r';', Punctuation, 'root'),
- (ncname, Name.Namespace),
- ],
- 'namespacekeyword': [
- include('whitespace'),
- (r'\(:', Comment, 'comment'),
- (stringdouble, String.Double, 'namespacedecl'),
- (stringsingle, String.Single, 'namespacedecl'),
- (r'inherit|no-inherit', Keyword, 'root'),
- (r'namespace', Keyword, 'namespacedecl'),
- (r'(default)(\s+)(element)', bygroups(Keyword, Text, Keyword)),
- (r'preserve|no-preserve', Keyword),
- (r',', Punctuation),
- ],
- 'annotationname': [
- (r'\(:', Comment, 'comment'),
- (qname, Name.Decorator),
- (r'(\()(' + stringdouble + ')', bygroups(Punctuation, String.Double)),
- (r'(\()(' + stringsingle + ')', bygroups(Punctuation, String.Single)),
- (r'(\,)(\s+)(' + stringdouble + ')',
- bygroups(Punctuation, Text, String.Double)),
- (r'(\,)(\s+)(' + stringsingle + ')',
- bygroups(Punctuation, Text, String.Single)),
- (r'\)', Punctuation),
- (r'(\s+)(\%)', bygroups(Text, Name.Decorator), 'annotationname'),
- (r'(\s+)(variable)(\s+)(\$)',
- bygroups(Text, Keyword.Declaration, Text, Name.Variable), 'varname'),
- (r'(\s+)(function)(\s+)',
- bygroups(Text, Keyword.Declaration, Text), 'root')
- ],
- 'varname': [
- (r'\(:', Comment, 'comment'),
- (r'(' + qname + r')(\()?', bygroups(Name, Punctuation), 'operator'),
- ],
- 'singletype': [
- include('whitespace'),
- (r'\(:', Comment, 'comment'),
- (ncname + r'(:\*)', Name.Variable, 'operator'),
- (qname, Name.Variable, 'operator'),
- ],
- 'itemtype': [
- include('whitespace'),
- (r'\(:', Comment, 'comment'),
- (r'\$', Name.Variable, 'varname'),
- (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|empty-sequence)(\s*)(\()',
- pushstate_occurrenceindicator_kindtest_callback),
- # Marklogic specific type?
- (r'(processing-instruction)(\s*)(\()',
- bygroups(Keyword, Text, Punctuation),
- ('occurrenceindicator', 'kindtestforpi')),
- (r'(item)(\s*)(\()(\s*)(\))(?=[*+?])',
- bygroups(Keyword, Text, Punctuation, Text, Punctuation),
- 'occurrenceindicator'),
- (r'(\(\#)(\s*)', bygroups(Punctuation, Text), 'pragma'),
- (r';', Punctuation, '#pop'),
- (r'then|else', Keyword, '#pop'),
- (r'(at)(\s+)(' + stringdouble + ')',
- bygroups(Keyword, Text, String.Double), 'namespacedecl'),
- (r'(at)(\s+)(' + stringsingle + ')',
- bygroups(Keyword, Text, String.Single), 'namespacedecl'),
- (r'except|intersect|in|is|return|satisfies|to|union|where|count',
- Keyword, 'root'),
- (r'and|div|eq|ge|gt|le|lt|ne|idiv|mod|or', Operator.Word, 'root'),
- (r':=|=|,|>=|>>|>|\[|\(|<=|<<|<|-|!=|\|\||\|', Operator, 'root'),
- (r'external|at', Keyword, 'root'),
- (r'(stable)(\s+)(order)(\s+)(by)',
- bygroups(Keyword, Text, Keyword, Text, Keyword), 'root'),
- (r'(castable|cast)(\s+)(as)',
- bygroups(Keyword, Text, Keyword), 'singletype'),
- (r'(treat)(\s+)(as)', bygroups(Keyword, Text, Keyword)),
- (r'(instance)(\s+)(of)', bygroups(Keyword, Text, Keyword)),
- (r'(case)(\s+)(' + stringdouble + ')',
- bygroups(Keyword, Text, String.Double), 'itemtype'),
- (r'(case)(\s+)(' + stringsingle + ')',
- bygroups(Keyword, Text, String.Single), 'itemtype'),
- (r'case|as', Keyword, 'itemtype'),
- (r'(\))(\s*)(as)', bygroups(Operator, Text, Keyword), 'itemtype'),
- (ncname + r':\*', Keyword.Type, 'operator'),
- (r'(function|map|array)(\()', bygroups(Keyword.Type, Punctuation)),
- (qname, Keyword.Type, 'occurrenceindicator'),
- ],
- 'kindtest': [
- (r'\(:', Comment, 'comment'),
- (r'\{', Punctuation, 'root'),
- (r'(\))([*+?]?)', popstate_kindtest_callback),
- (r'\*', Name, 'closekindtest'),
- (qname, Name, 'closekindtest'),
- (r'(element|schema-element)(\s*)(\()', pushstate_kindtest_callback),
- ],
- 'kindtestforpi': [
- (r'\(:', Comment, 'comment'),
- (r'\)', Punctuation, '#pop'),
- (ncname, Name.Variable),
- (stringdouble, String.Double),
- (stringsingle, String.Single),
- ],
- 'closekindtest': [
- (r'\(:', Comment, 'comment'),
- (r'(\))', popstate_callback),
- (r',', Punctuation),
- (r'(\{)', pushstate_operator_root_callback),
- (r'\?', Punctuation),
- ],
- 'xml_comment': [
- (r'(-->)', popstate_xmlcomment_callback),
- (r'[^-]{1,2}', Literal),
- (u'\\t|\\r|\\n|[\u0020-\uD7FF]|[\uE000-\uFFFD]|' +
- unirange(0x10000, 0x10ffff), Literal),
- ],
- 'processing_instruction': [
- (r'\s+', Text, 'processing_instruction_content'),
- (r'\?>', String.Doc, '#pop'),
- (pitarget, Name),
- ],
- 'processing_instruction_content': [
- (r'\?>', String.Doc, '#pop'),
- (u'\\t|\\r|\\n|[\u0020-\uD7FF]|[\uE000-\uFFFD]|' +
- unirange(0x10000, 0x10ffff), Literal),
- ],
- 'cdata_section': [
- (r']]>', String.Doc, '#pop'),
- (u'\\t|\\r|\\n|[\u0020-\uD7FF]|[\uE000-\uFFFD]|' +
- unirange(0x10000, 0x10ffff), Literal),
- ],
- 'start_tag': [
- include('whitespace'),
- (r'(/>)', popstate_tag_callback),
- (r'>', Name.Tag, 'element_content'),
- (r'"', Punctuation, 'quot_attribute_content'),
- (r"'", Punctuation, 'apos_attribute_content'),
- (r'=', Operator),
- (qname, Name.Tag),
- ],
- 'quot_attribute_content': [
- (r'"', Punctuation, 'start_tag'),
- (r'(\{)', pushstate_root_callback),
- (r'""', Name.Attribute),
- (quotattrcontentchar, Name.Attribute),
- (entityref, Name.Attribute),
- (charref, Name.Attribute),
- (r'\{\{|\}\}', Name.Attribute),
- ],
- 'apos_attribute_content': [
- (r"'", Punctuation, 'start_tag'),
- (r'\{', Punctuation, 'root'),
- (r"''", Name.Attribute),
- (aposattrcontentchar, Name.Attribute),
- (entityref, Name.Attribute),
- (charref, Name.Attribute),
- (r'\{\{|\}\}', Name.Attribute),
- ],
- 'element_content': [
- (r'</', Name.Tag, 'end_tag'),
- (r'(\{)', pushstate_root_callback),
- (r'(<!--)', pushstate_element_content_xmlcomment_callback),
- (r'(<\?)', pushstate_element_content_processing_instruction_callback),
- (r'(<!\[CDATA\[)', pushstate_element_content_cdata_section_callback),
- (r'(<)', pushstate_element_content_starttag_callback),
- (elementcontentchar, Literal),
- (entityref, Literal),
- (charref, Literal),
- (r'\{\{|\}\}', Literal),
- ],
- 'end_tag': [
- include('whitespace'),
- (r'(>)', popstate_tag_callback),
- (qname, Name.Tag),
- ],
- 'xmlspace_decl': [
- include('whitespace'),
- (r'\(:', Comment, 'comment'),
- (r'preserve|strip', Keyword, '#pop'),
- ],
- 'declareordering': [
- (r'\(:', Comment, 'comment'),
- include('whitespace'),
- (r'ordered|unordered', Keyword, '#pop'),
- ],
- 'xqueryversion': [
- include('whitespace'),
- (r'\(:', Comment, 'comment'),
- (stringdouble, String.Double),
- (stringsingle, String.Single),
- (r'encoding', Keyword),
- (r';', Punctuation, '#pop'),
- ],
- 'pragma': [
- (qname, Name.Variable, 'pragmacontents'),
- ],
- 'pragmacontents': [
- (r'#\)', Punctuation, 'operator'),
- (u'\\t|\\r|\\n|[\u0020-\uD7FF]|[\uE000-\uFFFD]|' +
- unirange(0x10000, 0x10ffff), Literal),
- (r'(\s+)', Text),
- ],
- 'occurrenceindicator': [
- include('whitespace'),
- (r'\(:', Comment, 'comment'),
- (r'\*|\?|\+', Operator, 'operator'),
- (r':=', Operator, 'root'),
- default('operator'),
- ],
- 'option': [
- include('whitespace'),
- (qname, Name.Variable, '#pop'),
- ],
- 'qname_braren': [
- include('whitespace'),
- (r'(\{)', pushstate_operator_root_callback),
- (r'(\()', Punctuation, 'root'),
- ],
- 'element_qname': [
- (qname, Name.Variable, 'root'),
- ],
- 'attribute_qname': [
- (qname, Name.Variable, 'root'),
- ],
- 'root': [
- include('whitespace'),
- (r'\(:', Comment, 'comment'),
-
- # handle operator state
- # order on numbers matters - handle most complex first
- (r'\d+(\.\d*)?[eE][+-]?\d+', Number.Float, 'operator'),
- (r'(\.\d+)[eE][+-]?\d+', Number.Float, 'operator'),
- (r'(\.\d+|\d+\.\d*)', Number.Float, 'operator'),
- (r'(\d+)', Number.Integer, 'operator'),
- (r'(\.\.|\.|\))', Punctuation, 'operator'),
- (r'(declare)(\s+)(construction)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration), 'operator'),
- (r'(declare)(\s+)(default)(\s+)(order)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration, Text, Keyword.Declaration), 'operator'),
- (r'(declare)(\s+)(context)(\s+)(item)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration, Text, Keyword.Declaration), 'operator'),
- (ncname + r':\*', Name, 'operator'),
- (r'\*:'+ncname, Name.Tag, 'operator'),
- (r'\*', Name.Tag, 'operator'),
- (stringdouble, String.Double, 'operator'),
- (stringsingle, String.Single, 'operator'),
-
- (r'(\}|\])', popstate_callback),
-
- # NAMESPACE DECL
- (r'(declare)(\s+)(default)(\s+)(collation)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration, Text, Keyword.Declaration)),
- (r'(module|declare)(\s+)(namespace)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration), 'namespacedecl'),
- (r'(declare)(\s+)(base-uri)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration), 'namespacedecl'),
-
- # NAMESPACE KEYWORD
- (r'(declare)(\s+)(default)(\s+)(element|function)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration, Text, Keyword.Declaration),
- 'namespacekeyword'),
- (r'(import)(\s+)(schema|module)',
- bygroups(Keyword.Pseudo, Text, Keyword.Pseudo), 'namespacekeyword'),
- (r'(declare)(\s+)(copy-namespaces)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration), 'namespacekeyword'),
-
- # VARNAMEs
- (r'(for|let|some|every)(\s+)(\$)',
- bygroups(Keyword, Text, Name.Variable), 'varname'),
- (r'(for)(\s+)(tumbling|sliding)(\s+)(window)(\s+)(\$)',
- bygroups(Keyword, Text, Keyword, Text, Keyword, Text, Name.Variable), 'varname'),
- (r'\$', Name.Variable, 'varname'),
- (r'(declare)(\s+)(variable)(\s+)(\$)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration, Text, Name.Variable), 'varname'),
-
- # ANNOTATED GLOBAL VARIABLES AND FUNCTIONS
- (r'(declare)(\s+)(\%)', bygroups(Keyword.Declaration, Text, Name.Decorator), 'annotationname'),
-
- # ITEMTYPE
- (r'(\))(\s+)(as)', bygroups(Operator, Text, Keyword), 'itemtype'),
-
- (r'(element|attribute|schema-element|schema-attribute|comment|'
- r'text|node|document-node|empty-sequence)(\s+)(\()',
- pushstate_operator_kindtest_callback),
-
- (r'(processing-instruction)(\s+)(\()',
- pushstate_operator_kindtestforpi_callback),
-
- (r'(<!--)', pushstate_operator_xmlcomment_callback),
-
- (r'(<\?)', pushstate_operator_processing_instruction_callback),
-
- (r'(<!\[CDATA\[)', pushstate_operator_cdata_section_callback),
-
- # (r'</', Name.Tag, 'end_tag'),
- (r'(<)', pushstate_operator_starttag_callback),
-
- (r'(declare)(\s+)(boundary-space)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration), 'xmlspace_decl'),
-
- (r'(validate)(\s+)(lax|strict)',
- pushstate_operator_root_validate_withmode),
- (r'(validate)(\s*)(\{)', pushstate_operator_root_validate),
- (r'(typeswitch)(\s*)(\()', bygroups(Keyword, Text, Punctuation)),
- (r'(switch)(\s*)(\()', bygroups(Keyword, Text, Punctuation)),
- (r'(element|attribute|namespace)(\s*)(\{)',
- pushstate_operator_root_construct_callback),
-
- (r'(document|text|processing-instruction|comment)(\s*)(\{)',
- pushstate_operator_root_construct_callback),
- # ATTRIBUTE
- (r'(attribute)(\s+)(?=' + qname + r')',
- bygroups(Keyword, Text), 'attribute_qname'),
- # ELEMENT
- (r'(element)(\s+)(?=' + qname + r')',
- bygroups(Keyword, Text), 'element_qname'),
- # PROCESSING_INSTRUCTION
- (r'(processing-instruction|namespace)(\s+)(' + ncname + r')(\s*)(\{)',
- bygroups(Keyword, Text, Name.Variable, Text, Punctuation),
- 'operator'),
-
- (r'(declare|define)(\s+)(function)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration)),
-
- (r'(\{|\[)', pushstate_operator_root_callback),
-
- (r'(unordered|ordered)(\s*)(\{)',
- pushstate_operator_order_callback),
-
- (r'(map|array)(\s*)(\{)',
- pushstate_operator_map_callback),
-
- (r'(declare)(\s+)(ordering)',
- bygroups(Keyword.Declaration, Text, Keyword.Declaration), 'declareordering'),
-
- (r'(xquery)(\s+)(version)',
- bygroups(Keyword.Pseudo, Text, Keyword.Pseudo), 'xqueryversion'),
-
- (r'(\(#)(\s*)', bygroups(Punctuation, Text), 'pragma'),
-
- # sometimes return can occur in root state
- (r'return', Keyword),
-
- (r'(declare)(\s+)(option)', bygroups(Keyword.Declaration, Text, Keyword.Declaration),
- 'option'),
-
- # URI LITERALS - single and double quoted
- (r'(at)(\s+)('+stringdouble+')', String.Double, 'namespacedecl'),
- (r'(at)(\s+)('+stringsingle+')', String.Single, 'namespacedecl'),
-
- (r'(ancestor-or-self|ancestor|attribute|child|descendant-or-self)(::)',
- bygroups(Keyword, Punctuation)),
- (r'(descendant|following-sibling|following|parent|preceding-sibling'
- r'|preceding|self)(::)', bygroups(Keyword, Punctuation)),
-
- (r'(if)(\s*)(\()', bygroups(Keyword, Text, Punctuation)),
-
- (r'then|else', Keyword),
-
- # eXist specific XQUF
- (r'(update)(\s*)(insert|delete|replace|value|rename)', bygroups(Keyword, Text, Keyword)),
- (r'(into|following|preceding|with)', Keyword),
-
- # Marklogic specific
- (r'(try)(\s*)', bygroups(Keyword, Text), 'root'),
- (r'(catch)(\s*)(\()(\$)',
- bygroups(Keyword, Text, Punctuation, Name.Variable), 'varname'),
-
-
- (r'(@'+qname+')', Name.Attribute, 'operator'),
- (r'(@'+ncname+')', Name.Attribute, 'operator'),
- (r'@\*:'+ncname, Name.Attribute, 'operator'),
- (r'@\*', Name.Attribute, 'operator'),
- (r'(@)', Name.Attribute, 'operator'),
-
- (r'//|/|\+|-|;|,|\(|\)', Punctuation),
-
- # STANDALONE QNAMES
- (qname + r'(?=\s*\{)', Name.Tag, 'qname_braren'),
- (qname + r'(?=\s*\([^:])', Name.Function, 'qname_braren'),
- (r'(' + qname + ')(#)([0-9]+)', bygroups(Name.Function, Keyword.Type, Number.Integer)),
- (qname, Name.Tag, 'operator'),
- ]
- }
-
-
-class QmlLexer(RegexLexer):
- """
- For QML files. See http://doc.qt.digia.com/4.7/qdeclarativeintroduction.html.
-
- .. versionadded:: 1.6
- """
-
- # QML is based on javascript, so much of this is taken from the
- # JavascriptLexer above.
-
- name = 'QML'
- aliases = ['qml', 'qbs']
- filenames = ['*.qml', '*.qbs']
- mimetypes = ['application/x-qml', 'application/x-qt.qbs+qml']
-
- # pasted from JavascriptLexer, with some additions
- flags = re.DOTALL | re.MULTILINE
-
- tokens = {
- 'commentsandwhitespace': [
- (r'\s+', Text),
- (r'<!--', Comment),
- (r'//.*?\n', Comment.Single),
- (r'/\*.*?\*/', Comment.Multiline)
- ],
- 'slashstartsregex': [
- include('commentsandwhitespace'),
- (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
- (r'(?=/)', Text, ('#pop', 'badregex')),
- default('#pop')
- ],
- 'badregex': [
- (r'\n', Text, '#pop')
- ],
- 'root': [
- (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
- include('commentsandwhitespace'),
- (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
- r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
- (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
- (r'[})\].]', Punctuation),
-
- # QML insertions
- (r'\bid\s*:\s*[A-Za-z][\w.]*', Keyword.Declaration,
- 'slashstartsregex'),
- (r'\b[A-Za-z][\w.]*\s*:', Keyword, 'slashstartsregex'),
-
- # the rest from JavascriptLexer
- (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|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|'
- r'transient|volatile)\b', Keyword.Reserved),
- (r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
- (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
- r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
- r'decodeURIComponent|encodeURI|encodeURIComponent|'
- r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
- r'window)\b', Name.Builtin),
- (r'[$a-zA-Z_]\w*', 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 CirruLexer(RegexLexer):
- r"""
- Syntax rules of Cirru can be found at:
- http://cirru.org/
-
- * using ``()`` for expressions, but restricted in a same line
- * using ``""`` for strings, with ``\`` for escaping chars
- * using ``$`` as folding operator
- * using ``,`` as unfolding operator
- * using indentations for nested blocks
-
- .. versionadded:: 2.0
- """
-
- name = 'Cirru'
- aliases = ['cirru']
- filenames = ['*.cirru']
- mimetypes = ['text/x-cirru']
- flags = re.MULTILINE
-
- tokens = {
- 'string': [
- (r'[^"\\\n]', String),
- (r'\\', String.Escape, 'escape'),
- (r'"', String, '#pop'),
- ],
- 'escape': [
- (r'.', String.Escape, '#pop'),
- ],
- 'function': [
- (r'\,', Operator, '#pop'),
- (r'[^\s"()]+', Name.Function, '#pop'),
- (r'\)', Operator, '#pop'),
- (r'(?=\n)', Text, '#pop'),
- (r'\(', Operator, '#push'),
- (r'"', String, ('#pop', 'string')),
- (r'[ ]+', Text.Whitespace),
- ],
- 'line': [
- (r'(?<!\w)\$(?!\w)', Operator, 'function'),
- (r'\(', Operator, 'function'),
- (r'\)', Operator),
- (r'\n', Text, '#pop'),
- (r'"', String, 'string'),
- (r'[ ]+', Text.Whitespace),
- (r'[+-]?[\d.]+\b', Number),
- (r'[^\s"()]+', Name.Variable)
- ],
- 'root': [
- (r'^\n+', Text.Whitespace),
- default(('line', 'function')),
- ]
- }
-
-
-class SlimLexer(ExtendedRegexLexer):
- """
- For Slim markup.
-
- .. versionadded:: 2.0
- """
-
- name = 'Slim'
- aliases = ['slim']
- filenames = ['*.slim']
- mimetypes = ['text/x-slim']
-
- flags = re.IGNORECASE
- _dot = r'(?: \|\n(?=.* \|)|.)'
- tokens = {
- 'root': [
- (r'[ \t]*\n', Text),
- (r'[ \t]*', _indentation),
- ],
-
- 'css': [
- (r'\.[\w:-]+', Name.Class, 'tag'),
- (r'\#[\w:-]+', Name.Function, 'tag'),
- ],
-
- 'eval-or-plain': [
- (r'([ \t]*==?)(.*\n)',
- bygroups(Punctuation, using(RubyLexer)),
- 'root'),
- (r'[ \t]+[\w:-]+(?==)', Name.Attribute, 'html-attributes'),
- default('plain'),
- ],
-
- 'content': [
- include('css'),
- (r'[\w:-]+:[ \t]*\n', Text, 'plain'),
- (r'(-)(.*\n)',
- bygroups(Punctuation, using(RubyLexer)),
- '#pop'),
- (r'\|' + _dot + r'*\n', _starts_block(Text, 'plain'), '#pop'),
- (r'/' + _dot + r'*\n', _starts_block(Comment.Preproc, 'slim-comment-block'), '#pop'),
- (r'[\w:-]+', Name.Tag, 'tag'),
- include('eval-or-plain'),
- ],
-
- 'tag': [
- include('css'),
- (r'[<>]{1,2}(?=[ \t=])', Punctuation),
- (r'[ \t]+\n', Punctuation, '#pop:2'),
- include('eval-or-plain'),
- ],
-
- 'plain': [
- (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Text),
- (r'(#\{)(.*?)(\})',
- bygroups(String.Interpol, using(RubyLexer), String.Interpol)),
- (r'\n', Text, 'root'),
- ],
-
- 'html-attributes': [
- (r'=', Punctuation),
- (r'"[^"]+"', using(RubyLexer), 'tag'),
- (r'\'[^\']+\'', using(RubyLexer), 'tag'),
- (r'\w+', Text, 'tag'),
- ],
-
- 'slim-comment-block': [
- (_dot + '+', Comment.Preproc),
- (r'\n', Text, 'root'),
- ],
- }
diff --git a/pygments/lexers/whiley.py b/pygments/lexers/whiley.py
deleted file mode 100644
index feeeb3b7..00000000
--- a/pygments/lexers/whiley.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.whiley
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Lexers for the Whiley language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups, words
-from pygments.token import Comment, Keyword, Name, Number, Operator, \
- Punctuation, String, Text
-
-__all__ = ['WhileyLexer']
-
-
-class WhileyLexer(RegexLexer):
- """
- Lexer for the Whiley programming language.
-
- .. versionadded:: 2.2
- """
- name = 'Whiley'
- filenames = ['*.whiley']
- aliases = ['whiley']
- mimetypes = ['text/x-whiley']
-
- # See the language specification:
- # http://whiley.org/download/WhileyLanguageSpec.pdf
-
- tokens = {
- 'root': [
- # Whitespace
- (r'\s+', Text),
-
- # Comments
- (r'//.*', Comment.Single),
- # don't parse empty comment as doc comment
- (r'/\*\*/', Comment.Multiline),
- (r'(?s)/\*\*.*?\*/', String.Doc),
- (r'(?s)/\*.*?\*/', Comment.Multiline),
-
- # Keywords
- (words((
- 'if', 'else', 'while', 'for', 'do', 'return',
- 'switch', 'case', 'default', 'break', 'continue',
- 'requires', 'ensures', 'where', 'assert', 'assume',
- 'all', 'no', 'some', 'in', 'is', 'new',
- 'throw', 'try', 'catch', 'debug', 'skip', 'fail',
- 'finite', 'total'), suffix=r'\b'), Keyword.Reserved),
- (words((
- 'function', 'method', 'public', 'private', 'protected',
- 'export', 'native'), suffix=r'\b'), Keyword.Declaration),
- # "constant" & "type" are not keywords unless used in declarations
- (r'(constant|type)(\s+)([a-zA-Z_]\w*)(\s+)(is)\b',
- bygroups(Keyword.Declaration, Text, Name, Text, Keyword.Reserved)),
- (r'(true|false|null)\b', Keyword.Constant),
- (r'(bool|byte|int|real|any|void)\b', Keyword.Type),
- # "from" is not a keyword unless used with import
- (r'(import)(\s+)(\*)([^\S\n]+)(from)\b',
- bygroups(Keyword.Namespace, Text, Punctuation, Text, Keyword.Namespace)),
- (r'(import)(\s+)([a-zA-Z_]\w*)([^\S\n]+)(from)\b',
- bygroups(Keyword.Namespace, Text, Name, Text, Keyword.Namespace)),
- (r'(package|import)\b', Keyword.Namespace),
-
- # standard library: https://github.com/Whiley/WhileyLibs/
- (words((
- # types defined in whiley.lang.Int
- 'i8', 'i16', 'i32', 'i64',
- 'u8', 'u16', 'u32', 'u64',
- 'uint', 'nat',
-
- # whiley.lang.Any
- 'toString'), suffix=r'\b'), Name.Builtin),
-
- # byte literal
- (r'[01]+b', Number.Bin),
-
- # decimal literal
- (r'[0-9]+\.[0-9]+', Number.Float),
- # match "1." but not ranges like "3..5"
- (r'[0-9]+\.(?!\.)', Number.Float),
-
- # integer literal
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
-
- # character literal
- (r"""'[^\\]'""", String.Char),
- (r"""(')(\\['"\\btnfr])(')""",
- bygroups(String.Char, String.Escape, String.Char)),
-
- # string literal
- (r'"', String, 'string'),
-
- # operators and punctuation
- (r'[{}()\[\],.;]', Punctuation),
- (u'[+\\-*/%&|<>^!~@=:?'
- # unicode operators
- u'\u2200\u2203\u2205\u2282\u2286\u2283\u2287'
- u'\u222A\u2229\u2264\u2265\u2208\u2227\u2228'
- u']', Operator),
-
- # identifier
- (r'[a-zA-Z_]\w*', Name),
- ],
- 'string': [
- (r'"', String, '#pop'),
- (r'\\[btnfr]', String.Escape),
- (r'\\u[0-9a-fA-F]{4}', String.Escape),
- (r'\\.', String),
- (r'[^\\"]+', String),
- ],
- }
diff --git a/pygments/lexers/x10.py b/pygments/lexers/x10.py
deleted file mode 100644
index eac87b1c..00000000
--- a/pygments/lexers/x10.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.x10
- ~~~~~~~~~~~~~~~~~~~
-
- Lexers for the X10 programming language.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-from pygments.lexer import RegexLexer
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-
-__all__ = ['X10Lexer']
-
-class X10Lexer(RegexLexer):
- """
- For the X10 language.
-
- .. versionadded:: 0.1
- """
-
- name = 'X10'
- aliases = ['x10', 'xten']
- filenames = ['*.x10']
- mimetypes = ['text/x-x10']
-
- keywords = (
- 'as', 'assert', 'async', 'at', 'athome', 'ateach', 'atomic',
- 'break', 'case', 'catch', 'class', 'clocked', 'continue',
- 'def', 'default', 'do', 'else', 'final', 'finally', 'finish',
- 'for', 'goto', 'haszero', 'here', 'if', 'import', 'in',
- 'instanceof', 'interface', 'isref', 'new', 'offer',
- 'operator', 'package', 'return', 'struct', 'switch', 'throw',
- 'try', 'type', 'val', 'var', 'when', 'while'
- )
-
- types = (
- 'void'
- )
-
- values = (
- 'false', 'null', 'self', 'super', 'this', 'true'
- )
-
- modifiers = (
- 'abstract', 'extends', 'implements', 'native', 'offers',
- 'private', 'property', 'protected', 'public', 'static',
- 'throws', 'transient'
- )
-
- tokens = {
- 'root': [
- (r'[^\S\n]+', Text),
- (r'//.*?\n', Comment.Single),
- (r'/\*(.|\n)*?\*/', Comment.Multiline),
- (r'\b(%s)\b' % '|'.join(keywords), Keyword),
- (r'\b(%s)\b' % '|'.join(types), Keyword.Type),
- (r'\b(%s)\b' % '|'.join(values), Keyword.Constant),
- (r'\b(%s)\b' % '|'.join(modifiers), Keyword.Declaration),
- (r'"(\\\\|\\"|[^"])*"', String),
- (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char),
- (r'.', Text)
- ],
- }
diff --git a/pygments/lexers/xorg.py b/pygments/lexers/xorg.py
deleted file mode 100644
index eadcfe76..00000000
--- a/pygments/lexers/xorg.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.xorg
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Xorg configs.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.lexer import RegexLexer, bygroups
-from pygments.token import Comment, String, Name, Text
-
-__all__ = ['XorgLexer']
-
-
-class XorgLexer(RegexLexer):
- """Lexer for xorg.conf file."""
- name = 'Xorg'
- aliases = ['xorg.conf']
- filenames = ['xorg.conf']
- mimetypes = []
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r'#.*$', Comment),
-
- (r'((?:Sub)?Section)(\s+)("\w+")',
- bygroups(String.Escape, Text, String.Escape)),
- (r'(End(|Sub)Section)', String.Escape),
-
- (r'(\w+)(\s+)([^\n#]+)',
- bygroups(Name.Builtin, Text, Name.Constant)),
- ],
- }
diff --git a/pygments/lexers/zig.py b/pygments/lexers/zig.py
deleted file mode 100644
index 7850fdf0..00000000
--- a/pygments/lexers/zig.py
+++ /dev/null
@@ -1,126 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers.zig
- ~~~~~~~~~~~~~~~~~~~~
-
- Lexers for Zig.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-from pygments.lexer import RegexLexer, bygroups, include, words
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error, Whitespace
-
-__all__ = ['ZigLexer']
-
-class ZigLexer(RegexLexer):
- """
- For `Zig <http://www.ziglang.org>`_ source code.
-
- grammar: https://ziglang.org/documentation/master/#Grammar
- """
- name = 'Zig'
- aliases = ['zig']
- filenames = ['*.zig']
- mimetypes = ['text/zig']
-
- type_keywords = (
- words(('bool', 'f16', 'f32', 'f64', 'f128', 'void', 'noreturn', 'type', 'anyerror', 'promise',
- 'i0', 'u0', 'isize', 'usize', 'comptime_int', 'comptime_float',
- 'c_short', 'c_ushort', 'c_int', 'c_uint', 'c_long', 'c_ulong', 'c_longlong', 'c_ulonglong', 'c_longdouble', 'c_void'
- 'i8', 'u8', 'i16', 'u16', 'i32', 'u32', 'i64', 'u64', 'i128', 'u128'
- ), suffix=r'\b'),
- Keyword.Type)
-
- storage_keywords = (
- words(('const', 'var', 'extern', 'packed', 'export', 'pub', 'noalias',
- 'inline', 'comptime', 'nakedcc', 'stdcallcc', 'volatile', 'allowzero',
- 'align', 'linksection', 'threadlocal'), suffix=r'\b'),
- Keyword.Reserved)
-
- structure_keywords = (
- words(('struct', 'enum', 'union', 'error'), suffix=r'\b'),
- Keyword)
-
- statement_keywords = (
- words(('break', 'return', 'continue', 'asm', 'defer', 'errdefer',
- 'unreachable', 'try', 'catch', 'async', 'await', 'suspend',
- 'resume', 'cancel'), suffix=r'\b'),
- Keyword)
-
- conditional_keywords = (
- words(('if', 'else', 'switch', 'and', 'or', 'orelse'), suffix=r'\b'),
- Keyword)
-
- repeat_keywords = (
- words(('while', 'for'), suffix=r'\b'),
- Keyword)
-
- other_keywords = (
- words(('fn', 'usingnamespace', 'test'), suffix=r'\b'),
- Keyword)
-
- constant_keywords = (
- words(('true', 'false', 'null', 'undefined'), suffix=r'\b'),
- Keyword.Constant)
-
- tokens = {
- 'root': [
- (r'\n', Whitespace),
- (r'\s+', Whitespace),
- (r'//.*?\n', Comment.Single),
-
- # Keywords
- statement_keywords,
- storage_keywords,
- structure_keywords,
- repeat_keywords,
- type_keywords,
- constant_keywords,
- conditional_keywords,
- other_keywords,
-
- # Floats
- (r'0x[0-9a-fA-F]+\.[0-9a-fA-F]+([pP][\-+]?[0-9a-fA-F]+)?', Number.Float),
- (r'0x[0-9a-fA-F]+\.?[pP][\-+]?[0-9a-fA-F]+', Number.Float),
- (r'[0-9]+\.[0-9]+([eE][-+]?[0-9]+)?', Number.Float),
- (r'[0-9]+\.?[eE][-+]?[0-9]+', Number.Float),
-
- # Integers
- (r'0b[01]+', Number.Bin),
- (r'0o[0-7]+', Number.Oct),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
-
- # Identifier
- (r'@[a-zA-Z_]\w*',Name.Builtin),
- (r'[a-zA-Z_]\w*', Name),
-
- # Characters
- (r'\'\\\'\'', String.Escape),
- (r'\'\\(|x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{6}|[nr\\t\'"])\'', String.Escape),
- (r'\'[^\\\']\'', String),
-
- # Strings
- (r'\\\\[^\n]*', String.Heredoc),
- (r'c\\\\[^\n]*', String.Heredoc),
- (r'c?"',String, 'string'),
-
- # Operators, Punctuation
- (r'[+%=><|^!?/\-*&~:]', Operator),
- (r'[{}()\[\],.;]', Punctuation)
- ],
- 'string': [
- (r'\\(x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{6}|[nr\\t\'"])', String.Escape),
- (r'[^\\"\n]+', String),
- (r'"', String, '#pop')
- ]
- }
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in \
- RegexLexer.get_tokens_unprocessed(self, text):
- yield index, token, value
diff --git a/pygments/modeline.py b/pygments/modeline.py
deleted file mode 100644
index 31b2e7fb..00000000
--- a/pygments/modeline.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.modeline
- ~~~~~~~~~~~~~~~~~
-
- A simple modeline parser (based on pymodeline).
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-
-__all__ = ['get_filetype_from_buffer']
-
-
-modeline_re = re.compile(r'''
- (?: vi | vim | ex ) (?: [<=>]? \d* )? :
- .* (?: ft | filetype | syn | syntax ) = ( [^:\s]+ )
-''', re.VERBOSE)
-
-
-def get_filetype_from_line(l):
- m = modeline_re.search(l)
- if m:
- return m.group(1)
-
-
-def get_filetype_from_buffer(buf, max_lines=5):
- """
- Scan the buffer for modelines and return filetype if one is found.
- """
- lines = buf.splitlines()
- for l in lines[-1:-max_lines-1:-1]:
- ret = get_filetype_from_line(l)
- if ret:
- return ret
- for i in range(max_lines, -1, -1):
- if i < len(lines):
- ret = get_filetype_from_line(lines[i])
- if ret:
- return ret
-
- return None
diff --git a/pygments/plugin.py b/pygments/plugin.py
deleted file mode 100644
index 3d185efc..00000000
--- a/pygments/plugin.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.plugin
- ~~~~~~~~~~~~~~~
-
- Pygments setuptools plugin interface. The methods defined
- here also work if setuptools isn't installed but they just
- return nothing.
-
- lexer plugins::
-
- [pygments.lexers]
- yourlexer = yourmodule:YourLexer
-
- formatter plugins::
-
- [pygments.formatters]
- yourformatter = yourformatter:YourFormatter
- /.ext = yourformatter:YourFormatter
-
- As you can see, you can define extensions for the formatter
- with a leading slash.
-
- syntax plugins::
-
- [pygments.styles]
- yourstyle = yourstyle:YourStyle
-
- filter plugin::
-
- [pygments.filter]
- yourfilter = yourfilter:YourFilter
-
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-LEXER_ENTRY_POINT = 'pygments.lexers'
-FORMATTER_ENTRY_POINT = 'pygments.formatters'
-STYLE_ENTRY_POINT = 'pygments.styles'
-FILTER_ENTRY_POINT = 'pygments.filters'
-
-
-def iter_entry_points(group_name):
- try:
- import pkg_resources
- except (ImportError, IOError):
- return []
-
- return pkg_resources.iter_entry_points(group_name)
-
-
-def find_plugin_lexers():
- for entrypoint in iter_entry_points(LEXER_ENTRY_POINT):
- yield entrypoint.load()
-
-
-def find_plugin_formatters():
- for entrypoint in iter_entry_points(FORMATTER_ENTRY_POINT):
- yield entrypoint.name, entrypoint.load()
-
-
-def find_plugin_styles():
- for entrypoint in iter_entry_points(STYLE_ENTRY_POINT):
- yield entrypoint.name, entrypoint.load()
-
-
-def find_plugin_filters():
- for entrypoint in iter_entry_points(FILTER_ENTRY_POINT):
- yield entrypoint.name, entrypoint.load()
diff --git a/pygments/regexopt.py b/pygments/regexopt.py
deleted file mode 100644
index 59d77ee0..00000000
--- a/pygments/regexopt.py
+++ /dev/null
@@ -1,92 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.regexopt
- ~~~~~~~~~~~~~~~~~
-
- An algorithm that generates optimized regexes for matching long lists of
- literal strings.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-from re import escape
-from os.path import commonprefix
-from itertools import groupby
-from operator import itemgetter
-
-CS_ESCAPE = re.compile(r'[\^\\\-\]]')
-FIRST_ELEMENT = itemgetter(0)
-
-
-def make_charset(letters):
- return '[' + CS_ESCAPE.sub(lambda m: '\\' + m.group(), ''.join(letters)) + ']'
-
-
-def regex_opt_inner(strings, open_paren):
- """Return a regex that matches any string in the sorted list of strings."""
- close_paren = open_paren and ')' or ''
- # print strings, repr(open_paren)
- if not strings:
- # print '-> nothing left'
- return ''
- first = strings[0]
- if len(strings) == 1:
- # print '-> only 1 string'
- return open_paren + escape(first) + close_paren
- if not first:
- # print '-> first string empty'
- return open_paren + regex_opt_inner(strings[1:], '(?:') \
- + '?' + close_paren
- if len(first) == 1:
- # multiple one-char strings? make a charset
- oneletter = []
- rest = []
- for s in strings:
- if len(s) == 1:
- oneletter.append(s)
- else:
- rest.append(s)
- if len(oneletter) > 1: # do we have more than one oneletter string?
- if rest:
- # print '-> 1-character + rest'
- return open_paren + regex_opt_inner(rest, '') + '|' \
- + make_charset(oneletter) + close_paren
- # print '-> only 1-character'
- return open_paren + make_charset(oneletter) + close_paren
- prefix = commonprefix(strings)
- if prefix:
- plen = len(prefix)
- # we have a prefix for all strings
- # print '-> prefix:', prefix
- return open_paren + escape(prefix) \
- + regex_opt_inner([s[plen:] for s in strings], '(?:') \
- + close_paren
- # is there a suffix?
- strings_rev = [s[::-1] for s in strings]
- suffix = commonprefix(strings_rev)
- if suffix:
- slen = len(suffix)
- # print '-> suffix:', suffix[::-1]
- return open_paren \
- + regex_opt_inner(sorted(s[:-slen] for s in strings), '(?:') \
- + escape(suffix[::-1]) + close_paren
- # recurse on common 1-string prefixes
- # print '-> last resort'
- return open_paren + \
- '|'.join(regex_opt_inner(list(group[1]), '')
- for group in groupby(strings, lambda s: s[0] == first[0])) \
- + close_paren
-
-
-def regex_opt(strings, prefix='', suffix=''):
- """Return a compiled regex that matches any string in the given list.
-
- The strings to match must be literal strings, not regexes. They will be
- regex-escaped.
-
- *prefix* and *suffix* are pre- and appended to the final regex.
- """
- strings = sorted(strings)
- return prefix + regex_opt_inner(strings, '(') + suffix
diff --git a/pygments/scanner.py b/pygments/scanner.py
deleted file mode 100644
index bcb19ed9..00000000
--- a/pygments/scanner.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.scanner
- ~~~~~~~~~~~~~~~~
-
- This library implements a regex based scanner. Some languages
- like Pascal are easy to parse but have some keywords that
- depend on the context. Because of this it's impossible to lex
- that just by using a regular expression lexer like the
- `RegexLexer`.
-
- Have a look at the `DelphiLexer` to get an idea of how to use
- this scanner.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-import re
-
-
-class EndOfText(RuntimeError):
- """
- Raise if end of text is reached and the user
- tried to call a match function.
- """
-
-
-class Scanner(object):
- """
- Simple scanner
-
- All method patterns are regular expression strings (not
- compiled expressions!)
- """
-
- def __init__(self, text, flags=0):
- """
- :param text: The text which should be scanned
- :param flags: default regular expression flags
- """
- self.data = text
- self.data_length = len(text)
- self.start_pos = 0
- self.pos = 0
- self.flags = flags
- self.last = None
- self.match = None
- self._re_cache = {}
-
- def eos(self):
- """`True` if the scanner reached the end of text."""
- return self.pos >= self.data_length
- eos = property(eos, eos.__doc__)
-
- def check(self, pattern):
- """
- Apply `pattern` on the current position and return
- the match object. (Doesn't touch pos). Use this for
- lookahead.
- """
- if self.eos:
- raise EndOfText()
- if pattern not in self._re_cache:
- self._re_cache[pattern] = re.compile(pattern, self.flags)
- return self._re_cache[pattern].match(self.data, self.pos)
-
- def test(self, pattern):
- """Apply a pattern on the current position and check
- if it patches. Doesn't touch pos.
- """
- return self.check(pattern) is not None
-
- def scan(self, pattern):
- """
- Scan the text for the given pattern and update pos/match
- and related fields. The return value is a boolen that
- indicates if the pattern matched. The matched value is
- stored on the instance as ``match``, the last value is
- stored as ``last``. ``start_pos`` is the position of the
- pointer before the pattern was matched, ``pos`` is the
- end position.
- """
- if self.eos:
- raise EndOfText()
- if pattern not in self._re_cache:
- self._re_cache[pattern] = re.compile(pattern, self.flags)
- self.last = self.match
- m = self._re_cache[pattern].match(self.data, self.pos)
- if m is None:
- return False
- self.start_pos = m.start()
- self.pos = m.end()
- self.match = m.group()
- return True
-
- def get_char(self):
- """Scan exactly one char."""
- self.scan('.')
-
- def __repr__(self):
- return '<%s %d/%d>' % (
- self.__class__.__name__,
- self.pos,
- self.data_length
- )
diff --git a/pygments/sphinxext.py b/pygments/sphinxext.py
deleted file mode 100644
index 282693e7..00000000
--- a/pygments/sphinxext.py
+++ /dev/null
@@ -1,158 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.sphinxext
- ~~~~~~~~~~~~~~~~~~
-
- Sphinx extension to generate automatic documentation of lexers,
- formatters and filters.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import sys
-
-from docutils import nodes
-from docutils.statemachine import ViewList
-from docutils.parsers.rst import Directive
-from sphinx.util.nodes import nested_parse_with_titles
-
-
-MODULEDOC = '''
-.. module:: %s
-
-%s
-%s
-'''
-
-LEXERDOC = '''
-.. class:: %s
-
- :Short names: %s
- :Filenames: %s
- :MIME types: %s
-
- %s
-
-'''
-
-FMTERDOC = '''
-.. class:: %s
-
- :Short names: %s
- :Filenames: %s
-
- %s
-
-'''
-
-FILTERDOC = '''
-.. class:: %s
-
- :Name: %s
-
- %s
-
-'''
-
-
-class PygmentsDoc(Directive):
- """
- A directive to collect all lexers/formatters/filters and generate
- autoclass directives for them.
- """
- has_content = False
- required_arguments = 1
- optional_arguments = 0
- final_argument_whitespace = False
- option_spec = {}
-
- def run(self):
- self.filenames = set()
- if self.arguments[0] == 'lexers':
- out = self.document_lexers()
- elif self.arguments[0] == 'formatters':
- out = self.document_formatters()
- elif self.arguments[0] == 'filters':
- out = self.document_filters()
- else:
- raise Exception('invalid argument for "pygmentsdoc" directive')
- node = nodes.compound()
- vl = ViewList(out.split('\n'), source='')
- nested_parse_with_titles(self.state, vl, node)
- for fn in self.filenames:
- self.state.document.settings.record_dependencies.add(fn)
- return node.children
-
- def document_lexers(self):
- from pygments.lexers._mapping import LEXERS
- out = []
- modules = {}
- moduledocstrings = {}
- for classname, data in sorted(LEXERS.items(), key=lambda x: x[0]):
- module = data[0]
- mod = __import__(module, None, None, [classname])
- self.filenames.add(mod.__file__)
- cls = getattr(mod, classname)
- if not cls.__doc__:
- print("Warning: %s does not have a docstring." % classname)
- docstring = cls.__doc__
- if isinstance(docstring, bytes):
- docstring = docstring.decode('utf8')
- modules.setdefault(module, []).append((
- classname,
- ', '.join(data[2]) or 'None',
- ', '.join(data[3]).replace('*', '\\*').replace('_', '\\') or 'None',
- ', '.join(data[4]) or 'None',
- docstring))
- if module not in moduledocstrings:
- moddoc = mod.__doc__
- if isinstance(moddoc, bytes):
- moddoc = moddoc.decode('utf8')
- moduledocstrings[module] = moddoc
-
- for module, lexers in sorted(modules.items(), key=lambda x: x[0]):
- if moduledocstrings[module] is None:
- raise Exception("Missing docstring for %s" % (module,))
- heading = moduledocstrings[module].splitlines()[4].strip().rstrip('.')
- out.append(MODULEDOC % (module, heading, '-'*len(heading)))
- for data in lexers:
- out.append(LEXERDOC % data)
-
- return ''.join(out)
-
- def document_formatters(self):
- from pygments.formatters import FORMATTERS
-
- out = []
- for classname, data in sorted(FORMATTERS.items(), key=lambda x: x[0]):
- module = data[0]
- mod = __import__(module, None, None, [classname])
- self.filenames.add(mod.__file__)
- cls = getattr(mod, classname)
- docstring = cls.__doc__
- if isinstance(docstring, bytes):
- docstring = docstring.decode('utf8')
- heading = cls.__name__
- out.append(FMTERDOC % (heading, ', '.join(data[2]) or 'None',
- ', '.join(data[3]).replace('*', '\\*') or 'None',
- docstring))
- return ''.join(out)
-
- def document_filters(self):
- from pygments.filters import FILTERS
-
- out = []
- for name, cls in FILTERS.items():
- self.filenames.add(sys.modules[cls.__module__].__file__)
- docstring = cls.__doc__
- if isinstance(docstring, bytes):
- docstring = docstring.decode('utf8')
- out.append(FILTERDOC % (cls.__name__, name, docstring))
- return ''.join(out)
-
-
-def setup(app):
- app.add_directive('pygmentsdoc', PygmentsDoc)
diff --git a/pygments/style.py b/pygments/style.py
deleted file mode 100644
index 73264577..00000000
--- a/pygments/style.py
+++ /dev/null
@@ -1,182 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.style
- ~~~~~~~~~~~~~~
-
- Basic style object.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.token import Token, STANDARD_TYPES
-from pygments.util import add_metaclass
-
-# Default mapping of ansixxx to RGB colors.
-_ansimap = {
- # dark
- 'ansiblack': '000000',
- 'ansired': '7f0000',
- 'ansigreen': '007f00',
- 'ansiyellow': '7f7fe0',
- 'ansiblue': '00007f',
- 'ansimagenta': '7f007f',
- 'ansicyan': '007f7f',
- 'ansigray': 'e5e5e5',
- # normal
- 'ansibrightblack': '555555',
- 'ansibrightred': 'ff0000',
- 'ansibrightgreen': '00ff00',
- 'ansibrightyellow': 'ffff00',
- 'ansibrightblue': '0000ff',
- 'ansibrightmagenta': 'ff00ff',
- 'ansibrightcyan': '00ffff',
- 'ansiwhite': 'ffffff',
-}
-# mapping of deprecated #ansixxx colors to new color names
-_deprecated_ansicolors = {
- # dark
- '#ansiblack': 'ansiblack',
- '#ansidarkred': 'ansired',
- '#ansidarkgreen': 'ansigreen',
- '#ansibrown': 'ansiyellow',
- '#ansidarkblue': 'ansiblue',
- '#ansipurple': 'ansimagenta',
- '#ansiteal': 'ansicyan',
- '#ansilightgray': 'ansigray',
- # normal
- '#ansidarkgray': 'ansibrightblack',
- '#ansired': 'ansibrightred',
- '#ansigreen': 'ansibrightgreen',
- '#ansiyellow': 'ansibrightyellow',
- '#ansiblue': 'ansibrightblue',
- '#ansifuchsia': 'ansibrightmagenta',
- '#ansiturquoise': 'ansibrightcyan',
- '#ansiwhite': 'ansiwhite',
-}
-ansicolors = set(_ansimap)
-
-
-class StyleMeta(type):
-
- def __new__(mcs, name, bases, dct):
- obj = type.__new__(mcs, name, bases, dct)
- for token in STANDARD_TYPES:
- if token not in obj.styles:
- obj.styles[token] = ''
-
- def colorformat(text):
- if text in ansicolors:
- return text
- if text[0:1] == '#':
- col = text[1:]
- if len(col) == 6:
- return col
- elif len(col) == 3:
- return col[0] * 2 + col[1] * 2 + col[2] * 2
- elif text == '':
- return ''
- elif text.startswith('var') or text.startswith('calc'):
- return text
- assert False, "wrong color format %r" % text
-
- _styles = obj._styles = {}
-
- for ttype in obj.styles:
- for token in ttype.split():
- if token in _styles:
- continue
- ndef = _styles.get(token.parent, None)
- styledefs = obj.styles.get(token, '').split()
- if not ndef or token is None:
- ndef = ['', 0, 0, 0, '', '', 0, 0, 0]
- elif 'noinherit' in styledefs and token is not Token:
- ndef = _styles[Token][:]
- else:
- ndef = ndef[:]
- _styles[token] = ndef
- for styledef in obj.styles.get(token, '').split():
- if styledef == 'noinherit':
- pass
- elif styledef == 'bold':
- ndef[1] = 1
- elif styledef == 'nobold':
- ndef[1] = 0
- elif styledef == 'italic':
- ndef[2] = 1
- elif styledef == 'noitalic':
- ndef[2] = 0
- elif styledef == 'underline':
- ndef[3] = 1
- elif styledef == 'nounderline':
- ndef[3] = 0
- elif styledef[:3] == 'bg:':
- ndef[4] = colorformat(styledef[3:])
- elif styledef[:7] == 'border:':
- ndef[5] = colorformat(styledef[7:])
- elif styledef == 'roman':
- ndef[6] = 1
- elif styledef == 'sans':
- ndef[7] = 1
- elif styledef == 'mono':
- ndef[8] = 1
- else:
- ndef[0] = colorformat(styledef)
-
- return obj
-
- def style_for_token(cls, token):
- t = cls._styles[token]
- ansicolor = bgansicolor = None
- color = t[0]
- if color in _deprecated_ansicolors:
- color = _deprecated_ansicolors[color]
- if color in ansicolors:
- ansicolor = color
- color = _ansimap[color]
- bgcolor = t[4]
- if bgcolor in _deprecated_ansicolors:
- bgcolor = _deprecated_ansicolors[color]
- if bgcolor in ansicolors:
- bgansicolor = bgcolor
- bgcolor = _ansimap[bgcolor]
-
- return {
- 'color': color or None,
- 'bold': bool(t[1]),
- 'italic': bool(t[2]),
- 'underline': bool(t[3]),
- 'bgcolor': bgcolor or None,
- 'border': t[5] or None,
- 'roman': bool(t[6]) or None,
- 'sans': bool(t[7]) or None,
- 'mono': bool(t[8]) or None,
- 'ansicolor': ansicolor,
- 'bgansicolor': bgansicolor,
- }
-
- def list_styles(cls):
- return list(cls)
-
- def styles_token(cls, ttype):
- return ttype in cls._styles
-
- def __iter__(cls):
- for token in cls._styles:
- yield token, cls.style_for_token(token)
-
- def __len__(cls):
- return len(cls._styles)
-
-
-@add_metaclass(StyleMeta)
-class Style(object):
-
- #: overall background color (``None`` means transparent)
- background_color = '#ffffff'
-
- #: highlight background color
- highlight_color = '#ffffcc'
-
- #: Style definitions for individual token types.
- styles = {}
diff --git a/pygments/styles/__init__.py b/pygments/styles/__init__.py
deleted file mode 100644
index 8de9e43b..00000000
--- a/pygments/styles/__init__.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles
- ~~~~~~~~~~~~~~~
-
- Contains built-in styles.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.plugin import find_plugin_styles
-from pygments.util import ClassNotFound
-
-
-#: Maps style names to 'submodule::classname'.
-STYLE_MAP = {
- 'default': 'default::DefaultStyle',
- 'emacs': 'emacs::EmacsStyle',
- 'friendly': 'friendly::FriendlyStyle',
- 'colorful': 'colorful::ColorfulStyle',
- 'autumn': 'autumn::AutumnStyle',
- 'murphy': 'murphy::MurphyStyle',
- 'manni': 'manni::ManniStyle',
- 'monokai': 'monokai::MonokaiStyle',
- 'perldoc': 'perldoc::PerldocStyle',
- 'pastie': 'pastie::PastieStyle',
- 'borland': 'borland::BorlandStyle',
- 'trac': 'trac::TracStyle',
- 'native': 'native::NativeStyle',
- 'fruity': 'fruity::FruityStyle',
- 'bw': 'bw::BlackWhiteStyle',
- 'vim': 'vim::VimStyle',
- 'vs': 'vs::VisualStudioStyle',
- 'tango': 'tango::TangoStyle',
- 'rrt': 'rrt::RrtStyle',
- 'xcode': 'xcode::XcodeStyle',
- 'igor': 'igor::IgorStyle',
- 'paraiso-light': 'paraiso_light::ParaisoLightStyle',
- 'paraiso-dark': 'paraiso_dark::ParaisoDarkStyle',
- 'lovelace': 'lovelace::LovelaceStyle',
- 'algol': 'algol::AlgolStyle',
- 'algol_nu': 'algol_nu::Algol_NuStyle',
- 'arduino': 'arduino::ArduinoStyle',
- 'rainbow_dash': 'rainbow_dash::RainbowDashStyle',
- 'abap': 'abap::AbapStyle',
- 'solarized-dark': 'solarized::SolarizedDarkStyle',
- 'solarized-light': 'solarized::SolarizedLightStyle',
- 'sas': 'sas::SasStyle',
- 'stata': 'stata_light::StataLightStyle',
- 'stata-light': 'stata_light::StataLightStyle',
- 'stata-dark': 'stata_dark::StataDarkStyle',
-}
-
-
-def get_style_by_name(name):
- if name in STYLE_MAP:
- mod, cls = STYLE_MAP[name].split('::')
- builtin = "yes"
- else:
- for found_name, style in find_plugin_styles():
- if name == found_name:
- return style
- # perhaps it got dropped into our styles package
- builtin = ""
- mod = name
- cls = name.title() + "Style"
-
- try:
- mod = __import__('pygments.styles.' + mod, None, None, [cls])
- except ImportError:
- raise ClassNotFound("Could not find style module %r" % mod +
- (builtin and ", though it should be builtin") + ".")
- try:
- return getattr(mod, cls)
- except AttributeError:
- raise ClassNotFound("Could not find style class %r in style module." % cls)
-
-
-def get_all_styles():
- """Return an generator for all styles by name,
- both builtin and plugin."""
- for name in STYLE_MAP:
- yield name
- for name, _ in find_plugin_styles():
- yield name
diff --git a/pygments/styles/abap.py b/pygments/styles/abap.py
deleted file mode 100644
index d0622d29..00000000
--- a/pygments/styles/abap.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.abap
- ~~~~~~~~~~~~~~~~~~~~
-
- ABAP workbench like style.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator
-
-
-class AbapStyle(Style):
- default_style = ""
- styles = {
- Comment: 'italic #888',
- Comment.Special: '#888',
- Keyword: '#00f',
- Operator.Word: '#00f',
- Name: '#000',
- Number: '#3af',
- String: '#5a2',
-
- Error: '#F00',
- }
diff --git a/pygments/styles/algol.py b/pygments/styles/algol.py
deleted file mode 100644
index d4d91870..00000000
--- a/pygments/styles/algol.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.algol
- ~~~~~~~~~~~~~~~~~~~~~
-
- Algol publication style.
-
- This style renders source code for publication of algorithms in
- scientific papers and academic texts, where its format is frequently used.
-
- It is based on the style of the revised Algol-60 language report[1].
-
- o No colours, only black, white and shades of grey are used.
- o Keywords are rendered in lowercase underline boldface.
- o Builtins are rendered in lowercase boldface italic.
- o Docstrings and pragmas are rendered in dark grey boldface.
- o Library identifiers are rendered in dark grey boldface italic.
- o Comments are rendered in grey italic.
-
- To render keywords without underlining, refer to the `Algol_Nu` style.
-
- For lowercase conversion of keywords and builtins in languages where
- these are not or might not be lowercase, a supporting lexer is required.
- The Algol and Modula-2 lexers automatically convert to lowercase whenever
- this style is selected.
-
- [1] `Revised Report on the Algorithmic Language Algol-60 <http://www.masswerk.at/algol60/report.htm>`
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, Operator
-
-
-class AlgolStyle(Style):
-
- background_color = "#ffffff"
- default_style = ""
-
- styles = {
- Comment: "italic #888",
- Comment.Preproc: "bold noitalic #888",
- Comment.Special: "bold noitalic #888",
-
- Keyword: "underline bold",
- Keyword.Declaration: "italic",
-
- Name.Builtin: "bold italic",
- Name.Builtin.Pseudo: "bold italic",
- Name.Namespace: "bold italic #666",
- Name.Class: "bold italic #666",
- Name.Function: "bold italic #666",
- Name.Variable: "bold italic #666",
- Name.Constant: "bold italic #666",
-
- Operator.Word: "bold",
-
- String: "italic #666",
-
- Error: "border:#FF0000"
- }
diff --git a/pygments/styles/algol_nu.py b/pygments/styles/algol_nu.py
deleted file mode 100644
index 09d69452..00000000
--- a/pygments/styles/algol_nu.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.algol_nu
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Algol publication style without underlining of keywords.
-
- This style renders source code for publication of algorithms in
- scientific papers and academic texts, where its format is frequently used.
-
- It is based on the style of the revised Algol-60 language report[1].
-
- o No colours, only black, white and shades of grey are used.
- o Keywords are rendered in lowercase boldface.
- o Builtins are rendered in lowercase boldface italic.
- o Docstrings and pragmas are rendered in dark grey boldface.
- o Library identifiers are rendered in dark grey boldface italic.
- o Comments are rendered in grey italic.
-
- To render keywords with underlining, refer to the `Algol` style.
-
- For lowercase conversion of keywords and builtins in languages where
- these are not or might not be lowercase, a supporting lexer is required.
- The Algol and Modula-2 lexers automatically convert to lowercase whenever
- this style is selected.
-
- [1] `Revised Report on the Algorithmic Language Algol-60 <http://www.masswerk.at/algol60/report.htm>`
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, Operator
-
-
-class Algol_NuStyle(Style):
-
- background_color = "#ffffff"
- default_style = ""
-
- styles = {
- Comment: "italic #888",
- Comment.Preproc: "bold noitalic #888",
- Comment.Special: "bold noitalic #888",
-
- Keyword: "bold",
- Keyword.Declaration: "italic",
-
- Name.Builtin: "bold italic",
- Name.Builtin.Pseudo: "bold italic",
- Name.Namespace: "bold italic #666",
- Name.Class: "bold italic #666",
- Name.Function: "bold italic #666",
- Name.Variable: "bold italic #666",
- Name.Constant: "bold italic #666",
-
- Operator.Word: "bold",
-
- String: "italic #666",
-
- Error: "border:#FF0000"
- }
diff --git a/pygments/styles/arduino.py b/pygments/styles/arduino.py
deleted file mode 100644
index 160ca094..00000000
--- a/pygments/styles/arduino.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.arduino
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Arduino® Syntax highlighting style.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class ArduinoStyle(Style):
- u"""
- The Arduino® language style. This style is designed to highlight the
- Arduino source code, so exepect the best results with it.
- """
-
- background_color = "#ffffff"
- default_style = ""
-
- styles = {
- Whitespace: "", # class: 'w'
- Error: "#a61717", # class: 'err'
-
- Comment: "#95a5a6", # class: 'c'
- Comment.Multiline: "", # class: 'cm'
- Comment.Preproc: "#728E00", # class: 'cp'
- Comment.Single: "", # class: 'c1'
- Comment.Special: "", # class: 'cs'
-
- Keyword: "#728E00", # class: 'k'
- Keyword.Constant: "#00979D", # class: 'kc'
- Keyword.Declaration: "", # class: 'kd'
- Keyword.Namespace: "", # class: 'kn'
- Keyword.Pseudo: "#00979D", # class: 'kp'
- Keyword.Reserved: "#00979D", # class: 'kr'
- Keyword.Type: "#00979D", # class: 'kt'
-
- Operator: "#728E00", # class: 'o'
- Operator.Word: "", # class: 'ow'
-
- Name: "#434f54", # class: 'n'
- Name.Attribute: "", # class: 'na'
- Name.Builtin: "#728E00", # class: 'nb'
- Name.Builtin.Pseudo: "", # class: 'bp'
- Name.Class: "", # class: 'nc'
- Name.Constant: "", # class: 'no'
- Name.Decorator: "", # class: 'nd'
- Name.Entity: "", # class: 'ni'
- Name.Exception: "", # class: 'ne'
- Name.Function: "#D35400", # class: 'nf'
- Name.Property: "", # class: 'py'
- Name.Label: "", # class: 'nl'
- Name.Namespace: "", # class: 'nn'
- Name.Other: "#728E00", # class: 'nx'
- Name.Tag: "", # class: 'nt'
- Name.Variable: "", # class: 'nv'
- Name.Variable.Class: "", # class: 'vc'
- Name.Variable.Global: "", # class: 'vg'
- Name.Variable.Instance: "", # class: 'vi'
-
- Number: "#8A7B52", # class: 'm'
- Number.Float: "", # class: 'mf'
- Number.Hex: "", # class: 'mh'
- Number.Integer: "", # class: 'mi'
- Number.Integer.Long: "", # class: 'il'
- Number.Oct: "", # class: 'mo'
-
- String: "#7F8C8D", # class: 's'
- String.Backtick: "", # class: 'sb'
- String.Char: "", # class: 'sc'
- String.Doc: "", # class: 'sd'
- String.Double: "", # class: 's2'
- String.Escape: "", # class: 'se'
- String.Heredoc: "", # class: 'sh'
- String.Interpol: "", # class: 'si'
- String.Other: "", # class: 'sx'
- String.Regex: "", # class: 'sr'
- String.Single: "", # class: 's1'
- String.Symbol: "", # class: 'ss'
-
- Generic: "", # class: 'g'
- Generic.Deleted: "", # class: 'gd',
- Generic.Emph: "", # class: 'ge'
- Generic.Error: "", # class: 'gr'
- Generic.Heading: "", # class: 'gh'
- Generic.Inserted: "", # class: 'gi'
- Generic.Output: "", # class: 'go'
- Generic.Prompt: "", # class: 'gp'
- Generic.Strong: "", # class: 'gs'
- Generic.Subheading: "", # class: 'gu'
- Generic.Traceback: "", # class: 'gt'
- }
diff --git a/pygments/styles/autumn.py b/pygments/styles/autumn.py
deleted file mode 100644
index d5ee045d..00000000
--- a/pygments/styles/autumn.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.autumn
- ~~~~~~~~~~~~~~~~~~~~~~
-
- A colorful style, inspired by the terminal highlighting style.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class AutumnStyle(Style):
- """
- A colorful style, inspired by the terminal highlighting style.
- """
-
- default_style = ""
-
- styles = {
- Whitespace: '#bbbbbb',
-
- Comment: 'italic #aaaaaa',
- Comment.Preproc: 'noitalic #4c8317',
- Comment.Special: 'italic #0000aa',
-
- Keyword: '#0000aa',
- Keyword.Type: '#00aaaa',
-
- Operator.Word: '#0000aa',
-
- Name.Builtin: '#00aaaa',
- Name.Function: '#00aa00',
- Name.Class: 'underline #00aa00',
- Name.Namespace: 'underline #00aaaa',
- Name.Variable: '#aa0000',
- Name.Constant: '#aa0000',
- Name.Entity: 'bold #800',
- Name.Attribute: '#1e90ff',
- Name.Tag: 'bold #1e90ff',
- Name.Decorator: '#888888',
-
- String: '#aa5500',
- String.Symbol: '#0000aa',
- String.Regex: '#009999',
-
- Number: '#009999',
-
- Generic.Heading: 'bold #000080',
- Generic.Subheading: 'bold #800080',
- Generic.Deleted: '#aa0000',
- Generic.Inserted: '#00aa00',
- Generic.Error: '#aa0000',
- Generic.Emph: 'italic',
- Generic.Strong: 'bold',
- Generic.Prompt: '#555555',
- Generic.Output: '#888888',
- Generic.Traceback: '#aa0000',
-
- Error: '#F00 bg:#FAA'
- }
diff --git a/pygments/styles/borland.py b/pygments/styles/borland.py
deleted file mode 100644
index e8ec1229..00000000
--- a/pygments/styles/borland.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.borland
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Style similar to the style used in the Borland IDEs.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class BorlandStyle(Style):
- """
- Style similar to the style used in the borland IDEs.
- """
-
- default_style = ''
-
- styles = {
- Whitespace: '#bbbbbb',
-
- Comment: 'italic #008800',
- Comment.Preproc: 'noitalic #008080',
- Comment.Special: 'noitalic bold',
-
- String: '#0000FF',
- String.Char: '#800080',
- Number: '#0000FF',
- Keyword: 'bold #000080',
- Operator.Word: 'bold',
- Name.Tag: 'bold #000080',
- Name.Attribute: '#FF0000',
-
- Generic.Heading: '#999999',
- Generic.Subheading: '#aaaaaa',
- Generic.Deleted: 'bg:#ffdddd #000000',
- Generic.Inserted: 'bg:#ddffdd #000000',
- Generic.Error: '#aa0000',
- Generic.Emph: 'italic',
- Generic.Strong: 'bold',
- Generic.Prompt: '#555555',
- Generic.Output: '#888888',
- Generic.Traceback: '#aa0000',
-
- Error: 'bg:#e3d2d2 #a61717'
- }
diff --git a/pygments/styles/bw.py b/pygments/styles/bw.py
deleted file mode 100644
index 54a653b6..00000000
--- a/pygments/styles/bw.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.bw
- ~~~~~~~~~~~~~~~~~~
-
- Simple black/white only style.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Operator, Generic
-
-
-class BlackWhiteStyle(Style):
-
- background_color = "#ffffff"
- default_style = ""
-
- styles = {
- Comment: "italic",
- Comment.Preproc: "noitalic",
-
- Keyword: "bold",
- Keyword.Pseudo: "nobold",
- Keyword.Type: "nobold",
-
- Operator.Word: "bold",
-
- Name.Class: "bold",
- Name.Namespace: "bold",
- Name.Exception: "bold",
- Name.Entity: "bold",
- Name.Tag: "bold",
-
- String: "italic",
- String.Interpol: "bold",
- String.Escape: "bold",
-
- Generic.Heading: "bold",
- Generic.Subheading: "bold",
- Generic.Emph: "italic",
- Generic.Strong: "bold",
- Generic.Prompt: "bold",
-
- Error: "border:#FF0000"
- }
diff --git a/pygments/styles/colorful.py b/pygments/styles/colorful.py
deleted file mode 100644
index 6aa493c9..00000000
--- a/pygments/styles/colorful.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.colorful
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- A colorful style, inspired by CodeRay.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class ColorfulStyle(Style):
- """
- A colorful style, inspired by CodeRay.
- """
-
- default_style = ""
-
- styles = {
- Whitespace: "#bbbbbb",
-
- Comment: "#888",
- Comment.Preproc: "#579",
- Comment.Special: "bold #cc0000",
-
- Keyword: "bold #080",
- Keyword.Pseudo: "#038",
- Keyword.Type: "#339",
-
- Operator: "#333",
- Operator.Word: "bold #000",
-
- Name.Builtin: "#007020",
- Name.Function: "bold #06B",
- Name.Class: "bold #B06",
- Name.Namespace: "bold #0e84b5",
- Name.Exception: "bold #F00",
- Name.Variable: "#963",
- Name.Variable.Instance: "#33B",
- Name.Variable.Class: "#369",
- Name.Variable.Global: "bold #d70",
- Name.Constant: "bold #036",
- Name.Label: "bold #970",
- Name.Entity: "bold #800",
- Name.Attribute: "#00C",
- Name.Tag: "#070",
- Name.Decorator: "bold #555",
-
- String: "bg:#fff0f0",
- String.Char: "#04D bg:",
- String.Doc: "#D42 bg:",
- String.Interpol: "bg:#eee",
- String.Escape: "bold #666",
- String.Regex: "bg:#fff0ff #000",
- String.Symbol: "#A60 bg:",
- String.Other: "#D20",
-
- Number: "bold #60E",
- Number.Integer: "bold #00D",
- Number.Float: "bold #60E",
- Number.Hex: "bold #058",
- Number.Oct: "bold #40E",
-
- Generic.Heading: "bold #000080",
- Generic.Subheading: "bold #800080",
- Generic.Deleted: "#A00000",
- Generic.Inserted: "#00A000",
- Generic.Error: "#FF0000",
- Generic.Emph: "italic",
- Generic.Strong: "bold",
- Generic.Prompt: "bold #c65d09",
- Generic.Output: "#888",
- Generic.Traceback: "#04D",
-
- Error: "#F00 bg:#FAA"
- }
diff --git a/pygments/styles/default.py b/pygments/styles/default.py
deleted file mode 100644
index c93d29fc..00000000
--- a/pygments/styles/default.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.default
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- The default highlighting style.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class DefaultStyle(Style):
- """
- The default style (inspired by Emacs 22).
- """
-
- background_color = "#f8f8f8"
- default_style = ""
-
- styles = {
- Whitespace: "#bbbbbb",
- Comment: "italic #408080",
- Comment.Preproc: "noitalic #BC7A00",
-
- #Keyword: "bold #AA22FF",
- Keyword: "bold #008000",
- Keyword.Pseudo: "nobold",
- Keyword.Type: "nobold #B00040",
-
- Operator: "#666666",
- Operator.Word: "bold #AA22FF",
-
- Name.Builtin: "#008000",
- Name.Function: "#0000FF",
- Name.Class: "bold #0000FF",
- Name.Namespace: "bold #0000FF",
- Name.Exception: "bold #D2413A",
- Name.Variable: "#19177C",
- Name.Constant: "#880000",
- Name.Label: "#A0A000",
- Name.Entity: "bold #999999",
- Name.Attribute: "#7D9029",
- Name.Tag: "bold #008000",
- Name.Decorator: "#AA22FF",
-
- String: "#BA2121",
- String.Doc: "italic",
- String.Interpol: "bold #BB6688",
- String.Escape: "bold #BB6622",
- String.Regex: "#BB6688",
- #String.Symbol: "#B8860B",
- String.Symbol: "#19177C",
- String.Other: "#008000",
- Number: "#666666",
-
- Generic.Heading: "bold #000080",
- Generic.Subheading: "bold #800080",
- Generic.Deleted: "#A00000",
- Generic.Inserted: "#00A000",
- Generic.Error: "#FF0000",
- Generic.Emph: "italic",
- Generic.Strong: "bold",
- Generic.Prompt: "bold #000080",
- Generic.Output: "#888",
- Generic.Traceback: "#04D",
-
- Error: "border:#FF0000"
- }
diff --git a/pygments/styles/emacs.py b/pygments/styles/emacs.py
deleted file mode 100644
index 8408b09a..00000000
--- a/pygments/styles/emacs.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.emacs
- ~~~~~~~~~~~~~~~~~~~~~
-
- A highlighting style for Pygments, inspired by Emacs.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class EmacsStyle(Style):
- """
- The default style (inspired by Emacs 22).
- """
-
- background_color = "#f8f8f8"
- default_style = ""
-
- styles = {
- Whitespace: "#bbbbbb",
- Comment: "italic #008800",
- Comment.Preproc: "noitalic",
- Comment.Special: "noitalic bold",
-
- Keyword: "bold #AA22FF",
- Keyword.Pseudo: "nobold",
- Keyword.Type: "bold #00BB00",
-
- Operator: "#666666",
- Operator.Word: "bold #AA22FF",
-
- Name.Builtin: "#AA22FF",
- Name.Function: "#00A000",
- Name.Class: "#0000FF",
- Name.Namespace: "bold #0000FF",
- Name.Exception: "bold #D2413A",
- Name.Variable: "#B8860B",
- Name.Constant: "#880000",
- Name.Label: "#A0A000",
- Name.Entity: "bold #999999",
- Name.Attribute: "#BB4444",
- Name.Tag: "bold #008000",
- Name.Decorator: "#AA22FF",
-
- String: "#BB4444",
- String.Doc: "italic",
- String.Interpol: "bold #BB6688",
- String.Escape: "bold #BB6622",
- String.Regex: "#BB6688",
- String.Symbol: "#B8860B",
- String.Other: "#008000",
- Number: "#666666",
-
- Generic.Heading: "bold #000080",
- Generic.Subheading: "bold #800080",
- Generic.Deleted: "#A00000",
- Generic.Inserted: "#00A000",
- Generic.Error: "#FF0000",
- Generic.Emph: "italic",
- Generic.Strong: "bold",
- Generic.Prompt: "bold #000080",
- Generic.Output: "#888",
- Generic.Traceback: "#04D",
-
- Error: "border:#FF0000"
- }
diff --git a/pygments/styles/friendly.py b/pygments/styles/friendly.py
deleted file mode 100644
index 4184a8e3..00000000
--- a/pygments/styles/friendly.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.friendly
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- A modern style based on the VIM pyte theme.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class FriendlyStyle(Style):
- """
- A modern style based on the VIM pyte theme.
- """
-
- background_color = "#f0f0f0"
- default_style = ""
-
- styles = {
- Whitespace: "#bbbbbb",
- Comment: "italic #60a0b0",
- Comment.Preproc: "noitalic #007020",
- Comment.Special: "noitalic bg:#fff0f0",
-
- Keyword: "bold #007020",
- Keyword.Pseudo: "nobold",
- Keyword.Type: "nobold #902000",
-
- Operator: "#666666",
- Operator.Word: "bold #007020",
-
- Name.Builtin: "#007020",
- Name.Function: "#06287e",
- Name.Class: "bold #0e84b5",
- Name.Namespace: "bold #0e84b5",
- Name.Exception: "#007020",
- Name.Variable: "#bb60d5",
- Name.Constant: "#60add5",
- Name.Label: "bold #002070",
- Name.Entity: "bold #d55537",
- Name.Attribute: "#4070a0",
- Name.Tag: "bold #062873",
- Name.Decorator: "bold #555555",
-
- String: "#4070a0",
- String.Doc: "italic",
- String.Interpol: "italic #70a0d0",
- String.Escape: "bold #4070a0",
- String.Regex: "#235388",
- String.Symbol: "#517918",
- String.Other: "#c65d09",
- Number: "#40a070",
-
- Generic.Heading: "bold #000080",
- Generic.Subheading: "bold #800080",
- Generic.Deleted: "#A00000",
- Generic.Inserted: "#00A000",
- Generic.Error: "#FF0000",
- Generic.Emph: "italic",
- Generic.Strong: "bold",
- Generic.Prompt: "bold #c65d09",
- Generic.Output: "#888",
- Generic.Traceback: "#04D",
-
- Error: "border:#FF0000"
- }
diff --git a/pygments/styles/fruity.py b/pygments/styles/fruity.py
deleted file mode 100644
index 7f5c0e3f..00000000
--- a/pygments/styles/fruity.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.fruity
- ~~~~~~~~~~~~~~~~~~~~~~
-
- pygments version of my "fruity" vim theme.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Token, Comment, Name, Keyword, \
- Generic, Number, String, Whitespace
-
-class FruityStyle(Style):
- """
- Pygments version of the "native" vim theme.
- """
-
- background_color = '#111111'
- highlight_color = '#333333'
-
- styles = {
- Whitespace: '#888888',
- Token: '#ffffff',
- Generic.Output: '#444444 bg:#222222',
- Keyword: '#fb660a bold',
- Keyword.Pseudo: 'nobold',
- Number: '#0086f7 bold',
- Name.Tag: '#fb660a bold',
- Name.Variable: '#fb660a',
- Comment: '#008800 bg:#0f140f italic',
- Name.Attribute: '#ff0086 bold',
- String: '#0086d2',
- Name.Function: '#ff0086 bold',
- Generic.Heading: '#ffffff bold',
- Keyword.Type: '#cdcaa9 bold',
- Generic.Subheading: '#ffffff bold',
- Name.Constant: '#0086d2',
- Comment.Preproc: '#ff0007 bold'
- }
diff --git a/pygments/styles/igor.py b/pygments/styles/igor.py
deleted file mode 100644
index 70ee38bc..00000000
--- a/pygments/styles/igor.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.igor
- ~~~~~~~~~~~~~~~~~~~~
-
- Igor Pro default style.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String
-
-
-class IgorStyle(Style):
- """
- Pygments version of the official colors for Igor Pro procedures.
- """
- default_style = ""
-
- styles = {
- Comment: 'italic #FF0000',
- Keyword: '#0000FF',
- Name.Function: '#C34E00',
- Name.Decorator: '#CC00A3',
- Name.Class: '#007575',
- String: '#009C00'
- }
diff --git a/pygments/styles/lovelace.py b/pygments/styles/lovelace.py
deleted file mode 100644
index 65b641ec..00000000
--- a/pygments/styles/lovelace.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.lovelace
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Lovelace by Miikka Salminen
-
- Pygments style by Miikka Salminen (https://github.com/miikkas)
- A desaturated, somewhat subdued style created for the Lovelace interactive
- learning environment.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Punctuation, Generic, Whitespace
-
-
-class LovelaceStyle(Style):
- """
- The style used in Lovelace interactive learning environment. Tries to avoid
- the "angry fruit salad" effect with desaturated and dim colours.
- """
- _KW_BLUE = '#2838b0'
- _NAME_GREEN = '#388038'
- _DOC_ORANGE = '#b85820'
- _OW_PURPLE = '#a848a8'
- _FUN_BROWN = '#785840'
- _STR_RED = '#b83838'
- _CLS_CYAN = '#287088'
- _ESCAPE_LIME = '#709030'
- _LABEL_CYAN = '#289870'
- _EXCEPT_YELLOW = '#908828'
-
- default_style = '#222222'
-
- styles = {
- Whitespace: '#a89028',
- Comment: 'italic #888888',
- Comment.Hashbang: _CLS_CYAN,
- Comment.Multiline: '#888888',
- Comment.Preproc: 'noitalic '+_LABEL_CYAN,
-
- Keyword: _KW_BLUE,
- Keyword.Constant: 'italic #444444',
- Keyword.Declaration: 'italic',
- Keyword.Type: 'italic',
-
- Operator: '#666666',
- Operator.Word: _OW_PURPLE,
-
- Punctuation: '#888888',
-
- Name.Attribute: _NAME_GREEN,
- Name.Builtin: _NAME_GREEN,
- Name.Builtin.Pseudo: 'italic',
- Name.Class: _CLS_CYAN,
- Name.Constant: _DOC_ORANGE,
- Name.Decorator: _CLS_CYAN,
- Name.Entity: _ESCAPE_LIME,
- Name.Exception: _EXCEPT_YELLOW,
- Name.Function: _FUN_BROWN,
- Name.Function.Magic: _DOC_ORANGE,
- Name.Label: _LABEL_CYAN,
- Name.Namespace: _LABEL_CYAN,
- Name.Tag: _KW_BLUE,
- Name.Variable: '#b04040',
- Name.Variable.Global:_EXCEPT_YELLOW,
- Name.Variable.Magic: _DOC_ORANGE,
-
- String: _STR_RED,
- String.Affix: '#444444',
- String.Char: _OW_PURPLE,
- String.Delimiter: _DOC_ORANGE,
- String.Doc: 'italic '+_DOC_ORANGE,
- String.Escape: _ESCAPE_LIME,
- String.Interpol: 'underline',
- String.Other: _OW_PURPLE,
- String.Regex: _OW_PURPLE,
-
- Number: '#444444',
-
- Generic.Deleted: '#c02828',
- Generic.Emph: 'italic',
- Generic.Error: '#c02828',
- Generic.Heading: '#666666',
- Generic.Subheading: '#444444',
- Generic.Inserted: _NAME_GREEN,
- Generic.Output: '#666666',
- Generic.Prompt: '#444444',
- Generic.Strong: 'bold',
- Generic.Traceback: _KW_BLUE,
-
- Error: 'bg:'+_OW_PURPLE,
- }
diff --git a/pygments/styles/manni.py b/pygments/styles/manni.py
deleted file mode 100644
index bd14f6a1..00000000
--- a/pygments/styles/manni.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.manni
- ~~~~~~~~~~~~~~~~~~~~~
-
- A colorful style, inspired by the terminal highlighting style.
-
- 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-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class ManniStyle(Style):
- """
- A colorful style, inspired by the terminal highlighting style.
- """
-
- background_color = '#f0f3f3'
-
- styles = {
- Whitespace: '#bbbbbb',
- Comment: 'italic #0099FF',
- Comment.Preproc: 'noitalic #009999',
- Comment.Special: 'bold',
-
- Keyword: 'bold #006699',
- Keyword.Pseudo: 'nobold',
- Keyword.Type: '#007788',
-
- Operator: '#555555',
- Operator.Word: 'bold #000000',
-
- Name.Builtin: '#336666',
- Name.Function: '#CC00FF',
- Name.Class: 'bold #00AA88',
- Name.Namespace: 'bold #00CCFF',
- Name.Exception: 'bold #CC0000',
- Name.Variable: '#003333',
- Name.Constant: '#336600',
- Name.Label: '#9999FF',
- Name.Entity: 'bold #999999',
- Name.Attribute: '#330099',
- Name.Tag: 'bold #330099',
- Name.Decorator: '#9999FF',
-
- String: '#CC3300',
- String.Doc: 'italic',
- String.Interpol: '#AA0000',
- String.Escape: 'bold #CC3300',
- String.Regex: '#33AAAA',
- String.Symbol: '#FFCC33',
- String.Other: '#CC3300',
-
- Number: '#FF6600',
-
- Generic.Heading: 'bold #003300',
- Generic.Subheading: 'bold #003300',
- Generic.Deleted: 'border:#CC0000 bg:#FFCCCC',
- Generic.Inserted: 'border:#00CC00 bg:#CCFFCC',
- Generic.Error: '#FF0000',
- Generic.Emph: 'italic',
- Generic.Strong: 'bold',
- Generic.Prompt: 'bold #000099',
- Generic.Output: '#AAAAAA',
- Generic.Traceback: '#99CC66',
-
- Error: 'bg:#FFAAAA #AA0000'
- }
diff --git a/pygments/styles/monokai.py b/pygments/styles/monokai.py
deleted file mode 100644
index 4580df2b..00000000
--- a/pygments/styles/monokai.py
+++ /dev/null
@@ -1,106 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.monokai
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Mimic the Monokai color scheme. Based on tango.py.
-
- http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, Text, \
- Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
-
-class MonokaiStyle(Style):
- """
- This style mimics the Monokai color scheme.
- """
-
- background_color = "#272822"
- highlight_color = "#49483e"
-
- styles = {
- # No corresponding class for the following:
- Text: "#f8f8f2", # class: ''
- Whitespace: "", # class: 'w'
- Error: "#960050 bg:#1e0010", # class: 'err'
- Other: "", # class 'x'
-
- Comment: "#75715e", # class: 'c'
- Comment.Multiline: "", # class: 'cm'
- Comment.Preproc: "", # class: 'cp'
- Comment.Single: "", # class: 'c1'
- Comment.Special: "", # class: 'cs'
-
- Keyword: "#66d9ef", # class: 'k'
- Keyword.Constant: "", # class: 'kc'
- Keyword.Declaration: "", # class: 'kd'
- Keyword.Namespace: "#f92672", # class: 'kn'
- Keyword.Pseudo: "", # class: 'kp'
- Keyword.Reserved: "", # class: 'kr'
- Keyword.Type: "", # class: 'kt'
-
- Operator: "#f92672", # class: 'o'
- Operator.Word: "", # class: 'ow' - like keywords
-
- Punctuation: "#f8f8f2", # class: 'p'
-
- Name: "#f8f8f2", # class: 'n'
- Name.Attribute: "#a6e22e", # class: 'na' - to be revised
- Name.Builtin: "", # class: 'nb'
- Name.Builtin.Pseudo: "", # class: 'bp'
- Name.Class: "#a6e22e", # class: 'nc' - to be revised
- Name.Constant: "#66d9ef", # class: 'no' - to be revised
- Name.Decorator: "#a6e22e", # class: 'nd' - to be revised
- Name.Entity: "", # class: 'ni'
- Name.Exception: "#a6e22e", # class: 'ne'
- Name.Function: "#a6e22e", # class: 'nf'
- Name.Property: "", # class: 'py'
- Name.Label: "", # class: 'nl'
- Name.Namespace: "", # class: 'nn' - to be revised
- Name.Other: "#a6e22e", # class: 'nx'
- Name.Tag: "#f92672", # class: 'nt' - like a keyword
- Name.Variable: "", # class: 'nv' - to be revised
- Name.Variable.Class: "", # class: 'vc' - to be revised
- Name.Variable.Global: "", # class: 'vg' - to be revised
- Name.Variable.Instance: "", # class: 'vi' - to be revised
-
- Number: "#ae81ff", # class: 'm'
- Number.Float: "", # class: 'mf'
- Number.Hex: "", # class: 'mh'
- Number.Integer: "", # class: 'mi'
- Number.Integer.Long: "", # class: 'il'
- Number.Oct: "", # class: 'mo'
-
- Literal: "#ae81ff", # class: 'l'
- Literal.Date: "#e6db74", # class: 'ld'
-
- String: "#e6db74", # class: 's'
- String.Backtick: "", # class: 'sb'
- String.Char: "", # class: 'sc'
- String.Doc: "", # class: 'sd' - like a comment
- String.Double: "", # class: 's2'
- String.Escape: "#ae81ff", # class: 'se'
- String.Heredoc: "", # class: 'sh'
- String.Interpol: "", # class: 'si'
- String.Other: "", # class: 'sx'
- String.Regex: "", # class: 'sr'
- String.Single: "", # class: 's1'
- String.Symbol: "", # class: 'ss'
-
- Generic: "", # class: 'g'
- Generic.Deleted: "#f92672", # class: 'gd',
- Generic.Emph: "italic", # class: 'ge'
- Generic.Error: "", # class: 'gr'
- Generic.Heading: "", # class: 'gh'
- Generic.Inserted: "#a6e22e", # class: 'gi'
- Generic.Output: "", # class: 'go'
- Generic.Prompt: "", # class: 'gp'
- Generic.Strong: "bold", # class: 'gs'
- Generic.Subheading: "#75715e", # class: 'gu'
- Generic.Traceback: "", # class: 'gt'
- }
diff --git a/pygments/styles/murphy.py b/pygments/styles/murphy.py
deleted file mode 100644
index e9b50d7a..00000000
--- a/pygments/styles/murphy.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.murphy
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Murphy's style from CodeRay.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class MurphyStyle(Style):
- """
- Murphy's style from CodeRay.
- """
-
- default_style = ""
-
- styles = {
- Whitespace: "#bbbbbb",
- Comment: "#666 italic",
- Comment.Preproc: "#579 noitalic",
- Comment.Special: "#c00 bold",
-
- Keyword: "bold #289",
- Keyword.Pseudo: "#08f",
- Keyword.Type: "#66f",
-
- Operator: "#333",
- Operator.Word: "bold #000",
-
- Name.Builtin: "#072",
- Name.Function: "bold #5ed",
- Name.Class: "bold #e9e",
- Name.Namespace: "bold #0e84b5",
- Name.Exception: "bold #F00",
- Name.Variable: "#036",
- Name.Variable.Instance: "#aaf",
- Name.Variable.Class: "#ccf",
- Name.Variable.Global: "#f84",
- Name.Constant: "bold #5ed",
- Name.Label: "bold #970",
- Name.Entity: "#800",
- Name.Attribute: "#007",
- Name.Tag: "#070",
- Name.Decorator: "bold #555",
-
- String: "bg:#e0e0ff",
- String.Char: "#88F bg:",
- String.Doc: "#D42 bg:",
- String.Interpol: "bg:#eee",
- String.Escape: "bold #666",
- String.Regex: "bg:#e0e0ff #000",
- String.Symbol: "#fc8 bg:",
- String.Other: "#f88",
-
- Number: "bold #60E",
- Number.Integer: "bold #66f",
- Number.Float: "bold #60E",
- Number.Hex: "bold #058",
- Number.Oct: "bold #40E",
-
- Generic.Heading: "bold #000080",
- Generic.Subheading: "bold #800080",
- Generic.Deleted: "#A00000",
- Generic.Inserted: "#00A000",
- Generic.Error: "#FF0000",
- Generic.Emph: "italic",
- Generic.Strong: "bold",
- Generic.Prompt: "bold #c65d09",
- Generic.Output: "#888",
- Generic.Traceback: "#04D",
-
- Error: "#F00 bg:#FAA"
- }
diff --git a/pygments/styles/native.py b/pygments/styles/native.py
deleted file mode 100644
index a41852ac..00000000
--- a/pygments/styles/native.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.native
- ~~~~~~~~~~~~~~~~~~~~~~
-
- pygments version of my "native" vim theme.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Token, Whitespace
-
-
-class NativeStyle(Style):
- """
- Pygments version of the "native" vim theme.
- """
-
- background_color = '#202020'
- highlight_color = '#404040'
-
- styles = {
- Token: '#d0d0d0',
- Whitespace: '#666666',
-
- Comment: 'italic #999999',
- Comment.Preproc: 'noitalic bold #cd2828',
- Comment.Special: 'noitalic bold #e50808 bg:#520000',
-
- Keyword: 'bold #6ab825',
- Keyword.Pseudo: 'nobold',
- Operator.Word: 'bold #6ab825',
-
- String: '#ed9d13',
- String.Other: '#ffa500',
-
- Number: '#3677a9',
-
- Name.Builtin: '#24909d',
- Name.Variable: '#40ffff',
- Name.Constant: '#40ffff',
- Name.Class: 'underline #447fcf',
- Name.Function: '#447fcf',
- Name.Namespace: 'underline #447fcf',
- Name.Exception: '#bbbbbb',
- Name.Tag: 'bold #6ab825',
- Name.Attribute: '#bbbbbb',
- Name.Decorator: '#ffa500',
-
- Generic.Heading: 'bold #ffffff',
- Generic.Subheading: 'underline #ffffff',
- Generic.Deleted: '#d22323',
- Generic.Inserted: '#589819',
- Generic.Error: '#d22323',
- Generic.Emph: 'italic',
- Generic.Strong: 'bold',
- Generic.Prompt: '#aaaaaa',
- Generic.Output: '#cccccc',
- Generic.Traceback: '#d22323',
-
- Error: 'bg:#e3d2d2 #a61717'
- }
diff --git a/pygments/styles/paraiso_dark.py b/pygments/styles/paraiso_dark.py
deleted file mode 100644
index 50afc37e..00000000
--- a/pygments/styles/paraiso_dark.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.paraiso_dark
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Paraíso (Dark) by Jan T. Sott
-
- Pygments template by Jan T. Sott (https://github.com/idleberg)
- Created with Base16 Builder by Chris Kempson
- (https://github.com/chriskempson/base16-builder).
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, Text, \
- Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
-
-
-BACKGROUND = "#2f1e2e"
-CURRENT_LINE = "#41323f"
-SELECTION = "#4f424c"
-FOREGROUND = "#e7e9db"
-COMMENT = "#776e71"
-RED = "#ef6155"
-ORANGE = "#f99b15"
-YELLOW = "#fec418"
-GREEN = "#48b685"
-AQUA = "#5bc4bf"
-BLUE = "#06b6ef"
-PURPLE = "#815ba4"
-
-
-class ParaisoDarkStyle(Style):
-
- default_style = ''
-
- background_color = BACKGROUND
- highlight_color = SELECTION
-
- background_color = BACKGROUND
- highlight_color = SELECTION
-
- styles = {
- # No corresponding class for the following:
- Text: FOREGROUND, # class: ''
- Whitespace: "", # class: 'w'
- Error: RED, # class: 'err'
- Other: "", # class 'x'
-
- Comment: COMMENT, # class: 'c'
- Comment.Multiline: "", # class: 'cm'
- Comment.Preproc: "", # class: 'cp'
- Comment.Single: "", # class: 'c1'
- Comment.Special: "", # class: 'cs'
-
- Keyword: PURPLE, # class: 'k'
- Keyword.Constant: "", # class: 'kc'
- Keyword.Declaration: "", # class: 'kd'
- Keyword.Namespace: AQUA, # class: 'kn'
- Keyword.Pseudo: "", # class: 'kp'
- Keyword.Reserved: "", # class: 'kr'
- Keyword.Type: YELLOW, # class: 'kt'
-
- Operator: AQUA, # class: 'o'
- Operator.Word: "", # class: 'ow' - like keywords
-
- Punctuation: FOREGROUND, # class: 'p'
-
- Name: FOREGROUND, # class: 'n'
- Name.Attribute: BLUE, # class: 'na' - to be revised
- Name.Builtin: "", # class: 'nb'
- Name.Builtin.Pseudo: "", # class: 'bp'
- Name.Class: YELLOW, # class: 'nc' - to be revised
- Name.Constant: RED, # class: 'no' - to be revised
- Name.Decorator: AQUA, # class: 'nd' - to be revised
- Name.Entity: "", # class: 'ni'
- Name.Exception: RED, # class: 'ne'
- Name.Function: BLUE, # class: 'nf'
- Name.Property: "", # class: 'py'
- Name.Label: "", # class: 'nl'
- Name.Namespace: YELLOW, # class: 'nn' - to be revised
- Name.Other: BLUE, # class: 'nx'
- Name.Tag: AQUA, # class: 'nt' - like a keyword
- Name.Variable: RED, # class: 'nv' - to be revised
- Name.Variable.Class: "", # class: 'vc' - to be revised
- Name.Variable.Global: "", # class: 'vg' - to be revised
- Name.Variable.Instance: "", # class: 'vi' - to be revised
-
- Number: ORANGE, # class: 'm'
- Number.Float: "", # class: 'mf'
- Number.Hex: "", # class: 'mh'
- Number.Integer: "", # class: 'mi'
- Number.Integer.Long: "", # class: 'il'
- Number.Oct: "", # class: 'mo'
-
- Literal: ORANGE, # class: 'l'
- Literal.Date: GREEN, # class: 'ld'
-
- String: GREEN, # class: 's'
- String.Backtick: "", # class: 'sb'
- String.Char: FOREGROUND, # class: 'sc'
- String.Doc: COMMENT, # class: 'sd' - like a comment
- String.Double: "", # class: 's2'
- String.Escape: ORANGE, # class: 'se'
- String.Heredoc: "", # class: 'sh'
- String.Interpol: ORANGE, # class: 'si'
- String.Other: "", # class: 'sx'
- String.Regex: "", # class: 'sr'
- String.Single: "", # class: 's1'
- String.Symbol: "", # class: 'ss'
-
- Generic: "", # class: 'g'
- Generic.Deleted: RED, # class: 'gd',
- Generic.Emph: "italic", # class: 'ge'
- Generic.Error: "", # class: 'gr'
- Generic.Heading: "bold " + FOREGROUND, # class: 'gh'
- Generic.Inserted: GREEN, # class: 'gi'
- Generic.Output: "", # class: 'go'
- Generic.Prompt: "bold " + COMMENT, # class: 'gp'
- Generic.Strong: "bold", # class: 'gs'
- Generic.Subheading: "bold " + AQUA, # class: 'gu'
- Generic.Traceback: "", # class: 'gt'
- }
diff --git a/pygments/styles/paraiso_light.py b/pygments/styles/paraiso_light.py
deleted file mode 100644
index a5f357ba..00000000
--- a/pygments/styles/paraiso_light.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.paraiso_light
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Paraíso (Light) by Jan T. Sott
-
- Pygments template by Jan T. Sott (https://github.com/idleberg)
- Created with Base16 Builder by Chris Kempson
- (https://github.com/chriskempson/base16-builder).
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, Text, \
- Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
-
-
-BACKGROUND = "#e7e9db"
-CURRENT_LINE = "#b9b6b0"
-SELECTION = "#a39e9b"
-FOREGROUND = "#2f1e2e"
-COMMENT = "#8d8687"
-RED = "#ef6155"
-ORANGE = "#f99b15"
-YELLOW = "#fec418"
-GREEN = "#48b685"
-AQUA = "#5bc4bf"
-BLUE = "#06b6ef"
-PURPLE = "#815ba4"
-
-
-class ParaisoLightStyle(Style):
-
- default_style = ''
-
- background_color = BACKGROUND
- highlight_color = SELECTION
-
- background_color = BACKGROUND
- highlight_color = SELECTION
-
- styles = {
- # No corresponding class for the following:
- Text: FOREGROUND, # class: ''
- Whitespace: "", # class: 'w'
- Error: RED, # class: 'err'
- Other: "", # class 'x'
-
- Comment: COMMENT, # class: 'c'
- Comment.Multiline: "", # class: 'cm'
- Comment.Preproc: "", # class: 'cp'
- Comment.Single: "", # class: 'c1'
- Comment.Special: "", # class: 'cs'
-
- Keyword: PURPLE, # class: 'k'
- Keyword.Constant: "", # class: 'kc'
- Keyword.Declaration: "", # class: 'kd'
- Keyword.Namespace: AQUA, # class: 'kn'
- Keyword.Pseudo: "", # class: 'kp'
- Keyword.Reserved: "", # class: 'kr'
- Keyword.Type: YELLOW, # class: 'kt'
-
- Operator: AQUA, # class: 'o'
- Operator.Word: "", # class: 'ow' - like keywords
-
- Punctuation: FOREGROUND, # class: 'p'
-
- Name: FOREGROUND, # class: 'n'
- Name.Attribute: BLUE, # class: 'na' - to be revised
- Name.Builtin: "", # class: 'nb'
- Name.Builtin.Pseudo: "", # class: 'bp'
- Name.Class: YELLOW, # class: 'nc' - to be revised
- Name.Constant: RED, # class: 'no' - to be revised
- Name.Decorator: AQUA, # class: 'nd' - to be revised
- Name.Entity: "", # class: 'ni'
- Name.Exception: RED, # class: 'ne'
- Name.Function: BLUE, # class: 'nf'
- Name.Property: "", # class: 'py'
- Name.Label: "", # class: 'nl'
- Name.Namespace: YELLOW, # class: 'nn' - to be revised
- Name.Other: BLUE, # class: 'nx'
- Name.Tag: AQUA, # class: 'nt' - like a keyword
- Name.Variable: RED, # class: 'nv' - to be revised
- Name.Variable.Class: "", # class: 'vc' - to be revised
- Name.Variable.Global: "", # class: 'vg' - to be revised
- Name.Variable.Instance: "", # class: 'vi' - to be revised
-
- Number: ORANGE, # class: 'm'
- Number.Float: "", # class: 'mf'
- Number.Hex: "", # class: 'mh'
- Number.Integer: "", # class: 'mi'
- Number.Integer.Long: "", # class: 'il'
- Number.Oct: "", # class: 'mo'
-
- Literal: ORANGE, # class: 'l'
- Literal.Date: GREEN, # class: 'ld'
-
- String: GREEN, # class: 's'
- String.Backtick: "", # class: 'sb'
- String.Char: FOREGROUND, # class: 'sc'
- String.Doc: COMMENT, # class: 'sd' - like a comment
- String.Double: "", # class: 's2'
- String.Escape: ORANGE, # class: 'se'
- String.Heredoc: "", # class: 'sh'
- String.Interpol: ORANGE, # class: 'si'
- String.Other: "", # class: 'sx'
- String.Regex: "", # class: 'sr'
- String.Single: "", # class: 's1'
- String.Symbol: "", # class: 'ss'
-
- Generic: "", # class: 'g'
- Generic.Deleted: RED, # class: 'gd',
- Generic.Emph: "italic", # class: 'ge'
- Generic.Error: "", # class: 'gr'
- Generic.Heading: "bold " + FOREGROUND, # class: 'gh'
- Generic.Inserted: GREEN, # class: 'gi'
- Generic.Output: "", # class: 'go'
- Generic.Prompt: "bold " + COMMENT, # class: 'gp'
- Generic.Strong: "bold", # class: 'gs'
- Generic.Subheading: "bold " + AQUA, # class: 'gu'
- Generic.Traceback: "", # class: 'gt'
- }
diff --git a/pygments/styles/pastie.py b/pygments/styles/pastie.py
deleted file mode 100644
index 6b022025..00000000
--- a/pygments/styles/pastie.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.pastie
- ~~~~~~~~~~~~~~~~~~~~~~
-
- Style similar to the `pastie`_ default style.
-
- .. _pastie: http://pastie.caboo.se/
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class PastieStyle(Style):
- """
- Style similar to the pastie default style.
- """
-
- default_style = ''
-
- styles = {
- Whitespace: '#bbbbbb',
- Comment: '#888888',
- Comment.Preproc: 'bold #cc0000',
- Comment.Special: 'bg:#fff0f0 bold #cc0000',
-
- String: 'bg:#fff0f0 #dd2200',
- String.Regex: 'bg:#fff0ff #008800',
- String.Other: 'bg:#f0fff0 #22bb22',
- String.Symbol: '#aa6600',
- String.Interpol: '#3333bb',
- String.Escape: '#0044dd',
-
- Operator.Word: '#008800',
-
- Keyword: 'bold #008800',
- Keyword.Pseudo: 'nobold',
- Keyword.Type: '#888888',
-
- Name.Class: 'bold #bb0066',
- Name.Exception: 'bold #bb0066',
- Name.Function: 'bold #0066bb',
- Name.Property: 'bold #336699',
- Name.Namespace: 'bold #bb0066',
- Name.Builtin: '#003388',
- Name.Variable: '#336699',
- Name.Variable.Class: '#336699',
- Name.Variable.Instance: '#3333bb',
- Name.Variable.Global: '#dd7700',
- Name.Constant: 'bold #003366',
- Name.Tag: 'bold #bb0066',
- Name.Attribute: '#336699',
- Name.Decorator: '#555555',
- Name.Label: 'italic #336699',
-
- Number: 'bold #0000DD',
-
- Generic.Heading: '#333',
- Generic.Subheading: '#666',
- Generic.Deleted: 'bg:#ffdddd #000000',
- Generic.Inserted: 'bg:#ddffdd #000000',
- Generic.Error: '#aa0000',
- Generic.Emph: 'italic',
- Generic.Strong: 'bold',
- Generic.Prompt: '#555555',
- Generic.Output: '#888888',
- Generic.Traceback: '#aa0000',
-
- Error: 'bg:#e3d2d2 #a61717'
- }
diff --git a/pygments/styles/perldoc.py b/pygments/styles/perldoc.py
deleted file mode 100644
index a6c21e90..00000000
--- a/pygments/styles/perldoc.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.perldoc
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- Style similar to the style used in the `perldoc`_ code blocks.
-
- .. _perldoc: http://perldoc.perl.org/
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class PerldocStyle(Style):
- """
- Style similar to the style used in the perldoc code blocks.
- """
-
- background_color = '#eeeedd'
- default_style = ''
-
- styles = {
- Whitespace: '#bbbbbb',
- Comment: '#228B22',
- Comment.Preproc: '#1e889b',
- Comment.Special: '#8B008B bold',
-
- String: '#CD5555',
- String.Heredoc: '#1c7e71 italic',
- String.Regex: '#B452CD',
- String.Other: '#cb6c20',
- String.Regex: '#1c7e71',
-
- Number: '#B452CD',
-
- Operator.Word: '#8B008B',
-
- Keyword: '#8B008B bold',
- Keyword.Type: '#00688B',
-
- Name.Class: '#008b45 bold',
- Name.Exception: '#008b45 bold',
- Name.Function: '#008b45',
- Name.Namespace: '#008b45 underline',
- Name.Variable: '#00688B',
- Name.Constant: '#00688B',
- Name.Decorator: '#707a7c',
- Name.Tag: '#8B008B bold',
- Name.Attribute: '#658b00',
- Name.Builtin: '#658b00',
-
- Generic.Heading: 'bold #000080',
- Generic.Subheading: 'bold #800080',
- Generic.Deleted: '#aa0000',
- Generic.Inserted: '#00aa00',
- Generic.Error: '#aa0000',
- Generic.Emph: 'italic',
- Generic.Strong: 'bold',
- Generic.Prompt: '#555555',
- Generic.Output: '#888888',
- Generic.Traceback: '#aa0000',
-
- Error: 'bg:#e3d2d2 #a61717'
- }
diff --git a/pygments/styles/rainbow_dash.py b/pygments/styles/rainbow_dash.py
deleted file mode 100644
index c2c2c7c5..00000000
--- a/pygments/styles/rainbow_dash.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.rainbow_dash
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- A bright and colorful syntax highlighting `theme`.
-
- .. _theme: http://sanssecours.github.io/Rainbow-Dash.tmbundle
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import (Comment, Error, Generic, Name, Number, Operator,
- String, Text, Whitespace, Keyword)
-
-BLUE_LIGHT = '#0080ff'
-BLUE = '#2c5dcd'
-GREEN = '#00cc66'
-GREEN_LIGHT = '#ccffcc'
-GREEN_NEON = '#00cc00'
-GREY = '#aaaaaa'
-GREY_LIGHT = '#cbcbcb'
-GREY_DARK = '#4d4d4d'
-PURPLE = '#5918bb'
-RED = '#cc0000'
-RED_DARK = '#c5060b'
-RED_LIGHT = '#ffcccc'
-RED_BRIGHT = '#ff0000'
-WHITE = '#ffffff'
-TURQUOISE = '#318495'
-ORANGE = '#ff8000'
-
-
-class RainbowDashStyle(Style):
- """
- A bright and colorful syntax highlighting theme.
- """
-
- background_color = WHITE
-
- styles = {
- Comment: 'italic {}'.format(BLUE_LIGHT),
- Comment.Preproc: 'noitalic',
- Comment.Special: 'bold',
-
- Error: 'bg:{} {}'.format(RED, WHITE),
-
- Generic.Deleted: 'border:{} bg:{}'.format(RED_DARK, RED_LIGHT),
- Generic.Emph: 'italic',
- Generic.Error: RED_BRIGHT,
- Generic.Heading: 'bold {}'.format(BLUE),
- Generic.Inserted: 'border:{} bg:{}'.format(GREEN_NEON, GREEN_LIGHT),
- Generic.Output: GREY,
- Generic.Prompt: 'bold {}'.format(BLUE),
- Generic.Strong: 'bold',
- Generic.Subheading: 'bold {}'.format(BLUE),
- Generic.Traceback: RED_DARK,
-
- Keyword: 'bold {}'.format(BLUE),
- Keyword.Pseudo: 'nobold',
- Keyword.Type: PURPLE,
-
- Name.Attribute: 'italic {}'.format(BLUE),
- Name.Builtin: 'bold {}'.format(PURPLE),
- Name.Class: 'underline',
- Name.Constant: TURQUOISE,
- Name.Decorator: 'bold {}'.format(ORANGE),
- Name.Entity: 'bold {}'.format(PURPLE),
- Name.Exception: 'bold {}'.format(PURPLE),
- Name.Function: 'bold {}'.format(ORANGE),
- Name.Tag: 'bold {}'.format(BLUE),
-
- Number: 'bold {}'.format(PURPLE),
-
- Operator: BLUE,
- Operator.Word: 'bold',
-
- String: GREEN,
- String.Doc: 'italic',
- String.Escape: 'bold {}'.format(RED_DARK),
- String.Other: TURQUOISE,
- String.Symbol: 'bold {}'.format(RED_DARK),
-
- Text: GREY_DARK,
-
- Whitespace: GREY_LIGHT
- }
diff --git a/pygments/styles/rrt.py b/pygments/styles/rrt.py
deleted file mode 100644
index d61085e0..00000000
--- a/pygments/styles/rrt.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.rrt
- ~~~~~~~~~~~~~~~~~~~
-
- pygments "rrt" theme, based on Zap and Emacs defaults.
-
- :copyright: Copyright 2006-2019 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',
- }
diff --git a/pygments/styles/sas.py b/pygments/styles/sas.py
deleted file mode 100644
index 3121aa53..00000000
--- a/pygments/styles/sas.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.sas
- ~~~~~~~~~~~~~~~~~~~
-
- Style inspired by SAS' enhanced program editor. Note This is not
- meant to be a complete style. It's merely meant to mimic SAS'
- program editor syntax highlighting.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Other, Whitespace, Generic
-
-
-class SasStyle(Style):
- """
- Style inspired by SAS' enhanced program editor. Note This is not
- meant to be a complete style. It's merely meant to mimic SAS'
- program editor syntax highlighting.
- """
-
- default_style = ''
-
- styles = {
- Whitespace: '#bbbbbb',
- Comment: 'italic #008800',
- String: '#800080',
- Number: 'bold #2e8b57',
- Other: 'bg:#ffffe0',
- Keyword: '#2c2cff',
- Keyword.Reserved: 'bold #353580',
- Keyword.Constant: 'bold',
- Name.Builtin: '#2c2cff',
- Name.Function: 'bold italic',
- Name.Variable: 'bold #2c2cff',
- Generic: '#2c2cff',
- Generic.Emph: '#008800',
- Generic.Error: '#d30202',
- Error: 'bg:#e3d2d2 #a61717'
- }
diff --git a/pygments/styles/solarized.py b/pygments/styles/solarized.py
deleted file mode 100644
index 7d4b113d..00000000
--- a/pygments/styles/solarized.py
+++ /dev/null
@@ -1,130 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.solarized
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Solarized by Camil Staps
-
- A Pygments style for the Solarized themes (licensed under MIT).
- See: https://github.com/altercation/solarized
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Comment, Error, Generic, Keyword, Name, Number, \
- Operator, String, Token
-
-
-def make_style(colors):
- return {
- Token: colors['base0'],
-
- Comment: 'italic ' + colors['base01'],
- Comment.Hashbang: colors['base01'],
- Comment.Multiline: colors['base01'],
- Comment.Preproc: 'noitalic ' + colors['magenta'],
- Comment.PreprocFile: 'noitalic ' + colors['base01'],
-
- Keyword: colors['green'],
- Keyword.Constant: colors['cyan'],
- Keyword.Declaration: colors['cyan'],
- Keyword.Namespace: colors['orange'],
- Keyword.Type: colors['yellow'],
-
- Operator: colors['base01'],
- Operator.Word: colors['green'],
-
- Name.Builtin: colors['blue'],
- Name.Builtin.Pseudo: colors['blue'],
- Name.Class: colors['blue'],
- Name.Constant: colors['blue'],
- Name.Decorator: colors['blue'],
- Name.Entity: colors['blue'],
- Name.Exception: colors['blue'],
- Name.Function: colors['blue'],
- Name.Function.Magic: colors['blue'],
- Name.Label: colors['blue'],
- Name.Namespace: colors['blue'],
- Name.Tag: colors['blue'],
- Name.Variable: colors['blue'],
- Name.Variable.Global:colors['blue'],
- Name.Variable.Magic: colors['blue'],
-
- String: colors['cyan'],
- String.Doc: colors['base01'],
- String.Regex: colors['orange'],
-
- Number: colors['cyan'],
-
- Generic.Deleted: colors['red'],
- Generic.Emph: 'italic',
- Generic.Error: colors['red'],
- Generic.Heading: 'bold',
- Generic.Subheading: 'underline',
- Generic.Inserted: colors['green'],
- Generic.Strong: 'bold',
- Generic.Traceback: colors['blue'],
-
- Error: 'bg:' + colors['red'],
- }
-
-
-DARK_COLORS = {
- 'base03': '#002b36',
- 'base02': '#073642',
- 'base01': '#586e75',
- 'base00': '#657b83',
- 'base0': '#839496',
- 'base1': '#93a1a1',
- 'base2': '#eee8d5',
- 'base3': '#fdf6e3',
- 'yellow': '#b58900',
- 'orange': '#cb4b16',
- 'red': '#dc322f',
- 'magenta': '#d33682',
- 'violet': '#6c71c4',
- 'blue': '#268bd2',
- 'cyan': '#2aa198',
- 'green': '#859900',
-}
-
-LIGHT_COLORS = {
- 'base3': '#002b36',
- 'base2': '#073642',
- 'base1': '#586e75',
- 'base0': '#657b83',
- 'base00': '#839496',
- 'base01': '#93a1a1',
- 'base02': '#eee8d5',
- 'base03': '#fdf6e3',
- 'yellow': '#b58900',
- 'orange': '#cb4b16',
- 'red': '#dc322f',
- 'magenta': '#d33682',
- 'violet': '#6c71c4',
- 'blue': '#268bd2',
- 'cyan': '#2aa198',
- 'green': '#859900',
-}
-
-
-class SolarizedDarkStyle(Style):
- """
- The solarized style, dark.
- """
-
- styles = make_style(DARK_COLORS)
- background_color = DARK_COLORS['base03']
- highlight_color = DARK_COLORS['base02']
-
-
-class SolarizedLightStyle(SolarizedDarkStyle):
- """
- The solarized style, light.
- """
-
- styles = make_style(LIGHT_COLORS)
- background_color = LIGHT_COLORS['base03']
- highlight_color = LIGHT_COLORS['base02']
diff --git a/pygments/styles/stata_dark.py b/pygments/styles/stata_dark.py
deleted file mode 100644
index 122b3d77..00000000
--- a/pygments/styles/stata_dark.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.stata_dark
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Dark style inspired by Stata's do-file editor. Note this is not
- meant to be a complete style, just for Stata's file formats.
-
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Whitespace, Generic, Text
-
-
-class StataDarkStyle(Style):
-
- default_style = ''
-
- background_color = "#232629"
- highlight_color = "#49483e"
-
- styles = {
- Whitespace: '#bbbbbb',
- Error: 'bg:#e3d2d2 #a61717',
- Text: '#cccccc',
- String: '#51cc99',
- Number: '#4FB8CC',
- Operator: '',
- Name.Function: '#6a6aff',
- Name.Other: '#e2828e',
- Keyword: 'bold #7686bb',
- Keyword.Constant: '',
- Comment: 'italic #777777',
- Name.Variable: 'bold #7AB4DB',
- Name.Variable.Global: 'bold #BE646C',
- Generic.Prompt: '#ffffff',
- }
diff --git a/pygments/styles/stata_light.py b/pygments/styles/stata_light.py
deleted file mode 100644
index 41009a18..00000000
--- a/pygments/styles/stata_light.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.stata_light
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Light Style inspired by Stata's do-file editor. Note this is not
- meant to be a complete style, just for Stata's file formats.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Whitespace, Text
-
-
-class StataLightStyle(Style):
- """
- Light mode style inspired by Stata's do-file editor. This is not
- meant to be a complete style, just for use with Stata.
- """
-
- default_style = ''
- styles = {
- Text: '#111111',
- Whitespace: '#bbbbbb',
- Error: 'bg:#e3d2d2 #a61717',
- String: '#7a2424',
- Number: '#2c2cff',
- Operator: '',
- Name.Function: '#2c2cff',
- Name.Other: '#be646c',
- Keyword: 'bold #353580',
- Keyword.Constant: '',
- Comment: 'italic #008800',
- Name.Variable: 'bold #35baba',
- Name.Variable.Global: 'bold #b5565e',
- }
diff --git a/pygments/styles/tango.py b/pygments/styles/tango.py
deleted file mode 100644
index 5205244c..00000000
--- a/pygments/styles/tango.py
+++ /dev/null
@@ -1,141 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.tango
- ~~~~~~~~~~~~~~~~~~~~~
-
- The Crunchy default Style inspired from the color palette from
- the Tango Icon Theme Guidelines.
-
- http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines
-
- Butter: #fce94f #edd400 #c4a000
- Orange: #fcaf3e #f57900 #ce5c00
- Chocolate: #e9b96e #c17d11 #8f5902
- Chameleon: #8ae234 #73d216 #4e9a06
- Sky Blue: #729fcf #3465a4 #204a87
- Plum: #ad7fa8 #75507b #5c35cc
- Scarlet Red:#ef2929 #cc0000 #a40000
- Aluminium: #eeeeec #d3d7cf #babdb6
- #888a85 #555753 #2e3436
-
- Not all of the above colors are used; other colors added:
- very light grey: #f8f8f8 (for background)
-
- This style can be used as a template as it includes all the known
- Token types, unlike most (if not all) of the styles included in the
- Pygments distribution.
-
- However, since Crunchy is intended to be used by beginners, we have strived
- to create a style that gloss over subtle distinctions between different
- categories.
-
- Taking Python for example, comments (Comment.*) and docstrings (String.Doc)
- 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-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
-
-
-class TangoStyle(Style):
- """
- The Crunchy default Style inspired from the color palette from
- the Tango Icon Theme Guidelines.
- """
-
- # work in progress...
-
- background_color = "#f8f8f8"
- default_style = ""
-
- styles = {
- # No corresponding class for the following:
- #Text: "", # class: ''
- Whitespace: "underline #f8f8f8", # class: 'w'
- Error: "#a40000 border:#ef2929", # class: 'err'
- Other: "#000000", # class 'x'
-
- Comment: "italic #8f5902", # class: 'c'
- Comment.Multiline: "italic #8f5902", # class: 'cm'
- Comment.Preproc: "italic #8f5902", # class: 'cp'
- Comment.Single: "italic #8f5902", # class: 'c1'
- Comment.Special: "italic #8f5902", # class: 'cs'
-
- Keyword: "bold #204a87", # class: 'k'
- Keyword.Constant: "bold #204a87", # class: 'kc'
- Keyword.Declaration: "bold #204a87", # class: 'kd'
- Keyword.Namespace: "bold #204a87", # class: 'kn'
- Keyword.Pseudo: "bold #204a87", # class: 'kp'
- Keyword.Reserved: "bold #204a87", # class: 'kr'
- Keyword.Type: "bold #204a87", # class: 'kt'
-
- Operator: "bold #ce5c00", # class: 'o'
- Operator.Word: "bold #204a87", # class: 'ow' - like keywords
-
- Punctuation: "bold #000000", # class: 'p'
-
- # because special names such as Name.Class, Name.Function, etc.
- # are not recognized as such later in the parsing, we choose them
- # to look the same as ordinary variables.
- Name: "#000000", # class: 'n'
- Name.Attribute: "#c4a000", # class: 'na' - to be revised
- Name.Builtin: "#204a87", # class: 'nb'
- Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
- Name.Class: "#000000", # class: 'nc' - to be revised
- Name.Constant: "#000000", # class: 'no' - to be revised
- Name.Decorator: "bold #5c35cc", # class: 'nd' - to be revised
- Name.Entity: "#ce5c00", # class: 'ni'
- Name.Exception: "bold #cc0000", # class: 'ne'
- Name.Function: "#000000", # class: 'nf'
- Name.Property: "#000000", # class: 'py'
- Name.Label: "#f57900", # class: 'nl'
- Name.Namespace: "#000000", # class: 'nn' - to be revised
- Name.Other: "#000000", # class: 'nx'
- Name.Tag: "bold #204a87", # class: 'nt' - like a keyword
- Name.Variable: "#000000", # class: 'nv' - to be revised
- Name.Variable.Class: "#000000", # class: 'vc' - to be revised
- Name.Variable.Global: "#000000", # class: 'vg' - to be revised
- Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
-
- # since the tango light blue does not show up well in text, we choose
- # a pure blue instead.
- Number: "bold #0000cf", # class: 'm'
- Number.Float: "bold #0000cf", # class: 'mf'
- Number.Hex: "bold #0000cf", # class: 'mh'
- Number.Integer: "bold #0000cf", # class: 'mi'
- Number.Integer.Long: "bold #0000cf", # class: 'il'
- Number.Oct: "bold #0000cf", # class: 'mo'
-
- Literal: "#000000", # class: 'l'
- Literal.Date: "#000000", # class: 'ld'
-
- String: "#4e9a06", # class: 's'
- String.Backtick: "#4e9a06", # class: 'sb'
- String.Char: "#4e9a06", # class: 'sc'
- String.Doc: "italic #8f5902", # class: 'sd' - like a comment
- String.Double: "#4e9a06", # class: 's2'
- String.Escape: "#4e9a06", # class: 'se'
- String.Heredoc: "#4e9a06", # class: 'sh'
- String.Interpol: "#4e9a06", # class: 'si'
- String.Other: "#4e9a06", # class: 'sx'
- String.Regex: "#4e9a06", # class: 'sr'
- String.Single: "#4e9a06", # class: 's1'
- String.Symbol: "#4e9a06", # class: 'ss'
-
- Generic: "#000000", # class: 'g'
- Generic.Deleted: "#a40000", # class: 'gd'
- Generic.Emph: "italic #000000", # class: 'ge'
- Generic.Error: "#ef2929", # class: 'gr'
- Generic.Heading: "bold #000080", # class: 'gh'
- Generic.Inserted: "#00A000", # class: 'gi'
- Generic.Output: "italic #000000", # class: 'go'
- Generic.Prompt: "#8f5902", # class: 'gp'
- Generic.Strong: "bold #000000", # class: 'gs'
- Generic.Subheading: "bold #800080", # class: 'gu'
- Generic.Traceback: "bold #a40000", # class: 'gt'
- }
diff --git a/pygments/styles/trac.py b/pygments/styles/trac.py
deleted file mode 100644
index 1e96584d..00000000
--- a/pygments/styles/trac.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.trac
- ~~~~~~~~~~~~~~~~~~~~
-
- Port of the default trac highlighter design.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace
-
-
-class TracStyle(Style):
- """
- Port of the default trac highlighter design.
- """
-
- default_style = ''
-
- styles = {
- Whitespace: '#bbbbbb',
- Comment: 'italic #999988',
- Comment.Preproc: 'bold noitalic #999999',
- Comment.Special: 'bold #999999',
-
- Operator: 'bold',
-
- String: '#bb8844',
- String.Regex: '#808000',
-
- Number: '#009999',
-
- Keyword: 'bold',
- Keyword.Type: '#445588',
-
- Name.Builtin: '#999999',
- Name.Function: 'bold #990000',
- Name.Class: 'bold #445588',
- Name.Exception: 'bold #990000',
- Name.Namespace: '#555555',
- Name.Variable: '#008080',
- Name.Constant: '#008080',
- Name.Tag: '#000080',
- Name.Attribute: '#008080',
- Name.Entity: '#800080',
-
- Generic.Heading: '#999999',
- Generic.Subheading: '#aaaaaa',
- Generic.Deleted: 'bg:#ffdddd #000000',
- Generic.Inserted: 'bg:#ddffdd #000000',
- Generic.Error: '#aa0000',
- Generic.Emph: 'italic',
- Generic.Strong: 'bold',
- Generic.Prompt: '#555555',
- Generic.Output: '#888888',
- Generic.Traceback: '#aa0000',
-
- Error: 'bg:#e3d2d2 #a61717'
- }
diff --git a/pygments/styles/vim.py b/pygments/styles/vim.py
deleted file mode 100644
index 954e91d5..00000000
--- a/pygments/styles/vim.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.vim
- ~~~~~~~~~~~~~~~~~~~
-
- A highlighting style for Pygments, inspired by vim.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic, Whitespace, Token
-
-
-class VimStyle(Style):
- """
- Styles somewhat like vim 7.0
- """
-
- background_color = "#000000"
- highlight_color = "#222222"
- default_style = "#cccccc"
-
- styles = {
- Token: "#cccccc",
- Whitespace: "",
- Comment: "#000080",
- Comment.Preproc: "",
- Comment.Special: "bold #cd0000",
-
- Keyword: "#cdcd00",
- Keyword.Declaration: "#00cd00",
- Keyword.Namespace: "#cd00cd",
- Keyword.Pseudo: "",
- Keyword.Type: "#00cd00",
-
- Operator: "#3399cc",
- Operator.Word: "#cdcd00",
-
- Name: "",
- Name.Class: "#00cdcd",
- Name.Builtin: "#cd00cd",
- Name.Exception: "bold #666699",
- Name.Variable: "#00cdcd",
-
- String: "#cd0000",
- Number: "#cd00cd",
-
- Generic.Heading: "bold #000080",
- Generic.Subheading: "bold #800080",
- Generic.Deleted: "#cd0000",
- Generic.Inserted: "#00cd00",
- Generic.Error: "#FF0000",
- Generic.Emph: "italic",
- Generic.Strong: "bold",
- Generic.Prompt: "bold #000080",
- Generic.Output: "#888",
- Generic.Traceback: "#04D",
-
- Error: "border:#FF0000"
- }
diff --git a/pygments/styles/vs.py b/pygments/styles/vs.py
deleted file mode 100644
index 111e4aed..00000000
--- a/pygments/styles/vs.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.vs
- ~~~~~~~~~~~~~~~~~~
-
- Simple style with MS Visual Studio colors.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Operator, Generic
-
-
-class VisualStudioStyle(Style):
-
- background_color = "#ffffff"
- default_style = ""
-
- styles = {
- Comment: "#008000",
- Comment.Preproc: "#0000ff",
- Keyword: "#0000ff",
- Operator.Word: "#0000ff",
- Keyword.Type: "#2b91af",
- Name.Class: "#2b91af",
- String: "#a31515",
-
- Generic.Heading: "bold",
- Generic.Subheading: "bold",
- Generic.Emph: "italic",
- Generic.Strong: "bold",
- Generic.Prompt: "bold",
-
- Error: "border:#FF0000"
- }
diff --git a/pygments/styles/xcode.py b/pygments/styles/xcode.py
deleted file mode 100644
index 7e87d083..00000000
--- a/pygments/styles/xcode.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.styles.xcode
- ~~~~~~~~~~~~~~~~~~~~~
-
- Style similar to the `Xcode` default theme.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Literal
-
-
-class XcodeStyle(Style):
- """
- Style similar to the Xcode default colouring theme.
- """
-
- default_style = ''
-
- styles = {
- Comment: '#177500',
- Comment.Preproc: '#633820',
-
- String: '#C41A16',
- String.Char: '#2300CE',
-
- Operator: '#000000',
-
- Keyword: '#A90D91',
-
- Name: '#000000',
- Name.Attribute: '#836C28',
- Name.Class: '#3F6E75',
- Name.Function: '#000000',
- Name.Builtin: '#A90D91',
- # In Obj-C code this token is used to colour Cocoa types
- Name.Builtin.Pseudo: '#5B269A',
- Name.Variable: '#000000',
- Name.Tag: '#000000',
- Name.Decorator: '#000000',
- # Workaround for a BUG here: lexer treats multiline method signatres as labels
- Name.Label: '#000000',
-
- Literal: '#1C01CE',
- Number: '#1C01CE',
- Error: '#000000',
- }
diff --git a/pygments/token.py b/pygments/token.py
deleted file mode 100644
index 5c30eb46..00000000
--- a/pygments/token.py
+++ /dev/null
@@ -1,213 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.token
- ~~~~~~~~~~~~~~
-
- Basic token types and the standard tokens.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-
-class _TokenType(tuple):
- parent = None
-
- def split(self):
- buf = []
- node = self
- while node is not None:
- buf.append(node)
- node = node.parent
- buf.reverse()
- return buf
-
- def __init__(self, *args):
- # no need to call super.__init__
- self.subtypes = set()
-
- def __contains__(self, val):
- return self is val or (
- type(val) is self.__class__ and
- val[:len(self)] == self
- )
-
- def __getattr__(self, val):
- if not val or not val[0].isupper():
- return tuple.__getattribute__(self, val)
- new = _TokenType(self + (val,))
- setattr(self, val, new)
- self.subtypes.add(new)
- new.parent = self
- return new
-
- def __repr__(self):
- return 'Token' + (self and '.' or '') + '.'.join(self)
-
- def __copy__(self):
- # These instances are supposed to be singletons
- return self
-
- def __deepcopy__(self, memo):
- # These instances are supposed to be singletons
- return self
-
-
-Token = _TokenType()
-
-# Special token types
-Text = Token.Text
-Whitespace = Text.Whitespace
-Escape = Token.Escape
-Error = Token.Error
-# Text that doesn't belong to this lexer (e.g. HTML in PHP)
-Other = Token.Other
-
-# Common token types for source code
-Keyword = Token.Keyword
-Name = Token.Name
-Literal = Token.Literal
-String = Literal.String
-Number = Literal.Number
-Punctuation = Token.Punctuation
-Operator = Token.Operator
-Comment = Token.Comment
-
-# Generic types for non-source code
-Generic = Token.Generic
-
-# String and some others are not direct children of Token.
-# alias them:
-Token.Token = Token
-Token.String = String
-Token.Number = Number
-
-
-def is_token_subtype(ttype, other):
- """
- Return True if ``ttype`` is a subtype of ``other``.
-
- exists for backwards compatibility. use ``ttype in other`` now.
- """
- return ttype in other
-
-
-def string_to_tokentype(s):
- """
- Convert a string into a token type::
-
- >>> string_to_token('String.Double')
- Token.Literal.String.Double
- >>> string_to_token('Token.Literal.Number')
- Token.Literal.Number
- >>> string_to_token('')
- Token
-
- Tokens that are already tokens are returned unchanged:
-
- >>> string_to_token(String)
- Token.Literal.String
- """
- if isinstance(s, _TokenType):
- return s
- if not s:
- return Token
- node = Token
- for item in s.split('.'):
- node = getattr(node, item)
- return node
-
-
-# Map standard token types to short names, used in CSS class naming.
-# If you add a new item, please be sure to run this file to perform
-# a consistency check for duplicate values.
-STANDARD_TYPES = {
- Token: '',
-
- Text: '',
- Whitespace: 'w',
- Escape: 'esc',
- Error: 'err',
- Other: 'x',
-
- Keyword: 'k',
- Keyword.Constant: 'kc',
- Keyword.Declaration: 'kd',
- Keyword.Namespace: 'kn',
- Keyword.Pseudo: 'kp',
- Keyword.Reserved: 'kr',
- Keyword.Type: 'kt',
-
- Name: 'n',
- Name.Attribute: 'na',
- Name.Builtin: 'nb',
- Name.Builtin.Pseudo: 'bp',
- Name.Class: 'nc',
- Name.Constant: 'no',
- Name.Decorator: 'nd',
- Name.Entity: 'ni',
- Name.Exception: 'ne',
- Name.Function: 'nf',
- Name.Function.Magic: 'fm',
- Name.Property: 'py',
- Name.Label: 'nl',
- Name.Namespace: 'nn',
- Name.Other: 'nx',
- Name.Tag: 'nt',
- Name.Variable: 'nv',
- Name.Variable.Class: 'vc',
- Name.Variable.Global: 'vg',
- Name.Variable.Instance: 'vi',
- Name.Variable.Magic: 'vm',
-
- Literal: 'l',
- Literal.Date: 'ld',
-
- String: 's',
- String.Affix: 'sa',
- String.Backtick: 'sb',
- String.Char: 'sc',
- String.Delimiter: 'dl',
- String.Doc: 'sd',
- String.Double: 's2',
- String.Escape: 'se',
- String.Heredoc: 'sh',
- String.Interpol: 'si',
- String.Other: 'sx',
- String.Regex: 'sr',
- String.Single: 's1',
- String.Symbol: 'ss',
-
- Number: 'm',
- Number.Bin: 'mb',
- Number.Float: 'mf',
- Number.Hex: 'mh',
- Number.Integer: 'mi',
- Number.Integer.Long: 'il',
- Number.Oct: 'mo',
-
- Operator: 'o',
- Operator.Word: 'ow',
-
- Punctuation: 'p',
-
- Comment: 'c',
- Comment.Hashbang: 'ch',
- Comment.Multiline: 'cm',
- Comment.Preproc: 'cp',
- Comment.PreprocFile: 'cpf',
- Comment.Single: 'c1',
- Comment.Special: 'cs',
-
- Generic: 'g',
- Generic.Deleted: 'gd',
- Generic.Emph: 'ge',
- Generic.Error: 'gr',
- Generic.Heading: 'gh',
- Generic.Inserted: 'gi',
- Generic.Output: 'go',
- Generic.Prompt: 'gp',
- Generic.Strong: 'gs',
- Generic.Subheading: 'gu',
- Generic.Traceback: 'gt',
-}
diff --git a/pygments/unistring.py b/pygments/unistring.py
deleted file mode 100644
index dd011cf0..00000000
--- a/pygments/unistring.py
+++ /dev/null
@@ -1,221 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.unistring
- ~~~~~~~~~~~~~~~~~~
-
- Strings of all Unicode characters of a certain category.
- Used for matching in Unicode-aware languages. Run to regenerate.
-
- Inspired by chartypes_create.py from the MoinMoin project.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import sys
-
-Cc = u'\x00-\x1f\x7f-\x9f'
-
-Cf = u'\xad\u0600-\u0605\u061c\u06dd\u070f\u08e2\u180e\u200b-\u200f\u202a-\u202e\u2060-\u2064\u2066-\u206f\ufeff\ufff9-\ufffb'
-
-Cn = u'\u0378-\u0379\u0380-\u0383\u038b\u038d\u03a2\u0530\u0557-\u0558\u058b-\u058c\u0590\u05c8-\u05cf\u05eb-\u05ee\u05f5-\u05ff\u061d\u070e\u074b-\u074c\u07b2-\u07bf\u07fb-\u07fc\u082e-\u082f\u083f\u085c-\u085d\u085f\u086b-\u089f\u08b5\u08be-\u08d2\u0984\u098d-\u098e\u0991-\u0992\u09a9\u09b1\u09b3-\u09b5\u09ba-\u09bb\u09c5-\u09c6\u09c9-\u09ca\u09cf-\u09d6\u09d8-\u09db\u09de\u09e4-\u09e5\u09ff-\u0a00\u0a04\u0a0b-\u0a0e\u0a11-\u0a12\u0a29\u0a31\u0a34\u0a37\u0a3a-\u0a3b\u0a3d\u0a43-\u0a46\u0a49-\u0a4a\u0a4e-\u0a50\u0a52-\u0a58\u0a5d\u0a5f-\u0a65\u0a77-\u0a80\u0a84\u0a8e\u0a92\u0aa9\u0ab1\u0ab4\u0aba-\u0abb\u0ac6\u0aca\u0ace-\u0acf\u0ad1-\u0adf\u0ae4-\u0ae5\u0af2-\u0af8\u0b00\u0b04\u0b0d-\u0b0e\u0b11-\u0b12\u0b29\u0b31\u0b34\u0b3a-\u0b3b\u0b45-\u0b46\u0b49-\u0b4a\u0b4e-\u0b55\u0b58-\u0b5b\u0b5e\u0b64-\u0b65\u0b78-\u0b81\u0b84\u0b8b-\u0b8d\u0b91\u0b96-\u0b98\u0b9b\u0b9d\u0ba0-\u0ba2\u0ba5-\u0ba7\u0bab-\u0bad\u0bba-\u0bbd\u0bc3-\u0bc5\u0bc9\u0bce-\u0bcf\u0bd1-\u0bd6\u0bd8-\u0be5\u0bfb-\u0bff\u0c0d\u0c11\u0c29\u0c3a-\u0c3c\u0c45\u0c49\u0c4e-\u0c54\u0c57\u0c5b-\u0c5f\u0c64-\u0c65\u0c70-\u0c77\u0c8d\u0c91\u0ca9\u0cb4\u0cba-\u0cbb\u0cc5\u0cc9\u0cce-\u0cd4\u0cd7-\u0cdd\u0cdf\u0ce4-\u0ce5\u0cf0\u0cf3-\u0cff\u0d04\u0d0d\u0d11\u0d45\u0d49\u0d50-\u0d53\u0d64-\u0d65\u0d80-\u0d81\u0d84\u0d97-\u0d99\u0db2\u0dbc\u0dbe-\u0dbf\u0dc7-\u0dc9\u0dcb-\u0dce\u0dd5\u0dd7\u0de0-\u0de5\u0df0-\u0df1\u0df5-\u0e00\u0e3b-\u0e3e\u0e5c-\u0e80\u0e83\u0e85-\u0e86\u0e89\u0e8b-\u0e8c\u0e8e-\u0e93\u0e98\u0ea0\u0ea4\u0ea6\u0ea8-\u0ea9\u0eac\u0eba\u0ebe-\u0ebf\u0ec5\u0ec7\u0ece-\u0ecf\u0eda-\u0edb\u0ee0-\u0eff\u0f48\u0f6d-\u0f70\u0f98\u0fbd\u0fcd\u0fdb-\u0fff\u10c6\u10c8-\u10cc\u10ce-\u10cf\u1249\u124e-\u124f\u1257\u1259\u125e-\u125f\u1289\u128e-\u128f\u12b1\u12b6-\u12b7\u12bf\u12c1\u12c6-\u12c7\u12d7\u1311\u1316-\u1317\u135b-\u135c\u137d-\u137f\u139a-\u139f\u13f6-\u13f7\u13fe-\u13ff\u169d-\u169f\u16f9-\u16ff\u170d\u1715-\u171f\u1737-\u173f\u1754-\u175f\u176d\u1771\u1774-\u177f\u17de-\u17df\u17ea-\u17ef\u17fa-\u17ff\u180f\u181a-\u181f\u1879-\u187f\u18ab-\u18af\u18f6-\u18ff\u191f\u192c-\u192f\u193c-\u193f\u1941-\u1943\u196e-\u196f\u1975-\u197f\u19ac-\u19af\u19ca-\u19cf\u19db-\u19dd\u1a1c-\u1a1d\u1a5f\u1a7d-\u1a7e\u1a8a-\u1a8f\u1a9a-\u1a9f\u1aae-\u1aaf\u1abf-\u1aff\u1b4c-\u1b4f\u1b7d-\u1b7f\u1bf4-\u1bfb\u1c38-\u1c3a\u1c4a-\u1c4c\u1c89-\u1c8f\u1cbb-\u1cbc\u1cc8-\u1ccf\u1cfa-\u1cff\u1dfa\u1f16-\u1f17\u1f1e-\u1f1f\u1f46-\u1f47\u1f4e-\u1f4f\u1f58\u1f5a\u1f5c\u1f5e\u1f7e-\u1f7f\u1fb5\u1fc5\u1fd4-\u1fd5\u1fdc\u1ff0-\u1ff1\u1ff5\u1fff\u2065\u2072-\u2073\u208f\u209d-\u209f\u20c0-\u20cf\u20f1-\u20ff\u218c-\u218f\u2427-\u243f\u244b-\u245f\u2b74-\u2b75\u2b96-\u2b97\u2bc9\u2bff\u2c2f\u2c5f\u2cf4-\u2cf8\u2d26\u2d28-\u2d2c\u2d2e-\u2d2f\u2d68-\u2d6e\u2d71-\u2d7e\u2d97-\u2d9f\u2da7\u2daf\u2db7\u2dbf\u2dc7\u2dcf\u2dd7\u2ddf\u2e4f-\u2e7f\u2e9a\u2ef4-\u2eff\u2fd6-\u2fef\u2ffc-\u2fff\u3040\u3097-\u3098\u3100-\u3104\u3130\u318f\u31bb-\u31bf\u31e4-\u31ef\u321f\u32ff\u4db6-\u4dbf\u9ff0-\u9fff\ua48d-\ua48f\ua4c7-\ua4cf\ua62c-\ua63f\ua6f8-\ua6ff\ua7ba-\ua7f6\ua82c-\ua82f\ua83a-\ua83f\ua878-\ua87f\ua8c6-\ua8cd\ua8da-\ua8df\ua954-\ua95e\ua97d-\ua97f\ua9ce\ua9da-\ua9dd\ua9ff\uaa37-\uaa3f\uaa4e-\uaa4f\uaa5a-\uaa5b\uaac3-\uaada\uaaf7-\uab00\uab07-\uab08\uab0f-\uab10\uab17-\uab1f\uab27\uab2f\uab66-\uab6f\uabee-\uabef\uabfa-\uabff\ud7a4-\ud7af\ud7c7-\ud7ca\ud7fc-\ud7ff\ufa6e-\ufa6f\ufada-\ufaff\ufb07-\ufb12\ufb18-\ufb1c\ufb37\ufb3d\ufb3f\ufb42\ufb45\ufbc2-\ufbd2\ufd40-\ufd4f\ufd90-\ufd91\ufdc8-\ufdef\ufdfe-\ufdff\ufe1a-\ufe1f\ufe53\ufe67\ufe6c-\ufe6f\ufe75\ufefd-\ufefe\uff00\uffbf-\uffc1\uffc8-\uffc9\uffd0-\uffd1\uffd8-\uffd9\uffdd-\uffdf\uffe7\uffef-\ufff8\ufffe-\uffff'
-
-Co = u'\ue000-\uf8ff'
-
-try:
- Cs = eval(r"u'\ud800-\udbff\\\udc00\udc01-\udfff'")
-except UnicodeDecodeError:
- Cs = '' # Jython can't handle isolated surrogates
-
-Ll = u'a-z\xb5\xdf-\xf6\xf8-\xff\u0101\u0103\u0105\u0107\u0109\u010b\u010d\u010f\u0111\u0113\u0115\u0117\u0119\u011b\u011d\u011f\u0121\u0123\u0125\u0127\u0129\u012b\u012d\u012f\u0131\u0133\u0135\u0137-\u0138\u013a\u013c\u013e\u0140\u0142\u0144\u0146\u0148-\u0149\u014b\u014d\u014f\u0151\u0153\u0155\u0157\u0159\u015b\u015d\u015f\u0161\u0163\u0165\u0167\u0169\u016b\u016d\u016f\u0171\u0173\u0175\u0177\u017a\u017c\u017e-\u0180\u0183\u0185\u0188\u018c-\u018d\u0192\u0195\u0199-\u019b\u019e\u01a1\u01a3\u01a5\u01a8\u01aa-\u01ab\u01ad\u01b0\u01b4\u01b6\u01b9-\u01ba\u01bd-\u01bf\u01c6\u01c9\u01cc\u01ce\u01d0\u01d2\u01d4\u01d6\u01d8\u01da\u01dc-\u01dd\u01df\u01e1\u01e3\u01e5\u01e7\u01e9\u01eb\u01ed\u01ef-\u01f0\u01f3\u01f5\u01f9\u01fb\u01fd\u01ff\u0201\u0203\u0205\u0207\u0209\u020b\u020d\u020f\u0211\u0213\u0215\u0217\u0219\u021b\u021d\u021f\u0221\u0223\u0225\u0227\u0229\u022b\u022d\u022f\u0231\u0233-\u0239\u023c\u023f-\u0240\u0242\u0247\u0249\u024b\u024d\u024f-\u0293\u0295-\u02af\u0371\u0373\u0377\u037b-\u037d\u0390\u03ac-\u03ce\u03d0-\u03d1\u03d5-\u03d7\u03d9\u03db\u03dd\u03df\u03e1\u03e3\u03e5\u03e7\u03e9\u03eb\u03ed\u03ef-\u03f3\u03f5\u03f8\u03fb-\u03fc\u0430-\u045f\u0461\u0463\u0465\u0467\u0469\u046b\u046d\u046f\u0471\u0473\u0475\u0477\u0479\u047b\u047d\u047f\u0481\u048b\u048d\u048f\u0491\u0493\u0495\u0497\u0499\u049b\u049d\u049f\u04a1\u04a3\u04a5\u04a7\u04a9\u04ab\u04ad\u04af\u04b1\u04b3\u04b5\u04b7\u04b9\u04bb\u04bd\u04bf\u04c2\u04c4\u04c6\u04c8\u04ca\u04cc\u04ce-\u04cf\u04d1\u04d3\u04d5\u04d7\u04d9\u04db\u04dd\u04df\u04e1\u04e3\u04e5\u04e7\u04e9\u04eb\u04ed\u04ef\u04f1\u04f3\u04f5\u04f7\u04f9\u04fb\u04fd\u04ff\u0501\u0503\u0505\u0507\u0509\u050b\u050d\u050f\u0511\u0513\u0515\u0517\u0519\u051b\u051d\u051f\u0521\u0523\u0525\u0527\u0529\u052b\u052d\u052f\u0560-\u0588\u10d0-\u10fa\u10fd-\u10ff\u13f8-\u13fd\u1c80-\u1c88\u1d00-\u1d2b\u1d6b-\u1d77\u1d79-\u1d9a\u1e01\u1e03\u1e05\u1e07\u1e09\u1e0b\u1e0d\u1e0f\u1e11\u1e13\u1e15\u1e17\u1e19\u1e1b\u1e1d\u1e1f\u1e21\u1e23\u1e25\u1e27\u1e29\u1e2b\u1e2d\u1e2f\u1e31\u1e33\u1e35\u1e37\u1e39\u1e3b\u1e3d\u1e3f\u1e41\u1e43\u1e45\u1e47\u1e49\u1e4b\u1e4d\u1e4f\u1e51\u1e53\u1e55\u1e57\u1e59\u1e5b\u1e5d\u1e5f\u1e61\u1e63\u1e65\u1e67\u1e69\u1e6b\u1e6d\u1e6f\u1e71\u1e73\u1e75\u1e77\u1e79\u1e7b\u1e7d\u1e7f\u1e81\u1e83\u1e85\u1e87\u1e89\u1e8b\u1e8d\u1e8f\u1e91\u1e93\u1e95-\u1e9d\u1e9f\u1ea1\u1ea3\u1ea5\u1ea7\u1ea9\u1eab\u1ead\u1eaf\u1eb1\u1eb3\u1eb5\u1eb7\u1eb9\u1ebb\u1ebd\u1ebf\u1ec1\u1ec3\u1ec5\u1ec7\u1ec9\u1ecb\u1ecd\u1ecf\u1ed1\u1ed3\u1ed5\u1ed7\u1ed9\u1edb\u1edd\u1edf\u1ee1\u1ee3\u1ee5\u1ee7\u1ee9\u1eeb\u1eed\u1eef\u1ef1\u1ef3\u1ef5\u1ef7\u1ef9\u1efb\u1efd\u1eff-\u1f07\u1f10-\u1f15\u1f20-\u1f27\u1f30-\u1f37\u1f40-\u1f45\u1f50-\u1f57\u1f60-\u1f67\u1f70-\u1f7d\u1f80-\u1f87\u1f90-\u1f97\u1fa0-\u1fa7\u1fb0-\u1fb4\u1fb6-\u1fb7\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fc7\u1fd0-\u1fd3\u1fd6-\u1fd7\u1fe0-\u1fe7\u1ff2-\u1ff4\u1ff6-\u1ff7\u210a\u210e-\u210f\u2113\u212f\u2134\u2139\u213c-\u213d\u2146-\u2149\u214e\u2184\u2c30-\u2c5e\u2c61\u2c65-\u2c66\u2c68\u2c6a\u2c6c\u2c71\u2c73-\u2c74\u2c76-\u2c7b\u2c81\u2c83\u2c85\u2c87\u2c89\u2c8b\u2c8d\u2c8f\u2c91\u2c93\u2c95\u2c97\u2c99\u2c9b\u2c9d\u2c9f\u2ca1\u2ca3\u2ca5\u2ca7\u2ca9\u2cab\u2cad\u2caf\u2cb1\u2cb3\u2cb5\u2cb7\u2cb9\u2cbb\u2cbd\u2cbf\u2cc1\u2cc3\u2cc5\u2cc7\u2cc9\u2ccb\u2ccd\u2ccf\u2cd1\u2cd3\u2cd5\u2cd7\u2cd9\u2cdb\u2cdd\u2cdf\u2ce1\u2ce3-\u2ce4\u2cec\u2cee\u2cf3\u2d00-\u2d25\u2d27\u2d2d\ua641\ua643\ua645\ua647\ua649\ua64b\ua64d\ua64f\ua651\ua653\ua655\ua657\ua659\ua65b\ua65d\ua65f\ua661\ua663\ua665\ua667\ua669\ua66b\ua66d\ua681\ua683\ua685\ua687\ua689\ua68b\ua68d\ua68f\ua691\ua693\ua695\ua697\ua699\ua69b\ua723\ua725\ua727\ua729\ua72b\ua72d\ua72f-\ua731\ua733\ua735\ua737\ua739\ua73b\ua73d\ua73f\ua741\ua743\ua745\ua747\ua749\ua74b\ua74d\ua74f\ua751\ua753\ua755\ua757\ua759\ua75b\ua75d\ua75f\ua761\ua763\ua765\ua767\ua769\ua76b\ua76d\ua76f\ua771-\ua778\ua77a\ua77c\ua77f\ua781\ua783\ua785\ua787\ua78c\ua78e\ua791\ua793-\ua795\ua797\ua799\ua79b\ua79d\ua79f\ua7a1\ua7a3\ua7a5\ua7a7\ua7a9\ua7af\ua7b5\ua7b7\ua7b9\ua7fa\uab30-\uab5a\uab60-\uab65\uab70-\uabbf\ufb00-\ufb06\ufb13-\ufb17\uff41-\uff5a'
-
-Lm = u'\u02b0-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0374\u037a\u0559\u0640\u06e5-\u06e6\u07f4-\u07f5\u07fa\u081a\u0824\u0828\u0971\u0e46\u0ec6\u10fc\u17d7\u1843\u1aa7\u1c78-\u1c7d\u1d2c-\u1d6a\u1d78\u1d9b-\u1dbf\u2071\u207f\u2090-\u209c\u2c7c-\u2c7d\u2d6f\u2e2f\u3005\u3031-\u3035\u303b\u309d-\u309e\u30fc-\u30fe\ua015\ua4f8-\ua4fd\ua60c\ua67f\ua69c-\ua69d\ua717-\ua71f\ua770\ua788\ua7f8-\ua7f9\ua9cf\ua9e6\uaa70\uaadd\uaaf3-\uaaf4\uab5c-\uab5f\uff70\uff9e-\uff9f'
-
-Lo = u'\xaa\xba\u01bb\u01c0-\u01c3\u0294\u05d0-\u05ea\u05ef-\u05f2\u0620-\u063f\u0641-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u0800-\u0815\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09f0-\u09f1\u09fc\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0af9\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60-\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0cf1-\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e45\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16f1-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17dc\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c77\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5-\u1cf6\u2135-\u2138\u2d30-\u2d67\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3006\u303c\u3041-\u3096\u309f\u30a1-\u30fa\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua014\ua016-\ua48c\ua4d0-\ua4f7\ua500-\ua60b\ua610-\ua61f\ua62a-\ua62b\ua66e\ua6a0-\ua6e5\ua78f\ua7f7\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd-\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9e0-\ua9e4\ua9e7-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa6f\uaa71-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5-\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadc\uaae0-\uaaea\uaaf2\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff66-\uff6f\uff71-\uff9d\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc'
-
-Lt = u'\u01c5\u01c8\u01cb\u01f2\u1f88-\u1f8f\u1f98-\u1f9f\u1fa8-\u1faf\u1fbc\u1fcc\u1ffc'
-
-Lu = u'A-Z\xc0-\xd6\xd8-\xde\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\u037f\u0386\u0388-\u038a\u038c\u038e-\u038f\u0391-\u03a1\u03a3-\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\u0524\u0526\u0528\u052a\u052c\u052e\u0531-\u0556\u10a0-\u10c5\u10c7\u10cd\u13a0-\u13f5\u1c90-\u1cba\u1cbd-\u1cbf\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\u1f5b\u1f5d\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-\u2c70\u2c72\u2c75\u2c7e-\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\u2ceb\u2ced\u2cf2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua660\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua698\ua69a\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\ua78d\ua790\ua792\ua796\ua798\ua79a\ua79c\ua79e\ua7a0\ua7a2\ua7a4\ua7a6\ua7a8\ua7aa-\ua7ae\ua7b0-\ua7b4\ua7b6\ua7b8\uff21-\uff3a'
-
-Mc = u'\u0903\u093b\u093e-\u0940\u0949-\u094c\u094e-\u094f\u0982-\u0983\u09be-\u09c0\u09c7-\u09c8\u09cb-\u09cc\u09d7\u0a03\u0a3e-\u0a40\u0a83\u0abe-\u0ac0\u0ac9\u0acb-\u0acc\u0b02-\u0b03\u0b3e\u0b40\u0b47-\u0b48\u0b4b-\u0b4c\u0b57\u0bbe-\u0bbf\u0bc1-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcc\u0bd7\u0c01-\u0c03\u0c41-\u0c44\u0c82-\u0c83\u0cbe\u0cc0-\u0cc4\u0cc7-\u0cc8\u0cca-\u0ccb\u0cd5-\u0cd6\u0d02-\u0d03\u0d3e-\u0d40\u0d46-\u0d48\u0d4a-\u0d4c\u0d57\u0d82-\u0d83\u0dcf-\u0dd1\u0dd8-\u0ddf\u0df2-\u0df3\u0f3e-\u0f3f\u0f7f\u102b-\u102c\u1031\u1038\u103b-\u103c\u1056-\u1057\u1062-\u1064\u1067-\u106d\u1083-\u1084\u1087-\u108c\u108f\u109a-\u109c\u17b6\u17be-\u17c5\u17c7-\u17c8\u1923-\u1926\u1929-\u192b\u1930-\u1931\u1933-\u1938\u1a19-\u1a1a\u1a55\u1a57\u1a61\u1a63-\u1a64\u1a6d-\u1a72\u1b04\u1b35\u1b3b\u1b3d-\u1b41\u1b43-\u1b44\u1b82\u1ba1\u1ba6-\u1ba7\u1baa\u1be7\u1bea-\u1bec\u1bee\u1bf2-\u1bf3\u1c24-\u1c2b\u1c34-\u1c35\u1ce1\u1cf2-\u1cf3\u1cf7\u302e-\u302f\ua823-\ua824\ua827\ua880-\ua881\ua8b4-\ua8c3\ua952-\ua953\ua983\ua9b4-\ua9b5\ua9ba-\ua9bb\ua9bd-\ua9c0\uaa2f-\uaa30\uaa33-\uaa34\uaa4d\uaa7b\uaa7d\uaaeb\uaaee-\uaaef\uaaf5\uabe3-\uabe4\uabe6-\uabe7\uabe9-\uabea\uabec'
-
-Me = u'\u0488-\u0489\u1abe\u20dd-\u20e0\u20e2-\u20e4\ua670-\ua672'
-
-Mn = u'\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09c1-\u09c4\u09cd\u09e2-\u09e3\u09fe\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0afa-\u0aff\u0b01\u0b3c\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b62-\u0b63\u0b82\u0bc0\u0bcd\u0c00\u0c04\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc6\u0ccc-\u0ccd\u0ce2-\u0ce3\u0d00-\u0d01\u0d3b-\u0d3c\u0d41-\u0d44\u0d4d\u0d62-\u0d63\u0dca\u0dd2-\u0dd4\u0dd6\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u1885-\u1886\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u3099-\u309a\ua66f\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4-\ua8c5\ua8e0-\ua8f1\ua8ff\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f'
-
-Nd = u'0-9\u0660-\u0669\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0de6-\u0def\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\ua9f0-\ua9f9\uaa50-\uaa59\uabf0-\uabf9\uff10-\uff19'
-
-Nl = u'\u16ee-\u16f0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303a\ua6e6-\ua6ef'
-
-No = u'\xb2-\xb3\xb9\xbc-\xbe\u09f4-\u09f9\u0b72-\u0b77\u0bf0-\u0bf2\u0c78-\u0c7e\u0d58-\u0d5e\u0d70-\u0d78\u0f2a-\u0f33\u1369-\u137c\u17f0-\u17f9\u19da\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215f\u2189\u2460-\u249b\u24ea-\u24ff\u2776-\u2793\u2cfd\u3192-\u3195\u3220-\u3229\u3248-\u324f\u3251-\u325f\u3280-\u3289\u32b1-\u32bf\ua830-\ua835'
-
-Pc = u'_\u203f-\u2040\u2054\ufe33-\ufe34\ufe4d-\ufe4f\uff3f'
-
-Pd = u'\\-\u058a\u05be\u1400\u1806\u2010-\u2015\u2e17\u2e1a\u2e3a-\u2e3b\u2e40\u301c\u3030\u30a0\ufe31-\ufe32\ufe58\ufe63\uff0d'
-
-Pe = u')\\]}\u0f3b\u0f3d\u169c\u2046\u207e\u208e\u2309\u230b\u232a\u2769\u276b\u276d\u276f\u2771\u2773\u2775\u27c6\u27e7\u27e9\u27eb\u27ed\u27ef\u2984\u2986\u2988\u298a\u298c\u298e\u2990\u2992\u2994\u2996\u2998\u29d9\u29db\u29fd\u2e23\u2e25\u2e27\u2e29\u3009\u300b\u300d\u300f\u3011\u3015\u3017\u3019\u301b\u301e-\u301f\ufd3e\ufe18\ufe36\ufe38\ufe3a\ufe3c\ufe3e\ufe40\ufe42\ufe44\ufe48\ufe5a\ufe5c\ufe5e\uff09\uff3d\uff5d\uff60\uff63'
-
-Pf = u'\xbb\u2019\u201d\u203a\u2e03\u2e05\u2e0a\u2e0d\u2e1d\u2e21'
-
-Pi = u'\xab\u2018\u201b-\u201c\u201f\u2039\u2e02\u2e04\u2e09\u2e0c\u2e1c\u2e20'
-
-Po = u"!-#%-'*,.-/:-;?-@\\\\\xa1\xa7\xb6-\xb7\xbf\u037e\u0387\u055a-\u055f\u0589\u05c0\u05c3\u05c6\u05f3-\u05f4\u0609-\u060a\u060c-\u060d\u061b\u061e-\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964-\u0965\u0970\u09fd\u0a76\u0af0\u0c84\u0df4\u0e4f\u0e5a-\u0e5b\u0f04-\u0f12\u0f14\u0f85\u0fd0-\u0fd4\u0fd9-\u0fda\u104a-\u104f\u10fb\u1360-\u1368\u166d-\u166e\u16eb-\u16ed\u1735-\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u1805\u1807-\u180a\u1944-\u1945\u1a1e-\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e-\u1c7f\u1cc0-\u1cc7\u1cd3\u2016-\u2017\u2020-\u2027\u2030-\u2038\u203b-\u203e\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205e\u2cf9-\u2cfc\u2cfe-\u2cff\u2d70\u2e00-\u2e01\u2e06-\u2e08\u2e0b\u2e0e-\u2e16\u2e18-\u2e19\u2e1b\u2e1e-\u2e1f\u2e2a-\u2e2e\u2e30-\u2e39\u2e3c-\u2e3f\u2e41\u2e43-\u2e4e\u3001-\u3003\u303d\u30fb\ua4fe-\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce-\ua8cf\ua8f8-\ua8fa\ua8fc\ua92e-\ua92f\ua95f\ua9c1-\ua9cd\ua9de-\ua9df\uaa5c-\uaa5f\uaade-\uaadf\uaaf0-\uaaf1\uabeb\ufe10-\ufe16\ufe19\ufe30\ufe45-\ufe46\ufe49-\ufe4c\ufe50-\ufe52\ufe54-\ufe57\ufe5f-\ufe61\ufe68\ufe6a-\ufe6b\uff01-\uff03\uff05-\uff07\uff0a\uff0c\uff0e-\uff0f\uff1a-\uff1b\uff1f-\uff20\uff3c\uff61\uff64-\uff65"
-
-Ps = u'(\\[{\u0f3a\u0f3c\u169b\u201a\u201e\u2045\u207d\u208d\u2308\u230a\u2329\u2768\u276a\u276c\u276e\u2770\u2772\u2774\u27c5\u27e6\u27e8\u27ea\u27ec\u27ee\u2983\u2985\u2987\u2989\u298b\u298d\u298f\u2991\u2993\u2995\u2997\u29d8\u29da\u29fc\u2e22\u2e24\u2e26\u2e28\u2e42\u3008\u300a\u300c\u300e\u3010\u3014\u3016\u3018\u301a\u301d\ufd3f\ufe17\ufe35\ufe37\ufe39\ufe3b\ufe3d\ufe3f\ufe41\ufe43\ufe47\ufe59\ufe5b\ufe5d\uff08\uff3b\uff5b\uff5f\uff62'
-
-Sc = u'$\xa2-\xa5\u058f\u060b\u07fe-\u07ff\u09f2-\u09f3\u09fb\u0af1\u0bf9\u0e3f\u17db\u20a0-\u20bf\ua838\ufdfc\ufe69\uff04\uffe0-\uffe1\uffe5-\uffe6'
-
-Sk = u'\\^`\xa8\xaf\xb4\xb8\u02c2-\u02c5\u02d2-\u02df\u02e5-\u02eb\u02ed\u02ef-\u02ff\u0375\u0384-\u0385\u1fbd\u1fbf-\u1fc1\u1fcd-\u1fcf\u1fdd-\u1fdf\u1fed-\u1fef\u1ffd-\u1ffe\u309b-\u309c\ua700-\ua716\ua720-\ua721\ua789-\ua78a\uab5b\ufbb2-\ufbc1\uff3e\uff40\uffe3'
-
-Sm = u'+<->|~\xac\xb1\xd7\xf7\u03f6\u0606-\u0608\u2044\u2052\u207a-\u207c\u208a-\u208c\u2118\u2140-\u2144\u214b\u2190-\u2194\u219a-\u219b\u21a0\u21a3\u21a6\u21ae\u21ce-\u21cf\u21d2\u21d4\u21f4-\u22ff\u2320-\u2321\u237c\u239b-\u23b3\u23dc-\u23e1\u25b7\u25c1\u25f8-\u25ff\u266f\u27c0-\u27c4\u27c7-\u27e5\u27f0-\u27ff\u2900-\u2982\u2999-\u29d7\u29dc-\u29fb\u29fe-\u2aff\u2b30-\u2b44\u2b47-\u2b4c\ufb29\ufe62\ufe64-\ufe66\uff0b\uff1c-\uff1e\uff5c\uff5e\uffe2\uffe9-\uffec'
-
-So = u'\xa6\xa9\xae\xb0\u0482\u058d-\u058e\u060e-\u060f\u06de\u06e9\u06fd-\u06fe\u07f6\u09fa\u0b70\u0bf3-\u0bf8\u0bfa\u0c7f\u0d4f\u0d79\u0f01-\u0f03\u0f13\u0f15-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38\u0fbe-\u0fc5\u0fc7-\u0fcc\u0fce-\u0fcf\u0fd5-\u0fd8\u109e-\u109f\u1390-\u1399\u1940\u19de-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2117\u211e-\u2123\u2125\u2127\u2129\u212e\u213a-\u213b\u214a\u214c-\u214d\u214f\u218a-\u218b\u2195-\u2199\u219c-\u219f\u21a1-\u21a2\u21a4-\u21a5\u21a7-\u21ad\u21af-\u21cd\u21d0-\u21d1\u21d3\u21d5-\u21f3\u2300-\u2307\u230c-\u231f\u2322-\u2328\u232b-\u237b\u237d-\u239a\u23b4-\u23db\u23e2-\u2426\u2440-\u244a\u249c-\u24e9\u2500-\u25b6\u25b8-\u25c0\u25c2-\u25f7\u2600-\u266e\u2670-\u2767\u2794-\u27bf\u2800-\u28ff\u2b00-\u2b2f\u2b45-\u2b46\u2b4d-\u2b73\u2b76-\u2b95\u2b98-\u2bc8\u2bca-\u2bfe\u2ce5-\u2cea\u2e80-\u2e99\u2e9b-\u2ef3\u2f00-\u2fd5\u2ff0-\u2ffb\u3004\u3012-\u3013\u3020\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3\u3200-\u321e\u322a-\u3247\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u32fe\u3300-\u33ff\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ua836-\ua837\ua839\uaa77-\uaa79\ufdfd\uffe4\uffe8\uffed-\uffee\ufffc-\ufffd'
-
-Zl = u'\u2028'
-
-Zp = u'\u2029'
-
-Zs = u' \xa0\u1680\u2000-\u200a\u202f\u205f\u3000'
-
-xid_continue = u'0-9A-Z_a-z\xaa\xb5\xb7\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376-\u0377\u037b-\u037d\u037f\u0386-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u05d0-\u05ea\u05ef-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u07fd\u0800-\u082d\u0840-\u085b\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u08d3-\u08e1\u08e3-\u0963\u0966-\u096f\u0971-\u0983\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7-\u09c8\u09cb-\u09ce\u09d7\u09dc-\u09dd\u09df-\u09e3\u09e6-\u09f1\u09fc\u09fe\u0a01-\u0a03\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a3c\u0a3e-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0af9-\u0aff\u0b01-\u0b03\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47-\u0b48\u0b4b-\u0b4d\u0b56-\u0b57\u0b5c-\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82-\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c00-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c58-\u0c5a\u0c60-\u0c63\u0c66-\u0c6f\u0c80-\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5-\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1-\u0cf2\u0d00-\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d54-\u0d57\u0d5f-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82-\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2-\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18-\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1369-\u1371\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772-\u1773\u1780-\u17d3\u17d7\u17dc-\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1878\u1880-\u18aa\u18b0-\u18f5\u1900-\u191e\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19da\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1ab0-\u1abd\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1cd0-\u1cd2\u1cd4-\u1cf9\u1d00-\u1df9\u1dfb-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u203f-\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099-\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua7b9\ua7f7-\ua827\ua840-\ua873\ua880-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua8fd-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\ua9e0-\ua9fe\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabea\uabec-\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufc5d\ufc64-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdf9\ufe00-\ufe0f\ufe20-\ufe2f\ufe33-\ufe34\ufe4d-\ufe4f\ufe71\ufe73\ufe77\ufe79\ufe7b\ufe7d\ufe7f-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc'
-
-xid_start = u'A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376-\u0377\u037b-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4-\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09f0-\u09f1\u09fc\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0af9\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60-\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0cf1-\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e40-\u0e46\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5-\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a-\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7b9\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd-\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5-\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufc5d\ufc64-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdf9\ufe71\ufe73\ufe77\ufe79\ufe7b\ufe7d\ufe7f-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uff9d\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc'
-
-if sys.maxunicode > 0xFFFF:
- # non-BMP characters, use only on wide Unicode builds
- Cf += u'\U000110bd\U000110cd\U0001bca0-\U0001bca3\U0001d173-\U0001d17a\U000e0001\U000e0020-\U000e007f'
-
- Cn += u'\U0001000c\U00010027\U0001003b\U0001003e\U0001004e-\U0001004f\U0001005e-\U0001007f\U000100fb-\U000100ff\U00010103-\U00010106\U00010134-\U00010136\U0001018f\U0001019c-\U0001019f\U000101a1-\U000101cf\U000101fe-\U0001027f\U0001029d-\U0001029f\U000102d1-\U000102df\U000102fc-\U000102ff\U00010324-\U0001032c\U0001034b-\U0001034f\U0001037b-\U0001037f\U0001039e\U000103c4-\U000103c7\U000103d6-\U000103ff\U0001049e-\U0001049f\U000104aa-\U000104af\U000104d4-\U000104d7\U000104fc-\U000104ff\U00010528-\U0001052f\U00010564-\U0001056e\U00010570-\U000105ff\U00010737-\U0001073f\U00010756-\U0001075f\U00010768-\U000107ff\U00010806-\U00010807\U00010809\U00010836\U00010839-\U0001083b\U0001083d-\U0001083e\U00010856\U0001089f-\U000108a6\U000108b0-\U000108df\U000108f3\U000108f6-\U000108fa\U0001091c-\U0001091e\U0001093a-\U0001093e\U00010940-\U0001097f\U000109b8-\U000109bb\U000109d0-\U000109d1\U00010a04\U00010a07-\U00010a0b\U00010a14\U00010a18\U00010a36-\U00010a37\U00010a3b-\U00010a3e\U00010a49-\U00010a4f\U00010a59-\U00010a5f\U00010aa0-\U00010abf\U00010ae7-\U00010aea\U00010af7-\U00010aff\U00010b36-\U00010b38\U00010b56-\U00010b57\U00010b73-\U00010b77\U00010b92-\U00010b98\U00010b9d-\U00010ba8\U00010bb0-\U00010bff\U00010c49-\U00010c7f\U00010cb3-\U00010cbf\U00010cf3-\U00010cf9\U00010d28-\U00010d2f\U00010d3a-\U00010e5f\U00010e7f-\U00010eff\U00010f28-\U00010f2f\U00010f5a-\U00010fff\U0001104e-\U00011051\U00011070-\U0001107e\U000110c2-\U000110cc\U000110ce-\U000110cf\U000110e9-\U000110ef\U000110fa-\U000110ff\U00011135\U00011147-\U0001114f\U00011177-\U0001117f\U000111ce-\U000111cf\U000111e0\U000111f5-\U000111ff\U00011212\U0001123f-\U0001127f\U00011287\U00011289\U0001128e\U0001129e\U000112aa-\U000112af\U000112eb-\U000112ef\U000112fa-\U000112ff\U00011304\U0001130d-\U0001130e\U00011311-\U00011312\U00011329\U00011331\U00011334\U0001133a\U00011345-\U00011346\U00011349-\U0001134a\U0001134e-\U0001134f\U00011351-\U00011356\U00011358-\U0001135c\U00011364-\U00011365\U0001136d-\U0001136f\U00011375-\U000113ff\U0001145a\U0001145c\U0001145f-\U0001147f\U000114c8-\U000114cf\U000114da-\U0001157f\U000115b6-\U000115b7\U000115de-\U000115ff\U00011645-\U0001164f\U0001165a-\U0001165f\U0001166d-\U0001167f\U000116b8-\U000116bf\U000116ca-\U000116ff\U0001171b-\U0001171c\U0001172c-\U0001172f\U00011740-\U000117ff\U0001183c-\U0001189f\U000118f3-\U000118fe\U00011900-\U000119ff\U00011a48-\U00011a4f\U00011a84-\U00011a85\U00011aa3-\U00011abf\U00011af9-\U00011bff\U00011c09\U00011c37\U00011c46-\U00011c4f\U00011c6d-\U00011c6f\U00011c90-\U00011c91\U00011ca8\U00011cb7-\U00011cff\U00011d07\U00011d0a\U00011d37-\U00011d39\U00011d3b\U00011d3e\U00011d48-\U00011d4f\U00011d5a-\U00011d5f\U00011d66\U00011d69\U00011d8f\U00011d92\U00011d99-\U00011d9f\U00011daa-\U00011edf\U00011ef9-\U00011fff\U0001239a-\U000123ff\U0001246f\U00012475-\U0001247f\U00012544-\U00012fff\U0001342f-\U000143ff\U00014647-\U000167ff\U00016a39-\U00016a3f\U00016a5f\U00016a6a-\U00016a6d\U00016a70-\U00016acf\U00016aee-\U00016aef\U00016af6-\U00016aff\U00016b46-\U00016b4f\U00016b5a\U00016b62\U00016b78-\U00016b7c\U00016b90-\U00016e3f\U00016e9b-\U00016eff\U00016f45-\U00016f4f\U00016f7f-\U00016f8e\U00016fa0-\U00016fdf\U00016fe2-\U00016fff\U000187f2-\U000187ff\U00018af3-\U0001afff\U0001b11f-\U0001b16f\U0001b2fc-\U0001bbff\U0001bc6b-\U0001bc6f\U0001bc7d-\U0001bc7f\U0001bc89-\U0001bc8f\U0001bc9a-\U0001bc9b\U0001bca4-\U0001cfff\U0001d0f6-\U0001d0ff\U0001d127-\U0001d128\U0001d1e9-\U0001d1ff\U0001d246-\U0001d2df\U0001d2f4-\U0001d2ff\U0001d357-\U0001d35f\U0001d379-\U0001d3ff\U0001d455\U0001d49d\U0001d4a0-\U0001d4a1\U0001d4a3-\U0001d4a4\U0001d4a7-\U0001d4a8\U0001d4ad\U0001d4ba\U0001d4bc\U0001d4c4\U0001d506\U0001d50b-\U0001d50c\U0001d515\U0001d51d\U0001d53a\U0001d53f\U0001d545\U0001d547-\U0001d549\U0001d551\U0001d6a6-\U0001d6a7\U0001d7cc-\U0001d7cd\U0001da8c-\U0001da9a\U0001daa0\U0001dab0-\U0001dfff\U0001e007\U0001e019-\U0001e01a\U0001e022\U0001e025\U0001e02b-\U0001e7ff\U0001e8c5-\U0001e8c6\U0001e8d7-\U0001e8ff\U0001e94b-\U0001e94f\U0001e95a-\U0001e95d\U0001e960-\U0001ec70\U0001ecb5-\U0001edff\U0001ee04\U0001ee20\U0001ee23\U0001ee25-\U0001ee26\U0001ee28\U0001ee33\U0001ee38\U0001ee3a\U0001ee3c-\U0001ee41\U0001ee43-\U0001ee46\U0001ee48\U0001ee4a\U0001ee4c\U0001ee50\U0001ee53\U0001ee55-\U0001ee56\U0001ee58\U0001ee5a\U0001ee5c\U0001ee5e\U0001ee60\U0001ee63\U0001ee65-\U0001ee66\U0001ee6b\U0001ee73\U0001ee78\U0001ee7d\U0001ee7f\U0001ee8a\U0001ee9c-\U0001eea0\U0001eea4\U0001eeaa\U0001eebc-\U0001eeef\U0001eef2-\U0001efff\U0001f02c-\U0001f02f\U0001f094-\U0001f09f\U0001f0af-\U0001f0b0\U0001f0c0\U0001f0d0\U0001f0f6-\U0001f0ff\U0001f10d-\U0001f10f\U0001f16c-\U0001f16f\U0001f1ad-\U0001f1e5\U0001f203-\U0001f20f\U0001f23c-\U0001f23f\U0001f249-\U0001f24f\U0001f252-\U0001f25f\U0001f266-\U0001f2ff\U0001f6d5-\U0001f6df\U0001f6ed-\U0001f6ef\U0001f6fa-\U0001f6ff\U0001f774-\U0001f77f\U0001f7d9-\U0001f7ff\U0001f80c-\U0001f80f\U0001f848-\U0001f84f\U0001f85a-\U0001f85f\U0001f888-\U0001f88f\U0001f8ae-\U0001f8ff\U0001f90c-\U0001f90f\U0001f93f\U0001f971-\U0001f972\U0001f977-\U0001f979\U0001f97b\U0001f9a3-\U0001f9af\U0001f9ba-\U0001f9bf\U0001f9c3-\U0001f9cf\U0001fa00-\U0001fa5f\U0001fa6e-\U0001ffff\U0002a6d7-\U0002a6ff\U0002b735-\U0002b73f\U0002b81e-\U0002b81f\U0002cea2-\U0002ceaf\U0002ebe1-\U0002f7ff\U0002fa1e-\U000e0000\U000e0002-\U000e001f\U000e0080-\U000e00ff\U000e01f0-\U000effff\U000ffffe-\U000fffff\U0010fffe-\U0010ffff'
-
- Co += u'\U000f0000-\U000ffffd\U00100000-\U0010fffd'
-
- Ll += u'\U00010428-\U0001044f\U000104d8-\U000104fb\U00010cc0-\U00010cf2\U000118c0-\U000118df\U00016e60-\U00016e7f\U0001d41a-\U0001d433\U0001d44e-\U0001d454\U0001d456-\U0001d467\U0001d482-\U0001d49b\U0001d4b6-\U0001d4b9\U0001d4bb\U0001d4bd-\U0001d4c3\U0001d4c5-\U0001d4cf\U0001d4ea-\U0001d503\U0001d51e-\U0001d537\U0001d552-\U0001d56b\U0001d586-\U0001d59f\U0001d5ba-\U0001d5d3\U0001d5ee-\U0001d607\U0001d622-\U0001d63b\U0001d656-\U0001d66f\U0001d68a-\U0001d6a5\U0001d6c2-\U0001d6da\U0001d6dc-\U0001d6e1\U0001d6fc-\U0001d714\U0001d716-\U0001d71b\U0001d736-\U0001d74e\U0001d750-\U0001d755\U0001d770-\U0001d788\U0001d78a-\U0001d78f\U0001d7aa-\U0001d7c2\U0001d7c4-\U0001d7c9\U0001d7cb\U0001e922-\U0001e943'
-
- Lm += u'\U00016b40-\U00016b43\U00016f93-\U00016f9f\U00016fe0-\U00016fe1'
-
- Lo += u'\U00010000-\U0001000b\U0001000d-\U00010026\U00010028-\U0001003a\U0001003c-\U0001003d\U0001003f-\U0001004d\U00010050-\U0001005d\U00010080-\U000100fa\U00010280-\U0001029c\U000102a0-\U000102d0\U00010300-\U0001031f\U0001032d-\U00010340\U00010342-\U00010349\U00010350-\U00010375\U00010380-\U0001039d\U000103a0-\U000103c3\U000103c8-\U000103cf\U00010450-\U0001049d\U00010500-\U00010527\U00010530-\U00010563\U00010600-\U00010736\U00010740-\U00010755\U00010760-\U00010767\U00010800-\U00010805\U00010808\U0001080a-\U00010835\U00010837-\U00010838\U0001083c\U0001083f-\U00010855\U00010860-\U00010876\U00010880-\U0001089e\U000108e0-\U000108f2\U000108f4-\U000108f5\U00010900-\U00010915\U00010920-\U00010939\U00010980-\U000109b7\U000109be-\U000109bf\U00010a00\U00010a10-\U00010a13\U00010a15-\U00010a17\U00010a19-\U00010a35\U00010a60-\U00010a7c\U00010a80-\U00010a9c\U00010ac0-\U00010ac7\U00010ac9-\U00010ae4\U00010b00-\U00010b35\U00010b40-\U00010b55\U00010b60-\U00010b72\U00010b80-\U00010b91\U00010c00-\U00010c48\U00010d00-\U00010d23\U00010f00-\U00010f1c\U00010f27\U00010f30-\U00010f45\U00011003-\U00011037\U00011083-\U000110af\U000110d0-\U000110e8\U00011103-\U00011126\U00011144\U00011150-\U00011172\U00011176\U00011183-\U000111b2\U000111c1-\U000111c4\U000111da\U000111dc\U00011200-\U00011211\U00011213-\U0001122b\U00011280-\U00011286\U00011288\U0001128a-\U0001128d\U0001128f-\U0001129d\U0001129f-\U000112a8\U000112b0-\U000112de\U00011305-\U0001130c\U0001130f-\U00011310\U00011313-\U00011328\U0001132a-\U00011330\U00011332-\U00011333\U00011335-\U00011339\U0001133d\U00011350\U0001135d-\U00011361\U00011400-\U00011434\U00011447-\U0001144a\U00011480-\U000114af\U000114c4-\U000114c5\U000114c7\U00011580-\U000115ae\U000115d8-\U000115db\U00011600-\U0001162f\U00011644\U00011680-\U000116aa\U00011700-\U0001171a\U00011800-\U0001182b\U000118ff\U00011a00\U00011a0b-\U00011a32\U00011a3a\U00011a50\U00011a5c-\U00011a83\U00011a86-\U00011a89\U00011a9d\U00011ac0-\U00011af8\U00011c00-\U00011c08\U00011c0a-\U00011c2e\U00011c40\U00011c72-\U00011c8f\U00011d00-\U00011d06\U00011d08-\U00011d09\U00011d0b-\U00011d30\U00011d46\U00011d60-\U00011d65\U00011d67-\U00011d68\U00011d6a-\U00011d89\U00011d98\U00011ee0-\U00011ef2\U00012000-\U00012399\U00012480-\U00012543\U00013000-\U0001342e\U00014400-\U00014646\U00016800-\U00016a38\U00016a40-\U00016a5e\U00016ad0-\U00016aed\U00016b00-\U00016b2f\U00016b63-\U00016b77\U00016b7d-\U00016b8f\U00016f00-\U00016f44\U00016f50\U00017000-\U000187f1\U00018800-\U00018af2\U0001b000-\U0001b11e\U0001b170-\U0001b2fb\U0001bc00-\U0001bc6a\U0001bc70-\U0001bc7c\U0001bc80-\U0001bc88\U0001bc90-\U0001bc99\U0001e800-\U0001e8c4\U0001ee00-\U0001ee03\U0001ee05-\U0001ee1f\U0001ee21-\U0001ee22\U0001ee24\U0001ee27\U0001ee29-\U0001ee32\U0001ee34-\U0001ee37\U0001ee39\U0001ee3b\U0001ee42\U0001ee47\U0001ee49\U0001ee4b\U0001ee4d-\U0001ee4f\U0001ee51-\U0001ee52\U0001ee54\U0001ee57\U0001ee59\U0001ee5b\U0001ee5d\U0001ee5f\U0001ee61-\U0001ee62\U0001ee64\U0001ee67-\U0001ee6a\U0001ee6c-\U0001ee72\U0001ee74-\U0001ee77\U0001ee79-\U0001ee7c\U0001ee7e\U0001ee80-\U0001ee89\U0001ee8b-\U0001ee9b\U0001eea1-\U0001eea3\U0001eea5-\U0001eea9\U0001eeab-\U0001eebb\U00020000-\U0002a6d6\U0002a700-\U0002b734\U0002b740-\U0002b81d\U0002b820-\U0002cea1\U0002ceb0-\U0002ebe0\U0002f800-\U0002fa1d'
-
- Lu += u'\U00010400-\U00010427\U000104b0-\U000104d3\U00010c80-\U00010cb2\U000118a0-\U000118bf\U00016e40-\U00016e5f\U0001d400-\U0001d419\U0001d434-\U0001d44d\U0001d468-\U0001d481\U0001d49c\U0001d49e-\U0001d49f\U0001d4a2\U0001d4a5-\U0001d4a6\U0001d4a9-\U0001d4ac\U0001d4ae-\U0001d4b5\U0001d4d0-\U0001d4e9\U0001d504-\U0001d505\U0001d507-\U0001d50a\U0001d50d-\U0001d514\U0001d516-\U0001d51c\U0001d538-\U0001d539\U0001d53b-\U0001d53e\U0001d540-\U0001d544\U0001d546\U0001d54a-\U0001d550\U0001d56c-\U0001d585\U0001d5a0-\U0001d5b9\U0001d5d4-\U0001d5ed\U0001d608-\U0001d621\U0001d63c-\U0001d655\U0001d670-\U0001d689\U0001d6a8-\U0001d6c0\U0001d6e2-\U0001d6fa\U0001d71c-\U0001d734\U0001d756-\U0001d76e\U0001d790-\U0001d7a8\U0001d7ca\U0001e900-\U0001e921'
-
- Mc += u'\U00011000\U00011002\U00011082\U000110b0-\U000110b2\U000110b7-\U000110b8\U0001112c\U00011145-\U00011146\U00011182\U000111b3-\U000111b5\U000111bf-\U000111c0\U0001122c-\U0001122e\U00011232-\U00011233\U00011235\U000112e0-\U000112e2\U00011302-\U00011303\U0001133e-\U0001133f\U00011341-\U00011344\U00011347-\U00011348\U0001134b-\U0001134d\U00011357\U00011362-\U00011363\U00011435-\U00011437\U00011440-\U00011441\U00011445\U000114b0-\U000114b2\U000114b9\U000114bb-\U000114be\U000114c1\U000115af-\U000115b1\U000115b8-\U000115bb\U000115be\U00011630-\U00011632\U0001163b-\U0001163c\U0001163e\U000116ac\U000116ae-\U000116af\U000116b6\U00011720-\U00011721\U00011726\U0001182c-\U0001182e\U00011838\U00011a39\U00011a57-\U00011a58\U00011a97\U00011c2f\U00011c3e\U00011ca9\U00011cb1\U00011cb4\U00011d8a-\U00011d8e\U00011d93-\U00011d94\U00011d96\U00011ef5-\U00011ef6\U00016f51-\U00016f7e\U0001d165-\U0001d166\U0001d16d-\U0001d172'
-
- Mn += u'\U000101fd\U000102e0\U00010376-\U0001037a\U00010a01-\U00010a03\U00010a05-\U00010a06\U00010a0c-\U00010a0f\U00010a38-\U00010a3a\U00010a3f\U00010ae5-\U00010ae6\U00010d24-\U00010d27\U00010f46-\U00010f50\U00011001\U00011038-\U00011046\U0001107f-\U00011081\U000110b3-\U000110b6\U000110b9-\U000110ba\U00011100-\U00011102\U00011127-\U0001112b\U0001112d-\U00011134\U00011173\U00011180-\U00011181\U000111b6-\U000111be\U000111c9-\U000111cc\U0001122f-\U00011231\U00011234\U00011236-\U00011237\U0001123e\U000112df\U000112e3-\U000112ea\U00011300-\U00011301\U0001133b-\U0001133c\U00011340\U00011366-\U0001136c\U00011370-\U00011374\U00011438-\U0001143f\U00011442-\U00011444\U00011446\U0001145e\U000114b3-\U000114b8\U000114ba\U000114bf-\U000114c0\U000114c2-\U000114c3\U000115b2-\U000115b5\U000115bc-\U000115bd\U000115bf-\U000115c0\U000115dc-\U000115dd\U00011633-\U0001163a\U0001163d\U0001163f-\U00011640\U000116ab\U000116ad\U000116b0-\U000116b5\U000116b7\U0001171d-\U0001171f\U00011722-\U00011725\U00011727-\U0001172b\U0001182f-\U00011837\U00011839-\U0001183a\U00011a01-\U00011a0a\U00011a33-\U00011a38\U00011a3b-\U00011a3e\U00011a47\U00011a51-\U00011a56\U00011a59-\U00011a5b\U00011a8a-\U00011a96\U00011a98-\U00011a99\U00011c30-\U00011c36\U00011c38-\U00011c3d\U00011c3f\U00011c92-\U00011ca7\U00011caa-\U00011cb0\U00011cb2-\U00011cb3\U00011cb5-\U00011cb6\U00011d31-\U00011d36\U00011d3a\U00011d3c-\U00011d3d\U00011d3f-\U00011d45\U00011d47\U00011d90-\U00011d91\U00011d95\U00011d97\U00011ef3-\U00011ef4\U00016af0-\U00016af4\U00016b30-\U00016b36\U00016f8f-\U00016f92\U0001bc9d-\U0001bc9e\U0001d167-\U0001d169\U0001d17b-\U0001d182\U0001d185-\U0001d18b\U0001d1aa-\U0001d1ad\U0001d242-\U0001d244\U0001da00-\U0001da36\U0001da3b-\U0001da6c\U0001da75\U0001da84\U0001da9b-\U0001da9f\U0001daa1-\U0001daaf\U0001e000-\U0001e006\U0001e008-\U0001e018\U0001e01b-\U0001e021\U0001e023-\U0001e024\U0001e026-\U0001e02a\U0001e8d0-\U0001e8d6\U0001e944-\U0001e94a\U000e0100-\U000e01ef'
-
- Nd += u'\U000104a0-\U000104a9\U00010d30-\U00010d39\U00011066-\U0001106f\U000110f0-\U000110f9\U00011136-\U0001113f\U000111d0-\U000111d9\U000112f0-\U000112f9\U00011450-\U00011459\U000114d0-\U000114d9\U00011650-\U00011659\U000116c0-\U000116c9\U00011730-\U00011739\U000118e0-\U000118e9\U00011c50-\U00011c59\U00011d50-\U00011d59\U00011da0-\U00011da9\U00016a60-\U00016a69\U00016b50-\U00016b59\U0001d7ce-\U0001d7ff\U0001e950-\U0001e959'
-
- Nl += u'\U00010140-\U00010174\U00010341\U0001034a\U000103d1-\U000103d5\U00012400-\U0001246e'
-
- No += u'\U00010107-\U00010133\U00010175-\U00010178\U0001018a-\U0001018b\U000102e1-\U000102fb\U00010320-\U00010323\U00010858-\U0001085f\U00010879-\U0001087f\U000108a7-\U000108af\U000108fb-\U000108ff\U00010916-\U0001091b\U000109bc-\U000109bd\U000109c0-\U000109cf\U000109d2-\U000109ff\U00010a40-\U00010a48\U00010a7d-\U00010a7e\U00010a9d-\U00010a9f\U00010aeb-\U00010aef\U00010b58-\U00010b5f\U00010b78-\U00010b7f\U00010ba9-\U00010baf\U00010cfa-\U00010cff\U00010e60-\U00010e7e\U00010f1d-\U00010f26\U00010f51-\U00010f54\U00011052-\U00011065\U000111e1-\U000111f4\U0001173a-\U0001173b\U000118ea-\U000118f2\U00011c5a-\U00011c6c\U00016b5b-\U00016b61\U00016e80-\U00016e96\U0001d2e0-\U0001d2f3\U0001d360-\U0001d378\U0001e8c7-\U0001e8cf\U0001ec71-\U0001ecab\U0001ecad-\U0001ecaf\U0001ecb1-\U0001ecb4\U0001f100-\U0001f10c'
-
- Po += u'\U00010100-\U00010102\U0001039f\U000103d0\U0001056f\U00010857\U0001091f\U0001093f\U00010a50-\U00010a58\U00010a7f\U00010af0-\U00010af6\U00010b39-\U00010b3f\U00010b99-\U00010b9c\U00010f55-\U00010f59\U00011047-\U0001104d\U000110bb-\U000110bc\U000110be-\U000110c1\U00011140-\U00011143\U00011174-\U00011175\U000111c5-\U000111c8\U000111cd\U000111db\U000111dd-\U000111df\U00011238-\U0001123d\U000112a9\U0001144b-\U0001144f\U0001145b\U0001145d\U000114c6\U000115c1-\U000115d7\U00011641-\U00011643\U00011660-\U0001166c\U0001173c-\U0001173e\U0001183b\U00011a3f-\U00011a46\U00011a9a-\U00011a9c\U00011a9e-\U00011aa2\U00011c41-\U00011c45\U00011c70-\U00011c71\U00011ef7-\U00011ef8\U00012470-\U00012474\U00016a6e-\U00016a6f\U00016af5\U00016b37-\U00016b3b\U00016b44\U00016e97-\U00016e9a\U0001bc9f\U0001da87-\U0001da8b\U0001e95e-\U0001e95f'
-
- Sc += u'\U0001ecb0'
-
- Sk += u'\U0001f3fb-\U0001f3ff'
-
- Sm += u'\U0001d6c1\U0001d6db\U0001d6fb\U0001d715\U0001d735\U0001d74f\U0001d76f\U0001d789\U0001d7a9\U0001d7c3\U0001eef0-\U0001eef1'
-
- So += u'\U00010137-\U0001013f\U00010179-\U00010189\U0001018c-\U0001018e\U00010190-\U0001019b\U000101a0\U000101d0-\U000101fc\U00010877-\U00010878\U00010ac8\U0001173f\U00016b3c-\U00016b3f\U00016b45\U0001bc9c\U0001d000-\U0001d0f5\U0001d100-\U0001d126\U0001d129-\U0001d164\U0001d16a-\U0001d16c\U0001d183-\U0001d184\U0001d18c-\U0001d1a9\U0001d1ae-\U0001d1e8\U0001d200-\U0001d241\U0001d245\U0001d300-\U0001d356\U0001d800-\U0001d9ff\U0001da37-\U0001da3a\U0001da6d-\U0001da74\U0001da76-\U0001da83\U0001da85-\U0001da86\U0001ecac\U0001f000-\U0001f02b\U0001f030-\U0001f093\U0001f0a0-\U0001f0ae\U0001f0b1-\U0001f0bf\U0001f0c1-\U0001f0cf\U0001f0d1-\U0001f0f5\U0001f110-\U0001f16b\U0001f170-\U0001f1ac\U0001f1e6-\U0001f202\U0001f210-\U0001f23b\U0001f240-\U0001f248\U0001f250-\U0001f251\U0001f260-\U0001f265\U0001f300-\U0001f3fa\U0001f400-\U0001f6d4\U0001f6e0-\U0001f6ec\U0001f6f0-\U0001f6f9\U0001f700-\U0001f773\U0001f780-\U0001f7d8\U0001f800-\U0001f80b\U0001f810-\U0001f847\U0001f850-\U0001f859\U0001f860-\U0001f887\U0001f890-\U0001f8ad\U0001f900-\U0001f90b\U0001f910-\U0001f93e\U0001f940-\U0001f970\U0001f973-\U0001f976\U0001f97a\U0001f97c-\U0001f9a2\U0001f9b0-\U0001f9b9\U0001f9c0-\U0001f9c2\U0001f9d0-\U0001f9ff\U0001fa60-\U0001fa6d'
-
- xid_continue += u'\U00010000-\U0001000b\U0001000d-\U00010026\U00010028-\U0001003a\U0001003c-\U0001003d\U0001003f-\U0001004d\U00010050-\U0001005d\U00010080-\U000100fa\U00010140-\U00010174\U000101fd\U00010280-\U0001029c\U000102a0-\U000102d0\U000102e0\U00010300-\U0001031f\U0001032d-\U0001034a\U00010350-\U0001037a\U00010380-\U0001039d\U000103a0-\U000103c3\U000103c8-\U000103cf\U000103d1-\U000103d5\U00010400-\U0001049d\U000104a0-\U000104a9\U000104b0-\U000104d3\U000104d8-\U000104fb\U00010500-\U00010527\U00010530-\U00010563\U00010600-\U00010736\U00010740-\U00010755\U00010760-\U00010767\U00010800-\U00010805\U00010808\U0001080a-\U00010835\U00010837-\U00010838\U0001083c\U0001083f-\U00010855\U00010860-\U00010876\U00010880-\U0001089e\U000108e0-\U000108f2\U000108f4-\U000108f5\U00010900-\U00010915\U00010920-\U00010939\U00010980-\U000109b7\U000109be-\U000109bf\U00010a00-\U00010a03\U00010a05-\U00010a06\U00010a0c-\U00010a13\U00010a15-\U00010a17\U00010a19-\U00010a35\U00010a38-\U00010a3a\U00010a3f\U00010a60-\U00010a7c\U00010a80-\U00010a9c\U00010ac0-\U00010ac7\U00010ac9-\U00010ae6\U00010b00-\U00010b35\U00010b40-\U00010b55\U00010b60-\U00010b72\U00010b80-\U00010b91\U00010c00-\U00010c48\U00010c80-\U00010cb2\U00010cc0-\U00010cf2\U00010d00-\U00010d27\U00010d30-\U00010d39\U00010f00-\U00010f1c\U00010f27\U00010f30-\U00010f50\U00011000-\U00011046\U00011066-\U0001106f\U0001107f-\U000110ba\U000110d0-\U000110e8\U000110f0-\U000110f9\U00011100-\U00011134\U00011136-\U0001113f\U00011144-\U00011146\U00011150-\U00011173\U00011176\U00011180-\U000111c4\U000111c9-\U000111cc\U000111d0-\U000111da\U000111dc\U00011200-\U00011211\U00011213-\U00011237\U0001123e\U00011280-\U00011286\U00011288\U0001128a-\U0001128d\U0001128f-\U0001129d\U0001129f-\U000112a8\U000112b0-\U000112ea\U000112f0-\U000112f9\U00011300-\U00011303\U00011305-\U0001130c\U0001130f-\U00011310\U00011313-\U00011328\U0001132a-\U00011330\U00011332-\U00011333\U00011335-\U00011339\U0001133b-\U00011344\U00011347-\U00011348\U0001134b-\U0001134d\U00011350\U00011357\U0001135d-\U00011363\U00011366-\U0001136c\U00011370-\U00011374\U00011400-\U0001144a\U00011450-\U00011459\U0001145e\U00011480-\U000114c5\U000114c7\U000114d0-\U000114d9\U00011580-\U000115b5\U000115b8-\U000115c0\U000115d8-\U000115dd\U00011600-\U00011640\U00011644\U00011650-\U00011659\U00011680-\U000116b7\U000116c0-\U000116c9\U00011700-\U0001171a\U0001171d-\U0001172b\U00011730-\U00011739\U00011800-\U0001183a\U000118a0-\U000118e9\U000118ff\U00011a00-\U00011a3e\U00011a47\U00011a50-\U00011a83\U00011a86-\U00011a99\U00011a9d\U00011ac0-\U00011af8\U00011c00-\U00011c08\U00011c0a-\U00011c36\U00011c38-\U00011c40\U00011c50-\U00011c59\U00011c72-\U00011c8f\U00011c92-\U00011ca7\U00011ca9-\U00011cb6\U00011d00-\U00011d06\U00011d08-\U00011d09\U00011d0b-\U00011d36\U00011d3a\U00011d3c-\U00011d3d\U00011d3f-\U00011d47\U00011d50-\U00011d59\U00011d60-\U00011d65\U00011d67-\U00011d68\U00011d6a-\U00011d8e\U00011d90-\U00011d91\U00011d93-\U00011d98\U00011da0-\U00011da9\U00011ee0-\U00011ef6\U00012000-\U00012399\U00012400-\U0001246e\U00012480-\U00012543\U00013000-\U0001342e\U00014400-\U00014646\U00016800-\U00016a38\U00016a40-\U00016a5e\U00016a60-\U00016a69\U00016ad0-\U00016aed\U00016af0-\U00016af4\U00016b00-\U00016b36\U00016b40-\U00016b43\U00016b50-\U00016b59\U00016b63-\U00016b77\U00016b7d-\U00016b8f\U00016e40-\U00016e7f\U00016f00-\U00016f44\U00016f50-\U00016f7e\U00016f8f-\U00016f9f\U00016fe0-\U00016fe1\U00017000-\U000187f1\U00018800-\U00018af2\U0001b000-\U0001b11e\U0001b170-\U0001b2fb\U0001bc00-\U0001bc6a\U0001bc70-\U0001bc7c\U0001bc80-\U0001bc88\U0001bc90-\U0001bc99\U0001bc9d-\U0001bc9e\U0001d165-\U0001d169\U0001d16d-\U0001d172\U0001d17b-\U0001d182\U0001d185-\U0001d18b\U0001d1aa-\U0001d1ad\U0001d242-\U0001d244\U0001d400-\U0001d454\U0001d456-\U0001d49c\U0001d49e-\U0001d49f\U0001d4a2\U0001d4a5-\U0001d4a6\U0001d4a9-\U0001d4ac\U0001d4ae-\U0001d4b9\U0001d4bb\U0001d4bd-\U0001d4c3\U0001d4c5-\U0001d505\U0001d507-\U0001d50a\U0001d50d-\U0001d514\U0001d516-\U0001d51c\U0001d51e-\U0001d539\U0001d53b-\U0001d53e\U0001d540-\U0001d544\U0001d546\U0001d54a-\U0001d550\U0001d552-\U0001d6a5\U0001d6a8-\U0001d6c0\U0001d6c2-\U0001d6da\U0001d6dc-\U0001d6fa\U0001d6fc-\U0001d714\U0001d716-\U0001d734\U0001d736-\U0001d74e\U0001d750-\U0001d76e\U0001d770-\U0001d788\U0001d78a-\U0001d7a8\U0001d7aa-\U0001d7c2\U0001d7c4-\U0001d7cb\U0001d7ce-\U0001d7ff\U0001da00-\U0001da36\U0001da3b-\U0001da6c\U0001da75\U0001da84\U0001da9b-\U0001da9f\U0001daa1-\U0001daaf\U0001e000-\U0001e006\U0001e008-\U0001e018\U0001e01b-\U0001e021\U0001e023-\U0001e024\U0001e026-\U0001e02a\U0001e800-\U0001e8c4\U0001e8d0-\U0001e8d6\U0001e900-\U0001e94a\U0001e950-\U0001e959\U0001ee00-\U0001ee03\U0001ee05-\U0001ee1f\U0001ee21-\U0001ee22\U0001ee24\U0001ee27\U0001ee29-\U0001ee32\U0001ee34-\U0001ee37\U0001ee39\U0001ee3b\U0001ee42\U0001ee47\U0001ee49\U0001ee4b\U0001ee4d-\U0001ee4f\U0001ee51-\U0001ee52\U0001ee54\U0001ee57\U0001ee59\U0001ee5b\U0001ee5d\U0001ee5f\U0001ee61-\U0001ee62\U0001ee64\U0001ee67-\U0001ee6a\U0001ee6c-\U0001ee72\U0001ee74-\U0001ee77\U0001ee79-\U0001ee7c\U0001ee7e\U0001ee80-\U0001ee89\U0001ee8b-\U0001ee9b\U0001eea1-\U0001eea3\U0001eea5-\U0001eea9\U0001eeab-\U0001eebb\U00020000-\U0002a6d6\U0002a700-\U0002b734\U0002b740-\U0002b81d\U0002b820-\U0002cea1\U0002ceb0-\U0002ebe0\U0002f800-\U0002fa1d\U000e0100-\U000e01ef'
-
- xid_start += u'\U00010000-\U0001000b\U0001000d-\U00010026\U00010028-\U0001003a\U0001003c-\U0001003d\U0001003f-\U0001004d\U00010050-\U0001005d\U00010080-\U000100fa\U00010140-\U00010174\U00010280-\U0001029c\U000102a0-\U000102d0\U00010300-\U0001031f\U0001032d-\U0001034a\U00010350-\U00010375\U00010380-\U0001039d\U000103a0-\U000103c3\U000103c8-\U000103cf\U000103d1-\U000103d5\U00010400-\U0001049d\U000104b0-\U000104d3\U000104d8-\U000104fb\U00010500-\U00010527\U00010530-\U00010563\U00010600-\U00010736\U00010740-\U00010755\U00010760-\U00010767\U00010800-\U00010805\U00010808\U0001080a-\U00010835\U00010837-\U00010838\U0001083c\U0001083f-\U00010855\U00010860-\U00010876\U00010880-\U0001089e\U000108e0-\U000108f2\U000108f4-\U000108f5\U00010900-\U00010915\U00010920-\U00010939\U00010980-\U000109b7\U000109be-\U000109bf\U00010a00\U00010a10-\U00010a13\U00010a15-\U00010a17\U00010a19-\U00010a35\U00010a60-\U00010a7c\U00010a80-\U00010a9c\U00010ac0-\U00010ac7\U00010ac9-\U00010ae4\U00010b00-\U00010b35\U00010b40-\U00010b55\U00010b60-\U00010b72\U00010b80-\U00010b91\U00010c00-\U00010c48\U00010c80-\U00010cb2\U00010cc0-\U00010cf2\U00010d00-\U00010d23\U00010f00-\U00010f1c\U00010f27\U00010f30-\U00010f45\U00011003-\U00011037\U00011083-\U000110af\U000110d0-\U000110e8\U00011103-\U00011126\U00011144\U00011150-\U00011172\U00011176\U00011183-\U000111b2\U000111c1-\U000111c4\U000111da\U000111dc\U00011200-\U00011211\U00011213-\U0001122b\U00011280-\U00011286\U00011288\U0001128a-\U0001128d\U0001128f-\U0001129d\U0001129f-\U000112a8\U000112b0-\U000112de\U00011305-\U0001130c\U0001130f-\U00011310\U00011313-\U00011328\U0001132a-\U00011330\U00011332-\U00011333\U00011335-\U00011339\U0001133d\U00011350\U0001135d-\U00011361\U00011400-\U00011434\U00011447-\U0001144a\U00011480-\U000114af\U000114c4-\U000114c5\U000114c7\U00011580-\U000115ae\U000115d8-\U000115db\U00011600-\U0001162f\U00011644\U00011680-\U000116aa\U00011700-\U0001171a\U00011800-\U0001182b\U000118a0-\U000118df\U000118ff\U00011a00\U00011a0b-\U00011a32\U00011a3a\U00011a50\U00011a5c-\U00011a83\U00011a86-\U00011a89\U00011a9d\U00011ac0-\U00011af8\U00011c00-\U00011c08\U00011c0a-\U00011c2e\U00011c40\U00011c72-\U00011c8f\U00011d00-\U00011d06\U00011d08-\U00011d09\U00011d0b-\U00011d30\U00011d46\U00011d60-\U00011d65\U00011d67-\U00011d68\U00011d6a-\U00011d89\U00011d98\U00011ee0-\U00011ef2\U00012000-\U00012399\U00012400-\U0001246e\U00012480-\U00012543\U00013000-\U0001342e\U00014400-\U00014646\U00016800-\U00016a38\U00016a40-\U00016a5e\U00016ad0-\U00016aed\U00016b00-\U00016b2f\U00016b40-\U00016b43\U00016b63-\U00016b77\U00016b7d-\U00016b8f\U00016e40-\U00016e7f\U00016f00-\U00016f44\U00016f50\U00016f93-\U00016f9f\U00016fe0-\U00016fe1\U00017000-\U000187f1\U00018800-\U00018af2\U0001b000-\U0001b11e\U0001b170-\U0001b2fb\U0001bc00-\U0001bc6a\U0001bc70-\U0001bc7c\U0001bc80-\U0001bc88\U0001bc90-\U0001bc99\U0001d400-\U0001d454\U0001d456-\U0001d49c\U0001d49e-\U0001d49f\U0001d4a2\U0001d4a5-\U0001d4a6\U0001d4a9-\U0001d4ac\U0001d4ae-\U0001d4b9\U0001d4bb\U0001d4bd-\U0001d4c3\U0001d4c5-\U0001d505\U0001d507-\U0001d50a\U0001d50d-\U0001d514\U0001d516-\U0001d51c\U0001d51e-\U0001d539\U0001d53b-\U0001d53e\U0001d540-\U0001d544\U0001d546\U0001d54a-\U0001d550\U0001d552-\U0001d6a5\U0001d6a8-\U0001d6c0\U0001d6c2-\U0001d6da\U0001d6dc-\U0001d6fa\U0001d6fc-\U0001d714\U0001d716-\U0001d734\U0001d736-\U0001d74e\U0001d750-\U0001d76e\U0001d770-\U0001d788\U0001d78a-\U0001d7a8\U0001d7aa-\U0001d7c2\U0001d7c4-\U0001d7cb\U0001e800-\U0001e8c4\U0001e900-\U0001e943\U0001ee00-\U0001ee03\U0001ee05-\U0001ee1f\U0001ee21-\U0001ee22\U0001ee24\U0001ee27\U0001ee29-\U0001ee32\U0001ee34-\U0001ee37\U0001ee39\U0001ee3b\U0001ee42\U0001ee47\U0001ee49\U0001ee4b\U0001ee4d-\U0001ee4f\U0001ee51-\U0001ee52\U0001ee54\U0001ee57\U0001ee59\U0001ee5b\U0001ee5d\U0001ee5f\U0001ee61-\U0001ee62\U0001ee64\U0001ee67-\U0001ee6a\U0001ee6c-\U0001ee72\U0001ee74-\U0001ee77\U0001ee79-\U0001ee7c\U0001ee7e\U0001ee80-\U0001ee89\U0001ee8b-\U0001ee9b\U0001eea1-\U0001eea3\U0001eea5-\U0001eea9\U0001eeab-\U0001eebb\U00020000-\U0002a6d6\U0002a700-\U0002b734\U0002b740-\U0002b81d\U0002b820-\U0002cea1\U0002ceb0-\U0002ebe0\U0002f800-\U0002fa1d'
-
-cats = ['Cc', 'Cf', 'Cn', 'Co', 'Cs', 'Ll', 'Lm', 'Lo', 'Lt', 'Lu', 'Mc', 'Me', 'Mn', 'Nd', 'Nl', 'No', 'Pc', 'Pd', 'Pe', 'Pf', 'Pi', 'Po', 'Ps', 'Sc', 'Sk', 'Sm', 'So', 'Zl', 'Zp', 'Zs']
-
-# Generated from unidata 11.0.0
-
-def combine(*args):
- return u''.join(globals()[cat] for cat in args)
-
-
-def allexcept(*args):
- newcats = cats[:]
- for arg in args:
- newcats.remove(arg)
- return u''.join(globals()[cat] for cat in newcats)
-
-
-def _handle_runs(char_list): # pragma: no cover
- buf = []
- for c in char_list:
- if len(c) == 1:
- if buf and buf[-1][1] == chr(ord(c)-1):
- buf[-1] = (buf[-1][0], c)
- else:
- buf.append((c, c))
- else:
- buf.append((c, c))
- for a, b in buf:
- if a == b:
- yield a
- else:
- yield u'%s-%s' % (a, b)
-
-
-if __name__ == '__main__': # pragma: no cover
- import unicodedata
-
- # we need Py3 for the determination of the XID_* properties
- if sys.version_info[:2] < (3, 3):
- raise RuntimeError('this file must be regenerated with Python 3.3+')
-
- categories_bmp = {'xid_start': [], 'xid_continue': []}
- categories_nonbmp = {'xid_start': [], 'xid_continue': []}
-
- with open(__file__) as fp:
- content = fp.read()
-
- header = content[:content.find('Cc =')]
- footer = content[content.find("def combine("):]
-
- for code in range(0x110000):
- c = chr(code)
- cat = unicodedata.category(c)
- if ord(c) == 0xdc00:
- # Hack to avoid combining this combining with the preceeding high
- # surrogate, 0xdbff, when doing a repr.
- c = u'\\' + c
- elif ord(c) in (0x2d, 0x5b, 0x5c, 0x5d, 0x5e):
- # Escape regex metachars.
- c = u'\\' + c
- cat_dic = categories_bmp if code < 0x10000 else categories_nonbmp
- cat_dic.setdefault(cat, []).append(c)
- # XID_START and XID_CONTINUE are special categories used for matching
- # identifiers in Python 3.
- if c.isidentifier():
- cat_dic['xid_start'].append(c)
- if ('a' + c).isidentifier():
- cat_dic['xid_continue'].append(c)
-
- with open(__file__, 'w') as fp:
- fp.write(header)
-
- for cat in sorted(categories_bmp):
- val = u''.join(_handle_runs(categories_bmp[cat]))
- if cat == 'Cs':
- # Jython can't handle isolated surrogates
- fp.write("""\
-try:
- Cs = eval(r"u%s")
-except UnicodeDecodeError:
- Cs = '' # Jython can't handle isolated surrogates\n\n""" % ascii(val))
- else:
- fp.write('%s = u%a\n\n' % (cat, val))
-
- fp.write('if sys.maxunicode > 0xFFFF:\n')
- fp.write(' # non-BMP characters, use only on wide Unicode builds\n')
- for cat in sorted(categories_nonbmp):
- # no special case for Cs needed, since there are no surrogates
- # in the higher planes
- val = u''.join(_handle_runs(categories_nonbmp[cat]))
- fp.write(' %s += u%a\n\n' % (cat, val))
-
- cats = sorted(categories_bmp)
- cats.remove('xid_start')
- cats.remove('xid_continue')
- fp.write('cats = %r\n\n' % cats)
-
- fp.write('# Generated from unidata %s\n\n' % (unicodedata.unidata_version,))
-
- fp.write(footer)
diff --git a/pygments/util.py b/pygments/util.py
deleted file mode 100644
index 054b705e..00000000
--- a/pygments/util.py
+++ /dev/null
@@ -1,388 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- pygments.util
- ~~~~~~~~~~~~~
-
- Utility functions.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-import sys
-
-
-split_path_re = re.compile(r'[/\\ ]')
-doctype_lookup_re = re.compile(r'''
- (<\?.*?\?>)?\s*
- <!DOCTYPE\s+(
- [a-zA-Z_][a-zA-Z0-9]*
- (?: \s+ # optional in HTML5
- [a-zA-Z_][a-zA-Z0-9]*\s+
- "[^"]*")?
- )
- [^>]*>
-''', re.DOTALL | re.MULTILINE | re.VERBOSE)
-tag_re = re.compile(r'<(.+?)(\s.*?)?>.*?</.+?>',
- re.UNICODE | re.IGNORECASE | re.DOTALL | re.MULTILINE)
-xml_decl_re = re.compile(r'\s*<\?xml[^>]*\?>', re.I)
-
-
-class ClassNotFound(ValueError):
- """Raised if one of the lookup functions didn't find a matching class."""
-
-
-class OptionError(Exception):
- pass
-
-
-def get_choice_opt(options, optname, allowed, default=None, normcase=False):
- string = options.get(optname, default)
- if normcase:
- string = string.lower()
- if string not in allowed:
- raise OptionError('Value for option %s must be one of %s' %
- (optname, ', '.join(map(str, allowed))))
- return string
-
-
-def get_bool_opt(options, optname, default=None):
- string = options.get(optname, default)
- if isinstance(string, bool):
- return string
- elif isinstance(string, int):
- return bool(string)
- elif not isinstance(string, string_types):
- raise OptionError('Invalid type %r for option %s; use '
- '1/0, yes/no, true/false, on/off' % (
- string, optname))
- elif string.lower() in ('1', 'yes', 'true', 'on'):
- return True
- elif string.lower() in ('0', 'no', 'false', 'off'):
- return False
- else:
- raise OptionError('Invalid value %r for option %s; use '
- '1/0, yes/no, true/false, on/off' % (
- string, optname))
-
-
-def get_int_opt(options, optname, default=None):
- string = options.get(optname, default)
- try:
- return int(string)
- except TypeError:
- raise OptionError('Invalid type %r for option %s; you '
- 'must give an integer value' % (
- string, optname))
- except ValueError:
- raise OptionError('Invalid value %r for option %s; you '
- 'must give an integer value' % (
- string, optname))
-
-
-def get_list_opt(options, optname, default=None):
- val = options.get(optname, default)
- if isinstance(val, string_types):
- return val.split()
- elif isinstance(val, (list, tuple)):
- return list(val)
- else:
- raise OptionError('Invalid type %r for option %s; you '
- 'must give a list value' % (
- val, optname))
-
-
-def docstring_headline(obj):
- if not obj.__doc__:
- return ''
- res = []
- for line in obj.__doc__.strip().splitlines():
- if line.strip():
- res.append(" " + line.strip())
- else:
- break
- return ''.join(res).lstrip()
-
-
-def make_analysator(f):
- """Return a static text analyser function that returns float values."""
- def text_analyse(text):
- try:
- rv = f(text)
- except Exception:
- return 0.0
- if not rv:
- return 0.0
- try:
- return min(1.0, max(0.0, float(rv)))
- except (ValueError, TypeError):
- return 0.0
- text_analyse.__doc__ = f.__doc__
- return staticmethod(text_analyse)
-
-
-def shebang_matches(text, regex):
- r"""Check if the given regular expression matches the last part of the
- shebang if one exists.
-
- >>> from pygments.util import shebang_matches
- >>> shebang_matches('#!/usr/bin/env python', r'python(2\.\d)?')
- True
- >>> shebang_matches('#!/usr/bin/python2.4', r'python(2\.\d)?')
- True
- >>> shebang_matches('#!/usr/bin/python-ruby', r'python(2\.\d)?')
- False
- >>> shebang_matches('#!/usr/bin/python/ruby', r'python(2\.\d)?')
- False
- >>> shebang_matches('#!/usr/bin/startsomethingwith python',
- ... r'python(2\.\d)?')
- True
-
- It also checks for common windows executable file extensions::
-
- >>> shebang_matches('#!C:\\Python2.4\\Python.exe', r'python(2\.\d)?')
- True
-
- Parameters (``'-f'`` or ``'--foo'`` are ignored so ``'perl'`` does
- the same as ``'perl -e'``)
-
- Note that this method automatically searches the whole string (eg:
- the regular expression is wrapped in ``'^$'``)
- """
- index = text.find('\n')
- if index >= 0:
- first_line = text[:index].lower()
- else:
- first_line = text.lower()
- if first_line.startswith('#!'):
- try:
- found = [x for x in split_path_re.split(first_line[2:].strip())
- if x and not x.startswith('-')][-1]
- except IndexError:
- return False
- regex = re.compile(r'^%s(\.(exe|cmd|bat|bin))?$' % regex, re.IGNORECASE)
- if regex.search(found) is not None:
- return True
- return False
-
-
-def doctype_matches(text, regex):
- """Check if the doctype matches a regular expression (if present).
-
- Note that this method only checks the first part of a DOCTYPE.
- eg: 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
- """
- m = doctype_lookup_re.match(text)
- if m is None:
- return False
- doctype = m.group(2)
- return re.compile(regex, re.I).match(doctype.strip()) is not None
-
-
-def html_doctype_matches(text):
- """Check if the file looks like it has a html doctype."""
- return doctype_matches(text, r'html')
-
-
-_looks_like_xml_cache = {}
-
-
-def looks_like_xml(text):
- """Check if a doctype exists or if we have some tags."""
- if xml_decl_re.match(text):
- return True
- key = hash(text)
- try:
- return _looks_like_xml_cache[key]
- except KeyError:
- m = doctype_lookup_re.match(text)
- if m is not None:
- return True
- rv = tag_re.search(text[:1000]) is not None
- _looks_like_xml_cache[key] = rv
- return rv
-
-
-# Python narrow build compatibility
-
-def _surrogatepair(c):
- # Given a unicode character code
- # with length greater than 16 bits,
- # return the two 16 bit surrogate pair.
- # From example D28 of:
- # http://www.unicode.org/book/ch03.pdf
- return (0xd7c0 + (c >> 10), (0xdc00 + (c & 0x3ff)))
-
-
-def unirange(a, b):
- """Returns a regular expression string to match the given non-BMP range."""
- if b < a:
- raise ValueError("Bad character range")
- if a < 0x10000 or b < 0x10000:
- raise ValueError("unirange is only defined for non-BMP ranges")
-
- if sys.maxunicode > 0xffff:
- # wide build
- return u'[%s-%s]' % (unichr(a), unichr(b))
- else:
- # narrow build stores surrogates, and the 're' module handles them
- # (incorrectly) as characters. Since there is still ordering among
- # these characters, expand the range to one that it understands. Some
- # background in http://bugs.python.org/issue3665 and
- # http://bugs.python.org/issue12749
- #
- # Additionally, the lower constants are using unichr rather than
- # literals because jython [which uses the wide path] can't load this
- # file if they are literals.
- ah, al = _surrogatepair(a)
- bh, bl = _surrogatepair(b)
- if ah == bh:
- return u'(?:%s[%s-%s])' % (unichr(ah), unichr(al), unichr(bl))
- else:
- buf = []
- buf.append(u'%s[%s-%s]' %
- (unichr(ah), unichr(al),
- ah == bh and unichr(bl) or unichr(0xdfff)))
- if ah - bh > 1:
- buf.append(u'[%s-%s][%s-%s]' %
- unichr(ah+1), unichr(bh-1), unichr(0xdc00), unichr(0xdfff))
- if ah != bh:
- buf.append(u'%s[%s-%s]' %
- (unichr(bh), unichr(0xdc00), unichr(bl)))
-
- return u'(?:' + u'|'.join(buf) + u')'
-
-
-def format_lines(var_name, seq, raw=False, indent_level=0):
- """Formats a sequence of strings for output."""
- lines = []
- base_indent = ' ' * indent_level * 4
- inner_indent = ' ' * (indent_level + 1) * 4
- lines.append(base_indent + var_name + ' = (')
- if raw:
- # These should be preformatted reprs of, say, tuples.
- for i in seq:
- lines.append(inner_indent + i + ',')
- else:
- for i in seq:
- # Force use of single quotes
- r = repr(i + '"')
- lines.append(inner_indent + r[:-2] + r[-1] + ',')
- lines.append(base_indent + ')')
- return '\n'.join(lines)
-
-
-def duplicates_removed(it, already_seen=()):
- """
- Returns a list with duplicates removed from the iterable `it`.
-
- Order is preserved.
- """
- lst = []
- seen = set()
- for i in it:
- if i in seen or i in already_seen:
- continue
- lst.append(i)
- seen.add(i)
- return lst
-
-
-class Future(object):
- """Generic class to defer some work.
-
- Handled specially in RegexLexerMeta, to support regex string construction at
- first use.
- """
- def get(self):
- raise NotImplementedError
-
-
-def guess_decode(text):
- """Decode *text* with guessed encoding.
-
- First try UTF-8; this should fail for non-UTF-8 encodings.
- Then try the preferred locale encoding.
- Fall back to latin-1, which always works.
- """
- try:
- text = text.decode('utf-8')
- return text, 'utf-8'
- except UnicodeDecodeError:
- try:
- import locale
- prefencoding = locale.getpreferredencoding()
- text = text.decode()
- return text, prefencoding
- except (UnicodeDecodeError, LookupError):
- text = text.decode('latin1')
- return text, 'latin1'
-
-
-def guess_decode_from_terminal(text, term):
- """Decode *text* coming from terminal *term*.
-
- First try the terminal encoding, if given.
- Then try UTF-8. Then try the preferred locale encoding.
- Fall back to latin-1, which always works.
- """
- if getattr(term, 'encoding', None):
- try:
- text = text.decode(term.encoding)
- except UnicodeDecodeError:
- pass
- else:
- return text, term.encoding
- return guess_decode(text)
-
-
-def terminal_encoding(term):
- """Return our best guess of encoding for the given *term*."""
- if getattr(term, 'encoding', None):
- return term.encoding
- import locale
- return locale.getpreferredencoding()
-
-
-# Python 2/3 compatibility
-
-if sys.version_info < (3, 0):
- unichr = unichr
- xrange = xrange
- string_types = (str, unicode)
- text_type = unicode
- u_prefix = 'u'
- iteritems = dict.iteritems
- itervalues = dict.itervalues
- import StringIO
- import cStringIO
- # unfortunately, io.StringIO in Python 2 doesn't accept str at all
- StringIO = StringIO.StringIO
- BytesIO = cStringIO.StringIO
-else:
- unichr = chr
- xrange = range
- string_types = (str,)
- text_type = str
- u_prefix = ''
- iteritems = dict.items
- itervalues = dict.values
- from io import StringIO, BytesIO, TextIOWrapper
-
- class UnclosingTextIOWrapper(TextIOWrapper):
- # Don't close underlying buffer on destruction.
- def close(self):
- self.flush()
-
-
-def add_metaclass(metaclass):
- """Class decorator for creating a class with a metaclass."""
- def wrapper(cls):
- orig_vars = cls.__dict__.copy()
- orig_vars.pop('__dict__', None)
- orig_vars.pop('__weakref__', None)
- for slots_var in orig_vars.get('__slots__', ()):
- orig_vars.pop(slots_var)
- return metaclass(cls.__name__, cls.__bases__, orig_vars)
- return wrapper
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 4754a9d2..00000000
--- a/requirements.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-coverage
-nose
-pyflakes
-pylint
-tox
diff --git a/scripts/check_sources.py b/scripts/check_sources.py
deleted file mode 100755
index f047168c..00000000
--- a/scripts/check_sources.py
+++ /dev/null
@@ -1,212 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
- Checker for file headers
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Make sure each Python file has a correct file header
- including copyright and license information.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import io
-import os
-import re
-import sys
-import getopt
-from os.path import join, splitext, abspath
-
-
-checkers = {}
-
-
-def checker(*suffixes, **kwds):
- only_pkg = kwds.pop('only_pkg', False)
-
- def deco(func):
- for suffix in suffixes:
- checkers.setdefault(suffix, []).append(func)
- func.only_pkg = only_pkg
- return func
- return deco
-
-
-name_mail_re = r'[\w ]+(<.*?>)?'
-copyright_re = re.compile(r'^ :copyright: Copyright 2006-2019 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)
-is_const_re = re.compile(r'if.*?==\s+(None|False|True)\b')
-
-misspellings = ["developement", "adress", "verificate", # ALLOW-MISSPELLING
- "informations", "unlexer"] # ALLOW-MISSPELLING
-
-
-@checker('.py')
-def check_syntax(fn, lines):
- if '#!/' in lines[0]:
- lines = lines[1:]
- if 'coding:' in lines[0]:
- lines = lines[1:]
- try:
- compile('\n'.join(lines), fn, "exec")
- except SyntaxError as err:
- yield 0, "not compilable: %s" % err
-
-
-@checker('.py')
-def check_style_and_encoding(fn, lines):
- for lno, line in enumerate(lines):
- if len(line) > 110:
- yield lno+1, "line too long"
- if is_const_re.search(line):
- yield lno+1, 'using == None/True/False'
-
-
-@checker('.py', only_pkg=True)
-def check_fileheader(fn, lines):
- # line number correction
- c = 1
- if lines[0:1] == ['#!/usr/bin/env python']:
- lines = lines[1:]
- c = 2
-
- llist = []
- docopen = False
- for lno, l in enumerate(lines):
- llist.append(l)
- if lno == 0:
- if l != '# -*- coding: utf-8 -*-':
- yield 1, "missing coding declaration"
- elif lno == 1:
- if l != '"""' and l != 'r"""':
- yield 2, 'missing docstring begin (""")'
- else:
- docopen = True
- elif docopen:
- if l == '"""':
- # end of docstring
- if lno <= 4:
- yield lno+c, "missing module name in docstring"
- break
-
- if l != "" and l[:4] != ' ' and docopen:
- yield lno+c, "missing correct docstring indentation"
-
- if lno == 2:
- # if not in package, don't check the module name
- modname = fn[:-3].replace('/', '.').replace('.__init__', '')
- while modname:
- if l.lower()[4:] == modname:
- break
- modname = '.'.join(modname.split('.')[1:])
- else:
- yield 3, "wrong module name in docstring heading"
- modnamelen = len(l.strip())
- elif lno == 3:
- if l.strip() != modnamelen * "~":
- yield 4, "wrong module name underline, should be ~~~...~"
-
- else:
- yield 0, "missing end and/or start of docstring..."
-
- # check for copyright and license fields
- license = llist[-2:-1]
- if license != [" :license: BSD, see LICENSE for details."]:
- yield 0, "no correct license info"
-
- ci = -3
- copyright = llist[ci:ci+1]
- while copyright and copyright_2_re.match(copyright[0]):
- ci -= 1
- copyright = llist[ci:ci+1]
- if not copyright or not copyright_re.match(copyright[0]):
- yield 0, "no correct copyright info"
-
-
-def main(argv):
- try:
- gopts, args = getopt.getopt(argv[1:], "vi:")
- except getopt.GetoptError:
- print("Usage: %s [-v] [-i ignorepath]* [path]" % argv[0])
- return 2
- opts = {}
- for opt, val in gopts:
- if opt == '-i':
- val = abspath(val)
- opts.setdefault(opt, []).append(val)
-
- if len(args) == 0:
- path = '.'
- elif len(args) == 1:
- path = args[0]
- else:
- print("Usage: %s [-v] [-i ignorepath]* [path]" % argv[0])
- return 2
-
- verbose = '-v' in opts
-
- num = 0
- out = io.StringIO()
-
- # TODO: replace os.walk run with iteration over output of
- # `svn list -R`.
-
- for root, dirs, files in os.walk(path):
- if '.hg' in dirs:
- dirs.remove('.hg')
- if 'examplefiles' in dirs:
- dirs.remove('examplefiles')
- if '-i' in opts and abspath(root) in opts['-i']:
- del dirs[:]
- continue
- # XXX: awkward: for the Makefile call: don't check non-package
- # files for file headers
- in_pygments_pkg = root.startswith('./pygments')
- for fn in files:
-
- fn = join(root, fn)
- if fn[:2] == './':
- fn = fn[2:]
-
- if '-i' in opts and abspath(fn) in opts['-i']:
- continue
-
- ext = splitext(fn)[1]
- checkerlist = checkers.get(ext, None)
- if not checkerlist:
- continue
-
- if verbose:
- print("Checking %s..." % fn)
-
- try:
- with open(fn, 'rb') as f:
- lines = f.read().decode('utf-8').splitlines()
- except (IOError, OSError) as err:
- print("%s: cannot open: %s" % (fn, err))
- num += 1
- continue
-
- for checker in checkerlist:
- if not in_pygments_pkg and checker.only_pkg:
- continue
- for lno, msg in checker(fn, lines):
- print(u"%s:%d: %s" % (fn, lno, msg), file=out)
- num += 1
- if verbose:
- print()
- if num == 0:
- print("No errors found.")
- else:
- print(out.getvalue().rstrip('\n'))
- print("%d error%s found." % (num, num > 1 and "s" or ""))
- return int(num > 0)
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
diff --git a/scripts/debug_lexer.py b/scripts/debug_lexer.py
deleted file mode 100755
index ef01a23f..00000000
--- a/scripts/debug_lexer.py
+++ /dev/null
@@ -1,246 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-"""
- Lexing error finder
- ~~~~~~~~~~~~~~~~~~~
-
- For the source files given on the command line, display
- the text where Error tokens are being generated, along
- with some context.
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import os
-import sys
-
-# always prefer Pygments from source if exists
-srcpath = os.path.join(os.path.dirname(__file__), '..')
-if os.path.isdir(os.path.join(srcpath, 'pygments')):
- sys.path.insert(0, srcpath)
-
-
-from pygments.lexer import RegexLexer, ExtendedRegexLexer, LexerContext, \
- ProfilingRegexLexer, ProfilingRegexLexerMeta
-from pygments.lexers import get_lexer_by_name, find_lexer_class, \
- find_lexer_class_for_filename
-from pygments.token import Error, Text, _TokenType
-from pygments.cmdline import _parse_options
-
-
-class DebuggingRegexLexer(ExtendedRegexLexer):
- """Make the state stack, position and current match instance attributes."""
-
- def get_tokens_unprocessed(self, text, stack=('root',)):
- """
- Split ``text`` into (tokentype, text) pairs.
-
- ``stack`` is the inital stack (default: ``['root']``)
- """
- tokendefs = self._tokens
- self.ctx = ctx = LexerContext(text, 0)
- ctx.stack = list(stack)
- statetokens = tokendefs[ctx.stack[-1]]
- while 1:
- for rexmatch, action, new_state in statetokens:
- self.m = m = rexmatch(text, ctx.pos, ctx.end)
- if m:
- if action is not None:
- if type(action) is _TokenType:
- yield ctx.pos, action, m.group()
- ctx.pos = m.end()
- else:
- if not isinstance(self, ExtendedRegexLexer):
- for item in action(self, m):
- yield item
- ctx.pos = m.end()
- else:
- for item in action(self, m, ctx):
- yield item
- if not new_state:
- # altered the state stack?
- statetokens = tokendefs[ctx.stack[-1]]
- if new_state is not None:
- # state transition
- if isinstance(new_state, tuple):
- for state in new_state:
- if state == '#pop':
- ctx.stack.pop()
- elif state == '#push':
- ctx.stack.append(ctx.stack[-1])
- else:
- ctx.stack.append(state)
- elif isinstance(new_state, int):
- # pop
- del ctx.stack[new_state:]
- elif new_state == '#push':
- ctx.stack.append(ctx.stack[-1])
- else:
- assert False, 'wrong state def: %r' % new_state
- statetokens = tokendefs[ctx.stack[-1]]
- break
- else:
- try:
- if ctx.pos >= ctx.end:
- break
- if text[ctx.pos] == '\n':
- # at EOL, reset state to 'root'
- ctx.stack = ['root']
- statetokens = tokendefs['root']
- yield ctx.pos, Text, u'\n'
- ctx.pos += 1
- continue
- yield ctx.pos, Error, text[ctx.pos]
- ctx.pos += 1
- except IndexError:
- break
-
-
-def main(fn, lexer=None, options={}):
- if lexer is not None:
- lxcls = get_lexer_by_name(lexer).__class__
- else:
- lxcls = find_lexer_class_for_filename(os.path.basename(fn))
- if lxcls is None:
- name, rest = fn.split('_', 1)
- lxcls = find_lexer_class(name)
- if lxcls is None:
- raise AssertionError('no lexer found for file %r' % fn)
- print('Using lexer: %s (%s.%s)' % (lxcls.name, lxcls.__module__,
- lxcls.__name__))
- debug_lexer = False
- # if profile:
- # # does not work for e.g. ExtendedRegexLexers
- # if lxcls.__bases__ == (RegexLexer,):
- # # yes we can! (change the metaclass)
- # lxcls.__class__ = ProfilingRegexLexerMeta
- # lxcls.__bases__ = (ProfilingRegexLexer,)
- # lxcls._prof_sort_index = profsort
- # else:
- # if lxcls.__bases__ == (RegexLexer,):
- # lxcls.__bases__ = (DebuggingRegexLexer,)
- # debug_lexer = True
- # elif lxcls.__bases__ == (DebuggingRegexLexer,):
- # # already debugged before
- # debug_lexer = True
- # else:
- # # HACK: ExtendedRegexLexer subclasses will only partially work here.
- # lxcls.__bases__ = (DebuggingRegexLexer,)
- # debug_lexer = True
-
- lx = lxcls(**options)
- lno = 1
- if fn == '-':
- text = sys.stdin.read()
- else:
- with open(fn, 'rb') as fp:
- text = fp.read().decode('utf-8')
- text = text.strip('\n') + '\n'
- tokens = []
- states = []
-
- def show_token(tok, state):
- reprs = list(map(repr, tok))
- print(' ' + reprs[1] + ' ' + ' ' * (29-len(reprs[1])) + reprs[0], end=' ')
- if debug_lexer:
- print(' ' + ' ' * (29-len(reprs[0])) + ' : '.join(state) if state else '', end=' ')
- print()
-
- for type, val in lx.get_tokens(text):
- lno += val.count('\n')
- if type == Error and not ignerror:
- print('Error parsing', fn, 'on line', lno)
- if not showall:
- print('Previous tokens' + (debug_lexer and ' and states' or '') + ':')
- for i in range(max(len(tokens) - num, 0), len(tokens)):
- if debug_lexer:
- show_token(tokens[i], states[i])
- else:
- show_token(tokens[i], None)
- print('Error token:')
- l = len(repr(val))
- print(' ' + repr(val), end=' ')
- if debug_lexer and hasattr(lx, 'ctx'):
- print(' ' * (60-l) + ' : '.join(lx.ctx.stack), end=' ')
- print()
- print()
- return 1
- tokens.append((type, val))
- if debug_lexer:
- if hasattr(lx, 'ctx'):
- states.append(lx.ctx.stack[:])
- else:
- states.append(None)
- if showall:
- show_token((type, val), states[-1] if debug_lexer else None)
- return 0
-
-
-def print_help():
- print('''\
-Pygments development helper to quickly debug lexers.
-
- scripts/debug_lexer.py [options] file ...
-
-Give one or more filenames to lex them and display possible error tokens
-and/or profiling info. Files are assumed to be encoded in UTF-8.
-
-Selecting lexer and options:
-
- -l NAME use lexer named NAME (default is to guess from
- the given filenames)
- -O OPTIONSTR use lexer options parsed from OPTIONSTR
-
-Debugging lexing errors:
-
- -n N show the last N tokens on error
- -a always show all lexed tokens (default is only
- to show them when an error occurs)
- -e do not stop on error tokens
-
-Profiling:
-
- -p use the ProfilingRegexLexer to profile regexes
- instead of the debugging lexer
- -s N sort profiling output by column N (default is
- column 4, the time per call)
-''')
-
-num = 10
-showall = False
-ignerror = False
-lexer = None
-options = {}
-profile = False
-profsort = 4
-
-if __name__ == '__main__':
- import getopt
- opts, args = getopt.getopt(sys.argv[1:], 'n:l:aepO:s:h')
- for opt, val in opts:
- if opt == '-n':
- num = int(val)
- elif opt == '-a':
- showall = True
- elif opt == '-e':
- ignerror = True
- elif opt == '-l':
- lexer = val
- elif opt == '-p':
- profile = True
- elif opt == '-s':
- profsort = int(val)
- elif opt == '-O':
- options = _parse_options([val])
- elif opt == '-h':
- print_help()
- sys.exit(0)
- ret = 0
- if not args:
- print_help()
- for f in args:
- ret += main(f, lexer, options)
- sys.exit(bool(ret))
diff --git a/scripts/detect_missing_analyse_text.py b/scripts/detect_missing_analyse_text.py
deleted file mode 100644
index ab58558e..00000000
--- a/scripts/detect_missing_analyse_text.py
+++ /dev/null
@@ -1,33 +0,0 @@
-from __future__ import print_function
-import sys
-
-from pygments.lexers import get_all_lexers, find_lexer_class
-from pygments.lexer import Lexer
-
-def main():
- uses = {}
-
- for name, aliases, filenames, mimetypes in get_all_lexers():
- cls = find_lexer_class(name)
- if not cls.aliases:
- print(cls, "has no aliases")
- for f in filenames:
- if f not in uses:
- uses[f] = []
- uses[f].append(cls)
-
- ret = 0
- for k, v in uses.items():
- if len(v) > 1:
- #print "Multiple for", k, v
- for i in v:
- if i.analyse_text is None:
- print(i, "has a None analyse_text")
- ret |= 1
- elif Lexer.analyse_text.__doc__ == i.analyse_text.__doc__:
- print(i, "needs analyse_text, multiple lexers for", k)
- ret |= 2
- return ret
-
-if __name__ == '__main__':
- sys.exit(main())
diff --git a/scripts/epydoc.css b/scripts/epydoc.css
deleted file mode 100644
index 16d5b0df..00000000
--- a/scripts/epydoc.css
+++ /dev/null
@@ -1,280 +0,0 @@
-
-
-/* Epydoc CSS Stylesheet
- *
- * This stylesheet can be used to customize the appearance of epydoc's
- * HTML output.
- *
- */
-
-/* Adapted for Pocoo API docs by Georg Brandl */
-
-/* Default Colors & Styles
- * - Set the default foreground & background color with 'body'; and
- * link colors with 'a:link' and 'a:visited'.
- * - Use bold for decision list terms.
- * - The heading styles defined here are used for headings *within*
- * docstring descriptions. All headings used by epydoc itself use
- * either class='epydoc' or class='toc' (CSS styles for both
- * defined below).
- */
-body { background: #ffffff; color: #000000;
- font-family: Trebuchet MS,Tahoma,sans-serif;
- font-size: 0.9em; line-height: 140%;
- margin: 0; padding: 0 1.2em 1.2em 1.2em; }
-a:link { color: #C87900; text-decoration: none;
- border-bottom: 1px solid #C87900; }
-a:visited { color: #C87900; text-decoration: none;
- border-bottom: 1px dotted #C87900; }
-a:hover { color: #F8A900; border-bottom-color: #F8A900; }
-dt { font-weight: bold; }
-h1 { font-size: +180%; font-style: italic;
- font-weight: bold; margin-top: 1.5em; }
-h2 { font-size: +140%; font-style: italic;
- font-weight: bold; }
-h3 { font-size: +110%; font-style: italic;
- font-weight: normal; }
-p { margin-top: .5em; margin-bottom: .5em; }
-hr { margin-top: 1.5em; margin-bottom: 1.5em;
- border: 1px solid #BBB; }
-tt.literal { background: #F5FFD0; padding: 2px;
- font-size: 110%; }
-table.rst-docutils { border: 0; }
-table.rst-docutils td { border: 0; padding: 5px 20px 5px 0px; }
-
-/* Page Header & Footer
- * - The standard page header consists of a navigation bar (with
- * pointers to standard pages such as 'home' and 'trees'); a
- * breadcrumbs list, which can be used to navigate to containing
- * classes or modules; options links, to show/hide private
- * variables and to show/hide frames; and a page title (using
- * <h1>). The page title may be followed by a link to the
- * corresponding source code (using 'span.codelink').
- * - The footer consists of a navigation bar, a timestamp, and a
- * pointer to epydoc's homepage.
- */
-h1.epydoc { margin-top: .4em; margin-bottom: .4em;
- font-size: +180%; font-weight: bold;
- font-style: normal; }
-h2.epydoc { font-size: +130%; font-weight: bold;
- font-style: normal; }
-h3.epydoc { font-size: +115%; font-weight: bold;
- font-style: normal; }
-table.navbar { background: #E6F8A0; color: #000000;
- border-top: 1px solid #c0d0d0;
- border-bottom: 1px solid #c0d0d0;
- margin: -1px -1.2em 1em -1.2em; }
-table.navbar th { padding: 2px 7px 2px 0px; }
-th.navbar-select { background-color: transparent; }
-th.navbar-select:before { content: ">" }
-th.navbar-select:after { content: "<" }
-table.navbar a { border: 0; }
-span.breadcrumbs { font-size: 95%; font-weight: bold; }
-span.options { font-size: 80%; }
-span.codelink { font-size: 85%; }
-td.footer { font-size: 85%; }
-
-/* Table Headers
- * - Each summary table and details section begins with a 'header'
- * row. This row contains a section title (marked by
- * 'span.table-header') as well as a show/hide private link
- * (marked by 'span.options', defined above).
- * - Summary tables that contain user-defined groups mark those
- * groups using 'group header' rows.
- */
-td.table-header { background: #B6C870; color: #000000;
- border-bottom: 1px solid #FFF; }
-span.table-header { font-size: 110%; font-weight: bold; }
-th.group-header { text-align: left; font-style: italic;
- font-size: 110%; }
-td.spacer { width: 5%; }
-
-/* Summary Tables (functions, variables, etc)
- * - Each object is described by a single row of the table with
- * two cells. The left cell gives the object's type, and is
- * marked with 'code.summary-type'. The right cell gives the
- * object's name and a summary description.
- * - CSS styles for the table's header and group headers are
- * defined above, under 'Table Headers'
- */
-table.summary { border-collapse: collapse;
- background: #E6F8A0; color: #000000;
- margin: 1em 0 .5em 0;
- border: 0; }
-table.summary tr { border-bottom: 1px solid #BBB; }
-td.summary a { font-weight: bold; }
-code.summary-type { font-size: 85%; }
-
-/* Details Tables (functions, variables, etc)
- * - Each object is described in its own single-celled table.
- * - A single-row summary table w/ table-header is used as
- * a header for each details section (CSS style for table-header
- * is defined above, under 'Table Headers').
- */
-
-table.detsummary { margin-top: 2em; }
-
-table.details { border-collapse: collapse;
- background: #E6F8A0; color: #000000;
- border-bottom: 1px solid #BBB;
- margin: 0; }
-table.details td { padding: .2em .2em .2em .5em; }
-table.details table td { padding: 0; }
-table.details h3 { margin: 5px 0 5px 0; font-size: 105%;
- font-style: normal; }
-
-table.details dd { display: inline; margin-left: 5px; }
-table.details dl { margin-left: 5px; }
-
-
-/* Index tables (identifier index, term index, etc)
- * - link-index is used for indices containing lists of links
- * (namely, the identifier index & term index).
- * - index-where is used in link indices for the text indicating
- * the container/source for each link.
- * - metadata-index is used for indices containing metadata
- * extracted from fields (namely, the bug index & todo index).
- */
-table.link-index { border-collapse: collapse;
- background: #F6FFB0; color: #000000;
- border: 1px solid #608090; }
-td.link-index { border-width: 0px; }
-span.index-where { font-size: 70%; }
-table.metadata-index { border-collapse: collapse;
- background: #F6FFB0; color: #000000;
- border: 1px solid #608090;
- margin: .2em 0 0 0; }
-td.metadata-index { border-width: 1px; border-style: solid; }
-
-/* Function signatures
- * - sig* is used for the signature in the details section.
- * - .summary-sig* is used for the signature in the summary
- * table, and when listing property accessor functions.
- * */
-.sig-name { color: #006080; }
-.sig-arg { color: #008060; }
-.sig-default { color: #602000; }
-.summary-sig-name { font-weight: bold; }
-.summary-sig-arg { color: #006040; }
-.summary-sig-default { color: #501800; }
-
-/* Variable values
- * - In the 'variable details' sections, each varaible's value is
- * listed in a 'pre.variable' box. The width of this box is
- * restricted to 80 chars; if the value's repr is longer than
- * this it will be wrapped, using a backslash marked with
- * class 'variable-linewrap'. If the value's repr is longer
- * than 3 lines, the rest will be ellided; and an ellipsis
- * marker ('...' marked with 'variable-ellipsis') will be used.
- * - If the value is a string, its quote marks will be marked
- * with 'variable-quote'.
- * - If the variable is a regexp, it is syntax-highlighted using
- * the re* CSS classes.
- */
-pre.variable { padding: .5em; margin: 0;
- background-color: #dce4ec;
- border: 1px solid #708890; }
-.variable-linewrap { display: none; }
-.variable-ellipsis { color: #604000; font-weight: bold; }
-.variable-quote { color: #604000; font-weight: bold; }
-.re { color: #000000; }
-.re-char { color: #006030; }
-.re-op { color: #600000; }
-.re-group { color: #003060; }
-.re-ref { color: #404040; }
-
-/* Base tree
- * - Used by class pages to display the base class hierarchy.
- */
-pre.base-tree { font-size: 90%; margin: 1em 0 2em 0;
- line-height: 100%;}
-
-/* Frames-based table of contents headers
- * - Consists of two frames: one for selecting modules; and
- * the other listing the contents of the selected module.
- * - h1.toc is used for each frame's heading
- * - h2.toc is used for subheadings within each frame.
- */
-h1.toc { text-align: center; font-size: 105%;
- margin: 0; font-weight: bold;
- padding: 0; }
-h2.toc { font-size: 100%; font-weight: bold;
- margin: 0.5em 0 0 -0.3em; }
-
-/* Syntax Highlighting for Source Code
- * - doctest examples are displayed in a 'pre.py-doctest' block.
- * If the example is in a details table entry, then it will use
- * the colors specified by the 'table pre.py-doctest' line.
- * - Source code listings are displayed in a 'pre.py-src' block.
- * Each line is marked with 'span.py-line' (used to draw a line
- * down the left margin, separating the code from the line
- * numbers). Line numbers are displayed with 'span.py-lineno'.
- * The expand/collapse block toggle button is displayed with
- * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not
- * modify the font size of the text.)
- * - If a source code page is opened with an anchor, then the
- * corresponding code block will be highlighted. The code
- * block's header is highlighted with 'py-highlight-hdr'; and
- * the code block's body is highlighted with 'py-highlight'.
- * - The remaining py-* classes are used to perform syntax
- * highlighting (py-string for string literals, py-name for names,
- * etc.)
- */
-pre.rst-literal-block,
-pre.py-doctest { margin-left: 1em; margin-right: 1.5em;
- line-height: 150%;
- background-color: #F5FFD0; padding: .5em;
- border: 1px solid #B6C870;
- font-size: 110%; }
-pre.py-src { border: 1px solid #BBB; margin-top: 3em;
- background: #f0f0f0; color: #000000;
- line-height: 150%; }
-span.py-line { margin-left: .2em; padding-left: .4em; }
-span.py-lineno { border-right: 1px solid #BBB;
- padding: .3em .5em .3em .5em;
- font-style: italic; font-size: 90%; }
-a.py-toggle { text-decoration: none; }
-div.py-highlight-hdr { border-top: 1px solid #BBB;
- background: #d0e0e0; }
-div.py-highlight { border-bottom: 1px solid #BBB;
- background: #d0e0e0; }
-.py-prompt { color: #005050; font-weight: bold;}
-.py-string { color: #006030; }
-.py-comment { color: #003060; }
-.py-keyword { color: #600000; }
-.py-output { color: #404040; }
-.py-name { color: #000050; }
-.py-name:link { color: #000050; }
-.py-name:visited { color: #000050; }
-.py-number { color: #005000; }
-.py-def-name { color: #000060; font-weight: bold; }
-.py-base-class { color: #000060; }
-.py-param { color: #000060; }
-.py-docstring { color: #006030; }
-.py-decorator { color: #804020; }
-/* Use this if you don't want links to names underlined: */
-/*a.py-name { text-decoration: none; }*/
-
-/* Graphs & Diagrams
- * - These CSS styles are used for graphs & diagrams generated using
- * Graphviz dot. 'img.graph-without-title' is used for bare
- * diagrams (to remove the border created by making the image
- * clickable).
- */
-img.graph-without-title { border: none; }
-img.graph-with-title { border: 1px solid #000000; }
-span.graph-title { font-weight: bold; }
-span.graph-caption { }
-
-/* General-purpose classes
- * - 'p.indent-wrapped-lines' defines a paragraph whose first line
- * is not indented, but whose subsequent lines are.
- * - The 'nomargin-top' class is used to remove the top margin (e.g.
- * from lists). The 'nomargin' class is used to remove both the
- * top and bottom margin (but not the left or right margin --
- * for lists, that would cause the bullets to disappear.)
- */
-p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em;
- margin: 0; }
-.nomargin-top { margin-top: 0; }
-.nomargin { margin-top: 0; margin-bottom: 0; }
diff --git a/scripts/find_error.py b/scripts/find_error.py
deleted file mode 120000
index ba0b76f1..00000000
--- a/scripts/find_error.py
+++ /dev/null
@@ -1 +0,0 @@
-debug_lexer.py \ No newline at end of file
diff --git a/scripts/get_vimkw.py b/scripts/get_vimkw.py
deleted file mode 100644
index a1b6873e..00000000
--- a/scripts/get_vimkw.py
+++ /dev/null
@@ -1,74 +0,0 @@
-from __future__ import print_function
-
-import re
-
-from pygments.util import format_lines
-
-r_line = re.compile(r"^(syn keyword vimCommand contained|syn keyword vimOption "
- r"contained|syn keyword vimAutoEvent contained)\s+(.*)")
-r_item = re.compile(r"(\w+)(?:\[(\w+)\])?")
-
-HEADER = '''\
-# -*- coding: utf-8 -*-
-"""
- pygments.lexers._vim_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This file is autogenerated by scripts/get_vimkw.py
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-# Split up in multiple functions so it's importable by jython, which has a
-# per-method size limit.
-'''
-
-METHOD = '''\
-def _get%(key)s():
-%(body)s
- return var
-%(key)s = _get%(key)s()
-'''
-
-def getkw(input, output):
- out = file(output, 'w')
-
- # Copy template from an existing file.
- print(HEADER, file=out)
-
- output_info = {'command': [], 'option': [], 'auto': []}
- for line in file(input):
- m = r_line.match(line)
- if m:
- # Decide which output gets mapped to d
- if 'vimCommand' in m.group(1):
- d = output_info['command']
- elif 'AutoEvent' in m.group(1):
- d = output_info['auto']
- else:
- d = output_info['option']
-
- # Extract all the shortened versions
- for i in r_item.finditer(m.group(2)):
- 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 key, keywordlist in output_info.items():
- keywordlist.sort()
- body = format_lines('var', keywordlist, raw=True, indent_level=1)
- print(METHOD % locals(), file=out)
-
-def is_keyword(w, keywords):
- for i in range(len(w), 0, -1):
- if w[:i] in keywords:
- return keywords[w[:i]][:len(w)] == w
- return False
-
-if __name__ == "__main__":
- getkw("/usr/share/vim/vim74/syntax/vim.vim",
- "pygments/lexers/_vim_builtins.py")
diff --git a/scripts/pylintrc b/scripts/pylintrc
deleted file mode 100644
index aa04e12e..00000000
--- a/scripts/pylintrc
+++ /dev/null
@@ -1,301 +0,0 @@
-# lint Python modules using external checkers.
-#
-# This is the main checker controling the other ones and the reports
-# generation. It is itself both a raw checker and an astng checker in order
-# to:
-# * handle message activation / deactivation at the module level
-# * handle some basic but necessary stats'data (number of classes, methods...)
-#
-[MASTER]
-
-# Specify a configuration file.
-#rcfile=
-
-# Profiled execution.
-profile=no
-
-# Add <file or directory> to the black list. It should be a base name, not a
-# path. You may set this option multiple times.
-ignore=.svn
-
-# Pickle collected data for later comparisons.
-persistent=yes
-
-# Set the cache size for astng objects.
-cache-size=500
-
-# List of plugins (as comma separated values of python modules names) to load,
-# usually to register additional checkers.
-load-plugins=
-
-
-[MESSAGES CONTROL]
-
-# Enable only checker(s) with the given id(s). This option conflict with the
-# disable-checker option
-#enable-checker=
-
-# Enable all checker(s) except those with the given id(s). This option conflict
-# with the disable-checker option
-#disable-checker=
-
-# Enable all messages in the listed categories.
-#enable-msg-cat=
-
-# Disable all messages in the listed categories.
-#disable-msg-cat=
-
-# Enable the message(s) with the given id(s).
-#enable-msg=
-
-# Disable the message(s) with the given id(s).
-disable-msg=C0323,W0142,C0301,C0103,C0111,E0213,C0302,C0203,W0703,R0201
-
-
-[REPORTS]
-
-# set the output format. Available formats are text, parseable, colorized and
-# html
-output-format=colorized
-
-# Include message's id in output
-include-ids=yes
-
-# Put messages in a separate file for each module / package specified on the
-# command line instead of printing them on stdout. Reports (if any) will be
-# written in a file name "pylint_global.[txt|html]".
-files-output=no
-
-# Tells wether to display a full report or only the messages
-reports=yes
-
-# Python expression which should return a note less than 10 (10 is the highest
-# note).You have access to the variables errors warning, statement which
-# respectivly contain the number of errors / warnings messages and the total
-# number of statements analyzed. This is used by the global evaluation report
-# (R0004).
-evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
-
-# Add a comment according to your evaluation note. This is used by the global
-# evaluation report (R0004).
-comment=no
-
-# Enable the report(s) with the given id(s).
-#enable-report=
-
-# Disable the report(s) with the given id(s).
-#disable-report=
-
-
-# checks for
-# * unused variables / imports
-# * undefined variables
-# * redefinition of variable from builtins or from an outer scope
-# * use of variable before assigment
-#
-[VARIABLES]
-
-# Tells wether we should check for unused import in __init__ files.
-init-import=no
-
-# A regular expression matching names used for dummy variables (i.e. not used).
-dummy-variables-rgx=_|dummy
-
-# List of additional names supposed to be defined in builtins. Remember that
-# you should avoid to define new builtins when possible.
-additional-builtins=
-
-
-# try to find bugs in the code using type inference
-#
-[TYPECHECK]
-
-# Tells wether missing members accessed in mixin class should be ignored. A
-# mixin class is detected if its name ends with "mixin" (case insensitive).
-ignore-mixin-members=yes
-
-# When zope mode is activated, consider the acquired-members option to ignore
-# access to some undefined attributes.
-zope=no
-
-# List of members which are usually get through zope's acquisition mecanism and
-# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
-acquired-members=REQUEST,acl_users,aq_parent
-
-
-# checks for :
-# * doc strings
-# * modules / classes / functions / methods / arguments / variables name
-# * number of arguments, local variables, branchs, returns and statements in
-# functions, methods
-# * required module attributes
-# * dangerous default values as arguments
-# * redefinition of function / method / class
-# * uses of the global statement
-#
-[BASIC]
-
-# Required attributes for module, separated by a comma
-required-attributes=
-
-# Regular expression which should only match functions or classes name which do
-# not require a docstring
-no-docstring-rgx=__.*__
-
-# Regular expression which should only match correct module names
-module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
-
-# Regular expression which should only match correct module level names
-const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__))$
-
-# Regular expression which should only match correct class names
-class-rgx=[A-Z_][a-zA-Z0-9]+$
-
-# Regular expression which should only match correct function names
-function-rgx=[a-z_][a-z0-9_]{2,30}$
-
-# Regular expression which should only match correct method names
-method-rgx=[a-z_][a-z0-9_]{2,30}$
-
-# Regular expression which should only match correct instance attribute names
-attr-rgx=[a-z_][a-z0-9_]{2,30}$
-
-# Regular expression which should only match correct argument names
-argument-rgx=[a-z_][a-z0-9_]{2,30}$
-
-# Regular expression which should only match correct variable names
-variable-rgx=[a-z_][a-z0-9_]{2,30}$
-
-# Regular expression which should only match correct list comprehension /
-# generator expression variable names
-inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
-
-# Good variable names which should always be accepted, separated by a comma
-good-names=i,j,k,ex,Run,_
-
-# Bad variable names which should always be refused, separated by a comma
-bad-names=foo,bar,baz,toto,tutu,tata
-
-# List of builtins function names that should not be used, separated by a comma
-bad-functions=apply,input
-
-
-# checks for sign of poor/misdesign:
-# * number of methods, attributes, local variables...
-# * size, complexity of functions, methods
-#
-[DESIGN]
-
-# Maximum number of arguments for function / method
-max-args=12
-
-# Maximum number of locals for function / method body
-max-locals=30
-
-# Maximum number of return / yield for function / method body
-max-returns=12
-
-# Maximum number of branch for function / method body
-max-branchs=30
-
-# Maximum number of statements in function / method body
-max-statements=60
-
-# Maximum number of parents for a class (see R0901).
-max-parents=7
-
-# Maximum number of attributes for a class (see R0902).
-max-attributes=20
-
-# Minimum number of public methods for a class (see R0903).
-min-public-methods=0
-
-# Maximum number of public methods for a class (see R0904).
-max-public-methods=20
-
-
-# checks for
-# * external modules dependencies
-# * relative / wildcard imports
-# * cyclic imports
-# * uses of deprecated modules
-#
-[IMPORTS]
-
-# Deprecated modules which should not be used, separated by a comma
-deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
-
-# Create a graph of every (i.e. internal and external) dependencies in the
-# given file (report R0402 must not be disabled)
-import-graph=
-
-# Create a graph of external dependencies in the given file (report R0402 must
-# not be disabled)
-ext-import-graph=
-
-# Create a graph of internal dependencies in the given file (report R0402 must
-# not be disabled)
-int-import-graph=
-
-
-# checks for :
-# * methods without self as first argument
-# * overridden methods signature
-# * access only to existant members via self
-# * attributes not defined in the __init__ method
-# * supported interfaces implementation
-# * unreachable code
-#
-[CLASSES]
-
-# List of interface methods to ignore, separated by a comma. This is used for
-# instance to not check methods defines in Zope's Interface base class.
-ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
-
-# List of method names used to declare (i.e. assign) instance attributes.
-defining-attr-methods=__init__,__new__,setUp
-
-
-# checks for similarities and duplicated code. This computation may be
-# memory / CPU intensive, so you should disable it if you experiments some
-# problems.
-#
-[SIMILARITIES]
-
-# Minimum lines number of a similarity.
-min-similarity-lines=10
-
-# Ignore comments when computing similarities.
-ignore-comments=yes
-
-# Ignore docstrings when computing similarities.
-ignore-docstrings=yes
-
-
-# checks for:
-# * warning notes in the code like FIXME, XXX
-# * PEP 263: source code with non ascii character but no encoding declaration
-#
-[MISCELLANEOUS]
-
-# List of note tags to take in consideration, separated by a comma.
-notes=FIXME,XXX,TODO
-
-
-# checks for :
-# * unauthorized constructions
-# * strict indentation
-# * line length
-# * use of <> instead of !=
-#
-[FORMAT]
-
-# Maximum number of characters on a single line.
-max-line-length=90
-
-# Maximum number of lines in a module
-max-module-lines=1000
-
-# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
-# tab).
-indent-string=' '
diff --git a/scripts/release-checklist b/scripts/release-checklist
deleted file mode 100644
index efc1e1e8..00000000
--- a/scripts/release-checklist
+++ /dev/null
@@ -1,24 +0,0 @@
-Release checklist
-=================
-
-* Check ``hg status``
-* ``make check``
-* LATER when configured properly: ``make pylint``
-* ``tox``
-* Update version info in ``setup.py/__init__.py``
-* Check setup.py metadata: long description, trove classifiers
-* Update release date/code name in ``CHANGES``
-* ``hg commit``
-* ``make clean``
-* ``python2 setup.py release bdist_wheel``
-* ``python3 setup.py release bdist_wheel sdist``
-* ``twine upload dist/Pygments-$NEWVER*``
-* Check PyPI release page for obvious errors
-* ``hg tag``
-* Merge default into stable if this was a ``x.y.0``
-* Update homepage (release info), regenerate docs (+printable!)
-* Add new version/milestone to tracker categories
-* Write announcement and send to mailing list/python-announce
-* Update version info, add new ``CHANGES`` entry for next version
-* ``hg commit``
-* ``hg push``
diff --git a/scripts/vim2pygments.py b/scripts/vim2pygments.py
deleted file mode 100755
index 42af0bbe..00000000
--- a/scripts/vim2pygments.py
+++ /dev/null
@@ -1,935 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
- Vim Colorscheme Converter
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This script converts vim colorscheme files to valid pygments
- style classes meant for putting into modules.
-
- :copyright 2006 by Armin Ronacher.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import sys
-import re
-from os import path
-from io import StringIO
-
-split_re = re.compile(r'(?<!\\)\s+')
-
-SCRIPT_NAME = 'Vim Colorscheme Converter'
-SCRIPT_VERSION = '0.1'
-
-
-COLORS = {
- # Numeric Colors
- '0': '#000000',
- '1': '#c00000',
- '2': '#008000',
- '3': '#808000',
- '4': '#0000c0',
- '5': '#c000c0',
- '6': '#008080',
- '7': '#c0c0c0',
- '8': '#808080',
- '9': '#ff6060',
- '10': '#00ff00',
- '11': '#ffff00',
- '12': '#8080ff',
- '13': '#ff40ff',
- '14': '#00ffff',
- '15': '#ffffff',
- # Named Colors
- 'alice': '#f0f8ff',
- 'aliceblue': '#f0f8ff',
- 'antique': '#faebd7',
- 'antiquewhite': '#faebd7',
- 'antiquewhite1': '#ffefdb',
- 'antiquewhite2': '#eedfcc',
- 'antiquewhite3': '#cdc0b0',
- 'antiquewhite4': '#8b8378',
- 'aquamarine': '#7fffd4',
- 'aquamarine1': '#7fffd4',
- 'aquamarine2': '#76eec6',
- 'aquamarine3': '#66cdaa',
- 'aquamarine4': '#458b74',
- 'azure': '#f0ffff',
- 'azure1': '#f0ffff',
- 'azure2': '#e0eeee',
- 'azure3': '#c1cdcd',
- 'azure4': '#838b8b',
- 'beige': '#f5f5dc',
- 'bisque': '#ffe4c4',
- 'bisque1': '#ffe4c4',
- 'bisque2': '#eed5b7',
- 'bisque3': '#cdb79e',
- 'bisque4': '#8b7d6b',
- 'black': '#000000',
- 'blanched': '#ffebcd',
- 'blanchedalmond': '#ffebcd',
- 'blue': '#8a2be2',
- 'blue1': '#0000ff',
- 'blue2': '#0000ee',
- 'blue3': '#0000cd',
- 'blue4': '#00008b',
- 'blueviolet': '#8a2be2',
- 'brown': '#a52a2a',
- 'brown1': '#ff4040',
- 'brown2': '#ee3b3b',
- 'brown3': '#cd3333',
- 'brown4': '#8b2323',
- 'burlywood': '#deb887',
- 'burlywood1': '#ffd39b',
- 'burlywood2': '#eec591',
- 'burlywood3': '#cdaa7d',
- 'burlywood4': '#8b7355',
- 'cadet': '#5f9ea0',
- 'cadetblue': '#5f9ea0',
- 'cadetblue1': '#98f5ff',
- 'cadetblue2': '#8ee5ee',
- 'cadetblue3': '#7ac5cd',
- 'cadetblue4': '#53868b',
- 'chartreuse': '#7fff00',
- 'chartreuse1': '#7fff00',
- 'chartreuse2': '#76ee00',
- 'chartreuse3': '#66cd00',
- 'chartreuse4': '#458b00',
- 'chocolate': '#d2691e',
- 'chocolate1': '#ff7f24',
- 'chocolate2': '#ee7621',
- 'chocolate3': '#cd661d',
- 'chocolate4': '#8b4513',
- 'coral': '#ff7f50',
- 'coral1': '#ff7256',
- 'coral2': '#ee6a50',
- 'coral3': '#cd5b45',
- 'coral4': '#8b3e2f',
- 'cornflower': '#6495ed',
- 'cornflowerblue': '#6495ed',
- 'cornsilk': '#fff8dc',
- 'cornsilk1': '#fff8dc',
- 'cornsilk2': '#eee8cd',
- 'cornsilk3': '#cdc8b1',
- 'cornsilk4': '#8b8878',
- 'cyan': '#00ffff',
- 'cyan1': '#00ffff',
- 'cyan2': '#00eeee',
- 'cyan3': '#00cdcd',
- 'cyan4': '#008b8b',
- 'dark': '#8b0000',
- 'darkblue': '#00008b',
- 'darkcyan': '#008b8b',
- 'darkgoldenrod': '#b8860b',
- 'darkgoldenrod1': '#ffb90f',
- 'darkgoldenrod2': '#eead0e',
- 'darkgoldenrod3': '#cd950c',
- 'darkgoldenrod4': '#8b6508',
- 'darkgray': '#a9a9a9',
- 'darkgreen': '#006400',
- 'darkgrey': '#a9a9a9',
- 'darkkhaki': '#bdb76b',
- 'darkmagenta': '#8b008b',
- 'darkolivegreen': '#556b2f',
- 'darkolivegreen1': '#caff70',
- 'darkolivegreen2': '#bcee68',
- 'darkolivegreen3': '#a2cd5a',
- 'darkolivegreen4': '#6e8b3d',
- 'darkorange': '#ff8c00',
- 'darkorange1': '#ff7f00',
- 'darkorange2': '#ee7600',
- 'darkorange3': '#cd6600',
- 'darkorange4': '#8b4500',
- 'darkorchid': '#9932cc',
- 'darkorchid1': '#bf3eff',
- 'darkorchid2': '#b23aee',
- 'darkorchid3': '#9a32cd',
- 'darkorchid4': '#68228b',
- 'darkred': '#8b0000',
- 'darksalmon': '#e9967a',
- 'darkseagreen': '#8fbc8f',
- 'darkseagreen1': '#c1ffc1',
- 'darkseagreen2': '#b4eeb4',
- 'darkseagreen3': '#9bcd9b',
- 'darkseagreen4': '#698b69',
- 'darkslateblue': '#483d8b',
- 'darkslategray': '#2f4f4f',
- 'darkslategray1': '#97ffff',
- 'darkslategray2': '#8deeee',
- 'darkslategray3': '#79cdcd',
- 'darkslategray4': '#528b8b',
- 'darkslategrey': '#2f4f4f',
- 'darkturquoise': '#00ced1',
- 'darkviolet': '#9400d3',
- 'deep': '#ff1493',
- 'deeppink': '#ff1493',
- 'deeppink1': '#ff1493',
- 'deeppink2': '#ee1289',
- 'deeppink3': '#cd1076',
- 'deeppink4': '#8b0a50',
- 'deepskyblue': '#00bfff',
- 'deepskyblue1': '#00bfff',
- 'deepskyblue2': '#00b2ee',
- 'deepskyblue3': '#009acd',
- 'deepskyblue4': '#00688b',
- 'dim': '#696969',
- 'dimgray': '#696969',
- 'dimgrey': '#696969',
- 'dodger': '#1e90ff',
- 'dodgerblue': '#1e90ff',
- 'dodgerblue1': '#1e90ff',
- 'dodgerblue2': '#1c86ee',
- 'dodgerblue3': '#1874cd',
- 'dodgerblue4': '#104e8b',
- 'firebrick': '#b22222',
- 'firebrick1': '#ff3030',
- 'firebrick2': '#ee2c2c',
- 'firebrick3': '#cd2626',
- 'firebrick4': '#8b1a1a',
- 'floral': '#fffaf0',
- 'floralwhite': '#fffaf0',
- 'forest': '#228b22',
- 'forestgreen': '#228b22',
- 'gainsboro': '#dcdcdc',
- 'ghost': '#f8f8ff',
- 'ghostwhite': '#f8f8ff',
- 'gold': '#ffd700',
- 'gold1': '#ffd700',
- 'gold2': '#eec900',
- 'gold3': '#cdad00',
- 'gold4': '#8b7500',
- 'goldenrod': '#daa520',
- 'goldenrod1': '#ffc125',
- 'goldenrod2': '#eeb422',
- 'goldenrod3': '#cd9b1d',
- 'goldenrod4': '#8b6914',
- 'gray': '#bebebe',
- 'gray0': '#000000',
- 'gray1': '#030303',
- 'gray10': '#1a1a1a',
- 'gray100': '#ffffff',
- 'gray11': '#1c1c1c',
- 'gray12': '#1f1f1f',
- 'gray13': '#212121',
- 'gray14': '#242424',
- 'gray15': '#262626',
- 'gray16': '#292929',
- 'gray17': '#2b2b2b',
- 'gray18': '#2e2e2e',
- 'gray19': '#303030',
- 'gray2': '#050505',
- 'gray20': '#333333',
- 'gray21': '#363636',
- 'gray22': '#383838',
- 'gray23': '#3b3b3b',
- 'gray24': '#3d3d3d',
- 'gray25': '#404040',
- 'gray26': '#424242',
- 'gray27': '#454545',
- 'gray28': '#474747',
- 'gray29': '#4a4a4a',
- 'gray3': '#080808',
- 'gray30': '#4d4d4d',
- 'gray31': '#4f4f4f',
- 'gray32': '#525252',
- 'gray33': '#545454',
- 'gray34': '#575757',
- 'gray35': '#595959',
- 'gray36': '#5c5c5c',
- 'gray37': '#5e5e5e',
- 'gray38': '#616161',
- 'gray39': '#636363',
- 'gray4': '#0a0a0a',
- 'gray40': '#666666',
- 'gray41': '#696969',
- 'gray42': '#6b6b6b',
- 'gray43': '#6e6e6e',
- 'gray44': '#707070',
- 'gray45': '#737373',
- 'gray46': '#757575',
- 'gray47': '#787878',
- 'gray48': '#7a7a7a',
- 'gray49': '#7d7d7d',
- 'gray5': '#0d0d0d',
- 'gray50': '#7f7f7f',
- 'gray51': '#828282',
- 'gray52': '#858585',
- 'gray53': '#878787',
- 'gray54': '#8a8a8a',
- 'gray55': '#8c8c8c',
- 'gray56': '#8f8f8f',
- 'gray57': '#919191',
- 'gray58': '#949494',
- 'gray59': '#969696',
- 'gray6': '#0f0f0f',
- 'gray60': '#999999',
- 'gray61': '#9c9c9c',
- 'gray62': '#9e9e9e',
- 'gray63': '#a1a1a1',
- 'gray64': '#a3a3a3',
- 'gray65': '#a6a6a6',
- 'gray66': '#a8a8a8',
- 'gray67': '#ababab',
- 'gray68': '#adadad',
- 'gray69': '#b0b0b0',
- 'gray7': '#121212',
- 'gray70': '#b3b3b3',
- 'gray71': '#b5b5b5',
- 'gray72': '#b8b8b8',
- 'gray73': '#bababa',
- 'gray74': '#bdbdbd',
- 'gray75': '#bfbfbf',
- 'gray76': '#c2c2c2',
- 'gray77': '#c4c4c4',
- 'gray78': '#c7c7c7',
- 'gray79': '#c9c9c9',
- 'gray8': '#141414',
- 'gray80': '#cccccc',
- 'gray81': '#cfcfcf',
- 'gray82': '#d1d1d1',
- 'gray83': '#d4d4d4',
- 'gray84': '#d6d6d6',
- 'gray85': '#d9d9d9',
- 'gray86': '#dbdbdb',
- 'gray87': '#dedede',
- 'gray88': '#e0e0e0',
- 'gray89': '#e3e3e3',
- 'gray9': '#171717',
- 'gray90': '#e5e5e5',
- 'gray91': '#e8e8e8',
- 'gray92': '#ebebeb',
- 'gray93': '#ededed',
- 'gray94': '#f0f0f0',
- 'gray95': '#f2f2f2',
- 'gray96': '#f5f5f5',
- 'gray97': '#f7f7f7',
- 'gray98': '#fafafa',
- 'gray99': '#fcfcfc',
- 'green': '#adff2f',
- 'green1': '#00ff00',
- 'green2': '#00ee00',
- 'green3': '#00cd00',
- 'green4': '#008b00',
- 'greenyellow': '#adff2f',
- 'grey': '#bebebe',
- 'grey0': '#000000',
- 'grey1': '#030303',
- 'grey10': '#1a1a1a',
- 'grey100': '#ffffff',
- 'grey11': '#1c1c1c',
- 'grey12': '#1f1f1f',
- 'grey13': '#212121',
- 'grey14': '#242424',
- 'grey15': '#262626',
- 'grey16': '#292929',
- 'grey17': '#2b2b2b',
- 'grey18': '#2e2e2e',
- 'grey19': '#303030',
- 'grey2': '#050505',
- 'grey20': '#333333',
- 'grey21': '#363636',
- 'grey22': '#383838',
- 'grey23': '#3b3b3b',
- 'grey24': '#3d3d3d',
- 'grey25': '#404040',
- 'grey26': '#424242',
- 'grey27': '#454545',
- 'grey28': '#474747',
- 'grey29': '#4a4a4a',
- 'grey3': '#080808',
- 'grey30': '#4d4d4d',
- 'grey31': '#4f4f4f',
- 'grey32': '#525252',
- 'grey33': '#545454',
- 'grey34': '#575757',
- 'grey35': '#595959',
- 'grey36': '#5c5c5c',
- 'grey37': '#5e5e5e',
- 'grey38': '#616161',
- 'grey39': '#636363',
- 'grey4': '#0a0a0a',
- 'grey40': '#666666',
- 'grey41': '#696969',
- 'grey42': '#6b6b6b',
- 'grey43': '#6e6e6e',
- 'grey44': '#707070',
- 'grey45': '#737373',
- 'grey46': '#757575',
- 'grey47': '#787878',
- 'grey48': '#7a7a7a',
- 'grey49': '#7d7d7d',
- 'grey5': '#0d0d0d',
- 'grey50': '#7f7f7f',
- 'grey51': '#828282',
- 'grey52': '#858585',
- 'grey53': '#878787',
- 'grey54': '#8a8a8a',
- 'grey55': '#8c8c8c',
- 'grey56': '#8f8f8f',
- 'grey57': '#919191',
- 'grey58': '#949494',
- 'grey59': '#969696',
- 'grey6': '#0f0f0f',
- 'grey60': '#999999',
- 'grey61': '#9c9c9c',
- 'grey62': '#9e9e9e',
- 'grey63': '#a1a1a1',
- 'grey64': '#a3a3a3',
- 'grey65': '#a6a6a6',
- 'grey66': '#a8a8a8',
- 'grey67': '#ababab',
- 'grey68': '#adadad',
- 'grey69': '#b0b0b0',
- 'grey7': '#121212',
- 'grey70': '#b3b3b3',
- 'grey71': '#b5b5b5',
- 'grey72': '#b8b8b8',
- 'grey73': '#bababa',
- 'grey74': '#bdbdbd',
- 'grey75': '#bfbfbf',
- 'grey76': '#c2c2c2',
- 'grey77': '#c4c4c4',
- 'grey78': '#c7c7c7',
- 'grey79': '#c9c9c9',
- 'grey8': '#141414',
- 'grey80': '#cccccc',
- 'grey81': '#cfcfcf',
- 'grey82': '#d1d1d1',
- 'grey83': '#d4d4d4',
- 'grey84': '#d6d6d6',
- 'grey85': '#d9d9d9',
- 'grey86': '#dbdbdb',
- 'grey87': '#dedede',
- 'grey88': '#e0e0e0',
- 'grey89': '#e3e3e3',
- 'grey9': '#171717',
- 'grey90': '#e5e5e5',
- 'grey91': '#e8e8e8',
- 'grey92': '#ebebeb',
- 'grey93': '#ededed',
- 'grey94': '#f0f0f0',
- 'grey95': '#f2f2f2',
- 'grey96': '#f5f5f5',
- 'grey97': '#f7f7f7',
- 'grey98': '#fafafa',
- 'grey99': '#fcfcfc',
- 'honeydew': '#f0fff0',
- 'honeydew1': '#f0fff0',
- 'honeydew2': '#e0eee0',
- 'honeydew3': '#c1cdc1',
- 'honeydew4': '#838b83',
- 'hot': '#ff69b4',
- 'hotpink': '#ff69b4',
- 'hotpink1': '#ff6eb4',
- 'hotpink2': '#ee6aa7',
- 'hotpink3': '#cd6090',
- 'hotpink4': '#8b3a62',
- 'indian': '#cd5c5c',
- 'indianred': '#cd5c5c',
- 'indianred1': '#ff6a6a',
- 'indianred2': '#ee6363',
- 'indianred3': '#cd5555',
- 'indianred4': '#8b3a3a',
- 'ivory': '#fffff0',
- 'ivory1': '#fffff0',
- 'ivory2': '#eeeee0',
- 'ivory3': '#cdcdc1',
- 'ivory4': '#8b8b83',
- 'khaki': '#f0e68c',
- 'khaki1': '#fff68f',
- 'khaki2': '#eee685',
- 'khaki3': '#cdc673',
- 'khaki4': '#8b864e',
- 'lavender': '#fff0f5',
- 'lavenderblush': '#fff0f5',
- 'lavenderblush1': '#fff0f5',
- 'lavenderblush2': '#eee0e5',
- 'lavenderblush3': '#cdc1c5',
- 'lavenderblush4': '#8b8386',
- 'lawn': '#7cfc00',
- 'lawngreen': '#7cfc00',
- 'lemon': '#fffacd',
- 'lemonchiffon': '#fffacd',
- 'lemonchiffon1': '#fffacd',
- 'lemonchiffon2': '#eee9bf',
- 'lemonchiffon3': '#cdc9a5',
- 'lemonchiffon4': '#8b8970',
- 'light': '#90ee90',
- 'lightblue': '#add8e6',
- 'lightblue1': '#bfefff',
- 'lightblue2': '#b2dfee',
- 'lightblue3': '#9ac0cd',
- 'lightblue4': '#68838b',
- 'lightcoral': '#f08080',
- 'lightcyan': '#e0ffff',
- 'lightcyan1': '#e0ffff',
- 'lightcyan2': '#d1eeee',
- 'lightcyan3': '#b4cdcd',
- 'lightcyan4': '#7a8b8b',
- 'lightgoldenrod': '#eedd82',
- 'lightgoldenrod1': '#ffec8b',
- 'lightgoldenrod2': '#eedc82',
- 'lightgoldenrod3': '#cdbe70',
- 'lightgoldenrod4': '#8b814c',
- 'lightgoldenrodyellow': '#fafad2',
- 'lightgray': '#d3d3d3',
- 'lightgreen': '#90ee90',
- 'lightgrey': '#d3d3d3',
- 'lightpink': '#ffb6c1',
- 'lightpink1': '#ffaeb9',
- 'lightpink2': '#eea2ad',
- 'lightpink3': '#cd8c95',
- 'lightpink4': '#8b5f65',
- 'lightsalmon': '#ffa07a',
- 'lightsalmon1': '#ffa07a',
- 'lightsalmon2': '#ee9572',
- 'lightsalmon3': '#cd8162',
- 'lightsalmon4': '#8b5742',
- 'lightseagreen': '#20b2aa',
- 'lightskyblue': '#87cefa',
- 'lightskyblue1': '#b0e2ff',
- 'lightskyblue2': '#a4d3ee',
- 'lightskyblue3': '#8db6cd',
- 'lightskyblue4': '#607b8b',
- 'lightslateblue': '#8470ff',
- 'lightslategray': '#778899',
- 'lightslategrey': '#778899',
- 'lightsteelblue': '#b0c4de',
- 'lightsteelblue1': '#cae1ff',
- 'lightsteelblue2': '#bcd2ee',
- 'lightsteelblue3': '#a2b5cd',
- 'lightsteelblue4': '#6e7b8b',
- 'lightyellow': '#ffffe0',
- 'lightyellow1': '#ffffe0',
- 'lightyellow2': '#eeeed1',
- 'lightyellow3': '#cdcdb4',
- 'lightyellow4': '#8b8b7a',
- 'lime': '#32cd32',
- 'limegreen': '#32cd32',
- 'linen': '#faf0e6',
- 'magenta': '#ff00ff',
- 'magenta1': '#ff00ff',
- 'magenta2': '#ee00ee',
- 'magenta3': '#cd00cd',
- 'magenta4': '#8b008b',
- 'maroon': '#b03060',
- 'maroon1': '#ff34b3',
- 'maroon2': '#ee30a7',
- 'maroon3': '#cd2990',
- 'maroon4': '#8b1c62',
- 'medium': '#9370db',
- 'mediumaquamarine': '#66cdaa',
- 'mediumblue': '#0000cd',
- 'mediumorchid': '#ba55d3',
- 'mediumorchid1': '#e066ff',
- 'mediumorchid2': '#d15fee',
- 'mediumorchid3': '#b452cd',
- 'mediumorchid4': '#7a378b',
- 'mediumpurple': '#9370db',
- 'mediumpurple1': '#ab82ff',
- 'mediumpurple2': '#9f79ee',
- 'mediumpurple3': '#8968cd',
- 'mediumpurple4': '#5d478b',
- 'mediumseagreen': '#3cb371',
- 'mediumslateblue': '#7b68ee',
- 'mediumspringgreen': '#00fa9a',
- 'mediumturquoise': '#48d1cc',
- 'mediumvioletred': '#c71585',
- 'midnight': '#191970',
- 'midnightblue': '#191970',
- 'mint': '#f5fffa',
- 'mintcream': '#f5fffa',
- 'misty': '#ffe4e1',
- 'mistyrose': '#ffe4e1',
- 'mistyrose1': '#ffe4e1',
- 'mistyrose2': '#eed5d2',
- 'mistyrose3': '#cdb7b5',
- 'mistyrose4': '#8b7d7b',
- 'moccasin': '#ffe4b5',
- 'navajo': '#ffdead',
- 'navajowhite': '#ffdead',
- 'navajowhite1': '#ffdead',
- 'navajowhite2': '#eecfa1',
- 'navajowhite3': '#cdb38b',
- 'navajowhite4': '#8b795e',
- 'navy': '#000080',
- 'navyblue': '#000080',
- 'old': '#fdf5e6',
- 'oldlace': '#fdf5e6',
- 'olive': '#6b8e23',
- 'olivedrab': '#6b8e23',
- 'olivedrab1': '#c0ff3e',
- 'olivedrab2': '#b3ee3a',
- 'olivedrab3': '#9acd32',
- 'olivedrab4': '#698b22',
- 'orange': '#ff4500',
- 'orange1': '#ffa500',
- 'orange2': '#ee9a00',
- 'orange3': '#cd8500',
- 'orange4': '#8b5a00',
- 'orangered': '#ff4500',
- 'orangered1': '#ff4500',
- 'orangered2': '#ee4000',
- 'orangered3': '#cd3700',
- 'orangered4': '#8b2500',
- 'orchid': '#da70d6',
- 'orchid1': '#ff83fa',
- 'orchid2': '#ee7ae9',
- 'orchid3': '#cd69c9',
- 'orchid4': '#8b4789',
- 'pale': '#db7093',
- 'palegoldenrod': '#eee8aa',
- 'palegreen': '#98fb98',
- 'palegreen1': '#9aff9a',
- 'palegreen2': '#90ee90',
- 'palegreen3': '#7ccd7c',
- 'palegreen4': '#548b54',
- 'paleturquoise': '#afeeee',
- 'paleturquoise1': '#bbffff',
- 'paleturquoise2': '#aeeeee',
- 'paleturquoise3': '#96cdcd',
- 'paleturquoise4': '#668b8b',
- 'palevioletred': '#db7093',
- 'palevioletred1': '#ff82ab',
- 'palevioletred2': '#ee799f',
- 'palevioletred3': '#cd6889',
- 'palevioletred4': '#8b475d',
- 'papaya': '#ffefd5',
- 'papayawhip': '#ffefd5',
- 'peach': '#ffdab9',
- 'peachpuff': '#ffdab9',
- 'peachpuff1': '#ffdab9',
- 'peachpuff2': '#eecbad',
- 'peachpuff3': '#cdaf95',
- 'peachpuff4': '#8b7765',
- 'peru': '#cd853f',
- 'pink': '#ffc0cb',
- 'pink1': '#ffb5c5',
- 'pink2': '#eea9b8',
- 'pink3': '#cd919e',
- 'pink4': '#8b636c',
- 'plum': '#dda0dd',
- 'plum1': '#ffbbff',
- 'plum2': '#eeaeee',
- 'plum3': '#cd96cd',
- 'plum4': '#8b668b',
- 'powder': '#b0e0e6',
- 'powderblue': '#b0e0e6',
- 'purple': '#a020f0',
- 'purple1': '#9b30ff',
- 'purple2': '#912cee',
- 'purple3': '#7d26cd',
- 'purple4': '#551a8b',
- 'red': '#ff0000',
- 'red1': '#ff0000',
- 'red2': '#ee0000',
- 'red3': '#cd0000',
- 'red4': '#8b0000',
- 'rosy': '#bc8f8f',
- 'rosybrown': '#bc8f8f',
- 'rosybrown1': '#ffc1c1',
- 'rosybrown2': '#eeb4b4',
- 'rosybrown3': '#cd9b9b',
- 'rosybrown4': '#8b6969',
- 'royal': '#4169e1',
- 'royalblue': '#4169e1',
- 'royalblue1': '#4876ff',
- 'royalblue2': '#436eee',
- 'royalblue3': '#3a5fcd',
- 'royalblue4': '#27408b',
- 'saddle': '#8b4513',
- 'saddlebrown': '#8b4513',
- 'salmon': '#fa8072',
- 'salmon1': '#ff8c69',
- 'salmon2': '#ee8262',
- 'salmon3': '#cd7054',
- 'salmon4': '#8b4c39',
- 'sandy': '#f4a460',
- 'sandybrown': '#f4a460',
- 'sea': '#2e8b57',
- 'seagreen': '#2e8b57',
- 'seagreen1': '#54ff9f',
- 'seagreen2': '#4eee94',
- 'seagreen3': '#43cd80',
- 'seagreen4': '#2e8b57',
- 'seashell': '#fff5ee',
- 'seashell1': '#fff5ee',
- 'seashell2': '#eee5de',
- 'seashell3': '#cdc5bf',
- 'seashell4': '#8b8682',
- 'sienna': '#a0522d',
- 'sienna1': '#ff8247',
- 'sienna2': '#ee7942',
- 'sienna3': '#cd6839',
- 'sienna4': '#8b4726',
- 'sky': '#87ceeb',
- 'skyblue': '#87ceeb',
- 'skyblue1': '#87ceff',
- 'skyblue2': '#7ec0ee',
- 'skyblue3': '#6ca6cd',
- 'skyblue4': '#4a708b',
- 'slate': '#6a5acd',
- 'slateblue': '#6a5acd',
- 'slateblue1': '#836fff',
- 'slateblue2': '#7a67ee',
- 'slateblue3': '#6959cd',
- 'slateblue4': '#473c8b',
- 'slategray': '#708090',
- 'slategray1': '#c6e2ff',
- 'slategray2': '#b9d3ee',
- 'slategray3': '#9fb6cd',
- 'slategray4': '#6c7b8b',
- 'slategrey': '#708090',
- 'snow': '#fffafa',
- 'snow1': '#fffafa',
- 'snow2': '#eee9e9',
- 'snow3': '#cdc9c9',
- 'snow4': '#8b8989',
- 'spring': '#00ff7f',
- 'springgreen': '#00ff7f',
- 'springgreen1': '#00ff7f',
- 'springgreen2': '#00ee76',
- 'springgreen3': '#00cd66',
- 'springgreen4': '#008b45',
- 'steel': '#4682b4',
- 'steelblue': '#4682b4',
- 'steelblue1': '#63b8ff',
- 'steelblue2': '#5cacee',
- 'steelblue3': '#4f94cd',
- 'steelblue4': '#36648b',
- 'tan': '#d2b48c',
- 'tan1': '#ffa54f',
- 'tan2': '#ee9a49',
- 'tan3': '#cd853f',
- 'tan4': '#8b5a2b',
- 'thistle': '#d8bfd8',
- 'thistle1': '#ffe1ff',
- 'thistle2': '#eed2ee',
- 'thistle3': '#cdb5cd',
- 'thistle4': '#8b7b8b',
- 'tomato': '#ff6347',
- 'tomato1': '#ff6347',
- 'tomato2': '#ee5c42',
- 'tomato3': '#cd4f39',
- 'tomato4': '#8b3626',
- 'turquoise': '#40e0d0',
- 'turquoise1': '#00f5ff',
- 'turquoise2': '#00e5ee',
- 'turquoise3': '#00c5cd',
- 'turquoise4': '#00868b',
- 'violet': '#ee82ee',
- 'violetred': '#d02090',
- 'violetred1': '#ff3e96',
- 'violetred2': '#ee3a8c',
- 'violetred3': '#cd3278',
- 'violetred4': '#8b2252',
- 'wheat': '#f5deb3',
- 'wheat1': '#ffe7ba',
- 'wheat2': '#eed8ae',
- 'wheat3': '#cdba96',
- 'wheat4': '#8b7e66',
- 'white': '#ffffff',
- 'whitesmoke': '#f5f5f5',
- 'yellow': '#ffff00',
- 'yellow1': '#ffff00',
- 'yellow2': '#eeee00',
- 'yellow3': '#cdcd00',
- 'yellow4': '#8b8b00',
- 'yellowgreen': '#9acd32'
-}
-
-TOKENS = {
- 'normal': '',
- 'string': 'String',
- 'number': 'Number',
- 'float': 'Number.Float',
- 'constant': 'Name.Constant',
- 'number': 'Number',
- 'statement': ('Keyword', 'Name.Tag'),
- 'identifier': 'Name.Variable',
- 'operator': 'Operator.Word',
- 'label': 'Name.Label',
- 'exception': 'Name.Exception',
- 'function': ('Name.Function', 'Name.Attribute'),
- 'preproc': 'Comment.Preproc',
- 'comment': 'Comment',
- 'type': 'Keyword.Type',
- 'diffadd': 'Generic.Inserted',
- 'diffdelete': 'Generic.Deleted',
- 'error': 'Generic.Error',
- 'errormsg': 'Generic.Traceback',
- 'title': ('Generic.Heading', 'Generic.Subheading'),
- 'underlined': 'Generic.Emph',
- 'special': 'Name.Entity',
- 'nontext': 'Generic.Output'
-}
-
-TOKEN_TYPES = set()
-for token in TOKENS.values():
- if not isinstance(token, tuple):
- token = (token,)
- for token in token:
- if token:
- TOKEN_TYPES.add(token.split('.')[0])
-
-
-def get_vim_color(color):
- if color.startswith('#'):
- if len(color) == 7:
- return color
- else:
- return '#%s0' % '0'.join(color)[1:]
- return COLORS.get(color.lower())
-
-
-def find_colors(code):
- colors = {'Normal': {}}
- bg_color = None
- def set(attrib, value):
- if token not in colors:
- colors[token] = {}
- if key.startswith('gui') or attrib not in colors[token]:
- colors[token][attrib] = value
-
- for line in code.splitlines():
- if line.startswith('"'):
- continue
- parts = split_re.split(line.strip())
- if len(parts) == 2 and parts[0] == 'set':
- p = parts[1].split()
- if p[0] == 'background' and p[1] == 'dark':
- token = 'Normal'
- bg_color = '#000000'
- elif len(parts) > 2 and \
- len(parts[0]) >= 2 and \
- 'highlight'.startswith(parts[0]):
- token = parts[1].lower()
- if token not in TOKENS:
- continue
- for item in parts[2:]:
- p = item.split('=', 1)
- if not len(p) == 2:
- continue
- key, value = p
- if key in ('ctermfg', 'guifg'):
- color = get_vim_color(value)
- if color:
- set('color', color)
- elif key in ('ctermbg', 'guibg'):
- color = get_vim_color(value)
- if color:
- set('bgcolor', color)
- elif key in ('term', 'cterm', 'gui'):
- items = value.split(',')
- for item in items:
- item = item.lower()
- if item == 'none':
- set('noinherit', True)
- elif item == 'bold':
- set('bold', True)
- elif item == 'underline':
- set('underline', True)
- elif item == 'italic':
- set('italic', True)
-
- if bg_color is not None and not colors['Normal'].get('bgcolor'):
- colors['Normal']['bgcolor'] = bg_color
-
- color_map = {}
- for token, styles in colors.items():
- if token in TOKENS:
- tmp = []
- if styles.get('noinherit'):
- tmp.append('noinherit')
- if 'color' in styles:
- tmp.append(styles['color'])
- if 'bgcolor' in styles:
- tmp.append('bg:' + styles['bgcolor'])
- if styles.get('bold'):
- tmp.append('bold')
- if styles.get('italic'):
- tmp.append('italic')
- if styles.get('underline'):
- tmp.append('underline')
- tokens = TOKENS[token]
- if not isinstance(tokens, tuple):
- tokens = (tokens,)
- for token in tokens:
- color_map[token] = ' '.join(tmp)
-
- default_token = color_map.pop('')
- return default_token, color_map
-
-
-class StyleWriter(object):
-
- def __init__(self, code, name):
- self.code = code
- self.name = name.lower()
-
- def write_header(self, out):
- out.write('# -*- coding: utf-8 -*-\n"""\n')
- out.write(' %s Colorscheme\n' % self.name.title())
- out.write(' %s\n\n' % ('~' * (len(self.name) + 12)))
- out.write(' Converted by %s\n' % SCRIPT_NAME)
- out.write('"""\nfrom pygments.style import Style\n')
- out.write('from pygments.token import Token, %s\n\n' % ', '.join(TOKEN_TYPES))
- out.write('class %sStyle(Style):\n\n' % self.name.title())
-
- def write(self, out):
- self.write_header(out)
- default_token, tokens = find_colors(self.code)
- tokens = list(tokens.items())
- tokens.sort(lambda a, b: cmp(len(a[0]), len(a[1])))
- bg_color = [x[3:] for x in default_token.split() if x.startswith('bg:')]
- if bg_color:
- out.write(' background_color = %r\n' % bg_color[0])
- out.write(' styles = {\n')
- out.write(' %-20s%r,\n' % ('Token:', default_token))
- for token, definition in tokens:
- if definition:
- out.write(' %-20s%r,\n' % (token + ':', definition))
- out.write(' }')
-
- def __repr__(self):
- out = StringIO()
- self.write_style(out)
- return out.getvalue()
-
-
-def convert(filename, stream=None):
- name = path.basename(filename)
- if name.endswith('.vim'):
- name = name[:-4]
- f = file(filename)
- code = f.read()
- f.close()
- writer = StyleWriter(code, name)
- if stream is not None:
- out = stream
- else:
- out = StringIO()
- writer.write(out)
- if stream is None:
- return out.getvalue()
-
-
-def main():
- if len(sys.argv) != 2 or sys.argv[1] in ('-h', '--help'):
- print('Usage: %s <filename.vim>' % sys.argv[0])
- return 2
- if sys.argv[1] in ('-v', '--version'):
- print('%s %s' % (SCRIPT_NAME, SCRIPT_VERSION))
- return
- filename = sys.argv[1]
- if not (path.exists(filename) and path.isfile(filename)):
- print('Error: %s not found' % filename)
- return 1
- convert(filename, sys.stdout)
- sys.stdout.write('\n')
-
-
-if __name__ == '__main__':
- sys.exit(main() or 0)
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 961eb6d4..00000000
--- a/setup.cfg
+++ /dev/null
@@ -1,10 +0,0 @@
-[egg_info]
-tag_build = dev
-tag_date = true
-
-[aliases]
-release = egg_info -Db ''
-upload = upload --sign --identity=36580288
-
-[bdist_wheel]
-universal = 1
diff --git a/setup.py b/setup.py
deleted file mode 100755
index e3d43fc0..00000000
--- a/setup.py
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
-Pygments
-~~~~~~~~
-
-Pygments is a syntax highlighting package written in Python.
-
-It is a generic syntax highlighter suitable for use in code hosting, forums,
-wikis or other applications that need to prettify source code. Highlights
-are:
-
-* a wide range of over 300 languages and other text formats is supported
-* special attention is paid to details, increasing quality by a fair amount
-* support for new languages and formats are added easily
-* a number of output formats, presently HTML, LaTeX, RTF, SVG, all image \
- formats that PIL supports and ANSI sequences
-* it is usable as a command-line tool and as a library
-
-:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
-:license: BSD, see LICENSE for details.
-"""
-
-try:
- from setuptools import setup, find_packages
- have_setuptools = True
-except ImportError:
- from distutils.core import setup
- def find_packages(*args, **kwargs):
- return [
- 'pygments',
- 'pygments.lexers',
- 'pygments.formatters',
- 'pygments.styles',
- 'pygments.filters',
- ]
- have_setuptools = False
-
-if have_setuptools:
- add_keywords = dict(
- entry_points = {
- 'console_scripts': ['pygmentize = pygments.cmdline:main'],
- },
- )
-else:
- add_keywords = dict(
- scripts = ['pygmentize'],
- )
-
-setup(
- name = 'Pygments',
- version = '2.4.2',
- url = 'http://pygments.org/',
- license = 'BSD License',
- author = 'Georg Brandl',
- author_email = 'georg@python.org',
- description = 'Pygments is a syntax highlighting package written in Python.',
- long_description = __doc__,
- keywords = 'syntax highlighting',
- packages = find_packages(),
- platforms = 'any',
- zip_safe = False,
- include_package_data = True,
- python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
- classifiers = [
- 'License :: OSI Approved :: BSD License',
- 'Intended Audience :: Developers',
- 'Intended Audience :: End Users/Desktop',
- 'Intended Audience :: System Administrators',
- 'Development Status :: 6 - Mature',
- 'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: 3.7',
- 'Operating System :: OS Independent',
- 'Topic :: Text Processing :: Filters',
- 'Topic :: Utilities',
- ],
- **add_keywords
-)
diff --git a/tests/dtds/HTML4-f.dtd b/tests/dtds/HTML4-f.dtd
deleted file mode 100644
index 95520128..00000000
--- a/tests/dtds/HTML4-f.dtd
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- This is the HTML 4.0 Frameset DTD, which should be
- used for documents with frames. This DTD is identical
- to the HTML 4.0 Transitional DTD except for the
- content model of the "HTML" element: in frameset
- documents, the "FRAMESET" element replaces the "BODY"
- element.
-
- Draft: $Date: 1999/05/02 15:37:15 $
-
- Authors:
- Dave Raggett <dsr@w3.org>
- Arnaud Le Hors <lehors@w3.org>
- Ian Jacobs <ij@w3.org>
-
- Further information about HTML 4.0 is available at:
-
- http://www.w3.org/TR/REC-html40.
--->
-<!ENTITY % HTML.Version "-//W3C//DTD HTML 4.0 Frameset//EN"
- -- Typical usage:
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN"
- "http://www.w3.org/TR/REC-html40/frameset.dtd">
- <html>
- <head>
- ...
- </head>
- <frameset>
- ...
- </frameset>
- </html>
--->
-
-<!ENTITY % HTML.Frameset "INCLUDE">
-<!ENTITY % HTML4.dtd PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-%HTML4.dtd; \ No newline at end of file
diff --git a/tests/dtds/HTML4-s.dtd b/tests/dtds/HTML4-s.dtd
deleted file mode 100644
index 8ce7917b..00000000
--- a/tests/dtds/HTML4-s.dtd
+++ /dev/null
@@ -1,869 +0,0 @@
-<!--
- This is HTML 4.0 Strict DTD, which excludes the presentation
- attributes and elements that W3C expects to phase out as
- support for style sheets matures. Authors should use the Strict
- DTD when possible, but may use the Transitional DTD when support
- for presentation attribute and elements is required.
-
- HTML 4.0 includes mechanisms for style sheets, scripting,
- embedding objects, improved support for right to left and mixed
- direction text, and enhancements to forms for improved
- accessibility for people with disabilities.
-
- Draft: $Date: 1999/05/02 15:37:15 $
-
- Authors:
- Dave Raggett <dsr@w3.org>
- Arnaud Le Hors <lehors@w3.org>
- Ian Jacobs <ij@w3.org>
-
- Further information about HTML 4.0 is available at:
-
- http://www.w3.org/TR/REC-html40
--->
-<!--
- Typical usage:
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
- "http://www.w3.org/TR/REC-html40/strict.dtd">
- <html>
- <head>
- ...
- </head>
- <body>
- ...
- </body>
- </html>
-
- The URI used as a system identifier with the public identifier allows
- the user agent to download the DTD and entity sets as needed.
-
- The FPI for the Transitional HTML 4.0 DTD is:
-
- "-//W3C//DTD HTML 4.0 Transitional//EN
-
- and its URI is:
-
- http://www.w3.org/TR/REC-html40/loose.dtd
-
- If you are writing a document that includes frames, use
- the following FPI:
-
- "-//W3C//DTD HTML 4.0 Frameset//EN"
-
- with the URI:
-
- http://www.w3.org/TR/REC-html40/frameset.dtd
-
- The following URIs are supported in relation to HTML 4.0
-
- "http://www.w3.org/TR/REC-html40/strict.dtd" (Strict DTD)
- "http://www.w3.org/TR/REC-html40/loose.dtd" (Loose DTD)
- "http://www.w3.org/TR/REC-html40/frameset.dtd" (Frameset DTD)
- "http://www.w3.org/TR/REC-html40/HTMLlat1.ent" (Latin-1 entities)
- "http://www.w3.org/TR/REC-html40/HTMLsymbol.ent" (Symbol entities)
- "http://www.w3.org/TR/REC-html40/HTMLspecial.ent" (Special entities)
-
- These URIs point to the latest version of each file. To reference
- this specific revision use the following URIs:
-
- "http://www.w3.org/TR/REC-html40-971218/strict.dtd"
- "http://www.w3.org/TR/REC-html40-971218/loose.dtd"
- "http://www.w3.org/TR/REC-html40-971218/frameset.dtd"
- "http://www.w3.org/TR/REC-html40-971218/HTMLlat1.ent"
- "http://www.w3.org/TR/REC-html40-971218/HTMLsymbol.ent"
- "http://www.w3.org/TR/REC-html40-971218/HTMLspecial.ent"
-
--->
-
-<!--================== Imported Names ====================================-->
-
-<!ENTITY % ContentType "CDATA"
- -- media type, as per [RFC2045]
- -->
-
-<!ENTITY % ContentTypes "CDATA"
- -- comma-separated list of media types, as per [RFC2045]
- -->
-
-<!ENTITY % Charset "CDATA"
- -- a character encoding, as per [RFC2045]
- -->
-
-<!ENTITY % Charsets "CDATA"
- -- a space separated list of character encodings, as per [RFC2045]
- -->
-
-<!ENTITY % LanguageCode "NAME"
- -- a language code, as per [RFC1766]
- -->
-
-<!ENTITY % Character "CDATA"
- -- a single character from [ISO10646]
- -->
-
-<!ENTITY % LinkTypes "CDATA"
- -- space-separated list of link types
- -->
-
-<!ENTITY % MediaDesc "CDATA"
- -- single or comma-separated list of media descriptors
- -->
-
-<!ENTITY % URI "CDATA"
- -- a Uniform Resource Identifier,
- see [URI]
- -->
-
-<!ENTITY % Datetime "CDATA" -- date and time information. ISO date format -->
-
-
-<!ENTITY % Script "CDATA" -- script expression -->
-
-<!ENTITY % StyleSheet "CDATA" -- style sheet data -->
-
-
-
-<!ENTITY % Text "CDATA">
-
-
-<!-- Parameter Entities -->
-
-<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
-
-<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
-
-<!ENTITY % list "UL | OL">
-
-<!ENTITY % preformatted "PRE">
-
-
-<!--================ Character mnemonic entities =========================-->
-
-<!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin1//EN//HTML"
- "http://www.w3.org/TR/REC-html40-971218/HTMLlat1.ent">
-%HTMLlat1;
-
-<!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols//EN//HTML"
- "http://www.w3.org/TR/REC-html40-971218/HTMLsymbol.ent">
-%HTMLsymbol;
-
-<!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special//EN//HTML"
- "http://www.w3.org/TR/REC-html40-971218/HTMLspecial.ent">
-%HTMLspecial;
-<!--=================== Generic Attributes ===============================-->
-
-<!ENTITY % coreattrs
- "id ID #IMPLIED -- document-wide unique id --
- class CDATA #IMPLIED -- space separated list of classes --
- style %StyleSheet; #IMPLIED -- associated style info --
- title %Text; #IMPLIED -- advisory title/amplification --"
- >
-
-<!ENTITY % i18n
- "lang %LanguageCode; #IMPLIED -- language code --
- dir (ltr|rtl) #IMPLIED -- direction for weak/neutral text --"
- >
-
-<!ENTITY % events
- "onclick %Script; #IMPLIED -- a pointer button was clicked --
- ondblclick %Script; #IMPLIED -- a pointer button was double clicked--
- onmousedown %Script; #IMPLIED -- a pointer button was pressed down --
- onmouseup %Script; #IMPLIED -- a pointer button was released --
- onmouseover %Script; #IMPLIED -- a pointer was moved onto --
- onmousemove %Script; #IMPLIED -- a pointer was moved within --
- onmouseout %Script; #IMPLIED -- a pointer was moved away --
- onkeypress %Script; #IMPLIED -- a key was pressed and released --
- onkeydown %Script; #IMPLIED -- a key was pressed down --
- onkeyup %Script; #IMPLIED -- a key was released --"
- >
-
-<!-- Reserved Feature Switch -->
-<!ENTITY % HTML.Reserved "IGNORE">
-
-<!-- The following attributes are reserved for possible future use -->
-<![ %HTML.Reserved; [
-<!ENTITY % reserved
- "datasrc %URI; #IMPLIED -- a single or tabular Data Source --
- datafld CDATA #IMPLIED -- the property or column name --
- dataformatas (plaintext|html) plaintext -- text or html --"
- >
-]]>
-
-<!ENTITY % reserved "">
-
-<!ENTITY % attrs "%coreattrs; %i18n; %events;">
-
-
-<!--=================== Text Markup ======================================-->
-
-<!ENTITY % fontstyle
- "TT | I | B | BIG | SMALL">
-
-<!ENTITY % phrase "EM | STRONG | DFN | CODE |
- SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
-
-<!ENTITY % special
- "A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">
-
-<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
-
-<!-- %inline; covers inline or "text-level" elements -->
-<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
-
-<!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
-<!ATTLIST (%fontstyle;|%phrase;)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT (SUB|SUP) - - (%inline;)* -- subscript, superscript -->
-<!ATTLIST (SUB|SUP)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT SPAN - - (%inline;)* -- generic language/style container -->
-<!ATTLIST SPAN
- %attrs; -- %coreattrs, %i18n, %events --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT BDO - - (%inline;)* -- I18N BiDi over-ride -->
-<!ATTLIST BDO
- %coreattrs; -- id, class, style, title --
- lang %LanguageCode; #IMPLIED -- language code --
- dir (ltr|rtl) #REQUIRED -- directionality --
- >
-
-
-<!ELEMENT BR - O EMPTY -- forced line break -->
-<!ATTLIST BR
- %coreattrs; -- id, class, style, title --
- >
-
-<!--================== HTML content models ===============================-->
-
-<!--
- HTML has two basic content models:
-
- %inline; character level elements and text strings
- %block; block-like elements e.g. paragraphs and lists
--->
-
-<!ENTITY % block
- "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
- BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
-
-<!ENTITY % flow "%block; | %inline;">
-
-<!--=================== Document Body ====================================-->
-
-<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->
-<!ATTLIST BODY
- %attrs; -- %coreattrs, %i18n, %events --
- onload %Script; #IMPLIED -- the document has been loaded --
- onunload %Script; #IMPLIED -- the document has been removed --
- >
-
-<!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
-<!ATTLIST ADDRESS
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT DIV - - (%flow;)* -- generic language/style container -->
-<!ATTLIST DIV
- %attrs; -- %coreattrs, %i18n, %events --
- %reserved; -- reserved for possible future use --
- >
-
-
-<!--================== The Anchor Element ================================-->
-
-<!ENTITY % Shape "(rect|circle|poly|default)">
-<!ENTITY % Coords "CDATA" -- comma separated list of lengths -->
-
-<!ELEMENT A - - (%inline;)* -(A) -- anchor -->
-<!ATTLIST A
- %attrs; -- %coreattrs, %i18n, %events --
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- type %ContentType; #IMPLIED -- advisory content type --
- name CDATA #IMPLIED -- named link end --
- href %URI; #IMPLIED -- URI for linked resource --
- hreflang %LanguageCode; #IMPLIED -- language code --
- rel %LinkTypes; #IMPLIED -- forward link types --
- rev %LinkTypes; #IMPLIED -- reverse link types --
- accesskey %Character; #IMPLIED -- accessibility key character --
- shape %Shape; rect -- for use with client-side image maps --
- coords %Coords; #IMPLIED -- for use with client-side image maps --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!--================== Client-side image maps ============================-->
-
-<!-- These can be placed in the same document or grouped in a
- separate document although this isn't yet widely supported -->
-
-<!ELEMENT MAP - - ((%block;)+ | AREA+) -- client-side image map -->
-<!ATTLIST MAP
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #REQUIRED -- for reference by usemap --
- >
-
-<!ELEMENT AREA - O EMPTY -- client-side image map area -->
-<!ATTLIST AREA
- %attrs; -- %coreattrs, %i18n, %events --
- shape %Shape; rect -- controls interpretation of coords --
- coords %Coords; #IMPLIED -- comma separated list of lengths --
- href %URI; #IMPLIED -- URI for linked resource --
- nohref (nohref) #IMPLIED -- this region has no action --
- alt %Text; #REQUIRED -- short description --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!--================== The LINK Element ==================================-->
-
-<!--
- Relationship values can be used in principle:
-
- a) for document specific toolbars/menus when used
- with the LINK element in document head e.g.
- start, contents, previous, next, index, end, help
- b) to link to a separate style sheet (rel=stylesheet)
- c) to make a link to a script (rel=script)
- d) by stylesheets to control how collections of
- html nodes are rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a postscript or pdf version (rel=alternate media=print)
--->
-
-<!ELEMENT LINK - O EMPTY -- a media-independent link -->
-<!ATTLIST LINK
- %attrs; -- %coreattrs, %i18n, %events --
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- href %URI; #IMPLIED -- URI for linked resource --
- hreflang %LanguageCode; #IMPLIED -- language code --
- type %ContentType; #IMPLIED -- advisory content type --
- rel %LinkTypes; #IMPLIED -- forward link types --
- rev %LinkTypes; #IMPLIED -- reverse link types --
- media %MediaDesc; #IMPLIED -- for rendering on these media --
- >
-
-<!--=================== Images ===========================================-->
-
-<!-- Length defined in strict DTD for cellpadding/cellspacing -->
-<!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
-<!ENTITY % MultiLength "CDATA" -- pixel, percentage, or relative -->
-
-<!ENTITY % MultiLengths "CDATA" -- comma-separated list of MultiLength -->
-
-<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
-
-
-<!-- To avoid problems with text-only UAs as well as
- to make image content understandable and navigable
- to users of non-visual UAs, you need to provide
- a description with ALT, and avoid server-side image maps -->
-<!ELEMENT IMG - O EMPTY -- Embedded image -->
-<!ATTLIST IMG
- %attrs; -- %coreattrs, %i18n, %events --
- src %URI; #REQUIRED -- URI of image to embed --
- alt %Text; #REQUIRED -- short description --
- longdesc %URI; #IMPLIED -- link to long description
- (complements alt) --
- height %Length; #IMPLIED -- override height --
- width %Length; #IMPLIED -- override width --
- usemap %URI; #IMPLIED -- use client-side image map --
- ismap (ismap) #IMPLIED -- use server-side image map --
- >
-
-<!-- USEMAP points to a MAP element which may be in this document
- or an external document, although the latter is not widely supported -->
-
-<!--==================== OBJECT ======================================-->
-<!--
- OBJECT is used to embed objects as part of HTML pages
- PARAM elements should precede other content. SGML mixed content
- model technicality precludes specifying this formally ...
--->
-
-<!ELEMENT OBJECT - - (PARAM | %flow;)*
- -- generic embedded object -->
-<!ATTLIST OBJECT
- %attrs; -- %coreattrs, %i18n, %events --
- declare (declare) #IMPLIED -- declare but don't instantiate flag --
- classid %URI; #IMPLIED -- identifies an implementation --
- codebase %URI; #IMPLIED -- base URI for classid, data, archive--
- data %URI; #IMPLIED -- reference to object's data --
- type %ContentType; #IMPLIED -- content type for data --
- codetype %ContentType; #IMPLIED -- content type for code --
- archive %URI; #IMPLIED -- space separated archive list --
- standby %Text; #IMPLIED -- message to show while loading --
- height %Length; #IMPLIED -- override height --
- width %Length; #IMPLIED -- override width --
- usemap %URI; #IMPLIED -- use client-side image map --
- name CDATA #IMPLIED -- submit as part of form --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT PARAM - O EMPTY -- named property value -->
-<!ATTLIST PARAM
- id ID #IMPLIED -- document-wide unique id --
- name CDATA #REQUIRED -- property name --
- value CDATA #IMPLIED -- property value --
- valuetype (DATA|REF|OBJECT) DATA -- How to interpret value --
- type %ContentType; #IMPLIED -- content type for value
- when valuetype=ref --
- >
-
-
-<!--=================== Horizontal Rule ==================================-->
-
-<!ELEMENT HR - O EMPTY -- horizontal rule -->
-<!ATTLIST HR
- %coreattrs; -- id, class, style, title --
- %events;
- >
-
-<!--=================== Paragraphs =======================================-->
-
-<!ELEMENT P - O (%inline;)* -- paragraph -->
-<!ATTLIST P
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--=================== Headings =========================================-->
-
-<!--
- There are six levels of headings from H1 (the most important)
- to H6 (the least important).
--->
-
-<!ELEMENT (%heading;) - - (%inline;)* -- heading -->
-<!ATTLIST (%heading;)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--=================== Preformatted Text ================================-->
-
-<!-- excludes markup for images and changes in font size -->
-<!ENTITY % pre.exclusion "IMG|OBJECT|BIG|SMALL|SUB|SUP">
-
-<!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
-<!ATTLIST PRE
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--===================== Inline Quotes ==================================-->
-
-<!ELEMENT Q - - (%inline;)* -- short inline quotation -->
-<!ATTLIST Q
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- URI for source document or msg --
- >
-
-<!--=================== Block-like Quotes ================================-->
-
-<!ELEMENT BLOCKQUOTE - - (%block;|SCRIPT)+ -- long quotation -->
-<!ATTLIST BLOCKQUOTE
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- URI for source document or msg --
- >
-
-<!--=================== Inserted/Deleted Text ============================-->
-
-
-<!-- INS/DEL are handled by inclusion on BODY -->
-<!ELEMENT (INS|DEL) - - (%flow;)* -- inserted text, deleted text -->
-<!ATTLIST (INS|DEL)
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- info on reason for change --
- datetime %Datetime; #IMPLIED -- date and time of change --
- >
-
-<!--=================== Lists ============================================-->
-
-<!-- definition lists - DT for term, DD for its definition -->
-
-<!ELEMENT DL - - (DT|DD)+ -- definition list -->
-<!ATTLIST DL
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT DT - O (%inline;)* -- definition term -->
-<!ELEMENT DD - O (%flow;)* -- definition description -->
-<!ATTLIST (DT|DD)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-
-<!ELEMENT OL - - (LI)+ -- ordered list -->
-<!ATTLIST OL
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!-- Unordered Lists (UL) bullet styles -->
-<!ELEMENT UL - - (LI)+ -- unordered list -->
-<!ATTLIST UL
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-
-
-<!ELEMENT LI - O (%flow;)* -- list item -->
-<!ATTLIST LI
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================ Forms ===============================================-->
-<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->
-<!ATTLIST FORM
- %attrs; -- %coreattrs, %i18n, %events --
- action %URI; #REQUIRED -- server-side form handler --
- method (GET|POST) GET -- HTTP method used to submit the form--
- enctype %ContentType; "application/x-www-form-urlencoded"
- onsubmit %Script; #IMPLIED -- the form was submitted --
- onreset %Script; #IMPLIED -- the form was reset --
- accept-charset %Charsets; #IMPLIED -- list of supported charsets --
- >
-
-<!-- Each label must not contain more than ONE field -->
-<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
-<!ATTLIST LABEL
- %attrs; -- %coreattrs, %i18n, %events --
- for IDREF #IMPLIED -- matches field ID value --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!ENTITY % InputType
- "(TEXT | PASSWORD | CHECKBOX |
- RADIO | SUBMIT | RESET |
- FILE | HIDDEN | IMAGE | BUTTON)"
- >
-
-<!-- attribute name required for all but submit & reset -->
-<!ELEMENT INPUT - O EMPTY -- form control -->
-<!ATTLIST INPUT
- %attrs; -- %coreattrs, %i18n, %events --
- type %InputType; TEXT -- what kind of widget is needed --
- name CDATA #IMPLIED -- submit as part of form --
- value CDATA #IMPLIED -- required for radio and checkboxes --
- checked (checked) #IMPLIED -- for radio buttons and check boxes --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- readonly (readonly) #IMPLIED -- for text and passwd --
- size CDATA #IMPLIED -- specific to each type of field --
- maxlength NUMBER #IMPLIED -- max chars for text fields --
- src %URI; #IMPLIED -- for fields with images --
- alt CDATA #IMPLIED -- short description --
- usemap %URI; #IMPLIED -- use client-side image map --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onselect %Script; #IMPLIED -- some text was selected --
- onchange %Script; #IMPLIED -- the element value was changed --
- accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
-<!ATTLIST SELECT
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED -- field name --
- size NUMBER #IMPLIED -- rows visible --
- multiple (multiple) #IMPLIED -- default is single selection --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onchange %Script; #IMPLIED -- the element value was changed --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT OPTGROUP - - (OPTION)+ -- option group -->
-<!ATTLIST OPTGROUP
- %attrs; -- %coreattrs, %i18n, %events --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- label %Text; #REQUIRED -- for use in hierarchical menus --
- >
-
-<!ELEMENT OPTION - O (#PCDATA) -- selectable choice -->
-<!ATTLIST OPTION
- %attrs; -- %coreattrs, %i18n, %events --
- selected (selected) #IMPLIED
- disabled (disabled) #IMPLIED -- unavailable in this context --
- label %Text; #IMPLIED -- for use in hierarchical menus --
- value CDATA #IMPLIED -- defaults to element content --
- >
-
-<!ELEMENT TEXTAREA - - (#PCDATA) -- multi-line text field -->
-<!ATTLIST TEXTAREA
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED
- rows NUMBER #REQUIRED
- cols NUMBER #REQUIRED
- disabled (disabled) #IMPLIED -- unavailable in this context --
- readonly (readonly) #IMPLIED
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onselect %Script; #IMPLIED -- some text was selected --
- onchange %Script; #IMPLIED -- the element value was changed --
- %reserved; -- reserved for possible future use --
- >
-
-<!--
- #PCDATA is to solve the mixed content problem,
- per specification only whitespace is allowed there!
- -->
-<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
-<!ATTLIST FIELDSET
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT LEGEND - - (%inline;)* -- fieldset legend -->
-<!ENTITY % LAlign "(top|bottom|left|right)">
-
-<!ATTLIST LEGEND
- %attrs; -- %coreattrs, %i18n, %events --
- accesskey %Character; #IMPLIED -- accessibility key character --
- >
-
-<!ELEMENT BUTTON - -
- (%flow;)* -(A|%formctrl;|FORM|FIELDSET)
- -- push button -->
-<!ATTLIST BUTTON
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED
- value CDATA #IMPLIED -- sent to server when submitted --
- type (button|submit|reset) submit -- for use as form button --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- %reserved; -- reserved for possible future use --
- >
-
-<!--======================= Tables =======================================-->
-
-<!-- IETF HTML table standard, see [RFC1942] -->
-
-<!--
- The BORDER attribute sets the thickness of the frame around the
- table. The default units are screen pixels.
-
- The FRAME attribute specifies which parts of the frame around
- the table should be rendered. The values are not the same as
- CALS to avoid a name clash with the VALIGN attribute.
-
- The value "border" is included for backwards compatibility with
- <TABLE BORDER> which yields frame=border and border=implied
- For <TABLE BORDER=1> you get border=1 and frame=implied. In this
- case, it is appropriate to treat this as frame=border for backwards
- compatibility with deployed browsers.
--->
-<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
-
-<!--
- The RULES attribute defines which rules to draw between cells:
-
- If RULES is absent then assume:
- "none" if BORDER is absent or BORDER=0 otherwise "all"
--->
-
-<!ENTITY % TRules "(none | groups | rows | cols | all)">
-
-<!-- horizontal placement of table relative to document -->
-<!ENTITY % TAlign "(left|center|right)">
-
-<!-- horizontal alignment attributes for cell contents -->
-<!ENTITY % cellhalign
- "align (left|center|right|justify|char) #IMPLIED
- char %Character; #IMPLIED -- alignment char, e.g. char=':' --
- charoff %Length; #IMPLIED -- offset for alignment char --"
- >
-
-<!-- vertical alignment attributes for cell contents -->
-<!ENTITY % cellvalign
- "valign (top|middle|bottom|baseline) #IMPLIED"
- >
-
-<!ELEMENT TABLE - -
- (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
-<!ELEMENT CAPTION - - (%inline;)* -- table caption -->
-<!ELEMENT THEAD - O (TR)+ -- table header -->
-<!ELEMENT TFOOT - O (TR)+ -- table footer -->
-<!ELEMENT TBODY O O (TR)+ -- table body -->
-<!ELEMENT COLGROUP - O (col)* -- table column group -->
-<!ELEMENT COL - O EMPTY -- table column -->
-<!ELEMENT TR - O (TH|TD)+ -- table row -->
-<!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell-->
-
-<!ATTLIST TABLE -- table element --
- %attrs; -- %coreattrs, %i18n, %events --
- summary %Text; #IMPLIED -- purpose/structure for speech output--
- width %Length; #IMPLIED -- table width --
- border %Pixels; #IMPLIED -- controls frame width around table --
- frame %TFrame; #IMPLIED -- which parts of frame to render --
- rules %TRules; #IMPLIED -- rulings between rows and cols --
- cellspacing %Length; #IMPLIED -- spacing between cells --
- cellpadding %Length; #IMPLIED -- spacing within cells --
- %reserved; -- reserved for possible future use --
- datapagesize CDATA #IMPLIED -- reserved for possible future use --
- >
-
-<!ENTITY % CAlign "(top|bottom|left|right)">
-
-<!ATTLIST CAPTION
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--
-COLGROUP groups a set of COL elements. It allows you to group
-several semantically related columns together.
--->
-<!ATTLIST COLGROUP
- %attrs; -- %coreattrs, %i18n, %events --
- span NUMBER 1 -- default number of columns in group --
- width %MultiLength; #IMPLIED -- default width for enclosed COLs --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!--
- COL elements define the alignment properties for cells in
- one or more columns.
-
- The WIDTH attribute specifies the width of the columns, e.g.
-
- width=64 width in screen pixels
- width=0.5* relative width of 0.5
-
- The SPAN attribute causes the attributes of one
- COL element to apply to more than one column.
--->
-<!ATTLIST COL -- column groups and properties --
- %attrs; -- %coreattrs, %i18n, %events --
- span NUMBER 1 -- COL attributes affect N columns --
- width %MultiLength; #IMPLIED -- column width specification --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!--
- Use THEAD to duplicate headers when breaking table
- across page boundaries, or for static headers when
- TBODY sections are rendered in scrolling panel.
-
- Use TFOOT to duplicate footers when breaking table
- across page boundaries, or for static footers when
- TBODY sections are rendered in scrolling panel.
-
- Use multiple TBODY sections when rules are needed
- between groups of table rows.
--->
-<!ATTLIST (THEAD|TBODY|TFOOT) -- table section --
- %attrs; -- %coreattrs, %i18n, %events --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!ATTLIST TR -- table row --
- %attrs; -- %coreattrs, %i18n, %events --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-
-<!-- Scope is simpler than axes attribute for common tables -->
-<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
-
-<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
-<!ATTLIST (TH|TD) -- header or data cell --
- %attrs; -- %coreattrs, %i18n, %events --
- abbr %Text; #IMPLIED -- abbreviation for header cell --
- axis CDATA #IMPLIED -- names groups of related headers--
- headers IDREFS #IMPLIED -- list of id's for header cells --
- scope %Scope; #IMPLIED -- scope covered by header cells --
- rowspan NUMBER 1 -- number of rows spanned by cell --
- colspan NUMBER 1 -- number of cols spanned by cell --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-
-<!--================ Document Head =======================================-->
-<!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
-<!ENTITY % head.content "TITLE & BASE?">
-
-<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
-<!ATTLIST HEAD
- %i18n; -- lang, dir --
- profile %URI; #IMPLIED -- named dictionary of meta info --
- >
-
-<!-- The TITLE element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
- -->
-<!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
-<!ATTLIST TITLE %i18n>
-
-
-<!ELEMENT BASE - O EMPTY -- document base URI -->
-<!ATTLIST BASE
- href %URI; #REQUIRED -- URI that acts as base URI --
- >
-
-<!ELEMENT META - O EMPTY -- generic metainformation -->
-<!ATTLIST META
- %i18n; -- lang, dir, for use with content --
- http-equiv NAME #IMPLIED -- HTTP response header name --
- name NAME #IMPLIED -- metainformation name --
- content CDATA #REQUIRED -- associated information --
- scheme CDATA #IMPLIED -- select form of content --
- >
-
-<!ELEMENT STYLE - - %StyleSheet -- style info -->
-<!ATTLIST STYLE
- %i18n; -- lang, dir, for use with title --
- type %ContentType; #REQUIRED -- content type of style language --
- media %MediaDesc; #IMPLIED -- designed for use with these media --
- title %Text; #IMPLIED -- advisory title --
- >
-
-<!ELEMENT SCRIPT - - %Script; -- script statements -->
-<!ATTLIST SCRIPT
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- type %ContentType; #REQUIRED -- content type of script language --
- language CDATA #IMPLIED -- predefined script language name --
- src %URI; #IMPLIED -- URI for an external script --
- defer (defer) #IMPLIED -- UA may defer execution of script --
- event CDATA #IMPLIED -- reserved for possible future use --
- for %URI; #IMPLIED -- reserved for possible future use --
- >
-
-<!ELEMENT NOSCRIPT - - (%block;)+
- -- alternate content container for non script-based rendering -->
-<!ATTLIST NOSCRIPT
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================ Document Structure ==================================-->
-<!ENTITY % html.content "HEAD, BODY">
-
-<!ELEMENT HTML O O (%html.content;) -- document root element -->
-<!ATTLIST HTML
- %i18n; -- lang, dir --
- >
diff --git a/tests/dtds/HTML4.dcl b/tests/dtds/HTML4.dcl
deleted file mode 100644
index db46db0f..00000000
--- a/tests/dtds/HTML4.dcl
+++ /dev/null
@@ -1,88 +0,0 @@
-<!SGML "ISO 8879:1986 (WWW)"
- --
- SGML Declaration for HyperText Markup Language version 4.0
-
- With support for the first 17 planes of ISO 10646 and
- increased limits for tag and literal lengths etc.
-
- Modified by jjc to work around SP's 16-bit character limit.
- Modified by jjc to support hex character references.
- --
-
- CHARSET
- BASESET "ISO Registration Number 177//CHARSET
- ISO/IEC 10646-1:1993 UCS-4 with
- implementation level 3//ESC 2/5 2/15 4/6"
- DESCSET 0 9 UNUSED
- 9 2 9
- 11 2 UNUSED
- 13 1 13
- 14 18 UNUSED
- 32 95 32
- 127 1 UNUSED
- 128 32 UNUSED
- -- jjc: changed the rest of the DESCSET.
- Note that surrogates are not declared UNUSED;
- this allows non-BMP characters to be parsed. --
- 160 65376 160
- -- 160 55136 160
- 55296 2048 UNUSED
- 57344 1056768 57344 --
-
-CAPACITY SGMLREF
- TOTALCAP 150000
- GRPCAP 150000
- ENTCAP 150000
-
-SCOPE DOCUMENT
-SYNTAX
- SHUNCHAR CONTROLS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
- 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 127
- BASESET "ISO 646IRV:1991//CHARSET
- International Reference Version
- (IRV)//ESC 2/8 4/2"
- DESCSET 0 128 0
-
- FUNCTION
- RE 13
- RS 10
- SPACE 32
- TAB SEPCHAR 9
-
- NAMING LCNMSTRT ""
- UCNMSTRT ""
- LCNMCHAR ".-_:"
- UCNMCHAR ".-_:"
- NAMECASE GENERAL YES
- ENTITY NO
- DELIM GENERAL SGMLREF
- HCRO "&#38;#X" -- added by jjc --
- SHORTREF SGMLREF
- NAMES SGMLREF
- QUANTITY SGMLREF
- ATTCNT 60 -- increased --
- ATTSPLEN 65536 -- These are the largest values --
- LITLEN 65536 -- permitted in the declaration --
- NAMELEN 65536 -- Avoid fixed limits in actual --
- PILEN 65536 -- implementations of HTML UA's --
- TAGLVL 100
- TAGLEN 65536
- GRPGTCNT 150
- GRPCNT 64
-
-FEATURES
- MINIMIZE
- DATATAG NO
- OMITTAG YES
- RANK NO
- SHORTTAG YES
- LINK
- SIMPLE NO
- IMPLICIT NO
- EXPLICIT NO
- OTHER
- CONCUR NO
- SUBDOC NO
- FORMAL YES
- APPINFO NONE
-> \ No newline at end of file
diff --git a/tests/dtds/HTML4.dtd b/tests/dtds/HTML4.dtd
deleted file mode 100644
index 9e781db1..00000000
--- a/tests/dtds/HTML4.dtd
+++ /dev/null
@@ -1,1092 +0,0 @@
-<!--
- This is the HTML 4.0 Transitional DTD, which includes
- presentation attributes and elements that W3C expects to phase out
- as support for style sheets matures. Authors should use the Strict
- DTD when possible, but may use the Transitional DTD when support
- for presentation attribute and elements is required.
-
- HTML 4.0 includes mechanisms for style sheets, scripting,
- embedding objects, improved support for right to left and mixed
- direction text, and enhancements to forms for improved
- accessibility for people with disabilities.
-
- Draft: $Date: 1999/05/02 15:37:15 $
-
- Authors:
- Dave Raggett <dsr@w3.org>
- Arnaud Le Hors <lehors@w3.org>
- Ian Jacobs <ij@w3.org>
-
- Further information about HTML 4.0 is available at:
-
- http://www.w3.org/TR/REC-html40
--->
-<!ENTITY % HTML.Version "-//W3C//DTD HTML 4.0 Transitional//EN"
- -- Typical usage:
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
- "http://www.w3.org/TR/REC-html40/loose.dtd">
- <html>
- <head>
- ...
- </head>
- <body>
- ...
- </body>
- </html>
-
- The URI used as a system identifier with the public identifier allows
- the user agent to download the DTD and entity sets as needed.
-
- The FPI for the Strict HTML 4.0 DTD is:
-
- "-//W3C//DTD HTML 4.0//EN"
-
- and its URI is:
-
- http://www.w3.org/TR/REC-html40/strict.dtd
-
- Authors should use the Strict DTD unless they need the
- presentation control for user agents that don't (adequately)
- support style sheets.
-
- If you are writing a document that includes frames, use
- the following FPI:
-
- "-//W3C//DTD HTML 4.0 Frameset//EN"
-
- with the URI:
-
- http://www.w3.org/TR/REC-html40/frameset.dtd
-
- The following URIs are supported in relation to HTML 4.0
-
- "http://www.w3.org/TR/REC-html40/strict.dtd" (Strict DTD)
- "http://www.w3.org/TR/REC-html40/loose.dtd" (Loose DTD)
- "http://www.w3.org/TR/REC-html40/frameset.dtd" (Frameset DTD)
- "http://www.w3.org/TR/REC-html40/HTMLlat1.ent" (Latin-1 entities)
- "http://www.w3.org/TR/REC-html40/HTMLsymbol.ent" (Symbol entities)
- "http://www.w3.org/TR/REC-html40/HTMLspecial.ent" (Special entities)
-
- These URIs point to the latest version of each file. To reference
- this specific revision use the following URIs:
-
- "http://www.w3.org/TR/REC-html40-971218/strict.dtd"
- "http://www.w3.org/TR/REC-html40-971218/loose.dtd"
- "http://www.w3.org/TR/REC-html40-971218/frameset.dtd"
- "http://www.w3.org/TR/REC-html40-971218/HTMLlat1.ent"
- "http://www.w3.org/TR/REC-html40-971218/HTMLsymbol.ent"
- "http://www.w3.org/TR/REC-html40-971218/HTMLspecial.ent"
-
--->
-
-<!--================== Imported Names ====================================-->
-
-<!ENTITY % ContentType "CDATA"
- -- media type, as per [RFC2045]
- -->
-
-<!ENTITY % ContentTypes "CDATA"
- -- comma-separated list of media types, as per [RFC2045]
- -->
-
-<!ENTITY % Charset "CDATA"
- -- a character encoding, as per [RFC2045]
- -->
-
-<!ENTITY % Charsets "CDATA"
- -- a space separated list of character encodings, as per [RFC2045]
- -->
-
-<!ENTITY % LanguageCode "NAME"
- -- a language code, as per [RFC1766]
- -->
-
-<!ENTITY % Character "CDATA"
- -- a single character from [ISO10646]
- -->
-
-<!ENTITY % LinkTypes "CDATA"
- -- space-separated list of link types
- -->
-
-<!ENTITY % MediaDesc "CDATA"
- -- single or comma-separated list of media descriptors
- -->
-
-<!ENTITY % URI "CDATA"
- -- a Uniform Resource Identifier,
- see [URI]
- -->
-
-<!ENTITY % Datetime "CDATA" -- date and time information. ISO date format -->
-
-
-<!ENTITY % Script "CDATA" -- script expression -->
-
-<!ENTITY % StyleSheet "CDATA" -- style sheet data -->
-
-<!ENTITY % FrameTarget "CDATA" -- render in this frame -->
-
-
-<!ENTITY % Text "CDATA">
-
-
-<!-- Parameter Entities -->
-
-<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
-
-<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
-
-<!ENTITY % list "UL | OL | DIR | MENU">
-
-<!ENTITY % preformatted "PRE">
-
-<!ENTITY % Color "CDATA" -- a color using sRGB: #RRGGBB as Hex values -->
-
-<!-- There are also 16 widely known color names with their sRGB values:
-
- Black = #000000 Green = #008000
- Silver = #C0C0C0 Lime = #00FF00
- Gray = #808080 Olive = #808000
- White = #FFFFFF Yellow = #FFFF00
- Maroon = #800000 Navy = #000080
- Red = #FF0000 Blue = #0000FF
- Purple = #800080 Teal = #008080
- Fuchsia= #FF00FF Aqua = #00FFFF
- -->
-
-<!ENTITY % bodycolors "
- bgcolor %Color; #IMPLIED -- document background color --
- text %Color; #IMPLIED -- document text color --
- link %Color; #IMPLIED -- color of links --
- vlink %Color; #IMPLIED -- color of visited links --
- alink %Color; #IMPLIED -- color of selected links --
- ">
-
-<!--================ Character mnemonic entities =========================-->
-
-<!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin1//EN//HTML"
- "http://www.w3.org/TR/REC-html40-971218/HTMLlat1.ent">
-%HTMLlat1;
-
-<!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols//EN//HTML"
- "http://www.w3.org/TR/REC-html40-971218/HTMLsymbol.ent">
-%HTMLsymbol;
-
-<!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special//EN//HTML"
- "http://www.w3.org/TR/REC-html40-971218/HTMLspecial.ent">
-%HTMLspecial;
-<!--=================== Generic Attributes ===============================-->
-
-<!ENTITY % coreattrs
- "id ID #IMPLIED -- document-wide unique id --
- class CDATA #IMPLIED -- space separated list of classes --
- style %StyleSheet; #IMPLIED -- associated style info --
- title %Text; #IMPLIED -- advisory title/amplification --"
- >
-
-<!ENTITY % i18n
- "lang %LanguageCode; #IMPLIED -- language code --
- dir (ltr|rtl) #IMPLIED -- direction for weak/neutral text --"
- >
-
-<!ENTITY % events
- "onclick %Script; #IMPLIED -- a pointer button was clicked --
- ondblclick %Script; #IMPLIED -- a pointer button was double clicked--
- onmousedown %Script; #IMPLIED -- a pointer button was pressed down --
- onmouseup %Script; #IMPLIED -- a pointer button was released --
- onmouseover %Script; #IMPLIED -- a pointer was moved onto --
- onmousemove %Script; #IMPLIED -- a pointer was moved within --
- onmouseout %Script; #IMPLIED -- a pointer was moved away --
- onkeypress %Script; #IMPLIED -- a key was pressed and released --
- onkeydown %Script; #IMPLIED -- a key was pressed down --
- onkeyup %Script; #IMPLIED -- a key was released --"
- >
-
-<!-- Reserved Feature Switch -->
-<!ENTITY % HTML.Reserved "IGNORE">
-
-<!-- The following attributes are reserved for possible future use -->
-<![ %HTML.Reserved; [
-<!ENTITY % reserved
- "datasrc %URI; #IMPLIED -- a single or tabular Data Source --
- datafld CDATA #IMPLIED -- the property or column name --
- dataformatas (plaintext|html) plaintext -- text or html --"
- >
-]]>
-
-<!ENTITY % reserved "">
-
-<!ENTITY % attrs "%coreattrs; %i18n; %events;">
-
-<!ENTITY % align "align (left|center|right|justify) #IMPLIED"
- -- default is left for ltr paragraphs, right for rtl --
- >
-
-<!--=================== Text Markup ======================================-->
-
-<!ENTITY % fontstyle
- "TT | I | B | U | S | STRIKE | BIG | SMALL">
-
-<!ENTITY % phrase "EM | STRONG | DFN | CODE |
- SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
-
-<!ENTITY % special
- "A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
- MAP | Q | SUB | SUP | SPAN | BDO | IFRAME">
-
-<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
-
-<!-- %inline; covers inline or "text-level" elements -->
-<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
-
-<!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
-<!ATTLIST (%fontstyle;|%phrase;)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT (SUB|SUP) - - (%inline;)* -- subscript, superscript -->
-<!ATTLIST (SUB|SUP)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT SPAN - - (%inline;)* -- generic language/style container -->
-<!ATTLIST SPAN
- %attrs; -- %coreattrs, %i18n, %events --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT BDO - - (%inline;)* -- I18N BiDi over-ride -->
-<!ATTLIST BDO
- %coreattrs; -- id, class, style, title --
- lang %LanguageCode; #IMPLIED -- language code --
- dir (ltr|rtl) #REQUIRED -- directionality --
- >
-
-<!ELEMENT BASEFONT - O EMPTY -- base font size -->
-<!ATTLIST BASEFONT
- id ID #IMPLIED -- document-wide unique id --
- size CDATA #REQUIRED -- base font size for FONT elements --
- color %Color; #IMPLIED -- text color --
- face CDATA #IMPLIED -- comma separated list of font names --
- >
-
-<!ELEMENT FONT - - (%inline;)* -- local change to font -->
-<!ATTLIST FONT
- %coreattrs; -- id, class, style, title --
- %i18n; -- lang, dir --
- size CDATA #IMPLIED -- [+|-]nn e.g. size="+1", size="4" --
- color %Color; #IMPLIED -- text color --
- face CDATA #IMPLIED -- comma separated list of font names --
- >
-
-<!ELEMENT BR - O EMPTY -- forced line break -->
-<!ATTLIST BR
- %coreattrs; -- id, class, style, title --
- clear (left|all|right|none) none -- control of text flow --
- >
-
-<!--================== HTML content models ===============================-->
-
-<!--
- HTML has two basic content models:
-
- %inline; character level elements and text strings
- %block; block-like elements e.g. paragraphs and lists
--->
-
-<!ENTITY % block
- "P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- TABLE | FIELDSET | ADDRESS">
-
-<!ENTITY % flow "%block; | %inline;">
-
-<!--=================== Document Body ====================================-->
-
-<!ELEMENT BODY O O (%flow;)* +(INS|DEL) -- document body -->
-<!ATTLIST BODY
- %attrs; -- %coreattrs, %i18n, %events --
- onload %Script; #IMPLIED -- the document has been loaded --
- onunload %Script; #IMPLIED -- the document has been removed --
- background %URI; #IMPLIED -- texture tile for document
- background --
- %bodycolors; -- bgcolor, text, link, vlink, alink --
- >
-
-<!ELEMENT ADDRESS - - ((%inline;)|P)* -- information on author -->
-<!ATTLIST ADDRESS
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT DIV - - (%flow;)* -- generic language/style container -->
-<!ATTLIST DIV
- %attrs; -- %coreattrs, %i18n, %events --
- %align; -- align, text alignment --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT CENTER - - (%flow;)* -- shorthand for DIV align=center -->
-<!ATTLIST CENTER
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================== The Anchor Element ================================-->
-
-<!ENTITY % Shape "(rect|circle|poly|default)">
-<!ENTITY % Coords "CDATA" -- comma separated list of lengths -->
-
-<!ELEMENT A - - (%inline;)* -(A) -- anchor -->
-<!ATTLIST A
- %attrs; -- %coreattrs, %i18n, %events --
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- type %ContentType; #IMPLIED -- advisory content type --
- name CDATA #IMPLIED -- named link end --
- href %URI; #IMPLIED -- URI for linked resource --
- hreflang %LanguageCode; #IMPLIED -- language code --
- target %FrameTarget; #IMPLIED -- render in this frame --
- rel %LinkTypes; #IMPLIED -- forward link types --
- rev %LinkTypes; #IMPLIED -- reverse link types --
- accesskey %Character; #IMPLIED -- accessibility key character --
- shape %Shape; rect -- for use with client-side image maps --
- coords %Coords; #IMPLIED -- for use with client-side image maps --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!--================== Client-side image maps ============================-->
-
-<!-- These can be placed in the same document or grouped in a
- separate document although this isn't yet widely supported -->
-
-<!ELEMENT MAP - - ((%block;)+ | AREA+) -- client-side image map -->
-<!ATTLIST MAP
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #REQUIRED -- for reference by usemap --
- >
-
-<!ELEMENT AREA - O EMPTY -- client-side image map area -->
-<!ATTLIST AREA
- %attrs; -- %coreattrs, %i18n, %events --
- shape %Shape; rect -- controls interpretation of coords --
- coords %Coords; #IMPLIED -- comma separated list of lengths --
- href %URI; #IMPLIED -- URI for linked resource --
- target %FrameTarget; #IMPLIED -- render in this frame --
- nohref (nohref) #IMPLIED -- this region has no action --
- alt %Text; #REQUIRED -- short description --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!--================== The LINK Element ==================================-->
-
-<!--
- Relationship values can be used in principle:
-
- a) for document specific toolbars/menus when used
- with the LINK element in document head e.g.
- start, contents, previous, next, index, end, help
- b) to link to a separate style sheet (rel=stylesheet)
- c) to make a link to a script (rel=script)
- d) by stylesheets to control how collections of
- html nodes are rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a postscript or pdf version (rel=alternate media=print)
--->
-
-<!ELEMENT LINK - O EMPTY -- a media-independent link -->
-<!ATTLIST LINK
- %attrs; -- %coreattrs, %i18n, %events --
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- href %URI; #IMPLIED -- URI for linked resource --
- hreflang %LanguageCode; #IMPLIED -- language code --
- type %ContentType; #IMPLIED -- advisory content type --
- rel %LinkTypes; #IMPLIED -- forward link types --
- rev %LinkTypes; #IMPLIED -- reverse link types --
- media %MediaDesc; #IMPLIED -- for rendering on these media --
- target %FrameTarget; #IMPLIED -- render in this frame --
- >
-
-<!--=================== Images ===========================================-->
-
-<!-- Length defined in strict DTD for cellpadding/cellspacing -->
-<!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
-<!ENTITY % MultiLength "CDATA" -- pixel, percentage, or relative -->
-
-<!ENTITY % MultiLengths "CDATA" -- comma-separated list of MultiLength -->
-
-<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
-
-<!ENTITY % IAlign "(top|middle|bottom|left|right)" -- center? -->
-
-<!-- To avoid problems with text-only UAs as well as
- to make image content understandable and navigable
- to users of non-visual UAs, you need to provide
- a description with ALT, and avoid server-side image maps -->
-<!ELEMENT IMG - O EMPTY -- Embedded image -->
-<!ATTLIST IMG
- %attrs; -- %coreattrs, %i18n, %events --
- src %URI; #REQUIRED -- URI of image to embed --
- alt %Text; #REQUIRED -- short description --
- longdesc %URI; #IMPLIED -- link to long description
- (complements alt) --
- height %Length; #IMPLIED -- override height --
- width %Length; #IMPLIED -- override width --
- usemap %URI; #IMPLIED -- use client-side image map --
- ismap (ismap) #IMPLIED -- use server-side image map --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- border %Length; #IMPLIED -- link border width --
- hspace %Pixels; #IMPLIED -- horizontal gutter --
- vspace %Pixels; #IMPLIED -- vertical gutter --
- >
-
-<!-- USEMAP points to a MAP element which may be in this document
- or an external document, although the latter is not widely supported -->
-
-<!--==================== OBJECT ======================================-->
-<!--
- OBJECT is used to embed objects as part of HTML pages
- PARAM elements should precede other content. SGML mixed content
- model technicality precludes specifying this formally ...
--->
-
-<!ELEMENT OBJECT - - (PARAM | %flow;)*
- -- generic embedded object -->
-<!ATTLIST OBJECT
- %attrs; -- %coreattrs, %i18n, %events --
- declare (declare) #IMPLIED -- declare but don't instantiate flag --
- classid %URI; #IMPLIED -- identifies an implementation --
- codebase %URI; #IMPLIED -- base URI for classid, data, archive--
- data %URI; #IMPLIED -- reference to object's data --
- type %ContentType; #IMPLIED -- content type for data --
- codetype %ContentType; #IMPLIED -- content type for code --
- archive %URI; #IMPLIED -- space separated archive list --
- standby %Text; #IMPLIED -- message to show while loading --
- height %Length; #IMPLIED -- override height --
- width %Length; #IMPLIED -- override width --
- usemap %URI; #IMPLIED -- use client-side image map --
- name CDATA #IMPLIED -- submit as part of form --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- border %Length; #IMPLIED -- link border width --
- hspace %Pixels; #IMPLIED -- horizontal gutter --
- vspace %Pixels; #IMPLIED -- vertical gutter --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT PARAM - O EMPTY -- named property value -->
-<!ATTLIST PARAM
- id ID #IMPLIED -- document-wide unique id --
- name CDATA #REQUIRED -- property name --
- value CDATA #IMPLIED -- property value --
- valuetype (DATA|REF|OBJECT) DATA -- How to interpret value --
- type %ContentType; #IMPLIED -- content type for value
- when valuetype=ref --
- >
-
-<!--=================== Java APPLET ==================================-->
-<!--
- One of code or object attributes must be present.
- Place PARAM elements before other content.
--->
-<!ELEMENT APPLET - - (PARAM | %flow;)* -- Java applet -->
-<!ATTLIST APPLET
- %coreattrs; -- id, class, style, title --
- codebase %URI; #IMPLIED -- optional base URI for applet --
- archive CDATA #IMPLIED -- comma separated archive list --
- code CDATA #IMPLIED -- applet class file --
- object CDATA #IMPLIED -- serialized applet file --
- alt %Text; #IMPLIED -- short description --
- name CDATA #IMPLIED -- allows applets to find each other --
- width %Length; #REQUIRED -- initial width --
- height %Length; #REQUIRED -- initial height --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- hspace %Pixels; #IMPLIED -- horizontal gutter --
- vspace %Pixels; #IMPLIED -- vertical gutter --
- >
-
-<!--=================== Horizontal Rule ==================================-->
-
-<!ELEMENT HR - O EMPTY -- horizontal rule -->
-<!ATTLIST HR
- %coreattrs; -- id, class, style, title --
- %events;
- align (left|center|right) #IMPLIED
- noshade (noshade) #IMPLIED
- size %Pixels; #IMPLIED
- width %Length; #IMPLIED
- >
-
-<!--=================== Paragraphs =======================================-->
-
-<!ELEMENT P - O (%inline;)* -- paragraph -->
-<!ATTLIST P
- %attrs; -- %coreattrs, %i18n, %events --
- %align; -- align, text alignment --
- >
-
-<!--=================== Headings =========================================-->
-
-<!--
- There are six levels of headings from H1 (the most important)
- to H6 (the least important).
--->
-
-<!ELEMENT (%heading;) - - (%inline;)* -- heading -->
-<!ATTLIST (%heading;)
- %attrs; -- %coreattrs, %i18n, %events --
- %align; -- align, text alignment --
- >
-
-<!--=================== Preformatted Text ================================-->
-
-<!-- excludes markup for images and changes in font size -->
-<!ENTITY % pre.exclusion "IMG|OBJECT|APPLET|BIG|SMALL|SUB|SUP|FONT|BASEFONT">
-
-<!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
-<!ATTLIST PRE
- %attrs; -- %coreattrs, %i18n, %events --
- width NUMBER #IMPLIED
- >
-
-<!--===================== Inline Quotes ==================================-->
-
-<!ELEMENT Q - - (%inline;)* -- short inline quotation -->
-<!ATTLIST Q
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- URI for source document or msg --
- >
-
-<!--=================== Block-like Quotes ================================-->
-
-<!ELEMENT BLOCKQUOTE - - (%flow;)* -- long quotation -->
-<!ATTLIST BLOCKQUOTE
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- URI for source document or msg --
- >
-
-<!--=================== Inserted/Deleted Text ============================-->
-
-
-<!-- INS/DEL are handled by inclusion on BODY -->
-<!ELEMENT (INS|DEL) - - (%flow;)* -- inserted text, deleted text -->
-<!ATTLIST (INS|DEL)
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- info on reason for change --
- datetime %Datetime; #IMPLIED -- date and time of change --
- >
-
-<!--=================== Lists ============================================-->
-
-<!-- definition lists - DT for term, DD for its definition -->
-
-<!ELEMENT DL - - (DT|DD)+ -- definition list -->
-<!ATTLIST DL
- %attrs; -- %coreattrs, %i18n, %events --
- compact (compact) #IMPLIED -- reduced interitem spacing --
- >
-
-<!ELEMENT DT - O (%inline;)* -- definition term -->
-<!ELEMENT DD - O (%flow;)* -- definition description -->
-<!ATTLIST (DT|DD)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!-- Ordered lists (OL) Numbering style
-
- 1 arablic numbers 1, 2, 3, ...
- a lower alpha a, b, c, ...
- A upper alpha A, B, C, ...
- i lower roman i, ii, iii, ...
- I upper roman I, II, III, ...
-
- The style is applied to the sequence number which by default
- is reset to 1 for the first list item in an ordered list.
-
- This can't be expressed directly in SGML due to case folding.
--->
-
-<!ENTITY % OLStyle "CDATA" -- constrained to: "(1|a|A|i|I)" -->
-
-<!ELEMENT OL - - (LI)+ -- ordered list -->
-<!ATTLIST OL
- %attrs; -- %coreattrs, %i18n, %events --
- type %OLStyle; #IMPLIED -- numbering style --
- compact (compact) #IMPLIED -- reduced interitem spacing --
- start NUMBER #IMPLIED -- starting sequence number --
- >
-
-<!-- Unordered Lists (UL) bullet styles -->
-<!ENTITY % ULStyle "(disc|square|circle)">
-
-<!ELEMENT UL - - (LI)+ -- unordered list -->
-<!ATTLIST UL
- %attrs; -- %coreattrs, %i18n, %events --
- type %ULStyle; #IMPLIED -- bullet style --
- compact (compact) #IMPLIED -- reduced interitem spacing --
- >
-
-<!ELEMENT (DIR|MENU) - - (LI)+ -(%block;) -- directory list, menu list -->
-<!ATTLIST DIR
- %attrs; -- %coreattrs, %i18n, %events --
- compact (compact) #IMPLIED
- >
-<!ATTLIST MENU
- %attrs; -- %coreattrs, %i18n, %events --
- compact (compact) #IMPLIED
- >
-
-<!ENTITY % LIStyle "CDATA" -- constrained to: "(%ULStyle;|%OLStyle;)" -->
-
-<!ELEMENT LI - O (%flow;)* -- list item -->
-<!ATTLIST LI
- %attrs; -- %coreattrs, %i18n, %events --
- type %LIStyle; #IMPLIED -- list item style --
- value NUMBER #IMPLIED -- reset sequence number --
- >
-
-<!--================ Forms ===============================================-->
-<!ELEMENT FORM - - (%flow;)* -(FORM) -- interactive form -->
-<!ATTLIST FORM
- %attrs; -- %coreattrs, %i18n, %events --
- action %URI; #REQUIRED -- server-side form handler --
- method (GET|POST) GET -- HTTP method used to submit the form--
- enctype %ContentType; "application/x-www-form-urlencoded"
- onsubmit %Script; #IMPLIED -- the form was submitted --
- onreset %Script; #IMPLIED -- the form was reset --
- target %FrameTarget; #IMPLIED -- render in this frame --
- accept-charset %Charsets; #IMPLIED -- list of supported charsets --
- >
-
-<!-- Each label must not contain more than ONE field -->
-<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
-<!ATTLIST LABEL
- %attrs; -- %coreattrs, %i18n, %events --
- for IDREF #IMPLIED -- matches field ID value --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!ENTITY % InputType
- "(TEXT | PASSWORD | CHECKBOX |
- RADIO | SUBMIT | RESET |
- FILE | HIDDEN | IMAGE | BUTTON)"
- >
-
-<!-- attribute name required for all but submit & reset -->
-<!ELEMENT INPUT - O EMPTY -- form control -->
-<!ATTLIST INPUT
- %attrs; -- %coreattrs, %i18n, %events --
- type %InputType; TEXT -- what kind of widget is needed --
- name CDATA #IMPLIED -- submit as part of form --
- value CDATA #IMPLIED -- required for radio and checkboxes --
- checked (checked) #IMPLIED -- for radio buttons and check boxes --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- readonly (readonly) #IMPLIED -- for text and passwd --
- size CDATA #IMPLIED -- specific to each type of field --
- maxlength NUMBER #IMPLIED -- max chars for text fields --
- src %URI; #IMPLIED -- for fields with images --
- alt CDATA #IMPLIED -- short description --
- usemap %URI; #IMPLIED -- use client-side image map --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onselect %Script; #IMPLIED -- some text was selected --
- onchange %Script; #IMPLIED -- the element value was changed --
- accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
-<!ATTLIST SELECT
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED -- field name --
- size NUMBER #IMPLIED -- rows visible --
- multiple (multiple) #IMPLIED -- default is single selection --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onchange %Script; #IMPLIED -- the element value was changed --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT OPTGROUP - - (OPTION)+ -- option group -->
-<!ATTLIST OPTGROUP
- %attrs; -- %coreattrs, %i18n, %events --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- label %Text; #REQUIRED -- for use in hierarchical menus --
- >
-
-<!ELEMENT OPTION - O (#PCDATA) -- selectable choice -->
-<!ATTLIST OPTION
- %attrs; -- %coreattrs, %i18n, %events --
- selected (selected) #IMPLIED
- disabled (disabled) #IMPLIED -- unavailable in this context --
- label %Text; #IMPLIED -- for use in hierarchical menus --
- value CDATA #IMPLIED -- defaults to element content --
- >
-
-<!ELEMENT TEXTAREA - - (#PCDATA) -- multi-line text field -->
-<!ATTLIST TEXTAREA
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED
- rows NUMBER #REQUIRED
- cols NUMBER #REQUIRED
- disabled (disabled) #IMPLIED -- unavailable in this context --
- readonly (readonly) #IMPLIED
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onselect %Script; #IMPLIED -- some text was selected --
- onchange %Script; #IMPLIED -- the element value was changed --
- %reserved; -- reserved for possible future use --
- >
-
-<!--
- #PCDATA is to solve the mixed content problem,
- per specification only whitespace is allowed there!
- -->
-<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
-<!ATTLIST FIELDSET
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT LEGEND - - (%inline;)* -- fieldset legend -->
-<!ENTITY % LAlign "(top|bottom|left|right)">
-
-<!ATTLIST LEGEND
- %attrs; -- %coreattrs, %i18n, %events --
- accesskey %Character; #IMPLIED -- accessibility key character --
- align %LAlign; #IMPLIED -- relative to fieldset --
- >
-
-<!ELEMENT BUTTON - -
- (%flow;)* -(A|%formctrl;|FORM|ISINDEX|FIELDSET|IFRAME)
- -- push button -->
-<!ATTLIST BUTTON
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED
- value CDATA #IMPLIED -- sent to server when submitted --
- type (button|submit|reset) submit -- for use as form button --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- %reserved; -- reserved for possible future use --
- >
-
-<!--======================= Tables =======================================-->
-
-<!-- IETF HTML table standard, see [RFC1942] -->
-
-<!--
- The BORDER attribute sets the thickness of the frame around the
- table. The default units are screen pixels.
-
- The FRAME attribute specifies which parts of the frame around
- the table should be rendered. The values are not the same as
- CALS to avoid a name clash with the VALIGN attribute.
-
- The value "border" is included for backwards compatibility with
- <TABLE BORDER> which yields frame=border and border=implied
- For <TABLE BORDER=1> you get border=1 and frame=implied. In this
- case, it is appropriate to treat this as frame=border for backwards
- compatibility with deployed browsers.
--->
-<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
-
-<!--
- The RULES attribute defines which rules to draw between cells:
-
- If RULES is absent then assume:
- "none" if BORDER is absent or BORDER=0 otherwise "all"
--->
-
-<!ENTITY % TRules "(none | groups | rows | cols | all)">
-
-<!-- horizontal placement of table relative to document -->
-<!ENTITY % TAlign "(left|center|right)">
-
-<!-- horizontal alignment attributes for cell contents -->
-<!ENTITY % cellhalign
- "align (left|center|right|justify|char) #IMPLIED
- char %Character; #IMPLIED -- alignment char, e.g. char=':' --
- charoff %Length; #IMPLIED -- offset for alignment char --"
- >
-
-<!-- vertical alignment attributes for cell contents -->
-<!ENTITY % cellvalign
- "valign (top|middle|bottom|baseline) #IMPLIED"
- >
-
-<!ELEMENT TABLE - -
- (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
-<!ELEMENT CAPTION - - (%inline;)* -- table caption -->
-<!ELEMENT THEAD - O (TR)+ -- table header -->
-<!ELEMENT TFOOT - O (TR)+ -- table footer -->
-<!ELEMENT TBODY O O (TR)+ -- table body -->
-<!ELEMENT COLGROUP - O (col)* -- table column group -->
-<!ELEMENT COL - O EMPTY -- table column -->
-<!ELEMENT TR - O (TH|TD)+ -- table row -->
-<!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell-->
-
-<!ATTLIST TABLE -- table element --
- %attrs; -- %coreattrs, %i18n, %events --
- summary %Text; #IMPLIED -- purpose/structure for speech output--
- width %Length; #IMPLIED -- table width --
- border %Pixels; #IMPLIED -- controls frame width around table --
- frame %TFrame; #IMPLIED -- which parts of frame to render --
- rules %TRules; #IMPLIED -- rulings between rows and cols --
- cellspacing %Length; #IMPLIED -- spacing between cells --
- cellpadding %Length; #IMPLIED -- spacing within cells --
- align %TAlign; #IMPLIED -- table position relative to window --
- bgcolor %Color; #IMPLIED -- background color for cells --
- %reserved; -- reserved for possible future use --
- datapagesize CDATA #IMPLIED -- reserved for possible future use --
- >
-
-<!ENTITY % CAlign "(top|bottom|left|right)">
-
-<!ATTLIST CAPTION
- %attrs; -- %coreattrs, %i18n, %events --
- align %CAlign; #IMPLIED -- relative to table --
- >
-
-<!--
-COLGROUP groups a set of COL elements. It allows you to group
-several semantically related columns together.
--->
-<!ATTLIST COLGROUP
- %attrs; -- %coreattrs, %i18n, %events --
- span NUMBER 1 -- default number of columns in group --
- width %MultiLength; #IMPLIED -- default width for enclosed COLs --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!--
- COL elements define the alignment properties for cells in
- one or more columns.
-
- The WIDTH attribute specifies the width of the columns, e.g.
-
- width=64 width in screen pixels
- width=0.5* relative width of 0.5
-
- The SPAN attribute causes the attributes of one
- COL element to apply to more than one column.
--->
-<!ATTLIST COL -- column groups and properties --
- %attrs; -- %coreattrs, %i18n, %events --
- span NUMBER 1 -- COL attributes affect N columns --
- width %MultiLength; #IMPLIED -- column width specification --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!--
- Use THEAD to duplicate headers when breaking table
- across page boundaries, or for static headers when
- TBODY sections are rendered in scrolling panel.
-
- Use TFOOT to duplicate footers when breaking table
- across page boundaries, or for static footers when
- TBODY sections are rendered in scrolling panel.
-
- Use multiple TBODY sections when rules are needed
- between groups of table rows.
--->
-<!ATTLIST (THEAD|TBODY|TFOOT) -- table section --
- %attrs; -- %coreattrs, %i18n, %events --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!ATTLIST TR -- table row --
- %attrs; -- %coreattrs, %i18n, %events --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- bgcolor %Color; #IMPLIED -- background color for row --
- >
-
-
-<!-- Scope is simpler than axes attribute for common tables -->
-<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
-
-<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
-<!ATTLIST (TH|TD) -- header or data cell --
- %attrs; -- %coreattrs, %i18n, %events --
- abbr %Text; #IMPLIED -- abbreviation for header cell --
- axis CDATA #IMPLIED -- names groups of related headers--
- headers IDREFS #IMPLIED -- list of id's for header cells --
- scope %Scope; #IMPLIED -- scope covered by header cells --
- rowspan NUMBER 1 -- number of rows spanned by cell --
- colspan NUMBER 1 -- number of cols spanned by cell --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- nowrap (nowrap) #IMPLIED -- suppress word wrap --
- bgcolor %Color; #IMPLIED -- cell background color --
- width %Pixels; #IMPLIED -- width for cell --
- height %Pixels; #IMPLIED -- height for cell --
- >
-
-<!--================== Document Frames ===================================-->
-
-<!--
- The content model for HTML documents depends on whether the HEAD is
- followed by a FRAMESET or BODY element. The widespread omission of
- the BODY start tag makes it impractical to define the content model
- without the use of a marked section.
--->
-
-<!-- Feature Switch for frameset documents -->
-<!ENTITY % HTML.Frameset "IGNORE">
-
-<![ %HTML.Frameset; [
-<!ELEMENT FRAMESET - - ((FRAMESET|FRAME)+ & NOFRAMES?) -- window subdivision-->
-<!ATTLIST FRAMESET
- %coreattrs; -- id, class, style, title --
- rows %MultiLengths; #IMPLIED -- list of lengths,
- default: 100% (1 row) --
- cols %MultiLengths; #IMPLIED -- list of lengths,
- default: 100% (1 col) --
- onload %Script; #IMPLIED -- all the frames have been loaded --
- onunload %Script; #IMPLIED -- all the frames have been removed --
- >
-]]>
-
-<![ %HTML.Frameset; [
-<!-- reserved frame names start with "_" otherwise starts with letter -->
-<!ELEMENT FRAME - O EMPTY -- subwindow -->
-<!ATTLIST FRAME
- %coreattrs; -- id, class, style, title --
- longdesc %URI; #IMPLIED -- link to long description
- (complements title) --
- name CDATA #IMPLIED -- name of frame for targetting --
- src %URI; #IMPLIED -- source of frame content --
- frameborder (1|0) 1 -- request frame borders? --
- marginwidth %Pixels; #IMPLIED -- margin widths in pixels --
- marginheight %Pixels; #IMPLIED -- margin height in pixels --
- noresize (noresize) #IMPLIED -- allow users to resize frames? --
- scrolling (yes|no|auto) auto -- scrollbar or none --
- >
-]]>
-
-<!ELEMENT IFRAME - - (%flow;)* -- inline subwindow -->
-<!ATTLIST IFRAME
- %coreattrs; -- id, class, style, title --
- longdesc %URI; #IMPLIED -- link to long description
- (complements title) --
- name CDATA #IMPLIED -- name of frame for targetting --
- src %URI; #IMPLIED -- source of frame content --
- frameborder (1|0) 1 -- request frame borders? --
- marginwidth %Pixels; #IMPLIED -- margin widths in pixels --
- marginheight %Pixels; #IMPLIED -- margin height in pixels --
- scrolling (yes|no|auto) auto -- scrollbar or none --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- height %Length; #IMPLIED -- frame height --
- width %Length; #IMPLIED -- frame width --
- >
-
-<![ %HTML.Frameset; [
-<!ENTITY % noframes.content "(BODY) -(NOFRAMES)">
-]]>
-
-<!ENTITY % noframes.content "(%flow;)*">
-
-<!ELEMENT NOFRAMES - - %noframes.content;
- -- alternate content container for non frame-based rendering -->
-<!ATTLIST NOFRAMES
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================ Document Head =======================================-->
-<!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
-<!ENTITY % head.content "TITLE & ISINDEX? & BASE?">
-
-<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
-<!ATTLIST HEAD
- %i18n; -- lang, dir --
- profile %URI; #IMPLIED -- named dictionary of meta info --
- >
-
-<!-- The TITLE element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
- -->
-<!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
-<!ATTLIST TITLE %i18n>
-
-<!ELEMENT ISINDEX - O EMPTY -- single line prompt -->
-<!ATTLIST ISINDEX
- %coreattrs; -- id, class, style, title --
- %i18n; -- lang, dir --
- prompt %Text; #IMPLIED -- prompt message -->
-
-<!ELEMENT BASE - O EMPTY -- document base URI -->
-<!ATTLIST BASE
- href %URI; #IMPLIED -- URI that acts as base URI --
- target %FrameTarget; #IMPLIED -- render in this frame --
- >
-
-<!ELEMENT META - O EMPTY -- generic metainformation -->
-<!ATTLIST META
- %i18n; -- lang, dir, for use with content --
- http-equiv NAME #IMPLIED -- HTTP response header name --
- name NAME #IMPLIED -- metainformation name --
- content CDATA #REQUIRED -- associated information --
- scheme CDATA #IMPLIED -- select form of content --
- >
-
-<!ELEMENT STYLE - - %StyleSheet -- style info -->
-<!ATTLIST STYLE
- %i18n; -- lang, dir, for use with title --
- type %ContentType; #REQUIRED -- content type of style language --
- media %MediaDesc; #IMPLIED -- designed for use with these media --
- title %Text; #IMPLIED -- advisory title --
- >
-
-<!ELEMENT SCRIPT - - %Script; -- script statements -->
-<!ATTLIST SCRIPT
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- type %ContentType; #REQUIRED -- content type of script language --
- language CDATA #IMPLIED -- predefined script language name --
- src %URI; #IMPLIED -- URI for an external script --
- defer (defer) #IMPLIED -- UA may defer execution of script --
- event CDATA #IMPLIED -- reserved for possible future use --
- for %URI; #IMPLIED -- reserved for possible future use --
- >
-
-<!ELEMENT NOSCRIPT - - (%flow;)*
- -- alternate content container for non script-based rendering -->
-<!ATTLIST NOSCRIPT
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================ Document Structure ==================================-->
-<!ENTITY % version "version CDATA #FIXED '%HTML.Version;'">
-
-<![ %HTML.Frameset; [
-<!ENTITY % html.content "HEAD, FRAMESET">
-]]>
-
-<!ENTITY % html.content "HEAD, BODY">
-
-<!ELEMENT HTML O O (%html.content;) -- document root element -->
-<!ATTLIST HTML
- %i18n; -- lang, dir --
- %version;
- >
diff --git a/tests/dtds/HTML4.soc b/tests/dtds/HTML4.soc
deleted file mode 100644
index ec4825f8..00000000
--- a/tests/dtds/HTML4.soc
+++ /dev/null
@@ -1,9 +0,0 @@
-OVERRIDE YES
-SGMLDECL HTML4.dcl
-DOCTYPE HTML HTML4.dtd
-PUBLIC "-//W3C//DTD HTML 4.0//EN" HTML4-s.dtd
-PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" HTML4.dtd
-PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" HTML4-f.dtd
-PUBLIC "-//W3C//ENTITIES Latin1//EN//HTML" HTMLlat1.ent
-PUBLIC "-//W3C//ENTITIES Special//EN//HTML" HTMLspec.ent
-PUBLIC "-//W3C//ENTITIES Symbols//EN//HTML" HTMLsym.ent
diff --git a/tests/dtds/HTMLlat1.ent b/tests/dtds/HTMLlat1.ent
deleted file mode 100644
index 7632023a..00000000
--- a/tests/dtds/HTMLlat1.ent
+++ /dev/null
@@ -1,195 +0,0 @@
-<!-- Portions (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Full Latin 1//EN//HTML">
- %HTMLlat1;
--->
-
-<!ENTITY nbsp CDATA "&#160;" -- no-break space = non-breaking space,
- U+00A0 ISOnum -->
-<!ENTITY iexcl CDATA "&#161;" -- inverted exclamation mark, U+00A1 ISOnum -->
-<!ENTITY cent CDATA "&#162;" -- cent sign, U+00A2 ISOnum -->
-<!ENTITY pound CDATA "&#163;" -- pound sign, U+00A3 ISOnum -->
-<!ENTITY curren CDATA "&#164;" -- currency sign, U+00A4 ISOnum -->
-<!ENTITY yen CDATA "&#165;" -- yen sign = yuan sign, U+00A5 ISOnum -->
-<!ENTITY brvbar CDATA "&#166;" -- broken bar = broken vertical bar,
- U+00A6 ISOnum -->
-<!ENTITY sect CDATA "&#167;" -- section sign, U+00A7 ISOnum -->
-<!ENTITY uml CDATA "&#168;" -- diaeresis = spacing diaeresis,
- U+00A8 ISOdia -->
-<!ENTITY copy CDATA "&#169;" -- copyright sign, U+00A9 ISOnum -->
-<!ENTITY ordf CDATA "&#170;" -- feminine ordinal indicator, U+00AA ISOnum -->
-<!ENTITY laquo CDATA "&#171;" -- left-pointing double angle quotation mark
- = left pointing guillemet, U+00AB ISOnum -->
-<!ENTITY not CDATA "&#172;" -- not sign = discretionary hyphen,
- U+00AC ISOnum -->
-<!ENTITY shy CDATA "&#173;" -- soft hyphen = discretionary hyphen,
- U+00AD ISOnum -->
-<!ENTITY reg CDATA "&#174;" -- registered sign = registered trade mark sign,
- U+00AE ISOnum -->
-<!ENTITY macr CDATA "&#175;" -- macron = spacing macron = overline
- = APL overbar, U+00AF ISOdia -->
-<!ENTITY deg CDATA "&#176;" -- degree sign, U+00B0 ISOnum -->
-<!ENTITY plusmn CDATA "&#177;" -- plus-minus sign = plus-or-minus sign,
- U+00B1 ISOnum -->
-<!ENTITY sup2 CDATA "&#178;" -- superscript two = superscript digit two
- = squared, U+00B2 ISOnum -->
-<!ENTITY sup3 CDATA "&#179;" -- superscript three = superscript digit three
- = cubed, U+00B3 ISOnum -->
-<!ENTITY acute CDATA "&#180;" -- acute accent = spacing acute,
- U+00B4 ISOdia -->
-<!ENTITY micro CDATA "&#181;" -- micro sign, U+00B5 ISOnum -->
-<!ENTITY para CDATA "&#182;" -- pilcrow sign = paragraph sign,
- U+00B6 ISOnum -->
-<!ENTITY middot CDATA "&#183;" -- middle dot = Georgian comma
- = Greek middle dot, U+00B7 ISOnum -->
-<!ENTITY cedil CDATA "&#184;" -- cedilla = spacing cedilla, U+00B8 ISOdia -->
-<!ENTITY sup1 CDATA "&#185;" -- superscript one = superscript digit one,
- U+00B9 ISOnum -->
-<!ENTITY ordm CDATA "&#186;" -- masculine ordinal indicator,
- U+00BA ISOnum -->
-<!ENTITY raquo CDATA "&#187;" -- right-pointing double angle quotation mark
- = right pointing guillemet, U+00BB ISOnum -->
-<!ENTITY frac14 CDATA "&#188;" -- vulgar fraction one quarter
- = fraction one quarter, U+00BC ISOnum -->
-<!ENTITY frac12 CDATA "&#189;" -- vulgar fraction one half
- = fraction one half, U+00BD ISOnum -->
-<!ENTITY frac34 CDATA "&#190;" -- vulgar fraction three quarters
- = fraction three quarters, U+00BE ISOnum -->
-<!ENTITY iquest CDATA "&#191;" -- inverted question mark
- = turned question mark, U+00BF ISOnum -->
-<!ENTITY Agrave CDATA "&#192;" -- latin capital letter A with grave
- = latin capital letter A grave,
- U+00C0 ISOlat1 -->
-<!ENTITY Aacute CDATA "&#193;" -- latin capital letter A with acute,
- U+00C1 ISOlat1 -->
-<!ENTITY Acirc CDATA "&#194;" -- latin capital letter A with circumflex,
- U+00C2 ISOlat1 -->
-<!ENTITY Atilde CDATA "&#195;" -- latin capital letter A with tilde,
- U+00C3 ISOlat1 -->
-<!ENTITY Auml CDATA "&#196;" -- latin capital letter A with diaeresis,
- U+00C4 ISOlat1 -->
-<!ENTITY Aring CDATA "&#197;" -- latin capital letter A with ring above
- = latin capital letter A ring,
- U+00C5 ISOlat1 -->
-<!ENTITY AElig CDATA "&#198;" -- latin capital letter AE
- = latin capital ligature AE,
- U+00C6 ISOlat1 -->
-<!ENTITY Ccedil CDATA "&#199;" -- latin capital letter C with cedilla,
- U+00C7 ISOlat1 -->
-<!ENTITY Egrave CDATA "&#200;" -- latin capital letter E with grave,
- U+00C8 ISOlat1 -->
-<!ENTITY Eacute CDATA "&#201;" -- latin capital letter E with acute,
- U+00C9 ISOlat1 -->
-<!ENTITY Ecirc CDATA "&#202;" -- latin capital letter E with circumflex,
- U+00CA ISOlat1 -->
-<!ENTITY Euml CDATA "&#203;" -- latin capital letter E with diaeresis,
- U+00CB ISOlat1 -->
-<!ENTITY Igrave CDATA "&#204;" -- latin capital letter I with grave,
- U+00CC ISOlat1 -->
-<!ENTITY Iacute CDATA "&#205;" -- latin capital letter I with acute,
- U+00CD ISOlat1 -->
-<!ENTITY Icirc CDATA "&#206;" -- latin capital letter I with circumflex,
- U+00CE ISOlat1 -->
-<!ENTITY Iuml CDATA "&#207;" -- latin capital letter I with diaeresis,
- U+00CF ISOlat1 -->
-<!ENTITY ETH CDATA "&#208;" -- latin capital letter ETH, U+00D0 ISOlat1 -->
-<!ENTITY Ntilde CDATA "&#209;" -- latin capital letter N with tilde,
- U+00D1 ISOlat1 -->
-<!ENTITY Ograve CDATA "&#210;" -- latin capital letter O with grave,
- U+00D2 ISOlat1 -->
-<!ENTITY Oacute CDATA "&#211;" -- latin capital letter O with acute,
- U+00D3 ISOlat1 -->
-<!ENTITY Ocirc CDATA "&#212;" -- latin capital letter O with circumflex,
- U+00D4 ISOlat1 -->
-<!ENTITY Otilde CDATA "&#213;" -- latin capital letter O with tilde,
- U+00D5 ISOlat1 -->
-<!ENTITY Ouml CDATA "&#214;" -- latin capital letter O with diaeresis,
- U+00D6 ISOlat1 -->
-<!ENTITY times CDATA "&#215;" -- multiplication sign, U+00D7 ISOnum -->
-<!ENTITY Oslash CDATA "&#216;" -- latin capital letter O with stroke
- = latin capital letter O slash,
- U+00D8 ISOlat1 -->
-<!ENTITY Ugrave CDATA "&#217;" -- latin capital letter U with grave,
- U+00D9 ISOlat1 -->
-<!ENTITY Uacute CDATA "&#218;" -- latin capital letter U with acute,
- U+00DA ISOlat1 -->
-<!ENTITY Ucirc CDATA "&#219;" -- latin capital letter U with circumflex,
- U+00DB ISOlat1 -->
-<!ENTITY Uuml CDATA "&#220;" -- latin capital letter U with diaeresis,
- U+00DC ISOlat1 -->
-<!ENTITY Yacute CDATA "&#221;" -- latin capital letter Y with acute,
- U+00DD ISOlat1 -->
-<!ENTITY THORN CDATA "&#222;" -- latin capital letter THORN,
- U+00DE ISOlat1 -->
-<!ENTITY szlig CDATA "&#223;" -- latin small letter sharp s = ess-zed,
- U+00DF ISOlat1 -->
-<!ENTITY agrave CDATA "&#224;" -- latin small letter a with grave
- = latin small letter a grave,
- U+00E0 ISOlat1 -->
-<!ENTITY aacute CDATA "&#225;" -- latin small letter a with acute,
- U+00E1 ISOlat1 -->
-<!ENTITY acirc CDATA "&#226;" -- latin small letter a with circumflex,
- U+00E2 ISOlat1 -->
-<!ENTITY atilde CDATA "&#227;" -- latin small letter a with tilde,
- U+00E3 ISOlat1 -->
-<!ENTITY auml CDATA "&#228;" -- latin small letter a with diaeresis,
- U+00E4 ISOlat1 -->
-<!ENTITY aring CDATA "&#229;" -- latin small letter a with ring above
- = latin small letter a ring,
- U+00E5 ISOlat1 -->
-<!ENTITY aelig CDATA "&#230;" -- latin small letter ae
- = latin small ligature ae, U+00E6 ISOlat1 -->
-<!ENTITY ccedil CDATA "&#231;" -- latin small letter c with cedilla,
- U+00E7 ISOlat1 -->
-<!ENTITY egrave CDATA "&#232;" -- latin small letter e with grave,
- U+00E8 ISOlat1 -->
-<!ENTITY eacute CDATA "&#233;" -- latin small letter e with acute,
- U+00E9 ISOlat1 -->
-<!ENTITY ecirc CDATA "&#234;" -- latin small letter e with circumflex,
- U+00EA ISOlat1 -->
-<!ENTITY euml CDATA "&#235;" -- latin small letter e with diaeresis,
- U+00EB ISOlat1 -->
-<!ENTITY igrave CDATA "&#236;" -- latin small letter i with grave,
- U+00EC ISOlat1 -->
-<!ENTITY iacute CDATA "&#237;" -- latin small letter i with acute,
- U+00ED ISOlat1 -->
-<!ENTITY icirc CDATA "&#238;" -- latin small letter i with circumflex,
- U+00EE ISOlat1 -->
-<!ENTITY iuml CDATA "&#239;" -- latin small letter i with diaeresis,
- U+00EF ISOlat1 -->
-<!ENTITY eth CDATA "&#240;" -- latin small letter eth, U+00F0 ISOlat1 -->
-<!ENTITY ntilde CDATA "&#241;" -- latin small letter n with tilde,
- U+00F1 ISOlat1 -->
-<!ENTITY ograve CDATA "&#242;" -- latin small letter o with grave,
- U+00F2 ISOlat1 -->
-<!ENTITY oacute CDATA "&#243;" -- latin small letter o with acute,
- U+00F3 ISOlat1 -->
-<!ENTITY ocirc CDATA "&#244;" -- latin small letter o with circumflex,
- U+00F4 ISOlat1 -->
-<!ENTITY otilde CDATA "&#245;" -- latin small letter o with tilde,
- U+00F5 ISOlat1 -->
-<!ENTITY ouml CDATA "&#246;" -- latin small letter o with diaeresis,
- U+00F6 ISOlat1 -->
-<!ENTITY divide CDATA "&#247;" -- division sign, U+00F7 ISOnum -->
-<!ENTITY oslash CDATA "&#248;" -- latin small letter o with stroke,
- = latin small letter o slash,
- U+00F8 ISOlat1 -->
-<!ENTITY ugrave CDATA "&#249;" -- latin small letter u with grave,
- U+00F9 ISOlat1 -->
-<!ENTITY uacute CDATA "&#250;" -- latin small letter u with acute,
- U+00FA ISOlat1 -->
-<!ENTITY ucirc CDATA "&#251;" -- latin small letter u with circumflex,
- U+00FB ISOlat1 -->
-<!ENTITY uuml CDATA "&#252;" -- latin small letter u with diaeresis,
- U+00FC ISOlat1 -->
-<!ENTITY yacute CDATA "&#253;" -- latin small letter y with acute,
- U+00FD ISOlat1 -->
-<!ENTITY thorn CDATA "&#254;" -- latin small letter thorn with,
- U+00FE ISOlat1 -->
-<!ENTITY yuml CDATA "&#255;" -- latin small letter y with diaeresis,
- U+00FF ISOlat1 --> \ No newline at end of file
diff --git a/tests/dtds/HTMLspec.ent b/tests/dtds/HTMLspec.ent
deleted file mode 100644
index 29011cc2..00000000
--- a/tests/dtds/HTMLspec.ent
+++ /dev/null
@@ -1,77 +0,0 @@
-<!-- Special characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special//EN//HTML">
- %HTMLspecial; -->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. CDATA values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are Unicode 2.0 names.
-
--->
-
-<!-- C0 Controls and Basic Latin -->
-<!ENTITY quot CDATA "&#34;" -- quotation mark = APL quote,
- U+0022 ISOnum -->
-<!ENTITY amp CDATA "&#38;" -- ampersand, U+0026 ISOnum -->
-<!ENTITY lt CDATA "&#60;" -- less-than sign, U+003C ISOnum -->
-<!ENTITY gt CDATA "&#62;" -- greater-than sign, U+003E ISOnum -->
-
-<!-- Latin Extended-A -->
-<!ENTITY OElig CDATA "&#338;" -- latin capital ligature OE,
- U+0152 ISOlat2 -->
-<!ENTITY oelig CDATA "&#339;" -- latin small ligature oe, U+0153 ISOlat2 -->
-<!-- ligature is a misnomer, this is a separate character in some languages -->
-<!ENTITY Scaron CDATA "&#352;" -- latin capital letter S with caron,
- U+0160 ISOlat2 -->
-<!ENTITY scaron CDATA "&#353;" -- latin small letter s with caron,
- U+0161 ISOlat2 -->
-<!ENTITY Yuml CDATA "&#376;" -- latin capital letter Y with diaeresis,
- U+0178 ISOlat2 -->
-
-<!-- Spacing Modifier Letters -->
-<!ENTITY circ CDATA "&#710;" -- modifier letter circumflex accent,
- U+02C6 ISOpub -->
-<!ENTITY tilde CDATA "&#732;" -- small tilde, U+02DC ISOdia -->
-
-<!-- General Punctuation -->
-<!ENTITY ensp CDATA "&#8194;" -- en space, U+2002 ISOpub -->
-<!ENTITY emsp CDATA "&#8195;" -- em space, U+2003 ISOpub -->
-<!ENTITY thinsp CDATA "&#8201;" -- thin space, U+2009 ISOpub -->
-<!ENTITY zwnj CDATA "&#8204;" -- zero width non-joiner,
- U+200C NEW RFC 2070 -->
-<!ENTITY zwj CDATA "&#8205;" -- zero width joiner, U+200D NEW RFC 2070 -->
-<!ENTITY lrm CDATA "&#8206;" -- left-to-right mark, U+200E NEW RFC 2070 -->
-<!ENTITY rlm CDATA "&#8207;" -- right-to-left mark, U+200F NEW RFC 2070 -->
-<!ENTITY ndash CDATA "&#8211;" -- en dash, U+2013 ISOpub -->
-<!ENTITY mdash CDATA "&#8212;" -- em dash, U+2014 ISOpub -->
-<!ENTITY lsquo CDATA "&#8216;" -- left single quotation mark,
- U+2018 ISOnum -->
-<!ENTITY rsquo CDATA "&#8217;" -- right single quotation mark,
- U+2019 ISOnum -->
-<!ENTITY sbquo CDATA "&#8218;" -- single low-9 quotation mark, U+201A NEW -->
-<!ENTITY ldquo CDATA "&#8220;" -- left double quotation mark,
- U+201C ISOnum -->
-<!ENTITY rdquo CDATA "&#8221;" -- right double quotation mark,
- U+201D ISOnum -->
-<!ENTITY bdquo CDATA "&#8222;" -- double low-9 quotation mark, U+201E NEW -->
-<!ENTITY dagger CDATA "&#8224;" -- dagger, U+2020 ISOpub -->
-<!ENTITY Dagger CDATA "&#8225;" -- double dagger, U+2021 ISOpub -->
-<!ENTITY permil CDATA "&#8240;" -- per mille sign, U+2030 ISOtech -->
-<!ENTITY lsaquo CDATA "&#8249;" -- single left-pointing angle quotation mark,
- U+2039 ISO proposed -->
-<!-- lsaquo is proposed but not yet ISO standardized -->
-<!ENTITY rsaquo CDATA "&#8250;" -- single right-pointing angle quotation mark,
- U+203A ISO proposed -->
-<!-- rsaquo is proposed but not yet ISO standardized -->
-<!ENTITY euro CDATA "&#8364;" -- euro sign, U+20AC NEW --> \ No newline at end of file
diff --git a/tests/dtds/HTMLsym.ent b/tests/dtds/HTMLsym.ent
deleted file mode 100644
index 2a6250ba..00000000
--- a/tests/dtds/HTMLsym.ent
+++ /dev/null
@@ -1,241 +0,0 @@
-<!-- Mathematical, Greek and Symbolic characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbolic//EN//HTML">
- %HTMLsymbol; -->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. CDATA values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are Unicode 2.0 names.
-
--->
-
-<!-- Latin Extended-B -->
-<!ENTITY fnof CDATA "&#402;" -- latin small f with hook = function
- = florin, U+0192 ISOtech -->
-
-<!-- Greek -->
-<!ENTITY Alpha CDATA "&#913;" -- greek capital letter alpha, U+0391 -->
-<!ENTITY Beta CDATA "&#914;" -- greek capital letter beta, U+0392 -->
-<!ENTITY Gamma CDATA "&#915;" -- greek capital letter gamma,
- U+0393 ISOgrk3 -->
-<!ENTITY Delta CDATA "&#916;" -- greek capital letter delta,
- U+0394 ISOgrk3 -->
-<!ENTITY Epsilon CDATA "&#917;" -- greek capital letter epsilon, U+0395 -->
-<!ENTITY Zeta CDATA "&#918;" -- greek capital letter zeta, U+0396 -->
-<!ENTITY Eta CDATA "&#919;" -- greek capital letter eta, U+0397 -->
-<!ENTITY Theta CDATA "&#920;" -- greek capital letter theta,
- U+0398 ISOgrk3 -->
-<!ENTITY Iota CDATA "&#921;" -- greek capital letter iota, U+0399 -->
-<!ENTITY Kappa CDATA "&#922;" -- greek capital letter kappa, U+039A -->
-<!ENTITY Lambda CDATA "&#923;" -- greek capital letter lambda,
- U+039B ISOgrk3 -->
-<!ENTITY Mu CDATA "&#924;" -- greek capital letter mu, U+039C -->
-<!ENTITY Nu CDATA "&#925;" -- greek capital letter nu, U+039D -->
-<!ENTITY Xi CDATA "&#926;" -- greek capital letter xi, U+039E ISOgrk3 -->
-<!ENTITY Omicron CDATA "&#927;" -- greek capital letter omicron, U+039F -->
-<!ENTITY Pi CDATA "&#928;" -- greek capital letter pi, U+03A0 ISOgrk3 -->
-<!ENTITY Rho CDATA "&#929;" -- greek capital letter rho, U+03A1 -->
-<!-- there is no Sigmaf, and no U+03A2 character either -->
-<!ENTITY Sigma CDATA "&#931;" -- greek capital letter sigma,
- U+03A3 ISOgrk3 -->
-<!ENTITY Tau CDATA "&#932;" -- greek capital letter tau, U+03A4 -->
-<!ENTITY Upsilon CDATA "&#933;" -- greek capital letter upsilon,
- U+03A5 ISOgrk3 -->
-<!ENTITY Phi CDATA "&#934;" -- greek capital letter phi,
- U+03A6 ISOgrk3 -->
-<!ENTITY Chi CDATA "&#935;" -- greek capital letter chi, U+03A7 -->
-<!ENTITY Psi CDATA "&#936;" -- greek capital letter psi,
- U+03A8 ISOgrk3 -->
-<!ENTITY Omega CDATA "&#937;" -- greek capital letter omega,
- U+03A9 ISOgrk3 -->
-
-<!ENTITY alpha CDATA "&#945;" -- greek small letter alpha,
- U+03B1 ISOgrk3 -->
-<!ENTITY beta CDATA "&#946;" -- greek small letter beta, U+03B2 ISOgrk3 -->
-<!ENTITY gamma CDATA "&#947;" -- greek small letter gamma,
- U+03B3 ISOgrk3 -->
-<!ENTITY delta CDATA "&#948;" -- greek small letter delta,
- U+03B4 ISOgrk3 -->
-<!ENTITY epsilon CDATA "&#949;" -- greek small letter epsilon,
- U+03B5 ISOgrk3 -->
-<!ENTITY zeta CDATA "&#950;" -- greek small letter zeta, U+03B6 ISOgrk3 -->
-<!ENTITY eta CDATA "&#951;" -- greek small letter eta, U+03B7 ISOgrk3 -->
-<!ENTITY theta CDATA "&#952;" -- greek small letter theta,
- U+03B8 ISOgrk3 -->
-<!ENTITY iota CDATA "&#953;" -- greek small letter iota, U+03B9 ISOgrk3 -->
-<!ENTITY kappa CDATA "&#954;" -- greek small letter kappa,
- U+03BA ISOgrk3 -->
-<!ENTITY lambda CDATA "&#955;" -- greek small letter lambda,
- U+03BB ISOgrk3 -->
-<!ENTITY mu CDATA "&#956;" -- greek small letter mu, U+03BC ISOgrk3 -->
-<!ENTITY nu CDATA "&#957;" -- greek small letter nu, U+03BD ISOgrk3 -->
-<!ENTITY xi CDATA "&#958;" -- greek small letter xi, U+03BE ISOgrk3 -->
-<!ENTITY omicron CDATA "&#959;" -- greek small letter omicron, U+03BF NEW -->
-<!ENTITY pi CDATA "&#960;" -- greek small letter pi, U+03C0 ISOgrk3 -->
-<!ENTITY rho CDATA "&#961;" -- greek small letter rho, U+03C1 ISOgrk3 -->
-<!ENTITY sigmaf CDATA "&#962;" -- greek small letter final sigma,
- U+03C2 ISOgrk3 -->
-<!ENTITY sigma CDATA "&#963;" -- greek small letter sigma,
- U+03C3 ISOgrk3 -->
-<!ENTITY tau CDATA "&#964;" -- greek small letter tau, U+03C4 ISOgrk3 -->
-<!ENTITY upsilon CDATA "&#965;" -- greek small letter upsilon,
- U+03C5 ISOgrk3 -->
-<!ENTITY phi CDATA "&#966;" -- greek small letter phi, U+03C6 ISOgrk3 -->
-<!ENTITY chi CDATA "&#967;" -- greek small letter chi, U+03C7 ISOgrk3 -->
-<!ENTITY psi CDATA "&#968;" -- greek small letter psi, U+03C8 ISOgrk3 -->
-<!ENTITY omega CDATA "&#969;" -- greek small letter omega,
- U+03C9 ISOgrk3 -->
-<!ENTITY thetasym CDATA "&#977;" -- greek small letter theta symbol,
- U+03D1 NEW -->
-<!ENTITY upsih CDATA "&#978;" -- greek upsilon with hook symbol,
- U+03D2 NEW -->
-<!ENTITY piv CDATA "&#982;" -- greek pi symbol, U+03D6 ISOgrk3 -->
-
-<!-- General Punctuation -->
-<!ENTITY bull CDATA "&#8226;" -- bullet = black small circle,
- U+2022 ISOpub -->
-<!-- bullet is NOT the same as bullet operator, U+2219 -->
-<!ENTITY hellip CDATA "&#8230;" -- horizontal ellipsis = three dot leader,
- U+2026 ISOpub -->
-<!ENTITY prime CDATA "&#8242;" -- prime = minutes = feet, U+2032 ISOtech -->
-<!ENTITY Prime CDATA "&#8243;" -- double prime = seconds = inches,
- U+2033 ISOtech -->
-<!ENTITY oline CDATA "&#8254;" -- overline = spacing overscore,
- U+203E NEW -->
-<!ENTITY frasl CDATA "&#8260;" -- fraction slash, U+2044 NEW -->
-
-<!-- Letterlike Symbols -->
-<!ENTITY weierp CDATA "&#8472;" -- script capital P = power set
- = Weierstrass p, U+2118 ISOamso -->
-<!ENTITY image CDATA "&#8465;" -- blackletter capital I = imaginary part,
- U+2111 ISOamso -->
-<!ENTITY real CDATA "&#8476;" -- blackletter capital R = real part symbol,
- U+211C ISOamso -->
-<!ENTITY trade CDATA "&#8482;" -- trade mark sign, U+2122 ISOnum -->
-<!ENTITY alefsym CDATA "&#8501;" -- alef symbol = first transfinite cardinal,
- U+2135 NEW -->
-<!-- alef symbol is NOT the same as hebrew letter alef,
- U+05D0 although the same glyph could be used to depict both characters -->
-
-<!-- Arrows -->
-<!ENTITY larr CDATA "&#8592;" -- leftwards arrow, U+2190 ISOnum -->
-<!ENTITY uarr CDATA "&#8593;" -- upwards arrow, U+2191 ISOnum-->
-<!ENTITY rarr CDATA "&#8594;" -- rightwards arrow, U+2192 ISOnum -->
-<!ENTITY darr CDATA "&#8595;" -- downwards arrow, U+2193 ISOnum -->
-<!ENTITY harr CDATA "&#8596;" -- left right arrow, U+2194 ISOamsa -->
-<!ENTITY crarr CDATA "&#8629;" -- downwards arrow with corner leftwards
- = carriage return, U+21B5 NEW -->
-<!ENTITY lArr CDATA "&#8656;" -- leftwards double arrow, U+21D0 ISOtech -->
-<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
- but also does not have any other character for that function. So ? lArr can
- be used for 'is implied by' as ISOtech suggests -->
-<!ENTITY uArr CDATA "&#8657;" -- upwards double arrow, U+21D1 ISOamsa -->
-<!ENTITY rArr CDATA "&#8658;" -- rightwards double arrow,
- U+21D2 ISOtech -->
-<!-- Unicode does not say this is the 'implies' character but does not have
- another character with this function so ?
- rArr can be used for 'implies' as ISOtech suggests -->
-<!ENTITY dArr CDATA "&#8659;" -- downwards double arrow, U+21D3 ISOamsa -->
-<!ENTITY hArr CDATA "&#8660;" -- left right double arrow,
- U+21D4 ISOamsa -->
-
-<!-- Mathematical Operators -->
-<!ENTITY forall CDATA "&#8704;" -- for all, U+2200 ISOtech -->
-<!ENTITY part CDATA "&#8706;" -- partial differential, U+2202 ISOtech -->
-<!ENTITY exist CDATA "&#8707;" -- there exists, U+2203 ISOtech -->
-<!ENTITY empty CDATA "&#8709;" -- empty set = null set = diameter,
- U+2205 ISOamso -->
-<!ENTITY nabla CDATA "&#8711;" -- nabla = backward difference,
- U+2207 ISOtech -->
-<!ENTITY isin CDATA "&#8712;" -- element of, U+2208 ISOtech -->
-<!ENTITY notin CDATA "&#8713;" -- not an element of, U+2209 ISOtech -->
-<!ENTITY ni CDATA "&#8715;" -- contains as member, U+220B ISOtech -->
-<!-- should there be a more memorable name than 'ni'? -->
-<!ENTITY prod CDATA "&#8719;" -- n-ary product = product sign,
- U+220F ISOamsb -->
-<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
- the same glyph might be used for both -->
-<!ENTITY sum CDATA "&#8721;" -- n-ary sumation, U+2211 ISOamsb -->
-<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
- though the same glyph might be used for both -->
-<!ENTITY minus CDATA "&#8722;" -- minus sign, U+2212 ISOtech -->
-<!ENTITY lowast CDATA "&#8727;" -- asterisk operator, U+2217 ISOtech -->
-<!ENTITY radic CDATA "&#8730;" -- square root = radical sign,
- U+221A ISOtech -->
-<!ENTITY prop CDATA "&#8733;" -- proportional to, U+221D ISOtech -->
-<!ENTITY infin CDATA "&#8734;" -- infinity, U+221E ISOtech -->
-<!ENTITY ang CDATA "&#8736;" -- angle, U+2220 ISOamso -->
-<!ENTITY and CDATA "&#8743;" -- logical and = wedge, U+2227 ISOtech -->
-<!ENTITY or CDATA "&#8744;" -- logical or = vee, U+2228 ISOtech -->
-<!ENTITY cap CDATA "&#8745;" -- intersection = cap, U+2229 ISOtech -->
-<!ENTITY cup CDATA "&#8746;" -- union = cup, U+222A ISOtech -->
-<!ENTITY int CDATA "&#8747;" -- integral, U+222B ISOtech -->
-<!ENTITY there4 CDATA "&#8756;" -- therefore, U+2234 ISOtech -->
-<!ENTITY sim CDATA "&#8764;" -- tilde operator = varies with = similar to,
- U+223C ISOtech -->
-<!-- tilde operator is NOT the same character as the tilde, U+007E,
- although the same glyph might be used to represent both -->
-<!ENTITY cong CDATA "&#8773;" -- approximately equal to, U+2245 ISOtech -->
-<!ENTITY asymp CDATA "&#8776;" -- almost equal to = asymptotic to,
- U+2248 ISOamsr -->
-<!ENTITY ne CDATA "&#8800;" -- not equal to, U+2260 ISOtech -->
-<!ENTITY equiv CDATA "&#8801;" -- identical to, U+2261 ISOtech -->
-<!ENTITY le CDATA "&#8804;" -- less-than or equal to, U+2264 ISOtech -->
-<!ENTITY ge CDATA "&#8805;" -- greater-than or equal to,
- U+2265 ISOtech -->
-<!ENTITY sub CDATA "&#8834;" -- subset of, U+2282 ISOtech -->
-<!ENTITY sup CDATA "&#8835;" -- superset of, U+2283 ISOtech -->
-<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
- font encoding and is not included. Should it be, for symmetry?
- It is in ISOamsn -->
-<!ENTITY nsub CDATA "&#8836;" -- not a subset of, U+2284 ISOamsn -->
-<!ENTITY sube CDATA "&#8838;" -- subset of or equal to, U+2286 ISOtech -->
-<!ENTITY supe CDATA "&#8839;" -- superset of or equal to,
- U+2287 ISOtech -->
-<!ENTITY oplus CDATA "&#8853;" -- circled plus = direct sum,
- U+2295 ISOamsb -->
-<!ENTITY otimes CDATA "&#8855;" -- circled times = vector product,
- U+2297 ISOamsb -->
-<!ENTITY perp CDATA "&#8869;" -- up tack = orthogonal to = perpendicular,
- U+22A5 ISOtech -->
-<!ENTITY sdot CDATA "&#8901;" -- dot operator, U+22C5 ISOamsb -->
-<!-- dot operator is NOT the same character as U+00B7 middle dot -->
-
-<!-- Miscellaneous Technical -->
-<!ENTITY lceil CDATA "&#8968;" -- left ceiling = apl upstile,
- U+2308 ISOamsc -->
-<!ENTITY rceil CDATA "&#8969;" -- right ceiling, U+2309 ISOamsc -->
-<!ENTITY lfloor CDATA "&#8970;" -- left floor = apl downstile,
- U+230A ISOamsc -->
-<!ENTITY rfloor CDATA "&#8971;" -- right floor, U+230B ISOamsc -->
-<!ENTITY lang CDATA "&#9001;" -- left-pointing angle bracket = bra,
- U+2329 ISOtech -->
-<!-- lang is NOT the same character as U+003C 'less than'
- or U+2039 'single left-pointing angle quotation mark' -->
-<!ENTITY rang CDATA "&#9002;" -- right-pointing angle bracket = ket,
- U+232A ISOtech -->
-<!-- rang is NOT the same character as U+003E 'greater than'
- or U+203A 'single right-pointing angle quotation mark' -->
-
-<!-- Geometric Shapes -->
-<!ENTITY loz CDATA "&#9674;" -- lozenge, U+25CA ISOpub -->
-
-<!-- Miscellaneous Symbols -->
-<!ENTITY spades CDATA "&#9824;" -- black spade suit, U+2660 ISOpub -->
-<!-- black here seems to mean filled as opposed to hollow -->
-<!ENTITY clubs CDATA "&#9827;" -- black club suit = shamrock,
- U+2663 ISOpub -->
-<!ENTITY hearts CDATA "&#9829;" -- black heart suit = valentine,
- U+2665 ISOpub -->
-<!ENTITY diams CDATA "&#9830;" -- black diamond suit, U+2666 ISOpub --> \ No newline at end of file
diff --git a/tests/examplefiles/99_bottles_of_beer.chpl b/tests/examplefiles/99_bottles_of_beer.chpl
deleted file mode 100644
index ff50b294..00000000
--- a/tests/examplefiles/99_bottles_of_beer.chpl
+++ /dev/null
@@ -1,206 +0,0 @@
-/***********************************************************************
- * Chapel implementation of "99 bottles of beer"
- *
- * by Brad Chamberlain and Steve Deitz
- * 07/13/2006 in Knoxville airport while waiting for flight home from
- * HPLS workshop
- * compiles and runs with chpl compiler version 1.12.0
- * for more information, contact: chapel_info@cray.com
- *
- *
- * Notes:
- * o as in all good parallel computations, boundary conditions
- * constitute the vast bulk of complexity in this code (invite Brad to
- * tell you about his zany boundary condition simplification scheme)
- * o uses type inference for variables, arguments
- * o relies on integer->string coercions
- * o uses named argument passing (for documentation purposes only)
- ***********************************************************************/
-
-// allow executable command-line specification of number of bottles
-// (e.g., ./a.out -snumBottles=999999)
-config const numBottles = 99;
-const numVerses = numBottles+1;
-
-// a domain to describe the space of lyrics
-var LyricsSpace: domain(1) = {1..numVerses};
-
-// array of lyrics
-var Lyrics: [LyricsSpace] string;
-
-// parallel computation of lyrics array
-[verse in LyricsSpace] Lyrics(verse) = computeLyric(verse);
-
-// as in any good parallel language, I/O to stdout is serialized.
-// (Note that I/O to a file could be parallelized using a parallel
-// prefix computation on the verse strings' lengths with file seeking)
-writeln(Lyrics);
-
-
-// HELPER FUNCTIONS:
-
-proc computeLyric(verseNum) {
- var bottleNum = numBottles - (verseNum - 1);
- var nextBottle = (bottleNum + numVerses - 1)%numVerses;
- return "\n" // disguise space used to separate elements in array I/O
- + describeBottles(bottleNum, startOfVerse=true) + " on the wall, "
- + describeBottles(bottleNum) + ".\n"
- + computeAction(bottleNum)
- + describeBottles(nextBottle) + " on the wall.\n";
-}
-
-
-proc describeBottles(bottleNum, startOfVerse:bool = false) {
- // NOTE: bool should not be necessary here (^^^^); working around bug
- var bottleDescription = if (bottleNum) then bottleNum:string
- else (if startOfVerse then "N"
- else "n")
- + "o more";
- return bottleDescription
- + " bottle" + (if (bottleNum == 1) then "" else "s")
- + " of beer";
-}
-
-
-proc computeAction(bottleNum) {
- return if (bottleNum == 0) then "Go to the store and buy some more, "
- else "Take one down and pass it around, ";
-}
-
-
-// Modules...
-module M1 {
- var x = 10;
-
- var y = 13.0;
-}
-
-module M2 {
- use M1 except y;
- use M1 only y;
- proc main() {
- writeln("M2 -> M1 -> x " + x);
- }
-}
-
-
-// Classes, records, unions...
-const PI: real = 3.14159;
-
-record Point {
- var x, y: real;
-}
-var p: Point;
-writeln("Distance from origin: " + sqrt(p.x ** 2 + p.y ** 2));
-p = new Point(1.0, 2.0);
-writeln("Distance from origin: " + sqrt(p.x ** 2 + p.y ** 2));
-
-class Circle {
- var p: Point;
- var r: real;
-}
-var c = new Circle(r=2.0);
-proc Circle.area()
- return PI * r ** 2;
-writeln("Area of circle: " + c.area());
-
-class Oval: Circle {
- var r2: real;
-}
-proc Oval.area()
- return PI * r * r2;
-
-delete c;
-c = nil;
-c = new Oval(r=1.0, r2=2.0);
-writeln("Area of oval: " + c.area());
-
-// This is a valid decimal integer:
-var x = 0000000000012;
-
-union U {
- var i: int;
- var r: real;
-}
-
-// chapel ranges are awesome.
-var r1 = 1..10, // 1 2 3 4 5 6 7 8 9 10
- r2 = 10..1, // no values in this range
- r3 = 1..10 by -1, // 10 9 8 7 6 5 4 3 2 1
- r4 = 1..10 by 2, // 1 3 5 7 9
- r5 = 1..10 by 2 align 0, // 2 4 6 8 10
- r6 = 1..10 by 2 align 2, // 2 4 6 8 10
- r7 = 1..10 # 3, // 1 2 3
- r8 = 1..10 # -2, // 9 10
- r9 = 1..100 # 10 by 2, // 1 3 5 7 9
- ra = 1..100 by 2 # 10, // 1 3 5 7 9 11 13 15 17 19
- rb = 1.. # 100 by 10; // 1 11 21 31 41 51 61 71 81 91
-
-// create a variable with default initialization
-var myVarWithoutInit: real = noinit;
-myVarWithoutInit = 1.0;
-
-// Chapel has <~> operator for read and write I/O operations.
-class IntPair {
- var x: int;
- var y: int;
- proc readWriteThis(f) {
- f <~> x <~> new ioLiteral(",") <~> y <~> new ioNewline();
- }
-}
-var ip = new IntPair(17,2);
-write(ip);
-
-var targetDom = {1..10},
- target: [targetDom] int;
-coforall i in targetDom with (ref target) {
- target[i] = i ** 3;
-}
-
-var wideOpen = 0o777,
- mememe = 0o600,
- clique_y = 0O660,
- zeroOct = 0o0,
- minPosOct = 0O1;
-
-private module M3 {
- private proc foo() {
-
- }
-
- private iter bar() {
- for i in 1..10 {
- yield i;
- }
- }
-
- private var x: int;
-
-}
-prototype module X {
-
- proc f() throws {
- throw new Error();
- }
-
- proc g() {
- try {
- f();
- try! f();
- } catch e {
- writeln("Caught ", e);
- }
- }
-
- proc int.add() { }
-
- g();
-
- override proc test() throws {
- var a = new borrowed IntPair();
- var b = new owned IntPair();
- var c = new shared IntPair();
- throw new unmanaged Error();
- }
-}
-
diff --git a/tests/examplefiles/AcidStateAdvanced.hs b/tests/examplefiles/AcidStateAdvanced.hs
deleted file mode 100644
index 9e3e7718..00000000
--- a/tests/examplefiles/AcidStateAdvanced.hs
+++ /dev/null
@@ -1,209 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, GeneralizedNewtypeDeriving
- , MultiParamTypeClasses, OverloadedStrings, ScopedTypeVariables, TemplateHaskell
- , TypeFamilies, FlexibleInstances #-}
-module Main where
-import Control.Applicative (Applicative, Alternative, (<$>))
-import Control.Exception.Lifted (bracket)
-import Control.Monad.Trans.Control (MonadBaseControl)
-import Control.Monad (MonadPlus, mplus)
-import Control.Monad.Reader (MonadReader, ReaderT(..), ask)
-import Control.Monad.Trans (MonadIO(..))
-import Data.Acid ( AcidState(..), EventState(..), EventResult(..)
- , Query(..), QueryEvent(..), Update(..), UpdateEvent(..)
- , IsAcidic(..), makeAcidic, openLocalState
- )
-import Data.Acid.Local ( createCheckpointAndClose
- , openLocalStateFrom
- )
-import Data.Acid.Advanced (query', update')
-import Data.Maybe (fromMaybe)
-import Data.SafeCopy (SafeCopy, base, deriveSafeCopy)
-import Data.Data (Data, Typeable)
-import Data.Lens ((%=), (!=))
-import Data.Lens.Template (makeLens)
-import Data.Text.Lazy (Text)
-import Happstack.Server ( Happstack, HasRqData, Method(GET, POST), Request(rqMethod)
- , Response
- , ServerPartT(..), WebMonad, FilterMonad, ServerMonad
- , askRq, decodeBody, dir, defaultBodyPolicy, lookText
- , mapServerPartT, nullConf, nullDir, ok, simpleHTTP
- , toResponse
- )
-import Prelude hiding (head, id)
-import System.FilePath ((</>))
-import Text.Blaze ((!))
-import Text.Blaze.Html4.Strict (body, head, html, input, form, label, p, title, toHtml)
-import Text.Blaze.Html4.Strict.Attributes (action, enctype, for, id, method, name, type_, value)
-class HasAcidState m st where
- getAcidState :: m (AcidState st)
-query :: forall event m.
- ( Functor m
- , MonadIO m
- , QueryEvent event
- , HasAcidState m (EventState event)
- ) =>
- event
- -> m (EventResult event)
-query event =
- do as <- getAcidState
- query' (as :: AcidState (EventState event)) event
-update :: forall event m.
- ( Functor m
- , MonadIO m
- , UpdateEvent event
- , HasAcidState m (EventState event)
- ) =>
- event
- -> m (EventResult event)
-update event =
- do as <- getAcidState
- update' (as :: AcidState (EventState event)) event
--- | bracket the opening and close of the `AcidState` handle.
-
--- automatically creates a checkpoint on close
-withLocalState :: (MonadBaseControl IO m, MonadIO m, IsAcidic st, Typeable st) =>
- Maybe FilePath -- ^ path to state directory
- -> st -- ^ initial state value
- -> (AcidState st -> m a) -- ^ function which uses the `AcidState` handle
- -> m a
-withLocalState mPath initialState =
- bracket (liftIO $ (maybe openLocalState openLocalStateFrom mPath) initialState)
- (liftIO . createCheckpointAndClose)
--- State that stores a hit count
-
-data CountState = CountState { _count :: Integer }
- deriving (Eq, Ord, Data, Typeable, Show)
-
-$(deriveSafeCopy 0 'base ''CountState)
-$(makeLens ''CountState)
-
-initialCountState :: CountState
-initialCountState = CountState { _count = 0 }
-
-incCount :: Update CountState Integer
-incCount = count %= succ
-
-$(makeAcidic ''CountState ['incCount])
--- State that stores a greeting
-data GreetingState = GreetingState { _greeting :: Text }
- deriving (Eq, Ord, Data, Typeable, Show)
-
-$(deriveSafeCopy 0 'base ''GreetingState)
-$(makeLens ''GreetingState)
-
-initialGreetingState :: GreetingState
-initialGreetingState = GreetingState { _greeting = "Hello" }
-
-getGreeting :: Query GreetingState Text
-getGreeting = _greeting <$> ask
-
-setGreeting :: Text -> Update GreetingState Text
-setGreeting txt = greeting != txt
-
-$(makeAcidic ''GreetingState ['getGreeting, 'setGreeting])
-data Acid = Acid { acidCountState :: AcidState CountState
- , acidGreetingState :: AcidState GreetingState
- }
-
-withAcid :: Maybe FilePath -> (Acid -> IO a) -> IO a
-withAcid mBasePath action =
- let basePath = fromMaybe "_state" mBasePath
- in withLocalState (Just $ basePath </> "count") initialCountState $ \c ->
- withLocalState (Just $ basePath </> "greeting") initialGreetingState $ \g ->
- action (Acid c g)
-newtype App a = App { unApp :: ServerPartT (ReaderT Acid IO) a }
- deriving ( Functor, Alternative, Applicative, Monad, MonadPlus, MonadIO
- , HasRqData, ServerMonad ,WebMonad Response, FilterMonad Response
- , Happstack, MonadReader Acid)
-
-runApp :: Acid -> App a -> ServerPartT IO a
-runApp acid (App sp) = mapServerPartT (flip runReaderT acid) sp
-instance HasAcidState App CountState where
- getAcidState = acidCountState <$> ask
-
-instance HasAcidState App GreetingState where
- getAcidState = acidGreetingState <$> ask
-page :: App Response
-page =
- do nullDir
- g <- greet
- c <- update IncCount -- ^ a CountState event
- ok $ toResponse $
- html $ do
- head $ do
- title "acid-state demo"
- body $ do
- form ! action "/" ! method "POST" ! enctype "multipart/form-data" $ do
- label "new message: " ! for "msg"
- input ! type_ "text" ! id "msg" ! name "greeting"
- input ! type_ "submit" ! value "update message"
- p $ toHtml g
- p $ do "This page has been loaded "
- toHtml c
- " time(s)."
- where
- greet =
- do m <- rqMethod <$> askRq
- case m of
- POST ->
- do decodeBody (defaultBodyPolicy "/tmp/" 0 1000 1000)
- newGreeting <- lookText "greeting"
- update (SetGreeting newGreeting) -- ^ a GreetingState event
- return newGreeting
- GET ->
- do query GetGreeting -- ^ a GreetingState event
-main :: IO ()
-main =
- withAcid Nothing $ \acid ->
- simpleHTTP nullConf $ runApp acid page
-newtype FooState = FooState { foo :: Text }
- deriving (Eq, Ord, Data, Typeable, SafeCopy)
-
-initialFooState :: FooState
-initialFooState = FooState { foo = "foo" }
-
-askFoo :: Query FooState Text
-askFoo = foo <$> ask
-
-$(makeAcidic ''FooState ['askFoo])
-fooPlugin :: (Happstack m, HasAcidState m FooState) => m Response
-fooPlugin =
- dir "foo" $ do
- txt <- query AskFoo
- ok $ toResponse txt
-data Acid' = Acid' { acidCountState' :: AcidState CountState
- , acidGreetingState' :: AcidState GreetingState
- , acidFooState' :: AcidState FooState
- }
-withAcid' :: Maybe FilePath -> (Acid' -> IO a) -> IO a
-withAcid' mBasePath action =
- let basePath = fromMaybe "_state" mBasePath
- in withLocalState (Just $ basePath </> "count") initialCountState $ \c ->
- withLocalState (Just $ basePath </> "greeting") initialGreetingState $ \g ->
- withLocalState (Just $ basePath </> "foo") initialFooState $ \f ->
- action (Acid' c g f)
-newtype App' a = App' { unApp' :: ServerPartT (ReaderT Acid' IO) a }
- deriving ( Functor, Alternative, Applicative, Monad, MonadPlus, MonadIO
- , HasRqData, ServerMonad ,WebMonad Response, FilterMonad Response
- , Happstack, MonadReader Acid')
-
-instance HasAcidState App' FooState where
- getAcidState = acidFooState' <$> ask
-fooAppPlugin :: App' Response
-fooAppPlugin = fooPlugin
-fooReaderPlugin :: ReaderT (AcidState FooState) (ServerPartT IO) Response
-fooReaderPlugin = fooPlugin
-instance HasAcidState (ReaderT (AcidState FooState) (ServerPartT IO)) FooState where
- getAcidState = ask
-withFooPlugin :: (MonadIO m, MonadBaseControl IO m) =>
- FilePath -- ^ path to state directory
- -> (ServerPartT IO Response -> m a) -- ^ function that uses fooPlugin
- -> m a
-withFooPlugin basePath f =
- do withLocalState (Just $ basePath </> "foo") initialFooState $ \fooState ->
- f $ runReaderT fooReaderPlugin fooState
-main' :: IO ()
-main' =
- withFooPlugin "_state" $ \fooPlugin' ->
- withAcid Nothing $ \acid ->
- simpleHTTP nullConf $ fooPlugin' `mplus` runApp acid page
diff --git a/tests/examplefiles/AlternatingGroup.mu b/tests/examplefiles/AlternatingGroup.mu
deleted file mode 100644
index 2cb19924..00000000
--- a/tests/examplefiles/AlternatingGroup.mu
+++ /dev/null
@@ -1,102 +0,0 @@
-/*++ $Id: AlternatingGroup.mu,v 1.4 2003/09/08 15:00:47 nthiery Exp $
-
-Dom::AlternatingGroup(n) -- the Alternating Group of {1..n}
-
-n - integer >= 1
-
-Elements are represented as in Dom::PermutationGroup(n)
-
-Author: Nicolas M. Thiry <nthiery@users.sourceforge.net>
-License: LGPL
-Created: August 8th, 1999
-Last update: $Date: 2003/09/08 15:00:47 $
-++*/
-
-domain Dom::AlternatingGroup(n: Type::PosInt)
- inherits Dom::PermutationGroup(n,toBeDefined);
- category Cat::PermutationGroup;
- axiom Ax::canonicalRep;
-
-/*--
- size
-
- Size of the group.
---*/
-
- size := fact(n)/2;
-
-/*--
- generators
-
- A list of generators of the group
-
- The first 3-cycle (1,2,3), and a maximal even cycle (1,...,n) or
- (2,...,n) depending on the parity of n
-
---*/
-
- generators :=
- if n<=2 then generators:=[dom([[1]])];
- elif n=3 then generators:=[dom([[1,2,3]])];
- elif n mod 2=0 then generators:=[dom([[1,2,3]]), dom([[$2..n]])];
- else generators:=[dom([[1,2,3]]), dom([[$1..n]])];
- end_if;
-
-/*--
- allElements
-
- List of all the elements of the group
---*/
-
- allElements :=
- proc()
- option remember;
- local p;
- begin
- [new(dom,p) $ p in select(combinat::permutations(n),
- p->bool(combinat::permutations::sign(p)=1))];
- end_proc;
-
-/*--
- cycleTypes:
-
- Count the elements of the group by cycle type.
- (Cf Cat::PermutationGroupModule).
-
- Same algorithm as for Dom::SymmetricGroup, but only even permutations
- are considered. This is done by disregarding partitions p such
- that n-length(p) is odd.
---*/
-
- cycleTypes :=
- proc()
- option remember;
- local t, p, gen;
- begin
- userinfo(3, "cycleTypes: starting computation");
- t:=table();
-
- gen := combinat::partitions::generator(n);
- while (p:=gen()) <> FAIL do
- userinfo(5, "working on partition", p);
- if(n-nops(p) mod 2=0) then
- // Compute the size of the conjugacy class of Sn indexed by p
- // and the cycle type of a permutation in this conjugacy class
- t[combinat::partitions::toExp(p,n)]
- := combinat::partitions::conjugacyClassSize(p);
- end_if;
- end_while;
- t;
- end_proc;
-
-begin
- if testargs() then
- if args(0) <> 1 then error("wrong no of args"); end_if;
- if not testtype(n,DOM_INT) then
- error("argument must be integer")
- end_if;
- if n < 1 then
- error("argument must be positive")
- end_if;
- end_if;
-end_domain:
diff --git a/tests/examplefiles/BOM.js b/tests/examplefiles/BOM.js
deleted file mode 100644
index 930599c1..00000000
--- a/tests/examplefiles/BOM.js
+++ /dev/null
@@ -1 +0,0 @@
-/* There is a BOM at the beginning of this file. */ \ No newline at end of file
diff --git a/tests/examplefiles/Blink.ino b/tests/examplefiles/Blink.ino
deleted file mode 100644
index 993bd743..00000000
--- a/tests/examplefiles/Blink.ino
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- Blink
- Turns on an LED on for one second, then off for one second, repeatedly.
-
- This example code is in the public domain.
- */
-
-// Pin 13 has an LED connected on most Arduino boards.
-// give it a name:
-int led = 13;
-
-// the setup routine runs once when you press reset:
-void setup() {
- // initialize the digital pin as an output.
- pinMode(led, OUTPUT);
-}
-
-// the loop routine runs over and over again forever:
-void loop() {
- digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(1000); // wait for a second
- digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
- delay(1000); // wait for a second
-}
diff --git a/tests/examplefiles/CPDictionary.j b/tests/examplefiles/CPDictionary.j
deleted file mode 100755
index 50243f1d..00000000
--- a/tests/examplefiles/CPDictionary.j
+++ /dev/null
@@ -1,611 +0,0 @@
-/*
- * CPDictionary.j
- * Foundation
- *
- * Created by Francisco Tolmasky.
- * Copyright 2008, 280 North, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-//@import "CPRange.j"
-@import "CPObject.j"
-@import "CPEnumerator.j"
-@import "CPException.j"
-
-/* @ignore */
-@implementation _CPDictionaryValueEnumerator : CPEnumerator
-{
- CPEnumerator _keyEnumerator;
- CPDictionary _dictionary;
-}
-
-- (id)initWithDictionary:(CPDictionary)aDictionary
-{
- self = [super init];
-
- if (self)
- {
- _keyEnumerator = [aDictionary keyEnumerator];
- _dictionary = aDictionary;
- }
-
- return self;
-}
-
-- (id)nextObject
-{
- var key = [_keyEnumerator nextObject];
-
- if (!key)
- return nil;
-
- return [_dictionary objectForKey:key];
-}
-
-@end
-
-/*!
- @class CPDictionary
- @ingroup foundation
- @brief A mutable key-value pair collection.
-
- A dictionary is the standard way of passing around key-value pairs in
- the Cappuccino framework. It is similar to the
- <a href="http://java.sun.com/javase/6/docs/api/index.html">Java map interface</a>,
- except all keys are CPStrings and values can be any
- Cappuccino or JavaScript object.
-
- If you are familiar with dictionaries in Cocoa, you'll notice that
- there is no CPMutableDictionary class. The regular CPDictionary
- has \c -setObject:forKey: and \c -removeObjectForKey: methods.
- In Cappuccino there is no distinction between immutable and mutable classes.
- They are all mutable.
-*/
-@implementation CPDictionary : CPObject
-{
-}
-
-/*
- @ignore
-*/
-+ (id)alloc
-{
- return new objj_dictionary();
-}
-
-/*!
- Returns a new empty CPDictionary.
-*/
-+ (id)dictionary
-{
- return [[self alloc] init];
-}
-
-/*!
- Returns a new dictionary, initialized with the contents of \c aDictionary.
- @param aDictionary the dictionary to copy key-value pairs from
- @return the new CPDictionary
-*/
-+ (id)dictionaryWithDictionary:(CPDictionary)aDictionary
-{
- return [[self alloc] initWithDictionary:aDictionary];
-}
-
-/*!
- Creates a new dictionary with single key-value pair.
- @param anObject the object for the paring
- @param aKey the key for the pairing
- @return the new CPDictionary
-*/
-+ (id)dictionaryWithObject:(id)anObject forKey:(id)aKey
-{
- return [[self alloc] initWithObjects:[anObject] forKeys:[aKey]];
-}
-
-/*!
- Creates a dictionary with multiple key-value pairs.
- @param objects the objects to place in the dictionary
- @param keys the keys for each of the objects
- @throws CPInvalidArgumentException if the number of objects and keys is different
- @return the new CPDictionary
-*/
-+ (id)dictionaryWithObjects:(CPArray)objects forKeys:(CPArray)keys
-{
- return [[self alloc] initWithObjects:objects forKeys:keys];
-}
-
-/*!
- Creates a dictionary with multiple key-value pairs.
- @param JavaScript object
- @return the new CPDictionary
-*/
-+ (id)dictionaryWithJSObject:(JSObject)object
-{
- return [self dictionaryWithJSObject:object recursively:NO];
-}
-
-/*!
- Creates a dictionary with multiple key-value pairs, recursively.
- @param JavaScript object
- @return the new CPDictionary
-*/
-+ (id)dictionaryWithJSObject:(JSObject)object recursively:(BOOL)recursively
-{
- var dictionary = [[self alloc] init];
-
- for (var key in object)
- {
- var value = object[key];
-
- if (recursively && value.constructor === Object)
- value = [CPDictionary dictionaryWithJSObject:value recursively:YES];
-
- [dictionary setObject:value forKey:key];
- }
-
- return dictionary;
-}
-
-/*!
- Creates and returns a dictionary constructed by a given pairs of keys and values.
- @param firstObject first object value
- @param ... key for the first object and ongoing value-key pairs for more objects.
- @throws CPInvalidArgumentException if the number of objects and keys is different
- @return the new CPDictionary
-
- Assuming that there's no object retaining in Cappuccino, you can create
- dictionaries same way as with alloc and initWithObjectsAndKeys:
- var dict = [CPDictionary dictionaryWithObjectsAndKeys:
- @"value1", @"key1",
- @"value2", @"key2"];
-
- Note, that there's no final nil like in Objective-C/Cocoa.
-
- @see [CPDictionary initWithObjectsAndKeys:]
-*/
-+ (id)dictionaryWithObjectsAndKeys:(id)firstObject, ...
-{
- arguments[0] = [self alloc];
- arguments[1] = @selector(initWithObjectsAndKeys:);
-
- return objj_msgSend.apply(this, arguments);
-}
-
-/*!
- Initializes the dictionary with the contents of another dictionary.
- @param aDictionary the dictionary to copy key-value pairs from
- @return the initialized dictionary
-*/
-- (id)initWithDictionary:(CPDictionary)aDictionary
-{
- var key = "",
- dictionary = [[CPDictionary alloc] init];
-
- for (key in aDictionary._buckets)
- [dictionary setObject:[aDictionary objectForKey:key] forKey:key];
-
- return dictionary;
-}
-
-/*!
- Initializes the dictionary from the arrays of keys and objects.
- @param objects the objects to put in the dictionary
- @param keyArray the keys for the objects to put in the dictionary
- @throws CPInvalidArgumentException if the number of objects and keys is different
- @return the initialized dictionary
-*/
-- (id)initWithObjects:(CPArray)objects forKeys:(CPArray)keyArray
-{
- self = [super init];
-
- if ([objects count] != [keyArray count])
- [CPException raise:CPInvalidArgumentException reason:"Counts are different.("+[objects count]+"!="+[keyArray count]+")"];
-
- if (self)
- {
- var i = [keyArray count];
-
- while (i--)
- [self setObject:objects[i] forKey:keyArray[i]];
- }
-
- return self;
-}
-
-/*!
- Creates and returns a dictionary constructed by a given pairs of keys and values.
- @param firstObject first object value
- @param ... key for the first object and ongoing value-key pairs for more objects.
- @throws CPInvalidArgumentException if the number of objects and keys is different
- @return the new CPDictionary
-
- You can create dictionaries this way:
- var dict = [[CPDictionary alloc] initWithObjectsAndKeys:
- @"value1", @"key1",
- @"value2", @"key2"];
-
- Note, that there's no final nil like in Objective-C/Cocoa.
-*/
-- (id)initWithObjectsAndKeys:(id)firstObject, ...
-{
- var argCount = arguments.length;
-
- if (argCount % 2 !== 0)
- [CPException raise:CPInvalidArgumentException reason:"Key-value count is mismatched. (" + argCount + " arguments passed)"];
-
- self = [super init];
-
- if (self)
- {
- // The arguments array contains self and _cmd, so the first object is at position 2.
- var index = 2;
-
- for(; index < argCount; index += 2)
- {
- var value = arguments[index];
-
- if (value === nil)
- break;
-
- [self setObject:value forKey:arguments[index + 1]];
- }
- }
-
- return self;
-}
-
-/*!
- return a copy of the receiver (does not deep copy the objects contained in the dictionary).
-*/
-- (CPDictionary)copy
-{
- return [CPDictionary dictionaryWithDictionary:self];
-}
-
-/*!
- Returns the number of entries in the dictionary
-*/
-- (int)count
-{
- return count;
-}
-
-/*!
- Returns an array of keys for all the entries in the dictionary.
-*/
-- (CPArray)allKeys
-{
- return _keys;
-}
-
-/*!
- Returns an array of values for all the entries in the dictionary.
-*/
-- (CPArray)allValues
-{
- var index = _keys.length,
- values = [];
-
- while (index--)
- values.push(dictionary_getValue(self, [_keys[index]]));
-
- return values;
-}
-
-/*!
- Returns an enumerator that enumerates over all the dictionary's keys.
-*/
-- (CPEnumerator)keyEnumerator
-{
- return [_keys objectEnumerator];
-}
-
-/*!
- Returns an enumerator that enumerates over all the dictionary's values.
-*/
-- (CPEnumerator)objectEnumerator
-{
- return [[_CPDictionaryValueEnumerator alloc] initWithDictionary:self];
-}
-
-/*!
- Compare the receiver to this dictionary, and return whether or not they are equal.
-*/
-- (BOOL)isEqualToDictionary:(CPDictionary)aDictionary
-{
- if (count !== [aDictionary count])
- return NO;
-
- var index = count;
- while (index--)
- {
- var currentKey = _keys[index],
- lhsObject = _buckets[currentKey],
- rhsObject = aDictionary._buckets[currentKey];
-
- if (lhsObject === rhsObject)
- continue;
-
- if (lhsObject.isa && rhsObject.isa && [lhsObject respondsToSelector:@selector(isEqual:)] && [lhsObject isEqual:rhsObject])
- continue;
-
- return NO;
- }
-
- return YES;
-}
-
-/*
- Instance.isEqualToDictionary(aDictionary)
- {
- if(this.count()!=aDictionary.count()) return NO;
-
- var i= this._keys.count();
- while(i--) if(this.objectForKey(this._keys[i])!=aDictionary.objectForKey(this._keys[i])) return NO;
-
- return YES;
- }
-
- Instance.allKeys()
- {
- return this._keys;
- }
-
- Instance.allKeysForObject(anObject)
- {
- var i= 0,
- keys= CPArray.array(),
- count= this.count();
-
- while((i= this._objects.indexOfObjectInRage(0, count-i))!=CPNotFound) keys.addObject(this._keys[i]);
-
- return keys;
- }
-
- Instance.allValues()
- {
- return this._objects;
- }
-
- Instance.keyEnumerator()
- {
- return this._keys.objectEnumerator();
- }
-
- Instance.keysSortedByValueUsingSelector(aSelector)
- {
- var dictionary= this,
- objectSelector= function(rhs)
- {
- return aSelector.apply(dictionary.objectForKey(this), [dictionary.objectForKey(rhs)]);
- };
-
- return this._keys.sortedArrayUsingSelector(objectSelector);
- }
-
- Instance.objectEnumerator()
- {
- return this._objects.objectEnumerator();
- }
-*/
-/*!
- Returns the object for the entry with key \c aKey.
- @param aKey the key for the object's entry
- @return the object for the entry
-*/
-- (id)objectForKey:(CPString)aKey
-{
- var object = _buckets[aKey];
-
- return (object === undefined) ? nil : object;
-}
-/*
- Instance.objectsForKeys(keys, aNotFoundMarker)
- {
- var i= keys.length,
- objects= CPArray.array();
-
- while(i--)
- {
- var object= this.objectForKey(keys[i]);
- objects.addObject(object==nil?aNotFoundMarker:object);
- }
-
- return objects;
- }
-
- Instance.valueForKey(aKey)
- {
- if(aKey.length && aKey[0]=="@") return this.objectForKey(aKey.substr(1));
-
- return base.valueForKey(aKey);
- }
-
- //
-
- Instance.addEntriesFromDictionary(aDictionary)
- {
- var key,
- keyEnumerator= aDictionary.keyEnumerator();
-
- while(key= keyEnumerator.nextObject()) this.setObjectForKey(aDictionary.objectForKey(key), key);
- }
-*/
-/*!
- Removes all the entries from the dictionary.
-*/
-- (void)removeAllObjects
-{
- _keys = [];
- count = 0;
- _buckets = {};
-}
-
-/*!
- Removes the entry for the specified key.
- @param aKey the key of the entry to be removed
-*/
-- (void)removeObjectForKey:(id)aKey
-{
- dictionary_removeValue(self, aKey);
-}
-
-/*!
- Removes each entry in allKeys from the receiver.
- @param allKeys an array of keys that will be removed from the dictionary
-*/
-- (void)removeObjectsForKeys:(CPArray)allKeys
-{
- var index = allKeys.length;
-
- while (index--)
- dictionary_removeValue(self, allKeys[index]);
-}
-
-/*
- Instance.removeObjectForKey(aKey)
- {
- var entry= this._dictionary[aKey];
-
- if(entry)
- {
- var range= CPMakeRange(entry.index, 1);
-
- this._keys.removeObjectsInRange(range);
- this._objects.removeObjectsInRange(range);
-
- delete this._dictionary[aKey];
- }
- }
-
- Instance.setDictionary(aDictionary)
- {
- this._keys= CPArray.arrayWithArray(aDictionary.allKeys());
- this._objects= CPArray.arrayWithArray(aDictionary.allValues());
-
- this._dictionary= { };
-
- var i= this._keys.count();
- while(i--) this._dictionary[this._keys[i]]= { object: this._objects[i], index: i };
- }
-*/
-/*!
- Adds an entry into the dictionary.
- @param anObject the object for the entry
- @param aKey the entry's key
-*/
-- (void)setObject:(id)anObject forKey:(id)aKey
-{
- dictionary_setValue(self, aKey, anObject);
-}
-/*
- Instance.setValueForKey(aValue, aKey)
- {
- if(!aValue) this.removeObjectForKey(aKey);
- else this.setObjectForKey(aValue, aKey);
- }
-
- Instance.copy()
- {
- return CPDictionary.alloc().dictionaryWithDictionary(this);
- }
-*/
-
-/*!
- Take all the key/value pairs in aDictionary and apply them to this dictionary.
-*/
-- (void)addEntriesFromDictionary:(CPDictionary)aDictionary
-{
- if (!aDictionary)
- return;
-
- var keys = [aDictionary allKeys],
- index = [keys count];
-
- while (index--)
- {
- var key = keys[index];
-
- [self setObject:[aDictionary objectForKey:key] forKey:key];
- }
-}
-
-/*!
- Returns a human readable description of the dictionary.
-*/
-- (CPString)description
-{
- var description = @"CPDictionary {\n";
-
- var i = _keys.length;
-
- while (i--)
- {
- description += _keys[i] + ":";
-
- var object = _buckets[_keys[i]];
-
- if (object && object.isa)
- description += [object description];
- else
- description += object;
-
- description += "\n";
- }
-
- description += "}";
-
- return description;
-}
-
-@end
-
-@implementation CPDictionary (CPCoding)
-
-/*
- Initializes the dictionary by unarchiving the data from a coder.
- @param aCoder the coder from which the data will be unarchived.
- @return the initialized dictionary
-*/
-- (id)initWithCoder:(CPCoder)aCoder
-{
- return [aCoder _decodeDictionaryOfObjectsForKey:@"CP.objects"];
-}
-
-/*!
- Archives the dictionary to a provided coder.
- @param aCoder the coder to which the dictionary data will be archived.
-*/
-- (void)encodeWithCoder:(CPCoder)aCoder
-{
- [aCoder _encodeDictionaryOfObjects:self forKey:@"CP.objects"];
-}
-
-@end
-
-/*!
- @class CPMutableDictionary
- @ingroup compatability
-
- This class is just an empty subclass of CPDictionary.
- CPDictionary already implements mutable methods and
- this class only exists for source compatability.
-*/
-@implementation CPMutableDictionary : CPDictionary
-
-@end
-
-objj_dictionary.prototype.isa = CPDictionary;
diff --git a/tests/examplefiles/Charmci.ci b/tests/examplefiles/Charmci.ci
deleted file mode 100644
index 2e5cd5c6..00000000
--- a/tests/examplefiles/Charmci.ci
+++ /dev/null
@@ -1,20 +0,0 @@
-module CkCallback {
- readonly CProxy_ckcallback_group _ckcallbackgroup;
- message CkCcsRequestMsg {
- char data[];
- };
- message CkDataMsg {
- char data[];
- };
-
- mainchare ckcallback_main {
- entry ckcallback_main(CkArgMsg *m);
- };
- group [migratable] ckcallback_group : IrrGroup {
- entry ckcallback_group();
- entry void registerCcsCallback(char name[strlen(name)+1],
- CkCallback cb);
- entry void call(CkCallback c,CkMarshalledMessage msg);
- entry void call(CkCallback c, int length, char data[length]);
- };
-};
diff --git a/tests/examplefiles/Config.in.cache b/tests/examplefiles/Config.in.cache
deleted file mode 100644
index e2f6ad5d..00000000
--- a/tests/examplefiles/Config.in.cache
+++ /dev/null
@@ -1,1973 +0,0 @@
-# INCLUDE_BEGIN Config.in
-mainmenu "Freetz Configuration"
-
-config FREETZ_HAVE_DOT_CONFIG
- bool
- default y
-
-comment "General --------------------------------"
-
-config FREETZ_AVM_VERSION_04_30
- bool
-config FREETZ_AVM_VERSION_04_33
- bool
-config FREETZ_AVM_VERSION_04_40
- bool
-config FREETZ_AVM_VERSION_04_49
- bool
-config FREETZ_AVM_VERSION_04_57
- bool
-config FREETZ_AVM_VERSION_04_67
- bool
-config FREETZ_AVM_VERSION_04_70
- bool
-config FREETZ_AVM_VERSION_04_76
- bool
-config FREETZ_AVM_VERSION_04_80
- bool
-config FREETZ_AVM_VERSION_04_87
- bool
-config FREETZ_AVM_VERSION_7270_04_86
- bool
-config FREETZ_AVM_VERSION_7270_05_05
- bool
-config FREETZ_AVM_VERSION_7320_04_86
- bool
-config FREETZ_AVM_VERSION_7390_04_90
- bool
-config FREETZ_AVM_VERSION_7390_05_05
- bool
-config FREETZ_AVM_VERSION_r7203
- bool
-
-choice
- prompt "Hardware type"
- default FREETZ_TYPE_FON_WLAN_7270_V2
- help
- Select your box type here.
-
- config FREETZ_TYPE_300IP_AS_FON
- select FREETZ_AVM_VERSION_04_49
- bool "300IP as Fon"
-
- config FREETZ_TYPE_2170
- select FREETZ_AVM_VERSION_04_57
- bool "2170"
-
- config FREETZ_TYPE_FON
- select FREETZ_AVM_VERSION_04_33 if FREETZ_TYPE_LANG_DE
- select FREETZ_AVM_VERSION_04_49 if ! FREETZ_TYPE_LANG_DE
- bool "Fon"
-
- config FREETZ_TYPE_FON_5010
- select FREETZ_AVM_VERSION_04_40
- bool "Fon 5010"
-
- config FREETZ_TYPE_FON_5050
- select FREETZ_AVM_VERSION_04_30
- bool "Fon 5050"
-
- config FREETZ_TYPE_FON_5124
- select FREETZ_AVM_VERSION_04_76
- bool "Fon 5124"
-
- config FREETZ_TYPE_FON_5140
- select FREETZ_AVM_VERSION_04_67
- bool "Fon 5140"
-
- config FREETZ_TYPE_FON_WLAN
- select FREETZ_AVM_VERSION_04_33 if FREETZ_TYPE_LANG_DE
- select FREETZ_AVM_VERSION_04_49 if ! FREETZ_TYPE_LANG_DE
- bool "Fon WLAN"
-
- config FREETZ_TYPE_FON_WLAN_7050
- select FREETZ_AVM_VERSION_04_33
- bool "Fon WLAN 7050"
-
- config FREETZ_TYPE_FON_WLAN_7112
- select FREETZ_AVM_VERSION_04_87
- bool "Fon WLAN 7112"
-
- config FREETZ_TYPE_FON_WLAN_7113
- select FREETZ_AVM_VERSION_04_80 if FREETZ_TYPE_LANG_EN
- select FREETZ_AVM_VERSION_04_67 if FREETZ_TYPE_LANG_DE
- bool "Fon WLAN 7113"
-
- config FREETZ_TYPE_FON_WLAN_7140
- select FREETZ_AVM_VERSION_04_33 if FREETZ_TYPE_LANG_DE
- select FREETZ_AVM_VERSION_04_76 if FREETZ_TYPE_LANG_A_CH
- select FREETZ_AVM_VERSION_04_67 if FREETZ_TYPE_LANG_EN
- bool "Fon WLAN 7140"
-
- config FREETZ_TYPE_FON_WLAN_7141
- select FREETZ_AVM_VERSION_04_76
- bool "Fon WLAN 7141"
-
- config FREETZ_TYPE_FON_7150
- select FREETZ_AVM_VERSION_04_70
- bool "Fon 7150"
-
- config FREETZ_TYPE_FON_WLAN_7170
- select FREETZ_AVM_VERSION_04_76 if FREETZ_TYPE_LANG_A_CH
- select FREETZ_AVM_VERSION_04_80 if FREETZ_TYPE_LANG_EN
- select FREETZ_AVM_VERSION_04_87 if FREETZ_TYPE_LANG_DE
- bool "Fon WLAN 7170"
-
- config FREETZ_TYPE_FON_WLAN_7240
- select FREETZ_AVM_VERSION_7270_05_05
- bool "Fon WLAN 7240"
-
- config FREETZ_TYPE_FON_WLAN_7270_V1
- select FREETZ_TYPE_FON_WLAN_7270
- bool "Fon WLAN 7270 v1"
-
- config FREETZ_TYPE_FON_WLAN_7270_V2
- select FREETZ_TYPE_FON_WLAN_7270
- bool "Fon WLAN 7270 v2"
-
- config FREETZ_TYPE_FON_WLAN_7270_V3
- select FREETZ_TYPE_FON_WLAN_7270
- bool "Fon WLAN 7270 v3"
-
- config FREETZ_TYPE_FON_WLAN_7320
- select FREETZ_AVM_VERSION_7320_04_86
- bool "Fon WLAN 7320"
-
- config FREETZ_TYPE_FON_WLAN_7330
- select FREETZ_AVM_VERSION_7320_04_86
- bool "Fon WLAN 7330"
-
- config FREETZ_TYPE_FON_WLAN_7340
- select FREETZ_AVM_VERSION_7390_05_05
- bool "Fon WLAN 7340"
-
- config FREETZ_TYPE_FON_WLAN_7390
- select FREETZ_AVM_VERSION_7390_05_05
- bool "Fon WLAN 7390"
-
- config FREETZ_TYPE_FON_WLAN_7570
- select FREETZ_AVM_VERSION_7270_04_86
- bool "Fon WLAN 7570 VDSL"
-
- config FREETZ_TYPE_FON_WLAN_7570_IAD
- bool "build firmware for Alice IAD 7570"
- depends on FREETZ_TYPE_FON_WLAN_7570
- comment "Hint: Use replace kernel to get max filesystem size"
- depends on FREETZ_TYPE_FON_WLAN_7570_IAD
-
- config FREETZ_TYPE_WLAN_3020
- select FREETZ_AVM_VERSION_04_33
- bool "WLAN 3020"
-
- config FREETZ_TYPE_WLAN_3030
- select FREETZ_AVM_VERSION_04_33
- bool "WLAN 3030"
-
- config FREETZ_TYPE_WLAN_3130
- select FREETZ_AVM_VERSION_04_33
- bool "WLAN 3130"
-
- config FREETZ_TYPE_WLAN_3131
- select FREETZ_AVM_VERSION_04_57
- bool "WLAN 3131"
-
- config FREETZ_TYPE_WLAN_3170
- select FREETZ_AVM_VERSION_04_57
- bool "WLAN 3170"
-
- config FREETZ_TYPE_WLAN_3270
- select FREETZ_AVM_VERSION_7270_05_05
- bool "WLAN 3270 (v1 and v2 only)"
-
- config FREETZ_TYPE_WLAN_3270_V3
- select FREETZ_AVM_VERSION_7270_05_05
- bool "WLAN 3270 (v3 only)"
-
- config FREETZ_TYPE_SPEEDPORT_W501V
- select FREETZ_AVM_VERSION_r7203
- bool "Speedport W501V"
-
- config FREETZ_TYPE_CUSTOM
- bool "Custom"
- depends on FREETZ_SHOW_ADVANCED
- select FREETZ_DL_OVERRIDE
-
-endchoice # "Hardware type" #
-
-config FREETZ_TYPE_FON_WLAN_7270
- depends on \
- FREETZ_TYPE_FON_WLAN_7270_V1 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3
- select FREETZ_AVM_VERSION_7270_04_86 if \
- FREETZ_TYPE_FON_WLAN_7270_V1
- select FREETZ_AVM_VERSION_7270_05_05 if \
- (FREETZ_TYPE_FON_WLAN_7270_V2 || FREETZ_TYPE_FON_WLAN_7270_V3)
- bool
-
-choice
- prompt "Firmware language"
- default FREETZ_TYPE_LANG_DE
-
- config FREETZ_TYPE_LANG_DE
- bool "de - deutsch"
- depends on \
- ! FREETZ_TYPE_FON_5010 && \
- ! FREETZ_TYPE_FON_5124 && \
- ! FREETZ_TYPE_FON_WLAN_7340 && \
- ! FREETZ_TYPE_FON_WLAN_7570
-
- config FREETZ_TYPE_LANG_A_CH
- bool "a-ch - deutsch"
- depends on \
- FREETZ_TYPE_FON_5010 || \
- FREETZ_TYPE_FON_WLAN_7140 || \
- FREETZ_TYPE_FON_WLAN_7170 \
-
- config FREETZ_TYPE_LANG_EN
- bool "en - international"
- depends on \
- FREETZ_TYPE_FON || \
- FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON_5124 || \
- FREETZ_TYPE_FON_WLAN || \
- FREETZ_TYPE_FON_WLAN_7113 || \
- FREETZ_TYPE_FON_WLAN_7140 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570 \
-
-endchoice # "Firmware language" #
-
-config FREETZ_TYPE_LANGUAGE
- string
- default "de" if FREETZ_TYPE_LANG_DE
- default "a-ch" if FREETZ_TYPE_LANG_A_CH
- default "en" if FREETZ_TYPE_LANG_EN
-
-config FREETZ_TYPE_LABOR
- bool "Beta/Labor"
- depends on \
- FREETZ_TYPE_LANG_DE && \
- ( \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 \
- )
- default n
- help
- Enable this to compile the mod based on an AVM "beta/labor" firmware.
-
-choice
- prompt "Labor version"
- depends on FREETZ_TYPE_LABOR
- default FREETZ_TYPE_LABOR_PREVIEW
-
-# config FREETZ_TYPE_LABOR_DSL
-# bool "DSL"
-# help
-# FRITZ!Lab DSL: This release optimizes the DSL (Digital Subscriber
-# Line) software and adds related graphs.
-
- config FREETZ_TYPE_LABOR_PREVIEW
- bool "Preview"
- depends on \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3
- help
- Labor Preview
-
-endchoice # "Labor version" #
-
-config FREETZ_TYPE_ALIEN_HARDWARE
- bool "Compile image for \"alien\" hardware"
- depends on \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7570
- default n
- help
- Enable this to compile the mod image for another hardware type
-
-choice
- prompt "Alien hardware type"
- depends on FREETZ_TYPE_ALIEN_HARDWARE
-# default FREETZ_TYPE_SINUS_W500V_7150 if FREETZ_TYPE_FON_7150
- default FREETZ_TYPE_SPEEDPORT_W701V_7170 if FREETZ_TYPE_FON_WLAN_7170
- default FREETZ_TYPE_7240_7270 if FREETZ_TYPE_FON_WLAN_7270_V2
- default FREETZ_TYPE_72702_72701 if FREETZ_TYPE_FON_WLAN_7270_V1
-
-# config FREETZ_TYPE_SINUS_W500V_7150
-# bool "Sinus W500V"
-# depends on FREETZ_TYPE_FON_7150
-# select FREETZ_MODULE_jffs2
-# help
-# Enable this to compile a mod image for T-Com Sinus W500V based
-# on a 7150 image.
-
- config FREETZ_TYPE_SPEEDPORT_W701V_7170
- bool "W701V"
- depends on FREETZ_TYPE_FON_WLAN_7170 && FREETZ_TYPE_LANG_DE
- select FREETZ_REMOVE_FTPD
- select FREETZ_REMOVE_MEDIASRV
- select FREETZ_REMOVE_PRINTSERV
- select FREETZ_REMOVE_PRINTSERV_MODULE if ! FREETZ_MODULE_usblp
- select FREETZ_REMOVE_SMBD
- help
- Enable this to compile a mod image for T-Com Speedport W701V based
- on a 7170 image.
-
- config FREETZ_TYPE_SPEEDPORT_W900V_7170
- bool "W900V"
- depends on FREETZ_TYPE_FON_WLAN_7170 && FREETZ_TYPE_LANG_DE
- help
- Enable this to compile a mod image for T-Com Speedport W900V based
- on a 7170 image.
-
- config FREETZ_TYPE_SPEEDPORT_W920V_7570
- bool "W920V"
- depends on FREETZ_TYPE_FON_WLAN_7570
- help
- Enable this to compile a mod image for T-Com Speedport W920V based
- on a 7570 image.
-
- config FREETZ_TYPE_3170_7170
- bool "3170"
- depends on FREETZ_TYPE_FON_WLAN_7170
- select FREETZ_REMOVE_VOIPD
- select FREETZ_REMOVE_VOIP_ISDN
- select FREETZ_REMOVE_CAPIOVERTCP
- help
- Enable this to compile a mod image for FritzBox FON WLAN 3170 based
- on a 7170 image.
-
- config FREETZ_TYPE_7112_7170
- bool "7112"
- depends on FREETZ_TYPE_FON_WLAN_7170
- select FREETZ_REMOVE_FTPD
- select FREETZ_REMOVE_MEDIASRV
- select FREETZ_REMOVE_PRINTSERV
- select FREETZ_REMOVE_PRINTSERV_MODULE if ! FREETZ_MODULE_usblp
- select FREETZ_REMOVE_SMBD
- help
- Enable this to compile a mod image for FritzBox Fon WLAN 7112 based
- on a 7170 image.
-
- config FREETZ_TYPE_7113_7170
- bool "7113"
- depends on FREETZ_TYPE_FON_WLAN_7170
- select FREETZ_REMOVE_FTPD
- select FREETZ_REMOVE_MEDIASRV
- select FREETZ_REMOVE_PRINTSERV
- select FREETZ_REMOVE_PRINTSERV_MODULE if ! FREETZ_MODULE_usblp
- select FREETZ_REMOVE_SMBD
- help
- Enable this to compile a mod image for FritzBox Fon WLAN 7113 based
- on a 7170 image.
-
- config FREETZ_TYPE_7140_7170
- bool "7140"
- depends on FREETZ_TYPE_FON_WLAN_7170
- help
- Enable this to compile a mod image for FritzBox FON WLAN 7140 based
- on a 7170 image.
-
- config FREETZ_TYPE_7141_7170
- bool "7141"
- depends on FREETZ_TYPE_FON_WLAN_7170
- help
- Enable this to compile a mod image for FritzBox FON WLAN 7141 based
- on a 7170 image.
-
- config FREETZ_TYPE_7240_7270
- bool "7240"
- depends on FREETZ_TYPE_FON_WLAN_7270_V2 || FREETZ_TYPE_FON_WLAN_7270_V3
- help
- Enable this to compile a mod image for FritzBox FON WLAN 7240 based
- on a 7270 image.
-
- config FREETZ_TYPE_7270_7270
- bool "7270 v1"
- depends on FREETZ_TYPE_FON_WLAN_7270_V2 && FREETZ_REPLACE_KERNEL_AVAILABLE
- select FREETZ_REPLACE_KERNEL
-# select FREETZ_REMOVE_AVM_VPN
-# select FREETZ_REMOVE_CAPIOVERTCP
-# select FREETZ_REMOVE_NTFS
-# select FREETZ_REMOVE_SMBD
-# select FREETZ_REMOVE_UMTSD
-# select FREETZ_REMOVE_VOIPD
-# select FREETZ_REMOVE_VOIP_ISDN
-# select FREETZ_REMOVE_WEBDAV
- help
- Enable this to compile a mod image for FritzBox FON WLAN 7270 v1 based
- on a 7270 v2 image.
-
- Caution: To fit into 8MB ROM some AVM components (e.g. telephony) have
- to be removed. Please use usbroot for a full featured image.
-
- config FREETZ_TYPE_72702_72701
- bool "7270 v2"
- depends on FREETZ_TYPE_FON_WLAN_7270_V1 && FREETZ_REPLACE_KERNEL_AVAILABLE
- help
- Enable this to compile a mod image for FritzBox FON WLAN 7270 v2 based
- on a 7270 v1 image.
-
- config FREETZ_TYPE_IAD_3331_7170
- bool "Alice IAD 3331"
- depends on FREETZ_TYPE_FON_WLAN_7170 && FREETZ_TYPE_LANG_DE
- select FREETZ_REMOVE_PIGLET_V1 if FREETZ_SHOW_ADVANCED
- select FREETZ_ENFORCE_URLADER_SETTINGS
- help
- Enable this to compile a mod image for Alice IAD 3331 based
- on a 7170 image.
- The firmware_version has to be enforced, because this variable is unset
- in the 7170_HN bootloader.
- Initial flashing might only be possible via ./tools/push_firmware
-
-endchoice # "Alien hardware type" #
-
-config FREETZ_AVM_VERSION_STRING
- string
- default "04.30" if FREETZ_AVM_VERSION_04_30
- default "04.33" if FREETZ_AVM_VERSION_04_33
- default "04.40" if FREETZ_AVM_VERSION_04_40
- default "04.49" if FREETZ_AVM_VERSION_04_49
- default "04.57" if FREETZ_AVM_VERSION_04_57
- default "04.67" if FREETZ_AVM_VERSION_04_67
- default "04.70" if FREETZ_AVM_VERSION_04_70
- default "04.76" if FREETZ_AVM_VERSION_04_76
- default "04.80" if FREETZ_AVM_VERSION_04_80
- default "04.87" if FREETZ_AVM_VERSION_04_87
- default "7270_04.86" if FREETZ_AVM_VERSION_7270_04_86
- default "7270_05.05" if FREETZ_AVM_VERSION_7270_05_05
- default "7320_04.86" if FREETZ_AVM_VERSION_7320_04_86
- default "7390_04.90" if FREETZ_AVM_VERSION_7390_04_90
- default "7390_05.05" if FREETZ_AVM_VERSION_7390_05_05
- default "r7203" if FREETZ_AVM_VERSION_r7203
-
-
-choice
- prompt "Annex"
- depends on FREETZ_TYPE_LANG_EN && \
- ! FREETZ_TYPE_FON_WLAN_7113 && \
- ! FREETZ_TYPE_FON_WLAN_7270 && \
- ! FREETZ_TYPE_FON_WLAN_7340 && \
- ! FREETZ_TYPE_FON_WLAN_7390 && \
- ! FREETZ_TYPE_FON_WLAN_7570
- default FREETZ_TYPE_ANNEX_B
-
- config FREETZ_TYPE_ANNEX_A
- bool "A"
-
- config FREETZ_TYPE_ANNEX_B
- bool "B"
-
-endchoice # prompt "Annex" #
-
-config FREETZ_TYPE_PREFIX
- string
- default "300ip_as_fon" if FREETZ_TYPE_300IP_AS_FON
- default "2170" if FREETZ_TYPE_2170
- default "3020" if FREETZ_TYPE_WLAN_3020
- default "3030" if FREETZ_TYPE_WLAN_3030
- default "3130" if FREETZ_TYPE_WLAN_3130
- default "3131" if FREETZ_TYPE_WLAN_3131
- default "3170" if FREETZ_TYPE_WLAN_3170
- default "3270" if FREETZ_TYPE_WLAN_3270
- default "3270_v3" if FREETZ_TYPE_WLAN_3270_V3
- default "fon" if FREETZ_TYPE_FON
- default "5010" if FREETZ_TYPE_FON_5010
- default "5050" if FREETZ_TYPE_FON_5050
- default "5124" if FREETZ_TYPE_FON_5124
- default "5140" if FREETZ_TYPE_FON_5140
- default "fon_wlan" if FREETZ_TYPE_FON_WLAN
- default "7050" if FREETZ_TYPE_FON_WLAN_7050
- default "7112" if FREETZ_TYPE_FON_WLAN_7112
- default "7113" if FREETZ_TYPE_FON_WLAN_7113
- default "7140" if FREETZ_TYPE_FON_WLAN_7140
- default "7141" if FREETZ_TYPE_FON_WLAN_7141
- default "7150" if FREETZ_TYPE_FON_7150
- default "7170" if FREETZ_TYPE_FON_WLAN_7170
- default "7240" if FREETZ_TYPE_FON_WLAN_7240 && ! FREETZ_TYPE_LABOR
-# default "7240_preview" if FREETZ_TYPE_FON_WLAN_7240 && FREETZ_TYPE_LABOR_PREVIEW
- default "7270_v1" if FREETZ_TYPE_FON_WLAN_7270_V1 && ! FREETZ_TYPE_LABOR
-# default "7270_v1_preview" if FREETZ_TYPE_FON_WLAN_7270_V1 && FREETZ_TYPE_LABOR_PREVIEW
- default "7270_v2" if ( ( FREETZ_TYPE_FON_WLAN_7270_V2 && ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7270_7270 ) && \
- ! FREETZ_TYPE_LABOR
- default "7270_v2_preview" if ( ( FREETZ_TYPE_FON_WLAN_7270_V2 && ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7270_7270 ) && \
- FREETZ_TYPE_LABOR_PREVIEW
- default "7270_v3" if ( ( FREETZ_TYPE_FON_WLAN_7270_V3 && ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7240_7270 ) && \
- ! FREETZ_TYPE_LABOR
- default "7270_v3_preview" if ( ( FREETZ_TYPE_FON_WLAN_7270_V3 && ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7240_7270 ) && \
- FREETZ_TYPE_LABOR_PREVIEW
- default "7320" if FREETZ_TYPE_FON_WLAN_7320 && ! FREETZ_TYPE_LABOR
- default "7330" if FREETZ_TYPE_FON_WLAN_7330
- default "7340" if FREETZ_TYPE_FON_WLAN_7340
- default "7390" if FREETZ_TYPE_FON_WLAN_7390 && ! FREETZ_TYPE_LABOR
- default "7390_preview" if FREETZ_TYPE_FON_WLAN_7390 && FREETZ_TYPE_LABOR_PREVIEW
- default "7570" if FREETZ_TYPE_FON_WLAN_7570
- default "W501V" if FREETZ_TYPE_SPEEDPORT_W501V
- default "custom" if FREETZ_TYPE_CUSTOM
-
-config FREETZ_TYPE_PREFIX_ALIEN_HARDWARE
- string
- default "W500V_" if FREETZ_TYPE_SINUS_W500V_7150
- default "W701V_" if FREETZ_TYPE_SPEEDPORT_W701V_7170
- default "W900V_" if FREETZ_TYPE_SPEEDPORT_W900V_7170
- default "W920V_" if FREETZ_TYPE_SPEEDPORT_W920V_7570
- default "3170_" if FREETZ_TYPE_3170_7170
- default "7112_" if FREETZ_TYPE_7112_7170
- default "7113_" if FREETZ_TYPE_7113_7170
- default "7140_" if FREETZ_TYPE_7140_7170
- default "7141_" if FREETZ_TYPE_7141_7170
- default "7240_" if FREETZ_TYPE_7240_7270
-
-comment "Custom options -------------------------"
- depends on FREETZ_TYPE_CUSTOM
-
-config FREETZ_INSTALL_BASE
- bool
- select FREETZ_PACKAGE_MOD
- select FREETZ_PACKAGE_HASERL
- select FREETZ_LIB_ld_uClibc
- select FREETZ_LIB_libcrypt
- select FREETZ_LIB_libdl
- select FREETZ_LIB_libgcc_s
- select FREETZ_LIB_libm
- select FREETZ_LIB_libnsl
- select FREETZ_LIB_libpthread
- select FREETZ_LIB_librt
- select FREETZ_LIB_libuClibc
- select FREETZ_LIB_libfreetz if FREETZ_HAS_USB_HOST
- default y
- help
- This is mandatory
-
-config FREETZ_REPLACE_BUSYBOX
- bool
- select FREETZ_BUSYBOX_REALPATH
- default y
- help
- This is mandatory
-
-config FREETZ_SHOW_ADVANCED
- bool "Show advanced options"
- default n
- help
- Show advanced Options for patching the firmware. This is only useful
- for experienced users who really know what they are doing
-
-if FREETZ_SHOW_ADVANCED
-
-comment "Replace kernel (currently not available)"
- depends on ! FREETZ_REPLACE_KERNEL_AVAILABLE
-
-config FREETZ_REPLACE_KERNEL_AVAILABLE
- bool
- depends on \
- ! (FREETZ_TYPE_FON && FREETZ_TYPE_LANG_EN) && \
- ! FREETZ_TYPE_LABOR
- default y
-
-config FREETZ_REPLACE_KERNEL
- bool "Replace kernel"
- depends on FREETZ_REPLACE_KERNEL_AVAILABLE
- select FREETZ_MODULE_fuse if ( \
- FREETZ_AVM_VERSION_7270_04_86 || \
- FREETZ_AVM_VERSION_7270_05_05 || \
- FREETZ_AVM_VERSION_7320_04_86 || \
- FREETZ_AVM_VERSION_7390_04_90 || \
- FREETZ_AVM_VERSION_7390_05_05 \
- )
- select FREETZ_MODULE_jffs2 if FREETZ_AVM_VERSION_7320_04_86
- select FREETZ_MODULE_msdos if FREETZ_AVM_VERSION_7270_05_05
- select FREETZ_MODULE_usbcore if \
- FREETZ_KERNEL_LAYOUT_UR8 && FREETZ_AVM_VERSION_7270_04_86
- select FREETZ_MODULE_vfat if FREETZ_AVM_VERSION_7270_05_05
- default n
- help
- Replace AVM kernel with self-built kernel.
-
-endif # FREETZ_SHOW_ADVANCED #
-
-comment "Hint: Select build toolchain if you want to enable IPv6 support"
- depends on \
- ( \
- FREETZ_HAS_AVM_IPV6 || \
- (FREETZ_SHOW_ADVANCED && FREETZ_REPLACE_KERNEL_AVAILABLE) \
- ) && \
- (FREETZ_TARGET_UCLIBC_VERSION_0_9_28 && FREETZ_DOWNLOAD_TOOLCHAIN)
-
-config FREETZ_TARGET_IPV6_SUPPORT
- bool "Enable IPv6 support"
- depends on \
- ( \
- FREETZ_HAS_AVM_IPV6 || \
- (FREETZ_SHOW_ADVANCED && FREETZ_REPLACE_KERNEL_AVAILABLE) \
- ) && \
- ! (FREETZ_TARGET_UCLIBC_VERSION_0_9_28 && FREETZ_DOWNLOAD_TOOLCHAIN)
- select FREETZ_REPLACE_KERNEL if ! (FREETZ_HAS_AVM_IPV6)
- select FREETZ_MODULE_ipv6 if ! (FREETZ_HAS_AVM_IPV6) && FREETZ_REPLACE_KERNEL
- select FREETZ_BUSYBOX_IP
- select FREETZ_BUSYBOX_FEATURE_IP_ADDRESS
- select FREETZ_BUSYBOX_FEATURE_IP_LINK
- select FREETZ_BUSYBOX_FEATURE_IP_ROUTE
- select FREETZ_BUSYBOX_FEATURE_IP_TUNNEL
- default n
- help
- Copies the ipv6 kernel module to the firmware and enables ipv6 support
- in uClibc and busybox.
- Shows additional options for busybox and iptables and other packages.
- To use IPv6 with Fritz!Box, at least the kernel, ucLibc and busybox
- have to be recompiled with IPv6 enabled.
- The toolchain will automatically be rebuild to achieve this.
- It is also recommended to include the package iptables/ip6tables for
- firewall settings.
-
-config FREETZ_TARGET_REF_4MB
- bool
- default y if \
- FREETZ_TYPE_2170 || \
- FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON || \
- FREETZ_TYPE_FON_5010 || \
- FREETZ_TYPE_FON_5050 || \
- FREETZ_TYPE_FON_5140 || \
- FREETZ_TYPE_FON_WLAN || \
- FREETZ_TYPE_FON_WLAN_7050 || \
- FREETZ_TYPE_SPEEDPORT_W501V || \
- FREETZ_TYPE_WLAN_3020 || \
- FREETZ_TYPE_WLAN_3030 || \
- FREETZ_TYPE_WLAN_3130 || \
- FREETZ_TYPE_WLAN_3131 || \
- FREETZ_TYPE_WLAN_3170
-
-config FREETZ_TARGET_REF_8MB
- bool
- default y if \
- FREETZ_TYPE_FON_5124 || \
- FREETZ_TYPE_FON_WLAN_7112 || \
- FREETZ_TYPE_FON_WLAN_7113 || \
- FREETZ_TYPE_FON_WLAN_7141 || \
- FREETZ_TYPE_FON_WLAN_7140 || \
- FREETZ_TYPE_FON_7150 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- ( FREETZ_TYPE_FON_WLAN_7270_V1 && ! FREETZ_TYPE_72702_72701 )
-
-config FREETZ_TARGET_REF_16MB
- bool
- default y if \
- FREETZ_TYPE_FON_WLAN_7240 || \
- ( FREETZ_TYPE_FON_WLAN_7270_V1 && FREETZ_TYPE_72702_72701 ) || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
-
-config FREETZ_TARGET_REF
- string "Target ref" if FREETZ_TYPE_CUSTOM
- default "4mb" if FREETZ_TARGET_REF_4MB
- default "8mb" if FREETZ_TARGET_REF_8MB
- default "16mb" if FREETZ_TARGET_REF_16MB
-
-config FREETZ_KERNEL_REF_4MB
- bool
- default y if \
- FREETZ_TYPE_2170 || \
- FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON || \
- FREETZ_TYPE_FON_5010 || \
- FREETZ_TYPE_FON_5050 || \
- FREETZ_TYPE_FON_5140 || \
- FREETZ_TYPE_FON_WLAN || \
- FREETZ_TYPE_FON_WLAN_7050 || \
- FREETZ_TYPE_SPEEDPORT_W501V || \
- FREETZ_TYPE_WLAN_3020 || \
- FREETZ_TYPE_WLAN_3030 || \
- FREETZ_TYPE_WLAN_3130 || \
- FREETZ_TYPE_WLAN_3131 || \
- FREETZ_TYPE_WLAN_3170
-
-config FREETZ_KERNEL_REF_8MB
- bool
- default y if \
- FREETZ_TYPE_FON_5124 || \
- FREETZ_TYPE_FON_WLAN_7112 || \
- FREETZ_TYPE_FON_WLAN_7113 || \
- FREETZ_TYPE_FON_WLAN_7141 || \
- FREETZ_TYPE_FON_WLAN_7140 || \
- FREETZ_TYPE_FON_7150 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- (FREETZ_TYPE_FON_WLAN_7270_V1 && ! FREETZ_TYPE_72702_72701)
-
-config FREETZ_KERNEL_REF_16MB
- bool
- default y if \
- FREETZ_TYPE_FON_WLAN_7240 || \
- (FREETZ_TYPE_FON_WLAN_7270_V1 && FREETZ_TYPE_72702_72701) || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
-
-config FREETZ_KERNEL_REF
- string "Kernel ref" if FREETZ_TYPE_CUSTOM
- default "4mb" if FREETZ_KERNEL_REF_4MB
- default "8mb" if FREETZ_KERNEL_REF_8MB
- default "16mb" if FREETZ_KERNEL_REF_16MB
-
-config FREETZ_KERNEL_MTD_SIZE
- int "Kernel (64K blocks)" if FREETZ_TYPE_CUSTOM
- default 119 if \
- FREETZ_TYPE_FON_5124 || \
- FREETZ_TYPE_FON_7150 || \
- FREETZ_TYPE_FON_WLAN_7112 || \
- FREETZ_TYPE_FON_WLAN_7113 || \
- FREETZ_TYPE_FON_WLAN_7140 || \
- FREETZ_TYPE_FON_WLAN_7141 || \
- (FREETZ_TYPE_FON_WLAN_7170 && ! FREETZ_TYPE_3170_7170) || \
- (FREETZ_TYPE_FON_WLAN_7270_V1 && ! FREETZ_TYPE_72702_72701) || \
- FREETZ_TYPE_7270_7270
- default 122 if \
- FREETZ_TYPE_FON_WLAN_7570_IAD && ! FREETZ_REPLACE_KERNEL
- default 238 if \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390
- default 244 if \
- FREETZ_TYPE_FON_WLAN_7570_IAD && FREETZ_REPLACE_KERNEL
- default 246 if \
- FREETZ_TYPE_FON_WLAN_7240 || \
- (FREETZ_TYPE_FON_WLAN_7270_V1 && FREETZ_TYPE_72702_72701) || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- (FREETZ_TYPE_FON_WLAN_7570 && ! FREETZ_TYPE_FON_WLAN_7570_IAD) || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default 59
- help
- Number of 64K blocks in the kernel mtd device.
-
-config FREETZ_HAS_AVM_AURA_USB
- bool "Has remote USB connection (AURA = AVM USB Remote-Architcture)" if FREETZ_TYPE_CUSTOM
- select FREETZ_REMOVE_AURA_USB if ! FREETZ_HAS_USB_HOST
- default y if \
- FREETZ_HAS_USB_HOST || \
- FREETZ_TYPE_SPEEDPORT_W701V_7170 || \
- FREETZ_TYPE_7112_7170 || \
- FREETZ_TYPE_7113_7170
- default n
- help
- Select this if your original firmware has an aura-usb-daemon (remote USB
- connection, USB-Fernanschluss)
-
-config FREETZ_HAS_AVM_MINID
- bool "Has mini-daemon (minid)" if FREETZ_TYPE_CUSTOM
- select FREETZ_REMOVE_MINID if \
- FREETZ_TYPE_7113_7170 || \
- FREETZ_TYPE_7112_7170 || \
- FREETZ_TYPE_3170_7170 || \
- FREETZ_TYPE_SPEEDPORT_W701V_7170
- default y if \
- FREETZ_TYPE_FON_WLAN_7141 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default n
- help
- Select this if your original firmware has a mini-daemon (minid)
-
-config FREETZ_HAS_AVM_NTFS
- bool "Has AVM NTFS" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default n
- help
- Select this if your original firmware has ntfs support.
-
-config FREETZ_HAS_AVM_IPV6
- bool "Has AVM IPv6" if FREETZ_TYPE_CUSTOM
- select FREETZ_TARGET_IPV6_SUPPORT
- default y if \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default n
- help
- Select this if your original firmware has IPv6 support.
-
-config FREETZ_HAS_AVM_WEBDAV
- bool "Has AVM WebDAV" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default n
- help
- Select this if your original firmware has WebDAV support.
-
-config FREETZ_HAS_AVM_INETD
- bool "Has AVM inetd" if FREETZ_TYPE_CUSTOM
- select FREETZ_PACKAGE_INETD
- default y if \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570
- default n
- help
- Select this if your original firmware has inetd support.
-
-config FREETZ_HAS_AVM_EXT3
- bool "Has AVM ext3 built into the kernel" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7390
- default n
- help
- Select this if your original firmware has ext3 support into the kernel.
-
-config FREETZ_HAS_AVM_TR069
- bool "Has AVM tr069" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON || \
- FREETZ_TYPE_FON_5124 || \
- FREETZ_TYPE_FON_WLAN || \
- FREETZ_TYPE_FON_WLAN_7050 || \
- FREETZ_TYPE_FON_WLAN_7113 || \
- FREETZ_TYPE_FON_WLAN_7140 || \
- FREETZ_TYPE_FON_WLAN_7141 || \
- FREETZ_TYPE_FON_7150 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570 || \
- FREETZ_TYPE_WLAN_3020 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default n
- help
- Select this if your original firmware has tr069 support (libtr069, libtr064).
-
-config FREETZ_HAS_CHRONYD
- bool "Has chronyd" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570
- default n
- help
- Select this if you have a box with chronyd.
-
-config FREETZ_HAS_DECT
- bool "Has DECT" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_FON_7150 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570 || \
- FREETZ_TYPE_SPEEDPORT_W900V_7170
- default n
- help
- Select this if you have a box with DECT.
-
-config FREETZ_HAS_OPENSSL_LIBS
- bool "Has libssl" if FREETZ_TYPE_CUSTOM
- default n if \
- FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON_5010 || \
- FREETZ_TYPE_FON_5050 || \
- FREETZ_TYPE_FON_WLAN || \
- FREETZ_TYPE_FON_WLAN_7050 || \
- FREETZ_TYPE_FON_WLAN_7140 || \
- FREETZ_TYPE_SPEEDPORT_W501V || \
- FREETZ_TYPE_WLAN_3020 || \
- FREETZ_TYPE_WLAN_3030
- default y
- help
- Select this if you have a box with AVM libcrypto and libssl.
-
-config FREETZ_HAS_LSOF
- bool "Has lsof" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default n
- help
- Select this if you have a box with lsof binary.
-
-config FREETZ_HAS_NAS
- bool "Has NAS" if FREETZ_TYPE_CUSTOM
- select FREETZ_BUSYBOX_TAR_OLDGNU_COMPATIBILITY
- default y if \
- ( \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3 \
- )
- default n
- help
- Select this if you have a box with NAS support.
-
-config FREETZ_HAS_PHONE
- bool "Has Phone" if FREETZ_TYPE_CUSTOM
- default n if \
- FREETZ_TYPE_2170 || \
- FREETZ_TYPE_WLAN_3020 || \
- FREETZ_TYPE_WLAN_3030 || \
- FREETZ_TYPE_WLAN_3130 || \
- FREETZ_TYPE_WLAN_3131 || \
- FREETZ_TYPE_WLAN_3170 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default y
- help
- Select this if you have a box with phone support.
-
-config FREETZ_HAS_STRACE
- bool "Has strace" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default n
- help
- Select this if you have a box with strace binary.
-
-config FREETZ_HAS_TAM
- bool "Has TAM" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_FON_7150 || \
- FREETZ_TYPE_FON_WLAN_7141 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570
- default n
- help
- Select this if you have a box with TAM (Telephone Answering Machine) support.
-
-config FREETZ_HAS_UDEV
- bool "udev" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default n
- help
- Select this if you have a box with udev.
-
-config FREETZ_HAS_USB_CLIENT
- bool "USB client" if FREETZ_TYPE_CUSTOM
- default y if \
- FREETZ_TYPE_2170 || \
- FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON || \
- FREETZ_TYPE_FON_5050 || \
- FREETZ_TYPE_FON_WLAN || \
- FREETZ_TYPE_FON_WLAN_7050 || \
- FREETZ_TYPE_WLAN_3020 || \
- FREETZ_TYPE_WLAN_3030 || \
- FREETZ_TYPE_WLAN_3131 || \
- FREETZ_TYPE_WLAN_3170
- default n
- help
- Select this if you have a box with USB.
-
-config FREETZ_HAS_USB_HOST
- bool "USB host" if FREETZ_TYPE_CUSTOM
- default n if \
- FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON || \
- FREETZ_TYPE_FON_5010 || \
- FREETZ_TYPE_FON_5050 || \
- FREETZ_TYPE_FON_5140 || \
- FREETZ_TYPE_FON_WLAN || \
- FREETZ_TYPE_FON_WLAN_7050 || \
- FREETZ_TYPE_FON_WLAN_7112 || \
- FREETZ_TYPE_7112_7170 || \
- FREETZ_TYPE_FON_WLAN_7113 || \
- FREETZ_TYPE_7113_7170 || \
- FREETZ_TYPE_WLAN_3020 || \
- FREETZ_TYPE_WLAN_3030 || \
- FREETZ_TYPE_SINUS_W500V_7150 || \
- FREETZ_TYPE_SPEEDPORT_W501V || \
- FREETZ_TYPE_SPEEDPORT_W701V_7170
- default y
- help
- Select this if your USB port is a host adapter.
-
-config FREETZ_HAS_USB_HOST_AVM
- bool "AVM USB host" if FREETZ_TYPE_CUSTOM
- depends on FREETZ_HAS_USB_HOST
- default y if \
- FREETZ_TYPE_2170 || \
- FREETZ_TYPE_FON_5124 || \
- FREETZ_TYPE_FON_7150 || \
- FREETZ_TYPE_FON_WLAN_7141 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_WLAN_3130 || \
- FREETZ_TYPE_WLAN_3131 || \
- FREETZ_TYPE_WLAN_3170
- default n
- help
- Select this if you have a box with AVM USB host.
-
-config FREETZ_HAS_AVM_E2FSPROGS
- bool "Has AVM e2fsprogs files" if FREETZ_TYPE_CUSTOM
- default y if\
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
- default n
- help
- Select this if you have a firmware with blkid, fsck and mkfs.
-
-config FREETZ_HAS_WLAN
- bool "Has WLAN" if FREETZ_TYPE_CUSTOM
- default n if \
- FREETZ_TYPE_2170 || \
- FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON || \
- FREETZ_TYPE_FON_5010 || \
- FREETZ_TYPE_FON_5050 || \
- FREETZ_TYPE_FON_5124 || \
- FREETZ_TYPE_FON_5140
- default y
- help
- Select this if you have a box with WLAN.
-
-comment "Mod ------------------------------------"
-
-choice
- prompt "Freetz Language"
- default FREETZ_LANG_DE if FREETZ_TYPE_LANG_DE
- default FREETZ_LANG_DE if FREETZ_TYPE_LANG_A_CH
- default FREETZ_LANG_EN if FREETZ_TYPE_LANG_EN
-
- config FREETZ_LANG_DE
- bool "de - deutsch"
-
- config FREETZ_LANG_EN
- bool "en - english"
-
-endchoice # "Freetz Language" #
-
-config FREETZ_LANG_STRING
- string
- default "de" if FREETZ_LANG_DE
- default "en" if FREETZ_LANG_EN
-
-menu "Patches"
-
-# INCLUDE_BEGIN patches/Config.in
-comment "Web menu patches -----------------------"
-
-config FREETZ_PATCH_VCC
- bool "Patch 2nd VCC"
- depends on FREETZ_HAS_PHONE && FREETZ_TYPE_LANG_DE
- default n
- help
- Patches the setting for 2nd VCC into web menu. It also adds two additional
- settings (PCR & SCR) not available in the original AVM firmware.
-
- Please also note that it is not possible to change the value of traffic_class
- setting via the web-interface. You have to do it some other way (e.g. using
- FBEditor or nvi ar7.cfg).
-
- Warning: Please read up on what each VCC setting means before setting/changing it.
- Besides not working wrong values may cause additional costs for you as your provider
- may treat it as simultaneous dial-in attempts (Doppeleinwahl).
-
- The correct values for an 1&1-Komplettanschluss are:
- VPI = 1;
- VCI = 35;
- traffic_class = atm_traffic_class_CBR;
- pcr = 603;
- scr = 0;
-
-config FREETZ_PATCH_ATA
- bool "Patch ATA"
- depends on \
- FREETZ_TYPE_SPEEDPORT_W501V
- default n
- help
- Patches the ATA mode configuration pages into the web menu.
-
-config FREETZ_PATCH_ENUM
- bool "Patch enum"
- depends on \
- FREETZ_TYPE_LANG_DE && \
- ( \
- FREETZ_TYPE_FON || \
- FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON_5050 || \
- FREETZ_TYPE_FON_WLAN || \
- FREETZ_TYPE_FON_WLAN_7050 || \
- FREETZ_TYPE_FON_WLAN_7140 \
- )
- default n
- help
- Patches the enum configuration pages into the web menu.
-
-config FREETZ_PATCH_DSL_EXPERT
- bool
-# bool "Patch extended DSL settings"
- depends on \
- ! FREETZ_TYPE_LABOR_DSL && \
- ! FREETZ_REMOVE_DSLD && \
- FREETZ_TYPE_LANG_DE && \
- ( \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320 \
- )
- default n
- help
- Patches the extended dsl-settings from labor-dsl into all-in-one-firmwares.
-
-config FREETZ_ADD_REGEXT_GUI
- bool "Patch GUI to enable external SIP connections"
- depends on \
- FREETZ_TYPE_FON_WLAN_7570 || \
- ( \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7390 \
- ) && FREETZ_TYPE_LANG_DE
- default n
- help
- Patches the WebUI and add a checkbox to enable setting "reg_from_outside" in the voip.conf.
-
-#config FREETZ_PATCH_INTERNATIONAL
-# bool "Patch international"
-# depends on FREETZ_HAS_PHONE && FREETZ_TYPE_LANG_DE
-# default y
-# help
-# Reveals some options from the international firmware in the web menu.
-
-config FREETZ_PATCH_ALARMCLOCK
- bool "Patch third alarm-clock"
- depends on ( \
- FREETZ_TYPE_FON_WLAN_7150 || \
- FREETZ_TYPE_FON_WLAN_7112 || \
- FREETZ_TYPE_FON_WLAN_7141 || \
- (FREETZ_TYPE_FON_WLAN_7170 && FREETZ_TYPE_LANG_DE) || \
- FREETZ_TYPE_FON_WLAN_7270_V1 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7570 \
- )
- default n
- help
- Adds a third alarm-clock to AVM-Webinterface
-
-config FREETZ_PATCH_SIGNED
- bool "Patch web menu signed message"
- default n
- help
- Hides the "unsupported changes" message from the web interface.
-
-if FREETZ_HAS_USB_HOST
-comment "USB storage patches --------------------"
-
-config FREETZ_PATCH_FREETZMOUNT
- bool "FREETZMOUNT: Patch AVMs hotplug scripts, USB storage names, ..."
- select FREETZ_USBSTORAGE_AUTOMOUNT
- select FREETZ_BUSYBOX_BLKID if FREETZ_REMOVE_AVM_E2FSPROGS || ! FREETZ_HAS_AVM_E2FSPROGS
- select FREETZ_BUSYBOX_BLKID_TYPE if FREETZ_REMOVE_AVM_E2FSPROGS || ! FREETZ_HAS_AVM_E2FSPROGS
- select FREETZ_BUSYBOX_VOLUMEID
- default y
- help
- 1. Replaces and deselects usb-storage patch.
- - The names of USB storage directories can be defined by WebIF (default uStorXY) (or by volume LABEL).
- 2. Replaces and deselects autorun.sh/autoend.sh patch.
- - autorun/autoend behaviour can be activated/deactivated via WebIF.
- - autorun/autoend are useful to start/terminate applications located on USB devices, eg
- apache, samba or even swapfiles, after connecting or before disconnecting of USB devices.
- 3. Auto-mounted USB storage devices will be fully accessible, eg it is now possible to put
- user home directories for (e.g. for FTP) on a FAT32-formatted partition and permit shell
- and FTP users to actually write to their own home directories.
- 4. Avoid deleting whole filesystems on USB devices.
- 5. Enhanced behaviour during mounting and unmounting.
- 6. Provides mount-by-label feature.
-
- It is highly recommended to select this patch.
-
-config FREETZ_USBSTORAGE_AUTOMOUNT
- bool "Automount filesystems"
- depends on FREETZ_PATCH_FREETZMOUNT
- default y
- help
- The filesystems ext2, ext3, ext4, fat, hfs, hfs+, ntfs and reiserfs and swap are mounted
- automatically. Detection is done by blkid utility . It depends on the original firmware
- which of the following points you have to select.
-
-if FREETZ_USBSTORAGE_AUTOMOUNT
-config FREETZ_AUTOMOUNT_EXT2
- bool "ext2"
- select FREETZ_BUSYBOX_VOLUMEID_EXT
- select FREETZ_MODULE_ext2
- default n
- help
- This adds ext2 module to your firmware.
-
-config FREETZ_AUTOMOUNT_EXT3
- bool "ext3"
- select FREETZ_BUSYBOX_VOLUMEID_EXT
- select FREETZ_MODULE_ext3 if ! FREETZ_HAS_AVM_EXT3
- default n
- help
- This adds ext3 module to your firmware.
-
-config FREETZ_AUTOMOUNT_EXT4
- bool "ext4"
- depends on FREETZ_KERNEL_VERSION_2_6_28 || \
- FREETZ_KERNEL_VERSION_2_6_32
- select FREETZ_BUSYBOX_VOLUMEID_EXT
- select FREETZ_MODULE_ext4
- default n
- help
- This adds ext4 module to your firmware.
-
-config FREETZ_AUTOMOUNT_FAT
- bool "fat"
- select FREETZ_BUSYBOX_VOLUMEID_FAT
- default n
- help
- This enables detection of fat partitions.
-
-config FREETZ_AUTOMOUNT_HFS
- bool "HFS"
- select FREETZ_BUSYBOX_VOLUMEID_HFS
- select FREETZ_MODULE_hfs
- default n
- help
- This adds hfs module to your firmware.
-
-config FREETZ_AUTOMOUNT_HFS_PLUS
- bool "HFS+"
- select FREETZ_BUSYBOX_VOLUMEID_HFS
- select FREETZ_MODULE_hfsplus
- default n
- help
- This adds hfs+ module to your firmware.
-
-config FREETZ_AUTOMOUNT_LUKS
- bool "luks"
- select FREETZ_BUSYBOX_VOLUMEID_LUKS
- default n
- help
- This enables detection (not mounting) of luks partitions.
-
-config FREETZ_AUTOMOUNT_NTFS
- bool "NTFS"
- select FREETZ_PACKAGE_NTFS if ! FREETZ_HAS_AVM_NTFS
- select FREETZ_BUSYBOX_VOLUMEID_NTFS
- default n
- help
- This adds ntfs-3g mount helper to your firmware.
-
-config FREETZ_AUTOMOUNT_REISER_FS
- bool "ReiserFS"
- select FREETZ_BUSYBOX_VOLUMEID_REISERFS
- select FREETZ_MODULE_reiserfs
- default n
- help
- This adds reiserfs module to your firmware.
-
-config FREETZ_AUTOMOUNT_LINUXSWAP
- bool "swap"
- select FREETZ_BUSYBOX_VOLUMEID_LINUXSWAP
- default n
- help
- This enables detection of linux-swap partitions.
-
-endif
-
-config FREETZ_PATCH_MAXDEVCOUNT
- bool "Raise the count of connectable usb device to 9"
- default n
- help
- Use this patch if you would connect more than 3 device to the box
-
-config FREETZ_PATCH_MULTIPLE_PRINTERS
- bool "Add support for multiple printers"
- depends on ! FREETZ_REMOVE_PRINTSERV && \
- ( \
- ( FREETZ_TYPE_FON_WLAN_7140 && ! FREETZ_TYPE_LANG_DE ) || \
- FREETZ_TYPE_FON_WLAN_7570 || \
- FREETZ_TYPE_FON_5124 || \
- FREETZ_TYPE_2170 || \
- FREETZ_TYPE_WLAN_3131 || \
- FREETZ_TYPE_WLAN_3170 || \
- FREETZ_TYPE_FON_WLAN_7141 || \
- FREETZ_TYPE_FON_7150 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7270_V1 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3 \
- )
- # no patch available atm: 7140_DE 2070 3070 3050 3130
- default n
- help
- Use this patch if you want to use more than one printer.
-
-endif
-
-comment "Removal patches ------------------------"
-
-config FREETZ_REMOVE_ANNEX_A_FIRMWARE
- bool "Remove Annex A firmware file"
- depends on \
- FREETZ_TYPE_FON_WLAN_7270_V2 || \
- FREETZ_TYPE_FON_WLAN_7270_V3 || \
- FREETZ_TYPE_FON_WLAN_7320
- default n
- help
- Remove lib/modules/dsp_ur8/ur8-A-dsl.bin. This saves about 400 KB of
- uncompressed data size.
-
-config FREETZ_REMOVE_ANNEX_B_FIRMWARE
- bool "Remove Annex B firmware file"
- depends on \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320
- default n
- help
- Remove lib/modules/dsp_ur8/ur8-B-dsl.bin. This saves about 400 KB of
- uncompressed data size.
-
-menu "Remove v1/v2 piglet file(s)"
- depends on FREETZ_SHOW_ADVANCED && \
- ( \
- (FREETZ_TYPE_FON_WLAN_7170 && ! FREETZ_TYPE_ALIEN_HARDWARE) || \
- FREETZ_TYPE_SPEEDPORT_W701V_7170 || \
- FREETZ_TYPE_SPEEDPORT_W900V_7170 || \
- FREETZ_TYPE_IAD_3331_7170 \
- )
-
- config FREETZ_REMOVE_PIGLET_V1
- bool "Remove v1 piglet file(s)"
- help
- The firmware of this model contains double piglet files. Which instance is needed depends
- on the hardware version (v1 or v2) of your box. You can safely remove the
- unneeded instance.
-
- Hint: If "echo $HWRevision_BitFileCount" returns "1" you could select this patch.
-
-
- config FREETZ_REMOVE_PIGLET_V2
- bool "Remove v2 piglet file(s)"
- help
- The firmware of this model contains double piglet files. Which instance is needed depends
- on the hardware version (v1 or v2) of your box. You can safely remove the
- unneeded instance.
-
- Hint: If "echo $HWRevision_BitFileCount" returns "" (nothing) you could select this patch.
-
-endmenu
-
-comment "WARNING: Both (v1 and v2) piglet files are selected for removal."
- depends on \
- FREETZ_REMOVE_PIGLET_V1 && \
- FREETZ_REMOVE_PIGLET_V2
-
-menu "Remove ISDN/POTS piglet file(s) (EXPERIMENTAL)"
- depends on FREETZ_SHOW_ADVANCED && \
- ( \
- FREETZ_TYPE_FON_5113 || \
- FREETZ_TYPE_FON_WLAN_7113 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_5113_7170 || \
- FREETZ_TYPE_7113_7170 \
- )
-
- config FREETZ_REMOVE_PIGLET_ISDN
- bool "Remove ISDN piglet file(s) (EXPERIMENTAL)"
- help
- The firmware of this model contains separate piglet files for ISDN and POTS. Depending
- on your type of fixed line usage you can safely remove the unneeded bitfile(s).
-
- Hint: If you are using POTS fixed line you could select this patch.
-
-
- config FREETZ_REMOVE_PIGLET_POTS
- bool "Remove POTS piglet file(s) (EXPERIMENTAL)"
- help
- The firmware of this model contains separate piglet files for ISDN and POTS. Depending
- on your type of fixed line usage you can safely remove the unneeded bitfile(s).
-
- Hint: If you are using ISDN fixed line you could select this patch.
-
-endmenu
-
-comment "WARNING: Both (ISDN and POTS) piglet files are selected for removal."
- depends on \
- FREETZ_REMOVE_PIGLET_ISDN && \
- FREETZ_REMOVE_PIGLET_POTS
-
-config FREETZ_REMOVE_ASSISTANT
- bool "Remove assistant"
- default n
- depends on \
- ! ( \
- ( \
- FREETZ_TYPE_FON_5124 || \
- FREETZ_TYPE_FON_WLAN_7140 || \
- FREETZ_TYPE_FON_WLAN_7170 \
- ) \
- && FREETZ_TYPE_LANG_EN \
- )
- help
- Removes the installation assistant from the web menu.
-
-config FREETZ_REMOVE_AURA_USB
- bool "Remove remote USB connection (AURA = AVM USB Remote-Architcture)" if FREETZ_SHOW_ADVANCED
- default n
- depends on FREETZ_HAS_AVM_AURA_USB
- help
- Remove the aura-usb-daemon (remote USB connection, USB-Fernanschluss) and some
- related files.
-
- This patch only removes the files, not the settings in AVM's web interface.
-
-config FREETZ_REMOVE_USB_MODULE
- bool "Remove avalanche_usb.ko" if FREETZ_SHOW_ADVANCED
- depends on FREETZ_HAS_USB_CLIENT
- default n
- help
- Removes avalanche_usb.ko to save 60kB uncompressed space.
-
-config FREETZ_REMOVE_NAS
- bool "Remove AVM NAS Webinterface"
- default n
- depends on FREETZ_HAS_NAS && FREETZ_TYPE_LANG_DE
- help
- Removes the AVM NAS Webinterface and internal memory file (saves about 390 KB in compressed image).
-
-config FREETZ_REMOVE_AVM_VPN
- bool "Remove AVM vpn" if FREETZ_SHOW_ADVANCED
- default n
- depends on \
- FREETZ_TYPE_2170 || \
- FREETZ_TYPE_FON_7150 || \
- (FREETZ_TYPE_FON_WLAN_7170 && FREETZ_TYPE_LANG_DE) || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_FON_WLAN_7570 || \
- FREETZ_TYPE_WLAN_3170 || \
- FREETZ_TYPE_WLAN_3270 || \
- FREETZ_TYPE_WLAN_3270_V3
-
- help
- Remove AVM's vpn and some other related files
- This patch removes the files and related Web UI entrys, but not the
- vpn settings. This will save about 120kB compressed size.
-
-config FREETZ_REMOVE_WEBSRV
- bool "Remove AVM web server (replaced by httpd)"
- depends on \
- ! FREETZ_TYPE_2170 \
- && ! FREETZ_TYPE_FON_5124 \
- && ! FREETZ_TYPE_FON_5140 \
- && ! FREETZ_TYPE_FON_WLAN_7112 \
- && ! ( FREETZ_TYPE_FON_WLAN_7140 && FREETZ_TYPE_LANG_EN ) \
- && ! ( FREETZ_TYPE_FON_WLAN_7140 && FREETZ_TYPE_LANG_A_CH ) \
- && ! ( FREETZ_TYPE_FON && FREETZ_TYPE_LANG_EN ) \
- && ! ( FREETZ_TYPE_300IP_AS_FON && FREETZ_TYPE_LANG_EN ) \
- && ! ( FREETZ_TYPE_FON_WLAN && FREETZ_TYPE_LANG_EN ) \
- && ! FREETZ_TYPE_FON_WLAN_7141 \
- && ! FREETZ_TYPE_FON_WLAN_7170 \
- && ! FREETZ_TYPE_FON_WLAN_7240 \
- && ! FREETZ_TYPE_FON_WLAN_7270 \
- && ! FREETZ_TYPE_FON_WLAN_7320 \
- && ! FREETZ_TYPE_FON_WLAN_7340 \
- && ! FREETZ_TYPE_FON_WLAN_7390 \
- && ! FREETZ_TYPE_FON_WLAN_7570 \
- && ! FREETZ_TYPE_WLAN_3131 \
- && ! FREETZ_TYPE_WLAN_3170 \
- && ! FREETZ_TYPE_WLAN_3270 \
- && ! FREETZ_TYPE_WLAN_3270_V3
-
- default n
- help
- Patch init scripts so BusyBox's httpd is used instead of AVM's websrv.
- The websrv binary will be removed from the firmware image.
-
- If "Remove UPnP daemon (igdd/upnpd)" patch is also selected and "Integrate
- Media Server from USB Labor firmware" is not selected, 'libwebsrv.so'
- will also be removed, because only those three binaries use it.
-
-comment "No brandings available to remove"
- depends on \
- FREETZ_TYPE_SPEEDPORT_W501V
-
-menu "Remove brandings"
- depends on \
- ! FREETZ_TYPE_SPEEDPORT_W501V
-
-comment "avm and tcom branding can't be removed"
- depends on \
- FREETZ_TYPE_ALIEN_HARDWARE
-
-config FREETZ_REMOVE_BRANDING_1und1
- bool "1&1"
- depends on \
- FREETZ_TYPE_LANG_DE && \
- ( \
- FREETZ_TYPE_FON || \
- FREETZ_TYPE_FON_5050 || \
- FREETZ_TYPE_FON_5140 || \
- FREETZ_TYPE_FON_WLAN || \
- FREETZ_TYPE_FON_WLAN_7050 || \
- FREETZ_TYPE_FON_WLAN_7112 || \
- FREETZ_TYPE_FON_WLAN_7113 || \
- FREETZ_TYPE_FON_WLAN_7141 || \
- FREETZ_TYPE_FON_WLAN_7170 || \
- FREETZ_TYPE_FON_WLAN_7240 || \
- FREETZ_TYPE_FON_WLAN_7270 || \
- FREETZ_TYPE_FON_WLAN_7320 || \
- FREETZ_TYPE_FON_WLAN_7330 || \
- FREETZ_TYPE_FON_WLAN_7340 || \
- FREETZ_TYPE_FON_WLAN_7390 || \
- FREETZ_TYPE_WLAN_3020 || \
- FREETZ_TYPE_WLAN_3030 || \
- FREETZ_TYPE_WLAN_3130 || \
- FREETZ_TYPE_CUSTOM \
- )
- default n
- help
- 1&1 branding
-
- Each branding provides the web UI templates for a certain manufacturer or OEM.
-
- NOTE: Make sure not to remove the branding corresponding to the one defined
- in your box's boot loader environment. It can be determined by calling the
- following command from the box's shell prompt:
-
- echo $(cat /proc/sys/urlader/firmware_version)
-
-config FREETZ_REMOVE_BRANDING_avm
- bool "AVM"
- depends on \
- ( \
- FREETZ_TYPE_LANG_A_CH || \
- FREETZ_TYPE_LANG_DE || \
- FREETZ_TYPE_CUSTOM \
- ) \
- && ! FREETZ_TYPE_ALIEN_HARDWARE
- default n
- help
- AVM branding
-
- Each branding provides the web UI templates for a certain manufacturer or OEM.
-
- NOTE: Make sure not to remove the branding corresponding to the one defined
- in your box's boot loader environment. It can be determined by calling the
- following command from the box's shell prompt:
-
- echo $(cat /proc/sys/urlader/firmware_version)
-
-config FREETZ_REMOVE_BRANDING_avme
- bool "AVM international"
- depends on \
- ( \
- FREETZ_TYPE_LANG_EN || \
- FREETZ_TYPE_CUSTOM \
- )
- default n
- help
- AVM international branding
-
- Each branding provides the web UI templates for a certain manufacturer or OEM.
-
- NOTE: Make sure not to remove the branding corresponding to the one defined
- in your box's boot loader environment. It can be determined by calling the
- following command from the box's shell prompt:
-
- echo $(cat /proc/sys/urlader/firmware_version)
-
-config FREETZ_DL_KERNEL_SITE
- string "Kernel site" if FREETZ_DL_OVERRIDE
- default "ftp.avm.de/develper/opensrc" if FREETZ_AVM_VERSION_04_30 || \
- FREETZ_AVM_VERSION_04_33 || \
- FREETZ_AVM_VERSION_04_40 || \
- FREETZ_AVM_VERSION_04_49 || \
- FREETZ_AVM_VERSION_04_57 || \
- FREETZ_AVM_VERSION_04_67 || \
- FREETZ_AVM_VERSION_04_70
- default "@AVM/fritzbox.fon_wlan_7170/x_misc/opensrc" if FREETZ_AVM_VERSION_04_76
- default "@AVM/fritzbox.fon_wlan_7170/x_misc/opensrc" if FREETZ_AVM_VERSION_04_80
- default "@AVM/fritzbox.fon_wlan_7170/x_misc/opensrc" if FREETZ_AVM_VERSION_04_87
- default "@AVM/fritzbox.fon_wlan_7270_v1/x_misc/opensrc" if FREETZ_AVM_VERSION_7270_04_86
- default "@AVM/fritzbox.fon_wlan_7270_v3/x_misc/opensrc" if FREETZ_AVM_VERSION_7270_05_05
- default "@AVM/fritzbox.fon_wlan_7320/x_misc/opensrc" if FREETZ_AVM_VERSION_7320_04_86
- default "http://gpl.back2roots.org/source/fritzbox" if FREETZ_AVM_VERSION_7390_04_90
- default "@AVM/fritzbox.fon_wlan_7390/x_misc/opensrc" if FREETZ_AVM_VERSION_7390_05_05
- default "@TELEKOM/Speedport/Speedport_W501V" if FREETZ_AVM_VERSION_r7203
-
-config FREETZ_DL_KERNEL_SOURCE
- string "Kernel source" if FREETZ_DL_OVERRIDE
- default "fritzbox7141-source-files-04.30.tar.bz2" if FREETZ_AVM_VERSION_04_30
- default "fritzbox-source-files-04.33.tar.bz2" if FREETZ_AVM_VERSION_04_33
- default "fritzbox-source-files.04.40.tar.bz2" if FREETZ_AVM_VERSION_04_40
- default "fritzbox-source-files-04.49.tar.gz" if FREETZ_AVM_VERSION_04_49
- default "fritzbox-source-files.04.57.tar.gz" if FREETZ_AVM_VERSION_04_57
- default "fritzbox-source-files.04.67.tar.gz" if FREETZ_AVM_VERSION_04_67
- default "fritzbox-source-files-04.70.tar.gz" if FREETZ_AVM_VERSION_04_70
- default "fritzbox7170-source-files-04.76.tar.gz" if FREETZ_AVM_VERSION_04_76
- default "fritzbox7170-source-files-04.80.tar.gz" if FREETZ_AVM_VERSION_04_80
- default "fritzbox7170-source-files-04.87.tar.gz" if FREETZ_AVM_VERSION_04_87
- default "fritzbox7270-source-files-04.86.tar.gz" if FREETZ_AVM_VERSION_7270_04_86
- default "fritzbox-source-files-05.05.tar.gz" if FREETZ_AVM_VERSION_7270_05_05
- default "fritzbox7320-source-files-04.86.tar.gz" if FREETZ_AVM_VERSION_7320_04_86
- default "fritz_box_fon_wlan_7390_source_files.04.91.tar.gz" if FREETZ_AVM_VERSION_7390_04_90
- default "fritz_box_fon_wlan_7390_source_files.05.05.tar.gz" if FREETZ_AVM_VERSION_7390_05_05
- default "GPL-r7203-4mb_26-tar.bz2" if FREETZ_AVM_VERSION_r7203
-
-config FREETZ_DL_KERNEL_SOURCE_MD5
- string "MD5 checksum for downloaded Kernel source file" if FREETZ_DL_OVERRIDE
- default "1a43eaf94b7989b8cf8e50b2e50c756c" if FREETZ_AVM_VERSION_04_30
- default "99b6a701f9cd09319086c8655fced242" if FREETZ_AVM_VERSION_04_33
- default "008ecd257e584fc5bbf5e276d4b03ff1" if FREETZ_AVM_VERSION_04_40
- default "e6889745b437bde0f5bdb5ada93c913d" if FREETZ_AVM_VERSION_04_49
- default "702f4adf12638bfa34a6b10c0ede4b55" if FREETZ_AVM_VERSION_04_57
- default "ec2c233bb836e822d9018fd41e123a91" if FREETZ_AVM_VERSION_04_67
- default "855d4ad80fc894d9dff52fcaf55d3c12" if FREETZ_AVM_VERSION_04_70
- default "4ffc088502c896c11931ba81536fa0e6" if FREETZ_AVM_VERSION_04_76
- default "6bf92b81b48a3a05efd3aae6c05fe3e2" if FREETZ_AVM_VERSION_04_80
- default "cad33bda041910e2aae01f027465162b" if FREETZ_AVM_VERSION_04_87
- default "55a11af7dcfd617c39e75877045ab468" if FREETZ_AVM_VERSION_7270_04_86
- default "19280ad861a7e88698d41211996c5ac6" if FREETZ_AVM_VERSION_7270_05_05
- default "0e2ddf32808eb329efc4b486c6de0011" if FREETZ_AVM_VERSION_7320_04_86
- default "2cad066e0e57aa3e58bf784b396ee676" if FREETZ_AVM_VERSION_7390_04_90
- default "fbf515bd77f3d3a64a3095889777cc13" if FREETZ_AVM_VERSION_7390_05_05
- default "582c74f0959a687c41c1bcfa599ace9c" if FREETZ_AVM_VERSION_r7203
-
-config FREETZ_DL_SITE
- string "Firmware site" if FREETZ_DL_OVERRIDE
- depends on ! FREETZ_TYPE_LABOR
- default "@AVM/fritzbox.2170/firmware/deutsch" if FREETZ_TYPE_2170
- default "@AVM/fritzbox.fon/firmware/deutsch" if (FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON) && \
- FREETZ_TYPE_LANG_DE
- default "@AVM/fritzbox.fon/firmware/english/annex_a" if (FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON) && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "@AVM/fritzbox.fon/firmware/english/annex_b" if (FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON) && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "@AVM/fritzbox.fon_5010/firmware/deutsch_a-ch" if FREETZ_TYPE_FON_5010
- default "@AVM/fritzbox.fon_5050/firmware" if FREETZ_TYPE_FON_5050
- default "@AVM/fritzbox.fon_5124/firmware/english/annex_a" if FREETZ_TYPE_FON_5124 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "@AVM/fritzbox.fon_5124/firmware/english/annex_b" if FREETZ_TYPE_FON_5124 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "@AVM/fritzbox.fon_5140/firmware" if FREETZ_TYPE_FON_5140
- default "@AVM/fritzbox.fon_wlan/firmware/deutsch" if FREETZ_TYPE_FON_WLAN && \
- FREETZ_TYPE_LANG_DE
- default "@AVM/fritzbox.fon_wlan/firmware/english/annex_a" if FREETZ_TYPE_FON_WLAN && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "@AVM/fritzbox.fon_wlan/firmware/english/annex_b" if FREETZ_TYPE_FON_WLAN && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "@AVM/fritzbox.fon_wlan_7050/firmware" if FREETZ_TYPE_FON_WLAN_7050
- default "@AVM/fritzbox.fon_wlan_7112/firmware/deutsch" if FREETZ_TYPE_FON_WLAN_7112
- default "@AVM/fritzbox.fon_wlan_7113/firmware/deutsch" if FREETZ_TYPE_FON_WLAN_7113 && \
- FREETZ_TYPE_LANG_DE
- default "@AVM/fritzbox.fon_wlan_7113/firmware/english/annex_a" if FREETZ_TYPE_FON_WLAN_7113 && \
- FREETZ_TYPE_LANG_EN
- default "@AVM/fritzbox.fon_wlan_7140/firmware/deutsch" if FREETZ_TYPE_FON_WLAN_7140 && \
- FREETZ_TYPE_LANG_DE
- default "@AVM/fritzbox.fon_wlan_7140/firmware/deutsch_a-ch" if FREETZ_TYPE_FON_WLAN_7140 && \
- FREETZ_TYPE_LANG_A_CH
- default "@AVM/fritzbox.fon_wlan_7140/firmware/english/annex_a" if FREETZ_TYPE_FON_WLAN_7140 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "@AVM/fritzbox.fon_wlan_7140/firmware/english/annex_b" if FREETZ_TYPE_FON_WLAN_7140 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "@AVM/fritzbox.fon_wlan_7141/firmware/deutsch" if FREETZ_TYPE_FON_WLAN_7141
- default "@AVM/fritzfon.7150/firmware" if FREETZ_TYPE_FON_7150
- default "@AVM/fritzbox.fon_wlan_7170/firmware/deutsch" if FREETZ_TYPE_FON_WLAN_7170 && \
- FREETZ_TYPE_LANG_DE
- default "@AVM/fritzbox.fon_wlan_7170/firmware/deutsch_a-ch" if FREETZ_TYPE_FON_WLAN_7170 && \
- FREETZ_TYPE_LANG_A_CH
- default "@AVM/fritzbox.fon_wlan_7170/firmware/english/annex_a" if FREETZ_TYPE_FON_WLAN_7170 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "@AVM/fritzbox.fon_wlan_7170/firmware/english/annex_b" if FREETZ_TYPE_FON_WLAN_7170 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "@AVM/fritzbox.fon_wlan_7240/firmware/deutsch" if FREETZ_TYPE_FON_WLAN_7240
- default "@AVM/fritzbox.fon_wlan_7270_v1/firmware/deutsch" if ( ( FREETZ_TYPE_FON_WLAN_7270_V1 && \
- ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_72702_72701 ) && \
- FREETZ_TYPE_LANG_DE
- default "@AVM/fritzbox.fon_wlan_7270_v2/firmware/deutsch" if ( ( FREETZ_TYPE_FON_WLAN_7270_V2 && \
- ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7270_7270 ) && \
- ! FREETZ_TYPE_LABOR && \
- FREETZ_TYPE_LANG_DE
- default "@AVM/fritzbox.fon_wlan_7270_v2/firmware/english" if ( ( FREETZ_TYPE_FON_WLAN_7270_V2 && \
- ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7270_7270 ) && \
- FREETZ_TYPE_LANG_EN
- default "@AVM/fritzbox.fon_wlan_7270_v3/firmware/deutsch" if ( ( FREETZ_TYPE_FON_WLAN_7270_V3 && \
- ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7240_7270 ) && \
- ! FREETZ_TYPE_LABOR && \
- FREETZ_TYPE_LANG_DE
- default "@AVM/fritzbox.fon_wlan_7270_v3/firmware/english" if ( ( FREETZ_TYPE_FON_WLAN_7270_V3 && \
- ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7240_7270 ) && \
- FREETZ_TYPE_LANG_EN
- default "@AVM/fritzbox.fon_wlan_7320/firmware/deutsch" if FREETZ_TYPE_FON_WLAN_7320
- default "@AVM/fritzbox.fon_wlan_7330/firmware/deutsch" if FREETZ_TYPE_FON_WLAN_7330
- default "@AVM/fritzbox.fon_wlan_7340/firmware/english" if FREETZ_TYPE_FON_WLAN_7340
- default "@AVM/fritzbox.fon_wlan_7390/firmware/deutsch" if FREETZ_TYPE_FON_WLAN_7390 && \
- FREETZ_TYPE_LANG_DE
- default "@AVM/fritzbox.fon_wlan_7390/firmware/english" if FREETZ_TYPE_FON_WLAN_7390 && \
- FREETZ_TYPE_LANG_EN
- default "@AVM/fritzbox.fon_wlan_7570/firmware/english" if FREETZ_TYPE_FON_WLAN_7570
- default "@AVM/fritzbox.sl_wlan/firmware" if FREETZ_TYPE_WLAN_3020
- default "@AVM/fritzbox.wlan_3030/firmware" if FREETZ_TYPE_WLAN_3030
- default "@AVM/fritzbox.wlan_3130/firmware" if FREETZ_TYPE_WLAN_3130
- default "@AVM/fritzbox.wlan_3131/firmware/deutsch" if FREETZ_TYPE_WLAN_3131
- default "@AVM/fritzbox.wlan_3170/firmware/deutsch" if FREETZ_TYPE_WLAN_3170
- default "@AVM/fritzbox.wlan_3270/firmware/deutsch" if FREETZ_TYPE_WLAN_3270
- default "@AVM/fritzbox.wlan_3270_v3/firmware/deutsch" if FREETZ_TYPE_WLAN_3270_V3
- default "@TELEKOM/Speedport/Speedport_W501V" if FREETZ_TYPE_SPEEDPORT_W501V
- default "@AVM/..." if FREETZ_TYPE_CUSTOM
-
-config FREETZ_DL_SOURCE
- string "Firmware source" if FREETZ_DL_OVERRIDE
- default "FRITZ.Box_2170.51.04.57.image" if FREETZ_TYPE_2170
- default "fritz.box_fon.06.04.33.image" if (FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON) && \
- FREETZ_TYPE_LANG_DE
- default "fritz.box_fon.annexa.en.06.04.49.image" if (FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON) && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "fritz.box_fon.en.06.04.49.image" if (FREETZ_TYPE_300IP_AS_FON || \
- FREETZ_TYPE_FON) && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "fritz.box_fon_5010.annexa.48.04.43.image" if FREETZ_TYPE_FON_5010
- default "fritz.box_fon_5050.12.04.31.image" if FREETZ_TYPE_FON_5050
- default "FRITZ.Box_Fon_5124.AnnexA.en.57.04.76.image" if FREETZ_TYPE_FON_5124 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "FRITZ.Box_Fon_5124.AnnexB.en.56.04.76.image" if FREETZ_TYPE_FON_5124 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "FRITZ.Box_Fon_5140.AnnexB.43.04.67.image" if FREETZ_TYPE_FON_5140
- default "fritz.box_fon_wlan.08.04.34.image" if FREETZ_TYPE_FON_WLAN && \
- FREETZ_TYPE_LANG_DE
- default "FRITZ.Box_Fon_WLAN.AnnexA.en.08.04.49.image" if FREETZ_TYPE_FON_WLAN && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "FRITZ.Box_Fon_WLAN.AnnexB.en.08.04.49.image" if FREETZ_TYPE_FON_WLAN && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "fritz.box_fon_wlan_7050.14.04.33.image" if FREETZ_TYPE_FON_WLAN_7050
- default "FRITZ.Box_Fon_WLAN_7112.87.04.87.image" if FREETZ_TYPE_FON_WLAN_7112
- default "FRITZ.Box_Fon_WLAN_7113.60.04.68.image" if FREETZ_TYPE_FON_WLAN_7113 && \
- FREETZ_TYPE_LANG_DE
- default "FRITZ.Box_Fon_WLAN_7113.AnnexA.de-en-es-it-fr.90.04.84.image" if FREETZ_TYPE_FON_WLAN_7113 && \
- FREETZ_TYPE_LANG_EN
- default "fritz.box_fon_wlan_7140.annexb.30.04.33.image" if FREETZ_TYPE_FON_WLAN_7140 && \
- FREETZ_TYPE_LANG_DE
- default "FRITZ.Box_Fon_WLAN_7140.AnnexA.39.04.76.image" if FREETZ_TYPE_FON_WLAN_7140 && \
- FREETZ_TYPE_LANG_A_CH
- default "FRITZ.Box_Fon_WLAN_7140.AnnexA.en.39.04.67.image" if FREETZ_TYPE_FON_WLAN_7140 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "FRITZ.Box_Fon_WLAN_7140.AnnexB.en.30.04.67.image" if FREETZ_TYPE_FON_WLAN_7140 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "FRITZ.Box_Fon_WLAN_7141.40.04.76.image" if FREETZ_TYPE_FON_WLAN_7141
- default "fritz.fon_7150.annexb.38.04.71.image" if FREETZ_TYPE_FON_7150
- default "FRITZ.Box_Fon_WLAN_7170.29.04.87.image" if FREETZ_TYPE_FON_WLAN_7170 && \
- FREETZ_TYPE_LANG_DE
- default "FRITZ.Box_Fon_WLAN_7170.AnnexA.58.04.76.image" if FREETZ_TYPE_FON_WLAN_7170 && \
- FREETZ_TYPE_LANG_A_CH
- default "FRITZ.Box_Fon_WLAN_7170.AnnexA.en.58.04.84.image" if FREETZ_TYPE_FON_WLAN_7170 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_A
- default "FRITZ.Box_Fon_WLAN_7170.AnnexB.en.29.04.82.image" if FREETZ_TYPE_FON_WLAN_7170 && \
- FREETZ_TYPE_LANG_EN && \
- FREETZ_TYPE_ANNEX_B
- default "FRITZ.Box_Fon_WLAN_7240.73.05.05.image" if FREETZ_TYPE_FON_WLAN_7240 && \
- ! FREETZ_TYPE_LABOR
-# default "Labor_FRITZ.Box_Fon_WLAN_7240.73.05.04-20170.image" if FREETZ_TYPE_FON_WLAN_7240 && \
-# FREETZ_TYPE_LABOR_PREVIEW
- default "FRITZ.Box_Fon_WLAN_7270_v1.54.04.88.image" if FREETZ_TYPE_FON_WLAN_7270_V1 && \
- ! FREETZ_TYPE_LABOR && \
- FREETZ_TYPE_LANG_DE
-# default "Labor_FRITZ.Box_Fon_WLAN_7270_v1.54.04.86-18582.image" if FREETZ_TYPE_FON_WLAN_7270_V1 && \
-# FREETZ_TYPE_LABOR_PREVIEW
- default "FRITZ.Box_Fon_WLAN_7270_v2.54.05.05.image" if ( ( FREETZ_TYPE_FON_WLAN_7270_V2 && \
- ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7270_7270 ) && \
- ! FREETZ_TYPE_LABOR && \
- FREETZ_TYPE_LANG_DE
- default "FRITZ.Box_Fon_WLAN_7270_v2_Labor.54.05.07-20870.image" if FREETZ_TYPE_FON_WLAN_7270_V2 && \
- FREETZ_TYPE_LABOR_PREVIEW
- default "FRITZ.Box_Fon_WLAN_7270_16.en-de-es-it-fr.54.05.05.image" if ( ( FREETZ_TYPE_FON_WLAN_7270_V2 && \
- ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7270_7270 ) && \
- FREETZ_TYPE_LANG_EN
- default "FRITZ.Box_Fon_WLAN_7270_v3.74.05.05.image" if ( ( FREETZ_TYPE_FON_WLAN_7270_V3 && \
- ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7240_7270 ) && \
- ! FREETZ_TYPE_LABOR && \
- FREETZ_TYPE_LANG_DE
- default "FRITZ.Box_Fon_WLAN_7270_v3.en-de-es-it-fr.74.05.05.image" if ( ( FREETZ_TYPE_FON_WLAN_7270_V3 && \
- ! FREETZ_TYPE_ALIEN_HARDWARE ) || \
- FREETZ_TYPE_7240_7270 ) && \
- FREETZ_TYPE_LANG_EN
- default "FRITZ.Box_Fon_WLAN_7270_v3_Labor.74.05.07-20870.image" if ( FREETZ_TYPE_FON_WLAN_7270_V3 || \
- ( FREETZ_TYPE_FON_WLAN_7270 && \
- FREETZ_TYPE_ALIEN_HARDWARE ) ) && \
- FREETZ_TYPE_LABOR_PREVIEW
- default "FRITZ.Box_Fon_WLAN_7320.100.04.89.image" if FREETZ_TYPE_FON_WLAN_7320 && \
- ! FREETZ_TYPE_LABOR
- default "FRITZ.Box_7330.107.05.06.image" if FREETZ_TYPE_FON_WLAN_7330
- default "FRITZ.Box_Fon_WLAN_7340.en-de-es-it-fr.99.05.05.image" if FREETZ_TYPE_FON_WLAN_7340
- default "FRITZ.Box_Fon_WLAN_7390.84.05.05.image" if FREETZ_TYPE_FON_WLAN_7390 && \
- ! FREETZ_TYPE_LABOR && \
- FREETZ_TYPE_LANG_DE
- default "FRITZ.Box_Fon_WLAN_7390.en-de-es-it-fr.84.05.05.image" if FREETZ_TYPE_FON_WLAN_7390 && \
- ! FREETZ_TYPE_LANG_DE
- default "FRITZ.Box_Fon_WLAN_7390_Labor.84.05.07-20869.image" if FREETZ_TYPE_FON_WLAN_7390 && \
- FREETZ_TYPE_LABOR_PREVIEW
- default "FRITZ.Box_Fon_WLAN_7570_vDSL.en-de-fr.75.04.91.image" if FREETZ_TYPE_FON_WLAN_7570
- default "fritz.box_sl_wlan.09.04.34.image" if FREETZ_TYPE_WLAN_3020
- default "fritz.box_wlan_3030.21.04.34.image" if FREETZ_TYPE_WLAN_3030
- default "fritz.box_wlan_3130.44.04.34.image" if FREETZ_TYPE_WLAN_3130
- default "fritz.box_wlan_3131.50.04.57.image" if FREETZ_TYPE_WLAN_3131
- default "fritz.box_wlan_3170.49.04.58.image" if FREETZ_TYPE_WLAN_3170
- default "fritz.box_wlan_3270.67.05.05.image" if FREETZ_TYPE_WLAN_3270
- default "fritz.box_wlan_3270_v3.96.05.05.image" if FREETZ_TYPE_WLAN_3270_V3
- default "fw_Speedport_W501V_v_28.04.38.image" if FREETZ_TYPE_SPEEDPORT_W501V
- default "fritz.box..." if FREETZ_TYPE_CUSTOM
-
-endmenu # "Toolchain options" #
-
-endmenu # "Advanced options" #
-
-# INCLUDE_END Config.in
diff --git a/tests/examplefiles/Constants.mo b/tests/examplefiles/Constants.mo
deleted file mode 100644
index a8862776..00000000
--- a/tests/examplefiles/Constants.mo
+++ /dev/null
@@ -1,158 +0,0 @@
-within Modelica;
-package Constants
- "Library of mathematical constants and constants of nature (e.g., pi, eps, R, sigma)"
-
- import SI = Modelica.SIunits;
- import NonSI = Modelica.SIunits.Conversions.NonSIunits;
-
- extends Modelica.Icons.Library2;
-
- // Mathematical constants
- final constant Real e=Modelica.Math.exp(1.0);
- final constant Real pi=2*Modelica.Math.asin(1.0); // 3.14159265358979;
- final constant Real D2R=pi/180 "Degree to Radian";
- final constant Real R2D=180/pi "Radian to Degree";
-
- // Machine dependent constants
- // (the definition is a temporary fix since not adapted to the
- // machine where the Modelica translator is running)
- final constant Real eps=1.e-15 "Biggest number such that 1.0 + eps = 1.0";
- final constant Real small=1.e-60
- "Smallest number such that small and -small are representable on the machine";
- final constant Real inf=1.e+60
- "Biggest Real number such that inf and -inf are representable on the machine";
- final constant Integer Integer_inf=2147483647
- "Biggest Integer number such that Integer_inf and -Integer_inf are representable on the machine";
-
- // Constants of nature
- // (name, value, description from http://physics.nist.gov/cuu/Constants/)
- final constant SI.Velocity c=299792458 "Speed of light in vacuum";
- final constant SI.Acceleration g_n=9.80665
- "Standard acceleration of gravity on earth";
- final constant Real G(final unit="m3/(kg.s2)") = 6.6742e-11
- "Newtonian constant of gravitation";
- final constant SI.FaradayConstant F = 9.64853399e4 "Faraday constant, C/mol";
- final constant Real h(final unit="J.s") = 6.6260693e-34 "Planck constant";
- final constant Real k(final unit="J/K") = 1.3806505e-23 "Boltzmann constant";
- final constant Real R(final unit="J/(mol.K)") = 8.314472 "Molar gas constant";
- final constant Real sigma(final unit="W/(m2.K4)") = 5.670400e-8
- "Stefan-Boltzmann constant";
- final constant Real N_A(final unit="1/mol") = 6.0221415e23
- "Avogadro constant";
- final constant Real mue_0(final unit="N/A2") = 4*pi*1.e-7 "Magnetic constant";
- final constant Real epsilon_0(final unit="F/m") = 1/(mue_0*c*c)
- "Electric constant";
- final constant NonSI.Temperature_degC T_zero=-273.15
- "Absolute zero temperature";
-
- annotation (
- Documentation(info="<html>
-<p>
-This package provides often needed constants from mathematics, machine
-dependent constants and constants from nature. The latter constants
-(name, value, description) are from the following source:
-</p>
-
-<dl>
-<dt>Peter J. Mohr and Barry N. Taylor (1999):</dt>
-<dd><b>CODATA Recommended Values of the Fundamental Physical Constants: 1998</b>.
- Journal of Physical and Chemical Reference Data, Vol. 28, No. 6, 1999 and
- Reviews of Modern Physics, Vol. 72, No. 2, 2000. See also <a href=
-\"http://physics.nist.gov/cuu/Constants/\">http://physics.nist.gov/cuu/Constants/</a></dd>
-</dl>
-
-<p>CODATA is the Committee on Data for Science and Technology.</p>
-
-<dl>
-<dt><b>Main Author:</b></dt>
-<dd><a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a><br>
- Deutsches Zentrum f&uuml;r Luft und Raumfahrt e. V. (DLR)<br>
- Oberpfaffenhofen<br>
- Postfach 11 16<br>
- D-82230 We&szlig;ling<br>
- email: <a href=\"mailto:Martin.Otter@dlr.de\">Martin.Otter@dlr.de</a></dd>
-</dl>
-
-
-<p>
-Copyright &copy; 1998-2009, Modelica Association and DLR.
-</p>
-<p>
-<i>This Modelica package is <b>free</b> software; it can be redistributed and/or modified
-under the terms of the <b>Modelica license</b>, see the license conditions
-and the accompanying <b>disclaimer</b>
-<a href=\"Modelica://Modelica.UsersGuide.ModelicaLicense\">here</a>.</i>
-</p><br>
-</html>
-", revisions="<html>
-<ul>
-<li><i>Nov 8, 2004</i>
- by <a href=\"http://www.robotic.dlr.de/Christian.Schweiger/\">Christian Schweiger</a>:<br>
- Constants updated according to 2002 CODATA values.</li>
-<li><i>Dec 9, 1999</i>
- by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br>
- Constants updated according to 1998 CODATA values. Using names, values
- and description text from this source. Included magnetic and
- electric constant.</li>
-<li><i>Sep 18, 1999</i>
- by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br>
- Constants eps, inf, small introduced.</li>
-<li><i>Nov 15, 1997</i>
- by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br>
- Realized.</li>
-</ul>
-</html>"),
- Invisible=true,
- Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,
- 100}}), graphics={
- Line(
- points={{-34,-38},{12,-38}},
- color={0,0,0},
- thickness=0.5),
- Line(
- points={{-20,-38},{-24,-48},{-28,-56},{-34,-64}},
- color={0,0,0},
- thickness=0.5),
- Line(
- points={{-2,-38},{2,-46},{8,-56},{14,-64}},
- color={0,0,0},
- thickness=0.5)}),
- Diagram(graphics={
- Rectangle(
- extent={{200,162},{380,312}},
- fillColor={235,235,235},
- fillPattern=FillPattern.Solid,
- lineColor={0,0,255}),
- Polygon(
- points={{200,312},{220,332},{400,332},{380,312},{200,312}},
- fillColor={235,235,235},
- fillPattern=FillPattern.Solid,
- lineColor={0,0,255}),
- Polygon(
- points={{400,332},{400,182},{380,162},{380,312},{400,332}},
- fillColor={235,235,235},
- fillPattern=FillPattern.Solid,
- lineColor={0,0,255}),
- Text(
- extent={{210,302},{370,272}},
- lineColor={160,160,164},
- fillColor={0,0,0},
- fillPattern=FillPattern.Solid,
- textString="Library"),
- Line(
- points={{266,224},{312,224}},
- color={0,0,0},
- thickness=1),
- Line(
- points={{280,224},{276,214},{272,206},{266,198}},
- color={0,0,0},
- thickness=1),
- Line(
- points={{298,224},{302,216},{308,206},{314,198}},
- color={0,0,0},
- thickness=1),
- Text(
- extent={{152,412},{458,334}},
- lineColor={255,0,0},
- textString="Modelica.Constants")}));
-end Constants;
diff --git a/tests/examplefiles/DancingSudoku.lhs b/tests/examplefiles/DancingSudoku.lhs
deleted file mode 100644
index 368ab8e5..00000000
--- a/tests/examplefiles/DancingSudoku.lhs
+++ /dev/null
@@ -1,411 +0,0 @@
- A Sukodku solver by Chris Kuklewicz (haskell (at) list (dot) mightyreason (dot) com)
- The usual BSD license applies, copyright 2006.
- Uploaded to HaskellWiki as DancingSudoku.lhs
-
- I compile on a powerbook G4 (Mac OS X, ghc 6.4.2) using
- ghc -optc-O3 -funbox-strict-fields -O2 --make -fglasgow-exts
-
- This is a translation of Knuth's GDANCE from dance.w / dance.c
-
- http://www-cs-faculty.stanford.edu/~uno/preprints.html
- http://www-cs-faculty.stanford.edu/~uno/programs.html
- http://en.wikipedia.org/wiki/Dancing_Links
-
- I have an older verison that uses lazy ST to return the solutions on
- demand, which was more useful when trying to generate new puzzles to
- solve.
-
-> module Main where
-
-> import Prelude hiding (read)
-> import Control.Monad
-> import Control.Monad.Fix
-> import Data.Array.IArray
-> import Control.Monad.ST.Strict
-> import Data.STRef.Strict
-> import Data.Char(intToDigit,digitToInt)
-> import Data.List(unfoldr,intersperse,inits)
-
-> new = newSTRef
-> {-# INLINE new #-}
-> read = readSTRef
-> {-# INLINE read #-}
-> write = writeSTRef
-> {-# INLINE write #-}
-> modify = modifySTRef
-> {-# INLINE modify #-}
-
- Data types to prevent mixing different index and value types
-
-> type A = Int
-> newtype R = R A deriving (Show,Read,Eq,Ord,Ix,Enum)
-> newtype C = C A deriving (Show,Read,Eq,Ord,Ix,Enum)
-> newtype V = V A deriving (Show,Read,Eq,Ord,Ix,Enum)
-> newtype B = B A deriving (Show,Read,Eq,Ord,Ix,Enum)
-
- Sudoku also has block constraints, so we want to look up a block
- index in an array:
-
-> lookupBlock :: Array (R,C) B
-> lookupBlock = listArray bb [ toBlock ij | ij <- range bb ]
-> where ra :: Array Int B
-> ra = listArray (0,pred (rangeSize b)) [B (fst b) .. B (snd b)]
-> toBlock (R i,C j) = ra ! ( (div (index b j) 3)+3*(div (index b i) 3) )
-
- The values for an unknown location is 'u'.
- The bound and range are given by b and rng. And bb is a 2D bound.
-
-> u = V 0 -- unknown value
-> b :: (Int,Int)
-> b = (1,9) -- min and max bounds
-> rng = enumFromTo (fst b) (snd b) -- list from '1' to '9'
-> bb = ((R (fst b),C (fst b)),(R (snd b),C (snd b)))
-
- A Spec can be turned into a parsed array with ease:
-
-> type Hint = ((R,C),V)
-> newtype Spec = Spec [Hint] deriving (Eq,Show)
-
-> type PA = Array (R,C) V
-
-> parse :: Spec -> PA
-> parse (Spec parsed) = let acc old new = new
-> in accumArray acc u bb parsed
-
- The dancing links algorithm depends on a sparse 2D node structure.
- Each column represents a constraint. Each row represents a Hint.
- The number of possible hints is 9x9x9 = 271
-
-> type (MutInt st) = (STRef st) Int
-
- The pointer types:
-
-> type (NodePtr st) = (STRef st) (Node st)
-> type (HeadPtr st) = (STRef st) (Head st)
-
- The structures is a 2D grid of nodes, with Col's on the top of
- columns and a sparse collection of nodes. Note that topNode of Head
- is not a strict field. This is because the topNode needs to refer to
- the Head, and they are both created monadically.
-
-> type HeadName = (Int,Int,Int) -- see below for meaning
-
-> data Head st = Head {headName:: !HeadName
-> ,topNode:: (Node st) -- header node for this column
-> ,len:: !(MutInt st) -- number of nodes below this head
-> ,next,prev:: !(HeadPtr st) -- doubly-linked list
-> }
-
-> data Node st = Node {getHint:: !Hint
-> ,getHead:: !(Head st) -- head for the column this node is in
-> ,up,down,left,right :: !(NodePtr st) -- two doubly-linked lists
-> }
-
-> instance Eq (Head st) where
-> a == b = headName a == headName b
-
-> instance Eq (Node st) where
-> a == b = up a == up b
-
- To initialize the structures is a bit tedious. Knuth's code reads in
- the problem description from a data file and builds the structure
- based on that. Rather than short strings, I will use HeadName as the
- identifier.
-
- The columns are (0,4,5) for nodes that put some value in Row 4 Col 5
- (1,2,3) for nodes that put Val 3 in Row 2 and some column
- (2,7,4) for nodes that put Val 4 in Col 7 and some row
- (3,1,8) for nodes that put Val 8 in some (row,column) in Block 1
-
- The first head is (0,0,0) which is the root. The non-root head data
- will be put in an array with the HeadName as an index.
-
-> headNames :: [HeadName]
-> headNames = let names = [0,1,2,3]
-> in (0,0,0):[ (l,i,j) | l<-names,i<-rng,j<-rng]
-
- A "row" of left-right linked nodes is a move. It is defined by a
- list of head names.
-
-> type Move = [(Hint,HeadName)]
-
- Initial hints are enforced by making them the only legal move for
- that location. Blank entries with value 'u = V 0' have a move for
- all possible values [V 1..V 9].
-
-> parseSpec :: Spec -> [Move]
-> parseSpec spec =
-> let rowsFrom :: Hint -> [Move]
-> rowsFrom (rc@(R r,C c),mv@(V v')) =
-> if mv == u then [ rsyms v | v <- rng ]
-> else [ rsyms v' ]
-> where (B b) = lookupBlock ! rc
-> rsyms :: A -> Move
-> rsyms v = map ( (,) (rc,V v) ) [(0,r,c),(1,r,v),(2,c,v),(3,b,v)]
-> in concatMap rowsFrom (assocs (parse spec))
-
- mkDList creates doubly linked lists using a monadic smart
- constructor and the recursive "mdo" notation as documented at
- http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#mdo-notation
- http://www.cse.ogi.edu/PacSoft/projects/rmb/
-
- For more fun with this, see the wiki page at
- http://haskell.org/hawiki/TyingTheKnot
-
-> mkDList :: (MonadFix m) => (b -> a -> b -> m b) -> [a] -> m b
-> mkDList _ [] = error "must have at least one element"
-> mkDList mkNode xs = mdo (first,last) <- go last xs first
-> return first
-> where go prev [] next = return (next,prev)
-> go prev (x:xs) next = mdo this <- mkNode prev x rest
-> (rest,last) <- go this xs next
-> return (this,last)
-
- toSimple takes a function and a header node and iterates (read . function)
- until the header is reached again, but does not return the header
- itself.
-
-> toSingle step header = loop =<< (read . step) header
-> where loop y = if header/=y then liftM (y:) (read (step y) >>= loop)
-> else return []
->
-
- forEach is an optimization of (toSimple step header >>= mapM_ act)
-
-> forEach step header act = loop =<< (read . step) header
-> where loop y = if header/=y then (act y >> (read (step y)) >>= loop)
-> else return ()
-
- Now make the root node and all the head nodes. This also exploits mdo:
-
-> makeHeads :: [HeadName] -> (ST st) (Head st)
-> makeHeads names = mkDList makeHead names
-> where makeHead before name after = mdo
-> ~newTopNode <- liftM4 (Node ((R 0,C 0),V 0) newHead) (new newTopNode) (new newTopNode)
-> (new newTopNode) (new newTopNode)
-> newHead <- liftM3 (Head name newTopNode)
-> (new 0) (new after) (new before)
-> return newHead
-
- The Head nodes will be places in an array for easy lookup while building moves:
-
-> type HArray st = Array HeadName (Head st)
-> hBounds = ((0,1,1),(3,9,9))
-> type Root st = (Head st,HArray st)
-
- The addMove function creates the (four) nodes that represent a move and adds
- them to the data structure. The HArray in Root makes for a fast
- lookup of the Head data.
-
-> addMove :: forall st. (Root st) -> Move -> (ST st) (Node st)
-> addMove (_,ha) move = mkDList addNode move
-> where addNode :: (Node st) -> (Hint,HeadName) -> (Node st) -> (ST st) (Node st)
-> addNode before (hint,name) after = do
-> let head = ha ! name
-> let below = topNode head
-> above <- read (up below)
-> newNode <- liftM4 (Node hint head) (new above) (new below)
-> (new before) (new after)
-> write (down above) newNode
-> write (up below) newNode
-> modify (len head) succ
-> l <- read (len head)
-> seq l (return newNode)
-
- Create the column headers, including the fast lookup array. These
- will be resused between puzzles.
-
-> initHA :: (ST st) (Root st)
-> initHA = do
-> root <- makeHeads headNames
-> heads <- toSingle next root
-> let ha = array hBounds (zip (map headName heads) heads)
-> return (root,ha)
-
- Take the Root from initHA and a puzzle Spec and fill in all the Nodes.
-
-> initRoot :: (Root st) -> Spec -> (ST st) ()
-> initRoot root spec = do
-> let moves = parseSpec spec
-> mapM_ (addMove root) moves
-
- Return the column headers to their condition after initHA
-
-> resetRoot :: (Root st) -> (ST st) ()
-> resetRoot (root,ha) = do
-> let heads@(first:_) = elems ha
-> let resetHead head = do
-> write (len head) 0
-> let node = topNode head
-> write (down node) node
-> write (up node) node
-> reset (last:[]) = do
-> write (prev root) last
-> write (next root) first
-> reset (before:xs@(head:[])) = do
-> resetHead head
-> write (prev head) before
-> write (next head) root
-> reset xs
-> reset (before:xs@(head:after:_)) = do
-> resetHead head
-> write (prev head) before
-> write (next head) after
-> reset xs
-> reset (root:heads)
-
- getBest iterates over the unmet constraints (i.e. the Head that are
- reachable from root). It locates the one with the lowest number of
- possible moves that will solve it, aborting early if it finds 0 or 1
- moves.
-
-> getBest :: (Head st) -> (ST st) (Maybe (Head st))
-> getBest root = do
-> first <- read (next root)
-> if first == root then return Nothing
-> else do
-> let findMin m best head | head == root = return (Just best)
-> | otherwise = do
-> l <- read (len head)
-> if l <= 1 then return (Just head)
-> else if l < m then findMin l head =<< read (next head)
-> else findMin l best =<< read (next head)
-> findMin 10 first first
-
- The unlink and relink operations are from where Knuth got the name
- "dancing links". So long as "a" does not change in between, the
- relink call will undo the unlink call. Similarly, the unconver will
- undo the changes of cover and unconverOthers will undo coverOthers.
-
-> unlink :: (a->STRef st a) -> (a->STRef st a) -> a -> (ST st) ()
-> unlink prev next a = do
-> before <- read (prev a)
-> after <- read (next a)
-> write (next before) after
-> write (prev after) before
-
-> relink :: (a->STRef st a) -> (a->STRef st a) -> a -> (ST st) ()
-> relink prev next a = do
-> before <- read (prev a)
-> after <- read (next a)
-> write (next before) a
-> write (prev after) a
-
-> cover :: (Head st) -> (ST st) ()
-> cover head = do
-> unlink prev next head
-> let eachDown rr = forEach right rr eachRight
-> eachRight nn = do
-> unlink up down nn
-> modify (len $ getHead nn) pred
-> forEach down (topNode head) eachDown
-
-> uncover :: (Head st) -> (ST st) ()
-> uncover head = do
-> let eachUp rr = forEach left rr eachLeft
-> eachLeft nn = do
-> modify (len $ getHead nn) succ
-> relink up down nn
-> forEach up (topNode head) eachUp
-> relink prev next head
-
-> coverOthers :: (Node st) -> (ST st) ()
-> coverOthers node = forEach right node (cover . getHead)
-
-> uncoverOthers :: (Node st) -> (ST st) ()
-> uncoverOthers node = forEach left node (uncover . getHead)
-
- A helper function for gdance:
-
-> choicesToSpec :: [(Node st)] -> Spec
-> choicesToSpec = Spec . (map getHint)
-
- This is the heart of the algorithm. I have altered it to return only
- the first solution, or produce an error if none is found.
-
- Knuth used several goto links to do what is done below with tail
- recursion.
-
-> gdance :: (Head st) -> (ST st) Spec -- [Spec]
-> gdance root =
-> let
-> forward choices = do
-> maybeHead <- getBest root
-> case maybeHead of
-> Nothing -> if null choices
-> then error "No choices in forward" -- return [] -- for [Spec]
-> else do -- nextSols <- recover choices -- for [Spec]
-> return $ (choicesToSpec choices) -- :nextSols -- for [Spec]
-> Just head -> do cover head
-> startRow <- readSTRef (down (topNode head))
-> advance (startRow:choices)
->
-> advance choices@(newRow:oldChoices) = do
-> let endOfRows = topNode (getHead newRow)
-> if (newRow == endOfRows)
-> then do uncover (getHead newRow)
-> if (null oldChoices)
-> then error "No choices in advance" -- return [] -- for [Spec]
-> else recover oldChoices
-> else do coverOthers newRow
-> forward choices
->
-> recover (oldRow:oldChoices) = do
-> uncoverOthers oldRow
-> newRow <- readSTRef (down oldRow)
-> advance (newRow:oldChoices)
->
-> in forward []
-
-
- Convert a text board into a Spec
-
-> parseBoard :: String -> Spec
-> parseBoard s = Spec (zip rcs vs'check)
-> where rcs :: [(R,C)]
-> rcs = [ (R r,C c) | r <- rng, c <- rng ]
-> isUnset c = (c=='.') || (c==' ') || (c=='0')
-> isHint c = ('1'<=c) && (c<='9')
-> cs = take 81 $ filter (\c -> isUnset c || isHint c) s
-> vs :: [V]
-> vs = map (\c -> if isUnset c then u else (V $ digitToInt c)) cs
-> vs'check = if 81==length vs then vs else error ("parse of board failed\n"++s)
-
- This is quite useful as a utility function which partitions the list into groups of n elements.
- Used by showSpec.
-
-> groupTake :: Int->[a]->[[a]]
-> groupTake n b = unfoldr foo b
-> where foo [] = Nothing
-> foo b = Just (splitAt n b)
-
- Make a nice 2D ascii board from the Spec (not used at the moment)
-
-> showSpec :: Spec -> String
-> showSpec spec = let pa = parse spec
-> g = groupTake 9 (map (\(V v) -> if v == 0 then '.' else intToDigit v) $ elems pa)
-> addV line = concat $ intersperse "|" (groupTake 3 line)
-> addH list = concat $ intersperse ["---+---+---"] (groupTake 3 list)
-> in unlines $ addH (map addV g)
-
- One line display
-
-> showCompact spec = map (\(V v) -> intToDigit v) (elems (parse spec))
-
- The main routine is designed to handle the input from http://www.csse.uwa.edu.au/~gordon/sudoku17
-
-> main = do
-> all <- getContents
-> let puzzles = zip [1..] (map parseBoard (lines all))
-> root <- stToIO initHA
-> let act :: (Int,Spec) -> IO ()
-> act (i,spec) = do
-> answer <- stToIO (do initRoot root spec
-> answer <- gdance (fst root)
-> resetRoot root
-> return answer)
-> print (i,showCompact answer)
-> mapM_ act puzzles
-
-> inits' xn@(_:_) = zipWith take [0..] $ map (const xn) $ undefined:xn
-> inits' _ = undefined
diff --git a/tests/examplefiles/Deflate.fs b/tests/examplefiles/Deflate.fs
deleted file mode 100755
index 7d3680ec..00000000
--- a/tests/examplefiles/Deflate.fs
+++ /dev/null
@@ -1,578 +0,0 @@
-// public domain
-
-module Deflate
-
-open System
-open System.Collections.Generic
-open System.IO
-open System.Linq
-open Crc
-
-let maxbuf = 32768
-let maxlen = 258
-
-let getBit (b:byte) (bit:int) =
- if b &&& (1uy <<< bit) = 0uy then 0 else 1
-
-type BitReader(sin:Stream) =
- let mutable bit = 8
- let mutable cur = 0uy
-
- member x.Skip() =
- bit <- 8
-
- member x.ReadBit() =
- if bit = 8 then
- bit <- 0
- let b = sin.ReadByte()
- if b = -1 then
- failwith "バッファを超過しました"
- cur <- byte b
- let ret = if cur &&& (1uy <<< bit) = 0uy then 0 else 1
- bit <- bit + 1
- ret
-
- member x.ReadLE n =
- let mutable ret = 0
- for i = 0 to n - 1 do
- if x.ReadBit() = 1 then ret <- ret ||| (1 <<< i)
- ret
-
- member x.ReadBE n =
- let mutable ret = 0
- for i = 0 to n - 1 do
- ret <- (ret <<< 1) ||| x.ReadBit()
- ret
-
- member x.ReadBytes len =
- if bit <> 8 then bit <- 8
- let buf = Array.zeroCreate<byte> len
- ignore <| sin.Read(buf, 0, len)
- buf
-
-type WriteBuffer(sout:Stream) =
- let mutable prev:byte[] = null
- let mutable buf = Array.zeroCreate<byte> maxbuf
- let mutable p = 0
-
- let next newbuf =
- prev <- buf
- buf <- if newbuf then Array.zeroCreate<byte> maxbuf else null
- p <- 0
-
- member x.Close() =
- next false
- next false
-
- interface IDisposable with
- member x.Dispose() = x.Close()
-
- member x.WriteByte (b:byte) =
- buf.[p] <- b
- sout.WriteByte b
- p <- p + 1
- if p = maxbuf then next true
-
- member x.Write (src:byte[]) start len =
- let maxlen = maxbuf - p
- if len <= maxlen then
- Array.Copy(src, start, buf, p, len)
- sout.Write(src, start, len)
- p <- p + len
- if p = maxbuf then next true
- else
- x.Write src start maxlen
- x.Write src (start + maxlen) (len - maxlen)
-
- member x.Copy len dist =
- if dist < 1 then
- failwith <| sprintf "dist too small: %d < 1" dist
- elif dist > maxbuf then
- failwith <| sprintf "dist too big: %d > %d" dist maxbuf
- let pp = p - dist
- if pp < 0 then
- if prev = null then
- failwith <| sprintf "dist too big: %d > %d" dist p
- let pp = pp + maxbuf
- let maxlen = maxbuf - pp
- if len <= maxlen then
- x.Write prev pp len
- else
- x.Write prev pp maxlen
- x.Copy (len - maxlen) dist
- else
- let maxlen = p - pp
- if len <= maxlen then
- x.Write buf pp len
- else
- if dist = 1 then
- let b = buf.[pp]
- for i = 1 to len do
- x.WriteByte b
- else
- let buf' = buf
- let mutable len' = len
- while len' > 0 do
- let len'' = Math.Min(len', maxlen)
- x.Write buf' pp len''
- len' <- len' - len''
-
-type Huffman(lens:int[]) =
- let vals = Array.zeroCreate<int> lens.Length
- let min = lens.Where(fun x -> x > 0).Min()
- let max = lens.Max()
- let counts = Array.zeroCreate<int> (max + 1)
- let firsts = Array.zeroCreate<int> (max + 1)
- let nexts = Array.zeroCreate<int> (max + 1)
- let tables = Array.zeroCreate<int[]>(max + 1)
-
- do
- for len in lens do
- if len > 0 then counts.[len] <- counts.[len] + 1
- for i = 1 to max do
- firsts.[i] <- (firsts.[i - 1] + counts.[i - 1]) <<< 1
- Array.Copy(firsts, 0, nexts, 0, max + 1)
- for i = 0 to vals.Length - 1 do
- let len = lens.[i]
- if len > 0 then
- vals.[i] <- nexts.[len]
- nexts.[len] <- nexts.[len] + 1
-
- for i = 0 to vals.Length - 1 do
- let len = lens.[i]
- if len > 0 then
- let start = firsts.[len]
- if tables.[len] = null then
- let count = nexts.[len] - start
- tables.[len] <- Array.zeroCreate<int> count
- tables.[len].[vals.[i] - start] <- i
-
- member x.GetValue h =
- let rec getv i =
- if i > max then -1 else
- if h < nexts.[i] then
- tables.[i].[h - firsts.[i]]
- else
- getv (i + 1)
- getv min
-
- member x.Read(br:BitReader) =
- let rec read h i =
- if h < nexts.[i] then
- tables.[i].[h - firsts.[i]]
- else
- read ((h <<< 1) ||| br.ReadBit()) (i + 1)
- read (br.ReadBE min) min
-
-type [<AbstractClass>] HuffmanDecoder() =
- abstract GetValue: unit->int
- abstract GetDistance: unit->int
-
-type FixedHuffman(br:BitReader) =
- inherit HuffmanDecoder()
-
- override x.GetValue() =
- let v = br.ReadBE 7
- if v < 24 then v + 256 else
- let v = (v <<< 1) ||| br.ReadBit()
- if v < 192 then v - 48
- elif v < 200 then v + 88
- else ((v <<< 1) ||| br.ReadBit()) - 256
-
- override x.GetDistance() = br.ReadBE 5
-
-type DynamicHuffman(br:BitReader) =
- inherit HuffmanDecoder()
-
- let lit, dist =
- let hlit =
- let hlit = (br.ReadLE 5) + 257
- if hlit > 286 then failwith <| sprintf "hlit: %d > 286" hlit
- hlit
-
- let hdist =
- let hdist = (br.ReadLE 5) + 1
- if hdist > 32 then failwith <| sprintf "hdist: %d > 32" hdist
- hdist
-
- let hclen =
- let hclen = (br.ReadLE 4) + 4
- if hclen > 19 then failwith <| sprintf "hclen: %d > 19" hclen
- hclen
-
- let clen =
- let hclens = Array.zeroCreate<int> 19
- let order = [| 16; 17; 18; 0; 8; 7; 9; 6; 10; 5;
- 11; 4; 12; 3; 13; 2; 14; 1; 15 |]
- for i = 0 to hclen - 1 do
- hclens.[order.[i]] <- br.ReadLE 3
- new Huffman(hclens)
-
- let ld = Array.zeroCreate<int>(hlit + hdist)
- let mutable i = 0
- while i < ld.Length do
- let v = clen.Read(br)
- if v < 16 then
- ld.[i] <- v
- i <- i + 1
- else
- let r, v =
- match v with
- | 16 -> (br.ReadLE 2) + 3, ld.[i - 1]
- | 17 -> (br.ReadLE 3) + 3, 0
- | 18 -> (br.ReadLE 7) + 11, 0
- | _ -> failwith "不正な値です。"
- for j = 0 to r - 1 do
- ld.[i + j] <- v
- i <- i + r
-
- new Huffman(ld.[0 .. hlit - 1]),
- new Huffman(ld.[hlit .. hlit + hdist - 1])
-
- override x.GetValue() = lit.Read br
- override x.GetDistance() = dist.Read br
-
-let getLitExLen v = if v < 265 || v = 285 then 0 else (v - 261) >>> 2
-let getDistExLen d = if d < 4 then 0 else (d - 2) >>> 1
-
-let litlens =
- let litlens = Array.zeroCreate<int> 286
- let mutable v = 3
- for i = 257 to 284 do
- litlens.[i] <- v
- v <- v + (1 <<< (getLitExLen i))
- litlens.[285] <- maxlen
- litlens.[257..285]
-
-let distlens =
- let distlens = Array.zeroCreate<int> 30
- let mutable v = 1
- for i = 0 to 29 do
- distlens.[i] <- v
- v <- v + (1 <<< (getDistExLen i))
- distlens
-
-type Reader(sin:Stream) =
- inherit Stream()
-
- let br = new BitReader(sin)
- let fh = new FixedHuffman(br)
-
- let sout = new MemoryStream()
- let dbuf = new WriteBuffer(sout)
-
- let mutable cache:byte[] = null
- let mutable canRead = true
-
- let rec read (h:HuffmanDecoder) =
- let v = h.GetValue()
- if v > 285 then failwith <| sprintf "不正な値: %d" v
- if v < 256 then
- dbuf.WriteByte(byte v)
- elif v > 256 then
- let len =
- if v < 265 then v - 254 else
- litlens.[v - 257] + (br.ReadLE (getLitExLen v))
- let dist =
- let d = h.GetDistance()
- if d > 29 then failwith <| sprintf "不正な距離: %d" d
- if d < 4 then d + 1 else
- distlens.[d] + (br.ReadLE (getDistExLen d))
- dbuf.Copy len dist
- if v <> 256 then read h
-
- override x.CanRead = canRead
- override x.CanWrite = false
- override x.CanSeek = false
- override x.Flush() = ()
-
- override x.Close() =
- dbuf.Close()
- canRead <- false
-
- override x.Read(buffer, offset, count) =
- let offset =
- if cache = null then 0 else
- let clen = cache.Length
- let len = Math.Min(clen, count)
- Array.Copy(cache, 0, buffer, offset, len)
- cache <- if len = clen then null
- else cache.[len .. clen - 1]
- len
- let req = int64 <| count - offset
- while canRead && sout.Length < req do
- x.readBlock()
- let len =
- if sout.Length = 0L then 0 else
- let data = sout.ToArray()
- sout.SetLength(0L)
- let dlen = data.Length
- let len = Math.Min(int req, dlen)
- Array.Copy(data, 0, buffer, offset, len)
- if dlen > len then
- cache <- data.[len..]
- len
- offset + len
-
- override x.Position
- with get() = raise <| new NotImplementedException()
- and set(v) = raise <| new NotImplementedException()
-
- override x.Length = raise <| new NotImplementedException()
- override x.Seek(_, _) = raise <| new NotImplementedException()
- override x.Write(_, _, _) = raise <| new NotImplementedException()
- override x.SetLength(_) = raise <| new NotImplementedException()
-
- member private x.readBlock() =
- let bfinal = br.ReadBit()
- match br.ReadLE 2 with
- | 0 -> br.Skip()
- let len = br.ReadLE 16
- let nlen = br.ReadLE 16
- if len + nlen <> 0x10000 then
- failwith "不正な非圧縮長"
- dbuf.Write (br.ReadBytes len) 0 len
- | 1 -> read fh
- | 2 -> read (new DynamicHuffman(br))
- | _ -> failwith "不正なブロックタイプ"
- if bfinal = 1 then
- canRead <- false
- x.Close()
-
-type BitWriter(sout:Stream) =
- let mutable bit = 0
- let mutable cur = 0uy
-
- member x.Skip() =
- if bit > 0 then
- sout.WriteByte(cur)
- bit <- 0
- cur <- 0uy
-
- interface IDisposable with
- member x.Dispose() =
- x.Skip()
- sout.Flush()
-
- member x.WriteBit(b:int) =
- cur <- cur ||| ((byte b) <<< bit)
- bit <- bit + 1
- if bit = 8 then
- sout.WriteByte(cur)
- bit <- 0
- cur <- 0uy
-
- member x.WriteLE (len:int) (b:int) =
- for i = 0 to len - 1 do
- x.WriteBit <| if (b &&& (1 <<< i)) = 0 then 0 else 1
-
- member x.WriteBE (len:int) (b:int) =
- for i = len - 1 downto 0 do
- x.WriteBit <| if (b &&& (1 <<< i)) = 0 then 0 else 1
-
- member x.WriteBytes(data:byte[]) =
- x.Skip()
- sout.Write(data, 0, data.Length)
-
-type FixedHuffmanWriter(bw:BitWriter) =
- member x.Write (b:int) =
- if b < 144 then
- bw.WriteBE 8 (b + 0b110000)
- elif b < 256 then
- bw.WriteBE 9 (b - 144 + 0b110010000)
- elif b < 280 then
- bw.WriteBE 7 (b - 256)
- elif b < 288 then
- bw.WriteBE 8 (b - 280 + 0b11000000)
-
- member x.WriteLen (len:int) =
- if len < 3 || len > maxlen then
- failwith <| sprintf "不正な長さ: %d" len
- let mutable ll = 285
- while len < litlens.[ll - 257] do
- ll <- ll - 1
- x.Write ll
- bw.WriteLE (getLitExLen ll) (len - litlens.[ll - 257])
-
- member x.WriteDist (d:int) =
- if d < 1 || d > maxbuf then
- failwith <| sprintf "不正な距離: %d" d
- let mutable dl = 29
- while d < distlens.[dl] do
- dl <- dl - 1
- bw.WriteBE 5 dl
- bw.WriteLE (getDistExLen dl) (d - distlens.[dl])
-
-let maxbuf2 = maxbuf * 2
-let buflen = maxbuf2 + maxlen
-
-let inline getHash (buf:byte[]) pos =
- ((int buf.[pos]) <<< 4) ^^^ ((int buf.[pos + 1]) <<< 2) ^^^ (int buf.[pos + 2])
-
-let inline addHash (hash:List<int>[]) (buf:byte[]) pos =
- if buf.[pos] <> buf.[pos + 1] then
- hash.[getHash buf pos].Add pos
-
-let inline addHash2 (tables:int[,]) (counts:int[]) (buf:byte[]) pos =
- if buf.[pos] <> buf.[pos + 1] then
- let h = getHash buf pos
- let c = counts.[h]
- tables.[h, c &&& 15] <- pos
- counts.[h] <- c + 1
-
-type Writer(t:int, sin:Stream) =
- let mutable length = buflen
- let buf = Array.zeroCreate<byte> buflen
- let tables, counts =
- if t = 2 then Array2D.zeroCreate<int> 4096 16, Array.create 4096 0 else null, null
- let hash = if tables = null then [| for _ in 0..4095 -> new List<int>() |] else null
- let mutable crc = ~~~0u
-
- let read pos len =
- let rlen = sin.Read(buf, pos, len)
- if rlen < len then length <- pos + rlen
- for i = pos to pos + rlen - 1 do
- let b = int(crc ^^^ (uint32 buf.[i])) &&& 0xff
- crc <- (crc >>> 8) ^^^ crc32_table.[b]
- if hash <> null then
- for list in hash do list.Clear()
- else
- Array.fill counts 0 counts.Length 0
-
- do
- read 0 buflen
-
- let search (pos:int) =
- let mutable maxp = -1
- let mutable maxl = 2
- let mlen = Math.Min(maxlen, length - pos)
- let last = Math.Max(0, pos - maxbuf)
- let h = getHash buf pos
- if hash <> null then
- let list = hash.[h]
- let mutable i = list.Count - 1
- while i >= 0 do
- let p = list.[i]
- if p < last then i <- 0 else
- let mutable len = 0
- while len < mlen && buf.[p + len] = buf.[pos + len] do
- len <- len + 1
- if len > maxl then
- maxp <- p
- maxl <- len
- i <- i - 1
- else
- let c = counts.[h]
- let p1, p2 = if c < 16 then 0, c - 1 else c + 1, c + 16
- let mutable i = p2
- while i >= p1 do
- let p = tables.[h, i &&& 15]
- if p < last then i <- 0 else
- let mutable len = 0
- while len < mlen && buf.[p + len] = buf.[pos + len] do
- len <- len + 1
- if len > maxl then
- maxp <- p
- maxl <- len
- i <- i - 1
- maxp, maxl
-
- member x.Crc = ~~~crc
-
- member x.Compress (sout:Stream) =
- use bw = new BitWriter(sout)
- bw.WriteBit 1
- bw.WriteLE 2 1
- let hw = new FixedHuffmanWriter(bw)
- let mutable p = 0
- match t with
- | 2 ->
- while p < length do
- let b = buf.[p]
- if p < length - 4 && b = buf.[p + 1] && b = buf.[p + 2] && b = buf.[p + 3] then
- let mutable len = 4
- let mlen = Math.Min(maxlen + 1, length - p)
- while len < mlen && b = buf.[p + len] do
- len <- len + 1
- hw.Write(int b)
- hw.WriteLen(len - 1)
- hw.WriteDist 1
- p <- p + len
- else
- let maxp, maxl = search p
- if maxp < 0 then
- hw.Write(int b)
- addHash2 tables counts buf p
- p <- p + 1
- else
- hw.WriteLen maxl
- hw.WriteDist (p - maxp)
- for i = p to p + maxl - 1 do
- addHash2 tables counts buf i
- p <- p + maxl
- if p > maxbuf2 then
- Array.Copy(buf, maxbuf, buf, 0, maxbuf + maxlen)
- if length < buflen then length <- length - maxbuf else
- read (maxbuf + maxlen) maxbuf
- p <- p - maxbuf
- for i = 0 to p - 1 do
- addHash2 tables counts buf i
- | 1 ->
- while p < length do
- let b = buf.[p]
- if p < length - 4 && b = buf.[p + 1] && b = buf.[p + 2] && b = buf.[p + 3] then
- let mutable len = 4
- let mlen = Math.Min(maxlen + 1, length - p)
- while len < mlen && b = buf.[p + len] do
- len <- len + 1
- hw.Write(int b)
- hw.WriteLen(len - 1)
- hw.WriteDist 1
- p <- p + len
- else
- let maxp, maxl = search p
- if maxp < 0 then
- hw.Write(int b)
- addHash hash buf p
- p <- p + 1
- else
- hw.WriteLen maxl
- hw.WriteDist (p - maxp)
- for i = p to p + maxl - 1 do
- addHash hash buf i
- p <- p + maxl
- if p > maxbuf2 then
- Array.Copy(buf, maxbuf, buf, 0, maxbuf + maxlen)
- if length < buflen then length <- length - maxbuf else
- read (maxbuf + maxlen) maxbuf
- p <- p - maxbuf
- for i = 0 to p - 1 do
- addHash hash buf i
- | _ ->
- while p < length do
- let maxp, maxl = search p
- if maxp < 0 then
- hw.Write(int buf.[p])
- hash.[getHash buf p].Add p
- p <- p + 1
- else
- hw.WriteLen maxl
- hw.WriteDist (p - maxp)
- for i = p to p + maxl - 1 do
- hash.[getHash buf i].Add i
- p <- p + maxl
- if p > maxbuf2 then
- Array.Copy(buf, maxbuf, buf, 0, maxbuf + maxlen)
- if length < buflen then length <- length - maxbuf else
- read (maxbuf + maxlen) maxbuf
- p <- p - maxbuf
- for i = 0 to p - 1 do
- hash.[getHash buf i].Add i
- hw.Write 256
-
-let GetCompressBytes (sin:Stream) =
- let now = DateTime.Now
- let ms = new MemoryStream()
- let w = new Writer(1, sin)
- w.Compress ms
- ms.ToArray(), w.Crc
diff --git a/tests/examplefiles/Error.pmod b/tests/examplefiles/Error.pmod
deleted file mode 100644
index 808ecb0e..00000000
--- a/tests/examplefiles/Error.pmod
+++ /dev/null
@@ -1,38 +0,0 @@
-#pike __REAL_VERSION__
-
-constant Generic = __builtin.GenericError;
-
-constant Index = __builtin.IndexError;
-
-constant BadArgument = __builtin.BadArgumentError;
-
-constant Math = __builtin.MathError;
-
-constant Resource = __builtin.ResourceError;
-
-constant Permission = __builtin.PermissionError;
-
-constant Decode = __builtin.DecodeError;
-
-constant Cpp = __builtin.CppError;
-
-constant Compilation = __builtin.CompilationError;
-
-constant MasterLoad = __builtin.MasterLoadError;
-
-constant ModuleLoad = __builtin.ModuleLoadError;
-
-//! Returns an Error object for any argument it receives. If the
-//! argument already is an Error object or is empty, it does nothing.
-object mkerror(mixed error)
-{
- if (error == UNDEFINED)
- return error;
- if (objectp(error) && error->is_generic_error)
- return error;
- if (arrayp(error))
- return Error.Generic(@error);
- if (stringp(error))
- return Error.Generic(error);
- return Error.Generic(sprintf("%O", error));
-} \ No newline at end of file
diff --git a/tests/examplefiles/Errors.scala b/tests/examplefiles/Errors.scala
deleted file mode 100644
index 7af70280..00000000
--- a/tests/examplefiles/Errors.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-/* This file /* which is totally legal scala */ will not be highlighted
- correcty by pygments */
-
-object ⌘ {
- val `interface` = """
-A
-"Multiline"
-String
-"""
-
- val foo_+ = "foo plus"
- val foo_⌬⌬ = "double benzene"
-
- // Test some interpolated strings
- val mu = s"${if (true) "a:b" else "c" {with "braces"}}"
- val mu2 = f"${if (true) "a:b" else "c" {with "braces"}}"
- val raw = raw"a raw\nstring\"with escaped quotes"
-
- def main(argv: Array[String]) {
- println(⌘.interface + " " + foo_+ + " " + foo_⌬⌬ )
- }
-}
-
diff --git a/tests/examplefiles/FakeFile.pike b/tests/examplefiles/FakeFile.pike
deleted file mode 100644
index 48f3ea64..00000000
--- a/tests/examplefiles/FakeFile.pike
+++ /dev/null
@@ -1,360 +0,0 @@
-#pike __REAL_VERSION__
-
-//! A string wrapper that pretends to be a @[Stdio.File] object
-//! in addition to some features of a @[Stdio.FILE] object.
-
-
-//! This constant can be used to distinguish a FakeFile object
-//! from a real @[Stdio.File] object.
-constant is_fake_file = 1;
-
-protected string data;
-protected int ptr;
-protected int(0..1) r;
-protected int(0..1) w;
-protected int mtime;
-
-protected function read_cb;
-protected function read_oob_cb;
-protected function write_cb;
-protected function write_oob_cb;
-protected function close_cb;
-
-//! @seealso
-//! @[Stdio.File()->close()]
-int close(void|string direction) {
- direction = lower_case(direction||"rw");
- int cr = has_value(direction, "r");
- int cw = has_value(direction, "w");
-
- if(cr) {
- r = 0;
- }
-
- if(cw) {
- w = 0;
- }
-
- // FIXME: Close callback
- return 1;
-}
-
-//! @decl void create(string data, void|string type, void|int pointer)
-//! @seealso
-//! @[Stdio.File()->create()]
-void create(string _data, void|string type, int|void _ptr) {
- if(!_data) error("No data string given to FakeFile.\n");
- data = _data;
- ptr = _ptr;
- mtime = time();
- if(type) {
- type = lower_case(type);
- if(has_value(type, "r"))
- r = 1;
- if(has_value(type, "w"))
- w = 1;
- }
- else
- r = w = 1;
-}
-
-protected string make_type_str() {
- string type = "";
- if(r) type += "r";
- if(w) type += "w";
- return type;
-}
-
-//! @seealso
-//! @[Stdio.File()->dup()]
-this_program dup() {
- return this_program(data, make_type_str(), ptr);
-}
-
-//! Always returns 0.
-//! @seealso
-//! @[Stdio.File()->errno()]
-int errno() { return 0; }
-
-//! Returns size and the creation time of the string.
-Stdio.Stat stat() {
- Stdio.Stat st = Stdio.Stat();
- st->size = sizeof(data);
- st->mtime=st->ctime=mtime;
- st->atime=time();
- return st;
-}
-
-//! @seealso
-//! @[Stdio.File()->line_iterator()]
-String.SplitIterator line_iterator(int|void trim) {
- if(trim)
- return String.SplitIterator( data-"\r", '\n' );
- return String.SplitIterator( data, '\n' );
-}
-
-protected mixed id;
-
-//! @seealso
-//! @[Stdio.File()->query_id()]
-mixed query_id() { return id; }
-
-//! @seealso
-//! @[Stdio.File()->set_id()]
-void set_id(mixed _id) { id = _id; }
-
-//! @seealso
-//! @[Stdio.File()->read_function()]
-function(:string) read_function(int nbytes) {
- return lambda() { return read(nbytes); };
-}
-
-//! @seealso
-//! @[Stdio.File()->peek()]
-int(-1..1) peek(int|float|void timeout) {
- if(!r) return -1;
- if(ptr >= sizeof(data)) return 0;
- return 1;
-}
-
-//! Always returns 0.
-//! @seealso
-//! @[Stdio.File()->query_address()]
-string query_address(void|int(0..1) is_local) { return 0; }
-
-//! @seealso
-//! @[Stdio.File()->read()]
-string read(void|int(0..) len, void|int(0..1) not_all) {
- if(!r) return 0;
- if (len < 0) error("Cannot read negative number of characters.\n");
- int start=ptr;
- ptr += len;
- if(zero_type(len) || ptr>sizeof(data))
- ptr = sizeof(data);
-
- // FIXME: read callback
- return data[start..ptr-1];
-}
-
-//! @seealso
-//! @[Stdio.FILE()->gets()]
-string gets() {
- if(!r) return 0;
- string ret;
- sscanf(data,"%*"+(string)ptr+"s%[^\n]",ret);
- if(ret)
- {
- ptr+=sizeof(ret)+1;
- if(ptr>sizeof(data))
- {
- ptr=sizeof(data);
- if(!sizeof(ret))
- ret = 0;
- }
- }
-
- // FIXME: read callback
- return ret;
-}
-
-//! @seealso
-//! @[Stdio.FILE()->getchar()]
-int getchar() {
- if(!r) return 0;
- int c;
- if(catch(c=data[ptr]))
- c=-1;
- else
- ptr++;
-
- // FIXME: read callback
- return c;
-}
-
-//! @seealso
-//! @[Stdio.FILE()->unread()]
-void unread(string s) {
- if(!r) return;
- if(data[ptr-sizeof(s)..ptr-1]==s)
- ptr-=sizeof(s);
- else
- {
- data=s+data[ptr..];
- ptr=0;
- }
-}
-
-//! @seealso
-//! @[Stdio.File()->seek()]
-int seek(int pos, void|int mult, void|int add) {
- if(mult)
- pos = pos*mult+add;
- if(pos<0)
- {
- pos = sizeof(data)+pos;
- if( pos < 0 )
- pos = 0;
- }
- ptr = pos;
- if( ptr > strlen( data ) )
- ptr = strlen(data);
- return ptr;
-}
-
-//! Always returns 1.
-//! @seealso
-//! @[Stdio.File()->sync()]
-int(1..1) sync() { return 1; }
-
-//! @seealso
-//! @[Stdio.File()->tell()]
-int tell() { return ptr; }
-
-//! @seealso
-//! @[Stdio.File()->truncate()]
-int(0..1) truncate(int length) {
- data = data[..length-1];
- return sizeof(data)==length;
-}
-
-//! @seealso
-//! @[Stdio.File()->write()]
-int(-1..) write(string|array(string) str, mixed ... extra) {
- if(!w) return -1;
- if(arrayp(str)) str=str*"";
- if(sizeof(extra)) str=sprintf(str, @extra);
-
- if(ptr==sizeof(data)) {
- data += str;
- ptr = sizeof(data);
- }
- else if(sizeof(str)==1)
- data[ptr++] = str[0];
- else {
- data = data[..ptr-1] + str + data[ptr+sizeof(str)..];
- ptr += sizeof(str);
- }
-
- // FIXME: write callback
- return sizeof(str);
-}
-
-//! @seealso
-//! @[Stdio.File()->set_blocking]
-void set_blocking() {
- close_cb = 0;
- read_cb = 0;
- read_oob_cb = 0;
- write_cb = 0;
- write_oob_cb = 0;
-}
-
-//! @seealso
-//! @[Stdio.File()->set_blocking_keep_callbacks]
-void set_blocking_keep_callbacks() { }
-
-//! @seealso
-//! @[Stdio.File()->set_blocking]
-void set_nonblocking(function rcb, function wcb, function ccb,
- function rocb, function wocb) {
- read_cb = rcb;
- write_cb = wcb;
- close_cb = ccb;
- read_oob_cb = rocb;
- write_oob_cb = wocb;
-}
-
-//! @seealso
-//! @[Stdio.File()->set_blocking_keep_callbacks]
-void set_nonblocking_keep_callbacks() { }
-
-
-//! @seealso
-//! @[Stdio.File()->set_close_callback]
-void set_close_callback(function cb) { close_cb = cb; }
-
-//! @seealso
-//! @[Stdio.File()->set_read_callback]
-void set_read_callback(function cb) { read_cb = cb; }
-
-//! @seealso
-//! @[Stdio.File()->set_read_oob_callback]
-void set_read_oob_callback(function cb) { read_oob_cb = cb; }
-
-//! @seealso
-//! @[Stdio.File()->set_write_callback]
-void set_write_callback(function cb) { write_cb = cb; }
-
-//! @seealso
-//! @[Stdio.File()->set_write_oob_callback]
-void set_write_oob_callback(function cb) { write_oob_cb = cb; }
-
-
-//! @seealso
-//! @[Stdio.File()->query_close_callback]
-function query_close_callback() { return close_cb; }
-
-//! @seealso
-//! @[Stdio.File()->query_read_callback]
-function query_read_callback() { return read_cb; }
-
-//! @seealso
-//! @[Stdio.File()->query_read_oob_callback]
-function query_read_oob_callback() { return read_oob_cb; }
-
-//! @seealso
-//! @[Stdio.File()->query_write_callback]
-function query_write_callback() { return write_cb; }
-
-//! @seealso
-//! @[Stdio.File()->query_write_oob_callback]
-function query_write_oob_callback() { return write_oob_cb; }
-
-string _sprintf(int t) {
- return t=='O' && sprintf("%O(%d,%O)", this_program, sizeof(data),
- make_type_str());
-}
-
-
-// FakeFile specials.
-
-//! A FakeFile can be casted to a string.
-mixed cast(string to) {
- switch(to) {
- case "string": return data;
- case "object": return this;
- }
- error("Can not cast object to %O.\n", to);
-}
-
-//! Sizeof on a FakeFile returns the size of its contents.
-int(0..) _sizeof() {
- return sizeof(data);
-}
-
-//! @ignore
-
-#define NOPE(X) mixed X (mixed ... args) { error("This is a FakeFile. %s is not available.\n", #X); }
-NOPE(assign);
-NOPE(async_connect);
-NOPE(connect);
-NOPE(connect_unix);
-NOPE(open);
-NOPE(open_socket);
-NOPE(pipe);
-NOPE(tcgetattr);
-NOPE(tcsetattr);
-
-// Stdio.Fd
-NOPE(dup2);
-NOPE(lock); // We could implement this
-NOPE(mode); // We could implement this
-NOPE(proxy); // We could implement this
-NOPE(query_fd);
-NOPE(read_oob);
-NOPE(set_close_on_exec);
-NOPE(set_keepalive);
-NOPE(trylock); // We could implement this
-NOPE(write_oob);
-
-//! @endignore \ No newline at end of file
diff --git a/tests/examplefiles/Get-CommandDefinitionHtml.ps1 b/tests/examplefiles/Get-CommandDefinitionHtml.ps1
deleted file mode 100644
index b181955f..00000000
--- a/tests/examplefiles/Get-CommandDefinitionHtml.ps1
+++ /dev/null
@@ -1,66 +0,0 @@
-
-function Get-CommandDefinitionHtml {
-
- # this tells powershell to allow advanced features,
- # like the [validatenotnullorempty()] attribute below.
- [CmdletBinding()]
- param(
- [ValidateNotNullOrEmpty()]
- [string]$name
- )
-
- $command = get-command $name
-
- # Look mom! I'm a cmdlet!
- $PSCmdlet.WriteVerbose("Dumping HTML for " + $command)
-
-@"
- <html>
- <head>
- <title>$($command.name)</title>
- </head>
- <body>
- <table border="1">
-$(
- $command.parametersets | % {
-@"
-
- <tr>
- <td>$($_.name)</td>
- <td>
- <table border="1">
- <tr>
- <th colspan="8">Parameters</th>
-
-$(
- $count = 0
- $_.parameters | % {
- if (0 -eq ($count % 8)) {
-@'
- </tr>
- <tr>
-'@
- }
-@"
- <td>$($_.name)</td>
-"@
- $count++
- }
-)
- </tr>
- </table>
- </td>
- </tr>
-"@
- }
-)
- </table>
- </body>
- </html>
-"@
-}
-
-Get-CommandDefinitionHtml get-item > out.html
-
-# show in browser
-invoke-item out.html
diff --git a/tests/examplefiles/IPDispatchC.nc b/tests/examplefiles/IPDispatchC.nc
deleted file mode 100644
index 95a61a2c..00000000
--- a/tests/examplefiles/IPDispatchC.nc
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * "Copyright (c) 2008-2011 The Regents of the University of California.
- * All rights reserved."
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice, the following
- * two paragraphs and the author appear in all copies of this software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
- *
- */
-
-/**
- *
- *
- */
-#include "IPDispatch.h"
-#include "BlipStatistics.h"
-
-configuration IPDispatchC {
- provides {
- interface SplitControl;
- interface IPLower;
- interface BlipStatistics<ip_statistics_t>;
- }
-} implementation {
-
- components MainC;
- components NoLedsC as LedsC;
-
- /* IPDispatchP wiring -- fragment rassembly and lib6lowpan bindings */
- components IPDispatchP;
- components CC2420RadioC as MessageC;
- components ReadLqiC;
- components new TimerMilliC();
-
- SplitControl = IPDispatchP.SplitControl;
- IPLower = IPDispatchP;
- BlipStatistics = IPDispatchP;
-
- IPDispatchP.Boot -> MainC;
-/* #else */
-/* components ResourceSendP; */
-/* ResourceSendP.SubSend -> MessageC; */
-/* ResourceSendP.Resource -> MessageC.SendResource[unique("RADIO_SEND_RESOURCE")]; */
-/* IPDispatchP.Ieee154Send -> ResourceSendP.Ieee154Send; */
-/* #endif */
- IPDispatchP.RadioControl -> MessageC;
-
- IPDispatchP.BarePacket -> MessageC.BarePacket;
- IPDispatchP.Ieee154Send -> MessageC.BareSend;
- IPDispatchP.Ieee154Receive -> MessageC.BareReceive;
-
-#ifdef LOW_POWER_LISTENING
- IPDispatchP.LowPowerListening -> MessageC;
-#endif
- MainC.SoftwareInit -> IPDispatchP.Init;
-
- IPDispatchP.PacketLink -> MessageC;
- IPDispatchP.ReadLqi -> ReadLqiC;
- IPDispatchP.Leds -> LedsC;
- IPDispatchP.ExpireTimer -> TimerMilliC;
-
- components new PoolC(message_t, N_FRAGMENTS) as FragPool;
- components new PoolC(struct send_entry, N_FRAGMENTS) as SendEntryPool;
- components new QueueC(struct send_entry *, N_FRAGMENTS);
- components new PoolC(struct send_info, N_CONCURRENT_SENDS) as SendInfoPool;
-
- IPDispatchP.FragPool -> FragPool;
- IPDispatchP.SendEntryPool -> SendEntryPool;
- IPDispatchP.SendInfoPool -> SendInfoPool;
- IPDispatchP.SendQueue -> QueueC;
-
- components IPNeighborDiscoveryP;
- IPDispatchP.NeighborDiscovery -> IPNeighborDiscoveryP;
-
-/* components ICMPResponderC; */
-/* #ifdef BLIP_MULTICAST */
-/* components MulticastP; */
-/* components new TrickleTimerMilliC(2, 30, 2, 1); */
-/* IP = MulticastP.IP; */
-
-/* MainC.SoftwareInit -> MulticastP.Init; */
-/* MulticastP.MulticastRx -> IPDispatchP.Multicast; */
-/* MulticastP.HopHeader -> IPExtensionP.HopByHopExt[0]; */
-/* MulticastP.TrickleTimer -> TrickleTimerMilliC.TrickleTimer[0]; */
-/* MulticastP.IPExtensions -> IPDispatchP; */
-/* #endif */
-
-#ifdef DELUGE
- components NWProgC;
-#endif
-
-}
diff --git a/tests/examplefiles/IPDispatchP.nc b/tests/examplefiles/IPDispatchP.nc
deleted file mode 100644
index 628f39a0..00000000
--- a/tests/examplefiles/IPDispatchP.nc
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- * "Copyright (c) 2008 The Regents of the University of California.
- * All rights reserved."
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice, the following
- * two paragraphs and the author appear in all copies of this software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
- *
- */
-
-#include <lib6lowpan/blip-tinyos-includes.h>
-#include <lib6lowpan/6lowpan.h>
-#include <lib6lowpan/lib6lowpan.h>
-#include <lib6lowpan/ip.h>
-#include <lib6lowpan/in_cksum.h>
-#include <lib6lowpan/ip_malloc.h>
-
-#include "blip_printf.h"
-#include "IPDispatch.h"
-#include "BlipStatistics.h"
-#include "table.h"
-
-/*
- * Provides IP layer reception to applications on motes.
- *
- * @author Stephen Dawson-Haggerty <stevedh@cs.berkeley.edu>
- */
-
-module IPDispatchP {
- provides {
- interface SplitControl;
- // interface for protocols not requiring special hand-holding
- interface IPLower;
-
- interface BlipStatistics<ip_statistics_t>;
-
- }
- uses {
- interface Boot;
-
-
- /* link-layer wiring */
- interface SplitControl as RadioControl;
-
- interface Packet as BarePacket;
- interface Send as Ieee154Send;
- interface Receive as Ieee154Receive;
-
- /* context lookup */
- interface NeighborDiscovery;
-
- interface ReadLqi;
- interface PacketLink;
- interface LowPowerListening;
-
- /* buffers for outgoing fragments */
- interface Pool<message_t> as FragPool;
- interface Pool<struct send_info> as SendInfoPool;
- interface Pool<struct send_entry> as SendEntryPool;
- interface Queue<struct send_entry *> as SendQueue;
-
- /* expire reconstruction */
- interface Timer<TMilli> as ExpireTimer;
-
- interface Leds;
-
- }
- provides interface Init;
-} implementation {
-
-#define HAVE_LOWPAN_EXTERN_MATCH_CONTEXT
-int lowpan_extern_read_context(struct in6_addr *addr, int context) {
- return call NeighborDiscovery.getContext(context, addr);
-}
-
-int lowpan_extern_match_context(struct in6_addr *addr, uint8_t *ctx_id) {
- return call NeighborDiscovery.matchContext(addr, ctx_id);
-}
-
- // generally including source files like this is a no-no. I'm doing
- // this in the hope that the optimizer will do a better job when
- // they're part of a component.
-#include <lib6lowpan/ieee154_header.c>
-#include <lib6lowpan/lib6lowpan.c>
-#include <lib6lowpan/lib6lowpan_4944.c>
-#include <lib6lowpan/lib6lowpan_frag.c>
-
- enum {
- S_RUNNING,
- S_STOPPED,
- S_STOPPING,
- };
- uint8_t state = S_STOPPED;
- bool radioBusy;
- uint8_t current_local_label = 0;
- ip_statistics_t stats;
-
- // this in theory could be arbitrarily large; however, it needs to
- // be large enough to hold all active reconstructions, and any tags
- // which we are dropping. It's important to keep dropped tags
- // around for a while, or else there are pathological situations
- // where you continually allocate buffers for packets which will
- // never complete.
-
- ////////////////////////////////////////
- //
- //
-
- table_t recon_cache;
-
- // table of packets we are currently receiving fragments from, that
- // are destined to us
- struct lowpan_reconstruct recon_data[N_RECONSTRUCTIONS];
-
- //
- //
- ////////////////////////////////////////
-
- // task void sendTask();
-
- void reconstruct_clear(void *ent) {
- struct lowpan_reconstruct *recon = (struct lowpan_reconstruct *)ent;
- memclr((uint8_t *)&recon->r_meta, sizeof(struct ip6_metadata));
- recon->r_timeout = T_UNUSED;
- recon->r_buf = NULL;
- }
-
- struct send_info *getSendInfo() {
- struct send_info *ret = call SendInfoPool.get();
- if (ret == NULL) return ret;
- ret->_refcount = 1;
- ret->upper_data = NULL;
- ret->failed = FALSE;
- ret->link_transmissions = 0;
- ret->link_fragments = 0;
- ret->link_fragment_attempts = 0;
- return ret;
- }
-#define SENDINFO_INCR(X) ((X)->_refcount)++
-void SENDINFO_DECR(struct send_info *si) {
- if (--(si->_refcount) == 0) {
- call SendInfoPool.put(si);
- }
-}
-
- command error_t SplitControl.start() {
- return call RadioControl.start();
- }
-
- command error_t SplitControl.stop() {
- if (!radioBusy) {
- state = S_STOPPED;
- return call RadioControl.stop();
- } else {
- // if there's a packet in the radio, wait for it to exit before
- // stopping
- state = S_STOPPING;
- return SUCCESS;
- }
- }
-
- event void RadioControl.startDone(error_t error) {
-#ifdef LPL_SLEEP_INTERVAL
- call LowPowerListening.setLocalWakeupInterval(LPL_SLEEP_INTERVAL);
-#endif
-
- if (error == SUCCESS) {
- call Leds.led2Toggle();
- call ExpireTimer.startPeriodic(FRAG_EXPIRE_TIME);
- state = S_RUNNING;
- radioBusy = FALSE;
- }
-
- signal SplitControl.startDone(error);
- }
-
- event void RadioControl.stopDone(error_t error) {
- signal SplitControl.stopDone(error);
- }
-
- command error_t Init.init() {
- // ip_malloc_init needs to be in init, not booted, because
- // context for coap is initialised in init
- ip_malloc_init();
- return SUCCESS;
- }
-
- event void Boot.booted() {
- call BlipStatistics.clear();
-
- /* set up our reconstruction cache */
- table_init(&recon_cache, recon_data, sizeof(struct lowpan_reconstruct), N_RECONSTRUCTIONS);
- table_map(&recon_cache, reconstruct_clear);
-
- call SplitControl.start();
- }
-
- /*
- * Receive-side code.
- */
- void deliver(struct lowpan_reconstruct *recon) {
- struct ip6_hdr *iph = (struct ip6_hdr *)recon->r_buf;
-
- // printf("deliver [%i]: ", recon->r_bytes_rcvd);
- // printf_buf(recon->r_buf, recon->r_bytes_rcvd);
-
- /* the payload length field is always compressed, have to put it back here */
- iph->ip6_plen = htons(recon->r_bytes_rcvd - sizeof(struct ip6_hdr));
- signal IPLower.recv(iph, (void *)(iph + 1), &recon->r_meta);
-
- // printf("ip_free(%p)\n", recon->r_buf);
- ip_free(recon->r_buf);
- recon->r_timeout = T_UNUSED;
- recon->r_buf = NULL;
- }
-
- /*
- * Bulletproof recovery logic is very important to make sure we
- * don't get wedged with no free buffers.
- *
- * The table is managed as follows:
- * - unused entries are marked T_UNUSED
- * - entries which
- * o have a buffer allocated
- * o have had a fragment reception before we fired
- * are marked T_ACTIVE
- * - entries which have not had a fragment reception during the last timer period
- * and were active are marked T_ZOMBIE
- * - zombie receptions are deleted: their buffer is freed and table entry marked unused.
- * - when a fragment is dropped, it is entered into the table as T_FAILED1.
- * no buffer is allocated
- * - when the timer fires, T_FAILED1 entries are aged to T_FAILED2.
- * - T_FAILED2 entries are deleted. Incomming fragments with tags
- * that are marked either FAILED1 or FAILED2 are dropped; this
- * prevents us from allocating a buffer for a packet which we
- * have already dropped fragments from.
- *
- */
- void reconstruct_age(void *elt) {
- struct lowpan_reconstruct *recon = (struct lowpan_reconstruct *)elt;
- if (recon->r_timeout != T_UNUSED)
- printf("recon src: 0x%x tag: 0x%x buf: %p recvd: %i/%i\n",
- recon->r_source_key, recon->r_tag, recon->r_buf,
- recon->r_bytes_rcvd, recon->r_size);
- switch (recon->r_timeout) {
- case T_ACTIVE:
- recon->r_timeout = T_ZOMBIE; break; // age existing receptions
- case T_FAILED1:
- recon->r_timeout = T_FAILED2; break; // age existing receptions
- case T_ZOMBIE:
- case T_FAILED2:
- // deallocate the space for reconstruction
- printf("timing out buffer: src: %i tag: %i\n", recon->r_source_key, recon->r_tag);
- if (recon->r_buf != NULL) {
- printf("ip_free(%p)\n", recon->r_buf);
- ip_free(recon->r_buf);
- }
- recon->r_timeout = T_UNUSED;
- recon->r_buf = NULL;
- break;
- }
- }
-
- void ip_print_heap() {
-#ifdef PRINTFUART_ENABLED
- bndrt_t *cur = (bndrt_t *)heap;
- while (((uint8_t *)cur) - heap < IP_MALLOC_HEAP_SIZE) {
- printf ("heap region start: %p length: %u used: %u\n",
- cur, (*cur & IP_MALLOC_LEN), (*cur & IP_MALLOC_INUSE) >> 15);
- cur = (bndrt_t *)(((uint8_t *)cur) + ((*cur) & IP_MALLOC_LEN));
- }
-#endif
- }
-
- event void ExpireTimer.fired() {
- table_map(&recon_cache, reconstruct_age);
-
-
- printf("Frag pool size: %i\n", call FragPool.size());
- printf("SendInfo pool size: %i\n", call SendInfoPool.size());
- printf("SendEntry pool size: %i\n", call SendEntryPool.size());
- printf("Forward queue length: %i\n", call SendQueue.size());
- ip_print_heap();
- printfflush();
- }
-
- /*
- * allocate a structure for recording information about incomming fragments.
- */
-
- struct lowpan_reconstruct *get_reconstruct(uint16_t key, uint16_t tag) {
- struct lowpan_reconstruct *ret = NULL;
- int i;
-
- // printf("get_reconstruct: %x %i\n", key, tag);
-
- for (i = 0; i < N_RECONSTRUCTIONS; i++) {
- struct lowpan_reconstruct *recon = (struct lowpan_reconstruct *)&recon_data[i];
-
- if (recon->r_tag == tag &&
- recon->r_source_key == key) {
-
- if (recon->r_timeout > T_UNUSED) {
- recon->r_timeout = T_ACTIVE;
- ret = recon;
- goto done;
-
- } else if (recon->r_timeout < T_UNUSED) {
- // if we have already tried and failed to get a buffer, we
- // need to drop remaining fragments.
- ret = NULL;
- goto done;
- }
- }
- if (recon->r_timeout == T_UNUSED)
- ret = recon;
- }
- done:
- // printf("got%p\n", ret);
- return ret;
- }
-
- event message_t *Ieee154Receive.receive(message_t *msg, void *msg_payload, uint8_t len) {
- struct packed_lowmsg lowmsg;
- struct ieee154_frame_addr frame_address;
- uint8_t *buf = msg_payload;
-
- // printf(" -- RECEIVE -- len : %i\n", len);
-
- BLIP_STATS_INCR(stats.rx_total);
-
- /* unpack the 802.15.4 address fields */
- buf = unpack_ieee154_hdr(msg_payload, &frame_address);
- len -= buf - (uint8_t *)msg_payload;
-
- /* unpack and 6lowpan headers */
- lowmsg.data = buf;
- lowmsg.len = len;
- lowmsg.headers = getHeaderBitmap(&lowmsg);
- if (lowmsg.headers == LOWMSG_NALP) {
- goto fail;
- }
-
- if (hasFrag1Header(&lowmsg) || hasFragNHeader(&lowmsg)) {
- // start reassembly
- int rv;
- struct lowpan_reconstruct *recon;
- uint16_t tag, source_key;
-
- source_key = ieee154_hashaddr(&frame_address.ieee_src);
- getFragDgramTag(&lowmsg, &tag);
- recon = get_reconstruct(source_key, tag);
- if (!recon) {
- goto fail;
- }
-
- /* fill in metadata: on fragmented packets, it applies to the
- first fragment only */
- memcpy(&recon->r_meta.sender, &frame_address.ieee_src,
- sizeof(ieee154_addr_t));
- recon->r_meta.lqi = call ReadLqi.readLqi(msg);
- recon->r_meta.rssi = call ReadLqi.readRssi(msg);
-
- if (hasFrag1Header(&lowmsg)) {
- if (recon->r_buf != NULL) goto fail;
- rv = lowpan_recon_start(&frame_address, recon, buf, len);
- } else {
- rv = lowpan_recon_add(recon, buf, len);
- }
-
- if (rv < 0) {
- recon->r_timeout = T_FAILED1;
- goto fail;
- } else {
- // printf("start recon buf: %p\n", recon->r_buf);
- recon->r_timeout = T_ACTIVE;
- recon->r_source_key = source_key;
- recon->r_tag = tag;
- }
-
- if (recon->r_size == recon->r_bytes_rcvd) {
- deliver(recon);
- }
-
- } else {
- /* no fragmentation, just deliver it */
- int rv;
- struct lowpan_reconstruct recon;
-
- /* fill in metadata */
- memcpy(&recon.r_meta.sender, &frame_address.ieee_src,
- sizeof(ieee154_addr_t));
- recon.r_meta.lqi = call ReadLqi.readLqi(msg);
- recon.r_meta.rssi = call ReadLqi.readRssi(msg);
-
- buf = getLowpanPayload(&lowmsg);
- if ((rv = lowpan_recon_start(&frame_address, &recon, buf, len)) < 0) {
- goto fail;
- }
-
- if (recon.r_size == recon.r_bytes_rcvd) {
- deliver(&recon);
- } else {
- // printf("ip_free(%p)\n", recon.r_buf);
- ip_free(recon.r_buf);
- }
- }
- goto done;
- fail:
- BLIP_STATS_INCR(stats.rx_drop);
- done:
- return msg;
- }
-
-
- /*
- * Send-side functionality
- */
- task void sendTask() {
- struct send_entry *s_entry;
-
- // printf("sendTask() - sending\n");
-
- if (radioBusy || state != S_RUNNING) return;
- if (call SendQueue.empty()) return;
- // this does not dequeue
- s_entry = call SendQueue.head();
-
-#ifdef LPL_SLEEP_INTERVAL
- call LowPowerListening.setRemoteWakeupInterval(s_entry->msg,
- call LowPowerListening.getLocalWakeupInterval());
-#endif
-
- if (s_entry->info->failed) {
- dbg("Drops", "drops: sendTask: dropping failed fragment\n");
- goto fail;
- }
-
- if ((call Ieee154Send.send(s_entry->msg,
- call BarePacket.payloadLength(s_entry->msg))) != SUCCESS) {
- dbg("Drops", "drops: sendTask: send failed\n");
- goto fail;
- } else {
- radioBusy = TRUE;
- }
-
- return;
- fail:
- printf("SEND FAIL\n");
- post sendTask();
- BLIP_STATS_INCR(stats.tx_drop);
-
- // deallocate the memory associated with this request.
- // other fragments associated with this packet will get dropped.
- s_entry->info->failed = TRUE;
- SENDINFO_DECR(s_entry->info);
- call FragPool.put(s_entry->msg);
- call SendEntryPool.put(s_entry);
- call SendQueue.dequeue();
- }
-
-
- /*
- * it will pack the message into the fragment pool and enqueue
- * those fragments for sending
- *
- * it will set
- * - payload length
- * - version, traffic class and flow label
- *
- * the source and destination IP addresses must be set by higher
- * layers.
- */
- command error_t IPLower.send(struct ieee154_frame_addr *frame_addr,
- struct ip6_packet *msg,
- void *data) {
- struct lowpan_ctx ctx;
- struct send_info *s_info;
- struct send_entry *s_entry;
- message_t *outgoing;
-
- int frag_len = 1;
- error_t rc = SUCCESS;
-
- if (state != S_RUNNING) {
- return EOFF;
- }
-
- /* set version to 6 in case upper layers forgot */
- msg->ip6_hdr.ip6_vfc &= ~IPV6_VERSION_MASK;
- msg->ip6_hdr.ip6_vfc |= IPV6_VERSION;
-
- ctx.tag = current_local_label++;
- ctx.offset = 0;
-
- s_info = getSendInfo();
- if (s_info == NULL) {
- rc = ERETRY;
- goto cleanup_outer;
- }
- s_info->upper_data = data;
-
- while (frag_len > 0) {
- s_entry = call SendEntryPool.get();
- outgoing = call FragPool.get();
-
- if (s_entry == NULL || outgoing == NULL) {
- if (s_entry != NULL)
- call SendEntryPool.put(s_entry);
- if (outgoing != NULL)
- call FragPool.put(outgoing);
- // this will cause any fragments we have already enqueued to
- // be dropped by the send task.
- s_info->failed = TRUE;
- printf("drops: IP send: no fragments\n");
- rc = ERETRY;
- goto done;
- }
-
- call BarePacket.clear(outgoing);
- frag_len = lowpan_frag_get(call Ieee154Send.getPayload(outgoing, 0),
- call BarePacket.maxPayloadLength(),
- msg,
- frame_addr,
- &ctx);
- if (frag_len < 0) {
- printf(" get frag error: %i\n", frag_len);
- }
-
- printf("fragment length: %i offset: %i\n", frag_len, ctx.offset);
- call BarePacket.setPayloadLength(outgoing, frag_len);
-
- if (frag_len <= 0) {
- call FragPool.put(outgoing);
- call SendEntryPool.put(s_entry);
- goto done;
- }
-
- if (call SendQueue.enqueue(s_entry) != SUCCESS) {
- BLIP_STATS_INCR(stats.encfail);
- s_info->failed = TRUE;
- printf("drops: IP send: enqueue failed\n");
- goto done;
- }
-
- s_info->link_fragments++;
- s_entry->msg = outgoing;
- s_entry->info = s_info;
-
- /* configure the L2 */
- if (frame_addr->ieee_dst.ieee_mode == IEEE154_ADDR_SHORT &&
- frame_addr->ieee_dst.i_saddr == IEEE154_BROADCAST_ADDR) {
- call PacketLink.setRetries(s_entry->msg, 0);
- } else {
- call PacketLink.setRetries(s_entry->msg, BLIP_L2_RETRIES);
- }
- call PacketLink.setRetryDelay(s_entry->msg, BLIP_L2_DELAY);
-
- SENDINFO_INCR(s_info);}
-
- // printf("got %i frags\n", s_info->link_fragments);
- done:
- BLIP_STATS_INCR(stats.sent);
- SENDINFO_DECR(s_info);
- post sendTask();
- cleanup_outer:
- return rc;
- }
-
- event void Ieee154Send.sendDone(message_t *msg, error_t error) {
- struct send_entry *s_entry = call SendQueue.head();
-
- radioBusy = FALSE;
-
- // printf("sendDone: %p %i\n", msg, error);
-
- if (state == S_STOPPING) {
- call RadioControl.stop();
- state = S_STOPPED;
- goto done;
- }
-
- s_entry->info->link_transmissions += (call PacketLink.getRetries(msg));
- s_entry->info->link_fragment_attempts++;
-
- if (!call PacketLink.wasDelivered(msg)) {
- printf("sendDone: was not delivered! (%i tries)\n",
- call PacketLink.getRetries(msg));
- s_entry->info->failed = TRUE;
- signal IPLower.sendDone(s_entry->info);
-/* if (s_entry->info->policy.dest[0] != 0xffff) */
-/* dbg("Drops", "drops: sendDone: frag was not delivered\n"); */
- // need to check for broadcast frames
- // BLIP_STATS_INCR(stats.tx_drop);
- } else if (s_entry->info->link_fragment_attempts ==
- s_entry->info->link_fragments) {
- signal IPLower.sendDone(s_entry->info);
- }
-
- done:
- // kill off any pending fragments
- SENDINFO_DECR(s_entry->info);
- call FragPool.put(s_entry->msg);
- call SendEntryPool.put(s_entry);
- call SendQueue.dequeue();
-
- post sendTask();
- }
-
-#if 0
- command struct tlv_hdr *IPExtensions.findTlv(struct ip6_ext *ext, uint8_t tlv_val) {
- int len = ext->len - sizeof(struct ip6_ext);
- struct tlv_hdr *tlv = (struct tlv_hdr *)(ext + 1);
- while (len > 0) {
- if (tlv->type == tlv_val) return tlv;
- if (tlv->len == 0) return NULL;
- tlv = (struct tlv_hdr *)(((uint8_t *)tlv) + tlv->len);
- len -= tlv->len;
- }
- return NULL;
- }
-#endif
-
-
- /*
- * BlipStatistics interface
- */
- command void BlipStatistics.get(ip_statistics_t *statistics) {
-#ifdef BLIP_STATS_IP_MEM
- stats.fragpool = call FragPool.size();
- stats.sendinfo = call SendInfoPool.size();
- stats.sendentry= call SendEntryPool.size();
- stats.sndqueue = call SendQueue.size();
- stats.heapfree = ip_malloc_freespace();
- printf("frag: %i sendinfo: %i sendentry: %i sendqueue: %i heap: %i\n",
- stats.fragpool,
- stats.sendinfo,
- stats.sendentry,
- stats.sndqueue,
- stats.heapfree);
-#endif
- memcpy(statistics, &stats, sizeof(ip_statistics_t));
-
- }
-
- command void BlipStatistics.clear() {
- memclr((uint8_t *)&stats, sizeof(ip_statistics_t));
- }
-
-/* default event void IP.recv[uint8_t nxt_hdr](struct ip6_hdr *iph, */
-/* void *payload, */
-/* struct ip_metadata *meta) { */
-/* } */
-
-/* default event void Multicast.recv[uint8_t scope](struct ip6_hdr *iph, */
-/* void *payload, */
-/* struct ip_metadata *meta) { */
-/* } */
-}
diff --git a/tests/examplefiles/Intro.java b/tests/examplefiles/Intro.java
deleted file mode 100644
index 66d2fee2..00000000
--- a/tests/examplefiles/Intro.java
+++ /dev/null
@@ -1,1660 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * -Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * -Redistribution in binary form must reproduct the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
- * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
- * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT
- * BE LIABLE FOR ANY DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT
- * OF OR RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS
- * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
- * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
- * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
- * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN
- * IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that Software is not designed, licensed or intended for
- * use in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-
-package java2d;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.geom.*;
-import java.awt.image.BufferedImage;
-import java.awt.image.DataBuffer;
-import java.awt.font.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.table.*;
-import javax.swing.event.*;
-import java.util.Vector;
-import java.util.List;
-import java.util.Arrays;
-
-
-
-/**
- * Introduction to the Java2Demo.
- *
- * @version @(#)Intro.java 1.19 03/06/26
- * @author Brian Lichtenwalter
- */
-public class Intro extends JPanel {
-
- static Color black = new Color(20, 20, 20);
- static Color white = new Color(240, 240, 255);
- static Color red = new Color(149, 43, 42);
- static Color blue = new Color(94, 105, 176);
- static Color yellow = new Color(255, 255, 140);
-
- static Surface surface;
- private ScenesTable scenesTable;
- private boolean doTable;
-
-
- public Intro() {
- EmptyBorder eb = new EmptyBorder(80,110,80,110);
- BevelBorder bb = new BevelBorder(BevelBorder.LOWERED);
- setBorder(new CompoundBorder(eb,bb));
- setLayout(new BorderLayout());
- setBackground(Color.gray);
- setToolTipText("click for scene table");
- add(surface = new Surface());
- addMouseListener(new MouseAdapter() {
- public void mouseClicked(MouseEvent e) {
- removeAll();
- if ((doTable = !doTable)) {
- setToolTipText("click for animation");
- surface.stop();
- if (scenesTable == null) {
- scenesTable = new ScenesTable();
- }
- add(scenesTable);
- } else {
- setToolTipText("click for scene table");
- surface.start();
- add(surface);
- }
- revalidate();
- repaint();
- }
- });
- }
-
-
- public void start() {
- if (!doTable) {
- surface.start();
- }
- }
-
-
- public void stop() {
- if (!doTable) {
- surface.stop();
- }
- }
-
-
- public static void main(String argv[]) {
- final Intro intro = new Intro();
- WindowListener l = new WindowAdapter() {
- public void windowClosing(WindowEvent e) {System.exit(0);}
- public void windowDeiconified(WindowEvent e) { intro.start(); }
- public void windowIconified(WindowEvent e) { intro.stop(); }
- };
- JFrame f = new JFrame("Java2D Demo - Intro");
- f.addWindowListener(l);
- f.getContentPane().add("Center", intro);
- f.pack();
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- int w = 720;
- int h = 510;
- f.setLocation(screenSize.width/2 - w/2, screenSize.height/2 - h/2);
- f.setSize(w, h);
- f.setVisible(true);
- intro.start();
- }
-
-
- /**
- * ScenesTable is the list of scenes known to the Director.
- * Scene participation, scene name and scene pause amount columns.
- * Global animation delay for scene's steps.
- */
- static class ScenesTable extends JPanel implements ActionListener, ChangeListener {
-
- private JTable table;
- private TableModel dataModel;
-
- public ScenesTable() {
- setBackground(Color.white);
- setLayout(new BorderLayout());
- final String[] names = { "", "Scenes", "Pause" };
-
- dataModel = new AbstractTableModel() {
- public int getColumnCount() { return names.length; }
- public int getRowCount() { return surface.director.size();}
- public Object getValueAt(int row, int col) {
- Surface.Scene scene = (Surface.Scene) surface.director.get(row);
- if (col == 0) {
- return scene.participate;
- } else if (col == 1) {
- return scene.name;
- } else {
- return scene.pauseAmt;
- }
- }
- public String getColumnName(int col) {return names[col]; }
- public Class getColumnClass(int c) {
- return getValueAt(0, c).getClass();
- }
- public boolean isCellEditable(int row, int col) {
- return col != 1 ? true : false;
- }
- public void setValueAt(Object aValue, int row, int col) {
- Surface.Scene scene = (Surface.Scene) surface.director.get(row);
- if (col == 0) {
- scene.participate = aValue;
- } else if (col == 1) {
- scene.name = aValue;
- } else {
- scene.pauseAmt = aValue;
- }
- }
- };
-
- table = new JTable(dataModel);
- TableColumn col = table.getColumn("");
- col.setWidth(16);
- col.setMinWidth(16);
- col.setMaxWidth(20);
- col = table.getColumn("Pause");
- col.setWidth(60);
- col.setMinWidth(60);
- col.setMaxWidth(60);
- table.sizeColumnsToFit(0);
-
- JScrollPane scrollpane = new JScrollPane(table);
- add(scrollpane);
-
- JPanel panel = new JPanel(new BorderLayout());
- JButton b = new JButton("Unselect All");
- b.setHorizontalAlignment(JButton.LEFT);
- Font font = new Font("serif", Font.PLAIN, 10);
- b.setFont(font);
- b.addActionListener(this);
- panel.add("West", b);
-
- JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 200, (int) surface.sleepAmt);
- slider.addChangeListener(this);
- TitledBorder tb = new TitledBorder(new EtchedBorder());
- tb.setTitleFont(font);
- tb.setTitle("Anim delay = " + String.valueOf(surface.sleepAmt) + " ms");
- slider.setBorder(tb);
- slider.setPreferredSize(new Dimension(140,40));
- slider.setMinimumSize(new Dimension(100,40));
- slider.setMaximumSize(new Dimension(180,40));
- panel.add("East", slider);
-
- add("South", panel);
- }
-
-
- public void actionPerformed(ActionEvent e) {
- JButton b = (JButton) e.getSource();
- b.setSelected(!b.isSelected());
- b.setText(b.isSelected() ? "Select All" : "Unselect All");
- for (int i = 0; i < surface.director.size(); i++) {
- Surface.Scene scene = (Surface.Scene) surface.director.get(i);
- scene.participate = new Boolean(!b.isSelected());
- }
- table.tableChanged(new TableModelEvent(dataModel));
- }
-
-
- public void stateChanged(ChangeEvent e) {
- JSlider slider = (JSlider) e.getSource();
- int value = slider.getValue();
- TitledBorder tb = (TitledBorder) slider.getBorder();
- tb.setTitle("Anim delay = " + String.valueOf(value) + " ms");
- surface.sleepAmt = (long) value;
- slider.repaint();
- }
- } // End ScenesTable class
-
-
-
- /**
- * Surface is the stage where the Director plays its scenes.
- */
- static class Surface extends JPanel implements Runnable {
-
- static Surface surf;
- static Image cupanim, java_logo;
- static BufferedImage bimg;
- public Director director;
- public int index;
- public long sleepAmt = 30;
- private Thread thread;
-
-
- public Surface() {
- surf = this;
- setBackground(black);
- setLayout(new BorderLayout());
- addMouseListener(new MouseAdapter() {
- public void mouseClicked(MouseEvent e) {
- if (thread == null) start(); else stop();
- }
- });
- cupanim = DemoImages.getImage("cupanim.gif", this);
- java_logo = DemoImages.getImage("java_logo.png", this);
- director = new Director();
- }
-
-
- static FontMetrics getMetrics(Font font) {
- return surf.getFontMetrics(font);
- }
-
-
- public void paint(Graphics g) {
- Dimension d = getSize();
- if (d.width <= 0 || d.height <= 0) {
- return;
- }
- if (bimg == null || bimg.getWidth() != d.width || bimg.getHeight() != d.height) {
- bimg = getGraphicsConfiguration().createCompatibleImage(d.width, d.height);
- // reset future scenes
- for (int i = index+1; i < director.size(); i++) {
- ((Scene) director.get(i)).reset(d.width, d.height);
- }
- }
-
- Scene scene = (Scene) director.get(index);
- if (scene.index <= scene.length) {
- if (thread != null) {
- scene.step(d.width, d.height);
- }
-
- Graphics2D g2 = bimg.createGraphics();
- g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
- g2.setBackground(getBackground());
- g2.clearRect(0, 0, d.width, d.height);
-
- scene.render(d.width, d.height, g2);
-
- if (thread != null) {
- // increment scene.index after scene.render
- scene.index++;
- }
- g2.dispose();
- }
- g.drawImage(bimg, 0, 0, this);
- }
-
-
-
- public void start() {
- if (thread == null) {
- thread = new Thread(this);
- thread.setPriority(Thread.MIN_PRIORITY);
- thread.setName("Intro");
- thread.start();
- }
- }
-
-
- public synchronized void stop() {
- if (thread != null) {
- thread.interrupt();
- }
- thread = null;
- notifyAll();
- }
-
-
- public void reset() {
- index = 0;
- Dimension d = getSize();
- for (int i = 0; i < director.size(); i++) {
- ((Scene) director.get(i)).reset(d.width, d.height);
- }
- }
-
-
- public void run() {
-
- Thread me = Thread.currentThread();
-
- while (thread == me && !isShowing() || getSize().width <= 0) {
- try {
- thread.sleep(500);
- } catch (InterruptedException e) { return; }
- }
-
- if (index == 0) {
- reset();
- }
-
- while (thread == me) {
- Scene scene = (Scene) director.get(index);
- if (((Boolean) scene.participate).booleanValue()) {
- repaint();
- try {
- thread.sleep(sleepAmt);
- } catch (InterruptedException e) { break; }
- if (scene.index > scene.length) {
- scene.pause(thread);
- if (++index >= director.size()) {
- reset();
- }
- }
- } else {
- if (++index >= director.size()) {
- reset();
- }
- }
- }
- thread = null;
- }
-
-
-
- /**
- * Part is a piece of the scene. Classes must implement Part
- * inorder to participate in a scene.
- */
- interface Part {
- public void reset(int newwidth, int newheight);
- public void step(int w, int h);
- public void render(int w, int h, Graphics2D g2);
- public int getBegin();
- public int getEnd();
- }
-
-
-
- /**
- * Director is the holder of the scenes, their names & pause amounts
- * between scenes.
- */
- static class Director extends Vector {
-
- GradientPaint gp = new GradientPaint(0,40,blue,38,2,black);
- Font f1 = new Font("serif", Font.PLAIN, 200);
- Font f2 = new Font("serif", Font.PLAIN, 120);
- Font f3 = new Font("serif", Font.PLAIN, 72);
- Object parts[][][] = {
- { { "J - scale text on gradient", "0" },
- { new GpE(GpE.BURI, black, blue, 0, 20),
- new TxE("J", f1, TxE.SCI, yellow, 2, 20) } },
- { { "2 - scale & rotate text on gradient" , "0" },
- { new GpE(GpE.BURI, blue, black, 0, 22),
- new TxE("2", f1, TxE.RI | TxE.SCI, yellow, 2, 22) } },
- { { "D - scale text on gradient", "0" },
- { new GpE(GpE.BURI, black, blue, 0, 20),
- new TxE("D", f1, TxE.SCI, yellow, 2, 20) } },
- { { "Java2D - scale & rotate text on gradient", "1000" },
- { new GpE(GpE.SIH, blue, black, 0, 40),
- new TxE("Java2D", f2, TxE.RI | TxE.SCI, yellow, 0, 40) }},
- { { "Previous scene dither dissolve out", "0"},
- { new DdE(0, 20, 1) }},
- { { "Graphics Features", "999" },
- { new Temp(Temp.RECT, null, 0, 15),
- new Temp(Temp.IMG, java_logo, 2, 15),
- new Temp(Temp.RNA | Temp.INA, java_logo, 16, 130),
- new Features(Features.GRAPHICS, 16, 130) }},
- { { "Java2D - texture text on gradient", "1000"},
- { new GpE(GpE.WI, blue, black, 0, 20),
- new GpE(GpE.WD, blue, black, 21, 40),
- new TpE(TpE.OI | TpE.NF, black, yellow, 4, 0, 10),
- new TpE(TpE.OD | TpE.NF, black, yellow, 4, 11, 20),
- new TpE(TpE.OI | TpE.NF | TpE.HAF, black, yellow,5,21,40),
- new TxE("Java2D", f2, 0, null, 0, 40) }},
- { { "Previous scene random close out", "0"},
- { new CoE(CoE.RAND, 0, 20) } },
- { { "Text Features", "999" },
- { new Temp(Temp.RECT, null, 0, 15),
- new Temp(Temp.IMG, java_logo, 2, 15),
- new Temp(Temp.RNA | Temp.INA, java_logo, 16, 130),
- new Features(Features.TEXT, 16, 130) }},
- { { "Java2D - composite text on texture", "1000"},
- { new TpE(TpE.RI, black, gp, 40, 0, 20),
- new TpE(TpE.RD, black, gp, 40, 21, 40),
- new TpE(TpE.RI, black, gp, 40, 41, 60),
- new TxE("Java2D", f2, TxE.AC, yellow, 0, 60) }},
- { { "Previous scene dither dissolve out", "0"},
- { new DdE(0, 20, 4) }},
- { { "Imaging Features", "999" },
- { new Temp(Temp.RECT, null, 0, 15),
- new Temp(Temp.IMG, java_logo, 2, 15),
- new Temp(Temp.RNA | Temp.INA, java_logo, 16, 130),
- new Features(Features.IMAGES, 16, 130) }},
- { { "Java2D - text on gradient", "1000" },
- { new GpE(GpE.SDH, blue, black, 0, 20),
- new GpE(GpE.SIH, blue, black, 21, 40),
- new GpE(GpE.SDH, blue, black, 41, 50),
- new GpE(GpE.INC | GpE.NF, red, yellow, 0, 50),
- new TxE("Java2D", f2, TxE.NOP, null, 0, 50) }},
- { { "Previous scene ellipse close out", "0"},
- { new CoE(CoE.OVAL, 0, 20) } },
- { { "Color Features", "999" },
- { new Temp(Temp.RECT, null, 0, 15),
- new Temp(Temp.IMG, java_logo, 2, 15),
- new Temp(Temp.RNA | Temp.INA, java_logo, 16, 99),
- new Features(Features.COLOR, 16, 99) }},
- { { "Java2D - composite and rotate text on paints", "2000" },
- { new GpE(GpE.BURI, black, blue, 0, 20),
- new GpE(GpE.BURD, black, blue, 21, 30),
- new TpE(TpE.OI | TpE.HAF, black, blue, 10, 31, 40),
- new TxE("Java2D", f2, TxE.AC | TxE.RI, yellow, 0, 40) }},
- { { "Previous scene subimage transform out", "0" },
- { new SiE(60, 60, 0, 40) }},
- { { "CREDITS - transform in", "1000" },
- { new LnE(LnE.ACI | LnE.ZOOMI | LnE.RI, 0, 60),
- new TxE("CREDITS", f3, TxE.AC | TxE.SCI, Color.red,20,30),
- new TxE("CREDITS", f3, TxE.SCXD, Color.red, 31, 38),
- new TxE("CREDITS", f3, TxE.SCXI, Color.red, 39, 48),
- new TxE("CREDITS", f3, TxE.SCXD, Color.red, 49, 54),
- new TxE("CREDITS", f3, TxE.SCXI, Color.red, 55, 60) }},
- { { "CREDITS - transform out", "0" },
- { new LnE(LnE.ACD | LnE.ZOOMD | LnE.RD, 0, 45),
- new TxE("CREDITS", f3, 0, Color.red, 0, 9),
- new TxE("CREDITS", f3, TxE.SCD | TxE.RD, Color.red,10,30)}},
- { { "Contributors", "1000" },
- { new Temp(Temp.RECT, null, 0, 30),
- new Temp(Temp.IMG, cupanim, 4, 30),
- new Temp(Temp.RNA | Temp.INA, cupanim, 31, 200),
- new Contributors(34, 200) } },
- };
-
-
- public Director() {
- for (int i = 0; i < parts.length; i++) {
- Vector v = new Vector();
- for (int j = 0; j < parts[i][1].length; j++) {
- v.addElement(parts[i][1][j]);
- }
- addElement(new Scene(v, parts[i][0][0], parts[i][0][1]));
- }
- }
- }
-
-
-
- /**
- * Scene is the manager of the parts.
- */
- static class Scene extends Object {
- public Object name;
- public Object participate = new Boolean(true);
- public Object pauseAmt;
- public Vector parts;
- public int index;
- public int length;
-
- public Scene(Vector parts, Object name, Object pauseAmt) {
- this.name = name;
- this.parts = parts;
- this.pauseAmt = pauseAmt;
- for (int i = 0; i < parts.size(); i++) {
- if (((Part) parts.get(i)).getEnd() > length) {
- length = ((Part) parts.get(i)).getEnd();
- }
- }
- }
-
- public void reset(int w, int h) {
- index = 0;
- for (int i = 0; i < parts.size(); i++) {
- ((Part) parts.get(i)).reset(w, h);
- }
- }
-
- public void step(int w, int h) {
- for (int i = 0; i < parts.size(); i++) {
- Part part = (Part) parts.get(i);
- if (index >= part.getBegin() && index <= part.getEnd()) {
- part.step(w, h);
- }
- }
- }
-
- public void render(int w, int h, Graphics2D g2) {
- for (int i = 0; i < parts.size(); i++) {
- Part part = (Part) parts.get(i);
- if (index >= part.getBegin() && index <= part.getEnd()) {
- part.render(w, h, g2);
- }
- }
- }
-
- public void pause(Thread thread) {
- try {
- thread.sleep(Long.parseLong((String) pauseAmt));
- } catch (Exception e) { }
- System.gc();
- }
- } // End Scene class
-
-
-
- /**
- * Text Effect. Transformation of characters. Clip or fill.
- */
- static class TxE implements Part {
-
- static final int INC = 1;
- static final int DEC = 2;
- static final int R = 4; // rotate
- static final int RI = R | INC;
- static final int RD = R | DEC;
- static final int SC = 8; // scale
- static final int SCI = SC | INC;
- static final int SCD = SC | DEC;
- static final int SCX = 16; // scale invert x
- static final int SCXI = SCX | SC | INC;
- static final int SCXD = SCX | SC | DEC;
- static final int SCY = 32; // scale invert y
- static final int SCYI = SCY | SC | INC;
- static final int SCYD = SCY | SC | DEC;
- static final int AC = 64; // AlphaComposite
- static final int CLIP = 128; // Clipping
- static final int NOP = 512; // No Paint
- private int beginning, ending;
- private int type;
- private double rIncr, sIncr;
- private double sx, sy, rotate;
- private Shape shapes[], txShapes[];
- private int sw;
- private int numRev;
- private Paint paint;
-
-
- public TxE(String text,
- Font font,
- int type,
- Paint paint,
- int beg,
- int end) {
- this.type = type;
- this.paint = paint;
- this.beginning = beg;
- this.ending = end;
-
- setIncrements(2);
-
- char[] chars = text.toCharArray();
- shapes = new Shape[chars.length];
- txShapes = new Shape[chars.length];
- FontRenderContext frc = new FontRenderContext(null,true,true);
- TextLayout tl = new TextLayout(text, font, frc);
- sw = (int) tl.getOutline(null).getBounds().getWidth();
- for (int j = 0; j < chars.length; j++) {
- String s = String.valueOf(chars[j]);
- shapes[j] = new TextLayout(s, font, frc).getOutline(null);
- }
- }
-
-
- public void setIncrements(double numRevolutions) {
- this.numRev = (int) numRevolutions;
- rIncr = 360.0 / ((ending - beginning) / numRevolutions);
- sIncr = 1.0 / (ending - beginning);
- if ((type & SCX) != 0 || (type & SCY) != 0) {
- sIncr *= 2;
- }
- if ((type & DEC) != 0) {
- rIncr = -rIncr;
- sIncr = -sIncr;
- }
- }
-
-
- public void reset(int w, int h) {
- if (type == SCXI) {
- sx = -1.0; sy = 1.0;
- } else if (type == SCYI) {
- sx = 1.0; sy = -1.0;
- } else {
- sx = sy = (type & DEC) != 0 ? 1.0 : 0.0;
- }
- rotate = 0;
- }
-
-
- public void step(int w, int h) {
-
- float charWidth = w/2-sw/2;
-
- for (int i = 0; i < shapes.length; i++) {
- AffineTransform at = new AffineTransform();
- Rectangle2D maxBounds = shapes[i].getBounds();
- at.translate(charWidth, h/2+maxBounds.getHeight()/2);
- charWidth += (float) maxBounds.getWidth() + 1;
- Shape shape = at.createTransformedShape(shapes[i]);
- Rectangle2D b1 = shape.getBounds2D();
-
- if ((type & R) != 0) {
- at.rotate(Math.toRadians(rotate));
- }
- if ((type & SC) != 0) {
- at.scale(sx, sy);
- }
- shape = at.createTransformedShape(shapes[i]);
- Rectangle2D b2 = shape.getBounds2D();
-
- double xx = (b1.getX()+b1.getWidth()/2)
- - (b2.getX()+b2.getWidth()/2);
- double yy = (b1.getY()+b1.getHeight()/2)
- - (b2.getY()+b2.getHeight()/2);
- AffineTransform toCenterAT = new AffineTransform();
- toCenterAT.translate(xx, yy);
- toCenterAT.concatenate(at);
- txShapes[i] = toCenterAT.createTransformedShape(shapes[i]);
- }
- // avoid over rotation
- if (Math.abs(rotate) <= numRev * 360) {
- rotate += rIncr;
- if ((type & SCX) != 0) {
- sx += sIncr;
- } else if ((type & SCY) != 0) {
- sy += sIncr;
- } else {
- sx += sIncr; sy += sIncr;
- }
- }
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- Composite saveAC = null;
- if ((type & AC) != 0 && sx > 0 && sx < 1) {
- saveAC = g2.getComposite();
- g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) sx));
- }
- GeneralPath path = null;
- if ((type & CLIP) != 0) {
- path = new GeneralPath();
- }
- if (paint != null) {
- g2.setPaint(paint);
- }
- for (int i = 0; i < txShapes.length; i++) {
- if ((type & CLIP) != 0) {
- path.append(txShapes[i], false);
- } else {
- g2.fill(txShapes[i]);
- }
- }
- if ((type & CLIP) != 0) {
- g2.clip(path);
- }
- if (saveAC != null) {
- g2.setComposite(saveAC);
- }
- }
-
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End TxE class
-
-
-
-
- /**
- * GradientPaint Effect. Burst, split, horizontal and
- * vertical gradient fill effects.
- */
- static class GpE implements Part {
-
- static final int INC = 1; // increasing
- static final int DEC = 2; // decreasing
- static final int CNT = 4; // center
- static final int WID = 8; // width
- static final int WI = WID | INC;
- static final int WD = WID | DEC;
- static final int HEI = 16; // height
- static final int HI = HEI | INC;
- static final int HD = HEI | DEC;
- static final int SPL = 32 | CNT; // split
- static final int SIW = SPL | INC | WID;
- static final int SDW = SPL | DEC | WID;
- static final int SIH = SPL | INC | HEI;
- static final int SDH = SPL | DEC | HEI;
- static final int BUR = 64 | CNT; // burst
- static final int BURI = BUR | INC;
- static final int BURD = BUR | DEC;
- static final int NF = 128; // no fill
- private Color c1, c2;
- private int beginning, ending;
- private float incr, index;
- private Vector rect = new Vector();
- private Vector grad = new Vector();
- private int type;
-
-
- public GpE(int type, Color c1, Color c2, int beg, int end) {
- this.type = type;
- this.c1 = c1;
- this.c2 = c2;
- this.beginning = beg;
- this.ending = end;
- }
-
-
- public void reset(int w, int h) {
- incr = 1.0f / (ending - beginning);
- if ((type & CNT) != 0) {
- incr /= 2.3f;
- }
- if ((type & CNT) != 0 && (type & INC) != 0) {
- index = 0.5f;
- } else if ((type & DEC) != 0) {
- index = 1.0f;
- incr = -incr;
- } else {
- index = 0.0f;
- }
- index += incr;
- }
-
-
- public void step(int w, int h) {
- rect.clear();
- grad.clear();
-
- if ((type & WID) != 0) {
- float w2 = 0, x1 = 0, x2 = 0;
- if ((type & SPL) != 0) {
- w2 = w * 0.5f;
- x1 = w * (1.0f - index);
- x2 = w * index;
- } else {
- w2 = w * index;
- x1 = x2 = w2;
- }
- rect.addElement(new Rectangle2D.Float(0, 0, w2, h));
- rect.addElement(new Rectangle2D.Float(w2, 0, w-w2, h));
- grad.addElement(new GradientPaint(0,0,c1,x1,0,c2));
- grad.addElement(new GradientPaint(x2,0,c2,w,0,c1));
- } else if ((type & HEI) != 0) {
- float h2 = 0, y1 = 0, y2 = 0;
- if ((type & SPL) != 0) {
- h2 = h * 0.5f;
- y1 = h * (1.0f - index);
- y2 = h * index;
- } else {
- h2 = h * index;
- y1 = y2 = h2;
- }
- rect.addElement(new Rectangle2D.Float(0, 0, w, h2));
- rect.addElement(new Rectangle2D.Float(0, h2, w, h-h2));
- grad.addElement(new GradientPaint(0,0,c1,0,y1,c2));
- grad.addElement(new GradientPaint(0,y2,c2,0,h,c1));
- } else if ((type & BUR) != 0) {
-
- float w2 = w/2;
- float h2 = h/2;
-
- rect.addElement(new Rectangle2D.Float(0, 0, w2, h2));
- rect.addElement(new Rectangle2D.Float(w2, 0, w2, h2));
- rect.addElement(new Rectangle2D.Float(0, h2, w2, h2));
- rect.addElement(new Rectangle2D.Float(w2, h2, w2, h2));
-
- float x1 = w * (1.0f - index);
- float x2 = w * index;
- float y1 = h * (1.0f - index);
- float y2 = h * index;
-
- grad.addElement(new GradientPaint(0,0,c1,x1,y1,c2));
- grad.addElement(new GradientPaint(w,0,c1,x2,y1,c2));
- grad.addElement(new GradientPaint(0,h,c1,x1,y2,c2));
- grad.addElement(new GradientPaint(w,h,c1,x2,y2,c2));
- } else if ((type & NF) != 0) {
- float x = w * index;
- float y = h * index;
- grad.addElement(new GradientPaint(0,0,c1,0,y,c2));
- }
-
- if ((type & INC) != 0 || (type & DEC) != 0) {
- index += incr;
- }
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_OFF);
- for (int i = 0; i < grad.size(); i++) {
- g2.setPaint((GradientPaint) grad.get(i));
- if ((type & NF) == 0) {
- g2.fill((Rectangle2D) rect.get(i));
- }
- }
- g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
- }
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End GpE class
-
-
-
- /**
- * TexturePaint Effect. Expand and collapse a texture.
- */
- static class TpE implements Part {
-
- static final int INC = 1; // increasing
- static final int DEC = 2; // decreasing
- static final int OVAL = 4; // oval
- static final int RECT = 8; // rectangle
- static final int HAF = 16; // half oval or rect size
- static final int OI = OVAL | INC;
- static final int OD = OVAL | DEC;
- static final int RI = RECT | INC;
- static final int RD = RECT | DEC;
- static final int NF = 32; // no fill
- private Paint p1, p2;
- private int beginning, ending;
- private float incr, index;
- private TexturePaint texture;
- private int type;
- private int size;
- private BufferedImage bimg;
- private Rectangle rect;
-
-
- public TpE(int type, Paint p1, Paint p2, int size,
- int beg, int end) {
- this.type = type;
- this.p1 = p1;
- this.p2 = p2;
- this.beginning = beg;
- this.ending = end;
- setTextureSize(size);
- }
-
-
- public void setTextureSize(int size) {
- this.size = size;
- bimg = new BufferedImage(size,size,BufferedImage.TYPE_INT_RGB);
- rect = new Rectangle(0,0,size,size);
- }
-
-
- public void reset(int w, int h) {
- incr = (float) (size) / (float) (ending - beginning);
- if ((type & HAF) != 0) {
- incr /= 2;
- }
- if ((type & DEC) != 0) {
- index = size;
- if ((type & HAF) != 0) {
- index /= 2;
- }
- incr = -incr;
- } else {
- index = 0.0f;
- }
- index += incr;
- }
-
-
- public void step(int w, int h) {
- Graphics2D g2 = bimg.createGraphics();
- g2.setPaint(p1);
- g2.fillRect(0,0,size,size);
- g2.setPaint(p2);
- if ((type & OVAL) != 0) {
- g2.fill(new Ellipse2D.Float(0,0,index,index));
- } else if ((type & RECT) != 0) {
- g2.fill(new Rectangle2D.Float(0,0,index,index));
- }
- texture = new TexturePaint(bimg, rect);
- g2.dispose();
- index += incr;
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- g2.setPaint(texture);
- if ((type & NF) == 0) {
- g2.fillRect(0, 0, w, h);
- }
- }
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End TpE class
-
-
-
- /**
- * Close out effect. Close out the buffered image with different
- * geometry shapes.
- */
- static class CoE implements Part {
-
- static final int WID = 1;
- static final int HEI = 2;
- static final int OVAL = 4;
- static final int RECT = 8;
- static final int RAND = 16;
- static final int ARC = 32;
- private int type;
- private int beginning, ending;
- private BufferedImage bimg;
- private Shape shape;
- private double zoom, extent;
- private double zIncr, eIncr;
- private boolean doRandom;
-
-
- public CoE(int type, int beg, int end) {
- this.type = type;
- this.beginning = beg;
- this.ending = end;
- zIncr = -(2.0 / (ending - beginning));
- eIncr = 360.0 / (ending - beginning);
- doRandom = (type & RAND) != 0;
- }
-
-
- public void reset(int w, int h) {
- if (doRandom) {
- int num = (int) (Math.random() * 5.0);
- switch (num) {
- case 0 : type = OVAL; break;
- case 1 : type = RECT; break;
- case 2 : type = RECT | WID; break;
- case 3 : type = RECT | HEI; break;
- case 4 : type = ARC; break;
- default : type = OVAL;
- }
- }
- shape = null;
- bimg = null;
- extent = 360.0;
- zoom = 2.0;
- }
-
-
- public void step(int w, int h) {
- if (bimg == null) {
- int biw = Surface.bimg.getWidth();
- int bih = Surface.bimg.getHeight();
- bimg = new BufferedImage(biw, bih, BufferedImage.TYPE_INT_RGB);
- Graphics2D big = bimg.createGraphics();
- big.drawImage(Surface.bimg, 0, 0, null);
- }
- double z = Math.min(w, h) * zoom;
- if ((type & OVAL) != 0) {
- shape = new Ellipse2D.Double(w/2-z/2,h/2-z/2,z,z);
- } else if ((type & ARC) != 0) {
- shape = new Arc2D.Double(-100,-100,w+200,h+200,90,extent,Arc2D.PIE);
- extent -= eIncr;
- } else if ((type & RECT) != 0) {
- if ((type & WID) != 0) {
- shape = new Rectangle2D.Double(w/2-z/2,0,z,h);
- } else if ((type & HEI) != 0) {
- shape = new Rectangle2D.Double(0,h/2-z/2,w,z);
- } else {
- shape = new Rectangle2D.Double(w/2-z/2,h/2-z/2,z,z);
- }
- }
- zoom += zIncr;
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- g2.clip(shape);
- g2.drawImage(bimg, 0, 0, null);
- }
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End CoE class
-
-
-
- /**
- * Dither Dissolve Effect. For each successive step in the animation,
- * a pseudo-random starting horizontal position is chosen using list,
- * and then the corresponding points created from xlist and ylist are
- * blacked out for the current "chunk". The x and y chunk starting
- * positions are each incremented by the associated chunk size, and
- * this process is repeated for the number of "steps" in the
- * animation, causing an equal number of pseudo-randomly picked
- * "blocks" to be blacked out during each step of the animation.
- */
- static class DdE implements Part {
-
- private int beginning, ending;
- private BufferedImage bimg;
- private Graphics2D big;
- private List list, xlist, ylist;
- private int xeNum, yeNum; // element number
- private int xcSize, ycSize; // chunk size
- private int inc;
- private int blocksize;
-
-
- public DdE(int beg, int end, int blocksize) {
- this.beginning = beg;
- this.ending = end;
- this.blocksize = blocksize;
- }
-
- private void createShuffledLists() {
- int width = bimg.getWidth();
- int height = bimg.getHeight();
- Integer xarray[] = new Integer[width];
- Integer yarray[] = new Integer[height];
- Integer array[] = new Integer[ending - beginning + 1];
- for (int i = 0; i < xarray.length; i++) {
- xarray[i] = new Integer(i);
- }
- for (int j = 0; j < yarray.length; j++) {
- yarray[j] = new Integer(j);
- }
- for (int k = 0; k < array.length; k++) {
- array[k] = new Integer(k);
- }
- java.util.Collections.shuffle(xlist = Arrays.asList(xarray));
- java.util.Collections.shuffle(ylist = Arrays.asList(yarray));
- java.util.Collections.shuffle(list = Arrays.asList(array));
- }
-
- public void reset(int w, int h) {
- bimg = null;
- }
-
- public void step(int w, int h) {
- if (bimg == null) {
- int biw = Surface.bimg.getWidth();
- int bih = Surface.bimg.getHeight();
- bimg = new BufferedImage(biw, bih, BufferedImage.TYPE_INT_RGB);
- createShuffledLists();
- big = bimg.createGraphics();
- big.drawImage(Surface.bimg, 0, 0, null);
- xcSize = (xlist.size() / (ending - beginning)) + 1;
- ycSize = (ylist.size() / (ending - beginning)) + 1;
- xeNum = 0;
- inc = 0;
- }
- xeNum = xcSize * ((Integer)list.get(inc)).intValue();
- yeNum = -ycSize;
- inc++;
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- big.setColor(black);
-
- for (int k = 0; k <= (ending - beginning); k++) {
- if ((xeNum + xcSize) > xlist.size()) {
- xeNum = 0;
- } else {
- xeNum += xcSize;
- }
- yeNum += ycSize;
-
- for (int i = xeNum; i < xeNum+xcSize && i < xlist.size(); i++) {
- for (int j = yeNum; j < yeNum+ycSize && j < ylist.size(); j++) {
- int xval = ((Integer)xlist.get(i)).intValue();
- int yval = ((Integer)ylist.get(j)).intValue();
- if (((xval % blocksize) == 0) &&
- ((yval % blocksize) == 0)) {
- big.fillRect(xval, yval, blocksize, blocksize);
- }
- }
- }
- }
-
- g2.drawImage(bimg, 0, 0, null);
- }
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End DdE class
-
-
- /**
- * Subimage effect. Subimage the scene's buffered
- * image then rotate and scale down the subimages.
- */
- static class SiE implements Part {
-
- private int beginning, ending;
- private BufferedImage bimg;
- private double rIncr, sIncr;
- private double scale, rotate;
- private int siw, sih;
- private Vector subs = new Vector(20);
- private Vector pts = new Vector(20);
-
-
- public SiE(int siw, int sih, int beg, int end) {
- this.siw = siw;
- this.sih = sih;
- this.beginning = beg;
- this.ending = end;
- rIncr = 360.0 / (ending - beginning);
- sIncr = 1.0 / (ending - beginning);
- }
-
-
- public void reset(int w, int h) {
- scale = 1.0;
- rotate = 0.0;
- bimg = null;
- subs.clear();
- pts.clear();
- }
-
-
- public void step(int w, int h) {
- if (bimg == null) {
- int biw = Surface.bimg.getWidth();
- int bih = Surface.bimg.getHeight();
- bimg = new BufferedImage(biw, bih, BufferedImage.TYPE_INT_RGB);
- Graphics2D big = bimg.createGraphics();
- big.drawImage(Surface.bimg, 0, 0, null);
- for (int x = 0; x < w && scale > 0.0; x+=siw) {
- int ww = x+siw < w ? siw : w-x;
- for (int y = 0; y < h; y+=sih) {
- int hh = y+sih < h ? sih : h-y;
- subs.addElement(bimg.getSubimage(x,y,ww,hh));
- pts.addElement(new Point(x, y));
- }
- }
- }
-
- rotate += rIncr;
- scale -= sIncr;
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- AffineTransform saveTx = g2.getTransform();
- g2.setColor(blue);
- for (int i = 0; i < subs.size() && scale > 0.0; i++) {
- BufferedImage bi = (BufferedImage) subs.get(i);
- Point p = (Point) pts.get(i);
- int ww = bi.getWidth();
- int hh = bi.getHeight();
- AffineTransform at = new AffineTransform();
- at.rotate(Math.toRadians(rotate), p.x+ww/2, p.y+hh/2);
- at.translate(p.x, p.y);
- at.scale(scale, scale);
-
- Rectangle b1 = new Rectangle(0, 0, ww, hh);
- Shape shape = at.createTransformedShape(b1);
- Rectangle2D b2 = shape.getBounds2D();
- double xx = (p.x+ww/2) - (b2.getX()+b2.getWidth()/2);
- double yy = (p.y+hh/2) - (b2.getY()+b2.getHeight()/2);
- AffineTransform toCenterAT = new AffineTransform();
- toCenterAT.translate(xx, yy);
- toCenterAT.concatenate(at);
-
- g2.setTransform(toCenterAT);
- g2.drawImage(bi, 0, 0, null);
- g2.draw(b1);
- }
- g2.setTransform(saveTx);
- }
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End SiE class
-
-
-
-
- /**
- * Line Effect. Flattened ellipse with lines from the center
- * to the edge. Expand or collapse the ellipse. Fade in or out
- * the lines.
- */
- static class LnE implements Part {
-
- static final int INC = 1;
- static final int DEC = 2;
- static final int R = 4; // rotate
- static final int RI = R | INC;
- static final int RD = R | DEC;
- static final int ZOOM = 8; // zoom
- static final int ZOOMI = ZOOM | INC;
- static final int ZOOMD = ZOOM | DEC;
- static final int AC = 32; // AlphaComposite
- static final int ACI = 32 | INC;
- static final int ACD = 32 | DEC;
- private int beginning, ending;
- private double rIncr, rotate;
- private double zIncr, zoom;
- private Vector pts = new Vector();
- private float alpha, aIncr;
- private int type;
-
-
- public LnE(int type, int beg, int end) {
- this.type = type;
- this.beginning = beg;
- this.ending = end;
- rIncr = 360.0 / (ending - beginning);
- aIncr = 0.9f / (ending - beginning);
- zIncr = 2.0 / (ending - beginning);
- if ((type & DEC) != 0) {
- rIncr = -rIncr;
- aIncr = -aIncr;
- zIncr = -zIncr;
- }
- }
-
-
- public void generatePts(int w, int h, double sizeF) {
- pts.clear();
- double size = Math.min(w, h) * sizeF;
- Ellipse2D ellipse = new Ellipse2D.Double(w/2-size/2,h/2-size/2,size,size);
- PathIterator pi = ellipse.getPathIterator(null, 0.8);
- while ( !pi.isDone() ) {
- double[] pt = new double[6];
- switch ( pi.currentSegment(pt) ) {
- case FlatteningPathIterator.SEG_MOVETO:
- case FlatteningPathIterator.SEG_LINETO:
- pts.addElement(new Point2D.Double(pt[0], pt[1]));
- }
- pi.next();
- }
- }
-
-
- public void reset(int w, int h) {
- if ((type & DEC) != 0) {
- rotate = 360;
- alpha = 1.0f;
- zoom = 2.0;
- } else {
- rotate = alpha = 0;
- zoom = 0;
- }
- if ((type & ZOOM) == 0) {
- generatePts(w, h, 0.5);
- }
- }
-
-
- public void step(int w, int h) {
- if ((type & ZOOM) != 0) {
- generatePts(w, h, zoom += zIncr);
- }
- if ((type & RI) != 0 || (type & RI) != 0) {
- rotate += rIncr;
- }
- if ((type & ACI) != 0 || (type & ACD) != 0) {
- alpha += aIncr;
- }
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- Composite saveAC = null;
- if ((type & AC) != 0 && alpha >= 0 && alpha <= 1) {
- saveAC = g2.getComposite();
- g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
- }
- AffineTransform saveTx = null;
- if ((type & R) != 0) {
- saveTx = g2.getTransform();
- AffineTransform at = new AffineTransform();
- at.rotate(Math.toRadians(rotate), w/2, h/2);
- g2.setTransform(at);
- }
- Point2D p1 = new Point2D.Double(w/2, h/2);
- g2.setColor(Color.yellow);
- for (int i = 0; i < pts.size()-1; i++) {
- g2.draw(new Line2D.Float(p1, (Point2D) pts.get(i)));
- }
- if (saveTx != null) {
- g2.setTransform(saveTx);
- }
- if (saveAC != null) {
- g2.setComposite(saveAC);
- }
- }
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End LnE class
-
-
-
- /**
- * Template for Features & Contributors consisting of translating
- * blue and red rectangles and an image going from transparent to
- * opaque.
- */
- static class Temp implements Part {
- static final int NOANIM = 1;
- static final int RECT = 2;
- static final int RNA = RECT | NOANIM;
- static final int IMG = 4;
- static final int INA = IMG | NOANIM;
- private int beginning, ending;
- private float alpha, aIncr;
- private int type;
- private Rectangle rect1, rect2;
- private int x, y, xIncr, yIncr;
- private Image img;
-
-
- public Temp(int type, Image img, int beg, int end) {
- this.type = type;
- this.img = img;
- this.beginning = beg;
- this.ending = end;
- aIncr = 0.9f / (ending - beginning);
- if ((type & NOANIM) != 0) {
- alpha = 1.0f;
- }
- }
-
-
-
- public void reset(int w, int h) {
- rect1 = new Rectangle(8, 20, w-20, 30);
- rect2 = new Rectangle(20, 8, 30, h-20);
- if ((type & NOANIM) == 0) {
- alpha = 0.0f;
- xIncr = w / (ending - beginning);
- yIncr = h / (ending - beginning);
- x = w+(int)(xIncr*1.4);
- y = h+(int)(yIncr*1.4);
- }
- }
-
-
- public void step(int w, int h) {
- if ((type & NOANIM) != 0) {
- return;
- }
- if ((type & RECT) != 0) {
- rect1.setLocation(x-=xIncr, 20);
- rect2.setLocation(20, y-=yIncr);
- }
- if ((type & IMG) != 0) {
- alpha += aIncr;
- }
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- if ((type & RECT) != 0) {
- g2.setColor(blue);
- g2.fill(rect1);
- g2.setColor(red);
- g2.fill(rect2);
- }
- if ((type & IMG) != 0) {
- Composite saveAC = g2.getComposite();
- if (alpha >= 0 && alpha <= 1) {
- g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
- }
- g2.drawImage(img, 30, 30, null);
- g2.setComposite(saveAC);
- }
- }
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End Temp class
-
-
-
- /**
- * Features of Java2D. Single character advancement effect.
- */
- static class Features implements Part {
-
- static final int GRAPHICS = 0;
- static final int TEXT = 1;
- static final int IMAGES = 2;
- static final int COLOR = 3;
- static Font font1 = new Font("serif", Font.BOLD, 38);
- static Font font2 = new Font("serif", Font.PLAIN, 24);
- static FontMetrics fm1 = Surface.getMetrics(font1);
- static FontMetrics fm2 = Surface.getMetrics(font2);
- static String table[][] =
- {{ "Graphics", "Antialiased rendering", "Bezier paths",
- "Transforms", "Compositing", "Stroking parameters" },
- { "Text", "Extended font support",
- "Advanced text layout", "Dynamic font loading",
- "AttributeSets for font customization" },
- { "Images", "Flexible image layouts",
- "Extended imaging operations",
- " Convolutions, Lookup Tables",
- "RenderableImage interface"},
- { "Color", "ICC profile support", "Color conversion",
- "Arbitrary color spaces"} };
- private String list[];
- private int beginning, ending;
- private int strH;
- private int endIndex, listIndex;
- private Vector v = new Vector();
-
-
- public Features(int type, int beg, int end) {
- list = table[type];
- this.beginning = beg;
- this.ending = end;
- }
-
-
- public void reset(int w, int h) {
- strH = (int) (fm2.getAscent()+fm2.getDescent());
- endIndex = 1;
- listIndex = 0;
- v.clear();
- v.addElement(list[listIndex].substring(0,endIndex));
- }
-
-
- public void step(int w, int h) {
- if (listIndex < list.length) {
- if (++endIndex > list[listIndex].length()) {
- if (++listIndex < list.length) {
- endIndex = 1;
- v.addElement(list[listIndex].substring(0,endIndex));
- }
- } else {
- v.set(listIndex, list[listIndex].substring(0,endIndex));
- }
- }
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- g2.setColor(white);
- g2.setFont(font1);
- g2.drawString((String) v.get(0), 90, 85);
- g2.setFont(font2);
- for (int i = 1, y = 90; i < v.size(); i++) {
- g2.drawString((String) v.get(i), 120, y += strH);
- }
- }
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End Features class
-
-
-
- /**
- * Scrolling text of Java2D contributors.
- */
- static class Contributors implements Part {
-
- static String members[] =
- {
- "Brian Lichtenwalter", "Jeannette Hung",
- "Thanh Nguyen", "Jim Graham", "Jerry Evans",
- "John Raley", "Michael Peirce", "Robert Kim",
- "Jennifer Ball", "Deborah Adair", "Paul Charlton",
- "Dmitry Feld", "Gregory Stone", "Richard Blanchard",
- "Link Perry", "Phil Race", "Vincent Hardy",
- "Parry Kejriwal", "Doug Felt", "Rekha Rangarajan",
- "Paula Patel", "Michael Bundschuh", "Joe Warzecha",
- "Joey Beheler", "Aastha Bhardwaj", "Daniel Rice",
- "Chris Campbell", "Shinsuke Fukuda", "Dmitri Trembovetski",
- "Chet Haase", "Jennifer Godinez", "Nicholas Talian",
- "Raul Vera", "Ankit Patel", "Ilya Bagrak"
- };
- static Font font = new Font("serif", Font.PLAIN, 26);
- static FontMetrics fm = Surface.getMetrics(font);
- private int beginning, ending;
- private int nStrs, strH, index, yh, height;
- private Vector v = new Vector();
- private Vector cast = new Vector(members.length+3);
- private int counter, cntMod;
- private GradientPaint gp;
-
-
- public Contributors(int beg, int end) {
- this.beginning = beg;
- this.ending = end;
- java.util.Arrays.sort(members);
- cast.addElement("CONTRIBUTORS");
- cast.addElement(" ");
- for (int i = 0; i < members.length; i++) {
- cast.addElement(members[i]);
- }
- cast.addElement(" "); cast.addElement(" ");
- cntMod = (ending - beginning) / cast.size() - 1;
- }
-
-
- public void reset(int w, int h) {
- v.clear();
- strH = (int) (fm.getAscent()+fm.getDescent());
- nStrs = (h-40)/strH + 1;
- height = strH * (nStrs-1) + 48;
- index = 0;
- gp = new GradientPaint(0,h/2,Color.white,0,h+20,Color.black);
- counter = 0;
- }
-
-
- public void step(int w, int h) {
- if (counter++%cntMod == 0) {
- if (index < cast.size()) {
- v.addElement(cast.get(index));
- }
- if ((v.size() == nStrs || index >= cast.size()) && v.size() != 0) {
- v.removeElementAt(0);
- }
- ++index;
- }
- }
-
-
- public void render(int w, int h, Graphics2D g2) {
- g2.setPaint(gp);
- g2.setFont(font);
- double remainder = counter%cntMod;
- double incr = 1.0-remainder/cntMod;
- incr = incr == 1.0 ? 0 : incr;
- int y = (int) (incr * strH);
-
- if (index >= cast.size()) {
- y = yh + y;
- } else {
- y = yh = height - v.size() * strH + y;
- }
- for (int i = 0; i < v.size(); i++) {
- String s = (String) v.get(i);
- g2.drawString(s, w/2-fm.stringWidth(s)/2, y += strH);
- }
- }
-
- public int getBegin() {
- return beginning;
- }
-
- public int getEnd() {
- return ending;
- }
- } // End Contributors class
-
- } // End Surface class
-} // End Intro class
diff --git a/tests/examplefiles/Makefile b/tests/examplefiles/Makefile
deleted file mode 100644
index bf272c5a..00000000
--- a/tests/examplefiles/Makefile
+++ /dev/null
@@ -1,1131 +0,0 @@
-# Generated automatically from Makefile.pre by makesetup.
-# Top-level Makefile for Python
-#
-# As distributed, this file is called Makefile.pre.in; it is processed
-# into the real Makefile by running the script ./configure, which
-# replaces things like @spam@ with values appropriate for your system.
-# This means that if you edit Makefile, your changes get lost the next
-# time you run the configure script. Ideally, you can do:
-#
-# ./configure
-# make
-# make test
-# make install
-#
-# If you have a previous version of Python installed that you don't
-# want to overwrite, you can use "make altinstall" instead of "make
-# install". Refer to the "Installing" section in the README file for
-# additional details.
-#
-# See also the section "Build instructions" in the README file.
-
-# === Variables set by makesetup ===
-
-MODOBJS= Modules/threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/zipimport.o Modules/symtablemodule.o Modules/xxsubtype.o
-MODLIBS= $(LOCALMODLIBS) $(BASEMODLIBS)
-
-# === Variables set by configure
-VERSION= 2.6
-srcdir= .
-
-
-CC= gcc -pthread
-CXX= g++ -pthread
-MAINCC= $(CC)
-LINKCC= $(PURIFY) $(MAINCC)
-AR= ar
-RANLIB= ranlib
-SVNVERSION= svnversion $(srcdir)
-
-# Shell used by make (some versions default to the login shell, which is bad)
-SHELL= /bin/sh
-
-# Use this to make a link between python$(VERSION) and python in $(BINDIR)
-LN= ln
-
-# Portable install script (configure doesn't always guess right)
-INSTALL= /usr/bin/install -c
-INSTALL_PROGRAM=${INSTALL}
-INSTALL_SCRIPT= ${INSTALL}
-INSTALL_DATA= ${INSTALL} -m 644
-# Shared libraries must be installed with executable mode on some systems;
-# rather than figuring out exactly which, we always give them executable mode.
-# Also, making them read-only seems to be a good idea...
-INSTALL_SHARED= ${INSTALL} -m 555
-
-MAKESETUP= $(srcdir)/Modules/makesetup
-
-# Compiler options
-OPT= -g -Wall -Wstrict-prototypes
-BASECFLAGS= -fno-strict-aliasing
-CFLAGS= $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)
-# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
-# be able to build extension modules using the directories specified in the
-# environment variables
-CPPFLAGS= -I. -I$(srcdir)/Include
-LDFLAGS=
-LDLAST=
-SGI_ABI=
-CCSHARED= -fPIC
-LINKFORSHARED= -Xlinker -export-dynamic
-# Extra C flags added for building the interpreter object files.
-CFLAGSFORSHARED=
-# C flags used for building the interpreter object files
-PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
-
-
-# Machine-dependent subdirectories
-MACHDEP= linux2
-
-# Install prefix for architecture-independent files
-prefix= /usr/local
-
-# Install prefix for architecture-dependent files
-exec_prefix= ${prefix}
-
-# Expanded directories
-BINDIR= $(exec_prefix)/bin
-LIBDIR= $(exec_prefix)/lib
-MANDIR= ${prefix}/man
-INCLUDEDIR= ${prefix}/include
-CONFINCLUDEDIR= $(exec_prefix)/include
-SCRIPTDIR= $(prefix)/lib
-
-# Detailed destination directories
-BINLIBDEST= $(LIBDIR)/python$(VERSION)
-LIBDEST= $(SCRIPTDIR)/python$(VERSION)
-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
-LIBP= $(LIBDIR)/python$(VERSION)
-
-# Symbols used for using shared libraries
-SO= .so
-LDSHARED= $(CC) -shared
-BLDSHARED= $(CC) -shared
-DESTSHARED= $(BINLIBDEST)/lib-dynload
-
-# Executable suffix (.exe on Windows and Mac OS X)
-EXE=
-BUILDEXE=
-
-# Short name and location for Mac OS X Python framework
-UNIVERSALSDK=
-PYTHONFRAMEWORK=
-PYTHONFRAMEWORKDIR= no-framework
-PYTHONFRAMEWORKPREFIX=
-PYTHONFRAMEWORKINSTALLDIR=
-# Deployment target selected during configure, to be checked
-# by distutils. The export statement is needed to ensure that the
-# deployment target is active during build.
-MACOSX_DEPLOYMENT_TARGET=
-#export MACOSX_DEPLOYMENT_TARGET
-
-# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
-OTHER_LIBTOOL_OPT=
-
-# Environment to run shared python without installed libraries
-RUNSHARED=
-
-# Modes for directories, executables and data files created by the
-# install process. Default to user-only-writable for all file types.
-DIRMODE= 755
-EXEMODE= 755
-FILEMODE= 644
-
-# configure script arguments
-CONFIG_ARGS= '--with-pydebug'
-
-
-# Subdirectories with code
-SRCDIRS= Parser Grammar Objects Python Modules Mac
-
-# Other subdirectories
-SUBDIRSTOO= Include Lib Misc Demo
-
-# Files and directories to be distributed
-CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
-DISTFILES= README ChangeLog $(CONFIGFILES)
-DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
-DIST= $(DISTFILES) $(DISTDIRS)
-
-
-LIBRARY= libpython$(VERSION).a
-LDLIBRARY= libpython$(VERSION).a
-BLDLIBRARY= $(LDLIBRARY)
-DLLLIBRARY=
-LDLIBRARYDIR=
-INSTSONAME= $(LDLIBRARY)
-
-
-LIBS= -lpthread -ldl -lutil
-LIBM= -lm
-LIBC=
-SYSLIBS= $(LIBM) $(LIBC)
-SHLIBS= $(LIBS)
-
-THREADOBJ= Python/thread.o
-DLINCLDIR= .
-DYNLOADFILE= dynload_shlib.o
-MACHDEP_OBJS=
-UNICODE_OBJS= Objects/unicodeobject.o Objects/unicodectype.o
-
-PYTHON= python$(EXE)
-BUILDPYTHON= python$(BUILDEXE)
-
-# === Definitions added by makesetup ===
-
-LOCALMODLIBS=
-BASEMODLIBS=
-GLHACK=-Dclear=__GLclear
-PYTHONPATH=$(COREPYTHONPATH)
-COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(EXTRAMACHDEPPATH)$(TKPATH)
-TKPATH=:lib-tk
-EXTRAMACHDEPPATH=
-MACHDEPPATH=:plat-$(MACHDEP)
-TESTPATH=
-SITEPATH=
-DESTPATH=
-MACHDESTLIB=$(BINLIBDEST)
-DESTLIB=$(LIBDEST)
-
-
-
-##########################################################################
-# Modules
-MODULE_OBJS= \
- Modules/config.o \
- Modules/getpath.o \
- Modules/main.o \
- Modules/gcmodule.o
-
-# Used of signalmodule.o is not available
-SIGNAL_OBJS=
-
-
-##########################################################################
-# Grammar
-GRAMMAR_H= $(srcdir)/Include/graminit.h
-GRAMMAR_C= $(srcdir)/Python/graminit.c
-GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
-
-
-##########################################################################
-# Parser
-PGEN= Parser/pgen$(EXE)
-
-POBJS= \
- Parser/acceler.o \
- Parser/grammar1.o \
- Parser/listnode.o \
- Parser/node.o \
- Parser/parser.o \
- Parser/parsetok.o \
- Parser/bitset.o \
- Parser/metagrammar.o \
- Parser/firstsets.o \
- Parser/grammar.o \
- Parser/pgen.o
-
-PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o
-
-PGOBJS= \
- Objects/obmalloc.o \
- Python/mysnprintf.o \
- Parser/tokenizer_pgen.o \
- Parser/printgrammar.o \
- Parser/pgenmain.o
-
-PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
-
-##########################################################################
-# AST
-AST_H_DIR= $(srcdir)/Include
-AST_H= $(AST_H_DIR)/Python-ast.h
-AST_C_DIR= $(srcdir)/Python
-AST_C= $(AST_C_DIR)/Python-ast.c
-AST_ASDL= $(srcdir)/Parser/Python.asdl
-
-ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
-# XXX Note that a build now requires Python exist before the build starts
-ASDLGEN= $(srcdir)/Parser/asdl_c.py
-
-##########################################################################
-# Python
-PYTHON_OBJS= \
- Python/Python-ast.o \
- Python/asdl.o \
- Python/ast.o \
- Python/bltinmodule.o \
- Python/ceval.o \
- Python/compile.o \
- Python/codecs.o \
- Python/errors.o \
- Python/frozen.o \
- Python/frozenmain.o \
- Python/future.o \
- Python/getargs.o \
- Python/getcompiler.o \
- Python/getcopyright.o \
- Python/getmtime.o \
- Python/getplatform.o \
- Python/getversion.o \
- Python/graminit.o \
- Python/import.o \
- Python/importdl.o \
- Python/marshal.o \
- Python/modsupport.o \
- Python/mystrtoul.o \
- Python/mysnprintf.o \
- Python/peephole.o \
- Python/pyarena.o \
- Python/pyfpe.o \
- Python/pystate.o \
- Python/pythonrun.o \
- Python/structmember.o \
- Python/symtable.o \
- Python/sysmodule.o \
- Python/traceback.o \
- Python/getopt.o \
- Python/pystrtod.o \
- Python/$(DYNLOADFILE) \
- $(MACHDEP_OBJS) \
- $(THREADOBJ)
-
-
-##########################################################################
-# Objects
-OBJECT_OBJS= \
- Objects/abstract.o \
- Objects/boolobject.o \
- Objects/bufferobject.o \
- Objects/cellobject.o \
- Objects/classobject.o \
- Objects/cobject.o \
- Objects/codeobject.o \
- Objects/complexobject.o \
- Objects/descrobject.o \
- Objects/enumobject.o \
- Objects/exceptions.o \
- Objects/genobject.o \
- Objects/fileobject.o \
- Objects/floatobject.o \
- Objects/frameobject.o \
- Objects/funcobject.o \
- Objects/intobject.o \
- Objects/iterobject.o \
- Objects/listobject.o \
- Objects/longobject.o \
- Objects/dictobject.o \
- Objects/methodobject.o \
- Objects/moduleobject.o \
- Objects/object.o \
- Objects/obmalloc.o \
- Objects/rangeobject.o \
- Objects/setobject.o \
- Objects/sliceobject.o \
- Objects/stringobject.o \
- Objects/structseq.o \
- Objects/tupleobject.o \
- Objects/typeobject.o \
- Objects/weakrefobject.o \
- $(UNICODE_OBJS)
-
-
-##########################################################################
-# objects that get linked into the Python library
-LIBRARY_OBJS= \
- Modules/_typesmodule.o \
- Modules/getbuildinfo.o \
- $(PARSER_OBJS) \
- $(OBJECT_OBJS) \
- $(PYTHON_OBJS) \
- $(MODULE_OBJS) \
- $(SIGNAL_OBJS) \
- $(MODOBJS)
-
-#########################################################################
-# Rules
-
-# Default target
-all: $(BUILDPYTHON) oldsharedmods sharedmods
-
-# Build the interpreter
-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
- $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
- Modules/python.o \
- $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-
-platform: $(BUILDPYTHON)
- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
-
-
-# Build the shared modules
-sharedmods: $(BUILDPYTHON)
- @case $$MAKEFLAGS in \
- *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
- esac
-
-# Build static library
-# avoid long command lines, same as LIBRARY_OBJS
-$(LIBRARY): $(LIBRARY_OBJS)
- -rm -f $@
- $(AR) cr $@ Modules/getbuildinfo.o
- $(AR) cr $@ Modules/_typesmodule.o
- $(AR) cr $@ $(PARSER_OBJS)
- $(AR) cr $@ $(OBJECT_OBJS)
- $(AR) cr $@ $(PYTHON_OBJS)
- $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
- $(AR) cr $@ $(MODOBJS)
- $(RANLIB) $@
-
-libpython$(VERSION).so: $(LIBRARY_OBJS)
- if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
- $(LN) -f $(INSTSONAME) $@; \
- else\
- $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
- fi
-
-libpython$(VERSION).sl: $(LIBRARY_OBJS)
- $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
-
-# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
-# minimal framework (not including the Lib directory and such) in the current
-# directory.
-RESSRCDIR=$(srcdir)/Mac/Resources/framework
-$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
- $(LIBRARY) \
- $(RESSRCDIR)/Info.plist \
- $(RESSRCDIR)/version.plist \
- $(RESSRCDIR)/English.lproj/InfoPlist.strings
- $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
- if test "${UNIVERSALSDK}"; then \
- $(CC) -o $(LDLIBRARY) -arch i386 -arch ppc -dynamiclib \
- -isysroot "${UNIVERSALSDK}" \
- -all_load $(LIBRARY) -Wl,-single_module \
- -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/Python \
- -compatibility_version $(VERSION) \
- -current_version $(VERSION); \
- else \
- libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
- ;\
- fi
- $(INSTALL) -d -m $(DIRMODE) \
- $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
- $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
- $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
- $(INSTALL_DATA) $(RESSRCDIR)/version.plist \
- $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/version.plist
- $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
- $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj/InfoPlist.strings
- $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
- $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
- $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
- $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
-
-# This rule builds the Cygwin Python DLL and import library if configured
-# for a shared core library; otherwise, this rule is a noop.
-$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
- if test -n "$(DLLLIBRARY)"; then \
- $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
- $(LIBS) $(MODLIBS) $(SYSLIBS); \
- else true; \
- fi
-
-
-oldsharedmods: $(SHAREDMODS)
-
-
-Makefile Modules/config.c: Makefile.pre \
- $(srcdir)/Modules/config.c.in \
- $(MAKESETUP) \
- Modules/Setup.config \
- Modules/Setup \
- Modules/Setup.local
- $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
- -s Modules \
- Modules/Setup.config \
- Modules/Setup.local \
- Modules/Setup
- @mv config.c Modules
- @echo "The Makefile was updated, you may need to re-run make."
-
-
-Modules/Setup: $(srcdir)/Modules/Setup.dist
- @if test -f Modules/Setup; then \
- echo "-----------------------------------------------"; \
- echo "Modules/Setup.dist is newer than Modules/Setup;"; \
- echo "check to make sure you have all the updates you"; \
- echo "need in your Modules/Setup file."; \
- echo "Usually, copying Setup.dist to Setup will work."; \
- echo "-----------------------------------------------"; \
- fi
-
-############################################################################
-# Special rules for object files
-
-Modules/getbuildinfo.o: $(PARSER_OBJS) \
- $(OBJECT_OBJS) \
- $(PYTHON_OBJS) \
- $(MODULE_OBJS) \
- $(SIGNAL_OBJS) \
- $(MODOBJS) \
- $(srcdir)/Modules/getbuildinfo.c
- $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
-
-Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
- $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
- -DPREFIX='"$(prefix)"' \
- -DEXEC_PREFIX='"$(exec_prefix)"' \
- -DVERSION='"$(VERSION)"' \
- -DVPATH='"$(VPATH)"' \
- -o $@ $(srcdir)/Modules/getpath.c
-
-Modules/python.o: $(srcdir)/Modules/python.c
- $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
-
-
-$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-
-$(PGEN): $(PGENOBJS)
- $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
-
-Parser/grammar.o: $(srcdir)/Parser/grammar.c \
- $(srcdir)/Include/token.h \
- $(srcdir)/Include/grammar.h
-Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
-
-Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c
-
-Parser/pgenmain.o: $(srcdir)/Include/parsetok.h
-
-$(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
- $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
-
-$(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
- $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
-
-Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
-
-Python/getplatform.o: $(srcdir)/Python/getplatform.c
- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
-
-Python/importdl.o: $(srcdir)/Python/importdl.c
- $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
-
-Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
- $(srcdir)/Objects/unicodetype_db.h
-
-############################################################################
-# Header files
-
-PYTHON_HEADERS= \
- Include/Python.h \
- Include/Python-ast.h \
- Include/asdl.h \
- Include/abstract.h \
- Include/boolobject.h \
- Include/bufferobject.h \
- Include/ceval.h \
- Include/classobject.h \
- Include/cobject.h \
- Include/code.h \
- Include/codecs.h \
- Include/compile.h \
- Include/complexobject.h \
- Include/descrobject.h \
- Include/dictobject.h \
- Include/enumobject.h \
- Include/genobject.h \
- Include/fileobject.h \
- Include/floatobject.h \
- Include/funcobject.h \
- Include/import.h \
- Include/intobject.h \
- Include/intrcheck.h \
- Include/iterobject.h \
- Include/listobject.h \
- Include/longobject.h \
- Include/methodobject.h \
- Include/modsupport.h \
- Include/moduleobject.h \
- Include/object.h \
- Include/objimpl.h \
- Include/parsetok.h \
- Include/patchlevel.h \
- Include/pyarena.h \
- Include/pydebug.h \
- Include/pyerrors.h \
- Include/pyfpe.h \
- Include/pymem.h \
- Include/pyport.h \
- Include/pystate.h \
- Include/pythonrun.h \
- Include/rangeobject.h \
- Include/setobject.h \
- Include/sliceobject.h \
- Include/stringobject.h \
- Include/structseq.h \
- Include/structmember.h \
- Include/symtable.h \
- Include/sysmodule.h \
- Include/traceback.h \
- Include/tupleobject.h \
- Include/unicodeobject.h \
- Include/weakrefobject.h \
- pyconfig.h
-
-$(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
-
-
-######################################################################
-
-# Test the interpreter (twice, once without .pyc files, once with)
-# In the past, we've had problems where bugs in the marshalling or
-# elsewhere caused bytecode read from .pyc files to behave differently
-# than bytecode generated directly from a .py source file. Sometimes
-# the bytecode read from a .pyc file had the bug, somtimes the directly
-# generated bytecode. This is sometimes a very shy bug needing a lot of
-# sample data.
-
-TESTOPTS= -l $(EXTRATESTOPTS)
-TESTPROG= $(srcdir)/Lib/test/regrtest.py
-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
-test: all platform
- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
- -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
- $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
-
-testall: all platform
- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
- -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
- $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
-
-# Run the unitests for both architectures in a Universal build on OSX
-# Must be run on an Intel box.
-testuniversal: all platform
- if [ `arch` != 'i386' ];then \
- echo "This can only be used on OSX/i386" ;\
- exit 1 ;\
- fi
- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
- -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
- $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
- $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) $(TESTOPTS) -uall
-
-
-# Like testall, but with a single pass only
-buildbottest: all platform
- $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall -rw
-
-QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \
- test_unicodedata test_re test_sre test_select test_poll \
- test_linuxaudiodev test_struct test_sunaudiodev test_zlib
-quicktest: all platform
- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
- -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
- $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
-
-MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
- test_longexp
-memtest: all platform
- -rm -f $(srcdir)/Lib/test/*.py[co]
- -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
- $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
-
-# Install everything
-install: altinstall bininstall maninstall
-
-# Install almost everything without disturbing previous versions
-altinstall: altbininstall libinstall inclinstall libainstall \
- sharedinstall oldsharedinstall
-
-# Install shared libraries enabled by Setup
-DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
-
-oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
- @for i in X $(SHAREDMODS); do \
- if test $$i != X; then \
- echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
- $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
- fi; \
- done
-
-$(DESTSHARED):
- @for i in $(DESTDIRS); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
- echo "Creating directory $$i"; \
- $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
- else true; \
- fi; \
- done
-
-
-# Install the interpreter (by creating a hard link to python$(VERSION))
-bininstall: altbininstall
- -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
- then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
- else true; \
- fi
- (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
- (cd $(DESTDIR)$(BINDIR); $(LN) -sf python$(VERSION)-config python-config)
-
-# Install the interpreter with $(VERSION) affixed
-# This goes into $(exec_prefix)
-altbininstall: $(BUILDPYTHON)
- @for i in $(BINDIR) $(LIBDIR); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
- echo "Creating directory $$i"; \
- $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
- else true; \
- fi; \
- done
- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
- if test -f libpython$(VERSION)$(SO); then \
- if test "$(SO)" = .dll; then \
- $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
- else \
- $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
- if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
- (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
- fi \
- fi; \
- else true; \
- fi
-
-# Install the manual page
-maninstall:
- @for i in $(MANDIR) $(MANDIR)/man1; \
- do \
- if test ! -d $(DESTDIR)$$i; then \
- echo "Creating directory $$i"; \
- $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
- else true; \
- fi; \
- done
- $(INSTALL_DATA) $(srcdir)/Misc/python.man \
- $(DESTDIR)$(MANDIR)/man1/python.1
-
-# Install the library
-PLATDIR= plat-$(MACHDEP)
-EXTRAPLATDIR=
-EXTRAMACHDEPPATH=
-MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
-XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
-PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
- plat-mac/lib-scriptpackages/_builtinSuites \
- plat-mac/lib-scriptpackages/CodeWarrior \
- plat-mac/lib-scriptpackages/Explorer \
- plat-mac/lib-scriptpackages/Finder \
- plat-mac/lib-scriptpackages/Netscape \
- plat-mac/lib-scriptpackages/StdSuites \
- plat-mac/lib-scriptpackages/SystemEvents \
- plat-mac/lib-scriptpackages/Terminal
-PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
-LIBSUBDIRS= lib-tk site-packages test test/output test/data \
- test/decimaltestdata \
- encodings compiler hotshot \
- email email/mime email/test email/test/data \
- sqlite3 sqlite3/test \
- logging bsddb bsddb/test csv wsgiref \
- ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
- distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
- setuptools setuptools/command setuptools/tests setuptools.egg-info \
- curses $(MACHDEPS)
-libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
- @for i in $(SCRIPTDIR) $(LIBDEST); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
- echo "Creating directory $$i"; \
- $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
- else true; \
- fi; \
- done
- @for d in $(LIBSUBDIRS); \
- do \
- a=$(srcdir)/Lib/$$d; \
- if test ! -d $$a; then continue; else true; fi; \
- b=$(LIBDEST)/$$d; \
- if test ! -d $(DESTDIR)$$b; then \
- echo "Creating directory $$b"; \
- $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
- else true; \
- fi; \
- done
- @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
- do \
- if test -x $$i; then \
- $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
- echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
- else \
- $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
- echo $(INSTALL_DATA) $$i $(LIBDEST); \
- fi; \
- done
- @for d in $(LIBSUBDIRS); \
- do \
- a=$(srcdir)/Lib/$$d; \
- if test ! -d $$a; then continue; else true; fi; \
- if test `ls $$a | wc -l` -lt 1; then continue; fi; \
- b=$(LIBDEST)/$$d; \
- for i in $$a/*; \
- do \
- case $$i in \
- *CVS) ;; \
- *.py[co]) ;; \
- *.orig) ;; \
- *~) ;; \
- *) \
- if test -d $$i; then continue; fi; \
- if test -x $$i; then \
- echo $(INSTALL_SCRIPT) $$i $$b; \
- $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
- else \
- echo $(INSTALL_DATA) $$i $$b; \
- $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
- fi;; \
- esac; \
- done; \
- done
- $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-
-# Create the PLATDIR source directory, if one wasn't distributed..
-$(srcdir)/Lib/$(PLATDIR):
- mkdir $(srcdir)/Lib/$(PLATDIR)
- cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
- export PATH; PATH="`pwd`:$$PATH"; \
- export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
- export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
- export EXE; EXE="$(BUILDEXE)"; \
- cd $(srcdir)/Lib/$(PLATDIR); ./regen
-
-# Install the include files
-INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
-inclinstall:
- @for i in $(INCLDIRSTOMAKE); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
- echo "Creating directory $$i"; \
- $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
- else true; \
- fi; \
- done
- @for i in $(srcdir)/Include/*.h; \
- do \
- echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
- $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
- done
- $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
-
-# Install the library and miscellaneous stuff needed for extending/embedding
-# This goes into $(exec_prefix)
-LIBPL= $(LIBP)/config
-libainstall: all
- @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
- echo "Creating directory $$i"; \
- $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
- else true; \
- fi; \
- done
- @if test -d $(LIBRARY); then :; else \
- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
- if test "$(SO)" = .dll; then \
- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
- else \
- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
- fi; \
- else \
- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
- fi; \
- fi
- $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
- $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
- $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
- $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
- $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
- $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
- $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
- $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
- $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
- # Substitution happens here, as the completely-expanded BINDIR
- # is not available in configure
- sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
- rm python-config
- @if [ -s Modules/python.exp -a \
- "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
- echo; echo "Installing support files for building shared extension modules on AIX:"; \
- $(INSTALL_DATA) Modules/python.exp \
- $(DESTDIR)$(LIBPL)/python.exp; \
- echo; echo "$(LIBPL)/python.exp"; \
- $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
- $(DESTDIR)$(LIBPL)/makexp_aix; \
- echo "$(LIBPL)/makexp_aix"; \
- $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
- $(DESTDIR)$(LIBPL)/ld_so_aix; \
- echo "$(LIBPL)/ld_so_aix"; \
- echo; echo "See Misc/AIX-NOTES for details."; \
- else true; \
- fi
- @case "$(MACHDEP)" in beos*) \
- echo; echo "Installing support files for building shared extension modules on BeOS:"; \
- $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README; \
- echo; echo "$(LIBPL)/README"; \
- $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
- echo "$(LIBPL)/ar_beos"; \
- $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
- echo "$(LIBPL)/ld_so_beos"; \
- echo; echo "See Misc/BeOS-NOTES for details."; \
- ;; \
- esac
-
-# Install the dynamically loadable modules
-# This goes into $(exec_prefix)
-sharedinstall:
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
- --prefix=$(prefix) \
- --install-scripts=$(BINDIR) \
- --install-platlib=$(DESTSHARED) \
- --root=/$(DESTDIR)
-
-# Here are a couple of targets for MacOSX again, to install a full
-# framework-based Python. frameworkinstall installs everything, the
-# subtargets install specific parts. Much of the actual work is offloaded to
-# the Makefile in Mac
-#
-#
-# This target is here for backward compatiblity, previous versions of Python
-# hadn't integrated framework installation in the normal install process.
-frameworkinstall: install
-
-# On install, we re-make the framework
-# structure in the install location, /Library/Frameworks/ or the argument to
-# --enable-framework. If --enable-framework has been specified then we have
-# automatically set prefix to the location deep down in the framework, so we
-# only have to cater for the structural bits of the framework.
-
-frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
-
-frameworkinstallstructure: $(LDLIBRARY)
- @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
- echo Not configured with --enable-framework; \
- exit 1; \
- else true; \
- fi
- @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
- if test ! -d $(DESTDIR)$$i; then \
- echo "Creating directory $(DESTDIR)$$i"; \
- $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
- else true; \
- fi; \
- done
- $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
- $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist
- $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist
- $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
- $(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings
- $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
- $(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python
- $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
- $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
- $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
-
-# This installs Mac/Lib into the framework
-# Install a number of symlinks to keep software that expects a normal unix
-# install (which includes python-config) happy.
-frameworkinstallmaclib:
- ln -fs "../../../Python" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
- cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)"
-
-# This installs the IDE, the Launcher and other apps into /Applications
-frameworkinstallapps:
- cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
-
-# This install the unix python and pythonw tools in /usr/local/bin
-frameworkinstallunixtools:
- cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
-
-frameworkaltinstallunixtools:
- cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
-
-# This installs the Demos and Tools into the applications directory.
-# It is not part of a normal frameworkinstall
-frameworkinstallextras:
- cd Mac && Make installextras DESTDIR="$(DESTDIR)"
-
-# This installs a few of the useful scripts in Tools/scripts
-scriptsinstall:
- SRCDIR=$(srcdir) $(RUNSHARED) \
- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
- --prefix=$(prefix) \
- --install-scripts=$(BINDIR) \
- --root=/$(DESTDIR)
-
-# Build the toplevel Makefile
-Makefile.pre: Makefile.pre.in config.status
- CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
- $(MAKE) -f Makefile.pre Makefile
-
-# Run the configure script.
-config.status: $(srcdir)/configure
- $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
-
-.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
-
-# Some make's put the object file in the current directory
-.c.o:
- $(CC) -c $(PY_CFLAGS) -o $@ $<
-
-# Run reindent on the library
-reindent:
- ./python$(EXEEXT) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
-
-# Rerun configure with the same options as it was run last time,
-# provided the config.status script exists
-recheck:
- $(SHELL) config.status --recheck
- $(SHELL) config.status
-
-# Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
-autoconf:
- (cd $(srcdir); autoconf)
- (cd $(srcdir); autoheader)
-
-# Create a tags file for vi
-tags::
- cd $(srcdir); \
- ctags -w -t Include/*.h; \
- for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
- done; \
- sort -o tags tags
-
-# Create a tags file for GNU Emacs
-TAGS::
- cd $(srcdir); \
- etags Include/*.h; \
- for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
-
-# Sanitation targets -- clean leaves libraries, executables and tags
-# files, which clobber removes those as well
-pycremoval:
- find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
-
-clean: pycremoval
- find . -name '*.o' -exec rm -f {} ';'
- find . -name '*.s[ol]' -exec rm -f {} ';'
- find $(srcdir)/build -name 'fficonfig.h' -exec rm -f {} ';' || true
- find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
-
-clobber: clean
- -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
- tags TAGS \
- config.cache config.log pyconfig.h Modules/config.c
- -rm -rf build platform
- -rm -rf $(PYTHONFRAMEWORKDIR)
-
-# Make things extra clean, before making a distribution:
-# remove all generated files, even Makefile[.pre]
-# Keep configure and Python-ast.[ch], it's possible they can't be generated
-distclean: clobber
- -rm -f core Makefile Makefile.pre config.status \
- Modules/Setup Modules/Setup.local Modules/Setup.config
- find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
- -o -name '[@,#]*' -o -name '*.old' \
- -o -name '*.orig' -o -name '*.rej' \
- -o -name '*.bak' ')' \
- -exec rm -f {} ';'
-
-# Check for smelly exported symbols (not starting with Py/_Py)
-smelly: all
- nm -p $(LIBRARY) | \
- sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
-
-# Find files with funny names
-funny:
- find $(DISTDIRS) -type d \
- -o -name '*.[chs]' \
- -o -name '*.py' \
- -o -name '*.doc' \
- -o -name '*.sty' \
- -o -name '*.bib' \
- -o -name '*.dat' \
- -o -name '*.el' \
- -o -name '*.fd' \
- -o -name '*.in' \
- -o -name '*.tex' \
- -o -name '*,[vpt]' \
- -o -name 'Setup' \
- -o -name 'Setup.*' \
- -o -name README \
- -o -name Makefile \
- -o -name ChangeLog \
- -o -name Repository \
- -o -name Root \
- -o -name Entries \
- -o -name Tag \
- -o -name tags \
- -o -name TAGS \
- -o -name .cvsignore \
- -o -name MANIFEST \
- -o -print
-
-# Dependencies
-
-Python/thread.o: $(srcdir)/Python/thread_atheos.h $(srcdir)/Python/thread_beos.h $(srcdir)/Python/thread_cthread.h $(srcdir)/Python/thread_foobar.h $(srcdir)/Python/thread_lwp.h $(srcdir)/Python/thread_nt.h $(srcdir)/Python/thread_os2.h $(srcdir)/Python/thread_pth.h $(srcdir)/Python/thread_pthread.h $(srcdir)/Python/thread_sgi.h $(srcdir)/Python/thread_solaris.h $(srcdir)/Python/thread_wince.h
-
-# Declare targets that aren't real files
-.PHONY: all sharedmods oldsharedmods test quicktest memtest
-.PHONY: install altinstall oldsharedinstall bininstall altbininstall
-.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
-.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
-.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
-.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
-.PHONY: smelly funny
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-
-# Rules appended by makedepend
-
-Modules/threadmodule.o: $(srcdir)/Modules/threadmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/threadmodule.c -o Modules/threadmodule.o
-Modules/threadmodule$(SO): Modules/threadmodule.o; $(LDSHARED) Modules/threadmodule.o -o Modules/threadmodule$(SO)
-Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o
-Modules/signalmodule$(SO): Modules/signalmodule.o; $(LDSHARED) Modules/signalmodule.o -o Modules/signalmodule$(SO)
-Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o
-Modules/posixmodule$(SO): Modules/posixmodule.o; $(LDSHARED) Modules/posixmodule.o -o Modules/posixmodule$(SO)
-Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o
-Modules/errnomodule$(SO): Modules/errnomodule.o; $(LDSHARED) Modules/errnomodule.o -o Modules/errnomodule$(SO)
-Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/pwdmodule.c -o Modules/pwdmodule.o
-Modules/pwdmodule$(SO): Modules/pwdmodule.o; $(LDSHARED) Modules/pwdmodule.o -o Modules/pwdmodule$(SO)
-Modules/_sre.o: $(srcdir)/Modules/_sre.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/_sre.c -o Modules/_sre.o
-Modules/_sre$(SO): Modules/_sre.o; $(LDSHARED) Modules/_sre.o -o Modules/_sre$(SO)
-Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o
-Modules/_codecsmodule$(SO): Modules/_codecsmodule.o; $(LDSHARED) Modules/_codecsmodule.o -o Modules/_codecsmodule$(SO)
-Modules/zipimport.o: $(srcdir)/Modules/zipimport.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/zipimport.c -o Modules/zipimport.o
-Modules/zipimport$(SO): Modules/zipimport.o; $(LDSHARED) Modules/zipimport.o -o Modules/zipimport$(SO)
-Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o
-Modules/_symtablemodule$(SO): Modules/symtablemodule.o; $(LDSHARED) Modules/symtablemodule.o -o Modules/_symtablemodule$(SO)
-Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o
-Modules/xxsubtype$(SO): Modules/xxsubtype.o; $(LDSHARED) Modules/xxsubtype.o -o Modules/xxsubtype$(SO)
diff --git a/tests/examplefiles/Object.st b/tests/examplefiles/Object.st
deleted file mode 100644
index 4a1ca4c4..00000000
--- a/tests/examplefiles/Object.st
+++ /dev/null
@@ -1,4394 +0,0 @@
-!ProtoObject subclass: #Object
- instanceVariableNames: ''
- classVariableNames: 'DependentsFields'
- poolDictionaries: ''
- category: 'Kernel-Objects'!
-
-!Object methodsFor: '*39Deprecated' stamp: 'gk 2/24/2004 08:49'!
-beep
- "Deprecated."
-
- self deprecated: 'Use Beeper class>>beep instead.'.
- Beeper beep! !
-
-!Object methodsFor: '*39Deprecated' stamp: 'gk 2/24/2004 08:50'!
-beepPrimitive
- "Deprecated. Beep in the absence of sound support."
-
- self deprecated: 'Use Beeper class>>beep or Beeper class>>beepPrimitive instead.'.
- Beeper beepPrimitive! !
-
-!Object methodsFor: '*39Deprecated' stamp: 'md 12/12/2003 17:02'!
-beep: soundName
- "Make the given sound, unless the making of sound is disabled in Preferences."
-
- self deprecated: 'Use SampledSound>>playSoundNamed: instead.'.
- Preferences soundsEnabled
- ifTrue: [self playSoundNamed: soundName]
-! !
-
-!Object methodsFor: '*39Deprecated' stamp: 'sd 11/19/2004 16:57'!
-contentsGetz: x
- self deprecated: 'there is no method named contents in object and in addition only one sender in a method not called'.
- self contents: x! !
-
-!Object methodsFor: '*39Deprecated' stamp: 'sd 11/13/2003 21:10'!
-deprecatedExplanation: aString
- "This method is OBSOLETE. Use #deprecated: instead."
- self deprecated: 'Use Object>>deprecated: instead of deprecatedExplanation:.'.
-
- Preferences showDeprecationWarnings ifTrue:
- [Deprecation signal: ('{1} has been deprecated. {2}' translated format: {thisContext sender printString. aString})]! !
-
-!Object methodsFor: '*39Deprecated' stamp: 'sd 11/13/2003 21:11'!
-deprecated: aBlock explanation: aString
- "This method is OBSOLETE. Use #deprecated:block: instead."
- self deprecated: 'Use Object>>deprecated:block: instead of deprecated:explanation:.'.
-
- Preferences showDeprecationWarnings ifTrue:
- [Deprecation
- signal: ('{1} has been deprecated. {2}' translated format: {thisContext sender printString. aString})].
- ^ aBlock value.
-! !
-
-!Object methodsFor: '*39Deprecated' stamp: 'md 12/12/2003 16:25'!
-doIfNotNil: aBlock
- self deprecated: 'use ifNotNilDo:'.
- ^ self ifNotNilDo: aBlock
-! !
-
-!Object methodsFor: '*39Deprecated' stamp: 'md 11/27/2004 12:20'!
-ifKindOf: aClass thenDo: aBlock
- self deprecated: 'Deprecated. Just use #isKindOf:'.
- ^ (self isKindOf: aClass) ifTrue: [aBlock value: self]! !
-
-!Object methodsFor: '*39Deprecated' stamp: 'gk 2/23/2004 20:51'!
-playSoundNamed: soundName
- "Deprecated.
- Play the sound with the given name."
-
- self deprecated: 'Use "SoundService default playSoundNamed: aName" instead.'.
- SoundService default playSoundNamed: soundName! !
-
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:23'!
-aidaCanBeLocked
- "can we get an exclusive lock on that object (not already locked)?"
- ^false! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:23'!
-aidaDontCache
- "don't cache web content in a browser. Appropriate header is added to http response"
- ^false! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:24'!
-aidaIsLocked
- "is object locked exclusively?"
- ^false! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:24'!
-aidaLock
- "get an exclusive lock on that object. Until unlocked, noon else can get that lock. Return false if already locked, true if successfull"
- ^false! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:24'!
-aidaUnlock
- "release an exclusive lock if any"
- ^true! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:24'!
-app
- "fastest and most convinient way to find a web app for that object"
- ^self webAppFor: self firstSessionFromStack! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:25'!
-contentType
-
- "Janko Mivsek, apr98"
- "return 'text/html' as content type for web pages"
-
- ^'text/html'! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:25'!
-deepSearchOfClass: aClassName
- "finf all objects of that class down in object hierarchy"
- | objectDictionary class |
- objectDictionary := IdentityDictionary new.
- self deepCopyNotIn: objectDictionary.
- class := aClassName asSymbol.
- ^objectDictionary keys select: [:each | each class name = class].! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:26'!
-deepSearchOfObsoleteClasses
- "find all objects of obsolete classes down in object hierarchy"
- | objectDictionary |
- objectDictionary := IdentityDictionary new.
- self deepCopyNotIn: objectDictionary.
- ^objectDictionary keys select: [:each | each class isObsolete].! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:26'!
-expiresTimestamp
- "until when content of this object wont be changed"
- "used in http response, override if you like to be included"
- ^self modifiedTimestamp "to reload pages immediately"! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:26'!
-firstAppFromStack
- "try to find a first sender up in calling stack, who is WebApplication"
- | context |
- context := thisContext.
- [context notNil] whileTrue: [
- (context receiver isKindOf: WebApplication) ifTrue: [^context receiver].
- context := context sender].
- ^self firstSessionFromStack lastApp! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/25/2007 21:34'!
-firstSessionFromStack
- "try to find a first sender up in calling stack, who is AIDASite and get session if that call"
- | context |
- context := thisContext.
- [context notNil] whileTrue: [
- (context receiver isKindOf: AIDASite) ifTrue: [^(context at: 3) "always?"].
- context := context sender].
- ^nil! !
-
-!Object methodsFor: '*Aida' stamp: 'mivsek 1/10/2008 18:14'!
-forLanguage: aLanguageCodeSymbol
- "for multilingual support: returns an apropriate instance of itself for that language.
- Langage is defined by ISO 639 2-letter language code, see
- http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes"
- ^false! !
-
-!Object methodsFor: '*Aida' stamp: 'mivsek 1/10/2008 18:14'!
-isMultilingual
- "for multilingual support: override this if your domain object responds
- to #forLanguage: and returns an apropriate instance of itself for that language"
- ^false! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:27'!
-isVersionedObject
- ^false! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:27'!
-isWebApplication
- ^false! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:27'!
-isWebStyle
- ^false! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:27'!
-modifiedTimestamp
- "when this object was last modified"
- "used in http response, override if you like to be included"
- ^nil! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:28'!
-preferedUrl
- "override with a suggestion for url of this method!! If not already used,
- it will be considered by URLResolver during automatic url generation"
- ^nil! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:28'!
-printWebAppNotFoundFor: aSession
- | page |
- page := WebPage new.
- page addText: 'Cannot find aWebApplication for object a', self class name.
- ^page! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:28'!
-printWebPageFor: aSession
- "find appropriate web application to represent self as web page"
-
- | webApp |
- webApp := self webAppFor: aSession.
- ^webApp notNil
- ifTrue: [webApp printWebPage]
- ifFalse: [self printWebAppNotFoundFor: aSession]! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:29'!
-sendOver: aStream
- "from Wiki rendering"
- self printOn: aStream! !
-
-!Object methodsFor: '*Aida' stamp: 'JM 4/22/2007 15:29'!
-webAppFor: aSession
- | webApp |
- aSession isNil ifTrue: [^nil].
- webApp := aSession webAppFor: self.
- webApp notNil ifTrue: [^webApp].
- webApp := WebApplication newFor: self on: aSession.
- webApp notNil ifTrue: [aSession addWebApp: webApp for: self].
- ^webApp! !
-
-
-!Object methodsFor: '*DynamicBindings' stamp: 'svp 3/6/2003 16:08'!
-binding
- "Answer the DynamicBinding for the receiver (if any)"
-
- ^Bindings bindingFor: self ifNotBound: [nil]! !
-
-!Object methodsFor: '*DynamicBindings' stamp: 'svp 4/29/2003 00:35'!
-binding: anObject
- "Set the dynamic binding for the receiver, if anObject is nil, then
- remove the receiver's dynamic binding (if any)"
-
- ^anObject
- ifNil: [self removeBinding]
- ifNotNil: [Bindings bind: self to: anObject]! !
-
-!Object methodsFor: '*DynamicBindings' stamp: 'svp 3/6/2003 16:09'!
-hasBinding
- "Answer whether or not the receiver has a dynamic binding"
-
- ^Bindings includesKey: self! !
-
-!Object methodsFor: '*DynamicBindings' stamp: 'svp 3/6/2003 16:09'!
-removeBinding
- "Remove the dynamic binding associated with the receiver"
-
- ^Bindings removeKey: self ifAbsent: []! !
-
-
-!Object methodsFor: '*KomHttpServer' stamp: 'SVP 8/23/1999 19:17'!
-asHtmlDocumentForRequest: aNetworkRequest
-
- self error:
- ('The requested object (',
- self asString,
- '), could not be converted into HTML for your browser.')! !
-
-!Object methodsFor: '*KomHttpServer' stamp: 'SVP 8/23/1999 19:23'!
-asHttpResponseTo: anHttpRequest
-
- ^(self asHtmlDocumentForRequest: anHttpRequest)
- asHttpResponseTo: anHttpRequest
-! !
-
-!Object methodsFor: '*KomHttpServer' stamp: 'svp 5/16/2003 12:47'!
-isComancheModule
-
- ^false! !
-
-!Object methodsFor: '*KomHttpServer' stamp: 'SVP 8/17/1999 17:51'!
-mimeType
-
- ^MIMEDocument defaultContentType! !
-
-
-!Object methodsFor: '*Morphic-NewCurve-testing''' stamp: 'wiz 12/31/2005 21:31'!
-isNonZero
-"Overriden in Number. This returns the backstop answer for non-numbers"
-^false.! !
-
-
-!Object methodsFor: '*Pinesoft-EventEnhancements' stamp: 'gvc 10/25/2006 18:18'!
-when: anEventSelector
-send: aMessageSelector
-to: anObject
-exclusive: aValueHolder
-
- self
- when: anEventSelector
- evaluate: ((ExclusiveWeakMessageSend
- receiver: anObject
- selector: aMessageSelector)
- basicExecuting: aValueHolder)! !
-
-!Object methodsFor: '*Pinesoft-EventEnhancements' stamp: 'gvc 10/25/2006 18:17'!
-when: anEventSelector
-send: aMessageSelector
-to: anObject
-with: anArg
-exclusive: aValueHolder
-
- self
- when: anEventSelector
- evaluate: ((ExclusiveWeakMessageSend
- receiver: anObject
- selector: aMessageSelector
- arguments: (Array with: anArg))
- basicExecuting: aValueHolder)! !
-
-!Object methodsFor: '*Pinesoft-EventEnhancements' stamp: 'gvc 10/25/2006 18:17'!
-when: anEventSelector
-send: aMessageSelector
-to: anObject
-withArguments: anArgArray
-exclusive: aValueHolder
-
- self
- when: anEventSelector
- evaluate: ((ExclusiveWeakMessageSend
- receiver: anObject
- selector: aMessageSelector
- arguments: anArgArray)
- basicExecuting: aValueHolder)! !
-
-!Object methodsFor: '*Pinesoft-EventEnhancements' stamp: 'gvc 10/24/2006 11:50'!
-when: anEventSelector
-sendOnce: aMessageSelector
-to: anObject
-
- self
- when: anEventSelector
- evaluate: (NonReentrantWeakMessageSend
- receiver: anObject
- selector: aMessageSelector)! !
-
-!Object methodsFor: '*Pinesoft-EventEnhancements' stamp: 'gvc 10/24/2006 11:49'!
-when: anEventSelector
-sendOnce: aMessageSelector
-to: anObject
-with: anArg
-
- self
- when: anEventSelector
- evaluate: (NonReentrantWeakMessageSend
- receiver: anObject
- selector: aMessageSelector
- arguments: (Array with: anArg))! !
-
-!Object methodsFor: '*Pinesoft-EventEnhancements' stamp: 'gvc 10/24/2006 11:49'!
-when: anEventSelector
-sendOnce: aMessageSelector
-to: anObject
-withArguments: anArgArray
-
- self
- when: anEventSelector
- evaluate: (NonReentrantWeakMessageSend
- receiver: anObject
- selector: aMessageSelector
- arguments: anArgArray)! !
-
-
-!Object methodsFor: '*Pinesoft-Widgets' stamp: 'gvc 1/10/2007 11:41'!
-okToClose
- "Sent to models when a window closing.
- Allows this check to be independent of okToChange."
-
- ^true! !
-
-!Object methodsFor: '*Pinesoft-Widgets' stamp: 'gvc 4/17/2007 17:41'!
-taskbarIcon
- "Answer the icon for the receiver in a task bar
- or nil for the default."
-
- ^self class taskbarIcon! !
-
-
-!Object methodsFor: '*Pinesoft-Widgets-override' stamp: 'gvc 9/4/2007 12:32'!
-windowActiveOnFirstClick
- "Return true if my window should be active on first click."
-
- ^true! !
-
-
-!Object methodsFor: '*SeasideAdaptersCompatibility' stamp: 'pmm 11/25/2007 14:17'!
-toString
- ^self! !
-
-
-!Object methodsFor: '*Tools-Explorer' stamp: 'stephaneducasse 9/17/2005 21:52'!
-exploreAndYourself
- "i.e. explore; yourself. Thisway i can peek w/o typing all the parentheses"
- self explore.
- ^self! !
-
-!Object methodsFor: '*Tools-Explorer' stamp: 'stephaneducasse 9/17/2005 21:48'!
-exploreWithLabel: label
-
- ^ ObjectExplorer new openExplorerFor: self withLabel:
-label! !
-
-
-!Object methodsFor: '*kernel-extensions-flagging' stamp: 'mtf 1/26/2008 23:34'!
-deprecated
- "Warn that the sending method has been deprecated."
-
- Preferences showDeprecationWarnings ifTrue:
- [Deprecation signal: thisContext sender printString, ' has been deprecated.']! !
-
-
-!Object methodsFor: '*kernel-extensions-flexibility' stamp: 'kph 1/27/2008 19:21'!
-askFor: selector
-
- "returns true or false"
-
- ^ (self askFor: selector ifAbsent: nil) == true! !
-
-!Object methodsFor: '*kernel-extensions-flexibility' stamp: 'kph 10/17/2007 14:01'!
-askFor: selector ifAbsent: aBlock
-
- "enables a default value to be specified in order to be tolerant of potentially missing methods
-
- e.g.
- (myPoint askFor: #originOffset) ifAbsent: [ 0@0 ].
- "
-
- ^ (self class canUnderstand: selector) ifFalse: [ aBlock value ] ifTrue: [self perform: selector]! !
-
-
-!Object methodsFor: '*kernel-extensions-logging' stamp: 'mtf 1/26/2008 23:52'!
-log
- "This method provides the univeral entry point fo all logging mechanisms"
-
- "Options:
- 1. Null for null logging
- 2. A LogRouter instance wih a FrameworkAdaptor.
- 3. CurrentLog a process local variable supplying a LogRouter"
-
- ^ (Smalltalk at: #CurrentLog ifAbsent: [ Null default ]) value
- sender: thisContext sender; beginEntry; yourself! !
-
-
-!Object methodsFor: '*magritte-model-accessing' stamp: 'lr 3/9/2006 11:31'!
-description
- "Return the description of the reciever. Subclasses might override this message to return instance-based descriptions."
-
- ^ self class description! !
-
-!Object methodsFor: '*magritte-model-accessing' stamp: 'lr 3/9/2006 11:31'!
-mementoClass
- "Return a class to be used to remember or cache the receiver, namely a memento object."
-
- ^ MACheckedMemento! !
-
-
-!Object methodsFor: '*magritte-model-model' stamp: 'lr 3/9/2006 11:31'!
-readUsing: aDescription
- "Dispatch the read-access to the receiver using the accessor of aDescription."
-
- ^ aDescription accessor read: self! !
-
-!Object methodsFor: '*magritte-model-model' stamp: 'lr 3/9/2006 11:31'!
-write: anObject using: aDescription
- "Dispatch the write-access to the receiver of anObject using the accessor of aDescription."
-
- aDescription accessor write: anObject to: self! !
-
-
-!Object methodsFor: '*magritte-model-testing' stamp: 'lr 3/9/2006 11:31'!
-isDescription
- ^ false! !
-
-
-!Object methodsFor: '*magritte-morph-converting' stamp: 'lr 3/9/2006 11:33'!
-asMorph
- ^ self description asMorphOn: self! !
-
-
-!Object methodsFor: '*magritte-seaside-converting' stamp: 'lr 3/9/2006 11:33'!
-asComponent
- ^ self description asComponentOn: self! !
-
-
-!Object methodsFor: '*monticello' stamp: 'dvf 8/10/2004 23:25'!
-isConflict
- ^false! !
-
-
-!Object methodsFor: '*null' stamp: 'kph 9/6/2007 23:31'!
-ifNull: aBlock
-
- ^ self! !
-
-!Object methodsFor: '*null' stamp: 'kph 9/6/2007 23:33'!
-isNull
-
- ^ false! !
-
-!Object methodsFor: '*null' stamp: 'kph 4/12/2007 08:27'!
-orNull
-
- ^ self! !
-
-
-!Object methodsFor: '*ob-tools-inspector' stamp: 'lr 6/5/2008 11:07'!
-basicInspectorNodes
- <inspector: #'1' priority: 600>
-
- | nodes |
- nodes := OrderedCollection new: self class instSize + self basicSize + 5.
- nodes add: self selfInspectorNode.
- self class allInstVarNames withIndexDo: [ :name :index |
- nodes add: (OTNamedVariableNode on: self index: index name: name) ].
- 1 to: self basicSize do: [ :index |
- nodes add: (OTIndexedVariableNode on: self index: index) ].
- ^ nodes! !
-
-!Object methodsFor: '*ob-tools-inspector' stamp: 'lr 6/5/2008 11:07'!
-protocolInspectorNodes
- <inspector: #'#' priority: 800>
-
- ^ self class allSelectors asArray sort
- collect: [ :each | OTProtocolInspectorNode on: self selector: each ]! !
-
-!Object methodsFor: '*ob-tools-inspector' stamp: 'lr 6/5/2008 09:58'!
-selfInspectorNode
- ^ OTDerivedInspectorNode on: self label: 'self' block: [ :obj | obj ]! !
-
-
-!Object methodsFor: '*omnibrowser-converting' stamp: 'cwp 4/17/2006 12:16'!
-asAnnouncement
- ^ self! !
-
-
-!Object methodsFor: '*pier-model' stamp: 'lr 3/9/2006 11:29'!
-accept: aVisitor
- self subclassResponsibility! !
-
-!Object methodsFor: '*pier-model' stamp: 'lr 3/9/2006 11:29'!
-acceptDecorated: aVisitor
- self accept: aVisitor! !
-
-
-!Object methodsFor: '*rio-kernel' stamp: 'kph 3/8/2007 21:25'!
-isRio
-
- ^ false! !
-
-
-!Object methodsFor: '*scriptaculous' stamp: 'lr 1/4/2007 17:20'!
-asFunction
- ^ self asFunction: #()! !
-
-!Object methodsFor: '*scriptaculous' stamp: 'lr 1/4/2007 17:21'!
-asFunction: aCollection
- ^ SUFunction new add: self; arguments: aCollection! !
-
-!Object methodsFor: '*scriptaculous' stamp: 'lr 4/11/2006 19:49'!
-asJavascript
- ^ String streamContents: [ :stream | self javascriptOn: stream ]! !
-
-
-!Object methodsFor: '*scriptaculous-printing' stamp: 'lr 4/20/2006 21:10'!
-javascriptOn: aStream
- self printOn: aStream! !
-
-
-!Object methodsFor: '*seaside2' stamp: 'lr 6/5/2007 21:35'!
-deprecatedApi
- self deprecatedApi: thisContext sender displayString! !
-
-!Object methodsFor: '*seaside2' stamp: 'lr 6/5/2007 21:35'!
-deprecatedApi: aString
- WADeprecatedApi raiseSignal: aString! !
-
-!Object methodsFor: '*seaside2' stamp: 'lr 5/9/2007 08:47'!
-inspectorFields
- | members |
- members := Array new writeStream.
- self class allInstVarNames withIndexDo: [ :each :index |
- members nextPut: each -> (self instVarAt: index) ].
- self class isVariable ifTrue: [
- 1 to: self size do: [ :index |
- members nextPut: index -> (self at: index) ] ].
- ^ members contents! !
-
-!Object methodsFor: '*seaside2' stamp: 'avi 3/14/2005 15:19'!
-labelForSelector: aSymbol
- ^ aSymbol asCapitalizedPhrase! !
-
-!Object methodsFor: '*seaside2' stamp: 'pmm 4/7/2007 17:14'!
-renderOn: aRenderer
- "Override this method to customize how objects (not components) are rendered when passed as an argument to #render:. The default is the return value of #displayString.
- Just remember that you can not use #callback:, #on:of:, or #call:"
-
- aRenderer text: self! !
-
-!Object methodsFor: '*seaside2' stamp: 'lr 3/19/2007 23:13'!
-restoreFromSnapshot: anObject
- self copyFrom: anObject! !
-
-!Object methodsFor: '*seaside2' stamp: 'avi 9/1/2004 21:20'!
-snapshotCopy
- ^ self shallowCopy! !
-
-!Object methodsFor: '*seaside2' stamp: 'lr 10/28/2007 14:42'!
-validationError: message
- ^WAValidationNotification raiseSignal: message! !
-
-
-!Object methodsFor: '*seaside2-encoding' stamp: 'lr 3/26/2007 20:16'!
-encodeOn: aDocument
- aDocument print: self displayString! !
-
-
-!Object methodsFor: '*seaside2-squeak' stamp: 'pmm 5/22/2007 22:10'!
-beMutable
- "for VW compatibility, a hack that allows to cache a value in a literal array"! !
-
-!Object methodsFor: '*seaside2-squeak' stamp: 'lr 7/12/2005 17:01'!
-displayString
- ^ self asString! !
-
-
-!Object methodsFor: '*services-base' stamp: 'rr 3/21/2006 11:54'!
-requestor
- "returns the focused window's requestor"
-
- "SystemWindow focusedWindow ifNotNilDo: [:w | ^ w requestor]."
-
- "triggers an infinite loop"
-
- ^ Requestor default! !
-
-
-!Object methodsFor: '*system-support' stamp: 'dvf 8/23/2003 12:27'!
-systemNavigation
-
- ^ SystemNavigation default! !
-
-
-!Object methodsFor: '*tools-browser' stamp: 'mu 3/6/2004 15:13'!
-browse
- self systemNavigation browseClass: self class! !
-
-!Object methodsFor: '*tools-browser' stamp: 'mu 3/11/2004 16:00'!
-browseHierarchy
- self systemNavigation browseHierarchy: self class! !
-
-
-!Object methodsFor: '*universes' stamp: 'ls 11/26/2006 12:33'!
-isUPackage
- ^false! !
-
-!Object methodsFor: '*universes' stamp: 'ls 11/26/2006 12:33'!
-isUPackageCategory
- ^false! !
-
-
-!Object methodsFor: 'accessing' stamp: 'sw 4/30/1998 12:18'!
-addInstanceVarNamed: aName withValue: aValue
- "Add an instance variable named aName and give it value aValue"
- self class addInstVarName: aName asString.
- self instVarAt: self class instSize put: aValue! !
-
-!Object methodsFor: 'accessing' stamp: 'yo 6/29/2004 11:39'!
-at: index
- "Primitive. Assumes receiver is indexable. Answer the value of an
- indexable element in the receiver. Fail if the argument index is not an
- Integer or is out of bounds. Essential. See Object documentation
- whatIsAPrimitive."
-
- <primitive: 60>
- index isInteger ifTrue:
- [self class isVariable
- ifTrue: [self errorSubscriptBounds: index]
- ifFalse: [self errorNotIndexable]].
- index isNumber
- ifTrue: [^self at: index asInteger]
- ifFalse: [self errorNonIntegerIndex]! !
-
-!Object methodsFor: 'accessing'!
-at: index modify: aBlock
- "Replace the element of the collection with itself transformed by the block"
- ^ self at: index put: (aBlock value: (self at: index))! !
-
-!Object methodsFor: 'accessing' stamp: 'yo 6/29/2004 13:08'!
-at: index put: value
- "Primitive. Assumes receiver is indexable. Store the argument value in
- the indexable element of the receiver indicated by index. Fail if the
- index is not an Integer or is out of bounds. Or fail if the value is not of
- the right type for this kind of collection. Answer the value that was
- stored. Essential. See Object documentation whatIsAPrimitive."
-
- <primitive: 61>
- index isInteger ifTrue:
- [self class isVariable
- ifTrue: [(index >= 1 and: [index <= self size])
- ifTrue: [self errorImproperStore]
- ifFalse: [self errorSubscriptBounds: index]]
- ifFalse: [self errorNotIndexable]].
- index isNumber
- ifTrue: [^self at: index asInteger put: value]
- ifFalse: [self errorNonIntegerIndex]! !
-
-!Object methodsFor: 'accessing' stamp: 'yo 9/20/2004 10:22'!
-basicAddInstanceVarNamed: aName withValue: aValue
- "Add an instance variable named aName and give it value aValue"
- self class addInstVarName: aName asString.
- self instVarAt: self class instSize put: aValue! !
-
-!Object methodsFor: 'accessing'!
-basicAt: index
- "Primitive. Assumes receiver is indexable. Answer the value of an
- indexable element in the receiver. Fail if the argument index is not an
- Integer or is out of bounds. Essential. Do not override in a subclass. See
- Object documentation whatIsAPrimitive."
-
- <primitive: 60>
- index isInteger ifTrue: [self errorSubscriptBounds: index].
- index isNumber
- ifTrue: [^self basicAt: index asInteger]
- ifFalse: [self errorNonIntegerIndex]! !
-
-!Object methodsFor: 'accessing'!
-basicAt: index put: value
- "Primitive. Assumes receiver is indexable. Store the second argument
- value in the indexable element of the receiver indicated by index. Fail
- if the index is not an Integer or is out of bounds. Or fail if the value is
- not of the right type for this kind of collection. Answer the value that
- was stored. Essential. Do not override in a subclass. See Object
- documentation whatIsAPrimitive."
-
- <primitive: 61>
- index isInteger
- ifTrue: [(index >= 1 and: [index <= self size])
- ifTrue: [self errorImproperStore]
- ifFalse: [self errorSubscriptBounds: index]].
- index isNumber
- ifTrue: [^self basicAt: index asInteger put: value]
- ifFalse: [self errorNonIntegerIndex]! !
-
-!Object methodsFor: 'accessing'!
-basicSize
- "Primitive. Answer the number of indexable variables in the receiver.
- This value is the same as the largest legal subscript. Essential. Do not
- override in any subclass. See Object documentation whatIsAPrimitive."
-
- <primitive: 62>
- "The number of indexable fields of fixed-length objects is 0"
- ^0 ! !
-
-!Object methodsFor: 'accessing'!
-bindWithTemp: aBlock
- ^ aBlock value: self value: nil! !
-
-!Object methodsFor: 'accessing' stamp: 'md 10/7/2004 15:43'!
-ifNil: nilBlock ifNotNilDo: aBlock
- "Evaluate aBlock with the receiver as its argument."
-
- ^ aBlock value: self
-! !
-
-!Object methodsFor: 'accessing' stamp: 'di 11/8/2000 21:04'!
-ifNotNilDo: aBlock
- "Evaluate the given block with the receiver as its argument."
-
- ^ aBlock value: self
-! !
-
-!Object methodsFor: 'accessing' stamp: 'md 10/7/2004 15:43'!
-ifNotNilDo: aBlock ifNil: nilBlock
- "Evaluate aBlock with the receiver as its argument."
-
- ^ aBlock value: self
-! !
-
-!Object methodsFor: 'accessing' stamp: 'ajh 1/21/2003 12:59'!
-in: aBlock
- "Evaluate the given block with the receiver as its argument."
-
- ^ aBlock value: self
-! !
-
-!Object methodsFor: 'accessing' stamp: 'sw 10/17/2000 11:15'!
-presenter
- "Answer the presenter object associated with the receiver. For morphs, there is in effect a clear containment hierarchy of presenters (accessed via their association with PasteUpMorphs); for arbitrary objects the hook is simply via the current world, at least at present."
-
- ^ self currentWorld presenter! !
-
-!Object methodsFor: 'accessing'!
-readFromString: aString
- "Create an object based on the contents of aString."
-
- ^self readFrom: (ReadStream on: aString)! !
-
-!Object methodsFor: 'accessing' stamp: 'di 3/29/1999 13:10'!
-size
- "Primitive. Answer the number of indexable variables in the receiver.
- This value is the same as the largest legal subscript. Essential. See Object
- documentation whatIsAPrimitive."
-
- <primitive: 62>
- self class isVariable ifFalse: [self errorNotIndexable].
- ^ 0! !
-
-!Object methodsFor: 'accessing' stamp: 'md 5/16/2006 12:34'!
-yourself
- "Answer self."
- ^self! !
-
-
-!Object methodsFor: 'associating' stamp: 'md 7/22/2005 16:03'!
--> anObject
- "Answer an Association between self and anObject"
-
- ^Association basicNew key: self value: anObject! !
-
-
-!Object methodsFor: 'binding'!
-bindingOf: aString
- ^nil! !
-
-
-!Object methodsFor: 'breakpoint' stamp: 'bkv 7/1/2003 12:33'!
-break
- "This is a simple message to use for inserting breakpoints during debugging.
- The debugger is opened by sending a signal. This gives a chance to restore
- invariants related to multiple processes."
-
- BreakPoint signal.
-
- "nil break."! !
-
-
-!Object methodsFor: 'casing'!
-caseOf: aBlockAssociationCollection
- "The elements of aBlockAssociationCollection are associations between blocks.
- Answer the evaluated value of the first association in aBlockAssociationCollection
- whose evaluated key equals the receiver. If no match is found, report an error."
-
- ^ self caseOf: aBlockAssociationCollection otherwise: [self caseError]
-
-"| z | z _ {[#a]->[1+1]. ['b' asSymbol]->[2+2]. [#c]->[3+3]}. #b caseOf: z"
-"| z | z _ {[#a]->[1+1]. ['d' asSymbol]->[2+2]. [#c]->[3+3]}. #b caseOf: z"
-"The following are compiled in-line:"
-"#b caseOf: {[#a]->[1+1]. ['b' asSymbol]->[2+2]. [#c]->[3+3]}"
-"#b caseOf: {[#a]->[1+1]. ['d' asSymbol]->[2+2]. [#c]->[3+3]}"! !
-
-!Object methodsFor: 'casing'!
-caseOf: aBlockAssociationCollection otherwise: aBlock
- "The elements of aBlockAssociationCollection are associations between blocks.
- Answer the evaluated value of the first association in aBlockAssociationCollection
- whose evaluated key equals the receiver. If no match is found, answer the result
- of evaluating aBlock."
-
- aBlockAssociationCollection associationsDo:
- [:assoc | (assoc key value = self) ifTrue: [^assoc value value]].
- ^ aBlock value
-
-"| z | z _ {[#a]->[1+1]. ['b' asSymbol]->[2+2]. [#c]->[3+3]}. #b caseOf: z otherwise: [0]"
-"| z | z _ {[#a]->[1+1]. ['d' asSymbol]->[2+2]. [#c]->[3+3]}. #b caseOf: z otherwise: [0]"
-"The following are compiled in-line:"
-"#b caseOf: {[#a]->[1+1]. ['b' asSymbol]->[2+2]. [#c]->[3+3]} otherwise: [0]"
-"#b caseOf: {[#a]->[1+1]. ['d' asSymbol]->[2+2]. [#c]->[3+3]} otherwise: [0]"! !
-
-
-!Object methodsFor: 'class membership'!
-class
- "Primitive. Answer the object which is the receiver's class. Essential. See
- Object documentation whatIsAPrimitive."
-
- <primitive: 111>
- self primitiveFailed! !
-
-!Object methodsFor: 'class membership' stamp: 'sw 9/27/2001 15:51'!
-inheritsFromAnyIn: aList
- "Answer whether the receiver inherits from any class represented by any element in the list. The elements of the list can be classes, class name symbols, or strings representing possible class names. This allows speculative membership tests to be made even when some of the classes may not be known to the current image, and even when their names are not interned symbols."
-
- | aClass |
- aList do:
- [:elem | Symbol hasInterned: elem asString ifTrue:
- [:elemSymbol | (((aClass _ Smalltalk at: elemSymbol ifAbsent: [nil]) isKindOf: Class)
- and: [self isKindOf: aClass])
- ifTrue:
- [^ true]]].
- ^ false
-
-
-"
-{3. true. 'olive'} do:
- [:token |
- {{#Number. #Boolean}. {Number. Boolean }. {'Number'. 'Boolean'}} do:
- [:list |
- Transcript cr; show: token asString, ' list element provided as a ', list first class name, ' - ', (token inheritsFromAnyIn: list) asString]]
-"! !
-
-!Object methodsFor: 'class membership'!
-isKindOf: aClass
- "Answer whether the class, aClass, is a superclass or class of the receiver."
-
- self class == aClass
- ifTrue: [^true]
- ifFalse: [^self class inheritsFrom: aClass]! !
-
-!Object methodsFor: 'class membership' stamp: 'sw 2/16/98 02:08'!
-isKindOf: aClass orOf: anotherClass
- "Answer whether either of the classes, aClass or anotherClass,, is a superclass or class of the receiver. A convenience; could be somewhat optimized"
- ^ (self isKindOf: aClass) or: [self isKindOf: anotherClass]! !
-
-!Object methodsFor: 'class membership'!
-isMemberOf: aClass
- "Answer whether the receiver is an instance of the class, aClass."
-
- ^self class == aClass! !
-
-!Object methodsFor: 'class membership'!
-respondsTo: aSymbol
- "Answer whether the method dictionary of the receiver's class contains
- aSymbol as a message selector."
-
- ^self class canUnderstand: aSymbol! !
-
-!Object methodsFor: 'class membership' stamp: 'tk 10/21/1998 12:38'!
-xxxClass
- "For subclasses of nil, such as ObjectOut"
- ^ self class! !
-
-
-!Object methodsFor: 'comparing' stamp: 'tk 4/16/1999 18:26'!
-closeTo: anObject
- "Answer whether the receiver and the argument represent the same
- object. If = is redefined in any subclass, consider also redefining the
- message hash."
-
- | ans |
- [ans _ self = anObject] ifError: [:aString :aReceiver | ^ false].
- ^ ans! !
-
-!Object methodsFor: 'comparing'!
-hash
- "Answer a SmallInteger whose value is related to the receiver's identity.
- May be overridden, and should be overridden in any classes that define = "
-
- ^ self identityHash! !
-
-!Object methodsFor: 'comparing' stamp: 'pm 9/23/97 09:36'!
-hashMappedBy: map
- "Answer what my hash would be if oops changed according to map."
-
- ^map newHashFor: self! !
-
-!Object methodsFor: 'comparing' stamp: 'di 9/27/97 20:23'!
-identityHashMappedBy: map
- "Answer what my hash would be if oops changed according to map."
-
- ^map newHashFor: self! !
-
-!Object methodsFor: 'comparing' stamp: 'sw 8/20/1998 12:34'!
-identityHashPrintString
- "'fred' identityHashPrintString"
-
- ^ '(', self identityHash printString, ')'! !
-
-!Object methodsFor: 'comparing' stamp: 'ajh 2/2/2002 15:02'!
-literalEqual: other
-
- ^ self class == other class and: [self = other]! !
-
-!Object methodsFor: 'comparing'!
-= anObject
- "Answer whether the receiver and the argument represent the same
- object. If = is redefined in any subclass, consider also redefining the
- message hash."
-
- ^self == anObject! !
-
-!Object methodsFor: 'comparing'!
-~= anObject
- "Answer whether the receiver and the argument do not represent the
- same object."
-
- ^self = anObject == false! !
-
-
-!Object methodsFor: 'converting' stamp: 'di 11/9/1998 12:15'!
-adaptToFloat: rcvr andSend: selector
- "If no method has been provided for adapting an object to a Float,
- then it may be adequate to simply adapt it to a number."
- ^ self adaptToNumber: rcvr andSend: selector! !
-
-!Object methodsFor: 'converting' stamp: 'di 11/9/1998 12:14'!
-adaptToFraction: rcvr andSend: selector
- "If no method has been provided for adapting an object to a Fraction,
- then it may be adequate to simply adapt it to a number."
- ^ self adaptToNumber: rcvr andSend: selector! !
-
-!Object methodsFor: 'converting' stamp: 'di 11/9/1998 12:15'!
-adaptToInteger: rcvr andSend: selector
- "If no method has been provided for adapting an object to a Integer,
- then it may be adequate to simply adapt it to a number."
- ^ self adaptToNumber: rcvr andSend: selector! !
-
-!Object methodsFor: 'converting' stamp: 'rw 4/27/2002 07:48'!
-asActionSequence
-
- ^WeakActionSequence with: self! !
-
-!Object methodsFor: 'converting' stamp: 'rw 7/20/2003 16:03'!
-asActionSequenceTrappingErrors
-
- ^WeakActionSequenceTrappingErrors with: self! !
-
-!Object methodsFor: 'converting' stamp: 'svp 5/16/2000 18:14'!
-asDraggableMorph
- ^(StringMorph contents: self printString)
- color: Color white;
- yourself! !
-
-!Object methodsFor: 'converting' stamp: 'sma 5/12/2000 17:39'!
-asOrderedCollection
- "Answer an OrderedCollection with the receiver as its only element."
-
- ^ OrderedCollection with: self! !
-
-!Object methodsFor: 'converting'!
-asString
- "Answer a string that represents the receiver."
-
- ^ self printString ! !
-
-!Object methodsFor: 'converting' stamp: 'ajh 3/11/2003 10:27'!
-asStringOrText
- "Answer a string that represents the receiver."
-
- ^ self printString ! !
-
-!Object methodsFor: 'converting'!
-as: aSimilarClass
- "Create an object of class aSimilarClass that has similar contents to the receiver."
-
- ^ aSimilarClass newFrom: self! !
-
-!Object methodsFor: 'converting' stamp: 'RAA 8/2/1999 12:41'!
-complexContents
-
- ^self! !
-
-!Object methodsFor: 'converting' stamp: 'ajh 7/6/2003 20:37'!
-mustBeBoolean
- "Catches attempts to test truth of non-Booleans. This message is sent from the VM. The sending context is rewound to just before the jump causing this exception."
-
- ^ self mustBeBooleanIn: thisContext sender! !
-
-!Object methodsFor: 'converting' stamp: 'ajh 7/6/2003 20:40'!
-mustBeBooleanIn: context
- "context is the where the non-boolean error occurred. Rewind context to before jump then raise error."
-
- | proceedValue |
- context skipBackBeforeJump.
- proceedValue _ NonBooleanReceiver new
- object: self;
- signal: 'proceed for truth.'.
- ^ proceedValue ~~ false! !
-
-!Object methodsFor: 'converting' stamp: 'sw 3/26/2001 12:12'!
-printDirectlyToDisplay
- "For debugging: write the receiver's printString directly to the display at (0, 100); senders of this are detected by the check-for-slips mechanism."
-
- self asString displayAt: 0@100
-
-"StringMorph someInstance printDirectlyToDisplay"! !
-
-!Object methodsFor: 'converting' stamp: 'RAA 3/31/1999 12:13'!
-withoutListWrapper
-
- ^self! !
-
-
-!Object methodsFor: 'copying'!
-clone
-
- <primitive: 148>
- self primitiveFailed! !
-
-!Object methodsFor: 'copying' stamp: 'ajh 8/18/2001 21:25'!
-copy
- "Answer another instance just like the receiver. Subclasses typically override postCopy; they typically do not override shallowCopy."
-
- ^self shallowCopy postCopy! !
-
-!Object methodsFor: 'copying' stamp: 'tk 8/20/1998 16:01'!
-copyAddedStateFrom: anotherObject
- "Copy over the values of instance variables added by the receiver's class from anotherObject to the receiver. These will be remapped in mapUniClasses, if needed."
-
- self class superclass instSize + 1 to: self class instSize do:
- [:index | self instVarAt: index put: (anotherObject instVarAt: index)]! !
-
-!Object methodsFor: 'copying' stamp: 'tpr 2/14/2004 21:53'!
-copyFrom: anotherObject
- "Copy to myself all instance variables I have in common with anotherObject. This is dangerous because it ignores an object's control over its own inst vars. "
-
- | mine his |
- <primitive: 168>
- mine _ self class allInstVarNames.
- his _ anotherObject class allInstVarNames.
- 1 to: (mine size min: his size) do: [:ind |
- (mine at: ind) = (his at: ind) ifTrue: [
- self instVarAt: ind put: (anotherObject instVarAt: ind)]].
- self class isVariable & anotherObject class isVariable ifTrue: [
- 1 to: (self basicSize min: anotherObject basicSize) do: [:ind |
- self basicAt: ind put: (anotherObject basicAt: ind)]].! !
-
-!Object methodsFor: 'copying' stamp: 'ajh 5/23/2002 00:38'!
-copySameFrom: otherObject
- "Copy to myself all instance variables named the same in otherObject.
- This ignores otherObject's control over its own inst vars."
-
- | myInstVars otherInstVars match |
- myInstVars _ self class allInstVarNames.
- otherInstVars _ otherObject class allInstVarNames.
- myInstVars doWithIndex: [:each :index |
- (match _ otherInstVars indexOf: each) > 0 ifTrue:
- [self instVarAt: index put: (otherObject instVarAt: match)]].
- 1 to: (self basicSize min: otherObject basicSize) do: [:i |
- self basicAt: i put: (otherObject basicAt: i)].
-! !
-
-!Object methodsFor: 'copying' stamp: 'tk 4/20/1999 14:44'!
-copyTwoLevel
- "one more level than a shallowCopy"
-
- | newObject class index |
- class _ self class.
- newObject _ self clone.
- newObject == self ifTrue: [^ self].
- class isVariable
- ifTrue:
- [index _ self basicSize.
- [index > 0]
- whileTrue:
- [newObject basicAt: index put: (self basicAt: index) shallowCopy.
- index _ index - 1]].
- index _ class instSize.
- [index > 0]
- whileTrue:
- [newObject instVarAt: index put: (self instVarAt: index) shallowCopy.
- index _ index - 1].
- ^newObject! !
-
-!Object methodsFor: 'copying'!
-deepCopy
- "Answer a copy of the receiver with its own copy of each instance
- variable."
-
- | newObject class index |
- class _ self class.
- (class == Object) ifTrue: [^self].
- class isVariable
- ifTrue:
- [index _ self basicSize.
- newObject _ class basicNew: index.
- [index > 0]
- whileTrue:
- [newObject basicAt: index put: (self basicAt: index) deepCopy.
- index _ index - 1]]
- ifFalse: [newObject _ class basicNew].
- index _ class instSize.
- [index > 0]
- whileTrue:
- [newObject instVarAt: index put: (self instVarAt: index) deepCopy.
- index _ index - 1].
- ^newObject! !
-
-!Object methodsFor: 'copying' stamp: 'hg 11/23/1999 13:43'!
-initialDeepCopierSize
- "default value is 4096; other classes may override this, esp. for smaller (=faster) sizes"
-
- ^4096! !
-
-!Object methodsFor: 'copying' stamp: 'ajh 1/27/2003 18:45'!
-postCopy
- "self is a shallow copy, subclasses should copy fields as necessary to complete the full copy"
-
- ^ self! !
-
-!Object methodsFor: 'copying' stamp: 'jm 11/14/97 11:08'!
-shallowCopy
- "Answer a copy of the receiver which shares the receiver's instance variables."
- | class newObject index |
- <primitive: 148>
- class _ self class.
- class isVariable
- ifTrue:
- [index _ self basicSize.
- newObject _ class basicNew: index.
- [index > 0]
- whileTrue:
- [newObject basicAt: index put: (self basicAt: index).
- index _ index - 1]]
- ifFalse: [newObject _ class basicNew].
- index _ class instSize.
- [index > 0]
- whileTrue:
- [newObject instVarAt: index put: (self instVarAt: index).
- index _ index - 1].
- ^ newObject! !
-
-!Object methodsFor: 'copying' stamp: 'tk 3/11/2003 13:58'!
-veryDeepCopy
- "Do a complete tree copy using a dictionary. An object in the tree twice is only copied once. All references to the object in the copy of the tree will point to the new copy."
-
- | copier new |
- copier _ DeepCopier new initialize: self initialDeepCopierSize.
- new _ self veryDeepCopyWith: copier.
- copier mapUniClasses.
- copier references associationsDo: [:assoc |
- assoc value veryDeepFixupWith: copier].
- copier fixDependents.
- ^ new! !
-
-!Object methodsFor: 'copying' stamp: 'tk 3/11/2003 13:58'!
-veryDeepCopySibling
- "Do a complete tree copy using a dictionary. Substitute a clone of oldPlayer for the root. Normally, a Player or non systemDefined object would have a new class. We do not want one this time. An object in the tree twice, is only copied once. All references to the object in the copy of the tree will point to the new copy."
-
- | copier new |
- copier _ DeepCopier new initialize: self initialDeepCopierSize.
- copier newUniClasses: false.
- new _ self veryDeepCopyWith: copier.
- copier mapUniClasses.
- copier references associationsDo: [:assoc |
- assoc value veryDeepFixupWith: copier].
- copier fixDependents.
- ^ new! !
-
-!Object methodsFor: 'copying' stamp: 'tk 5/13/2003 19:39'!
-veryDeepCopyUsing: copier
- "Do a complete tree copy using a dictionary. An object in the tree twice is only copied once. All references to the object in the copy of the tree will point to the new copy.
- Same as veryDeepCopy except copier (with dictionary) is supplied.
- ** do not delete this method, even if it has no callers **"
-
- | new refs newDep newModel |
- new _ self veryDeepCopyWith: copier.
- copier mapUniClasses.
- copier references associationsDo: [:assoc |
- assoc value veryDeepFixupWith: copier].
- "Fix dependents"
- refs _ copier references.
- DependentsFields associationsDo: [:pair |
- pair value do: [:dep |
- (newDep _ refs at: dep ifAbsent: [nil]) ifNotNil: [
- newModel _ refs at: pair key ifAbsent: [pair key].
- newModel addDependent: newDep]]].
- ^ new! !
-
-!Object methodsFor: 'copying' stamp: 'tk 3/11/2003 14:12'!
-veryDeepCopyWith: deepCopier
- "Copy me and the entire tree of objects I point to. An object in the tree twice is copied once, and both references point to him. deepCopier holds a dictionary of objects we have seen. Some classes refuse to be copied. Some classes are picky about which fields get deep copied."
- | class index sub subAss new uc sup has mine |
- deepCopier references at: self ifPresent: [:newer | ^ newer]. "already did him"
- class _ self class.
- class isMeta ifTrue: [^ self]. "a class"
- new _ self clone.
- (class isSystemDefined not and: [deepCopier newUniClasses "allowed"]) ifTrue: [
- uc _ deepCopier uniClasses at: class ifAbsent: [nil].
- uc ifNil: [
- deepCopier uniClasses at: class put: (uc _ self copyUniClassWith: deepCopier).
- deepCopier references at: class put: uc]. "remember"
- new _ uc new.
- new copyFrom: self]. "copy inst vars in case any are weak"
- deepCopier references at: self put: new. "remember"
- (class isVariable and: [class isPointers]) ifTrue:
- [index _ self basicSize.
- [index > 0] whileTrue:
- [sub _ self basicAt: index.
- (subAss _ deepCopier references associationAt: sub ifAbsent: [nil])
- ifNil: [new basicAt: index put: (sub veryDeepCopyWith: deepCopier)]
- ifNotNil: [new basicAt: index put: subAss value].
- index _ index - 1]].
- "Ask each superclass if it wants to share (weak copy) any inst vars"
- new veryDeepInner: deepCopier. "does super a lot"
-
- "other superclasses want all inst vars deep copied"
- sup _ class. index _ class instSize.
- [has _ sup compiledMethodAt: #veryDeepInner: ifAbsent: [nil].
- has _ has ifNil: [class isSystemDefined not "is a uniClass"] ifNotNil: [true].
- mine _ sup instVarNames.
- has ifTrue: [index _ index - mine size] "skip inst vars"
- ifFalse: [1 to: mine size do: [:xx |
- sub _ self instVarAt: index.
- (subAss _ deepCopier references associationAt: sub ifAbsent: [nil])
- "use association, not value, so nil is an exceptional value"
- ifNil: [new instVarAt: index put:
- (sub veryDeepCopyWith: deepCopier)]
- ifNotNil: [new instVarAt: index put: subAss value].
- index _ index - 1]].
- (sup _ sup superclass) == nil] whileFalse.
- new rehash. "force Sets and Dictionaries to rehash"
- ^ new
-! !
-
-!Object methodsFor: 'copying' stamp: 'tk 1/6/1999 17:39'!
-veryDeepFixupWith: deepCopier
- "I have no fields and no superclass. Catch the super call."
-! !
-
-!Object methodsFor: 'copying' stamp: 'tk 9/4/2001 10:30'!
-veryDeepInner: deepCopier
- "No special treatment for inst vars of my superclasses. Override when some need to be weakly copied. Object>>veryDeepCopyWith: will veryDeepCopy any inst var whose class does not actually define veryDeepInner:"
-! !
-
-
-!Object methodsFor: 'creation' stamp: 'nk 2/26/2004 13:35'!
-asStringMorph
- "Open a StringMorph, as best one can, on the receiver"
-
- ^ self asStringOrText asStringMorph
-! !
-
-!Object methodsFor: 'creation' stamp: 'nk 2/26/2004 13:35'!
-asTextMorph
- "Open a TextMorph, as best one can, on the receiver"
-
- ^ TextMorph new contentsAsIs: self asStringOrText
-! !
-
-!Object methodsFor: 'creation' stamp: 'sw 1/29/2002 21:45'!
-openAsMorph
- "Open a morph, as best one can, on the receiver"
-
- ^ self asMorph openInHand
-
-"
-234 openAsMorph
-(ScriptingSystem formAtKey: #TinyMenu) openAsMorph
-'fred' openAsMorph
-"! !
-
-
-!Object methodsFor: 'debugging' stamp: 'md 11/24/2004 11:45'!
-haltIf: condition
- "This is the typical message to use for inserting breakpoints during
- debugging. Param can be a block or expression, halt if true.
- If the Block has one arg, the receiver is bound to that.
- If the condition is a selector, we look up in the callchain. Halt if
- any method's selector equals selector."
- | cntxt |
-
- condition isSymbol ifTrue:[
- "only halt if a method with selector symbol is in callchain"
- cntxt := thisContext.
- [cntxt sender isNil] whileFalse: [
- cntxt := cntxt sender.
- (cntxt selector = condition) ifTrue: [Halt signal].
- ].
- ^self.
- ].
- (condition isBlock
- ifTrue: [condition valueWithPossibleArgument: self]
- ifFalse: [condition]
- ) ifTrue: [
- Halt signal
- ].! !
-
-!Object methodsFor: 'debugging'!
-needsWork! !
-
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:26'!
-checkHaltCountExpired
- | counter |
- counter _ Smalltalk at: #HaltCount ifAbsent: [0].
- ^counter = 0! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 5/19/2004 19:04'!
-clearHaltOnce
- "Turn on the halt once flag."
- Smalltalk at: #HaltOnce put: false! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:30'!
-decrementAndCheckHaltCount
- self decrementHaltCount.
- ^self checkHaltCountExpired! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:28'!
-decrementHaltCount
- | counter |
- counter := Smalltalk
- at: #HaltCount
- ifAbsent: [0].
- counter > 0 ifTrue: [
- counter _ counter - 1.
- self setHaltCountTo: counter]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:42'!
-doExpiredHaltCount
- self clearHaltOnce.
- self removeHaltCount.
- self halt! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:44'!
-doExpiredHaltCount: aString
- self clearHaltOnce.
- self removeHaltCount.
- self halt: aString! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:45'!
-doExpiredInspectCount
- self clearHaltOnce.
- self removeHaltCount.
- self inspect! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:43'!
-haltOnCount: int
- self haltOnceEnabled
- ifTrue: [self hasHaltCount
- ifTrue: [self decrementAndCheckHaltCount
- ifTrue: [self doExpiredHaltCount]]
- ifFalse: [int = 1
- ifTrue: [self doExpiredHaltCount]
- ifFalse: [self setHaltCountTo: int - 1]]]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 5/19/2004 19:05'!
-haltOnce
- "Halt unless we have already done it once."
- self haltOnceEnabled
- ifTrue: [self clearHaltOnce.
- ^ self halt]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 5/19/2004 19:04'!
-haltOnceEnabled
- ^ Smalltalk
- at: #HaltOnce
- ifAbsent: [false]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 5/19/2004 19:05'!
-haltOnce: aString
- "Halt unless we have already done it once."
- self haltOnceEnabled
- ifTrue: [self clearHaltOnce.
- ^ self halt: aString]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:45'!
-halt: aString onCount: int
- self haltOnceEnabled
- ifTrue: [self hasHaltCount
- ifTrue: [self decrementAndCheckHaltCount
- ifTrue: [self doExpiredHaltCount: aString]]
- ifFalse: [int = 1
- ifTrue: [self doExpiredHaltCount: aString]
- ifFalse: [self setHaltCountTo: int - 1]]]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:36'!
-hasHaltCount
- ^Smalltalk
- includesKey: #HaltCount! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:46'!
-inspectOnCount: int
- self haltOnceEnabled
- ifTrue: [self hasHaltCount
- ifTrue: [self decrementAndCheckHaltCount
- ifTrue: [self doExpiredInspectCount]]
- ifFalse: [int = 1
- ifTrue: [self doExpiredInspectCount]
- ifFalse: [self setHaltCountTo: int - 1]]]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 5/19/2004 19:05'!
-inspectOnce
- "Inspect unless we have already done it once."
- self haltOnceEnabled
- ifTrue: [self clearHaltOnce.
- ^ self inspect]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 13:20'!
-inspectUntilCount: int
- self haltOnceEnabled
- ifTrue: [self hasHaltCount
- ifTrue: [self decrementAndCheckHaltCount
- ifTrue: [self doExpiredInspectCount]
- ifFalse: [self inspect]]
- ifFalse: [int = 1
- ifTrue: [self doExpiredInspectCount]
- ifFalse: [self setHaltCountTo: int - 1]]]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:49'!
-removeHaltCount
- (Smalltalk includesKey: #HaltCount) ifTrue: [
- Smalltalk removeKey: #HaltCount]! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 6/2/2004 08:25'!
-setHaltCountTo: int
- Smalltalk at: #HaltCount put: int! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 5/19/2004 19:04'!
-setHaltOnce
- "Turn on the halt once flag."
- Smalltalk at: #HaltOnce put: true! !
-
-!Object methodsFor: 'debugging-haltOnce' stamp: 'sbw 5/19/2004 19:04'!
-toggleHaltOnce
- self haltOnceEnabled
- ifTrue: [self clearHaltOnce]
- ifFalse: [self setHaltOnce]! !
-
-
-!Object methodsFor: 'dependents access' stamp: 'ar 2/11/2001 01:55'!
-addDependent: anObject
- "Make the given object one of the receiver's dependents."
-
- | dependents |
- dependents _ self dependents.
- (dependents includes: anObject) ifFalse:
- [self myDependents: (dependents copyWithDependent: anObject)].
- ^ anObject! !
-
-!Object methodsFor: 'dependents access' stamp: 'sma 2/29/2000 19:53'!
-breakDependents
- "Remove all of the receiver's dependents."
-
- self myDependents: nil! !
-
-!Object methodsFor: 'dependents access' stamp: 'sma 2/29/2000 19:26'!
-canDiscardEdits
- "Answer true if none of the views on this model has unaccepted edits that matter."
-
- self dependents
- do: [:each | each canDiscardEdits ifFalse: [^ false]]
- without: self.
- ^ true! !
-
-!Object methodsFor: 'dependents access' stamp: 'sma 2/29/2000 19:58'!
-dependents
- "Answer a collection of objects that are 'dependent' on the receiver;
- that is, all objects that should be notified if the receiver changes."
-
- ^ self myDependents ifNil: [#()]! !
-
-!Object methodsFor: 'dependents access'!
-evaluate: actionBlock wheneverChangeIn: aspectBlock
- | viewerThenObject objectThenViewer |
- objectThenViewer _ self.
- viewerThenObject _ ObjectViewer on: objectThenViewer.
- objectThenViewer become: viewerThenObject.
- "--- Then ---"
- objectThenViewer xxxViewedObject: viewerThenObject
- evaluate: actionBlock
- wheneverChangeIn: aspectBlock! !
-
-!Object methodsFor: 'dependents access' stamp: 'sma 2/29/2000 19:59'!
-hasUnacceptedEdits
- "Answer true if any of the views on this object has unaccepted edits."
-
- self dependents
- do: [:each | each hasUnacceptedEdits ifTrue: [^ true]]
- without: self.
- ^ false! !
-
-!Object methodsFor: 'dependents access' stamp: 'sma 2/29/2000 19:55'!
-myDependents
- "Private. Answer a list of all the receiver's dependents."
-
- ^ DependentsFields at: self ifAbsent: []! !
-
-!Object methodsFor: 'dependents access' stamp: 'sma 2/29/2000 19:52'!
-myDependents: aCollectionOrNil
- "Private. Set (or remove) the receiver's dependents list."
-
- aCollectionOrNil
- ifNil: [DependentsFields removeKey: self ifAbsent: []]
- ifNotNil: [DependentsFields at: self put: aCollectionOrNil]! !
-
-!Object methodsFor: 'dependents access' stamp: 'reThink 2/18/2001 17:06'!
-release
- "Remove references to objects that may refer to the receiver. This message
- should be overridden by subclasses with any cycles, in which case the
- subclass should also include the expression super release."
-
- self releaseActionMap! !
-
-!Object methodsFor: 'dependents access' stamp: 'sma 2/29/2000 20:23'!
-removeDependent: anObject
- "Remove the given object as one of the receiver's dependents."
-
- | dependents |
- dependents _ self dependents reject: [:each | each == anObject].
- self myDependents: (dependents isEmpty ifFalse: [dependents]).
- ^ anObject! !
-
-
-!Object methodsFor: 'drag and drop' stamp: 'bh 9/16/2001 18:10'!
-acceptDroppingMorph: transferMorph event: evt inMorph: dstListMorph
-
- ^false.! !
-
-!Object methodsFor: 'drag and drop' stamp: 'mir 5/16/2000 11:35'!
-dragAnimationFor: item transferMorph: transferMorph
- "Default do nothing"! !
-
-!Object methodsFor: 'drag and drop' stamp: 'panda 4/28/2000 16:20'!
-dragPassengerFor: item inMorph: dragSource
- ^item! !
-
-!Object methodsFor: 'drag and drop' stamp: 'panda 4/28/2000 16:11'!
-dragTransferType
- ^nil! !
-
-!Object methodsFor: 'drag and drop' stamp: 'panda 4/28/2000 16:05'!
-dragTransferTypeForMorph: dragSource
- ^nil! !
-
-!Object methodsFor: 'drag and drop' stamp: 'mir 5/8/2000 17:19'!
-wantsDroppedMorph: aMorph event: anEvent inMorph: destinationLM
- ^false! !
-
-
-!Object methodsFor: 'error handling' stamp: 'sma 5/6/2000 19:35'!
-assert: aBlock
- "Throw an assertion error if aBlock does not evaluates to true."
-
- aBlock value ifFalse: [AssertionFailure signal: 'Assertion failed']! !
-
-!Object methodsFor: 'error handling' stamp: 'nk 1/15/2004 10:54'!
-assert: aBlock descriptionBlock: descriptionBlock
- "Throw an assertion error if aBlock does not evaluate to true."
-
- aBlock value ifFalse: [AssertionFailure signal: descriptionBlock value asString ]! !
-
-!Object methodsFor: 'error handling' stamp: 'nk 10/25/2003 16:47'!
-assert: aBlock description: aString
- "Throw an assertion error if aBlock does not evaluates to true."
-
- aBlock value ifFalse: [AssertionFailure signal: aString ]! !
-
-!Object methodsFor: 'error handling' stamp: 'md 10/13/2004 15:59'!
-backwardCompatibilityOnly: anExplanationString
- "Warn that the sending method has been deprecated. Methods that are tagt with #backwardCompatibility:
- are kept for compatibility."
-
- Preferences showDeprecationWarnings ifTrue:
- [Deprecation signal: thisContext sender printString, ' has been deprecated (but will be kept for compatibility). ', anExplanationString]! !
-
-!Object methodsFor: 'error handling'!
-caseError
- "Report an error from an in-line or explicit case statement."
-
- self error: 'Case not found, and no otherwise clause'! !
-
-!Object methodsFor: 'error handling' stamp: 'rbb 3/1/2005 09:26'!
-confirm: queryString
- "Put up a yes/no menu with caption queryString. Answer true if the
- response is yes, false if no. This is a modal question--the user must
- respond yes or no."
-
- "nil confirm: 'Are you hungry?'"
-
- ^ UIManager default confirm: queryString! !
-
-!Object methodsFor: 'error handling' stamp: 'rbb 3/1/2005 09:27'!
-confirm: aString orCancel: cancelBlock
- "Put up a yes/no/cancel menu with caption aString. Answer true if
- the response is yes, false if no. If cancel is chosen, evaluate
- cancelBlock. This is a modal question--the user must respond yes or no."
-
- ^ UIManager default confirm: aString orCancel: cancelBlock! !
-
-!Object methodsFor: 'error handling' stamp: 'dew 10/6/2003 18:20'!
-deprecated: anExplanationString
- "Warn that the sending method has been deprecated."
-
- Preferences showDeprecationWarnings ifTrue:
- [Deprecation signal: thisContext sender printString, ' has been deprecated. ', anExplanationString]! !
-
-!Object methodsFor: 'error handling' stamp: 'dew 10/7/2003 00:26'!
-deprecated: anExplanationString block: aBlock
- "Warn that the sender has been deprecated. Answer the value of aBlock on resumption. (Note that #deprecated: is usually the preferred method.)"
-
- Preferences showDeprecationWarnings ifTrue:
- [Deprecation
- signal: thisContext sender printString, ' has been deprecated. ', anExplanationString].
- ^ aBlock value.
-! !
-
-!Object methodsFor: 'error handling' stamp: 'md 2/22/2006 21:21'!
-doesNotUnderstand: aMessage
- "Handle the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message (typically sent from the machine when a message is sent to the receiver and no method is defined for that selector)."
- "Testing: (3 activeProcess)"
-
- MessageNotUnderstood new
- message: aMessage;
- receiver: self;
- signal.
- ^ aMessage sentTo: self.
-! !
-
-!Object methodsFor: 'error handling' stamp: 'TRee 11/4/2003 16:47'!
-dpsTrace: reportObject
- Transcript myDependents isNil ifTrue: [^self].
- self dpsTrace: reportObject levels: 1 withContext: thisContext
-
-" nil dpsTrace: 'sludder'. "! !
-
-!Object methodsFor: 'error handling' stamp: 'TRee 11/4/2003 16:49'!
-dpsTrace: reportObject levels: anInt
- self dpsTrace: reportObject levels: anInt withContext: thisContext
-
-"(1 to: 3) do: [:int | nil dpsTrace: int levels: 5.]"! !
-
-!Object methodsFor: 'error handling' stamp: 'TRee 11/4/2003 17:02'!
-dpsTrace: reportObject levels: anInt withContext: currentContext
- | reportString context displayCount |
- reportString := (reportObject respondsTo: #asString)
- ifTrue: [reportObject asString] ifFalse: [reportObject printString].
- (Smalltalk at: #Decompiler ifAbsent: [nil])
- ifNil:
- [Transcript cr; show: reportString]
- ifNotNil:
- [context := currentContext.
- displayCount := anInt > 1.
- 1 to: anInt do:
- [:count |
- Transcript cr.
- displayCount
- ifTrue: [Transcript show: count printString, ': '].
-
- reportString notNil
- ifTrue:
- [Transcript show: context home class name
- , '/' , context sender selector, ' (' , reportString , ')'.
- context := context sender.
- reportString := nil]
- ifFalse:
- [(context notNil and: [(context := context sender) notNil])
- ifTrue: [Transcript show: context receiver class name , '/' , context selector]]].
- "Transcript cr"].! !
-
-!Object methodsFor: 'error handling' stamp: 'md 8/2/2005 22:17'!
-error
- "Throw a generic Error exception."
-
- ^self error: 'Error!!'.! !
-
-!Object methodsFor: 'error handling' stamp: 'tfei 4/12/1999 12:55'!
-error: aString
- "Throw a generic Error exception."
-
- ^Error new signal: aString! !
-
-!Object methodsFor: 'error handling' stamp: 'al 9/16/2005 14:12'!
-explicitRequirement
- self error: 'Explicitly required method'! !
-
-!Object methodsFor: 'error handling' stamp: 'al 2/13/2006 22:20'!
-halt
- "This is the typical message to use for inserting breakpoints during
- debugging. It behaves like halt:, but does not call on halt: in order to
- avoid putting this message on the stack. Halt is especially useful when
- the breakpoint message is an arbitrary one."
-
- Halt signal! !
-
-!Object methodsFor: 'error handling' stamp: 'tfei 4/12/1999 12:59'!
-halt: aString
- "This is the typical message to use for inserting breakpoints during
- debugging. It creates and schedules a Notifier with the argument,
- aString, as the label."
-
- Halt new signal: aString! !
-
-!Object methodsFor: 'error handling' stamp: 'md 1/20/2006 16:24'!
-handles: exception
- "This method exists in case a non exception class is the first arg in an on:do: (for instance using a exception class that is not loaded). We prefer this to raising an error during error handling itself. Also, semantically it makes sense that the exception handler is not active if its exception class is not loaded"
-
- ^ false! !
-
-!Object methodsFor: 'error handling' stamp: 'ar 9/27/2005 20:24'!
-notifyWithLabel: aString
- "Create and schedule a Notifier with aString as the window label as well as the contents of the window, in order to request confirmation before a process can proceed."
-
- ToolSet
- debugContext: thisContext
- label: aString
- contents: aString
-
- "nil notifyWithLabel: 'let us see if this works'"! !
-
-!Object methodsFor: 'error handling' stamp: 'hg 10/2/2001 20:49'!
-notify: aString
- "Create and schedule a Notifier with the argument as the message in
- order to request confirmation before a process can proceed."
-
- Warning signal: aString
-
- "nil notify: 'confirmation message'"! !
-
-!Object methodsFor: 'error handling'!
-notify: aString at: location
- "Create and schedule a Notifier with the argument as the message in
- order to request confirmation before a process can proceed. Subclasses can
- override this and insert an error message at location within aString."
-
- self notify: aString
-
- "nil notify: 'confirmation message' at: 12"! !
-
-!Object methodsFor: 'error handling'!
-primitiveFailed
- "Announce that a primitive has failed and there is no appropriate
- Smalltalk code to run."
-
- self error: 'a primitive has failed'! !
-
-!Object methodsFor: 'error handling' stamp: 'al 9/16/2005 14:12'!
-requirement
- self error: 'Implicitly required method'! !
-
-!Object methodsFor: 'error handling' stamp: 'AFi 2/8/2003 22:52'!
-shouldBeImplemented
- "Announce that this message should be implemented"
-
- self error: 'This message should be implemented'! !
-
-!Object methodsFor: 'error handling'!
-shouldNotImplement
- "Announce that, although the receiver inherits this message, it should
- not implement it."
-
- self error: 'This message is not appropriate for this object'! !
-
-!Object methodsFor: 'error handling' stamp: 'md 2/17/2006 12:02'!
-subclassResponsibility
- "This message sets up a framework for the behavior of the class' subclasses.
- Announce that the subclass should have implemented this message."
-
- self error: 'My subclass should have overridden ', thisContext sender selector printString! !
-
-!Object methodsFor: 'error handling' stamp: 'al 12/16/2003 16:16'!
-traitConflict
- self error: 'A class or trait does not properly resolve a conflict between multiple traits it uses.'! !
-
-
-!Object methodsFor: 'evaluating' stamp: 'reThink 3/12/2001 18:14'!
-value
-
- ^self! !
-
-!Object methodsFor: 'evaluating' stamp: 'reThink 2/18/2001 15:23'!
-valueWithArguments: aSequenceOfArguments
-
- ^self! !
-
-
-!Object methodsFor: 'events' stamp: 'nk 8/27/2003 16:23'!
-actionsWithReceiver: anObject forEvent: anEventSelector
-
- ^(self actionSequenceForEvent: anEventSelector)
- select: [:anAction | anAction receiver == anObject ]! !
-
-!Object methodsFor: 'events' stamp: 'nk 8/27/2003 17:45'!
-renameActionsWithReceiver: anObject forEvent: anEventSelector toEvent: newEvent
-
- | oldActions newActions |
- oldActions _ Set new.
- newActions _ Set new.
- (self actionSequenceForEvent: anEventSelector) do: [ :action |
- action receiver == anObject
- ifTrue: [ oldActions add: anObject ]
- ifFalse: [ newActions add: anObject ]].
- self setActionSequence: (ActionSequence withAll: newActions) forEvent: anEventSelector.
- oldActions do: [ :act | self when: newEvent evaluate: act ].! !
-
-
-!Object methodsFor: 'events-accessing' stamp: 'nk 12/20/2002 17:48'!
-actionForEvent: anEventSelector
- "Answer the action to be evaluated when <anEventSelector> has been triggered."
-
- | actions |
- actions := self actionMap
- at: anEventSelector asSymbol
- ifAbsent: [nil].
- actions ifNil: [^nil].
- ^ actions asMinimalRepresentation! !
-
-!Object methodsFor: 'events-accessing' stamp: 'nk 12/20/2002 17:48'!
-actionForEvent: anEventSelector
-ifAbsent: anExceptionBlock
- "Answer the action to be evaluated when <anEventSelector> has been triggered."
-
- | actions |
- actions := self actionMap
- at: anEventSelector asSymbol
- ifAbsent: [nil].
- actions ifNil: [^anExceptionBlock value].
- ^ actions asMinimalRepresentation! !
-
-!Object methodsFor: 'events-accessing' stamp: 'reThink 2/18/2001 14:43'!
-actionMap
-
- ^EventManager actionMapFor: self! !
-
-!Object methodsFor: 'events-accessing' stamp: 'rw 4/27/2002 08:35'!
-actionSequenceForEvent: anEventSelector
-
- ^(self actionMap
- at: anEventSelector asSymbol
- ifAbsent: [^WeakActionSequence new])
- asActionSequence! !
-
-!Object methodsFor: 'events-accessing' stamp: 'SqR 6/28/2001 13:19'!
-actionsDo: aBlock
-
- self actionMap do: aBlock! !
-
-!Object methodsFor: 'events-accessing' stamp: 'rw 2/10/2002 13:05'!
-createActionMap
-
- ^IdentityDictionary new! !
-
-!Object methodsFor: 'events-accessing' stamp: 'SqR 2/19/2001 14:04'!
-hasActionForEvent: anEventSelector
- "Answer true if there is an action associated with anEventSelector"
-
- ^(self actionForEvent: anEventSelector) notNil! !
-
-!Object methodsFor: 'events-accessing' stamp: 'reThink 2/18/2001 15:29'!
-setActionSequence: actionSequence
-forEvent: anEventSelector
-
- | action |
- action := actionSequence asMinimalRepresentation.
- action == nil
- ifTrue:
- [self removeActionsForEvent: anEventSelector]
- ifFalse:
- [self updateableActionMap
- at: anEventSelector asSymbol
- put: action]! !
-
-!Object methodsFor: 'events-accessing' stamp: 'reThink 2/25/2001 08:50'!
-updateableActionMap
-
- ^EventManager updateableActionMapFor: self! !
-
-
-!Object methodsFor: 'events-registering' stamp: 'reThink 2/18/2001 15:04'!
-when: anEventSelector evaluate: anAction
-
- | actions |
- actions := self actionSequenceForEvent: anEventSelector.
- (actions includes: anAction)
- ifTrue: [^ self].
- self
- setActionSequence: (actions copyWith: anAction)
- forEvent: anEventSelector! !
-
-!Object methodsFor: 'events-registering' stamp: 'rww 12/30/2002 10:37'!
-when: anEventSelector
-send: aMessageSelector
-to: anObject
-
- self
- when: anEventSelector
- evaluate: (WeakMessageSend
- receiver: anObject
- selector: aMessageSelector)! !
-
-!Object methodsFor: 'events-registering' stamp: 'rww 12/30/2002 10:37'!
-when: anEventSelector
-send: aMessageSelector
-to: anObject
-withArguments: anArgArray
-
- self
- when: anEventSelector
- evaluate: (WeakMessageSend
- receiver: anObject
- selector: aMessageSelector
- arguments: anArgArray)! !
-
-!Object methodsFor: 'events-registering' stamp: 'rww 12/30/2002 10:37'!
-when: anEventSelector
-send: aMessageSelector
-to: anObject
-with: anArg
-
- self
- when: anEventSelector
- evaluate: (WeakMessageSend
- receiver: anObject
- selector: aMessageSelector
- arguments: (Array with: anArg))! !
-
-
-!Object methodsFor: 'events-removing' stamp: 'reThink 2/18/2001 15:33'!
-releaseActionMap
-
- EventManager releaseActionMapFor: self! !
-
-!Object methodsFor: 'events-removing' stamp: 'reThink 2/18/2001 15:33'!
-removeActionsForEvent: anEventSelector
-
- | map |
- map := self actionMap.
- map removeKey: anEventSelector asSymbol ifAbsent: [].
- map isEmpty
- ifTrue: [self releaseActionMap]! !
-
-!Object methodsFor: 'events-removing' stamp: 'nk 8/25/2003 21:46'!
-removeActionsSatisfying: aBlock
-
- self actionMap keys do:
- [:eachEventSelector |
- self
- removeActionsSatisfying: aBlock
- forEvent: eachEventSelector
- ]! !
-
-!Object methodsFor: 'events-removing' stamp: 'reThink 2/18/2001 15:31'!
-removeActionsSatisfying: aOneArgBlock
-forEvent: anEventSelector
-
- self
- setActionSequence:
- ((self actionSequenceForEvent: anEventSelector)
- reject: [:anAction | aOneArgBlock value: anAction])
- forEvent: anEventSelector! !
-
-!Object methodsFor: 'events-removing' stamp: 'rw 7/29/2003 17:18'!
-removeActionsWithReceiver: anObject
-
- self actionMap copy keysDo:
- [:eachEventSelector |
- self
- removeActionsSatisfying: [:anAction | anAction receiver == anObject]
- forEvent: eachEventSelector
- ]! !
-
-!Object methodsFor: 'events-removing' stamp: 'reThink 2/18/2001 15:36'!
-removeActionsWithReceiver: anObject
-forEvent: anEventSelector
-
- self
- removeActionsSatisfying:
- [:anAction |
- anAction receiver == anObject]
- forEvent: anEventSelector! !
-
-!Object methodsFor: 'events-removing' stamp: 'reThink 2/18/2001 15:31'!
-removeAction: anAction
-forEvent: anEventSelector
-
- self
- removeActionsSatisfying: [:action | action = anAction]
- forEvent: anEventSelector! !
-
-
-!Object methodsFor: 'events-triggering' stamp: 'reThink 2/18/2001 15:22'!
-triggerEvent: anEventSelector
- "Evaluate all actions registered for <anEventSelector>. Return the value of the last registered action."
-
- ^(self actionForEvent: anEventSelector) value! !
-
-!Object methodsFor: 'events-triggering' stamp: 'reThink 2/18/2001 17:09'!
-triggerEvent: anEventSelector
-ifNotHandled: anExceptionBlock
- "Evaluate all actions registered for <anEventSelector>. Return the value of the last registered action."
-
- ^(self
- actionForEvent: anEventSelector
- ifAbsent: [^anExceptionBlock value]) value
-! !
-
-!Object methodsFor: 'events-triggering' stamp: 'reThink 2/18/2001 15:21'!
-triggerEvent: anEventSelector
-withArguments: anArgumentList
-
- ^(self actionForEvent: anEventSelector)
- valueWithArguments: anArgumentList! !
-
-!Object methodsFor: 'events-triggering' stamp: 'reThink 2/18/2001 15:21'!
-triggerEvent: anEventSelector
-withArguments: anArgumentList
-ifNotHandled: anExceptionBlock
-
- ^(self
- actionForEvent: anEventSelector
- ifAbsent: [^anExceptionBlock value])
- valueWithArguments: anArgumentList! !
-
-!Object methodsFor: 'events-triggering' stamp: 'reThink 2/18/2001 14:59'!
-triggerEvent: anEventSelector
-with: anObject
-
- ^self
- triggerEvent: anEventSelector
- withArguments: (Array with: anObject)! !
-
-!Object methodsFor: 'events-triggering' stamp: 'reThink 2/18/2001 14:59'!
-triggerEvent: anEventSelector
-with: anObject
-ifNotHandled: anExceptionBlock
-
- ^self
- triggerEvent: anEventSelector
- withArguments: (Array with: anObject)
- ifNotHandled: anExceptionBlock! !
-
-
-!Object methodsFor: 'filter streaming' stamp: 'MPW 1/1/1901 00:42'!
-byteEncode:aStream
- self flattenOnStream:aStream.
-! !
-
-!Object methodsFor: 'filter streaming'!
-drawOnCanvas:aStream
- self flattenOnStream:aStream.
-! !
-
-!Object methodsFor: 'filter streaming' stamp: 'MPW 1/1/1901 01:31'!
-elementSeparator
- ^nil.! !
-
-!Object methodsFor: 'filter streaming'!
-encodePostscriptOn:aStream
- self byteEncode:aStream.
-! !
-
-!Object methodsFor: 'filter streaming' stamp: 'MPW 1/1/1901 00:07'!
-flattenOnStream:aStream
- self writeOnFilterStream:aStream.
-! !
-
-!Object methodsFor: 'filter streaming' stamp: 'mpw 6/22/1930 22:56'!
-fullDrawPostscriptOn:aStream
- ^aStream fullDraw:self.
-! !
-
-!Object methodsFor: 'filter streaming' stamp: 'MPW 1/1/1901 01:51'!
-printOnStream:aStream
- self byteEncode:aStream.
-! !
-
-!Object methodsFor: 'filter streaming' stamp: 'MPW 1/1/1901 00:49'!
-putOn:aStream
- ^aStream nextPut:self.
-! !
-
-!Object methodsFor: 'filter streaming' stamp: 'MPW 1/1/1901 01:53'!
-storeOnStream:aStream
- self printOnStream:aStream.
-! !
-
-!Object methodsFor: 'filter streaming' stamp: 'MPW 1/1/1901 00:06'!
-writeOnFilterStream:aStream
- aStream writeObject:self.
-! !
-
-
-!Object methodsFor: 'finalization' stamp: 'ar 3/21/98 16:26'!
-actAsExecutor
- "Prepare the receiver to act as executor for any resources associated with it"
- self breakDependents! !
-
-!Object methodsFor: 'finalization' stamp: 'ar 3/20/98 22:19'!
-executor
- "Return an object which can act as executor for finalization of the receiver"
- ^self shallowCopy actAsExecutor! !
-
-!Object methodsFor: 'finalization' stamp: 'ar 5/19/2003 20:10'!
-finalizationRegistry
- "Answer the finalization registry associated with the receiver."
- ^WeakRegistry default! !
-
-!Object methodsFor: 'finalization' stamp: 'ar 3/21/98 16:27'!
-finalize
- "Finalize the resource associated with the receiver. This message should only be sent during the finalization process. There is NO garantuee that the resource associated with the receiver hasn't been free'd before so take care that you don't run into trouble - this all may happen with interrupt priority."! !
-
-!Object methodsFor: 'finalization' stamp: 'ar 3/21/98 18:38'!
-retryWithGC: execBlock until: testBlock
- "Retry execBlock as long as testBlock returns false. Do an incremental GC after the first try, a full GC after the second try."
- | blockValue |
- blockValue := execBlock value.
- (testBlock value: blockValue) ifTrue:[^blockValue].
- Smalltalk garbageCollectMost.
- blockValue := execBlock value.
- (testBlock value: blockValue) ifTrue:[^blockValue].
- Smalltalk garbageCollect.
- ^execBlock value.! !
-
-!Object methodsFor: 'finalization' stamp: 'ar 5/19/2003 20:14'!
-toFinalizeSend: aSelector to: aFinalizer with: aResourceHandle
- "When I am finalized (e.g., garbage collected) close the associated resource handle by sending aSelector to the appropriate finalizer (the guy who knows how to get rid of the resource).
- WARNING: Neither the finalizer nor the resource handle are allowed to reference me. If they do, then I will NEVER be garbage collected. Since this cannot be validated here, it is up to the client to make sure this invariant is not broken."
- self == aFinalizer ifTrue:[self error: 'I cannot finalize myself'].
- self == aResourceHandle ifTrue:[self error: 'I cannot finalize myself'].
- ^self finalizationRegistry add: self executor:
- (ObjectFinalizer new
- receiver: aFinalizer
- selector: aSelector
- argument: aResourceHandle)! !
-
-
-!Object methodsFor: 'flagging' stamp: 'sw 8/4/97 16:49'!
-isThisEverCalled
- ^ self isThisEverCalled: thisContext sender printString! !
-
-!Object methodsFor: 'flagging'!
-isThisEverCalled: msg
- "Send this message, with some useful printable argument, from methods or branches of methods which you believe are never reached. 2/5/96 sw"
-
- self halt: 'This is indeed called: ', msg printString! !
-
-!Object methodsFor: 'flagging' stamp: 'jm 3/18/98 17:23'!
-logEntry
-
- Transcript show: 'Entered ', thisContext sender printString; cr.
-! !
-
-!Object methodsFor: 'flagging' stamp: 'jm 3/18/98 17:23'!
-logExecution
-
- Transcript show: 'Executing ', thisContext sender printString; cr.
-! !
-
-!Object methodsFor: 'flagging' stamp: 'jm 3/18/98 17:22'!
-logExit
-
- Transcript show: 'Exited ', thisContext sender printString; cr.
-! !
-
-
-!Object methodsFor: 'graph model' stamp: 'dgd 9/18/2004 15:07'!
-addModelYellowButtonMenuItemsTo: aCustomMenu forMorph: aMorph hand: aHandMorph
- "The receiver serves as the model for aMorph; a menu is being constructed for the morph, and here the receiver is able to add its own items"
- Preferences cmdGesturesEnabled ifTrue: [ "build mode"
- aCustomMenu add: 'inspect model' translated target: self action: #inspect.
- ].
-
- ^aCustomMenu
-! !
-
-!Object methodsFor: 'graph model' stamp: 'nk 1/23/2004 14:35'!
-hasModelYellowButtonMenuItems
- ^Preferences cmdGesturesEnabled! !
-
-
-!Object methodsFor: 'inspecting' stamp: 'ar 9/27/2005 18:31'!
-basicInspect
- "Create and schedule an Inspector in which the user can examine the
- receiver's variables. This method should not be overriden."
- ^ToolSet basicInspect: self! !
-
-!Object methodsFor: 'inspecting' stamp: 'md 1/18/2006 19:09'!
-inspect
- "Create and schedule an Inspector in which the user can examine the receiver's variables."
- ToolSet inspect: self! !
-
-!Object methodsFor: 'inspecting' stamp: 'apb 7/14/2004 12:19'!
-inspectorClass
- "Answer the class of the inspector to be used on the receiver. Called by inspect;
- use basicInspect to get a normal (less useful) type of inspector."
-
- ^ Inspector! !
-
-
-!Object methodsFor: 'locales' stamp: 'tak 8/4/2005 14:55'!
-localeChanged
- self shouldBeImplemented! !
-
-
-!Object methodsFor: 'macpal' stamp: 'sw 5/7/1998 23:00'!
-codeStrippedOut: messageString
- "When a method is stripped out for external release, it is replaced by a method that calls this"
-
- self halt: 'Code stripped out -- ', messageString, '-- do not proceed.'! !
-
-!Object methodsFor: 'macpal' stamp: 'sw 1/28/1999 17:31'!
-contentsChanged
- self changed: #contents! !
-
-!Object methodsFor: 'macpal' stamp: 'ar 3/18/2001 00:03'!
-currentEvent
- "Answer the current Morphic event. This method never returns nil."
- ^ActiveEvent ifNil:[self currentHand lastEvent]! !
-
-!Object methodsFor: 'macpal' stamp: 'nk 9/1/2004 10:41'!
-currentHand
- "Return a usable HandMorph -- the one associated with the object's current environment. This method will always return a hand, even if it has to conjure one up as a last resort. If a particular hand is actually handling events at the moment (such as a remote hand or a ghost hand), it will be returned."
-
- ^ActiveHand ifNil: [ self currentWorld primaryHand ]! !
-
-!Object methodsFor: 'macpal' stamp: 'sw 5/17/2001 12:08'!
-currentVocabulary
- "Answer the currently-prevailing default vocabulary."
-
- ^ Smalltalk isMorphic ifTrue:
- [ActiveWorld currentVocabulary]
- ifFalse:
- [Vocabulary fullVocabulary]! !
-
-!Object methodsFor: 'macpal' stamp: 'ar 3/18/2001 00:08'!
-currentWorld
- "Answer a morphic world that is the current UI focus.
- If in an embedded world, it's that world.
- If in a morphic project, it's that project's world.
- If in an mvc project, it is the topmost morphic-mvc-window's worldMorph.
- If in an mvc project that has no morphic-mvc-windows, then it's just some existing worldmorph instance.
- If in an mvc project in a Squeak that has NO WorldMorph instances, one is created.
-
- This method will never return nil, it will always return its best effort at returning a relevant world morph, but if need be -- if there are no worlds anywhere, it will create a new one."
-
- | aView aSubview |
- ActiveWorld ifNotNil:[^ActiveWorld].
- World ifNotNil:[^World].
- aView _ ScheduledControllers controllerSatisfying:
- [:ctrl | (aSubview _ ctrl view firstSubView) notNil and:
- [aSubview model isMorph and: [aSubview model isWorldMorph]]].
- ^aView
- ifNotNil:
- [aSubview model]
- ifNil:
- [MVCWiWPasteUpMorph newWorldForProject: nil].! !
-
-!Object methodsFor: 'macpal' stamp: 'jm 5/6/1998 22:35'!
-flash
- "Do nothing."
-! !
-
-!Object methodsFor: 'macpal' stamp: 'sw 6/16/1998 15:07'!
-instanceVariableValues
- "Answer a collection whose elements are the values of those instance variables of the receiver which were added by the receiver's class"
- | c |
- c _ OrderedCollection new.
- self class superclass instSize + 1 to: self class instSize do:
- [:i | c add: (self instVarAt: i)].
- ^ c! !
-
-!Object methodsFor: 'macpal' stamp: 'sw 3/20/2001 13:29'!
-isUniversalTiles
- "Return true if I (my world) uses universal tiles. This message can be called in places where the current World is not known, such as when writing out a project. For more information about the project-writing subtlety addressed by this protocol, kindly contact Ted Kaehler."
-
- ^ Preferences universalTiles! !
-
-!Object methodsFor: 'macpal' stamp: 'sw 10/24/2000 07:04'!
-objectRepresented
- "most objects represent themselves; this provides a hook for aliases to grab on to"
-
- ^ self! !
-
-!Object methodsFor: 'macpal' stamp: 'sw 5/22/2001 18:31'!
-refusesToAcceptCode
- "Answer whether the receiver is a code-bearing instrument which at the moment refuses to allow its contents to be submitted"
-
- ^ false
- ! !
-
-!Object methodsFor: 'macpal' stamp: 'jm 2/24/1999 12:40'!
-scriptPerformer
-
- ^ self
-! !
-
-!Object methodsFor: 'macpal' stamp: 'sw 3/20/2001 13:40'!
-slotInfo
- "Answer a list of slot-information objects. Initally only provides useful info for players"
-
- ^ Dictionary new! !
-
-
-!Object methodsFor: 'message handling' stamp: 'md 1/20/2006 16:28'!
-executeMethod: compiledMethod
- "Execute compiledMethod against the receiver with no args"
-
- "<primitive: 189>" "uncomment once prim 189 is in VM"
- ^ self withArgs: #() executeMethod: compiledMethod! !
-
-!Object methodsFor: 'message handling' stamp: 'di 3/26/1999 07:52'!
-perform: aSymbol
- "Send the unary selector, aSymbol, to the receiver.
- Fail if the number of arguments expected by the selector is not zero.
- Primitive. Optional. See Object documentation whatIsAPrimitive."
-
- <primitive: 83>
- ^ self perform: aSymbol withArguments: (Array new: 0)! !
-
-!Object methodsFor: 'message handling' stamp: 'st 11/5/2004 16:19'!
-perform: selector orSendTo: otherTarget
- "If I wish to intercept and handle selector myself, do it; else send it to otherTarget"
- ^ (self respondsTo: selector) ifTrue: [self perform: selector] ifFalse: [otherTarget perform: selector]! !
-
-!Object methodsFor: 'message handling' stamp: 'di 3/26/1999 07:55'!
-perform: selector withArguments: argArray
- "Send the selector, aSymbol, to the receiver with arguments in argArray.
- Fail if the number of arguments expected by the selector
- does not match the size of argArray.
- Primitive. Optional. See Object documentation whatIsAPrimitive."
-
- <primitive: 84>
- ^ self perform: selector withArguments: argArray inSuperclass: self class! !
-
-!Object methodsFor: 'message handling' stamp: 'ar 4/25/2005 13:35'!
-perform: selector withArguments: argArray inSuperclass: lookupClass
- "NOTE: This is just like perform:withArguments:, except that
- the message lookup process begins, not with the receivers's class,
- but with the supplied superclass instead. It will fail if lookupClass
- cannot be found among the receiver's superclasses.
- Primitive. Essential. See Object documentation whatIsAPrimitive."
-
- <primitive: 100>
- (selector isSymbol)
- ifFalse: [^ self error: 'selector argument must be a Symbol'].
- (selector numArgs = argArray size)
- ifFalse: [^ self error: 'incorrect number of arguments'].
- (self class == lookupClass or: [self class inheritsFrom: lookupClass])
- ifFalse: [^ self error: 'lookupClass is not in my inheritance chain'].
- self primitiveFailed! !
-
-!Object methodsFor: 'message handling' stamp: 'nk 4/11/2002 14:13'!
-perform: selector withEnoughArguments: anArray
- "Send the selector, aSymbol, to the receiver with arguments in argArray.
- Only use enough arguments for the arity of the selector; supply nils for missing ones."
- | numArgs args |
- numArgs _ selector numArgs.
- anArray size == numArgs
- ifTrue: [ ^self perform: selector withArguments: anArray asArray ].
-
- args _ Array new: numArgs.
- args replaceFrom: 1
- to: (anArray size min: args size)
- with: anArray
- startingAt: 1.
-
- ^ self perform: selector withArguments: args! !
-
-!Object methodsFor: 'message handling' stamp: 'di 3/26/1999 07:52'!
-perform: aSymbol with: anObject
- "Send the selector, aSymbol, to the receiver with anObject as its argument.
- Fail if the number of arguments expected by the selector is not one.
- Primitive. Optional. See Object documentation whatIsAPrimitive."
-
- <primitive: 83>
- ^ self perform: aSymbol withArguments: (Array with: anObject)! !
-
-!Object methodsFor: 'message handling' stamp: 'di 3/26/1999 07:52'!
-perform: aSymbol with: firstObject with: secondObject
- "Send the selector, aSymbol, to the receiver with the given arguments.
- Fail if the number of arguments expected by the selector is not two.
- Primitive. Optional. See Object documentation whatIsAPrimitive."
-
- <primitive: 83>
- ^ self perform: aSymbol withArguments: (Array with: firstObject with: secondObject)! !
-
-!Object methodsFor: 'message handling' stamp: 'di 3/26/1999 07:51'!
-perform: aSymbol with: firstObject with: secondObject with: thirdObject
- "Send the selector, aSymbol, to the receiver with the given arguments.
- Fail if the number of arguments expected by the selector is not three.
- Primitive. Optional. See Object documentation whatIsAPrimitive."
-
- <primitive: 83>
- ^ self perform: aSymbol
- withArguments: (Array with: firstObject with: secondObject with: thirdObject)! !
-
-!Object methodsFor: 'message handling' stamp: 'NS 1/28/2004 11:19'!
-withArgs: argArray executeMethod: compiledMethod
- "Execute compiledMethod against the receiver and args in argArray"
-
- | selector |
- <primitive: 188>
- selector _ Symbol new.
- self class addSelectorSilently: selector withMethod: compiledMethod.
- ^ [self perform: selector withArguments: argArray]
- ensure: [self class basicRemoveSelector: selector]! !
-
-!Object methodsFor: 'message handling' stamp: 'md 1/20/2006 16:28'!
-with: arg1 executeMethod: compiledMethod
- "Execute compiledMethod against the receiver and arg1"
-
- "<primitive: 189>" "uncomment once prim 189 is in VM"
- ^ self withArgs: {arg1} executeMethod: compiledMethod! !
-
-!Object methodsFor: 'message handling' stamp: 'md 1/20/2006 16:28'!
-with: arg1 with: arg2 executeMethod: compiledMethod
- "Execute compiledMethod against the receiver and arg1 & arg2"
-
- "<primitive: 189>" "uncomment once prim 189 is in VM"
- ^ self withArgs: {arg1. arg2} executeMethod: compiledMethod! !
-
-!Object methodsFor: 'message handling' stamp: 'md 1/20/2006 16:28'!
-with: arg1 with: arg2 with: arg3 executeMethod: compiledMethod
- "Execute compiledMethod against the receiver and arg1, arg2, & arg3"
-
- "<primitive: 189>" "uncomment once prim 189 is in VM"
- ^ self withArgs: {arg1. arg2. arg3} executeMethod: compiledMethod! !
-
-!Object methodsFor: 'message handling' stamp: 'md 1/20/2006 16:28'!
-with: arg1 with: arg2 with: arg3 with: arg4 executeMethod: compiledMethod
- "Execute compiledMethod against the receiver and arg1, arg2, arg3, & arg4"
-
- "<primitive: 189>" "uncomment once prim 189 is in VM"
- ^ self withArgs: {arg1. arg2. arg3. arg4} executeMethod: compiledMethod! !
-
-
-!Object methodsFor: 'objects from disk' stamp: 'tk 4/8/1999 12:46'!
-comeFullyUpOnReload: smartRefStream
- "Normally this read-in object is exactly what we want to store. 7/26/96 tk"
-
- ^ self! !
-
-!Object methodsFor: 'objects from disk' stamp: 'RAA 12/20/2000 16:51'!
-convertToCurrentVersion: varDict refStream: smartRefStrm
-
- "subclasses should implement if they wish to convert old instances to modern ones"! !
-
-!Object methodsFor: 'objects from disk' stamp: 'tk 11/29/2004 15:04'!
-fixUponLoad: aProject seg: anImageSegment
- "change the object due to conventions that have changed on
-the project level. (sent to all objects in the incoming project).
-Specific classes should reimplement this."! !
-
-!Object methodsFor: 'objects from disk' stamp: 'RAA 1/10/2001 14:02'!
-indexIfCompact
-
- ^0 "helps avoid a #respondsTo: in publishing"! !
-
-!Object methodsFor: 'objects from disk' stamp: 'tk 2/24/1999 11:08'!
-objectForDataStream: refStrm
- "Return an object to store on an external data stream."
-
- ^ self! !
-
-!Object methodsFor: 'objects from disk' stamp: 'tk 4/8/1999 12:05'!
-readDataFrom: aDataStream size: varsOnDisk
- "Fill in the fields of self based on the contents of aDataStream. Return self.
- Read in the instance-variables written by Object>>storeDataOn:.
- NOTE: This method must send beginReference: before reading any objects from aDataStream that might reference it.
- Allow aDataStream to have fewer inst vars. See SmartRefStream."
- | cntInstVars cntIndexedVars |
-
- cntInstVars _ self class instSize.
- self class isVariable
- ifTrue: [cntIndexedVars _ varsOnDisk - cntInstVars.
- cntIndexedVars < 0 ifTrue: [
- self error: 'Class has changed too much. Define a convertxxx method']]
- ifFalse: [cntIndexedVars _ 0.
- cntInstVars _ varsOnDisk]. "OK if fewer than now"
-
- aDataStream beginReference: self.
- 1 to: cntInstVars do:
- [:i | self instVarAt: i put: aDataStream next].
- 1 to: cntIndexedVars do:
- [:i | self basicAt: i put: aDataStream next].
- "Total number read MUST be equal to varsOnDisk!!"
- ^ self "If we ever return something other than self, fix calls
- on (super readDataFrom: aDataStream size: anInteger)"! !
-
-!Object methodsFor: 'objects from disk' stamp: 'CdG 10/17/2005 20:32'!
-saveOnFile
- "Ask the user for a filename and save myself on a SmartReferenceStream file. Writes out the version and class structure. The file is fileIn-able. Does not file out the class of the object. tk 6/26/97 13:48"
-
- | aFileName fileStream |
- aFileName := self class name asFileName. "do better?"
- aFileName := UIManager default
- request: 'File name?' translated initialAnswer: aFileName.
- aFileName size == 0 ifTrue: [^ Beeper beep].
-
- fileStream := FileStream newFileNamed: aFileName asFileName.
- fileStream fileOutClass: nil andObject: self.! !
-
-!Object methodsFor: 'objects from disk' stamp: 'tk 8/9/2001 15:40'!
-storeDataOn: aDataStream
- "Store myself on a DataStream. Answer self. This is a low-level DataStream/ReferenceStream method. See also objectToStoreOnDataStream. NOTE: This method must send 'aDataStream beginInstance:size:' and then (nextPut:/nextPutWeak:) its subobjects. readDataFrom:size: reads back what we write here."
- | cntInstVars cntIndexedVars |
-
- cntInstVars _ self class instSize.
- cntIndexedVars _ self basicSize.
- aDataStream
- beginInstance: self class
- size: cntInstVars + cntIndexedVars.
- 1 to: cntInstVars do:
- [:i | aDataStream nextPut: (self instVarAt: i)].
-
- "Write fields of a variable length object. When writing to a dummy
- stream, don't bother to write the bytes"
- ((aDataStream byteStream class == DummyStream) and: [self class isBits]) ifFalse: [
- 1 to: cntIndexedVars do:
- [:i | aDataStream nextPut: (self basicAt: i)]].
-! !
-
-
-!Object methodsFor: 'parts bin' stamp: 'sw 10/24/2001 16:34'!
-descriptionForPartsBin
- "If the receiver is a member of a class that would like to be represented in a parts bin, answer the name by which it should be known, and a documentation string to be provided, for example, as balloon help. When the 'nativitySelector' is sent to the 'globalReceiver', it is expected that some kind of Morph will result. The parameters used in the implementation below are for documentation purposes only!!"
-
- ^ DescriptionForPartsBin
- formalName: 'PutFormalNameHere'
- categoryList: #(PutACategoryHere MaybePutAnotherCategoryHere)
- documentation: 'Put the balloon help here'
- globalReceiverSymbol: #PutAGlobalHere
- nativitySelector: #PutASelectorHere! !
-
-
-!Object methodsFor: 'printing' stamp: 'di 6/20/97 08:57'!
-fullPrintString
- "Answer a String whose characters are a description of the receiver."
-
- ^ String streamContents: [:s | self printOn: s]! !
-
-!Object methodsFor: 'printing'!
-isLiteral
- "Answer whether the receiver has a literal text form recognized by the
- compiler."
-
- ^false! !
-
-!Object methodsFor: 'printing' stamp: 'sma 6/1/2000 09:28'!
-longPrintOn: aStream
- "Append to the argument, aStream, the names and values of all
- of the receiver's instance variables."
-
- self class allInstVarNames doWithIndex:
- [:title :index |
- aStream nextPutAll: title;
- nextPut: $:;
- space;
- tab;
- print: (self instVarAt: index);
- cr]! !
-
-!Object methodsFor: 'printing' stamp: 'tk 10/19/2001 11:18'!
-longPrintOn: aStream limitedTo: sizeLimit indent: indent
- "Append to the argument, aStream, the names and values of all of the receiver's instance variables. Limit is the length limit for each inst var."
-
- self class allInstVarNames doWithIndex:
- [:title :index |
- indent timesRepeat: [aStream tab].
- aStream nextPutAll: title;
- nextPut: $:;
- space;
- tab;
- nextPutAll:
- ((self instVarAt: index) printStringLimitedTo: (sizeLimit -3 -title size max: 1));
- cr]! !
-
-!Object methodsFor: 'printing' stamp: 'tk 10/16/2001 19:41'!
-longPrintString
- "Answer a String whose characters are a description of the receiver."
-
- | str |
- str _ String streamContents: [:aStream | self longPrintOn: aStream].
- "Objects without inst vars should return something"
- ^ str isEmpty ifTrue: [self printString, String cr] ifFalse: [str]! !
-
-!Object methodsFor: 'printing' stamp: 'BG 11/7/2004 13:39'!
-longPrintStringLimitedTo: aLimitValue
- "Answer a String whose characters are a description of the receiver."
-
- | str |
- str _ String streamContents: [:aStream | self longPrintOn: aStream limitedTo: aLimitValue indent: 0].
- "Objects without inst vars should return something"
- ^ str isEmpty ifTrue: [self printString, String cr] ifFalse: [str]! !
-
-!Object methodsFor: 'printing' stamp: 'sw 3/7/2001 13:14'!
-nominallyUnsent: aSelectorSymbol
- "From within the body of a method which is not formally sent within the system, but which you intend to have remain in the system (for potential manual invocation, or for documentation, or perhaps because it's sent by commented-out-code that you anticipate uncommenting out someday, send this message, with the selector itself as the argument.
-
-This will serve two purposes:
-
- (1) The method will not be returned by searches for unsent selectors (because it, in a manner of speaking, sends itself).
- (2) You can locate all such methods by browsing senders of #nominallyUnsent:"
-
- false ifTrue: [self flag: #nominallyUnsent:] "So that this method itself will appear to be sent"
-! !
-
-!Object methodsFor: 'printing' stamp: 'sma 6/1/2000 09:31'!
-printOn: aStream
- "Append to the argument, aStream, a sequence of characters that
- identifies the receiver."
-
- | title |
- title _ self class name.
- aStream
- nextPutAll: (title first isVowel ifTrue: ['an '] ifFalse: ['a ']);
- nextPutAll: title! !
-
-!Object methodsFor: 'printing' stamp: 'sma 6/1/2000 09:22'!
-printString
- "Answer a String whose characters are a description of the receiver.
- If you want to print without a character limit, use fullPrintString."
-
- ^ self printStringLimitedTo: 50000! !
-
-!Object methodsFor: 'printing' stamp: 'tk 5/7/1999 16:20'!
-printStringLimitedTo: limit
- "Answer a String whose characters are a description of the receiver.
- If you want to print without a character limit, use fullPrintString."
- | limitedString |
- limitedString _ String streamContents: [:s | self printOn: s] limitedTo: limit.
- limitedString size < limit ifTrue: [^ limitedString].
- ^ limitedString , '...etc...'! !
-
-!Object methodsFor: 'printing' stamp: 'MPW 1/1/1901 00:30'!
-propertyList
- "Answer a String whose characters are a property-list description of the receiver."
-
- ^ PropertyListEncoder process:self.
-! !
-
-!Object methodsFor: 'printing' stamp: 'sw 10/17/2000 11:16'!
-reportableSize
- "Answer a string that reports the size of the receiver -- useful for showing in a list view, for example"
-
- ^ (self basicSize + self class instSize) printString! !
-
-!Object methodsFor: 'printing'!
-storeOn: aStream
- "Append to the argument aStream a sequence of characters that is an
- expression whose evaluation creates an object similar to the receiver."
-
- aStream nextPut: $(.
- self class isVariable
- ifTrue: [aStream nextPutAll: '(', self class name, ' basicNew: ';
- store: self basicSize;
- nextPutAll: ') ']
- ifFalse: [aStream nextPutAll: self class name, ' basicNew'].
- 1 to: self class instSize do:
- [:i |
- aStream nextPutAll: ' instVarAt: ';
- store: i;
- nextPutAll: ' put: ';
- store: (self instVarAt: i);
- nextPut: $;].
- 1 to: self basicSize do:
- [:i |
- aStream nextPutAll: ' basicAt: ';
- store: i;
- nextPutAll: ' put: ';
- store: (self basicAt: i);
- nextPut: $;].
- aStream nextPutAll: ' yourself)'
-! !
-
-!Object methodsFor: 'printing' stamp: 'di 6/20/97 09:12'!
-storeString
- "Answer a String representation of the receiver from which the receiver
- can be reconstructed."
-
- ^ String streamContents: [:s | self storeOn: s]! !
-
-!Object methodsFor: 'printing' stamp: 'sw 5/2/1998 13:55'!
-stringForReadout
- ^ self stringRepresentation! !
-
-!Object methodsFor: 'printing'!
-stringRepresentation
- "Answer a string that represents the receiver. For most objects this is simply its printString, but for strings themselves, it's themselves. 6/12/96 sw"
-
- ^ self printString ! !
-
-
-!Object methodsFor: 'scripting' stamp: 'ar 3/17/2001 20:11'!
-adaptedToWorld: aWorld
- "If I refer to a world or a hand, return the corresponding items in the new world."
- ^self! !
-
-!Object methodsFor: 'scripting' stamp: 'sw 3/10/2000 13:57'!
-defaultFloatPrecisionFor: aGetSelector
- "Answer a number indicating the default float precision to be used in a numeric readout for which the receiver is the model."
-
- ^ 1! !
-
-!Object methodsFor: 'scripting' stamp: 'RAA 3/9/2001 17:08'!
-evaluateUnloggedForSelf: aCodeString
-
- ^Compiler evaluate:
- aCodeString
- for: self
- logged: false! !
-
-!Object methodsFor: 'scripting' stamp: 'yo 12/25/2003 16:43'!
-methodInterfacesForCategory: aCategorySymbol inVocabulary: aVocabulary limitClass: aLimitClass
- "Return a list of methodInterfaces for the receiver in the given category, given a vocabulary. aCategorySymbol is the inherent category symbol, not necessarily the wording as expressed in the vocabulary."
-
- | categorySymbol |
- categorySymbol _ aCategorySymbol asSymbol.
-
- (categorySymbol == ScriptingSystem nameForInstanceVariablesCategory) ifTrue: [
- "user-defined instance variables"
- ^ self methodInterfacesForInstanceVariablesCategoryIn: aVocabulary].
- (categorySymbol == ScriptingSystem nameForScriptsCategory) ifTrue: [
- "user-defined scripts"
- ^ self methodInterfacesForScriptsCategoryIn: aVocabulary].
- "all others"
- ^ self usableMethodInterfacesIn: (aVocabulary methodInterfacesInCategory: categorySymbol
- forInstance: self
- ofClass: self class
- limitClass: aLimitClass)
-! !
-
-!Object methodsFor: 'scripting' stamp: 'sw 8/3/2001 13:54'!
-methodInterfacesForInstanceVariablesCategoryIn: aVocabulary
- "Return a collection of methodInterfaces for the instance-variables category. The vocabulary parameter, at present anyway, is not used. And for non-players, the method is at present vacuous in any case"
-
- ^ OrderedCollection new! !
-
-!Object methodsFor: 'scripting' stamp: 'sw 8/3/2001 13:53'!
-methodInterfacesForScriptsCategoryIn: aVocabulary
- "Answer a list of method interfaces for the category #scripts, as seen in a viewer or other tool. The vocabulary argument is not presently used. Also, at present, only Players really do anyting interesting here."
-
- ^ OrderedCollection new! !
-
-!Object methodsFor: 'scripting' stamp: 'RAA 2/16/2001 19:37'!
-selfWrittenAsIll
-
- ^self! !
-
-!Object methodsFor: 'scripting' stamp: 'RAA 2/16/2001 19:38'!
-selfWrittenAsIm
-
- ^self! !
-
-!Object methodsFor: 'scripting' stamp: 'RAA 2/16/2001 19:37'!
-selfWrittenAsMe
-
- ^self! !
-
-!Object methodsFor: 'scripting' stamp: 'RAA 2/16/2001 19:37'!
-selfWrittenAsMy
-
- ^self! !
-
-!Object methodsFor: 'scripting' stamp: 'RAA 2/16/2001 19:38'!
-selfWrittenAsThis
-
- ^self! !
-
-
-!Object methodsFor: 'scripts-kernel' stamp: 'nk 10/14/2004 10:55'!
-universalTilesForGetterOf: aMethodInterface
- "Return universal tiles for a getter on the given method interface."
-
- | ms argTile argArray itsSelector |
- itsSelector _ aMethodInterface selector.
- argArray _ #().
-
- "Four gratuituous special cases..."
-
- (itsSelector == #color:sees:) ifTrue:
- [argTile _ ScriptingSystem tileForArgType: #Color.
- argArray _ Array with: argTile colorSwatch color with: argTile colorSwatch color copy].
-
- itsSelector == #seesColor: ifTrue:
- [argTile _ ScriptingSystem tileForArgType: #Color.
- argArray _ Array with: argTile colorSwatch color].
-
- (#(touchesA: overlaps: overlapsAny:) includes: itsSelector) ifTrue:
- [argTile _ ScriptingSystem tileForArgType: #Player.
- argArray _ Array with: argTile actualObject].
-
- ms _ MessageSend receiver: self selector: itsSelector arguments: argArray.
- ^ ms asTilesIn: self class globalNames: (self class officialClass ~~ CardPlayer)
- "For CardPlayers, use 'self'. For others, name it, and use its name."! !
-
-!Object methodsFor: 'scripts-kernel' stamp: 'tk 9/28/2001 13:30'!
-universalTilesForInterface: aMethodInterface
- "Return universal tiles for the given method interface. Record who self is."
-
- | ms argTile itsSelector aType argList |
- itsSelector _ aMethodInterface selector.
- argList _ OrderedCollection new.
- aMethodInterface argumentVariables doWithIndex:
- [:anArgumentVariable :anIndex |
- argTile _ ScriptingSystem tileForArgType: (aType _ aMethodInterface typeForArgumentNumber: anIndex).
- argList add: (aType == #Player
- ifTrue: [argTile actualObject]
- ifFalse: [argTile literal]). "default value for each type"].
-
- ms _ MessageSend receiver: self selector: itsSelector arguments: argList asArray.
- ^ ms asTilesIn: self class globalNames: (self class officialClass ~~ CardPlayer)
- "For CardPlayers, use 'self'. For others, name it, and use its name."! !
-
-
-!Object methodsFor: 'self evaluating' stamp: 'sd 7/31/2005 21:47'!
-isSelfEvaluating
- ^ self isLiteral! !
-
-
-!Object methodsFor: 'system primitives'!
-asOop
- "Primitive. Answer a SmallInteger whose value is half of the receiver's
- object pointer (interpreting object pointers as 16-bit signed quantities).
- Fail if the receiver is a SmallInteger. Essential. See Object documentation
- whatIsAPrimitive."
-
- <primitive: 75>
- self primitiveFailed! !
-
-!Object methodsFor: 'system primitives' stamp: 'di 1/9/1999 15:19'!
-becomeForward: otherObject
- "Primitive. All variables in the entire system that used to point
- to the receiver now point to the argument.
- Fails if either argument is a SmallInteger."
-
- (Array with: self)
- elementsForwardIdentityTo:
- (Array with: otherObject)! !
-
-!Object methodsFor: 'system primitives' stamp: 'zz 3/3/2004 23:53'!
-becomeForward: otherObject copyHash: copyHash
- "Primitive. All variables in the entire system that used to point to the receiver now point to the argument.
- If copyHash is true, the argument's identity hash bits will be set to those of the receiver.
- Fails if either argument is a SmallInteger."
-
- (Array with: self)
- elementsForwardIdentityTo:
- (Array with: otherObject)
- copyHash: copyHash! !
-
-!Object methodsFor: 'system primitives' stamp: 'sw 10/16/2000 10:59'!
-className
- "Answer a string characterizing the receiver's class, for use in list views for example"
-
- ^ self class name asString! !
-
-!Object methodsFor: 'system primitives' stamp: 'sw 10/16/2000 11:04'!
-creationStamp
- "Answer a string which reports the creation particulars of the receiver. Intended perhaps for list views, but this is presently a feature not easily accessible"
-
- ^ '<no creation stamp>'! !
-
-!Object methodsFor: 'system primitives'!
-instVarAt: index
- "Primitive. Answer a fixed variable in an object. The numbering of the
- variables corresponds to the named instance variables. Fail if the index
- is not an Integer or is not the index of a fixed variable. Essential. See
- Object documentation whatIsAPrimitive."
-
- <primitive: 73>
- "Access beyond fixed variables."
- ^self basicAt: index - self class instSize ! !
-
-!Object methodsFor: 'system primitives'!
-instVarAt: anInteger put: anObject
- "Primitive. Store a value into a fixed variable in the receiver. The
- numbering of the variables corresponds to the named instance variables.
- Fail if the index is not an Integer or is not the index of a fixed variable.
- Answer the value stored as the result. Using this message violates the
- principle that each object has sovereign control over the storing of
- values into its instance variables. Essential. See Object documentation
- whatIsAPrimitive."
-
- <primitive: 74>
- "Access beyond fixed fields"
- ^self basicAt: anInteger - self class instSize put: anObject! !
-
-!Object methodsFor: 'system primitives' stamp: 'sw 10/16/2000 11:09'!
-instVarNamed: aString
- "Return the value of the instance variable in me with that name. Slow and unclean, but very useful. "
-
- ^ self instVarAt: (self class allInstVarNames indexOf: aString asString)
-
-
-! !
-
-!Object methodsFor: 'system primitives' stamp: 'sw 10/16/2000 11:10'!
-instVarNamed: aString put: aValue
- "Store into the value of the instance variable in me of that name. Slow and unclean, but very useful. "
-
- ^ self instVarAt: (self class allInstVarNames indexOf: aString asString) put: aValue
-! !
-
-!Object methodsFor: 'system primitives' stamp: 'sw 10/17/2000 11:12'!
-oopString
- "Answer a string that represents the oop of the receiver"
-
- ^ self asOop printString! !
-
-!Object methodsFor: 'system primitives' stamp: 'ar 3/2/2001 01:34'!
-primitiveChangeClassTo: anObject
- "Primitive. Change the class of the receiver into the class of the argument given that the format of the receiver matches the format of the argument's class. Fail if receiver or argument are SmallIntegers, or the receiver is an instance of a compact class and the argument isn't, or when the argument's class is compact and the receiver isn't, or when the format of the receiver is different from the format of the argument's class, or when the arguments class is fixed and the receiver's size differs from the size that an instance of the argument's class should have.
- Note: The primitive will fail in most cases that you think might work. This is mostly because of a) the difference between compact and non-compact classes, and b) because of differences in the format. As an example, '(Array new: 3) primitiveChangeClassTo: Morph basicNew' would fail for three of the reasons mentioned above. Array is compact, Morph is not (failure #1). Array is variable and Morph is fixed (different format - failure #2). Morph is a fixed-field-only object and the array is too short (failure #3).
- The facility is really provided for certain, very specific applications (mostly related to classes changing shape) and not for casual use."
-
- <primitive: 115>
- self primitiveFailed! !
-
-!Object methodsFor: 'system primitives' stamp: 'di 3/27/1999 12:21'!
-rootStubInImageSegment: imageSegment
-
- ^ ImageSegmentRootStub new
- xxSuperclass: nil
- format: nil
- segment: imageSegment! !
-
-!Object methodsFor: 'system primitives'!
-someObject
- "Primitive. Answer the first object in the enumeration of all
- objects."
-
- <primitive: 138>
- self primitiveFailed.! !
-
-
-!Object methodsFor: 'testing' stamp: 'sw 9/26/2001 11:58'!
-basicType
- "Answer a symbol representing the inherent type of the receiver"
-
- ^ #Object! !
-
-!Object methodsFor: 'testing' stamp: 'sw 5/3/2001 16:19'!
-beViewed
- "Open up a viewer on the receiver. The Presenter is invited to decide just how to present this viewer"
-
- self uniqueNameForReference. "So the viewer will have something nice to refer to"
- self presenter viewObject: self! !
-
-!Object methodsFor: 'testing' stamp: 'sw 10/16/2000 11:01'!
-costumes
- "Answer a list of costumes associated with the receiver. The appearance of this method in class Object serves only as a backstop, probably only transitionally"
-
- ^ nil! !
-
-!Object methodsFor: 'testing' stamp: 'sw 1/12/98 18:09'!
-haltIfNil! !
-
-!Object methodsFor: 'testing' stamp: 'md 1/20/2006 17:09'!
-hasLiteralSuchThat: testBlock
- "This is the end of the imbedded structure path so return false."
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'md 1/20/2006 17:10'!
-hasLiteralThorough: literal
- "Answer true if literal is identical to any literal in this array, even if imbedded in further structures. This is the end of the imbedded structure path so return false."
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'sw 1/30/2001 22:24'!
-haveFullProtocolBrowsed
- "Open up a Lexicon on the receiver"
-
- ^ self haveFullProtocolBrowsedShowingSelector: nil
-
- "(2@3) haveFullProtocolBrowsed"
-! !
-
-!Object methodsFor: 'testing' stamp: 'ar 9/27/2005 21:04'!
-haveFullProtocolBrowsedShowingSelector: aSelector
- "Open up a Lexicon on the receiver, having it open up showing aSelector, which may be nil"
-
- | aBrowser |
- aBrowser := (Smalltalk at: #InstanceBrowser ifAbsent:[^nil]) new useVocabulary: Vocabulary fullVocabulary.
- aBrowser openOnObject: self inWorld: ActiveWorld showingSelector: aSelector
-
- "(2@3) haveFullProtocolBrowsed"! !
-
-!Object methodsFor: 'testing' stamp: 'md 7/30/2005 21:21'!
-isArray
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'ar 7/9/1999 18:18'!
-isBehavior
- "Return true if the receiver is a behavior.
- Note: Do not override in any class except behavior."
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'ajh 1/21/2003 13:15'!
-isBlock
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'md 11/21/2003 12:14'!
-isBlockClosure
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'yo 8/28/2002 13:41'!
-isCharacter
-
- ^ false.
-! !
-
-!Object methodsFor: 'testing' stamp: 'ar 8/17/1999 19:43'!
-isCollection
- "Return true if the receiver is some sort of Collection and responds to basic collection messages such as #size and #do:"
- ^false! !
-
-!Object methodsFor: 'testing'!
-isColor
- "Answer true if receiver is a Color. False by default."
-
- ^ false
-! !
-
-!Object methodsFor: 'testing' stamp: 'nk 4/17/2004 19:43'!
-isColorForm
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'md 11/21/2003 12:14'!
-isCompiledMethod
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'mk 10/27/2003 17:33'!
-isComplex
- "Answer true if receiver is a Complex number. False by default."
-
- ^ false
-! !
-
-!Object methodsFor: 'testing' stamp: 'md 8/11/2005 16:45'!
-isDictionary
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'di 11/9/1998 09:38'!
-isFloat
- "Overridden to return true in Float, natch"
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'ar 10/30/2000 23:22'!
-isForm
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'len 1/13/98 21:18'!
-isFraction
- "Answer true if the receiver is a Fraction."
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'rhi 8/14/2003 08:51'!
-isHeap
-
- ^ false! !
-
-!Object methodsFor: 'testing'!
-isInteger
- "Overridden to return true in Integer."
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'rhi 8/12/2003 09:52'!
-isInterval
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'nk 4/25/2002 08:04'!
-isMessageSend
- ^false
-! !
-
-!Object methodsFor: 'testing' stamp: 'md 2/19/2006 11:24'!
-isMethodProperties
- ^false! !
-
-!Object methodsFor: 'testing'!
-isMorph
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'ar 9/13/2000 15:37'!
-isMorphicEvent
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'gm 2/22/2003 12:56'!
-isMorphicModel
- "Return true if the receiver is a morphic model"
- ^false
-! !
-
-!Object methodsFor: 'testing'!
-isNumber
- "Overridden to return true in Number, natch"
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'di 11/6/1998 08:04'!
-isPoint
- "Overridden to return true in Point."
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'ikp 9/26/97 14:45'!
-isPseudoContext
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'md 10/2/2005 21:52'!
-isRectangle
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'nk 6/14/2004 16:49'!
-isSketchMorph
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'ar 12/23/1999 15:43'!
-isStream
- "Return true if the receiver responds to the stream protocol"
- ^false
-! !
-
-!Object methodsFor: 'testing' stamp: 'sma 6/15/2000 15:48'!
-isString
- "Overridden to return true in String, natch"
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'md 4/30/2003 15:30'!
-isSymbol
- ^ false ! !
-
-!Object methodsFor: 'testing' stamp: 'jam 3/9/2003 15:10'!
-isSystemWindow
-"answer whatever the receiver is a SystemWindow"
- ^ false! !
-
-!Object methodsFor: 'testing'!
-isText
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'pmm 7/6/2006 20:46'!
-isTrait
- "Return true if the receiver is a trait.
- Note: Do not override in any class except TraitBehavior."
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'tk 10/21/97 12:45'!
-isTransparent
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'ar 8/14/2001 23:19'!
-isVariableBinding
- "Return true if I represent a literal variable binding"
- ^false
- ! !
-
-!Object methodsFor: 'testing' stamp: 'ls 7/14/1998 21:45'!
-isWebBrowser
- "whether this object is a web browser. See class: Scamper"
- ^false! !
-
-!Object methodsFor: 'testing' stamp: 'sw 10/27/2000 06:58'!
-knownName
- "If a formal name has been handed out for this object, answer it, else nil"
-
- ^ Preferences capitalizedReferences
- ifTrue:
- [References keyAtValue: self ifAbsent: [nil]]
- ifFalse:
- [nil]! !
-
-!Object methodsFor: 'testing' stamp: 'sw 9/27/96'!
-name
- "Answer a name for the receiver. This is used generically in the title of certain inspectors, such as the referred-to inspector, and specificially by various subsystems. By default, we let the object just print itself out.. "
-
- ^ self printString! !
-
-!Object methodsFor: 'testing' stamp: 'sw 11/19/2001 13:28'!
-nameForViewer
- "Answer a name to be shown in a Viewer that is viewing the receiver"
-
- | aName |
- (aName _ self uniqueNameForReferenceOrNil) ifNotNil: [^ aName].
- (aName _ self knownName) ifNotNil: [^ aName].
-
- ^ [(self asString copyWithout: Character cr) truncateTo: 27] ifError:
- [:msg :rcvr | ^ self class name printString]! !
-
-!Object methodsFor: 'testing'!
-notNil
- "Coerces nil to false and everything else to true."
-
- ^true! !
-
-!Object methodsFor: 'testing' stamp: 'tk 9/6/2001 19:15'!
-openInstanceBrowserWithTiles
- "Open up an instance browser on me with tiles as the code type, and with the search level as desired."
-
- | aBrowser |
- aBrowser _ InstanceBrowser new.
- aBrowser useVocabulary: Vocabulary fullVocabulary.
- aBrowser limitClass: self class.
- aBrowser contentsSymbol: #tiles. "preset it to make extra buttons (tile menus)"
- aBrowser openOnObject: self inWorld: ActiveWorld showingSelector: nil.
- aBrowser contentsSymbol: #source.
- aBrowser toggleShowingTiles.
-
- "
-(2@3) openInstanceBrowserWithTiles.
-WatchMorph new openInstanceBrowserWithTiles
-"! !
-
-!Object methodsFor: 'testing' stamp: 'tk 7/28/2005 04:50'!
-renameInternal: newName
- "Change the internal name (because of a conflict) but leave the external name unchanged. Change Player class name, but do not change the names that appear in tiles. Any object that might be pointed to in the References dictionary might get this message sent to it upon reload"
-
- ^ nil "caller will renameTo:. new name may be different"! !
-
-!Object methodsFor: 'testing' stamp: 'sw 2/27/2002 14:55'!
-renameTo: newName
- "If the receiver has an inherent idea about its own name, it should take action here. Any object that might be pointed to in the References dictionary might get this message sent to it upon reload"! !
-
-!Object methodsFor: 'testing' stamp: 'sw 1/18/2001 13:43'!
-showDiffs
- "Answer whether the receiver, serving as the model of a text-bearing entity, is 'showing differences' -- if it is, the editor may wish to show special feedback"
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'sw 10/20/1999 14:52'!
-stepAt: millisecondClockValue in: aWindow
-
- ^ self stepIn: aWindow! !
-
-!Object methodsFor: 'testing' stamp: 'sw 10/19/1999 08:16'!
-stepIn: aWindow
-
- ^ self step! !
-
-!Object methodsFor: 'testing' stamp: 'sw 10/19/1999 08:21'!
-stepTime
-
- ^ 1000 "milliseconds -- default backstop for objects serving as models of system windows"! !
-
-!Object methodsFor: 'testing' stamp: 'sw 10/19/1999 08:22'!
-stepTimeIn: aSystemWindow
-
- ^ 1000 "milliseconds -- default backstop for objects serving as models of system windows"! !
-
-!Object methodsFor: 'testing' stamp: 'sw 5/3/2001 18:22'!
-vocabularyDemanded
- "Answer a vocabulary that the receiver insists be used when it is looked at in a Viewer. This allows specific classes to insist on specific custom vocabularies"
-
- ^ nil! !
-
-!Object methodsFor: 'testing' stamp: 'sw 11/13/2001 07:26'!
-wantsDiffFeedback
- "Answer whether the receiver, serving as the model of a text-bearing entity, would like for 'diffs' green pane-border feedback to be shown"
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'di 1/8/1999 15:04'!
-wantsSteps
- "Overridden by morphic classes whose instances want to be stepped,
- or by model classes who want their morphic views to be stepped."
-
- ^ false! !
-
-!Object methodsFor: 'testing' stamp: 'sw 10/19/1999 08:26'!
-wantsStepsIn: aSystemWindow
-
- ^ self wantsSteps! !
-
-
-!Object methodsFor: 'thumbnail' stamp: 'dgd 9/25/2004 23:17'!
-iconOrThumbnailOfSize: aNumberOrPoint
- "Answer an appropiate form to represent the receiver"
- ^ nil! !
-
-
-!Object methodsFor: 'translation support'!
-inline: inlineFlag
- "For translation only; noop when running in Smalltalk."! !
-
-!Object methodsFor: 'translation support'!
-var: varSymbol declareC: declString
- "For translation only; noop when running in Smalltalk."! !
-
-
-!Object methodsFor: 'undo' stamp: 'di 9/11/2000 20:32'!
-capturedState
- "May be overridden in subclasses."
-
- ^ self shallowCopy
-! !
-
-!Object methodsFor: 'undo' stamp: 'di 9/11/2000 20:29'!
-commandHistory
- "Return the command history for the receiver"
- | w |
- (w _ self currentWorld) ifNotNil: [^ w commandHistory].
- ^ CommandHistory new. "won't really record anything but prevent breaking things"! !
-
-!Object methodsFor: 'undo' stamp: 'di 12/12/2000 15:01'!
-purgeAllCommands
- "Purge all commands for this object"
- Preferences useUndo ifFalse: [^ self]. "get out quickly"
- self commandHistory purgeAllCommandsSuchThat: [:cmd | cmd undoTarget == self].
-! !
-
-!Object methodsFor: 'undo' stamp: 'di 9/12/2000 08:15'!
-redoFromCapturedState: st
- "May be overridden in subclasses. See also capturedState"
-
- self undoFromCapturedState: st "Simple cases are symmetric"
-! !
-
-!Object methodsFor: 'undo' stamp: 'sw 11/16/2000 14:42'!
-refineRedoTarget: target selector: aSymbol arguments: arguments in: refineBlock
- "Any object can override this method to refine its redo specification"
-
- ^ refineBlock
- value: target
- value: aSymbol
- value: arguments! !
-
-!Object methodsFor: 'undo' stamp: 'sw 11/16/2000 14:42'!
-refineUndoTarget: target selector: aSymbol arguments: arguments in: refineBlock
- "Any object can override this method to refine its undo specification"
-
- ^ refineBlock
- value: target
- value: aSymbol
- value: arguments! !
-
-!Object methodsFor: 'undo' stamp: 'di 9/11/2000 20:30'!
-rememberCommand: aCommand
- "Remember the given command for undo"
- Preferences useUndo ifFalse: [^ self]. "get out quickly"
- ^ self commandHistory rememberCommand: aCommand! !
-
-!Object methodsFor: 'undo' stamp: 'di 9/11/2000 20:30'!
-rememberUndoableAction: actionBlock named: caption
- | cmd result |
- cmd _ Command new cmdWording: caption.
- cmd undoTarget: self selector: #undoFromCapturedState: argument: self capturedState.
- result _ actionBlock value.
- cmd redoTarget: self selector: #redoFromCapturedState: argument: self capturedState.
- self rememberCommand: cmd.
- ^ result! !
-
-!Object methodsFor: 'undo' stamp: 'di 9/11/2000 20:32'!
-undoFromCapturedState: st
- "May be overridden in subclasses. See also capturedState"
-
- self copyFrom: st
-! !
-
-
-!Object methodsFor: 'updating'!
-changed
- "Receiver changed in a general way; inform all the dependents by
- sending each dependent an update: message."
-
- self changed: self! !
-
-!Object methodsFor: 'updating'!
-changed: aParameter
- "Receiver changed. The change is denoted by the argument aParameter.
- Usually the argument is a Symbol that is part of the dependent's change
- protocol. Inform all of the dependents."
-
- self dependents do: [:aDependent | aDependent update: aParameter]! !
-
-!Object methodsFor: 'updating' stamp: 'nk 2/17/2004 11:12'!
-changed: anAspect with: anObject
- "Receiver changed. The change is denoted by the argument anAspect.
- Usually the argument is a Symbol that is part of the dependent's change
- protocol. Inform all of the dependents. Also pass anObject for additional information."
-
- self dependents do: [:aDependent | aDependent update: anAspect with: anObject]! !
-
-!Object methodsFor: 'updating' stamp: 'sw 10/12/1999 18:15'!
-handledListVerification
- "When a self-updating PluggableListMorph lazily checks to see the state of affairs, it first gives its model an opportunity to handle the list verification itself (this is appropriate for some models, such as VersionsBrowser); if a list's model has indeed handled things itself, it returns true here"
-
- ^ false! !
-
-!Object methodsFor: 'updating' stamp: 'sw 10/31/1999 00:15'!
-noteSelectionIndex: anInteger for: aSymbol
- "backstop"! !
-
-!Object methodsFor: 'updating'!
-okToChange
- "Allows a controller to ask this of any model"
- ^ true! !
-
-!Object methodsFor: 'updating' stamp: 'sw 10/19/1999 14:39'!
-updateListsAndCodeIn: aWindow
- self canDiscardEdits ifFalse: [^ self].
- aWindow updatablePanes do: [:aPane | aPane verifyContents]! !
-
-!Object methodsFor: 'updating' stamp: 'sma 2/29/2000 20:05'!
-update: aParameter
- "Receive a change notice from an object of whom the receiver is a
- dependent. The default behavior is to do nothing; a subclass might want
- to change itself in some way."
-
- ^ self! !
-
-!Object methodsFor: 'updating' stamp: 'nk 2/17/2004 11:13'!
-update: anAspect with: anObject
- "Receive a change notice from an object of whom the receiver is a
- dependent. The default behavior is to call update:,
- which by default does nothing; a subclass might want
- to change itself in some way."
-
- ^ self update: anAspect! !
-
-!Object methodsFor: 'updating' stamp: 'jm 8/20/1998 18:26'!
-windowIsClosing
- "This message is used to inform a models that its window is closing. Most models do nothing, but some, such as the Debugger, must do some cleanup. Note that this mechanism must be used with care by models that support multiple views, since one view may be closed while others left open."
-! !
-
-
-!Object methodsFor: 'user interface' stamp: 'sw 10/4/1999 08:13'!
-addModelItemsToWindowMenu: aMenu
- "aMenu is being constructed to be presented to the user in response to the user's pressing on the menu widget in the title bar of a morphic window. Here, the model is given the opportunity to add any model-specific items to the menu, whose default target is the SystemWindow itself."! !
-
-!Object methodsFor: 'user interface' stamp: 'sw 10/5/1998 14:39'!
-addModelMenuItemsTo: aCustomMenu forMorph: aMorph hand: aHandMorph
- "The receiver serves as the model for aMorph; a menu is being constructed for the morph, and here the receiver is able to add its own items"
-! !
-
-!Object methodsFor: 'user interface' stamp: 'sma 11/12/2000 11:43'!
-asExplorerString
- ^ self printString! !
-
-!Object methodsFor: 'user interface' stamp: 'sw 7/13/1999 15:53'!
-defaultBackgroundColor
- "Answer the color to be used as the base window color for a window whose model is an object of the receiver's class"
-
- ^ Preferences windowColorFor: self class name! !
-
-!Object methodsFor: 'user interface'!
-defaultLabelForInspector
- "Answer the default label to be used for an Inspector window on the receiver."
-
- ^ self class name! !
-
-!Object methodsFor: 'user interface' stamp: 'RAA 7/10/2000 08:11'!
-eToyStreamedRepresentationNotifying: aWidget
-
- | outData |
- [ outData _ SmartRefStream streamedRepresentationOf: self ]
- on: ProgressInitiationException
- do: [ :ex |
- ex sendNotificationsTo: [ :min :max :curr |
- aWidget ifNotNil: [aWidget flashIndicator: #working].
- ].
- ].
- ^outData
-! !
-
-!Object methodsFor: 'user interface' stamp: 'ar 9/27/2005 20:29'!
-explore
- ^ToolSet explore: self! !
-
-!Object methodsFor: 'user interface' stamp: 'sw 8/15/97 17:25'!
-fullScreenSize
- "Answer the size to which a window displaying the receiver should be set"
- | adj |
- adj _ (3 * Preferences scrollBarWidth) @ 0.
- ^ Rectangle origin: adj extent: (DisplayScreen actualScreenSize - adj)! !
-
-!Object methodsFor: 'user interface' stamp: 'RAA 6/21/1999 11:27'!
-hasContentsInExplorer
-
- ^self basicSize > 0 or: [self class allInstVarNames isEmpty not]
-! !
-
-!Object methodsFor: 'user interface' stamp: 'rbb 3/1/2005 09:28'!
-inform: aString
- "Display a message for the user to read and then dismiss. 6/9/96 sw"
-
- aString isEmptyOrNil ifFalse: [UIManager default inform: aString]! !
-
-!Object methodsFor: 'user interface'!
-initialExtent
- "Answer the desired extent for the receiver when a view on it is first opened on the screen.
- 5/22/96 sw: in the absence of any override, obtain from RealEstateAgent"
-
- ^ RealEstateAgent standardWindowExtent! !
-
-!Object methodsFor: 'user interface' stamp: 'ar 9/27/2005 20:30'!
-inspectWithLabel: aLabel
- "Create and schedule an Inspector in which the user can examine the receiver's variables."
- ^ToolSet inspect: self label: aLabel! !
-
-!Object methodsFor: 'user interface' stamp: 'sw 6/12/2001 11:09'!
-launchPartVia: aSelector
- "Obtain a morph by sending aSelector to self, and attach it to the morphic hand. This provides a general protocol for parts bins"
-
- | aMorph |
- aMorph _ self perform: aSelector.
- aMorph setProperty: #beFullyVisibleAfterDrop toValue: true.
- aMorph openInHand! !
-
-!Object methodsFor: 'user interface' stamp: 'sw 6/17/2004 01:47'!
-launchPartVia: aSelector label: aString
- "Obtain a morph by sending aSelector to self, and attach it to the morphic hand. This provides a general protocol for parts bins"
-
- | aMorph |
- aMorph _ self perform: aSelector.
- aMorph setNameTo: (ActiveWorld unusedMorphNameLike: aString).
- aMorph setProperty: #beFullyVisibleAfterDrop toValue: true.
- aMorph openInHand! !
-
-!Object methodsFor: 'user interface' stamp: 'sw 10/16/2000 11:11'!
-launchTileToRefer
- "Create a tile to reference the receiver, and attach it to the hand"
-
- self currentHand attachMorph: self tileToRefer! !
-
-!Object methodsFor: 'user interface' stamp: 'di 5/11/1999 22:26'!
-modelSleep
- "A window with me as model is being exited or collapsed or closed.
- Default response is no-op" ! !
-
-!Object methodsFor: 'user interface' stamp: 'di 5/11/1999 22:01'!
-modelWakeUp
- "A window with me as model is being entered or expanded. Default response is no-op" ! !
-
-!Object methodsFor: 'user interface' stamp: 'sw 10/16/1999 22:45'!
-modelWakeUpIn: aWindow
- "A window with me as model is being entered or expanded. Default response is no-op"
- self modelWakeUp! !
-
-!Object methodsFor: 'user interface' stamp: 'sw 3/8/1999 15:27'!
-mouseUpBalk: evt
- "A button I own got a mouseDown, but the user moved out before letting up. Certain kinds of objects (so-called 'radio buttons', for example, and other structures that must always have some selection, e.g. PaintBoxMorph) wish to take special action in this case; this default does nothing."
-! !
-
-!Object methodsFor: 'user interface' stamp: 'sw 8/22/97 13:14'!
-newTileMorphRepresentative
- ^ TileMorph new setLiteral: self! !
-
-!Object methodsFor: 'user interface' stamp: 'jcg 11/1/2001 13:13'!
-notYetImplemented
- self inform: 'Not yet implemented (', thisContext sender printString, ')'! !
-
-!Object methodsFor: 'user interface' stamp: 'di 6/10/1998 15:06'!
-windowReqNewLabel: labelString
- "My window's title has been edited.
- Return true if this is OK, and override for further behavior."
-
- ^ true! !
-
-
-!Object methodsFor: 'viewer' stamp: 'sw 10/16/2000 10:35'!
-assureUniClass
- "If the receiver is not yet an instance of a uniclass, create a uniclass for it and make the receiver become an instance of that class."
-
- | anInstance |
- self belongsToUniClass ifTrue: [^ self].
- anInstance _ self class instanceOfUniqueClass.
- self become: (self as: anInstance class).
- ^ anInstance! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 10/16/2000 10:41'!
-belongsToUniClass
- "Answer whether the receiver belongs to a uniclass. For the moment (this is not entirely satisfactory) this is precisely equated with the classname ending in a digit"
-
- ^ self class name endsWithDigit! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 12/11/2000 15:37'!
-browseOwnClassSubProtocol
- "Open up a ProtocolBrowser on the subprotocol of the receiver"
-
- ProtocolBrowser openSubProtocolForClass: self class
-! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 8/4/2001 00:51'!
-categoriesForViewer: aViewer
- "Answer a list of categories to offer in the given viewer"
-
- ^ aViewer currentVocabulary categoryListForInstance: self ofClass: self class limitClass: aViewer limitClass! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 8/3/2001 22:08'!
-categoriesForVocabulary: aVocabulary limitClass: aLimitClass
- "Answer a list of categories of methods for the receiver when using the given vocabulary, given that one considers only methods that are implemented not further away than aLimitClass"
-
- ^ aVocabulary categoryListForInstance: self ofClass: self class limitClass: aLimitClass! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 10/25/2000 07:20'!
-chooseNewNameForReference
- "Offer an opportunity for the receiver, presumed already to be known in the References registry, to be renamed"
-
- | nameSym current newName |
- current _ References keyAtValue: self ifAbsent: [^ self error: 'not found in References'].
-
- newName _ FillInTheBlank request: 'Please enter new name' initialAnswer: current.
- "Want to user some better way of determining the validity of the chosen identifier, and also want to give more precise diagnostic if the string the user types in is not acceptable. Work to be done here."
-
- newName isEmpty ifTrue: [^ nil].
- ((Scanner isLiteralSymbol: newName) and: [(newName includes: $:) not])
- ifTrue:
- [nameSym _ newName capitalized asSymbol.
- (((References includesKey: nameSym) not and:
- [(Smalltalk includesKey: nameSym) not]) and:
- [(ScriptingSystem allKnownClassVariableNames includes: nameSym) not])
- ifTrue:
- [(References associationAt: current) key: nameSym.
- References rehash.
- ^ nameSym]].
- self inform: 'Sorry, that name is not available.'.
- ^ nil! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 8/3/2001 21:22'!
-defaultLimitClassForVocabulary: aVocabulary
- "Answer the class to use, by default, as the limit class on a protocol browser or viewer opened up on the receiver, within the purview of the Vocabulary provided"
-
- ^ (aVocabulary isKindOf: FullVocabulary)
- ifTrue:
- [self class superclass == Object
- ifTrue:
- [self class]
- ifFalse:
- [self class superclass]]
- ifFalse:
- [ProtoObject]! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 2/14/2000 14:24'!
-defaultNameStemForInstances
- "Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind"
-
- ^ self class defaultNameStemForInstances! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 5/22/2001 16:53'!
-elementTypeFor: aStringOrSymbol vocabulary: aVocabulary
- "Answer a symbol characterizing what kind of element aStringOrSymbol represents. Realistically, at present, this always just returns #systemScript; a prototyped but not-incorporated architecture supported use of a leading colon to characterize an inst var of a system class, and for the moment we still see its remnant here."
-
- self flag: #deferred. "a loose end in the non-player case"
- ^ #systemScript! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 5/4/2001 07:04'!
-externalName
- "Answer an external name by which the receiver is known. Generic implementation here is a transitional backstop. probably"
-
- ^ self nameForViewer! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 5/4/2001 07:06'!
-graphicForViewerTab
- "When a Viewer is open on the receiver, its tab needs some graphic to show to the user. Answer a form or a morph to serve that purpose. A generic image is used for arbitrary objects, but note my reimplementors"
-
- ^ ScriptingSystem formAtKey: 'Image'! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 5/4/2001 07:08'!
-hasUserDefinedSlots
- "Answer whether the receiver has any user-defined slots, in the omniuser sense of the term. This is needed to allow Viewers to look at any object, not just at Players."
-
- ^ false! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 8/22/2002 14:07'!
-infoFor: anElement inViewer: aViewer
- "The user made a gesture asking for info/menu relating to me. Some of the messages dispatched here are not yet available in this image"
-
- | aMenu elementType |
- elementType _ self elementTypeFor: anElement vocabulary: aViewer currentVocabulary.
- ((elementType = #systemSlot) | (elementType == #userSlot))
- ifTrue: [^ self slotInfoButtonHitFor: anElement inViewer: aViewer].
- self flag: #deferred. "Use a traditional MenuMorph, and reinstate the pacify thing"
- aMenu _ MenuMorph new defaultTarget: aViewer.
- #( ('implementors' browseImplementorsOf:)
- ('senders' browseSendersOf:)
- ('versions' browseVersionsOf:)
- -
- ('browse full' browseMethodFull:)
- ('inheritance' browseMethodInheritance:)
- -
- ('about this method' aboutMethod:)) do:
-
- [:pair |
- pair = '-'
- ifTrue:
- [aMenu addLine]
- ifFalse:
- [aMenu add: pair first target: aViewer selector: pair second argument: anElement]].
- aMenu addLine.
- aMenu defaultTarget: self.
- #( ('destroy script' removeScript:)
- ('rename script' renameScript:)
- ('pacify script' pacifyScript:)) do:
- [:pair |
- aMenu add: pair first target: self selector: pair second argument: anElement].
-
- aMenu addLine.
- aMenu add: 'show categories....' target: aViewer selector: #showCategoriesFor: argument: anElement.
- aMenu items size == 0 ifTrue: "won't happen at the moment a/c the above"
- [aMenu add: 'ok' action: nil]. "in case it was a slot -- weird, transitional"
-
- aMenu addTitle: anElement asString, ' (', elementType, ')'.
-
- aMenu popUpInWorld: self currentWorld.
- ! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 9/26/2001 11:58'!
-initialTypeForSlotNamed: aName
- "Answer the initial type to be ascribed to the given instance variable"
-
- ^ #Object! !
-
-!Object methodsFor: 'viewer' stamp: 'ar 5/26/2001 16:13'!
-isPlayerLike
- "Return true if the receiver is a player-like object"
- ^false! !
-
-!Object methodsFor: 'viewer' stamp: 'nk 9/11/2004 16:53'!
-methodInterfacesInPresentationOrderFrom: interfaceList forCategory: aCategory
- "Answer the interface list sorted in desired presentation order, using a
- static master-ordering list, q.v. The category parameter allows an
- escape in case one wants to apply different order strategies in different
- categories, but for now a single master-priority-ordering is used -- see
- the comment in method EToyVocabulary.masterOrderingOfPhraseSymbols"
-
- | masterOrder ordered unordered index |
- masterOrder := Vocabulary eToyVocabulary masterOrderingOfPhraseSymbols.
- ordered := SortedCollection sortBlock: [:a :b | a key < b key].
- unordered := SortedCollection sortBlock: [:a :b | a wording < b wording].
-
- interfaceList do: [:interface |
- index := masterOrder indexOf: interface elementSymbol.
- index isZero
- ifTrue: [unordered add: interface]
- ifFalse: [ordered add: index -> interface]].
-
- ^ Array
- streamContents: [:stream |
- ordered do: [:assoc | stream nextPut: assoc value].
- stream nextPutAll: unordered]! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 10/24/2000 11:36'!
-newScriptorAround: aPhraseTileMorph
- "Sprout a scriptor around aPhraseTileMorph, thus making a new script. This is where generalized scriptors will be threaded in"
-
- ^ nil! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 10/25/2000 17:42'!
-offerViewerMenuForEvt: anEvent morph: aMorph
- "Offer the viewer's primary menu to the user. aMorph is some morph within the viewer itself, the one within which a mousedown triggered the need for this menu, and it is used only to retrieve the Viewer itself"
-
- self offerViewerMenuFor: (aMorph ownerThatIsA: StandardViewer) event: anEvent! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 8/11/2002 02:03'!
-offerViewerMenuFor: aViewer event: evt
- "Offer the primary Viewer menu to the user. Copied up from Player code, but most of the functions suggested here don't work for non-Player objects, many aren't even defined, some relate to exploratory sw work not yet reflected in the current corpus. We are early in the life cycle of this method..."
-
- | aMenu |
- aMenu _ MenuMorph new defaultTarget: self.
- aMenu addStayUpItem.
- aMenu title: '**CAUTION -- UNDER CONSTRUCTION!!**
-Many things may not work!!
-', self nameForViewer.
- (aViewer affordsUniclass and: [self belongsToUniClass not]) ifTrue:
- [aMenu add: 'give me a Uniclass' action: #assureUniClass.
- aMenu addLine].
- aMenu add: 'choose vocabulary...' target: aViewer action: #chooseVocabulary.
- aMenu add: 'choose limit class...' target: aViewer action: #chooseLimitClass.
- aMenu add: 'add search pane' target: aViewer action: #addSearchPane.
- aMenu balloonTextForLastItem: 'Specify which class should be the most generic one to have its methods shown in this Viewer'.
- aMenu addLine.
-
- self belongsToUniClass ifTrue:
- [aMenu add: 'add a new instance variable' target: self selector: #addInstanceVariableIn: argument: aViewer.
- aMenu add: 'add a new script' target: aViewer selector: #newPermanentScriptIn: argument: aViewer.
- aMenu addLine.
- aMenu add: 'make my class be first-class' target: self selector: #makeFirstClassClassIn: argument: aViewer.
- aMenu add: 'move my changes up to my superclass' target: self action: #promoteChangesToSuperclass.
- aMenu addLine].
-
- aMenu add: 'tear off a tile' target: self selector: #launchTileToRefer.
- aMenu addLine.
-
- aMenu add: 'inspect me' target: self selector: #inspect.
- aMenu add: 'inspect my class' target: self class action: #inspect.
- aMenu addLine.
-
- aMenu add: 'browse vocabulary' action: #haveFullProtocolBrowsed.
- aMenu add: 'inspect this Viewer' target: aViewer action: #inspect.
-
- aMenu popUpEvent: evt in: aViewer currentWorld
-
-"
- aMenu add: 'references to me' target: aViewer action: #browseReferencesToObject.
- aMenu add: 'toggle scratch pane' target: aViewer selector: #toggleScratchPane.
- aMenu add: 'make a nascent script for me' target: aViewer selector: #makeNascentScript.
- aMenu add: 'rename me' target: aViewer selector: #chooseNewNameForReference.
- aMenu add: 'browse full' action: #browseOwnClassFull.
- aMenu add: 'browse hierarchy' action: #browseOwnClassHierarchy.
- aMenu add: 'set user level...' target: aViewer action: #setUserLevel.
- aMenu add: 'browse sub-protocol' action: #browseOwnClassSubProtocol.
- aMenu addLine.
-
-"! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 1/22/2001 15:20'!
-renameScript: oldSelector
- "prompt the user for a new selector and apply it. Presently only works for players"
-
- self notYetImplemented! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 8/10/2004 11:53'!
-tilePhrasesForCategory: aCategorySymbol inViewer: aViewer
- "Return a collection of phrases for the category."
-
- | interfaces |
- interfaces _ self methodInterfacesForCategory: aCategorySymbol inVocabulary: aViewer currentVocabulary limitClass: aViewer limitClass.
- interfaces _ self methodInterfacesInPresentationOrderFrom: interfaces forCategory: aCategorySymbol.
- ^ self tilePhrasesForMethodInterfaces: interfaces inViewer: aViewer! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 8/10/2004 11:53'!
-tilePhrasesForMethodInterfaces: methodInterfaceList inViewer: aViewer
- "Return a collection of ViewerLine objects corresponding to the method-interface list provided. The resulting list will be in the same order as the incoming list, but may be smaller if the viewer's vocbulary suppresses some of the methods, or if, in classic tiles mode, the selector requires more arguments than can be handled."
-
- | toSuppress interfaces resultType itsSelector |
- toSuppress _ aViewer currentVocabulary phraseSymbolsToSuppress.
- interfaces _ methodInterfaceList reject: [:int | toSuppress includes: int selector].
- Preferences universalTiles ifFalse: "Classic tiles have their limitations..."
- [interfaces _ interfaces select:
- [:int |
- itsSelector _ int selector.
- itsSelector numArgs < 2 or:
- "The lone two-arg loophole in classic tiles"
- [#(color:sees:) includes: itsSelector]]].
-
- ^ interfaces collect:
- [:aMethodInterface |
- ((resultType _ aMethodInterface resultType) notNil and: [resultType ~~ #unknown])
- ifTrue:
- [aViewer phraseForVariableFrom: aMethodInterface]
- ifFalse:
- [aViewer phraseForCommandFrom: aMethodInterface]]! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 8/10/2004 12:23'!
-tilePhrasesForSelectorList: aList inViewer: aViewer
- "Particular to the search facility in viewers. Answer a list, in appropriate order, of ViewerLine objects to put into the viewer."
-
- | interfaces aVocab |
- aVocab _ aViewer currentVocabulary.
- interfaces _ self
- methodInterfacesInPresentationOrderFrom:
- (aList collect: [:aSel | aVocab methodInterfaceForSelector: aSel class: self class])
- forCategory: #search.
- ^ self tilePhrasesForMethodInterfaces: interfaces inViewer: aViewer! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 5/4/2001 04:51'!
-tileToRefer
- "Answer a reference tile that comprises an alias to me"
-
- ^ TileMorph new setToReferTo: self! !
-
-!Object methodsFor: 'viewer' stamp: 'sd 3/30/2005 22:04'!
-uniqueInstanceVariableNameLike: aString excluding: takenNames
- "Answer a nice instance-variable name to be added to the receiver which resembles aString, making sure it does not coincide with any element in takenNames"
-
- | okBase uniqueName usedNames |
- usedNames _ self class allInstVarNamesEverywhere.
- usedNames removeAllFoundIn: self class instVarNames.
- usedNames addAll: takenNames.
- okBase _ Scanner wellFormedInstanceVariableNameFrom: aString.
-
- uniqueName _ Utilities keyLike: okBase satisfying:
- [:aKey | (usedNames includes: aKey) not].
-
- ^ uniqueName! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 11/21/2001 15:16'!
-uniqueNameForReference
- "Answer a nice name by which the receiver can be referred to by other objects. At present this uses a global References dictionary to hold the database of references, but in due course this will need to acquire some locality"
-
- | aName nameSym stem knownClassVars |
- (aName _ self uniqueNameForReferenceOrNil) ifNotNil: [^ aName].
- (stem _ self knownName) ifNil:
- [stem _ self defaultNameStemForInstances asString].
- stem _ stem select: [:ch | ch isLetter or: [ch isDigit]].
- stem size == 0 ifTrue: [stem _ 'A'].
- stem first isLetter ifFalse:
- [stem _ 'A', stem].
- stem _ stem capitalized.
- knownClassVars _ ScriptingSystem allKnownClassVariableNames.
- aName _ Utilities keyLike: stem satisfying:
- [:jinaLake |
- nameSym _ jinaLake asSymbol.
- ((References includesKey: nameSym) not and:
- [(Smalltalk includesKey: nameSym) not]) and:
- [(knownClassVars includes: nameSym) not]].
-
- References at: (aName _ aName asSymbol) put: self.
- ^ aName! !
-
-!Object methodsFor: 'viewer' stamp: 'md 1/17/2006 17:58'!
-uniqueNameForReferenceFrom: proposedName
- "Answer a satisfactory symbol, similar to the proposedName but obeying the rules, to represent the receiver"
-
- | aName nameSym stem okay |
- proposedName = self uniqueNameForReferenceOrNil
- ifTrue: [^ proposedName]. "No change"
-
- stem _ proposedName select: [:ch | ch isLetter or: [ch isDigit]].
- stem size == 0 ifTrue: [stem _ 'A'].
- stem first isLetter ifFalse:
- [stem _ 'A', stem].
- stem _ stem capitalized.
- aName _ Utilities keyLike: stem satisfying:
- [:jinaLake |
- nameSym _ jinaLake asSymbol.
- okay _ true.
- (self class bindingOf: nameSym) ifNotNil: [okay _ false "don't use it"].
- okay].
- ^ aName asSymbol! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 3/15/2004 23:01'!
-uniqueNameForReferenceOrNil
- "If the receiver has a unique name for reference, return it here, else return nil"
-
- ^ References keyAtValue: self ifAbsent: [nil]! !
-
-!Object methodsFor: 'viewer' stamp: 'ar 5/16/2001 01:40'!
-updateThresholdForGraphicInViewerTab
- "When a Viewer is open on the receiver, its tab needs some graphic to show to the user. Computing this graphic can take quite some time so we want to make the update frequency depending on how long it takes to compute the thumbnail. The threshold returned by this method defines that the viewer will update at most every 'threshold * timeItTakesToDraw' milliseconds. Thus, if the time for computing the receiver's thumbnail is 200 msecs and the the threshold is 10, the viewer will update at most every two seconds."
- ^20 "seems to be a pretty good general choice"! !
-
-!Object methodsFor: 'viewer' stamp: 'sw 3/9/2001 13:48'!
-usableMethodInterfacesIn: aListOfMethodInterfaces
- "Filter aList, returning a subset list of apt phrases"
-
- ^ aListOfMethodInterfaces
-! !
-
-
-!Object methodsFor: 'world hacking' stamp: 'ar 3/17/2001 23:45'!
-couldOpenInMorphic
-
- "is there an obvious morphic world in which to open a new morph?"
-
- ^World notNil or: [ActiveWorld notNil]! !
-
-
-!Object methodsFor: 'private'!
-errorImproperStore
- "Create an error notification that an improper store was attempted."
-
- self error: 'Improper store into indexable object'! !
-
-!Object methodsFor: 'private'!
-errorNonIntegerIndex
- "Create an error notification that an improper object was used as an index."
-
- self error: 'only integers should be used as indices'! !
-
-!Object methodsFor: 'private' stamp: 'yo 6/29/2004 11:37'!
-errorNotIndexable
- "Create an error notification that the receiver is not indexable."
-
- self error: ('Instances of {1} are not indexable' translated format: {self class name})! !
-
-!Object methodsFor: 'private'!
-errorSubscriptBounds: index
- "Create an error notification that an improper integer was used as an index."
-
- self error: 'subscript is out of bounds: ' , index printString! !
-
-!Object methodsFor: 'private' stamp: 'ar 2/6/2004 14:47'!
-primitiveError: aString
- "This method is called when the error handling results in a recursion in
- calling on error: or halt or halt:."
-
- | context |
- (String
- streamContents:
- [:s |
- s nextPutAll: '***System error handling failed***'.
- s cr; nextPutAll: aString.
- context _ thisContext sender sender.
- 20 timesRepeat: [context == nil ifFalse: [s cr; print: (context _ context sender)]].
- s cr; nextPutAll: '-------------------------------'.
- s cr; nextPutAll: 'Type CR to enter an emergency evaluator.'.
- s cr; nextPutAll: 'Type any other character to restart.'])
- displayAt: 0 @ 0.
- [Sensor keyboardPressed] whileFalse.
- Sensor keyboard = Character cr ifTrue: [Transcripter emergencyEvaluator].
- Smalltalk isMorphic
- ifTrue: [World install "init hands and redisplay"]
- ifFalse: [ScheduledControllers searchForActiveController]! !
-
-!Object methodsFor: 'private'!
-species
- "Answer the preferred class for reconstructing the receiver. For example,
- collections create new collections whenever enumeration messages such as
- collect: or select: are invoked. The new kind of collection is determined by
- the species of the original collection. Species and class are not always the
- same. For example, the species of Interval is Array."
-
- ^self class! !
-
-!Object methodsFor: 'private'!
-storeAt: offset inTempFrame: aContext
- "This message had to get sent to an expression already on the stack
- as a Block argument being accessed by the debugger.
- Just re-route it to the temp frame."
- ^ aContext tempAt: offset put: self! !
-
-"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
-
-Object class
- instanceVariableNames: ''!
-
-!Object class methodsFor: '*Pinesoft-Widgets' stamp: 'gvc 4/17/2007 17:40'!
-taskbarIcon
- "Answer the icon for an instance of the receiver in a task bar
- or nil for the default."
-
- ^nil! !
-
-
-!Object class methodsFor: '*magritte-model-accessing' stamp: 'lr 3/27/2006 15:47'!
-description
- ^ MADescriptionBuilder for: self! !
-
-
-!Object class methodsFor: 'class initialization' stamp: 'ar 2/11/2001 02:00'!
-flushDependents
- DependentsFields keysAndValuesDo:[:key :dep|
- key ifNotNil:[key removeDependent: nil].
- ].
- DependentsFields finalizeValues.! !
-
-!Object class methodsFor: 'class initialization' stamp: 'rw 2/10/2002 13:09'!
-flushEvents
- "Object flushEvents"
-
- EventManager flushEvents. ! !
-
-!Object class methodsFor: 'class initialization' stamp: 'rww 10/2/2001 07:35'!
-initialize
- "Object initialize"
- DependentsFields ifNil:[self initializeDependentsFields].! !
-
-!Object class methodsFor: 'class initialization' stamp: 'ar 2/11/2001 01:41'!
-initializeDependentsFields
- "Object initialize"
- DependentsFields _ WeakIdentityKeyDictionary new.
-! !
-
-!Object class methodsFor: 'class initialization' stamp: 'ar 2/11/2001 01:45'!
-reInitializeDependentsFields
- "Object reInitializeDependentsFields"
- | oldFields |
- oldFields _ DependentsFields.
- DependentsFields _ WeakIdentityKeyDictionary new.
- oldFields keysAndValuesDo:[:obj :deps|
- deps do:[:d| obj addDependent: d]].
-! !
-
-
-!Object class methodsFor: 'documentation'!
-howToModifyPrimitives
- "You are allowed to write methods which specify primitives, but please use
- caution. If you make a subclass of a class which contains a primitive method,
- the subclass inherits the primitive. The message which is implemented
- primitively may be overridden in the subclass (E.g., see at:put: in String's
- subclass Symbol). The primitive behavior can be invoked using super (see
- Symbol string:).
-
- A class which attempts to mimic the behavior of another class without being
- its subclass may or may not be able to use the primitives of the original class.
- In general, if the instance variables read or written by a primitive have the
- same meanings and are in the same fields in both classes, the primitive will
- work.
-
- For certain frequently used 'special selectors', the compiler emits a
- send-special-selector bytecode instead of a send-message bytecode.
- Special selectors were created because they offer two advantages. Code
- which sends special selectors compiles into fewer bytes than normal. For
- some pairs of receiver classes and special selectors, the interpreter jumps
- directly to a primitive routine without looking up the method in the class.
- This is much faster than a normal message lookup.
-
- A selector which is a special selector solely in order to save space has a
- normal behavior. Methods whose selectors are special in order to
- gain speed contain the comment, 'No Lookup'. When the interpreter
- encounters a send-special-selector bytecode, it checks the class of the
- receiver and the selector. If the class-selector pair is a no-lookup pair,
- then the interpreter swiftly jumps to the routine which implements the
- corresponding primitive. (A special selector whose receiver is not of the
- right class to make a no-lookup pair, is looked up normally). The pairs are
- listed below. No-lookup methods contain a primitive number specification,
- <primitive: xx>, which is redundant. Since the method is not normally looked
- up, deleting the primitive number specification cannot prevent this
- primitive from running. If a no-lookup primitive fails, the method is looked
- up normally, and the expressions in it are executed.
-
- No Lookup pairs of (class, selector)
-
- SmallInteger with any of + - * / \\ bitOr: bitShift: bitAnd: //
- SmallInteger with any of = ~= > < >= <=
- Any class with ==
- Any class with @
- Point with either of x y
- ContextPart with blockCopy:
- BlockContext with either of value value:
- "
-
- self error: 'comment only'! !
-
-!Object class methodsFor: 'documentation'!
-whatIsAPrimitive
- "Some messages in the system are responded to primitively. A primitive
- response is performed directly by the interpreter rather than by evaluating
- expressions in a method. The methods for these messages indicate the
- presence of a primitive response by including <primitive: xx> before the
- first expression in the method.
-
- Primitives exist for several reasons. Certain basic or 'primitive'
- operations cannot be performed in any other way. Smalltalk without
- primitives can move values from one variable to another, but cannot add two
- SmallIntegers together. Many methods for arithmetic and comparison
- between numbers are primitives. Some primitives allow Smalltalk to
- communicate with I/O devices such as the disk, the display, and the keyboard.
- Some primitives exist only to make the system run faster; each does the same
- thing as a certain Smalltalk method, and its implementation as a primitive is
- optional.
-
- When the Smalltalk interpreter begins to execute a method which specifies a
- primitive response, it tries to perform the primitive action and to return a
- result. If the routine in the interpreter for this primitive is successful,
- it will return a value and the expressions in the method will not be evaluated.
- If the primitive routine is not successful, the primitive 'fails', and the
- Smalltalk expressions in the method are executed instead. These
- expressions are evaluated as though the primitive routine had not been
- called.
-
- The Smalltalk code that is evaluated when a primitive fails usually
- anticipates why that primitive might fail. If the primitive is optional, the
- expressions in the method do exactly what the primitive would have done (See
- Number @). If the primitive only works on certain classes of arguments, the
- Smalltalk code tries to coerce the argument or appeals to a superclass to find
- a more general way of doing the operation (see SmallInteger +). If the
- primitive is never supposed to fail, the expressions signal an error (see
- SmallInteger asFloat).
-
- Each method that specifies a primitive has a comment in it. If the primitive is
- optional, the comment will say 'Optional'. An optional primitive that is not
- implemented always fails, and the Smalltalk expressions do the work
- instead.
-
- If a primitive is not optional, the comment will say, 'Essential'. Some
- methods will have the comment, 'No Lookup'. See Object
- howToModifyPrimitives for an explanation of special selectors which are
- not looked up.
-
- For the primitives for +, -, *, and bitShift: in SmallInteger, and truncated
- in Float, the primitive constructs and returns a 16-bit
- LargePositiveInteger when the result warrants it. Returning 16-bit
- LargePositiveIntegers from these primitives instead of failing is
- optional in the same sense that the LargePositiveInteger arithmetic
- primitives are optional. The comments in the SmallInteger primitives say,
- 'Fails if result is not a SmallInteger', even though the implementor has the
- option to construct a LargePositiveInteger. For further information on
- primitives, see the 'Primitive Methods' part of the chapter on the formal
- specification of the interpreter in the Smalltalk book."
-
- self error: 'comment only'! !
-
-
-!Object class methodsFor: 'file list services' stamp: 'nk 6/12/2004 11:41'!
-fileReaderServicesForDirectory: aFileDirectory
- "Backstop"
- ^#()! !
-
-!Object class methodsFor: 'file list services' stamp: 'nk 6/12/2004 11:30'!
-fileReaderServicesForFile: fullName suffix: suffix
- "Backstop"
- ^#()! !
-
-!Object class methodsFor: 'file list services' stamp: 'md 2/15/2006 17:20'!
-services
- "Backstop"
- ^#()! !
-
-
-!Object class methodsFor: 'instance creation' stamp: 'sw 1/23/2003 09:45'!
-categoryForUniclasses
- "Answer the default system category into which to place unique-class instances"
-
- ^ 'UserObjects'! !
-
-!Object class methodsFor: 'instance creation' stamp: 'sw 7/28/97 15:56'!
-chooseUniqueClassName
- | i className |
- i _ 1.
- [className _ (self name , i printString) asSymbol.
- Smalltalk includesKey: className]
- whileTrue: [i _ i + 1].
- ^ className! !
-
-!Object class methodsFor: 'instance creation' stamp: 'tk 8/22/1998 08:22'!
-initialInstance
- "Answer the first instance of the receiver, generate an error if there is one already"
- "self instanceCount > 0 ifTrue: [self error: 'instance(s) already exist.']."
- "Debugging test that is very slow"
- ^ self new! !
-
-!Object class methodsFor: 'instance creation' stamp: 'sw 5/5/2000 09:30'!
-initializedInstance
- ^ self new! !
-
-!Object class methodsFor: 'instance creation' stamp: 'sw 10/16/2000 10:58'!
-instanceOfUniqueClass
- "Answer an instance of a unique subclass of the receiver"
-
- ^ self instanceOfUniqueClassWithInstVarString: '' andClassInstVarString: ''! !
-
-!Object class methodsFor: 'instance creation' stamp: 'tk 8/22/1998 08:27'!
-instanceOfUniqueClassWithInstVarString: instVarString andClassInstVarString: classInstVarString
- "Create a unique class for the receiver, and answer an instance of it"
-
- ^ (self newUniqueClassInstVars: instVarString
- classInstVars: classInstVarString) initialInstance! !
-
-!Object class methodsFor: 'instance creation' stamp: 'sw 10/23/1999 22:51'!
-isUniClass
- ^ false! !
-
-!Object class methodsFor: 'instance creation' stamp: 'ajh 5/23/2002 00:35'!
-newFrom: aSimilarObject
- "Create an object that has similar contents to aSimilarObject.
- If the classes have any instance varaibles with the same names, copy them across.
- If this is bad for a class, override this method."
-
- ^ (self isVariable
- ifTrue: [self basicNew: aSimilarObject basicSize]
- ifFalse: [self basicNew]
- ) copySameFrom: aSimilarObject! !
-
-!Object class methodsFor: 'instance creation' stamp: 'tk 6/29/1998 12:11'!
-newUniqueClassInstVars: instVarString classInstVars: classInstVarString
- "Create a unique class for the receiver"
-
- | aName aClass |
- self isSystemDefined ifFalse:
- [^ superclass newUniqueClassInstVars: instVarString classInstVars: classInstVarString].
- aName _ self chooseUniqueClassName.
- aClass _ self subclass: aName instanceVariableNames: instVarString
- classVariableNames: '' poolDictionaries: '' category: self categoryForUniclasses.
- classInstVarString size > 0 ifTrue:
- [aClass class instanceVariableNames: classInstVarString].
- ^ aClass! !
-
-!Object class methodsFor: 'instance creation' stamp: 'sw 7/28/97 15:56'!
-newUserInstance
- "Answer an instance of an appropriate class to serve as a user object in the containment hierarchy"
-
- ^ self instanceOfUniqueClass! !
-
-!Object class methodsFor: 'instance creation' stamp: 'nk 8/30/2004 07:57'!
-readCarefullyFrom: textStringOrStream
- "Create an object based on the contents of textStringOrStream. Return an error instead of putting up a SyntaxError window."
-
- | object |
- (Compiler couldEvaluate: textStringOrStream)
- ifFalse: [^ self error: 'expected String, Stream, or Text'].
- object _ Compiler evaluate: textStringOrStream for: nil
- notifying: #error: "signal we want errors" logged: false.
- (object isKindOf: self) ifFalse: [self error: self name, ' expected'].
- ^object! !
-
-!Object class methodsFor: 'instance creation' stamp: 'nk 8/30/2004 07:57'!
-readFrom: textStringOrStream
- "Create an object based on the contents of textStringOrStream."
-
- | object |
- (Compiler couldEvaluate: textStringOrStream)
- ifFalse: [^ self error: 'expected String, Stream, or Text'].
- object _ Compiler evaluate: textStringOrStream.
- (object isKindOf: self) ifFalse: [self error: self name, ' expected'].
- ^object! !
-
-
-!Object class methodsFor: 'objects from disk' stamp: 'tk 1/8/97'!
-createFrom: aSmartRefStream size: varsOnDisk version: instVarList
- "Create an instance of me so objects on the disk can be read in. Tricky part is computing the size if variable. Inst vars will be filled in later. "
-
- ^ self isVariable
- ifFalse: [self basicNew]
- ifTrue: ["instVarList is names of old class's inst vars plus a version number"
- self basicNew: (varsOnDisk - (instVarList size - 1))]
-! !
-
-
-!Object class methodsFor: 'window color' stamp: 'nk 6/10/2004 08:10'!
-windowColorSpecification
- "Answer a WindowColorSpec object that declares my preference.
- This is a backstop for classes that don't otherwise define a preference."
-
- ^ WindowColorSpec classSymbol: self name
- wording: 'Default' brightColor: #white
- pastelColor: #white
- helpMessage: 'Other windows without color preferences.'! !
-
-
-!Object class methodsFor: 'private' stamp: 'mir 8/22/2001 15:20'!
-releaseExternalSettings
- "Do nothing as a default"! !
-
-
-Object initialize!
diff --git a/tests/examplefiles/OrderedMap.hx b/tests/examplefiles/OrderedMap.hx
deleted file mode 100644
index 13b21f26..00000000
--- a/tests/examplefiles/OrderedMap.hx
+++ /dev/null
@@ -1,584 +0,0 @@
-package util;
-
-import util.Map;
-import util.Collection;
-import util.Set;
-import util.Option;
-import util.Debug;
-import util.Throwable;
-
-using util.StringFormat;
-
-/**
- * An ordered map of (key,value) pairs. The key ordering is defined by
- * a comparison function specified at construction. Duplicate keys
- * are not allowed.
- *
- * Worst Case Time and Space Complexities:
- * [operation] [time] [space]
- * insert O(lg(n)) O(lg(n))
- * find O(lg(n)) O(1)
- * delete O(lg(n)) O(lg(n))
- * range-query O(lg(n))* O(lg(n))
- * iteration O(n)** O(lg(n))
- * *range-query returns an iterator over elements in the range
- * **total cost of iterating over the entire map
- *
- * The map is backed by a Left-Leaning Red-Black 2-3 Tree
- * adapted from Robert Sedgewick (2008) (http://www.cs.princeton.edu/~rs/)
- *
- * Implementation choices (let size of tree be n)
- * - Parent Pointers
- * - This implementation omits parent pointers.
- * - Omitting parent pointers saves n words of persistent memory
- * at the expense of lg(n) stack space per operation.
- * - Without parent pointers, most operations in the tree must
- * either use recursion, or simulate recursion by saving a history
- * of nodes via a stack. For example, each iterator will require
- * lg(n) extra space to track progress through the tree. Insertions
- * and deletions into the tree will also invalidate any existing
- * iterators.
- * - Node Size Information
- * - This implementation omits the size of each node.
- * - Omitting size information saves n words of long-term memory at
- * the expense of not providing a find-kth operation.
- * - This seems like a reasonable trade-off as range queries are
- * generally more common than find-kth operations. The implementation
- * used below could easily be modified to provide a version with
- * size information should find-kth be of specific interest.
- * - Recursive vs. Iterative
- * - This implementation uses recursive algorithms.
- * - The recursive implementations allow the code to remain compact and
- * understandable. Since the height of LLRB 2-3 Trees is gaurenteed
- * to be at most 2lg(n), stack overflow is typically not a concern.
- * Unlike the standard single-rotation red-black algorithm, LLRB
- * operations are not tail-recursive, so even an iterative
- * version will require lg(n) extra memory.
- */
-class OrderedMap<K,V>
-{
- private var root :Null<Node<K,V>>;
- private var nodeCount :Int;
- private var comp :K -> K -> Int;
-
- public function new( keyComp :K -> K -> Int )
- {
- root = null;
- comp = keyComp;
- nodeCount = 0;
- assertInvariants();
- }
-
- /**
- * @returns Some(v) if (\key,v) is in the map, None otherwise.
- */
- public function get(key :K) :Option<V>
- {
- //normal BST search
- var n = root;
- while( n != null )
- {
- var cmp = comp(key,n.key);
- if( cmp < 0 )
- {
- n = n.left;
- }
- else if ( cmp > 0 )
- {
- n = n.right;
- }
- else
- {
- return Some(n.val);
- }
- }
- return None;
- }
-
- /**
- * Puts (\key,\val) into the map or replaces the current value of \key
- * with \val.
- *
- * @return None if \key currently is not in the map, or Some(v) if (\key,v)
- * was in the map before the put operation.
- */
- public function set(key :K, val :V) :Option<V>
- {
- var ret = new Ref<V>(null);
- root = insertNode(root,key,val,ret);
- root.color = black;
-
- assertInvariants();
-
- if( ret.r == null )
- {
- return None;
- }
- return Some(ret.r);
- }
-
- private function insertNode(n :Node<K,V>, key :K, val :V, ret :Ref<V>)
- {
- //do the insertion at the leaf level
- if( n == null )
- {
- ++nodeCount;
- return new Node<K,V>(key,val);
- }
-
- //normal BST search
- var cmp = comp(key,n.key);
- if( cmp < 0 )
- {
- n.left = insertNode(n.left,key,val,ret);
- }
- else if( cmp > 0 )
- {
- n.right = insertNode(n.right,key,val,ret);
- }
- else
- {
- //the key is already in the map, update the value
- ret.r = n.val;
- n.val = val;
- }
-
- return fixInvariants(n);
- }
-
- /**
- * Removes (\key,v) from the map if it exists.
- *
- * @return None if (\key,v) wasn't in the map, Some(v) otherwise.
- */
- public function remove(key :K) :Option<V>
- {
- var ret = new Ref<V>(null);
- if( root != null )
- {
- root = deleteNode(root,key,ret);
- if( root != null )
- {
- root.color = black;
- }
- }
-
- assertInvariants();
-
- if( ret.r == null )
- {
- return None;
- }
- return Some(ret.r);
- }
-
- private function deleteNode( n :Node<K,V>, key :K, ret :Ref<V> )
- {
- if( comp(key,n.key) < 0 )
- {
- if( isBlack(n.left) && isBlack(n.left.left) )
- {
- //ensure we move into a 3-node
- n = moveRedLeft(n);
- }
- n.left = deleteNode(n.left,key,ret);
- }
- else
- {
- if( isRed(n.left) )
- {
- //ensure we move into a 3-node
- n = rotateRight(n);
- }
- if( comp(key,n.key) == 0 && n.right == null )
- {
- //delete the node
- ret.r = n.val;
- --nodeCount;
- return null;
- }
- if( isBlack(n.right) && isBlack(n.right.left) )
- {
- //ensure we move into a 3-node
- n = moveRedRight(n);
- }
- if( comp(key,n.key) == 0 )
- {
- Debug.assert(n.right != null);
-
- ret.r = n.val;
-
- //ensure we are deleting a node with at most one child
- var min = minNode(n.right);
- n.val = min.val;
- n.key = min.key;
- n.right = deleteMinNode(n.right);
- }
- else
- {
- n.right = deleteNode(n.right,key,ret);
- }
- }
-
- return fixInvariants(n);
- }
-
- /** returns a view of the set of keys in this TreeMap **/
- public function keys() :SetView<K>
- {
- var _this = this;
-
- return {
- size: function() return _this.size(),
- iterator: function() return IterTools.mapIter(new NodeIterator(_this.root),function(x) return x.key),
- exists: function(x) {
- return switch(_this.get(x))
- {
- case None: false;
- case Some(_): true;
- };
- },
- };
- }
-
- /** returns a view of the collection of values in this TreeMap **/
- public function values() :CollectionView<V>
- {
- var _this = this;
-
- return {
- size: function() return _this.size(),
- iterator: function() return IterTools.mapIter(new NodeIterator(_this.root),function(x) return x.val),
- };
- }
-
- /** returns a view of the (key,value) pairs in this TreeMap **/
- public function entries() :CollectionView<Entry<K,V>>
- {
- var _this = this;
-
- return {
- size: function() {
- return _this.size();
- },
- iterator: function() {
- return cast new NodeIterator(_this.root);
- },
- };
- }
-
- /** returns the number of (key,value) pairs in the map **/
- public function size() :Int
- {
- return nodeCount;
- }
-
- public function toString() :String
- {
- var sb = new StringBuf();
-
- sb.add("{");
- for( entry in this.entries() )
- {
- sb.add("%y => %y, ".sprintf([entry.key,entry.val]));
- }
- sb.add("}");
-
- return sb.toString();
- }
-
- private static function isRed<K,V>( n :Node<K,V> )
- {
- if( n == null ) return false;
- return switch(n.color)
- {
- case red: true;
- case black: false;
- };
- }
-
- private static inline function isBlack<K,V>( n :Node<K,V> )
- {
- return !isRed(n);
- }
-
- private static function colorFlip<K,V>( n :Node<K,V> )
- {
- n.color = oppositeColor(n.color);
- n.left.color = oppositeColor(n.left.color);
- n.right.color = oppositeColor(n.right.color);
- }
-
- private static inline function oppositeColor( c :Color )
- {
- return switch(c)
- {
- case red: black;
- case black: red;
- };
- }
-
- private static function rotateLeft<K,V>( n :Node<K,V> )
- {
- Debug.assert(n != null);
- Debug.assert(n.right != null);
- /*
- n x
- / \ / \
- a x => n c
- / \ / \
- b c a b
- */
- var x = n.right;
- n.right = x.left;
- x.left = n;
- x.color = n.color;
- n.color = red;
- return x;
- }
-
- private static function rotateRight<K,V>( n :Node<K,V> )
- {
- Debug.assert( n != null );
- Debug.assert( n.left != null );
- /*
- n x
- / \ / \
- x c => a n
- / \ / \
- a b b c
- */
- var x = n.left;
- n.left = x.right;
- x.right = n;
- x.color = n.color;
- n.color = red;
- return x;
- }
-
- private static function moveRedLeft<K,V>( n :Node<K,V> )
- {
- //borrow extra node from right child (which is a 3-node)
- colorFlip(n);
- if( isRed(n.right.left) )
- {
- n.right = rotateRight(n.right);
- n = rotateLeft(n);
- colorFlip(n);
- }
- return n;
- }
-
- private static function moveRedRight<K,V>( n :Node<K,V> )
- {
- //borrow extra node from left child (which is a 3-node)
- colorFlip(n);
- if( isRed(n.left.left) )
- {
- n = rotateRight(n);
- colorFlip(n);
- }
- return n;
- }
-
- private static function fixInvariants<K,V>( n :Node<K,V> )
- {
- if( isRed(n.right) && isBlack(n.left) )
- {
- //ensure left-leaning property
- n = rotateLeft(n);
- }
- if( isRed(n.left) && isRed(n.left.left) )
- {
- //balance 4-node
- n = rotateRight(n);
- }
- if( isRed(n.left) && isRed(n.right) )
- {
- //split 4-node
- colorFlip(n);
- }
- return n;
- }
-
- private function deleteMinNode<K,V>( n :Node<K,V> )
- {
- if( n.left == null )
- {
- //delete
- --nodeCount;
- return null;
- }
-
- if( isBlack(n.left) && isBlack(n.left.left) )
- {
- n = moveRedLeft(n);
- }
-
- n.left = deleteMinNode(n.left);
-
- return fixInvariants(n);
- }
-
- private static function minNode<K,V>( n :Node<K,V> )
- {
- Debug.assert(n != null);
-
- while( n.left != null )
- {
- n = n.left;
- }
- return n;
- }
-
- private static function maxNode<K,V>( n :Node<K,V> )
- {
- Debug.assert(n != null);
-
- while( n.right != null )
- {
- n = n.right;
- }
- return n;
- }
-
- /** Used to verify that the invariants of the tree hold **/
- private inline function assertInvariants()
- {
- #if DEBUG
- Debug.assert( isBlack(root), "root is black: " + root );
-
- assertIsTree(root,new List<Node<K,V>>());
- assertBlackNodeCount(root);
- assertBSTOrdering(root,comp);
- #end
- }
-
- private static function assertIsTree<K,V>( n: Node<K,V>, visited :List<Node<K,V>> )
- {
- if( n == null )
- {
- return;
- }
-
- for( r in visited )
- {
- Debug.assert( n != r );
- }
- visited.push(n);
- assertIsTree(n.left,visited);
- assertIsTree(n.right,visited);
- }
-
- private static function assertBlackNodeCount<K,V>( n: Node<K,V> ) :Int
- {
- if( n == null )
- {
- return 1;
- }
-
- var leftCount = assertBlackNodeCount(n.left);
- var rightCount = assertBlackNodeCount(n.right);
-
- Debug.assert(
- leftCount == rightCount,
- "num of black nodes in all paths for left and right child not equal" + n
- );
-
- return leftCount + switch(n.color) {
- case red: 0;
- case black: 1;
- }
- }
-
- private static function assertBSTOrdering<K,V>( n: Node<K,V>, compK :K -> K -> Int ) :Void
- {
- if( n == null )
- {
- return;
- }
-
- if( n.left != null && n.left.val != null )
- {
- Debug.assert( compK(n.left.key,n.key) < 0, "left child not less than its parent" + n );
- assertBSTOrdering(n.left,compK);
- }
-
- if( n.right != null && n.right.val != null )
- {
- Debug.assert( compK(n.key,n.right.key) < 0, "parent not less than its right child" + n );
- assertBSTOrdering(n.right,compK);
- }
- }
-}
-
-private enum Color
-{
- red;
- black;
-}
-
-private class Node<K,V> /*implements Entry<K,V>*/
-{
- public var left :Null<Node<K,V>>;
- public var right :Null<Node<K,V>>;
- public var color :Color;
-
- public var key :K;
- public var val :V;
-
- public function new(k :K, v :V)
- {
- key = k;
- val = v;
- color = red;
- }
-}
-
-private class NodeIterator<K,V>
-{
- private var curr :Node<K,V>;
- private var fringe :Array<Node<K,V>>;
-
- public function new( root :Node<K,V> )
- {
- fringe = new Array<Node<K,V>>();
- traverseToMin(root);
- curr = fringe.pop();
- }
-
- public inline function hasNext() :Bool
- {
- return curr != null;
- }
-
- public function next() :Node<K,V>
- {
- if( !hasNext() )
- {
- throw new NoSuchElement();
- }
- var ret = curr;
-
- if( fringe.length > 0 )
- {
- curr = fringe.pop();
- traverseToMin(curr.right);
- }
- else
- {
- curr = null;
- }
-
- return ret;
- }
-
- private function traverseToMin( n :Node<K,V> )
- {
- while( n != null )
- {
- fringe.push(n);
- n = n.left;
- }
- }
-} \ No newline at end of file
diff --git a/tests/examplefiles/RoleQ.pm6 b/tests/examplefiles/RoleQ.pm6
deleted file mode 100644
index 9b66bde4..00000000
--- a/tests/examplefiles/RoleQ.pm6
+++ /dev/null
@@ -1,23 +0,0 @@
-role q {
- token stopper { \' }
-
- token escape:sym<\\> { <sym> <item=.backslash> }
-
- token backslash:sym<qq> { <?before 'q'> <quote=.LANG('MAIN','quote')> }
- token backslash:sym<\\> { <text=.sym> }
- token backslash:sym<stopper> { <text=.stopper> }
-
- token backslash:sym<miscq> { {} . }
-
- method tweak_q($v) { self.panic("Too late for :q") }
- method tweak_qq($v) { self.panic("Too late for :qq") }
-}
-
-role qq does b1 does c1 does s1 does a1 does h1 does f1 {
- token stopper { \" }
- token backslash:sym<unrec> { {} (\w) { self.throw_unrecog_backslash_seq: $/[0].Str } }
- token backslash:sym<misc> { \W }
-
- method tweak_q($v) { self.panic("Too late for :q") }
- method tweak_qq($v) { self.panic("Too late for :qq") }
-}
diff --git a/tests/examplefiles/SmallCheck.hs b/tests/examplefiles/SmallCheck.hs
deleted file mode 100644
index 36c39efc..00000000
--- a/tests/examplefiles/SmallCheck.hs
+++ /dev/null
@@ -1,378 +0,0 @@
----------------------------------------------------------------------
--- SmallCheck: another lightweight testing library.
--- Colin Runciman, August 2006
--- Version 0.2 (November 2006)
---
--- After QuickCheck, by Koen Claessen and John Hughes (2000-2004).
----------------------------------------------------------------------
-
-module SmallCheck (
- smallCheck, depthCheck,
- Property, Testable,
- forAll, forAllElem,
- exists, existsDeeperBy, thereExists, thereExistsElem,
- (==>),
- Series, Serial(..),
- (\/), (><), two, three, four,
- cons0, cons1, cons2, cons3, cons4,
- alts0, alts1, alts2, alts3, alts4,
- N(..), Nat, Natural,
- depth, inc, dec
- ) where
-
-import Data.List (intersperse)
-import Control.Monad (when)
-import System.IO (stdout, hFlush)
-
------------------- <Series of depth-bounded values> -----------------
-
--- Series arguments should be interpreted as a depth bound (>=0)
--- Series results should have finite length
-
-type Series a = Int -> [a]
-
--- sum
-infixr 7 \/
-(\/) :: Series a -> Series a -> Series a
-s1 \/ s2 = \d -> s1 d ++ s2 d
-
--- product
-infixr 8 ><
-(><) :: Series a -> Series b -> Series (a,b)
-s1 >< s2 = \d -> [(x,y) | x <- s1 d, y <- s2 d]
-
-------------------- <methods for type enumeration> ------------------
-
--- enumerated data values should be finite and fully defined
--- enumerated functional values should be total and strict
-
--- bounds:
--- for data values, the depth of nested constructor applications
--- for functional values, both the depth of nested case analysis
--- and the depth of results
-
-class Serial a where
- series :: Series a
- coseries :: Serial b => Series (a->b)
-
-instance Serial () where
- series _ = [()]
- coseries d = [ \() -> b
- | b <- series d ]
-
-instance Serial Int where
- series d = [(-d)..d]
- coseries d = [ \i -> if i > 0 then f (N (i - 1))
- else if i < 0 then g (N (abs i - 1))
- else z
- | z <- alts0 d, f <- alts1 d, g <- alts1 d ]
-
-instance Serial Integer where
- series d = [ toInteger (i :: Int)
- | i <- series d ]
- coseries d = [ f . (fromInteger :: Integer->Int)
- | f <- series d ]
-
-newtype N a = N a
-
-instance Show a => Show (N a) where
- show (N i) = show i
-
-instance (Integral a, Serial a) => Serial (N a) where
- series d = map N [0..d']
- where
- d' = fromInteger (toInteger d)
- coseries d = [ \(N i) -> if i > 0 then f (N (i - 1))
- else z
- | z <- alts0 d, f <- alts1 d ]
-
-type Nat = N Int
-type Natural = N Integer
-
-instance Serial Float where
- series d = [ encodeFloat sig exp
- | (sig,exp) <- series d,
- odd sig || sig==0 && exp==0 ]
- coseries d = [ f . decodeFloat
- | f <- series d ]
-
-instance Serial Double where
- series d = [ frac (x :: Float)
- | x <- series d ]
- coseries d = [ f . (frac :: Double->Float)
- | f <- series d ]
-
-frac :: (Real a, Fractional a, Real b, Fractional b) => a -> b
-frac = fromRational . toRational
-
-instance Serial Char where
- series d = take (d+1) ['a'..'z']
- coseries d = [ \c -> f (N (fromEnum c - fromEnum 'a'))
- | f <- series d ]
-
-instance (Serial a, Serial b) =>
- Serial (a,b) where
- series = series >< series
- coseries = map uncurry . coseries
-
-instance (Serial a, Serial b, Serial c) =>
- Serial (a,b,c) where
- series = \d -> [(a,b,c) | (a,(b,c)) <- series d]
- coseries = map uncurry3 . coseries
-
-instance (Serial a, Serial b, Serial c, Serial d) =>
- Serial (a,b,c,d) where
- series = \d -> [(a,b,c,d) | (a,(b,(c,d))) <- series d]
- coseries = map uncurry4 . coseries
-
-uncurry3 :: (a->b->c->d) -> ((a,b,c)->d)
-uncurry3 f (x,y,z) = f x y z
-
-uncurry4 :: (a->b->c->d->e) -> ((a,b,c,d)->e)
-uncurry4 f (w,x,y,z) = f w x y z
-
-two :: Series a -> Series (a,a)
-two s = s >< s
-
-three :: Series a -> Series (a,a,a)
-three s = \d -> [(x,y,z) | (x,(y,z)) <- (s >< s >< s) d]
-
-four :: Series a -> Series (a,a,a,a)
-four s = \d -> [(w,x,y,z) | (w,(x,(y,z))) <- (s >< s >< s >< s) d]
-
-cons0 ::
- a -> Series a
-cons0 c _ = [c]
-
-cons1 :: Serial a =>
- (a->b) -> Series b
-cons1 c d = [c z | d > 0, z <- series (d-1)]
-
-cons2 :: (Serial a, Serial b) =>
- (a->b->c) -> Series c
-cons2 c d = [c y z | d > 0, (y,z) <- series (d-1)]
-
-cons3 :: (Serial a, Serial b, Serial c) =>
- (a->b->c->d) -> Series d
-cons3 c d = [c x y z | d > 0, (x,y,z) <- series (d-1)]
-
-cons4 :: (Serial a, Serial b, Serial c, Serial d) =>
- (a->b->c->d->e) -> Series e
-cons4 c d = [c w x y z | d > 0, (w,x,y,z) <- series (d-1)]
-
-alts0 :: Serial a =>
- Series a
-alts0 d = series d
-
-alts1 :: (Serial a, Serial b) =>
- Series (a->b)
-alts1 d = if d > 0 then series (dec d)
- else [\_ -> x | x <- series d]
-
-alts2 :: (Serial a, Serial b, Serial c) =>
- Series (a->b->c)
-alts2 d = if d > 0 then series (dec d)
- else [\_ _ -> x | x <- series d]
-
-alts3 :: (Serial a, Serial b, Serial c, Serial d) =>
- Series (a->b->c->d)
-alts3 d = if d > 0 then series (dec d)
- else [\_ _ _ -> x | x <- series d]
-
-alts4 :: (Serial a, Serial b, Serial c, Serial d, Serial e) =>
- Series (a->b->c->d->e)
-alts4 d = if d > 0 then series (dec d)
- else [\_ _ _ _ -> x | x <- series d]
-
-instance Serial Bool where
- series = cons0 True \/ cons0 False
- coseries d = [ \x -> if x then b1 else b2
- | (b1,b2) <- series d ]
-
-instance Serial a => Serial (Maybe a) where
- series = cons0 Nothing \/ cons1 Just
- coseries d = [ \m -> case m of
- Nothing -> z
- Just x -> f x
- | z <- alts0 d ,
- f <- alts1 d ]
-
-instance (Serial a, Serial b) => Serial (Either a b) where
- series = cons1 Left \/ cons1 Right
- coseries d = [ \e -> case e of
- Left x -> f x
- Right y -> g y
- | f <- alts1 d ,
- g <- alts1 d ]
-
-instance Serial a => Serial [a] where
- series = cons0 [] \/ cons2 (:)
- coseries d = [ \xs -> case xs of
- [] -> y
- (x:xs') -> f x xs'
- | y <- alts0 d ,
- f <- alts2 d ]
-
--- Warning: the coseries instance here may generate duplicates.
-instance (Serial a, Serial b) => Serial (a->b) where
- series = coseries
- coseries d = [ \f -> g [f x | x <- series d]
- | g <- series d ]
-
--- For customising the depth measure. Use with care!
-
-depth :: Int -> Int -> Int
-depth d d' | d >= 0 = d'+1-d
- | otherwise = error "SmallCheck.depth: argument < 0"
-
-dec :: Int -> Int
-dec d | d > 0 = d-1
- | otherwise = error "SmallCheck.dec: argument <= 0"
-
-inc :: Int -> Int
-inc d = d+1
-
--- show the extension of a function (in part, bounded both by
--- the number and depth of arguments)
-instance (Serial a, Show a, Show b) => Show (a->b) where
- show f =
- if maxarheight == 1
- && sumarwidth + length ars * length "->;" < widthLimit then
- "{"++(
- concat $ intersperse ";" $ [a++"->"++r | (a,r) <- ars]
- )++"}"
- else
- concat $ [a++"->\n"++indent r | (a,r) <- ars]
- where
- ars = take lengthLimit [ (show x, show (f x))
- | x <- series depthLimit ]
- maxarheight = maximum [ max (height a) (height r)
- | (a,r) <- ars ]
- sumarwidth = sum [ length a + length r
- | (a,r) <- ars]
- indent = unlines . map (" "++) . lines
- height = length . lines
- (widthLimit,lengthLimit,depthLimit) = (80,20,3)::(Int,Int,Int)
-
----------------- <properties and their evaluation> ------------------
-
--- adapted from QuickCheck originals: here results come in lists,
--- properties have depth arguments, stamps (for classifying random
--- tests) are omitted, existentials are introduced
-
-newtype PR = Prop [Result]
-
-data Result = Result {ok :: Maybe Bool, arguments :: [String]}
-
-nothing :: Result
-nothing = Result {ok = Nothing, arguments = []}
-
-result :: Result -> PR
-result res = Prop [res]
-
-newtype Property = Property (Int -> PR)
-
-class Testable a where
- property :: a -> Int -> PR
-
-instance Testable Bool where
- property b _ = Prop [Result (Just b) []]
-
-instance Testable PR where
- property prop _ = prop
-
-instance (Serial a, Show a, Testable b) => Testable (a->b) where
- property f = f' where Property f' = forAll series f
-
-instance Testable Property where
- property (Property f) d = f d
-
-evaluate :: Testable a => a -> Series Result
-evaluate x d = rs where Prop rs = property x d
-
-forAll :: (Show a, Testable b) => Series a -> (a->b) -> Property
-forAll xs f = Property $ \d -> Prop $
- [ r{arguments = show x : arguments r}
- | x <- xs d, r <- evaluate (f x) d ]
-
-forAllElem :: (Show a, Testable b) => [a] -> (a->b) -> Property
-forAllElem xs = forAll (const xs)
-
-thereExists :: Testable b => Series a -> (a->b) -> Property
-thereExists xs f = Property $ \d -> Prop $
- [ Result
- ( Just $ or [ all pass (evaluate (f x) d)
- | x <- xs d ] )
- [] ]
- where
- pass (Result Nothing _) = True
- pass (Result (Just b) _) = b
-
-thereExistsElem :: Testable b => [a] -> (a->b) -> Property
-thereExistsElem xs = thereExists (const xs)
-
-exists :: (Serial a, Testable b) =>
- (a->b) -> Property
-exists = thereExists series
-
-existsDeeperBy :: (Serial a, Testable b) =>
- (Int->Int) -> (a->b) -> Property
-existsDeeperBy f = thereExists (series . f)
-
-infixr 0 ==>
-
-(==>) :: Testable a => Bool -> a -> Property
-True ==> x = Property (property x)
-False ==> x = Property (const (result nothing))
-
---------------------- <top-level test drivers> ----------------------
-
--- similar in spirit to QuickCheck but with iterative deepening
-
--- test for values of depths 0..d stopping when a property
--- fails or when it has been checked for all these values
-smallCheck :: Testable a => Int -> a -> IO String
-smallCheck d = iterCheck 0 (Just d)
-
-depthCheck :: Testable a => Int -> a -> IO String
-depthCheck d = iterCheck d (Just d)
-
-iterCheck :: Testable a => Int -> Maybe Int -> a -> IO String
-iterCheck dFrom mdTo t = iter dFrom
- where
- iter :: Int -> IO String
- iter d = do
- let Prop results = property t d
- (ok,s) <- check (mdTo==Nothing) 0 0 True results
- maybe (iter (d+1))
- (\dTo -> if ok && d < dTo
- then iter (d+1)
- else return s)
- mdTo
-
-check :: Bool -> Int -> Int -> Bool -> [Result] -> IO (Bool, String)
-check i n x ok rs | null rs = do
- let s = " Completed "++show n++" test(s)"
- y = if i then "." else " without failure."
- z | x > 0 = " But "++show x++" did not meet ==> condition."
- | otherwise = ""
- return (ok, s ++ y ++ z)
-
-check i n x ok (Result Nothing _ : rs) = do
- progressReport i n x
- check i (n+1) (x+1) ok rs
-
-check i n x f (Result (Just True) _ : rs) = do
- progressReport i n x
- check i (n+1) x f rs
-
-check i n x f (Result (Just False) args : rs) = do
- let s = " Failed test no. "++show (n+1)++". Test values follow."
- s' = s ++ ": " ++ concat (intersperse ", " args)
- if i then
- check i (n+1) x False rs
- else
- return (False, s')
-
-progressReport :: Bool -> Int -> Int -> IO ()
-progressReport _ _ _ = return ()
diff --git a/tests/examplefiles/Sorting.mod b/tests/examplefiles/Sorting.mod
deleted file mode 100644
index d6a27c1f..00000000
--- a/tests/examplefiles/Sorting.mod
+++ /dev/null
@@ -1,470 +0,0 @@
-IMPLEMENTATION MODULE Sorting;
-
-(* J. Andrea, Dec.16/91 *)
-(* This code may be freely used and distributed, it may not be sold. *)
-
-(* Adapted to ISO Module-2 by Frank Schoonjans Feb 2004 *)
-
-FROM Storage IMPORT ALLOCATE;
-
-CONST
- max_stack = 20;
- n_small = 6; (* use a simple sort for this size and smaller *)
-
-VAR
- rtemp :REAL;
- ctemp :CARDINAL;
-
- L, R, n :INTEGER;
- top, bottom, lastflip :INTEGER;
-
- tos :CARDINAL;
- Lstack, Rstack :ARRAY [1..max_stack] OF INTEGER;
-
- (* --------------------------------------------------- *)
- PROCEDURE CardQSortIndex( x :ARRAY OF CARDINAL; array_len :CARDINAL;
- VAR index :ARRAY OF CARDINAL );
-
- VAR
- median : CARDINAL;
- i,j : INTEGER;
- BEGIN
-
- n := VAL(INTEGER,array_len) - 1; (* back to zero offset *)
-
- (* initialize the index *)
- FOR i := 0 TO n DO
- index[i] := VAL(CARDINAL,i);
- END;
-
- tos := 0;
-
- L := 0; R := n;
-
- (* PUSH very first set *)
- tos := tos + 1; Lstack[tos] := L; Rstack[tos] := R;
-
- REPEAT
-
- (* POP *)
- L := Lstack[tos]; R := Rstack[tos]; tos := tos - 1;
-
- IF R - L + 1 > n_small THEN
-
- REPEAT
- i := L; j := R; median := x[index[( L + R ) DIV 2]];
-
- REPEAT
- WHILE x[index[i]] < median DO
- i := i + 1;
- END;
- WHILE median < x[index[j]] DO
- j := j - 1;
- END;
-
- IF i <= j THEN (* swap *)
- ctemp := index[i]; index[i] := index[j]; index[j] := ctemp;
- i := i + 1; j := j - 1;
- END;
- UNTIL i > j;
-
- IF j - L < R - i THEN
- IF i < R THEN (* PUSH *)
- tos := tos + 1; Lstack[tos] := i; Rstack[tos] := R;
- END;
- R := j;
- ELSE
- IF L < j THEN (* push *)
- tos := tos + 1; Lstack[tos] := L; Rstack[tos] := j;
- END;
- L := i;
- END;
-
- UNTIL L >= R;
-
- ELSE
-
- (* small sort for small number of values *)
- FOR i := L TO R - 1 DO
- FOR j := i TO R DO
- IF x[index[i]] > x[index[j]] THEN
- ctemp := index[i];
- index[i] := index[j];
- index[j] := ctemp
- END;
- END;
- END;
-
- END; (* check for small *)
-
- UNTIL tos = 0;
-
- END CardQSortIndex;
-
- (* --------------------------------------------------- *)
- PROCEDURE RealQSortIndex( x :ARRAY OF REAL; array_len :CARDINAL;
- VAR index :ARRAY OF CARDINAL );
-
- VAR
- median :REAL;
- i,j :INTEGER;
- BEGIN
-
- n := VAL(INTEGER,array_len) - 1; (* back to zero offset *)
-
- (* initialize the index *)
- FOR i := 0 TO n DO
- index[i] := VAL(CARDINAL,i);
- END;
-
- tos := 0;
-
- L := 0; R := n;
-
- (* PUSH very first set *)
- tos := tos + 1; Lstack[tos] := L; Rstack[tos] := R;
-
- REPEAT
-
- (* POP *)
- L := Lstack[tos]; R := Rstack[tos]; tos := tos - 1;
-
- IF R - L + 1 > n_small THEN
-
- REPEAT
- i := L; j := R; median := x[index[( L + R ) DIV 2]];
-
- REPEAT
- WHILE x[index[i]] < median DO
- i := i + 1;
- END;
- WHILE median < x[index[j]] DO
- j := j - 1;
- END;
-
- IF i <= j THEN (* swap *)
- ctemp := index[i]; index[i] := index[j]; index[j] := ctemp;
- i := i + 1; j := j - 1;
- END;
- UNTIL i > j;
-
- IF j - L < R - i THEN
- IF i < R THEN (* PUSH *)
- tos := tos + 1; Lstack[tos] := i; Rstack[tos] := R;
- END;
- R := j;
- ELSE
- IF L < j THEN (* push *)
- tos := tos + 1; Lstack[tos] := L; Rstack[tos] := j;
- END;
- L := i;
- END;
-
- UNTIL L >= R;
-
- ELSE
-
- (* small sort for small number of values *)
- FOR i := L TO R - 1 DO
- FOR j := i TO R DO
- IF x[index[i]] > x[index[j]] THEN
- ctemp := index[i];
- index[i] := index[j];
- index[j] := ctemp
- END;
- END;
- END;
-
- END; (* check for small *)
-
- UNTIL tos = 0;
-
- END RealQSortIndex;
-
- (* --------------------------------------------------- *)
- PROCEDURE CardQSort( VAR x :ARRAY OF CARDINAL; array_len :CARDINAL );
-
- VAR
- median : CARDINAL;
- n,i,j : INTEGER;
- BEGIN
-
- n := VAL(INTEGER,array_len) - 1; (* back to zero offset *)
-
- tos := 0;
-
- L := 0; R := n;
-
- (* PUSH very first set *)
- tos := tos + 1; Lstack[tos] := L; Rstack[tos] := R;
-
- REPEAT
-
- (* POP *)
- L := Lstack[tos]; R := Rstack[tos]; tos := tos - 1;
-
- IF R - L + 1 > n_small THEN
-
- REPEAT
- i := L; j := R; median := x[( L + R ) DIV 2];
-
- REPEAT
- WHILE x[i] < median DO
- i := i + 1;
- END;
- WHILE median < x[j] DO
- j := j - 1;
- END;
-
- IF i <= j THEN (* swap *)
- ctemp := x[i]; x[i] := x[j]; x[j] := ctemp;
- i := i + 1; j := j - 1;
- END;
- UNTIL i > j;
-
- IF j - L < R - i THEN
- IF i < R THEN (* PUSH *)
- tos := tos + 1; Lstack[tos] := i; Rstack[tos] := R;
- END;
- R := j;
- ELSE
- IF L < j THEN (* push *)
- tos := tos + 1; Lstack[tos] := L; Rstack[tos] := j;
- END;
- L := i;
- END;
-
- UNTIL L >= R;
-
- ELSE
-
- (* small sort for small number of values *)
- FOR i := L TO R - 1 DO
- FOR j := i TO R DO
- IF x[i] > x[j] THEN
- ctemp := x[i];
- x[i] := x[j];
- x[j] := ctemp
- END;
- END;
- END;
-
- END; (* check for small *)
-
- UNTIL tos = 0;
-
- END CardQSort;
-
- (* ----------------------------------------------------- *)
- PROCEDURE CardBSort( VAR x :ARRAY OF CARDINAL; array_len :CARDINAL );
- VAR i,j : INTEGER;
- BEGIN
- top := 0; (* open arrays are zero offset *)
- bottom := VAL(INTEGER,array_len) - 1;
-
- WHILE top < bottom DO
-
- lastflip := top;
-
- FOR i := top TO bottom-1 DO
- IF x[i] > x[i+1] THEN (* flip *)
- ctemp := x[i];
- x[i] := x[i+1];
- x[i+1] := ctemp;
- lastflip := i;
- END;
- END;
-
- bottom := lastflip;
-
- IF bottom > top THEN
-
- i := bottom - 1;
- FOR j := top TO bottom-1 DO
- IF x[i] > x[i+1] THEN (* flip *)
- ctemp := x[i];
- x[i] := x[i+1];
- x[i+1] := ctemp;
- lastflip := i;
- END;
- i := i - 1;
- END;
-
- top := lastflip + 1;
-
- ELSE
- (* force a loop failure *)
- top := bottom + 1;
- END;
-
- END;
-
- END CardBSort;
-
-
- (* ----------------------------------------------------- *)
- PROCEDURE RealBSort( VAR x :ARRAY OF REAL; array_len :CARDINAL );
- VAR bottom,top : INTEGER;
- i,j : INTEGER;
- BEGIN
- top := 0; (* open arrays are zero offset *)
- bottom := VAL(INTEGER,array_len) - 1;
-
- WHILE top < bottom DO
-
- lastflip := top;
-
- FOR i := top TO bottom-1 DO
- IF x[i] > x[i+1] THEN (* flip *)
- rtemp := x[i];
- x[i] := x[i+1];
- x[i+1] := rtemp;
- lastflip := i;
- END;
- END;
-
- bottom := lastflip;
-
- IF bottom > top THEN
-
- i := bottom - 1;
- FOR j := top TO bottom-1 DO
- IF x[i] > x[i+1] THEN (* flip *)
- rtemp := x[i];
- x[i] := x[i+1];
- x[i+1] := rtemp;
- lastflip := i;
- END;
- i := i - 1;
- END;
-
- top := lastflip + 1;
-
- ELSE
- (* force a loop failure *)
- top := bottom + 1;
- END;
-
- END;
-
- END RealBSort;
-
-
- (* ----------------------------------------------------- *)
- PROCEDURE TopoSort( x, y :ARRAY OF CARDINAL; n_pairs :CARDINAL;
- VAR solution :ARRAY OF CARDINAL; VAR n_solution :CARDINAL;
- VAR error, sorted :BOOLEAN );
- (*
- This procedure needs some garbage collection added, i've tried but
- will little success. J. Andrea, Dec.18/91
- *)
-
- TYPE
- LPtr = POINTER TO Leader;
- TPtr = POINTER TO Trailer;
-
- Leader = RECORD
- key :CARDINAL;
- count :INTEGER;
- trail :TPtr;
- next :LPtr;
- END;
-
- Trailer = RECORD
- id :LPtr;
- next :TPtr;
- END;
-
- VAR
- p, q, head, tail :LPtr;
- t :TPtr;
- i, max_solutions :CARDINAL;
-
- (* -------------------------------------------- *)
- PROCEDURE Find( w :CARDINAL ) :LPtr;
- VAR h :LPtr;
- BEGIN
- h := head; tail^.key := w; (* sentinel *)
- WHILE h^.key # w DO
- h := h^.next;
- END;
- IF h = tail THEN
- NEW( tail );
- n := n + 1;
- h^.count := 0;
- h^.trail := NIL;
- h^.next := tail;
- END;
- RETURN h;
- END Find;
-
- BEGIN
-
- error := FALSE;
- n_solution := 0;
-
- IF n_pairs < 2 THEN
- error := TRUE;
- ELSE
-
- max_solutions := HIGH( solution ) + 1;
-
- NEW( head ); tail := head; n := 0;
-
- (* add all of the given pairs *)
-
- FOR i := 0 TO n_pairs - 1 DO
- p := Find( x[i] ); q := Find( y[i] );
- NEW(t);
- t^.id := q;
- t^.next := p^.trail;
- p^.trail := t;
- q^.count := q^.count + 1;
- END;
-
- (* search for leaders without predecessors *)
-
- p := head; head := NIL;
- WHILE p # tail DO
- q := p; p := q^.next;
- IF q^.count = 0 THEN
- (* insert q^ in new chain *)
- q^.next := head; head := q;
- END;
- END;
-
- (* output phase *)
-
- q := head;
- WHILE ( NOT error ) & ( q # NIL ) DO
- n_solution := n_solution + 1;
- IF n_solution > max_solutions THEN
- error := TRUE;
- ELSE
-
- solution[n_solution-1] := q^.key;
- n := n - 1;
- t := q^.trail; q := q^.next;
- WHILE t # NIL DO
- p := t^.id; p^.count := p^.count - 1;
- IF p^.count = 0 THEN
- (* insert p^ in leader list *)
- p^.next := q; q := p;
- END;
- t := t^.next;
- END;
- END;
- END;
-
- IF n # 0 THEN
- sorted := FALSE;
- ELSE
- sorted := TRUE;
- END;
-
- END;
-
- END TopoSort;
-
-BEGIN
-END Sorting.
diff --git a/tests/examplefiles/StdGeneric.icl b/tests/examplefiles/StdGeneric.icl
deleted file mode 100644
index 891b510a..00000000
--- a/tests/examplefiles/StdGeneric.icl
+++ /dev/null
@@ -1,134 +0,0 @@
-implementation module StdGeneric
-
-/**
- * NOTE: this is a collection of different tricky parts of Clean modules (even
- * though the file is simply called StdGeneric.icl). The code is taken from:
- *
- * - StdGeneric (StdEnv)
- * - Graphics.Scalable.Image (Platform)
- */
-
-import StdInt, StdMisc, StdClass, StdFunc
-
-generic bimap a b :: Bimap .a .b
-
-bimapId :: Bimap .a .a
-bimapId = { map_to = id, map_from = id }
-
-bimap{|c|} = { map_to = id, map_from = id }
-
-bimap{|PAIR|} bx by = { map_to= map_to, map_from=map_from }
-where
- map_to (PAIR x y) = PAIR (bx.map_to x) (by.map_to y)
- map_from (PAIR x y) = PAIR (bx.map_from x) (by.map_from y)
-bimap{|EITHER|} bl br = { map_to= map_to, map_from=map_from }
-where
- map_to (LEFT x) = LEFT (bl.map_to x)
- map_to (RIGHT x) = RIGHT (br.map_to x)
- map_from (LEFT x) = LEFT (bl.map_from x)
- map_from (RIGHT x) = RIGHT (br.map_from x)
-
-bimap{|(->)|} barg bres = { map_to = map_to, map_from = map_from }
-where
- map_to f = comp3 bres.map_to f barg.map_from
- map_from f = comp3 bres.map_from f barg.map_to
-
-bimap{|CONS|} barg = { map_to= map_to, map_from=map_from }
-where
- map_to (CONS x) = CONS (barg.map_to x)
- map_from (CONS x) = CONS (barg.map_from x)
-
-bimap{|FIELD|} barg = { map_to= map_to, map_from=map_from }
-where
- map_to (FIELD x) = FIELD (barg.map_to x)
- map_from (FIELD x) = FIELD (barg.map_from x)
-
-bimap{|OBJECT|} barg = { map_to= map_to, map_from=map_from }
-where
- map_to (OBJECT x) = OBJECT (barg.map_to x)
- map_from (OBJECT x) = OBJECT (barg.map_from x)
-
-bimap{|Bimap|} x y = {map_to = map_to, map_from = map_from}
-where
- map_to {map_to, map_from} =
- { map_to = comp3 y.map_to map_to x.map_from
- , map_from = comp3 x.map_to map_from y.map_from
- }
- map_from {map_to, map_from} =
- { map_to = comp3 y.map_from map_to x.map_to
- , map_from = comp3 x.map_from map_from y.map_to
- }
-
-comp3 :: !(.a -> .b) u:(.c -> .a) !(.d -> .c) -> u:(.d -> .b)
-comp3 f g h
- | is_id f
- | is_id h
- = cast g
- = cast (\x -> g (h x))
- | is_id h
- = cast (\x -> f (g x))
- = \x -> f (g (h x))
-where
- is_id :: !.(.a -> .b) -> Bool
- is_id f = code inline
- {
- eq_desc e_StdFunc_did 0 0
- pop_a 1
- }
-
- cast :: !u:a -> u:b
- cast f = code inline
- {
- pop_a 0
- }
-
-getConsPath :: !GenericConsDescriptor -> [ConsPos]
-getConsPath {gcd_index, gcd_type_def={gtd_num_conses}}
- = doit gcd_index gtd_num_conses
-where
- doit i n
- | n == 0
- = abort "getConsPath: zero conses\n"
- | i >= n
- = abort "getConsPath: cons index >= number of conses"
- | n == 1
- = []
- | i < (n/2)
- = [ ConsLeft : doit i (n/2) ]
- | otherwise
- = [ ConsRight : doit (i - (n/2)) (n - (n/2)) ]
-
-:: NoAttr m = NoAttr
-:: DashAttr m = { dash :: ![Int] }
-:: FillAttr m = { fill :: !SVGColor }
-:: LineEndMarker m = { endmarker :: !Image m }
-:: LineMidMarker m = { midmarker :: !Image m }
-:: LineStartMarker m = { startmarker :: !Image m }
-:: MaskAttr m = { mask :: !Image m }
-:: OpacityAttr m = { opacity :: !Real }
-:: StrokeAttr m = { stroke :: !SVGColor }
-:: StrokeWidthAttr m = { strokewidth :: !Span }
-:: XRadiusAttr m = { xradius :: !Span }
-:: YRadiusAttr m = { yradius :: !Span }
-
-
-instance tuneImage NoAttr where tuneImage image _ = image
-instance tuneImage DashAttr where tuneImage image attr = Attr` (BasicImageAttr` (BasicImgDashAttr attr.DashAttr.dash)) image
-instance tuneImage FillAttr where tuneImage image attr = Attr` (BasicImageAttr` (BasicImgFillAttr attr.FillAttr.fill)) image
-instance tuneImage LineEndMarker where tuneImage image attr = Attr` (LineMarkerAttr` {LineMarkerAttr | markerImg = attr.LineEndMarker.endmarker, markerPos = LineMarkerEnd}) image
-instance tuneImage LineMidMarker where tuneImage image attr = Attr` (LineMarkerAttr` {LineMarkerAttr | markerImg = attr.LineMidMarker.midmarker, markerPos = LineMarkerMid}) image
-instance tuneImage LineStartMarker where tuneImage image attr = Attr` (LineMarkerAttr` {LineMarkerAttr | markerImg = attr.LineStartMarker.startmarker, markerPos = LineMarkerStart}) image
-instance tuneImage MaskAttr where tuneImage image attr = Attr` (MaskAttr` attr.MaskAttr.mask) image
-instance tuneImage OpacityAttr where tuneImage image attr = Attr` (BasicImageAttr` (BasicImgFillOpacityAttr attr.OpacityAttr.opacity)) image
-instance tuneImage StrokeAttr where tuneImage image attr = Attr` (BasicImageAttr` (BasicImgStrokeAttr attr.StrokeAttr.stroke)) image
-instance tuneImage StrokeWidthAttr where tuneImage image attr = Attr` (BasicImageAttr` (BasicImgStrokeWidthAttr attr.StrokeWidthAttr.strokewidth)) image
-instance tuneImage XRadiusAttr where tuneImage image attr = Attr` (BasicImageAttr` (BasicImgXRadiusAttr attr.XRadiusAttr.xradius)) image
-instance tuneImage YRadiusAttr where tuneImage image attr = Attr` (BasicImageAttr` (BasicImgYRadiusAttr attr.YRadiusAttr.yradius)) image
-
-instance tuneImage DraggableAttr where tuneImage image attr = Attr` (HandlerAttr` (ImgEventhandlerDraggableAttr attr)) image
-instance tuneImage OnClickAttr where tuneImage image attr = Attr` (HandlerAttr` (ImgEventhandlerOnClickAttr attr)) image
-instance tuneImage OnMouseDownAttr where tuneImage image attr = Attr` (HandlerAttr` (ImgEventhandlerOnMouseDownAttr attr)) image
-instance tuneImage OnMouseMoveAttr where tuneImage image attr = Attr` (HandlerAttr` (ImgEventhandlerOnMouseMoveAttr attr)) image
-instance tuneImage OnMouseOutAttr where tuneImage image attr = Attr` (HandlerAttr` (ImgEventhandlerOnMouseOutAttr attr)) image
-instance tuneImage OnMouseOverAttr where tuneImage image attr = Attr` (HandlerAttr` (ImgEventhandlerOnMouseOverAttr attr)) image
-instance tuneImage OnMouseUpAttr where tuneImage image attr = Attr` (HandlerAttr` (ImgEventhandlerOnMouseUpAttr attr)) image
diff --git a/tests/examplefiles/Sudoku.lhs b/tests/examplefiles/Sudoku.lhs
deleted file mode 100644
index 6829cf6c..00000000
--- a/tests/examplefiles/Sudoku.lhs
+++ /dev/null
@@ -1,382 +0,0 @@
-% Copyright 2005 Brian Alliet
-
-\documentclass[11pt]{article}
-\usepackage{palatino}
-\usepackage{fullpage}
-\usepackage{parskip}
-\usepackage{lhs}
-
-\begin{document}
-
-\title{Sudoku Solver}
-\author{Brian Alliet}
-\maketitle
-
-\ignore{
-\begin{code}
-module Sudoku (
- Sudoku,
- makeSudoku, solve, eliminate, analyze, backtrack,
- main
- ) where
-
-import Array
-import Monad
-import List (union,intersperse,transpose,(\\),nub,nubBy)
-\end{code}
-}
-
-\section{Introduction}
-
-This Haskell module implements a solver for Sudoku~\footnote{http://en.wikipedia.org/wiki/Sudoku} puzzles. It can solve
-any Sudoku puzzle, even those that require backtracking.
-
-\section{Data Types}
-
-\begin{code}
-data CellState a = Known a | Unknown [a] | Impossible deriving Eq
-\end{code}
-
-Each cell in a Sudoku grid can be in one of three states: ``Known'' if it has a known correct value~\footnote{Actually
-this doesn't always means it is correct. While we are in the backtracking stage we make our guesses ``Known''.},
-``Unknown'' if there is still more than one possible correct value, or ``Impossible'' if there is no value that can
-possibly fit the cell. Sudoku grids with ``Impossible'' cells are quickly discarded by the {\tt solve} function.
-
-\begin{code}
-type Coords = (Int,Int)
-type Grid a = Array Coords (CellState a)
-newtype Sudoku a = Sudoku { unSudoku :: Grid a } deriving Eq
-\end{code}
-
-We represent a Sudoku grid as an Array indexed by integer coordinates. We additionally define a newtype wrapper for the
-grid. The smart constructor, {\tt makeSudoku} verifies some invariants before creating the Sudoku value. All the public
-API functions operate on the Sudoku type.
-
-\begin{code}
-instance Show a => Show (Sudoku a) where showsPrec p = showParen (p>0) . showsGrid . unSudoku
-instance Show a => Show (CellState a) where showsPrec _ = showsCell
-\end{code}
-
-We define {\tt Show} instances for the above types.
-
-\section{Internal Functions}
-
-\begin{code}
-size :: Grid a -> Int
-size = (+1).fst.snd.bounds
-\end{code}
-
-{\tt size} returns the size (the width, height, and number of subboxes) for a Sudoku grid. We ensure Grid's are always
-square and indexed starting at $(0,0)$ so simply incrementing either of the array's upper bounds is correct.
-
-\begin{code}
-getRow,getCol,getBox :: Grid a -> Int -> [(Coords,CellState a)]
-getRow grid r = [let l = (r,c) in (l,grid!l)|c <- [0..size grid - 1]]
-getCol grid c = [let l = (r,c) in (l,grid!l)|r <- [0..size grid - 1]]
-getBox grid b = [let l = (r,c) in (l,grid!l)|r <- [boxR..boxR+boxN-1],c <- [boxC..boxC+boxN-1]]
- where
- boxN = intSqrt (size grid); boxR = b `quot` boxN * boxN; boxC = b `rem` boxN * boxN
-
-getBoxOf :: Grid a -> Coords -> [(Coords,CellState a)]
-getBoxOf grid (r,c) = grid `getBox` ((r `quot` boxN * boxN) + (c `quot` boxN))
- where boxN = intSqrt (size grid)
-\end{code}
-
-{\tt getRow}, {\tt getCol}, and {\tt getBox} return the coordinates and values of the cell in row, column, or box
-number {\tt n}, {\tt r}, or {\tt b}.
-
-\begin{code}
-getNeighbors :: Eq a => Grid a -> Coords -> [(Coords,CellState a)]
-getNeighbors grid l@(r,c) = filter ((/=l).fst)
- $ foldr (union.($grid)) []
- [(`getRow`r),(`getCol`c),(`getBoxOf`l)]
-\end{code}
-
-{\tt getNeighbors} returns the coordinates and values of all the neighbors of this cell.
-
-\begin{code}
-impossible :: Eq a => Grid a -> Coords -> [a]
-impossible grid l = map snd $ justKnowns $ grid `getNeighbors` l
-\end{code}
-
-{\tt impossible} returns a list of impossible values for a given cell. The impossible values consist of the values any
-``Known'' neighbors.
-
-\begin{code}
-justUnknowns :: [(Coords,CellState a)] -> [(Coords,[a])]
-justUnknowns = foldr (\c -> case c of (p,Unknown xs) -> ((p,xs):); _ -> id) []
-
-justKnowns :: [(Coords,CellState a)] -> [(Coords,a)]
-justKnowns = foldr (\c -> case c of (p,Known x) -> ((p,x):); _ -> id) []
-\end{code}
-
-{\tt justUnknowns} and {\tt justKnowns} return only the Known or Unknown values (with the constructor stripped off)
-from a list of cells.
-
-\begin{code}
-updateGrid :: Grid a -> [(Coords,CellState a)] -> Maybe (Grid a)
-updateGrid _ [] = Nothing
-updateGrid grid xs = Just $ grid // nubBy (\(x,_) (y,_) -> x==y) xs
-\end{code}
-
-{\tt updateGrid} applies a set of updates to a grid and returns the new grid only if it was updated.
-
-\section{Public API}
-
-\begin{code}
-makeSudoku :: (Num a, Ord a, Enum a) => [[a]] -> Sudoku a
-makeSudoku xs
- | not (all ((==size).length) xs) = error "error not a square"
- | (intSqrt size)^(2::Int) /= size = error "error dims aren't perfect squares"
- | any (\x -> x < 0 || x > fromIntegral size) (concat xs) = error "value out of range"
- | otherwise = Sudoku (listArray ((0,0),(size-1,size-1)) states)
- where
- size = length xs
- states = map f (concat xs)
- f 0 = Unknown [1..fromIntegral size]
- f x = Known x
-\end{code}
-
-{\tt makeSudoku} makes a {\tt Sudoku} value from a list of numbers. The given matrix must be square and have dimensions
-that are a perfect square. The possible values for each cell range from 1 to the dimension of the square with ``0''
-representing unknown values.\footnote{The rest of the code doesn't depend on any of this weird ``0'' is unknown
-representation. In fact, it doesn't depend on numeric values at all. ``0'' is just used here because it makes
-representing grids in Haskell source code easier.}
-
-\begin{code}
-eliminate :: Eq a => Sudoku a -> Maybe (Sudoku a)
-eliminate (Sudoku grid) = fmap Sudoku $ updateGrid grid changes >>= sanitize
- where
- changes = concatMap findChange $ assocs grid
- findChange (l,Unknown xs)
- = map ((,) l)
- $ case filter (not.(`elem`impossible grid l)) xs of
- [] -> return Impossible
- [x] -> return $ Known x
- xs'
- | xs' /= xs -> return $ Unknown xs'
- | otherwise -> mzero
- findChange _ = mzero
- sanitize grid = return $ grid // [(l,Impossible) |
- (l,x) <- justKnowns changes, x `elem` impossible grid l]
-\end{code}
-
-The {\tt eliminate} phase tries to remove possible choices for ``Unknowns'' based on ``Known'' values in the same row,
-column, or box as the ``Unknown'' value. For each cell on the grid we find its ``neighbors'', that is, cells in the
-same row, column, or box. Out of those neighbors we get a list of all the ``Known'' values. We can eliminate all of
-these from our list of candidates for this cell. If we're lucky enough to eliminate all the candidates but one we have
-a new ``Known'' value. If we're unlucky enough to have eliminates {\bf all} the possible candidates we have a new
-``Impossible'' value.
-
-After iterating though every cell we make one more pass looking for conflicting changes. {\tt sanitize} marks cells as
-``Impossible'' if we have conflicting ``Known'' values.
-
-\begin{code}
-analyze :: Eq a => Sudoku a -> Maybe (Sudoku a)
-analyze (Sudoku grid) = fmap Sudoku $ updateGrid grid $ nub [u |
- f <- map ($grid) [getRow,getCol,getBox],
- n <- [0..size grid - 1],
- u <- unique (f n)]
- where
- unique xs = foldr f [] $ foldr (union.snd) [] unknowns \\ map snd (justKnowns xs)
- where
- unknowns = justUnknowns xs
- f c = case filter ((c`elem`).snd) unknowns of
- [(p,_)] -> ((p,Known c):)
- _ -> id
-\end{code}
-
-The {\tt analyze} phase tries to turn ``Unknowns'' into ``Knowns'' when a certain ``Unknown'' is the only cell that
-contains a value needed in a given row, column, or box. We apply each of the functions {\tt getRow}, {\tt getCol}, and
-{\tt getBox} to all the indices on the grid, apply {\tt unique} to each group, and update the array with the
-results. {\tt unique} gets a list of all the unknown cells in the group and finds all the unknown values in each of
-those cells. Each of these values are iterated though looking for a value that is only contained in one cell. If such a
-value is found the cell containing it must be that value.
-
-\begin{code}
-backtrack :: (MonadPlus m, Eq a) => Sudoku a -> m (Sudoku a)
-backtrack (Sudoku grid) = case (justUnknowns (assocs grid)) of
- [] -> return $ Sudoku grid
- ((p,xs):_) -> msum $ map (\x -> solve $ Sudoku $ grid // [(p,Known x)]) xs
-\end{code}
-
-Sometimes the above two phases still aren't enough to solve a puzzle. For these rare puzzles backtracking is required.
-We attempt to solve the puzzle by replacing the first ``Unknown'' value with each of the candidate values and solving
-the resulting puzzles. Hopefully at least one of our choices will result in a solvable puzzle.
-
-We could actually solve any puzzle using backtracking alone, although this would be very inefficient. The above
-functions simplify most puzzles enough that the backtracking phase has to do hardly any work.
-
-\begin{code}
-solve :: (MonadPlus m, Eq a) => Sudoku a -> m (Sudoku a)
-solve sudoku =
- case eliminate sudoku of
- Just new
- | any (==Impossible) (elems (unSudoku new))-> mzero
- | otherwise -> solve new
- Nothing -> case analyze sudoku of
- Just new -> solve new
- Nothing -> backtrack sudoku
-\end{code}
-
-{\tt solve} glues all the above phases together. First we run the {\tt eliminate} phase. If that found the puzzle to
-be unsolvable we abort immediately. If {\tt eliminate} changed the grid we go though the {\tt eliminate} phase again
-hoping to eliminate more. Once {\tt eliminate} can do no more work we move on to the {\tt analyze} phase. If this
-succeeds in doing some work we start over again with the {\tt eliminate} phase. Once {\tt analyze} can do no more work
-we have no choice but to resort to backtracking. (However in most cases backtracking won't actually do anything because
-the puzzle is already solved.)
-
-\begin{code}
-showsCell :: Show a => CellState a -> ShowS
-showsCell (Known x) = shows x
-showsCell (Impossible) = showChar 'X'
-showsCell (Unknown xs) = \rest -> ('(':)
- $ foldr id (')':rest)
- $ intersperse (showChar ' ')
- $ map shows xs
-\end{code}
-
-{\tt showCell} shows a cell.
-
-\begin{code}
-showsGrid :: Show a => Grid a -> ShowS
-showsGrid grid = showsTable [[grid!(r,c) | c <- [0..size grid-1]] | r <- [0..size grid-1]]
-\end{code}
-
-{\tt showGrid} show a grid.
-
-\begin{code}
--- FEATURE: This is pretty inefficient
-showsTable :: Show a => [[a]] -> ShowS
-showsTable xs = (showChar '\n' .) $ showString $ unlines $ map (concat . intersperse " ") xs''
- where
- xs' = (map.map) show xs
- colWidths = map (max 2 . maximum . map length) (transpose xs')
- xs'' = map (zipWith (\n s -> s ++ (replicate (n - length s) ' ')) colWidths) xs'
-\end{code}
-
-{\tt showsTable} shows a table (or matrix). Every column has the same width so things line up.
-
-\begin{code}
-intSqrt :: Integral a => a -> a
-intSqrt n
- | n < 0 = error "intSqrt: negative n"
- | otherwise = f n
- where
- f x = if y < x then f y else x
- where y = (x + (n `quot` x)) `quot` 2
-\end{code}
-
-{\tt intSqrt} is Newton`s Iteration for finding integral square roots.
-
-\ignore{
-\begin{code}
-test :: Sudoku Int
-test = makeSudoku [
- [0,6,0,1,0,4,0,5,0],
- [0,0,8,3,0,5,6,0,0],
- [2,0,0,0,0,0,0,0,1],
- [8,0,0,4,0,7,0,0,6],
- [0,0,6,0,0,0,3,0,0],
- [7,0,0,9,0,1,0,0,4],
- [5,0,0,0,0,0,0,0,2],
- [0,0,7,2,0,6,9,0,0],
- [0,4,0,5,0,8,0,7,0]]
-
-test2 :: Sudoku Int
-test2 = makeSudoku [
- [0,7,0,0,0,0,8,0,0],
- [0,0,0,2,0,4,0,0,0],
- [0,0,6,0,0,0,0,3,0],
- [0,0,0,5,0,0,0,0,6],
- [9,0,8,0,0,2,0,4,0],
- [0,5,0,0,3,0,9,0,0],
- [0,0,2,0,8,0,0,6,0],
- [0,6,0,9,0,0,7,0,1],
- [4,0,0,0,0,3,0,0,0]]
-
-testSmall :: Sudoku Int
-testSmall = makeSudoku [
- [1,0,0,0,0,0,0,0,0],
- [0,0,2,7,4,0,0,0,0],
- [0,0,0,5,0,0,0,0,4],
- [0,3,0,0,0,0,0,0,0],
- [7,5,0,0,0,0,0,0,0],
- [0,0,0,0,0,9,6,0,0],
- [0,4,0,0,0,6,0,0,0],
- [0,0,0,0,0,0,0,7,1],
- [0,0,0,0,0,1,0,3,0]]
-
-testHard :: Sudoku Int
-testHard = makeSudoku [
- [0,0,0,8,0,2,0,0,0],
- [5,0,0,0,0,0,0,0,1],
- [0,0,6,0,5,0,3,0,0],
- [0,0,9,0,1,0,8,0,0],
- [1,0,0,0,0,0,0,0,2],
- [0,0,0,9,0,7,0,0,0],
- [0,6,1,0,3,0,7,8,0],
- [0,5,0,0,0,0,0,4,0],
- [0,7,2,0,4,0,1,5,0]]
-
-testHard2 :: Sudoku Int
-testHard2 = makeSudoku [
- [3,0,0,2,0,0,9,0,0],
- [0,0,0,0,0,0,0,0,5],
- [0,7,0,1,0,4,0,0,0],
- [0,0,9,0,0,0,8,0,0],
- [5,0,0,0,7,0,0,0,6],
- [0,0,1,0,0,0,2,0,0],
- [0,0,0,3,0,9,0,4,0],
- [8,0,0,0,0,0,0,0,0],
- [0,0,6,0,0,5,0,0,7]]
-
-testHW :: Sudoku Int
-testHW = makeSudoku [
- [0,0,0,1,0,0,7,0,2],
- [0,3,0,9,5,0,0,0,0],
- [0,0,1,0,0,2,0,0,3],
- [5,9,0,0,0,0,3,0,1],
- [0,2,0,0,0,0,0,7,0],
- [7,0,3,0,0,0,0,9,8],
- [8,0,0,2,0,0,1,0,0],
- [0,0,0,0,8,5,0,6,0],
- [6,0,5,0,0,9,0,0,0]]
-
-testTough :: Sudoku Int
-testTough = makeSudoku $ map (map read . words) $ lines $
- "8 3 0 0 0 0 0 4 6\n"++
- "0 2 0 1 0 4 0 3 0\n"++
- "0 0 0 0 0 0 0 0 0\n"++
- "0 0 2 9 0 6 5 0 0\n"++
- "1 4 0 0 0 0 0 2 3\n"++
- "0 0 5 4 0 3 1 0 0\n"++
- "0 0 0 0 0 0 0 0 0\n"++
- "0 6 0 3 0 8 0 7 0\n"++
- "9 5 0 0 0 0 0 6 2\n"
-
-testDiabolical :: Sudoku Int
-testDiabolical = makeSudoku $ map (map read . words) $ lines $
- "8 0 0 7 0 1 0 0 2\n"++
- "0 0 6 0 0 0 7 0 0\n"++
- "0 1 7 0 0 0 8 9 0\n"++
- "0 0 0 1 7 3 0 0 0\n"++
- "7 0 0 0 0 0 0 0 6\n"++
- "0 0 0 9 5 6 0 0 0\n"++
- "0 9 5 0 0 0 4 1 0\n"++
- "0 0 8 0 0 0 5 0 0\n"++
- "3 0 0 6 0 5 0 0 7\n"
-
-main :: IO ()
-main = do
- let
- solve' p = case solve p of
- [] -> fail $ "couldn't solve: " ++ show p
- sols -> return sols
- mapM_ (\p -> solve' p >>= putStrLn.show) [test,test2,testSmall,testHard,testHard2,testHW,testTough,testDiabolical]
- return ()
-
-\end{code}
-}
-
-\end{document}
diff --git a/tests/examplefiles/abnf_example1.abnf b/tests/examplefiles/abnf_example1.abnf
deleted file mode 100644
index 5cd9cd25..00000000
--- a/tests/examplefiles/abnf_example1.abnf
+++ /dev/null
@@ -1,22 +0,0 @@
-; This examples from WikiPedia <https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_Form>.
-
- postal-address = name-part street zip-part
-
- name-part = *(personal-part SP) last-name [SP suffix] CRLF
- name-part =/ personal-part CRLF
-
- personal-part = first-name / (initial ".")
- first-name = *ALPHA
- initial = ALPHA
- last-name = *ALPHA
- suffix = ("Jr." / "Sr." / 1*("I" / "V" / "X"))
-
- street = [apt SP] house-num SP street-name CRLF
- apt = 1*4DIGIT
- house-num = 1*8(DIGIT / ALPHA)
- street-name = 1*VCHAR
-
- zip-part = town-name "," SP state 1*2SP zip-code CRLF
- town-name = 1*(ALPHA / SP)
- state = 2ALPHA
- zip-code = 5DIGIT ["-" 4DIGIT]
diff --git a/tests/examplefiles/abnf_example2.abnf b/tests/examplefiles/abnf_example2.abnf
deleted file mode 100644
index 8781adfb..00000000
--- a/tests/examplefiles/abnf_example2.abnf
+++ /dev/null
@@ -1,9 +0,0 @@
-crlf = %d13.10
-
-command = "command string"
-
-char-line = %x0D.0A *(%x20-7E) %x0D.0A
-
-without-ws-and-ctl = %d1-8 / %d11 / %d12 / %d14-31 / %d127
-
-three-blank-lines = %x0D.0A.0D.0A.0D.0A
diff --git a/tests/examplefiles/addressbook.proto b/tests/examplefiles/addressbook.proto
deleted file mode 100644
index b14829e9..00000000
--- a/tests/examplefiles/addressbook.proto
+++ /dev/null
@@ -1,30 +0,0 @@
-// See README.txt for information and build instructions.
-
-package tutorial;
-
-option java_package = "com.example.tutorial";
-option java_outer_classname = "AddressBookProtos";
-
-message Person {
- required string name = 1;
- required int32 id = 2; // Unique ID number for this person.
- optional string email = 3;
-
- enum PhoneType {
- MOBILE = 0;
- HOME = 1;
- WORK = 2;
- }
-
- message PhoneNumber {
- required string number = 1;
- optional PhoneType type = 2 [default = HOME];
- }
-
- repeated PhoneNumber phone = 4;
-}
-
-// Our address book file is just one of these.
-message AddressBook {
- repeated Person person = 1;
-}
diff --git a/tests/examplefiles/ahcon.f b/tests/examplefiles/ahcon.f
deleted file mode 100644
index 48ae920b..00000000
--- a/tests/examplefiles/ahcon.f
+++ /dev/null
@@ -1,340 +0,0 @@
- SUBROUTINE AHCON (SIZE,N,M,A,B,OLEVR,OLEVI,CLEVR,CLEVI, TRUNCATED
- & SCR1,SCR2,IPVT,JPVT,CON,WORK,ISEED,IERR) !Test inline comment
-C
-C FUNCTION:
-CF
-CF Determines whether the pair (A,B) is controllable and flags
-CF the eigenvalues corresponding to uncontrollable modes.
-CF this ad-hoc controllability calculation uses a random matrix F
-CF and computes whether eigenvalues move from A to the controlled
-CF system A+B*F.
-CF
-C USAGE:
-CU
-CU CALL AHCON (SIZE,N,M,A,B,OLEVR,OLEVI,CLEVR,CLEVI,SCR1,SCR2,IPVT,
-CU JPVT,CON,WORK,ISEED,IERR)
-CU
-CU since AHCON generates different random F matrices for each
-CU call, as long as iseed is not re-initialized by the main
-CU program, and since this code has the potential to be fooled
-CU by extremely ill-conditioned problems, the cautious user
-CU may wish to call it multiple times and rely, perhaps, on
-CU a 2-of-3 vote. We believe, but have not proved, that any
-CU errors this routine may produce are conservative--i.e., that
-CU it may flag a controllable mode as uncontrollable, but
-CU not vice-versa.
-CU
-C INPUTS:
-CI
-CI SIZE integer - first dimension of all 2-d arrays.
-CI
-CI N integer - number of states.
-CI
-CI M integer - number of inputs.
-CI
-CI A double precision - SIZE by N array containing the
-CI N by N system dynamics matrix A.
-CI
-CI B double precision - SIZE by M array containing the
-CI N by M system input matrix B.
-CI
-CI ISEED initial seed for random number generator; if ISEED=0,
-CI then AHCON will set ISEED to a legal value.
-CI
-C OUTPUTS:
-CO
-CO OLEVR double precision - N dimensional vector containing the
-CO real parts of the eigenvalues of A.
-CO
-CO OLEVI double precision - N dimensional vector containing the
-CO imaginary parts of the eigenvalues of A.
-CO
-CO CLEVR double precision - N dimensional vector work space
-CO containing the real parts of the eigenvalues of A+B*F,
-CO where F is the random matrix.
-CO
-CO CLEVI double precision - N dimensional vector work space
-CO containing the imaginary parts of the eigenvalues of
-CO A+B*F, where F is the random matrix.
-CO
-CO SCR1 double precision - N dimensional vector containing the
-CO magnitudes of the corresponding eigenvalues of A.
-CO
-CO SCR2 double precision - N dimensional vector containing the
-CO damping factors of the corresponding eigenvalues of A.
-CO
-CO IPVT integer - N dimensional vector; contains the row pivots
-CO used in finding the nearest neighbor eigenvalues between
-CO those of A and of A+B*F. The IPVT(1)th eigenvalue of
-CO A and the JPVT(1)th eigenvalue of A+B*F are the closest
-CO pair.
-CO
-CO JPVT integer - N dimensional vector; contains the column
-CO pivots used in finding the nearest neighbor eigenvalues;
-CO see IPVT.
-CO
-CO CON logical - N dimensional vector; flagging the uncontrollable
-CO modes of the system. CON(I)=.TRUE. implies the
-CO eigenvalue of A given by DCMPLX(OLEVR(IPVT(I)),OLEVI(IPVT(i)))
-CO corresponds to a controllable mode; CON(I)=.FALSE.
-CO implies an uncontrollable mode for that eigenvalue.
-CO
-CO WORK double precision - SIZE by N dimensional array containing
-CO an N by N matrix. WORK(I,J) is the distance between
-CO the open loop eigenvalue given by DCMPLX(OLEVR(I),OLEVI(I))
-CO and the closed loop eigenvalue of A+B*F given by
-CO DCMPLX(CLEVR(J),CLEVI(J)).
-CO
-CO IERR integer - IERR=0 indicates normal return; a non-zero
-CO value indicates trouble in the eigenvalue calculation.
-CO see the EISPACK and EIGEN documentation for details.
-CO
-C ALGORITHM:
-CA
-CA Calculate eigenvalues of A and of A+B*F for a randomly
-CA generated F, and see which ones change. Use a full pivot
-CA search through a matrix of euclidean distance measures
-CA between each pair of eigenvalues from (A,A+BF) to
-CA determine the closest pairs.
-CA
-C MACHINE DEPENDENCIES:
-CM
-CM NONE
-CM
-C HISTORY:
-CH
-CH written by: Birdwell & Laub
-CH date: May 18, 1985
-CH current version: 1.0
-CH modifications: made machine independent and modified for
-CH f77:bb:8-86.
-CH changed cmplx -> dcmplx: 7/27/88 jdb
-CH
-C ROUTINES CALLED:
-CC
-CC EIGEN,RAND
-CC
-C COMMON MEMORY USED:
-CM
-CM none
-CM
-C----------------------------------------------------------------------
-C written for: The CASCADE Project
-C Oak Ridge National Laboratory
-C U.S. Department of Energy
-C contract number DE-AC05-840R21400
-C subcontract number 37B-7685 S13
-C organization: The University of Tennessee
-C----------------------------------------------------------------------
-C THIS SOFTWARE IS IN THE PUBLIC DOMAIN
-C NO RESTRICTIONS ON ITS USE ARE IMPLIED
-C----------------------------------------------------------------------
-C
-C--global variables:
-C
- INTEGER SIZE
- INTEGER N
- INTEGER M
- INTEGER IPVT(1)
- INTEGER JPVT(1)
- INTEGER IERR
-C
- DOUBLE PRECISION A(SIZE,N)
- DOUBLE PRECISION B(SIZE,M)
- DOUBLE PRECISION WORK(SIZE,N)
- DOUBLE PRECISION CLEVR(N)
- DOUBLE PRECISION CLEVI(N)
- DOUBLE PRECISION OLEVR(N)
- DOUBLE PRECISION OLEVI(N)
- DOUBLE PRECISION SCR1(N)
- DOUBLE PRECISION SCR2(N)
-C
- LOGICAL CON(N)
-C
-C--local variables:
-C
- INTEGER ISEED
- INTEGER ITEMP
- INTEGER K1
- INTEGER K2
- INTEGER I
- INTEGER J
- INTEGER K
- INTEGER IMAX
- INTEGER JMAX
-C
- DOUBLE PRECISION VALUE
- DOUBLE PRECISION EPS
- DOUBLE PRECISION EPS1
- DOUBLE PRECISION TEMP
- DOUBLE PRECISION CURR
- DOUBLE PRECISION ANORM
- DOUBLE PRECISION BNORM
- DOUBLE PRECISION COLNRM
- DOUBLE PRECISION RNDMNO
-C
- DOUBLE COMPLEX DCMPLX
-C
-C--compute machine epsilon
-C
- EPS = 1.D0
-100 CONTINUE
- EPS = EPS / 2.D0
- EPS1 = 1.D0 + EPS
- IF (EPS1 .NE. 1.D0) GO TO 100
- EPS = EPS * 2.D0
-C
-C--compute the l-1 norm of a
-C
- ANORM = 0.0D0
- DO 120 J = 1, N
- COLNRM = 0.D0
- DO 110 I = 1, N
- COLNRM = COLNRM + ABS(A(I,J))
-110 CONTINUE
- IF (COLNRM .GT. ANORM) ANORM = COLNRM
-120 CONTINUE
-C
-C--compute the l-1 norm of b
-C
- BNORM = 0.0D0
- DO 140 J = 1, M
- COLNRM = 0.D0
- DO 130 I = 1, N
- COLNRM = COLNRM + ABS(B(I,J))
-130 CONTINUE
- IF (COLNRM .GT. BNORM) BNORM = COLNRM
-140 CONTINUE
-C
-C--compute a + b * f
-C
- DO 160 J = 1, N
- DO 150 I = 1, N
- WORK(I,J) = A(I,J)
-150 CONTINUE
-160 CONTINUE
-C
-C--the elements of f are random with uniform distribution
-C--from -anorm/bnorm to +anorm/bnorm
-C--note that f is not explicitly stored as a matrix
-C--pathalogical floating point notes: the if (bnorm .gt. 0.d0)
-C--test should actually be if (bnorm .gt. dsmall), where dsmall
-C--is the smallest representable number whose reciprocal does
-C--not generate an overflow or loss of precision.
-C
- IF (ISEED .EQ. 0) ISEED = 86345823
- IF (ANORM .EQ. 0.D0) ANORM = 1.D0
- IF (BNORM .GT. 0.D0) THEN
- TEMP = 2.D0 * ANORM / BNORM
- ELSE
- TEMP = 2.D0
- END IF
- DO 190 K = 1, M
- DO 180 J = 1, N
- CALL RAND(ISEED,ISEED,RNDMNO)
- VALUE = (RNDMNO - 0.5D0) * TEMP
- DO 170 I = 1, N
- WORK(I,J) = WORK(I,J) + B(I,K)*VALUE
-170 CONTINUE
-180 CONTINUE
-190 CONTINUE
-C
-C--compute the eigenvalues of a + b*f, and several other things
-C
- CALL EIGEN (0,SIZE,N,WORK,CLEVR,CLEVI,WORK,SCR1,SCR2,IERR)
- IF (IERR .NE. 0) RETURN
-C
-C--copy a so it is not destroyed
-C
- DO 210 J = 1, N
- DO 200 I = 1, N
- WORK(I,J) = A(I,J)
-200 CONTINUE
-210 CONTINUE
-C
-C--compute the eigenvalues of a, and several other things
-C
- CALL EIGEN (0,SIZE,N,WORK,OLEVR,OLEVI,WORK,SCR1,SCR2,IERR)
- IF (IERR .NE. 0) RETURN
-C
-C--form the matrix of distances between eigenvalues of a and
-C--EIGENVALUES OF A+B*F
-C
- DO 230 J = 1, N
- DO 220 I = 1, N
- WORK(I,J) =
- & ABS(DCMPLX(OLEVR(I),OLEVI(I))-DCMPLX(CLEVR(J),CLEVI(J)))
-220 CONTINUE
-230 CONTINUE
-C
-C--initialize row and column pivots
-C
- DO 240 I = 1, N
- IPVT(I) = I
- JPVT(I) = I
-240 CONTINUE
-C
-C--a little bit messy to avoid swapping columns and
-C--rows of work
-C
- DO 270 I = 1, N-1
-C
-C--find the minimum element of each lower right square
-C--submatrix of work, for submatrices of size n x n
-C--through 2 x 2
-C
- CURR = WORK(IPVT(I),JPVT(I))
- IMAX = I
- JMAX = I
- TEMP = CURR
-C
-C--find the minimum element
-C
- DO 260 K1 = I, N
- DO 250 K2 = I, N
- IF (WORK(IPVT(K1),JPVT(K2)) .LT. TEMP) THEN
- TEMP = WORK(IPVT(K1),JPVT(K2))
- IMAX = K1
- JMAX = K2
- END IF
-250 CONTINUE
-260 CONTINUE
-C
-C--update row and column pivots for indirect addressing of work
-C
- ITEMP = IPVT(I)
- IPVT(I) = IPVT(IMAX)
- IPVT(IMAX) = ITEMP
-C
- ITEMP = JPVT(I)
- JPVT(I) = JPVT(JMAX)
- JPVT(JMAX) = ITEMP
-C
-C--do next submatrix
-C
-270 CONTINUE
-C
-C--this threshold for determining when an eigenvalue has
-C--not moved, and is therefore uncontrollable, is critical,
-C--and may require future changes with more experience.
-C
- EPS1 = SQRT(EPS)
-C
-C--for each eigenvalue pair, decide if it is controllable
-C
- DO 280 I = 1, N
-C
-C--note that we are working with the "pivoted" work matrix
-C--and are looking at its diagonal elements
-C
- IF (WORK(IPVT(I),JPVT(I))/ANORM .LE. EPS1) THEN
- CON(I) = .FALSE.
- ELSE
- CON(I) = .TRUE.
- END IF
-280 CONTINUE
-C
-C--finally!
-C
- RETURN
- END
diff --git a/tests/examplefiles/all.nit b/tests/examplefiles/all.nit
deleted file mode 100644
index d4e1ddfa..00000000
--- a/tests/examplefiles/all.nit
+++ /dev/null
@@ -1,1986 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2013 Alexis Laferrière <alexis.laf@xymus.net>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import gtk
-
-class CalculatorContext
- var result : nullable Float = null
-
- var last_op : nullable Char = null
-
- var current : nullable Float = null
- var after_point : nullable Int = null
-
- fun push_op( op : Char )
- do
- apply_last_op_if_any
- if op == 'C' then
- self.result = 0.0
- last_op = null
- else
- last_op = op # store for next push_op
- end
-
- # prepare next current
- after_point = null
- current = null
- end
-
- fun push_digit( digit : Int )
- do
- var current = current
- if current == null then current = 0.0
-
- var after_point = after_point
- if after_point == null then
- current = current * 10.0 + digit.to_f
- else
- current = current + digit.to_f * 10.0.pow(after_point.to_f)
- self.after_point -= 1
- end
-
- self.current = current
- end
-
- fun switch_to_decimals
- do
- if self.current == null then current = 0.0
- if after_point != null then return
-
- after_point = -1
- end
-
- fun apply_last_op_if_any
- do
- var op = last_op
-
- var result = result
- if result == null then result = 0.0
-
- var current = current
- if current == null then current = 0.0
-
- if op == null then
- result = current
- else if op == '+' then
- result = result + current
- else if op == '-' then
- result = result - current
- else if op == '/' then
- result = result / current
- else if op == '*' then
- result = result * current
- end
- self.result = result
- self.current = null
- end
-end
-
-class CalculatorGui
- super GtkCallable
-
- var win : GtkWindow
- var container : GtkGrid
-
- var lbl_disp : GtkLabel
- var but_eq : GtkButton
- var but_dot : GtkButton
-
- var context = new CalculatorContext
-
- redef fun signal( sender, user_data )
- do
- var after_point = context.after_point
- if after_point == null then
- after_point = 0
- else
- after_point = (after_point.abs)
- end
-
- if user_data isa Char then # is an operation
- var c = user_data
- if c == '.' then
- but_dot.sensitive= false
- context.switch_to_decimals
- lbl_disp.text = "{context.current.to_i}."
- else
- but_dot.sensitive= true
- context.push_op( c )
-
- var s = context.result.to_precision_native(6)
- var index : nullable Int = null
- for i in s.length.times do
- var chiffre = s.chars[i]
- if chiffre == '0' and index == null then
- index = i
- else if chiffre != '0' then
- index = null
- end
- end
- if index != null then
- s = s.substring(0, index)
- if s.chars[s.length-1] == ',' then s = s.substring(0, s.length-1)
- end
- lbl_disp.text = s
- end
- else if user_data isa Int then # is a number
- var n = user_data
- context.push_digit( n )
- lbl_disp.text = context.current.to_precision_native(after_point)
- end
- end
-
- init
- do
- init_gtk
-
- win = new GtkWindow( 0 )
-
- container = new GtkGrid(5,5,true)
- win.add( container )
-
- lbl_disp = new GtkLabel( "_" )
- container.attach( lbl_disp, 0, 0, 5, 1 )
-
- # digits
- for n in [0..9] do
- var but = new GtkButton.with_label( n.to_s )
- but.request_size( 64, 64 )
- but.signal_connect( "clicked", self, n )
- if n == 0 then
- container.attach( but, 0, 4, 1, 1 )
- else container.attach( but, (n-1)%3, 3-(n-1)/3, 1, 1 )
- end
-
- # operators
- var r = 1
- for op in ['+', '-', '*', '/' ] do
- var but = new GtkButton.with_label( op.to_s )
- but.request_size( 64, 64 )
- but.signal_connect( "clicked", self, op )
- container.attach( but, 3, r, 1, 1 )
- r+=1
- end
-
- # =
- but_eq = new GtkButton.with_label( "=" )
- but_eq.request_size( 64, 64 )
- but_eq.signal_connect( "clicked", self, '=' )
- container.attach( but_eq, 4, 3, 1, 2 )
-
- # .
- but_dot = new GtkButton.with_label( "." )
- but_dot.request_size( 64, 64 )
- but_dot.signal_connect( "clicked", self, '.' )
- container.attach( but_dot, 1, 4, 1, 1 )
-
- #C
- var but_c = new GtkButton.with_label( "C" )
- but_c.request_size( 64, 64 )
- but_c.signal_connect("clicked", self, 'C')
- container.attach( but_c, 2, 4, 1, 1 )
-
- win.show_all
- end
-end
-
-# context tests
-var context = new CalculatorContext
-context.push_digit( 1 )
-context.push_digit( 2 )
-context.push_op( '+' )
-context.push_digit( 3 )
-context.push_op( '*' )
-context.push_digit( 2 )
-context.push_op( '=' )
-var r = context.result.to_precision( 2 )
-assert r == "30.00" else print r
-
-context = new CalculatorContext
-context.push_digit( 1 )
-context.push_digit( 4 )
-context.switch_to_decimals
-context.push_digit( 1 )
-context.push_op( '*' )
-context.push_digit( 3 )
-context.push_op( '=' )
-r = context.result.to_precision( 2 )
-assert r == "42.30" else print r
-
-context.push_op( '+' )
-context.push_digit( 1 )
-context.push_digit( 1 )
-context.push_op( '=' )
-r = context.result.to_precision( 2 )
-assert r == "53.30" else print r
-
-context = new CalculatorContext
-context.push_digit( 4 )
-context.push_digit( 2 )
-context.switch_to_decimals
-context.push_digit( 3 )
-context.push_op( '/' )
-context.push_digit( 3 )
-context.push_op( '=' )
-r = context.result.to_precision( 2 )
-assert r == "14.10" else print r
-
-#test multiple decimals
-context = new CalculatorContext
-context.push_digit( 5 )
-context.push_digit( 0 )
-context.switch_to_decimals
-context.push_digit( 1 )
-context.push_digit( 2 )
-context.push_digit( 3 )
-context.push_op( '+' )
-context.push_digit( 1 )
-context.push_op( '=' )
-r = context.result.to_precision( 3 )
-assert r == "51.123" else print r
-
-#test 'C' button
-context = new CalculatorContext
-context.push_digit( 1 )
-context.push_digit( 0 )
-context.push_op( '+' )
-context.push_digit( 1 )
-context.push_digit( 0 )
-context.push_op( '=' )
-context.push_op( 'C' )
-r = context.result.to_precision( 1 )
-assert r == "0.0" else print r
-
-# graphical application
-
-if "NIT_TESTING".environ != "true" then
- var app = new CalculatorGui
- run_gtk
-end
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2013 Matthieu Lucas <lucasmatthieu@gmail.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This sample has been implemented to show you how simple is it to play
-# with native callbacks (C) through an high level with NIT program.
-
-module callback_chimpanze
-import callback_monkey
-
-class Chimpanze
- super MonkeyActionCallable
-
- fun create
- do
- var monkey = new Monkey
- print "Hum, I'm sleeping ..."
- # Invoking method which will take some time to compute, and
- # will be back in wokeUp method with information.
- # - Callback method defined in MonkeyActionCallable Interface
- monkey.wokeUpAction(self, "Hey, I'm awake.")
- end
-
- # Inherit callback method, defined by MonkeyActionCallable interface
- # - Back of wokeUpAction method
- redef fun wokeUp( sender:Monkey, message:Object )
- do
- print message
- end
-end
-
-var m = new Chimpanze
-m.create
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2013 Matthieu Lucas <lucasmatthieu@gmail.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This sample has been implemented to show you how simple is it to play
-# with native callbacks (C) through an high level with NIT program.
-
-module callback_monkey
-
-in "C header" `{
- #include <stdio.h>
- #include <stdlib.h>
-
- typedef struct {
- int id;
- int age;
- } CMonkey;
-
- typedef struct {
- MonkeyActionCallable toCall;
- Object message;
- } MonkeyAction;
-`}
-
-in "C body" `{
- // Method which reproduce a callback answer
- // Please note that a function pointer is only used to reproduce the callback
- void cbMonkey(CMonkey *mkey, void callbackFunc(CMonkey*, MonkeyAction*), MonkeyAction *data)
- {
- sleep(2);
- callbackFunc( mkey, data );
- }
-
- // Back of background treatment, will be redirected to callback function
- void nit_monkey_callback_func( CMonkey *mkey, MonkeyAction *data )
- {
- // To call a your method, the signature must be written like this :
- // <Interface Name>_<Method>...
- MonkeyActionCallable_wokeUp( data->toCall, mkey, data->message );
- }
-`}
-
-# Implementable interface to get callback in defined methods
-interface MonkeyActionCallable
- fun wokeUp( sender:Monkey, message: Object) is abstract
-end
-
-# Defining my object type Monkey, which is, in a low level, a pointer to a C struct (CMonkey)
-extern class Monkey `{ CMonkey * `}
-
- new `{
- CMonkey *monkey = malloc( sizeof(CMonkey) );
- monkey->age = 10;
- monkey->id = 1;
- return monkey;
- `}
-
- # Object method which will get a callback in wokeUp method, defined in MonkeyActionCallable interface
- # Must be defined as Nit/C method because of C call inside
- fun wokeUpAction( toCall: MonkeyActionCallable, message: Object ) is extern import MonkeyActionCallable.wokeUp `{
-
- // Allocating memory to keep reference of received parameters :
- // - Object receiver
- // - Message
- MonkeyAction *data = malloc( sizeof(MonkeyAction) );
-
- // Incrementing reference counter to prevent from releasing
- MonkeyActionCallable_incr_ref( toCall );
- Object_incr_ref( message );
-
- data->toCall = toCall;
- data->message = message;
-
- // Calling method which reproduce a callback by passing :
- // - Receiver
- // - Function pointer to object return method
- // - Datas
- cbMonkey( recv, &nit_monkey_callback_func, data );
- `}
-end
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Implementation of circular lists
-# This example shows the usage of generics and somewhat a specialisation of collections.
-module circular_list
-
-# Sequences of elements implemented with a double-linked circular list
-class CircularList[E]
- # Like standard Array or LinkedList, CircularList is a Sequence.
- super Sequence[E]
-
- # The first node of the list if any
- # The special case of an empty list is handled by a null node
- private var node: nullable CLNode[E] = null
-
- redef fun iterator do return new CircularListIterator[E](self)
-
- redef fun first do return self.node.item
-
- redef fun push(e)
- do
- var new_node = new CLNode[E](e)
- var n = self.node
- if n == null then
- # the first node
- self.node = new_node
- else
- # not the first one, so attach nodes correctly.
- var old_last_node = n.prev
- new_node.next = n
- new_node.prev = old_last_node
- old_last_node.next = new_node
- n.prev = new_node
- end
- end
-
- redef fun pop
- do
- var n = self.node
- assert n != null
- var prev = n.prev
- if prev == n then
- # the only node
- self.node = null
- return n.item
- end
- # not the only one do detach nodes correctly.
- var prev_prev = prev.prev
- n.prev = prev_prev
- prev_prev.next = n
- return prev.item
- end
-
- redef fun unshift(e)
- do
- # Circularity has benefits.
- push(e)
- self.node = self.node.prev
- end
-
- redef fun shift
- do
- # Circularity has benefits.
- self.node = self.node.next
- return self.pop
- end
-
- # Move the first at the last position, the second at the first, etc.
- fun rotate
- do
- var n = self.node
- if n == null then return
- self.node = n.next
- end
-
- # Sort the list using the Josephus algorithm.
- fun josephus(step: Int)
- do
- var res = new CircularList[E]
- while not self.is_empty do
- # count 'step'
- for i in [1..step[ do self.rotate
- # kill
- var x = self.shift
- res.add(x)
- end
- self.node = res.node
- end
-end
-
-# Nodes of a CircularList
-private class CLNode[E]
- # The current item
- var item: E
-
- # The next item in the circular list.
- # Because of circularity, there is always a next;
- # so by default let it be self
- var next: CLNode[E] = self
-
- # The previous item in the circular list.
- # Coherence between next and previous nodes has to be maintained by the
- # circular list.
- var prev: CLNode[E] = self
-end
-
-# An iterator of a CircularList.
-private class CircularListIterator[E]
- super IndexedIterator[E]
-
- redef var index: Int
-
- # The current node pointed.
- # Is null if the list is empty.
- var node: nullable CLNode[E]
-
- # The list iterated.
- var list: CircularList[E]
-
- redef fun is_ok
- do
- # Empty lists are not OK.
- # Pointing again the first node is not OK.
- return self.node != null and (self.index == 0 or self.node != self.list.node)
- end
-
- redef fun next
- do
- self.node = self.node.next
- self.index += 1
- end
-
- redef fun item do return self.node.item
-
- init(list: CircularList[E])
- do
- self.node = list.node
- self.list = list
- self.index = 0
- end
-end
-
-var i = new CircularList[Int]
-i.add_all([1, 2, 3, 4, 5, 6, 7])
-print i.first
-print i.join(":")
-
-i.push(8)
-print i.shift
-print i.pop
-i.unshift(0)
-print i.join(":")
-
-i.josephus(3)
-print i.join(":")
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This module beef up the clock module by allowing a clock to be comparable.
-# It show the usage of class refinement
-module clock_more
-
-import clock
-
-redef class Clock
- # Clock are now comparable
- super Comparable
-
- # Comparaison of a clock make only sense with an other clock
- redef type OTHER: Clock
-
- redef fun <(o)
- do
- # Note: < is the only abstract method of Comparable.
- # All other operators and methods rely on < and ==.
- return self.total_minutes < o.total_minutes
- end
-end
-
-var c1 = new Clock(8, 12)
-var c2 = new Clock(8, 13)
-var c3 = new Clock(9, 13)
-
-print "{c1}<{c2}? {c1<c2}"
-print "{c1}<={c2}? {c1<=c2}"
-print "{c1}>{c2}? {c1>c2}"
-print "{c1}>={c2}? {c1>=c2}"
-print "{c1}<=>{c2}? {c1<=>c2}"
-print "{c1},{c2}? max={c1.max(c2)} min={c1.min(c2)}"
-print "{c1}.is_between({c2}, {c3})? {c1.is_between(c2, c3)}"
-print "{c2}.is_between({c1}, {c3})? {c2.is_between(c1, c3)}"
-
-print "-"
-
-c1.minutes += 1
-
-print "{c1}<{c2}? {c1<c2}"
-print "{c1}<={c2}? {c1<=c2}"
-print "{c1}>{c2}? {c1>c2}"
-print "{c1}>={c2}? {c1>=c2}"
-print "{c1}<=>{c2}? {c1<=>c2}"
-print "{c1},{c2}? max={c1.max(c2)} min={c1.min(c2)}"
-print "{c1}.is_between({c2}, {c3})? {c1.is_between(c2, c3)}"
-print "{c2}.is_between({c1}, {c3})? {c2.is_between(c1, c3)}"
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This module provide a simple wall clock.
-# It is an example of getters and setters.
-# A beefed-up module is available in clock_more
-module clock
-
-# A simple wall clock with 60 minutes and 12 hours.
-class Clock
- # total number of minutes from 0 to 719
- var total_minutes: Int
- # Note: only the read acces is public, the write access is private.
-
- # number of minutes in the current hour (from 0 to 59)
- fun minutes: Int do return self.total_minutes % 60
-
- # set the number of minutes in the current hour.
- # if m < 0 or m >= 60, the hour will be changed accordinlgy
- fun minutes=(m: Int) do self.total_minutes = self.hours * 60 + m
-
- # number of hours (from 0 to 11)
- fun hours: Int do return self.total_minutes / 60
-
- # set the number of hours
- # the minutes will not be updated
- fun hours=(h: Int) do self.total_minutes = h * 60 + minutes
-
- # the position of the hour arrow in the [0..60[ interval
- fun hour_pos: Int do return total_minutes / 12
-
- # replace the arrow of hours (from 0 to 59).
- # the hours and the minutes will be updated.
- fun hour_pos=(h: Int) do self.total_minutes = h * 12
-
- redef fun to_s do return "{hours}:{minutes}"
-
- fun reset(hours, minutes: Int) do self.total_minutes = hours*60 + minutes
-
- init(hours, minutes: Int) do self.reset(hours, minutes)
-
- redef fun ==(o)
- do
- # Note: o is a nullable Object, a type test is required
- # Thanks to adaptive typing, there is no downcast
- # i.e. the code is safe!
- return o isa Clock and self.total_minutes == o.total_minutes
- end
-end
-
-var c = new Clock(10,50)
-print "It's {c} o'clock."
-
-c.minutes += 22
-print "Now it's {c} o'clock."
-
-print "The short arrow in on the {c.hour_pos/5} and the long arrow in on the {c.minutes/5}."
-
-c.hours -= 2
-print "Now it's {c} o'clock."
-
-var c2 = new Clock(9, 11)
-print "It's {c2} on the second clock."
-print "The two clocks are synchronized: {c == c2}."
-c2.minutes += 1
-print "It's now {c2} on the second clock."
-print "The two clocks are synchronized: {c == c2}."
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2013 Matthieu Lucas <lucasmatthieu@gmail.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Sample of the Curl module.
-module curl_http
-
-import curl
-
-# Small class to represent an Http Fetcher
-class MyHttpFetcher
- super CurlCallbacks
-
- var curl: Curl
- var our_body: String = ""
-
- init(curl: Curl) do self.curl = curl
-
- # Release curl object
- fun destroy do self.curl.destroy
-
- # Header callback
- redef fun header_callback(line: String) do
- # We keep this callback silent for testing purposes
- #if not line.has_prefix("Date:") then print "Header_callback : {line}"
- end
-
- # Body callback
- redef fun body_callback(line: String) do self.our_body = "{self.our_body}{line}"
-
- # Stream callback - Cf : No one is registered
- redef fun stream_callback(buffer: String, size: Int, count: Int) do print "Stream_callback : {buffer} - {size} - {count}"
-end
-
-
-# Program
-if args.length < 2 then
- print "Usage: curl_http <method wished [POST, GET, GET_FILE]> <target url>"
-else
- var curl = new Curl
- var url = args[1]
- var request = new CurlHTTPRequest(url, curl)
-
- # HTTP Get Request
- if args[0] == "GET" then
- request.verbose = false
- var getResponse = request.execute
-
- if getResponse isa CurlResponseSuccess then
- print "Status code : {getResponse.status_code}"
- print "Body : {getResponse.body_str}"
- else if getResponse isa CurlResponseFailed then
- print "Error code : {getResponse.error_code}"
- print "Error msg : {getResponse.error_msg}"
- end
-
- # HTTP Post Request
- else if args[0] == "POST" then
- var myHttpFetcher = new MyHttpFetcher(curl)
- request.delegate = myHttpFetcher
-
- var postDatas = new HeaderMap
- postDatas["Bugs Bunny"] = "Daffy Duck"
- postDatas["Batman"] = "Robin likes special characters @#ùà!è§'(\"é&://,;<>∞~*"
- postDatas["Batman"] = "Yes you can set multiple identical keys, but APACHE will consider only once, the last one"
- request.datas = postDatas
- request.verbose = false
- var postResponse = request.execute
-
- print "Our body from the callback : {myHttpFetcher.our_body}"
-
- if postResponse isa CurlResponseSuccess then
- print "*** Answer ***"
- print "Status code : {postResponse.status_code}"
- print "Body should be empty, because we decided to manage callbacks : {postResponse.body_str.length}"
- else if postResponse isa CurlResponseFailed then
- print "Error code : {postResponse.error_code}"
- print "Error msg : {postResponse.error_msg}"
- end
-
- # HTTP Get to file Request
- else if args[0] == "GET_FILE" then
- var headers = new HeaderMap
- headers["Accept"] = "Moo"
- request.headers = headers
- request.verbose = false
- var downloadResponse = request.download_to_file(null)
-
- if downloadResponse isa CurlFileResponseSuccess then
- print "*** Answer ***"
- print "Status code : {downloadResponse.status_code}"
- print "Size downloaded : {downloadResponse.size_download}"
- else if downloadResponse isa CurlResponseFailed then
- print "Error code : {downloadResponse.error_code}"
- print "Error msg : {downloadResponse.error_msg}"
- end
- # Program logic
- else
- print "Usage : Method[POST, GET, GET_FILE]"
- end
-end
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2013 Matthieu Lucas <lucasmatthieu@gmail.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Mail sender sample using the Curl module
-module curl_mail
-
-import curl
-
-var curl = new Curl
-var mail_request = new CurlMailRequest(curl)
-
-# Networks
-var response = mail_request.set_outgoing_server("smtps://smtp.example.org:465", "user@example.org", "mypassword")
-if response isa CurlResponseFailed then
- print "Error code : {response.error_code}"
- print "Error msg : {response.error_msg}"
-end
-
-# Headers
-mail_request.from = "Billy Bob"
-mail_request.to = ["user@example.org"]
-mail_request.cc = ["bob@example.org"]
-mail_request.bcc = null
-
-var headers_body = new HeaderMap
-headers_body["Content-Type:"] = "text/html; charset=\"UTF-8\""
-headers_body["Content-Transfer-Encoding:"] = "quoted-printable"
-mail_request.headers_body = headers_body
-
-# Content
-mail_request.body = "<h1>Here you can write HTML stuff.</h1>"
-mail_request.subject = "Hello From My Nit Program"
-
-# Others
-mail_request.verbose = false
-
-# Send mail
-response = mail_request.execute
-if response isa CurlResponseFailed then
- print "Error code : {response.error_code}"
- print "Error msg : {response.error_msg}"
-else if response isa CurlMailResponseSuccess then
- print "Mail Sent"
-else
- print "Unknown Curl Response type"
-end
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2012-2013 Alexis Laferrière <alexis.laf@xymus.net>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Draws an arithmetic operation to the terminal
-module draw_operation
-
-redef enum Int
- fun n_chars: Int `{
- int c;
- if ( abs(recv) >= 10 )
- c = 1+(int)log10f( (float)abs(recv) );
- else
- c = 1;
- if ( recv < 0 ) c ++;
- return c;
- `}
-end
-
-redef enum Char
- fun as_operator(a, b: Int): Int
- do
- if self == '+' then return a + b
- if self == '-' then return a - b
- if self == '*' then return a * b
- if self == '/' then return a / b
- if self == '%' then return a % b
- abort
- end
-
- fun override_dispc: Bool
- do
- return self == '+' or self == '-' or self == '*' or self == '/' or self == '%'
- end
-
- fun lines(s: Int): Array[Line]
- do
- if self == '+' then
- return [new Line(new P(0,s/2),1,0,s), new Line(new P(s/2,1),0,1,s-2)]
- else if self == '-' then
- return [new Line(new P(0,s/2),1,0,s)]
- else if self == '*' then
- var lines = new Array[Line]
- for y in [1..s-1[ do
- lines.add( new Line(new P(1,y), 1,0,s-2) )
- end
- return lines
- else if self == '/' then
- return [new Line(new P(s-1,0), -1,1, s )]
- else if self == '%' then
- var q4 = s/4
- var lines = [new Line(new P(s-1,0),-1,1,s)]
- for l in [0..q4[ do
- lines.append([ new Line( new P(0,l), 1,0,q4), new Line( new P(s-1,s-1-l), -1,0,q4) ])
- end
- return lines
- else if self == '1' then
- return [new Line(new P(s/2,0), 0,1,s),new Line(new P(0,s-1),1,0,s),
- new Line( new P(s/2,0),-1,1,s/2)]
- else if self == '2' then
- return [new Line(new P(0,0), 1,0,s),new Line(new P(s-1,0),0,1,s/2),
- new Line( new P(0,s-1),1,0,s), new Line( new P(0,s/2), 0,1,s/2),
- new Line( new P(0,s/2), 1,0,s)]
- else if self == '3' then
- return [new Line(new P(0,0), 1,0,s),new Line(new P(s-1,0),0,1,s),
- new Line( new P(0,s-1),1,0,s), new Line( new P(0,s/2), 1,0,s)]
- else if self == '4' then
- return [new Line(new P(s-1,0),0,1,s), new Line( new P(0,0), 0,1,s/2),
- new Line( new P(0,s/2), 1,0,s)]
- else if self == '5' then
- return [new Line(new P(0,0), 1,0,s),new Line(new P(s-1,s/2),0,1,s/2),
- new Line( new P(0,s-1),1,0,s), new Line( new P(0,0), 0,1,s/2),
- new Line( new P(0,s/2), 1,0,s)]
- else if self == '6' then
- return [new Line(new P(0,0), 1,0,s),new Line(new P(s-1,s/2),0,1,s/2),
- new Line( new P(0,s-1),1,0,s), new Line( new P(0,0), 0,1,s),
- new Line( new P(0,s/2), 1,0,s)]
- else if self == '7' then
- var tl = new P(0,0)
- var tr = new P(s-1,0)
- return [new Line(tl, 1,0,s), new Line(tr,-1,1,s)]
- else if self == '8' then
- return [new Line(new P(0,0), 1,0,s),new Line(new P(s-1,0),0,1,s),
- new Line( new P(0,s-1),1,0,s), new Line( new P(0,0), 0,1,s),
- new Line( new P(0,s/2), 1,0,s)]
- else if self == '9' then
- return [new Line(new P(0,0), 1,0,s),new Line(new P(s-1,0),0,1,s),
- new Line( new P(0,s-1),1,0,s), new Line( new P(0,0), 0,1,s/2),
- new Line( new P(0,s/2), 1,0,s)]
- else if self == '0' then
- return [new Line(new P(0,0), 1,0,s),new Line(new P(s-1,0),0,1,s),
- new Line( new P(0,s-1),1,0,s), new Line( new P(0,0), 0,1,s)]
- end
- return new Array[Line]
- end
-end
-
-class P
- var x : Int
- var y : Int
-end
-
-redef class String
- # hack is to support a bug in the evaluation software
- fun draw(dispc: Char, size, gap: Int, hack: Bool)
- do
- var w = size * length +(length-1)*gap
- var h = size
- var map = new Array[Array[Char]]
- for x in [0..w[ do
- map[x] = new Array[Char].filled_with( ' ', h )
- end
-
- var ci = 0
- for c in self.chars do
- var local_dispc
- if c.override_dispc then
- local_dispc = c
- else
- local_dispc = dispc
- end
-
- var lines = c.lines( size )
- for line in lines do
- var x = line.o.x+ci*size
- x += ci*gap
- var y = line.o.y
- for s in [0..line.len[ do
- assert map.length > x and map[x].length > y else print "setting {x},{y} as {local_dispc}"
- map[x][y] = local_dispc
- x += line.step_x
- y += line.step_y
- end
- end
-
- ci += 1
- end
-
- if hack then
- for c in [0..size[ do
- map[c][0] = map[map.length-size+c][0]
- map[map.length-size+c][0] = ' '
- end
- end
-
- for y in [0..h[ do
- for x in [0..w[ do
- printn map[x][y]
- end
- print ""
- end
- end
-end
-
-class Line
- var o : P
- var step_x : Int
- var step_y : Int
- var len : Int
-end
-
-var a
-var b
-var op_char
-var disp_char
-var disp_size
-var disp_gap
-
-if "NIT_TESTING".environ == "true" then
- a = 567
- b = 13
- op_char = '*'
- disp_char = 'O'
- disp_size = 8
- disp_gap = 1
-else
- printn "Left operand: "
- a = gets.to_i
-
- printn "Right operand: "
- b = gets.to_i
-
- printn "Operator (+, -, *, /, %): "
- op_char = gets.chars[0]
-
- printn "Char to display: "
- disp_char = gets.chars[0]
-
- printn "Size of text: "
- disp_size = gets.to_i
-
- printn "Space between digits: "
- disp_gap = gets.to_i
-end
-
-var result = op_char.as_operator( a, b )
-
-var len_a = a.n_chars
-var len_b = b.n_chars
-var len_res = result.n_chars
-var max_len = len_a.max( len_b.max( len_res ) ) + 1
-
-# draw first line
-var d = max_len - len_a
-var line_a = ""
-for i in [0..d[ do line_a += " "
-line_a += a.to_s
-line_a.draw( disp_char, disp_size, disp_gap, false )
-
-print ""
-# draw second line
-d = max_len - len_b-1
-var line_b = op_char.to_s
-for i in [0..d[ do line_b += " "
-line_b += b.to_s
-line_b.draw( disp_char, disp_size, disp_gap, false )
-
-# draw -----
-print ""
-for i in [0..disp_size*max_len+(max_len-1)*disp_gap] do
- printn "_"
-end
-print ""
-print ""
-
-# draw result
-d = max_len - len_res
-var line_res = ""
-for i in [0..d[ do line_res += " "
-line_res += result.to_s
-line_res.draw( disp_char, disp_size, disp_gap, false )
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2013 Alexis Laferrière <alexis.laf@xymus.net>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Example using the privileges module to drop privileges from root
-module drop_privileges
-
-import privileges
-
-# basic command line options
-var opts = new OptionContext
-var opt_ug = new OptionUserAndGroup.for_dropping_privileges
-opt_ug.mandatory = true
-opts.add_option(opt_ug)
-
-# parse and check command line options
-opts.parse(args)
-if not opts.errors.is_empty then
- print opts.errors
- print "Usage: drop_privileges [options]"
- opts.usage
- exit 1
-end
-
-# original user
-print "before {sys.uid}:{sys.gid}"
-
-# make the switch
-var user_group = opt_ug.value
-assert user_group != null
-user_group.drop_privileges
-
-# final user
-print "after {sys.uid}:{sys.egid}"
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2012-2013 Alexis Laferrière <alexis.laf@xymus.net>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This module illustrates some uses of the FFI, specifically
-# how to use extern methods. Which means to implement a Nit method in C.
-module extern_methods
-
-redef enum Int
- # Returns self'th fibonnaci number
- # implemented here in C for optimization purposes
- fun fib : Int import fib `{
- if ( recv < 2 )
- return recv;
- else
- return Int_fib( recv-1 ) + Int_fib( recv-2 );
- `}
-
- # System call to sleep for "self" seconds
- fun sleep `{
- sleep( recv );
- `}
-
- # Return atan2l( self, x ) from libmath
- fun atan_with( x : Int ) : Float `{
- return atan2( recv, x );
- `}
-
- # This method callback to Nit methods from C code
- # It will use from C code:
- # * the local fib method
- # * the + operator, a method of Int
- # * to_s, a method of all objects
- # * String.to_cstring, a method of String to return an equivalent char*
- fun foo import fib, +, to_s, String.to_cstring `{
- long recv_fib = Int_fib( recv );
- long recv_plus_fib = Int__plus( recv, recv_fib );
-
- String nit_string = Int_to_s( recv_plus_fib );
- char *c_string = String_to_cstring( nit_string );
-
- printf( "from C: self + fib(self) = %s\n", c_string );
- `}
-
- # Equivalent to foo but written in pure Nit
- fun bar do print "from Nit: self + fib(self) = {self+self.fib}"
-end
-
-print 12.fib
-
-print "sleeping 1 second..."
-1.sleep
-
-print 100.atan_with( 200 )
-8.foo
-8.bar
-
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2004-2008 Jean Privat <jean@pryen.org>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# A simple exemple of refinement where a method is added to the integer class.
-module fibonacci
-
-redef class Int
- # Calculate the self-th element of the fibonacci sequence.
- fun fibonacci: Int
- do
- if self < 2 then
- return 1
- else
- return (self-2).fibonacci + (self-1).fibonacci
- end
- end
-end
-
-# Print usage and exit.
-fun usage
-do
- print "Usage: fibonnaci <integer>"
- exit 0
-end
-
-# Main part
-if args.length != 1 then
- usage
-end
-print args.first.to_i.fibonacci
-print "hello world"
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import html
-
-class NitHomepage
- super HTMLPage
-
- redef fun head do
- add("meta").attr("charset", "utf-8")
- add("title").text("Nit")
- add("link").attr("rel", "icon").attr("href", "http://nitlanguage.org/favicon.ico").attr("type", "image/x-icon")
- add("link").attr("rel", "stylesheet").attr("href", "http://nitlanguage.org/style.css").attr("type", "text/css")
- add("link").attr("rel", "stylesheet").attr("href", "http://nitlanguage.org/local.css").attr("type", "text/css")
- end
-
- redef fun body do
- open("article").add_class("page")
- open("section").add_class("pageheader")
- add_html("<a id='toptitle_first' class='toptitle'>the</a><a id='toptitle_second' class='toptitle' href=''>Nit</a><a id='toptitle_third' class='toptitle' href=''>Programming Language</a>")
- open("header").add_class("header")
- open("div").add_class("topsubtitle")
- add("p").text("A Fun Language for Serious Programming")
- close("div")
- close("header")
- close("section")
-
- open("div").attr("id", "pagebody")
- open("section").attr("id", "content")
- add("h1").text("# What is Nit?")
- add("p").text("Nit is an object-oriented programming language. The goal of Nit is to propose a robust statically typed programming language where structure is not a pain.")
- add("p").text("So, what does the famous hello world program look like, in Nit?")
- add_html("<pre><tt><span class='normal'>print </span><span class='string'>'Hello, World!'</span></tt></pre>")
-
- add("h1").text("# Feature Highlights")
- add("h2").text("Usability")
- add("p").text("Nit's goal is to be usable by real programmers for real projects")
-
- open("ul")
- open("li")
- add("a").attr("href", "http://en.wikipedia.org/wiki/KISS_principle").text("KISS principle")
- close("li")
- add("li").text("Script-like language without verbosity nor cryptic statements")
- add("li").text("Painless static types: static typing should help programmers")
- add("li").text("Efficient development, efficient execution, efficient evolution.")
- close("ul")
-
- add("h2").text("Robustness")
- add("p").text("Nit will help you to write bug-free programs")
-
- open("ul")
- add("li").text("Strong static typing")
- add("li").text("No more NullPointerException")
- close("ul")
-
- add("h2").text("Object-Oriented")
- add("p").text("Nit's guideline is to follow the most powerful OO principles")
-
- open("ul")
- open("li")
- add("a").attr("href", "./everything_is_an_object/").text("Everything is an object")
- close("li")
- open("li")
- add("a").attr("href", "./multiple_inheritance/").text("Multiple inheritance")
- close("li")
- open("li")
- add("a").attr("href", "./refinement/").text("Open classes")
- close("li")
- open("li")
- add("a").attr("href", "./virtual_types/").text("Virtual types")
- close("li")
- close("ul")
-
-
- add("h1").text("# Getting Started")
- add("p").text("Get Nit from its Git repository:")
-
- add_html("<pre><code>$ git clone http://nitlanguage.org/nit.git</code></pre>")
- add("p").text("Build the compiler (may be long):")
- add_html("<pre><code>$ cd nit\n")
- add_html("$ make</code></pre>")
- add("p").text("Compile a program:")
- add_html("<pre><code>$ bin/nitc examples/hello_world.nit</code></pre>")
- add("p").text("Execute the program:")
- add_html("<pre><code>$ ./hello_world</code></pre>")
- close("section")
- close("div")
- close("article")
- end
-end
-
-var page = new NitHomepage
-page.write_to stdout
-page.write_to_file("nit.html")
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# An example that defines and uses stacks of integers.
-# The implementation is done with a simple linked list.
-# It features: free constructors, nullable types and some adaptive typing.
-module int_stack
-
-# A stack of integer implemented by a simple linked list.
-# Note that this is only a toy class since a real linked list will gain to use
-# generics and extends interfaces, like Collection, from the standard library.
-class IntStack
- # The head node of the list.
- # Null means that the stack is empty.
- private var head: nullable ISNode = null
-
- # Add a new integer in the stack.
- fun push(val: Int)
- do
- self.head = new ISNode(val, self.head)
- end
-
- # Remove and return the last pushed integer.
- # Return null if the stack is empty.
- fun pop: nullable Int
- do
- var head = self.head
- if head == null then return null
- # Note: the followings are statically safe because of the
- # previous 'if'.
- var val = head.val
- self.head = head.next
- return val
- end
-
- # Return the sum of all integers of the stack.
- # Return 0 if the stack is empty.
- fun sumall: Int
- do
- var sum = 0
- var cur = self.head
- while cur != null do
- # Note: the followings are statically safe because of
- # the condition of the 'while'.
- sum += cur.val
- cur = cur.next
- end
- return sum
- end
-
- # Note: Because all attributes have a default value, a free constructor
- # "init()" is implicitly defined.
-end
-
-# A node of a IntStack
-private class ISNode
- # The integer value stored in the node.
- var val: Int
-
- # The next node, if any.
- var next: nullable ISNode
-
- # Note: A free constructor "init(val: Int, next: nullable ISNode)" is
- # implicitly defined.
-end
-
-var l = new IntStack
-l.push(1)
-l.push(2)
-l.push(3)
-
-print l.sumall
-
-# Note: the 'for' control structure cannot be used on IntStack in its current state.
-# It requires a more advanced topic.
-# However, why not using the 'loop' control structure?
-loop
- var i = l.pop
- if i == null then break
- # The following is statically safe because of the previous 'if'.
- print i * 10
-end
-
-# Note: 'or else' is used to give an alternative of a null expression.
-l.push(5)
-print l.pop or else 0 # l.pop gives 5, so print 5
-print l.pop or else 0 # l.pop gives null, so print the alternative: 0
-
-
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2014 Alexis Laferrière <alexis.laf@xymus.net>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Basic example of OpenGL ES 2.0 usage from the book OpenGL ES 2.0 Programming Guide.
-#
-# Code reference:
-# https://code.google.com/p/opengles-book-samples/source/browse/trunk/LinuxX11/Chapter_2/Hello_Triangle/Hello_Triangle.c
-module opengles2_hello_triangle
-
-import glesv2
-import egl
-import mnit_linux # for sdl
-import x11
-
-if "NIT_TESTING".environ == "true" then exit(0)
-
-var window_width = 800
-var window_height = 600
-
-#
-## SDL
-#
-var sdl_display = new SDLDisplay(window_width, window_height)
-var sdl_wm_info = new SDLSystemWindowManagerInfo
-var x11_window_handle = sdl_wm_info.x11_window_handle
-
-#
-## X11
-#
-var x_display = x_open_default_display
-assert x_display != 0 else print "x11 fail"
-
-#
-## EGL
-#
-var egl_display = new EGLDisplay(x_display)
-assert egl_display.is_valid else print "EGL display is not valid"
-egl_display.initialize
-
-print "EGL version: {egl_display.version}"
-print "EGL vendor: {egl_display.vendor}"
-print "EGL extensions: {egl_display.extensions.join(", ")}"
-print "EGL client APIs: {egl_display.client_apis.join(", ")}"
-
-assert egl_display.is_valid else print egl_display.error
-
-var config_chooser = new EGLConfigChooser
-#config_chooser.surface_type_egl
-config_chooser.blue_size = 8
-config_chooser.green_size = 8
-config_chooser.red_size = 8
-#config_chooser.alpha_size = 8
-#config_chooser.depth_size = 8
-#config_chooser.stencil_size = 8
-#config_chooser.sample_buffers = 1
-config_chooser.close
-
-var configs = config_chooser.choose(egl_display)
-assert configs != null else print "choosing config failed: {egl_display.error}"
-assert not configs.is_empty else print "no EGL config"
-
-print "{configs.length} EGL configs available"
-for config in configs do
- var attribs = config.attribs(egl_display)
- print "* caveats: {attribs.caveat}"
- print " conformant to: {attribs.conformant}"
- print " size of RGBA: {attribs.red_size} {attribs.green_size} {attribs.blue_size} {attribs.alpha_size}"
- print " buffer, depth, stencil: {attribs.buffer_size} {attribs.depth_size} {attribs.stencil_size}"
-end
-
-var config = configs.first
-
-var format = config.attribs(egl_display).native_visual_id
-
-# TODO android part
-# Opengles1Display_midway_init(recv, format);
-
-var surface = egl_display.create_window_surface(config, x11_window_handle, [0])
-assert surface.is_ok else print egl_display.error
-
-var context = egl_display.create_context(config)
-assert context.is_ok else print egl_display.error
-
-var make_current_res = egl_display.make_current(surface, surface, context)
-assert make_current_res
-
-var width = surface.attribs(egl_display).width
-var height = surface.attribs(egl_display).height
-print "Width: {width}"
-print "Height: {height}"
-
-assert egl_bind_opengl_es_api else print "eglBingAPI failed: {egl_display.error}"
-
-#
-## GLESv2
-#
-
-print "Can compile shaders? {gl_shader_compiler}"
-assert_no_gl_error
-
-assert gl_shader_compiler else print "Cannot compile shaders"
-
-# gl program
-print gl_error.to_s
-var program = new GLProgram
-if not program.is_ok then
- print "Program is not ok: {gl_error.to_s}\nLog:"
- print program.info_log
- abort
-end
-assert_no_gl_error
-
-# vertex shader
-var vertex_shader = new GLVertexShader
-assert vertex_shader.is_ok else print "Vertex shader is not ok: {gl_error}"
-vertex_shader.source = """
-attribute vec4 vPosition;
-void main()
-{
- gl_Position = vPosition;
-} """
-vertex_shader.compile
-assert vertex_shader.is_compiled else print "Vertex shader compilation failed with: {vertex_shader.info_log} {program.info_log}"
-assert_no_gl_error
-
-# fragment shader
-var fragment_shader = new GLFragmentShader
-assert fragment_shader.is_ok else print "Fragment shader is not ok: {gl_error}"
-fragment_shader.source = """
-precision mediump float;
-void main()
-{
- gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
-}
-"""
-fragment_shader.compile
-assert fragment_shader.is_compiled else print "Fragment shader compilation failed with: {fragment_shader.info_log}"
-assert_no_gl_error
-
-program.attach_shader vertex_shader
-program.attach_shader fragment_shader
-program.bind_attrib_location(0, "vPosition")
-program.link
-assert program.is_linked else print "Linking failed: {program.info_log}"
-assert_no_gl_error
-
-# draw!
-var vertices = [0.0, 0.5, 0.0, -0.5, -0.5, 0.0, 0.5, -0.5, 0.0]
-var vertex_array = new VertexArray(0, 3, vertices)
-vertex_array.attrib_pointer
-gl_clear_color(0.5, 0.0, 0.5, 1.0)
-for i in [0..10000[ do
- printn "."
- assert_no_gl_error
- gl_viewport(0, 0, width, height)
- gl_clear_color_buffer
- program.use
- vertex_array.enable
- vertex_array.draw_arrays_triangles
- egl_display.swap_buffers(surface)
-end
-
-# delete
-program.delete
-vertex_shader.delete
-fragment_shader.delete
-
-#
-## EGL
-#
-# close
-egl_display.make_current(new EGLSurface.none, new EGLSurface.none, new EGLContext.none)
-egl_display.destroy_context(context)
-egl_display.destroy_surface(surface)
-
-#
-## SDL
-#
-# close
-sdl_display.destroy
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2004-2008 Jean Privat <jean@pryen.org>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# How to print arguments of the command line.
-module print_arguments
-
-for a in args do
- print a
-end
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2004-2008 Jean Privat <jean@pryen.org>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# A procedural program (without explicit class definition).
-# This program manipulates arrays of integers.
-module procedural_array
-
-# The sum of the elements of `a'.
-# Uses a 'for' control structure.
-fun array_sum(a: Array[Int]): Int
-do
- var sum = 0
- for i in a do
- sum = sum + i
- end
- return sum
-end
-
-# The sum of the elements of `a' (alternative version).
-# Uses a 'while' control structure.
-fun array_sum_alt(a: Array[Int]): Int
-do
- var sum = 0
- var i = 0
- while i < a.length do
- sum = sum + a[i]
- i = i + 1
- end
- return sum
-end
-
-# The main part of the program.
-var a = [10, 5, 8, 9]
-print(array_sum(a))
-print(array_sum_alt(a))
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2013 Matthieu Lucas <lucasmatthieu@gmail.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Client sample using the Socket module which connect to the server sample.
-module socket_client
-
-import socket
-
-if args.length < 2 then
- print "Usage : socket_client <host> <port>"
- return
-end
-
-var s = new Socket.client(args[0], args[1].to_i)
-print "[HOST ADDRESS] : {s.address}"
-print "[HOST] : {s.host}"
-print "[PORT] : {s.port}"
-print "Connecting ... {s.connected}"
-if s.connected then
- print "Writing ... Hello server !"
- s.write("Hello server !")
- print "[Response from server] : {s.read(100)}"
- print "Closing ..."
- s.close
-end
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2013 Matthieu Lucas <lucasmatthieu@gmail.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Server sample using the Socket module which allow client to connect
-module socket_server
-
-import socket
-
-if args.is_empty then
- print "Usage : socket_server <port>"
- return
-end
-
-var socket = new Socket.server(args[0].to_i, 1)
-print "[PORT] : {socket.port.to_s}"
-
-var clients = new Array[Socket]
-var max = socket
-loop
- var fs = new SocketObserver(true, true, true)
- fs.readset.set(socket)
-
- for c in clients do fs.readset.set(c)
-
- if fs.select(max, 4, 0) == 0 then
- print "Error occured in select {sys.errno.strerror}"
- break
- end
-
- if fs.readset.is_set(socket) then
- var ns = socket.accept
- print "Accepting {ns.address} ... "
- print "[Message from {ns.address}] : {ns.read(100)}"
- ns.write("Goodbye client.")
- print "Closing {ns.address} ..."
- ns.close
- end
-end
-
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import template
-
-### Here, definition of the specific templates
-
-# The root template for composers
-class TmplComposers
- super Template
-
- # Short list of composers
- var composers = new Array[TmplComposer]
-
- # Detailled list of composers
- var composer_details = new Array[TmplComposerDetail]
-
- # Add a composer in both lists
- fun add_composer(firstname, lastname: String, birth, death: Int)
- do
- composers.add(new TmplComposer(lastname))
- composer_details.add(new TmplComposerDetail(firstname, lastname, birth, death))
- end
-
- redef fun rendering do
- add """
-COMPOSERS
-=========
-"""
- add_all composers
- add """
-
-DETAILS
-=======
-"""
- add_all composer_details
- end
-end
-
-# A composer in the short list of composers
-class TmplComposer
- super Template
-
- # Short name
- var name: String
-
- init(name: String) do self.name = name
-
- redef fun rendering do add "- {name}\n"
-end
-
-# A composer in the detailled list of composers
-class TmplComposerDetail
- super Template
-
- var firstname: String
- var lastname: String
- var birth: Int
- var death: Int
-
- init(firstname, lastname: String, birth, death: Int) do
- self.firstname = firstname
- self.lastname = lastname
- self.birth = birth
- self.death = death
- end
-
- redef fun rendering do add """
-
-COMPOSER: {{{firstname}}} {{{lastname}}}
-BIRTH...: {{{birth}}}
-DEATH...: {{{death}}}
-"""
-
-end
-
-### Here a simple usage of the templates
-
-var f = new TmplComposers
-f.add_composer("Johann Sebastian", "Bach", 1685, 1750)
-f.add_composer("George Frideric", "Handel", 1685, 1759)
-f.add_composer("Wolfgang Amadeus", "Mozart", 1756, 1791)
-f.write_to(stdout)
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2014 Lucas Bajolet <r4pass@hotmail.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Sample module for a minimal chat server using Websockets on port 8088
-module websocket_server
-
-import websocket
-
-var sock = new WebSocket(8088, 1)
-
-var msg: String
-
-if sock.listener.eof then
- print sys.errno.strerror
-end
-
-sock.accept
-
-while not sock.listener.eof do
- if not sock.connected then sock.accept
- if sys.stdin.poll_in then
- msg = gets
- printn "Received message : {msg}"
- if msg == "exit" then sock.close
- if msg == "disconnect" then sock.disconnect_client
- sock.write(msg)
- end
- if sock.can_read(10) then
- msg = sock.read_line
- if msg != "" then print msg
- end
-end
-
diff --git a/tests/examplefiles/antlr_ANTLRv3.g b/tests/examplefiles/antlr_ANTLRv3.g
deleted file mode 100644
index fbe6d654..00000000
--- a/tests/examplefiles/antlr_ANTLRv3.g
+++ /dev/null
@@ -1,608 +0,0 @@
-/*
- [The "BSD licence"]
- Copyright (c) 2005-2007 Terence Parr
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/** ANTLR v3 grammar written in ANTLR v3 with AST construction */
-grammar ANTLRv3;
-
-options {
- output=AST;
- ASTLabelType=CommonTree;
-}
-
-tokens {
- DOC_COMMENT;
- PARSER;
- LEXER;
- RULE;
- BLOCK;
- OPTIONAL;
- CLOSURE;
- POSITIVE_CLOSURE;
- SYNPRED;
- RANGE;
- CHAR_RANGE;
- EPSILON;
- ALT;
- EOR;
- EOB;
- EOA; // end of alt
- ID;
- ARG;
- ARGLIST;
- RET;
- LEXER_GRAMMAR;
- PARSER_GRAMMAR;
- TREE_GRAMMAR;
- COMBINED_GRAMMAR;
- INITACTION;
- LABEL; // $x used in rewrite rules
- TEMPLATE;
- SCOPE='scope';
- SEMPRED;
- GATED_SEMPRED; // {p}? =>
- SYN_SEMPRED; // (...) => it's a manually-specified synpred converted to sempred
- BACKTRACK_SEMPRED; // auto backtracking mode syn pred converted to sempred
- FRAGMENT='fragment';
- TREE_BEGIN='^(';
- ROOT='^';
- BANG='!';
- RANGE='..';
- REWRITE='->';
-}
-
-@members {
- int gtype;
-}
-
-grammarDef
- : DOC_COMMENT?
- ( 'lexer' {gtype=LEXER_GRAMMAR;} // pure lexer
- | 'parser' {gtype=PARSER_GRAMMAR;} // pure parser
- | 'tree' {gtype=TREE_GRAMMAR;} // a tree parser
- | {gtype=COMBINED_GRAMMAR;} // merged parser/lexer
- )
- g='grammar' id ';' optionsSpec? tokensSpec? attrScope* action*
- rule+
- EOF
- -> ^( {adaptor.create(gtype,$g)}
- id DOC_COMMENT? optionsSpec? tokensSpec? attrScope* action* rule+
- )
- ;
-
-tokensSpec
- : TOKENS tokenSpec+ '}' -> ^(TOKENS tokenSpec+)
- ;
-
-tokenSpec
- : TOKEN_REF
- ( '=' (lit=STRING_LITERAL|lit=CHAR_LITERAL) -> ^('=' TOKEN_REF $lit)
- | -> TOKEN_REF
- )
- ';'
- ;
-
-attrScope
- : 'scope' id ACTION -> ^('scope' id ACTION)
- ;
-
-/** Match stuff like @parser::members {int i;} */
-action
- : '@' (actionScopeName '::')? id ACTION -> ^('@' actionScopeName? id ACTION)
- ;
-
-/** Sometimes the scope names will collide with keywords; allow them as
- * ids for action scopes.
- */
-actionScopeName
- : id
- | l='lexer' -> ID[$l]
- | p='parser' -> ID[$p]
- ;
-
-optionsSpec
- : OPTIONS (option ';')+ '}' -> ^(OPTIONS option+)
- ;
-
-option
- : id '=' optionValue -> ^('=' id optionValue)
- ;
-
-optionValue
- : id
- | STRING_LITERAL
- | CHAR_LITERAL
- | INT
- | s='*' -> STRING_LITERAL[$s] // used for k=*
- ;
-
-rule
-scope {
- String name;
-}
- : DOC_COMMENT?
- ( modifier=('protected'|'public'|'private'|'fragment') )?
- id {$rule::name = $id.text;}
- '!'?
- ( arg=ARG_ACTION )?
- ( 'returns' rt=ARG_ACTION )?
- throwsSpec? optionsSpec? ruleScopeSpec? ruleAction*
- ':' altList ';'
- exceptionGroup?
- -> ^( RULE id {modifier!=null?adaptor.create(modifier):null} ^(ARG $arg)? ^(RET $rt)?
- optionsSpec? ruleScopeSpec? ruleAction*
- altList
- exceptionGroup?
- EOR["EOR"]
- )
- ;
-
-/** Match stuff like @init {int i;} */
-ruleAction
- : '@' id ACTION -> ^('@' id ACTION)
- ;
-
-throwsSpec
- : 'throws' id ( ',' id )* -> ^('throws' id+)
- ;
-
-ruleScopeSpec
- : 'scope' ACTION -> ^('scope' ACTION)
- | 'scope' id (',' id)* ';' -> ^('scope' id+)
- | 'scope' ACTION
- 'scope' id (',' id)* ';'
- -> ^('scope' ACTION id+ )
- ;
-
-block
- : lp='('
- ( (opts=optionsSpec)? ':' )?
- a1=alternative rewrite ( '|' a2=alternative rewrite )*
- rp=')'
- -> ^( BLOCK[$lp,"BLOCK"] optionsSpec? alternative+ EOB[$rp,"EOB"] )
- ;
-
-altList
-@init {
- // must create root manually as it's used by invoked rules in real antlr tool.
- // leave here to demonstrate use of {...} in rewrite rule
- // it's really BLOCK[firstToken,"BLOCK"]; set line/col to previous ( or : token.
- CommonTree blkRoot = (CommonTree)adaptor.create(BLOCK,input.LT(-1),"BLOCK");
-}
- : a1=alternative rewrite ( '|' a2=alternative rewrite )*
- -> ^( {blkRoot} (alternative rewrite?)+ EOB["EOB"] )
- ;
-
-alternative
-@init {
- Token firstToken = input.LT(1);
- Token prevToken = input.LT(-1); // either : or | I think
-}
- : element+ -> ^(ALT[firstToken,"ALT"] element+ EOA["EOA"])
- | -> ^(ALT[prevToken,"ALT"] EPSILON[prevToken,"EPSILON"] EOA["EOA"])
- ;
-
-exceptionGroup
- : ( exceptionHandler )+ ( finallyClause )?
- | finallyClause
- ;
-
-exceptionHandler
- : 'catch' ARG_ACTION ACTION -> ^('catch' ARG_ACTION ACTION)
- ;
-
-finallyClause
- : 'finally' ACTION -> ^('finally' ACTION)
- ;
-
-element
- : elementNoOptionSpec
- ;
-
-elementNoOptionSpec
- : id (labelOp='='|labelOp='+=') atom
- ( ebnfSuffix -> ^( ebnfSuffix ^(BLOCK["BLOCK"] ^(ALT["ALT"] ^($labelOp id atom) EOA["EOA"]) EOB["EOB"]))
- | -> ^($labelOp id atom)
- )
- | id (labelOp='='|labelOp='+=') block
- ( ebnfSuffix -> ^( ebnfSuffix ^(BLOCK["BLOCK"] ^(ALT["ALT"] ^($labelOp id block) EOA["EOA"]) EOB["EOB"]))
- | -> ^($labelOp id block)
- )
- | atom
- ( ebnfSuffix -> ^(BLOCK["BLOCK"] ^(ALT["ALT"] atom EOA["EOA"]) EOB["EOB"])
- | -> atom
- )
- | ebnf
- | ACTION
- | SEMPRED ( '=>' -> GATED_SEMPRED | -> SEMPRED )
- | treeSpec
- ;
-
-atom: range ( (op='^'|op='!') -> ^($op range) | -> range )
- | terminal
- | notSet ( (op='^'|op='!') -> ^($op notSet) | -> notSet )
- | RULE_REF ( arg=ARG_ACTION )? ( (op='^'|op='!') )?
- -> {$arg!=null&&op!=null}? ^($op RULE_REF $arg)
- -> {$arg!=null}? ^(RULE_REF $arg)
- -> {$op!=null}? ^($op RULE_REF)
- -> RULE_REF
- ;
-
-notSet
- : '~'
- ( notTerminal -> ^('~' notTerminal)
- | block -> ^('~' block)
- )
- ;
-
-treeSpec
- : '^(' element ( element )+ ')' -> ^(TREE_BEGIN element+)
- ;
-
-/** Matches ENBF blocks (and token sets via block rule) */
-ebnf
-@init {
- Token firstToken = input.LT(1);
-}
-@after {
- $ebnf.tree.getToken().setLine(firstToken.getLine());
- $ebnf.tree.getToken().setCharPositionInLine(firstToken.getCharPositionInLine());
-}
- : block {Token op=input.LT(1);}
- ( '?' -> ^(OPTIONAL[op] block)
- | '*' -> ^(CLOSURE[op] block)
- | '+' -> ^(POSITIVE_CLOSURE[op] block)
- | '^' -> ^('^' block)
- | '!' -> ^('!' block)
- | '=>' // syntactic predicate
- -> {gtype==COMBINED_GRAMMAR &&
- Character.isUpperCase($rule::name.charAt(0))}?
- // if lexer rule in combined, leave as pred for lexer
- ^(SYNPRED["=>"] block)
- // in real antlr tool, text for SYN_SEMPRED is predname
- -> SYN_SEMPRED
- | -> block
- )
- ;
-
-range!
- : c1=CHAR_LITERAL RANGE c2=CHAR_LITERAL -> ^(CHAR_RANGE[$c1,".."] $c1 $c2)
- ;
-
-terminal
- : ( CHAR_LITERAL -> CHAR_LITERAL
- // Args are only valid for lexer rules
- | TOKEN_REF
- ( ARG_ACTION -> ^(TOKEN_REF ARG_ACTION)
- | -> TOKEN_REF
- )
- | STRING_LITERAL -> STRING_LITERAL
- | '.' -> '.'
- )
- ( '^' -> ^('^' $terminal)
- | '!' -> ^('!' $terminal)
- )?
- ;
-
-notTerminal
- : CHAR_LITERAL
- | TOKEN_REF
- | STRING_LITERAL
- ;
-
-ebnfSuffix
-@init {
- Token op = input.LT(1);
-}
- : '?' -> OPTIONAL[op]
- | '*' -> CLOSURE[op]
- | '+' -> POSITIVE_CLOSURE[op]
- ;
-
-
-
-// R E W R I T E S Y N T A X
-
-rewrite
-@init {
- Token firstToken = input.LT(1);
-}
- : (rew+='->' preds+=SEMPRED predicated+=rewrite_alternative)*
- rew2='->' last=rewrite_alternative
- -> ^($rew $preds $predicated)* ^($rew2 $last)
- |
- ;
-
-rewrite_alternative
- : rewrite_template
- | rewrite_tree_alternative
- | /* empty rewrite */ -> ^(ALT["ALT"] EPSILON["EPSILON"] EOA["EOA"])
- ;
-
-rewrite_template_block
- : lp='(' rewrite_template ')' -> ^(BLOCK[$lp,"BLOCK"] rewrite_template EOB[$lp,"EOB"])
- ;
-
-rewrite_tree_block
- : lp='(' rewrite_tree_alternative ')'
- -> ^(BLOCK[$lp,"BLOCK"] rewrite_tree_alternative EOB[$lp,"EOB"])
- ;
-
-rewrite_tree_alternative
- : rewrite_tree_element+ -> ^(ALT["ALT"] rewrite_tree_element+ EOA["EOA"])
- ;
-
-rewrite_tree_element
- : rewrite_tree_atom
- | rewrite_tree_atom ebnfSuffix
- -> ^( ebnfSuffix ^(BLOCK["BLOCK"] ^(ALT["ALT"] rewrite_tree_atom EOA["EOA"]) EOB["EOB"]))
- | rewrite_tree
- ( ebnfSuffix
- -> ^(BLOCK["BLOCK"] ^(ALT["ALT"] rewrite_tree EOA["EOA"]) EOB["EOB"])
- | -> rewrite_tree
- )
- | rewrite_tree_ebnf
- ;
-
-rewrite_tree_atom
- : CHAR_LITERAL
- | TOKEN_REF ARG_ACTION? -> ^(TOKEN_REF ARG_ACTION?) // for imaginary nodes
- | RULE_REF
- | STRING_LITERAL
- | d='$' id -> LABEL[$d,$id.text] // reference to a label in a rewrite rule
- | ACTION
- ;
-
-rewrite_tree_ebnf
-@init {
- Token firstToken = input.LT(1);
-}
-@after {
- $rewrite_tree_ebnf.tree.getToken().setLine(firstToken.getLine());
- $rewrite_tree_ebnf.tree.getToken().setCharPositionInLine(firstToken.getCharPositionInLine());
-}
- : rewrite_tree_block ebnfSuffix -> ^(ebnfSuffix rewrite_tree_block)
- ;
-
-rewrite_tree
- : '^(' rewrite_tree_atom rewrite_tree_element* ')'
- -> ^(TREE_BEGIN rewrite_tree_atom rewrite_tree_element* )
- ;
-
-/** Build a tree for a template rewrite:
- ^(TEMPLATE (ID|ACTION) ^(ARGLIST ^(ARG ID ACTION) ...) )
- where ARGLIST is always there even if no args exist.
- ID can be "template" keyword. If first child is ACTION then it's
- an indirect template ref
-
- -> foo(a={...}, b={...})
- -> ({string-e})(a={...}, b={...}) // e evaluates to template name
- -> {%{$ID.text}} // create literal template from string (done in ActionTranslator)
- -> {st-expr} // st-expr evaluates to ST
- */
-rewrite_template
- : // -> template(a={...},...) "..." inline template
- {input.LT(1).getText().equals("template")}?
- id lp='(' rewrite_template_args ')'
- st=( DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL )
- -> ^(TEMPLATE[$lp,"TEMPLATE"] id rewrite_template_args $st)
-
- | // -> foo(a={...}, ...)
- rewrite_template_ref
-
- | // -> ({expr})(a={...}, ...)
- rewrite_indirect_template_head
-
- | // -> {...}
- ACTION
- ;
-
-/** -> foo(a={...}, ...) */
-rewrite_template_ref
- : id lp='(' rewrite_template_args ')'
- -> ^(TEMPLATE[$lp,"TEMPLATE"] id rewrite_template_args)
- ;
-
-/** -> ({expr})(a={...}, ...) */
-rewrite_indirect_template_head
- : lp='(' ACTION ')' '(' rewrite_template_args ')'
- -> ^(TEMPLATE[$lp,"TEMPLATE"] ACTION rewrite_template_args)
- ;
-
-rewrite_template_args
- : rewrite_template_arg (',' rewrite_template_arg)*
- -> ^(ARGLIST rewrite_template_arg+)
- | -> ARGLIST
- ;
-
-rewrite_template_arg
- : id '=' ACTION -> ^(ARG[$id.start] id ACTION)
- ;
-
-id : TOKEN_REF -> ID[$TOKEN_REF]
- | RULE_REF -> ID[$RULE_REF]
- ;
-
-// L E X I C A L R U L E S
-
-SL_COMMENT
- : '//'
- ( ' $ANTLR ' SRC // src directive
- | ~('\r'|'\n')*
- )
- '\r'? '\n'
- {$channel=HIDDEN;}
- ;
-
-ML_COMMENT
- : '/*' {if (input.LA(1)=='*') $type=DOC_COMMENT; else $channel=HIDDEN;} .* '*/'
- ;
-
-CHAR_LITERAL
- : '\'' LITERAL_CHAR '\''
- ;
-
-STRING_LITERAL
- : '\'' LITERAL_CHAR LITERAL_CHAR* '\''
- ;
-
-fragment
-LITERAL_CHAR
- : ESC
- | ~('\''|'\\')
- ;
-
-DOUBLE_QUOTE_STRING_LITERAL
- : '"' LITERAL_CHAR* '"'
- ;
-
-DOUBLE_ANGLE_STRING_LITERAL
- : '<<' .* '>>'
- ;
-
-fragment
-ESC : '\\'
- ( 'n'
- | 'r'
- | 't'
- | 'b'
- | 'f'
- | '"'
- | '\''
- | '\\'
- | '>'
- | 'u' XDIGIT XDIGIT XDIGIT XDIGIT
- | . // unknown, leave as it is
- )
- ;
-
-fragment
-XDIGIT :
- '0' .. '9'
- | 'a' .. 'f'
- | 'A' .. 'F'
- ;
-
-INT : '0'..'9'+
- ;
-
-ARG_ACTION
- : NESTED_ARG_ACTION
- ;
-
-fragment
-NESTED_ARG_ACTION :
- '['
- ( options {greedy=false; k=1;}
- : NESTED_ARG_ACTION
- | ACTION_STRING_LITERAL
- | ACTION_CHAR_LITERAL
- | .
- )*
- ']'
- {setText(getText().substring(1, getText().length()-1));}
- ;
-
-ACTION
- : NESTED_ACTION ( '?' {$type = SEMPRED;} )?
- ;
-
-fragment
-NESTED_ACTION :
- '{'
- ( options {greedy=false; k=3;}
- : NESTED_ACTION
- | SL_COMMENT
- | ML_COMMENT
- | ACTION_STRING_LITERAL
- | ACTION_CHAR_LITERAL
- | .
- )*
- '}'
- {$channel = DEFAULT_TOKEN_CHANNEL;}
- ;
-
-fragment
-ACTION_CHAR_LITERAL
- : '\'' (ACTION_ESC|~('\\'|'\'')) '\''
- ;
-
-fragment
-ACTION_STRING_LITERAL
- : '"' (ACTION_ESC|~('\\'|'"'))+ '"'
- ;
-
-fragment
-ACTION_ESC
- : '\\\''
- | '\\"'
- | '\\' ~('\''|'"')
- ;
-
-TOKEN_REF
- : 'A'..'Z' ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*
- ;
-
-RULE_REF
- : 'a'..'z' ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*
- ;
-
-/** Match the start of an options section. Don't allow normal
- * action processing on the {...} as it's not a action.
- */
-OPTIONS
- : 'options' WS_LOOP '{' {$channel=DEFAULT_TOKEN_CHANNEL;} // WS_LOOP sets channel
- ;
-
-TOKENS
- : 'tokens' WS_LOOP '{' {$channel=DEFAULT_TOKEN_CHANNEL;}
- ;
-
-/** Reset the file and line information; useful when the grammar
- * has been generated so that errors are shown relative to the
- * original file like the old C preprocessor used to do.
- */
-fragment
-SRC : 'src' ' ' file=ACTION_STRING_LITERAL ' ' line=INT {$channel=HIDDEN;}
- ;
-
-WS : ( ' '
- | '\t'
- | '\r'? '\n'
- )+
- {$channel=HIDDEN;}
- ;
-
-fragment
-WS_LOOP
- : ( WS
- | SL_COMMENT
- | ML_COMMENT
- )*
- {$channel=HIDDEN;}
- ;
-
diff --git a/tests/examplefiles/antlr_throws b/tests/examplefiles/antlr_throws
deleted file mode 100644
index 816d8914..00000000
--- a/tests/examplefiles/antlr_throws
+++ /dev/null
@@ -1 +0,0 @@
-public f throws a, b, c : x ;
diff --git a/tests/examplefiles/apache2.conf b/tests/examplefiles/apache2.conf
deleted file mode 100644
index 5db66b10..00000000
--- a/tests/examplefiles/apache2.conf
+++ /dev/null
@@ -1,398 +0,0 @@
-# Based upon the NCSA server configuration files originally by Rob McCool.
-# Changed extensively for the Debian package by Daniel Stone <daniel@sfarc.net>
-# and also by Thom May <thom@debian.org>.
-
-# ServerRoot: The top of the directory tree under which the server's
-# configuration, error, and log files are kept.
-#
-# NOTE! If you intend to place this on an NFS (or otherwise network)
-# mounted filesystem then please read the LockFile documentation
-# (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
-# you will save yourself a lot of trouble.
-
-ServerRoot "/etc/apache2"
-
-# The LockFile directive sets the path to the lockfile used when Apache
-# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
-# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
-# its default value. The main reason for changing it is if the logs
-# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
-# DISK. The PID of the main server process is automatically appended to
-# the filename.
-
-LockFile /var/lock/apache2/accept.lock
-
-# PidFile: The file in which the server should record its process
-# identification number when it starts.
-
-PidFile /var/run/apache2.pid
-
-# Timeout: The number of seconds before receives and sends time out.
-
-Timeout 300
-
-# KeepAlive: Whether or not to allow persistent connections (more than
-# one request per connection). Set to "Off" to deactivate.
-
-KeepAlive On
-
-# MaxKeepAliveRequests: The maximum number of requests to allow
-# during a persistent connection. Set to 0 to allow an unlimited amount.
-# We recommend you leave this number high, for maximum performance.
-
-MaxKeepAliveRequests 100
-
-# KeepAliveTimeout: Number of seconds to wait for the next request from the
-# same client on the same connection.
-
-KeepAliveTimeout 15
-
-##
-## Server-Pool Size Regulation (MPM specific)
-##
-
-# prefork MPM
-# StartServers ......... number of server processes to start
-# MinSpareServers ...... minimum number of server processes which are kept spare
-# MaxSpareServers ...... maximum number of server processes which are kept spare
-# MaxClients ........... maximum number of server processes allowed to start
-# MaxRequestsPerChild .. maximum number of requests a server process serves
-<IfModule prefork.c>
-StartServers 5
-MinSpareServers 5
-MaxSpareServers 10
-MaxClients 20
-MaxRequestsPerChild 0
-</IfModule>
-
-# pthread MPM
-# StartServers ......... initial number of server processes to start
-# MaxClients ........... maximum number of server processes allowed to start
-# MinSpareThreads ...... minimum number of worker threads which are kept spare
-# MaxSpareThreads ...... maximum number of worker threads which are kept spare
-# ThreadsPerChild ...... constant number of worker threads in each server process
-# MaxRequestsPerChild .. maximum number of requests a server process serves
-<IfModule worker.c>
-StartServers 2
-MaxClients 150
-MinSpareThreads 25
-MaxSpareThreads 75
-ThreadsPerChild 25
-MaxRequestsPerChild 0
-</IfModule>
-
-# perchild MPM
-# NumServers ........... constant number of server processes
-# StartThreads ......... initial number of worker threads in each server process
-# MinSpareThreads ...... minimum number of worker threads which are kept spare
-# MaxSpareThreads ...... maximum number of worker threads which are kept spare
-# MaxThreadsPerChild ... maximum number of worker threads in each server process
-# MaxRequestsPerChild .. maximum number of connections per server process (then it dies)
-<IfModule perchild.c>
-NumServers 5
-StartThreads 5
-MinSpareThreads 5
-MaxSpareThreads 10
-MaxThreadsPerChild 20
-MaxRequestsPerChild 0
-AcceptMutex fcntl
-</IfModule>
-
-User www-data
-Group www-data
-
-# The following directives define some format nicknames for use with
-# a CustomLog directive (see below).
-LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
-LogFormat "%h %l %u %t \"%r\" %>s %b" common
-LogFormat "%{Referer}i -> %U" referer
-LogFormat "%{User-agent}i" agent
-
-
-# Global error log.
-ErrorLog /var/log/apache2/error.log
-
-# Include module configuration:
-Include /etc/apache2/mods-enabled/*.load
-Include /etc/apache2/mods-enabled/*.conf
-
-# Include all the user configurations:
-Include /etc/apache2/httpd.conf
-
-# Include ports listing
-Include /etc/apache2/ports.conf
-
-# Include generic snippets of statements
-Include /etc/apache2/conf.d/[^.#]*
-
-#Let's have some Icons, shall we?
-Alias /icons/ "/usr/share/apache2/icons/"
-<Directory "/usr/share/apache2/icons">
- Options Indexes MultiViews
- AllowOverride None
- Order allow,deny
- Allow from all
-</Directory>
-
-# Set up the default error docs.
-#
-# Customizable error responses come in three flavors:
-# 1) plain text 2) local redirects 3) external redirects
-#
-# Some examples:
-#ErrorDocument 500 "The server made a boo boo."
-#ErrorDocument 404 /missing.html
-#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
-#ErrorDocument 402 http://www.example.com/subscription_info.html
-#
-
-#
-# Putting this all together, we can Internationalize error responses.
-#
-# We use Alias to redirect any /error/HTTP_<error>.html.var response to
-# our collection of by-error message multi-language collections. We use
-# includes to substitute the appropriate text.
-#
-# You can modify the messages' appearance without changing any of the
-# default HTTP_<error>.html.var files by adding the line;
-#
-# Alias /error/include/ "/your/include/path/"
-#
-# which allows you to create your own set of files by starting with the
-# /usr/local/apache2/error/include/ files and
-# copying them to /your/include/path/, even on a per-VirtualHost basis.
-#
-
-<IfModule mod_negotiation.c>
-<IfModule mod_include.c>
- Alias /error/ "/usr/share/apache2/error/"
-
- <Directory "/usr/share/apache2/error">
- AllowOverride None
- Options IncludesNoExec
- AddOutputFilter Includes html
- AddHandler type-map var
- Order allow,deny
- Allow from all
- LanguagePriority en es de fr
- ForceLanguagePriority Prefer Fallback
- </Directory>
-
- ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
- ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
- ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
- ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
- ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
- ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
- ErrorDocument 410 /error/HTTP_GONE.html.var
- ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
- ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
- ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
- ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
- ErrorDocument 415 /error/HTTP_SERVICE_UNAVAILABLE.html.var
- ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
- ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
- ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
- ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
- ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
-
-</IfModule>
-</IfModule>
-
-DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
-
-# UserDir is now a module
-#UserDir public_html
-#UserDir disabled root
-
-#<Directory /home/*/public_html>
-# AllowOverride FileInfo AuthConfig Limit
-# Options Indexes SymLinksIfOwnerMatch IncludesNoExec
-#</Directory>
-
-AccessFileName .htaccess
-
-<Files ~ "^\.ht">
- Order allow,deny
- Deny from all
-</Files>
-
-UseCanonicalName Off
-
-TypesConfig /etc/mime.types
-DefaultType text/plain
-
-HostnameLookups Off
-
-IndexOptions FancyIndexing VersionSort
-
-AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
-
-AddIconByType (TXT,/icons/text.gif) text/*
-AddIconByType (IMG,/icons/image2.gif) image/*
-AddIconByType (SND,/icons/sound2.gif) audio/*
-AddIconByType (VID,/icons/movie.gif) video/*
-
-# This really should be .jpg.
-
-AddIcon /icons/binary.gif .bin .exe
-AddIcon /icons/binhex.gif .hqx
-AddIcon /icons/tar.gif .tar
-AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
-AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
-AddIcon /icons/a.gif .ps .ai .eps
-AddIcon /icons/layout.gif .html .shtml .htm .pdf
-AddIcon /icons/text.gif .txt
-AddIcon /icons/c.gif .c
-AddIcon /icons/p.gif .pl .py
-AddIcon /icons/f.gif .for
-AddIcon /icons/dvi.gif .dvi
-AddIcon /icons/uuencoded.gif .uu
-AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
-AddIcon /icons/tex.gif .tex
-AddIcon /icons/bomb.gif core
-
-AddIcon /icons/back.gif ..
-AddIcon /icons/hand.right.gif README
-AddIcon /icons/folder.gif ^^DIRECTORY^^
-AddIcon /icons/blank.gif ^^BLANKICON^^
-
-
-# This is from Matty J's patch. Anyone want to make the icons?
-#AddIcon /icons/dirsymlink.jpg ^^SYMDIR^^
-#AddIcon /icons/symlink.jpg ^^SYMLINK^^
-
-DefaultIcon /icons/unknown.gif
-
-ReadmeName README.html
-HeaderName HEADER.html
-
-IndexIgnore .??* *~ *# HEADER* RCS CVS *,t
-
-AddEncoding x-compress Z
-AddEncoding x-gzip gz tgz
-
-AddLanguage da .dk
-AddLanguage nl .nl
-AddLanguage en .en
-AddLanguage et .et
-AddLanguage fr .fr
-AddLanguage de .de
-AddLanguage el .el
-AddLanguage it .it
-AddLanguage ja .ja
-AddLanguage pl .po
-AddLanguage ko .ko
-AddLanguage pt .pt
-AddLanguage no .no
-AddLanguage pt-br .pt-br
-AddLanguage ltz .ltz
-AddLanguage ca .ca
-AddLanguage es .es
-AddLanguage sv .se
-AddLanguage cz .cz
-AddLanguage ru .ru
-AddLanguage tw .tw
-AddLanguage zh-tw .tw
-
-LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw
-
-
-#AddDefaultCharset ISO-8859-1
-
-AddCharset ISO-8859-1 .iso8859-1 .latin1
-AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
-AddCharset ISO-8859-3 .iso8859-3 .latin3
-AddCharset ISO-8859-4 .iso8859-4 .latin4
-AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
-AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
-AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
-AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
-AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
-AddCharset ISO-2022-JP .iso2022-jp .jis
-AddCharset ISO-2022-KR .iso2022-kr .kis
-AddCharset ISO-2022-CN .iso2022-cn .cis
-AddCharset Big5 .Big5 .big5
-# For russian, more than one charset is used (depends on client, mostly):
-AddCharset WINDOWS-1251 .cp-1251 .win-1251
-AddCharset CP866 .cp866
-AddCharset KOI8-r .koi8-r .koi8-ru
-AddCharset KOI8-ru .koi8-uk .ua
-AddCharset ISO-10646-UCS-2 .ucs2
-AddCharset ISO-10646-UCS-4 .ucs4
-AddCharset UTF-8 .utf8
-
-AddCharset GB2312 .gb2312 .gb
-AddCharset utf-7 .utf7
-AddCharset utf-8 .utf8
-AddCharset big5 .big5 .b5
-AddCharset EUC-TW .euc-tw
-AddCharset EUC-JP .euc-jp
-AddCharset EUC-KR .euc-kr
-AddCharset shift_jis .sjis
-
-#AddType application/x-httpd-php .php
-#AddType application/x-httpd-php-source .phps
-
-AddType application/x-tar .tgz
-
-# To use CGI scripts outside /cgi-bin/:
-#
-#AddHandler cgi-script .cgi
-
-# To use server-parsed HTML files
-#
-<FilesMatch "\.shtml(\..+)?$">
- SetOutputFilter INCLUDES
-</FilesMatch>
-
-# If you wish to use server-parsed imagemap files, use
-#
-#AddHandler imap-file map
-
-BrowserMatch "Mozilla/2" nokeepalive
-BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
-BrowserMatch "RealPlayer 4\.0" force-response-1.0
-BrowserMatch "Java/1\.0" force-response-1.0
-BrowserMatch "JDK/1\.0" force-response-1.0
-
-#
-# The following directive disables redirects on non-GET requests for
-# a directory that does not include the trailing slash. This fixes a
-# problem with Microsoft WebFolders which does not appropriately handle
-# redirects for folders with DAV methods.
-#
-
-BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
-BrowserMatch "^WebDrive" redirect-carefully
-BrowserMatch "^gnome-vfs" redirect-carefully
-BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
-
-# Allow server status reports, with the URL of http://servername/server-status
-# Change the ".your_domain.com" to match your domain to enable.
-#
-#<Location /server-status>
-# SetHandler server-status
-# Order deny,allow
-# Deny from all
-# Allow from .your_domain.com
-#</Location>
-
-# Allow remote server configuration reports, with the URL of
-# http://servername/server-info (requires that mod_info.c be loaded).
-# Change the ".your_domain.com" to match your domain to enable.
-#
-#<Location /server-info>
-# SetHandler server-info
-# Order deny,allow
-# Deny from all
-# Allow from .your_domain.com
-#</Location>
-
-# Include the virtual host configurations:
-Include /etc/apache2/sites-enabled/[^.#]*
-
-# From PR#766
-<IfVersion >= 2.4>
-ErrorLogFormat "%{cu}t %M"
-</IfVersion> \ No newline at end of file
diff --git a/tests/examplefiles/as3_test.as b/tests/examplefiles/as3_test.as
deleted file mode 100644
index d6b08424..00000000
--- a/tests/examplefiles/as3_test.as
+++ /dev/null
@@ -1,143 +0,0 @@
- import flash.events.MouseEvent;
- import com.example.programmingas3.playlist.PlayList;
- import com.example.programmingas3.playlist.Song;
- import com.example.programmingas3.playlist.SortProperty;
-
- // constants for the different "states" of the song form
- private static const ADD_SONG:uint = 1;
- private static const SONG_DETAIL:uint = 2;
-
- private var playList:PlayList = new PlayList.<T>();
-
- private function initApp():void
- {
- // set the initial state of the song form, for adding a new song
- setFormState(ADD_SONG);
-
- // prepopulate the list with a few songs
- playList.addSong(new Song("Nessun Dorma", "Luciano Pavarotti", 1990, "nessundorma.mp3", ["90's", "Opera"]));
- playList.addSong(new Song("Come Undone", "Duran Duran", 1993, "comeundone.mp3", ["90's", "Pop"]));
- playList.addSong(new Song("Think of Me", "Sarah Brightman", 1987, "thinkofme.mp3", ["Showtunes"]));
- playList.addSong(new Song("Unbelievable", "EMF", 1991, "unbelievable.mp3", ["90's", "Pop"]));
-
- songList.dataProvider = playList.songList;
- }
-
-
- private function sortList(sortField:SortProperty.<T>):void
- {
- // Make all the sort type buttons enabled.
- // The active one will be grayed-out below
- sortByTitle.selected = false;
- sortByArtist.selected = false;
- sortByYear.selected = false;
-
- switch (sortField)
- {
- case SortProperty.TITLE:
- sortByTitle.selected = true;
- break;
- case SortProperty.ARTIST:
- sortByArtist.selected = true;
- break;
- case SortProperty.YEAR:
- sortByYear.selected = true;
- break;
- }
-
- playList.sortList(sortField);
-
- refreshList();
- }
-
-
- private function refreshList():void
- {
- // remember which song was selected
- var selectedSong:Song = Song(songList.selectedItem);
-
- // re-assign the song list as the dataprovider to get the newly sorted list
- // and force the List control to refresh itself
- songList.dataProvider = playList.songList;
-
- // reset the song selection
- if (selectedSong != null)
- {
- songList.selectedItem = selectedSong;
- }
- }
-
-
- private function songSelectionChange():void
- {
- if (songList.selectedIndex != -1)
- {
- setFormState(SONG_DETAIL);
- }
- else
- {
- setFormState(ADD_SONG);
- }
- }
-
-
- private function addNewSong():void
- {
- // gather the values from the form and add the new song
- var title:String = newSongTitle.text;
- var artist:String = newSongArtist.text;
- var year:uint = newSongYear.value;
- var filename:String = newSongFilename.text;
- var genres:Array = newSongGenres.selectedItems;
-
- playList.addSong(new Song(title, artist, year, filename, genres));
-
- refreshList();
-
- // clear out the "add song" form fields
- setFormState(ADD_SONG);
- }
-
-
- private function songListLabel(item:Object):String
- {
- return item.toString();
- }
-
-
- private function setFormState(state:uint):void
- {
- // set the form title and control state
- switch (state)
- {
- case ADD_SONG:
- formTitle.text = "Add New Song";
- // show the submit button
- submitSongData.visible = true;
- showAddControlsBtn.visible = false;
- // clear the form fields
- newSongTitle.text = "";
- newSongArtist.text = "";
- newSongYear.value = (new Date()).fullYear;
- newSongFilename.text = "";
- newSongGenres.selectedIndex = -1;
- // deselect the currently selected song (if any)
- songList.selectedIndex = -1;
- break;
-
- case SONG_DETAIL:
- formTitle.text = "Song Details";
- // populate the form with the selected item's data
- var selectedSong:Song = Song(songList.selectedItem);
- newSongTitle.text = selectedSong.title;
- newSongArtist.text = selectedSong.artist;
- newSongYear.value = selectedSong.year;
- newSongFilename.text = selectedSong.filename;
- newSongGenres.selectedItems = selectedSong.genres;
- // hide the submit button
- submitSongData.visible = false;
- showAddControlsBtn.visible = true;
- break;
- }
- }
-
diff --git a/tests/examplefiles/as3_test2.as b/tests/examplefiles/as3_test2.as
deleted file mode 100644
index 630ea729..00000000
--- a/tests/examplefiles/as3_test2.as
+++ /dev/null
@@ -1,46 +0,0 @@
-package ru.dfls.events {
- import flash.events.Event;
- import flash.events.ErrorEvent;
-
- /**
- * This event is usually dispatched if some error was thrown from an asynchronous code, i.e. there
- * is no relevant user stack part to process the error. There is only one type of such event:
- * <code>ErrorEvent.ERROR</code> which is same as <code>flash.events.ErrorEvent.ERROR</code>.
- * The only difference between <code>flash.events.ErrorEvent</code> and
- * <code>ru.dfls.events.ErrorEvent</code> is the capability of the latter to store the underlying cause
- * (the <code>Error</code>).
- *
- * @see flash.events.ErrorEvent
- * @see Error
- * @author dragonfly
- */
- public class ErrorEvent extends flash.events.ErrorEvent {
-
- public static var ERROR : String = flash.events.ErrorEvent.ERROR;
-
- private var _error : Error;
-
- public function ErrorEvent(type : String, bubbles : Boolean = false, cancelable : Boolean = false,
- text : String = "", error : Error = null) {
- super(type, bubbles, cancelable, text);
- _error = error;
- }
-
- public function get error() : Error {
- return _error;
- }
-
- public function set error(value : Error) : void {
- _error = value;
- }
-
- public override function toString() : String {
- return formatToString("ErrorEvent", "type", "bubbles", "cancelable", "eventPhase", "text", "error");
- }
-
- public override function clone() : Event {
- return new ru.dfls.events.ErrorEvent(type, bubbles, cancelable, text, error);
- }
-
- }
-}
diff --git a/tests/examplefiles/as3_test3.as b/tests/examplefiles/as3_test3.as
deleted file mode 100644
index b6954863..00000000
--- a/tests/examplefiles/as3_test3.as
+++ /dev/null
@@ -1,3 +0,0 @@
-protected function remote(method : String, ...args : Array) : Boolean {
- return true;
-}
diff --git a/tests/examplefiles/aspx-cs_example b/tests/examplefiles/aspx-cs_example
deleted file mode 100644
index 01de00e4..00000000
--- a/tests/examplefiles/aspx-cs_example
+++ /dev/null
@@ -1,27 +0,0 @@
-<%@ Page Language="C#" %>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<script runat="server">
-
- protected void Page_Load(object sender, EventArgs e)
- {
- Label1.Text = DateTime.Now.ToLongDateString();
- }
-
-</script>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head runat="server">
- <title>Sample page</title>
-</head>
-<body>
- <form id="form1" runat="server">
- <div>
- The current time is: <asp:Label runat="server" id="Label1" />
- </div>
- </form>
-
-</body>
-</html>
diff --git a/tests/examplefiles/autoit_submit.au3 b/tests/examplefiles/autoit_submit.au3
deleted file mode 100644
index 84fb7150..00000000
--- a/tests/examplefiles/autoit_submit.au3
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <IE.au3>
-;http://msdn.microsoft.com/en-us/library/Aa752084.aspx
-$ourl="http://localhost:5000/"
-
-$oIE = _IEAttach ($ourl,"url")
-If @error = $_IEStatus_NoMatch Then
- $oIE = _IECreate ($ourl & "sample.html")
-endIf
-
-$oForm = _IEFormGetObjByName ($oIE, "form1")
-;username, call DOM directly
-$oIE.document.getElementById("username").value="helloAutoIT"
-;state select
-$oSelect = _IEFormElementGetObjByName ($oForm, "state")
-_IEFormElementOptionSelect ($oSelect, "S2", 1, "byText")
-;options raido
-_IEFormElementRadioSelect($oForm, "2nd", "type", 1, "byValue")
-
-#cs
-ConsoleWrite(@Error)
-Sleep(10000)
-#ce
-_IEFormSubmit($oForm, 0)
-_IELoadWait($oIE)
-Sleep(60000)
-_IEQuit($oIE)
-
diff --git a/tests/examplefiles/automake.mk b/tests/examplefiles/automake.mk
deleted file mode 100644
index 47a50a38..00000000
--- a/tests/examplefiles/automake.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-if DEBUG
-DBG = debug
-else
-DBG =
-endif
-noinst_PROGRAMS = $(DBG)
-
diff --git a/tests/examplefiles/badcase.java b/tests/examplefiles/badcase.java
deleted file mode 100644
index dc9b2e71..00000000
--- a/tests/examplefiles/badcase.java
+++ /dev/null
@@ -1,2 +0,0 @@
-// this used to take ages
-void foo() throws xxxxxxxxxxxxxxxxxxxxxx{ }
diff --git a/tests/examplefiles/bigtest.nsi b/tests/examplefiles/bigtest.nsi
deleted file mode 100644
index 62f5211c..00000000
--- a/tests/examplefiles/bigtest.nsi
+++ /dev/null
@@ -1,308 +0,0 @@
-; bigtest.nsi
-;
-; This script attempts to test most of the functionality of the NSIS exehead.
-
-;--------------------------------
-
-!ifdef HAVE_UPX
-!packhdr tmp.dat "upx\upx -9 tmp.dat"
-!endif
-
-!ifdef NOCOMPRESS
-SetCompress off
-!endif
-
-;--------------------------------
-
-Name "BigNSISTest"
-Caption "NSIS Big Test"
-Icon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-install.ico"
-OutFile "bigtest.exe"
-
-SetDateSave on
-SetDatablockOptimize on
-CRCCheck on
-SilentInstall normal
-BGGradient 000000 800000 FFFFFF
-InstallColors FF8080 000030
-XPStyle on
-
-InstallDir "$PROGRAMFILES\NSISTest\BigNSISTest"
-InstallDirRegKey HKLM "Software\NSISTest\BigNSISTest" "Install_Dir"
-
-CheckBitmap "${NSISDIR}\Contrib\Graphics\Checks\classic-cross.bmp"
-
-LicenseText "A test text, make sure it's all there"
-LicenseData "bigtest.nsi"
-
-RequestExecutionLevel admin
-
-;--------------------------------
-
-Page license
-Page components
-Page directory
-Page instfiles
-
-UninstPage uninstConfirm
-UninstPage instfiles
-
-;--------------------------------
-
-!ifndef NOINSTTYPES ; only if not defined
- InstType "Most"
- InstType "Full"
- InstType "More"
- InstType "Base"
- ;InstType /NOCUSTOM
- ;InstType /COMPONENTSONLYONCUSTOM
-!endif
-
-AutoCloseWindow false
-ShowInstDetails show
-
-;--------------------------------
-
-Section "" ; empty string makes it hidden, so would starting with -
-
- ; write reg info
- StrCpy $1 "POOOOOOOOOOOP"
- DetailPrint "I like to be able to see what is going on (debug) $1"
- WriteRegStr HKLM SOFTWARE\NSISTest\BigNSISTest "Install_Dir" "$INSTDIR"
-
- ; write uninstall strings
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "DisplayName" "BigNSISTest (remove only)"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "UninstallString" '"$INSTDIR\bt-uninst.exe"'
-
- SetOutPath $INSTDIR
- File /a "silent.nsi"
- CreateDirectory "$INSTDIR\MyProjectFamily\MyProject" ; 2 recursively create a directory for fun.
- WriteUninstaller "bt-uninst.exe"
-
- Nop ; for fun
-
-SectionEnd
-
-Section "TempTest"
-
-SectionIn 1 2 3
- Start: MessageBox MB_OK "Start:"
-
- MessageBox MB_YESNO "Goto MyLabel" IDYES MyLabel
-
- MessageBox MB_OK "Right before MyLabel:"
-
- MyLabel: MessageBox MB_OK "MyLabel:"
-
- MessageBox MB_OK "Right after MyLabel:"
-
- MessageBox MB_YESNO "Goto Start:?" IDYES Start
-
-SectionEnd
-
-SectionGroup /e SectionGroup1
-
-Section "Test Registry/INI functions"
-
-SectionIn 1 4 3
-
- WriteRegStr HKLM SOFTWARE\NSISTest\BigNSISTest "StrTest_INSTDIR" "$INSTDIR"
- WriteRegDword HKLM SOFTWARE\NSISTest\BigNSISTest "DwordTest_0xDEADBEEF" 0xdeadbeef
- WriteRegDword HKLM SOFTWARE\NSISTest\BigNSISTest "DwordTest_123456" 123456
- WriteRegDword HKLM SOFTWARE\NSISTest\BigNSISTest "DwordTest_0123" 0123
- WriteRegBin HKLM SOFTWARE\NSISTest\BigNSISTest "BinTest_deadbeef01f00dbeef" "DEADBEEF01F00DBEEF"
- StrCpy $8 "$SYSDIR\IniTest"
- WriteINIStr "$INSTDIR\test.ini" "MySection" "Value1" $8
- WriteINIStr "$INSTDIR\test.ini" "MySectionIni" "Value1" $8
- WriteINIStr "$INSTDIR\test.ini" "MySectionIni" "Value2" $8
- WriteINIStr "$INSTDIR\test.ini" "IniOn" "Value1" $8
-
- Call MyFunctionTest
-
- DeleteINIStr "$INSTDIR\test.ini" "IniOn" "Value1"
- DeleteINISec "$INSTDIR\test.ini" "MySectionIni"
-
- ReadINIStr $1 "$INSTDIR\test.ini" "MySectionIni" "Value1"
- StrCmp $1 "" INIDelSuccess
- MessageBox MB_OK "DeleteINISec failed"
- INIDelSuccess:
-
- ClearErrors
- ReadRegStr $1 HKCR "software\microsoft" xyz_cc_does_not_exist
- IfErrors 0 NoError
- MessageBox MB_OK "could not read from HKCR\software\microsoft\xyz_cc_does_not_exist"
- Goto ErrorYay
- NoError:
- MessageBox MB_OK "read '$1' from HKCR\software\microsoft\xyz_cc_does_not_exist"
- ErrorYay:
-
-SectionEnd
-
-Section "Test CreateShortCut"
-
- SectionIn 1 2 3
-
- Call CSCTest
-
-SectionEnd
-
-SectionGroup Group2
-
-Section "Test Branching"
-
- BeginTestSection:
- SectionIn 1 2 3
-
- SetOutPath $INSTDIR
-
- IfFileExists "$INSTDIR\LogicLib.nsi" 0 BranchTest69
-
- MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to overwrite $INSTDIR\LogicLib.nsi?" IDNO NoOverwrite ; skipped if file doesn't exist
-
- BranchTest69:
-
- SetOverwrite ifnewer ; NOT AN INSTRUCTION, NOT COUNTED IN SKIPPINGS
-
- NoOverwrite:
-
- File "LogicLib.nsi" ; skipped if answered no
- SetOverwrite try ; NOT AN INSTRUCTION, NOT COUNTED IN SKIPPINGS
-
- MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to skip the rest of this section?" IDYES EndTestBranch
- MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to go back to the beginning of this section?" IDYES BeginTestSection
- MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to hide the installer and wait five seconds?" IDNO NoHide
-
- HideWindow
- Sleep 5000
- BringToFront
-
- NoHide:
-
- MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to call the function 5 times?" IDNO NoRecurse
-
- StrCpy $1 "x"
-
- LoopTest:
-
- Call myfunc
- StrCpy $1 "x$1"
- StrCmp $1 "xxxxxx" 0 LoopTest
-
- NoRecurse:
-
- EndTestBranch:
-
-SectionEnd
-
-SectionGroupEnd
-
-Section "Test CopyFiles"
-
- SectionIn 1 2 3
-
- SetOutPath $INSTDIR\cpdest
- CopyFiles "$WINDIR\*.ini" "$INSTDIR\cpdest" 0
-
-SectionEnd
-
-SectionGroupEnd
-
-Section "Test Exec functions" TESTIDX
-
- SectionIn 1 2 3
-
- SearchPath $1 notepad.exe
-
- MessageBox MB_OK "notepad.exe=$1"
- Exec '"$1"'
- ExecShell "open" '"$INSTDIR"'
- Sleep 500
- BringToFront
-
-SectionEnd
-
-Section "Test ActiveX control registration"
-
- SectionIn 2
-
- UnRegDLL "$SYSDIR\spin32.ocx"
- Sleep 1000
- RegDLL "$SYSDIR\spin32.ocx"
- Sleep 1000
-
-SectionEnd
-
-;--------------------------------
-
-Function "CSCTest"
-
- CreateDirectory "$SMPROGRAMS\Big NSIS Test"
- SetOutPath $INSTDIR ; for working directory
- CreateShortCut "$SMPROGRAMS\Big NSIS Test\Uninstall BIG NSIS Test.lnk" "$INSTDIR\bt-uninst.exe" ; use defaults for parameters, icon, etc.
- ; this one will use notepad's icon, start it minimized, and give it a hotkey (of Ctrl+Shift+Q)
- CreateShortCut "$SMPROGRAMS\Big NSIS Test\silent.nsi.lnk" "$INSTDIR\silent.nsi" "" "$WINDIR\notepad.exe" 0 SW_SHOWMINIMIZED CONTROL|SHIFT|Q
- CreateShortCut "$SMPROGRAMS\Big NSIS Test\TheDir.lnk" "$INSTDIR\" "" "" 0 SW_SHOWMAXIMIZED CONTROL|SHIFT|Z
-
-FunctionEnd
-
-Function myfunc
-
- StrCpy $2 "MyTestVar=$1"
- MessageBox MB_OK "myfunc: $2"
-
-FunctionEnd
-
-Function MyFunctionTest
-
- ReadINIStr $1 "$INSTDIR\test.ini" "MySectionIni" "Value1"
- StrCmp $1 $8 NoFailedMsg
- MessageBox MB_OK "WriteINIStr failed"
-
- NoFailedMsg:
-
-FunctionEnd
-
-Function .onSelChange
-
- SectionGetText ${TESTIDX} $0
- StrCmp $0 "" e
- SectionSetText ${TESTIDX} ""
- Goto e2
-e:
- SectionSetText ${TESTIDX} "TextInSection"
-e2:
-
-FunctionEnd
-
-;--------------------------------
-
-; Uninstaller
-
-UninstallText "This will uninstall example2. Hit next to continue."
-UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-uninstall.ico"
-
-Section "Uninstall"
-
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest"
- DeleteRegKey HKLM "SOFTWARE\NSISTest\BigNSISTest"
- Delete "$INSTDIR\silent.nsi"
- Delete "$INSTDIR\LogicLib.nsi"
- Delete "$INSTDIR\bt-uninst.exe"
- Delete "$INSTDIR\test.ini"
- Delete "$SMPROGRAMS\Big NSIS Test\*.*"
- RMDir "$SMPROGRAMS\BiG NSIS Test"
-
- MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to remove the directory $INSTDIR\cpdest?" IDNO NoDelete
- Delete "$INSTDIR\cpdest\*.*"
- RMDir "$INSTDIR\cpdest" ; skipped if no
- NoDelete:
-
- RMDir "$INSTDIR\MyProjectFamily\MyProject"
- RMDir "$INSTDIR\MyProjectFamily"
- RMDir "$INSTDIR"
-
- IfFileExists "$INSTDIR" 0 NoErrorMsg
- MessageBox MB_OK "Note: $INSTDIR could not be removed!" IDOK 0 ; skipped if file doesn't exist
- NoErrorMsg:
-
-SectionEnd
diff --git a/tests/examplefiles/bnf_example1.bnf b/tests/examplefiles/bnf_example1.bnf
deleted file mode 100644
index fe041a6e..00000000
--- a/tests/examplefiles/bnf_example1.bnf
+++ /dev/null
@@ -1,15 +0,0 @@
-; This examples from WikiPedia <https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form>.
-
- <postal-address> ::= <name-part> <street-address> <zip-part>
-
- <name-part> ::= <personal-part> <last-name> <opt-suffix-part> <EOL>
- | <personal-part> <name-part>
-
- <personal-part> ::= <initial> "." | <first-name>
-
- <street-address> ::= <house-num> <street-name> <opt-apt-num> <EOL>
-
- <zip-part> ::= <town-name> "," <state-code> <ZIP-code> <EOL>
-
- <opt-suffix-part> ::= "Sr." | "Jr." | <roman-numeral> | ""
- <opt-apt-num> ::= <apt-num> | ""
diff --git a/tests/examplefiles/boot-9.scm b/tests/examplefiles/boot-9.scm
deleted file mode 100644
index 1f6ae246..00000000
--- a/tests/examplefiles/boot-9.scm
+++ /dev/null
@@ -1,1557 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 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 software; see the file COPYING. If not, write to
-;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-;;;;
-;;;; As a special exception, the Free Software Foundation gives permission
-;;;; for additional uses of the text contained in its release of GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE library with other files
-;;;; to produce an executable, this does not by itself cause the
-;;;; resulting executable to be covered by the GNU General Public License.
-;;;; Your use of that executable is in no way restricted on account of
-;;;; linking the GUILE library code into it.
-;;;;
-;;;; This exception does not however invalidate any other reasons why
-;;;; the executable file might be covered by the GNU General Public License.
-;;;;
-;;;; This exception applies only to the code released by the
-;;;; Free Software Foundation under the name GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, as the General Public License permits, the exception does
-;;;; not apply to the code that you add in this way. To avoid misleading
-;;;; anyone as to the status of such modified files, you must delete
-;;;; this exception notice from them.
-;;;;
-;;;; If you write modifications of your own for GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-;;; Commentary:
-
-;;; This file is the first thing loaded into Guile. It adds many mundane
-;;; definitions and a few that are interesting.
-;;;
-;;; The module system (hence the hierarchical namespace) are defined in this
-;;; file.
-;;;
-
-;;; Code:
-
-
-;;; {Deprecation}
-;;;
-
-;; We don't have macros here, but we do want to define
-;; `begin-deprecated' early.
-
-(define begin-deprecated
- (procedure->memoizing-macro
- (lambda (exp env)
- (if (include-deprecated-features)
- `(begin ,@(cdr exp))
- `#f))))
-
-
-;;; {Features}
-;;
-
-(define (provide sym)
- (if (not (memq sym *features*))
- (set! *features* (cons sym *features*))))
-
-;;; Return #t iff FEATURE is available to this Guile interpreter.
-;;; In SLIB, provided? also checks to see if the module is available.
-;;; We should do that too, but don't.
-(define (provided? feature)
- (and (memq feature *features*) #t))
-
-(begin-deprecated
- (define (feature? sym)
- (issue-deprecation-warning
- "`feature?' is deprecated. Use `provided?' instead.")
- (provided? sym)))
-
-;;; let format alias simple-format until the more complete version is loaded
-(define format simple-format)
-
-
-;;; {R4RS compliance}
-
-(primitive-load-path "ice-9/r4rs.scm")
-
-
-;;; {Simple Debugging Tools}
-;;
-
-
-;; peek takes any number of arguments, writes them to the
-;; current ouput port, and returns the last argument.
-;; It is handy to wrap around an expression to look at
-;; a value each time is evaluated, e.g.:
-;;
-;; (+ 10 (troublesome-fn))
-;; => (+ 10 (pk 'troublesome-fn-returned (troublesome-fn)))
-;;
-
-(define (peek . stuff)
- (newline)
- (display ";;; ")
- (write stuff)
- (newline)
- (car (last-pair stuff)))
-
-(define pk peek)
-
-(define (warn . stuff)
- (with-output-to-port (current-error-port)
- (lambda ()
- (newline)
- (display ";;; WARNING ")
- (display stuff)
- (newline)
- (car (last-pair stuff)))))
-
-
-;;; {Trivial Functions}
-;;;
-
-(define (identity x) x)
-(define (1+ n) (+ n 1))
-(define (1- n) (+ n -1))
-(define (and=> value procedure) (and value (procedure value)))
-(define (make-hash-table k) (make-vector k '()))
-
-(begin-deprecated
- (define (id x)
- (issue-deprecation-warning "`id' is deprecated. Use `identity' instead.")
- (identity x))
- (define (-1+ n)
- (issue-deprecation-warning "`-1+' is deprecated. Use `1-' instead.")
- (1- n))
- (define (return-it . args)
- (issue-deprecation-warning "`return-it' is deprecated. Use `noop' instead.")
- (apply noop args)))
-
-;;; apply-to-args is functionally redundant with apply and, worse,
-;;; is less general than apply since it only takes two arguments.
-;;;
-;;; On the other hand, apply-to-args is a syntacticly convenient way to
-;;; perform binding in many circumstances when the "let" family of
-;;; of forms don't cut it. E.g.:
-;;;
-;;; (apply-to-args (return-3d-mouse-coords)
-;;; (lambda (x y z)
-;;; ...))
-;;;
-
-(define (apply-to-args args fn) (apply fn args))
-
-
-
-;;; {Integer Math}
-;;;
-
-(define (ipow-by-squaring x k acc proc)
- (cond ((zero? k) acc)
- ((= 1 k) (proc acc x))
- (else (ipow-by-squaring (proc x x)
- (quotient k 2)
- (if (even? k) acc (proc acc x))
- proc))))
-
-(begin-deprecated
- (define (string-character-length s)
- (issue-deprecation-warning "`string-character-length' is deprecated. Use `string-length' instead.")
- (string-length s))
- (define (flags . args)
- (issue-deprecation-warning "`flags' is deprecated. Use `logior' instead.")
- (apply logior args)))
-
-
-;;; {Symbol Properties}
-;;;
-
-(define (symbol-property sym prop)
- (let ((pair (assoc prop (symbol-pref sym))))
- (and pair (cdr pair))))
-
-(define (set-symbol-property! sym prop val)
- (let ((pair (assoc prop (symbol-pref sym))))
- (if pair
- (set-cdr! pair val)
- (symbol-pset! sym (acons prop val (symbol-pref sym))))))
-
-(define (symbol-property-remove! sym prop)
- (let ((pair (assoc prop (symbol-pref sym))))
- (if pair
- (symbol-pset! sym (delq! pair (symbol-pref sym))))))
-
-;;; {General Properties}
-;;;
-
-;; This is a more modern interface to properties. It will replace all
-;; other property-like things eventually.
-
-(define (make-object-property)
- (let ((prop (primitive-make-property #f)))
- (make-procedure-with-setter
- (lambda (obj) (primitive-property-ref prop obj))
- (lambda (obj val) (primitive-property-set! prop obj val)))))
-
-
-
-;;; {Arrays}
-;;;
-
-(if (provided? 'array)
- (primitive-load-path "ice-9/arrays.scm"))
-
-
-;;; {Keywords}
-;;;
-
-(define (symbol->keyword symbol)
- (make-keyword-from-dash-symbol (symbol-append '- symbol)))
-
-(define (keyword->symbol kw)
- (let ((sym (symbol->string (keyword-dash-symbol kw))))
- (string->symbol (substring sym 1 (string-length sym)))))
-
-(define (kw-arg-ref args kw)
- (let ((rem (member kw args)))
- (and rem (pair? (cdr rem)) (cadr rem))))
-
-
-
-;;; {Structs}
-
-(define (struct-layout s)
- (struct-ref (struct-vtable s) vtable-index-layout))
-
-
-
-;;; Environments
-
-(define the-environment
- (procedure->syntax
- (lambda (x e)
- e)))
-
-(define the-root-environment (the-environment))
-
-(define (environment-module env)
- (let ((closure (and (pair? env) (car (last-pair env)))))
- (and closure (procedure-property closure 'module))))
-
-
-;;; {Records}
-;;;
-
-;; Printing records: by default, records are printed as
-;;
-;; #<type-name field1: val1 field2: val2 ...>
-;;
-;; You can change that by giving a custom printing function to
-;; MAKE-RECORD-TYPE (after the list of field symbols). This function
-;; will be called like
-;;
-;; (<printer> object port)
-;;
-;; It should print OBJECT to PORT.
-
-(define (inherit-print-state old-port new-port)
- (if (get-print-state old-port)
- (port-with-print-state new-port (get-print-state old-port))
- new-port))
-
-;; 0: type-name, 1: fields
-(define record-type-vtable
- (make-vtable-vtable "prpr" 0
- (lambda (s p)
- (cond ((eq? s record-type-vtable)
- (display "#<record-type-vtable>" p))
- (else
- (display "#<record-type " p)
- (display (record-type-name s) p)
- (display ">" p))))))
-
-(define (record-type? obj)
- (and (struct? obj) (eq? record-type-vtable (struct-vtable obj))))
-
-(define (make-record-type type-name fields . opt)
- (let ((printer-fn (and (pair? opt) (car opt))))
- (let ((struct (make-struct record-type-vtable 0
- (make-struct-layout
- (apply string-append
- (map (lambda (f) "pw") fields)))
- (or printer-fn
- (lambda (s p)
- (display "#<" p)
- (display type-name p)
- (let loop ((fields fields)
- (off 0))
- (cond
- ((not (null? fields))
- (display " " p)
- (display (car fields) p)
- (display ": " p)
- (display (struct-ref s off) p)
- (loop (cdr fields) (+ 1 off)))))
- (display ">" p)))
- type-name
- (copy-tree fields))))
- ;; Temporary solution: Associate a name to the record type descriptor
- ;; so that the object system can create a wrapper class for it.
- (set-struct-vtable-name! struct (if (symbol? type-name)
- type-name
- (string->symbol type-name)))
- struct)))
-
-(define (record-type-name obj)
- (if (record-type? obj)
- (struct-ref obj vtable-offset-user)
- (error 'not-a-record-type obj)))
-
-(define (record-type-fields obj)
- (if (record-type? obj)
- (struct-ref obj (+ 1 vtable-offset-user))
- (error 'not-a-record-type obj)))
-
-(define (record-constructor rtd . opt)
- (let ((field-names (if (pair? opt) (car opt) (record-type-fields rtd))))
- (local-eval `(lambda ,field-names
- (make-struct ',rtd 0 ,@(map (lambda (f)
- (if (memq f field-names)
- f
- #f))
- (record-type-fields rtd))))
- the-root-environment)))
-
-(define (record-predicate rtd)
- (lambda (obj) (and (struct? obj) (eq? rtd (struct-vtable obj)))))
-
-(define (record-accessor rtd field-name)
- (let* ((pos (list-index (record-type-fields rtd) field-name)))
- (if (not pos)
- (error 'no-such-field field-name))
- (local-eval `(lambda (obj)
- (and (eq? ',rtd (record-type-descriptor obj))
- (struct-ref obj ,pos)))
- the-root-environment)))
-
-(define (record-modifier rtd field-name)
- (let* ((pos (list-index (record-type-fields rtd) field-name)))
- (if (not pos)
- (error 'no-such-field field-name))
- (local-eval `(lambda (obj val)
- (and (eq? ',rtd (record-type-descriptor obj))
- (struct-set! obj ,pos val)))
- the-root-environment)))
-
-
-(define (record? obj)
- (and (struct? obj) (record-type? (struct-vtable obj))))
-
-(define (record-type-descriptor obj)
- (if (struct? obj)
- (struct-vtable obj)
- (error 'not-a-record obj)))
-
-(provide 'record)
-
-
-;;; {Booleans}
-;;;
-
-(define (->bool x) (not (not x)))
-
-
-;;; {Symbols}
-;;;
-
-(define (symbol-append . args)
- (string->symbol (apply string-append (map symbol->string args))))
-
-(define (list->symbol . args)
- (string->symbol (apply list->string args)))
-
-(define (symbol . args)
- (string->symbol (apply string args)))
-
-
-;;; {Lists}
-;;;
-
-(define (list-index l k)
- (let loop ((n 0)
- (l l))
- (and (not (null? l))
- (if (eq? (car l) k)
- n
- (loop (+ n 1) (cdr l))))))
-
-(define (make-list n . init)
- (if (pair? init) (set! init (car init)))
- (let loop ((answer '())
- (n n))
- (if (<= n 0)
- answer
- (loop (cons init answer) (- n 1)))))
-
-
-;;; {and-map and or-map}
-;;;
-;;; (and-map fn lst) is like (and (fn (car lst)) (fn (cadr lst)) (fn...) ...)
-;;; (or-map fn lst) is like (or (fn (car lst)) (fn (cadr lst)) (fn...) ...)
-;;;
-
-;; and-map f l
-;;
-;; Apply f to successive elements of l until exhaustion or f returns #f.
-;; If returning early, return #f. Otherwise, return the last value returned
-;; by f. If f has never been called because l is empty, return #t.
-;;
-(define (and-map f lst)
- (let loop ((result #t)
- (l lst))
- (and result
- (or (and (null? l)
- result)
- (loop (f (car l)) (cdr l))))))
-
-;; or-map f l
-;;
-;; Apply f to successive elements of l until exhaustion or while f returns #f.
-;; If returning early, return the return value of f.
-;;
-(define (or-map f lst)
- (let loop ((result #f)
- (l lst))
- (or result
- (and (not (null? l))
- (loop (f (car l)) (cdr l))))))
-
-
-
-(if (provided? 'posix)
- (primitive-load-path "ice-9/posix.scm"))
-
-(if (provided? 'socket)
- (primitive-load-path "ice-9/networking.scm"))
-
-(define file-exists?
- (if (provided? 'posix)
- (lambda (str)
- (->bool (false-if-exception (stat str))))
- (lambda (str)
- (let ((port (catch 'system-error (lambda () (open-file str OPEN_READ))
- (lambda args #f))))
- (if port (begin (close-port port) #t)
- #f)))))
-
-(define file-is-directory?
- (if (provided? 'posix)
- (lambda (str)
- (eq? (stat:type (stat str)) 'directory))
- (lambda (str)
- (let ((port (catch 'system-error
- (lambda () (open-file (string-append str "/.")
- OPEN_READ))
- (lambda args #f))))
- (if port (begin (close-port port) #t)
- #f)))))
-
-(define (has-suffix? str suffix)
- (let ((sufl (string-length suffix))
- (sl (string-length str)))
- (and (> sl sufl)
- (string=? (substring str (- sl sufl) sl) suffix))))
-
-(define (system-error-errno args)
- (if (eq? (car args) 'system-error)
- (car (list-ref args 4))
- #f))
-
-
-;;; {Error Handling}
-;;;
-
-(define (error . args)
- (save-stack)
- (if (null? args)
- (scm-error 'misc-error #f "?" #f #f)
- (let loop ((msg "~A")
- (rest (cdr args)))
- (if (not (null? rest))
- (loop (string-append msg " ~S")
- (cdr rest))
- (scm-error 'misc-error #f msg args #f)))))
-
-;; bad-throw is the hook that is called upon a throw to a an unhandled
-;; key (unless the throw has four arguments, in which case
-;; it's usually interpreted as an error throw.)
-;; If the key has a default handler (a throw-handler-default property),
-;; it is applied to the throw.
-;;
-(define (bad-throw key . args)
- (let ((default (symbol-property key 'throw-handler-default)))
- (or (and default (apply default key args))
- (apply error "unhandled-exception:" key args))))
-
-
-
-(define (tm:sec obj) (vector-ref obj 0))
-(define (tm:min obj) (vector-ref obj 1))
-(define (tm:hour obj) (vector-ref obj 2))
-(define (tm:mday obj) (vector-ref obj 3))
-(define (tm:mon obj) (vector-ref obj 4))
-(define (tm:year obj) (vector-ref obj 5))
-(define (tm:wday obj) (vector-ref obj 6))
-(define (tm:yday obj) (vector-ref obj 7))
-(define (tm:isdst obj) (vector-ref obj 8))
-(define (tm:gmtoff obj) (vector-ref obj 9))
-(define (tm:zone obj) (vector-ref obj 10))
-
-(define (set-tm:sec obj val) (vector-set! obj 0 val))
-(define (set-tm:min obj val) (vector-set! obj 1 val))
-(define (set-tm:hour obj val) (vector-set! obj 2 val))
-(define (set-tm:mday obj val) (vector-set! obj 3 val))
-(define (set-tm:mon obj val) (vector-set! obj 4 val))
-(define (set-tm:year obj val) (vector-set! obj 5 val))
-(define (set-tm:wday obj val) (vector-set! obj 6 val))
-(define (set-tm:yday obj val) (vector-set! obj 7 val))
-(define (set-tm:isdst obj val) (vector-set! obj 8 val))
-(define (set-tm:gmtoff obj val) (vector-set! obj 9 val))
-(define (set-tm:zone obj val) (vector-set! obj 10 val))
-
-(define (tms:clock obj) (vector-ref obj 0))
-(define (tms:utime obj) (vector-ref obj 1))
-(define (tms:stime obj) (vector-ref obj 2))
-(define (tms:cutime obj) (vector-ref obj 3))
-(define (tms:cstime obj) (vector-ref obj 4))
-
-(define file-position ftell)
-(define (file-set-position port offset . whence)
- (let ((whence (if (eq? whence '()) SEEK_SET (car whence))))
- (seek port offset whence)))
-
-(define (move->fdes fd/port fd)
- (cond ((integer? fd/port)
- (dup->fdes fd/port fd)
- (close fd/port)
- fd)
- (else
- (primitive-move->fdes fd/port fd)
- (set-port-revealed! fd/port 1)
- fd/port)))
-
-(define (release-port-handle port)
- (let ((revealed (port-revealed port)))
- (if (> revealed 0)
- (set-port-revealed! port (- revealed 1)))))
-
-(define (dup->port port/fd mode . maybe-fd)
- (let ((port (fdopen (apply dup->fdes port/fd maybe-fd)
- mode)))
- (if (pair? maybe-fd)
- (set-port-revealed! port 1))
- port))
-
-(define (dup->inport port/fd . maybe-fd)
- (apply dup->port port/fd "r" maybe-fd))
-
-(define (dup->outport port/fd . maybe-fd)
- (apply dup->port port/fd "w" maybe-fd))
-
-(define (dup port/fd . maybe-fd)
- (if (integer? port/fd)
- (apply dup->fdes port/fd maybe-fd)
- (apply dup->port port/fd (port-mode port/fd) maybe-fd)))
-
-(define (duplicate-port port modes)
- (dup->port port modes))
-
-(define (fdes->inport fdes)
- (let loop ((rest-ports (fdes->ports fdes)))
- (cond ((null? rest-ports)
- (let ((result (fdopen fdes "r")))
- (set-port-revealed! result 1)
- result))
- ((input-port? (car rest-ports))
- (set-port-revealed! (car rest-ports)
- (+ (port-revealed (car rest-ports)) 1))
- (car rest-ports))
- (else
- (loop (cdr rest-ports))))))
-
-(define (fdes->outport fdes)
- (let loop ((rest-ports (fdes->ports fdes)))
- (cond ((null? rest-ports)
- (let ((result (fdopen fdes "w")))
- (set-port-revealed! result 1)
- result))
- ((output-port? (car rest-ports))
- (set-port-revealed! (car rest-ports)
- (+ (port-revealed (car rest-ports)) 1))
- (car rest-ports))
- (else
- (loop (cdr rest-ports))))))
-
-(define (port->fdes port)
- (set-port-revealed! port (+ (port-revealed port) 1))
- (fileno port))
-
-(define (setenv name value)
- (if value
- (putenv (string-append name "=" value))
- (putenv name)))
-
-
-;;; {Load Paths}
-;;;
-
-;;; Here for backward compatability
-;;
-(define scheme-file-suffix (lambda () ".scm"))
-
-(define (in-vicinity vicinity file)
- (let ((tail (let ((len (string-length vicinity)))
- (if (zero? len)
- #f
- (string-ref vicinity (- len 1))))))
- (string-append vicinity
- (if (or (not tail)
- (eq? tail #\/))
- ""
- "/")
- file)))
-
-
-;;; {Help for scm_shell}
-;;; The argument-processing code used by Guile-based shells generates
-;;; Scheme code based on the argument list. This page contains help
-;;; functions for the code it generates.
-
-(define (command-line) (program-arguments))
-
-;; This is mostly for the internal use of the code generated by
-;; scm_compile_shell_switches.
-(define (load-user-init)
- (let* ((home (or (getenv "HOME")
- (false-if-exception (passwd:dir (getpwuid (getuid))))
- "/")) ;; fallback for cygwin etc.
- (init-file (in-vicinity home ".guile")))
- (if (file-exists? init-file)
- (primitive-load init-file))))
-
-
-;;; {Loading by paths}
-
-;;; Load a Scheme source file named NAME, searching for it in the
-;;; directories listed in %load-path, and applying each of the file
-;;; name extensions listed in %load-extensions.
-(define (load-from-path name)
- (start-stack 'load-stack
- (primitive-load-path name)))
-
-
-
-;;; {Transcendental Functions}
-;;;
-;;; Derived from "Transcen.scm", Complex trancendental functions for SCM.
-;;; Written by Jerry D. Hedden, (C) FSF.
-;;; See the file `COPYING' for terms applying to this program.
-;;;
-
-(define (exp z)
- (if (real? z) ($exp z)
- (make-polar ($exp (real-part z)) (imag-part z))))
-
-(define (log z)
- (if (and (real? z) (>= z 0))
- ($log z)
- (make-rectangular ($log (magnitude z)) (angle z))))
-
-(define (sqrt z)
- (if (real? z)
- (if (negative? z) (make-rectangular 0 ($sqrt (- z)))
- ($sqrt z))
- (make-polar ($sqrt (magnitude z)) (/ (angle z) 2))))
-
-(define expt
- (let ((integer-expt integer-expt))
- (lambda (z1 z2)
- (cond ((integer? z2)
- (if (negative? z2)
- (/ 1 (integer-expt z1 (- z2)))
- (integer-expt z1 z2)))
- ((and (real? z2) (real? z1) (>= z1 0))
- ($expt z1 z2))
- (else
- (exp (* z2 (log z1))))))))
-
-(define (sinh z)
- (if (real? z) ($sinh z)
- (let ((x (real-part z)) (y (imag-part z)))
- (make-rectangular (* ($sinh x) ($cos y))
- (* ($cosh x) ($sin y))))))
-(define (cosh z)
- (if (real? z) ($cosh z)
- (let ((x (real-part z)) (y (imag-part z)))
- (make-rectangular (* ($cosh x) ($cos y))
- (* ($sinh x) ($sin y))))))
-(define (tanh z)
- (if (real? z) ($tanh z)
- (let* ((x (* 2 (real-part z)))
- (y (* 2 (imag-part z)))
- (w (+ ($cosh x) ($cos y))))
- (make-rectangular (/ ($sinh x) w) (/ ($sin y) w)))))
-
-(define (asinh z)
- (if (real? z) ($asinh z)
- (log (+ z (sqrt (+ (* z z) 1))))))
-
-(define (acosh z)
- (if (and (real? z) (>= z 1))
- ($acosh z)
- (log (+ z (sqrt (- (* z z) 1))))))
-
-(define (atanh z)
- (if (and (real? z) (> z -1) (< z 1))
- ($atanh z)
- (/ (log (/ (+ 1 z) (- 1 z))) 2)))
-
-(define (sin z)
- (if (real? z) ($sin z)
- (let ((x (real-part z)) (y (imag-part z)))
- (make-rectangular (* ($sin x) ($cosh y))
- (* ($cos x) ($sinh y))))))
-(define (cos z)
- (if (real? z) ($cos z)
- (let ((x (real-part z)) (y (imag-part z)))
- (make-rectangular (* ($cos x) ($cosh y))
- (- (* ($sin x) ($sinh y)))))))
-(define (tan z)
- (if (real? z) ($tan z)
- (let* ((x (* 2 (real-part z)))
- (y (* 2 (imag-part z)))
- (w (+ ($cos x) ($cosh y))))
- (make-rectangular (/ ($sin x) w) (/ ($sinh y) w)))))
-
-(define (asin z)
- (if (and (real? z) (>= z -1) (<= z 1))
- ($asin z)
- (* -i (asinh (* +i z)))))
-
-(define (acos z)
- (if (and (real? z) (>= z -1) (<= z 1))
- ($acos z)
- (+ (/ (angle -1) 2) (* +i (asinh (* +i z))))))
-
-(define (atan z . y)
- (if (null? y)
- (if (real? z) ($atan z)
- (/ (log (/ (- +i z) (+ +i z))) +2i))
- ($atan2 z (car y))))
-
-(define (log10 arg)
- (/ (log arg) (log 10)))
-
-
-
-;;; {Reader Extensions}
-;;;
-
-;;; Reader code for various "#c" forms.
-;;;
-
-(read-hash-extend #\' (lambda (c port)
- (read port)))
-
-(define read-eval? (make-fluid))
-(fluid-set! read-eval? #f)
-(read-hash-extend #\.
- (lambda (c port)
- (if (fluid-ref read-eval?)
- (eval (read port) (interaction-environment))
- (error
- "#. read expansion found and read-eval? is #f."))))
-
-
-;;; {Command Line Options}
-;;;
-
-(define (get-option argv kw-opts kw-args return)
- (cond
- ((null? argv)
- (return #f #f argv))
-
- ((or (not (eq? #\- (string-ref (car argv) 0)))
- (eq? (string-length (car argv)) 1))
- (return 'normal-arg (car argv) (cdr argv)))
-
- ((eq? #\- (string-ref (car argv) 1))
- (let* ((kw-arg-pos (or (string-index (car argv) #\=)
- (string-length (car argv))))
- (kw (symbol->keyword (substring (car argv) 2 kw-arg-pos)))
- (kw-opt? (member kw kw-opts))
- (kw-arg? (member kw kw-args))
- (arg (or (and (not (eq? kw-arg-pos (string-length (car argv))))
- (substring (car argv)
- (+ kw-arg-pos 1)
- (string-length (car argv))))
- (and kw-arg?
- (begin (set! argv (cdr argv)) (car argv))))))
- (if (or kw-opt? kw-arg?)
- (return kw arg (cdr argv))
- (return 'usage-error kw (cdr argv)))))
-
- (else
- (let* ((char (substring (car argv) 1 2))
- (kw (symbol->keyword char)))
- (cond
-
- ((member kw kw-opts)
- (let* ((rest-car (substring (car argv) 2 (string-length (car argv))))
- (new-argv (if (= 0 (string-length rest-car))
- (cdr argv)
- (cons (string-append "-" rest-car) (cdr argv)))))
- (return kw #f new-argv)))
-
- ((member kw kw-args)
- (let* ((rest-car (substring (car argv) 2 (string-length (car argv))))
- (arg (if (= 0 (string-length rest-car))
- (cadr argv)
- rest-car))
- (new-argv (if (= 0 (string-length rest-car))
- (cddr argv)
- (cdr argv))))
- (return kw arg new-argv)))
-
- (else (return 'usage-error kw argv)))))))
-
-(define (for-next-option proc argv kw-opts kw-args)
- (let loop ((argv argv))
- (get-option argv kw-opts kw-args
- (lambda (opt opt-arg argv)
- (and opt (proc opt opt-arg argv loop))))))
-
-(define (display-usage-report kw-desc)
- (for-each
- (lambda (kw)
- (or (eq? (car kw) #t)
- (eq? (car kw) 'else)
- (let* ((opt-desc kw)
- (help (cadr opt-desc))
- (opts (car opt-desc))
- (opts-proper (if (string? (car opts)) (cdr opts) opts))
- (arg-name (if (string? (car opts))
- (string-append "<" (car opts) ">")
- ""))
- (left-part (string-append
- (with-output-to-string
- (lambda ()
- (map (lambda (x) (display (keyword->symbol x)) (display " "))
- opts-proper)))
- arg-name))
- (middle-part (if (and (< (string-length left-part) 30)
- (< (string-length help) 40))
- (make-string (- 30 (string-length left-part)) #\ )
- "\n\t")))
- (display left-part)
- (display middle-part)
- (display help)
- (newline))))
- kw-desc))
-
-
-
-(define (transform-usage-lambda cases)
- (let* ((raw-usage (delq! 'else (map car cases)))
- (usage-sans-specials (map (lambda (x)
- (or (and (not (list? x)) x)
- (and (symbol? (car x)) #t)
- (and (boolean? (car x)) #t)
- x))
- raw-usage))
- (usage-desc (delq! #t usage-sans-specials))
- (kw-desc (map car usage-desc))
- (kw-opts (apply append (map (lambda (x) (and (not (string? (car x))) x)) kw-desc)))
- (kw-args (apply append (map (lambda (x) (and (string? (car x)) (cdr x))) kw-desc)))
- (transmogrified-cases (map (lambda (case)
- (cons (let ((opts (car case)))
- (if (or (boolean? opts) (eq? 'else opts))
- opts
- (cond
- ((symbol? (car opts)) opts)
- ((boolean? (car opts)) opts)
- ((string? (caar opts)) (cdar opts))
- (else (car opts)))))
- (cdr case)))
- cases)))
- `(let ((%display-usage (lambda () (display-usage-report ',usage-desc))))
- (lambda (%argv)
- (let %next-arg ((%argv %argv))
- (get-option %argv
- ',kw-opts
- ',kw-args
- (lambda (%opt %arg %new-argv)
- (case %opt
- ,@ transmogrified-cases))))))))
-
-
-
-
-;;; {Low Level Modules}
-;;;
-;;; These are the low level data structures for modules.
-;;;
-;;; !!! warning: The interface to lazy binder procedures is going
-;;; to be changed in an incompatible way to permit all the basic
-;;; module ops to be virtualized.
-;;;
-;;; (make-module size use-list lazy-binding-proc) => module
-;;; module-{obarray,uses,binder}[|-set!]
-;;; (module? obj) => [#t|#f]
-;;; (module-locally-bound? module symbol) => [#t|#f]
-;;; (module-bound? module symbol) => [#t|#f]
-;;; (module-symbol-locally-interned? module symbol) => [#t|#f]
-;;; (module-symbol-interned? module symbol) => [#t|#f]
-;;; (module-local-variable module symbol) => [#<variable ...> | #f]
-;;; (module-variable module symbol) => [#<variable ...> | #f]
-;;; (module-symbol-binding module symbol opt-value)
-;;; => [ <obj> | opt-value | an error occurs ]
-;;; (module-make-local-var! module symbol) => #<variable...>
-;;; (module-add! module symbol var) => unspecified
-;;; (module-remove! module symbol) => unspecified
-;;; (module-for-each proc module) => unspecified
-;;; (make-scm-module) => module ; a lazy copy of the symhash module
-;;; (set-current-module module) => unspecified
-;;; (current-module) => #<module...>
-;;;
-;;;
-
-
-;;; {Printing Modules}
-;; This is how modules are printed. You can re-define it.
-;; (Redefining is actually more complicated than simply redefining
-;; %print-module because that would only change the binding and not
-;; the value stored in the vtable that determines how record are
-;; printed. Sigh.)
-
-(define (%print-module mod port) ; unused args: depth length style table)
- (display "#<" port)
- (display (or (module-kind mod) "module") port)
- (let ((name (module-name mod)))
- (if name
- (begin
- (display " " port)
- (display name port))))
- (display " " port)
- (display (number->string (object-address mod) 16) port)
- (display ">" port))
-
-;; module-type
-;;
-;; A module is characterized by an obarray in which local symbols
-;; are interned, a list of modules, "uses", from which non-local
-;; bindings can be inherited, and an optional lazy-binder which
-;; is a (CLOSURE module symbol) which, as a last resort, can provide
-;; bindings that would otherwise not be found locally in the module.
-;;
-;; NOTE: If you change here, you also need to change libguile/modules.h.
-;;
-(define module-type
- (make-record-type 'module
- '(obarray uses binder eval-closure transformer name kind
- observers weak-observers observer-id)
- %print-module))
-
-;; make-module &opt size uses binder
-;;
-;; Create a new module, perhaps with a particular size of obarray,
-;; initial uses list, or binding procedure.
-;;
-(define make-module
- (lambda args
-
- (define (parse-arg index default)
- (if (> (length args) index)
- (list-ref args index)
- default))
-
- (if (> (length args) 3)
- (error "Too many args to make-module." args))
-
- (let ((size (parse-arg 0 1021))
- (uses (parse-arg 1 '()))
- (binder (parse-arg 2 #f)))
-
- (if (not (integer? size))
- (error "Illegal size to make-module." size))
- (if (not (and (list? uses)
- (and-map module? uses)))
- (error "Incorrect use list." uses))
- (if (and binder (not (procedure? binder)))
- (error
- "Lazy-binder expected to be a procedure or #f." binder))
-
- (let ((module (module-constructor (make-vector size '())
- uses binder #f #f #f #f
- '()
- (make-weak-value-hash-table 31)
- 0)))
-
- ;; We can't pass this as an argument to module-constructor,
- ;; because we need it to close over a pointer to the module
- ;; itself.
- (set-module-eval-closure! module (standard-eval-closure module))
-
- module))))
-
-(define module-constructor (record-constructor module-type))
-(define module-obarray (record-accessor module-type 'obarray))
-(define set-module-obarray! (record-modifier module-type 'obarray))
-(define module-uses (record-accessor module-type 'uses))
-(define set-module-uses! (record-modifier module-type 'uses))
-(define module-binder (record-accessor module-type 'binder))
-(define set-module-binder! (record-modifier module-type 'binder))
-
-;; NOTE: This binding is used in libguile/modules.c.
-(define module-eval-closure (record-accessor module-type 'eval-closure))
-
-(define module-transformer (record-accessor module-type 'transformer))
-(define set-module-transformer! (record-modifier module-type 'transformer))
-(define module-name (record-accessor module-type 'name))
-(define set-module-name! (record-modifier module-type 'name))
-(define module-kind (record-accessor module-type 'kind))
-(define set-module-kind! (record-modifier module-type 'kind))
-(define module-observers (record-accessor module-type 'observers))
-(define set-module-observers! (record-modifier module-type 'observers))
-(define module-weak-observers (record-accessor module-type 'weak-observers))
-(define module-observer-id (record-accessor module-type 'observer-id))
-(define set-module-observer-id! (record-modifier module-type 'observer-id))
-(define module? (record-predicate module-type))
-
-(define set-module-eval-closure!
- (let ((setter (record-modifier module-type 'eval-closure)))
- (lambda (module closure)
- (setter module closure)
- ;; Make it possible to lookup the module from the environment.
- ;; This implementation is correct since an eval closure can belong
- ;; to maximally one module.
- (set-procedure-property! closure 'module module))))
-
-(begin-deprecated
- (define (eval-in-module exp mod)
- (issue-deprecation-warning
- "`eval-in-module' is deprecated. Use `eval' instead.")
- (eval exp mod)))
-
-
-;;; {Observer protocol}
-;;;
-
-(define (module-observe module proc)
- (set-module-observers! module (cons proc (module-observers module)))
- (cons module proc))
-
-(define (module-observe-weak module proc)
- (let ((id (module-observer-id module)))
- (hash-set! (module-weak-observers module) id proc)
- (set-module-observer-id! module (+ 1 id))
- (cons module id)))
-
-(define (module-unobserve token)
- (let ((module (car token))
- (id (cdr token)))
- (if (integer? id)
- (hash-remove! (module-weak-observers module) id)
- (set-module-observers! module (delq1! id (module-observers module)))))
- *unspecified*)
-
-(define (module-modified m)
- (for-each (lambda (proc) (proc m)) (module-observers m))
- (hash-fold (lambda (id proc res) (proc m)) #f (module-weak-observers m)))
-
-
-;;; {Module Searching in General}
-;;;
-;;; We sometimes want to look for properties of a symbol
-;;; just within the obarray of one module. If the property
-;;; holds, then it is said to hold ``locally'' as in, ``The symbol
-;;; DISPLAY is locally rebound in the module `safe-guile'.''
-;;;
-;;;
-;;; Other times, we want to test for a symbol property in the obarray
-;;; of M and, if it is not found there, try each of the modules in the
-;;; uses list of M. This is the normal way of testing for some
-;;; property, so we state these properties without qualification as
-;;; in: ``The symbol 'fnord is interned in module M because it is
-;;; interned locally in module M2 which is a member of the uses list
-;;; of M.''
-;;;
-
-;; module-search fn m
-;;
-;; return the first non-#f result of FN applied to M and then to
-;; the modules in the uses of m, and so on recursively. If all applications
-;; return #f, then so does this function.
-;;
-(define (module-search fn m v)
- (define (loop pos)
- (and (pair? pos)
- (or (module-search fn (car pos) v)
- (loop (cdr pos)))))
- (or (fn m v)
- (loop (module-uses m))))
-
-
-;;; {Is a symbol bound in a module?}
-;;;
-;;; Symbol S in Module M is bound if S is interned in M and if the binding
-;;; of S in M has been set to some well-defined value.
-;;;
-
-;; module-locally-bound? module symbol
-;;
-;; Is a symbol bound (interned and defined) locally in a given module?
-;;
-(define (module-locally-bound? m v)
- (let ((var (module-local-variable m v)))
- (and var
- (variable-bound? var))))
-
-;; module-bound? module symbol
-;;
-;; Is a symbol bound (interned and defined) anywhere in a given module
-;; or its uses?
-;;
-(define (module-bound? m v)
- (module-search module-locally-bound? m v))
-
-;;; {Is a symbol interned in a module?}
-;;;
-;;; Symbol S in Module M is interned if S occurs in
-;;; of S in M has been set to some well-defined value.
-;;;
-;;; It is possible to intern a symbol in a module without providing
-;;; an initial binding for the corresponding variable. This is done
-;;; with:
-;;; (module-add! module symbol (make-undefined-variable))
-;;;
-;;; In that case, the symbol is interned in the module, but not
-;;; bound there. The unbound symbol shadows any binding for that
-;;; symbol that might otherwise be inherited from a member of the uses list.
-;;;
-
-(define (module-obarray-get-handle ob key)
- ((if (symbol? key) hashq-get-handle hash-get-handle) ob key))
-
-(define (module-obarray-ref ob key)
- ((if (symbol? key) hashq-ref hash-ref) ob key))
-
-(define (module-obarray-set! ob key val)
- ((if (symbol? key) hashq-set! hash-set!) ob key val))
-
-(define (module-obarray-remove! ob key)
- ((if (symbol? key) hashq-remove! hash-remove!) ob key))
-
-;; module-symbol-locally-interned? module symbol
-;;
-;; is a symbol interned (not neccessarily defined) locally in a given module
-;; or its uses? Interned symbols shadow inherited bindings even if
-;; they are not themselves bound to a defined value.
-;;
-(define (module-symbol-locally-interned? m v)
- (not (not (module-obarray-get-handle (module-obarray m) v))))
-
-;; module-symbol-interned? module symbol
-;;
-;; is a symbol interned (not neccessarily defined) anywhere in a given module
-;; or its uses? Interned symbols shadow inherited bindings even if
-;; they are not themselves bound to a defined value.
-;;
-(define (module-symbol-interned? m v)
- (module-search module-symbol-locally-interned? m v))
-
-
-;;; {Mapping modules x symbols --> variables}
-;;;
-
-;; module-local-variable module symbol
-;; return the local variable associated with a MODULE and SYMBOL.
-;;
-;;; This function is very important. It is the only function that can
-;;; return a variable from a module other than the mutators that store
-;;; new variables in modules. Therefore, this function is the location
-;;; of the "lazy binder" hack.
-;;;
-;;; If symbol is defined in MODULE, and if the definition binds symbol
-;;; to a variable, return that variable object.
-;;;
-;;; If the symbols is not found at first, but the module has a lazy binder,
-;;; then try the binder.
-;;;
-;;; If the symbol is not found at all, return #f.
-;;;
-(define (module-local-variable m v)
-; (caddr
-; (list m v
- (let ((b (module-obarray-ref (module-obarray m) v)))
- (or (and (variable? b) b)
- (and (module-binder m)
- ((module-binder m) m v #f)))))
-;))
-
-;; module-variable module symbol
-;;
-;; like module-local-variable, except search the uses in the
-;; case V is not found in M.
-;;
-;; NOTE: This function is superseded with C code (see modules.c)
-;;; when using the standard eval closure.
-;;
-(define (module-variable m v)
- (module-search module-local-variable m v))
-
-
-;;; {Mapping modules x symbols --> bindings}
-;;;
-;;; These are similar to the mapping to variables, except that the
-;;; variable is dereferenced.
-;;;
-
-;; module-symbol-binding module symbol opt-value
-;;
-;; return the binding of a variable specified by name within
-;; a given module, signalling an error if the variable is unbound.
-;; If the OPT-VALUE is passed, then instead of signalling an error,
-;; return OPT-VALUE.
-;;
-(define (module-symbol-local-binding m v . opt-val)
- (let ((var (module-local-variable m v)))
- (if var
- (variable-ref var)
- (if (not (null? opt-val))
- (car opt-val)
- (error "Locally unbound variable." v)))))
-
-;; module-symbol-binding module symbol opt-value
-;;
-;; return the binding of a variable specified by name within
-;; a given module, signalling an error if the variable is unbound.
-;; If the OPT-VALUE is passed, then instead of signalling an error,
-;; return OPT-VALUE.
-;;
-(define (module-symbol-binding m v . opt-val)
- (let ((var (module-variable m v)))
- (if var
- (variable-ref var)
- (if (not (null? opt-val))
- (car opt-val)
- (error "Unbound variable." v)))))
-
-
-
-;;; {Adding Variables to Modules}
-;;;
-;;;
-
-
-;; module-make-local-var! module symbol
-;;
-;; ensure a variable for V in the local namespace of M.
-;; If no variable was already there, then create a new and uninitialzied
-;; variable.
-;;
-(define (module-make-local-var! m v)
- (or (let ((b (module-obarray-ref (module-obarray m) v)))
- (and (variable? b)
- (begin
- (module-modified m)
- b)))
- (and (module-binder m)
- ((module-binder m) m v #t))
- (begin
- (let ((answer (make-undefined-variable)))
- (variable-set-name-hint! answer v)
- (module-obarray-set! (module-obarray m) v answer)
- (module-modified m)
- answer))))
-
-;; module-ensure-local-variable! module symbol
-;;
-;; Ensure that there is a local variable in MODULE for SYMBOL. If
-;; there is no binding for SYMBOL, create a new uninitialized
-;; variable. Return the local variable.
-;;
-(define (module-ensure-local-variable! module symbol)
- (or (module-local-variable module symbol)
- (let ((var (make-undefined-variable)))
- (variable-set-name-hint! var symbol)
- (module-add! module symbol var)
- var)))
-
-;; module-add! module symbol var
-;;
-;; ensure a particular variable for V in the local namespace of M.
-;;
-(define (module-add! m v var)
- (if (not (variable? var))
- (error "Bad variable to module-add!" var))
- (module-obarray-set! (module-obarray m) v var)
- (module-modified m))
-
-;; module-remove!
-;;
-;; make sure that a symbol is undefined in the local namespace of M.
-;;
-(define (module-remove! m v)
- (module-obarray-remove! (module-obarray m) v)
- (module-modified m))
-
-(define (module-clear! m)
- (vector-fill! (module-obarray m) '())
- (module-modified m))
-
-;; MODULE-FOR-EACH -- exported
-;;
-;; Call PROC on each symbol in MODULE, with arguments of (SYMBOL VARIABLE).
-;;
-(define (module-for-each proc module)
- (let ((obarray (module-obarray module)))
- (do ((index 0 (+ index 1))
- (end (vector-length obarray)))
- ((= index end))
- (for-each
- (lambda (bucket)
- (proc (car bucket) (cdr bucket)))
- (vector-ref obarray index)))))
-
-
-(define (module-map proc module)
- (let* ((obarray (module-obarray module))
- (end (vector-length obarray)))
-
- (let loop ((i 0)
- (answer '()))
- (if (= i end)
- answer
- (loop (+ 1 i)
- (append!
- (map (lambda (bucket)
- (proc (car bucket) (cdr bucket)))
- (vector-ref obarray i))
- answer))))))
-
-
-;;; {Low Level Bootstrapping}
-;;;
-
-;; make-root-module
-
-;; A root module uses the pre-modules-obarray as its obarray. This
-;; special obarray accumulates all bindings that have been established
-;; before the module system is fully booted.
-;;
-;; (The obarray continues to be used by code that has been closed over
-;; before the module system has been booted.)
-
-(define (make-root-module)
- (let ((m (make-module 0)))
- (set-module-obarray! m (%get-pre-modules-obarray))
- m))
-
-;; make-scm-module
-
-;; The root interface is a module that uses the same obarray as the
-;; root module. It does not allow new definitions, tho.
-
-(define (make-scm-module)
- (let ((m (make-module 0)))
- (set-module-obarray! m (%get-pre-modules-obarray))
- (set-module-eval-closure! m (standard-interface-eval-closure m))
- m))
-
-
-
-;;; {Module-based Loading}
-;;;
-
-(define (save-module-excursion thunk)
- (let ((inner-module (current-module))
- (outer-module #f))
- (dynamic-wind (lambda ()
- (set! outer-module (current-module))
- (set-current-module inner-module)
- (set! inner-module #f))
- thunk
- (lambda ()
- (set! inner-module (current-module))
- (set-current-module outer-module)
- (set! outer-module #f)))))
-
-(define basic-load load)
-
-(define (load-module filename)
- (save-module-excursion
- (lambda ()
- (let ((oldname (and (current-load-port)
- (port-filename (current-load-port)))))
- (basic-load (if (and oldname
- (> (string-length filename) 0)
- (not (char=? (string-ref filename 0) #\/))
- (not (string=? (dirname oldname) ".")))
- (string-append (dirname oldname) "/" filename)
- filename))))))
-
-
-
-;;; {MODULE-REF -- exported}
-;;
-;; Returns the value of a variable called NAME in MODULE or any of its
-;; used modules. If there is no such variable, then if the optional third
-;; argument DEFAULT is present, it is returned; otherwise an error is signaled.
-;;
-(define (module-ref module name . rest)
- (let ((variable (module-variable module name)))
- (if (and variable (variable-bound? variable))
- (variable-ref variable)
- (if (null? rest)
- (error "No variable named" name 'in module)
- (car rest) ; default value
- ))))
-
-;; MODULE-SET! -- exported
-;;
-;; Sets the variable called NAME in MODULE (or in a module that MODULE uses)
-;; to VALUE; if there is no such variable, an error is signaled.
-;;
-(define (module-set! module name value)
- (let ((variable (module-variable module name)))
- (if variable
- (variable-set! variable value)
- (error "No variable named" name 'in module))))
-
-;; MODULE-DEFINE! -- exported
-;;
-;; Sets the variable called NAME in MODULE to VALUE; if there is no such
-;; variable, it is added first.
-;;
-(define (module-define! module name value)
- (let ((variable (module-local-variable module name)))
- (if variable
- (begin
- (variable-set! variable value)
- (module-modified module))
- (let ((variable (make-variable value)))
- (variable-set-name-hint! variable name)
- (module-add! module name variable)))))
-
-;; MODULE-DEFINED? -- exported
-;;
-;; Return #t iff NAME is defined in MODULE (or in a module that MODULE
-;; uses)
-;;
-(define (module-defined? module name)
- (let ((variable (module-variable module name)))
- (and variable (variable-bound? variable))))
-
-;; MODULE-USE! module interface
-;;
-;; Add INTERFACE to the list of interfaces used by MODULE.
-;;
-(define (module-use! module interface)
- (set-module-uses! module
- (cons interface (delq! interface (module-uses module))))
- (module-modified module))
-
-
-;;; {Recursive Namespaces}
-;;;
-;;;
-;;; A hierarchical namespace emerges if we consider some module to be
-;;; root, and variables bound to modules as nested namespaces.
-;;;
-;;; The routines in this file manage variable names in hierarchical namespace.
-;;; Each variable name is a list of elements, looked up in successively nested
-;;; modules.
-;;;
-;;; (nested-ref some-root-module '(foo bar baz))
-;;; => <value of a variable named baz in the module bound to bar in
-;;; the module bound to foo in some-root-module>
-;;;
-;;;
-;;; There are:
-;;;
-;;; ;; a-root is a module
-;;; ;; name is a list of symbols
-;;;
-;;; nested-ref a-root name
-;;; nested-set! a-root name val
-;;; nested-define! a-root name val
-;;; nested-remove! a-root name
-;;;
-;;;
-;;; (current-module) is a natural choice for a-root so for convenience there are
-;;; also:
-;;;
-;;; local-ref name == nested-ref (current-module) name
-;;; local-set! name val == nested-set! (current-module) name val
-;;; local-define! name val == nested-define! (current-module) name val
-;;; local-remove! name == nested-remove! (current-module) name
-;;;
-
-
-(define (nested-ref root names)
- (let loop ((cur root)
- (elts names))
- (cond
- ((null? elts) cur)
- ((not (module? cur)) #f)
- (else (loop (module-ref cur (car elts) #f) (cdr elts))))))
-
-(define (nested-set! root names val)
- (let loop ((cur root)
- (elts names))
- (if (null? (cdr elts))
- (module-set! cur (car elts) val)
- (loop (module-ref cur (car elts)) (cdr elts)))))
-
-(define (nested-define! root names val)
- (let loop ((cur root)
- (elts names))
- (if (null? (cdr elts))
- (module-define! cur (car elts) val)
- (loop (module-ref cur (car elts)) (cdr elts)))))
-
-(define (nested-remove! root names)
- (let loop ((cur root)
- (elts names))
- (if (null? (cdr elts))
- (module-remove! cur (car elts))
- (loop (module-ref cur (car elts)) (cdr elts)))))
-
-(define (local-ref names) (nested-ref (current-module) names))
-(define (local-set! names val) (nested-set! (current-module) names val))
-(define (local-define names val) (nested-define! (current-module) names val))
-(define (local-remove names) (nested-remove! (current-module) names))
-;;; boot-9.scm ends here
diff --git a/tests/examplefiles/ca65_example b/tests/examplefiles/ca65_example
deleted file mode 100644
index 67c6313e..00000000
--- a/tests/examplefiles/ca65_example
+++ /dev/null
@@ -1,284 +0,0 @@
-;--------------------------------------
-; Lychrel numbers.
-;
-; :author: Marc 'BlackJack' Rintsch
-; :date: 2008-03-07
-; :version: 0.1
-;
-; Prints all `Lychrel numbers`_ between 1 and 100000.
-;
-; The numbers are stored as array of "digits" in little endian
-; order. Each digit is a byte with a value between 0 and 9.
-;
-; Runtime on C64: 00:21:01
-;
-; .. _Lychrel numbers: http://en.wikipedia.org/wiki/Lychrel_number
-;
-; .. cl65 -l -tnone -C simple.cfg lychrel.s -o lychrel.prg
-;--------------------------------------
-
-;--------------------------------------
-; External addresses.
-;--------------------------------------
- chrout = $ffd2
-
-;--------------------------------------
-; Constants.
-;--------------------------------------
- TO = 100000
- TO_DIGITS = 10
- ITERATIONS = 100
- MAX_DIGITS = TO_DIGITS + ITERATIONS
-
-;--------------------------------------
-; Global variables.
-;--------------------------------------
-.zeropage
-;
-; Length of the currently tested `n` in digits.
-;
-n_length:
- .res 1
-;
-; Length of the number(s) `xa` and `xb` while testing.
-;
-length:
- .res 1
-
-.bss
-;
-; Number to be tested as digits i.e. bytes with values between
-; 0 and 9. The length is stored in `n_length`.
-;
-n:
- .res TO_DIGITS
-;
-; Space for calculating the reversed and added values.
-; In the `main` code the current number is copied into `xa`
-; and then repeatedly `reverse_add`\ed to itself with the
-; result of that adding stored in `xb`.
-;
-xa:
- .res MAX_DIGITS
-xb:
- .res MAX_DIGITS
-
-;--------------------------------------
-; BASIC header.
-;--------------------------------------
-.code
- .word 0800h ; Load address.
- .byte 0
- .word @line_end
- .word 2008 ; Line number.
- .byte $9e ; SYS token.
- .byte "2080 " ; SYS argument.
- .byte "LYCHREL NUMBERS/BJ"
-@line_end:
- .byte 0, 0, 0 ; Line and program end marker.
-
-;--------------------------------------
-; Main program.
-;--------------------------------------
-.proc main
-
-.zeropage
-;
-; Three byte counter for `TO` iterations (100000 = $0186a0).
-;
-i:
- .res 3
-
-.code
-;
-; Clear and set `n` and `i` to 1.
-;
- lda #0 ; n := 0; n := 1; i := 1
- sta i+1
- sta i+2
- ldx #TO_DIGITS
-clear_n:
- sta n-1,x
- dex
- bne clear_n
- inx
- stx i
- stx n
- stx n_length
-
-mainloop:
- jsr is_lychrel
- bcc no_lychrel
- jsr print_n
-no_lychrel:
- jsr increase_n
-
- inc i ; INC(i)
- bne skip
- inc i+1
- bne skip
- inc i+2
-skip:
- lda i
- cmp #<TO
- bne mainloop
- lda i+1
- cmp #>TO
- bne mainloop
- lda i+2
- cmp #^TO
- bne mainloop
-
- rts
-.endproc
-
-;--------------------------------------
-; Print `n` and a trailing newline.
-;
-; :in: `n_length`, `n`
-;--------------------------------------
-.proc print_n
- ldy n_length
-L1:
- lda n-1,y
- ora #%110000 ; = '0'
- jsr chrout
- dey
- bne L1
-
- lda #13
- jmp chrout
-.endproc
-
-;--------------------------------------
-; Increase `n` by one.
-;
-; This procedure expects n[n_length] == 0 in case the number gets
-; one digit longer.
-;
-; :in: `n`, `n_length`
-; :out: `n`, `n_length`
-;--------------------------------------
-.proc increase_n
- ldx #0
-L1:
- inc n,x ; Increase digit.
- lda n,x
- cmp #10 ; If "carry", store 0 and go to next digit.
- bne return
- lda #0
- sta n,x
- inx
- bne L1
-return:
- cpx n_length ; If "carry" after last digit, increase length.
- bcc skip
- inc n_length
-skip:
- rts
-.endproc
-
-;--------------------------------------
-; Tests if `n` is a Lychrel number.
-;
-; :in: `n`, `n_length`
-; :out: C is set if yes, cleared otherwise.
-; :uses: `length`, `xa`, `xb`
-;--------------------------------------
-.proc is_lychrel
-.zeropage
-i:
- .res 1
-
-.code
- ldx n_length ; xa := n; length := n_length
- stx length
-L1:
- lda n-1,x
- sta xa-1,x
- dex
- bne L1
-
- lda #ITERATIONS ; i := ITERATIONS
- sta i
-L2:
- jsr reverse_add
- jsr is_palindrome
- bne no_palindrome
- clc
- rts
-no_palindrome:
- ldx length ; a := b
-L3:
- lda xb-1,x
- sta xa-1,x
- dex
- bne L3
-
- dec i ; Loop body end.
- bne L2
-
- sec
- rts
-.endproc
-
-;--------------------------------------
-; Add the reverse to `xa` to itself and store the result in `xb`.
-;
-; :in: `length`, `xa`
-; :out: `length`, `xb`
-;--------------------------------------
-.proc reverse_add
-.code
- ldx #0
- ldy length
- clc
-L1:
- lda xa,x
- adc xa-1,y
-
- cmp #10
- bcc no_adjust
- sbc #10
-no_adjust:
- sta xb,x
-
- dey
- inx
- txa ; ``eor`` instead of ``cpx`` to keep the carry flag
- eor length ; of the addition above.
- bne L1
-
- bcc no_carry
- lda #1
- sta xb,x
- inc length
-no_carry:
- rts
-.endproc
-
-;--------------------------------------
-; Checks if `xb` is a palindrome.
-;
-; :in: `length`, `xb`
-; :out: Z flag set if `xb` is a palindrome, cleared otherwise.
-;--------------------------------------
-.proc is_palindrome
-.code
- ldx #0
- lda length
- tay
- lsr
- sta L1+1 ; Self modifying code!
-L1:
- cpx #0 ; <<< 0 replaced by (`length` / 2).
- beq return
- lda xb,x
- cmp xb-1,y
- bne return
- dey
- inx
- bne L1
-return:
- rts
-.endproc
diff --git a/tests/examplefiles/capdl_example.cdl b/tests/examplefiles/capdl_example.cdl
deleted file mode 100644
index 050e56a6..00000000
--- a/tests/examplefiles/capdl_example.cdl
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifdef ARCH_ARM
-arch arm11
-#else
-arch ia32
-#endif
-
-objects {
- my_ep = ep /* A synchronous endpoint */
-
- /* Two thread control blocks */
- tcb1 = tcb
- tcb2 = tcb
-
- /* Four frames of physical memory */
- frame1 = frame (4k)
- frame2 = frame (4k)
- frame3 = frame (4k)
- frame4 = frame (4k)
-
- /* Two page tables */
- pt1 = pt
- pt2 = pt
-
- /* Two page directories */
- pd1 = pd
- pd2 = pd
-
- /* Two capability nodes */
- cnode1 = cnode (2 bits)
- cnode2 = cnode (3 bits)
-}
-caps {
- cnode1 {
- 0x1: frame1 (RW) /* read/write */
- 0x2: my_ep (R) /* read-only */
- }
- cnode2 {
- 0x1: my_ep (W) /* write-only */
- }
- tcb1 {
- vspace: pd1
- ipc_buffer_slot: frame1
- cspace: cnode1
- }
- pd1 {
- 0x10: pt1
- }
- pt1 {
- 0x8: frame1 (RW)
- 0x9: frame2 (R)
- }
- tcb2 {
- vspace: pd2
- ipc_buffer_slot: frame3
- cspace: cnode2
- }
- pd2 {
- 0x10: pt2
- }
- pt2 {
- 0x10: frame3 (RW)
- 0x12: frame4 (R)
- }
-}
diff --git a/tests/examplefiles/cbmbas_example b/tests/examplefiles/cbmbas_example
deleted file mode 100644
index 8d8ded9e..00000000
--- a/tests/examplefiles/cbmbas_example
+++ /dev/null
@@ -1,9 +0,0 @@
-10 rem cbm basic v2 example
-20 rem comment with keywords: for, data
-30 dim a$(20)
-35 rem the typical space efficient form of leaving spaces out:
-40 fort=0to15:poke646,t:print"{revers on} ";:next
-50 geta$:ifa$=chr$(0):goto40
-55 rem it is legal to omit the closing " on line end
-60 print"{white}":print"bye...
-70 end
diff --git a/tests/examplefiles/cells.ps b/tests/examplefiles/cells.ps
deleted file mode 100644
index d5bc325f..00000000
--- a/tests/examplefiles/cells.ps
+++ /dev/null
@@ -1,515 +0,0 @@
-%!PS-Adobe-2.0
-%%Creator: PS_Write.F
-%%Title: cells.ps
-%%Pages: 1
-%%Document-Fonts: Times-Roman
-%%CreationDate: 09/29/99
-%%BoundingBox: 36 36 576 756
-%%EndComments
-%%BeginProlog
-%%EndProlog
-/inch {72 mul} def
-/Palatino-Roman findfont
-1.00 inch scalefont
-setfont
- 0.0000 0.0000 0.0000 setrgbcolor
-%%Page: 1 1
-save
- 0.7000 0.7000 0.7000 setrgbcolor
- newpath
- 497 294 moveto
- 500 297 lineto
- 503 300 lineto
- 506 303 lineto
- 510 307 lineto
- 513 310 lineto
- 516 313 lineto
- 519 316 lineto
- 522 319 lineto
- 526 323 lineto
- 529 326 lineto
- 532 329 lineto
- 535 332 lineto
- 538 335 lineto
- 541 338 lineto
- 545 342 lineto
- 548 345 lineto
- 551 348 lineto
- 554 351 lineto
- 557 354 lineto
- 561 358 lineto
- 0.7000 0.7000 0.7000 setrgbcolor
- stroke
- newpath
- 51 358 moveto
- 65 385 lineto
- 84 408 lineto
- 109 425 lineto
- 138 433 lineto
- 168 436 lineto
- 198 435 lineto
- 226 436 lineto
- 252 442 lineto
- 279 451 lineto
- 306 463 lineto
- 335 472 lineto
- 365 475 lineto
- 394 470 lineto
- 421 455 lineto
- 444 436 lineto
- 465 414 lineto
- 485 395 lineto
- 508 380 lineto
- 533 369 lineto
- 561 358 lineto
- 0.7000 0.7000 0.7000 setrgbcolor
- stroke
- newpath
- 115 294 moveto
- 112 297 lineto
- 109 300 lineto
- 106 303 lineto
- 102 307 lineto
- 99 310 lineto
- 96 313 lineto
- 93 316 lineto
- 90 319 lineto
- 86 323 lineto
- 83 326 lineto
- 80 329 lineto
- 77 332 lineto
- 74 335 lineto
- 71 338 lineto
- 67 342 lineto
- 64 345 lineto
- 61 348 lineto
- 58 351 lineto
- 55 354 lineto
- 51 358 lineto
- 0.7000 0.7000 0.7000 setrgbcolor
- stroke
- newpath
- 115 294 moveto
- 131 308 lineto
- 147 321 lineto
- 165 333 lineto
- 183 344 lineto
- 203 352 lineto
- 223 360 lineto
- 243 366 lineto
- 264 370 lineto
- 285 372 lineto
- 306 373 lineto
- 327 372 lineto
- 348 370 lineto
- 369 366 lineto
- 389 360 lineto
- 409 352 lineto
- 429 344 lineto
- 447 333 lineto
- 465 321 lineto
- 481 308 lineto
- 497 294 lineto
- 0.7000 0.7000 0.7000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 171 337 moveto
- 164 348 lineto
- 158 360 lineto
- 151 371 lineto
- 145 383 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 145 383 moveto
- 126 372 lineto
- 109 359 lineto
- 95 343 lineto
- 83 326 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 83 326 moveto
- 91 318 lineto
- 99 310 lineto
- 107 302 lineto
- 115 294 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 115 294 moveto
- 128 306 lineto
- 142 317 lineto
- 156 327 lineto
- 171 337 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 236 364 moveto
- 234 373 lineto
- 231 382 lineto
- 229 391 lineto
- 226 400 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 226 400 moveto
- 206 397 lineto
- 185 394 lineto
- 165 390 lineto
- 145 383 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 145 383 moveto
- 151 371 lineto
- 158 360 lineto
- 164 348 lineto
- 171 337 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 171 337 moveto
- 187 345 lineto
- 203 352 lineto
- 219 359 lineto
- 236 364 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 306 373 moveto
- 306 384 lineto
- 306 396 lineto
- 306 407 lineto
- 306 418 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 306 418 moveto
- 286 413 lineto
- 266 408 lineto
- 246 403 lineto
- 226 400 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 226 400 moveto
- 229 391 lineto
- 231 382 lineto
- 234 373 lineto
- 236 364 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 236 364 moveto
- 253 368 lineto
- 271 371 lineto
- 288 372 lineto
- 306 373 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 376 364 moveto
- 379 377 lineto
- 383 389 lineto
- 386 402 lineto
- 390 415 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 390 415 moveto
- 369 421 lineto
- 348 423 lineto
- 327 422 lineto
- 306 418 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 306 418 moveto
- 306 407 lineto
- 306 396 lineto
- 306 384 lineto
- 306 373 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 306 373 moveto
- 324 372 lineto
- 341 371 lineto
- 359 368 lineto
- 376 364 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 441 337 moveto
- 446 345 lineto
- 450 353 lineto
- 455 361 lineto
- 460 369 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 460 369 moveto
- 443 381 lineto
- 427 394 lineto
- 409 406 lineto
- 390 415 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 390 415 moveto
- 386 402 lineto
- 383 389 lineto
- 379 377 lineto
- 376 364 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 376 364 moveto
- 393 359 lineto
- 409 352 lineto
- 425 345 lineto
- 441 337 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 497 294 moveto
- 505 302 lineto
- 513 310 lineto
- 521 318 lineto
- 529 326 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 529 326 moveto
- 511 336 lineto
- 493 347 lineto
- 476 357 lineto
- 460 369 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 460 369 moveto
- 455 361 lineto
- 450 353 lineto
- 446 345 lineto
- 441 337 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 441 337 moveto
- 456 327 lineto
- 470 317 lineto
- 484 306 lineto
- 497 294 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 145 383 moveto
- 138 394 lineto
- 131 405 lineto
- 125 417 lineto
- 118 428 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 118 428 moveto
- 96 417 lineto
- 77 401 lineto
- 63 380 lineto
- 51 358 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 51 358 moveto
- 59 350 lineto
- 67 342 lineto
- 75 334 lineto
- 83 326 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 83 326 moveto
- 95 343 lineto
- 109 359 lineto
- 126 372 lineto
- 145 383 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 226 400 moveto
- 224 409 lineto
- 222 418 lineto
- 219 427 lineto
- 217 436 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 217 436 moveto
- 193 435 lineto
- 168 436 lineto
- 143 434 lineto
- 118 428 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 118 428 moveto
- 125 417 lineto
- 131 405 lineto
- 138 394 lineto
- 145 383 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 145 383 moveto
- 165 390 lineto
- 185 394 lineto
- 206 397 lineto
- 226 400 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 306 418 moveto
- 306 429 lineto
- 306 441 lineto
- 306 452 lineto
- 306 463 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 306 463 moveto
- 283 453 lineto
- 261 444 lineto
- 239 438 lineto
- 217 436 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 217 436 moveto
- 219 427 lineto
- 222 418 lineto
- 224 409 lineto
- 226 400 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 226 400 moveto
- 246 403 lineto
- 266 408 lineto
- 286 413 lineto
- 306 418 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 390 415 moveto
- 393 428 lineto
- 396 440 lineto
- 400 453 lineto
- 403 466 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 403 466 moveto
- 380 474 lineto
- 355 475 lineto
- 330 471 lineto
- 306 463 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 306 463 moveto
- 306 452 lineto
- 306 441 lineto
- 306 429 lineto
- 306 418 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 306 418 moveto
- 327 422 lineto
- 348 423 lineto
- 369 421 lineto
- 390 415 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 460 369 moveto
- 464 377 lineto
- 469 385 lineto
- 474 393 lineto
- 478 401 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 478 401 moveto
- 461 418 lineto
- 444 436 lineto
- 425 452 lineto
- 403 466 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 403 466 moveto
- 400 453 lineto
- 396 440 lineto
- 393 428 lineto
- 390 415 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 390 415 moveto
- 409 406 lineto
- 427 394 lineto
- 443 381 lineto
- 460 369 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- 0.0000 0.0000 0.4000 setrgbcolor
- newpath
- 529 326 moveto
- 537 334 lineto
- 545 342 lineto
- 553 350 lineto
- 561 358 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 561 358 moveto
- 537 367 lineto
- 516 376 lineto
- 496 387 lineto
- 478 401 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 478 401 moveto
- 474 393 lineto
- 469 385 lineto
- 464 377 lineto
- 460 369 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
- newpath
- 460 369 moveto
- 476 357 lineto
- 493 347 lineto
- 511 336 lineto
- 529 326 lineto
- 0.0000 0.0000 0.4000 setrgbcolor
- stroke
-restore
-showpage
-%%Trailer
-%%Pages: 1
-%%EOF
diff --git a/tests/examplefiles/ceval.c b/tests/examplefiles/ceval.c
deleted file mode 100644
index c6739630..00000000
--- a/tests/examplefiles/ceval.c
+++ /dev/null
@@ -1,2604 +0,0 @@
-
-/* Execute compiled code */
-
-/* XXX TO DO:
- XXX speed up searching for keywords by using a dictionary
- XXX document it!
- */
-
-/* enable more aggressive intra-module optimizations, where available */
-#define PY_LOCAL_AGGRESSIVE
-
-#include "Python.h"
-
-#include "code.h"
-#include "frameobject.h"
-#include "eval.h"
-#include "opcode.h"
-#include "structmember.h"
-
-#include <ctype.h>
-
-#ifndef WITH_TSC
-
-#define READ_TIMESTAMP(var)
-
-#else
-
-typedef unsigned long long uint64;
-
-#if defined(__ppc__) /* <- Don't know if this is the correct symbol; this
- section should work for GCC on any PowerPC platform,
- irrespective of OS. POWER? Who knows :-) */
-
-#define READ_TIMESTAMP(var) ppc_getcounter(&var)
-
-static void
-ppc_getcounter(uint64 *v)
-{
- register unsigned long tbu, tb, tbu2;
-
- loop:
- asm volatile ("mftbu %0" : "=r" (tbu) );
- asm volatile ("mftb %0" : "=r" (tb) );
- asm volatile ("mftbu %0" : "=r" (tbu2));
- if (__builtin_expect(tbu != tbu2, 0)) goto loop;
-
- /* The slightly peculiar way of writing the next lines is
- compiled better by GCC than any other way I tried. */
- ((long*)(v))[0] = tbu;
- ((long*)(v))[1] = tb;
-}
-
-#else /* this is for linux/x86 (and probably any other GCC/x86 combo) */
-
-#define READ_TIMESTAMP(val) \
- __asm__ __volatile__("rdtsc" : "=A" (val))
-
-#endif
-
-void dump_tsc(int opcode, int ticked, uint64 inst0, uint64 inst1,
- uint64 loop0, uint64 loop1, uint64 intr0, uint64 intr1)
-{
- uint64 intr, inst, loop;
- PyThreadState *tstate = PyThreadState_Get();
- if (!tstate->interp->tscdump)
- return;
- intr = intr1 - intr0;
- inst = inst1 - inst0 - intr;
- loop = loop1 - loop0 - intr;
- fprintf(stderr, "opcode=%03d t=%d inst=%06lld loop=%06lld\n",
- opcode, ticked, inst, loop);
-}
-
-#endif
-
-/* Turn this on if your compiler chokes on the big switch: */
-/* #define CASE_TOO_BIG 1 */
-
-#ifdef Py_DEBUG
-/* For debugging the interpreter: */
-#define LLTRACE 1 /* Low-level trace feature */
-#define CHECKEXC 1 /* Double-check exception checking */
-#endif
-
-typedef PyObject *(*callproc)(PyObject *, PyObject *, PyObject *);
-
-/* Forward declarations */
-#ifdef WITH_TSC
-static PyObject * call_function(PyObject ***, int, uint64*, uint64*);
-#else
-static PyObject * call_function(PyObject ***, int);
-#endif
-static PyObject * fast_function(PyObject *, PyObject ***, int, int, int);
-static PyObject * do_call(PyObject *, PyObject ***, int, int);
-static PyObject * ext_do_call(PyObject *, PyObject ***, int, int, int);
-static PyObject * update_keyword_args(PyObject *, int, PyObject ***,PyObject *);
-static PyObject * update_star_args(int, int, PyObject *, PyObject ***);
-static PyObject * load_args(PyObject ***, int);
-#define CALL_FLAG_VAR 1
-#define CALL_FLAG_KW 2
-
-#ifdef LLTRACE
-static int lltrace;
-static int prtrace(PyObject *, char *);
-#endif
-static int call_trace(Py_tracefunc, PyObject *, PyFrameObject *,
- int, PyObject *);
-static void call_trace_protected(Py_tracefunc, PyObject *,
- PyFrameObject *, int, PyObject *);
-static void call_exc_trace(Py_tracefunc, PyObject *, PyFrameObject *);
-static int maybe_call_line_trace(Py_tracefunc, PyObject *,
- PyFrameObject *, int *, int *, int *);
-
-static PyObject * apply_slice(PyObject *, PyObject *, PyObject *);
-static int assign_slice(PyObject *, PyObject *,
- PyObject *, PyObject *);
-static PyObject * cmp_outcome(int, PyObject *, PyObject *);
-static PyObject * import_from(PyObject *, PyObject *);
-static int import_all_from(PyObject *, PyObject *);
-static PyObject * build_class(PyObject *, PyObject *, PyObject *);
-static int exec_statement(PyFrameObject *,
- PyObject *, PyObject *, PyObject *);
-static void set_exc_info(PyThreadState *, PyObject *, PyObject *, PyObject *);
-static void reset_exc_info(PyThreadState *);
-static void format_exc_check_arg(PyObject *, char *, PyObject *);
-static PyObject * string_concatenate(PyObject *, PyObject *,
- PyFrameObject *, unsigned char *);
-
-#define NAME_ERROR_MSG \
- "name '%.200s' is not defined"
-#define GLOBAL_NAME_ERROR_MSG \
- "global name '%.200s' is not defined"
-#define UNBOUNDLOCAL_ERROR_MSG \
- "local variable '%.200s' referenced before assignment"
-#define UNBOUNDFREE_ERROR_MSG \
- "free variable '%.200s' referenced before assignment" \
- " in enclosing scope"
-
-/* Dynamic execution profile */
-#ifdef DYNAMIC_EXECUTION_PROFILE
-#ifdef DXPAIRS
-static long dxpairs[257][256];
-#define dxp dxpairs[256]
-#else
-static long dxp[256];
-#endif
-#endif
-
-/* Function call profile */
-#ifdef CALL_PROFILE
-#define PCALL_NUM 11
-static int pcall[PCALL_NUM];
-
-#define PCALL_ALL 0
-#define PCALL_FUNCTION 1
-#define PCALL_FAST_FUNCTION 2
-#define PCALL_FASTER_FUNCTION 3
-#define PCALL_METHOD 4
-#define PCALL_BOUND_METHOD 5
-#define PCALL_CFUNCTION 6
-#define PCALL_TYPE 7
-#define PCALL_GENERATOR 8
-#define PCALL_OTHER 9
-#define PCALL_POP 10
-
-/* Notes about the statistics
-
- PCALL_FAST stats
-
- FAST_FUNCTION means no argument tuple needs to be created.
- FASTER_FUNCTION means that the fast-path frame setup code is used.
-
- If there is a method call where the call can be optimized by changing
- the argument tuple and calling the function directly, it gets recorded
- twice.
-
- As a result, the relationship among the statistics appears to be
- PCALL_ALL == PCALL_FUNCTION + PCALL_METHOD - PCALL_BOUND_METHOD +
- PCALL_CFUNCTION + PCALL_TYPE + PCALL_GENERATOR + PCALL_OTHER
- PCALL_FUNCTION > PCALL_FAST_FUNCTION > PCALL_FASTER_FUNCTION
- PCALL_METHOD > PCALL_BOUND_METHOD
-*/
-
-#define PCALL(POS) pcall[POS]++
-
-PyObject *
-PyEval_GetCallStats(PyObject *self)
-{
- return Py_BuildValue("iiiiiiiiii",
- pcall[0], pcall[1], pcall[2], pcall[3],
- pcall[4], pcall[5], pcall[6], pcall[7],
- pcall[8], pcall[9]);
-}
-#else
-#define PCALL(O)
-
-PyObject *
-PyEval_GetCallStats(PyObject *self)
-{
- Py_INCREF(Py_None);
- return Py_None;
-}
-#endif
-
-
-#ifdef WITH_THREAD
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#include "pythread.h"
-
-static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */
-static long main_thread = 0;
-
-int
-PyEval_ThreadsInitialized(void)
-{
- return interpreter_lock != 0;
-}
-
-void
-PyEval_InitThreads(void)
-{
- if (interpreter_lock)
- return;
- interpreter_lock = PyThread_allocate_lock();
- PyThread_acquire_lock(interpreter_lock, 1);
- main_thread = PyThread_get_thread_ident();
-}
-
-void
-PyEval_AcquireLock(void)
-{
- PyThread_acquire_lock(interpreter_lock, 1);
-}
-
-void
-PyEval_ReleaseLock(void)
-{
- PyThread_release_lock(interpreter_lock);
-}
-
-void
-PyEval_AcquireThread(PyThreadState *tstate)
-{
- if (tstate == NULL)
- Py_FatalError("PyEval_AcquireThread: NULL new thread state");
- /* Check someone has called PyEval_InitThreads() to create the lock */
- assert(interpreter_lock);
- PyThread_acquire_lock(interpreter_lock, 1);
- if (PyThreadState_Swap(tstate) != NULL)
- Py_FatalError(
- "PyEval_AcquireThread: non-NULL old thread state");
-}
-
-void
-PyEval_ReleaseThread(PyThreadState *tstate)
-{
- if (tstate == NULL)
- Py_FatalError("PyEval_ReleaseThread: NULL thread state");
- if (PyThreadState_Swap(NULL) != tstate)
- Py_FatalError("PyEval_ReleaseThread: wrong thread state");
- PyThread_release_lock(interpreter_lock);
-}
-
-/* This function is called from PyOS_AfterFork to ensure that newly
- created child processes don't hold locks referring to threads which
- are not running in the child process. (This could also be done using
- pthread_atfork mechanism, at least for the pthreads implementation.) */
-
-void
-PyEval_ReInitThreads(void)
-{
- if (!interpreter_lock)
- return;
- /*XXX Can't use PyThread_free_lock here because it does too
- much error-checking. Doing this cleanly would require
- adding a new function to each thread_*.h. Instead, just
- create a new lock and waste a little bit of memory */
- interpreter_lock = PyThread_allocate_lock();
- PyThread_acquire_lock(interpreter_lock, 1);
- main_thread = PyThread_get_thread_ident();
-}
-#endif
-
-/* Functions save_thread and restore_thread are always defined so
- dynamically loaded modules needn't be compiled separately for use
- with and without threads: */
-
-PyThreadState *
-PyEval_SaveThread(void)
-{
- PyThreadState *tstate = PyThreadState_Swap(NULL);
- if (tstate == NULL)
- Py_FatalError("PyEval_SaveThread: NULL tstate");
-#ifdef WITH_THREAD
- if (interpreter_lock)
- PyThread_release_lock(interpreter_lock);
-#endif
- return tstate;
-}
-
-void
-PyEval_RestoreThread(PyThreadState *tstate)
-{
- if (tstate == NULL)
- Py_FatalError("PyEval_RestoreThread: NULL tstate");
-#ifdef WITH_THREAD
- if (interpreter_lock) {
- int err = errno;
- PyThread_acquire_lock(interpreter_lock, 1);
- errno = err;
- }
-#endif
- PyThreadState_Swap(tstate);
-}
-
-
-/* Mechanism whereby asynchronously executing callbacks (e.g. UNIX
- signal handlers or Mac I/O completion routines) can schedule calls
- to a function to be called synchronously.
- The synchronous function is called with one void* argument.
- It should return 0 for success or -1 for failure -- failure should
- be accompanied by an exception.
-
- If registry succeeds, the registry function returns 0; if it fails
- (e.g. due to too many pending calls) it returns -1 (without setting
- an exception condition).
-
- Note that because registry may occur from within signal handlers,
- or other asynchronous events, calling malloc() is unsafe!
-
-#ifdef WITH_THREAD
- Any thread can schedule pending calls, but only the main thread
- will execute them.
-#endif
-
- XXX WARNING! ASYNCHRONOUSLY EXECUTING CODE!
- There are two possible race conditions:
- (1) nested asynchronous registry calls;
- (2) registry calls made while pending calls are being processed.
- While (1) is very unlikely, (2) is a real possibility.
- The current code is safe against (2), but not against (1).
- The safety against (2) is derived from the fact that only one
- thread (the main thread) ever takes things out of the queue.
-
- XXX Darn! With the advent of thread state, we should have an array
- of pending calls per thread in the thread state! Later...
-*/
-
-#define NPENDINGCALLS 32
-static struct {
- int (*func)(void *);
- void *arg;
-} pendingcalls[NPENDINGCALLS];
-static volatile int pendingfirst = 0;
-static volatile int pendinglast = 0;
-static volatile int things_to_do = 0;
-
-int
-Py_AddPendingCall(int (*func)(void *), void *arg)
-{
- static volatile int busy = 0;
- int i, j;
- /* XXX Begin critical section */
- /* XXX If you want this to be safe against nested
- XXX asynchronous calls, you'll have to work harder! */
- if (busy)
- return -1;
- busy = 1;
- i = pendinglast;
- j = (i + 1) % NPENDINGCALLS;
- if (j == pendingfirst) {
- busy = 0;
- return -1; /* Queue full */
- }
- pendingcalls[i].func = func;
- pendingcalls[i].arg = arg;
- pendinglast = j;
-
- _Py_Ticker = 0;
- things_to_do = 1; /* Signal main loop */
- busy = 0;
- /* XXX End critical section */
- return 0;
-}
-
-int
-Py_MakePendingCalls(void)
-{
- static int busy = 0;
-#ifdef WITH_THREAD
- if (main_thread && PyThread_get_thread_ident() != main_thread)
- return 0;
-#endif
- if (busy)
- return 0;
- busy = 1;
- things_to_do = 0;
- for (;;) {
- int i;
- int (*func)(void *);
- void *arg;
- i = pendingfirst;
- if (i == pendinglast)
- break; /* Queue empty */
- func = pendingcalls[i].func;
- arg = pendingcalls[i].arg;
- pendingfirst = (i + 1) % NPENDINGCALLS;
- if (func(arg) < 0) {
- busy = 0;
- things_to_do = 1; /* We're not done yet */
- return -1;
- }
- }
- busy = 0;
- return 0;
-}
-
-
-/* The interpreter's recursion limit */
-
-#ifndef Py_DEFAULT_RECURSION_LIMIT
-#define Py_DEFAULT_RECURSION_LIMIT 1000
-#endif
-static int recursion_limit = Py_DEFAULT_RECURSION_LIMIT;
-int _Py_CheckRecursionLimit = Py_DEFAULT_RECURSION_LIMIT;
-
-int
-Py_GetRecursionLimit(void)
-{
- return recursion_limit;
-}
-
-void
-Py_SetRecursionLimit(int new_limit)
-{
- recursion_limit = new_limit;
- _Py_CheckRecursionLimit = recursion_limit;
-}
-
-/* the macro Py_EnterRecursiveCall() only calls _Py_CheckRecursiveCall()
- if the recursion_depth reaches _Py_CheckRecursionLimit.
- If USE_STACKCHECK, the macro decrements _Py_CheckRecursionLimit
- to guarantee that _Py_CheckRecursiveCall() is regularly called.
- Without USE_STACKCHECK, there is no need for this. */
-int
-_Py_CheckRecursiveCall(char *where)
-{
- PyThreadState *tstate = PyThreadState_GET();
-
-#ifdef USE_STACKCHECK
- if (PyOS_CheckStack()) {
- --tstate->recursion_depth;
- PyErr_SetString(PyExc_MemoryError, "Stack overflow");
- return -1;
- }
-#endif
- if (tstate->recursion_depth > recursion_limit) {
- --tstate->recursion_depth;
- PyErr_Format(PyExc_RuntimeError,
- "maximum recursion depth exceeded%s",
- where);
- return -1;
- }
- _Py_CheckRecursionLimit = recursion_limit;
- return 0;
-}
-
-/* Status code for main loop (reason for stack unwind) */
-enum why_code {
- WHY_NOT = 0x0001, /* No error */
- WHY_EXCEPTION = 0x0002, /* Exception occurred */
- WHY_RERAISE = 0x0004, /* Exception re-raised by 'finally' */
- WHY_RETURN = 0x0008, /* 'return' statement */
- WHY_BREAK = 0x0010, /* 'break' statement */
- WHY_CONTINUE = 0x0020, /* 'continue' statement */
- WHY_YIELD = 0x0040 /* 'yield' operator */
-};
-
-static enum why_code do_raise(PyObject *, PyObject *, PyObject *);
-static int unpack_iterable(PyObject *, int, PyObject **);
-
-/* for manipulating the thread switch and periodic "stuff" - used to be
- per thread, now just a pair o' globals */
-int _Py_CheckInterval = 100;
-volatile int _Py_Ticker = 100;
-
-PyObject *
-PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
-{
- /* XXX raise SystemError if globals is NULL */
- return PyEval_EvalCodeEx(co,
- globals, locals,
- (PyObject **)NULL, 0,
- (PyObject **)NULL, 0,
- (PyObject **)NULL, 0,
- NULL);
-}
-
-
-/* Interpreter main loop */
-
-PyObject *
-PyEval_EvalFrame(PyFrameObject *f) {
- /* This is for backward compatibility with extension modules that
- used this API; core interpreter code should call PyEval_EvalFrameEx() */
- return PyEval_EvalFrameEx(f, 0);
-}
-
-PyObject *
-PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
-{
-#ifdef DXPAIRS
- int lastopcode = 0;
-#endif
- register PyObject **stack_pointer; /* Next free slot in value stack */
- register unsigned char *next_instr;
- register int opcode; /* Current opcode */
- register int oparg; /* Current opcode argument, if any */
- register enum why_code why; /* Reason for block stack unwind */
- register int err; /* Error status -- nonzero if error */
- register PyObject *x; /* Result object -- NULL if error */
- register PyObject *v; /* Temporary objects popped off stack */
- register PyObject *w;
- register PyObject *u;
- register PyObject *t;
- register PyObject *stream = NULL; /* for PRINT opcodes */
- register PyObject **fastlocals, **freevars;
- PyObject *retval = NULL; /* Return value */
- PyThreadState *tstate = PyThreadState_GET();
- PyCodeObject *co;
-
- /* when tracing we set things up so that
-
- not (instr_lb <= current_bytecode_offset < instr_ub)
-
- is true when the line being executed has changed. The
- initial values are such as to make this false the first
- time it is tested. */
- int instr_ub = -1, instr_lb = 0, instr_prev = -1;
-
- unsigned char *first_instr;
- PyObject *names;
- PyObject *consts;
-#if defined(Py_DEBUG) || defined(LLTRACE)
- /* Make it easier to find out where we are with a debugger */
- char *filename;
-#endif
-
-/* Tuple access macros */
-
-#ifndef Py_DEBUG
-#define GETITEM(v, i) PyTuple_GET_ITEM((PyTupleObject *)(v), (i))
-#else
-#define GETITEM(v, i) PyTuple_GetItem((v), (i))
-#endif
-
-#ifdef WITH_TSC
-/* Use Pentium timestamp counter to mark certain events:
- inst0 -- beginning of switch statement for opcode dispatch
- inst1 -- end of switch statement (may be skipped)
- loop0 -- the top of the mainloop
- loop1 -- place where control returns again to top of mainloop
- (may be skipped)
- intr1 -- beginning of long interruption
- intr2 -- end of long interruption
-
- Many opcodes call out to helper C functions. In some cases, the
- time in those functions should be counted towards the time for the
- opcode, but not in all cases. For example, a CALL_FUNCTION opcode
- calls another Python function; there's no point in charge all the
- bytecode executed by the called function to the caller.
-
- It's hard to make a useful judgement statically. In the presence
- of operator overloading, it's impossible to tell if a call will
- execute new Python code or not.
-
- It's a case-by-case judgement. I'll use intr1 for the following
- cases:
-
- EXEC_STMT
- IMPORT_STAR
- IMPORT_FROM
- CALL_FUNCTION (and friends)
-
- */
- uint64 inst0, inst1, loop0, loop1, intr0 = 0, intr1 = 0;
- int ticked = 0;
-
- READ_TIMESTAMP(inst0);
- READ_TIMESTAMP(inst1);
- READ_TIMESTAMP(loop0);
- READ_TIMESTAMP(loop1);
-
- /* shut up the compiler */
- opcode = 0;
-#endif
-
-/* Code access macros */
-
-#define INSTR_OFFSET() ((int)(next_instr - first_instr))
-#define NEXTOP() (*next_instr++)
-#define NEXTARG() (next_instr += 2, (next_instr[-1]<<8) + next_instr[-2])
-#define PEEKARG() ((next_instr[2]<<8) + next_instr[1])
-#define JUMPTO(x) (next_instr = first_instr + (x))
-#define JUMPBY(x) (next_instr += (x))
-
-/* OpCode prediction macros
- Some opcodes tend to come in pairs thus making it possible to predict
- the second code when the first is run. For example, COMPARE_OP is often
- followed by JUMP_IF_FALSE or JUMP_IF_TRUE. And, those opcodes are often
- followed by a POP_TOP.
-
- Verifying the prediction costs a single high-speed test of register
- variable against a constant. If the pairing was good, then the
- processor has a high likelihood of making its own successful branch
- prediction which results in a nearly zero overhead transition to the
- next opcode.
-
- A successful prediction saves a trip through the eval-loop including
- its two unpredictable branches, the HASARG test and the switch-case.
-
- If collecting opcode statistics, turn off prediction so that
- statistics are accurately maintained (the predictions bypass
- the opcode frequency counter updates).
-*/
-
-#ifdef DYNAMIC_EXECUTION_PROFILE
-#define PREDICT(op) if (0) goto PRED_##op
-#else
-#define PREDICT(op) if (*next_instr == op) goto PRED_##op
-#endif
-
-#define PREDICTED(op) PRED_##op: next_instr++
-#define PREDICTED_WITH_ARG(op) PRED_##op: oparg = PEEKARG(); next_instr += 3
-
-/* Stack manipulation macros */
-
-/* The stack can grow at most MAXINT deep, as co_nlocals and
- co_stacksize are ints. */
-#define STACK_LEVEL() ((int)(stack_pointer - f->f_valuestack))
-#define EMPTY() (STACK_LEVEL() == 0)
-#define TOP() (stack_pointer[-1])
-#define SECOND() (stack_pointer[-2])
-#define THIRD() (stack_pointer[-3])
-#define FOURTH() (stack_pointer[-4])
-#define SET_TOP(v) (stack_pointer[-1] = (v))
-#define SET_SECOND(v) (stack_pointer[-2] = (v))
-#define SET_THIRD(v) (stack_pointer[-3] = (v))
-#define SET_FOURTH(v) (stack_pointer[-4] = (v))
-#define BASIC_STACKADJ(n) (stack_pointer += n)
-#define BASIC_PUSH(v) (*stack_pointer++ = (v))
-#define BASIC_POP() (*--stack_pointer)
-
-#ifdef LLTRACE
-#define PUSH(v) { (void)(BASIC_PUSH(v), \
- lltrace && prtrace(TOP(), "push")); \
- assert(STACK_LEVEL() <= co->co_stacksize); }
-#define POP() ((void)(lltrace && prtrace(TOP(), "pop")), BASIC_POP())
-#define STACKADJ(n) { (void)(BASIC_STACKADJ(n), \
- lltrace && prtrace(TOP(), "stackadj")); \
- assert(STACK_LEVEL() <= co->co_stacksize); }
-#define EXT_POP(STACK_POINTER) (lltrace && prtrace(*(STACK_POINTER), "ext_pop"), *--(STACK_POINTER))
-#else
-#define PUSH(v) BASIC_PUSH(v)
-#define POP() BASIC_POP()
-#define STACKADJ(n) BASIC_STACKADJ(n)
-#define EXT_POP(STACK_POINTER) (*--(STACK_POINTER))
-#endif
-
-/* Local variable macros */
-
-#define GETLOCAL(i) (fastlocals[i])
-
-/* The SETLOCAL() macro must not DECREF the local variable in-place and
- then store the new value; it must copy the old value to a temporary
- value, then store the new value, and then DECREF the temporary value.
- This is because it is possible that during the DECREF the frame is
- accessed by other code (e.g. a __del__ method or gc.collect()) and the
- variable would be pointing to already-freed memory. */
-#define SETLOCAL(i, value) do { PyObject *tmp = GETLOCAL(i); \
- GETLOCAL(i) = value; \
- Py_XDECREF(tmp); } while (0)
-
-/* Start of code */
-
- if (f == NULL)
- return NULL;
-
- /* push frame */
- if (Py_EnterRecursiveCall(""))
- return NULL;
-
- tstate->frame = f;
-
- if (tstate->use_tracing) {
- if (tstate->c_tracefunc != NULL) {
- /* tstate->c_tracefunc, if defined, is a
- function that will be called on *every* entry
- to a code block. Its return value, if not
- None, is a function that will be called at
- the start of each executed line of code.
- (Actually, the function must return itself
- in order to continue tracing.) The trace
- functions are called with three arguments:
- a pointer to the current frame, a string
- indicating why the function is called, and
- an argument which depends on the situation.
- The global trace function is also called
- whenever an exception is detected. */
- if (call_trace(tstate->c_tracefunc, tstate->c_traceobj,
- f, PyTrace_CALL, Py_None)) {
- /* Trace function raised an error */
- goto exit_eval_frame;
- }
- }
- if (tstate->c_profilefunc != NULL) {
- /* Similar for c_profilefunc, except it needn't
- return itself and isn't called for "line" events */
- if (call_trace(tstate->c_profilefunc,
- tstate->c_profileobj,
- f, PyTrace_CALL, Py_None)) {
- /* Profile function raised an error */
- goto exit_eval_frame;
- }
- }
- }
-
- co = f->f_code;
- names = co->co_names;
- consts = co->co_consts;
- fastlocals = f->f_localsplus;
- freevars = f->f_localsplus + co->co_nlocals;
- first_instr = (unsigned char*) PyString_AS_STRING(co->co_code);
- /* An explanation is in order for the next line.
-
- f->f_lasti now refers to the index of the last instruction
- executed. You might think this was obvious from the name, but
- this wasn't always true before 2.3! PyFrame_New now sets
- f->f_lasti to -1 (i.e. the index *before* the first instruction)
- and YIELD_VALUE doesn't fiddle with f_lasti any more. So this
- does work. Promise. */
- next_instr = first_instr + f->f_lasti + 1;
- stack_pointer = f->f_stacktop;
- assert(stack_pointer != NULL);
- f->f_stacktop = NULL; /* remains NULL unless yield suspends frame */
-
-#ifdef LLTRACE
- lltrace = PyDict_GetItemString(f->f_globals, "__lltrace__") != NULL;
-#endif
-#if defined(Py_DEBUG) || defined(LLTRACE)
- filename = PyString_AsString(co->co_filename);
-#endif
-
- why = WHY_NOT;
- err = 0;
- x = Py_None; /* Not a reference, just anything non-NULL */
- w = NULL;
-
- if (throwflag) { /* support for generator.throw() */
- why = WHY_EXCEPTION;
- goto on_error;
- }
-
- for (;;) {
-#ifdef WITH_TSC
- if (inst1 == 0) {
- /* Almost surely, the opcode executed a break
- or a continue, preventing inst1 from being set
- on the way out of the loop.
- */
- READ_TIMESTAMP(inst1);
- loop1 = inst1;
- }
- dump_tsc(opcode, ticked, inst0, inst1, loop0, loop1,
- intr0, intr1);
- ticked = 0;
- inst1 = 0;
- intr0 = 0;
- intr1 = 0;
- READ_TIMESTAMP(loop0);
-#endif
- assert(stack_pointer >= f->f_valuestack); /* else underflow */
- assert(STACK_LEVEL() <= co->co_stacksize); /* else overflow */
-
- /* Do periodic things. Doing this every time through
- the loop would add too much overhead, so we do it
- only every Nth instruction. We also do it if
- ``things_to_do'' is set, i.e. when an asynchronous
- event needs attention (e.g. a signal handler or
- async I/O handler); see Py_AddPendingCall() and
- Py_MakePendingCalls() above. */
-
- if (--_Py_Ticker < 0) {
- if (*next_instr == SETUP_FINALLY) {
- /* Make the last opcode before
- a try: finally: block uninterruptable. */
- goto fast_next_opcode;
- }
- _Py_Ticker = _Py_CheckInterval;
- tstate->tick_counter++;
-#ifdef WITH_TSC
- ticked = 1;
-#endif
- if (things_to_do) {
- if (Py_MakePendingCalls() < 0) {
- why = WHY_EXCEPTION;
- goto on_error;
- }
- if (things_to_do)
- /* MakePendingCalls() didn't succeed.
- Force early re-execution of this
- "periodic" code, possibly after
- a thread switch */
- _Py_Ticker = 0;
- }
-#ifdef WITH_THREAD
- if (interpreter_lock) {
- /* Give another thread a chance */
-
- if (PyThreadState_Swap(NULL) != tstate)
- Py_FatalError("ceval: tstate mix-up");
- PyThread_release_lock(interpreter_lock);
-
- /* Other threads may run now */
-
- PyThread_acquire_lock(interpreter_lock, 1);
- if (PyThreadState_Swap(tstate) != NULL)
- Py_FatalError("ceval: orphan tstate");
-
- /* Check for thread interrupts */
-
- if (tstate->async_exc != NULL) {
- x = tstate->async_exc;
- tstate->async_exc = NULL;
- PyErr_SetNone(x);
- Py_DECREF(x);
- why = WHY_EXCEPTION;
- goto on_error;
- }
- }
-#endif
- }
-
- fast_next_opcode:
- f->f_lasti = INSTR_OFFSET();
-
- /* line-by-line tracing support */
-
- if (tstate->c_tracefunc != NULL && !tstate->tracing) {
- /* see maybe_call_line_trace
- for expository comments */
- f->f_stacktop = stack_pointer;
-
- err = maybe_call_line_trace(tstate->c_tracefunc,
- tstate->c_traceobj,
- f, &instr_lb, &instr_ub,
- &instr_prev);
- /* Reload possibly changed frame fields */
- JUMPTO(f->f_lasti);
- if (f->f_stacktop != NULL) {
- stack_pointer = f->f_stacktop;
- f->f_stacktop = NULL;
- }
- if (err) {
- /* trace function raised an exception */
- goto on_error;
- }
- }
-
- /* Extract opcode and argument */
-
- opcode = NEXTOP();
- oparg = 0; /* allows oparg to be stored in a register because
- it doesn't have to be remembered across a full loop */
- if (HAS_ARG(opcode))
- oparg = NEXTARG();
- dispatch_opcode:
-#ifdef DYNAMIC_EXECUTION_PROFILE
-#ifdef DXPAIRS
- dxpairs[lastopcode][opcode]++;
- lastopcode = opcode;
-#endif
- dxp[opcode]++;
-#endif
-
-#ifdef LLTRACE
- /* Instruction tracing */
-
- if (lltrace) {
- if (HAS_ARG(opcode)) {
- printf("%d: %d, %d\n",
- f->f_lasti, opcode, oparg);
- }
- else {
- printf("%d: %d\n",
- f->f_lasti, opcode);
- }
- }
-#endif
-
- /* Main switch on opcode */
- READ_TIMESTAMP(inst0);
-
- switch (opcode) {
-
- /* BEWARE!
- It is essential that any operation that fails sets either
- x to NULL, err to nonzero, or why to anything but WHY_NOT,
- and that no operation that succeeds does this! */
-
- /* case STOP_CODE: this is an error! */
-
- case NOP:
- goto fast_next_opcode;
-
- case LOAD_FAST:
- x = GETLOCAL(oparg);
- if (x != NULL) {
- Py_INCREF(x);
- PUSH(x);
- goto fast_next_opcode;
- }
- format_exc_check_arg(PyExc_UnboundLocalError,
- UNBOUNDLOCAL_ERROR_MSG,
- PyTuple_GetItem(co->co_varnames, oparg));
- break;
-
- case LOAD_CONST:
- x = GETITEM(consts, oparg);
- Py_INCREF(x);
- PUSH(x);
- goto fast_next_opcode;
-
- PREDICTED_WITH_ARG(STORE_FAST);
- case STORE_FAST:
- v = POP();
- SETLOCAL(oparg, v);
- goto fast_next_opcode;
-
- PREDICTED(POP_TOP);
- case POP_TOP:
- v = POP();
- Py_DECREF(v);
- goto fast_next_opcode;
-
- case ROT_TWO:
- v = TOP();
- w = SECOND();
- SET_TOP(w);
- SET_SECOND(v);
- goto fast_next_opcode;
-
- case ROT_THREE:
- v = TOP();
- w = SECOND();
- x = THIRD();
- SET_TOP(w);
- SET_SECOND(x);
- SET_THIRD(v);
- goto fast_next_opcode;
-
- case ROT_FOUR:
- u = TOP();
- v = SECOND();
- w = THIRD();
- x = FOURTH();
- SET_TOP(v);
- SET_SECOND(w);
- SET_THIRD(x);
- SET_FOURTH(u);
- goto fast_next_opcode;
-
- case DUP_TOP:
- v = TOP();
- Py_INCREF(v);
- PUSH(v);
- goto fast_next_opcode;
-
- case DUP_TOPX:
- if (oparg == 2) {
- x = TOP();
- Py_INCREF(x);
- w = SECOND();
- Py_INCREF(w);
- STACKADJ(2);
- SET_TOP(x);
- SET_SECOND(w);
- goto fast_next_opcode;
- } else if (oparg == 3) {
- x = TOP();
- Py_INCREF(x);
- w = SECOND();
- Py_INCREF(w);
- v = THIRD();
- Py_INCREF(v);
- STACKADJ(3);
- SET_TOP(x);
- SET_SECOND(w);
- SET_THIRD(v);
- goto fast_next_opcode;
- }
- Py_FatalError("invalid argument to DUP_TOPX"
- " (bytecode corruption?)");
- break;
-
- case UNARY_POSITIVE:
- v = TOP();
- x = PyNumber_Positive(v);
- Py_DECREF(v);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case UNARY_NEGATIVE:
- v = TOP();
- x = PyNumber_Negative(v);
- Py_DECREF(v);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case UNARY_NOT:
- v = TOP();
- err = PyObject_IsTrue(v);
- Py_DECREF(v);
- if (err == 0) {
- Py_INCREF(Py_True);
- SET_TOP(Py_True);
- continue;
- }
- else if (err > 0) {
- Py_INCREF(Py_False);
- SET_TOP(Py_False);
- err = 0;
- continue;
- }
- STACKADJ(-1);
- break;
-
- case UNARY_CONVERT:
- v = TOP();
- x = PyObject_Repr(v);
- Py_DECREF(v);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case UNARY_INVERT:
- v = TOP();
- x = PyNumber_Invert(v);
- Py_DECREF(v);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_POWER:
- w = POP();
- v = TOP();
- x = PyNumber_Power(v, w, Py_None);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_MULTIPLY:
- w = POP();
- v = TOP();
- x = PyNumber_Multiply(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_DIVIDE:
- if (!_Py_QnewFlag) {
- w = POP();
- v = TOP();
- x = PyNumber_Divide(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
- }
- /* -Qnew is in effect: fall through to
- BINARY_TRUE_DIVIDE */
- case BINARY_TRUE_DIVIDE:
- w = POP();
- v = TOP();
- x = PyNumber_TrueDivide(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_FLOOR_DIVIDE:
- w = POP();
- v = TOP();
- x = PyNumber_FloorDivide(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_MODULO:
- w = POP();
- v = TOP();
- x = PyNumber_Remainder(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_ADD:
- w = POP();
- v = TOP();
- if (PyInt_CheckExact(v) && PyInt_CheckExact(w)) {
- /* INLINE: int + int */
- register long a, b, i;
- a = PyInt_AS_LONG(v);
- b = PyInt_AS_LONG(w);
- i = a + b;
- if ((i^a) < 0 && (i^b) < 0)
- goto slow_add;
- x = PyInt_FromLong(i);
- }
- else if (PyString_CheckExact(v) &&
- PyString_CheckExact(w)) {
- x = string_concatenate(v, w, f, next_instr);
- /* string_concatenate consumed the ref to v */
- goto skip_decref_vx;
- }
- else {
- slow_add:
- x = PyNumber_Add(v, w);
- }
- Py_DECREF(v);
- skip_decref_vx:
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_SUBTRACT:
- w = POP();
- v = TOP();
- if (PyInt_CheckExact(v) && PyInt_CheckExact(w)) {
- /* INLINE: int - int */
- register long a, b, i;
- a = PyInt_AS_LONG(v);
- b = PyInt_AS_LONG(w);
- i = a - b;
- if ((i^a) < 0 && (i^~b) < 0)
- goto slow_sub;
- x = PyInt_FromLong(i);
- }
- else {
- slow_sub:
- x = PyNumber_Subtract(v, w);
- }
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_SUBSCR:
- w = POP();
- v = TOP();
- if (PyList_CheckExact(v) && PyInt_CheckExact(w)) {
- /* INLINE: list[int] */
- Py_ssize_t i = PyInt_AsSsize_t(w);
- if (i < 0)
- i += PyList_GET_SIZE(v);
- if (i >= 0 && i < PyList_GET_SIZE(v)) {
- x = PyList_GET_ITEM(v, i);
- Py_INCREF(x);
- }
- else
- goto slow_get;
- }
- else
- slow_get:
- x = PyObject_GetItem(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_LSHIFT:
- w = POP();
- v = TOP();
- x = PyNumber_Lshift(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_RSHIFT:
- w = POP();
- v = TOP();
- x = PyNumber_Rshift(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_AND:
- w = POP();
- v = TOP();
- x = PyNumber_And(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_XOR:
- w = POP();
- v = TOP();
- x = PyNumber_Xor(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case BINARY_OR:
- w = POP();
- v = TOP();
- x = PyNumber_Or(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case LIST_APPEND:
- w = POP();
- v = POP();
- err = PyList_Append(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- if (err == 0) {
- PREDICT(JUMP_ABSOLUTE);
- continue;
- }
- break;
-
- case INPLACE_POWER:
- w = POP();
- v = TOP();
- x = PyNumber_InPlacePower(v, w, Py_None);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_MULTIPLY:
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceMultiply(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_DIVIDE:
- if (!_Py_QnewFlag) {
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceDivide(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
- }
- /* -Qnew is in effect: fall through to
- INPLACE_TRUE_DIVIDE */
- case INPLACE_TRUE_DIVIDE:
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceTrueDivide(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_FLOOR_DIVIDE:
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceFloorDivide(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_MODULO:
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceRemainder(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_ADD:
- w = POP();
- v = TOP();
- if (PyInt_CheckExact(v) && PyInt_CheckExact(w)) {
- /* INLINE: int + int */
- register long a, b, i;
- a = PyInt_AS_LONG(v);
- b = PyInt_AS_LONG(w);
- i = a + b;
- if ((i^a) < 0 && (i^b) < 0)
- goto slow_iadd;
- x = PyInt_FromLong(i);
- }
- else if (PyString_CheckExact(v) &&
- PyString_CheckExact(w)) {
- x = string_concatenate(v, w, f, next_instr);
- /* string_concatenate consumed the ref to v */
- goto skip_decref_v;
- }
- else {
- slow_iadd:
- x = PyNumber_InPlaceAdd(v, w);
- }
- Py_DECREF(v);
- skip_decref_v:
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_SUBTRACT:
- w = POP();
- v = TOP();
- if (PyInt_CheckExact(v) && PyInt_CheckExact(w)) {
- /* INLINE: int - int */
- register long a, b, i;
- a = PyInt_AS_LONG(v);
- b = PyInt_AS_LONG(w);
- i = a - b;
- if ((i^a) < 0 && (i^~b) < 0)
- goto slow_isub;
- x = PyInt_FromLong(i);
- }
- else {
- slow_isub:
- x = PyNumber_InPlaceSubtract(v, w);
- }
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_LSHIFT:
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceLshift(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_RSHIFT:
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceRshift(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_AND:
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceAnd(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_XOR:
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceXor(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case INPLACE_OR:
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceOr(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case SLICE+0:
- case SLICE+1:
- case SLICE+2:
- case SLICE+3:
- if ((opcode-SLICE) & 2)
- w = POP();
- else
- w = NULL;
- if ((opcode-SLICE) & 1)
- v = POP();
- else
- v = NULL;
- u = TOP();
- x = apply_slice(u, v, w);
- Py_DECREF(u);
- Py_XDECREF(v);
- Py_XDECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case STORE_SLICE+0:
- case STORE_SLICE+1:
- case STORE_SLICE+2:
- case STORE_SLICE+3:
- if ((opcode-STORE_SLICE) & 2)
- w = POP();
- else
- w = NULL;
- if ((opcode-STORE_SLICE) & 1)
- v = POP();
- else
- v = NULL;
- u = POP();
- t = POP();
- err = assign_slice(u, v, w, t); /* u[v:w] = t */
- Py_DECREF(t);
- Py_DECREF(u);
- Py_XDECREF(v);
- Py_XDECREF(w);
- if (err == 0) continue;
- break;
-
- case DELETE_SLICE+0:
- case DELETE_SLICE+1:
- case DELETE_SLICE+2:
- case DELETE_SLICE+3:
- if ((opcode-DELETE_SLICE) & 2)
- w = POP();
- else
- w = NULL;
- if ((opcode-DELETE_SLICE) & 1)
- v = POP();
- else
- v = NULL;
- u = POP();
- err = assign_slice(u, v, w, (PyObject *)NULL);
- /* del u[v:w] */
- Py_DECREF(u);
- Py_XDECREF(v);
- Py_XDECREF(w);
- if (err == 0) continue;
- break;
-
- case STORE_SUBSCR:
- w = TOP();
- v = SECOND();
- u = THIRD();
- STACKADJ(-3);
- /* v[w] = u */
- err = PyObject_SetItem(v, w, u);
- Py_DECREF(u);
- Py_DECREF(v);
- Py_DECREF(w);
- if (err == 0) continue;
- break;
-
- case DELETE_SUBSCR:
- w = TOP();
- v = SECOND();
- STACKADJ(-2);
- /* del v[w] */
- err = PyObject_DelItem(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- if (err == 0) continue;
- break;
-
- case PRINT_EXPR:
- v = POP();
- w = PySys_GetObject("displayhook");
- if (w == NULL) {
- PyErr_SetString(PyExc_RuntimeError,
- "lost sys.displayhook");
- err = -1;
- x = NULL;
- }
- if (err == 0) {
- x = PyTuple_Pack(1, v);
- if (x == NULL)
- err = -1;
- }
- if (err == 0) {
- w = PyEval_CallObject(w, x);
- Py_XDECREF(w);
- if (w == NULL)
- err = -1;
- }
- Py_DECREF(v);
- Py_XDECREF(x);
- break;
-
- case PRINT_ITEM_TO:
- w = stream = POP();
- /* fall through to PRINT_ITEM */
-
- case PRINT_ITEM:
- v = POP();
- if (stream == NULL || stream == Py_None) {
- w = PySys_GetObject("stdout");
- if (w == NULL) {
- PyErr_SetString(PyExc_RuntimeError,
- "lost sys.stdout");
- err = -1;
- }
- }
- /* PyFile_SoftSpace() can exececute arbitrary code
- if sys.stdout is an instance with a __getattr__.
- If __getattr__ raises an exception, w will
- be freed, so we need to prevent that temporarily. */
- Py_XINCREF(w);
- if (w != NULL && PyFile_SoftSpace(w, 0))
- err = PyFile_WriteString(" ", w);
- if (err == 0)
- err = PyFile_WriteObject(v, w, Py_PRINT_RAW);
- if (err == 0) {
- /* XXX move into writeobject() ? */
- if (PyString_Check(v)) {
- char *s = PyString_AS_STRING(v);
- Py_ssize_t len = PyString_GET_SIZE(v);
- if (len == 0 ||
- !isspace(Py_CHARMASK(s[len-1])) ||
- s[len-1] == ' ')
- PyFile_SoftSpace(w, 1);
- }
-#ifdef Py_USING_UNICODE
- else if (PyUnicode_Check(v)) {
- Py_UNICODE *s = PyUnicode_AS_UNICODE(v);
- Py_ssize_t len = PyUnicode_GET_SIZE(v);
- if (len == 0 ||
- !Py_UNICODE_ISSPACE(s[len-1]) ||
- s[len-1] == ' ')
- PyFile_SoftSpace(w, 1);
- }
-#endif
- else
- PyFile_SoftSpace(w, 1);
- }
- Py_XDECREF(w);
- Py_DECREF(v);
- Py_XDECREF(stream);
- stream = NULL;
- if (err == 0)
- continue;
- break;
-
- case PRINT_NEWLINE_TO:
- w = stream = POP();
- /* fall through to PRINT_NEWLINE */
-
- case PRINT_NEWLINE:
- if (stream == NULL || stream == Py_None) {
- w = PySys_GetObject("stdout");
- if (w == NULL)
- PyErr_SetString(PyExc_RuntimeError,
- "lost sys.stdout");
- }
- if (w != NULL) {
- err = PyFile_WriteString("\n", w);
- if (err == 0)
- PyFile_SoftSpace(w, 0);
- }
- Py_XDECREF(stream);
- stream = NULL;
- break;
-
-
-#ifdef CASE_TOO_BIG
- default: switch (opcode) {
-#endif
- case RAISE_VARARGS:
- u = v = w = NULL;
- switch (oparg) {
- case 3:
- u = POP(); /* traceback */
- /* Fallthrough */
- case 2:
- v = POP(); /* value */
- /* Fallthrough */
- case 1:
- w = POP(); /* exc */
- case 0: /* Fallthrough */
- why = do_raise(w, v, u);
- break;
- default:
- PyErr_SetString(PyExc_SystemError,
- "bad RAISE_VARARGS oparg");
- why = WHY_EXCEPTION;
- break;
- }
- break;
-
- case LOAD_LOCALS:
- if ((x = f->f_locals) != NULL) {
- Py_INCREF(x);
- PUSH(x);
- continue;
- }
- PyErr_SetString(PyExc_SystemError, "no locals");
- break;
-
- case RETURN_VALUE:
- retval = POP();
- why = WHY_RETURN;
- goto fast_block_end;
-
- case YIELD_VALUE:
- retval = POP();
- f->f_stacktop = stack_pointer;
- why = WHY_YIELD;
- goto fast_yield;
-
- case EXEC_STMT:
- w = TOP();
- v = SECOND();
- u = THIRD();
- STACKADJ(-3);
- READ_TIMESTAMP(intr0);
- err = exec_statement(f, u, v, w);
- READ_TIMESTAMP(intr1);
- Py_DECREF(u);
- Py_DECREF(v);
- Py_DECREF(w);
- break;
-
- case POP_BLOCK:
- {
- PyTryBlock *b = PyFrame_BlockPop(f);
- while (STACK_LEVEL() > b->b_level) {
- v = POP();
- Py_DECREF(v);
- }
- }
- continue;
-
- case END_FINALLY:
- v = POP();
- if (PyInt_Check(v)) {
- why = (enum why_code) PyInt_AS_LONG(v);
- assert(why != WHY_YIELD);
- if (why == WHY_RETURN ||
- why == WHY_CONTINUE)
- retval = POP();
- }
- else if (PyExceptionClass_Check(v) || PyString_Check(v)) {
- w = POP();
- u = POP();
- PyErr_Restore(v, w, u);
- why = WHY_RERAISE;
- break;
- }
- else if (v != Py_None) {
- PyErr_SetString(PyExc_SystemError,
- "'finally' pops bad exception");
- why = WHY_EXCEPTION;
- }
- Py_DECREF(v);
- break;
-
- case BUILD_CLASS:
- u = TOP();
- v = SECOND();
- w = THIRD();
- STACKADJ(-2);
- x = build_class(u, v, w);
- SET_TOP(x);
- Py_DECREF(u);
- Py_DECREF(v);
- Py_DECREF(w);
- break;
-
- case STORE_NAME:
- w = GETITEM(names, oparg);
- v = POP();
- if ((x = f->f_locals) != NULL) {
- if (PyDict_CheckExact(x))
- err = PyDict_SetItem(x, w, v);
- else
- err = PyObject_SetItem(x, w, v);
- Py_DECREF(v);
- if (err == 0) continue;
- break;
- }
- PyErr_Format(PyExc_SystemError,
- "no locals found when storing %s",
- PyObject_REPR(w));
- break;
-
- case DELETE_NAME:
- w = GETITEM(names, oparg);
- if ((x = f->f_locals) != NULL) {
- if ((err = PyObject_DelItem(x, w)) != 0)
- format_exc_check_arg(PyExc_NameError,
- NAME_ERROR_MSG ,w);
- break;
- }
- PyErr_Format(PyExc_SystemError,
- "no locals when deleting %s",
- PyObject_REPR(w));
- break;
-
- PREDICTED_WITH_ARG(UNPACK_SEQUENCE);
- case UNPACK_SEQUENCE:
- v = POP();
- if (PyTuple_CheckExact(v) && PyTuple_GET_SIZE(v) == oparg) {
- PyObject **items = ((PyTupleObject *)v)->ob_item;
- while (oparg--) {
- w = items[oparg];
- Py_INCREF(w);
- PUSH(w);
- }
- Py_DECREF(v);
- continue;
- } else if (PyList_CheckExact(v) && PyList_GET_SIZE(v) == oparg) {
- PyObject **items = ((PyListObject *)v)->ob_item;
- while (oparg--) {
- w = items[oparg];
- Py_INCREF(w);
- PUSH(w);
- }
- } else if (unpack_iterable(v, oparg,
- stack_pointer + oparg))
- stack_pointer += oparg;
- else {
- if (PyErr_ExceptionMatches(PyExc_TypeError))
- PyErr_SetString(PyExc_TypeError,
- "unpack non-sequence");
- why = WHY_EXCEPTION;
- }
- Py_DECREF(v);
- break;
-
- case STORE_ATTR:
- w = GETITEM(names, oparg);
- v = TOP();
- u = SECOND();
- STACKADJ(-2);
- err = PyObject_SetAttr(v, w, u); /* v.w = u */
- Py_DECREF(v);
- Py_DECREF(u);
- if (err == 0) continue;
- break;
-
- case DELETE_ATTR:
- w = GETITEM(names, oparg);
- v = POP();
- err = PyObject_SetAttr(v, w, (PyObject *)NULL);
- /* del v.w */
- Py_DECREF(v);
- break;
-
- case STORE_GLOBAL:
- w = GETITEM(names, oparg);
- v = POP();
- err = PyDict_SetItem(f->f_globals, w, v);
- Py_DECREF(v);
- if (err == 0) continue;
- break;
-
- case DELETE_GLOBAL:
- w = GETITEM(names, oparg);
- if ((err = PyDict_DelItem(f->f_globals, w)) != 0)
- format_exc_check_arg(
- PyExc_NameError, GLOBAL_NAME_ERROR_MSG, w);
- break;
-
- case LOAD_NAME:
- w = GETITEM(names, oparg);
- if ((v = f->f_locals) == NULL) {
- PyErr_Format(PyExc_SystemError,
- "no locals when loading %s",
- PyObject_REPR(w));
- break;
- }
- if (PyDict_CheckExact(v)) {
- x = PyDict_GetItem(v, w);
- Py_XINCREF(x);
- }
- else {
- x = PyObject_GetItem(v, w);
- if (x == NULL && PyErr_Occurred()) {
- if (!PyErr_ExceptionMatches(PyExc_KeyError))
- break;
- PyErr_Clear();
- }
- }
- if (x == NULL) {
- x = PyDict_GetItem(f->f_globals, w);
- if (x == NULL) {
- x = PyDict_GetItem(f->f_builtins, w);
- if (x == NULL) {
- format_exc_check_arg(
- PyExc_NameError,
- NAME_ERROR_MSG ,w);
- break;
- }
- }
- Py_INCREF(x);
- }
- PUSH(x);
- continue;
-
- case LOAD_GLOBAL:
- w = GETITEM(names, oparg);
- if (PyString_CheckExact(w)) {
- /* Inline the PyDict_GetItem() calls.
- WARNING: this is an extreme speed hack.
- Do not try this at home. */
- long hash = ((PyStringObject *)w)->ob_shash;
- if (hash != -1) {
- PyDictObject *d;
- PyDictEntry *e;
- d = (PyDictObject *)(f->f_globals);
- e = d->ma_lookup(d, w, hash);
- if (e == NULL) {
- x = NULL;
- break;
- }
- x = e->me_value;
- if (x != NULL) {
- Py_INCREF(x);
- PUSH(x);
- continue;
- }
- d = (PyDictObject *)(f->f_builtins);
- e = d->ma_lookup(d, w, hash);
- if (e == NULL) {
- x = NULL;
- break;
- }
- x = e->me_value;
- if (x != NULL) {
- Py_INCREF(x);
- PUSH(x);
- continue;
- }
- goto load_global_error;
- }
- }
- /* This is the un-inlined version of the code above */
- x = PyDict_GetItem(f->f_globals, w);
- if (x == NULL) {
- x = PyDict_GetItem(f->f_builtins, w);
- if (x == NULL) {
- load_global_error:
- format_exc_check_arg(
- PyExc_NameError,
- GLOBAL_NAME_ERROR_MSG, w);
- break;
- }
- }
- Py_INCREF(x);
- PUSH(x);
- continue;
-
- case DELETE_FAST:
- x = GETLOCAL(oparg);
- if (x != NULL) {
- SETLOCAL(oparg, NULL);
- continue;
- }
- format_exc_check_arg(
- PyExc_UnboundLocalError,
- UNBOUNDLOCAL_ERROR_MSG,
- PyTuple_GetItem(co->co_varnames, oparg)
- );
- break;
-
- case LOAD_CLOSURE:
- x = freevars[oparg];
- Py_INCREF(x);
- PUSH(x);
- if (x != NULL) continue;
- break;
-
- case LOAD_DEREF:
- x = freevars[oparg];
- w = PyCell_Get(x);
- if (w != NULL) {
- PUSH(w);
- continue;
- }
- err = -1;
- /* Don't stomp existing exception */
- if (PyErr_Occurred())
- break;
- if (oparg < PyTuple_GET_SIZE(co->co_cellvars)) {
- v = PyTuple_GET_ITEM(co->co_cellvars,
- oparg);
- format_exc_check_arg(
- PyExc_UnboundLocalError,
- UNBOUNDLOCAL_ERROR_MSG,
- v);
- } else {
- v = PyTuple_GET_ITEM(
- co->co_freevars,
- oparg - PyTuple_GET_SIZE(co->co_cellvars));
- format_exc_check_arg(
- PyExc_NameError,
- UNBOUNDFREE_ERROR_MSG,
- v);
- }
- break;
-
- case STORE_DEREF:
- w = POP();
- x = freevars[oparg];
- PyCell_Set(x, w);
- Py_DECREF(w);
- continue;
-
- case BUILD_TUPLE:
- x = PyTuple_New(oparg);
- if (x != NULL) {
- for (; --oparg >= 0;) {
- w = POP();
- PyTuple_SET_ITEM(x, oparg, w);
- }
- PUSH(x);
- continue;
- }
- break;
-
- case BUILD_LIST:
- x = PyList_New(oparg);
- if (x != NULL) {
- for (; --oparg >= 0;) {
- w = POP();
- PyList_SET_ITEM(x, oparg, w);
- }
- PUSH(x);
- continue;
- }
- break;
-
- case BUILD_MAP:
- x = PyDict_New();
- PUSH(x);
- if (x != NULL) continue;
- break;
-
- case LOAD_ATTR:
- w = GETITEM(names, oparg);
- v = TOP();
- x = PyObject_GetAttr(v, w);
- Py_DECREF(v);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case COMPARE_OP:
- w = POP();
- v = TOP();
- if (PyInt_CheckExact(w) && PyInt_CheckExact(v)) {
- /* INLINE: cmp(int, int) */
- register long a, b;
- register int res;
- a = PyInt_AS_LONG(v);
- b = PyInt_AS_LONG(w);
- switch (oparg) {
- case PyCmp_LT: res = a < b; break;
- case PyCmp_LE: res = a <= b; break;
- case PyCmp_EQ: res = a == b; break;
- case PyCmp_NE: res = a != b; break;
- case PyCmp_GT: res = a > b; break;
- case PyCmp_GE: res = a >= b; break;
- case PyCmp_IS: res = v == w; break;
- case PyCmp_IS_NOT: res = v != w; break;
- default: goto slow_compare;
- }
- x = res ? Py_True : Py_False;
- Py_INCREF(x);
- }
- else {
- slow_compare:
- x = cmp_outcome(oparg, v, w);
- }
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x == NULL) break;
- PREDICT(JUMP_IF_FALSE);
- PREDICT(JUMP_IF_TRUE);
- continue;
-
- case IMPORT_NAME:
- w = GETITEM(names, oparg);
- x = PyDict_GetItemString(f->f_builtins, "__import__");
- if (x == NULL) {
- PyErr_SetString(PyExc_ImportError,
- "__import__ not found");
- break;
- }
- v = POP();
- u = TOP();
- if (PyInt_AsLong(u) != -1 || PyErr_Occurred())
- w = PyTuple_Pack(5,
- w,
- f->f_globals,
- f->f_locals == NULL ?
- Py_None : f->f_locals,
- v,
- u);
- else
- w = PyTuple_Pack(4,
- w,
- f->f_globals,
- f->f_locals == NULL ?
- Py_None : f->f_locals,
- v);
- Py_DECREF(v);
- Py_DECREF(u);
- if (w == NULL) {
- u = POP();
- x = NULL;
- break;
- }
- READ_TIMESTAMP(intr0);
- x = PyEval_CallObject(x, w);
- READ_TIMESTAMP(intr1);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case IMPORT_STAR:
- v = POP();
- PyFrame_FastToLocals(f);
- if ((x = f->f_locals) == NULL) {
- PyErr_SetString(PyExc_SystemError,
- "no locals found during 'import *'");
- break;
- }
- READ_TIMESTAMP(intr0);
- err = import_all_from(x, v);
- READ_TIMESTAMP(intr1);
- PyFrame_LocalsToFast(f, 0);
- Py_DECREF(v);
- if (err == 0) continue;
- break;
-
- case IMPORT_FROM:
- w = GETITEM(names, oparg);
- v = TOP();
- READ_TIMESTAMP(intr0);
- x = import_from(v, w);
- READ_TIMESTAMP(intr1);
- PUSH(x);
- if (x != NULL) continue;
- break;
-
- case JUMP_FORWARD:
- JUMPBY(oparg);
- goto fast_next_opcode;
-
- PREDICTED_WITH_ARG(JUMP_IF_FALSE);
- case JUMP_IF_FALSE:
- w = TOP();
- if (w == Py_True) {
- PREDICT(POP_TOP);
- goto fast_next_opcode;
- }
- if (w == Py_False) {
- JUMPBY(oparg);
- goto fast_next_opcode;
- }
- err = PyObject_IsTrue(w);
- if (err > 0)
- err = 0;
- else if (err == 0)
- JUMPBY(oparg);
- else
- break;
- continue;
-
- PREDICTED_WITH_ARG(JUMP_IF_TRUE);
- case JUMP_IF_TRUE:
- w = TOP();
- if (w == Py_False) {
- PREDICT(POP_TOP);
- goto fast_next_opcode;
- }
- if (w == Py_True) {
- JUMPBY(oparg);
- goto fast_next_opcode;
- }
- err = PyObject_IsTrue(w);
- if (err > 0) {
- err = 0;
- JUMPBY(oparg);
- }
- else if (err == 0)
- ;
- else
- break;
- continue;
-
- PREDICTED_WITH_ARG(JUMP_ABSOLUTE);
- case JUMP_ABSOLUTE:
- JUMPTO(oparg);
- continue;
-
- case GET_ITER:
- /* before: [obj]; after [getiter(obj)] */
- v = TOP();
- x = PyObject_GetIter(v);
- Py_DECREF(v);
- if (x != NULL) {
- SET_TOP(x);
- PREDICT(FOR_ITER);
- continue;
- }
- STACKADJ(-1);
- break;
-
- PREDICTED_WITH_ARG(FOR_ITER);
- case FOR_ITER:
- /* before: [iter]; after: [iter, iter()] *or* [] */
- v = TOP();
- x = (*v->ob_type->tp_iternext)(v);
- if (x != NULL) {
- PUSH(x);
- PREDICT(STORE_FAST);
- PREDICT(UNPACK_SEQUENCE);
- continue;
- }
- if (PyErr_Occurred()) {
- if (!PyErr_ExceptionMatches(PyExc_StopIteration))
- break;
- PyErr_Clear();
- }
- /* iterator ended normally */
- x = v = POP();
- Py_DECREF(v);
- JUMPBY(oparg);
- continue;
-
- case BREAK_LOOP:
- why = WHY_BREAK;
- goto fast_block_end;
-
- case CONTINUE_LOOP:
- retval = PyInt_FromLong(oparg);
- if (!retval) {
- x = NULL;
- break;
- }
- why = WHY_CONTINUE;
- goto fast_block_end;
-
- case SETUP_LOOP:
- case SETUP_EXCEPT:
- case SETUP_FINALLY:
- /* NOTE: If you add any new block-setup opcodes that are not try/except/finally
- handlers, you may need to update the PyGen_NeedsFinalizing() function. */
-
- PyFrame_BlockSetup(f, opcode, INSTR_OFFSET() + oparg,
- STACK_LEVEL());
- continue;
-
- case WITH_CLEANUP:
- {
- /* TOP is the context.__exit__ bound method.
- Below that are 1-3 values indicating how/why
- we entered the finally clause:
- - SECOND = None
- - (SECOND, THIRD) = (WHY_{RETURN,CONTINUE}), retval
- - SECOND = WHY_*; no retval below it
- - (SECOND, THIRD, FOURTH) = exc_info()
- In the last case, we must call
- TOP(SECOND, THIRD, FOURTH)
- otherwise we must call
- TOP(None, None, None)
-
- In addition, if the stack represents an exception,
- *and* the function call returns a 'true' value, we
- "zap" this information, to prevent END_FINALLY from
- re-raising the exception. (But non-local gotos
- should still be resumed.)
- */
-
- x = TOP();
- u = SECOND();
- if (PyInt_Check(u) || u == Py_None) {
- u = v = w = Py_None;
- }
- else {
- v = THIRD();
- w = FOURTH();
- }
- /* XXX Not the fastest way to call it... */
- x = PyObject_CallFunctionObjArgs(x, u, v, w, NULL);
- if (x == NULL)
- break; /* Go to error exit */
- if (u != Py_None && PyObject_IsTrue(x)) {
- /* There was an exception and a true return */
- Py_DECREF(x);
- x = TOP(); /* Again */
- STACKADJ(-3);
- Py_INCREF(Py_None);
- SET_TOP(Py_None);
- Py_DECREF(x);
- Py_DECREF(u);
- Py_DECREF(v);
- Py_DECREF(w);
- } else {
- /* Let END_FINALLY do its thing */
- Py_DECREF(x);
- x = POP();
- Py_DECREF(x);
- }
- break;
- }
-
- case CALL_FUNCTION:
- {
- PyObject **sp;
- PCALL(PCALL_ALL);
- sp = stack_pointer;
-#ifdef WITH_TSC
- x = call_function(&sp, oparg, &intr0, &intr1);
-#else
- x = call_function(&sp, oparg);
-#endif
- stack_pointer = sp;
- PUSH(x);
- if (x != NULL)
- continue;
- break;
- }
-
- case CALL_FUNCTION_VAR:
- case CALL_FUNCTION_KW:
- case CALL_FUNCTION_VAR_KW:
- {
- int na = oparg & 0xff;
- int nk = (oparg>>8) & 0xff;
- int flags = (opcode - CALL_FUNCTION) & 3;
- int n = na + 2 * nk;
- PyObject **pfunc, *func, **sp;
- PCALL(PCALL_ALL);
- if (flags & CALL_FLAG_VAR)
- n++;
- if (flags & CALL_FLAG_KW)
- n++;
- pfunc = stack_pointer - n - 1;
- func = *pfunc;
-
- if (PyMethod_Check(func)
- && PyMethod_GET_SELF(func) != NULL) {
- PyObject *self = PyMethod_GET_SELF(func);
- Py_INCREF(self);
- func = PyMethod_GET_FUNCTION(func);
- Py_INCREF(func);
- Py_DECREF(*pfunc);
- *pfunc = self;
- na++;
- n++;
- } else
- Py_INCREF(func);
- sp = stack_pointer;
- READ_TIMESTAMP(intr0);
- x = ext_do_call(func, &sp, flags, na, nk);
- READ_TIMESTAMP(intr1);
- stack_pointer = sp;
- Py_DECREF(func);
-
- while (stack_pointer > pfunc) {
- w = POP();
- Py_DECREF(w);
- }
- PUSH(x);
- if (x != NULL)
- continue;
- break;
- }
-
- case MAKE_FUNCTION:
- v = POP(); /* code object */
- x = PyFunction_New(v, f->f_globals);
- Py_DECREF(v);
- /* XXX Maybe this should be a separate opcode? */
- if (x != NULL && oparg > 0) {
- v = PyTuple_New(oparg);
- if (v == NULL) {
- Py_DECREF(x);
- x = NULL;
- break;
- }
- while (--oparg >= 0) {
- w = POP();
- PyTuple_SET_ITEM(v, oparg, w);
- }
- err = PyFunction_SetDefaults(x, v);
- Py_DECREF(v);
- }
- PUSH(x);
- break;
-
- case MAKE_CLOSURE:
- {
- v = POP(); /* code object */
- x = PyFunction_New(v, f->f_globals);
- Py_DECREF(v);
- if (x != NULL) {
- v = POP();
- err = PyFunction_SetClosure(x, v);
- Py_DECREF(v);
- }
- if (x != NULL && oparg > 0) {
- v = PyTuple_New(oparg);
- if (v == NULL) {
- Py_DECREF(x);
- x = NULL;
- break;
- }
- while (--oparg >= 0) {
- w = POP();
- PyTuple_SET_ITEM(v, oparg, w);
- }
- err = PyFunction_SetDefaults(x, v);
- Py_DECREF(v);
- }
- PUSH(x);
- break;
- }
-
- case BUILD_SLICE:
- if (oparg == 3)
- w = POP();
- else
- w = NULL;
- v = POP();
- u = TOP();
- x = PySlice_New(u, v, w);
- Py_DECREF(u);
- Py_DECREF(v);
- Py_XDECREF(w);
- SET_TOP(x);
- if (x != NULL) continue;
- break;
-
- case EXTENDED_ARG:
- opcode = NEXTOP();
- oparg = oparg<<16 | NEXTARG();
- goto dispatch_opcode;
-
- default:
- fprintf(stderr,
- "XXX lineno: %d, opcode: %d\n",
- PyCode_Addr2Line(f->f_code, f->f_lasti),
- opcode);
- PyErr_SetString(PyExc_SystemError, "unknown opcode");
- why = WHY_EXCEPTION;
- break;
-
-#ifdef CASE_TOO_BIG
- }
-#endif
-
- } /* switch */
-
- on_error:
-
- READ_TIMESTAMP(inst1);
-
- /* Quickly continue if no error occurred */
-
- if (why == WHY_NOT) {
- if (err == 0 && x != NULL) {
-#ifdef CHECKEXC
- /* This check is expensive! */
- if (PyErr_Occurred())
- fprintf(stderr,
- "XXX undetected error\n");
- else {
-#endif
- READ_TIMESTAMP(loop1);
- continue; /* Normal, fast path */
-#ifdef CHECKEXC
- }
-#endif
- }
- why = WHY_EXCEPTION;
- x = Py_None;
- err = 0;
- }
-
- /* Double-check exception status */
-
- if (why == WHY_EXCEPTION || why == WHY_RERAISE) {
- if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_SystemError,
- "error return without exception set");
- why = WHY_EXCEPTION;
- }
- }
-#ifdef CHECKEXC
- else {
- /* This check is expensive! */
- if (PyErr_Occurred()) {
- char buf[1024];
- sprintf(buf, "Stack unwind with exception "
- "set and why=%d", why);
- Py_FatalError(buf);
- }
- }
-#endif
-
- /* Log traceback info if this is a real exception */
-
- if (why == WHY_EXCEPTION) {
- PyTraceBack_Here(f);
-
- if (tstate->c_tracefunc != NULL)
- call_exc_trace(tstate->c_tracefunc,
- tstate->c_traceobj, f);
- }
-
- /* For the rest, treat WHY_RERAISE as WHY_EXCEPTION */
-
- if (why == WHY_RERAISE)
- why = WHY_EXCEPTION;
-
- /* Unwind stacks if a (pseudo) exception occurred */
-
-fast_block_end:
- while (why != WHY_NOT && f->f_iblock > 0) {
- PyTryBlock *b = PyFrame_BlockPop(f);
-
- assert(why != WHY_YIELD);
- if (b->b_type == SETUP_LOOP && why == WHY_CONTINUE) {
- /* For a continue inside a try block,
- don't pop the block for the loop. */
- PyFrame_BlockSetup(f, b->b_type, b->b_handler,
- b->b_level);
- why = WHY_NOT;
- JUMPTO(PyInt_AS_LONG(retval));
- Py_DECREF(retval);
- break;
- }
-
- while (STACK_LEVEL() > b->b_level) {
- v = POP();
- Py_XDECREF(v);
- }
- if (b->b_type == SETUP_LOOP && why == WHY_BREAK) {
- why = WHY_NOT;
- JUMPTO(b->b_handler);
- break;
- }
- if (b->b_type == SETUP_FINALLY ||
- (b->b_type == SETUP_EXCEPT &&
- why == WHY_EXCEPTION)) {
- if (why == WHY_EXCEPTION) {
- PyObject *exc, *val, *tb;
- PyErr_Fetch(&exc, &val, &tb);
- if (val == NULL) {
- val = Py_None;
- Py_INCREF(val);
- }
- /* Make the raw exception data
- available to the handler,
- so a program can emulate the
- Python main loop. Don't do
- this for 'finally'. */
- if (b->b_type == SETUP_EXCEPT) {
- PyErr_NormalizeException(
- &exc, &val, &tb);
- set_exc_info(tstate,
- exc, val, tb);
- }
- if (tb == NULL) {
- Py_INCREF(Py_None);
- PUSH(Py_None);
- } else
- PUSH(tb);
- PUSH(val);
- PUSH(exc);
- }
- else {
- if (why & (WHY_RETURN | WHY_CONTINUE))
- PUSH(retval);
- v = PyInt_FromLong((long)why);
- PUSH(v);
- }
- why = WHY_NOT;
- JUMPTO(b->b_handler);
- break;
- }
- } /* unwind stack */
-
- /* End the loop if we still have an error (or return) */
-
- if (why != WHY_NOT)
- break;
- READ_TIMESTAMP(loop1);
-
- } /* main loop */
-
- assert(why != WHY_YIELD);
- /* Pop remaining stack entries. */
- while (!EMPTY()) {
- v = POP();
- Py_XDECREF(v);
- }
-
- if (why != WHY_RETURN)
- retval = NULL;
-
-fast_yield:
- if (tstate->use_tracing) {
- if (tstate->c_tracefunc) {
- if (why == WHY_RETURN || why == WHY_YIELD) {
- if (call_trace(tstate->c_tracefunc,
- tstate->c_traceobj, f,
- PyTrace_RETURN, retval)) {
- Py_XDECREF(retval);
- retval = NULL;
- why = WHY_EXCEPTION;
- }
- }
- else if (why == WHY_EXCEPTION) {
- call_trace_protected(tstate->c_tracefunc,
- tstate->c_traceobj, f,
- PyTrace_RETURN, NULL);
- }
- }
- if (tstate->c_profilefunc) {
- if (why == WHY_EXCEPTION)
- call_trace_protected(tstate->c_profilefunc,
- tstate->c_profileobj, f,
- PyTrace_RETURN, NULL);
- else if (call_trace(tstate->c_profilefunc,
- tstate->c_profileobj, f,
- PyTrace_RETURN, retval)) {
- Py_XDECREF(retval);
- retval = NULL;
- why = WHY_EXCEPTION;
- }
- }
- }
-
- if (tstate->frame->f_exc_type != NULL)
- reset_exc_info(tstate);
- else {
- assert(tstate->frame->f_exc_value == NULL);
- assert(tstate->frame->f_exc_traceback == NULL);
- }
-
- /* pop frame */
- exit_eval_frame:
- Py_LeaveRecursiveCall();
- tstate->frame = f->f_back;
-
- return retval;
-}
-
diff --git a/tests/examplefiles/char.scala b/tests/examplefiles/char.scala
deleted file mode 100644
index 0032612f..00000000
--- a/tests/examplefiles/char.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-'symbol
-'a'
-'\u1234'
-'\n'
diff --git a/tests/examplefiles/cheetah_example.html b/tests/examplefiles/cheetah_example.html
deleted file mode 100644
index e2a0f477..00000000
--- a/tests/examplefiles/cheetah_example.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<html>
- <head><title>$title</title></head>
- <body>
- <table>
- #for $client in $clients
- <tr>
- <td>$client.surname, $client.firstname</td>
- <td><a href="mailto:$client.email">$client.email</a></td>
- </tr>
- #end for
- </table>
- </body>
-</html>
diff --git a/tests/examplefiles/classes.dylan b/tests/examplefiles/classes.dylan
deleted file mode 100644
index 83faf69c..00000000
--- a/tests/examplefiles/classes.dylan
+++ /dev/null
@@ -1,125 +0,0 @@
-module: sample
-comment: for make sure that does not highlight per word.
- and it continues on to the next line.
-
-define class <car> (<object>)
- slot serial-number :: <integer> = unique-serial-number();
- constant slot model-name :: <string>,
- required-init-keyword: model:;
- each-subclass slot has-sunroof? :: <boolean>,
- init-keyword: sunroof?:,
- init-value: #f;
- keyword foo:;
- required keyword bar:;
-end class <car>;
-
-define class <flying-car> (<car>)
-end class <flying-car>;
-
-let flying-car = make(<flying-car>);
-let car? :: <car?> = #f;
-let prefixed-car :: <vehicles/car> = #f;
-let model :: <car-911> = #f;
-
-define constant $empty-string = "";
-define constant $escaped-backslash = '\\';
-define constant $escaped-single-quote = '\'';
-
-define variable *unique-serial-number* = 0;
-
-define function unique-serial-number() => (usn :: <integer>)
- let serial = *unique-serial-number*;
- *unique-serial-number* := *unique-serial-number* + 1;
- serial;
-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 \+
- (offset1 :: <time-offset>, offset2 :: <time-offset>)
- => (sum :: <time-offset>)
- let sum = offset1.total-seconds + offset2.total-seconds;
- make(<time-offset>, total-seconds: sum);
-end method \+;
-
-define method bar ()
- 1 | 2 & 3
-end
-
-if (bar)
- 1
-elseif (foo)
- 2
-else
- 3
-end if;
-
-select (foo by instance?)
- <integer> => 1
- otherwise => 3
-end select;
-
-/* multi
- line
- comment
-*/
-
-/* multi line comments
- /* can be */
- nested */
-
-define constant $symbol = #"hello";
-define variable *vector* = #[3.5, 5]
-define constant $list = #(1, 2);
-define constant $pair = #(1 . "foo")
-
-let octal-number = #o238;
-let hex-number = #x3890ADEF;
-let binary-number = #b1010;
-let float-exponent = 3.5e10;
-
-block (return)
- with-lock (lock)
- return();
- end;
-exception (e :: <error>)
- format-out("Oh no");
-cleanup
- return();
-afterwards
- format-out("Hello");
-end;
-
-define macro repeat
- { repeat ?:body end }
- => { block (?=stop!)
- local method again() ?body; again() end;
- again();
- end }
-end macro repeat;
-
-define macro with-decoded-seconds
- {
- with-decoded-seconds
- (?max:variable, ?min:variable, ?sec:variable = ?time:expression)
- ?:body
- end
- }
- => {
- let (?max, ?min, ?sec) = decode-total-seconds(?time);
- ?body
- }
-end macro;
-
-let x = "This size call should be seen as a builtin despite the odd case.".siZe;
-
diff --git a/tests/examplefiles/clojure-weird-keywords.clj b/tests/examplefiles/clojure-weird-keywords.clj
deleted file mode 100644
index 2d914c59..00000000
--- a/tests/examplefiles/clojure-weird-keywords.clj
+++ /dev/null
@@ -1,5 +0,0 @@
-; Note, clojure lexer is here (and is a good deal more liberal than the language spec:
-; https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L62
-
-(defn valid [#^java.lang.reflect.Method meth]
- [:keyword :#initial-hash :h#sh-in-middle :hash-at-end# #js {:keyword "value"}])
diff --git a/tests/examplefiles/condensed_ruby.rb b/tests/examplefiles/condensed_ruby.rb
deleted file mode 100644
index afe57aaa..00000000
--- a/tests/examplefiles/condensed_ruby.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# Server: ruby p2p.rb password server server-uri merge-servers
-# Sample: ruby p2p.rb foobar server druby://localhost:1337 druby://foo.bar:1337
-# Client: ruby p2p.rb password client server-uri download-pattern
-# Sample: ruby p2p.rb foobar client druby://localhost:1337 *.rb
-require'drb';F,D,C,P,M,U,*O=File,Class,Dir,*ARGV;def s(p)F.split(p[/[^|].*/])[-1
-]end;def c(u);DRbObject.new((),u)end;def x(u)[P,u].hash;end;M=="client"&&c(U).f(
-x(U)).each{|n|p,c=x(n),c(n);(c.f(p,O[0],0).map{|f|s f}-D["*"]).each{|f|F.open(f,
-"w"){|o|o<<c.f(p,f,1)}}}||(DRb.start_service U,C.new{def f(c,a=[],t=2)c==x(U)&&(
-t==0&&D[s(a)]||t==1&&F.read(s(a))||p(a))end;def y()(p(U)+p).each{|u|c(u).f(x(u),
-p(U))rescue()};self;end;private;def p(x=[]);O.push(*x).uniq!;O;end}.new.y;sleep)
diff --git a/tests/examplefiles/coq_RelationClasses b/tests/examplefiles/coq_RelationClasses
deleted file mode 100644
index 94c51bf1..00000000
--- a/tests/examplefiles/coq_RelationClasses
+++ /dev/null
@@ -1,447 +0,0 @@
-(* -*- 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/core.cljs b/tests/examplefiles/core.cljs
deleted file mode 100644
index f135b832..00000000
--- a/tests/examplefiles/core.cljs
+++ /dev/null
@@ -1,52 +0,0 @@
-
-(ns bounder.core
- (:require [bounder.html :as html]
- [domina :refer [value set-value! single-node]]
- [domina.css :refer [sel]]
- [lowline.functions :refer [debounce]]
- [enfocus.core :refer [at]]
- [cljs.reader :as reader]
- [clojure.string :as s])
- (:require-macros [enfocus.macros :as em]))
-
-(def filter-input
- (single-node
- (sel ".search input")))
-
-(defn project-matches [query project]
- (let [words (cons (:name project)
- (map name (:categories project)))
- to-match (->> words
- (s/join "")
- (s/lower-case))]
- (<= 0 (.indexOf to-match (s/lower-case query)))))
-
-(defn apply-filter-for [projects]
- (let [query (value filter-input)]
- (html/render-projects
- (filter (partial project-matches query)
- projects))))
-
-(defn filter-category [projects evt]
- (let [target (.-currentTarget evt)]
- (set-value! filter-input
- (.-innerHTML target))
- (apply-filter-for projects)))
-
-(defn init-listeners [projects]
- (at js/document
- ["input"] (em/listen
- :keyup
- (debounce
- (partial apply-filter-for projects)
- 500))
- [".category-links li"] (em/listen
- :click
- (partial filter-category projects))))
-
-(defn init [projects-edn]
- (let [projects (reader/read-string projects-edn)]
- (init-listeners projects)
- (html/render-projects projects)
- (html/loaded)))
-
diff --git a/tests/examplefiles/database.pytb b/tests/examplefiles/database.pytb
deleted file mode 100644
index 9138e01b..00000000
--- a/tests/examplefiles/database.pytb
+++ /dev/null
@@ -1,20 +0,0 @@
-Text before
-
-Traceback (most recent call last):
- File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 314, in dispatch_request
- dispatcher.dispatch(req)
- File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 186, in dispatch
- req.session = Session(self.env, req)
- File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 52, in __init__
- self.promote_session(sid)
- File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 125, in promote_session
- "AND authenticated=0", (sid,))
- File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 47, in execute
- return self.cursor.execute(sql_escape_percent(sql), args)
- File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 44, in execute
- args or [])
- File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 36, in _rollback_on_error
- return function(self, *args, **kwargs)
-OperationalError: database is locked
-
-Text after
diff --git a/tests/examplefiles/de.MoinMoin.po b/tests/examplefiles/de.MoinMoin.po
deleted file mode 100644
index 1574d8bf..00000000
--- a/tests/examplefiles/de.MoinMoin.po
+++ /dev/null
@@ -1,2461 +0,0 @@
-## Please edit system and help pages ONLY in the moinmaster wiki! For more
-## information, please see MoinMaster:MoinPagesEditorGroup.
-##master-page:None
-##master-date:None
-#acl MoinPagesEditorGroup:read,write,delete,revert All:read
-#format gettext
-#language de
-
-#
-# MoinMoin de system text translation
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: MoinMoin 1.6\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-05-26 23:12+0200\n"
-"PO-Revision-Date: 2005-09-21 00:00+0100\n"
-"Last-Translator: Thomas Waldmann <tw-public@gmx.de>\n"
-"Language-Team: German <moin-devel@lists.sourceforge.net>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Language: Deutsch\n"
-"X-Language-in-English: German\n"
-"X-HasWikiMarkup: True\n"
-"X-Direction: ltr\n"
-
-msgid ""
-"This wiki is not enabled for mail processing.\n"
-"Contact the owner of the wiki, who can enable email."
-msgstr ""
-"In diesem Wiki ist Mail-Verarbeitung nicht eingeschaltet.\n"
-"Bitte kontaktieren Sie den Eigentümer des Wiki, der die Mailfunktionen "
-"einschalten kann."
-
-msgid "Please provide a valid email address!"
-msgstr "Bitte eine gültige E-Mail-Adresse angeben!"
-
-#, python-format
-msgid "Found no account matching the given email address '%(email)s'!"
-msgstr ""
-"Es wurde kein Benutzerkonto mit der E-Mail-Adresse '%(email)s' gefunden!"
-
-msgid "Use UserPreferences to change your settings or create an account."
-msgstr ""
-"Benutzen Sie BenutzerEinstellungen, um Ihre Einstellungen zu ändern oder ein "
-"Konto zu erzeugen."
-
-msgid "Empty user name. Please enter a user name."
-msgstr "Leerer Benutzername, bitte geben Sie einen Benutzernamen ein."
-
-#, python-format
-msgid ""
-"Invalid user name {{{'%s'}}}.\n"
-"Name may contain any Unicode alpha numeric character, with optional one\n"
-"space between words. Group page name is not allowed."
-msgstr ""
-"Ungültiger Benutzername {{{'%s'}}}.\n"
-"Der Name darf beliebige alphanumerische Unicode-Zeichen enthalten, mit "
-"optional einem\n"
-"Leerzeichen zwischen den Worten. Gruppennamen sind nicht erlaubt."
-
-msgid "This user name already belongs to somebody else."
-msgstr "Dieser Benutzername gehört bereits jemand anderem."
-
-msgid "Passwords don't match!"
-msgstr "Die Passworte sind nicht gleich!"
-
-msgid "Please specify a password!"
-msgstr "Bitte geben Sie ein Passwort an!"
-
-msgid ""
-"Please provide your email address. If you lose your login information, you "
-"can get it by email."
-msgstr ""
-"Bitte geben Sie Ihre E-Mail-Adresse an. Wenn Sie Ihre Login-Informationen "
-"verlieren können Sie sie per E-Mail wieder bekommen."
-
-msgid "This email already belongs to somebody else."
-msgstr "Diese E-Mail-Adresse gehört bereits jemand anderem."
-
-msgid "User account created! You can use this account to login now..."
-msgstr ""
-"Es wurde ein Benutzerkonto für Sie angelegt. Sie können sich nun anmelden..."
-
-msgid "Use UserPreferences to change settings of the selected user account"
-msgstr ""
-"Benutzen Sie BenutzerEinstellungen, um die Einstellungen des ausgewählten "
-"Benutzers zu ändern."
-
-#, python-format
-msgid "The theme '%(theme_name)s' could not be loaded!"
-msgstr "Das Theme '%(theme_name)s' konnte nicht geladen werden!"
-
-msgid "User preferences saved!"
-msgstr "Persönliche Einstellungen gespeichert!"
-
-msgid "Default"
-msgstr "Standardeinstellung"
-
-msgid "<Browser setting>"
-msgstr "<Browsereinstellung>"
-
-msgid "the one preferred"
-msgstr "der Bevorzugte"
-
-msgid "free choice"
-msgstr "Freie Auswahl"
-
-msgid "Select User"
-msgstr "Benutzer auswählen"
-
-msgid "Save"
-msgstr "Speichern"
-
-msgid "Cancel"
-msgstr "Abbrechen"
-
-msgid "Preferred theme"
-msgstr "Bevorzugter Stil"
-
-msgid "Editor Preference"
-msgstr "Bevorzugter Editor"
-
-msgid "Editor shown on UI"
-msgstr "Angezeigter Editor"
-
-msgid "Time zone"
-msgstr "Zeitzone"
-
-msgid "Your time is"
-msgstr "Die lokale Zeit ist"
-
-msgid "Server time is"
-msgstr "Die Zeit des Servers ist"
-
-msgid "Date format"
-msgstr "Datumsformat"
-
-msgid "Preferred language"
-msgstr "Bevorzugte Sprache"
-
-msgid "General options"
-msgstr "Allgemeine Optionen"
-
-msgid "Quick links"
-msgstr "Expressverweise"
-
-msgid "This list does not work, unless you have entered a valid email address!"
-msgstr ""
-"Änderungsnachrichten werden nur versandt, wenn eine gültige E-Mail-Adresse "
-"eingegeben wurde!"
-
-msgid "Subscribed wiki pages (one regex per line)"
-msgstr "Abonnierte Wiki-Seiten (ein regulärer Ausdruck pro Zeile)"
-
-msgid "Create Profile"
-msgstr "Benutzer anlegen"
-
-msgid "Mail me my account data"
-msgstr "E-Mail mit den Zugangsdaten senden"
-
-msgid "Email"
-msgstr "E-Mail"
-
-#, python-format
-msgid ""
-"To create an account, see the %(userprefslink)s page. To recover a lost "
-"password, go to %(sendmypasswordlink)s."
-msgstr ""
-"Siehe Seite %(userprefslink)s, um einen Account anzulegen. Um ein verlorenes "
-"Passwort wieder zu erhalten, siehe %(sendmypasswordlink)s."
-
-msgid "Name"
-msgstr "Name"
-
-msgid "Password"
-msgstr "Passwort"
-
-msgid "Login"
-msgstr "Anmelden"
-
-msgid "Action"
-msgstr "Aktion"
-
-#, python-format
-msgid "Expected \"=\" to follow \"%(token)s\""
-msgstr "\"=\" fehlt hinter dem Attribut \"%(token)s\""
-
-#, python-format
-msgid "Expected a value for key \"%(token)s\""
-msgstr "Attribut \"%(token)s\" wurde kein Wert zugewiesen"
-
-msgid "You are not allowed to edit this page."
-msgstr "Sie dürfen diese Seite nicht editieren."
-
-msgid "Page is immutable!"
-msgstr "Die Seite ist gegen Änderungen geschützt!"
-
-msgid "Cannot edit old revisions!"
-msgstr "Alte Versionen können nicht editiert werden!"
-
-msgid "The lock you held timed out. Be prepared for editing conflicts!"
-msgstr ""
-"Die von Ihnen gehaltene Sperre ist abgelaufen. Das Auftreten von "
-"Änderungskonflikten ist wahrscheinlich!"
-
-#, python-format
-msgid "Draft of \"%(pagename)s\""
-msgstr "Entwurf von \"%(pagename)s\""
-
-#, python-format
-msgid "Edit \"%(pagename)s\""
-msgstr "\"%(pagename)s\" editieren"
-
-#, python-format
-msgid "Preview of \"%(pagename)s\""
-msgstr "Vorschau für \"%(pagename)s\""
-
-#, python-format
-msgid "Your edit lock on %(lock_page)s has expired!"
-msgstr "Ihre Sperre der Seite %(lock_page)s ist abgelaufen!"
-
-#, python-format
-msgid "Your edit lock on %(lock_page)s will expire in # minutes."
-msgstr "Ihre Sperre der Seite %(lock_page)s läuft in # Minuten ab."
-
-#, python-format
-msgid "Your edit lock on %(lock_page)s will expire in # seconds."
-msgstr "Ihre Sperre der Seite %(lock_page)s läuft in # Sekunden ab."
-
-msgid "Someone else deleted this page while you were editing!"
-msgstr "Ein anderer Benutzer hat diese Seite inzwischen gelöscht!"
-
-msgid "Someone else changed this page while you were editing!"
-msgstr "Ein anderer Benutzer hat diese Seite inzwischen geändert!"
-
-msgid ""
-"Someone else saved this page while you were editing!\n"
-"Please review the page and save then. Do not save this page as it is!"
-msgstr ""
-"Ein anderer Benutzer hat gespeichert, während Sie editiert haben!\n"
-"Bitte schauen Sie die Seite nochmal durch und speichern Sie dann. Speichern "
-"Sie die Seite nicht so, wie sie ist!"
-
-msgid "[Content loaded from draft]"
-msgstr "[Inhalt der Seite mit dem Entwurf geladen]"
-
-#, python-format
-msgid "[Content of new page loaded from %s]"
-msgstr "[Inhalt der neuen Seite auf Basis der Vorlage %s]"
-
-#, python-format
-msgid "[Template %s not found]"
-msgstr "[Vorlage %s nicht gefunden]"
-
-#, python-format
-msgid "[You may not read %s]"
-msgstr "[Sie dürfen %s nicht lesen]"
-
-#, python-format
-msgid ""
-"'''[[BR]]Your draft based on revision %(draft_rev)d (saved %"
-"(draft_timestamp_str)s) can be loaded instead of the current revision %"
-"(page_rev)d by using the load draft button - in case you lost your last edit "
-"somehow without saving it.''' A draft gets saved for you when you do a "
-"preview, cancel an edit or unsuccessfully save."
-msgstr ""
-"'''[[BR]]Ihr Entwurf basierend auf Revision %(draft_rev)d (gespeichert %"
-"(draft_timestamp_str)s kann anstatt der aktuellen Revision %(page_rev)d "
-"geladen werden, indem Sie den Knopf ''Entwurf laden'' drücken (falls Sie "
-"Ihre letzten Änderungen verloren haben, bevor Sie sie gespeichert "
-"hatten).''' Ein Entwurf wird für Sie gespeichert, wenn Sie auf Vorschau oder "
-"Abbrechen drücken oder das Speichern nicht funktioniert."
-
-#, python-format
-msgid "Describe %s here."
-msgstr "%s hier beschreiben..."
-
-msgid "Check Spelling"
-msgstr "Rechtschreibung prüfen"
-
-msgid "Save Changes"
-msgstr "Änderungen speichern"
-
-#, python-format
-msgid ""
-"By hitting '''%(save_button_text)s''' you put your changes under the %"
-"(license_link)s.\n"
-"If you don't want that, hit '''%(cancel_button_text)s''' to cancel your "
-"changes."
-msgstr ""
-"Durch Anklicken von '''%(save_button_text)s''' stellen Sie Ihre Änderungen "
-"unter die %(license_link)s.\n"
-"Wenn Sie das nicht wollen, klicken Sie auf '''%(cancel_button_text)s''', um "
-"Ihre Änderungen zu verwerfen."
-
-msgid "Preview"
-msgstr "Vorschau anzeigen"
-
-msgid "Text mode"
-msgstr "Text-Modus"
-
-msgid "Load Draft"
-msgstr "Entwurf laden"
-
-msgid "Comment:"
-msgstr "Kommentar:"
-
-msgid "<No addition>"
-msgstr "<Keine Änderung>"
-
-#, python-format
-msgid "Add to: %(category)s"
-msgstr "Zu %(category)s hinzufügen:"
-
-msgid "Trivial change"
-msgstr "Triviale Änderung"
-
-msgid "Remove trailing whitespace from each line"
-msgstr "Leerzeichen am Ende jeder Zeile entfernen"
-
-msgid "The wiki is currently not reachable."
-msgstr "Das Wiki ist derzeit nicht erreichbar."
-
-msgid ""
-"The remote version of MoinMoin is too old, version 1.6 is required at least."
-msgstr ""
-"Die ferne MoinMoin-Version ist zu alt, mindestens Version 1.6 wird benötigt."
-
-msgid "Invalid username or password."
-msgstr "Ungültiger Username oder Passwort."
-
-#, python-format
-msgid ""
-"The remote wiki uses a different InterWiki name (%(remotename)s) internally "
-"than you specified (%(localname)s)."
-msgstr ""
-"Das ferne Wiki benutzt intern einen anderen InterWiki-Namen (%(remotename)s) "
-"als Sie angegeben haben (%(localname)s)."
-
-#, python-format
-msgid "The package needs a newer version of MoinMoin (at least %s)."
-msgstr "Das Paket erfordert eine neuere Version von MoinMoin (mindestens %s)."
-
-msgid "The theme name is not set."
-msgstr "Theme-Name ist nicht gesetzt."
-
-msgid "Installing theme files is only supported for standalone type servers."
-msgstr ""
-"Das Installieren von Theme-Dateien wird nur für Server-Typ standalone "
-"unterstützt."
-
-#, python-format
-msgid "Installation of '%(filename)s' failed."
-msgstr "Installation von '%(filename)s' fehlgeschlagen."
-
-#, python-format
-msgid "The file %s is not a MoinMoin package file."
-msgstr "Die Datei %s ist keine MoinMoin-Paket-Datei."
-
-#, python-format
-msgid "The page %s does not exist."
-msgstr "Die Seite %s existiert nicht."
-
-msgid "Invalid package file header."
-msgstr "Ungültiger Paket-Datei-Header."
-
-msgid "Package file format unsupported."
-msgstr "Paket-Datei-Format nicht unterstützt."
-
-#, python-format
-msgid "Unknown function %(func)s in line %(lineno)i."
-msgstr "Unbekannte Funktion %(func)s in Zeile %(lineno)i."
-
-#, python-format
-msgid "The file %s was not found in the package."
-msgstr "Die Datei %s wurde im Paket nicht gefunden."
-
-msgid "Your changes are not saved!"
-msgstr "Ihre Änderungen sind nicht gesichert!"
-
-msgid "Page name is too long, try shorter name."
-msgstr "Seitenname ist zu lang, bitte kürzen."
-
-msgid "GUI Mode"
-msgstr "GUI-Modus"
-
-msgid "Edit was cancelled."
-msgstr "Editierung wurde abgebrochen."
-
-msgid "You can't copy to an empty pagename."
-msgstr "Sie können eine Seite nicht auf einen leeren Seitennamen kopieren."
-
-msgid "You are not allowed to copy this page!"
-msgstr "Sie dürfen diese Seite nicht kopieren!"
-
-#, python-format
-msgid ""
-"'''A page with the name {{{'%s'}}} already exists.'''\n"
-"Try a different name."
-msgstr ""
-"'''Es gibt bereits eine Seite mit dem Namen {{{'%s'}}}.'''\n"
-"Versuchen Sie es mit einem anderen Namen."
-
-#, python-format
-msgid "Could not copy page because of file system error: %s."
-msgstr ""
-"Konnte die Seite nicht kopieren wegen eines Dateisystem-Fehlercodes: %s."
-
-msgid "You are not allowed to rename this page!"
-msgstr "Sie dürfen diese Seite nicht umbenennen!"
-
-msgid "You can't rename to an empty pagename."
-msgstr "Sie können eine Seite nicht auf einen leeren Seitennamen umbenennen."
-
-#, python-format
-msgid ""
-"'''A page with the name {{{'%s'}}} already exists.'''\n"
-"\n"
-"Try a different name."
-msgstr ""
-"'''Es gibt bereits eine Seite mit dem Namen {{{'%s'}}}.'''\n"
-"Versuchen Sie es mit einem anderen Namen."
-
-#, python-format
-msgid "Could not rename page because of file system error: %s."
-msgstr ""
-"Konnte die Seite nicht umbenennen wegen eines Dateisystem-Fehlercodes: %s."
-
-msgid "You are not allowed to delete this page!"
-msgstr "Sie dürfen diese Seite nicht löschen!"
-
-msgid "Thank you for your changes. Your attention to detail is appreciated."
-msgstr "Danke für die Änderung und die Sorgfalt beim Editieren."
-
-#, python-format
-msgid "Page \"%s\" was successfully deleted!"
-msgstr "Seite \"%s\" wurde erfolgreich gelöscht!"
-
-#, python-format
-msgid ""
-"Dear Wiki user,\n"
-"\n"
-"You have subscribed to a wiki page or wiki category on \"%(sitename)s\" for "
-"change notification.\n"
-"\n"
-"The following page has been changed by %(editor)s:\n"
-"%(pagelink)s\n"
-"\n"
-msgstr ""
-"Sehr geehrter Wikibenutzer,\n"
-"\n"
-"Sie haben die Änderungen einer Wikiseite oder Kategorie von \"%(sitename)s\" "
-"abonniert.\n"
-"\n"
-"Die folgende Seite wurde durch %(editor)s verändert:\n"
-"%(pagelink)s\n"
-"\n"
-
-#, python-format
-msgid ""
-"The comment on the change is:\n"
-"%(comment)s\n"
-"\n"
-msgstr ""
-"Der Kommentar zur Änderung ist:\n"
-"%(comment)s\n"
-"\n"
-
-msgid "New page:\n"
-msgstr "Neue Seite:\n"
-
-msgid "No differences found!\n"
-msgstr "Es wurden keine Änderungen gefunden!\n"
-
-#, python-format
-msgid "[%(sitename)s] %(trivial)sUpdate of \"%(pagename)s\" by %(username)s"
-msgstr ""
-"[%(sitename)s] %(trivial)sÄnderung von \"%(pagename)s\" von %(username)s"
-
-msgid "Trivial "
-msgstr "Triviale "
-
-msgid "Status of sending notification mails:"
-msgstr "Status des Versands der Änderungsnachrichten:"
-
-#, python-format
-msgid "[%(lang)s] %(recipients)s: %(status)s"
-msgstr "[%(lang)s] %(recipients)s: %(status)s"
-
-#, python-format
-msgid "Page could not get locked. Unexpected error (errno=%d)."
-msgstr "Seite konnte nicht gesperrt werden. Unerwarteter Fehler (errno=%d)."
-
-msgid "Page could not get locked. Missing 'current' file?"
-msgstr "Seite konnte nicht gesperrt werden. Fehlende Datei 'current'?"
-
-msgid "You are not allowed to edit this page!"
-msgstr "Sie dürfen diese Seite nicht editieren!"
-
-msgid "You cannot save empty pages."
-msgstr "Leere Seiten können nicht gespeichert werden!"
-
-msgid "You already saved this page!"
-msgstr "Sie haben diese Seite bereits gesichert!"
-
-msgid "You already edited this page! Please do not use the back button."
-msgstr ""
-"Sie haben diese Seite bereits editiert! Bitte benutzen Sie nicht den Zurück-"
-"Button."
-
-msgid "You did not change the page content, not saved!"
-msgstr "Der Seiteninhalt wurde nicht verändert und folglich nicht gesichert!"
-
-msgid ""
-"You can't change ACLs on this page since you have no admin rights on it!"
-msgstr ""
-"Sie dürfen keine ACLs auf dieser Seite ändern, weil Sie keine admin-Rechte "
-"auf ihr haben!"
-
-#, python-format
-msgid ""
-"The lock of %(owner)s timed out %(mins_ago)d minute(s) ago, and you were "
-"granted the lock for this page."
-msgstr ""
-"Die Sperre von %(owner)s ist vor %(mins_ago)d Minute(n) abgelaufen und wurde "
-"an Sie übertragen."
-
-#, python-format
-msgid ""
-"Other users will be ''blocked'' from editing this page until %(bumptime)s."
-msgstr ""
-"Anderen Benutzern wird die Editierung dieser Seite bis %(bumptime)s "
-"''verweigert''."
-
-#, python-format
-msgid ""
-"Other users will be ''warned'' until %(bumptime)s that you are editing this "
-"page."
-msgstr ""
-"Andere Benutzer erhalten bis %(bumptime)s eine ''Warnung'', dass Sie diese "
-"Seite editieren."
-
-msgid "Use the Preview button to extend the locking period."
-msgstr "Mit \"Vorschau anzeigen\" können Sie diesen Zeitraum verlängern."
-
-#, python-format
-msgid ""
-"This page is currently ''locked'' for editing by %(owner)s until %(timestamp)"
-"s, i.e. for %(mins_valid)d minute(s)."
-msgstr ""
-"Diese Seite ist derzeit zur Editierung durch %(owner)s gegen Änderungen "
-"''gesperrt'' bis %(timestamp)s, also weitere %(mins_valid)d Minute(n)."
-
-#, python-format
-msgid ""
-"This page was opened for editing or last previewed at %(timestamp)s by %"
-"(owner)s.[[BR]]\n"
-"'''You should ''refrain from editing'' this page for at least another %"
-"(mins_valid)d minute(s),\n"
-"to avoid editing conflicts.'''[[BR]]\n"
-"To leave the editor, press the Cancel button."
-msgstr ""
-"Diese Seite wurde zum letzten Mal um %(timestamp)s durch %(owner)s zum "
-"Editieren geöffnet\n"
-"oder in der Vorschau angezeigt.[[BR]]\n"
-"'''Sie sollten diese Seite für mindestens weitere %(mins_valid)d Minute(n) "
-"''nicht editieren'', um Konflikte auszuschließen.'''[[BR]]\n"
-"Benutzen Sie \"Abbrechen\" zum Verlassen des Editors."
-
-msgid "<unknown>"
-msgstr "<unbekannt>"
-
-#, python-format
-msgid ""
-"Login Name: %s\n"
-"\n"
-"Login Password: %s\n"
-"\n"
-"Login URL: %s/%s?action=login\n"
-msgstr ""
-"Anmelde-Name: %s\n"
-"\n"
-"Anmelde-Passwort: %s\n"
-"\n"
-"Anmelde-URL: %s/%s?action=login\n"
-
-msgid ""
-"Somebody has requested to submit your account data to this email address.\n"
-"\n"
-"If you lost your password, please use the data below and just enter the\n"
-"password AS SHOWN into the wiki's password form field (use copy and paste\n"
-"for that).\n"
-"\n"
-"After successfully logging in, it is of course a good idea to set a new and "
-"known password.\n"
-msgstr ""
-"Jemand hat angefordert, Ihre Accountdaten an diese E-Mail-Adresse zu "
-"senden.\n"
-"\n"
-"Wenn Sie Ihr Passwort vergessen haben, benutzen Sie bitte die Daten unten "
-"und\n"
-"geben Sie das Passwort GENAUSO WIE ANGEZEIGT in das Passwort-Feld des Wikis "
-"ein (benutzen Sie kopieren und einfügen dazu).\n"
-"\n"
-"Nachdem Sie sich erfolgreich angemeldet haben, setzen Sie bitte Ihr Passwort "
-"neu.\n"
-
-#, python-format
-msgid "[%(sitename)s] Your wiki account data"
-msgstr "[%(sitename)s] Ihre Wiki-Acount-Daten"
-
-msgid ""
-"The backed up content of this page is deprecated and will not be included in "
-"search results!"
-msgstr ""
-"Der Inhalt der letzten Sicherungskopie ist veraltet und wird von der "
-"Volltextsuche ignoriert!"
-
-#, python-format
-msgid "Revision %(rev)d as of %(date)s"
-msgstr "Revision %(rev)d vom %(date)s"
-
-#, python-format
-msgid "Redirected from page \"%(page)s\""
-msgstr "Hierher umgeleitet von Seite \"%(page)s\""
-
-#, python-format
-msgid "This page redirects to page \"%(page)s\""
-msgstr "Diese Seite wird umgeleitet auf \"%(page)s\""
-
-msgid "Create New Page"
-msgstr "Neue Seite anlegen"
-
-msgid "You are not allowed to view this page."
-msgstr "Sie dürfen diese Seite nicht ansehen."
-
-#, python-format
-msgid ""
-"Results %(bs)s%(hitsFrom)d - %(hitsTo)d%(be)s of %(aboutHits)s %(bs)s%(hits)d"
-"%(be)s results out of about %(pages)d pages."
-msgstr ""
-"Ergebnisse %(bs)s%(hitsFrom)d - %(hitsTo)d%(be)s von %(aboutHits)s %(bs)s%"
-"(hits)d%(be)s Ergebnisse aus ungefähr %(pages)d Seiten."
-
-msgid "seconds"
-msgstr "Sekunden"
-
-msgid "Previous"
-msgstr "Vorherige"
-
-msgid "Next"
-msgstr "Nächste"
-
-msgid "current"
-msgstr "aktuelle"
-
-#, python-format
-msgid "last modified: %s"
-msgstr "zuletzt geändert: %s"
-
-msgid "match"
-msgstr "Treffer"
-
-msgid "matches"
-msgstr "Treffer"
-
-msgid "Go To Page"
-msgstr "Gehe zu Seite"
-
-msgid "Include system pages"
-msgstr "Systemseiten einschließen"
-
-msgid "Exclude system pages"
-msgstr "Systemseiten ausschließen"
-
-#, python-format
-msgid "Please use a more selective search term instead of {{{\"%s\"}}}"
-msgstr ""
-"Bitte verwenden Sie einen selektiveren Suchbegriff anstatt {{{\"%s\"}}}"
-
-#, python-format
-msgid "ERROR in regex '%s'"
-msgstr "FEHLER in regulärem Ausdruck '%s'"
-
-#, python-format
-msgid "Bad timestamp '%s'"
-msgstr "Ungültige Zeitangabe '%s'"
-
-#, python-format
-msgid "Unsupported navigation scheme '%(scheme)s'!"
-msgstr "Nicht bekanntes Navigationsschema '%(scheme)s'!"
-
-msgid "No parent page found!"
-msgstr "Diese Seite ist keine Unterseite!"
-
-msgid "Wiki"
-msgstr "Wiki"
-
-msgid "Edit"
-msgstr "Editieren"
-
-msgid "Slideshow"
-msgstr "Diaschau"
-
-msgid "Start"
-msgstr "Start"
-
-#, python-format
-msgid "Slide %(pos)d of %(size)d"
-msgstr "Seite %(pos)d von %(size)d"
-
-msgid "Search Titles"
-msgstr "Titel durchsuchen"
-
-msgid "Display context of search results"
-msgstr "Umgebung der Treffer anzeigen"
-
-msgid "Case-sensitive searching"
-msgstr "Groß-/Kleinschreibung beachten"
-
-msgid "Search Text"
-msgstr "Text durchsuchen"
-
-#, python-format
-msgid "Not supported mimetype of file: %s"
-msgstr "MIME-Typ der Datei wird nicht unterstützt: %s"
-
-msgid "Embedded"
-msgstr "Eingebettet"
-
-#, python-format
-msgid "Upload new attachment \"%(filename)s\""
-msgstr "Neuen Dateianhang \"%(filename)s\" hochladen"
-
-#, python-format
-msgid "Invalid MonthCalendar calparms \"%s\"!"
-msgstr "Ungültige MonthCalendaer calparms \"%s\"!"
-
-#, python-format
-msgid "Invalid MonthCalendar arguments \"%s\"!"
-msgstr "Ungültige MonthCalendar-Argumente: \"%s\"!"
-
-msgid "No orphaned pages in this wiki."
-msgstr "Es existieren keine verwaisten Seiten in diesem Wiki."
-
-msgid "Python Version"
-msgstr "Python Version"
-
-msgid "MoinMoin Version"
-msgstr "MoinMoin Version"
-
-#, python-format
-msgid "Release %s [Revision %s]"
-msgstr "Version %s [Revision %s]"
-
-msgid "4Suite Version"
-msgstr "4Suite Version"
-
-msgid "Number of pages"
-msgstr "Seitenanzahl"
-
-msgid "Number of system pages"
-msgstr "Anzahl der Systemseiten"
-
-msgid "Accumulated page sizes"
-msgstr "Kumulierte Seitengrößen"
-
-#, python-format
-msgid "Disk usage of %(data_dir)s/pages/"
-msgstr "Plattenbelegung von %(data_dir)s/pages/"
-
-#, python-format
-msgid "Disk usage of %(data_dir)s/"
-msgstr "Plattenbelegung von %(data_dir)s/"
-
-msgid "Entries in edit log"
-msgstr "Einträge in der Änderungshistorie"
-
-msgid "NONE"
-msgstr "KEINE"
-
-msgid "Global extension macros"
-msgstr "Globale Erweiterungsmakros"
-
-msgid "Local extension macros"
-msgstr "Lokale Erweiterungsmakros"
-
-msgid "Global extension actions"
-msgstr "Globale Erweiterungsaktionen"
-
-msgid "Local extension actions"
-msgstr "Lokale Erweiterungsaktionen"
-
-msgid "Global parsers"
-msgstr "Globale Parser"
-
-msgid "Local extension parsers"
-msgstr "Lokale Erweiterungsparser"
-
-msgid "Disabled"
-msgstr "Deaktiviert"
-
-msgid "Enabled"
-msgstr "Aktiviert"
-
-msgid "index available"
-msgstr "Index verfügbar"
-
-msgid "index unavailable"
-msgstr "Index nicht verfügbar"
-
-msgid "N/A"
-msgstr "k.A."
-
-msgid "Xapian and/or Python Xapian bindings not installed"
-msgstr "Xapian und/oder Python-Xapian-Bindings nicht installiert"
-
-msgid "Xapian search"
-msgstr "Xapian-Suche"
-
-msgid "Xapian Version"
-msgstr "Xapian-Version"
-
-msgid "Xapian stemming"
-msgstr "Xapian-Wortstamm-Bildung"
-
-msgid "Active threads"
-msgstr "Aktive Threads"
-
-#, python-format
-msgid "No quotes on %(pagename)s."
-msgstr "Keine Zitate auf Seite %(pagename)s gefunden."
-
-#, python-format
-msgid "Upload of attachment '%(filename)s'."
-msgstr "Dateianhang '%(filename)s' wurde angelegt."
-
-#, python-format
-msgid "Attachment '%(filename)s' deleted."
-msgstr "Dateianhang '%(filename)s' wurde gelöscht."
-
-#, python-format
-msgid "Drawing '%(filename)s' saved."
-msgstr "Zeichnung '%(filename)s' wurde gesichert."
-
-#, python-format
-msgid "Revert to revision %(rev)d."
-msgstr "Revision %(rev)d restauriert."
-
-#, python-format
-msgid "Renamed from '%(oldpagename)s'."
-msgstr "Umbenannt von '%(oldpagename)s'."
-
-#, python-format
-msgid "%(mins)dm ago"
-msgstr "vor %(mins)dm"
-
-msgid "(no bookmark set)"
-msgstr "(kein Lesezeichen gesetzt)"
-
-#, python-format
-msgid "(currently set to %s)"
-msgstr "(derzeit %s)"
-
-msgid "Delete bookmark"
-msgstr "Lesezeichen löschen"
-
-msgid "Set bookmark"
-msgstr "Lesezeichen setzen"
-
-msgid "[Bookmark reached]"
-msgstr "[Lesezeichen erreicht]"
-
-#, python-format
-msgid "Invalid include arguments \"%s\"!"
-msgstr "Ungültige \"Include\"-Argumente: \"%s\"!"
-
-#, python-format
-msgid "Nothing found for \"%s\"!"
-msgstr "Textmarkierung \"%s\" nicht gefunden!"
-
-msgid "edit"
-msgstr "ändern"
-
-msgid "Contents"
-msgstr "Inhaltsverzeichnis"
-
-msgid "You need to provide a chart type!"
-msgstr "Es muss ein Diagrammtyp angegeben werden!"
-
-#, python-format
-msgid "Bad chart type \"%s\"!"
-msgstr "Unbekannter Diagrammtyp \"%s\"!"
-
-msgid "Search for items"
-msgstr "Nach Items suchen"
-
-msgid "containing all the following terms"
-msgstr "die alle folgenden Ausdrücke enthalten"
-
-msgid "containing one or more of the following terms"
-msgstr "die einen oder mehrere der folgenden Ausdrücke enthalten"
-
-msgid "not containing the following terms"
-msgstr "die folgende Ausdrücke nicht enthalten"
-
-msgid "belonging to one of the following categories"
-msgstr "die einer der folgenden Kategorien angehören"
-
-msgid "last modified since (e.g. last 2 weeks)"
-msgstr "die zuletzt geändert wurden seit (z.B. 'last 2 weeks')"
-
-msgid "any language"
-msgstr "jede Sprache"
-
-msgid "any mimetype"
-msgstr "jeder MIME-Typ"
-
-msgid "Language"
-msgstr "Sprache"
-
-msgid "File Type"
-msgstr "Dateityp"
-
-msgid "Search only in titles"
-msgstr "Nur Titel durchsuchen"
-
-msgid "Case-sensitive search"
-msgstr "Groß-/Kleinschreibung bei der Suche beachten"
-
-msgid "Exclude underlay"
-msgstr "Underlay ausschließen"
-
-msgid "No system items"
-msgstr "Keine System-Items"
-
-msgid "Search in all page revisions"
-msgstr "In allen Seitenrevisionen suchen"
-
-msgid "Go get it!"
-msgstr "Los geht's"
-
-#, python-format
-msgid "Check your argument %s"
-msgstr "Überprüfen Sie das Argument %s"
-
-msgid "Markup"
-msgstr "Notation"
-
-msgid "Display"
-msgstr "Anzeige"
-
-msgid "No wanted pages in this wiki."
-msgstr "Es existieren keine gewünschten Seiten in diesem Wiki."
-
-#, python-format
-msgid "Connection to mailserver '%(server)s' failed: %(reason)s"
-msgstr "Verbindung zum Mailserver '%(server)s' gestört: %(reason)s"
-
-msgid "Mail not sent"
-msgstr "E-Mail wurde nicht versandt"
-
-msgid "Mail sent OK"
-msgstr "E-Mail wurde erfolgreich versandt"
-
-msgid "Date"
-msgstr "Datum"
-
-msgid "From"
-msgstr "Von"
-
-msgid "To"
-msgstr "An"
-
-msgid "Content"
-msgstr "Inhalt"
-
-msgid "Attachments"
-msgstr "Dateianhänge"
-
-msgid "XSLT option disabled, please look at HelpOnConfiguration."
-msgstr "XSLT-Option ist abgeschaltet, siehe HelpOnConfiguration."
-
-msgid "XSLT processing is not available, please install 4suite 1.x."
-msgstr ""
-"Die Verarbeitung von XSLT-Stylesheets ist nicht verfügbar, bitte 4suite 1.x "
-"installieren."
-
-#, python-format
-msgid "%(errortype)s processing error"
-msgstr "Verarbeitungsfehler vom Typ \"%(errortype)s\""
-
-#, python-format
-msgid "Expected \"%(wanted)s\" after \"%(key)s\", got \"%(token)s\""
-msgstr "Erwartete \"%(wanted)s\" nach \"%(key)s\", bekam \"%(token)s\""
-
-#, python-format
-msgid "Expected an integer \"%(key)s\" before \"%(token)s\""
-msgstr "Erwartete eine Ganzzahl \"%(key)s\" vor \"%(token)s\""
-
-#, python-format
-msgid "Expected an integer \"%(arg)s\" after \"%(key)s\""
-msgstr "Erwartete eine Ganzzahl \"%(arg)s\" nach \"%(key)s\""
-
-#, python-format
-msgid "Expected a color value \"%(arg)s\" after \"%(key)s\""
-msgstr "Erwartete einen Farbwert \"%(arg)s\" nach \"%(key)s\""
-
-msgid ""
-"Rendering of reStructured text is not possible, please install Docutils."
-msgstr ""
-"Anzeigen von reStructured Text ist nicht möglich, bitte installieren Sie "
-"Docutils."
-
-msgid "**Maximum number of allowed includes exceeded**"
-msgstr "**Maximale Anzahl erlaubter Includes überschritten**"
-
-#, python-format
-msgid "**Could not find the referenced page: %s**"
-msgstr "**Konnte die referenzierte Seite nicht finden: %s**"
-
-#, python-format
-msgid "Inlined image: %(url)s"
-msgstr "Eingebettetes Bild: %(url)s"
-
-#, python-format
-msgid "Create new drawing \"%(filename)s (opens in new window)\""
-msgstr "Neue Zeichnung \"%(filename)s\" anlegen (öffnet ein neues Fenster)"
-
-#, python-format
-msgid "Edit drawing %(filename)s (opens in new window)"
-msgstr "Zeichnung %(filename)s bearbeiten (öffnet ein neues Fenster)"
-
-#, python-format
-msgid "Clickable drawing: %(filename)s"
-msgstr "Anklickbare Zeichnung %(filename)s"
-
-msgid "Toggle line numbers"
-msgstr "Zeilennummern ein/ausschalten"
-
-msgid "[all]"
-msgstr "[alle]"
-
-msgid "[not empty]"
-msgstr "[nicht leer]"
-
-msgid "[empty]"
-msgstr "[leer]"
-
-msgid "filter"
-msgstr "Filter"
-
-msgid "Line"
-msgstr "Zeile"
-
-msgid "No differences found!"
-msgstr "Es wurden keine Änderungen gefunden!"
-
-msgid "Deletions are marked like this."
-msgstr "Gelöschter Text ist auf diese Art markiert."
-
-msgid "Additions are marked like this."
-msgstr "Hinzugefügter Text ist auf diese Art markiert."
-
-#, python-format
-msgid ""
-"Sorry, can not save page because \"%(content)s\" is not allowed in this wiki."
-msgstr ""
-"Kann die Seite nicht speichern, weil der Inhalt \"%(content)s\" in diesem "
-"Wiki nicht erlaubt ist."
-
-msgid "Page"
-msgstr "Seite"
-
-msgid "User"
-msgstr "Benutzer"
-
-msgid "Diffs"
-msgstr "DifferenzAnzeige"
-
-msgid "Info"
-msgstr "Info"
-
-msgid "Unsubscribe"
-msgstr "Nicht abonnieren"
-
-msgid "Subscribe"
-msgstr "Abonnieren"
-
-msgid "Raw"
-msgstr "Rohform"
-
-msgid "XML"
-msgstr "XML"
-
-msgid "Print"
-msgstr "Druckansicht"
-
-msgid "View"
-msgstr "Anzeigen"
-
-msgid "Home"
-msgstr "Heim"
-
-msgid "Up"
-msgstr "Hoch"
-
-msgid "[RSS]"
-msgstr "[RSS]"
-
-msgid "[DELETED]"
-msgstr "[GELÖSCHT]"
-
-msgid "[UPDATED]"
-msgstr "[AKTUALISIERT]"
-
-msgid "[RENAMED]"
-msgstr "[UMBENANNT]"
-
-msgid "[CONFLICT]"
-msgstr "[KONFLIKT]"
-
-msgid "[NEW]"
-msgstr "[NEU]"
-
-msgid "[DIFF]"
-msgstr "[DIFF]"
-
-msgid "[BOTTOM]"
-msgstr "[FUSS]"
-
-msgid "[TOP]"
-msgstr "[KOPF]"
-
-msgid "Click to do a full-text search for this title"
-msgstr "Hier klicken für eine Liste der Seiten, die auf diese verweisen"
-
-msgid "Preferences"
-msgstr "Einstellungen"
-
-msgid "Logout"
-msgstr "Abmelden"
-
-msgid "Clear message"
-msgstr "Nachricht löschen"
-
-#, python-format
-msgid "last edited %(time)s by %(editor)s"
-msgstr "zuletzt geändert am %(time)s durch %(editor)s"
-
-#, python-format
-msgid "last modified %(time)s"
-msgstr "zuletzt geändert %(time)s"
-
-msgid "Search:"
-msgstr "Suchen:"
-
-msgid "Text"
-msgstr "Text"
-
-msgid "Titles"
-msgstr "Titel"
-
-msgid "Search"
-msgstr "Suche"
-
-msgid "More Actions:"
-msgstr "Weitere Aktionen:"
-
-msgid "------------------------"
-msgstr "------------------------"
-
-msgid "Raw Text"
-msgstr "Rohform"
-
-msgid "Print View"
-msgstr "Druckansicht"
-
-msgid "Delete Cache"
-msgstr "Cache löschen"
-
-msgid "Rename Page"
-msgstr "Seite umbenennen"
-
-msgid "Copy Page"
-msgstr "Seite kopieren"
-
-msgid "Delete Page"
-msgstr "Seite löschen"
-
-msgid "Like Pages"
-msgstr "Ähnliche Seiten"
-
-msgid "Local Site Map"
-msgstr "ÜbersichtsKarte"
-
-msgid "My Pages"
-msgstr "Meine Seiten"
-
-msgid "Subscribe User"
-msgstr "Abo für Benutzer"
-
-msgid "Remove Spam"
-msgstr "Spam entfernen"
-
-msgid "Revert to this revision"
-msgstr "Diese Revision restaurieren"
-
-msgid "Package Pages"
-msgstr "Seiten paketieren"
-
-msgid "Render as Docbook"
-msgstr "Docbook ausgeben"
-
-msgid "Sync Pages"
-msgstr "Seiten synchronisieren"
-
-msgid "Do"
-msgstr "Los!"
-
-msgid "Comments"
-msgstr "Kommentare"
-
-msgid "Edit (Text)"
-msgstr "Editieren (Text)"
-
-msgid "Edit (GUI)"
-msgstr "Editieren (GUI)"
-
-msgid "Immutable Page"
-msgstr "Geschützte Seite"
-
-msgid "Remove Link"
-msgstr "Verweis entfernen"
-
-msgid "Add Link"
-msgstr "Verweis hinzufügen"
-
-#, python-format
-msgid "Show %s days."
-msgstr "%s Tage anzeigen."
-
-msgid "Wiki Markup"
-msgstr "Wiki Quelltext"
-
-msgid "DeleteCache"
-msgstr "CacheLöschen"
-
-#, python-format
-msgid "(cached %s)"
-msgstr "(gecached %s)"
-
-msgid "Or try one of these actions:"
-msgstr "Oder benutze eine dieser Aktionen:"
-
-msgid "FrontPage"
-msgstr "StartSeite"
-
-msgid "RecentChanges"
-msgstr "AktuelleÄnderungen"
-
-msgid "TitleIndex"
-msgstr "TitelIndex"
-
-msgid "WordIndex"
-msgstr "WortIndex"
-
-msgid "FindPage"
-msgstr "SeiteFinden"
-
-msgid "SiteNavigation"
-msgstr "WegWeiser"
-
-msgid "HelpContents"
-msgstr "HilfeInhalt"
-
-msgid "HelpOnFormatting"
-msgstr "HilfeZumFormatieren"
-
-msgid "UserPreferences"
-msgstr "BenutzerEinstellungen"
-
-msgid "WikiLicense"
-msgstr "WikiLizenz"
-
-msgid "MissingPage"
-msgstr "FehlendeSeite"
-
-msgid "MissingHomePage"
-msgstr "FehlendePersönlicheSeite"
-
-msgid "Mon"
-msgstr "Mo"
-
-msgid "Tue"
-msgstr "Di"
-
-msgid "Wed"
-msgstr "Mi"
-
-msgid "Thu"
-msgstr "Do"
-
-msgid "Fri"
-msgstr "Fr"
-
-msgid "Sat"
-msgstr "Sa"
-
-msgid "Sun"
-msgstr "So"
-
-msgid "AttachFile"
-msgstr "DateiAnhänge"
-
-msgid "DeletePage"
-msgstr "SeiteLöschen"
-
-msgid "LikePages"
-msgstr "ÄhnlicheSeiten"
-
-msgid "LocalSiteMap"
-msgstr "ÜbersichtsKarte"
-
-msgid "RenamePage"
-msgstr "SeiteUmbenennen"
-
-msgid "SpellCheck"
-msgstr "RechtSchreibung"
-
-#, python-format
-msgid "Unknown action %(action_name)s."
-msgstr "Unbekannte Aktion %(action_name)s."
-
-#, python-format
-msgid "You are not allowed to do %(action_name)s on this page."
-msgstr "Sie dürfen die Aktion %(action_name)s auf dieser Seite nicht benutzen!"
-
-msgid "Login and try again."
-msgstr "Melden Sie sich an und probieren Sie es noch einmal."
-
-msgid "Charts are not available!"
-msgstr "Die Diagrammoption ist nicht verfügbar!"
-
-msgid "Page Size Distribution"
-msgstr "Verteilung der Seitengrößen"
-
-msgid "page size upper bound [bytes]"
-msgstr "Obere Grenze der Seitengröße [bytes]"
-
-msgid "# of pages of this size"
-msgstr "Anzahl der Seiten in dieser Größenklasse"
-
-msgid "User agent"
-msgstr "Browsertyp"
-
-msgid "Others"
-msgstr "Sonstige"
-
-msgid "Distribution of User-Agent Types"
-msgstr "Verteilung der Zugriffe auf Browsertypen"
-
-msgid "Views/day"
-msgstr "Lesezugriffe/Tag"
-
-msgid "Edits/day"
-msgstr "Schreibzugriffe/Tag"
-
-msgid "Page hits and edits"
-msgstr "Seitenzugriffe und Änderungen"
-
-#, python-format
-msgid "%(chart_title)s for %(filterpage)s"
-msgstr "%(chart_title)s für %(filterpage)s"
-
-msgid ""
-"green=view\n"
-"red=edit"
-msgstr ""
-"grün=Anzeigen\n"
-"rot=Änderungen"
-
-msgid "date"
-msgstr "Datum"
-
-msgid "# of hits"
-msgstr "Anzahl der Zugriffe"
-
-msgid ""
-" Emphasis:: [[Verbatim('')]]''italics''[[Verbatim('')]]; [[Verbatim"
-"(''')]]'''bold'''[[Verbatim(''')]]; [[Verbatim(''''')]]'''''bold "
-"italics'''''[[Verbatim(''''')]]; [[Verbatim('')]]''mixed ''[[Verbatim"
-"(''')]]'''''bold'''[[Verbatim(''')]] and italics''[[Verbatim('')]]; "
-"[[Verbatim(----)]] horizontal rule.\n"
-" Headings:: [[Verbatim(=)]] Title 1 [[Verbatim(=)]]; [[Verbatim(==)]] Title "
-"2 [[Verbatim(==)]]; [[Verbatim(===)]] Title 3 [[Verbatim(===)]]; [[Verbatim"
-"(====)]] Title 4 [[Verbatim(====)]]; [[Verbatim(=====)]] Title 5 [[Verbatim"
-"(=====)]].\n"
-" Lists:: space and one of: * bullets; 1., a., A., i., I. numbered items; 1."
-"#n start numbering at n; space alone indents.\n"
-" Links:: [[Verbatim(JoinCapitalizedWords)]]; [[Verbatim([\"brackets and "
-"double quotes\"])]]; url; [url]; [url label].\n"
-" Tables:: || cell text |||| cell text spanning 2 columns ||; no trailing "
-"white space allowed after tables or titles.\n"
-"\n"
-"(!) For more help, see HelpOnEditing or SyntaxReference.\n"
-msgstr ""
-" Betonung:: [[Verbatim('')]]''kursiv''[[Verbatim('')]]; [[Verbatim"
-"(''')]]'''fett'''[[Verbatim(''')]]; [[Verbatim(''''')]]'''''fett und "
-"kursiv'''''[[Verbatim(''''')]]; [[Verbatim('')]]''gemischt ''[[Verbatim"
-"(''')]]'''''fett'''[[Verbatim(''')]] und kursiv''[[Verbatim('')]]; [[Verbatim"
-"(----)]] horizontaler Balken.\n"
-" Überschriften:: [[Verbatim(=)]] Überschrift 1 [[Verbatim(=)]]; [[Verbatim"
-"(==)]] Überschrift 2 [[Verbatim(==)]]; [[Verbatim(===)]] Ü 3 [[Verbatim"
-"(===)]]; [[Verbatim(====)]] Ü 4 [[Verbatim(====)]]; [[Verbatim(=====)]] Ü "
-"5 [[Verbatim(=====)]].\n"
-" Listen:: Leerzeichen und eins von: * Punkte; 1., a., A., i., I. nummerierte "
-"Punkte; 1.#n starte Nummerierung bei n; nur Leerzeichen rückt ein.\n"
-" Links:: [[Verbatim(ZusammenGeschriebeneGroßeWorte)]]; [[Verbatim"
-"([\"Klammern und doppelte Anführungszeichen\"])]]; url; [url]; [url "
-"label].\n"
-" Tabellen:: || Zellentext |||| Zellentext, 2 Zellen überspannend ||; "
-"keine anhängenden Leerzeichen nach Überschriften oder Tabellen.\n"
-"\n"
-"(!) Weitere Hilfe finden Sie unter HilfeZumEditieren oder SyntaxReferenz.\n"
-
-msgid ""
-"Emphasis: <i>*italic*</i> <b>**bold**</b> ``monospace``<br/>\n"
-"<br/><pre>\n"
-"Headings: Heading 1 Heading 2 Heading 3\n"
-" ========= --------- ~~~~~~~~~\n"
-"\n"
-"Horizontal rule: ---- \n"
-"Links: TrailingUnderscore_ `multi word with backticks`_ external_ \n"
-"\n"
-".. _external: http://external-site.net/foo/\n"
-"\n"
-"Lists: * bullets; 1., a. numbered items.\n"
-"</pre>\n"
-"<br/>\n"
-"(!) For more help, see the \n"
-"<a href=\"http://docutils.sourceforge.net/docs/user/rst/quickref.html\">\n"
-"reStructuredText Quick Reference\n"
-"</a>.\n"
-msgstr ""
-"Betonung: <i>*kursiv*</i> <b>**fett**</b> ``gleiche Zeichenbreite``<br/>\n"
-"<br/><pre>\n"
-"Überschriften: Überschrift 1 Überschrift 2 Überschrift 3\n"
-" ============= ------------- ~~~~~~~~~~~~~\n"
-"\n"
-"Horizontale Linie: ---- \n"
-"Links: AngehängterUnterstrich_ `mehrere Worte mit Rückwärtsapostroph`_ "
-"extern_ \n"
-"\n"
-".. _extern: http://externe-seite.de/\n"
-"\n"
-"Listen: * Punkte; 1., a. nummerierte Punkte.\n"
-"</pre>\n"
-"<br/>\n"
-"(!) Für mehr Hilfe siehe die \n"
-"<a href=\"http://docutils.sourceforge.net/docs/user/rst/quickref.html\">\n"
-"reStructuredText Quick Reference\n"
-"</a>.\n"
-
-msgid "UnSubscribe"
-msgstr "Nicht abonnieren"
-
-msgid "Publish my email (not my wiki homepage) in author info"
-msgstr ""
-"Veröffentliche meine E-Mail-Adresse (nicht meine Wiki-Homepage) in der "
-"Autoren-Info"
-
-msgid "Open editor on double click"
-msgstr "Editor per Doppelklick öffnen"
-
-msgid "After login, jump to last visited page"
-msgstr "Nach dem Anmelden zur zuletzt besuchten Seite springen"
-
-msgid "Show comment sections"
-msgstr "Kommentarabschnitte anzeigen"
-
-msgid "Show question mark for non-existing pagelinks"
-msgstr "Verweise auf unbekannte Seiten mit Fragezeichen markieren"
-
-msgid "Show page trail"
-msgstr "Kürzlich besuchte Seiten anzeigen (Verlauf)"
-
-msgid "Show icon toolbar"
-msgstr "Werkzeugleiste mit Bildsymbolen anzeigen"
-
-msgid "Show top/bottom links in headings"
-msgstr "Verweise zum Anfang und Ende der Seite in Überschriften anzeigen"
-
-msgid "Show fancy diffs"
-msgstr "Unterschiede farbig markiert anzeigen"
-
-msgid "Add spaces to displayed wiki names"
-msgstr "Angezeigte Wikinamen mit Leerzeichen trennen"
-
-msgid "Remember login information"
-msgstr "Speichere Login-Informationen"
-
-msgid "Subscribe to trivial changes"
-msgstr "Triviale Änderungen abonnieren"
-
-msgid "Disable this account forever"
-msgstr "Dieses Benutzerkonto für immer deaktivieren"
-
-msgid "(Use Firstname''''''Lastname)"
-msgstr "(Vorname''''''Nachname verwenden)"
-
-msgid "Alias-Name"
-msgstr "Alias-Name"
-
-msgid "Password repeat"
-msgstr "Passwort wiederholen"
-
-msgid "(Only for password change or new account)"
-msgstr "(Nur für Passwort-Änderung oder neue Benutzerkonten)"
-
-msgid "User CSS URL"
-msgstr "Benutzer CSS URL"
-
-msgid "(Leave it empty for disabling user CSS)"
-msgstr "Leer lassen, um benutzerdefiniertes CSS auszuschalten)"
-
-msgid "Editor size"
-msgstr "Größe des Texteingabefelds"
-
-msgid "Do it."
-msgstr "Ausführen"
-
-#, python-format
-msgid "Execute action %(actionname)s?"
-msgstr "Aktion %(actionname)s ausführen?"
-
-#, python-format
-msgid "Action %(actionname)s is excluded in this wiki!"
-msgstr "Aktion %(actionname)s ist ausgeschlossen in diesem Wiki!"
-
-#, python-format
-msgid "You are not allowed to use action %(actionname)s on this page!"
-msgstr "Sie dürfen die Aktion %(actionname)s auf dieser Seite nicht benutzen!"
-
-#, python-format
-msgid "Please use the interactive user interface to use action %(actionname)s!"
-msgstr ""
-"Für die Aktion %(actionname)s bitte nur die vorgesehenen Webseiten benutzen!"
-
-msgid "You must login to add a quicklink."
-msgstr "Sie müssen sich anmelden, um einen Expressverweis hinzuzufügen."
-
-msgid "Your quicklink to this page has been removed."
-msgstr "Ihr Expressverweis für diese Seite wurde entfernt."
-
-msgid "Your quicklink to this page could not be removed."
-msgstr "Ihr Expressverweis für diese Seite konnte nicht entfernt werden."
-
-msgid "A quicklink to this page has been added for you."
-msgstr "Ein Expressverweis für diese Seite wurde hinzugefügt."
-
-msgid "A quicklink to this page could not be added for you."
-msgstr "Ein Expressverweis für diese Seite konnte nicht hinzugefügt werden."
-
-msgid "Missing password. Please enter user name and password."
-msgstr "Fehlendes Passwort. Bitte geben Sie Benutzername und Passwort ein."
-
-msgid "Sorry, login failed."
-msgstr "Login fehlgeschlagen."
-
-#, python-format
-msgid "[%d attachments]"
-msgstr "[%d Anhänge]"
-
-#, python-format
-msgid ""
-"There are <a href=\"%(link)s\">%(count)s attachment(s)</a> stored for this "
-"page."
-msgstr ""
-"Es sind <a href=\"%(link)s\">%(count)s Anhänge</a> für diese Seite "
-"gespeichert."
-
-#, python-format
-msgid "Attachment '%(target)s' already exists."
-msgstr "Dateianhang '%(target)s' existiert bereits."
-
-msgid "Filename of attachment not specified!"
-msgstr "Dateiname des Anhangs fehlt oder ist leer!"
-
-#, python-format
-msgid "Attachment '%(filename)s' does not exist!"
-msgstr "Dateianhang '%(filename)s' existiert nicht!"
-
-msgid ""
-"To refer to attachments on a page, use '''{{{attachment:filename}}}''', \n"
-"as shown below in the list of files. \n"
-"Do '''NOT''' use the URL of the {{{[get]}}} link, \n"
-"since this is subject to change and can break easily."
-msgstr ""
-"Um Dateianhänge in eine Seite einzufügen sollte unbedingt eine Angabe \n"
-"wie '''{{{attachment:dateiname}}}''' benutzt werden, \n"
-"wie sie auch in der folgenden Liste der Dateien erscheint. \n"
-"Es sollte '''niemals''' die URL des Verweises (\"laden\") kopiert werden, \n"
-"da sich diese jederzeit ändern kann und damit der Verweis auf die Datei "
-"brechen würde."
-
-msgid "del"
-msgstr "löschen"
-
-msgid "move"
-msgstr "verschieben"
-
-msgid "get"
-msgstr "laden"
-
-msgid "view"
-msgstr "anzeigen"
-
-msgid "unzip"
-msgstr "auspacken"
-
-msgid "install"
-msgstr "installieren"
-
-#, python-format
-msgid "No attachments stored for %(pagename)s"
-msgstr "Es wurden keine Anhänge für die Seite %(pagename)s gespeichert."
-
-msgid "Edit drawing"
-msgstr "Zeichnung editieren"
-
-msgid "New Attachment"
-msgstr "Neuer Dateianhang"
-
-msgid ""
-"An upload will never overwrite an existing file. If there is a name\n"
-"conflict, you have to rename the file that you want to upload.\n"
-"Otherwise, if \"Rename to\" is left blank, the original filename will be "
-"used."
-msgstr ""
-"Ein neuer Anhang überschreibt niemals einen bereits vorhandenen gleichen "
-"Namens.\n"
-"Besteht ein Namenskonflikt, muss dem neuen Anhang ein alternativer Name "
-"zugewiesen werden.\n"
-"Ansonsten kann das Feld \"Umbenennen auf\" leer bleiben und es wird der "
-"originale Dateiname benutzt."
-
-msgid "File to upload"
-msgstr "Neuer Dateianhang"
-
-msgid "Rename to"
-msgstr "Umbenennen auf"
-
-msgid "Overwrite existing attachment of same name"
-msgstr "Anhänge gleichen Namens überschreiben"
-
-msgid "Upload"
-msgstr "Datei hochladen"
-
-msgid "Attached Files"
-msgstr "Gespeicherte Dateianhänge"
-
-msgid "You are not allowed to attach a file to this page."
-msgstr "Sie dürfen keine Anhänge an diese Seite anhängen!"
-
-msgid "File attachments are not allowed in this wiki!"
-msgstr "Dateianhänge sind in diesem Wiki nicht erlaubt!"
-
-msgid "You are not allowed to save a drawing on this page."
-msgstr "Sie dürfen auf dieser Seite keine Zeichnung speichern."
-
-msgid ""
-"No file content. Delete non ASCII characters from the file name and try "
-"again."
-msgstr ""
-"Kein Dateiinhalt. Löschen Sie nicht-ASCII-Zeichen aus dem Dateinamen und "
-"probieren Sie es noch einmal."
-
-msgid "You are not allowed to delete attachments on this page."
-msgstr "Sie dürfen keine Anhänge dieser Seite löschen!"
-
-msgid "You are not allowed to move attachments from this page."
-msgstr "Sie dürfen keine Anhänge von dieser Seite verschieben."
-
-msgid "Move aborted!"
-msgstr "Verschieben abgebrochen!"
-
-msgid "Please use the interactive user interface to move attachments!"
-msgstr ""
-"Für die das Verschieben von Anhängen bitte nur die vorgesehenen Webseiten "
-"benutzen!"
-
-msgid "You are not allowed to get attachments from this page."
-msgstr "Sie dürfen auf keine Anhänge dieser Seite zugreifen."
-
-msgid "You are not allowed to unzip attachments of this page."
-msgstr "Sie dürfen keine Anhänge dieser Seite auspacken."
-
-msgid "You are not allowed to install files."
-msgstr "Sie dürfen keine Dateien installieren."
-
-msgid "You are not allowed to view attachments of this page."
-msgstr "Sie dürfen keine Anhänge dieser Seite ansehen."
-
-#, python-format
-msgid "Unsupported upload action: %s"
-msgstr "Unbekannte Aktion für Dateianhang: %s"
-
-#, python-format
-msgid "Attachments for \"%(pagename)s\""
-msgstr "Dateianhänge für \"%(pagename)s\""
-
-#, python-format
-msgid ""
-"Attachment '%(target)s' (remote name '%(filename)s') with %(bytes)d bytes "
-"saved."
-msgstr ""
-"Dateianhang '%(target)s' (ursprünglicher Name '%(filename)s') mit %(bytes)d "
-"Bytes gesichert."
-
-#, python-format
-msgid "Attachment '%(target)s' (remote name '%(filename)s') already exists."
-msgstr ""
-"Dateianhang '%(target)s' (ursprünglicher Name '%(filename)s') existiert "
-"bereits."
-
-#, python-format
-msgid "Attachment '%(filename)s' already exists."
-msgstr "Dateianhang '%(filename)s' existiert bereits."
-
-#, python-format
-msgid "Attachment '%(filename)s' moved to %(page)s."
-msgstr "Dateianhang '%(filename)s' auf Seite %(page)s verschoben."
-
-msgid "Nothing changed"
-msgstr "Keine Änderung."
-
-#, python-format
-msgid "Page %(newpagename)s does not exists or you don't have enough rights."
-msgstr ""
-"Seite %(newpagename)s existiert nicht oder Sie haben nicht ausreichend "
-"Rechte."
-
-msgid "Move aborted because empty page name"
-msgstr "Sie können eine Seite nicht auf einen leeren Seitennamen umbenennen."
-
-#, python-format
-msgid "Please use a valid filename for attachment '%(filename)s'."
-msgstr ""
-"Bitte benutzen Sie einen gültigen Dateinamen für Dateianhang '%(filename)s'."
-
-msgid "Move aborted because empty attachment name"
-msgstr "Verschieben wegen eines leeren Anhangsnamens abgebrochen"
-
-msgid "Move"
-msgstr "Verschieben"
-
-msgid "New page name"
-msgstr "Neuer Seitenname"
-
-msgid "New attachment name"
-msgstr "Neuer Name des Dateianhangs"
-
-#, python-format
-msgid "Attachment '%(filename)s' installed."
-msgstr "Dateianhang '%(filename)s' wurde installiert."
-
-#, python-format
-msgid ""
-"Attachment '%(filename)s' could not be unzipped because the resulting files "
-"would be too large (%(space)d kB missing)."
-msgstr ""
-"Dateianhang '%(filename)s' konnte nicht ausgepackt werden, weil die "
-"ausgepackten Dateien zu groß wären (%(space)d kB fehlen)."
-
-#, python-format
-msgid ""
-"Attachment '%(filename)s' could not be unzipped because the resulting files "
-"would be too many (%(count)d missing)."
-msgstr ""
-"Dateianhang '%(filename)s' konnte nicht ausgepackt werden, weil die "
-"ausgepackten Dateien zu viele wären (%(count)d fehlen)."
-
-#, python-format
-msgid "Attachment '%(filename)s' unzipped."
-msgstr "Dateianhang '%(filename)s' wurde ausgepackt."
-
-#, python-format
-msgid ""
-"Attachment '%(filename)s' not unzipped because the files are too big, .zip "
-"files only, exist already or reside in folders."
-msgstr ""
-"Dateianhang '%(filename)s' wurde nicht ausgepackt, weil die Datei zu groß "
-"sind, weil nur .zip-Dateien erlaubt sind, weil sie bereits existieren oder "
-"weil Dateien in Ordnern enthalten sind."
-
-#, python-format
-msgid "The file %(filename)s is not a .zip file."
-msgstr "Die Datei %(filename)s ist keine .zip-Datei."
-
-#, python-format
-msgid "Attachment '%(filename)s'"
-msgstr "Dateianhang '%(filename)s'"
-
-msgid "Package script:"
-msgstr "Paket-Skript:"
-
-msgid "File Name"
-msgstr "Dateiname"
-
-msgid "Modified"
-msgstr "Modifiziert"
-
-msgid "Size"
-msgstr "Größe"
-
-msgid "Unknown file type, cannot display this attachment inline."
-msgstr ""
-"Dieser Anhang besitzt einen unbekannten Dateityp und kann deshalb nicht "
-"direkt angezeigt werden."
-
-#, python-format
-msgid "attachment:%(filename)s of %(pagename)s"
-msgstr "[[Verbatim(attachment:)]]%(filename)s für %(pagename)s"
-
-msgid "This page is already deleted or was never created!"
-msgstr "Diese Seite wurde bereits gelöscht oder wurde bisher nicht angelegt!"
-
-msgid "Rename all /subpages too?"
-msgstr "Alle /UnterSeiten auch umbenennen?"
-
-msgid "New name"
-msgstr "Neuer Name"
-
-msgid "Optional reason for the renaming"
-msgstr "Optionale Begründung für das Umbenennen"
-
-msgid "Really rename this page?"
-msgstr "Diese Seite wirklich umbenennen?"
-
-#, python-format
-msgid "Full Link List for \"%s\""
-msgstr "Liste aller Seitenverweise für \"%s\""
-
-msgid "Editor"
-msgstr "Autor"
-
-msgid "Pages"
-msgstr "Seiten"
-
-msgid "Select Author"
-msgstr "Autor auswählen"
-
-msgid "Revert all!"
-msgstr "Alle restaurieren!"
-
-msgid "You are not allowed to use this action."
-msgstr "Sie dürfen diese Aktion nicht ausführen."
-
-#, python-format
-msgid "Rolled back changes to the page %s."
-msgstr "Änderungen an der Seite %s rückgängig gemacht"
-
-msgid "Exception while calling rollback function:"
-msgstr "Fehler beim Aufrufen der Rollback-Funktion:"
-
-msgid ""
-"Please enter your password of your account at the remote wiki below. "
-"[[BR]] /!\\ You should trust both wikis because the password could be read "
-"by the particular administrators."
-msgstr ""
-"Bitte geben Sie das Passwort Ihres Accounts im fernen Wiki unten ein. "
-"[[BR]] /!\\ Sie sollten beiden Wikis vertrauen, weil das Passwort von den "
-"entsprechenden Administratoren gelesen werden könnte."
-
-msgid "Operation was canceled."
-msgstr "Operation wurde abgebrochen."
-
-msgid "The only supported directions are BOTH and DOWN."
-msgstr "Es werden nur die Richtungen BOTH und DOWN unterstützt."
-
-msgid ""
-"Please set an interwikiname in your wikiconfig (see HelpOnConfiguration) to "
-"be able to use this action."
-msgstr ""
-"Bitte setzen Sie interwikiname in Ihrer wikiconfig (siehe "
-"HilfeZurKonfiguration), um diese Aktion benutzen zu können."
-
-msgid ""
-"Incorrect parameters. Please supply at least the ''remoteWiki'' parameter. "
-"Refer to HelpOnSynchronisation for help."
-msgstr ""
-"Ungültige Parameter, bitte geben Sie mindestens den ''remoteWiki''-Parameter "
-"an. Siehe HilfeZurSynchronisation für weitere Informationen."
-
-msgid "The ''remoteWiki'' is unknown."
-msgstr "Das ''remoteWiki'' ist nicht bekannt."
-
-msgid "A severe error occured:"
-msgstr "Ein schwerwiegender Fehler ist aufgetreten:"
-
-msgid "Synchronisation finished. Look below for the status messages."
-msgstr "Synchronisierung beendet, siehe Status-Nachrichten unten."
-
-msgid "Synchronisation started -"
-msgstr "Synchronisierung gestartet -"
-
-#, python-format
-msgid ""
-"Got a list of %s local and %s remote pages. This results in %s different "
-"pages over-all."
-msgstr ""
-"%s lokale und %s ferne Seiten, resultierend in insgesamt %s "
-"unterschiedlichen Seiten."
-
-#, python-format
-msgid "After filtering: %s pages"
-msgstr "Nach dem Filtern: %s Seiten"
-
-#, python-format
-msgid "Skipped page %s because of no write access to local page."
-msgstr ""
-"Seite %s wurde wegen fehlenden Schreibrechten auf die lokale Seite "
-"übersprungen."
-
-#, python-format
-msgid "Deleted page %s locally."
-msgstr "Lokale Seite %s gelöscht."
-
-#, python-format
-msgid "Error while deleting page %s locally:"
-msgstr "Fehler beim lokalen Löschen der Seite %s:"
-
-#, python-format
-msgid "Deleted page %s remotely."
-msgstr "Ferne Seite %s gelöscht."
-
-#, python-format
-msgid "Error while deleting page %s remotely:"
-msgstr "Fehler beim fernen Löschen der Seite %s:"
-
-#, python-format
-msgid ""
-"The item %s cannot be merged automatically but was changed in both wikis. "
-"Please delete it in one of both wikis and try again."
-msgstr ""
-"Das Objekt %s kann nicht automatisch zusammengeführt werden, wurde aber in "
-"beiden Wikis geändert. Bitte löschen Sie es in einem der beiden Wikis und "
-"versuchen Sie es erneut."
-
-#, python-format
-msgid ""
-"The item %s has different mime types in both wikis and cannot be merged. "
-"Please delete it in one of both wikis or unify the mime type, and try again."
-msgstr ""
-"Das Objekt %s hat einen unterschiedlichen Mime-Typ in beiden Wikis und kann "
-"nicht zusammengeführt werden. Bitte löschen Sie es in einem der beiden Wikis "
-"oder vereinheitlichen Sie den Mime-Typ und probieren Sie es nochmal."
-
-#, python-format
-msgid ""
-"The item %s was renamed locally. This is not implemented yet. Therefore the "
-"full synchronisation history is lost for this page."
-msgstr ""
-"Seite %s wurde lokal umbenannt. Dies wird noch nicht unterstützt, daher geht "
-"für diese Seite die ganze Synchronisierungs-Historie verloren."
-
-#, python-format
-msgid "Synchronising page %s with remote page %s ..."
-msgstr "Synchronisiere Seite %s mit der entfernten Seite %s ..."
-
-#, python-format
-msgid "The page %s was deleted remotely but changed locally."
-msgstr "Seite %s wurde lokal geändert, aber ferne gelöscht."
-
-#, python-format
-msgid ""
-"The page %s could not be synced. The remote page was renamed. This is not "
-"supported yet. You may want to delete one of the pages to get it synced."
-msgstr ""
-"Seite %s konnte nicht synchronisiert werden. Die entfernte Seite wurde "
-"umbenannt, was bis jetzt noch nicht unterstützt wird. Vielleicht möchten Sie "
-"eine der Seiten löschen, um die Seite erfolgreich zu synchronisieren."
-
-#, python-format
-msgid "Skipped page %s because of a locally or remotely unresolved conflict."
-msgstr ""
-"Seite %s wurde wegen eines lokalen oder entfernten nicht beseitigten "
-"Konflikts übersprungen."
-
-#, python-format
-msgid ""
-"This is the first synchronisation between the local and the remote wiki for "
-"the page %s."
-msgstr ""
-"Dies ist die erste Synchronisation zwischen dem lokalen und fernen Wiki für "
-"die Seite %s."
-
-#, python-format
-msgid ""
-"The page %s could not be merged because you are not allowed to modify the "
-"page in the remote wiki."
-msgstr ""
-"Die Seite %s konnte nicht zusammengeführt werden, weil Sie die Seite im "
-"fernen Wiki nicht ändern dürfen."
-
-#, python-format
-msgid "Page %s successfully merged."
-msgstr "Seite \"%s\" wurde erfolgreich zusammengeführt."
-
-#, python-format
-msgid "Page %s contains conflicts that were introduced on the remote side."
-msgstr "Seite %s enthält von der fernen Seite eingeführte Konflikte."
-
-#, python-format
-msgid "Page %s merged with conflicts."
-msgstr "Seite %s wurde mit Konflikten zusammengeführt."
-
-msgid "Load"
-msgstr "Laden"
-
-msgid "New Page or New Attachment"
-msgstr "Neue Seite oder neuer Dateianhang"
-
-msgid ""
-"You can upload a file to a new page or choose to upload a file as attachment "
-"for the current page"
-msgstr ""
-"Sie können eine Datei in eine neue Seite hochladen oder eine Datei als "
-"Dateianhang an die aktuelle Seite hochladen"
-
-msgid "attachment"
-msgstr "Dateianhang"
-
-msgid "overwrite"
-msgstr "überschreiben"
-
-msgid "New Name"
-msgstr "Neuer Name"
-
-#, python-format
-msgid "(including %(localwords)d %(pagelink)s)"
-msgstr "(inklusive %(localwords)d %(pagelink)s)"
-
-#, python-format
-msgid ""
-"The following %(badwords)d words could not be found in the dictionary of %"
-"(totalwords)d words%(localwords)s and are highlighted below:"
-msgstr ""
-"Die nachfolgenden %(badwords)d Worte konnten nicht im Wörterbuch mit %"
-"(totalwords)d Worten%(localwords)s gefunden werden und sind im Text "
-"hervorgehoben:"
-
-msgid "Add checked words to dictionary"
-msgstr "Markierte Wörter zum Wörterbuch hinzufügen"
-
-msgid "No spelling errors found!"
-msgstr "Keine Rechtschreibfehler gefunden!"
-
-msgid "You can't save spelling words."
-msgstr "Sie können keine Rechtschreibkorrektur-Wörter abspeichern."
-
-msgid "You can't check spelling on a page you can't read."
-msgstr ""
-"Sie dürfen keine Seite auf Rechtschreibung prüfen, die Sie nicht lesen "
-"können."
-
-msgid "You are now logged out."
-msgstr "Sie sind nun abgemeldet."
-
-msgid "You are not allowed to subscribe to a page you can't read."
-msgstr "Sie dürfen keine Seiten abonnieren, die Sie nicht lesen dürfen."
-
-msgid "This wiki is not enabled for mail processing."
-msgstr "In diesem Wiki ist Mail-Verarbeitung nicht eingeschaltet."
-
-msgid "You must log in to use subscriptions."
-msgstr "Sie müssen sich anmelden, um Abonnements verwenden zu können."
-
-msgid "Add your email address in your UserPreferences to use subscriptions."
-msgstr ""
-"Fügen Sie Ihre E-Mail-Adresse in den BenutzerEinstellungen hinzu, um "
-"Abonnements benutzen zu können."
-
-msgid "Your subscription to this page has been removed."
-msgstr "Ihr Abonnementsfür diese Seite wurde entfernt."
-
-msgid "Can't remove regular expression subscription!"
-msgstr "Kann nicht Abonnement mit regulärem Ausdruck entfernen."
-
-msgid "Edit the subscription regular expressions in your UserPreferences."
-msgstr ""
-"Editieren Sie die regulären Ausdrücke für Abonnements in Ihren "
-"BenutzerEinstellungen."
-
-msgid "You have been subscribed to this page."
-msgstr "Die Seite wurde zur Liste abonnierter Seiten hinzugefügt."
-
-msgid "You could not get subscribed to this page."
-msgstr ""
-"Die Seite konnte nicht zur Liste abonnierter Seiten hinzugefügt werden."
-
-msgid "General Information"
-msgstr "Allgemeine Informationen"
-
-#, python-format
-msgid "Page size: %d"
-msgstr "Seitengröße: %d"
-
-msgid "SHA digest of this page's content is:"
-msgstr "Signatur des Seiteninhalts nach dem SHA-Verfahren:"
-
-msgid "The following users subscribed to this page:"
-msgstr "Nachfolgende Benutzer haben diese Seite abonniert:"
-
-msgid "This page links to the following pages:"
-msgstr "Diese Seite verweist auf die folgenden Seiten:"
-
-msgid "Diff"
-msgstr "Differenz"
-
-msgid "Comment"
-msgstr "Kommentar"
-
-msgid "Revision History"
-msgstr "Versionshistorie"
-
-msgid "No log entries found."
-msgstr "Keine Log-Einträge gefunden."
-
-#, python-format
-msgid "Info for \"%s\""
-msgstr "Info für \"%s\""
-
-#, python-format
-msgid "Show \"%(title)s\""
-msgstr "\"%(title)s\" anzeigen"
-
-msgid "General Page Infos"
-msgstr "Allgemeine Seiten-Informationen"
-
-msgid "Please log in first."
-msgstr "Bitte melden Sie sich vorher an."
-
-msgid "Please first create a homepage before creating additional pages."
-msgstr ""
-"Bitte erzeugen Sie zuerst eine Homepage, bevor Sie weitere Seiten anlegen."
-
-#, python-format
-msgid ""
-"You can add some additional sub pages to your already existing homepage "
-"here.\n"
-"\n"
-"You can choose how open to other readers or writers those pages shall be,\n"
-"access is controlled by group membership of the corresponding group page.\n"
-"\n"
-"Just enter the sub page's name and click on the button to create a new "
-"page.\n"
-"\n"
-"Before creating access protected pages, make sure the corresponding group "
-"page\n"
-"exists and has the appropriate members in it. Use HomepageGroupsTemplate for "
-"creating\n"
-"the group pages.\n"
-"\n"
-"||'''Add a new personal page:'''||'''Related access control list "
-"group:'''||\n"
-"||[[NewPage(HomepageReadWritePageTemplate,read-write page,%(username)s)]]||"
-"[\"%(username)s/ReadWriteGroup\"]||\n"
-"||[[NewPage(HomepageReadPageTemplate,read-only page,%(username)s)]]||[\"%"
-"(username)s/ReadGroup\"]||\n"
-"||[[NewPage(HomepagePrivatePageTemplate,private page,%(username)s)]]||%"
-"(username)s only||\n"
-"\n"
-msgstr ""
-"Hier können Sie zusätzliche Unterseiten zu Ihrer bereits existierenden "
-"Homepage hinzufügen.\n"
-"\n"
-"Sie können wählen, wie offen diese Seiten für andere Leser oder Autoren sein "
-"sollen,\n"
-"der Zugriff wird über Gruppenmitgliedschaft in der entsprechenden Gruppe "
-"kontrolliert.\n"
-"\n"
-"Geben Sie einfach den Namen der Unterseite ein und klicken Sie auf den "
-"Knopf, um eine neue Seite zu erzeugen.\n"
-"\n"
-"Bevor Sie zugriffsgeschützte Seiten erzeugen, stellen Sie sicher, dass die "
-"entsprechende Gruppenseite existiert und die richtigen Mitglieder hat. "
-"Benutzen Sie HomepageGroupsTemplate für das Erzeugen der Gruppenseiten.\n"
-"\n"
-"||'''Neue persönliche Seite hinzufügen:'''||'''Zugeordnete ACL-Gruppe:'''||\n"
-"||[[NewPage(HomepageReadWritePageTemplate,Seite (read/write),%(username)"
-"s)]]||[\"%(username)s/ReadWriteGroup\"]||\n"
-"||[[NewPage(HomepageReadPageTemplate,Seite (read-only),%(username)s)]]||[\"%"
-"(username)s/ReadGroup\"]||\n"
-"||[[NewPage(HomepagePrivatePageTemplate,Seite (privat),%(username)s)]]||nur %"
-"(username)s||\n"
-"\n"
-
-msgid "MyPages management"
-msgstr "Verwaltung meiner Seiten"
-
-#, python-format
-msgid "Subscribe users to the page %s"
-msgstr "Seite %s für Benutzer abonnieren"
-
-#, python-format
-msgid "Subscribed for %s:"
-msgstr "Abonnenten von %s:"
-
-msgid "Not a user:"
-msgstr "Kein Benutzer:"
-
-msgid "You are not allowed to perform this action."
-msgstr "Sie dürfen diese Aktion nicht ausführen."
-
-#, python-format
-msgid "(!) Only pages changed since '''%s''' are being displayed!"
-msgstr "(!) Nur Seiten, die seit '''%s''' geändert wurden, werden angezeigt!"
-
-msgid ""
-"/!\\ The modification date you entered was not recognized and is therefore "
-"not considered for the search results!"
-msgstr ""
-"/!\\ Das eingegebene Änderungsdatum wurde nicht erkannt und wird deshalb "
-"nicht bei der Suche berücksichtigt."
-
-#, python-format
-msgid "Title Search: \"%s\""
-msgstr "Titelsuche: \"%s\""
-
-#, python-format
-msgid "Advanced Search: \"%s\""
-msgstr "Erweiterte Suche: \"%s\""
-
-#, python-format
-msgid "Full Text Search: \"%s\""
-msgstr "Volltextsuche: \"%s\""
-
-#, python-format
-msgid ""
-"Your search query {{{\"%s\"}}} is invalid. Please refer to HelpOnSearching "
-"for more information."
-msgstr ""
-"Ihre Suchanfrage {{{\"%s\"}}} ist ungültig. Siehe HilfeZumSuchen für weitere "
-"Informationen."
-
-#, python-format
-msgid ""
-"Your search query {{{\"%s\"}}} didn't return any results. Please change some "
-"terms and refer to HelpOnSearching for more information.%s"
-msgstr ""
-"Ihre Suche nach {{{\"%s\"}}} hat keine Resultate ergeben. Bitte ändern Sie "
-"einige Suchbegriffe und lesen Sie für weitere Informationen auf "
-"HilfeZumSuchen nach. %s"
-
-msgid "(!) Consider performing a"
-msgstr "(!) Erwägen Sie eine"
-
-msgid "full-text search with your search terms"
-msgstr "Volltextsuche mit Ihren Suchbegriffen"
-
-msgid ""
-"(!) You're performing a title search that might not include all related "
-"results of your search query in this wiki. [[BR]]"
-msgstr ""
-"(!) Sie führen eine Titelsuche durch, die möglicherweise nicht alle "
-"relevanten Ergebnisse Ihrer Sucheanfrage in diesem Wiki enthält. [[BR]]"
-
-msgid "Click here to perform a full-text search with your search terms!"
-msgstr "Hier klicken für eine Volltextsuche mit diesen Suchbegriffen!"
-
-#, python-format
-msgid ""
-"Restored Backup: %(filename)s to target dir: %(targetdir)s.\n"
-"Files: %(filecount)d, Directories: %(dircount)d"
-msgstr ""
-"Wiederhergestelltes Backup: %(filename)s nach Zielverzeichnis: %(targetdir)"
-"s.\n"
-"Dateien: %(filecount)d, Verzeichnisse: %(dircount)d"
-
-#, python-format
-msgid "Restoring backup: %(filename)s to target dir: %(targetdir)s failed."
-msgstr ""
-"Wiederherstellen von Backup %(filename)s in das Zielverzeichnis %(targetdir)"
-"s fehlgeschlagen."
-
-msgid "Wiki Backup / Restore"
-msgstr "Wiki Sicherung / Wiederherstellung"
-
-msgid ""
-"Some hints:\n"
-" * To restore a backup:\n"
-" * Restoring a backup will overwrite existing data, so be careful.\n"
-" * Rename it to <siteid>.tar.<compression> (remove the --date--time--UTC "
-"stuff).\n"
-" * Put the backup file into the backup_storage_dir (use scp, ftp, ...).\n"
-" * Hit the [[GetText(Restore)]] button below.\n"
-"\n"
-" * To make a backup, just hit the [[GetText(Backup)]] button and save the "
-"file\n"
-" you get to a secure place.\n"
-"\n"
-"Please make sure your wiki configuration backup_* values are correct and "
-"complete.\n"
-"\n"
-msgstr ""
-"Hinweise:\n"
-" * Um ein Backup wiederherzustellen:\n"
-" * Das Wiederherstellen eines Backups wird bestehende Daten überschreiben, "
-"also seien Sie vorsichtig.\n"
-" * Benennen Sie es auf <siteid>.tar.<compression> um (entfernen Sie --date--"
-"time--UTC).\n"
-" * Legen Sie die Backupdatei in das backup_storage_dir (mit scp, "
-"ftp, ...).\n"
-" * Drücken Sie unten auf [[GetText(Restore)]]-Knopf unten.\n"
-"\n"
-" * Um ein Backup zu erstellen, drücken Sie einfach auf den [[GetText"
-"(Backup)]]-Knopf und sichern Sie die Datei,\n"
-" die Sie erhalten an eine sichere Stelle.\n"
-"\n"
-"Bitte stellen Sie sicher, dass die backup_* Werte in Ihrer Wiki-"
-"Konfiguration korrekt und vollständig sind.\n"
-
-msgid "Backup"
-msgstr "Datensicherung"
-
-msgid "Restore"
-msgstr "Datenwiederherstellung"
-
-msgid "You are not allowed to do remote backup."
-msgstr "Sie dürfen kein Remote-Backup ausführen."
-
-#, python-format
-msgid "Unknown backup subaction: %s."
-msgstr "Unbekannte backup Unteraktion: %s."
-
-msgid "You are not allowed to revert this page!"
-msgstr "Sie dürfen diese Seite nicht restaurieren!"
-
-msgid ""
-"You were viewing the current revision of this page when you called the "
-"revert action. If you want to revert to an older revision, first view that "
-"older revision and then call revert to this (older) revision again."
-msgstr ""
-"Sie haben die aktuelle Revision dieser Seite angeschaut als Sie die "
-"Restaurieren-Funktion aufgerufen haben. Wenn Sie eine ältere Revision "
-"restaurieren wollen, betrachten Sie erst diese ältere Revision und rufen Sie "
-"dann die Restaurieren-Funktion für diese ältere Revision erneut auf."
-
-#, python-format
-msgid "Local Site Map for \"%s\""
-msgstr "Lokale Seitenverweise für \"%s\""
-
-#, python-format
-msgid "No pages like \"%s\"!"
-msgstr "Keine Seite ähnlich wie \"%s\"!"
-
-#, python-format
-msgid "Invalid filename \"%s\"!"
-msgstr "Ungültiger Dateiname \"%s\"!"
-
-#, python-format
-msgid "Created the package %s containing the pages %s."
-msgstr "Paket %s, das die Seiten %s enthält wurde erzeugt."
-
-msgid "Package pages"
-msgstr "Seiten paketieren"
-
-msgid "Package name"
-msgstr "Paketname"
-
-msgid "List of page names - separated by a comma"
-msgstr "Liste von Seitennamen - getrennt durch ein Komma"
-
-msgid "No older revisions available!"
-msgstr "Es sind keine älteren Versionen dieser Seite verfügbar!"
-
-#, python-format
-msgid "Diff for \"%s\""
-msgstr "Änderungen von \"%s\""
-
-#, python-format
-msgid "Differences between revisions %d and %d"
-msgstr "Unterschiede zwischen den Revisionen %d und %d"
-
-#, python-format
-msgid "(spanning %d versions)"
-msgstr "(über %d Versionen hinweg)"
-
-#, python-format
-msgid "The page was saved %(count)d times, though!"
-msgstr "Die Seite wurde jedoch %(count)d mal gespeichert!"
-
-msgid "(ignoring whitespace)"
-msgstr "(ignoriere Leerraum)"
-
-msgid "Ignore changes in the amount of whitespace"
-msgstr "Ausschließlich Leerraum betreffende Änderungen ignorieren"
-
-#, python-format
-msgid "Exactly one page like \"%s\" found, redirecting to page."
-msgstr "Genau eine Seite wie \"%s\" gefunden, leite dorthin weiter."
-
-#, python-format
-msgid "Pages like \"%s\""
-msgstr "Seiten ähnlich wie \"%s\""
-
-#, python-format
-msgid "%(matchcount)d %(matches)s for \"%(title)s\""
-msgstr "%(matchcount)d %(matches)s passen zu \"%(title)s\""
-
-msgid "Copy all /subpages too?"
-msgstr "Alle /UnterSeiten auch kopieren?"
-
-msgid "Optional reason for the copying"
-msgstr "Optionale Begründung für das Kopieren"
-
-msgid "Really copy this page?"
-msgstr "Diese Seite wirklich kopieren?"
-
-msgid ""
-"Cannot create a new page without a page name. Please specify a page name."
-msgstr ""
-"Kann keine neue Seite ohne Seitennamen anlegen - bitte geben Sie einen "
-"Seitennamen an."
-
-msgid "Delete"
-msgstr "Löschen"
-
-msgid "Delete all /subpages too?"
-msgstr "Alle /UnterSeiten auch löschen?"
-
-msgid "Optional reason for the deletion"
-msgstr "Optionale Begründung für die Löschung"
-
-msgid "Really delete this page?"
-msgstr "Diese Seite wirklich löschen?"
-
-#~ msgid "filename"
-#~ msgstr "Dateiname"
-
-#~ msgid ""
-#~ "~-If you submit this form, the submitted values will be displayed.\n"
-#~ "To use this form on other pages, insert a\n"
-#~ "[[BR]][[BR]]'''{{{ [[Form(\"%(pagename)s\")]]}}}'''[[BR]][[BR]]\n"
-#~ "macro call.-~\n"
-#~ msgstr ""
-#~ "~-Das Absenden dieses Formulars zeigt die eingegebenen Werte an.\n"
-#~ "Um das Formular auf anderen Seiten zu benutzen, muss folgender "
-#~ "Makroaufruf\n"
-#~ "[[BR]][[BR]]'''{{{ [[Form(\"%(pagename)s\")]]}}}'''[[BR]][[BR]]\n"
-#~ "auf diesen Seiten platziert werden.-~\n"
-
-#~ msgid ""
-#~ "Unknown user name: {{{\"%s\"}}}. Please enter user name and password."
-#~ msgstr ""
-#~ "Unbekannter Benutzername: {{{\"%s\"}}}. Bitte geben Sie Benutzername und "
-#~ "Passwort ein."
diff --git a/tests/examplefiles/demo.ahk b/tests/examplefiles/demo.ahk
deleted file mode 100644
index a75a8bf6..00000000
--- a/tests/examplefiles/demo.ahk
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-multiline comment
-msgbox(comment)
-*/
-send, key[pgdn]
-string := "hello" . x . "world!"
-string := "hello ""world""! "
-string := "hello `"world""! "
-; single line comment1
-;;; single line comment2
-
-::stopi::viper_off()
-
-a::send, ^a
-mylabel:send, ^{space} ;; set mark
-e::send, ^e
-n::
- send, ^n
- return
-!i::
-viper("iviper") ; stdlib
-x = "viper"" " ; escaped quote
-Return
-#If WinExist("iviper" )
-indexdir = %A_ScriptDir%\%dir%
-FileCreateDir, % indexdir
-fileindex = %indexdir%\_files
-FileSelectFile, file,,, Select an image:, Images (*.gif; *.jpg; *.bmp; *.png; *.tif; *.ico; *.cur; *.ani; *.exe; *.dll)
-
-; viper
-
-
-i::viper_off()
-#If
-
-;; keybindings
-#If WinExist("iviper") and WinActive("ahk_class Emacs")
-
-p::
-k::
-send, ^p
-return
-,::send, +!, ;; beginning of page
-.::send, +!. ;; end of page
-[::send, !a
-]::send, !e
-d:: ^k ;; kill line
-x:: send ^d
-\:: ^!k ;; kill next word or sexp
-
-
-#IfWinActive
-#Persistent
-
-F2:: ;; hotkey
-start: ;; label
-start2: ; label
- ppm := ppm_new(50, 50, 255)
- ppm_fill(ppm, 80, 90, 95)
- msgbox % getPixel(ppm, 1, 1)
- setPixel(90, 90, 90, ppm, 1, 1)
- msgbox % getPixel(ppm, 1, 1)
- ListVars ; command
- msgbox % ppm
- return
-
-
- ppm_read(file)
- {
- fileread, ppm, % file
- return ppm
-}
-
-::hotstring::
-::hot3::
-ppm_width(ppm)
-{
- regexmatch(ppm, "\R(\d+)\s(\d+)", dim)
- return dim1
-}
-ppm_height(ppm)
-{
- regexmatch(ppm, "\R(\d+)\s(\d+)", dim)
- return dim2
-}
-
-ppm_colors(ppm)
-{
-regexmatch(ppm, "\R(\d+)\D*\R", colors) ; \R stands for any
-return colors1
-}
-
-ppm_data(ppm)
-{
-pos := regexmatch(ppm, "\R(\d+)\D*\R", colors) ; \R stands for any newline
-stringtrimleft, data, ppm, pos + strlen(colors1)
-return data
-}
-ppm_header(ppm)
-{
-pos := regexmatch(ppm, "\R(\d+)\D*\R", colors) ; \R stands for any newline
-stringleft, header, ppm, pos + strlen(colors1)
-return header
-}
-
-ppm_fill(ByRef ppm, r, g, b)
-{
- width := ppm_width(ppm)
- height := ppm_height(ppm)
- header := ppm_header(ppm)
- headerLength := strlen(header)
- varsetcapacity(data, width * height, 0)
- loop, % (width * height)
- {
- if r
- numput(r, data, (A_Index - 1) * 3, "uchar")
- if g
- numput(g, data, (A_Index - 1) * 3 + 1, "uchar")
- if b
- numput(b, data, (A_Index - 1) * 3 + 2, "uchar")
-}
-VarCopy(&ppm + headerLength, &data, width * height)
-
-}
-
-ppm_new(width, height, colors)
-{
- header = P6`n%width% %height%`n%colors%`n
- headerLength := strlen(header)
- varsetcapacity(ppm, width * height + headerLength, 1)
- varsetcapacity(data, width * height, 0)
- VarCopy(&ppm, &header, headerLength)
- VarCopy(&ppm + headerLength, &data, width * height)
- return ppm
-}
-
-heredoc =
-(
- P6
- # lasdjkf
- 87 09
- 255
- color data...
-)
-
-; Example: Simple image viewer:
-
-Gui, +Resize
-Gui, Add, Button, default, &Load New Image
-Gui, Add, Radio, ym+5 x+10 vRadio checked, Load &actual size
-Gui, Add, Radio, ym+5 x+10, Load to &fit screen
-Gui, Add, Pic, xm vPic
-Gui, Show
-return
-
-ButtonLoadNewImage:
-FileSelectFile, file,,, Select an image:, Images (*.gif; *.jpg; *.bmp; *.png; *.tif; *.ico; *.cur; *.ani; *.exe; *.dll)
-if file =
- return
-Gui, Submit, NoHide ; Save the values of the radio buttons.
-if Radio = 1 ; Display image at its actual size.
-{
- Width = 0
- Height = 0
-}
-else ; Second radio is selected: Resize the image to fit the screen.
-{
- Width := A_ScreenWidth - 28 ; Minus 28 to allow room for borders and margins inside.
- Height = -1 ; "Keep aspect ratio" seems best.
-}
-GuiControl,, Pic, *w%width% *h%height% %file% ; Load the image.
-Gui, Show, xCenter y0 AutoSize, %file% ; Resize the window to match the picture size.
-return
-
-GuiClose:
-ExitApp
-; Example: Simple text editor with menu bar.
-
-; Create the sub-menus for the menu bar:
-Menu, FileMenu, Add, &New, FileNew
-
diff --git a/tests/examplefiles/demo.cfm b/tests/examplefiles/demo.cfm
deleted file mode 100644
index 78098c05..00000000
--- a/tests/examplefiles/demo.cfm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!--- cfcomment --->
-<!--- nested <!--- cfcomment ---> --->
-<!--- multi-line
-nested
-<!---
-cfcomment
---->
---->
-<!-- html comment -->
-<html>
-<head>
-<title>Date Functions</title>
-</head>
-<body>
-<cfset RightNow = Now()>
-<cfoutput>
- #RightNow#<br />
- #DateFormat(RightNow)#<br />
- #DateFormat(RightNow,"mm/dd/yy")#<br />
- #TimeFormat(RightNow)#<br />
- #TimeFormat(RightNow,"hh:mm tt")#<br />
- #IsDate(RightNow)#<br />
- #IsDate("January 31, 2007")#<br />
- #IsDate("foo")#<br />
- #DaysInMonth(RightNow)#
-</cfoutput>
-<cfset x="x">
-<cfset y="y">
-<cfset z="z">
-<cfoutput group="x">
- #x#
- <cfoutput>#y#</cfoutput>
- #z#
-</cfoutput>
-</body>
-</html>
-
-<cfset person = "Paul">
-<cfset greeting = "Hello #person#">
-
-<cfset greeting = "Hello" & " world!">
-<cfset a = 5>
-<cfset b = 10>
-<cfset c = a^b>
-<cfset c = a MOD b>
-<cfset c = a / b>
-<cfset c = a * b>
-<cfset c = a + b>
-<cfset c = a - b>
-<!--- <!-- another <!--- nested --> ---> comment --->
diff --git a/tests/examplefiles/demo.css.in b/tests/examplefiles/demo.css.in
deleted file mode 100644
index 36330a9d..00000000
--- a/tests/examplefiles/demo.css.in
+++ /dev/null
@@ -1,6 +0,0 @@
-%if defined(__foo__)
-.cls {
- color: #fff;
-}
-%endif
-%literal %foo
diff --git a/tests/examplefiles/demo.frt b/tests/examplefiles/demo.frt
deleted file mode 100644
index 1b09ebb0..00000000
--- a/tests/examplefiles/demo.frt
+++ /dev/null
@@ -1,3 +0,0 @@
-2 3 + CR .
-: F ( blah ) DUP DROP 1 + ;
-1 F CR .
diff --git a/tests/examplefiles/demo.hbs b/tests/examplefiles/demo.hbs
deleted file mode 100644
index ae80cc1b..00000000
--- a/tests/examplefiles/demo.hbs
+++ /dev/null
@@ -1,34 +0,0 @@
-<!-- post.handlebars -->
-
-<div class='intro'>
- {{intro}}
-</div>
-
-{{#if isExpanded}}
- <div class='body'>{{body}}</div>
- <button {{action contract}}>Contract</button>
-{{else}}
- <button {{action expand}}>Show More...</button>
-{{/if}}
-
-{{> myPartial}}
-{{> myPartial var="value" }}
-{{> myPartial var=../value}}
-{{> (myPartial)}}
-{{> (myPartial) var="value"}}
-{{> (lookup . "myPartial")}}
-{{> ( lookup . "myPartial" ) var="value" }}
-{{> (lookup ../foo "myPartial") var="value" }}
-{{> @partial-block}}
-
-{{#>myPartial}}
-...
-{{/myPartial}}
-
-{{#*inline "myPartial"}}
-...
-{{/inline}}
-
-{{../name}}
-{{./name}}
-{{this/name}}
diff --git a/tests/examplefiles/demo.js.in b/tests/examplefiles/demo.js.in
deleted file mode 100644
index f44fc53d..00000000
--- a/tests/examplefiles/demo.js.in
+++ /dev/null
@@ -1,6 +0,0 @@
-window.foo = {
-#if defined(__foo__)
- 'key': 'value'
-#endif
-}
-#literal #foo
diff --git a/tests/examplefiles/demo.thrift b/tests/examplefiles/demo.thrift
deleted file mode 100644
index e50544d5..00000000
--- a/tests/examplefiles/demo.thrift
+++ /dev/null
@@ -1,14 +0,0 @@
-/* comment */
-/** doc comment */
-
-namespace cpp shared // inline comment
-
-struct Foo1 {
- 1: i32 key
- 2: string value
-}
-
-service Foo2 {
- Foo1 bar(1: i32 key)
-}
-
diff --git a/tests/examplefiles/demo.xul.in b/tests/examplefiles/demo.xul.in
deleted file mode 100644
index 9e1f4938..00000000
--- a/tests/examplefiles/demo.xul.in
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<window
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-#if defined(__foo__)
-<description value="Text" />
-#endif
-</window>
diff --git a/tests/examplefiles/django_sample.html+django b/tests/examplefiles/django_sample.html+django
deleted file mode 100644
index b1fdc5eb..00000000
--- a/tests/examplefiles/django_sample.html+django
+++ /dev/null
@@ -1,68 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n admin_modify adminmedia %}
-{% block extrahead %}{{ block.super }}
-<script type="text/javascript" src="../../../jsi18n/"></script>
-{% for js in javascript_imports %}{% include_admin_script js %}{% endfor %}
-{% endblock %}
-{% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %}
-{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}
-{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
-{% block userlinks %}<a href="../../../doc/">{% trans 'Documentation' %}</a> / <a href="../../../password_change/">{% trans 'Change password' %}</a> / <a href="../../../logout/">{% trans 'Log out' %}</a>{% endblock %}
-{% block breadcrumbs %}{% if not is_popup %}
-<div class="breadcrumbs">
- <a href="../../../">{% trans "Home" %}</a> &rsaquo;
- <a href="../">{{ opts.verbose_name_plural|capfirst|escape }}</a> &rsaquo;
- {% if add %}{% trans "Add" %} {{ opts.verbose_name|escape }}{% else %}{{ original|truncatewords:"18"|escape }}{% endif %}
-</div>
-{% endif %}{% endblock %}
-{% block content %}<div id="content-main">
-{% if change %}{% if not is_popup %}
- <ul class="object-tools"><li><a href="history/" class="historylink">{% trans "History" %}</a></li>
- {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
- </ul>
-{% endif %}{% endif %}
-<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
-<div>
-{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
-{% if opts.admin.save_on_top %}{% submit_row %}{% endif %}
-{% if form.error_dict %}
- <p class="errornote">
- {% blocktrans count form.error_dict.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
- </p>
-{% endif %}
-{% for bound_field_set in bound_field_sets %}
- <fieldset class="module aligned {{ bound_field_set.classes }}">
- {% if bound_field_set.name %}<h2>{{ bound_field_set.name }}</h2>{% endif %}
- {% if bound_field_set.description %}<div class="description">{{ bound_field_set.description }}</div>{% endif %}
- {% for bound_field_line in bound_field_set %}
- {% admin_field_line bound_field_line %}
- {% for bound_field in bound_field_line %}
- {% filter_interface_script_maybe bound_field %}
- {% endfor %}
- {% endfor %}
- </fieldset>
-{% endfor %}
-{% block after_field_sets %}{% endblock %}
-{% if change %}
- {% if ordered_objects %}
- <fieldset class="module"><h2>{% trans "Ordering" %}</h2>
- <div class="form-row{% if form.order_.errors %} error{% endif %} ">
- {% if form.order_.errors %}{{ form.order_.html_error_list }}{% endif %}
- <p><label for="id_order_">{% trans "Order:" %}</label> {{ form.order_ }}</p>
- </div></fieldset>
- {% endif %}
-{% endif %}
-{% for related_object in inline_related_objects %}{% edit_inline related_object %}{% endfor %}
-{% block after_related_objects %}{% endblock %}
-{% submit_row %}
-{% if add %}
- <script type="text/javascript">document.getElementById("{{ first_form_field_id }}").focus();</script>
-{% endif %}
-{% if auto_populated_fields %}
- <script type="text/javascript">
- {% auto_populated_field_script auto_populated_fields change %}
- </script>
-{% endif %}
-</div>
-</form></div>
-{% endblock %}
diff --git a/tests/examplefiles/docker.docker b/tests/examplefiles/docker.docker
deleted file mode 100644
index 1ae3c3a1..00000000
--- a/tests/examplefiles/docker.docker
+++ /dev/null
@@ -1,34 +0,0 @@
-FROM alpine:3.5
-MAINTAINER First O'Last
-
-# comment
-run echo \
- 123 $bar
-RUN apk --update add rsync dumb-init
-
-# Test env with both syntax
-ENV FOO = "BAR"
-ENV FOO \
- "BAR"
-
-COPY foo "bar"
-COPY foo \
- "bar"
-
-HEALTHCHECK \
- --interval=5m --timeout=3s \
- CMD curl -f http://localhost/ || exit 1
-
-# ONBUILD keyword, then with linebreak
-ONBUILD ADD . /app/src
-ONBUILD \
- RUN echo 123 $bar
-
-# Potential JSON array parsing, mixed with linebreaks
-VOLUME \
- /foo
-VOLUME \
- ["/bar"]
-VOLUME ["/bar"]
-VOLUME /foo
-CMD ["foo", "bar"]
diff --git a/tests/examplefiles/durexmania.aheui b/tests/examplefiles/durexmania.aheui
deleted file mode 100644
index 89654c00..00000000
--- a/tests/examplefiles/durexmania.aheui
+++ /dev/null
@@ -1,4 +0,0 @@
-우주메이저☆듀렉스전도사♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♂♀♡먊
-삶은밥과야근밥샤주세양♡밥사밥사밥사밥사밥사땅땅땅빵☆따밦내발따밦다빵맣밥밥밥내놔밥줘밥밥밥밗땅땅땅박밝땅땅딻타밟타맣밦밣따박타맣밦밣따박타맣밦밣따박타맣박빵빵빵빵따따따따맣삶몲
-Original Source by @harunene // Run it on AheuiChem(http://yoo2001818.github.io/AheuiChem/)
-https://gist.github.com/item4/ca870a63b390da6cc6f1
diff --git a/tests/examplefiles/dwarf.cw b/tests/examplefiles/dwarf.cw
deleted file mode 100644
index ad8bb615..00000000
--- a/tests/examplefiles/dwarf.cw
+++ /dev/null
@@ -1,17 +0,0 @@
-;redcode
-;name Dwarf
-;author A. K. Dewdney
-;version 94.1
-;date April 29, 1993
-;strategy Bombs every fourth instruction.
- ORG start ; Indicates the instruction with
- ; the label "start" should be the
- ; first to execute.
-step EQU 4 ; Replaces all occurrences of "step"
- ; with the character "4".
-target DAT.F #0, #0 ; Pointer to target instruction.
-start ADD.AB #step, target ; Increments pointer by step.
- MOV.AB #0, @target ; Bombs target instruction.
- JMP.A start ; Same as JMP.A -2. Loops back to
- ; the instruction labelled "start".
- END
diff --git a/tests/examplefiles/eg_example1.eg b/tests/examplefiles/eg_example1.eg
deleted file mode 100644
index e23bf8c8..00000000
--- a/tests/examplefiles/eg_example1.eg
+++ /dev/null
@@ -1,155 +0,0 @@
-;; filepath tests
-require:
- library
- ./awesome
- ./variable/greatness/file
-
-
-;; Strings
-"Hello World!"
-"Hello!\nWorld!"
-'sasadads\ssdasdasd{ @method variable }'
-var dstring = .dotted-string
-
-key-dash
-but-can-it-do-ops +
- yes-it-can:
- 100 +
- print "So cool!"
- 100
- {that = "is awesome", you = "are hilarious"} +
- jiminy-crickets:
- oliver-twist each mr-bojangles +
- kittens =
- 12
-
-check-it:
- still-works:
- {1, 2, 3}.reversed.reversed.awesome{}.that.sort().what.map with
- x -> x * x
- (1, 2, 3) + this
-
-if total awesomeness > great stupidity:
- print "You've won!"
- not-sure-what-this-does @@ but-it-wont-capture
-else:
- print "Keep trying!"
- needs-work ++ you
-
-;; with tests
-needs-obj('awesome') with {"greatness values"}
-object.field.method with {1, 2, 3}
-
-;; object assignment
-obj = {
- key = "oh yeah"
- tree = "schmoh cheah"
-}
-obj.field = {
- that = super cool: "wowzers!"
- thatFunc = {x} -> x
-}
-
-;; match statements
-match @awesome.great:
- {head, *tail} -> [print head; tail]
- Array[] -> convert(.arr)
- String? -> convert(.str)
- else -> throw E.error("This is an error!")
-
-unimpl-func = -> pass
-
-;; if / elif / else test
-if coolness > 11:
- add something: something-else
-elif true:
- add nothing: something-else
-else:
- add everything: the-castle
-
-;; nested if / elif / else test
-mad-function = bananas ->
- if bananas > 5:
- print "You've got a lot of bananas!"
- elif bananas == 5:
- print "You might want to consider getting more bananas"
- else:
- print "Go get more bananas now!"
-
-;; class test
-class Dog:
- constructor(@name, @breed) =
- this.awesomesauce = 100
-
- unimpl-meth = -> pass
-
- bark(@, sd)
-
-;; error test
-try:
- throw E.test.my-error("This is my error.")
-catch TypeError? e:
- print "There was a type error."
-catch E.my-error? e:
- print "My error!"
-catch e:
- print "Some other error."
-finally:
- print "We are done."
-
-;; method shorthand operator
-stream-of-twos = *->
- while [true]: yield 2 ;; need to fix literals with colons after them.
-
-;; gen shorthand operator
-full-name = @->
- '{@first-name} {@last-name}'
-
-name-method = @->
- @name.parents.full-name()
-
-;; Keyword highlight test
-key x
-key +x; key @x; key .x ; key "x"; key 0; .asdasd
-key (x); key [x]; key {x}
-nokey.x(); nokey{x}
-key x + y
-key key x
-x + key y
-x - key y
-nokey + x
-nokey
-key: x
-key nokey: y
-key x > nokey: z
-x + key nokey: z
-x and {y, z}
-x + nokey: y
-x mod nokey: y
-x = key: y ;; comments work after keywords!
-x each key: y
-x each* k ;;
-a.b{c.d, e.f}
-a.bad-method(c.d, e.f)
-#a{}
-nokey mod: y ;; do not highlight nokey
-;; because mod is an operator
-
-;; Highlight all of these:
-await; break; chain; continue; else:; expr-value
-match; return; yield
-
-;; Edge-case highlighting test
-key-word: xyz
-nokey - x: yz
-
-;; Some keywords may contain operators as a subpart. If your regexp
-;; uses \b to single out operators like each, is or in, you may
-;; fail to highlight these properly:
-beaches ;; Do not highlight each inside the word beaches
-each-thing ;; Do not highlight each
-sleep-in ;; Do not highlight in
-before-each: xyz ;; Highlight before-each as a keyword
-is-great: xyz ;; Highlight is-great as a keyword
-
-send()
diff --git a/tests/examplefiles/ember.handlebars b/tests/examplefiles/ember.handlebars
deleted file mode 100644
index 515dffbd..00000000
--- a/tests/examplefiles/ember.handlebars
+++ /dev/null
@@ -1,33 +0,0 @@
-{{#view EmberFirebaseChat.ChatView class="chat-container"}}
- <div class="chat-messages-container">
- <ul class="chat-messages">
- {{#each message in content}}
- <li>
- [{{formatTimestamp "message.timestamp" fmtString="h:mm:ss A"}}]
- <strong>{{message.sender}}</strong>: {{message.content}}
- </li>
- {{/each}}
- </ul>
- </div>
-
- {{! Comment }}
- {{{unescaped value}}}
-
- {{#view EmberFirebaseChat.InputView class="chat-input-container"}}
- <form class="form-inline">
- {{#if "auth.authed"}}
- {{#if "auth.hasName"}}
- <input type="text" id="message" placeholder="Message">
- <button {{action "postMessage" target="view"}} class="btn">Send</button>
- {{else}}
- <input type="text" id="username" placeholder="Enter your username...">
- <button {{action "pickName" target="view"}} class="btn">Send</button>
- {{/if}}
- {{else}}
- <input type="text" placeholder="Log in with Persona to chat!" disabled="disabled">
- <button {{action "login"}} class="btn">Login</button>
- {{/if}}
- </form>
- {{/view}}
-{{/view}}
-
diff --git a/tests/examplefiles/erl_session b/tests/examplefiles/erl_session
deleted file mode 100644
index c207781b..00000000
--- a/tests/examplefiles/erl_session
+++ /dev/null
@@ -1,10 +0,0 @@
-1> io:format("Hello\n").
-Hello
-ok
-2> fun(X) -> X + 1 end.
-#Fun<erl_eval.6.13229925>
-3> 123 + 234.
-357
-4> X = Y.
-* 1: variable 'Y' is unbound
-5>
diff --git a/tests/examplefiles/es6.js b/tests/examplefiles/es6.js
deleted file mode 100644
index 79bfd3e6..00000000
--- a/tests/examplefiles/es6.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Most examples from https://github.com/rse/es6-features under MIT license
-const PI = 3.141593;
-
-let callbacks = [];
-
-odds = evens.map(v => v + 1);
-
-nums.forEach(v => {
- if (v % 5 === 0)
- fives.push(v);
-})
-
-function f (x, y, ...a) {
- return (x + y) * a.length;
-}
-
-var params = [ "hello", true, 7 ];
-var other = [ 1, 2, ...params ]; // [ 1, 2, "hello", true, 7 ]
-f(1, 2, ...params) === 9;
-
-var str = "foo";
-var chars = [ ...str ]; // [ "f", "o", "o" ]
-
-var customer = { name: "Foo" };
-var card = { amount: 7, product: "Bar", unitprice: 42 };
-message = `Hello ${customer.name},
-want to buy ${card.amount} ${card.product} for
-a total of ${card.amount * card.unitprice} bucks?`;
-
-0b111110111 === 503;
-0o767 === 503;
-
-for (let codepoint of "𠮷") console.log(codepoint);
-
-function* ();
-*function();
-yield;
-
-export class Node {
-}
-
-isFinite();
-isNaN();
-isSafeInteger();
-x = new Promise(...a);
-x = new Proxy(...a);
diff --git a/tests/examplefiles/escape_semicolon.clj b/tests/examplefiles/escape_semicolon.clj
deleted file mode 100644
index b46a8521..00000000
--- a/tests/examplefiles/escape_semicolon.clj
+++ /dev/null
@@ -1 +0,0 @@
-(= c (int \;)) (do (.readLine s) :line-start)
diff --git a/tests/examplefiles/eval.rs b/tests/examplefiles/eval.rs
deleted file mode 100644
index 17e585a0..00000000
--- a/tests/examplefiles/eval.rs
+++ /dev/null
@@ -1,606 +0,0 @@
-// -------------------------------------------------------------------------------------------------
-// Rick, a Rust intercal compiler. Save your souls!
-//
-// Copyright (c) 2015 Georg Brandl
-//
-// 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 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
-// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-// -------------------------------------------------------------------------------------------------
-
-/// Interprets INTERCAL source.
-///
-/// The evaluator is used when rick is called with `-i`, or when the compiler generates
-/// the output while compiling (in the constant-output case).
-
-use std::fmt::{ Debug, Display };
-use std::io::Write;
-use std::u16;
-
-use err::{ Res, IE123, IE129, IE252, IE275, IE555, IE633, IE774, IE994 };
-use ast::{ self, Program, Stmt, StmtBody, ComeFrom, Expr, Var, VType };
-use stdops::{ Bind, Array, write_number, read_number, check_chance, check_ovf, pop_jumps,
- get_random_seed, mingle, select, and_16, and_32, or_16, or_32, xor_16, xor_32 };
-
-
-/// Represents a value (either 16-bit or 32-bit) at runtime.
-#[derive(Clone, PartialEq, Eq, Debug)]
-pub enum Val {
- I16(u16),
- I32(u32),
-}
-
-impl Val {
- /// Cast as a 16-bit value; returns an error if 32-bit and too big.
- pub fn as_u16(&self) -> Res<u16> {
- match *self {
- Val::I16(v) => Ok(v),
- Val::I32(v) => {
- if v > (u16::MAX as u32) {
- return IE275.err();
- }
- Ok(v as u16)
- }
- }
- }
-
- /// Cast as a 32-bit value; always succeeds.
- pub fn as_u32(&self) -> u32 {
- match *self {
- Val::I16(v) => v as u32,
- Val::I32(v) => v
- }
- }
-
- /// Cast as an usize value; always succeeds.
- pub fn as_usize(&self) -> usize {
- self.as_u32() as usize
- }
-
- /// Create from a 32-bit value; will select the smallest possible type.
- pub fn from_u32(v: u32) -> Val {
- if v & 0xFFFF == v {
- Val::I16(v as u16)
- } else {
- Val::I32(v)
- }
- }
-}
-
-/// The state of the interpreter's evaluator.
-pub struct Eval<'a> {
- /// Program to execute.
- program: &'a Program,
- /// Stream to use for printing output.
- stdout: &'a mut Write,
- /// Whether to print debugging output during execution.
- debug: bool,
- /// Variable bindings for the four types of variables.
- spot: Vec<Bind<u16>>,
- twospot: Vec<Bind<u32>>,
- tail: Vec<Bind<Array<u16>>>,
- hybrid: Vec<Bind<Array<u32>>>,
- /// The infamous NEXT stack, capable of holding 80 elements.
- jumps: Vec<ast::LogLine>,
- /// Abstain counter for each statement.
- abstain: Vec<u32>,
- /// Binary I/O "tape" state.
- last_in: u8,
- last_out: u8,
- /// Random number generator state.
- rand_st: u32,
- /// Counts the number of executed statements.
- stmt_ctr: usize,
-}
-
-/// Represents the control flow effect of an executed statement.
-enum StmtRes {
- /// normal execution, next statement
- Next,
- /// jump around, from DO ... NEXT
- Jump(usize),
- /// jump back, from RESUME
- Back(usize),
- /// start from the first statement, from TRY AGAIN
- FromTop,
- /// end the program, from GIVE UP
- End,
-}
-
-impl<'a> Eval<'a> {
- /// Construct a new evaluator.
- pub fn new(program: &'a Program, stdout: &'a mut Write, debug: bool,
- random: bool) -> Eval<'a> {
- let abs = program.stmts.iter().map(|stmt| stmt.props.disabled as u32).collect();
- let nvars = (program.var_info.0.len(),
- program.var_info.1.len(),
- program.var_info.2.len(),
- program.var_info.3.len());
- Eval {
- program: program,
- stdout: stdout,
- debug: debug,
- spot: vec![Bind::new(0); nvars.0],
- twospot: vec![Bind::new(0); nvars.1],
- tail: vec![Bind::new(Array::empty()); nvars.2],
- hybrid: vec![Bind::new(Array::empty()); nvars.3],
- jumps: Vec::with_capacity(80),
- rand_st: if random { get_random_seed() } else { 0 },
- abstain: abs,
- last_in: 0,
- last_out: 0,
- stmt_ctr: 0,
- }
- }
-
- /// Interpret the program. Returns either the number of executed statements,
- /// or an error (RtError).
- pub fn eval(&mut self) -> Res<usize> {
- let mut pctr = 0; // index of current statement
- let program = self.program.clone();
- let nstmts = program.stmts.len();
- loop {
- // check for falling off the end
- if pctr >= nstmts {
- // if the last statement was a TRY AGAIN, falling off the end is fine
- if let StmtBody::TryAgain = program.stmts[program.stmts.len() - 1].body {
- break;
- }
- return IE633.err();
- }
- self.stmt_ctr += 1;
- let stmt = &program.stmts[pctr];
- // execute statement if not abstained
- if self.abstain[pctr] == 0 {
- // check execution chance
- let (passed, rand_st) = check_chance(stmt.props.chance, self.rand_st);
- self.rand_st = rand_st;
- if passed {
- // try to eval this statement
- let res = match self.eval_stmt(stmt) {
- // on error, set the correct line number and bubble up
- Err(mut err) => {
- err.set_line(stmt.props.onthewayto);
- // special treatment for NEXT
- if let StmtBody::DoNext(n) = stmt.body {
- if let Some(i) = program.labels.get(&n) {
- err.set_line(program.stmts[*i as usize].props.srcline);
- }
- }
- return Err(err);
- }
- Ok(res) => res
- };
- // handle control flow effects
- match res {
- StmtRes::Next => { }
- StmtRes::Jump(n) => {
- self.jumps.push(pctr as u16); // push the line with the NEXT
- pctr = n;
- continue; // do not increment or check for COME FROMs
- }
- StmtRes::Back(n) => {
- pctr = n; // will be incremented below after COME FROM check
- }
- StmtRes::FromTop => {
- pctr = 0; // start from the beginning, do not push any stack
- continue;
- }
- StmtRes::End => break,
- }
- }
- }
- // if we are on the line with the compiler bug, error out
- if pctr == self.program.bugline as usize {
- return IE774.err_with(None, stmt.props.onthewayto);
- }
- // try to determine if we have to go to a COME FROM statement
- // (note: in general, program.stmts[pctr] != stmt)
- //
- // the static COME FROM is always a possibility
- let mut maybe_next = program.stmts[pctr].comefrom;
- // the complicated case: evaluate all computed-come-from expressions
- let my_label = program.stmts[pctr].props.label;
- if program.uses_complex_comefrom && my_label > 0 {
- for (i, stmt) in program.stmts.iter().enumerate() {
- if let StmtBody::ComeFrom(ComeFrom::Expr(ref e)) = stmt.body {
- let v = try!(try!(self.eval_expr(e)).as_u16());
- if v == my_label {
- // as soon as we have multiple candidates, we can bail out
- if maybe_next.is_some() {
- return IE555.err();
- }
- maybe_next = Some(i as u16);
- }
- }
- }
- }
- // check for COME FROMs from this line
- if let Some(next) = maybe_next {
- let next = next as usize;
- // check for abstained COME FROM
- if self.abstain[next] == 0 {
- // the COME FROM can also have a % chance
- let (passed, rand_st) = check_chance(program.stmts[next].props.chance,
- self.rand_st);
- self.rand_st = rand_st;
- if passed {
- pctr = next;
- continue;
- }
- }
- }
- // no COME FROM, normal execution
- pctr += 1;
- }
- Ok(self.stmt_ctr)
- }
-
- /// Interpret a single statement.
- fn eval_stmt(&mut self, stmt: &Stmt) -> Res<StmtRes> {
- if self.debug {
- println!("\nExecuting Stmt #{} (state before following)", self.stmt_ctr);
- self.dump_state();
- println!("{}", stmt);
- }
- match stmt.body {
- StmtBody::Calc(ref var, ref expr) => {
- let val = try!(self.eval_expr(expr));
- try!(self.assign(var, val));
- Ok(StmtRes::Next)
- }
- StmtBody::Dim(ref var, ref exprs) => {
- try!(self.array_dim(var, exprs));
- Ok(StmtRes::Next)
- }
- StmtBody::DoNext(n) => {
- match self.program.labels.get(&n) {
- // too many jumps on stack already?
- Some(_) if self.jumps.len() >= 80 => IE123.err(),
- Some(i) => Ok(StmtRes::Jump(*i as usize)),
- None => IE129.err(),
- }
- }
- StmtBody::ComeFrom(_) => {
- // nothing to do here at runtime
- Ok(StmtRes::Next)
- }
- StmtBody::Resume(ref expr) => {
- let n = try!(self.eval_expr(expr)).as_u32();
- // this expect() is safe: if the third arg is true, there will
- // be no Ok(None) returns
- let next = try!(pop_jumps(&mut self.jumps, n, true, 0))
- .expect("https://xkcd.com/378/ ?!");
- Ok(StmtRes::Back(next as usize))
- }
- StmtBody::Forget(ref expr) => {
- let n = try!(self.eval_expr(expr)).as_u32();
- try!(pop_jumps(&mut self.jumps, n, false, 0));
- Ok(StmtRes::Next)
- }
- StmtBody::Ignore(ref vars) => {
- for var in vars {
- self.set_rw(var, false);
- }
- Ok(StmtRes::Next)
- }
- StmtBody::Remember(ref vars) => {
- for var in vars {
- self.set_rw(var, true);
- }
- Ok(StmtRes::Next)
- }
- StmtBody::Stash(ref vars) => {
- for var in vars {
- self.stash(var);
- }
- Ok(StmtRes::Next)
- }
- StmtBody::Retrieve(ref vars) => {
- for var in vars {
- try!(self.retrieve(var));
- }
- Ok(StmtRes::Next)
- }
- StmtBody::Abstain(ref expr, ref whats) => {
- let f: Box<Fn(u32) -> u32> = if let Some(ref e) = *expr {
- let n = try!(self.eval_expr(e)).as_u32();
- box move |v: u32| v.saturating_add(n)
- } else {
- box |_| 1
- };
- for what in whats {
- self.abstain(what, &*f);
- }
- Ok(StmtRes::Next)
- }
- StmtBody::Reinstate(ref whats) => {
- for what in whats {
- self.abstain(what, &|v: u32| v.saturating_sub(1));
- }
- Ok(StmtRes::Next)
- }
- StmtBody::ReadOut(ref vars) => {
- for var in vars {
- match *var {
- // read out whole array
- Expr::Var(ref var) if var.is_dim() => {
- try!(self.array_readout(var));
- }
- // read out single var or array element
- Expr::Var(ref var) => {
- let varval = try!(self.lookup(var));
- try!(write_number(self.stdout, varval.as_u32(), 0));
- }
- // read out constant
- Expr::Num(_, v) => try!(write_number(self.stdout, v, 0)),
- // others will not be generated
- _ => return IE994.err(),
- };
- }
- Ok(StmtRes::Next)
- }
- StmtBody::WriteIn(ref vars) => {
- for var in vars {
- if var.is_dim() {
- // write in whole array
- try!(self.array_writein(var));
- } else {
- // write in single var or array element
- let n = try!(read_number(0));
- try!(self.assign(var, Val::from_u32(n)));
- }
- }
- Ok(StmtRes::Next)
- }
- // this one is only generated by the constant-program optimizer
- StmtBody::Print(ref s) => {
- if let Err(_) = self.stdout.write(&s) {
- return IE252.err();
- }
- Ok(StmtRes::Next)
- }
- StmtBody::TryAgain => Ok(StmtRes::FromTop),
- StmtBody::GiveUp => Ok(StmtRes::End),
- StmtBody::Error(ref e) => Err((*e).clone()),
- }
- }
-
- /// Evaluate an expression to a value.
- fn eval_expr(&self, expr: &Expr) -> Res<Val> {
- match *expr {
- Expr::Num(vtype, v) => match vtype {
- VType::I16 => Ok(Val::I16(v as u16)),
- VType::I32 => Ok(Val::I32(v)),
- },
- Expr::Var(ref var) => self.lookup(var),
- Expr::Mingle(ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx)).as_u32();
- let w = try!(self.eval_expr(wx)).as_u32();
- let v = try!(check_ovf(v, 0));
- let w = try!(check_ovf(w, 0));
- Ok(Val::I32(mingle(v, w)))
- }
- Expr::Select(vtype, ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx));
- let w = try!(self.eval_expr(wx));
- if vtype == VType::I16 {
- Ok(Val::I16(select(v.as_u32(), try!(w.as_u16()) as u32) as u16))
- } else {
- Ok(Val::I32(select(v.as_u32(), w.as_u32())))
- }
- }
- Expr::And(vtype, ref vx) => {
- let v = try!(self.eval_expr(vx));
- match vtype {
- VType::I16 => Ok(Val::I16(and_16(try!(v.as_u16()) as u32) as u16)),
- VType::I32 => Ok(Val::I32(and_32(v.as_u32()))),
- }
- }
- Expr::Or(vtype, ref vx) => {
- let v = try!(self.eval_expr(vx));
- match vtype {
- VType::I16 => Ok(Val::I16(or_16(try!(v.as_u16()) as u32) as u16)),
- VType::I32 => Ok(Val::I32(or_32(v.as_u32()))),
- }
- }
- Expr::Xor(vtype, ref vx) => {
- let v = try!(self.eval_expr(vx));
- match vtype {
- VType::I16 => Ok(Val::I16(xor_16(try!(v.as_u16()) as u32) as u16)),
- VType::I32 => Ok(Val::I32(xor_32(v.as_u32()))),
- }
- }
- Expr::RsNot(ref vx) => {
- let v = try!(self.eval_expr(vx));
- Ok(Val::I32(!v.as_u32()))
- }
- Expr::RsAnd(ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx));
- let w = try!(self.eval_expr(wx));
- Ok(Val::I32(v.as_u32() & w.as_u32()))
- }
- Expr::RsOr(ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx));
- let w = try!(self.eval_expr(wx));
- Ok(Val::I32(v.as_u32() | w.as_u32()))
- }
- Expr::RsXor(ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx));
- let w = try!(self.eval_expr(wx));
- Ok(Val::I32(v.as_u32() ^ w.as_u32()))
- }
- Expr::RsRshift(ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx));
- let w = try!(self.eval_expr(wx));
- Ok(Val::I32(v.as_u32() >> w.as_u32()))
- }
- Expr::RsLshift(ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx));
- let w = try!(self.eval_expr(wx));
- Ok(Val::I32(v.as_u32() << w.as_u32()))
- }
- // Expr::RsEqual(ref vx, ref wx) => {
- // let v = try!(self.eval_expr(vx));
- // let w = try!(self.eval_expr(wx));
- // Ok(Val::I32((v.as_u32() == w.as_u32()) as u32))
- // }
- Expr::RsNotEqual(ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx));
- let w = try!(self.eval_expr(wx));
- Ok(Val::I32((v.as_u32() != w.as_u32()) as u32))
- }
- Expr::RsPlus(ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx));
- let w = try!(self.eval_expr(wx));
- Ok(Val::I32(v.as_u32() + w.as_u32()))
- }
- Expr::RsMinus(ref vx, ref wx) => {
- let v = try!(self.eval_expr(vx));
- let w = try!(self.eval_expr(wx));
- Ok(Val::I32(v.as_u32() - w.as_u32()))
- }
- }
- }
-
- #[inline]
- fn eval_subs(&self, subs: &Vec<Expr>) -> Res<Vec<usize>> {
- subs.iter().map(|v| self.eval_expr(v).map(|w| w.as_usize())).collect()
- }
-
- /// Dimension an array.
- fn array_dim(&mut self, var: &Var, dims: &Vec<Expr>) -> Res<()> {
- let dims = try!(self.eval_subs(dims));
- match *var {
- Var::A16(n, _) => self.tail[n].dimension(dims, 0),
- Var::A32(n, _) => self.hybrid[n].dimension(dims, 0),
- _ => return IE994.err(),
- }
- }
-
- /// Assign to a variable.
- fn assign(&mut self, var: &Var, val: Val) -> Res<()> {
- match *var {
- Var::I16(n) => Ok(self.spot[n].assign(try!(val.as_u16()))),
- Var::I32(n) => Ok(self.twospot[n].assign(val.as_u32())),
- Var::A16(n, ref subs) => {
- let subs = try!(self.eval_subs(subs));
- self.tail[n].set_md(subs, try!(val.as_u16()), 0)
- }
- Var::A32(n, ref subs) => {
- let subs = try!(self.eval_subs(subs));
- self.hybrid[n].set_md(subs, val.as_u32(), 0)
- }
- }
- }
-
- /// Look up the value of a variable.
- fn lookup(&self, var: &Var) -> Res<Val> {
- match *var {
- Var::I16(n) => Ok(Val::I16(self.spot[n].val)),
- Var::I32(n) => Ok(Val::I32(self.twospot[n].val)),
- Var::A16(n, ref subs) => {
- let subs = try!(self.eval_subs(subs));
- self.tail[n].get_md(subs, 0).map(Val::I16)
- }
- Var::A32(n, ref subs) => {
- let subs = try!(self.eval_subs(subs));
- self.hybrid[n].get_md(subs, 0).map(Val::I32)
- }
- }
- }
-
- /// Process a STASH statement.
- fn stash(&mut self, var: &Var) {
- match *var {
- Var::I16(n) => self.spot[n].stash(),
- Var::I32(n) => self.twospot[n].stash(),
- Var::A16(n, _) => self.tail[n].stash(),
- Var::A32(n, _) => self.hybrid[n].stash(),
- }
- }
-
- /// Process a RETRIEVE statement.
- fn retrieve(&mut self, var: &Var) -> Res<()> {
- match *var {
- Var::I16(n) => self.spot[n].retrieve(0),
- Var::I32(n) => self.twospot[n].retrieve(0),
- Var::A16(n, _) => self.tail[n].retrieve(0),
- Var::A32(n, _) => self.hybrid[n].retrieve(0),
- }
- }
-
- /// Process an IGNORE or REMEMBER statement. Cannot fail.
- fn set_rw(&mut self, var: &Var, rw: bool) {
- match *var {
- Var::I16(n) => self.spot[n].rw = rw,
- Var::I32(n) => self.twospot[n].rw = rw,
- Var::A16(n, _) => self.tail[n].rw = rw,
- Var::A32(n, _) => self.hybrid[n].rw = rw,
- }
- }
-
- /// P()rocess an ABSTAIN or REINSTATE statement. Cannot fail.
- fn abstain(&mut self, what: &ast::Abstain, f: &Fn(u32) -> u32) {
- if let &ast::Abstain::Label(lbl) = what {
- let idx = self.program.labels[&lbl] as usize;
- if self.program.stmts[idx].body != StmtBody::GiveUp {
- self.abstain[idx] = f(self.abstain[idx]);
- }
- } else {
- for (i, stype) in self.program.stmt_types.iter().enumerate() {
- if stype == what {
- self.abstain[i] = f(self.abstain[i]);
- }
- }
- }
- }
-
- /// Array readout helper.
- fn array_readout(&mut self, var: &Var) -> Res<()> {
- let state = &mut self.last_out;
- match *var {
- Var::A16(n, _) => self.tail[n].readout(self.stdout, state, 0),
- Var::A32(n, _) => self.hybrid[n].readout(self.stdout, state, 0),
- _ => return IE994.err(),
- }
- }
-
- /// Array writein helper.
- fn array_writein(&mut self, var: &Var) -> Res<()> {
- let state = &mut self.last_in;
- match *var {
- Var::A16(n, _) => self.tail[n].writein(state, 0),
- Var::A32(n, _) => self.hybrid[n].writein(state, 0),
- _ => return IE994.err(),
- }
- }
-
- /// Debug helpers.
- fn dump_state(&self) {
- self.dump_state_one(&self.spot, ".");
- self.dump_state_one(&self.twospot, ":");
- self.dump_state_one(&self.tail, ",");
- self.dump_state_one(&self.hybrid, ";");
- if self.jumps.len() > 0 {
- println!("Next stack: {:?}", self.jumps);
- }
- //println!("Abstained: {:?}", self.abstain);
- }
-
- fn dump_state_one<T: Debug + Display>(&self, vec: &Vec<Bind<T>>, sigil: &str) {
- if vec.len() > 0 {
- for (i, v) in vec.iter().enumerate() {
- print!("{}{} = {}, ", sigil, i, v);
- }
- println!("");
- }
- }
-}
diff --git a/tests/examplefiles/evil_regex.js b/tests/examplefiles/evil_regex.js
deleted file mode 100644
index 3839c3f4..00000000
--- a/tests/examplefiles/evil_regex.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/regexp/.test(foo) || x = [/regexp/,/regexp/, /regexp/, // comment
-// comment
-/regexp/];
-if (/regexp/.test(string))
-{/regexp/.test(string);};
-x =/regexp/;
-x = /regexp/;
-if (0</regexp/.exec(string) || 1>/regexp/.exec(string))
-x = { u:/regexp/, v: /regexp/ };
-foo();/regexp/.test(string); /regexp/.test(string);
-if (!/regexp/) foobar();
-x = u %/regexp/.exec(string) */regexp/.exec(string) / /regexp/.exec(string);
-x = u?/regexp/.exec(string) : v +/regexp/.exec(string) -/regexp/.exec(string);
-a = u^/regexp/.exec(string) &/regexp/.exec(string) |/regexp/.exec(string) +~/regexp/.exec(string);
-x = /regexp/ /* a comment */ ;
-x = /[reg/exp]/;
-x = 4/2/i;
-x = (a == b) ?/* this is a comment */ c : d;
-/// a comment //
-a = /regex//2/1; //syntactically correct, returns NaN
-
-
-
-
-/* original examples */
-
-// regex
-
-blah(/abc/);
-x = /abc/;
-x = /abc/.match;
-
-// math
-
-blah(1/2); //comment
-x = 1 / 2 / 3;
-x = 1/1/.1;
-
-// broken
-
-x=/1/;
-x=1/a/g;
-x=a/a/g;
-
-// real-world
-
-var x = 1/(1+Math.sqrt(sum)); // convert to number between 1-0
-return Math.round((num / den) * 100)/100;
diff --git a/tests/examplefiles/example.Rd b/tests/examplefiles/example.Rd
deleted file mode 100644
index 2b8de0b8..00000000
--- a/tests/examplefiles/example.Rd
+++ /dev/null
@@ -1,78 +0,0 @@
-\name{foo}
-\alias{foo}
-% I'm a comment
-\title{The foo function}
-
-\description{It doesn't do much}
-
-\usage{
-foo(x, y)
-}
-
-\arguments{
- \item{x}{A number}
- \item{y}{Another number}
-}
-\details{
- I just adds \code{x} and \code{y},
-}
-\value{\code{numeric}. The sum of \code{x} and \code{y}.}
-\references{
- \href{http://en.wikipedia.org/wiki/Sum}{Sum}
-}
-\author{
- Anonymous
-}
-\note{
- Lorem ipsum \dots \R \emph{emp}, \strong{strong}, \bold{bold},
- \sQuote{single quotes}, \dQuote{double quotes}, \code{code},
- \preformatted{x <- 2 + 2}, \kbd{type this}, \samp{literal seq},
- \pkg{base}, \file{foo.txt}, \email{email@hostname},
- \url{http://cran.r-project.org/}, \var{foo}, \env{HOME},
- \option{-d}, \dfn{something new}, \acronym{GNU}.
-
- Escaped symbols: \\ \{ \} \% not comment. \\NotAMacro.
-
- \tabular{rlll}{
- [,1] \tab alpha \tab numeric \tab A (ppb)\cr
- [,2] \tab bravo \tab integer \tab B \cr
- [,3] \tab charlie \tab character \tab C \cr
- }
- \enumerate{
- \item delta
- \item echo
- }
- \itemize{
- \item foxtrot
- \item golf
- }
-
- \deqn{p(x; \mu, \sigma^2) = \frac{1}{\sigma \sqrt{2 \pi}} \exp \frac{-(x - \mu)^2}{2 \sigma}{%
- p(\mu; x) = 1/\sigma (2 \pi)^(-1/2) exp( -(x - \mu)^2 / (2 \sigma)) }
- for \eqn{x = 0, 1, 2, \ldots}.
-
- \if{latex}{\out{\beta}}\ifelse{html}{\out{&beta;}}{beta}
-
-#ifdef unix
-Now windows
-#endif
-#ifndef windows
-Using windows
-#endif
-
-}
-\section{Misc}{
- Stuff.
-}
-
-\seealso{
- \code{\link{sum}}
-}
-\examples{
-x <- 1
-y <- 2
-z <- foo(x, y)
-\dontrun{plot(z)}
-\dontshow{log(x)}
-}
-\keyword{arith}
diff --git a/tests/examplefiles/example.als b/tests/examplefiles/example.als
deleted file mode 100644
index 3a5ab82b..00000000
--- a/tests/examplefiles/example.als
+++ /dev/null
@@ -1,217 +0,0 @@
-module examples/systems/views
-
-/*
- * Model of views in object-oriented programming.
- *
- * Two object references, called the view and the backing,
- * are related by a view mechanism when changes to the
- * backing are automatically propagated to the view. Note
- * that the state of a view need not be a projection of the
- * state of the backing; the keySet method of Map, for
- * example, produces two view relationships, and for the
- * one in which the map is modified by changes to the key
- * set, the value of the new map cannot be determined from
- * the key set. Note that in the iterator view mechanism,
- * the iterator is by this definition the backing object,
- * since changes are propagated from iterator to collection
- * and not vice versa. Oddly, a reference may be a view of
- * more than one backing: there can be two iterators on the
- * same collection, eg. A reference cannot be a view under
- * more than one view type.
- *
- * A reference is made dirty when it is a backing for a view
- * with which it is no longer related by the view invariant.
- * This usually happens when a view is modified, either
- * directly or via another backing. For example, changing a
- * collection directly when it has an iterator invalidates
- * it, as does changing the collection through one iterator
- * when there are others.
- *
- * More work is needed if we want to model more closely the
- * failure of an iterator when its collection is invalidated.
- *
- * As a terminological convention, when there are two
- * complementary view relationships, we will give them types
- * t and t'. For example, KeySetView propagates from map to
- * set, and KeySetView' propagates from set to map.
- *
- * author: Daniel Jackson
- */
-
-open util/ordering[State] as so
-open util/relation as rel
-
-sig Ref {}
-sig Object {}
-
--- t->b->v in views when v is view of type t of backing b
--- dirty contains refs that have been invalidated
-sig State {
- refs: set Ref,
- obj: refs -> one Object,
- views: ViewType -> refs -> refs,
- dirty: set refs
--- , anyviews: Ref -> Ref -- for visualization
- }
--- {anyviews = ViewType.views}
-
-sig Map extends Object {
- keys: set Ref,
- map: keys -> one Ref
- }{all s: State | keys + Ref.map in s.refs}
-sig MapRef extends Ref {}
-fact {State.obj[MapRef] in Map}
-
-sig Iterator extends Object {
- left, done: set Ref,
- lastRef: lone done
- }{all s: State | done + left + lastRef in s.refs}
-sig IteratorRef extends Ref {}
-fact {State.obj[IteratorRef] in Iterator}
-
-sig Set extends Object {
- elts: set Ref
- }{all s: State | elts in s.refs}
-sig SetRef extends Ref {}
-fact {State.obj[SetRef] in Set}
-
-abstract sig ViewType {}
-one sig KeySetView, KeySetView', IteratorView extends ViewType {}
-fact ViewTypes {
- State.views[KeySetView] in MapRef -> SetRef
- State.views[KeySetView'] in SetRef -> MapRef
- State.views[IteratorView] in IteratorRef -> SetRef
- all s: State | s.views[KeySetView] = ~(s.views[KeySetView'])
- }
-
-/**
- * mods is refs modified directly or by view mechanism
- * doesn't handle possibility of modifying an object and its view at once?
- * should we limit frame conds to non-dirty refs?
- */
-pred modifies [pre, post: State, rs: set Ref] {
- let vr = pre.views[ViewType], mods = rs.*vr {
- all r: pre.refs - mods | pre.obj[r] = post.obj[r]
- all b: mods, v: pre.refs, t: ViewType |
- b->v in pre.views[t] => viewFrame [t, pre.obj[v], post.obj[v], post.obj[b]]
- post.dirty = pre.dirty +
- {b: pre.refs | some v: Ref, t: ViewType |
- b->v in pre.views[t] && !viewFrame [t, pre.obj[v], post.obj[v], post.obj[b]]
- }
- }
- }
-
-pred allocates [pre, post: State, rs: set Ref] {
- no rs & pre.refs
- post.refs = pre.refs + rs
- }
-
-/**
- * models frame condition that limits change to view object from v to v' when backing object changes to b'
- */
-pred viewFrame [t: ViewType, v, v', b': Object] {
- t in KeySetView => v'.elts = dom [b'.map]
- t in KeySetView' => b'.elts = dom [v'.map]
- t in KeySetView' => (b'.elts) <: (v.map) = (b'.elts) <: (v'.map)
- t in IteratorView => v'.elts = b'.left + b'.done
- }
-
-pred MapRef.keySet [pre, post: State, setRefs: SetRef] {
- post.obj[setRefs].elts = dom [pre.obj[this].map]
- modifies [pre, post, none]
- allocates [pre, post, setRefs]
- post.views = pre.views + KeySetView->this->setRefs + KeySetView'->setRefs->this
- }
-
-pred MapRef.put [pre, post: State, k, v: Ref] {
- post.obj[this].map = pre.obj[this].map ++ k->v
- modifies [pre, post, this]
- allocates [pre, post, none]
- post.views = pre.views
- }
-
-pred SetRef.iterator [pre, post: State, iterRef: IteratorRef] {
- let i = post.obj[iterRef] {
- i.left = pre.obj[this].elts
- no i.done + i.lastRef
- }
- modifies [pre,post,none]
- allocates [pre, post, iterRef]
- post.views = pre.views + IteratorView->iterRef->this
- }
-
-pred IteratorRef.remove [pre, post: State] {
- let i = pre.obj[this], i' = post.obj[this] {
- i'.left = i.left
- i'.done = i.done - i.lastRef
- no i'.lastRef
- }
- modifies [pre,post,this]
- allocates [pre, post, none]
- pre.views = post.views
- }
-
-pred IteratorRef.next [pre, post: State, ref: Ref] {
- let i = pre.obj[this], i' = post.obj[this] {
- ref in i.left
- i'.left = i.left - ref
- i'.done = i.done + ref
- i'.lastRef = ref
- }
- modifies [pre, post, this]
- allocates [pre, post, none]
- pre.views = post.views
- }
-
-pred IteratorRef.hasNext [s: State] {
- some s.obj[this].left
- }
-
-assert zippishOK {
- all
- ks, vs: SetRef,
- m: MapRef,
- ki, vi: IteratorRef,
- k, v: Ref |
- let s0=so/first,
- s1=so/next[s0],
- s2=so/next[s1],
- s3=so/next[s2],
- s4=so/next[s3],
- s5=so/next[s4],
- s6=so/next[s5],
- s7=so/next[s6] |
- ({
- precondition [s0, ks, vs, m]
- no s0.dirty
- ks.iterator [s0, s1, ki]
- vs.iterator [s1, s2, vi]
- ki.hasNext [s2]
- vi.hasNext [s2]
- ki.this/next [s2, s3, k]
- vi.this/next [s3, s4, v]
- m.put [s4, s5, k, v]
- ki.remove [s5, s6]
- vi.remove [s6, s7]
- } => no State.dirty)
- }
-
-pred precondition [pre: State, ks, vs, m: Ref] {
- // all these conditions and other errors discovered in scope of 6 but 8,3
- // in initial state, must have view invariants hold
- (all t: ViewType, b, v: pre.refs |
- b->v in pre.views[t] => viewFrame [t, pre.obj[v], pre.obj[v], pre.obj[b]])
- // sets are not aliases
--- ks != vs
- // sets are not views of map
--- no (ks+vs)->m & ViewType.pre.views
- // no iterator currently on either set
--- no Ref->(ks+vs) & ViewType.pre.views
- }
-
-check zippishOK for 6 but 8 State, 3 ViewType expect 1
-
-/**
- * experiment with controlling heap size
- */
-fact {all s: State | #s.obj < 5}
diff --git a/tests/examplefiles/example.bat b/tests/examplefiles/example.bat
deleted file mode 100644
index 2b45d2bc..00000000
--- a/tests/examplefiles/example.bat
+++ /dev/null
@@ -1,211 +0,0 @@
-@ @@ echo off
-::This is an example of the Windows batch language.
-
-setlocal EnableDelayedExpansion
-(cls)
-set/a^
-_te^
-sts^
-=0,^
-_"pa"^
-ssed=0^
-0
-set,/a title= Batch test
-title=%,/a title%
-echo^ %~nx0,^ the>,con comprehensive testing suite
-ver
-echo(
-
-if cmdextversion 2 goto =)
-goto :fail
-
- :)
-echo Starting tests at:
-date/t & time/t
-echo(
-
-if '%*'=='--help' (
- echo Usage: %~nx0 [--help]
- echo --help: Display this help message and quit.
- shift
- goto :exit comment) else rem
-
-(call :comments)
-call ::io+x
-call:control:x
-call::internal x
-
-:exit
-if /i !_tests!==!_passed! (
- color 02
-) else if !*==* (
- color c
- if not defined _exit^
-Code set _exit^
-Code=1
-)
-set _percentage=NaN
-if defined _tests (
- if !_tests! neq 0 (set/a_percentage=100*_passed/_tests)
-)
-echo(
-if !_percentage!==NaN ( echo(There were no tests^^! & color e
-) else ( echo Tests passed: %_passed%/%_tests% (%_percentage%%%^) )
-pause
-color
-title
-endlocal
-exit /b %_exitCode%
-
-x:fail
-rem This should never happen.
-echo Internal error 1>& 269105>>&2
-set /a _exitCode=0x69+(0105*1000)
-break
-goto :exit
-
-:comments
-(rem )/?
-)
-rem "comment^
-(rem.) & set /a _tests+=1
-(rem) & goto :fail
-(rem. ) & (rem. comment ) & echo Test %_tests%: Comments
-rem )
-)
-)|comment
-)(
-:: comment
-goto :comments^^1:comment
-:comments^^1 comment
-if(1==1) goto :comments^
-^1
-rem^ /?
-rem ^
-^
-goto :comments^
-2+comment
-goto :fail
-:comments2
-rem >^
-if 1==1 (goto :comments3)
-:comments3)
-goto :fail
-:comments3
-rem comment^
-goto:fail
-rem.comment comment^
-goto fail
-rem "comment comment"^
-goto fail
-rem comment comment^
-if "1==1" equ "1==1" goto comments4
-goto fail
-:comments4
-rem comment"comment^
-set /a _passed+=1
-GOTO :EOF
-goto :fail
-
-:IO
-SET /A _tests+=1 & Echo Test !_tests:*!==^!: I/O
-verify on
-pushd .
-if exist temp echo temp already exists. & goto :eof
-md temp
-cd temp
-mkdir 2>nul temp
-chdir temp
->cd echo Checking drive...
->>cd echo must be C or else this won't work
-for /f "tokens=* usebackq" %%G in ("cd
-) do (<nul set /p="%%G ")
-echo(
-DEL cd
-if not "%cd:~0,3%"=="C:\" (
- call call echo Wrong drive (should be C^):
- vol
- goto :test)
->test0^
-.bat echo rem Machine-generated; do not edit
-call echo set /a _passed+=1 >>test0.bat
-type test0.bat >"test 1.bat
-ren "test 1.bat" test2.bat
-rename test2.bat test.bat
-caLL ^
-C:test
-del test.bat 2>nul
-2>NUL erase test0.bat
-popd
-rd temp\temp
-rmdir temp
-VERIFY OFF
-goto:eof
-
-:control
-set /a _tests+=1
-echo Test %_tests%: Control statements
-set "_iterations=0">nul
-for %%G in (,+,,-,
-) do @(
- for /l %%H in (,-1;;-1 -3,) do (
- for /f tokens^=1-2^,5 %%I in ("2 %%H _ _ 10") do (
- for /f "tokens=1 usebackq" %%L in ( `echo %%G%%J ``` `
-` ` ) do ( for /f "tokens=2" %%M in ('echo ' %%L0 '
-' ' ) do ( set /a _iterations+=(%%M%%M^)
- )
- )
- )
- )
-)
-if exist %~nx0 if not exist %~nx0 goto :fail
-if exist %~nx0 (
- if not exist %~nx0 goto :fail
-) else (
- if exist %~nx0 goto :fail
-)
-if /i %_iterations% gtr -2 (
- if /i %_iterations% geq -1 (
- if /i %_iterations% lss 1 (
- if /i %_iterations% leq 0 (
- if /i %_iterations% equ 0 (
- if 1 equ 01 (
- if 1 neq "01" (
- if "1" neq 01 (
- set /a _passed+=1))))))))
-) comment
-goto :eof
-
-:internal
-set /a _tests+=1
-echo Test %_tests%: Internal commands
-keys on
-mklink 2>nul
->nul path %path%
->nul dpath %dpath%
-if not defined prompt prompt $P$G
-prompt !prompt:~!rem/ $H?
-echo on
-rem/?
-@echo off
-rem(/?>nul
-rem )/? >nul
-(rem (/?) >nul
-rem /?>nul
-rem^/?>nul
-if/?>nul || if^/^?>nul || if /?>nul || if x/? >nul
-for/?>nul && for^/^?>nul && for /?>nul && for x/? >nul && for /?x >nul
-goto/?>nul && goto^/? && goto^ /? && goto /^
-? && goto /?>nul && goto:/? >nul && goto ) /? ) >nul && (goto /? )>nul
-=set+;/p extension'),=.bat
-for /f "tokens=2 delims==" %%G in ( 'assoc %+;/p extension'),%'
- ) do (
- assoc 2>nul %+;/p extension'),:*.=.%=%%G
- ftype 1>nul %%G
-) &>nul ver
-if errorlevel 0 if not errorlevel 1 set /a _passed+=1
-goto :eof
-FOR /F %%a IN ('%%c%%') DO %%a
-rem %x% %x% %x% %x% %x% %x% %x% %x% %x% %x% %x% %x% %x% %x% %x% %x%
-:/?
-goto :fail
diff --git a/tests/examplefiles/example.bbc b/tests/examplefiles/example.bbc
deleted file mode 100644
index ebdb8537..00000000
--- a/tests/examplefiles/example.bbc
+++ /dev/null
@@ -1,156 +0,0 @@
-10REM >EIRC
-20REM The simplest IRC client you can write. Maybe.
-30REM (C) Justin Fletcher, 1998
-40:
-50END=PAGE+1024*16
-60REM Change these if you wish
-70host$="irc.stealth.net"
-80port=6667
-90nick$="eirc"
-100ourchan$="#acorn"
-110:
-120REM Start connecting to a host
-130SYS "ESocket_ConnectToHost",host$,port TO handle
-140REPEAT
-150 SYS "ESocket_CheckState",handle TO state
-160 IF state<-1 THENSYS "ESocket_Forget",handle:SYS "ESocket_DecodeState",state TO a$:ERROR 1,"Failed ("+a$+")"
-170UNTIL state=4
-180:
-190REM We are now connected
-200PRINT"Connected"
-210:
-220REM Log on to the server
-230SYS "ESocket_SendLine",handle,"USER "+nick$+" x x :"+nick$
-240SYS "ESocket_SendLine",handle,"NICK "+nick$
-250SYS "ESocket_SendLine",handle,"JOIN "+ourchan$
-260REM Install a monitor so that we don't waste time
-270SYS "ESocket_Monitor",0,handle TO monitor
-280SYS "ESocket_ResetMonitor",monitor,0 TO polladdr%
-290:
-300REM If we crash, we should tidy up after ourselves
-310ON ERROR SYS "XESocket_Forget",handle:SYS "XESocket_Forget",monitor:ERROR EXT ERR,REPORT$+" at line "+STR$ERL
-320:
-330REM Memory buffer for our data
-340bufsize%=1024
-350DIM buf% bufsize%
-360:
-370input$="":REM The input line
-380REPEAT
-390 REM In a taskwindow we should yield until there is data
-400 SYS "OS_UpCall",6,polladdr%
-410 IF !polladdr%<>0 THEN
-420 REM Reset the monitor for the time being
-430 SYS "ESocket_ResetMonitor",monitor,0 TO polladdr%
-440 REPEAT
-450 REM Read lines from the connection until this buffer is empty
-460 SYS "ESocket_ReadLine",handle,buf%,bufsize%,%100 TO ,str,len
-470 IF str<>0 AND $str<>"" THEN
-480 line$=$str
-490 IF LEFT$(line$,4)="PING" THEN
-500 REM Ping's must be replied to immediately
-510 SYS "ESocket_SendLine",handle,"PONG "+MID$(line$,6)
-520 ELSE
-530 REM Extract source info
-540 from$=MID$(LEFT$(line$,INSTR(line$+" "," ")-1),2)
-550 line$=MID$(line$,INSTR(line$+" "," ")+1)
-560 uid$=LEFT$(from$,INSTR(from$+"!","!")-1)
-570 com$=LEFT$(line$,INSTR(line$+" "," ")-1)
-580 line$=MID$(line$,INSTR(line$+" "," ")+1)
-590 REM remove the input line
-600 IF input$<>"" THENFORI=1TOLEN(input$):VDU127:NEXT
-610 CASE FNupper(com$) OF
-620 WHEN "PRIVMSG"
-630 REM Extract the destination
-640 chan$=LEFT$(line$,INSTR(line$+" "," ")-1)
-650 line$=MID$(line$,INSTR(line$+" "," ")+2):REM Skip :
-660 IF LEFT$(line$,1)=CHR$1 THEN
-670 REM CTCP, so respond to it
-680 line$=MID$(line$,2,LEN(line$)-2)
-690 com$=LEFT$(line$,INSTR(line$+" "," ")-1)
-700 line$=MID$(line$,INSTR(line$+" "," ")+1)
-710 CASE FNupper(com$) OF
-720 WHEN "PING"
-730 REM Ping lag timing
-740 line$="PONG "+line$
-750 PRINTuid$;" pinged us"
-760 WHEN "VERSION"
-770 REM Version checking
-780 line$="VERSION EIRC 1.00 (c) Justin Fletcher"
-790 PRINTuid$;" wanted our version"
-800 WHEN "ACTION"
-810 PRINT"* ";uid$;" ";line$
-820 line$=""
-830 OTHERWISE
-840 REM everything else is an error
-850 line$="ERRMSG "+com$+" not understood"
-860 PRINT"CTCP '";com$;"' from ";uid$;" (";line$;")"
-870 ENDCASE
-880 IF line$<>"" THEN
-890 SYS "ESocket_SendLine",handle,"NOTICE "+uid$+" :"+CHR$1+line$+CHR$1
-900 ENDIF
-910 ELSE
-920 REM Somebody said something...
-930 PRINT"<";uid$;"> ";FNsafe(line$)
-940 ENDIF
-950 WHEN "JOIN"
-960 REM We (or someone else) has joined the channel
-970 chan$=LEFT$(line$,INSTR(line$+" "," ")):REM Skip :
-980 IF LEFT$(chan$,1)=":" THENchan$=MID$(chan$,2)
-990 PRINTuid$;" has joined ";chan$
-1000 WHEN "PART"
-1010 REM Someone else has left the channel
-1020 chan$=LEFT$(line$,INSTR(line$+" "," ")-1)
-1030 IF LEFT$(chan$,1)=":" THENchan$=MID$(chan$,2)
-1040 PRINTuid$;" has left ";chan$
-1050 WHEN "QUIT"
-1060 REM Someone else has quit IRC
-1070 PRINTuid$;" quit IRC"
-1080 OTHERWISE
-1090 REM Some unknown command
-1100 PRINTuid$;":";com$;":";FNsafe(line$)
-1110 ENDCASE
-1120 REM Re-display our input line
-1130 PRINTinput$;
-1140 ENDIF
-1150 ENDIF
-1160 UNTIL str=0
-1170 ENDIF
-1180 b$=INKEY$(0)
-1190 IF b$<>"" THEN
-1200 CASE b$ OF
-1210 WHEN CHR$13
-1220 SYS "ESocket_SendLine",handle,"PRIVMSG "+ourchan$+" :"+input$
-1230 REM Remove the line
-1240 IF input$<>"" THENFORI=1TOLEN(input$):VDU127:NEXT
-1250 REM We said it...
-1260 PRINT"<"+nick$+"> ";input$
-1270 input$=""
-1280 WHEN CHR$127,CHR$8
-1290 REM Backspace
-1300 IF input$<>"" THENVDU127
-1310 input$=LEFT$(input$)
-1320 OTHERWISE
-1330 REM Ad to current input
-1340 input$+=b$
-1350 PRINTb$;
-1360 ENDCASE
-1370 ENDIF
-1380 REM Has the socket closed
-1390 SYS "ESocket_Closed",handle,%0 TO closed
-1400UNTIL closed
-1410SYS "ESocket_Forget",handle
-1420SYS "ESocket_Forget",monitor
-1430END
-1440:
-1450DEFFNupper(a$):LOCAL c$,b$,I
-1460FORI=1TOLEN(a$)
-1470c$=MID$(a$,I,1):IF c$>="a"ANDc$<="z"THENc$=CHR$(ASC(c$)-32)
-1480b$+=c$:NEXT:=b$
-1490
-1500REM Remove control codes
-1510DEFFNsafe(line$)
-1520LOCAL I
-1530FORI=1TOLEN(line$)
-1540 IF MID$(line$,I,1)<" " THENMID$(line$,I,1)="*"
-1550NEXT
-1560=line$
diff --git a/tests/examplefiles/example.bc b/tests/examplefiles/example.bc
deleted file mode 100644
index 6604cd31..00000000
--- a/tests/examplefiles/example.bc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Calculate the Greatest Common Divisor of a and b.
- */
-define gcd(a, b) {
- auto tmp;
-
- /*
- * Euclidean algorithm
- */
- while (b != 0) {
- tmp = a % b;
- a = b;
- b = tmp;
- }
- return a;
-}
-"gcd(225, 150) = " ; gcd(225, 150)
-
-/* assign operators */
-a = 10
-a += 1
-a++
-++a
-a--
---a
-a += 5
-a -= 5
-a *= 2
-a /= 3
-a ^= 2
-a %= 2
-
-/* comparison */
-if (a > 2) {
-}
-if (a >= 2) {
-}
-if (a == 2) {
-}
-if (a != 2) {
-}
-if (a <= 2) {
-}
-if (a < 2) {
-}
-
-a /* /*/ * 2 /* == a * 2 */
-a //* /*/ 1.5 /* == a / 1.5 */
-a /*/*/ * 3 /* == a * 3 */
-a * 3 /**/ * 4 /* == a * 3 * 4 */
-a / 3 //*//*/ .4 /* == a / 3 / 0.4 */
-a / 3 //*//*/ 1.3 /* == a / 3 / 1.4 */
-a / 3 /*//*// 1.3 /* == a / 3 / 1.4 */
diff --git a/tests/examplefiles/example.boa b/tests/examplefiles/example.boa
deleted file mode 100644
index a18f1626..00000000
--- a/tests/examplefiles/example.boa
+++ /dev/null
@@ -1,18 +0,0 @@
-# Computes Number of Public Methods (NPM) for each project, per-type
-# Output is: NPM[ProjectID][TypeName] = NPM value
-p: Project = input;
-NPM: output sum[string][string] of int;
-
-visit(p, visitor {
- # only look at the latest snapshot
- before n: CodeRepository -> {
- snapshot := getsnapshot(n);
- foreach (i: int; def(snapshot[i]))
- visit(snapshot[i]);
- stop;
- }
- before node: Declaration ->
- if (node.kind == TypeKind.CLASS)
- foreach (i: int; has_modifier_public(node.methods[i]))
- NPM[p.id][node.name] << 1;
-});
diff --git a/tests/examplefiles/example.bug b/tests/examplefiles/example.bug
deleted file mode 100644
index 9ccd531d..00000000
--- a/tests/examplefiles/example.bug
+++ /dev/null
@@ -1,54 +0,0 @@
-# Alligators: multinomial - logistic regression
-# http://www.openbugs.info/Examples/Aligators.html
-model {
- # PRIORS
- alpha[1] <- 0; # zero contrast for baseline food
- for (k in 2 : K) {
- alpha[k] ~ dnorm(0, 0.00001) # vague priors
- }
- # Loop around lakes:
- for (k in 1 : K){
- beta[1, k] <- 0
- } # corner-point contrast with first lake
- for (i in 2 : I) {
- beta[i, 1] <- 0 ; # zero contrast for baseline food
- for (k in 2 : K){
- beta[i, k] ~ dnorm(0, 0.00001) # vague priors
- }
- }
- # Loop around sizes:
- for (k in 1 : K){
- gamma[1, k] <- 0 # corner-point contrast with first size
- }
- for (j in 2 : J) {
- gamma[j, 1] <- 0 ; # zero contrast for baseline food
- for ( k in 2 : K){
- gamma[j, k] ~ dnorm(0, 0.00001) # vague priors
- }
- }
-
- # LIKELIHOOD
- for (i in 1 : I) { # loop around lakes
- for (j in 1 : J) { # loop around sizes
-
- # Fit standard Poisson regressions relative to baseline
- lambda[i, j] ~ dflat() # vague priors
- for (k in 1 : K) { # loop around foods
- X[i, j, k] ~ dpois(mu[i, j, k])
- log(mu[i, j, k]) <- lambda[i, j] + alpha[k] + beta[i, k] + gamma[j, k]
- culmative.X[i, j, k] <- culmative(X[i, j, k], X[i, j, k])
- }
- }
- }
-
- # TRANSFORM OUTPUT TO ENABLE COMPARISON
- # WITH AGRESTI'S RESULTS
- for (k in 1 : K) { # loop around foods
- for (i in 1 : I) { # loop around lakes
- b[i, k] <- beta[i, k] - mean(beta[, k]); # sum to zero constraint
- }
- for (j in 1 : J) { # loop around sizes
- g[j, k] <- gamma[j, k] - mean(gamma[, k]); # sum to zero constraint
- }
- }
-}
diff --git a/tests/examplefiles/example.c b/tests/examplefiles/example.c
deleted file mode 100644
index 7bf70149..00000000
--- a/tests/examplefiles/example.c
+++ /dev/null
@@ -1,2080 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "codegen.h"
-#include "symboltable.h"
-#include "stringbuffer.h"
-
-extern void yyerror(char* msg);
-
-static stringBuffer* staticVariableBuffer;
-static stringBuffer* classInitBuffer;
-static stringBuffer* currentMethodBuffer;
-static stringBuffer* finishedMethodsBuffer;
-static stringBuffer* mainBuffer;
-
-static int currentMethodBufferIndex;
-static int currentMethodStackSize;
-static int currentMethodStackSizeMax;
-static int currentMethodNumberOfLocals;
-
-static int classInitBufferIndex;
-static int classInitStackSize;
-static int classInitStackSizeMax;
-
-static int labelCounter = 0;
-static int global = 1;
-
-char tempString[MAX_LENGTH_OF_COMMAND];
-
-extern char* className; /* from minako-syntax.y */
-
-/* forward declarations */
-static void increaseStackby(int stackdiff);
-char convertType(int type);
-
-void codegenInit() {
- staticVariableBuffer = newStringBuffer();
- classInitBuffer = newStringBuffer();
- currentMethodBuffer = 0;
- finishedMethodsBuffer = newStringBuffer();
- mainBuffer = newStringBuffer();
-
- stringBufferAppend(mainBuffer, "; ------- Header --------------------------------------------");
- sprintf(tempString, ".class public synchronized %s", className);
- stringBufferAppend(mainBuffer, tempString);
- stringBufferAppend(mainBuffer, ".super java/lang/Object");
- stringBufferAppend(mainBuffer, "; -----------------------------------------------------------");
- stringBufferAppend(mainBuffer, "");
-
- stringBufferAppend(finishedMethodsBuffer, "; ------- Constructor ---------------------------------------");
- stringBufferAppend(finishedMethodsBuffer, ".method public <init>()V");
- stringBufferAppend(finishedMethodsBuffer, "\t.limit stack 1");
- stringBufferAppend(finishedMethodsBuffer, "\t.limit locals 1");
- stringBufferAppend(finishedMethodsBuffer, "\taload_0");
- stringBufferAppend(finishedMethodsBuffer, "\tinvokenonvirtual java/lang/Object/<init>()V");
- stringBufferAppend(finishedMethodsBuffer, "\treturn");
- stringBufferAppend(finishedMethodsBuffer, ".end method");
- stringBufferAppend(finishedMethodsBuffer, "; -----------------------------------------------------------");
- stringBufferAppend(finishedMethodsBuffer, "");
-
- stringBufferAppend(staticVariableBuffer, "; ------- Class Variables -----------------------------------");
-
- stringBufferAppend(classInitBuffer, "; ------- Class Initializer ---------------------------------");
- stringBufferAppend(classInitBuffer, ".method static <clinit>()V");
- classInitBufferIndex = classInitBuffer->numberOfNextElement;
- stringBufferAppend(classInitBuffer, "\t.limit locals 0");
-
-}
-
-void codegenAppendCommand(char* cmd, int stackdiff) {
- char tempString[MAX_LENGTH_OF_COMMAND];
- sprintf(tempString, "\t%s", cmd);
- if (global) stringBufferAppend(classInitBuffer, tempString);
- else stringBufferAppend(currentMethodBuffer, tempString);
- increaseStackby(stackdiff);
-}
-
-void codegenInsertCommand(int address, char* cmd, int stackdiff) {
- char tempString[MAX_LENGTH_OF_COMMAND];
- sprintf(tempString, "\t%s", cmd);
- if (global) stringBufferInsert(classInitBuffer, address, tempString);
- else stringBufferInsert(currentMethodBuffer, address, tempString);
- increaseStackby(stackdiff);
-}
-
-void codegenAppendLabel(int label) {
- char tempString[MAX_LENGTH_OF_COMMAND];
- sprintf(tempString, "Label%d:", label);
- if (global) stringBufferAppend(classInitBuffer, tempString);
- else stringBufferAppend(currentMethodBuffer, tempString);
-}
-
-void codegenAddVariable(char* name, int type) {
- /*fprintf(stderr, "add variable %s(%d) global=%d ", name, convertType(type), global);*/
- if (global) {
- if (type == TYPE_INT) sprintf(tempString, ".field static %s %c", name, 'I');
- else if (type == TYPE_FLOAT) sprintf(tempString, ".field static %s %c", name, 'F');
- else if (type == TYPE_BOOLEAN) sprintf(tempString, ".field static %s %c", name, 'Z');
- else yyerror("compiler-intern error in codegenAddGlobalVariable().\n");
- stringBufferAppend(staticVariableBuffer, tempString);
- }
- else {
- currentMethodNumberOfLocals++;
- }
-}
-
-int codegenGetNextLabel() {
- return labelCounter++;
-}
-
-int codegenGetCurrentAddress() {
- if (global) return classInitBuffer->numberOfNextElement;
- else return currentMethodBuffer->numberOfNextElement;
-}
-
-void codegenEnterFunction(symtabEntry* entry) {
- currentMethodBuffer = newStringBuffer();
- currentMethodStackSize = 0;
- currentMethodStackSizeMax = 0;
- labelCounter = 1;
- global = 0;
-
- if (strcmp(entry->name, "main") == 0) {
- if (entry->idtype != TYPE_VOID) yyerror("main has to be void.\n");
- currentMethodNumberOfLocals = 1;
- symtabInsert(strdup("#main-param#"), TYPE_VOID, CLASS_FUNC);
- stringBufferAppend(currentMethodBuffer, "; ------- Methode ---- void main() --------------------------");
- stringBufferAppend(currentMethodBuffer, ".method public static main([Ljava/lang/String;)V");
- }
- else {
- int i;
- currentMethodNumberOfLocals = entry->paramIndex;
- stringBufferAppend(currentMethodBuffer, "; ------- Methode -------------------------------------------");
- sprintf(tempString, ".method public static %s(", entry->name);
- for (i=entry->paramIndex-1; i>=0; i--) {
- int type = entry->params[i]->idtype;
- tempString[strlen(tempString)+1] = 0;
- tempString[strlen(tempString)] = convertType(type);
- }
- tempString[strlen(tempString)+2] = 0;
- tempString[strlen(tempString)+1] = convertType(entry->idtype);
- tempString[strlen(tempString)] = ')';
- stringBufferAppend(currentMethodBuffer, tempString);
- }
- currentMethodBufferIndex = currentMethodBuffer->numberOfNextElement;
-}
-
-void codegenLeaveFunction() {
- global = 1;
- sprintf(tempString, "\t.limit locals %d", currentMethodNumberOfLocals);
- stringBufferInsert(currentMethodBuffer, currentMethodBufferIndex, tempString);
- sprintf(tempString, "\t.limit stack %d", currentMethodStackSizeMax);
- stringBufferInsert(currentMethodBuffer, currentMethodBufferIndex, tempString);
- stringBufferAppend(currentMethodBuffer, "\treturn");
- stringBufferAppend(currentMethodBuffer, ".end method");
- stringBufferAppend(currentMethodBuffer, "; -----------------------------------------------------------");
- stringBufferAppend(currentMethodBuffer, "");
-
- stringBufferConcatenate(finishedMethodsBuffer, currentMethodBuffer);
-}
-
-
-
-void codegenFinishCode() {
- stringBufferAppend(staticVariableBuffer, "; -----------------------------------------------------------");
- stringBufferAppend(staticVariableBuffer, "");
-
- sprintf(tempString, "\t.limit stack %d", classInitStackSizeMax);
- stringBufferInsert(classInitBuffer, classInitBufferIndex, tempString);
- stringBufferAppend(classInitBuffer, "\treturn");
- stringBufferAppend(classInitBuffer, ".end method");
- stringBufferAppend(classInitBuffer, "; -----------------------------------------------------------");
-
- stringBufferConcatenate(mainBuffer, staticVariableBuffer);
- stringBufferConcatenate(mainBuffer, finishedMethodsBuffer);
- stringBufferConcatenate(mainBuffer, classInitBuffer);
-
- stringBufferPrint(mainBuffer);
-}
-
-static void increaseStackby(int stackdiff) {
- if (global) {
- classInitStackSize += stackdiff;
- if (classInitStackSize > classInitStackSizeMax) classInitStackSizeMax = classInitStackSize;
- }
- else {
- currentMethodStackSize += stackdiff;
- if (currentMethodStackSize > currentMethodStackSizeMax) currentMethodStackSizeMax = currentMethodStackSize;
- }
-}
-
-char convertType(int type) {
- switch(type) {
- case TYPE_VOID: return 'V';
- case TYPE_INT: return 'I';
- case TYPE_FLOAT: return 'F';
- case TYPE_BOOLEAN: return 'Z';
- default : yyerror("compiler-intern error in convertType().\n");
- }
- return 0; /* to avoid compiler-warning */
-}
-
-
-//#include <stdlib.h>
-//#include <stdio.h>
-
-int main() {
- int a = 12, b = 44;
- while (a != b) {
- if (a > b)
- a -= b;
- else
- b -= a;
- }
- printf("%d\n%d", a, 0X0);\
-}
-
-
-/**********************************************************************
-
- array.c -
-
- $Author: murphy $
- $Date: 2005-11-05 04:33:55 +0100 (Sa, 05 Nov 2005) $
- created at: Fri Aug 6 09:46:12 JST 1993
-
- Copyright (C) 1993-2003 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
-#include "ruby.h"
-#include "util.h"
-#include "st.h"
-#include "node.h"
-
-VALUE rb_cArray, rb_cValues;
-
-static ID id_cmp;
-
-#define ARY_DEFAULT_SIZE 16
-
-
-void
-rb_mem_clear(mem, size)
- register VALUE *mem;
- register long size;
-{
- while (size--) {
- *mem++ = Qnil;
- }
-}
-
-static inline void
-memfill(mem, size, val)
- register VALUE *mem;
- register long size;
- register VALUE val;
-{
- while (size--) {
- *mem++ = val;
- }
-}
-
-#define ARY_TMPLOCK FL_USER1
-
-static inline void
-rb_ary_modify_check(ary)
- VALUE ary;
-{
- if (OBJ_FROZEN(ary)) rb_error_frozen("array");
- if (FL_TEST(ary, ARY_TMPLOCK))
- rb_raise(rb_eRuntimeError, "can't modify array during iteration");
- if (!OBJ_TAINTED(ary) && rb_safe_level() >= 4)
- rb_raise(rb_eSecurityError, "Insecure: can't modify array");
-}
-
-static void
-rb_ary_modify(ary)
- VALUE ary;
-{
- VALUE *ptr;
-
- rb_ary_modify_check(ary);
- if (FL_TEST(ary, ELTS_SHARED)) {
- ptr = ALLOC_N(VALUE, RARRAY(ary)->len);
- FL_UNSET(ary, ELTS_SHARED);
- RARRAY(ary)->aux.capa = RARRAY(ary)->len;
- MEMCPY(ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
- RARRAY(ary)->ptr = ptr;
- }
-}
-
-VALUE
-rb_ary_freeze(ary)
- VALUE ary;
-{
- return rb_obj_freeze(ary);
-}
-
-/*
- * call-seq:
- * array.frozen? -> true or false
- *
- * Return <code>true</code> if this array is frozen (or temporarily frozen
- * while being sorted).
- */
-
-static VALUE
-rb_ary_frozen_p(ary)
- VALUE ary;
-{
- if (OBJ_FROZEN(ary)) return Qtrue;
- if (FL_TEST(ary, ARY_TMPLOCK)) return Qtrue;
- return Qfalse;
-}
-
-static VALUE ary_alloc(VALUE);
-static VALUE
-ary_alloc(klass)
- VALUE klass;
-{
- NEWOBJ(ary, struct RArray);
- OBJSETUP(ary, klass, T_ARRAY);
-
- ary->len = 0;
- ary->ptr = 0;
- ary->aux.capa = 0;
-
- return (VALUE)ary;
-}
-
-static VALUE
-ary_new(klass, len)
- VALUE klass;
- long len;
-{
- VALUE ary;
-
- if (len < 0) {
- rb_raise(rb_eArgError, "negative array size (or size too big)");
- }
- if (len > 0 && len * sizeof(VALUE) <= len) {
- rb_raise(rb_eArgError, "array size too big");
- }
- if (len == 0) len++;
-
- ary = ary_alloc(klass);
- RARRAY(ary)->ptr = ALLOC_N(VALUE, len);
- RARRAY(ary)->aux.capa = len;
-
- return ary;
-}
-
-VALUE
-rb_ary_new2(len)
- long len;
-{
- return ary_new(rb_cArray, len);
-}
-
-
-VALUE
-rb_ary_new()
-{
- return rb_ary_new2(ARY_DEFAULT_SIZE);
-}
-
-#ifdef HAVE_STDARG_PROTOTYPES
-#include <stdarg.h>
-#define va_init_list(a,b) va_start(a,b)
-#else
-#include <varargs.h>
-#define va_init_list(a,b) va_start(a)
-#endif
-
-VALUE
-#ifdef HAVE_STDARG_PROTOTYPES
-rb_ary_new3(long n, ...)
-#else
-rb_ary_new3(n, va_alist)
- long n;
- va_dcl
-#endif
-{
- va_list ar;
- VALUE ary;
- long i;
-
- ary = rb_ary_new2(n);
-
- va_init_list(ar, n);
- for (i=0; i<n; i++) {
- RARRAY(ary)->ptr[i] = va_arg(ar, VALUE);
- }
- va_end(ar);
-
- RARRAY(ary)->len = n;
- return ary;
-}
-
-VALUE
-rb_ary_new4(n, elts)
- long n;
- const VALUE *elts;
-{
- VALUE ary;
-
- ary = rb_ary_new2(n);
- if (n > 0 && elts) {
- MEMCPY(RARRAY(ary)->ptr, elts, VALUE, n);
- }
- RARRAY(ary)->len = n;
-
- return ary;
-}
-
-VALUE
-#ifdef HAVE_STDARG_PROTOTYPES
-rb_values_new(long n, ...)
-#else
-rb_values_new(n, va_alist)
- long n;
- va_dcl
-#endif
-{
- va_list ar;
- VALUE val;
- long i;
-
- val = ary_new(rb_cValues, n);
- va_init_list(ar, n);
- for (i=0; i<n; i++) {
- RARRAY(val)->ptr[i] = va_arg(ar, VALUE);
- }
- va_end(ar);
- RARRAY(val)->len = n;
-
- return val;
-}
-
-VALUE
-rb_values_new2(n, elts)
- long n;
- const VALUE *elts;
-{
- VALUE val;
-
- val = ary_new(rb_cValues, n);
- if (n > 0 && elts) {
- RARRAY(val)->len = n;
- MEMCPY(RARRAY(val)->ptr, elts, VALUE, n);
- }
-
- return val;
-}
-
-static VALUE
-ary_make_shared(ary)
- VALUE ary;
-{
- if (!FL_TEST(ary, ELTS_SHARED)) {
- NEWOBJ(shared, struct RArray);
- OBJSETUP(shared, rb_cArray, T_ARRAY);
-
- shared->len = RARRAY(ary)->len;
- shared->ptr = RARRAY(ary)->ptr;
- shared->aux.capa = RARRAY(ary)->aux.capa;
- RARRAY(ary)->aux.shared = (VALUE)shared;
- FL_SET(ary, ELTS_SHARED);
- OBJ_FREEZE(shared);
- return (VALUE)shared;
- }
- else {
- return RARRAY(ary)->aux.shared;
- }
-}
-
-static VALUE
-ary_shared_array(klass, ary)
- VALUE klass, ary;
-{
- VALUE val = ary_alloc(klass);
-
- ary_make_shared(ary);
- RARRAY(val)->ptr = RARRAY(ary)->ptr;
- RARRAY(val)->len = RARRAY(ary)->len;
- RARRAY(val)->aux.shared = RARRAY(ary)->aux.shared;
- FL_SET(val, ELTS_SHARED);
- return val;
-}
-
-VALUE
-rb_values_from_ary(ary)
- VALUE ary;
-{
- return ary_shared_array(rb_cValues, ary);
-}
-
-VALUE
-rb_ary_from_values(val)
- VALUE val;
-{
- return ary_shared_array(rb_cArray, val);
-}
-
-VALUE
-rb_assoc_new(car, cdr)
- VALUE car, cdr;
-{
- return rb_values_new(2, car, cdr);
-}
-
-static VALUE
-to_ary(ary)
- VALUE ary;
-{
- return rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
-}
-
-static VALUE
-to_a(ary)
- VALUE ary;
-{
- return rb_convert_type(ary, T_ARRAY, "Array", "to_a");
-}
-
-VALUE
-rb_check_array_type(ary)
- VALUE ary;
-{
- return rb_check_convert_type(ary, T_ARRAY, "Array", "to_ary");
-}
-
-static VALUE rb_ary_replace _((VALUE, VALUE));
-
-/*
- * call-seq:
- * Array.new(size=0, obj=nil)
- * Array.new(array)
- * Array.new(size) {|index| block }
- *
- * Returns a new array. In the first form, the new array is
- * empty. In the second it is created with _size_ copies of _obj_
- * (that is, _size_ references to the same
- * _obj_). The third form creates a copy of the array
- * passed as a parameter (the array is generated by calling
- * to_ary on the parameter). In the last form, an array
- * of the given size is created. Each element in this array is
- * calculated by passing the element's index to the given block and
- * storing the return value.
- *
- * Array.new
- * Array.new(2)
- * Array.new(5, "A")
- *
- * # only one copy of the object is created
- * a = Array.new(2, Hash.new)
- * a[0]['cat'] = 'feline'
- * a
- * a[1]['cat'] = 'Felix'
- * a
- *
- * # here multiple copies are created
- * a = Array.new(2) { Hash.new }
- * a[0]['cat'] = 'feline'
- * a
- *
- * squares = Array.new(5) {|i| i*i}
- * squares
- *
- * copy = Array.new(squares)
- */
-
-static VALUE
-rb_ary_initialize(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- long len;
- VALUE size, val;
-
- if (rb_scan_args(argc, argv, "02", &size, &val) == 0) {
- RARRAY(ary)->len = 0;
- if (rb_block_given_p()) {
- rb_warning("given block not used");
- }
- return ary;
- }
-
- if (argc == 1 && !FIXNUM_P(size)) {
- val = rb_check_array_type(size);
- if (!NIL_P(val)) {
- rb_ary_replace(ary, val);
- return ary;
- }
- }
-
- len = NUM2LONG(size);
- if (len < 0) {
- rb_raise(rb_eArgError, "negative array size");
- }
- if (len > 0 && len * (long)sizeof(VALUE) <= len) {
- rb_raise(rb_eArgError, "array size too big");
- }
- rb_ary_modify(ary);
- if (len > RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, len);
- RARRAY(ary)->aux.capa = len;
- }
- if (rb_block_given_p()) {
- long i;
-
- if (argc == 2) {
- rb_warn("block supersedes default value argument");
- }
- for (i=0; i<len; i++) {
- rb_ary_store(ary, i, rb_yield(LONG2NUM(i)));
- RARRAY(ary)->len = i + 1;
- }
- }
- else {
- memfill(RARRAY(ary)->ptr, len, val);
- RARRAY(ary)->len = len;
- }
-
- return ary;
-}
-
-
-/*
-* Returns a new array populated with the given objects.
-*
-* Array.[]( 1, 'a', /^A/ )
-* Array[ 1, 'a', /^A/ ]
-* [ 1, 'a', /^A/ ]
-*/
-
-static VALUE
-rb_ary_s_create(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
-{
- VALUE ary = ary_alloc(klass);
-
- if (argc > 0) {
- RARRAY(ary)->ptr = ALLOC_N(VALUE, argc);
- MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
- }
- RARRAY(ary)->len = RARRAY(ary)->aux.capa = argc;
-
- return ary;
-}
-
-void
-rb_ary_store(ary, idx, val)
- VALUE ary;
- long idx;
- VALUE val;
-{
- if (idx < 0) {
- idx += RARRAY(ary)->len;
- if (idx < 0) {
- rb_raise(rb_eIndexError, "index %ld out of array",
- idx - RARRAY(ary)->len);
- }
- }
-
- rb_ary_modify(ary);
- if (idx >= RARRAY(ary)->aux.capa) {
- long new_capa = RARRAY(ary)->aux.capa / 2;
-
- if (new_capa < ARY_DEFAULT_SIZE) {
- new_capa = ARY_DEFAULT_SIZE;
- }
- new_capa += idx;
- if (new_capa * (long)sizeof(VALUE) <= new_capa) {
- rb_raise(rb_eArgError, "index too big");
- }
- REALLOC_N(RARRAY(ary)->ptr, VALUE, new_capa);
- RARRAY(ary)->aux.capa = new_capa;
- }
- if (idx > RARRAY(ary)->len) {
- rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len,
- idx-RARRAY(ary)->len + 1);
- }
-
- if (idx >= RARRAY(ary)->len) {
- RARRAY(ary)->len = idx + 1;
- }
- RARRAY(ary)->ptr[idx] = val;
-}
-
-static VALUE
-ary_shared_first(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE nv, result;
- long n;
-
- rb_scan_args(argc, argv, "1", &nv);
- n = NUM2LONG(nv);
- if (n > RARRAY(ary)->len) {
- n = RARRAY(ary)->len;
- }
- else if (n < 0) {
- rb_raise(rb_eArgError, "negative array size");
- }
- result = ary_shared_array(rb_cArray, ary);
- RARRAY(result)->len = n;
- return result;
-}
-
-static VALUE
-ary_shared_last(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE result = ary_shared_first(argc, argv, ary);
-
- RARRAY(result)->ptr += RARRAY(ary)->len - RARRAY(result)->len;
- return result;
-}
-
-/*
- * call-seq:
- * array << obj -> array
- *
- * Append---Pushes the given object on to the end of this array. This
- * expression returns the array itself, so several appends
- * may be chained together.
- *
- * [ 1, 2 ] << "c" << "d" << [ 3, 4 ]
- * #=> [ 1, 2, "c", "d", [ 3, 4 ] ]
- *
- */
-
-VALUE
-rb_ary_push(ary, item)
- VALUE ary;
- VALUE item;
-{
- rb_ary_store(ary, RARRAY(ary)->len, item);
- return ary;
-}
-
-/*
- * call-seq:
- * array.push(obj, ... ) -> array
- *
- * Append---Pushes the given object(s) on to the end of this array. This
- * expression returns the array itself, so several appends
- * may be chained together.
- *
- * a = [ "a", "b", "c" ]
- * a.push("d", "e", "f")
- * #=> ["a", "b", "c", "d", "e", "f"]
- */
-
-static VALUE
-rb_ary_push_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- while (argc--) {
- rb_ary_push(ary, *argv++);
- }
- return ary;
-}
-
-VALUE
-rb_ary_pop(ary)
- VALUE ary;
-{
- rb_ary_modify_check(ary);
- if (RARRAY(ary)->len == 0) return Qnil;
- if (!FL_TEST(ary, ELTS_SHARED) &&
- RARRAY(ary)->len * 2 < RARRAY(ary)->aux.capa &&
- RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) {
- RARRAY(ary)->aux.capa = RARRAY(ary)->len * 2;
- REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa);
- }
- return RARRAY(ary)->ptr[--RARRAY(ary)->len];
-}
-
-/*
- * call-seq:
- * array.pop -> obj or nil
- *
- * Removes the last element from <i>self</i> and returns it, or
- * <code>nil</code> if the array is empty.
- *
- * a = [ "a", "b", "c", "d" ]
- * a.pop #=> "d"
- * a.pop(2) #=> ["b", "c"]
- * a #=> ["a"]
- */
-
-static VALUE
-rb_ary_pop_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE result;
-
- if (argc == 0) {
- return rb_ary_pop(ary);
- }
-
- rb_ary_modify_check(ary);
-
- result = ary_shared_last(argc, argv, ary);
- RARRAY(ary)->len -= RARRAY(result)->len;
- return result;
-}
-
-VALUE
-rb_ary_shift(ary)
- VALUE ary;
-{
- VALUE top;
-
- rb_ary_modify_check(ary);
- if (RARRAY(ary)->len == 0) return Qnil;
- top = RARRAY(ary)->ptr[0];
- ary_make_shared(ary);
- RARRAY(ary)->ptr++; /* shift ptr */
- RARRAY(ary)->len--;
-
- return top;
-}
-
-/*
- * call-seq:
- * array.shift -> obj or nil
- *
- * Returns the first element of <i>self</i> and removes it (shifting all
- * other elements down by one). Returns <code>nil</code> if the array
- * is empty.
- *
- * args = [ "-m", "-q", "filename" ]
- * args.shift #=> "-m"
- * args #=> ["-q", "filename"]
- *
- * args = [ "-m", "-q", "filename" ]
- * args.shift(2) #=> ["-m", "-q"]
- * args #=> ["filename"]
- */
-
-static VALUE
-rb_ary_shift_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE result;
- long n;
-
- if (argc == 0) {
- return rb_ary_shift(ary);
- }
-
- rb_ary_modify_check(ary);
-
- result = ary_shared_first(argc, argv, ary);
- n = RARRAY(result)->len;
- RARRAY(ary)->ptr += n;
- RARRAY(ary)->len -= n;
-
- return result;
-}
-
-VALUE
-rb_ary_unshift(ary, item)
- VALUE ary, item;
-{
- rb_ary_modify(ary);
- if (RARRAY(ary)->len == RARRAY(ary)->aux.capa) {
- long capa_inc = RARRAY(ary)->aux.capa / 2;
- if (capa_inc < ARY_DEFAULT_SIZE) {
- capa_inc = ARY_DEFAULT_SIZE;
- }
- RARRAY(ary)->aux.capa += capa_inc;
- REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa);
- }
-
- /* sliding items */
- MEMMOVE(RARRAY(ary)->ptr + 1, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
-
- RARRAY(ary)->len++;
- RARRAY(ary)->ptr[0] = item;
-
- return ary;
-}
-
-/*
- * call-seq:
- * array.unshift(obj, ...) -> array
- *
- * Prepends objects to the front of <i>array</i>.
- * other elements up one.
- *
- * a = [ "b", "c", "d" ]
- * a.unshift("a") #=> ["a", "b", "c", "d"]
- * a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"]
- */
-
-static VALUE
-rb_ary_unshift_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- long len = RARRAY(ary)->len;
-
- if (argc == 0) return ary;
-
- /* make rooms by setting the last item */
- rb_ary_store(ary, len + argc - 1, Qnil);
-
- /* sliding items */
- MEMMOVE(RARRAY(ary)->ptr + argc, RARRAY(ary)->ptr, VALUE, len);
- MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
-
- return ary;
-}
-
-/* faster version - use this if you don't need to treat negative offset */
-static inline VALUE
-rb_ary_elt(ary, offset)
- VALUE ary;
- long offset;
-{
- if (RARRAY(ary)->len == 0) return Qnil;
- if (offset < 0 || RARRAY(ary)->len <= offset) {
- return Qnil;
- }
- return RARRAY(ary)->ptr[offset];
-}
-
-VALUE
-rb_ary_entry(ary, offset)
- VALUE ary;
- long offset;
-{
- if (offset < 0) {
- offset += RARRAY(ary)->len;
- }
- return rb_ary_elt(ary, offset);
-}
-
-static VALUE
-rb_ary_subseq(ary, beg, len)
- VALUE ary;
- long beg, len;
-{
- VALUE klass, ary2, shared;
- VALUE *ptr;
-
- if (beg > RARRAY(ary)->len) return Qnil;
- if (beg < 0 || len < 0) return Qnil;
-
- if (beg + len > RARRAY(ary)->len) {
- len = RARRAY(ary)->len - beg;
- if (len < 0)
- len = 0;
- }
- klass = rb_obj_class(ary);
- if (len == 0) return ary_new(klass, 0);
-
- shared = ary_make_shared(ary);
- ptr = RARRAY(ary)->ptr;
- ary2 = ary_alloc(klass);
- RARRAY(ary2)->ptr = ptr + beg;
- RARRAY(ary2)->len = len;
- RARRAY(ary2)->aux.shared = shared;
- FL_SET(ary2, ELTS_SHARED);
-
- return ary2;
-}
-
-/*
- * call-seq:
- * array[index] -> obj or nil
- * array[start, length] -> an_array or nil
- * array[range] -> an_array or nil
- * array.slice(index) -> obj or nil
- * array.slice(start, length) -> an_array or nil
- * array.slice(range) -> an_array or nil
- *
- * Element Reference---Returns the element at _index_,
- * or returns a subarray starting at _start_ and
- * continuing for _length_ elements, or returns a subarray
- * specified by _range_.
- * Negative indices count backward from the end of the
- * array (-1 is the last element). Returns nil if the index
- * (or starting index) are out of range.
- *
- * a = [ "a", "b", "c", "d", "e" ]
- * a[2] + a[0] + a[1] #=> "cab"
- * a[6] #=> nil
- * a[1, 2] #=> [ "b", "c" ]
- * a[1..3] #=> [ "b", "c", "d" ]
- * a[4..7] #=> [ "e" ]
- * a[6..10] #=> nil
- * a[-3, 3] #=> [ "c", "d", "e" ]
- * # special cases
- * a[5] #=> nil
- * a[5, 1] #=> []
- * a[5..10] #=> []
- *
- */
-
-VALUE
-rb_ary_aref(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE arg;
- long beg, len;
-
- if (argc == 2) {
- beg = NUM2LONG(argv[0]);
- len = NUM2LONG(argv[1]);
- if (beg < 0) {
- beg += RARRAY(ary)->len;
- }
- return rb_ary_subseq(ary, beg, len);
- }
- if (argc != 1) {
- rb_scan_args(argc, argv, "11", 0, 0);
- }
- arg = argv[0];
- /* special case - speeding up */
- if (FIXNUM_P(arg)) {
- return rb_ary_entry(ary, FIX2LONG(arg));
- }
- /* check if idx is Range */
- switch (rb_range_beg_len(arg, &beg, &len, RARRAY(ary)->len, 0)) {
- case Qfalse:
- break;
- case Qnil:
- return Qnil;
- default:
- return rb_ary_subseq(ary, beg, len);
- }
- return rb_ary_entry(ary, NUM2LONG(arg));
-}
-
-/*
- * call-seq:
- * array.at(index) -> obj or nil
- *
- * Returns the element at _index_. A
- * negative index counts from the end of _self_. Returns +nil+
- * if the index is out of range. See also <code>Array#[]</code>.
- * (<code>Array#at</code> is slightly faster than <code>Array#[]</code>,
- * as it does not accept ranges and so on.)
- *
- * a = [ "a", "b", "c", "d", "e" ]
- * a.at(0) #=> "a"
- * a.at(-1) #=> "e"
- */
-
-static VALUE
-rb_ary_at(ary, pos)
- VALUE ary, pos;
-{
- return rb_ary_entry(ary, NUM2LONG(pos));
-}
-
-/*
- * call-seq:
- * array.first -> obj or nil
- * array.first(n) -> an_array
- *
- * Returns the first element of the array. If the array is empty,
- * returns <code>nil</code>.
- *
- * a = [ "q", "r", "s", "t" ]
- * a.first #=> "q"
- * a.first(2) #=> ["q", "r"]
- */
-
-static VALUE
-rb_ary_first(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- if (argc == 0) {
- if (RARRAY(ary)->len == 0) return Qnil;
- return RARRAY(ary)->ptr[0];
- }
- else {
- return ary_shared_first(argc, argv, ary);
- }
-}
-
-/*
- * call-seq:
- * array.last -> obj or nil
- * array.last(n) -> an_array
- *
- * Returns the last element(s) of <i>self</i>. If the array is empty,
- * the first form returns <code>nil</code>.
- *
- * a = [ "w", "x", "y", "z" ]
- * a.last #=> "z"
- * a.last(2) #=> ["y", "z"]
- */
-
-static VALUE
-rb_ary_last(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- if (argc == 0) {
- if (RARRAY(ary)->len == 0) return Qnil;
- return RARRAY(ary)->ptr[RARRAY(ary)->len-1];
- }
- else {
- return ary_shared_last(argc, argv, ary);
- }
-}
-
-/*
- * call-seq:
- * array.fetch(index) -> obj
- * array.fetch(index, default ) -> obj
- * array.fetch(index) {|index| block } -> obj
- *
- * Tries to return the element at position <i>index</i>. If the index
- * lies outside the array, the first form throws an
- * <code>IndexError</code> exception, the second form returns
- * <i>default</i>, and the third form returns the value of invoking
- * the block, passing in the index. Negative values of <i>index</i>
- * count from the end of the array.
- *
- * a = [ 11, 22, 33, 44 ]
- * a.fetch(1) #=> 22
- * a.fetch(-1) #=> 44
- * a.fetch(4, 'cat') #=> "cat"
- * a.fetch(4) { |i| i*i } #=> 16
- */
-
-static VALUE
-rb_ary_fetch(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE pos, ifnone;
- long block_given;
- long idx;
-
- rb_scan_args(argc, argv, "11", &pos, &ifnone);
- block_given = rb_block_given_p();
- if (block_given && argc == 2) {
- rb_warn("block supersedes default value argument");
- }
- idx = NUM2LONG(pos);
-
- if (idx < 0) {
- idx += RARRAY(ary)->len;
- }
- if (idx < 0 || RARRAY(ary)->len <= idx) {
- if (block_given) return rb_yield(pos);
- if (argc == 1) {
- rb_raise(rb_eIndexError, "index %ld out of array", idx);
- }
- return ifnone;
- }
- return RARRAY(ary)->ptr[idx];
-}
-
-/*
- * call-seq:
- * array.index(obj) -> int or nil
- * array.index {|item| block} -> int or nil
- *
- * Returns the index of the first object in <i>self</i> such that is
- * <code>==</code> to <i>obj</i>. If a block is given instead of an
- * argument, returns first object for which <em>block</em> is true.
- * Returns <code>nil</code> if no match is found.
- *
- * a = [ "a", "b", "c" ]
- * a.index("b") #=> 1
- * a.index("z") #=> nil
- * a.index{|x|x=="b"} #=> 1
- */
-
-static VALUE
-rb_ary_index(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE val;
- long i;
-
- if (rb_scan_args(argc, argv, "01", &val) == 0) {
- for (i=0; i<RARRAY(ary)->len; i++) {
- if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) {
- return LONG2NUM(i);
- }
- }
- }
- else {
- for (i=0; i<RARRAY(ary)->len; i++) {
- if (rb_equal(RARRAY(ary)->ptr[i], val))
- return LONG2NUM(i);
- }
- }
- return Qnil;
-}
-
-/*
- * call-seq:
- * array.rindex(obj) -> int or nil
- *
- * Returns the index of the last object in <i>array</i>
- * <code>==</code> to <i>obj</i>. If a block is given instead of an
- * argument, returns first object for which <em>block</em> is
- * true. Returns <code>nil</code> if no match is found.
- *
- * a = [ "a", "b", "b", "b", "c" ]
- * a.rindex("b") #=> 3
- * a.rindex("z") #=> nil
- * a.rindex{|x|x=="b"} #=> 3
- */
-
-static VALUE
-rb_ary_rindex(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE val;
- long i = RARRAY(ary)->len;
-
- if (rb_scan_args(argc, argv, "01", &val) == 0) {
- while (i--) {
- if (RTEST(rb_yield(RARRAY(ary)->ptr[i])))
- return LONG2NUM(i);
- if (i > RARRAY(ary)->len) {
- i = RARRAY(ary)->len;
- }
- }
- }
- else {
- while (i--) {
- if (rb_equal(RARRAY(ary)->ptr[i], val))
- return LONG2NUM(i);
- if (i > RARRAY(ary)->len) {
- i = RARRAY(ary)->len;
- }
- }
- }
- return Qnil;
-}
-
-VALUE
-rb_ary_to_ary(obj)
- VALUE obj;
-{
- if (TYPE(obj) == T_ARRAY) {
- return obj;
- }
- if (rb_respond_to(obj, rb_intern("to_ary"))) {
- return to_ary(obj);
- }
- return rb_ary_new3(1, obj);
-}
-
-static void
-rb_ary_splice(ary, beg, len, rpl)
- VALUE ary;
- long beg, len;
- VALUE rpl;
-{
- long rlen;
-
- if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
- if (beg < 0) {
- beg += RARRAY(ary)->len;
- if (beg < 0) {
- beg -= RARRAY(ary)->len;
- rb_raise(rb_eIndexError, "index %ld out of array", beg);
- }
- }
- if (beg + len > RARRAY(ary)->len) {
- len = RARRAY(ary)->len - beg;
- }
-
- if (rpl == Qundef) {
- rlen = 0;
- }
- else {
- rpl = rb_ary_to_ary(rpl);
- rlen = RARRAY(rpl)->len;
- }
- rb_ary_modify(ary);
-
- if (beg >= RARRAY(ary)->len) {
- len = beg + rlen;
- if (len >= RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, len);
- RARRAY(ary)->aux.capa = len;
- }
- rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, beg - RARRAY(ary)->len);
- if (rlen > 0) {
- MEMCPY(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen);
- }
- RARRAY(ary)->len = len;
- }
- else {
- long alen;
-
- if (beg + len > RARRAY(ary)->len) {
- len = RARRAY(ary)->len - beg;
- }
-
- alen = RARRAY(ary)->len + rlen - len;
- if (alen >= RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, alen);
- RARRAY(ary)->aux.capa = alen;
- }
-
- if (len != rlen) {
- MEMMOVE(RARRAY(ary)->ptr + beg + rlen, RARRAY(ary)->ptr + beg + len,
- VALUE, RARRAY(ary)->len - (beg + len));
- RARRAY(ary)->len = alen;
- }
- if (rlen > 0) {
- MEMMOVE(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen);
- }
- }
-}
-
-/*
- * call-seq:
- * array[index] = obj -> obj
- * array[start, length] = obj or an_array or nil -> obj or an_array or nil
- * array[range] = obj or an_array or nil -> obj or an_array or nil
- *
- * Element Assignment---Sets the element at _index_,
- * or replaces a subarray starting at _start_ and
- * continuing for _length_ elements, or replaces a subarray
- * specified by _range_. If indices are greater than
- * the current capacity of the array, the array grows
- * automatically. A negative indices will count backward
- * from the end of the array. Inserts elements if _length_ is
- * zero. An +IndexError+ is raised if a negative index points
- * past the beginning of the array. See also
- * <code>Array#push</code>, and <code>Array#unshift</code>.
- *
- * a = Array.new
- * a[4] = "4"; #=> [nil, nil, nil, nil, "4"]
- * a[0, 3] = [ 'a', 'b', 'c' ] #=> ["a", "b", "c", nil, "4"]
- * a[1..2] = [ 1, 2 ] #=> ["a", 1, 2, nil, "4"]
- * a[0, 2] = "?" #=> ["?", 2, nil, "4"]
- * a[0..2] = "A" #=> ["A", "4"]
- * a[-1] = "Z" #=> ["A", "Z"]
- * a[1..-1] = nil #=> ["A", nil]
- * a[1..-1] = [] #=> ["A"]
- */
-
-static VALUE
-rb_ary_aset(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- long offset, beg, len;
-
- if (argc == 3) {
- rb_ary_splice(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]);
- return argv[2];
- }
- if (argc != 2) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
- }
- if (FIXNUM_P(argv[0])) {
- offset = FIX2LONG(argv[0]);
- goto fixnum;
- }
- if (rb_range_beg_len(argv[0], &beg, &len, RARRAY(ary)->len, 1)) {
- /* check if idx is Range */
- rb_ary_splice(ary, beg, len, argv[1]);
- return argv[1];
- }
-
- offset = NUM2LONG(argv[0]);
-fixnum:
- rb_ary_store(ary, offset, argv[1]);
- return argv[1];
-}
-
-/*
- * call-seq:
- * array.insert(index, obj...) -> array
- *
- * Inserts the given values before the element with the given index
- * (which may be negative).
- *
- * a = %w{ a b c d }
- * a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
- * a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"]
- */
-
-static VALUE
-rb_ary_insert(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- long pos;
-
- if (argc < 1) {
- rb_raise(rb_eArgError, "wrong number of arguments (at least 1)");
- }
- pos = NUM2LONG(argv[0]);
- if (pos == -1) {
- pos = RARRAY(ary)->len;
- }
- else if (pos < 0) {
- pos++;
- }
-
- if (argc == 1) return ary;
- rb_ary_splice(ary, pos, 0, rb_ary_new4(argc - 1, argv + 1));
- return ary;
-}
-
-/*
- * call-seq:
- * array.each {|item| block } -> array
- *
- * Calls <i>block</i> once for each element in <i>self</i>, passing that
- * element as a parameter.
- *
- * a = [ "a", "b", "c" ]
- * a.each {|x| print x, " -- " }
- *
- * produces:
- *
- * a -- b -- c --
- */
-
-VALUE
-rb_ary_each(ary)
- VALUE ary;
-{
- long i;
-
- for (i=0; i<RARRAY(ary)->len; i++) {
- rb_yield(RARRAY(ary)->ptr[i]);
- }
- return ary;
-}
-
-/*
- * call-seq:
- * array.each_index {|index| block } -> array
- *
- * Same as <code>Array#each</code>, but passes the index of the element
- * instead of the element itself.
- *
- * a = [ "a", "b", "c" ]
- * a.each_index {|x| print x, " -- " }
- *
- * produces:
- *
- * 0 -- 1 -- 2 --
- */
-
-static VALUE
-rb_ary_each_index(ary)
- VALUE ary;
-{
- long i;
-
- for (i=0; i<RARRAY(ary)->len; i++) {
- rb_yield(LONG2NUM(i));
- }
- return ary;
-}
-
-/*
- * call-seq:
- * array.reverse_each {|item| block }
- *
- * Same as <code>Array#each</code>, but traverses <i>self</i> in reverse
- * order.
- *
- * a = [ "a", "b", "c" ]
- * a.reverse_each {|x| print x, " " }
- *
- * produces:
- *
- * c b a
- */
-
-static VALUE
-rb_ary_reverse_each(ary)
- VALUE ary;
-{
- long len = RARRAY(ary)->len;
-
- while (len--) {
- rb_yield(RARRAY(ary)->ptr[len]);
- if (RARRAY(ary)->len < len) {
- len = RARRAY(ary)->len;
- }
- }
- return ary;
-}
-
-/*
- * call-seq:
- * array.length -> int
- *
- * Returns the number of elements in <i>self</i>. May be zero.
- *
- * [ 1, 2, 3, 4, 5 ].length #=> 5
- */
-
-static VALUE
-rb_ary_length(ary)
- VALUE ary;
-{
- return LONG2NUM(RARRAY(ary)->len);
-}
-
-/*
- * call-seq:
- * array.empty? -> true or false
- *
- * Returns <code>true</code> if <i>self</i> array contains no elements.
- *
- * [].empty? #=> true
- */
-
-static VALUE
-rb_ary_empty_p(ary)
- VALUE ary;
-{
- if (RARRAY(ary)->len == 0)
- return Qtrue;
- return Qfalse;
-}
-
-VALUE
-rb_ary_dup(ary)
- VALUE ary;
-{
- VALUE dup = rb_ary_new2(RARRAY(ary)->len);
-
- DUPSETUP(dup, ary);
- MEMCPY(RARRAY(dup)->ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
- RARRAY(dup)->len = RARRAY(ary)->len;
- return dup;
-}
-
-extern VALUE rb_output_fs;
-
-static VALUE
-recursive_join(ary, arg, recur)
- VALUE ary;
- VALUE *arg;
- int recur;
-{
- if (recur) {
- return rb_str_new2("[...]");
- }
- return rb_ary_join(arg[0], arg[1]);
-}
-
-VALUE
-rb_ary_join(ary, sep)
- VALUE ary, sep;
-{
- long len = 1, i;
- int taint = Qfalse;
- VALUE result, tmp;
-
- if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
- if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = Qtrue;
-
- for (i=0; i<RARRAY(ary)->len; i++) {
- tmp = rb_check_string_type(RARRAY(ary)->ptr[i]);
- len += NIL_P(tmp) ? 10 : RSTRING(tmp)->len;
- }
- if (!NIL_P(sep)) {
- StringValue(sep);
- len += RSTRING(sep)->len * (RARRAY(ary)->len - 1);
- }
- result = rb_str_buf_new(len);
- for (i=0; i<RARRAY(ary)->len; i++) {
- tmp = RARRAY(ary)->ptr[i];
- switch (TYPE(tmp)) {
- case T_STRING:
- break;
- case T_ARRAY:
- {
- VALUE args[2];
-
- args[0] = tmp;
- args[1] = sep;
- tmp = rb_exec_recursive(recursive_join, ary, (VALUE)args);
- }
- break;
- default:
- tmp = rb_obj_as_string(tmp);
- }
- if (i > 0 && !NIL_P(sep))
- rb_str_buf_append(result, sep);
- rb_str_buf_append(result, tmp);
- if (OBJ_TAINTED(tmp)) taint = Qtrue;
- }
-
- if (taint) OBJ_TAINT(result);
- return result;
-}
-
-/*
- * call-seq:
- * array.join(sep=$,) -> str
- *
- * Returns a string created by converting each element of the array to
- * a string, separated by <i>sep</i>.
- *
- * [ "a", "b", "c" ].join #=> "abc"
- * [ "a", "b", "c" ].join("-") #=> "a-b-c"
- */
-
-static VALUE
-rb_ary_join_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE sep;
-
- rb_scan_args(argc, argv, "01", &sep);
- if (NIL_P(sep)) sep = rb_output_fs;
-
- return rb_ary_join(ary, sep);
-}
-
-/*
- * call-seq:
- * array.to_s -> string
- *
- * Returns _self_<code>.join</code>.
- *
- * [ "a", "e", "i", "o" ].to_s #=> "aeio"
- *
- */
-
-VALUE
-rb_ary_to_s(ary)
- VALUE ary;
-{
- if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
-
- return rb_ary_join(ary, rb_output_fs);
-}
-
-static VALUE
-inspect_ary(ary, dummy, recur)
- VALUE ary;
- VALUE dummy;
- int recur;
-{
- int tainted = OBJ_TAINTED(ary);
- long i;
- VALUE s, str;
-
- if (recur) return rb_tainted_str_new2("[...]");
- str = rb_str_buf_new2("[");
- for (i=0; i<RARRAY(ary)->len; i++) {
- s = rb_inspect(RARRAY(ary)->ptr[i]);
- if (OBJ_TAINTED(s)) tainted = Qtrue;
- if (i > 0) rb_str_buf_cat2(str, ", ");
- rb_str_buf_append(str, s);
- }
- rb_str_buf_cat2(str, "]");
- if (tainted) OBJ_TAINT(str);
- return str;
-}
-
-/*
- * call-seq:
- * array.inspect -> string
- *
- * Create a printable version of <i>array</i>.
- */
-
-static VALUE
-rb_ary_inspect(ary)
- VALUE ary;
-{
- if (RARRAY(ary)->len == 0) return rb_str_new2("[]");
- return rb_exec_recursive(inspect_ary, ary, 0);
-}
-
-/*
- * call-seq:
- * array.to_a -> array
- *
- * Returns _self_. If called on a subclass of Array, converts
- * the receiver to an Array object.
- */
-
-static VALUE
-rb_ary_to_a(ary)
- VALUE ary;
-{
- if (rb_obj_class(ary) != rb_cArray) {
- VALUE dup = rb_ary_new2(RARRAY(ary)->len);
- rb_ary_replace(dup, ary);
- return dup;
- }
- return ary;
-}
-
-/*
- * call-seq:
- * array.to_ary -> array
- *
- * Returns _self_.
- */
-
-static VALUE
-rb_ary_to_ary_m(ary)
- VALUE ary;
-{
- return ary;
-}
-
-VALUE
-rb_ary_reverse(ary)
- VALUE ary;
-{
- VALUE *p1, *p2;
- VALUE tmp;
-
- rb_ary_modify(ary);
- if (RARRAY(ary)->len > 1) {
- p1 = RARRAY(ary)->ptr;
- p2 = p1 + RARRAY(ary)->len - 1; /* points last item */
-
- while (p1 < p2) {
- tmp = *p1;
- *p1++ = *p2;
- *p2-- = tmp;
- }
- }
- return ary;
-}
-
-/*
- * call-seq:
- * array.reverse! -> array
- *
- * Reverses _self_ in place.
- *
- * a = [ "a", "b", "c" ]
- * a.reverse! #=> ["c", "b", "a"]
- * a #=> ["c", "b", "a"]
- */
-
-static VALUE
-rb_ary_reverse_bang(ary)
- VALUE ary;
-{
- return rb_ary_reverse(ary);
-}
-
-/*
- * call-seq:
- * array.reverse -> an_array
- *
- * Returns a new array containing <i>self</i>'s elements in reverse order.
- *
- * [ "a", "b", "c" ].reverse #=> ["c", "b", "a"]
- * [ 1 ].reverse #=> [1]
- */
-
-static VALUE
-rb_ary_reverse_m(ary)
- VALUE ary;
-{
- return rb_ary_reverse(rb_ary_dup(ary));
-}
-
-struct ary_sort_data {
- VALUE ary;
- VALUE *ptr;
- long len;
-};
-
-static void
-ary_sort_check(data)
- struct ary_sort_data *data;
-{
- if (RARRAY(data->ary)->ptr != data->ptr || RARRAY(data->ary)->len != data->len) {
- rb_raise(rb_eRuntimeError, "array modified during sort");
- }
-}
-
-static int
-sort_1(a, b, data)
- VALUE *a, *b;
- struct ary_sort_data *data;
-{
- VALUE retval = rb_yield_values(2, *a, *b);
- int n;
-
- n = rb_cmpint(retval, *a, *b);
- ary_sort_check(data);
- return n;
-}
-
-static int
-sort_2(ap, bp, data)
- VALUE *ap, *bp;
- struct ary_sort_data *data;
-{
- VALUE retval;
- VALUE a = *ap, b = *bp;
- int n;
-
- if (FIXNUM_P(a) && FIXNUM_P(b)) {
- if ((long)a > (long)b) return 1;
- if ((long)a < (long)b) return -1;
- return 0;
- }
- if (TYPE(a) == T_STRING && TYPE(b) == T_STRING) {
- return rb_str_cmp(a, b);
- }
-
- retval = rb_funcall(a, id_cmp, 1, b);
- n = rb_cmpint(retval, a, b);
- ary_sort_check(data);
-
- return n;
-}
-
-static VALUE
-sort_internal(ary)
- VALUE ary;
-{
- struct ary_sort_data data;
-
- data.ary = ary;
- data.ptr = RARRAY(ary)->ptr; data.len = RARRAY(ary)->len;
- qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE),
- rb_block_given_p()?sort_1:sort_2, &data);
- return ary;
-}
-
-static VALUE
-sort_unlock(ary)
- VALUE ary;
-{
- FL_UNSET(ary, ARY_TMPLOCK);
- return ary;
-}
-
-/*
- * call-seq:
- * array.sort! -> array
- * array.sort! {| a,b | block } -> array
- *
- * Sorts _self_. Comparisons for
- * the sort will be done using the <code><=></code> operator or using
- * an optional code block. The block implements a comparison between
- * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
- * <code>Enumerable#sort_by</code>.
- *
- * a = [ "d", "a", "e", "c", "b" ]
- * a.sort #=> ["a", "b", "c", "d", "e"]
- * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
- */
-
-VALUE
-rb_ary_sort_bang(ary)
- VALUE ary;
-{
- rb_ary_modify(ary);
- if (RARRAY(ary)->len > 1) {
- FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during sort */
- rb_ensure(sort_internal, ary, sort_unlock, ary);
- }
- return ary;
-}
-
-/*
- * call-seq:
- * array.sort -> an_array
- * array.sort {| a,b | block } -> an_array
- *
- * Returns a new array created by sorting <i>self</i>. Comparisons for
- * the sort will be done using the <code><=></code> operator or using
- * an optional code block. The block implements a comparison between
- * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
- * <code>Enumerable#sort_by</code>.
- *
- * a = [ "d", "a", "e", "c", "b" ]
- * a.sort #=> ["a", "b", "c", "d", "e"]
- * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
- */
-
-VALUE
-rb_ary_sort(ary)
- VALUE ary;
-{
- ary = rb_ary_dup(ary);
- rb_ary_sort_bang(ary);
- return ary;
-}
-
-/*
- * call-seq:
- * array.collect {|item| block } -> an_array
- * array.map {|item| block } -> an_array
- *
- * Invokes <i>block</i> once for each element of <i>self</i>. Creates a
- * new array containing the values returned by the block.
- * See also <code>Enumerable#collect</code>.
- *
- * a = [ "a", "b", "c", "d" ]
- * a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
- * a #=> ["a", "b", "c", "d"]
- */
-
-static VALUE
-rb_ary_collect(ary)
- VALUE ary;
-{
- long i;
- VALUE collect;
-
- if (!rb_block_given_p()) {
- return rb_ary_new4(RARRAY(ary)->len, RARRAY(ary)->ptr);
- }
-
- collect = rb_ary_new2(RARRAY(ary)->len);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- rb_ary_push(collect, rb_yield(RARRAY(ary)->ptr[i]));
- }
- return collect;
-}
-
-/*
- * call-seq:
- * array.collect! {|item| block } -> array
- * array.map! {|item| block } -> array
- *
- * Invokes the block once for each element of _self_, replacing the
- * element with the value returned by _block_.
- * See also <code>Enumerable#collect</code>.
- *
- * a = [ "a", "b", "c", "d" ]
- * a.collect! {|x| x + "!" }
- * a #=> [ "a!", "b!", "c!", "d!" ]
- */
-
-static VALUE
-rb_ary_collect_bang(ary)
- VALUE ary;
-{
- long i;
-
- rb_ary_modify(ary);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- rb_ary_store(ary, i, rb_yield(RARRAY(ary)->ptr[i]));
- }
- return ary;
-}
-
-VALUE
-rb_get_values_at(obj, olen, argc, argv, func)
- VALUE obj;
- long olen;
- int argc;
- VALUE *argv;
- VALUE (*func) _((VALUE,long));
-{
- VALUE result = rb_ary_new2(argc);
- long beg, len, i, j;
-
- for (i=0; i<argc; i++) {
- if (FIXNUM_P(argv[i])) {
- rb_ary_push(result, (*func)(obj, FIX2LONG(argv[i])));
- continue;
- }
- /* check if idx is Range */
- switch (rb_range_beg_len(argv[i], &beg, &len, olen, 0)) {
- case Qfalse:
- break;
- case Qnil:
- continue;
- default:
- for (j=0; j<len; j++) {
- rb_ary_push(result, (*func)(obj, j+beg));
- }
- continue;
- }
- rb_ary_push(result, (*func)(obj, NUM2LONG(argv[i])));
- }
- return result;
-}
-
-/*
- * call-seq:
- * array.values_at(selector,... ) -> an_array
- *
- * Returns an array containing the elements in
- * _self_ corresponding to the given selector(s). The selectors
- * may be either integer indices or ranges.
- * See also <code>Array#select</code>.
- *
- * a = %w{ a b c d e f }
- * a.values_at(1, 3, 5)
- * a.values_at(1, 3, 5, 7)
- * a.values_at(-1, -3, -5, -7)
- * a.values_at(1..3, 2...5)
- */
-
-static VALUE
-rb_ary_values_at(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- return rb_get_values_at(ary, RARRAY(ary)->len, argc, argv, rb_ary_entry);
-}
-
-/*
- * call-seq:
- * array.select {|item| block } -> an_array
- *
- * Invokes the block passing in successive elements from <i>array</i>,
- * returning an array containing those elements for which the block
- * returns a true value (equivalent to <code>Enumerable#select</code>).
- *
- * a = %w{ a b c d e f }
- * a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"]
- */
-
-static VALUE
-rb_ary_select(ary)
- VALUE ary;
-{
- VALUE result;
- long i;
-
- result = rb_ary_new2(RARRAY(ary)->len);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) {
- rb_ary_push(result, rb_ary_elt(ary, i));
- }
- }
- return result;
-}
-
diff --git a/tests/examplefiles/example.ceylon b/tests/examplefiles/example.ceylon
deleted file mode 100644
index 04223c56..00000000
--- a/tests/examplefiles/example.ceylon
+++ /dev/null
@@ -1,52 +0,0 @@
-import ceylon.language { parseInteger }
-
-doc "A top-level function,
- with multi-line documentation."
-void topLevel(String? a, Integer b=5, String* seqs) {
- function nested(String s) {
- print(s[1..2]);
- return true;
- }
- for (s in seqs.filter((String x) => x.size > 2)) {
- nested(s);
- }
- value uppers = seqs.map((String x) {
- return x.uppercased;
- });
- String|Null z = a;
- {Integer+} ints = { 1, 2, 3, 4, 5 };
- value numbers = [ 1, #ffff, #ffff_ffff, $10101010, $1010_1010_1010_1010,
- 123_456_789 ];
- value chars = ['a', '\{#ffff}' ];
-}
-
-shared class Example_1<Element>(name, element) satisfies Comparable<Example_1<Element>>
- given Element satisfies Comparable<Element> {
- shared String name;
- shared Element element;
- shared [Integer,String] tuple = [1, "2"];
- shared late String lastName;
- variable Integer cnt = 0;
-
- shared Integer count => cnt;
- assign count {
- assert(count >= cnt);
- cnt = count;
- }
-
- shared actual Comparison compare(Example_1<Element> other) {
- return element <=> other.element;
- }
-
- shared actual String string {
- return "Example with ``element.string``";
- }
-}
-
-Example_1<Integer> instance = Example_1 {
- element = 5;
- name = "Named args call \{#0060}";
-};
-
-object example1 extends Example_1<Integer>("object", 5) {
-} \ No newline at end of file
diff --git a/tests/examplefiles/example.chai b/tests/examplefiles/example.chai
deleted file mode 100644
index 85f53c38..00000000
--- a/tests/examplefiles/example.chai
+++ /dev/null
@@ -1,6 +0,0 @@
-var f = fun(x) { x + 2; }
-// comment
-puts(someFunc(2 + 2 - 1 * 5 / 4));
-var x = "str";
-def dosomething(lhs, rhs) { print("lhs: ${lhs}, rhs: ${rhs}"); }
-callfunc(`+`, 1, 4);
diff --git a/tests/examplefiles/example.clay b/tests/examplefiles/example.clay
deleted file mode 100644
index 784752c6..00000000
--- a/tests/examplefiles/example.clay
+++ /dev/null
@@ -1,33 +0,0 @@
-
-/// @section StringLiteralRef
-
-record StringLiteralRef (
- sizep : Pointer[SizeT],
-);
-
-
-/// @section predicates
-
-overload ContiguousSequence?(#StringLiteralRef) : Bool = true;
-[s when StringLiteral?(s)]
-overload ContiguousSequence?(#Static[s]) : Bool = true;
-
-
-
-/// @section size, begin, end, index
-
-forceinline overload size(a:StringLiteralRef) = a.sizep^;
-
-forceinline overload begin(a:StringLiteralRef) : Pointer[Char] = Pointer[Char](a.sizep + 1);
-forceinline overload end(a:StringLiteralRef) = begin(a) + size(a);
-
-[I when Integer?(I)]
-forceinline overload index(a:StringLiteralRef, i:I) : ByRef[Char] {
- assert["boundsChecks"](i >= 0 and i < size(a), "StringLiteralRef index out of bounds");
- return ref (begin(a) + i)^;
-}
-
-foo() = """
-long\tlong
-story
-"""
diff --git a/tests/examplefiles/example.cls b/tests/examplefiles/example.cls
deleted file mode 100644
index d36ad6f0..00000000
--- a/tests/examplefiles/example.cls
+++ /dev/null
@@ -1,15 +0,0 @@
-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.cob b/tests/examplefiles/example.cob
deleted file mode 100644
index 92d2e300..00000000
--- a/tests/examplefiles/example.cob
+++ /dev/null
@@ -1,2620 +0,0 @@
- IDENTIFICATION DIVISION.
- PROGRAM-ID. OCic.
- *****************************************************************
- ** This program provides a Textual User Interface (TUI) to the **
- ** process of compiling and (optionally) executing an OpenCOBOL**
- ** program. **
- ** **
- ** This programs execution syntax is as follows: **
- ** **
- ** ocic <program-path-and-filename> [ <switch>... ] **
- ** **
- ** Once executed, a display screen will be presented showing **
- ** the compilation options that will be used. The user will **
- ** have the opportunity to change options, specify new ones **
- ** and specify any program execution arguments to be used if **
- ** you select the "Execute" option. When you press the Enter **
- ** key the program will be compiled. **
- ** **
- ** The SCREEN SECTION contains an image of the screen. **
- ** **
- ** The "010-Parse-Args" section in the PROCEDURE DIVISION has **
- ** documentation on switches and their function. **
- *****************************************************************
- ** **
- ** AUTHOR: GARY L. CUTLER **
- ** CutlerGL@gmail.com **
- ** Copyright (C) 2009-2010, Gary L. Cutler, GPL **
- ** **
- ** DATE-WRITTEN: June 14, 2009 **
- ** **
- *****************************************************************
- ** Note: Depending on which extended DISPLAY handler you're **
- ** using (PDCurses, Curses, ...), you may need to un- **
- ** comment any source lines tagged with "SCROLL" in cols **
- ** 1-6 in order to have error messages scroll properly **
- ** in the OCic shell window. **
- *****************************************************************
- ** DATE CHANGE DESCRIPTION **
- ** ====== ==================================================== **
- ** GC0609 Don't display compiler messages file if compilation **
- ** Is successful. Also don't display messages if the **
- ** output file is busy (just put a message on the **
- ** screen, leave the OC screen up & let the user fix **
- ** the problem & resubmit. **
- ** GC0709 When 'EXECUTE' is selected, a 'FILE BUSY' error will **
- ** still cause the (old) executable to be launched. **
- ** Also, the 'EXTRA SWITCHES' field is being ignored. **
- ** Changed the title bar to lowlighted reverse video & **
- ** the message area to highlighted reverse-video. **
- ** GC0809 Add a SPACE in from of command-line args when **
- ** executing users program. Add a SPACE after the **
- ** -ftraceall switch when building cobc command. **
- ** GC0909 Convert to work on Cygwin/Linux as well as MinGW **
- ** GC0310 Virtualized the key codes for S-F1 thru S-F7 as they **
- ** differ depending upon whether PDCurses or NCurses is **
- ** being used. **
- ** GC0410 Introduced the cross-reference and source listing **
- ** features. Also fixed a bug in @EXTRA switch proces- **
- ** sing where garbage will result if more than the **
- ** @EXTRA switch is specified. **
- *****************************************************************
- ENVIRONMENT DIVISION.
- CONFIGURATION SECTION.
- REPOSITORY.
- FUNCTION ALL INTRINSIC.
- INPUT-OUTPUT SECTION.
- FILE-CONTROL.
- SELECT Bat-File ASSIGN TO Bat-File-Name
- ORGANIZATION IS LINE SEQUENTIAL.
-
- SELECT Cobc-Output ASSIGN TO Cobc-Output-File
- ORGANIZATION IS LINE SEQUENTIAL.
-
- SELECT Source-Code ASSIGN TO File-Name
- ORGANIZATION IS LINE SEQUENTIAL
- FILE STATUS IS FSM-Status.
- DATA DIVISION.
- FILE SECTION.
- FD Bat-File.
- 01 Bat-File-Rec PIC X(2048).
-
- FD Cobc-Output.
- 01 Cobc-Output-Rec PIC X(256).
-
- FD Source-Code.
- 01 Source-Code-Record PIC X(80).
-
- WORKING-STORAGE SECTION.
- COPY screenio.
-
- 01 Bat-File-Name PIC X(256).
-
-GC0909 01 Cmd PIC X(512).
-
- 01 Cobc-Cmd PIC X(256).
-
- 01 Cobc-Output-File PIC X(256).
-
- 01 Command-Line-Args PIC X(256).
-
- 01 Config-File PIC X(12).
-
-GC0310 01 Config-Keys.
-GC0310 05 CK-S-F1 PIC 9(4).
-GC0310 05 CK-S-F2 PIC 9(4).
-GC0310 05 CK-S-F3 PIC 9(4).
-GC0310 05 CK-S-F4 PIC 9(4).
-GC0310 05 CK-S-F5 PIC 9(4).
-GC0310 05 CK-S-F6 PIC 9(4).
-GC0310 05 CK-S-F7 PIC 9(4).
-
-GC0909 01 Dir-Char PIC X(1).
-
- 01 Dummy PIC X(1).
-
- 01 Env-TEMP PIC X(256).
-
- 01 File-Name.
- 05 FN-Char OCCURS 256 TIMES PIC X(1).
-
- 01 File-Status-Message.
- 05 FILLER PIC X(13) VALUE 'Status Code: '.
- 05 FSM-Status PIC 9(2).
- 05 FILLER PIC X(11) VALUE ', Meaning: '.
- 05 FSM-Msg PIC X(25).
-
- 01 Flags.
- 05 F-Compilation-Succeeded PIC X(1).
- 88 88-Compile-OK VALUE 'Y'.
-GC0909 88 88-Compile-OK-Warn VALUE 'W'.
- 88 88-Compile-Failed VALUE 'N'.
-GC0609 05 F-Complete PIC X(1).
-GC0609 88 88-Complete VALUE 'Y'.
-GC0609 88 88-Not-Complete VALUE 'N'.
-GC0809 05 F-IDENT-DIVISION PIC X(1).
-GC0809 88 88-1st-Prog-Complete VALUE 'Y'.
-GC0809 88 88-More-To-1st-Prog VALUE 'N'.
- 05 F-LINKAGE-SECTION PIC X(1).
- 88 88-Compile-As-Subpgm VALUE 'Y'.
- 88 88-Compile-As-Mainpgm VALUE 'N'.
- 05 F-No-Switch-Changes PIC X(1).
- 88 88-No-Switch-Changes VALUE 'Y'.
- 88 88-Switch-Changes VALUE 'N'.
-GC0709 05 F-Output-File-Busy PIC X(1).
-GC0709 88 88-Output-File-Busy VALUE 'Y'.
-GC0709 88 88-Output-File-Avail VALUE 'N'.
-GC0809 05 F-Source-Record-Type PIC X(1).
-GC0809 88 88-Source-Rec-Linkage VALUE 'L'.
-GC0809 88 88-Source-Rec-Ident VALUE 'I'.
-GC0809 88 88-Source-Rec-IgnoCOB-COLOR-RED VALUE ' '.
- 05 F-Switch-Error PIC X(1).
- 88 88-Switch-Is-Bad VALUE 'Y'.
- 88 88-Switch-Is-Good VALUE 'N'.
-
-GC0909 01 Horizontal-Line PIC X(80).
-GC0909
- 01 I USAGE BINARY-LONG.
-
- 01 J USAGE BINARY-LONG.
-
-GC0909 01 MS USAGE BINARY-LONG.
-
-GC0909 01 ML USAGE BINARY-LONG.
-
- 01 OC-Compiled PIC XXXX/XX/XXBXX/XX.
-
-GC0909 01 OS-Type USAGE BINARY-LONG.
-GC0909 88 OS-Unknown VALUE 0.
-GC0909 88 OS-Windows VALUE 1.
-GC0909 88 OS-Cygwin VALUE 2.
-GC0909 88 OS-UNIX VALUE 3.
-
-GC0909 01 OS-Type-Literal PIC X(7).
-
- 01 Output-Message PIC X(80).
-
- 01 Path-Delimiter PIC X(1).
-
- 01 Prog-Folder PIC X(256).
-
- 01 Prog-Extension PIC X(30).
-
- 01 Prog-File-Name PIC X(40).
-
- 01 Prog-Name PIC X(31).
-
- 78 Selection-Char VALUE '>'.
-
- 01 Switch-Display.
- 05 SD-Switch-And-Value PIC X(19).
- 05 FILLER PIC X(1).
- 05 SD-Description PIC X(60).
-
- 01 Switch-Keyword PIC X(12).
-GC0410 88 Switch-Is-CONFIG VALUE '@CONFIG', '@C'.
-GC0410 88 Switch-Is-DEBUG VALUE '@DEBUG', '@D'.
-GC0410 88 Switch-Is-DLL VALUE '@DLL'.
-GC0410 88 Switch-Is-EXECUTE VALUE '@EXECUTE', '@E'.
-GC0410 88 Switch-Is-EXTRA VALUE '@EXTRA', '@EX'.
-GC0410 88 Switch-Is-NOTRUNC VALUE '@NOTRUNC', '@N'.
-GC0410 88 Switch-Is-TRACE VALUE '@TRACE', '@T'.
-GC0410 88 Switch-Is-SOURCE VALUE '@SOURCE', '@S'.
-GC0410 88 Switch-Is-XREF VALUE '@XREF', '@X'.
-
- 01 Switch-Keyword-And-Value PIC X(256).
-
- 01 Switch-Value.
- 05 SV-1 PIC X(1).
- 05 FILLER PIC X(255).
- 01 Switch-Value-Alt REDEFINES Switch-Value
- PIC X(256).
- 88 Valid-Config-Filename
- VALUE 'BS2000', 'COBOL85', 'COBOL2002', 'DEFAULT',
- 'IBM', 'MF', 'MVS'.
-
- 01 Switches.
- 05 S-ARGS PIC X(75) VALUE SPACES.
- 05 S-CfgS.
- 10 S-Cfg-BS2000 PIC X(1) VALUE ' '.
- 10 S-Cfg-COBOL85 PIC X(1) VALUE ' '.
- 10 S-Cfg-COBOL2002 PIC X(1) VALUE ' '.
- 10 S-Cfg-DEFAULT PIC X(1) VALUE Selection-Char.
- 10 S-Cfg-IBM PIC X(1) VALUE ' '.
- 10 S-Cfg-MF PIC X(1) VALUE ' '.
- 10 S-Cfg-MVS PIC X(1) VALUE ' '.
- 05 S-EXTRA PIC X(75) VALUE SPACES.
- 05 S-Yes-No-Switches.
- 10 S-DEBUG PIC X(1) VALUE 'N'.
- 10 S-DLL PIC X(1) VALUE 'N'.
-GC0410 10 S-XREF PIC X(1) VALUE 'N'.
-GC0410 10 S-SOURCE PIC X(1) VALUE 'N'.
- 10 S-EXECUTE PIC X(1) VALUE 'N'.
- 10 S-NOTRUNC PIC X(1) VALUE 'Y'.
- 10 S-SUBROUTINE PIC X(1) VALUE 'A'.
- 10 S-TRACE PIC X(1) VALUE 'N'.
- 10 S-TRACEALL PIC X(1) VALUE 'N'.
-
- 01 Tally USAGE BINARY-LONG.
-
- SCREEN SECTION.
- *>
- *> Here is the layout of the OCic screen.
- *>
- *> Note that this program can utilize the traditional PC line-drawing characters,
- *> if they are available.
- *>
- *> If this program is run on Windows, it must run with codepage 437 activated to
- *> display the line-drawing characters. With a native Windows build or a
- *> Windows/MinGW build, one could use the command "chcp 437" to set that codepage
- *> for display within a Windows console window (that should be the default, though).
- *> With a Windows/Cygwin build, set the environment variable CYGWIN to a value of
- *> "codepage:oem" (this cannot be done from within the program though - you will
- *> have to use the "Computer/Advanced System Settings/Environment Variables" (Vista or
- *> Windows 7) function to define the variable. XP Users: use "My Computer/Properties/
- *> Advanced/Environment Variables".
- *>
- *> To use OCic without the line-drawing characters, comment-out the first set of
- *> 78 "LD" items and uncomment the second.
- *>
- *> The following sample screen layout shows how the screen looks with line-drawing
- *> characters disabled.
- *>
- *>===================================================================================
- *> OCic (2010/04/02 11:36) - OpenCOBOL V1.1 Interactive Compilation Windows 01
- *> +-----------------------------------------------------------------------------+ 02
- *> | Program: OCic F-Key: Select Opt | 03
- *> | Folder: E:\OpenCOBOL\Samples Enter: Compile | 04
- *> | Filename: OCic.cbl Esc: Quit | 05
- *> +-----------------------------------------------------------------------------+ 06
- *> On/Off Switches: Configuration: 07
- *> +---------------------------------------------------------+-------------------+ 08
- *> | F1 Compile debug lines F8 Produce source listing | S-F1 BS2000 | 09
- *> | F2 Always make DLLs F9 Produce xref listing | S-F2 COBOL85 | 10
- *> | F3 Pgm is a SUBROUTINE | S-F3 COBOL2002 | 11
- *> | F4 Execute if compile OK | S-F4 > Default | 12
- *> | F5 > No COMP/BINARY trunc | S-F5 IBM | 13
- *> | F6 Trace procedures | S-F6 MicroFocus | 14
- *> | F7 Trace proc + stmnts | S-F7 MVS | 15
- *> +---------------------------------------------------------+-------------------+ 16
- *> Additional "cobc" Switches (if any): 17
- *> +-----------------------------------------------------------------------------+ 18
- *> | -O2________________________________________________________________________ | 19
- *> +-----------------------------------------------------------------------------+ 20
- *> Program Execution Arguments (if any): 21
- *> +-----------------------------------------------------------------------------+ 22
- *> | ___________________________________________________________________________ | 23
- *> +-----------------------------------------------------------------------------+ 24
- *> OCic Copyright (C) 2009-2010, Gary L. Cutler, GPL 25
- *>===================================================================================
- *>12345678901234567890123456789012345678901234567890123456789012345678901234567890
- *> 1 2 3 4 5 6 7 8
- *>
- *> USE THESE CHARS FOR LINE-DRAWING IF YOU HAVE ACCESS TO PC-DOS CODEPAGE 437:
- *>
- 78 LD-UL-Corner VALUE X"DA".
- 78 LD-LL-Corner VALUE X"C0".
- 78 LD-UR-Corner VALUE X"BF".
- 78 LD-LR-Corner VALUE X"D9".
- 78 LD-Upper-T VALUE X"C2".
- 78 LD-Lower-T VALUE X"C1".
- 78 LD-Horiz-Line VALUE X"C4".
- 78 LD-Vert-Line VALUE X"B3".
- *>
- *> USE THESE CHARS FOR LINE-DRAWING IF YOU DO NOT HAVE ACCESS TO PC-DOS CODEPAGE 437:
- *>
- *> 78 LD-UL-Corner VALUE '+'.
- *> 78 LD-LL-Corner VALUE '+'.
- *> 78 LD-UR-Corner VALUE '+'.
- *> 78 LD-LR-Corner VALUE '+'.
- *> 78 LD-Upper-T VALUE '+'.
- *> 78 LD-Lower-T VALUE '+'.
- *> 78 LD-Horiz-Line VALUE '-'.
- *> 78 LD-Vert-Line VALUE '|'.
- *>
- 01 Blank-Screen LINE 1 COLUMN 1 BLANK SCREEN.
-
- 01 Switches-Screen BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-WHITE AUTO.
- *>
- *> GENERAL SCREEN FRAMEWORK
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-BLUE HIGHLIGHT.
- 05 LINE 02 COL 02 VALUE LD-UL-Corner.
- 05 PIC X(77) FROM Horizontal-Line.
- 05 COL 80 VALUE LD-UR-Corner.
-
- 05 LINE 03 COL 02 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 04 COL 02 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 05 COL 02 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 06 COL 02 VALUE LD-LL-Corner.
- 05 PIC X(77) FROM Horizontal-Line.
- 05 COL 80 VALUE LD-LR-Corner.
-
- 05 LINE 08 COL 02 VALUE LD-UL-Corner.
- 05 PIC X(57) FROM Horizontal-Line.
- 05 COL 60 VALUE LD-Upper-T.
- 05 PIC X(19) FROM Horizontal-Line.
- 05 COL 80 VALUE LD-UR-Corner.
-
- 05 LINE 09 COL 02 VALUE LD-Vert-Line.
- 05 COL 60 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 10 COL 02 VALUE LD-Vert-Line.
- 05 COL 60 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 11 COL 02 VALUE LD-Vert-Line.
- 05 COL 60 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 12 COL 02 VALUE LD-Vert-Line.
- 05 COL 60 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 13 COL 02 VALUE LD-Vert-Line.
- 05 COL 60 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 14 COL 02 VALUE LD-Vert-Line.
- 05 COL 60 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 15 COL 02 VALUE LD-Vert-Line.
- 05 COL 60 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 16 COL 02 VALUE LD-LL-Corner.
- 05 PIC X(57) FROM Horizontal-Line.
- 05 COL 60 VALUE LD-Lower-T.
- 05 PIC X(19) FROM Horizontal-Line.
- 05 COL 80 VALUE LD-LR-Corner.
-
- 05 LINE 18 COL 02 VALUE LD-UL-Corner.
- 05 PIC X(77) FROM Horizontal-Line.
- 05 COL 80 VALUE LD-UR-Corner.
-
- 05 LINE 19 COL 02 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 20 COL 02 VALUE LD-LL-Corner.
- 05 PIC X(77) FROM Horizontal-Line.
- 05 COL 80 VALUE LD-LR-Corner.
-
- 05 LINE 22 COL 02 VALUE LD-UL-Corner.
- 05 PIC X(77) FROM Horizontal-Line.
- 05 COL 80 VALUE LD-UR-Corner.
-
- 05 LINE 23 COL 02 VALUE LD-Vert-Line.
- 05 COL 80 VALUE LD-Vert-Line.
-
- 05 LINE 24 COL 02 VALUE LD-LL-Corner.
- 05 PIC X(77) FROM Horizontal-Line.
- 05 COL 80 VALUE LD-LR-Corner.
- *>
- *> TOP AND BOTTOM LINES
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLUE BLINK
- FOREGROUND-COLOR COB-COLOR-WHITE HIGHLIGHT.
-GC0410 05 LINE 01 COL 01 VALUE ' OCic ('.
-GC0410 05 PIC X(16) FROM OC-Compiled.
-GC0410 05 VALUE ') OpenCOBOL V1.1 06FEB2009 ' &
-GC0410 'Interactive Compilation '.
-GC0410 05 LINE 25 COL 01 PIC X(81) FROM Output-Message.
- *>
- *> LABELS
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-CYAN HIGHLIGHT.
- 05 LINE 07 COL 04 VALUE 'On/Off Switches:'.
- 05 COL 62 VALUE 'Configuration:'.
- 05 LINE 17 COL 04 VALUE 'Additional "cobc" Switches (if any
- - '):'.
- 05 LINE 21 COL 04 VALUE 'Program Execution Arguments (if an
- - 'y):'.
- *>
- *> TOP SECTION BACKGROUND
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-CYAN LOWLIGHT.
- 05 LINE 03 COL 04 VALUE 'Program: '.
- 05 LINE 04 COL 04 VALUE 'Folder: '.
- 05 LINE 05 COL 04 VALUE 'Filename: '.
-
- 05 LINE 03 COL 62 VALUE 'F-Key: Select Opt'.
- 05 LINE 04 COL 62 VALUE 'Enter: Compile '.
- 05 LINE 05 COL 62 VALUE 'Esc: Quit '.
- *>
- *> TOP SECTION PROGRAM INFO
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-WHITE HIGHLIGHT.
- 05 LINE 03 COL 14 PIC X(47) FROM Prog-Name.
- 05 LINE 04 COL 14 PIC X(47) FROM Prog-Folder.
- 05 LINE 05 COL 14 PIC X(47) FROM Prog-File-Name.
- *>
- *> MIDDLE LEFT SECTION F-KEYS
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-WHITE HIGHLIGHT.
- 05 LINE 09 COL 04 VALUE 'F1'.
- 05 LINE 10 COL 04 VALUE 'F2'.
- 05 LINE 11 COL 04 VALUE 'F3'.
- 05 LINE 12 COL 04 VALUE 'F4'.
- 05 LINE 13 COL 04 VALUE 'F5'.
- 05 LINE 14 COL 04 VALUE 'F6'.
- 05 LINE 15 COL 04 VALUE 'F7'.
- 05 LINE 09 COL 32 VALUE 'F8'.
- 05 LINE 10 COL 32 VALUE 'F9'.
- *>
- *> MIDDLE LEFT SECTION SWITCHES
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-RED HIGHLIGHT.
- 05 LINE 09 COL 07 PIC X(1) FROM S-DEBUG.
- 05 LINE 10 COL 07 PIC X(1) FROM S-DLL.
- 05 LINE 11 COL 07 PIC X(1) FROM S-SUBROUTINE.
- 05 LINE 12 COL 07 PIC X(1) FROM S-EXECUTE.
- 05 LINE 13 COL 07 PIC X(1) FROM S-NOTRUNC.
- 05 LINE 14 COL 07 PIC X(1) FROM S-TRACE.
- 05 LINE 15 COL 07 PIC X(1) FROM S-TRACEALL.
- 05 LINE 09 COL 35 PIC X(1) FROM S-SOURCE.
- 05 LINE 10 COL 35 PIC X(1) FROM S-XREF.
- *>
- *> MIDDLE LEFT SECTION BACKGROUND
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-CYAN LOWLIGHT.
- 05 LINE 09 COL 09 VALUE 'Compile debug lines '.
- 05 LINE 10 COL 09 VALUE 'Always make DLLs '.
- 05 LINE 11 COL 09 VALUE 'Pgm is a SUBROUTINE '.
- 05 LINE 12 COL 09 VALUE 'Execute if compile OK '.
- 05 LINE 13 COL 09 VALUE 'No COMP/BINARY trunc '.
- 05 LINE 14 COL 09 VALUE 'Trace procedures '.
- 05 LINE 15 COL 09 VALUE 'Trace proc + stmnts '.
- 05 LINE 09 COL 37 VALUE 'Produce source listing'.
- 05 LINE 10 COL 37 VALUE 'Produce xref listing '.
- *>
- *> MIDDLE RIGHT SECTION F-KEYS
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-WHITE HIGHLIGHT.
- 05 LINE 09 COL 62 VALUE 'S-F1'.
- 05 LINE 10 COL 62 VALUE 'S-F2'.
- 05 LINE 11 COL 62 VALUE 'S-F3'.
- 05 LINE 12 COL 62 VALUE 'S-F4'.
- 05 LINE 13 COL 62 VALUE 'S-F5'.
- 05 LINE 14 COL 62 VALUE 'S-F6'.
- 05 LINE 15 COL 62 VALUE 'S-F7'.
- *>
- *> MIDDLE RIGHT SECTION SWITCHES
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-RED HIGHLIGHT.
- 05 LINE 09 COL 67 PIC X(1) FROM S-Cfg-BS2000.
- 05 LINE 10 COL 67 PIC X(1) FROM S-Cfg-COBOL85.
- 05 LINE 11 COL 67 PIC X(1) FROM S-Cfg-COBOL2002.
- 05 LINE 12 COL 67 PIC X(1) FROM S-Cfg-DEFAULT.
- 05 LINE 13 COL 67 PIC X(1) FROM S-Cfg-IBM.
- 05 LINE 14 COL 67 PIC X(1) FROM S-Cfg-MF.
- 05 LINE 15 COL 67 PIC X(1) FROM S-Cfg-MVS.
- *>
- *> MIDDLE RIGHT SECTION BACKGROUND
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-CYAN LOWLIGHT.
- 05 LINE 09 COL 69 VALUE 'BS2000 '.
- 05 LINE 10 COL 69 VALUE 'COBOL85 '.
- 05 LINE 11 COL 69 VALUE 'COBOL2002 '.
- 05 LINE 12 COL 69 VALUE 'Default '.
- 05 LINE 13 COL 69 VALUE 'IBM '.
- 05 LINE 14 COL 69 VALUE 'MicroFocus'.
- 05 LINE 15 COL 69 VALUE 'MVS '.
- *>
- *> FREE-FORM OPTIONS FIELDS
- *>
- 03 BACKGROUND-COLOR COB-COLOR-BLACK
- FOREGROUND-COLOR COB-COLOR-WHITE HIGHLIGHT.
- 05 LINE 19 COL 04 PIC X(75) USING S-EXTRA.
- 05 LINE 23 COL 04 PIC X(75) USING S-ARGS.
- /
- PROCEDURE DIVISION.
- *****************************************************************
- ** Legend to procedure names: **
- ** **
- ** 00x-xxx All MAIN driver procedures **
- ** 0xx-xxx All GLOBAL UTILITY procedures **
- ** 1xx-xxx All INITIALIZATION procedures **
- ** 2xx-xxx All CORE PROCESSING procedures **
- ** 9xx-xxx All TERMINATION procedures **
- *****************************************************************
- DECLARATIVES.
- 000-File-Error SECTION.
- USE AFTER STANDARD ERROR PROCEDURE ON Source-Code.
- 000-Handle-Error.
- COPY FileStat-Msgs
- REPLACING STATUS BY FSM-Status
- MSG BY FSM-Msg.
- MOVE SPACES TO Output-Message
- IF FSM-Status = 35
- DISPLAY
- 'File not found: "'
- TRIM(File-Name,TRAILING)
- '"'
- END-DISPLAY
- ELSE
- DISPLAY
- 'Error accessing file: "'
- TRIM(File-Name,TRAILING)
- '"'
- END-DISPLAY
- END-IF
- GOBACK
- .
- END DECLARATIVES.
- /
- 000-Main SECTION.
-
- PERFORM 100-Initialization
-GC0609 SET 88-Not-Complete TO TRUE
-GC0609 PERFORM UNTIL 88-Complete
-GC0609 PERFORM 200-Let-User-Set-Switches
-GC0609 PERFORM 210-Run-Compiler
-GC0410 IF (88-Compile-OK OR 88-Compile-OK-Warn)
-GC0410 AND (S-XREF NOT = SPACE OR S-SOURCE NOT = SPACE)
-GC0410 PERFORM 220-Make-Listing
-GC0410 END-IF
-GC0709 IF (S-EXECUTE NOT = SPACES)
-GC0709 AND (88-Output-File-Avail)
-GC0609 PERFORM 230-Run-Program
-GC0609 END-IF
-GC0609 END-PERFORM
- .
-
- 009-Done.
- PERFORM 900-Terminate
- .
- * -- Control will NOT return
- /
- 010-Parse-Args SECTION.
- *****************************************************************
- ** Process a sequence of KEYWORD=VALUE items. These are items **
- ** specified on the command-line to provide the initial **
- ** options shown selected on the screen. When integrating **
- ** OCic into an edirot or framework, include these switches on **
- ** the ocic.exe command the editor/framework executes. Any **
- ** underlined choice is the default value for that switch. **
- ** **
- ** @CONFIG=BS2000|COBOL85|COBOL2002|DEFAULT|IBM|MF|MVS **
- ** ======= **
- ** This switch specifies the default cobc compiler configura- **
- ** tion file to be used **
- ** **
- ** @DEBUG=YES|NO **
- ** == **
- ** This switch specifies whether (YES) or not (NO) debugging **
- ** lines (those with a "D" in column 7) will be compiled. **
- ** **
- ** @DLL=YES|NO **
- ** == **
- ** Use this switch to force ALL compiled programs to be built **
- ** as DLLs ("@DLL=YES"). When main programs are built as DLLs **
- ** they must be executed using the cobcrun utility. When **
- ** "@DLL=NO" is in effect, main programs are generated as **
- ** actual "exe" files and only subprograms will be generated **
- ** as DLLs. **
- ** **
- ** @EXECUTE=YES|NO **
- ** == **
- ** This switch specifies whether ("@EXECUTE=YES") or not **
- ** ("@EXECUTE=NO") the program will be executed after it is **
- ** successfully compiled. **
- ** **
- ** @EXTRA=extra cobc argument(s) **
- ** **
- ** This switch allows you to specify additional cobc arguments **
- ** that aren't managed by the other OC switches. If used, **
- ** this must be the last switch specified on the command line, **
- ** as everything that follows the "=" will be placed on the **
- ** cobc command generated by OC. **
- ** **
- ** @NOTRUNC=YES|NO **
- ** === **
- ** This switch specifies whether (YES) or not (NO) the sup- **
- ** pression of binary field truncation will occur. If a PIC **
- ** 99 COMP field (one byte of storage), for example, is given **
- ** the value 123, it may have its value truncated to 23 when **
- ** DISPLAYed. Regardless of the NOTRUNC setting, internally **
- ** the full precision of the field (allowing a maximum value **
- ** of 255) will be preserved. Even though truncation - if it **
- ** does occur - would appear to have a minimal disruption on **
- ** program operation, it has a significant effect on program **
- ** run-time speed. **
- ** **
- ** @TRACE=YES|NO|ALL **
- ** == **
- ** This switch controls whether or not code will be added to **
- ** the object program to produce execution-time logic traces. **
- ** A specification of "@TRACE=NO" means no such code will be **
- ** produced. By specifying "@TRACE=YES", code will be genera- **
- ** ted to display procedure names as they are entered. A **
- ** "@TRACE=ALL" specification will generate not only procedure **
- ** traces (as "@TRACE=YES" would) but also statement-level **
- ** traces too! All trace output is written to STDERR, so **
- ** adding a "2>file" to the execution of the program will pipe **
- ** the trace output to a file. You may find it valuable to **
- ** add your own DISPLAY statements to the debugging output via **
- ** "DISPLAY xx UPON SYSERR" The SYSERR device corresponds to **
- ** the Windows or UNIX STDERR device and will therefore honor **
- ** any "2>file" placed at the end of your program's execution. **
- ** Add a "D" in column 7 and you can control the generation or **
- ** ignoring of these DISPLAY statements via the "@DEBUG" **
- ** switch. **
- ** **
-GC0410** @SOURCE=YES|NO **
-GC0410** == **
-GC0410** Use this switch to produce a source listing of the program, **
-GC0410** PROVIDED it compiles without errors. **
- ** **
-GC0410** @XREF=YES|NO **
-GC0410** == **
-GC0410** Use this switch to produce a cross-reference listing of the **
-GC0410** program, PROVIDED it compiles without errors. **
- *****************************************************************
-
- 011-Init.
- MOVE 1 TO I
- .
-
- 012-Extract-Kwd-And-Value.
- PERFORM UNTIL I NOT < LENGTH(Command-Line-Args)
- MOVE I TO J
- UNSTRING Command-Line-Args
- DELIMITED BY ALL SPACES
- INTO Switch-Keyword-And-Value
- WITH POINTER I
- END-UNSTRING
- IF Switch-Keyword-And-Value NOT = SPACES
- UNSTRING Switch-Keyword-And-Value
- DELIMITED BY '='
- INTO Switch-Keyword, Switch-Value
- END-UNSTRING
- PERFORM 030-Process-Keyword
- END-IF
- END-PERFORM
- .
-
- 019-Done.
- EXIT.
-
- *****************************************************************
- ** Since this program uses the SCREEN SECTION, it cannot do **
- ** conventional console DISPLAY operations. This routine **
- ** (which, I admit, is like using an H-bomb to hunt rabbits) **
- ** will submit an "ECHO" command to the system to simulate a **
- ** DISPLAY. **
- *****************************************************************
- 021-Build-And-Issue-Command.
- DISPLAY
- Output-Message
- END-DISPLAY
- .
-
- 029-Done.
- EXIT.
- /
- 030-Process-Keyword SECTION.
- *****************************************************************
- ** Process a single KEYWORD=VALUE item. **
- *****************************************************************
-
- 031-Init.
- MOVE UPPER-CASE(Switch-Keyword) TO Switch-Keyword
- SET 88-Switch-Is-Good TO TRUE
- .
-
- 032-Process.
- EVALUATE TRUE
- WHEN Switch-Is-EXTRA
-GC0410 MOVE J TO I
- UNSTRING Command-Line-Args DELIMITED BY '='
- INTO Dummy, S-EXTRA
-GC0410 WITH POINTER I
-GC0410 END-UNSTRING
- MOVE LENGTH(Command-Line-Args) TO I
- WHEN Switch-Is-CONFIG
- MOVE 'CONFIG' TO Switch-Keyword
- MOVE UPPER-CASE(Switch-Value)
- TO Switch-Value
- EVALUATE Switch-Value
- WHEN 'BS2000'
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-BS2000
- WHEN 'COBOL85'
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-COBOL85
- WHEN 'COBOL2002'
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-COBOL2002
- WHEN 'DEFAULT'
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-DEFAULT
- WHEN 'IBM'
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-IBM
- WHEN 'MF'
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-MF
- WHEN 'MVS'
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-MVS
- WHEN OTHER
- MOVE 'An invalid /CONFIG switch value ' &
- 'was specified on the command line ' &
- '- ignored'
- TO Output-Message
- END-EVALUATE
- WHEN Switch-Is-DEBUG
- MOVE 'DEBUG' TO Switch-Keyword
- MOVE UPPER-CASE(Switch-Value)
- TO Switch-Value
- PERFORM 040-Process-Yes-No-Value
- IF 88-Switch-Is-Good
- MOVE SV-1 TO S-DEBUG
- END-IF
-GC0410 WHEN Switch-Is-DLL
-GC0410 MOVE 'DLL' TO Switch-Keyword
-GC0410 MOVE UPPER-CASE(Switch-Value)
-GC0410 TO Switch-Value
-GC0410 PERFORM 040-Process-Yes-No-Value
-GC0410 IF 88-Switch-Is-Good
-GC0410 MOVE SV-1 TO S-DLL
-GC0410 END-IF
- WHEN Switch-Is-EXECUTE
- MOVE 'EXECUTE' TO Switch-Keyword
- MOVE UPPER-CASE(Switch-Value)
- TO Switch-Value
- PERFORM 040-Process-Yes-No-Value
- IF 88-Switch-Is-Good
- MOVE SV-1 TO S-EXECUTE
- END-IF
- WHEN Switch-Is-NOTRUNC
- MOVE 'NOTRUNC' TO Switch-Keyword
- MOVE UPPER-CASE(Switch-Value)
- TO Switch-Value
- PERFORM 040-Process-Yes-No-Value
- IF 88-Switch-Is-Good
- MOVE SV-1 TO S-NOTRUNC
- END-IF
-GC0410 WHEN Switch-Is-SOURCE
-GC0410 MOVE 'SOURCE' TO Switch-Keyword
-GC0410 MOVE UPPER-CASE(Switch-Value)
-GC0410 TO Switch-Value
-GC0410 PERFORM 050-Process-Yes-No-All
-GC0410 IF 88-Switch-Is-Good
-GC0410 MOVE SV-1 TO S-SOURCE
-GC0410 END-IF
- WHEN Switch-Is-TRACE
- MOVE 'TRACE' TO Switch-Keyword
- MOVE UPPER-CASE(Switch-Value)
- TO Switch-Value
- PERFORM 050-Process-Yes-No-All
- IF 88-Switch-Is-Good
- MOVE SV-1 TO S-TRACE
- END-IF
-GC0410 WHEN Switch-Is-XREF
-GC0410 MOVE 'XREF' TO Switch-Keyword
-GC0410 MOVE UPPER-CASE(Switch-Value)
-GC0410 TO Switch-Value
-GC0410 PERFORM 050-Process-Yes-No-All
-GC0410 IF 88-Switch-Is-Good
-GC0410 MOVE SV-1 TO S-XREF
-GC0410 END-IF
- WHEN OTHER
- MOVE SPACES TO Output-Message
- STRING '"'
- TRIM(Switch-Keyword)
- '" is not a valid switch ' &
- '- ignored'
- DELIMITED SIZE
- INTO Output-Message
- END-STRING
- SET 88-Switch-Is-Bad TO TRUE
- END-EVALUATE
- .
-
- 039-Done.
- EXIT.
- /
- 040-Process-Yes-No-Value SECTION.
- *****************************************************************
- ** Process a switch value of YES or NO **
- *****************************************************************
-
- 042-Process.
- EVALUATE SV-1
- WHEN 'Y'
- MOVE 'YES' TO Switch-Value
- WHEN 'N'
- MOVE 'NO' To Switch-Value
- WHEN OTHER
- MOVE SPACES TO Output-Message
- STRING '*ERROR: "' TRIM(Switch-Value)
- '" is not a valid value for the "'
- TRIM(Switch-Keyword) '" switch'
- DELIMITED SPACES
- INTO Output-Message
- END-STRING
- SET 88-Switch-Is-Bad TO TRUE
- END-EVALUATE
- .
-
- 049-Done.
- EXIT.
- /
- 050-Process-Yes-No-All SECTION.
- *****************************************************************
- ** Process a switch value of YES, NO or ALL **
- *****************************************************************
-
- 052-Process.
- IF SV-1 = 'A'
- MOVE 'ALL' TO Switch-Value
- ELSE
- PERFORM 040-Process-Yes-No-Value
- END-IF
- .
-
- 059-Done.
- EXIT.
- /
- 060-Process-Yes-No-Auto SECTION.
- *****************************************************************
- ** Process a switch value of YES, NO or AUTO **
- *****************************************************************
-
- 061-Init.
- IF SV-1 = 'A'
- PERFORM 070-Find-LINKAGE-SECTION
- IF 88-Compile-As-Subpgm
- MOVE 'Y' TO Switch-Value
- ELSE
- MOVE 'N' TO Switch-Value
- END-IF
- ELSE
- PERFORM 040-Process-Yes-No-Value
- END-IF
- .
- /
- 070-Find-LINKAGE-SECTION SECTION.
- *****************************************************************
- ** Determine if the program being compiled is a MAIN program **
- *****************************************************************
-
- 071-Init.
- OPEN INPUT Source-Code
- SET 88-Compile-As-Mainpgm TO TRUE
- SET 88-More-To-1st-Prog TO TRUE
- PERFORM UNTIL 88-1st-Prog-Complete
- READ Source-Code AT END
- CLOSE Source-Code
- EXIT SECTION
- END-READ
- CALL 'CHECKSOURCE' USING Source-Code-Record
- F-Source-Record-Type
- END-CALL
- IF 88-Source-Rec-Ident
- SET 88-1st-Prog-Complete TO TRUE
- END-IF
- END-PERFORM
- .
-
- 072-Process-Source.
- SET 88-Source-Rec-IgnoCOB-COLOR-RED TO TRUE
- PERFORM UNTIL 88-Source-Rec-Linkage
- OR 88-Source-Rec-Ident
- READ Source-Code AT END
- CLOSE Source-Code
- EXIT SECTION
- END-READ
- CALL 'CHECKSOURCE' USING Source-Code-Record
- F-Source-Record-Type
- END-CALL
- END-PERFORM
- CLOSE Source-Code
- IF 88-Source-Rec-Linkage
- SET 88-Compile-As-Subpgm TO TRUE
- END-IF
- .
-
- 079-Done.
- EXIT.
- /
- 100-Initialization SECTION.
- *****************************************************************
- ** Perform all program-wide initialization operations **
- *****************************************************************
-
-
-GC0909 101-Determine-OS-Type.
-GC0909 CALL 'GETOSTYPE'
-GC0909 END-CALL
-GC0909 MOVE RETURN-CODE TO OS-Type
-GC0909 EVALUATE TRUE
-GC0909 WHEN OS-Unknown
-GC0909 MOVE '\' TO Dir-Char
-GC0909 MOVE 'Unknown' TO OS-Type-Literal
-GC0310 MOVE COB-SCR-F11 TO CK-S-F1
-GC0310 MOVE COB-SCR-F12 TO CK-S-F2
-GC0310 MOVE COB-SCR-F13 TO CK-S-F3
-GC0310 MOVE COB-SCR-F14 TO CK-S-F4
-GC0310 MOVE COB-SCR-F15 TO CK-S-F5
-GC0310 MOVE COB-SCR-F16 TO CK-S-F6
-GC0310 MOVE COB-SCR-F17 TO CK-S-F7
-GC0909 WHEN OS-Windows
-GC0909 MOVE '\' TO Dir-Char
-GC0909 MOVE 'Windows' TO OS-Type-Literal
-GC0310 MOVE COB-SCR-F13 TO CK-S-F1
-GC0310 MOVE COB-SCR-F14 TO CK-S-F2
-GC0310 MOVE COB-SCR-F15 TO CK-S-F3
-GC0310 MOVE COB-SCR-F16 TO CK-S-F4
-GC0310 MOVE COB-SCR-F17 TO CK-S-F5
-GC0310 MOVE COB-SCR-F18 TO CK-S-F6
-GC0310 MOVE COB-SCR-F19 TO CK-S-F7
-GC0909 WHEN OS-Cygwin
-GC0909 MOVE '/' TO Dir-Char
-GC0410 MOVE 'Cygwin' TO OS-Type-Literal
-GC0310 MOVE COB-SCR-F11 TO CK-S-F1
-GC0310 MOVE COB-SCR-F12 TO CK-S-F2
-GC0310 MOVE COB-SCR-F13 TO CK-S-F3
-GC0310 MOVE COB-SCR-F14 TO CK-S-F4
-GC0310 MOVE COB-SCR-F15 TO CK-S-F5
-GC0310 MOVE COB-SCR-F16 TO CK-S-F6
-GC0310 MOVE COB-SCR-F17 TO CK-S-F7
-GC0909 WHEN OS-UNIX
-GC0909 MOVE '/' TO Dir-Char
-GC0410 MOVE 'UNIX ' TO OS-Type-Literal
-GC0310 MOVE COB-SCR-F11 TO CK-S-F1
-GC0310 MOVE COB-SCR-F12 TO CK-S-F2
-GC0310 MOVE COB-SCR-F13 TO CK-S-F3
-GC0310 MOVE COB-SCR-F14 TO CK-S-F4
-GC0310 MOVE COB-SCR-F15 TO CK-S-F5
-GC0310 MOVE COB-SCR-F16 TO CK-S-F6
-GC0310 MOVE COB-SCR-F17 TO CK-S-F7
-GC0909 END-EVALUATE
-GC0909 .
-
- 102-Set-Environment-Vars.
- SET ENVIRONMENT 'COB_SCREEN_EXCEPTIONS' TO 'Y'
- SET ENVIRONMENT 'COB_SCREEN_ESC' TO 'Y'
- .
-
- 103-Generate-Cobc-Output-Fn.
- ACCEPT Env-TEMP
- FROM ENVIRONMENT "TEMP"
- END-ACCEPT
- MOVE SPACES TO Cobc-Output-File
- STRING TRIM(Env-TEMP,TRAILING)
-GC0909 Dir-Char
-GC0909 'OC-Messages.TXT'
- DELIMITED SIZE
- INTO Cobc-Output-File
- END-STRING
- .
-
- 104-Generate-Banner-Line-Info.
- MOVE WHEN-COMPILED (1:12) TO OC-Compiled
- INSPECT OC-Compiled
- REPLACING ALL '/' BY ':'
- AFTER INITIAL SPACE
- .
-
- 105-Establish-Switch-Settings.
- ACCEPT Command-Line-Args
- FROM COMMAND-LINE
- END-ACCEPT
- MOVE TRIM(Command-Line-Args, Leading)
- TO Command-Line-Args
- MOVE 0 TO Tally
-GC0410 INSPECT Command-Line-Args TALLYING Tally FOR ALL '@'
- IF Tally = 0
- MOVE Command-Line-Args TO File-Name
- MOVE SPACES TO Command-Line-Args
- ELSE
-GC0410 UNSTRING Command-Line-Args DELIMITED BY '@'
- INTO File-Name, Dummy
- END-UNSTRING
- INSPECT Command-Line-Args
-GC0410 REPLACING FIRST '@' BY LOW-VALUES
- UNSTRING Command-Line-Args
- DELIMITED BY LOW-VALUES
- INTO Dummy, Cmd
- END-UNSTRING
- MOVE SPACES TO Command-Line-Args
-GC0410 STRING '@' Cmd DELIMITED SIZE
- INTO Command-Line-Args
- END-STRING
- END-IF
- IF File-Name = SPACES
- DISPLAY
- 'No program filename was specified'
- END-DISPLAY
- PERFORM 900-Terminate
- END-IF
- PERFORM 010-Parse-Args
- IF S-SUBROUTINE = 'A'
- MOVE 'S' TO Switch-Keyword
- MOVE 'A' TO Switch-Value
- PERFORM 070-Find-LINKAGE-SECTION
- IF 88-Compile-As-Subpgm
- MOVE 'Y' TO S-SUBROUTINE
- ELSE
- MOVE 'N' TO S-SUBROUTINE
- END-IF
- END-IF
- INSPECT S-Yes-No-Switches REPLACING ALL 'Y' BY Selection-Char
- INSPECT S-Yes-No-Switches REPLACING ALL 'N' BY ' '
- .
-
- 106-Determine-Folder-Path.
- Move 256 TO I
-GC0909 IF OS-Cygwin AND File-Name (2:1) = ':'
-GC0909 MOVE '\' TO Dir-Char
-GC0909 END-IF
- PERFORM UNTIL I = 0 OR FN-Char (I) = Dir-Char
- SUBTRACT 1 FROM I
- END-PERFORM
- IF I = 0
- MOVE SPACES TO Prog-Folder
- MOVE File-Name TO Prog-File-Name
- ELSE
- MOVE '*' TO FN-Char (I)
- UNSTRING File-Name DELIMITED BY '*'
- INTO Prog-Folder
- Prog-File-Name
- END-UNSTRING
- MOVE Dir-Char TO FN-Char (I)
- END-IF
- UNSTRING Prog-File-Name DELIMITED BY '.'
- INTO Prog-Name, Prog-Extension
- END-UNSTRING
- IF Prog-Folder = SPACES
- ACCEPT Prog-Folder
- FROM ENVIRONMENT 'CD'
- END-ACCEPT
-GC0909 ELSE
-GC0909 CALL "CBL_CHANGE_DIR"
-GC0909 USING TRIM(Prog-Folder,TRAILING)
-GC0909 END-CALL
- END-IF
-GC0909 IF OS-Cygwin AND File-Name (2:1) = ':'
-GC0909 MOVE '/' TO Dir-Char
-GC0909 END-IF
- .
-
-GC0909 107-Other.
-GC0909 MOVE ALL LD-Horiz-Line TO Horizontal-Line.
-GC0410 MOVE CONCATENATE(' OCic for ',
-GC0410 TRIM(OS-Type-Literal,Trailing),
-GC0410 ' Copyright (C) 2009-2010, Gary L. Cutler,',
-GC0410 ' GPL')
-GC0410 TO Output-Message.
-GC0909 .
-GC0909
- 109-Done.
- EXIT.
- /
- 200-Let-User-Set-Switches SECTION.
- *****************************************************************
- ** Show the user the current switch settings and allow them to **
- ** be changed. **
- *****************************************************************
-
- 201-Init.
- SET 88-Switch-Changes TO TRUE
- .
-
- 202-Show-And-Change-Switches.
- PERFORM UNTIL 88-No-Switch-Changes
- ACCEPT
- Switches-Screen
- END-ACCEPT
- IF COB-CRT-STATUS > 0
- EVALUATE COB-CRT-STATUS
- WHEN COB-SCR-F1
- IF S-DEBUG = SPACE
- MOVE Selection-Char TO S-DEBUG
- ELSE
- MOVE ' ' TO S-DEBUG
- END-IF
- WHEN COB-SCR-F2
- IF S-DLL = SPACE
- MOVE Selection-Char TO S-DLL
- ELSE
- MOVE ' ' TO S-DLL
- END-IF
- WHEN COB-SCR-F3
- IF S-SUBROUTINE = SPACE
- MOVE Selection-Char TO S-SUBROUTINE
- MOVE ' ' TO S-EXECUTE
- ELSE
- MOVE ' ' TO S-SUBROUTINE
- END-IF
- WHEN COB-SCR-F4
- IF S-EXECUTE = SPACE
- AND S-SUBROUTINE = SPACE
- MOVE Selection-Char TO S-EXECUTE
- ELSE
- MOVE ' ' TO S-EXECUTE
- END-IF
- WHEN COB-SCR-F5
- IF S-NOTRUNC = SPACE
- MOVE Selection-Char TO S-NOTRUNC
- ELSE
- MOVE ' ' TO S-NOTRUNC
- END-IF
- WHEN COB-SCR-F6
- IF S-TRACE = SPACE
- MOVE Selection-Char TO S-TRACE
- MOVE ' ' TO S-TRACEALL
- ELSE
- MOVE ' ' TO S-TRACE
- END-IF
- WHEN COB-SCR-F7
- IF S-TRACEALL = SPACE
- MOVE Selection-Char TO S-TRACEALL
- MOVE ' ' TO S-TRACE
- ELSE
- MOVE ' ' TO S-TRACEALL
- END-IF
-GC0410 WHEN COB-SCR-F8
-GC0410 IF S-SOURCE = SPACE
-GC0410 MOVE Selection-Char TO S-SOURCE
-GC0410 ELSE
-GC0410 MOVE ' ' TO S-SOURCE
-GC0410 END-IF
-GC0410 WHEN COB-SCR-F9
-GC0410 IF S-XREF = SPACE
-GC0410 MOVE Selection-Char TO S-XREF
-GC0410 ELSE
-GC0410 MOVE ' ' TO S-XREF
-GC0410 END-IF
- WHEN COB-SCR-ESC
- PERFORM 900-Terminate
-GC0310 WHEN CK-S-F1
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-BS2000
-GC0310 WHEN CK-S-F2
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-COBOL85
-GC0310 WHEN CK-S-F3
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-COBOL2002
-GC0310 WHEN CK-S-F4
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-DEFAULT
-GC0310 WHEN CK-S-F5
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-IBM
-GC0310 WHEN CK-S-F6
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-MF
-GC0310 WHEN CK-S-F7
- MOVE SPACES TO S-CfgS
- MOVE Selection-Char TO S-Cfg-MVS
- WHEN OTHER
- MOVE 'An unsupported key was pressed'
- TO Output-Message
- END-EVALUATE
- ELSE
- SET 88-No-Switch-Changes TO TRUE
- END-IF
- END-PERFORM
- .
-
- 209-Done.
- EXIT.
- /
- 210-Run-Compiler SECTION.
- *****************************************************************
- ** Run the compiler using the switch settings we've prepared. **
- *****************************************************************
-
- 211-Init.
- MOVE SPACES TO Cmd
- Cobc-Cmd
- Output-Message
- DISPLAY
- Switches-Screen
- END-DISPLAY
- MOVE 1 TO I
- EVALUATE TRUE
- WHEN S-Cfg-BS2000 NOT = SPACES
- MOVE 'bs2000' TO Config-File
- WHEN S-Cfg-COBOL85 NOT = SPACES
- MOVE 'cobol85' TO Config-File
- WHEN S-Cfg-COBOL2002 NOT = SPACES
- MOVE 'cobol2002' TO Config-File
- WHEN S-Cfg-IBM NOT = SPACES
- MOVE 'ibm' TO Config-File
- WHEN S-Cfg-MF NOT = SPACES
- MOVE 'mf' TO Config-File
- WHEN S-Cfg-MVS NOT = SPACES
- MOVE 'mvs' TO Config-File
- WHEN OTHER
- MOVE 'default' TO Config-File
- END-EVALUATE
- .
-
- 212-Build-Compile-Command.
-GC0909 MOVE SPACES TO Cobc-Cmd
-GC0909 STRING 'cobc -std='
-GC0909 TRIM(Config-File,TRAILING)
-GC0909 ' '
-GC0909 INTO Cobc-Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
- IF S-SUBROUTINE NOT = ' '
- STRING '-m '
- DELIMITED SIZE INTO Cobc-Cmd
- WITH POINTER I
- END-STRING
- ELSE
- STRING '-x '
- DELIMITED SIZE INTO Cobc-Cmd
- WITH POINTER I
- END-STRING
- END-IF
- IF S-DEBUG NOT = ' '
- STRING '-fdebugging-line '
- DELIMITED SIZE INTO Cobc-Cmd
- WITH POINTER I
- END-STRING
- END-IF
- IF S-NOTRUNC NOT = ' '
- STRING '-fnotrunc '
- DELIMITED SIZE INTO Cobc-Cmd
- WITH POINTER I
- END-STRING
- END-IF
- IF S-TRACEALL NOT = ' '
-GC0809 STRING '-ftraceall '
- DELIMITED SIZE INTO Cobc-Cmd
- WITH POINTER I
- END-STRING
- END-IF
- IF S-TRACE NOT = ' '
- STRING '-ftrace '
- DELIMITED SIZE INTO Cobc-Cmd
- WITH POINTER I
- END-STRING
- END-IF
-
-GC0709 IF S-EXTRA > SPACES
-GC0709 STRING ' '
-GC0709 TRIM(S-Extra,TRAILING)
-GC0709 ' '
-GC0709 DELIMITED SIZE INTO Cobc-Cmd
-GC0709 WITH POINTER I
-GC0709 END-STRING
-GC0709 END-IF
-GC0909 STRING TRIM(Prog-File-Name,TRAILING)
-GC0909 DELIMITED SIZE INTO Cobc-Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
- .
-
- 213-Run-Compiler.
-GC0410 MOVE ' Compiling...' TO Output-Message
-GC0410 DISPLAY
-GC0410 Switches-Screen
-GC0410 END-DISPLAY
-GC0609 SET 88-Output-File-Avail TO TRUE
- MOVE SPACES TO Cmd
- STRING TRIM(Cobc-Cmd,TRAILING)
- ' 2>'
- TRIM(Cobc-Output-File,TRAILING)
- DELIMITED SIZE
- INTO Cmd
- END-STRING
- CALL 'SYSTEM'
- USING TRIM(Cmd,TRAILING)
- END-CALL
-GC0909 IF RETURN-CODE = 0
-GC0909 SET 88-Compile-OK TO TRUE
-GC0909 ELSE
-GC0909 SET 88-Compile-Failed TO TRUE
-GC0909 END-IF
-GC0909 IF 88-Compile-OK
-GC0909 OPEN INPUT Cobc-Output
-GC0909 READ Cobc-Output
-GC0909 AT END
-GC0909 CONTINUE
-GC0909 NOT AT END
-GC0909 SET 88-Compile-OK-Warn TO TRUE
-GC0909 END-READ
-GC0909 CLOSE Cobc-Output
-GC0909 END-IF
-GC0909 MOVE SPACES TO Output-Message
- IF 88-Compile-OK
-GC0909 MOVE ' Compilation Was Successful' TO Output-Message
-GC0909 DISPLAY
-GC0909 Switches-Screen
-GC0909 END-DISPLAY
-GC0909 CALL 'C$SLEEP'
-GC0909 USING 2
-GC0909 END-CALL
-GC0909 MOVE SPACES TO Output-Message
-GC0609 SET 88-Complete TO TRUE
- ELSE
-GC0909 DISPLAY
-GC0909 Blank-Screen
-GC0909 END-DISPLAY
-GC0909 IF 88-Compile-OK-Warn
-GC0909 DISPLAY ' Compilation was successful, but ' &
-GC0909 'warnings were generated:'
-SCROLL* AT LINE 24 COLUMN 1
-SCROLL* WITH SCROLL UP 1 LINE
-GC0909 END-DISPLAY
-GC0909 ELSE
-GC0909 DISPLAY 'Compilation Failed:'
-SCROLL* AT LINE 24 COLUMN 1
-SCROLL* WITH SCROLL UP 1 LINE
-GC0909 END-DISPLAY
-GC0909 END-IF
-GC0609 SET 88-Compile-Failed TO TRUE
-GC0609 SET 88-Complete TO TRUE
-GC0909 DISPLAY ' '
-SCROLL* AT LINE 24 COLUMN 1
-SCROLL* WITH SCROLL UP 1 LINE
-GC0909 END-DISPLAY
-GC0909 OPEN INPUT Cobc-Output
-GC0909 PERFORM FOREVER
-GC0909 READ Cobc-Output AT END
-GC0909 EXIT PERFORM
-GC0909 END-READ
-GC0909 DISPLAY TRIM(Cobc-Output-Rec,TRAILING)
-SCROLL* AT LINE 24 COLUMN 1
-SCROLL* WITH SCROLL UP 1 LINE
-GC0909 END-DISPLAY
-GC0909 END-PERFORM
-GC0909 CLOSE Cobc-Output
-GC0909 DISPLAY ' '
-SCROLL* AT LINE 24 COLUMN 1
-SCROLL* WITH SCROLL UP 2 LINES
-GC0909 END-DISPLAY
-GC0909 DISPLAY 'Press ENTER to close:'
-SCROLL* AT LINE 24 COLUMN 1
-SCROLL* WITH SCROLL UP 1 LINE
-GC0909 END-DISPLAY
-GC0909 ACCEPT Dummy
-GC0909 FROM CONSOLE
-GC0909 END-ACCEPT
-GC0909 DISPLAY
-GC0909 Blank-Screen
-GC0909 END-DISPLAY
- END-IF
- .
-
- 219-Done.
- IF 88-Compile-Failed
- PERFORM 900-Terminate
- END-IF
- .
- /
-GC0410 220-Make-Listing SECTION.
-GC0410*****************************************************************
-GC0410** Generate a source and/or xref listing using XREF **
-GC0410*****************************************************************
-GC0410
-GC0410 221-Init.
-GC0410 MOVE ' Generating cross-reference listing...'
-GC0410 TO Output-Message
-GC0410 DISPLAY
-GC0410 Switches-Screen
-GC0410 END-DISPLAY
-GC0410 CALL "CBL_DELETE_FILE"
-GC0410 USING CONCATENATE(TRIM(Prog-Name,Trailing),".lst")
-GC0410 END-CALL
-GC0410 MOVE 0 TO RETURN-CODE
-GC0410 .
-GC0410
-GC0410 213-Run-OCXref.
-GC0410 MOVE SPACES TO Output-Message
-GC0410 CALL 'LISTING'
-GC0410 USING S-SOURCE
-GC0410 S-XREF
-GC0410 File-Name
-GC0410 ON EXCEPTION
-GC0410 MOVE ' LISTING module is not available'
-GC0410 TO Output-Message
-GC0410 MOVE 1 TO RETURN-CODE
-GC0410 END-CALL
-GC0410 IF RETURN-CODE = 0
-GC0410 MOVE ' Listing generated'
-GC0410 TO Output-Message
-GC0410 IF OS-Windows OR OS-Cygwin
-GC0410 MOVE SPACES TO Cmd
-GC0410 STRING
-GC0410 'cmd /c '
-GC0410 TRIM(Prog-Name,TRAILING)
-GC0410 '.lst'
-GC0410 DELIMITED SIZE INTO Cmd
-GC0410 END-STRING
-GC0410 CALL 'SYSTEM'
-GC0410 USING TRIM(Cmd,TRAILING)
-GC0410 END-CALL
-GC0410 END-IF
-GC0410 ELSE
-GC0410 IF Output-Message = SPACES
-GC0410 MOVE ' Listing generation failed'
-GC0410 TO Output-Message
-GC0410 END-IF
-GC0410 END-IF
-GC0410 DISPLAY
-GC0410 Switches-Screen
-GC0410 END-DISPLAY
-GC0410 CALL 'C$SLEEP'
-GC0410 USING 2
-GC0410 END-CALL
-GC0410 .
- /
- 230-Run-Program SECTION.
- *****************************************************************
- ** Run the compiled program **
- *****************************************************************
-
- 232-Build-Command.
-GC0909 MOVE SPACES TO Cmd
-GC0909 MOVE 1 TO I
- IF S-SUBROUTINE NOT = ' '
- OR S-DLL NOT = ' '
- STRING 'cobcrun ' DELIMITED SIZE
- INTO Cmd
- WITH POINTER I
- END-STRING
- END-IF
- IF Prog-Folder NOT = SPACES
-GC0909 IF OS-Cygwin AND Prog-Folder (2:1) = ':'
-GC0909 STRING '/cygdrive/'
-GC0909 INTO Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
-GC0909 STRING LOWER-CASE(Prog-Folder (1:1))
-GC0909 INTO Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
-GC0909 PERFORM VARYING J FROM 3 BY 1
-GC0909 UNTIL J > LENGTH(TRIM(Prog-Folder))
-GC0909 IF Prog-Folder (J:1) = '\'
-GC0909 STRING '/'
-GC0909 INTO Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
-GC0909 ELSE
-GC0909 STRING Prog-Folder (J:1)
-GC0909 INTO Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
-GC0909 END-IF
-GC0909 END-PERFORM
-GC0909 ELSE
-GC0410 STRING '"' TRIM(Prog-Folder,TRAILING)
-GC0909 INTO Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
-GC0909 END-IF
-GC0909 STRING Dir-Char
-GC0909 INTO Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
-GC0909 ELSE
-GC0909 IF OS-Cygwin OR OS-UNIX
-GC0909 STRING './'
-GC0909 INTO Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
-GC0909 END-IF
- END-IF
-GC0909 STRING TRIM(Prog-Name,TRAILING)
-GC0909 INTO Cmd
-GC0909 WITH POINTER I
-GC0909 END-STRING
-GC0909 IF S-SUBROUTINE = ' '
-GC0909 AND S-DLL NOT = ' '
-GC0909 STRING '.exe' DELIMITED SIZE
- INTO Cmd
- WITH POINTER I
- END-STRING
- END-IF
- IF S-ARGS NOT = SPACES
-GC0809 STRING ' ' TRIM(S-ARGS,TRAILING)
- INTO Cmd
- WITH POINTER I
- END-STRING
- END-IF
- IF OS-Unknown OR OS-Windows
-GC0410 STRING '"&&pause'
- INTO Cmd
- WITH POINTER I
- END-STRING
- ELSE
- STRING ';echo "Press ENTER to close...";read'
- INTO Cmd
- WITH POINTER I
- END-STRING
- END-IF
- .
-
- 233-Run-Program.
-GC0909 DISPLAY
-GC0909 Blank-Screen
-GC0909 END-DISPLAY
-
- CALL 'SYSTEM'
- USING TRIM(Cmd,TRAILING)
- END-CALL
- PERFORM 900-Terminate
- .
-
- 239-Done.
- EXIT.
- /
- 900-Terminate SECTION.
- *****************************************************************
- ** Display a message and halt the program **
- *****************************************************************
-
- 901-Display-Message.
-GC0909 IF Output-Message > SPACES
-GC0909 DISPLAY
-GC0909 Switches-Screen
-GC0909 END-DISPLAY
-GC0909 CALL 'C$SLEEP'
-GC0909 USING 2
-GC0909 END-CALL
-GC0909 END-IF
- DISPLAY
- Blank-Screen
- END-DISPLAY
- .
-
- 909-Done.
- GOBACK
- .
-
- END PROGRAM OCic.
-
- IDENTIFICATION DIVISION.
- PROGRAM-ID. GETOSTYPE.
- *****************************************************************
- ** This subprogram determine the OS type the program is run- **
- ** ning under, passing that result back in RETURN-CODE as fol- **
- ** lows: **
- ** **
- ** 0: Cannot be determined **
- ** 1: Native Windows or Windows/MinGW **
- ** 2: Cygwin **
- ** 3: UNIX/Linux/MacOS **
- *****************************************************************
- ** DATE CHANGE DESCRIPTION **
- ** ====== ==================================================== **
- ** GC0909 Initial coding. **
- *****************************************************************
- ENVIRONMENT DIVISION.
- CONFIGURATION SECTION.
- REPOSITORY.
- FUNCTION ALL INTRINSIC.
- DATA DIVISION.
- WORKING-STORAGE SECTION.
- 01 Env-Path PIC X(1024).
- 01 Tally USAGE BINARY-LONG.
- PROCEDURE DIVISION.
- 000-Main SECTION.
- 010-Get-TEMP-Var.
- MOVE SPACES TO Env-Path
- ACCEPT Env-Path
- FROM ENVIRONMENT "PATH"
- ON EXCEPTION
- MOVE 0 TO RETURN-CODE
- GOBACK
- END-ACCEPT
- IF Env-Path = SPACES
- MOVE 0 TO RETURN-CODE
- ELSE
- MOVE 0 TO Tally
- INSPECT Env-Path
- TALLYING Tally FOR ALL ";"
- IF Tally = 0 *> Must be some form of UNIX
- MOVE 0 TO Tally
- INSPECT Env-Path
- TALLYING TALLY FOR ALL "/cygdrive/"
- IF Tally = 0 *> UNIX/MacOS
- MOVE 3 TO RETURN-CODE
- ELSE *> Cygwin
- MOVE 2 TO RETURN-CODE
- END-IF
- ELSE *> Assume Windows[/MinGW]
- MOVE 1 TO RETURN-CODE
- END-IF
- END-IF
- GOBACK
- .
- END PROGRAM GETOSTYPE.
-
- IDENTIFICATION DIVISION.
- PROGRAM-ID. CHECKSOURCE.
- *****************************************************************
- ** This subprogram will scan a line of source code it is given **
- ** looking for "LINKAGE SECTION" or "IDENTIFICATION DIVISION". **
- ** **
- ** ****NOTE**** ****NOTE**** ****NOTE**** ****NOTE*** **
- ** **
- ** These two strings must be found IN THEIR ENTIRETY within **
- ** the 1st 80 columns of program source records, and cannot **
- ** follow either a "*>" sequence OR a "*" in col 7. **
- *****************************************************************
- ** DATE CHANGE DESCRIPTION **
- ** ====== ==================================================== **
- ** GC0809 Initial coding. **
- *****************************************************************
- ENVIRONMENT DIVISION.
- CONFIGURATION SECTION.
- REPOSITORY.
- FUNCTION ALL INTRINSIC.
- DATA DIVISION.
- WORKING-STORAGE SECTION.
- 01 Compressed-Src.
- 05 CS-Char OCCURS 80 TIMES PIC X(1).
-
- 01 Flags.
- 05 F-Found-SPACE PIC X(1).
- 88 88-Skipping-SPACE VALUE 'Y'.
- 88 88-Not-Skipping-SPACE VALUE 'N'.
-
- 01 I USAGE BINARY-CHAR.
-
- 01 J USAGE BINARY-CHAR.
- LINKAGE SECTION.
- 01 Argument-1.
- 02 A1-Char OCCURS 80 TIMES PIC X(1).
-
- 01 Argument-2 PIC X(1).
- 88 88-A2-LINKAGE-SECTION VALUE 'L'.
- 88 88-A2-IDENTIFICATION-DIVISION VALUE 'I'.
- 88 88-A2-Nothing-Special VALUE ' '.
- PROCEDURE DIVISION USING Argument-1, Argument-2.
- 000-Main SECTION.
-
- 010-Initialize.
- SET 88-A2-Nothing-Special TO TRUE
- IF A1-Char (7) = '*'
- GOBACK
- END-IF
- .
-
- 020-Compress-Multiple-SPACES.
- SET 88-Not-Skipping-SPACE TO TRUE
- MOVE 0 TO J
- MOVE SPACES TO Compressed-Src
- PERFORM VARYING I FROM 1 BY 1
- UNTIL I > 80
- IF A1-Char (I) = SPACE
- IF 88-Not-Skipping-SPACE
- ADD 1 TO J
- MOVE UPPER-CASE(A1-Char (I)) TO CS-Char (J)
- SET 88-Skipping-SPACE TO TRUE
- END-IF
- ELSE
- SET 88-Not-Skipping-SPACE TO TRUE
- ADD 1 TO J
- MOVE A1-Char (I) TO CS-Char (J)
- END-IF
- END-PERFORM
- .
-
- 030-Scan-Compressed-Src.
- PERFORM VARYING I FROM 1 BY 1
- UNTIL I > 66
- EVALUATE TRUE
- WHEN CS-Char (I) = '*'
- IF Compressed-Src (I : 2) = '*>'
- GOBACK
- END-IF
- WHEN (CS-Char (I) = 'L') AND (I < 66)
- IF Compressed-Src (I : 15) = 'LINKAGE SECTION'
- SET 88-A2-LINKAGE-SECTION TO TRUE
- GOBACK
- END-IF
- WHEN (CS-Char (I) = 'I') AND (I < 58)
- IF Compressed-Src (I : 23) = 'IDENTIFICATION ' &
- 'DIVISION'
- SET 88-A2-IDENTIFICATION-DIVISION TO TRUE
- GOBACK
- END-IF
- END-EVALUATE
- END-PERFORM
- .
-
- 099-Never-Found-Either-One.
- GOBACK
- .
- END PROGRAM CHECKSOURCE.
-
- IDENTIFICATION DIVISION.
- PROGRAM-ID. LISTING.
- *****************************************************************
- ** This subprogram generates a cross-reference listing of an **
- ** OpenCOBOL program. **
- ** **
- ** Linkage: CALL "LISTING" USING <source> **
- ** <xref> **
- ** <filename> **
- ** **
- ** Where: **
- ** <source> is a PIC X(1) flag indicating **
- ** whether or not a source listing **
- ** should be produced (space=NO, **
- ** non-space=yes) **
- ** <xref> is a PIC X(1) flag indicating **
- ** whether or not an xref listing **
- ** should be produced (space=NO, **
- ** non-space=yes) **
- ** <filename> is the [path]filename of the **
- ** program being listed and/or **
- ** xreffed in a PIC X(256) form. **
- *****************************************************************
- ** **
- ** AUTHOR: GARY L. CUTLER **
- ** CutlerGL@gmail.com **
- ** Copyright (C) 2010, Gary L. Cutler, GPL **
- ** **
- ** DATE-WRITTEN: April 1, 2010 **
- ** **
- *****************************************************************
- ** DATE CHANGE DESCRIPTION **
- ** ====== ==================================================== **
- ** GC0410 Initial coding **
- ** GC0710 Handle duplicate data names (i.e. "CORRESPONDING" or **
- ** qualified items) better; ignore "END PROGRAM" recs **
- ** so program name doesn't appear in listing. **
- *****************************************************************
- ENVIRONMENT DIVISION.
- CONFIGURATION SECTION.
- REPOSITORY.
- FUNCTION ALL INTRINSIC.
- INPUT-OUTPUT SECTION.
- FILE-CONTROL.
- SELECT Expand-Code ASSIGN TO Expanded-Src-Filename
- ORGANIZATION IS LINE SEQUENTIAL.
- SELECT Report-File ASSIGN TO Report-Filename
- ORGANIZATION IS LINE SEQUENTIAL.
- SELECT Sort-File ASSIGN TO DISK.
- SELECT Source-Code ASSIGN TO Src-Filename
- ORGANIZATION IS LINE SEQUENTIAL.
- DATA DIVISION.
- FILE SECTION.
- FD Expand-Code.
- 01 Expand-Code-Rec.
- 05 ECR-1 PIC X.
- 05 ECR-2-256 PIC X(256).
- 01 Expand-Code-Rec-Alt.
- 05 ECR-1-128 PIC X(128).
- 05 ECR-129-256 PIC X(128).
-
- FD Report-File.
- 01 Report-Rec PIC X(135).
-
- SD Sort-File.
- 01 Sort-Rec.
- 05 SR-Prog-ID PIC X(15).
- 05 SR-Token-UC PIC X(32).
- 05 SR-Token PIC X(32).
- 05 SR-Section PIC X(15).
- 05 SR-Line-No-Def PIC 9(6).
- 05 SR-Reference.
- 10 SR-Line-No-Ref PIC 9(6).
- 10 SR-Ref-Flag PIC X(1).
-
- FD Source-Code.
- 01 Source-Code-Rec.
-GC0410 05 SCR-1-128.
-GC0410 10 FILLER PIC X(6).
-GC0410 10 SCR-7 PIC X(1).
-GC0410 10 FILLER PIC X(121).
- 05 SCR-129-256 PIC X(128).
-
- WORKING-STORAGE SECTION.
- 78 Line-Nos-Per-Rec VALUE 8.
-
- 01 Cmd PIC X(256).
-
- 01 Delim PIC X(2).
-
- 01 Detail-Line-S.
- 05 DLS-Line-No PIC ZZZZZ9.
- 05 FILLER PIC X(1).
- 05 DLS-Statement PIC X(128).
-
- 01 Detail-Line-X.
- 05 DLX-Prog-ID PIC X(15).
- 05 FILLER PIC X(1).
- 05 DLX-Token PIC X(32).
- 05 FILLER PIC X(1).
- 05 DLX-Line-No-Def PIC ZZZZZ9.
- 05 FILLER PIC X(1).
- 05 DLX-Section PIC X(15).
- 05 FILLER PIC X(1).
- 05 DLX-Reference OCCURS Line-Nos-Per-Rec TIMES.
- 10 DLX-Line-No-Ref PIC ZZZZZ9.
- 10 DLX-Ref-Flag PIC X(1).
- 10 FILLER PIC X(1).
-
- 01 Dummy PIC X(1).
-
- 01 Env-TEMP PIC X(256).
-
- 01 Expanded-Src-Filename PIC X(256).
-
- 01 Filename PIC X(256).
-
- 01 Flags.
-GC0710 05 F-Duplicate PIC X(1).
- 05 F-First-Record PIC X(1).
- 05 F-In-Which-Pgm PIC X(1).
- 88 In-Main-Module VALUE 'M'.
- 88 In-Copybook VALUE 'C'.
- 05 F-Last-Token-Ended-Sent PIC X(1).
- 05 F-Processing-PICTURE PIC X(1).
- 05 F-Token-Ended-Sentence PIC X(1).
-GC0710 05 F-Verb-Has-Been-Found PIC X(1).
-
- 01 Group-Indicators.
- 05 GI-Prog-ID PIC X(15).
- 05 GI-Token PIC X(32).
-
- 01 Heading-1S.
- 05 FILLER PIC X(125) VALUE
- "OpenCOBOL 1.1 06FEB2009 Source Listing - " &
- "OCic Copyright (C) 2009-2010, Gary L. Cutler, GPL".
- 05 H1S-Date PIC 9999/99/99.
-
- 01 Heading-1X.
- 05 FILLER PIC X(125) VALUE
- "OpenCOBOL 1.1 06FEB2009 Cross-Reference Listing - " &
- "OCic Copyright (C) 2009-2010, Gary L. Cutler, GPL".
- 05 H1X-Date PIC 9999/99/99.
-
- 01 Heading-2 PIC X(135).
-
- 01 Heading-4S PIC X(16) VALUE
- "Line Statement".
-
- 01 Heading-4X PIC X(96) VALUE
- "PROGRAM-ID Identifier/Register/Function Defn Wher
- - "e Defined References (* = Updated)".
-
- 01 Heading-5S PIC X(135) VALUE
- "====== =====================================================
- - "============================================================
- - "===============".
-
- 01 Heading-5X PIC X(135) VALUE
- "=============== ================================ ====== ====
- - "=========== ================================================
- - "===============".
-
- 01 Held-Reference PIC X(100).
-
- 01 I USAGE BINARY-LONG.
-
- 01 J USAGE BINARY-LONG.
-
- 01 Lines-Left USAGE BINARY-LONG.
-
- 01 Lines-Per-Page USAGE BINARY-LONG.
-
- 01 Lines-Per-Page-ENV PIC X(256).
-
- 01 Num-UserNames USAGE BINARY-LONG.
-
- 01 PIC-X10 PIC X(10).
-
- 01 PIC-X32 PIC X(32).
-
- 01 PIC-X256 PIC X(256).
-
- 01 Program-Path PIC X(256).
-
- 01 Report-Filename PIC X(256).
-
- 01 Reserved-Words.
- 05 FILLER PIC X(33) VALUE "IABS".
- 05 FILLER PIC X(33) VALUE "VACCEPT".
- 05 FILLER PIC X(33) VALUE " ACCESS".
- 05 FILLER PIC X(33) VALUE "IACOS".
- 05 FILLER PIC X(33) VALUE " ACTIVE-CLASS".
- 05 FILLER PIC X(33) VALUE "VADD".
- 05 FILLER PIC X(33) VALUE " ADDRESS".
- 05 FILLER PIC X(33) VALUE " ADVANCING".
- 05 FILLER PIC X(33) VALUE "KAFTER".
- 05 FILLER PIC X(33) VALUE " ALIGNED".
- 05 FILLER PIC X(33) VALUE " ALL".
- 05 FILLER PIC X(33) VALUE "VALLOCATE".
- 05 FILLER PIC X(33) VALUE " ALPHABET".
- 05 FILLER PIC X(33) VALUE " ALPHABETIC".
- 05 FILLER PIC X(33) VALUE " ALPHABETIC-LOWER".
- 05 FILLER PIC X(33) VALUE " ALPHABETIC-UPPER".
- 05 FILLER PIC X(33) VALUE " ALPHANUMERIC".
- 05 FILLER PIC X(33) VALUE " ALPHANUMERIC-EDITED".
- 05 FILLER PIC X(33) VALUE " ALSO".
- 05 FILLER PIC X(33) VALUE "VALTER".
- 05 FILLER PIC X(33) VALUE " ALTERNATE".
- 05 FILLER PIC X(33) VALUE " AND".
- 05 FILLER PIC X(33) VALUE "IANNUITY".
- 05 FILLER PIC X(33) VALUE " ANY".
- 05 FILLER PIC X(33) VALUE " ANYCASE".
- 05 FILLER PIC X(33) VALUE " ARE".
- 05 FILLER PIC X(33) VALUE " AREA".
- 05 FILLER PIC X(33) VALUE " AREAS".
- 05 FILLER PIC X(33) VALUE " ARGUMENT-NUMBER".
- 05 FILLER PIC X(33) VALUE " ARGUMENT-VALUE".
- 05 FILLER PIC X(33) VALUE " AS".
- 05 FILLER PIC X(33) VALUE " ASCENDING".
- 05 FILLER PIC X(33) VALUE "IASIN".
- 05 FILLER PIC X(33) VALUE " ASSIGN".
- 05 FILLER PIC X(33) VALUE " AT".
- 05 FILLER PIC X(33) VALUE "IATAN".
- 05 FILLER PIC X(33) VALUE " AUTHOR".
- 05 FILLER PIC X(33) VALUE " AUTO".
- 05 FILLER PIC X(33) VALUE " AUTO-SKIP".
- 05 FILLER PIC X(33) VALUE " AUTOMATIC".
- 05 FILLER PIC X(33) VALUE " AUTOTERMINATE".
- 05 FILLER PIC X(33) VALUE " BACKGROUND-COLOR".
- 05 FILLER PIC X(33) VALUE " BASED".
- 05 FILLER PIC X(33) VALUE " BEEP".
- 05 FILLER PIC X(33) VALUE " BEFORE".
- 05 FILLER PIC X(33) VALUE " BELL".
- 05 FILLER PIC X(33) VALUE " BINARY".
- 05 FILLER PIC X(33) VALUE " BINARY-C-LONG".
- 05 FILLER PIC X(33) VALUE " BINARY-CHAR".
- 05 FILLER PIC X(33) VALUE " BINARY-DOUBLE".
- 05 FILLER PIC X(33) VALUE " BINARY-LONG".
- 05 FILLER PIC X(33) VALUE " BINARY-SHORT".
- 05 FILLER PIC X(33) VALUE " BIT".
- 05 FILLER PIC X(33) VALUE " BLANK".
- 05 FILLER PIC X(33) VALUE " BLINK".
- 05 FILLER PIC X(33) VALUE " BLOCK".
- 05 FILLER PIC X(33) VALUE " BOOLEAN".
- 05 FILLER PIC X(33) VALUE " BOTTOM".
- 05 FILLER PIC X(33) VALUE "YBY".
- 05 FILLER PIC X(33) VALUE "IBYTE-LENGTH".
- 05 FILLER PIC X(33) VALUE "MC01".
- 05 FILLER PIC X(33) VALUE "MC02".
- 05 FILLER PIC X(33) VALUE "MC03".
- 05 FILLER PIC X(33) VALUE "MC04".
- 05 FILLER PIC X(33) VALUE "MC05".
- 05 FILLER PIC X(33) VALUE "MC06".
- 05 FILLER PIC X(33) VALUE "MC07".
- 05 FILLER PIC X(33) VALUE "MC08".
- 05 FILLER PIC X(33) VALUE "MC09".
- 05 FILLER PIC X(33) VALUE "MC10".
- 05 FILLER PIC X(33) VALUE "MC11".
- 05 FILLER PIC X(33) VALUE "MC12".
- 05 FILLER PIC X(33) VALUE "VCALL".
- 05 FILLER PIC X(33) VALUE "VCANCEL".
- 05 FILLER PIC X(33) VALUE " CF".
- 05 FILLER PIC X(33) VALUE " CH".
- 05 FILLER PIC X(33) VALUE " CHAINING".
- 05 FILLER PIC X(33) VALUE "ICHAR".
- 05 FILLER PIC X(33) VALUE " CHARACTER".
- 05 FILLER PIC X(33) VALUE " CHARACTERS".
- 05 FILLER PIC X(33) VALUE " CLASS".
- 05 FILLER PIC X(33) VALUE " CLASS-ID".
- 05 FILLER PIC X(33) VALUE "VCLOSE".
- 05 FILLER PIC X(33) VALUE "ICOB-CRT-STATUS".
- 05 FILLER PIC X(33) VALUE " CODE".
- 05 FILLER PIC X(33) VALUE " CODE-SET".
- 05 FILLER PIC X(33) VALUE " COL".
- 05 FILLER PIC X(33) VALUE " COLLATING".
- 05 FILLER PIC X(33) VALUE " COLS".
- 05 FILLER PIC X(33) VALUE " COLUMN".
- 05 FILLER PIC X(33) VALUE " COLUMNS".
- 05 FILLER PIC X(33) VALUE "ICOMBINED-DATETIME".
- 05 FILLER PIC X(33) VALUE " COMMA".
- 05 FILLER PIC X(33) VALUE " COMMAND-LINE".
- 05 FILLER PIC X(33) VALUE "VCOMMIT".
- 05 FILLER PIC X(33) VALUE " COMMON".
- 05 FILLER PIC X(33) VALUE " COMP".
- 05 FILLER PIC X(33) VALUE " COMP-1".
- 05 FILLER PIC X(33) VALUE " COMP-2".
- 05 FILLER PIC X(33) VALUE " COMP-3".
- 05 FILLER PIC X(33) VALUE " COMP-4".
- 05 FILLER PIC X(33) VALUE " COMP-5".
- 05 FILLER PIC X(33) VALUE " COMP-X".
- 05 FILLER PIC X(33) VALUE " COMPUTATIONAL".
- 05 FILLER PIC X(33) VALUE " COMPUTATIONAL-1".
- 05 FILLER PIC X(33) VALUE " COMPUTATIONAL-2".
- 05 FILLER PIC X(33) VALUE " COMPUTATIONAL-3".
- 05 FILLER PIC X(33) VALUE " COMPUTATIONAL-4".
- 05 FILLER PIC X(33) VALUE " COMPUTATIONAL-5".
- 05 FILLER PIC X(33) VALUE " COMPUTATIONAL-X".
- 05 FILLER PIC X(33) VALUE "VCOMPUTE".
- 05 FILLER PIC X(33) VALUE "ICONCATENATE".
- 05 FILLER PIC X(33) VALUE " CONDITION".
- 05 FILLER PIC X(33) VALUE "KCONFIGURATION".
- 05 FILLER PIC X(33) VALUE "MCONSOLE".
- 05 FILLER PIC X(33) VALUE " CONSTANT".
- 05 FILLER PIC X(33) VALUE " CONTAINS".
- 05 FILLER PIC X(33) VALUE " CONTENT".
- 05 FILLER PIC X(33) VALUE "VCONTINUE".
- 05 FILLER PIC X(33) VALUE " CONTROL".
- 05 FILLER PIC X(33) VALUE " CONTROLS".
- 05 FILLER PIC X(33) VALUE "KCONVERTING".
- 05 FILLER PIC X(33) VALUE " COPY".
- 05 FILLER PIC X(33) VALUE " CORR".
- 05 FILLER PIC X(33) VALUE " CORRESPONDING".
- 05 FILLER PIC X(33) VALUE "ICOS".
- 05 FILLER PIC X(33) VALUE "KCOUNT".
- 05 FILLER PIC X(33) VALUE " CRT".
- 05 FILLER PIC X(33) VALUE " CURRENCY".
- 05 FILLER PIC X(33) VALUE "ICURRENT-DATE".
- 05 FILLER PIC X(33) VALUE " CURSOR".
- 05 FILLER PIC X(33) VALUE " CYCLE".
- 05 FILLER PIC X(33) VALUE "KDATA".
- 05 FILLER PIC X(33) VALUE " DATA-POINTER".
- 05 FILLER PIC X(33) VALUE " DATE".
- 05 FILLER PIC X(33) VALUE " DATE-COMPILED".
- 05 FILLER PIC X(33) VALUE " DATE-MODIFIED".
- 05 FILLER PIC X(33) VALUE "IDATE-OF-INTEGER".
- 05 FILLER PIC X(33) VALUE "IDATE-TO-YYYYMMDD".
- 05 FILLER PIC X(33) VALUE " DATE-WRITTEN".
- 05 FILLER PIC X(33) VALUE " DAY".
- 05 FILLER PIC X(33) VALUE "IDAY-OF-INTEGER".
- 05 FILLER PIC X(33) VALUE " DAY-OF-WEEK".
- 05 FILLER PIC X(33) VALUE "IDAY-TO-YYYYDDD".
- 05 FILLER PIC X(33) VALUE " DE".
- 05 FILLER PIC X(33) VALUE " DEBUGGING".
- 05 FILLER PIC X(33) VALUE " DECIMAL-POINT".
- 05 FILLER PIC X(33) VALUE " DECLARATIVES".
- 05 FILLER PIC X(33) VALUE " DEFAULT".
- 05 FILLER PIC X(33) VALUE "VDELETE".
- 05 FILLER PIC X(33) VALUE " DELIMITED".
- 05 FILLER PIC X(33) VALUE "KDELIMITER".
- 05 FILLER PIC X(33) VALUE " DEPENDING".
- 05 FILLER PIC X(33) VALUE " DESCENDING".
- 05 FILLER PIC X(33) VALUE " DESTINATION".
- 05 FILLER PIC X(33) VALUE " DETAIL".
- 05 FILLER PIC X(33) VALUE " DISABLE".
- 05 FILLER PIC X(33) VALUE " DISK".
- 05 FILLER PIC X(33) VALUE "VDISPLAY".
- 05 FILLER PIC X(33) VALUE "VDIVIDE".
- 05 FILLER PIC X(33) VALUE "KDIVISION".
- 05 FILLER PIC X(33) VALUE "KDOWN".
- 05 FILLER PIC X(33) VALUE " DUPLICATES".
- 05 FILLER PIC X(33) VALUE " DYNAMIC".
- 05 FILLER PIC X(33) VALUE "IE".
- 05 FILLER PIC X(33) VALUE " EBCDIC".
- 05 FILLER PIC X(33) VALUE " EC".
- 05 FILLER PIC X(33) VALUE "VELSE".
-GC0710 05 FILLER PIC X(33) VALUE "KEND".
- 05 FILLER PIC X(33) VALUE " END-ACCEPT".
- 05 FILLER PIC X(33) VALUE " END-ADD".
- 05 FILLER PIC X(33) VALUE " END-CALL".
- 05 FILLER PIC X(33) VALUE " END-COMPUTE".
- 05 FILLER PIC X(33) VALUE " END-DELETE".
- 05 FILLER PIC X(33) VALUE " END-DISPLAY".
- 05 FILLER PIC X(33) VALUE " END-DIVIDE".
- 05 FILLER PIC X(33) VALUE " END-EVALUATE".
- 05 FILLER PIC X(33) VALUE " END-IF".
- 05 FILLER PIC X(33) VALUE " END-MULTIPLY".
- 05 FILLER PIC X(33) VALUE " END-OF-PAGE".
- 05 FILLER PIC X(33) VALUE " END-PERFORM".
- 05 FILLER PIC X(33) VALUE " END-READ".
- 05 FILLER PIC X(33) VALUE " END-RETURN".
- 05 FILLER PIC X(33) VALUE " END-REWRITE".
- 05 FILLER PIC X(33) VALUE " END-SEARCH".
- 05 FILLER PIC X(33) VALUE " END-START".
- 05 FILLER PIC X(33) VALUE " END-STRING".
- 05 FILLER PIC X(33) VALUE " END-SUBTRACT".
- 05 FILLER PIC X(33) VALUE " END-UNSTRING".
- 05 FILLER PIC X(33) VALUE " END-WRITE".
- 05 FILLER PIC X(33) VALUE "VENTRY".
- 05 FILLER PIC X(33) VALUE "KENVIRONMENT".
- 05 FILLER PIC X(33) VALUE " ENVIRONMENT-NAME".
- 05 FILLER PIC X(33) VALUE " ENVIRONMENT-VALUE".
- 05 FILLER PIC X(33) VALUE " EO".
- 05 FILLER PIC X(33) VALUE " EOL".
- 05 FILLER PIC X(33) VALUE " EOP".
- 05 FILLER PIC X(33) VALUE " EOS".
- 05 FILLER PIC X(33) VALUE " EQUAL".
- 05 FILLER PIC X(33) VALUE "KEQUALS".
- 05 FILLER PIC X(33) VALUE " ERASE".
- 05 FILLER PIC X(33) VALUE " ERROR".
- 05 FILLER PIC X(33) VALUE " ESCAPE".
- 05 FILLER PIC X(33) VALUE "VEVALUATE".
- 05 FILLER PIC X(33) VALUE " EXCEPTION".
- 05 FILLER PIC X(33) VALUE "IEXCEPTION-FILE".
- 05 FILLER PIC X(33) VALUE "IEXCEPTION-LOCATION".
- 05 FILLER PIC X(33) VALUE " EXCEPTION-OBJECT".
- 05 FILLER PIC X(33) VALUE "IEXCEPTION-STATEMENT".
- 05 FILLER PIC X(33) VALUE "IEXCEPTION-STATUS".
- 05 FILLER PIC X(33) VALUE " EXCLUSIVE".
- 05 FILLER PIC X(33) VALUE "VEXIT".
- 05 FILLER PIC X(33) VALUE "IEXP".
- 05 FILLER PIC X(33) VALUE "IEXP10".
- 05 FILLER PIC X(33) VALUE " EXTEND".
- 05 FILLER PIC X(33) VALUE " EXTERNAL".
- 05 FILLER PIC X(33) VALUE "IFACTORIAL".
- 05 FILLER PIC X(33) VALUE " FACTORY".
- 05 FILLER PIC X(33) VALUE " FALSE".
- 05 FILLER PIC X(33) VALUE "KFD".
- 05 FILLER PIC X(33) VALUE "KFILE".
- 05 FILLER PIC X(33) VALUE " FILE-CONTROL".
- 05 FILLER PIC X(33) VALUE " FILE-ID".
- 05 FILLER PIC X(33) VALUE " FILLER".
- 05 FILLER PIC X(33) VALUE " FINAL".
- 05 FILLER PIC X(33) VALUE " FIRST".
- 05 FILLER PIC X(33) VALUE " FLOAT-BINARY-16".
- 05 FILLER PIC X(33) VALUE " FLOAT-BINARY-34".
- 05 FILLER PIC X(33) VALUE " FLOAT-BINARY-7".
- 05 FILLER PIC X(33) VALUE " FLOAT-DECIMAL-16".
- 05 FILLER PIC X(33) VALUE " FLOAT-DECIMAL-34".
- 05 FILLER PIC X(33) VALUE " FLOAT-EXTENDED".
- 05 FILLER PIC X(33) VALUE " FLOAT-LONG".
- 05 FILLER PIC X(33) VALUE " FLOAT-SHORT".
- 05 FILLER PIC X(33) VALUE " FOOTING".
- 05 FILLER PIC X(33) VALUE " FOR".
- 05 FILLER PIC X(33) VALUE " FOREGROUND-COLOR".
- 05 FILLER PIC X(33) VALUE " FOREVER".
- 05 FILLER PIC X(33) VALUE " FORMAT".
- 05 FILLER PIC X(33) VALUE "MFORMFEED".
- 05 FILLER PIC X(33) VALUE "IFRACTION-PART".
- 05 FILLER PIC X(33) VALUE "VFREE".
- 05 FILLER PIC X(33) VALUE " FROM".
- 05 FILLER PIC X(33) VALUE " FULL".
- 05 FILLER PIC X(33) VALUE " FUNCTION".
- 05 FILLER PIC X(33) VALUE " FUNCTION-ID".
- 05 FILLER PIC X(33) VALUE " FUNCTION-POINTER".
- 05 FILLER PIC X(33) VALUE "VGENERATE".
- 05 FILLER PIC X(33) VALUE " GET".
- 05 FILLER PIC X(33) VALUE "KGIVING".
- 05 FILLER PIC X(33) VALUE " GLOBAL".
- 05 FILLER PIC X(33) VALUE "VGO".
- 05 FILLER PIC X(33) VALUE "VGOBACK".
- 05 FILLER PIC X(33) VALUE " GREATER".
- 05 FILLER PIC X(33) VALUE " GROUP".
- 05 FILLER PIC X(33) VALUE " GROUP-USAGE".
- 05 FILLER PIC X(33) VALUE " HEADING".
- 05 FILLER PIC X(33) VALUE " HIGH-VALUE".
- 05 FILLER PIC X(33) VALUE " HIGH-VALUES".
- 05 FILLER PIC X(33) VALUE " HIGHLIGHT".
- 05 FILLER PIC X(33) VALUE " I-O".
- 05 FILLER PIC X(33) VALUE " I-O-CONTROL".
- 05 FILLER PIC X(33) VALUE "KID".
- 05 FILLER PIC X(33) VALUE "KIDENTIFICATION".
- 05 FILLER PIC X(33) VALUE "VIF".
- 05 FILLER PIC X(33) VALUE " IGNORE".
- 05 FILLER PIC X(33) VALUE " IGNORING".
- 05 FILLER PIC X(33) VALUE " IN".
- 05 FILLER PIC X(33) VALUE " INDEX".
- 05 FILLER PIC X(33) VALUE "KINDEXED".
- 05 FILLER PIC X(33) VALUE " INDICATE".
- 05 FILLER PIC X(33) VALUE " INFINITY".
- 05 FILLER PIC X(33) VALUE " INHERITS".
- 05 FILLER PIC X(33) VALUE " INITIAL".
- 05 FILLER PIC X(33) VALUE " INITIALISED".
- 05 FILLER PIC X(33) VALUE "VINITIALIZE".
- 05 FILLER PIC X(33) VALUE " INITIALIZED".
- 05 FILLER PIC X(33) VALUE "VINITIATE".
- 05 FILLER PIC X(33) VALUE " INPUT".
- 05 FILLER PIC X(33) VALUE "KINPUT-OUTPUT".
- 05 FILLER PIC X(33) VALUE "VINSPECT".
- 05 FILLER PIC X(33) VALUE " INSTALLATION".
- 05 FILLER PIC X(33) VALUE "IINTEGER".
- 05 FILLER PIC X(33) VALUE "IINTEGER-OF-DATE".
- 05 FILLER PIC X(33) VALUE "IINTEGER-OF-DAY".
- 05 FILLER PIC X(33) VALUE "IINTEGER-PART".
- 05 FILLER PIC X(33) VALUE " INTERFACE".
- 05 FILLER PIC X(33) VALUE " INTERFACE-ID".
- 05 FILLER PIC X(33) VALUE "KINTO".
- 05 FILLER PIC X(33) VALUE " INTRINSIC".
- 05 FILLER PIC X(33) VALUE " INVALID".
- 05 FILLER PIC X(33) VALUE " INVOKE".
- 05 FILLER PIC X(33) VALUE " IS".
- 05 FILLER PIC X(33) VALUE " JUST".
- 05 FILLER PIC X(33) VALUE " JUSTIFIED".
- 05 FILLER PIC X(33) VALUE " KEY".
- 05 FILLER PIC X(33) VALUE " LABEL".
- 05 FILLER PIC X(33) VALUE " LAST".
- 05 FILLER PIC X(33) VALUE " LEADING".
- 05 FILLER PIC X(33) VALUE " LEFT".
- 05 FILLER PIC X(33) VALUE " LEFT-JUSTIFY".
- 05 FILLER PIC X(33) VALUE "ILENGTH".
- 05 FILLER PIC X(33) VALUE " LESS".
- 05 FILLER PIC X(33) VALUE " LIMIT".
- 05 FILLER PIC X(33) VALUE " LIMITS".
- 05 FILLER PIC X(33) VALUE " LINAGE".
- 05 FILLER PIC X(33) VALUE "ILINAGE-COUNTER".
- 05 FILLER PIC X(33) VALUE " LINE".
- 05 FILLER PIC X(33) VALUE " LINE-COUNTER".
- 05 FILLER PIC X(33) VALUE " LINES".
- 05 FILLER PIC X(33) VALUE "KLINKAGE".
- 05 FILLER PIC X(33) VALUE "KLOCAL-STORAGE".
- 05 FILLER PIC X(33) VALUE " LOCALE".
- 05 FILLER PIC X(33) VALUE "ILOCALE-DATE".
- 05 FILLER PIC X(33) VALUE "ILOCALE-TIME".
- 05 FILLER PIC X(33) VALUE "ILOCALE-TIME-FROM-SECONDS".
- 05 FILLER PIC X(33) VALUE " LOCK".
- 05 FILLER PIC X(33) VALUE "ILOG".
- 05 FILLER PIC X(33) VALUE "ILOG10".
- 05 FILLER PIC X(33) VALUE " LOW-VALUE".
- 05 FILLER PIC X(33) VALUE " LOW-VALUES".
- 05 FILLER PIC X(33) VALUE " LOWER".
- 05 FILLER PIC X(33) VALUE "ILOWER-CASE".
- 05 FILLER PIC X(33) VALUE " LOWLIGHT".
- 05 FILLER PIC X(33) VALUE " MANUAL".
- 05 FILLER PIC X(33) VALUE "IMAX".
- 05 FILLER PIC X(33) VALUE "IMEAN".
- 05 FILLER PIC X(33) VALUE "IMEDIAN".
- 05 FILLER PIC X(33) VALUE " MEMORY".
- 05 FILLER PIC X(33) VALUE "VMERGE".
- 05 FILLER PIC X(33) VALUE " METHOD".
- 05 FILLER PIC X(33) VALUE " METHOD-ID".
- 05 FILLER PIC X(33) VALUE "IMIDRANGE".
- 05 FILLER PIC X(33) VALUE "IMIN".
- 05 FILLER PIC X(33) VALUE " MINUS".
- 05 FILLER PIC X(33) VALUE "IMOD".
- 05 FILLER PIC X(33) VALUE " MODE".
- 05 FILLER PIC X(33) VALUE "VMOVE".
- 05 FILLER PIC X(33) VALUE " MULTIPLE".
- 05 FILLER PIC X(33) VALUE "VMULTIPLY".
- 05 FILLER PIC X(33) VALUE " NATIONAL".
- 05 FILLER PIC X(33) VALUE " NATIONAL-EDITED".
- 05 FILLER PIC X(33) VALUE " NATIVE".
- 05 FILLER PIC X(33) VALUE " NEGATIVE".
- 05 FILLER PIC X(33) VALUE " NESTED".
- 05 FILLER PIC X(33) VALUE "VNEXT".
- 05 FILLER PIC X(33) VALUE " NO".
- 05 FILLER PIC X(33) VALUE " NOT".
- 05 FILLER PIC X(33) VALUE " NULL".
- 05 FILLER PIC X(33) VALUE " NULLS".
- 05 FILLER PIC X(33) VALUE " NUMBER".
- 05 FILLER PIC X(33) VALUE "INUMBER-OF-CALL-PARAMETERS".
- 05 FILLER PIC X(33) VALUE " NUMBERS".
- 05 FILLER PIC X(33) VALUE " NUMERIC".
- 05 FILLER PIC X(33) VALUE " NUMERIC-EDITED".
- 05 FILLER PIC X(33) VALUE "INUMVAL".
- 05 FILLER PIC X(33) VALUE "INUMVAL-C".
- 05 FILLER PIC X(33) VALUE " OBJECT".
- 05 FILLER PIC X(33) VALUE " OBJECT-COMPUTER".
- 05 FILLER PIC X(33) VALUE " OBJECT-REFERENCE".
- 05 FILLER PIC X(33) VALUE " OCCURS".
- 05 FILLER PIC X(33) VALUE " OF".
- 05 FILLER PIC X(33) VALUE " OFF".
- 05 FILLER PIC X(33) VALUE " OMITTED".
- 05 FILLER PIC X(33) VALUE " ON".
- 05 FILLER PIC X(33) VALUE " ONLY".
- 05 FILLER PIC X(33) VALUE "VOPEN".
- 05 FILLER PIC X(33) VALUE " OPTIONAL".
- 05 FILLER PIC X(33) VALUE " OPTIONS".
- 05 FILLER PIC X(33) VALUE " OR".
- 05 FILLER PIC X(33) VALUE "IORD".
- 05 FILLER PIC X(33) VALUE "IORD-MAX".
- 05 FILLER PIC X(33) VALUE "IORD-MIN".
- 05 FILLER PIC X(33) VALUE " ORDER".
- 05 FILLER PIC X(33) VALUE " ORGANIZATION".
- 05 FILLER PIC X(33) VALUE " OTHER".
- 05 FILLER PIC X(33) VALUE " OUTPUT".
- 05 FILLER PIC X(33) VALUE " OVERFLOW".
- 05 FILLER PIC X(33) VALUE " OVERLINE".
- 05 FILLER PIC X(33) VALUE " OVERRIDE".
- 05 FILLER PIC X(33) VALUE " PACKED-DECIMAL".
- 05 FILLER PIC X(33) VALUE " PADDING".
- 05 FILLER PIC X(33) VALUE " PAGE".
- 05 FILLER PIC X(33) VALUE " PAGE-COUNTER".
- 05 FILLER PIC X(33) VALUE " PARAGRAPH".
- 05 FILLER PIC X(33) VALUE "VPERFORM".
- 05 FILLER PIC X(33) VALUE " PF".
- 05 FILLER PIC X(33) VALUE " PH".
- 05 FILLER PIC X(33) VALUE "IPI".
- 05 FILLER PIC X(33) VALUE "KPIC".
- 05 FILLER PIC X(33) VALUE "KPICTURE".
- 05 FILLER PIC X(33) VALUE " PLUS".
- 05 FILLER PIC X(33) VALUE "KPOINTER".
- 05 FILLER PIC X(33) VALUE " POSITION".
- 05 FILLER PIC X(33) VALUE " POSITIVE".
- 05 FILLER PIC X(33) VALUE " PRESENT".
- 05 FILLER PIC X(33) VALUE "IPRESENT-VALUE".
- 05 FILLER PIC X(33) VALUE " PREVIOUS".
- 05 FILLER PIC X(33) VALUE "MPRINTER".
- 05 FILLER PIC X(33) VALUE " PRINTING".
- 05 FILLER PIC X(33) VALUE "KPROCEDURE".
- 05 FILLER PIC X(33) VALUE " PROCEDURE-POINTER".
- 05 FILLER PIC X(33) VALUE " PROCEDURES".
- 05 FILLER PIC X(33) VALUE " PROCEED".
- 05 FILLER PIC X(33) VALUE " PROGRAM".
- 05 FILLER PIC X(33) VALUE "KPROGRAM-ID".
- 05 FILLER PIC X(33) VALUE " PROGRAM-POINTER".
- 05 FILLER PIC X(33) VALUE " PROMPT".
- 05 FILLER PIC X(33) VALUE " PROPERTY".
- 05 FILLER PIC X(33) VALUE " PROTOTYPE".
- 05 FILLER PIC X(33) VALUE " QUOTE".
- 05 FILLER PIC X(33) VALUE " QUOTES".
- 05 FILLER PIC X(33) VALUE " RAISE".
- 05 FILLER PIC X(33) VALUE " RAISING".
- 05 FILLER PIC X(33) VALUE "IRANDOM".
- 05 FILLER PIC X(33) VALUE "IRANGE".
- 05 FILLER PIC X(33) VALUE " RD".
- 05 FILLER PIC X(33) VALUE "VREAD".
- 05 FILLER PIC X(33) VALUE "VREADY".
- 05 FILLER PIC X(33) VALUE " RECORD".
- 05 FILLER PIC X(33) VALUE " RECORDING".
- 05 FILLER PIC X(33) VALUE " RECORDS".
- 05 FILLER PIC X(33) VALUE " RECURSIVE".
- 05 FILLER PIC X(33) VALUE "KREDEFINES".
- 05 FILLER PIC X(33) VALUE " REEL".
- 05 FILLER PIC X(33) VALUE " REFERENCE".
- 05 FILLER PIC X(33) VALUE " RELATIVE".
- 05 FILLER PIC X(33) VALUE "VRELEASE".
- 05 FILLER PIC X(33) VALUE "IREM".
- 05 FILLER PIC X(33) VALUE " REMAINDER".
- 05 FILLER PIC X(33) VALUE " REMARKS".
- 05 FILLER PIC X(33) VALUE " REMOVAL".
- 05 FILLER PIC X(33) VALUE "KRENAMES".
- 05 FILLER PIC X(33) VALUE "KREPLACING".
- 05 FILLER PIC X(33) VALUE "KREPORT".
- 05 FILLER PIC X(33) VALUE " REPORTING".
- 05 FILLER PIC X(33) VALUE " REPORTS".
- 05 FILLER PIC X(33) VALUE " REPOSITORY".
- 05 FILLER PIC X(33) VALUE " REPRESENTS-NOT-A-NUMBER".
- 05 FILLER PIC X(33) VALUE " REQUIRED".
- 05 FILLER PIC X(33) VALUE " RESERVE".
- 05 FILLER PIC X(33) VALUE " RESUME".
- 05 FILLER PIC X(33) VALUE " RETRY".
- 05 FILLER PIC X(33) VALUE "VRETURN".
- 05 FILLER PIC X(33) VALUE "IRETURN-CODE".
- 05 FILLER PIC X(33) VALUE "KRETURNING".
- 05 FILLER PIC X(33) VALUE "IREVERSE".
- 05 FILLER PIC X(33) VALUE " REVERSE-VIDEO".
- 05 FILLER PIC X(33) VALUE " REWIND".
- 05 FILLER PIC X(33) VALUE "VREWRITE".
- 05 FILLER PIC X(33) VALUE " RF".
- 05 FILLER PIC X(33) VALUE " RH".
- 05 FILLER PIC X(33) VALUE " RIGHT".
- 05 FILLER PIC X(33) VALUE " RIGHT-JUSTIFY".
- 05 FILLER PIC X(33) VALUE "VROLLBACK".
- 05 FILLER PIC X(33) VALUE " ROUNDED".
- 05 FILLER PIC X(33) VALUE " RUN".
- 05 FILLER PIC X(33) VALUE " SAME".
- 05 FILLER PIC X(33) VALUE "KSCREEN".
- 05 FILLER PIC X(33) VALUE " SCROLL".
- 05 FILLER PIC X(33) VALUE "KSD".
- 05 FILLER PIC X(33) VALUE "VSEARCH".
- 05 FILLER PIC X(33) VALUE "ISECONDS-FROM-FORMATTED-TIME".
- 05 FILLER PIC X(33) VALUE "ISECONDS-PAST-MIDNIGHT".
- 05 FILLER PIC X(33) VALUE "KSECTION".
- 05 FILLER PIC X(33) VALUE " SECURE".
- 05 FILLER PIC X(33) VALUE " SECURITY".
- 05 FILLER PIC X(33) VALUE " SEGMENT-LIMIT".
- 05 FILLER PIC X(33) VALUE " SELECT".
- 05 FILLER PIC X(33) VALUE " SELF".
- 05 FILLER PIC X(33) VALUE " SENTENCE".
- 05 FILLER PIC X(33) VALUE " SEPARATE".
- 05 FILLER PIC X(33) VALUE " SEQUENCE".
- 05 FILLER PIC X(33) VALUE " SEQUENTIAL".
- 05 FILLER PIC X(33) VALUE "VSET".
- 05 FILLER PIC X(33) VALUE " SHARING".
- 05 FILLER PIC X(33) VALUE "ISIGN".
- 05 FILLER PIC X(33) VALUE " SIGNED".
- 05 FILLER PIC X(33) VALUE " SIGNED-INT".
- 05 FILLER PIC X(33) VALUE " SIGNED-LONG".
- 05 FILLER PIC X(33) VALUE " SIGNED-SHORT".
- 05 FILLER PIC X(33) VALUE "ISIN".
- 05 FILLER PIC X(33) VALUE " SIZE".
- 05 FILLER PIC X(33) VALUE "VSORT".
- 05 FILLER PIC X(33) VALUE " SORT-MERGE".
- 05 FILLER PIC X(33) VALUE "ISORT-RETURN".
- 05 FILLER PIC X(33) VALUE " SOURCE".
- 05 FILLER PIC X(33) VALUE " SOURCE-COMPUTER".
- 05 FILLER PIC X(33) VALUE " SOURCES".
- 05 FILLER PIC X(33) VALUE " SPACE".
- 05 FILLER PIC X(33) VALUE " SPACE-FILL".
- 05 FILLER PIC X(33) VALUE " SPACES".
- 05 FILLER PIC X(33) VALUE " SPECIAL-NAMES".
- 05 FILLER PIC X(33) VALUE "ISQRT".
- 05 FILLER PIC X(33) VALUE " STANDARD".
- 05 FILLER PIC X(33) VALUE " STANDARD-1".
- 05 FILLER PIC X(33) VALUE " STANDARD-2".
- 05 FILLER PIC X(33) VALUE "ISTANDARD-DEVIATION".
- 05 FILLER PIC X(33) VALUE "VSTART".
- 05 FILLER PIC X(33) VALUE " STATUS".
- 05 FILLER PIC X(33) VALUE "VSTOP".
- 05 FILLER PIC X(33) VALUE "ISTORED-CHAR-LENGTH".
- 05 FILLER PIC X(33) VALUE "VSTRING".
- 05 FILLER PIC X(33) VALUE "ISUBSTITUTE".
- 05 FILLER PIC X(33) VALUE "ISUBSTITUTE-CASE".
- 05 FILLER PIC X(33) VALUE "VSUBTRACT".
- 05 FILLER PIC X(33) VALUE "ISUM".
- 05 FILLER PIC X(33) VALUE " SUPER".
- 05 FILLER PIC X(33) VALUE "VSUPPRESS".
- 05 FILLER PIC X(33) VALUE "MSWITCH-1".
- 05 FILLER PIC X(33) VALUE "MSWITCH-2".
- 05 FILLER PIC X(33) VALUE "MSWITCH-3".
- 05 FILLER PIC X(33) VALUE "MSWITCH-4".
- 05 FILLER PIC X(33) VALUE "MSWITCH-5".
- 05 FILLER PIC X(33) VALUE "MSWITCH-6".
- 05 FILLER PIC X(33) VALUE "MSWITCH-7".
- 05 FILLER PIC X(33) VALUE "MSWITCH-8".
- 05 FILLER PIC X(33) VALUE " SYMBOLIC".
- 05 FILLER PIC X(33) VALUE " SYNC".
- 05 FILLER PIC X(33) VALUE " SYNCHRONIZED".
- 05 FILLER PIC X(33) VALUE "MSYSERR".
- 05 FILLER PIC X(33) VALUE "MSYSIN".
- 05 FILLER PIC X(33) VALUE "MSYSIPT".
- 05 FILLER PIC X(33) VALUE "MSYSLIST".
- 05 FILLER PIC X(33) VALUE "MSYSLST".
- 05 FILLER PIC X(33) VALUE "MSYSOUT".
- 05 FILLER PIC X(33) VALUE " SYSTEM-DEFAULT".
- 05 FILLER PIC X(33) VALUE " TABLE".
- 05 FILLER PIC X(33) VALUE "KTALLYING".
- 05 FILLER PIC X(33) VALUE "ITAN".
- 05 FILLER PIC X(33) VALUE " TAPE".
- 05 FILLER PIC X(33) VALUE "VTERMINATE".
- 05 FILLER PIC X(33) VALUE " TEST".
- 05 FILLER PIC X(33) VALUE "ITEST-DATE-YYYYMMDD".
- 05 FILLER PIC X(33) VALUE "ITEST-DAY-YYYYDDD".
- 05 FILLER PIC X(33) VALUE " THAN".
- 05 FILLER PIC X(33) VALUE " THEN".
- 05 FILLER PIC X(33) VALUE " THROUGH".
- 05 FILLER PIC X(33) VALUE " THRU".
- 05 FILLER PIC X(33) VALUE " TIME".
- 05 FILLER PIC X(33) VALUE " TIMES".
- 05 FILLER PIC X(33) VALUE "KTO".
- 05 FILLER PIC X(33) VALUE " TOP".
- 05 FILLER PIC X(33) VALUE " TRAILING".
- 05 FILLER PIC X(33) VALUE " TRAILING-SIGN".
- 05 FILLER PIC X(33) VALUE "VTRANSFORM".
- 05 FILLER PIC X(33) VALUE "ITRIM".
- 05 FILLER PIC X(33) VALUE " TRUE".
- 05 FILLER PIC X(33) VALUE " TYPE".
- 05 FILLER PIC X(33) VALUE " TYPEDEF".
- 05 FILLER PIC X(33) VALUE " UNDERLINE".
- 05 FILLER PIC X(33) VALUE " UNIT".
- 05 FILLER PIC X(33) VALUE " UNIVERSAL".
- 05 FILLER PIC X(33) VALUE "VUNLOCK".
- 05 FILLER PIC X(33) VALUE " UNSIGNED".
- 05 FILLER PIC X(33) VALUE " UNSIGNED-INT".
- 05 FILLER PIC X(33) VALUE " UNSIGNED-LONG".
- 05 FILLER PIC X(33) VALUE " UNSIGNED-SHORT".
- 05 FILLER PIC X(33) VALUE "VUNSTRING".
- 05 FILLER PIC X(33) VALUE " UNTIL".
- 05 FILLER PIC X(33) VALUE "KUP".
- 05 FILLER PIC X(33) VALUE " UPDATE".
- 05 FILLER PIC X(33) VALUE " UPON".
- 05 FILLER PIC X(33) VALUE " UPPER".
- 05 FILLER PIC X(33) VALUE "IUPPER-CASE".
- 05 FILLER PIC X(33) VALUE " USAGE".
- 05 FILLER PIC X(33) VALUE "VUSE".
- 05 FILLER PIC X(33) VALUE " USER-DEFAULT".
- 05 FILLER PIC X(33) VALUE "KUSING".
- 05 FILLER PIC X(33) VALUE " VAL-STATUS".
- 05 FILLER PIC X(33) VALUE " VALID".
- 05 FILLER PIC X(33) VALUE " VALIDATE".
- 05 FILLER PIC X(33) VALUE " VALIDATE-STATUS".
- 05 FILLER PIC X(33) VALUE " VALUE".
- 05 FILLER PIC X(33) VALUE " VALUES".
- 05 FILLER PIC X(33) VALUE "IVARIANCE".
- 05 FILLER PIC X(33) VALUE "KVARYING".
- 05 FILLER PIC X(33) VALUE " WAIT".
- 05 FILLER PIC X(33) VALUE "VWHEN".
- 05 FILLER PIC X(33) VALUE "IWHEN-COMPILED".
- 05 FILLER PIC X(33) VALUE " WITH".
- 05 FILLER PIC X(33) VALUE " WORDS".
- 05 FILLER PIC X(33) VALUE "KWORKING-STORAGE".
- 05 FILLER PIC X(33) VALUE "VWRITE".
- 05 FILLER PIC X(33) VALUE "IYEAR-TO-YYYY".
- 05 FILLER PIC X(33) VALUE " YYYYDDD".
- 05 FILLER PIC X(33) VALUE " YYYYMMDD".
- 05 FILLER PIC X(33) VALUE " ZERO".
- 05 FILLER PIC X(33) VALUE " ZERO-FILL".
- 05 FILLER PIC X(33) VALUE " ZEROES".
- 05 FILLER PIC X(33) VALUE " ZEROS".
- 01 Reserved-Word-Table REDEFINES Reserved-Words.
- 05 Reserved-Word OCCURS 591 TIMES
- ASCENDING KEY RW-Word
- INDEXED RW-Idx.
- 10 RW-Type PIC X(1).
- 10 RW-Word PIC X(32).
-
- 01 Saved-Section PIC X(15).
-
- 01 Search-Token PIC X(32).
-
- 01 Source-Line-No PIC 9(6).
-
- 01 Src-Ptr USAGE BINARY-LONG.
-
- 01 Syntax-Parsing-Items.
- 05 SPI-Current-Char PIC X(1).
- 88 Current-Char-Is-Punct VALUE "=", "(", ")", "*", "/",
- "&", ";", ",", "<", ">",
- ":".
- 88 Current-Char-Is-Quote VALUE '"', "'".
- 88 Current-Char-Is-X VALUE "x", "X".
- 88 Current-Char-Is-Z VALUE "z", "Z".
- 05 SPI-Current-Division PIC X(1).
- 88 In-IDENTIFICATION-DIVISION VALUE "I", "?".
- 88 In-ENVIRONMENT-DIVISION VALUE "E".
- 88 In-DATA-DIVISION VALUE "D".
- 88 In-PROCEDURE-DIVISION VALUE "P".
- 05 SPI-Current-Line-No PIC 9(6).
- 05 SPI-Current-Program-ID.
- 10 FILLER PIC X(12).
- 10 SPI-CP-13-15 PIC X(3).
- 05 SPI-Current-Section.
- 10 SPI-CS-1 PIC X(1).
- 10 SPI-CS-2-14.
- 15 FILLER PIC X(10).
- 15 SPI-CS-11-14 PIC X(3).
- 10 SPI-CS-15 PIC X(1).
- 05 SPI-Current-Token PIC X(32).
- 05 SPI-Current-Token-UC PIC X(32).
- 05 SPI-Current-Verb PIC X(12).
- 05 SPI-Next-Char PIC X(1).
- 88 Next-Char-Is-Quote VALUE '"', "'".
- 05 SPI-Prior-Token PIC X(32).
- 05 SPI-Token-Type PIC X(1).
- 88 Token-Is-EOF VALUE HIGH-VALUES.
- 88 Token-Is-Identifier VALUE "I".
- 88 Token-Is-Key-Word VALUE "K", "V".
- 88 Token-Is-Literal-Alpha VALUE "L".
- 88 Token-Is-Literal-Number VALUE "N".
- 88 Token-Is-Verb VALUE "V".
-GC0710 88 Token-Is-Reserved-Word VALUE " ".
-
- 01 Tally USAGE BINARY-LONG.
-
- 01 Todays-Date PIC 9(8).
-
- LINKAGE SECTION.
- 01 Produce-Source-Listing PIC X(1).
- 01 Produce-Xref-Listing PIC X(1).
- 01 Src-Filename PIC X(256).
- /
- PROCEDURE DIVISION USING Produce-Source-Listing
- Produce-Xref-Listing
- Src-Filename.
- 000-Main SECTION.
- 001-Init.
- PERFORM 100-Initialization
- PERFORM 200-Execute-cobc
- OPEN OUTPUT Report-File
- IF Produce-Source-Listing NOT = SPACE
- PERFORM 500-Produce-Source-Listing
- END-IF
- IF Produce-Xref-Listing NOT = SPACE
- SORT Sort-File
- ASCENDING KEY SR-Prog-ID
- SR-Token-UC
- SR-Line-No-Ref
- INPUT PROCEDURE 300-Tokenize-Source
- OUTPUT PROCEDURE 400-Produce-Xref-Listing
- END-IF
- CLOSE Report-File
- GOBACK
- .
- /
- 100-Initialization SECTION.
- *****************************************************************
- ** Perform all program-wide initialization operations **
- *****************************************************************
- END PROGRAM LISTING.
diff --git a/tests/examplefiles/example.coffee b/tests/examplefiles/example.coffee
deleted file mode 100644
index 2cbd1df3..00000000
--- a/tests/examplefiles/example.coffee
+++ /dev/null
@@ -1,27 +0,0 @@
-# function arrows
-
-methodA:-> 'A'
-methodB:=> 'B'
-methodC:()=> 'C'
-methodD:()-> 'D'
-methodE:(a,b)-> 'E'
-methodF:(c,d)-> 'F'
--> 'G'
-=> 'H'
-
-(-> 'I')
-(=> 'J')
-
-# strings
-
-"#{wow}"
-"w#{wow}w"
-"#wow"
-"wow#"
-"w#ow"
-
-'#{wow}'
-'w#{wow}w'
-'#wow'
-'wow#'
-'w#ow'
diff --git a/tests/examplefiles/example.cpp b/tests/examplefiles/example.cpp
deleted file mode 100644
index 334e7ca7..00000000
--- a/tests/examplefiles/example.cpp
+++ /dev/null
@@ -1,2363 +0,0 @@
-/***************************************************************************
- ansigenerator.cpp - description
- -------------------
- begin : Jul 5 2004
- copyright : (C) 2004 by Andr Simon
- email : andre.simon1@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * 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 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#include "ansigenerator.h"
-
-using namespace std;
-
-namespace highlight {
-
-
-string AnsiGenerator::getOpenTag(const string&font,
- const string&fgCol, const string&bgCol) {
- ostringstream s;
- s << "\033["<<font;
- if (!fgCol.empty())
- s<<";"<<fgCol;
- if (!bgCol.empty())
- s<<";"<<bgCol;
- s << "m";
- return s.str();
-}
-
-
-AnsiGenerator::AnsiGenerator(const string &colourTheme)
- : CodeGenerator(colourTheme) {
- styleTagOpen.push_back("");
- styleTagOpen.push_back(getOpenTag("00", "31")); //str
- styleTagOpen.push_back(getOpenTag("00", "34"));//number
- styleTagOpen.push_back(getOpenTag("00", "34"));//sl comment
- styleTagOpen.push_back(getOpenTag("00", "34"));//ml comment
- styleTagOpen.push_back(getOpenTag("00", "35"));//escapeChar
- styleTagOpen.push_back(getOpenTag("00", "35"));//directive
- styleTagOpen.push_back(getOpenTag("01", "31"));//directive string
- styleTagOpen.push_back(getOpenTag("00", "30"));//linenum
- styleTagOpen.push_back(getOpenTag("01", "00"));//symbol
-
- styleTagClose.push_back("");
- for (int i=1;i<NUMBER_BUILTIN_STYLES; i++) {
- styleTagClose.push_back("\033[m");
- }
- newLineTag = "\n";
- spacer = " ";
-}
-
-AnsiGenerator::AnsiGenerator() {}
-AnsiGenerator::~AnsiGenerator() {}
-
-string AnsiGenerator::getHeader(const string & title) {
- return string();
-}
-
-void AnsiGenerator::printBody() {
- processRootState();
-}
-
-string AnsiGenerator::getFooter() {
- return string();
-}
-
-string AnsiGenerator::maskCharacter(unsigned char c) {
- string m;
- m+=c;
- return m;
-}
-
-string AnsiGenerator::getMatchingOpenTag(unsigned int styleID) {
- return (styleID)?getOpenTag("01", "32", ""):getOpenTag("00", "33");
-}
-
-string AnsiGenerator::getMatchingCloseTag(unsigned int styleID) {
- return "\033[m";
-}
-
-}
-/***************************************************************************
- ansicode.h - description
- -------------------
- begin : Jul 5 2004
- copyright : (C) 2004 by Andre Simon
- email : andre.simon1@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * 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 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#ifndef ANSIGENERATOR_H
-#define ANSIGENERATOR_H
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <sstream>
-
-#include "codegenerator.h"
-#include "charcodes.h"
-#include "version.h"
-
-namespace highlight {
-
-/**
- \brief This class generates ANSI escape sequences.
-
- It contains information about the resulting document structure (document
- header and footer), the colour system, white space handling and text
- formatting attributes.
-
-* @author Andre Simon
-*/
-
-class AnsiGenerator : public highlight::CodeGenerator
- {
- public:
-
- /** Constructor
- \param colourTheme Name of Colour theme to use
- */
- AnsiGenerator( const string &colourTheme);
- AnsiGenerator();
- ~AnsiGenerator();
-
- /** prints document header
- \param title Title of the document
- */
- string getHeader(const string & title);
-
- /** Prints document footer*/
- string getFooter();
-
- /** Prints document body*/
- void printBody();
-
- private:
-
- /** \return escaped character*/
- virtual string maskCharacter(unsigned char );
-
-
- /** gibt ANSI-"Tags" zurueck (Farbindex+bold+kursiv)*/
- string getOpenTag(const string&font,
- const string&fgCol, const string&bgCol="");
-
-
-
- string getMatchingOpenTag(unsigned int styleID);
- string getMatchingCloseTag(unsigned int styleID);
- };
-
-}
-#endif
-/*
- * Copyright (c) 1998,1999,2000,2001,2002 Tal Davidson. All rights reserved.
- *
- * ASBeautifier.cpp
- * by Tal Davidson (davidsont@bigfoot.com)
- * This file is a part of "Artistic Style" - an indentater and reformatter
- * of C, C, C# and Java source files.
- *
- * The "Artistic Style" project, including all files needed to compile it,
- * is free software; you can redistribute it and/or use it and/or modify it
- * under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2 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.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program.
- *
- * Patches:
- * 18 March 1999 - Brian Rampel -
- * Fixed inverse insertion of spaces vs. tabs when in -t mode.
- * 08 may 2004
- * applied ASBeautifier.cpp.BITFIELD.patch.bz2
- */
-
-#include "compiler_defines.h"
-#include "ASBeautifier.h"
-
-#include <vector>
-#include <string>
-#include <cctype>
-#include <algorithm>
-#include <iostream>
-
-
-#define INIT_CONTAINER(container, value) {if ( (container) != NULL ) delete (container); (container) = (value); }
-#define DELETE_CONTAINER(container) {if ( (container) != NULL ) delete (container) ; }
-
-#ifdef USES_NAMESPACE
-using namespace std;
-#endif
-
-
-
-
-#ifdef USES_NAMESPACE
-namespace astyle
- {
-#endif
-
- bool ASBeautifier::calledInitStatic = false;
-
- vector<const string*> ASBeautifier::headers;
- vector<const string*> ASBeautifier::nonParenHeaders;
- vector<const string*> ASBeautifier::preBlockStatements;
- vector<const string*> ASBeautifier::assignmentOperators;
- vector<const string*> ASBeautifier::nonAssignmentOperators;
-
- /*
- * initialize the static vars
- */
- void ASBeautifier::initStatic()
- {
- if (calledInitStatic)
- return;
-
- calledInitStatic = true;
-
- headers.push_back(&AS_IF);
- headers.push_back(&AS_ELSE);
- headers.push_back(&AS_FOR);
- headers.push_back(&AS_WHILE);
- headers.push_back(&AS_DO);
- headers.push_back(&AS_TRY);
- headers.push_back(&AS_CATCH);
- headers.push_back(&AS_FINALLY);
- headers.push_back(&AS_SYNCHRONIZED);
- headers.push_back(&AS_SWITCH);
- headers.push_back(&AS_CASE);
- headers.push_back(&AS_DEFAULT);
- headers.push_back(&AS_FOREACH);
- headers.push_back(&AS_LOCK);
- headers.push_back(&AS_UNSAFE);
- headers.push_back(&AS_FIXED);
- headers.push_back(&AS_GET);
- headers.push_back(&AS_SET);
- headers.push_back(&AS_ADD);
- headers.push_back(&AS_REMOVE);
- //headers.push_back(&AS_PUBLIC);
- //headers.push_back(&AS_PRIVATE);
- //headers.push_back(&AS_PROTECTED);
-
- //headers.push_back(&AS_OPERATOR);
- headers.push_back(&AS_TEMPLATE);
- headers.push_back(&AS_CONST);
- /**/
- headers.push_back(&AS_STATIC);
- headers.push_back(&AS_EXTERN);
-
- nonParenHeaders.push_back(&AS_ELSE);
- nonParenHeaders.push_back(&AS_DO);
- nonParenHeaders.push_back(&AS_TRY);
- nonParenHeaders.push_back(&AS_FINALLY);
- nonParenHeaders.push_back(&AS_STATIC);
- nonParenHeaders.push_back(&AS_CONST);
- nonParenHeaders.push_back(&AS_EXTERN);
- nonParenHeaders.push_back(&AS_CASE);
- nonParenHeaders.push_back(&AS_DEFAULT);
- nonParenHeaders.push_back(&AS_UNSAFE);
- nonParenHeaders.push_back(&AS_GET);
- nonParenHeaders.push_back(&AS_SET);
- nonParenHeaders.push_back(&AS_ADD);
- nonParenHeaders.push_back(&AS_REMOVE);
-
-
-
- nonParenHeaders.push_back(&AS_PUBLIC);
- nonParenHeaders.push_back(&AS_PRIVATE);
- nonParenHeaders.push_back(&AS_PROTECTED);
- nonParenHeaders.push_back(&AS_TEMPLATE);
- nonParenHeaders.push_back(&AS_CONST);
- /// nonParenHeaders.push_back(&AS_ASM);
-
- preBlockStatements.push_back(&AS_CLASS);
- preBlockStatements.push_back(&AS_STRUCT);
- preBlockStatements.push_back(&AS_UNION);
- preBlockStatements.push_back(&AS_INTERFACE);
- preBlockStatements.push_back(&AS_NAMESPACE);
- preBlockStatements.push_back(&AS_THROWS);
- preBlockStatements.push_back(&AS_EXTERN);
-
- assignmentOperators.push_back(&AS_ASSIGN);
- assignmentOperators.push_back(&AS_PLUS_ASSIGN);
- assignmentOperators.push_back(&AS_MINUS_ASSIGN);
- assignmentOperators.push_back(&AS_MULT_ASSIGN);
- assignmentOperators.push_back(&AS_DIV_ASSIGN);
- assignmentOperators.push_back(&AS_MOD_ASSIGN);
- assignmentOperators.push_back(&AS_OR_ASSIGN);
- assignmentOperators.push_back(&AS_AND_ASSIGN);
- assignmentOperators.push_back(&AS_XOR_ASSIGN);
- assignmentOperators.push_back(&AS_GR_GR_GR_ASSIGN);
- assignmentOperators.push_back(&AS_GR_GR_ASSIGN);
- assignmentOperators.push_back(&AS_LS_LS_LS_ASSIGN);
- assignmentOperators.push_back(&AS_LS_LS_ASSIGN);
-
- assignmentOperators.push_back(&AS_RETURN);
-
- nonAssignmentOperators.push_back(&AS_EQUAL);
- nonAssignmentOperators.push_back(&AS_PLUS_PLUS);
- nonAssignmentOperators.push_back(&AS_MINUS_MINUS);
- nonAssignmentOperators.push_back(&AS_NOT_EQUAL);
- nonAssignmentOperators.push_back(&AS_GR_EQUAL);
- nonAssignmentOperators.push_back(&AS_GR_GR_GR);
- nonAssignmentOperators.push_back(&AS_GR_GR);
- nonAssignmentOperators.push_back(&AS_LS_EQUAL);
- nonAssignmentOperators.push_back(&AS_LS_LS_LS);
- nonAssignmentOperators.push_back(&AS_LS_LS);
- nonAssignmentOperators.push_back(&AS_ARROW);
- nonAssignmentOperators.push_back(&AS_AND);
- nonAssignmentOperators.push_back(&AS_OR);
- }
-
- /**
- * ASBeautifier's constructor
- */
- ASBeautifier::ASBeautifier()
- {
- initStatic();
-
- waitingBeautifierStack = NULL;
- activeBeautifierStack = NULL;
- waitingBeautifierStackLengthStack = NULL;
- activeBeautifierStackLengthStack = NULL;
-
- headerStack = NULL;
- tempStacks = NULL;
- blockParenDepthStack = NULL;
- blockStatementStack = NULL;
- parenStatementStack = NULL;
- bracketBlockStateStack = NULL;
- inStatementIndentStack = NULL;
- inStatementIndentStackSizeStack = NULL;
- parenIndentStack = NULL;
- sourceIterator = NULL;
-
- isMinimalConditinalIndentSet = false;
- shouldForceTabIndentation = false;
-
- setSpaceIndentation(4);
- setMaxInStatementIndentLength(40);
- setClassIndent(false);
- setSwitchIndent(false);
- setCaseIndent(false);
- setBlockIndent(false);
- setBracketIndent(false);
- setNamespaceIndent(false);
- setLabelIndent(false);
- setEmptyLineFill(false);
- setCStyle();
- setPreprocessorIndent(false);
- }
-
- ASBeautifier::ASBeautifier(const ASBeautifier &other)
- {
- waitingBeautifierStack = NULL;
- activeBeautifierStack = NULL;
- waitingBeautifierStackLengthStack = NULL;
- activeBeautifierStackLengthStack = NULL;
-
- headerStack = new vector<const string*>;
- *headerStack = *other.headerStack;
-
- tempStacks = new vector< vector<const string*>* >;
- vector< vector<const string*>* >::iterator iter;
- for (iter = other.tempStacks->begin();
- iter != other.tempStacks->end();
- ++iter)
- {
- vector<const string*> *newVec = new vector<const string*>;
- *newVec = **iter;
- tempStacks->push_back(newVec);
- }
- blockParenDepthStack = new vector<int>;
- *blockParenDepthStack = *other.blockParenDepthStack;
-
- blockStatementStack = new vector<bool>;
- *blockStatementStack = *other.blockStatementStack;
-
- parenStatementStack = new vector<bool>;
- *parenStatementStack = *other.parenStatementStack;
-
- bracketBlockStateStack = new vector<bool>;
- *bracketBlockStateStack = *other.bracketBlockStateStack;
-
- inStatementIndentStack = new vector<int>;
- *inStatementIndentStack = *other.inStatementIndentStack;
-
- inStatementIndentStackSizeStack = new vector<int>;
- *inStatementIndentStackSizeStack = *other.inStatementIndentStackSizeStack;
-
- parenIndentStack = new vector<int>;
- *parenIndentStack = *other.parenIndentStack;
-
- sourceIterator = other.sourceIterator;
-
- indentString = other.indentString;
- currentHeader = other.currentHeader;
- previousLastLineHeader = other.previousLastLineHeader;
- immediatelyPreviousAssignmentOp = other.immediatelyPreviousAssignmentOp;
- isInQuote = other.isInQuote;
- isInComment = other.isInComment;
- isInCase = other.isInCase;
- isInQuestion = other.isInQuestion;
- isInStatement =other. isInStatement;
- isInHeader = other.isInHeader;
- isCStyle = other.isCStyle;
- isInOperator = other.isInOperator;
- isInTemplate = other.isInTemplate;
- isInConst = other.isInConst;
- classIndent = other.classIndent;
- isInClassHeader = other.isInClassHeader;
- isInClassHeaderTab = other.isInClassHeaderTab;
- switchIndent = other.switchIndent;
- caseIndent = other.caseIndent;
- namespaceIndent = other.namespaceIndent;
- bracketIndent = other.bracketIndent;
- blockIndent = other.blockIndent;
- labelIndent = other.labelIndent;
- preprocessorIndent = other.preprocessorIndent;
- parenDepth = other.parenDepth;
- indentLength = other.indentLength;
- blockTabCount = other.blockTabCount;
- leadingWhiteSpaces = other.leadingWhiteSpaces;
- maxInStatementIndent = other.maxInStatementIndent;
- templateDepth = other.templateDepth;
- quoteChar = other.quoteChar;
- prevNonSpaceCh = other.prevNonSpaceCh;
- currentNonSpaceCh = other.currentNonSpaceCh;
- currentNonLegalCh = other.currentNonLegalCh;
- prevNonLegalCh = other.prevNonLegalCh;
- isInConditional = other.isInConditional;
- minConditionalIndent = other.minConditionalIndent;
- prevFinalLineSpaceTabCount = other.prevFinalLineSpaceTabCount;
- prevFinalLineTabCount = other.prevFinalLineTabCount;
- emptyLineFill = other.emptyLineFill;
- probationHeader = other.probationHeader;
- isInDefine = other.isInDefine;
- isInDefineDefinition = other.isInDefineDefinition;
- backslashEndsPrevLine = other.backslashEndsPrevLine;
- defineTabCount = other.defineTabCount;
- }
-
- /**
- * ASBeautifier's destructor
- */
- ASBeautifier::~ASBeautifier()
- {
- DELETE_CONTAINER( headerStack );
- DELETE_CONTAINER( tempStacks );
- DELETE_CONTAINER( blockParenDepthStack );
- DELETE_CONTAINER( blockStatementStack );
- DELETE_CONTAINER( parenStatementStack );
- DELETE_CONTAINER( bracketBlockStateStack );
- DELETE_CONTAINER( inStatementIndentStack );
- DELETE_CONTAINER( inStatementIndentStackSizeStack );
- DELETE_CONTAINER( parenIndentStack );
-
- // DELETE_CONTAINER( sourceIterator );
- }
-
- /**
- * initialize the ASBeautifier.
- *
- * init() should be called every time a ABeautifier object is to start
- * beautifying a NEW source file.
- * init() recieves a pointer to a DYNAMICALLY CREATED ASSourceIterator object
- * that will be used to iterate through the source code. This object will be
- * deleted during the ASBeautifier's destruction, and thus should not be
- * deleted elsewhere.
- *
- * @param iter a pointer to the DYNAMICALLY CREATED ASSourceIterator object.
- */
- void ASBeautifier::init(ASSourceIterator *iter)
-
- {
- sourceIterator = iter;
- init();
- }
-
- /**
- * initialize the ASBeautifier.
- */
- void ASBeautifier::init()
- {
- INIT_CONTAINER( waitingBeautifierStack, new vector<ASBeautifier*> );
- INIT_CONTAINER( activeBeautifierStack, new vector<ASBeautifier*> );
-
- INIT_CONTAINER( waitingBeautifierStackLengthStack, new vector<int> );
- INIT_CONTAINER( activeBeautifierStackLengthStack, new vector<int> );
-
- INIT_CONTAINER( headerStack, new vector<const string*> );
- INIT_CONTAINER( tempStacks, new vector< vector<const string*>* > );
- tempStacks->push_back(new vector<const string*>);
-
- INIT_CONTAINER( blockParenDepthStack, new vector<int> );
- INIT_CONTAINER( blockStatementStack, new vector<bool> );
- INIT_CONTAINER( parenStatementStack, new vector<bool> );
-
- INIT_CONTAINER( bracketBlockStateStack, new vector<bool> );
- bracketBlockStateStack->push_back(true);
-
- INIT_CONTAINER( inStatementIndentStack, new vector<int> );
- INIT_CONTAINER( inStatementIndentStackSizeStack, new vector<int> );
- inStatementIndentStackSizeStack->push_back(0);
- INIT_CONTAINER( parenIndentStack, new vector<int> );
-
- immediatelyPreviousAssignmentOp = NULL;
- previousLastLineHeader = NULL;
-
- isInQuote = false;
- isInComment = false;
- isInStatement = false;
- isInCase = false;
- isInQuestion = false;
- isInClassHeader = false;
- isInClassHeaderTab = false;
- isInHeader = false;
- isInOperator = false;
- isInTemplate = false;
- isInConst = false;
- isInConditional = false;
- templateDepth = 0;
- parenDepth=0;
- blockTabCount = 0;
- leadingWhiteSpaces = 0;
- prevNonSpaceCh = '{';
- currentNonSpaceCh = '{';
- prevNonLegalCh = '{';
- currentNonLegalCh = '{';
- prevFinalLineSpaceTabCount = 0;
- prevFinalLineTabCount = 0;
- probationHeader = NULL;
- backslashEndsPrevLine = false;
- isInDefine = false;
- isInDefineDefinition = false;
- defineTabCount = 0;
- }
-
- /**
- * set indentation style to ANSI C/C++.
- */
- void ASBeautifier::setCStyle()
- {
- isCStyle = true;
- }
-
- /**
- * set indentation style to Java / K&R.
- */
- void ASBeautifier::setJavaStyle()
- {
- isCStyle = false;
- }
-
- /**
- * indent using one tab per indentation
- */
- void ASBeautifier::setTabIndentation(int length, bool forceTabs)
- {
- indentString = "\t";
- indentLength = length;
- shouldForceTabIndentation = forceTabs;
-
- if (!isMinimalConditinalIndentSet)
- minConditionalIndent = indentLength * 2;
- }
-
- /**
-
- * indent using a number of spaces per indentation.
- *
- * @param length number of spaces per indent.
- */
- void ASBeautifier::setSpaceIndentation(int length)
- {
- indentString=string(length, ' ');
- indentLength = length;
-
- if (!isMinimalConditinalIndentSet)
- minConditionalIndent = indentLength * 2;
- }
-
- /**
- * set the maximum indentation between two lines in a multi-line statement.
- *
- * @param max maximum indentation length.
- */
- void ASBeautifier::setMaxInStatementIndentLength(int max)
- {
- maxInStatementIndent = max;
- }
-
- /**
- * set the minimum indentation between two lines in a multi-line condition.
- *
- * @param min minimal indentation length.
- */
- void ASBeautifier::setMinConditionalIndentLength(int min)
- {
- minConditionalIndent = min;
- isMinimalConditinalIndentSet = true;
- }
-
- /**
- * set the state of the bracket indentation option. If true, brackets will
- * be indented one additional indent.
- *
- * @param state state of option.
- */
- void ASBeautifier::setBracketIndent(bool state)
- {
- bracketIndent = state;
- }
-
- /**
- * set the state of the block indentation option. If true, entire blocks
- * will be indented one additional indent, similar to the GNU indent style.
- *
- * @param state state of option.
- */
- void ASBeautifier::setBlockIndent(bool state)
- {
- if (state)
- setBracketIndent(false); // so that we don't have both bracket and block indent
- blockIndent = state;
- }
-
- /**
- * set the state of the class indentation option. If true, C++ class
- * definitions will be indented one additional indent.
- *
- * @param state state of option.
- */
- void ASBeautifier::setClassIndent(bool state)
- {
- classIndent = state;
- }
-
- /**
- * set the state of the switch indentation option. If true, blocks of 'switch'
- * statements will be indented one additional indent.
- *
- * @param state state of option.
- */
- void ASBeautifier::setSwitchIndent(bool state)
- {
- switchIndent = state;
- }
-
- /**
- * set the state of the case indentation option. If true, lines of 'case'
- * statements will be indented one additional indent.
- *
- * @param state state of option.
- */
- void ASBeautifier::setCaseIndent(bool state)
- {
- caseIndent = state;
- }
- /**
- * set the state of the namespace indentation option.
- * If true, blocks of 'namespace' statements will be indented one
- * additional indent. Otherwise, NO indentation will be added.
- *
- * @param state state of option.
- */
- void ASBeautifier::setNamespaceIndent(bool state)
- {
- namespaceIndent = state;
- }
-
- /**
- * set the state of the label indentation option.
- * If true, labels will be indented one indent LESS than the
- * current indentation level.
- * If false, labels will be flushed to the left with NO
- * indent at all.
- *
- * @param state state of option.
- */
- void ASBeautifier::setLabelIndent(bool state)
- {
- labelIndent = state;
- }
-
- /**
- * set the state of the preprocessor indentation option.
- * If true, multiline #define statements will be indented.
- *
- * @param state state of option.
- */
- void ASBeautifier::setPreprocessorIndent(bool state)
- {
- preprocessorIndent = state;
- }
-
- /**
- * set the state of the empty line fill option.
- * If true, empty lines will be filled with the whitespace.
- * of their previous lines.
- * If false, these lines will remain empty.
- *
- * @param state state of option.
- */
- void ASBeautifier::setEmptyLineFill(bool state)
- {
- emptyLineFill = state;
- }
-
- /**
- * check if there are any indented lines ready to be read by nextLine()
- *
- * @return are there any indented lines ready?
- */
- bool ASBeautifier::hasMoreLines() const
- {
- return sourceIterator->hasMoreLines();
- }
-
- /**
- * get the next indented line.
- *
- * @return indented line.
- */
- string ASBeautifier::nextLine()
- {
- return beautify(sourceIterator->nextLine());
- }
-
- /**
- * beautify a line of source code.
- * every line of source code in a source code file should be sent
- * one after the other to the beautify method.
- *
- * @return the indented line.
- * @param originalLine the original unindented line.
- */
- string ASBeautifier::beautify(const string &originalLine)
- {
- string line;
- bool isInLineComment = false;
- bool lineStartsInComment = false;
- bool isInClass = false;
- bool isInSwitch = false;
- bool isImmediatelyAfterConst = false;
- bool isSpecialChar = false;
-
- char ch = ' ';
- char prevCh;
- string outBuffer; // the newly idented line is bufferd here
- int tabCount = 0;
- const string *lastLineHeader = NULL;
- bool closingBracketReached = false;
- int spaceTabCount = 0;
- char tempCh;
- unsigned int headerStackSize = headerStack->size();
- //bool isLineInStatement = isInStatement;
- bool shouldIndentBrackettedLine = true;
- int lineOpeningBlocksNum = 0;
- int lineClosingBlocksNum = 0;
- bool previousLineProbation = (probationHeader != NULL);
- unsigned int i;
-
- currentHeader = NULL;
-
- lineStartsInComment = isInComment;
-
- // handle and remove white spaces around the line:
- // If not in comment, first find out size of white space before line,
- // so that possible comments starting in the line continue in
- // relation to the preliminary white-space.
- if (!isInComment)
- {
- leadingWhiteSpaces = 0;
- while (leadingWhiteSpaces<originalLine.length() && originalLine[leadingWhiteSpaces] <= 0x20)
- leadingWhiteSpaces++;
-
- line = trim(originalLine);
- }
- else
- {
- unsigned int trimSize;
- for (trimSize=0;
- trimSize < originalLine.length() && trimSize<leadingWhiteSpaces && originalLine[trimSize] <= 0x20 ;
- trimSize++)
- ;
- line = originalLine.substr(trimSize);
- }
-
-
- if (line.length() == 0)
- {
- if (emptyLineFill)
- return preLineWS(prevFinalLineSpaceTabCount, prevFinalLineTabCount);
- else
- return line;
- }
-
- // handle preprocessor commands
-
- if (isCStyle && !isInComment && (line[0] == '#' || backslashEndsPrevLine))
- {
- if (line[0] == '#')
- {
- string preproc = trim(string(line.c_str() + 1));
-
-
- // When finding a multi-lined #define statement, the original beautifier
- // 1. sets its isInDefineDefinition flag
- // 2. clones a new beautifier that will be used for the actual indentation
- // of the #define. This clone is put into the activeBeautifierStack in order
- // to be called for the actual indentation.
- // The original beautifier will have isInDefineDefinition = true, isInDefine = false
- // The cloned beautifier will have isInDefineDefinition = true, isInDefine = true
- if (preprocessorIndent && preproc.COMPARE(0, 6, string("define")) == 0 && line[line.length() - 1] == '\\')
- {
- if (!isInDefineDefinition)
- {
- ASBeautifier *defineBeautifier;
-
- // this is the original beautifier
- isInDefineDefinition = true;
-
- // push a new beautifier into the active stack
- // this breautifier will be used for the indentation of this define
- defineBeautifier = new ASBeautifier(*this);
- //defineBeautifier->init();
- //defineBeautifier->isInDefineDefinition = true;
- //defineBeautifier->beautify("");
- activeBeautifierStack->push_back(defineBeautifier);
- }
- else
- {
- // the is the cloned beautifier that is in charge of indenting the #define.
- isInDefine = true;
- }
- }
- else if (preproc.COMPARE(0, 2, string("if")) == 0)
- {
- // push a new beautifier into the stack
- waitingBeautifierStackLengthStack->push_back(waitingBeautifierStack->size());
- activeBeautifierStackLengthStack->push_back(activeBeautifierStack->size());
- waitingBeautifierStack->push_back(new ASBeautifier(*this));
- }
- else if (preproc.COMPARE(0, 4/*2*/, string("else")) == 0)
- {
- if (!waitingBeautifierStack->empty())
- {
- // MOVE current waiting beautifier to active stack.
- activeBeautifierStack->push_back(waitingBeautifierStack->back());
- waitingBeautifierStack->pop_back();
- }
- }
- else if (preproc.COMPARE(0, 4, string("elif")) == 0)
- {
- if (!waitingBeautifierStack->empty())
- {
- // append a COPY current waiting beautifier to active stack, WITHOUT deleting the original.
- activeBeautifierStack->push_back( new ASBeautifier( *(waitingBeautifierStack->back()) ) );
- }
- }
- else if (preproc.COMPARE(0, 5, string("endif")) == 0)
- {
- unsigned int stackLength;
- ASBeautifier *beautifier;
-
- if (!waitingBeautifierStackLengthStack->empty())
- {
- stackLength = waitingBeautifierStackLengthStack->back();
- waitingBeautifierStackLengthStack->pop_back();
- while (waitingBeautifierStack->size() > stackLength)
- {
- beautifier = waitingBeautifierStack->back();
- waitingBeautifierStack->pop_back();
- delete beautifier;
- }
- }
-
- if (!activeBeautifierStackLengthStack->empty())
- {
- stackLength = activeBeautifierStackLengthStack->back();
- activeBeautifierStackLengthStack->pop_back();
- while (activeBeautifierStack->size() > stackLength)
- {
- beautifier = activeBeautifierStack->back();
- activeBeautifierStack->pop_back();
- delete beautifier;
- }
- }
-
-
- }
- }
-
- // check if the last char is a backslash
- if(line.length() > 0)
- backslashEndsPrevLine = (line[line.length() - 1] == '\\');
- else
- backslashEndsPrevLine = false;
-
- // check if this line ends a multi-line #define
- // if so, use the #define's cloned beautifier for the line's indentation
- // and then remove it from the active beautifier stack and delete it.
- if (!backslashEndsPrevLine && isInDefineDefinition && !isInDefine)
- {
- string beautifiedLine;
- ASBeautifier *defineBeautifier;
-
- isInDefineDefinition = false;
- defineBeautifier = activeBeautifierStack->back();
- activeBeautifierStack->pop_back();
-
- beautifiedLine = defineBeautifier->beautify(line);
- delete defineBeautifier;
- return beautifiedLine;
- }
-
- // unless this is a multi-line #define, return this precompiler line as is.
- if (!isInDefine && !isInDefineDefinition)
- return originalLine;
- }
-
- // if there exists any worker beautifier in the activeBeautifierStack,
- // then use it instead of me to indent the current line.
- if (!isInDefine && activeBeautifierStack != NULL && !activeBeautifierStack->empty())
- {
- return activeBeautifierStack->back()->beautify(line);
- }
-
- // calculate preliminary indentation based on data from past lines
- if (!inStatementIndentStack->empty())
- spaceTabCount = inStatementIndentStack->back();
-
-
- for (i=0; i<headerStackSize; i++)
- {
- isInClass = false;
-
- if (blockIndent || (!(i>0 && (*headerStack)[i-1] != &AS_OPEN_BRACKET
- && (*headerStack)[i] == &AS_OPEN_BRACKET)))
- ++tabCount;
-
- if (isCStyle && !namespaceIndent && i >= 1
- && (*headerStack)[i-1] == &AS_NAMESPACE
- && (*headerStack)[i] == &AS_OPEN_BRACKET)
- --tabCount;
-
- if (isCStyle && i >= 1
- && (*headerStack)[i-1] == &AS_CLASS
- && (*headerStack)[i] == &AS_OPEN_BRACKET )
- {
- if (classIndent)
- ++tabCount;
- isInClass = true;
- }
-
- // is the switchIndent option is on, indent switch statements an additional indent.
- else if (switchIndent && i > 1 &&
- (*headerStack)[i-1] == &AS_SWITCH &&
- (*headerStack)[i] == &AS_OPEN_BRACKET
- )
- {
- ++tabCount;
- isInSwitch = true;
- }
-
- }
-
- if (!lineStartsInComment
- && isCStyle
- && isInClass
- && classIndent
- && headerStackSize >= 2
- &&(*headerStack)[headerStackSize-2] == &AS_CLASS
- && (*headerStack)[headerStackSize-1] == &AS_OPEN_BRACKET
- && line[0] == '}')
- --tabCount;
-
- else if (!lineStartsInComment
- && isInSwitch
- && switchIndent
- && headerStackSize >= 2
- && (*headerStack)[headerStackSize-2] == &AS_SWITCH
- && (*headerStack)[headerStackSize-1] == &AS_OPEN_BRACKET
- && line[0] == '}')
- --tabCount;
-
- if (isInClassHeader)
- {
- isInClassHeaderTab = true;
- tabCount += 2;
- }
-
- if (isInConditional)
- {
- --tabCount;
- }
-
-
- // parse characters in the current line.
-
- for (i=0; i<line.length(); i++)
- {
- tempCh = line[i];
-
- prevCh = ch;
- ch = tempCh;
-
- outBuffer.append(1, ch);
-
- if (isWhiteSpace(ch))
- continue;
-
-
- // handle special characters (i.e. backslash+character such as \n, \t, ...)
- if (isSpecialChar)
- {
- isSpecialChar = false;
- continue;
- }
- if (!(isInComment || isInLineComment) && line.COMPARE(i, 2, string("\\\\")) == 0)
- {
- outBuffer.append(1, '\\');
- i++;
- continue;
- }
- if (!(isInComment || isInLineComment) && ch=='\\')
- {
- isSpecialChar = true;
- continue;
- }
-
- // handle quotes (such as 'x' and "Hello Dolly")
- if (!(isInComment || isInLineComment) && (ch=='"' || ch=='\''))
- if (!isInQuote)
- {
- quoteChar = ch;
- isInQuote = true;
- }
- else if (quoteChar == ch)
- {
- isInQuote = false;
- isInStatement = true;
- continue;
- }
- if (isInQuote)
- continue;
-
- // handle comments
-
- if ( !(isInComment || isInLineComment) && line.COMPARE(i, 2, AS_OPEN_LINE_COMMENT) == 0 )
- {
- isInLineComment = true;
- outBuffer.append(1, '/');
- i++;
- continue;
- }
- else if ( !(isInComment || isInLineComment) && line.COMPARE(i, 2, AS_OPEN_COMMENT) == 0 )
- {
- isInComment = true;
- outBuffer.append(1, '*');
- i++;
- continue;
- }
- else if ( (isInComment || isInLineComment) && line.COMPARE(i, 2, AS_CLOSE_COMMENT) == 0 )
- {
- isInComment = false;
- outBuffer.append(1, '/');
- i++;
- continue;
- }
-
- if (isInComment||isInLineComment)
- continue;
-
- // if we have reached this far then we are NOT in a comment or string of special character...
-
- if (probationHeader != NULL)
- {
- if ( ((probationHeader == &AS_STATIC || probationHeader == &AS_CONST) && ch == '{')
- || (probationHeader == &AS_SYNCHRONIZED && ch == '('))
- {
- // insert the probation header as a new header
- isInHeader = true;
- headerStack->push_back(probationHeader);
-
- // handle the specific probation header
- isInConditional = (probationHeader == &AS_SYNCHRONIZED);
- if (probationHeader == &AS_CONST)
- isImmediatelyAfterConst = true;
- // isInConst = true;
- /* TODO:
- * There is actually no more need for the global isInConst variable.
- * The only reason for checking const is to see if there is a const
- * immediately before an open-bracket.
- * Since CONST is now put into probation and is checked during itspost-char,
- * isImmediatelyAfterConst can be set by its own...
- */
-
- isInStatement = false;
- // if the probation comes from the previous line, then indent by 1 tab count.
- if (previousLineProbation && ch == '{')
- tabCount++;
- previousLineProbation = false;
- }
-
- // dismiss the probation header
- probationHeader = NULL;
- }
-
- prevNonSpaceCh = currentNonSpaceCh;
- currentNonSpaceCh = ch;
- if (!isLegalNameChar(ch) && ch != ',' && ch != ';' )
- {
- prevNonLegalCh = currentNonLegalCh;
- currentNonLegalCh = ch;
- }
-
- //if (isInConst)
- //{
- // isInConst = false;
- // isImmediatelyAfterConst = true;
- //}
-
- if (isInHeader)
- {
- isInHeader = false;
- currentHeader = headerStack->back();
- }
- else
- currentHeader = NULL;
-
- if (isCStyle && isInTemplate
- && (ch == '<' || ch == '>')
- && findHeader(line, i, nonAssignmentOperators) == NULL) //;
- {
- if (ch == '<')
- {
- ++templateDepth;
- }
- else if (ch == '>')
- {
- if (--templateDepth <= 0)
- {
- if (isInTemplate)
- ch = ';';
- else
- ch = 't';
- isInTemplate = false;
- templateDepth = 0;
- }
-
- }
- }
-
- // handle parenthesies
- if (ch == '(' || ch == '[' || ch == ')' || ch == ']')
- {
- if (ch == '(' || ch == '[')
- {
- if (parenDepth == 0)
- {
- parenStatementStack->push_back(isInStatement);
- isInStatement = true;
- }
- parenDepth++;
-
- inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
-
- if (currentHeader != NULL)
- registerInStatementIndent(line, i, spaceTabCount, minConditionalIndent/*indentLength*2*/, true);
- else
- registerInStatementIndent(line, i, spaceTabCount, 0, true);
- }
- else if (ch == ')' || ch == ']')
- {
- parenDepth--;
- if (parenDepth == 0)
- {
- isInStatement = parenStatementStack->back();
- parenStatementStack->pop_back();
- ch = ' ';
-
- isInConditional = false;
- }
-
- if (!inStatementIndentStackSizeStack->empty())
- {
- unsigned int previousIndentStackSize = inStatementIndentStackSizeStack->back();
- inStatementIndentStackSizeStack->pop_back();
- while (previousIndentStackSize < inStatementIndentStack->size())
- inStatementIndentStack->pop_back();
-
- if (!parenIndentStack->empty())
- {
- int poppedIndent = parenIndentStack->back();
- parenIndentStack->pop_back();
-
- if (i == 0)
- spaceTabCount = poppedIndent;
- }
- }
- }
-
- continue;
- }
-
-
- if (ch == '{')
- {
- bool isBlockOpener = false;
-
- // first, check if '{' is a block-opener or an static-array opener
- isBlockOpener = ( (prevNonSpaceCh == '{' && bracketBlockStateStack->back())
- || prevNonSpaceCh == '}'
- || prevNonSpaceCh == ')'
- || prevNonSpaceCh == ';'
- || isInClassHeader
- || isBlockOpener
- || isImmediatelyAfterConst
- || (isInDefine &&
- (prevNonSpaceCh == '('
- || prevNonSpaceCh == '_'
- || isalnum(prevNonSpaceCh))) );
-
- isInClassHeader = false;
- if (!isBlockOpener && currentHeader != NULL)
- {
- for (unsigned int n=0; n < nonParenHeaders.size(); n++)
- if (currentHeader == nonParenHeaders[n])
- {
- isBlockOpener = true;
- break;
- }
- }
- bracketBlockStateStack->push_back(isBlockOpener);
- if (!isBlockOpener)
- {
- inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
- registerInStatementIndent(line, i, spaceTabCount, 0, true);
- parenDepth++;
- if (i == 0)
- shouldIndentBrackettedLine = false;
-
- continue;
- }
-
- // this bracket is a block opener...
-
- ++lineOpeningBlocksNum;
-
- if (isInClassHeader)
- isInClassHeader = false;
- if (isInClassHeaderTab)
- {
- isInClassHeaderTab = false;
- tabCount -= 2;
- }
-
- blockParenDepthStack->push_back(parenDepth);
- blockStatementStack->push_back(isInStatement);
-
- inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
-
- blockTabCount += isInStatement? 1 : 0;
- parenDepth = 0;
- isInStatement = false;
-
- tempStacks->push_back(new vector<const string*>);
- headerStack->push_back(&AS_OPEN_BRACKET);
- lastLineHeader = &AS_OPEN_BRACKET; // <------
-
- continue;
- }
-
- //check if a header has been reached
- if (prevCh == ' ')
- {
- bool isIndentableHeader = true;
- const string *newHeader = findHeader(line, i, headers);
- if (newHeader != NULL)
- {
- // if we reached here, then this is a header...
- isInHeader = true;
-
- vector<const string*> *lastTempStack;
- if (tempStacks->empty())
- lastTempStack = NULL;
- else
- lastTempStack = tempStacks->back();
-
- // if a new block is opened, push a new stack into tempStacks to hold the
- // future list of headers in the new block.
-
- // take care of the special case: 'else if (...)'
- if (newHeader == &AS_IF && lastLineHeader == &AS_ELSE)
- {
- //spaceTabCount += indentLength; // to counter the opposite addition that occurs when the 'if' is registered below...
- headerStack->pop_back();
- }
-
- // take care of 'else'
- else if (newHeader == &AS_ELSE)
- {
- if (lastTempStack != NULL)
- {
- int indexOfIf = indexOf(*lastTempStack, &AS_IF); // <---
- if (indexOfIf != -1)
- {
- // recreate the header list in headerStack up to the previous 'if'
- // from the temporary snapshot stored in lastTempStack.
- int restackSize = lastTempStack->size() - indexOfIf - 1;
- for (int r=0; r<restackSize; r++)
- {
- headerStack->push_back(lastTempStack->back());
- lastTempStack->pop_back();
- }
- if (!closingBracketReached)
- tabCount += restackSize;
- }
- /*
- * If the above if is not true, i.e. no 'if' before the 'else',
- * then nothing beautiful will come out of this...
- * I should think about inserting an Exception here to notify the caller of this...
- */
- }
- }
-
- // check if 'while' closes a previous 'do'
- else if (newHeader == &AS_WHILE)
- {
- if (lastTempStack != NULL)
- {
- int indexOfDo = indexOf(*lastTempStack, &AS_DO); // <---
- if (indexOfDo != -1)
- {
- // recreate the header list in headerStack up to the previous 'do'
- // from the temporary snapshot stored in lastTempStack.
- int restackSize = lastTempStack->size() - indexOfDo - 1;
- for (int r=0; r<restackSize; r++)
- {
- headerStack->push_back(lastTempStack->back());
- lastTempStack->pop_back();
- }
- if (!closingBracketReached)
- tabCount += restackSize;
- }
- }
- }
- // check if 'catch' closes a previous 'try' or 'catch'
- else if (newHeader == &AS_CATCH || newHeader == &AS_FINALLY)
- {
- if (lastTempStack != NULL)
- {
- int indexOfTry = indexOf(*lastTempStack, &AS_TRY);
- if (indexOfTry == -1)
- indexOfTry = indexOf(*lastTempStack, &AS_CATCH);
- if (indexOfTry != -1)
- {
- // recreate the header list in headerStack up to the previous 'try'
- // from the temporary snapshot stored in lastTempStack.
- int restackSize = lastTempStack->size() - indexOfTry - 1;
- for (int r=0; r<restackSize; r++)
- {
- headerStack->push_back(lastTempStack->back());
- lastTempStack->pop_back();
- }
-
- if (!closingBracketReached)
- tabCount += restackSize;
- }
- }
- }
- else if (newHeader == &AS_CASE)
- {
- isInCase = true;
- if (!caseIndent)
- --tabCount;
- }
- else if(newHeader == &AS_DEFAULT)
- {
- isInCase = true;
- if (!caseIndent)
- --tabCount;
- }
- else if (newHeader == &AS_PUBLIC || newHeader == &AS_PROTECTED || newHeader == &AS_PRIVATE)
- {
- if (isCStyle && !isInClassHeader)
- --tabCount;
- isIndentableHeader = false;
- }
- //else if ((newHeader == &STATIC || newHeader == &SYNCHRONIZED) &&
- // !headerStack->empty() &&
- // (headerStack->back() == &STATIC || headerStack->back() == &SYNCHRONIZED))
- //{
- // isIndentableHeader = false;
- //}
- else if (newHeader == &AS_STATIC
- || newHeader == &AS_SYNCHRONIZED
- || (newHeader == &AS_CONST && isCStyle))
- {
- if (!headerStack->empty() &&
- (headerStack->back() == &AS_STATIC
- || headerStack->back() == &AS_SYNCHRONIZED
- || headerStack->back() == &AS_CONST))
- {
- isIndentableHeader = false;
- }
- else
- {
- isIndentableHeader = false;
- probationHeader = newHeader;
- }
- }
- else if (newHeader == &AS_CONST)
- {
- // this will be entered only if NOT in C style
- // since otherwise the CONST would be found to be a probstion header...
-
- //if (isCStyle)
- // isInConst = true;
- isIndentableHeader = false;
- }
- /*
- else if (newHeader == &OPERATOR)
- {
- if (isCStyle)
- isInOperator = true;
- isIndentableHeader = false;
- }
- */
- else if (newHeader == &AS_TEMPLATE)
- {
- if (isCStyle)
- isInTemplate = true;
- isIndentableHeader = false;
- }
-
-
- if (isIndentableHeader)
- {
- // 3.2.99
- //spaceTabCount-=indentLength;
- headerStack->push_back(newHeader);
- isInStatement = false;
- if (indexOf(nonParenHeaders, newHeader) == -1)
- {
- isInConditional = true;
- }
- lastLineHeader = newHeader;
- }
- else
- isInHeader = false;
-
- //lastLineHeader = newHeader;
-
- outBuffer.append(newHeader->substr(1));
- i += newHeader->length() - 1;
-
- continue;
- }
- }
-
- if (isCStyle && !isalpha(prevCh)
- && line.COMPARE(i, 8, AS_OPERATOR) == 0 && !isalnum(line[i+8]))
- {
- isInOperator = true;
- outBuffer.append(AS_OPERATOR.substr(1));
- i += 7;
- continue;
- }
-
- if (ch == '?')
- isInQuestion = true;
-
-
- // special handling of 'case' statements
- if (ch == ':')
- {
- if (line.length() > i+1 && line[i+1] == ':') // look for ::
- {
- ++i;
- outBuffer.append(1, ':');
- ch = ' ';
- continue;
- }
-
- else if (isCStyle && isInClass && prevNonSpaceCh != ')')
- {
- // BEGIN Content of ASBeautifier.cpp.BITFIELD.patch:
-
- unsigned int chIndex;
- char nextCh = 0;
- for (chIndex = i+1; chIndex < line.length(); chIndex++)
- if (!isWhiteSpace(line[chIndex]))
- break;
- if (chIndex< line.length())
- nextCh = line[chIndex];
- int nWord =0;
- for (chIndex = 0; chIndex < i; chIndex++)
- {
- if (!isWhiteSpace(line[chIndex]))
- {
- nWord ++;
- while (!isWhiteSpace(line[++chIndex]));
- }
- }
- if ((nextCh >= '0' && nextCh <= '9') || (nWord >1))
- continue;
- // END Content of ASBeautifier.cpp.BITFIELD.patch:
-
- --tabCount;
- // found a 'private:' or 'public:' inside a class definition
- // so do nothing special
- }
-
- else if (isCStyle && isInClassHeader)
- {
-
- // found a 'class A : public B' definition
- // so do nothing special
- }
-
- else if (isInQuestion)
- {
- isInQuestion = false;
- }
- else if (isCStyle && prevNonSpaceCh == ')')
- {
- isInClassHeader = true;
- if (i==0)
- tabCount += 2;
- }
- else
- {
- currentNonSpaceCh = ';'; // so that brackets after the ':' will appear as block-openers
- if (isInCase)
- {
- isInCase = false;
- ch = ';'; // from here on, treat char as ';'
- }
- // BEGIN content of ASBeautifier.cpp.BITFIELD.patch.bz2
- else // bitfield or labels
- {
- unsigned int chIndex;
- char nextCh = 0;
- for (chIndex = i+1; (isCStyle && chIndex < line.length()); chIndex++)
- if (!isWhiteSpace(line[chIndex]))
- break;
- if (chIndex< line.length())
- nextCh = line[chIndex];
-
- int nWord =0;
- for (chIndex = 0; chIndex < i; chIndex++)
- {
- if (!isWhiteSpace(line[chIndex]))
- {
- nWord ++;
- while (!isWhiteSpace(line[++chIndex]));
- }
- }
- if (isCStyle && (nextCh >= '0' && nextCh <= '9') || (nWord >1))
- {
- continue;
- }
- // END content of ASASBeautifier.cpp.BITFIELD.patch.bz2
-
- else // is in a label (e.g. 'label1:')
- {
- if (labelIndent)
- --tabCount; // unindent label by one indent
- else
- tabCount = 0; // completely flush indent to left
- }
-
- // BEGIN content of ASASBeautifier.cpp.BITFIELD.patch.bz2
- }
- // END content of ASASBeautifier.cpp.BITFIELD.patch.bz2
-
- }
- }
-
- if ((ch == ';' || (parenDepth>0 && ch == ',')) && !inStatementIndentStackSizeStack->empty())
- while ((unsigned int)inStatementIndentStackSizeStack->back() + (parenDepth>0 ? 1 : 0) < inStatementIndentStack->size())
- inStatementIndentStack->pop_back();
-
-
- // handle ends of statements
- if ( (ch == ';' && parenDepth == 0) || ch == '}'/* || (ch == ',' && parenDepth == 0)*/)
- {
- if (ch == '}')
- {
- // first check if this '}' closes a previous block, or a static array...
- if (!bracketBlockStateStack->empty())
- {
- bool bracketBlockState = bracketBlockStateStack->back();
- bracketBlockStateStack->pop_back();
- if (!bracketBlockState)
- {
- if (!inStatementIndentStackSizeStack->empty())
- {
- // this bracket is a static array
-
- unsigned int previousIndentStackSize = inStatementIndentStackSizeStack->back();
- inStatementIndentStackSizeStack->pop_back();
- while (previousIndentStackSize < inStatementIndentStack->size())
- inStatementIndentStack->pop_back();
- parenDepth--;
- if (i == 0)
- shouldIndentBrackettedLine = false;
-
- if (!parenIndentStack->empty())
- {
- int poppedIndent = parenIndentStack->back();
- parenIndentStack->pop_back();
- if (i == 0)
- spaceTabCount = poppedIndent;
- }
- }
- continue;
- }
- }
-
- // this bracket is block closer...
-
- ++lineClosingBlocksNum;
-
- if(!inStatementIndentStackSizeStack->empty())
- inStatementIndentStackSizeStack->pop_back();
-
- if (!blockParenDepthStack->empty())
- {
- parenDepth = blockParenDepthStack->back();
- blockParenDepthStack->pop_back();
- isInStatement = blockStatementStack->back();
- blockStatementStack->pop_back();
-
- if (isInStatement)
- blockTabCount--;
- }
-
- closingBracketReached = true;
- int headerPlace = indexOf(*headerStack, &AS_OPEN_BRACKET); // <---
- if (headerPlace != -1)
- {
- const string *popped = headerStack->back();
- while (popped != &AS_OPEN_BRACKET)
- {
- headerStack->pop_back();
- popped = headerStack->back();
- }
- headerStack->pop_back();
-
- if (!tempStacks->empty())
- {
- vector<const string*> *temp = tempStacks->back();
- tempStacks->pop_back();
- delete temp;
- }
- }
-
-
- ch = ' '; // needed due to cases such as '}else{', so that headers ('else' tn tih case) will be identified...
- }
-
- /*
- * Create a temporary snapshot of the current block's header-list in the
- * uppermost inner stack in tempStacks, and clear the headerStack up to
- * the begining of the block.
- * Thus, the next future statement will think it comes one indent past
- * the block's '{' unless it specifically checks for a companion-header
- * (such as a previous 'if' for an 'else' header) within the tempStacks,
- * and recreates the temporary snapshot by manipulating the tempStacks.
- */
- if (!tempStacks->back()->empty())
- while (!tempStacks->back()->empty())
- tempStacks->back()->pop_back();
- while (!headerStack->empty() && headerStack->back() != &AS_OPEN_BRACKET)
- {
- tempStacks->back()->push_back(headerStack->back());
- headerStack->pop_back();
- }
-
- if (parenDepth == 0 && ch == ';')
- isInStatement=false;
-
- isInClassHeader = false;
-
- continue;
- }
-
-
- // check for preBlockStatements ONLY if not within parenthesies
- // (otherwise 'struct XXX' statements would be wrongly interpreted...)
- if (prevCh == ' ' && !isInTemplate && parenDepth == 0)
- {
- const string *newHeader = findHeader(line, i, preBlockStatements);
- if (newHeader != NULL)
- {
- isInClassHeader = true;
- outBuffer.append(newHeader->substr(1));
- i += newHeader->length() - 1;
- //if (isCStyle)
- headerStack->push_back(newHeader);
- }
- }
-
- // Handle operators
- //
-
- //// // PRECHECK if a '==' or '--' or '++' operator was reached.
- //// // If not, then register an indent IF an assignment operator was reached.
- //// // The precheck is important, so that statements such as 'i--==2' are not recognized
- //// // to have assignment operators (here, '-=') in them . . .
-
- const string *foundAssignmentOp = NULL;
- const string *foundNonAssignmentOp = NULL;
-
- immediatelyPreviousAssignmentOp = NULL;
-
- // Check if an operator has been reached.
- foundAssignmentOp = findHeader(line, i, assignmentOperators, false);
- foundNonAssignmentOp = findHeader(line, i, nonAssignmentOperators, false);
-
- // Since findHeader's boundry checking was not used above, it is possible
- // that both an assignment op and a non-assignment op where found,
- // e.g. '>>' and '>>='. If this is the case, treat the LONGER one as the
- // found operator.
- if (foundAssignmentOp != NULL && foundNonAssignmentOp != NULL)
- if (foundAssignmentOp->length() < foundNonAssignmentOp->length())
- foundAssignmentOp = NULL;
- else
- foundNonAssignmentOp = NULL;
-
- if (foundNonAssignmentOp != NULL)
- {
- if (foundNonAssignmentOp->length() > 1)
- {
- outBuffer.append(foundNonAssignmentOp->substr(1));
- i += foundNonAssignmentOp->length() - 1;
- }
- }
-
- else if (foundAssignmentOp != NULL)
-
- {
- if (foundAssignmentOp->length() > 1)
- {
- outBuffer.append(foundAssignmentOp->substr(1));
- i += foundAssignmentOp->length() - 1;
- }
-
- if (!isInOperator && !isInTemplate)
- {
- registerInStatementIndent(line, i, spaceTabCount, 0, false);
- immediatelyPreviousAssignmentOp = foundAssignmentOp;
- isInStatement = true;
- }
- }
-
- /*
- immediatelyPreviousAssignmentOp = NULL;
- bool isNonAssingmentOperator = false;
- for (int n = 0; n < nonAssignmentOperators.size(); n++)
- if (line.COMPARE(i, nonAssignmentOperators[n]->length(), *(nonAssignmentOperators[n])) == 0)
- {
- if (nonAssignmentOperators[n]->length() > 1)
- {
- outBuffer.append(nonAssignmentOperators[n]->substr(1));
- i += nonAssignmentOperators[n]->length() - 1;
- }
- isNonAssingmentOperator = true;
- break;
- }
- if (!isNonAssingmentOperator)
- {
- for (int a = 0; a < assignmentOperators.size(); a++)
- if (line.COMPARE(i, assignmentOperators[a]->length(), *(assignmentOperators[a])) == 0)
- {
- if (assignmentOperators[a]->length() > 1)
- {
- outBuffer.append(assignmentOperators[a]->substr(1));
- i += assignmentOperators[a]->length() - 1;
- }
-
- if (!isInOperator && !isInTemplate)
- {
- registerInStatementIndent(line, i, spaceTabCount, 0, false);
- immediatelyPreviousAssignmentOp = assignmentOperators[a];
- isInStatement = true;
- }
- break;
- }
- }
- */
-
- if (isInOperator)
- isInOperator = false;
- }
-
- // handle special cases of unindentation:
-
- /*
- * if '{' doesn't follow an immediately previous '{' in the headerStack
- * (but rather another header such as "for" or "if", then unindent it
- * by one indentation relative to its block.
- */
- // cerr << endl << lineOpeningBlocksNum << " " << lineClosingBlocksNum << " " << previousLastLineHeader << endl;
-
- // indent #define lines with one less tab
- //if (isInDefine)
- // tabCount -= defineTabCount-1;
-
-
- if (!lineStartsInComment
- && !blockIndent
- && outBuffer.length()>0
- && outBuffer[0]=='{'
- && !(lineOpeningBlocksNum > 0 && lineOpeningBlocksNum == lineClosingBlocksNum)
- && !(headerStack->size() > 1 && (*headerStack)[headerStack->size()-2] == &AS_OPEN_BRACKET)
- && shouldIndentBrackettedLine)
- --tabCount;
-
- else if (!lineStartsInComment
- && outBuffer.length()>0
- && outBuffer[0]=='}'
- && shouldIndentBrackettedLine )
- --tabCount;
-
- // correctly indent one-line-blocks...
- else if (!lineStartsInComment
- && outBuffer.length()>0
- && lineOpeningBlocksNum > 0
- && lineOpeningBlocksNum == lineClosingBlocksNum
- && previousLastLineHeader != NULL
- && previousLastLineHeader != &AS_OPEN_BRACKET)
- tabCount -= 1; //lineOpeningBlocksNum - (blockIndent ? 1 : 0);
-
- if (tabCount < 0)
- tabCount = 0;
-
- // take care of extra bracket indentatation option...
- if (bracketIndent && outBuffer.length()>0 && shouldIndentBrackettedLine)
- if (outBuffer[0]=='{' || outBuffer[0]=='}')
- tabCount++;
-
-
- if (isInDefine)
- {
- if (outBuffer[0] == '#')
- {
- string preproc = trim(string(outBuffer.c_str() + 1));
- if (preproc.COMPARE(0, 6, string("define")) == 0)
- {
- if (!inStatementIndentStack->empty()
- && inStatementIndentStack->back() > 0)
- {
- defineTabCount = tabCount;
- }
- else
- {
- defineTabCount = tabCount - 1;
- tabCount--;
- }
- }
- }
-
- tabCount -= defineTabCount;
- }
-
- if (tabCount < 0)
- tabCount = 0;
-
-
- // finally, insert indentations into begining of line
-
- prevFinalLineSpaceTabCount = spaceTabCount;
- prevFinalLineTabCount = tabCount;
-
- if (shouldForceTabIndentation)
- {
- tabCount += spaceTabCount / indentLength;
- spaceTabCount = spaceTabCount % indentLength;
- }
-
- outBuffer = preLineWS(spaceTabCount,tabCount) + outBuffer;
-
- if (lastLineHeader != NULL)
- previousLastLineHeader = lastLineHeader;
-
- return outBuffer;
- }
-
-
- string ASBeautifier::preLineWS(int spaceTabCount, int tabCount)
- {
- string ws;
-
- for (int i=0; i<tabCount; i++)
- ws += indentString;
-
- while ((spaceTabCount--) > 0)
- ws += string(" ");
-
- return ws;
-
- }
-
- /**
- * register an in-statement indent.
- */
- void ASBeautifier::registerInStatementIndent(const string &line, int i, int spaceTabCount,
- int minIndent, bool updateParenStack)
- {
- int inStatementIndent;
- int remainingCharNum = line.length() - i;
- int nextNonWSChar = 1;
-
- nextNonWSChar = getNextProgramCharDistance(line, i);
-
- // if indent is around the last char in the line, indent instead 2 spaces from the previous indent
- if (nextNonWSChar == remainingCharNum)
- {
- int previousIndent = spaceTabCount;
- if (!inStatementIndentStack->empty())
- previousIndent = inStatementIndentStack->back();
-
- inStatementIndentStack->push_back(/*2*/ indentLength + previousIndent );
- if (updateParenStack)
- parenIndentStack->push_back( previousIndent );
- return;
- }
-
- if (updateParenStack)
- parenIndentStack->push_back(i+spaceTabCount);
-
- inStatementIndent = i + nextNonWSChar + spaceTabCount;
-
- if (i + nextNonWSChar < minIndent)
- inStatementIndent = minIndent + spaceTabCount;
-
- if (i + nextNonWSChar > maxInStatementIndent)
- inStatementIndent = indentLength*2 + spaceTabCount;
-
-
-
- if (!inStatementIndentStack->empty() &&
- inStatementIndent < inStatementIndentStack->back())
- inStatementIndent = inStatementIndentStack->back();
-
- inStatementIndentStack->push_back(inStatementIndent);
- }
-
- /**
- * get distance to the next non-white sspace, non-comment character in the line.
- * if no such character exists, return the length remaining to the end of the line.
- */
- int ASBeautifier::getNextProgramCharDistance(const string &line, int i)
- {
- bool inComment = false;
- int remainingCharNum = line.length() - i;
- int charDistance = 1;
- int ch;
-
- for (charDistance = 1; charDistance < remainingCharNum; charDistance++)
- {
- ch = line[i + charDistance];
- if (inComment)
- {
- if (line.COMPARE(i + charDistance, 2, AS_CLOSE_COMMENT) == 0)
- {
- charDistance++;
- inComment = false;
- }
- continue;
- }
- else if (isWhiteSpace(ch))
- continue;
- else if (ch == '/')
- {
- if (line.COMPARE(i + charDistance, 2, AS_OPEN_LINE_COMMENT) == 0)
- return remainingCharNum;
- else if (line.COMPARE(i + charDistance, 2, AS_OPEN_COMMENT) == 0)
- {
- charDistance++;
- inComment = true;
- }
- }
- else
- return charDistance;
- }
-
- return charDistance;
- }
-
-
- /**
- * check if a specific character can be used in a legal variable/method/class name
- *
- * @return legality of the char.
- * @param ch the character to be checked.
- */
- bool ASBeautifier::isLegalNameChar(char ch) const
- {
- return (isalnum(ch) //(ch>='a' && ch<='z') || (ch>='A' && ch<='Z') || (ch>='0' && ch<='9') ||
- || ch=='.' || ch=='_' || (!isCStyle && ch=='$') || (isCStyle && ch=='~'));
- }
-
-
- /**
- * check if a specific line position contains a header, out of several possible headers.
- *
- * @return a pointer to the found header. if no header was found then return NULL.
- */
- const string *ASBeautifier::findHeader(const string &line, int i, const vector<const string*> &possibleHeaders, bool checkBoundry)
- {
- int maxHeaders = possibleHeaders.size();
- const string *header = NULL;
- int p;
-
- for (p=0; p < maxHeaders; p++)
- {
- header = possibleHeaders[p];
-
- if (line.COMPARE(i, header->length(), *header) == 0)
- {
- // check that this is a header and not a part of a longer word
- // (e.g. not at its begining, not at its middle...)
-
- int lineLength = line.length();
- int headerEnd = i + header->length();
- char startCh = (*header)[0]; // first char of header
- char endCh = 0; // char just after header
- char prevCh = 0; // char just before header
-
- if (headerEnd < lineLength)
- {
- endCh = line[headerEnd];
- }
- if (i > 0)
- {
- prevCh = line[i-1];
- }
-
- if (!checkBoundry)
- {
- return header;
- }
- else if (prevCh != 0
- && isLegalNameChar(startCh)
- && isLegalNameChar(prevCh))
- {
- return NULL;
- }
- else if (headerEnd >= lineLength
- || !isLegalNameChar(startCh)
- || !isLegalNameChar(endCh))
- {
- return header;
- }
- else
- {
- return NULL;
- }
- }
- }
-
- return NULL;
- }
-
-
- /**
- * check if a specific character can be used in a legal variable/method/class name
- *
- * @return legality of the char.
- * @param ch the character to be checked.
- */
- bool ASBeautifier::isWhiteSpace(char ch) const
- {
- return (ch == ' ' || ch == '\t');
- }
-
- /**
- * find the index number of a string element in a container of strings
- *
- * @return the index number of element in the ocntainer. -1 if element not found.
- * @param container a vector of strings.
- * @param element the element to find .
- */
- int ASBeautifier::indexOf(vector<const string*> &container, const string *element)
- {
- vector<const string*>::const_iterator where;
-
- where= find(container.begin(), container.end(), element);
- if (where == container.end())
- return -1;
- else
- return where - container.begin();
- }
-
- /**
- * trim removes the white space surrounding a line.
- *
- * @return the trimmed line.
- * @param str the line to trim.
- */
- string ASBeautifier::trim(const string &str)
- {
-
- int start = 0;
- int end = str.length() - 1;
-
- while (start < end && isWhiteSpace(str[start]))
- start++;
-
- while (start <= end && isWhiteSpace(str[end]))
- end--;
-
- string returnStr(str, start, end+1-start);
- return returnStr;
- }
-
-#ifdef USES_NAMESPACE
-}
-#endif
-/*
- * Copyright (c) 1998,1999,2000,2001,2002 Tal Davidson. All rights reserved.
- *
- * compiler_defines.h (1 January 1999)
- * by Tal Davidson (davidsont@bigfoot.com)
- * This file is a part of "Artistic Style" - an indentater and reformatter
- * of C, C++, C# and Java source files.
- *
- * The "Artistic Style" project, including all files needed to compile it,
- * is free software; you can redistribute it and/or use it and/or modify it
- * under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2 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.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program.
- */
-
-
-#ifndef ASBEAUTIFIER_H
-#define ASBEAUTIFIER_H
-
-#include "ASResource.h"
-#include "compiler_defines.h"
-#include "ASSourceIterator.h"
-
-#include <string>
-#include <vector>
-
-
-using namespace std;
-
-namespace astyle
- {
-
- enum BracketMode { NONE_MODE, ATTACH_MODE, BREAK_MODE, BDAC_MODE };
- enum BracketType { NULL_TYPE = 0,
- DEFINITION_TYPE = 1,
- COMMAND_TYPE = 2,
- ARRAY_TYPE = 4,
- SINGLE_LINE_TYPE = 8};
-
-
- class ASBeautifier : protected ASResource
- {
- public:
- ASBeautifier();
- virtual ~ASBeautifier();
- virtual void init(ASSourceIterator* iter); // pointer to dynamically created iterator.
- virtual void init();
- virtual bool hasMoreLines() const;
- virtual string nextLine();
- virtual string beautify(const string &line);
- void setTabIndentation(int length = 4, bool forceTabs = false);
- void setSpaceIndentation(int length = 4);
- void setMaxInStatementIndentLength(int max);
- void setMinConditionalIndentLength(int min);
- void setClassIndent(bool state);
- void setSwitchIndent(bool state);
- void setCaseIndent(bool state);
- void setBracketIndent(bool state);
- void setBlockIndent(bool state);
- void setNamespaceIndent(bool state);
- void setLabelIndent(bool state);
- void setCStyle();
- void setJavaStyle();
- void setEmptyLineFill(bool state);
- void setPreprocessorIndent(bool state);
-
-
- protected:
- int getNextProgramCharDistance(const string &line, int i);
- bool isLegalNameChar(char ch) const;
- bool isWhiteSpace(char ch) const;
- const string *findHeader(const string &line, int i,
- const vector<const string*> &possibleHeaders,
- bool checkBoundry = true);
- string trim(const string &str);
- int indexOf(vector<const string*> &container, const string *element);
-
- private:
- ASBeautifier(const ASBeautifier &copy);
- void operator=(ASBeautifier&); // not to be implemented
-
- void initStatic();
- void registerInStatementIndent(const string &line, int i, int spaceTabCount,
- int minIndent, bool updateParenStack);
- string preLineWS(int spaceTabCount, int tabCount);
-
- static vector<const string*> headers;
- static vector<const string*> nonParenHeaders;
- static vector<const string*> preprocessorHeaders;
- static vector<const string*> preBlockStatements;
- static vector<const string*> assignmentOperators;
- static vector<const string*> nonAssignmentOperators;
-
- static bool calledInitStatic;
-
- ASSourceIterator *sourceIterator;
- vector<ASBeautifier*> *waitingBeautifierStack;
- vector<ASBeautifier*> *activeBeautifierStack;
- vector<int> *waitingBeautifierStackLengthStack;
- vector<int> *activeBeautifierStackLengthStack;
- vector<const string*> *headerStack;
- vector< vector<const string*>* > *tempStacks;
- vector<int> *blockParenDepthStack;
- vector<bool> *blockStatementStack;
- vector<bool> *parenStatementStack;
- vector<int> *inStatementIndentStack;
- vector<int> *inStatementIndentStackSizeStack;
- vector<int> *parenIndentStack;
- vector<bool> *bracketBlockStateStack;
- string indentString;
- const string *currentHeader;
- const string *previousLastLineHeader;
- const string *immediatelyPreviousAssignmentOp;
- const string *probationHeader;
- bool isInQuote;
- bool isInComment;
- bool isInCase;
- bool isInQuestion;
- bool isInStatement;
- bool isInHeader;
- bool isCStyle;
- bool isInOperator;
- bool isInTemplate;
- bool isInConst;
- bool isInDefine;
- bool isInDefineDefinition;
- bool classIndent;
- bool isInClassHeader;
- bool isInClassHeaderTab;
- bool switchIndent;
- bool caseIndent;
- bool namespaceIndent;
- bool bracketIndent;
- bool blockIndent;
- bool labelIndent;
- bool preprocessorIndent;
- bool isInConditional;
- bool isMinimalConditinalIndentSet;
- bool shouldForceTabIndentation;
- int minConditionalIndent;
- int parenDepth;
- int indentLength;
- int blockTabCount;
- unsigned int leadingWhiteSpaces;
- int maxInStatementIndent;
- int templateDepth;
- char quoteChar;
- char prevNonSpaceCh;
- char currentNonSpaceCh;
- char currentNonLegalCh;
- char prevNonLegalCh;
- int prevFinalLineSpaceTabCount;
- int prevFinalLineTabCount;
- bool emptyLineFill;
- bool backslashEndsPrevLine;
- int defineTabCount;
- };
-}
-
-#endif
-/*
- * Copyright (c) 1998,1999,2000,2001,2002 Tal Davidson. All rights reserved.
- *
- * ASFormatter.cpp
- * by Tal Davidson (davidsont@bigfoot.com)
- * This file is a part of "Artistic Style" - an indentater and reformatter
- * of C, C++, C# and Java source files.
- *
- * The "Artistic Style" project, including all files needed to compile it,
- * is free software; you can redistribute it and/or use it and/or modify it
- * under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2 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.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program.
- *
- *
- * Patches:
- * 26 November 1998 - Richard Bullington -
- * A correction of line-breaking in headers following '}',
-
- * was created using a variation of a patch by Richard Bullington.
- * 08 May 2004
- * applied ASFormatter450670.patch.bz2, ASFormatter.cpp.patch.bz2,
- * patch1_ssvb_patch.tar.gz
- */
-
-#include "compiler_defines.h"
-#include "ASFormatter.h"
-
-
-#include <string>
-#include <cctype>
-#include <vector>
-#include <algorithm>
-#include <iostream>
-
-
-#define INIT_CONTAINER(container, value) {if ( (container) != NULL ) delete (container); (container) = (value); }
-#define DELETE_CONTAINER(container) {if ( (container) != NULL ) delete (container) ; }
-#define IS_A(a,b) ( ((a) & (b)) == (b))
-#ifdef USES_NAMESPACE
-using namespace std;
-
diff --git a/tests/examplefiles/example.e b/tests/examplefiles/example.e
deleted file mode 100644
index 2e43954b..00000000
--- a/tests/examplefiles/example.e
+++ /dev/null
@@ -1,124 +0,0 @@
-note
- description : "[
- This is use to have almost every language element."
-
- That way, I can correctly test the lexer. %]"
-
- Don't try to understand what it does. It's not even compilling.
- ]"
- date : "August 6, 2013"
- revision : "0.1"
-
-class
- SAMPLE
-
-inherit
- ARGUMENTS
- rename
- Command_line as Caller_command,
- command_name as Application_name
- undefine
- out
- end
- ANY
- export
- {ANY} out
- redefine
- out
- end
-
-
-
-create
- make
-
-convert
- as_boolean: {BOOLEAN}
-
-feature {NONE} -- Initialization
-
- make
- -- Run application.
- local
- i1_:expanded INTEGER
- f_1:REAL_64
- l_char:CHARACTER_8
- do
- l_char:='!'
- l_char:='%''
- l_char:='%%'
- i1_:=80 - 0x2F0C // 0C70 \\ 0b10110 * 1;
- f_1:=0.1 / .567
- f_1:=34.
- f_1:=12345.67890
- inspect i1_
- when 1 then
- io.output.put_integer (i1_) -- Comment
- else
- io.output.put_real (f_1.truncated_to_real)
- end
- io.output.put_string (CuRrEnt.out) -- Comment
- (agent funct_1).call([1,2,"Coucou"])
- end
-
-feature -- Access
-
- funct_1(x,y:separate INTEGER;a_text:READABLE_STRING_GENERAL):detachable BOOLEAN
- obsolete "This function is obsolete"
- require
- Is_Attached: AttAched a_text
- local
- l_list:LIST[like x]
- do
- if (NOT a_text.is_empty=TrUe or elSe ((x<0 aNd x>10) oR (y>0 and then y<10))) xor True thEn
- ResuLT := FalSe
- elseif (acROss l_list as la_list SoMe la_list.item<0 end) implies a_text.is_boolean then
- ResuLT := FalSe
- else
- Result := TruE
- eND
- from
- l_list.start
- until
- l_list.exhausted
- loop
- l_list.forth
- variant
- l_list.count - l_list.index
- end
- check Current /= Void end
- debug print("%"Here%"%N") end
- ensure
- Is_Cool_Not_Change: is_cool = old is_cool
- end
-
- is_cool:BOOLEAN
- attribute
- Result:=False
- end
-
- froZen c_malloc: POINTER is
- exTErnal
- "C inline use <stdlib.h>"
- alIAs
- "malloc (1)"
- end
-
- as_boolean:BOOLEAN
- do
- Result:=True
- rescue
- retry
- end
-
-feature {ANY} -- The redefine feature
-
- out:STRING_8
- once
- reSUlt:=PrecursOr {ANY}
- Result := "Hello Worl"+('d').out
- end
-
-invariant
- Always_Cool: is_cool
-end
diff --git a/tests/examplefiles/example.elm b/tests/examplefiles/example.elm
deleted file mode 100644
index 222d46e5..00000000
--- a/tests/examplefiles/example.elm
+++ /dev/null
@@ -1,58 +0,0 @@
-import Math.Vector3 (..)
-import Math.Matrix4 (..)
-import Graphics.WebGL (..)
-
--- Create a mesh with two triangles
-
-type Vertex = { position:Vec3, color:Vec3 }
-
-mesh : [Triangle Vertex]
-mesh = [ ( Vertex (vec3 0 0 0) (vec3 1 0 0)
- , Vertex (vec3 1 1 0) (vec3 0 1 0)
- , Vertex (vec3 1 -1 0) (vec3 0 0 1)
- )
- ]
-
--- Create the scene
-
-main : Signal Element
-main = scene <~ foldp (+) 0 (fps 30)
-
-scene : Float -> Element
-scene t =
- webgl (400,400)
- [ entity vertexShader fragmentShader mesh { view = view (t / 1000) } ]
-
-view : Float -> Mat4
-view t =
- mul (makePerspective 45 1 0.01 100)
- (makeLookAt (vec3 (4 * cos t) 0 (4 * sin t)) (vec3 0 0 0) (vec3 0 1 0))
-
--- Shaders
-
-vertexShader : Shader { attr | position:Vec3, color:Vec3 } { unif | view:Mat4 } { vcolor:Vec3 }
-vertexShader = [glsl|
-
-attribute vec3 position;
-attribute vec3 color;
-uniform mat4 view;
-varying vec3 vcolor;
-
-void main () {
- gl_Position = view * vec4(position, 1.0);
- vcolor = color;
-}
-
-|]
-
-fragmentShader : Shader {} u { vcolor:Vec3 }
-fragmentShader = [glsl|
-
-precision mediump float;
-varying vec3 vcolor;
-
-void main () {
- gl_FragColor = vec4(vcolor, 1.0);
-}
-
-|]
diff --git a/tests/examplefiles/example.ezt b/tests/examplefiles/example.ezt
deleted file mode 100644
index fec2aa4c..00000000
--- a/tests/examplefiles/example.ezt
+++ /dev/null
@@ -1,32 +0,0 @@
-* Easytrieve Plus example programm.
-
-* Environtment section.
-PARM DEBUG(FLOW FLDCHK)
-
-* Library Section.
-FILE PERSNL FB(150 1800)
- NAME 17 8 A
- EMP# 9 5 N * Note: '#' is a valid character for names.
- DEPT 98 3 N. GROSS 94 4 P 2
- * ^ 2 field definitions in 1 line.
-
-* Call macro in example.mac.
-FILE EXAMPLE FB(80 200)
-%EXAMPLE SOMEFILE SOME
-
-* Activity Section.
-JOB INPUT PERSNL NAME FIRST-PROGRAM START AT-START FINISH AT_FINISH
- PRINT PAY-RPT
-REPORT PAY-RPT LINESIZE 80
- TITLE 01 'PERSONNEL REPORT EXAMPLE-1'
- LINE 01 DEPT NAME EMP# GROSS
-
-* Procedure declarations.
-AT-START. PROC
- DISPLAY 'PROCESSING...'
-END-PROC
-
-AT-FINISH
-PROC
- DISPLAY 'DONE.'
-END-PROC
diff --git a/tests/examplefiles/example.f90 b/tests/examplefiles/example.f90
deleted file mode 100644
index 40462189..00000000
--- a/tests/examplefiles/example.f90
+++ /dev/null
@@ -1,8 +0,0 @@
-program main
- integer, parameter :: mykind = selected_real_kind()
- print *, 1
- print *, 1_mykind
- print *, 1.
- print *, 1._mykind
- print *, (1., 1._mykind)
-end program main
diff --git a/tests/examplefiles/example.feature b/tests/examplefiles/example.feature
deleted file mode 100644
index a26268da..00000000
--- a/tests/examplefiles/example.feature
+++ /dev/null
@@ -1,16 +0,0 @@
-# First comment
-Feature: My amazing feature
- Feature description line 1
- Feature description line 2
-
-#comment
-Scenario Outline: My detailed scenario #string
- Given That <x> is set
- When When I <subtract>
- Then I should get the <remain#der>
-
- # indented comment
- Examples:
- | x | subtract | remain#der |
- | 12 | 5\|3 | #73 |
- | #the | 10 | 15 |
diff --git a/tests/examplefiles/example.fish b/tests/examplefiles/example.fish
deleted file mode 100644
index 2cfd2c8b..00000000
--- a/tests/examplefiles/example.fish
+++ /dev/null
@@ -1,580 +0,0 @@
-# -----------------------------------------------------------------------------
-# Fishshell Samples
-# |- Theme / bobthefish
-# |- Function / funced
-# |- Configuration / config.fish
-# -----------------------------------------------------------------------------
-
-# name: bobthefish
-#
-# bobthefish is a Powerline-style, Git-aware fish theme optimized for awesome.
-#
-# You will probably need a Powerline-patched font for this to work:
-#
-# https://powerline.readthedocs.org/en/latest/fontpatching.html
-#
-# I recommend picking one of these:
-#
-# https://github.com/Lokaltog/powerline-fonts
-#
-# You can override some default options in your config.fish:
-#
-# set -g theme_display_user yes
-# set -g default_user your_normal_user
-
-set -g __bobthefish_current_bg NONE
-
-# Powerline glyphs
-set __bobthefish_branch_glyph \uE0A0
-set __bobthefish_ln_glyph \uE0A1
-set __bobthefish_padlock_glyph \uE0A2
-set __bobthefish_right_black_arrow_glyph \uE0B0
-set __bobthefish_right_arrow_glyph \uE0B1
-set __bobthefish_left_black_arrow_glyph \uE0B2
-set __bobthefish_left_arrow_glyph \uE0B3
-
-# Additional glyphs
-set __bobthefish_detached_glyph \u27A6
-set __bobthefish_nonzero_exit_glyph '! '
-set __bobthefish_superuser_glyph '$ '
-set __bobthefish_bg_job_glyph '% '
-set __bobthefish_hg_glyph \u263F
-
-# Python glyphs
-set __bobthefish_superscript_glyph \u00B9 \u00B2 \u00B3
-set __bobthefish_virtualenv_glyph \u25F0
-set __bobthefish_pypy_glyph \u1D56
-
-# Colors
-set __bobthefish_lt_green addc10
-set __bobthefish_med_green 189303
-set __bobthefish_dk_green 0c4801
-
-set __bobthefish_lt_red C99
-set __bobthefish_med_red ce000f
-set __bobthefish_dk_red 600
-
-set __bobthefish_slate_blue 255e87
-
-set __bobthefish_lt_orange f6b117
-set __bobthefish_dk_orange 3a2a03
-
-set __bobthefish_dk_grey 333
-set __bobthefish_med_grey 999
-set __bobthefish_lt_grey ccc
-
-set __bobthefish_dk_brown 4d2600
-set __bobthefish_med_brown 803F00
-set __bobthefish_lt_brown BF5E00
-
-set __bobthefish_dk_blue 1E2933
-set __bobthefish_med_blue 275379
-set __bobthefish_lt_blue 326D9E
-
-# ===========================
-# Helper methods
-# ===========================
-
-function __bobthefish_in_git -d 'Check whether pwd is inside a git repo'
- command which git > /dev/null 2>&1; and command git rev-parse --is-inside-work-tree >/dev/null 2>&1
-end
-
-function __bobthefish_in_hg -d 'Check whether pwd is inside a hg repo'
- command which hg > /dev/null 2>&1; and command hg stat > /dev/null 2>&1
-end
-
-function __bobthefish_git_branch -d 'Get the current git branch (or commitish)'
- set -l ref (command git symbolic-ref HEAD 2> /dev/null)
- if [ $status -gt 0 ]
- set -l branch (command git show-ref --head -s --abbrev |head -n1 2> /dev/null)
- set ref "$__bobthefish_detached_glyph $branch"
- end
- echo $ref | sed "s-refs/heads/-$__bobthefish_branch_glyph -"
-end
-
-function __bobthefish_hg_branch -d 'Get the current hg branch'
- set -l branch (hg branch ^/dev/null)
- set -l book " @ "(hg book | grep \* | cut -d\ -f3)
- echo "$__bobthefish_branch_glyph $branch$book"
-end
-
-function __bobthefish_pretty_parent -d 'Print a parent directory, shortened to fit the prompt'
- echo -n (dirname $argv[1]) | sed -e 's|/private||' -e "s|^$HOME|~|" -e 's-/\(\.\{0,1\}[^/]\)\([^/]*\)-/\1-g' -e 's|/$||'
-end
-
-function __bobthefish_git_project_dir -d 'Print the current git project base directory'
- command git rev-parse --show-toplevel 2>/dev/null
-end
-
-function __bobthefish_hg_project_dir -d 'Print the current hg project base directory'
- command hg root 2>/dev/null
-end
-
-function __bobthefish_project_pwd -d 'Print the working directory relative to project root'
- echo "$PWD" | sed -e "s*$argv[1]**g" -e 's*^/**'
-end
-
-
-# ===========================
-# Segment functions
-# ===========================
-
-function __bobthefish_start_segment -d 'Start a prompt segment'
- set_color -b $argv[1]
- set_color $argv[2]
- if [ "$__bobthefish_current_bg" = 'NONE' ]
- # If there's no background, just start one
- echo -n ' '
- else
- # If there's already a background...
- if [ "$argv[1]" = "$__bobthefish_current_bg" ]
- # and it's the same color, draw a separator
- echo -n "$__bobthefish_right_arrow_glyph "
- else
- # otherwise, draw the end of the previous segment and the start of the next
- set_color $__bobthefish_current_bg
- echo -n "$__bobthefish_right_black_arrow_glyph "
- set_color $argv[2]
- end
- end
- set __bobthefish_current_bg $argv[1]
-end
-
-function __bobthefish_path_segment -d 'Display a shortened form of a directory'
- if test -w "$argv[1]"
- __bobthefish_start_segment $__bobthefish_dk_grey $__bobthefish_med_grey
- else
- __bobthefish_start_segment $__bobthefish_dk_red $__bobthefish_lt_red
- end
-
- set -l directory
- set -l parent
-
- switch "$argv[1]"
- case /
- set directory '/'
- case "$HOME"
- set directory '~'
- case '*'
- set parent (__bobthefish_pretty_parent "$argv[1]")
- set parent "$parent/"
- set directory (basename "$argv[1]")
- end
-
- test "$parent"; and echo -n -s "$parent"
- set_color fff --bold
- echo -n "$directory "
- set_color normal
-end
-
-function __bobthefish_finish_segments -d 'Close open prompt segments'
- if [ -n $__bobthefish_current_bg -a $__bobthefish_current_bg != 'NONE' ]
- set_color -b normal
- set_color $__bobthefish_current_bg
- echo -n "$__bobthefish_right_black_arrow_glyph "
- set_color normal
- end
- set -g __bobthefish_current_bg NONE
-end
-
-
-# ===========================
-# Theme components
-# ===========================
-
-function __bobthefish_prompt_status -d 'Display symbols for a non zero exit status, root and background jobs'
- set -l nonzero
- set -l superuser
- set -l bg_jobs
-
- # Last exit was nonzero
- if [ $status -ne 0 ]
- set nonzero $__bobthefish_nonzero_exit_glyph
- end
-
- # if superuser (uid == 0)
- set -l uid (id -u $USER)
- if [ $uid -eq 0 ]
- set superuser $__bobthefish_superuser_glyph
- end
-
- # Jobs display
- if [ (jobs -l | wc -l) -gt 0 ]
- set bg_jobs $__bobthefish_bg_job_glyph
- end
-
- set -l status_flags "$nonzero$superuser$bg_jobs"
-
- if test "$nonzero" -o "$superuser" -o "$bg_jobs"
- __bobthefish_start_segment fff 000
- if [ "$nonzero" ]
- set_color $__bobthefish_med_red --bold
- echo -n $__bobthefish_nonzero_exit_glyph
- end
-
- if [ "$superuser" ]
- set_color $__bobthefish_med_green --bold
- echo -n $__bobthefish_superuser_glyph
- end
-
- if [ "$bg_jobs" ]
- set_color $__bobthefish_slate_blue --bold
- echo -n $__bobthefish_bg_job_glyph
- end
-
- set_color normal
- end
-end
-
-function __bobthefish_prompt_user -d 'Display actual user if different from $default_user'
- if [ "$theme_display_user" = 'yes' ]
- if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ]
- __bobthefish_start_segment $__bobthefish_lt_grey $__bobthefish_slate_blue
- echo -n -s (whoami) '@' (hostname | cut -d . -f 1) ' '
- end
- end
-end
-
-function __bobthefish_prompt_hg -d 'Display the actual hg state'
- set -l dirty (command hg stat; or echo -n '*')
-
- set -l flags "$dirty"
- test "$flags"; and set flags ""
-
- set -l flag_bg $__bobthefish_lt_green
- set -l flag_fg $__bobthefish_dk_green
- if test "$dirty"
- set flag_bg $__bobthefish_med_red
- set flag_fg fff
- end
-
- __bobthefish_path_segment (__bobthefish_hg_project_dir)
-
- __bobthefish_start_segment $flag_bg $flag_fg
- echo -n -s $__bobthefish_hg_glyph ' '
-
- __bobthefish_start_segment $flag_bg $flag_fg
- set_color $flag_fg --bold
- echo -n -s (__bobthefish_hg_branch) $flags ' '
- set_color normal
-
- set -l project_pwd (__bobthefish_project_pwd (__bobthefish_hg_project_dir))
- if test "$project_pwd"
- if test -w "$PWD"
- __bobthefish_start_segment 333 999
- else
- __bobthefish_start_segment $__bobthefish_med_red $__bobthefish_lt_red
- end
-
- echo -n -s $project_pwd ' '
- end
-end
-
-# TODO: clean up the fugly $ahead business
-function __bobthefish_prompt_git -d 'Display the actual git state'
- set -l dirty (command git diff --no-ext-diff --quiet --exit-code; or echo -n '*')
- set -l staged (command git diff --cached --no-ext-diff --quiet --exit-code; or echo -n '~')
- set -l stashed (command git rev-parse --verify refs/stash > /dev/null 2>&1; and echo -n '$')
- set -l ahead (command git branch -v 2> /dev/null | grep -Eo '^\* [^ ]* *[^ ]* *\[[^]]*\]' | grep -Eo '\[[^]]*\]$' | awk 'ORS="";/ahead/ {print "+"} /behind/ {print "-"}' | sed -e 's/+-/±/')
-
- set -l new (command git ls-files --other --exclude-standard);
- test "$new"; and set new '…'
-
- set -l flags "$dirty$staged$stashed$ahead$new"
- test "$flags"; and set flags " $flags"
-
- set -l flag_bg $__bobthefish_lt_green
- set -l flag_fg $__bobthefish_dk_green
- if test "$dirty" -o "$staged"
- set flag_bg $__bobthefish_med_red
- set flag_fg fff
- else
- if test "$stashed"
- set flag_bg $__bobthefish_lt_orange
- set flag_fg $__bobthefish_dk_orange
- end
- end
-
- __bobthefish_path_segment (__bobthefish_git_project_dir)
-
- __bobthefish_start_segment $flag_bg $flag_fg
- set_color $flag_fg --bold
- echo -n -s (__bobthefish_git_branch) $flags ' '
- set_color normal
-
- set -l project_pwd (__bobthefish_project_pwd (__bobthefish_git_project_dir))
- if test "$project_pwd"
- if test -w "$PWD"
- __bobthefish_start_segment 333 999
- else
- __bobthefish_start_segment $__bobthefish_med_red $__bobthefish_lt_red
- end
-
- echo -n -s $project_pwd ' '
- end
-end
-
-function __bobthefish_prompt_dir -d 'Display a shortened form of the current directory'
- __bobthefish_path_segment "$PWD"
-end
-
-function __bobthefish_in_virtualfish_virtualenv
- set -q VIRTUAL_ENV
-end
-
-function __bobthefish_virtualenv_python_version -d 'Get current python version'
- switch (readlink (which python))
- case python2
- echo $__bobthefish_superscript_glyph[2]
- case python3
- echo $__bobthefish_superscript_glyph[3]
- case pypy
- echo $__bobthefish_pypy_glyph
- end
-end
-
-function __bobthefish_virtualenv -d 'Get the current virtualenv'
- echo $__bobthefish_virtualenv_glyph(__bobthefish_virtualenv_python_version) (basename "$VIRTUAL_ENV")
-end
-
-function __bobthefish_prompt_virtualfish -d "Display activated virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself)"
- set flag_bg $__bobthefish_lt_blue
- set flag_fg $__bobthefish_dk_blue
- __bobthefish_start_segment $flag_bg $flag_fg
- set_color $flag_fg --bold
- echo -n -s (__bobthefish_virtualenv) $flags ' '
- set_color normal
-end
-
-
-# ===========================
-# Apply theme
-# ===========================
-
-function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
- __bobthefish_prompt_status
- __bobthefish_prompt_user
- if __bobthefish_in_virtualfish_virtualenv
- __bobthefish_prompt_virtualfish
- end
- if __bobthefish_in_git # TODO: do this right.
- __bobthefish_prompt_git # if something is in both git and hg, check the length of
- else if __bobthefish_in_hg # __bobthefish_git_project_dir vs __bobthefish_hg_project_dir
- __bobthefish_prompt_hg # and pick the longer of the two.
- else
- __bobthefish_prompt_dir
- end
- __bobthefish_finish_segments
-end
-
-# -----------------------------------------------------------------------------
-# funced - edit a function interactively
-#
-# Synopsis
-#
-# funced [OPTIONS] NAME
-#
-# Description
-#
-# funced provides an interface to edit the definition of the function NAME.
-# -----------------------------------------------------------------------------
-
-function funced --description 'Edit function definition'
- set -l editor $EDITOR
- set -l interactive
- set -l funcname
- while set -q argv[1]
- switch $argv[1]
- case -h --help
- __fish_print_help funced
- return 0
-
- case -e --editor
- set editor $argv[2]
- set -e argv[2]
-
- case -i --interactive
- set interactive 1
-
- case --
- set funcname $funcname $argv[2]
- set -e argv[2]
-
- case '-*'
- set_color red
- printf (_ "%s: Unknown option %s\n") funced $argv[1]
- set_color normal
- return 1
-
- case '*' '.*'
- set funcname $funcname $argv[1]
- end
- set -e argv[1]
- end
-
- if begin; set -q funcname[2]; or not test "$funcname[1]"; end
- set_color red
- _ "funced: You must specify one function name
-"
- set_color normal
- return 1
- end
-
- set -l init
- switch $funcname
- case '-*'
- set init function -- $funcname\n\nend
- case '*'
- set init function $funcname\n\nend
- end
-
- # Break editor up to get its first command (i.e. discard flags)
- if test -n "$editor"
- set -l editor_cmd
- eval set editor_cmd $editor
- if not type -f "$editor_cmd[1]" >/dev/null
- _ "funced: The value for \$EDITOR '$editor' could not be used because the command '$editor_cmd[1]' could not be found
- "
- set editor fish
- end
- end
-
- # If no editor is specified, use fish
- if test -z "$editor"
- set editor fish
- end
-
- if begin; set -q interactive[1]; or test "$editor" = fish; end
- set -l IFS
- if functions -q -- $funcname
- # Shadow IFS here to avoid array splitting in command substitution
- set init (functions -- $funcname | fish_indent --no-indent)
- end
-
- set -l prompt 'printf "%s%s%s> " (set_color green) '$funcname' (set_color normal)'
- # Unshadow IFS since the fish_title breaks otherwise
- set -e IFS
- if read -p $prompt -c "$init" -s cmd
- # Shadow IFS _again_ to avoid array splitting in command substitution
- set -l IFS
- eval (echo -n $cmd | fish_indent)
- end
- return 0
- end
-
- set -q TMPDIR; or set -l TMPDIR /tmp
- set -l tmpname (printf "$TMPDIR/fish_funced_%d_%d.fish" %self (random))
- while test -f $tmpname
- set tmpname (printf "$TMPDIR/fish_funced_%d_%d.fish" %self (random))
- end
-
- if functions -q -- $funcname
- functions -- $funcname > $tmpname
- else
- echo $init > $tmpname
- end
- if eval $editor $tmpname
- . $tmpname
- end
- set -l stat $status
- rm -f $tmpname >/dev/null
- return $stat
-end
-
-# -----------------------------------------------------------------------------
-# Main file for fish command completions. This file contains various
-# common helper functions for the command completions. All actual
-# completions are located in the completions subdirectory.
-## -----------------------------------------------------------------------------
-
-#
-# Set default field separators
-#
-
-set -g IFS \n\ \t
-
-#
-# Set default search paths for completions and shellscript functions
-# unless they already exist
-#
-
-set -l configdir ~/.config
-
-if set -q XDG_CONFIG_HOME
- set configdir $XDG_CONFIG_HOME
-end
-
-# __fish_datadir, __fish_sysconfdir, __fish_help_dir, __fish_bin_dir
-# are expected to have been set up by read_init from fish.cpp
-
-# Set up function and completion paths. Make sure that the fish
-# default functions/completions are included in the respective path.
-
-if not set -q fish_function_path
- set fish_function_path $configdir/fish/functions $__fish_sysconfdir/functions $__fish_datadir/functions
-end
-
-if not contains $__fish_datadir/functions $fish_function_path
- set fish_function_path[-1] $__fish_datadir/functions
-end
-
-if not set -q fish_complete_path
- set fish_complete_path $configdir/fish/completions $__fish_sysconfdir/completions $__fish_datadir/completions
-end
-
-if not contains $__fish_datadir/completions $fish_complete_path
- set fish_complete_path[-1] $__fish_datadir/completions
-end
-
-#
-# This is a Solaris-specific test to modify the PATH so that
-# Posix-conformant tools are used by default. It is separate from the
-# other PATH code because this directory needs to be prepended, not
-# appended, since it contains POSIX-compliant replacements for various
-# system utilities.
-#
-
-if test -d /usr/xpg4/bin
- if not contains /usr/xpg4/bin $PATH
- set PATH /usr/xpg4/bin $PATH
- end
-end
-
-#
-# Add a few common directories to path, if they exists. Note that pure
-# console programs like makedep sometimes live in /usr/X11R6/bin, so we
-# want this even for text-only terminals.
-#
-
-set -l path_list /bin /usr/bin /usr/X11R6/bin /usr/local/bin $__fish_bin_dir
-
-# Root should also have the sbin directories in the path
-switch $USER
- case root
- set path_list $path_list /sbin /usr/sbin /usr/local/sbin
-end
-
-for i in $path_list
- if not contains $i $PATH
- if test -d $i
- set PATH $PATH $i
- end
- end
-end
-
-#
-# Launch debugger on SIGTRAP
-#
-function fish_sigtrap_handler --on-signal TRAP --no-scope-shadowing --description "Signal handler for the TRAP signal. Lanches a debug prompt."
- breakpoint
-end
-
-#
-# Whenever a prompt is displayed, make sure that interactive
-# mode-specific initializations have been performed.
-# This handler removes itself after it is first called.
-#
-function __fish_on_interactive --on-event fish_prompt
- __fish_config_interactive
- functions -e __fish_on_interactive
-end
diff --git a/tests/examplefiles/example.flo b/tests/examplefiles/example.flo
deleted file mode 100644
index 2d4ab5e7..00000000
--- a/tests/examplefiles/example.flo
+++ /dev/null
@@ -1,40 +0,0 @@
-#example mission box1.flo
-#from: https://github.com/ioflo/ioflo
-
-house box1
-
- framer vehiclesim be active first vehicle_run
- frame vehicle_run
- do simulator motion uuv
-
- framer mission be active first northleg
- frame northleg
- set elapsed with 20.0
- set heading with 0.0
- set depth with 5.0
- set speed with 2.5
- go next if elapsed >= goal
-
- frame eastleg
- set heading with 90.0
- go next if elapsed >= goal
-
- frame southleg
- set heading with 180.0
- go next if elapsed >= goal
-
- frame westleg
- set heading with 270.0
- go next if elapsed >= goal
-
- frame mission_stop
- bid stop vehiclesim
- bid stop autopilot
- bid stop me
-
- framer autopilot be active first autopilot_run
- frame autopilot_run
- do controller pid speed
- do controller pid heading
- do controller pid depth
- do controller pid pitch \ No newline at end of file
diff --git a/tests/examplefiles/example.gd b/tests/examplefiles/example.gd
deleted file mode 100644
index c285ea32..00000000
--- a/tests/examplefiles/example.gd
+++ /dev/null
@@ -1,23 +0,0 @@
-#############################################################################
-##
-#W example.gd
-##
-## This file contains a sample of a GAP declaration file.
-##
-DeclareProperty( "SomeProperty", IsLeftModule );
-DeclareGlobalFunction( "SomeGlobalFunction" );
-
-
-#############################################################################
-##
-#C IsQuuxFrobnicator(<R>)
-##
-## <ManSection>
-## <Filt Name="IsQuuxFrobnicator" Arg='R' Type='Category'/>
-##
-## <Description>
-## Tests whether R is a quux frobnicator.
-## </Description>
-## </ManSection>
-##
-DeclareSynonym( "IsQuuxFrobnicator", IsField and IsGroup );
diff --git a/tests/examplefiles/example.gi b/tests/examplefiles/example.gi
deleted file mode 100644
index c9c5e55d..00000000
--- a/tests/examplefiles/example.gi
+++ /dev/null
@@ -1,64 +0,0 @@
-#############################################################################
-##
-#W example.gd
-##
-## This file contains a sample of a GAP implementation file.
-##
-
-
-#############################################################################
-##
-#M SomeOperation( <val> )
-##
-## performs some operation on <val>
-##
-InstallMethod( SomeProperty,
- "for left modules",
- [ IsLeftModule ], 0,
- function( M )
- if IsFreeLeftModule( M ) and not IsTrivial( M ) then
- return true;
- fi;
- TryNextMethod();
- end );
-
-
-
-#############################################################################
-##
-#F SomeGlobalFunction( )
-##
-## A global variadic funfion.
-##
-InstallGlobalFunction( SomeGlobalFunction, function( arg )
- if Length( arg ) = 3 then
- return arg[1] + arg[2] * arg[3];
- elif Length( arg ) = 2 then
- return arg[1] - arg[2]
- else
- Error( "usage: SomeGlobalFunction( <x>, <y>[, <z>] )" );
- fi;
- end );
-
-
-#
-# A plain function.
-#
-SomeFunc := function(x, y)
- local z, func, tmp, j;
- z := x * 1.0;
- y := 17^17 - y;
- func := a -> a mod 5;
- tmp := List( [1..50], func );
- while y > 0 do
- for j in tmp do
- Print(j, "\n");
- od;
- repeat
- y := y - 1;
- until 0 < 1;
- y := y -1;
- od;
- return z;
-end;
- \ No newline at end of file
diff --git a/tests/examplefiles/example.golo b/tests/examplefiles/example.golo
deleted file mode 100644
index 92ff78b5..00000000
--- a/tests/examplefiles/example.golo
+++ /dev/null
@@ -1,113 +0,0 @@
-#
-# Comments
-#
-
-module pygments.Example
-
-import some.Module
-
-local function foo = |a, b| -> a + b
-
-----
-golodoc string
-----
-augment java.util.Collection {
-
- ----
- sub doc
- ----
- function plop = |this, v| {
- return this: length() + v
- }
-}
-
-function bar = |a, b| {
- let msg = "a string"
- var tmp = ""
- tmp = tmp + a: toString()
- println(tmp + b)
-}
-
-function baz = {
- foreach i in range(0, 5) {
- if i % 2 == 0 and true or false {
- print("e")
- } else {
- print("o")
- }
- }
-}
-
-function userMatch = |v| ->
- match {
- when v % 2 == 0 then "e"
- otherwise "o"
- }
-}
-
-function add = |x| -> |y| -> x + y
-
-let aChar = 'a'
-
-let multiline =
-"""
-foo
-bar
-baz
-"""
-
-local function myObj = -> DynamicObject():
- name("foo"):
- age(25):
- define("meth", |this| -> this: name() + this: age()
-
-----
-Golo doc string
-----
-function nullTest = {
- let m = map[
- ["a", 1],
- ["b", 2]
- ]
-
- println(map: get("a") orIfNull 0)
- println(map: get("b")?: toString() orIfNull "0")
-
-}
-
-struct Point = { x, y }
-
-function deco1 = |fun| {
- return |args...| {
- return "deco1 + " + fun: invokeWithArguments(args)
- }
-}
-
-@deco1
-function decofoo = |a| {
- return "foo: " + a
-}
-
-@deco1
-function decobar = |a| -> "bar: " + a
-
-function deco2 = |fun| {
- return |args...| {
- return "deco2 + " + fun: invokeWithArguments(args)
- }
-}
-
-@deco2
-@deco1
-function decobaz = |a| -> "baz: " + a
-
-let deco3 = ^deco1: andThen(^deco2)
-
-@deco3
-function decospam = |a| -> "spam: " + a
-
-@another.Module.deco
-function ping = -> "pong"
-
-@deco("with", params)
-function gnop = -> "gnip"
diff --git a/tests/examplefiles/example.groovy b/tests/examplefiles/example.groovy
deleted file mode 100755
index 25ef2eab..00000000
--- a/tests/examplefiles/example.groovy
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env groovy
-println "Hello World"
diff --git a/tests/examplefiles/example.gs b/tests/examplefiles/example.gs
deleted file mode 100644
index eb8372d6..00000000
--- a/tests/examplefiles/example.gs
+++ /dev/null
@@ -1,106 +0,0 @@
-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
deleted file mode 100644
index 55fedb4f..00000000
--- a/tests/examplefiles/example.gst
+++ /dev/null
@@ -1,7 +0,0 @@
-<%!-- 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.hlsl b/tests/examplefiles/example.hlsl
deleted file mode 100644
index 21d0a672..00000000
--- a/tests/examplefiles/example.hlsl
+++ /dev/null
@@ -1,168 +0,0 @@
-// A few random snippets of HLSL shader code I gathered...
-
-[numthreads(256, 1, 1)]
-void cs_main(uint3 threadId : SV_DispatchThreadID)
-{
- // Seed the PRNG using the thread ID
- rng_state = threadId.x;
-
- // Generate a few numbers...
- uint r0 = rand_xorshift();
- uint r1 = rand_xorshift();
- // Do some stuff with them...
-
- // Generate a random float in [0, 1)...
- float f0 = float(rand_xorshift()) * (1.0 / 4294967296.0);
-
- // ...etc.
-}
-
-// Constant buffer of parameters
-cbuffer IntegratorParams : register(b0)
-{
- float2 specPow; // Spec powers in XY directions (equal for isotropic BRDFs)
- float3 L; // Unit vector toward light
- int2 cThread; // Total threads launched in XY dimensions
- int2 xyOutput; // Where in the output buffer to store the result
-}
-
-static const float pi = 3.141592654;
-
-float AshikhminShirleyNDF(float3 H)
-{
- float normFactor = sqrt((specPow.x + 2.0f) * (specPow.y + 2.0)) * (0.5f / pi);
- float NdotH = H.z;
- float2 Hxy = normalize(H.xy);
- return normFactor * pow(NdotH, dot(specPow, Hxy * Hxy));
-}
-
-float BeckmannNDF(float3 H)
-{
- float glossFactor = specPow.x * 0.5f + 1.0f; // This is 1/m^2 in the usual Beckmann formula
- float normFactor = glossFactor * (1.0f / pi);
- float NdotHSq = H.z * H.z;
- return normFactor / (NdotHSq * NdotHSq) * exp(glossFactor * (1.0f - 1.0f / NdotHSq));
-}
-
-// Output buffer for compute shader (actually float, but must be declared as uint
-// for atomic operations to work)
-globallycoherent RWTexture2D<uint> o_data : register(u0);
-
-// Sum up the outputs of all threads and store to the output location
-static const uint threadGroupSize2D = 16;
-static const uint threadGroupSize1D = threadGroupSize2D * threadGroupSize2D;
-groupshared float g_partialSums[threadGroupSize1D];
-void SumAcrossThreadsAndStore(float value, uint iThreadInGroup)
-{
- // First reduce within the threadgroup: partial sums of 2, 4, 8... elements
- // are calculated by 1/2, 1/4, 1/8... of the threads, always keeping the
- // active threads at the front of the group to minimize divergence.
-
- // NOTE: there are faster ways of doing this...but this is simple to code
- // and good enough.
-
- g_partialSums[iThreadInGroup] = value;
- GroupMemoryBarrierWithGroupSync();
-
- [unroll] for (uint i = threadGroupSize1D / 2; i > 0; i /= 2)
- {
- if (iThreadInGroup < i)
- {
- g_partialSums[iThreadInGroup] += g_partialSums[iThreadInGroup + i];
- }
- GroupMemoryBarrierWithGroupSync();
- }
-
- // Then reduce across threadgroups: one thread from each group adds the group
- // total to the final output location, using a software transactional memory
- // style since D3D11 doesn't support atomic add on floats.
- // (Assumes the output value has been cleared to zero beforehand.)
-
- if (iThreadInGroup == 0)
- {
- float threadGroupSum = g_partialSums[0];
- uint outputValueRead = o_data[xyOutput];
- while (true)
- {
- uint newOutputValue = asuint(asfloat(outputValueRead) + threadGroupSum);
- uint previousOutputValue;
- InterlockedCompareExchange(
- o_data[xyOutput], outputValueRead, newOutputValue, previousOutputValue);
- if (previousOutputValue == outputValueRead)
- break;
- outputValueRead = previousOutputValue;
- }
- }
-}
-
-void main(
- in Vertex i_vtx,
- out Vertex o_vtx,
- out float3 o_vecCamera : CAMERA,
- out float4 o_uvzwShadow : UVZW_SHADOW,
- out float4 o_posClip : SV_Position)
-{
- o_vtx = i_vtx;
- o_vecCamera = g_posCamera - i_vtx.m_pos;
- o_uvzwShadow = mul(float4(i_vtx.m_pos, 1.0), g_matWorldToUvzwShadow);
- o_posClip = mul(float4(i_vtx.m_pos, 1.0), g_matWorldToClip);
-}
-
-#pragma pack_matrix(row_major)
-
-struct Vertex
-{
- float3 m_pos : POSITION;
- float3 m_normal : NORMAL;
- float2 m_uv : UV;
-};
-
-cbuffer CBFrame : CB_FRAME // matches struct CBFrame in test.cpp
-{
- float4x4 g_matWorldToClip;
- float4x4 g_matWorldToUvzwShadow;
- float3x3 g_matWorldToUvzShadowNormal;
- float3 g_posCamera;
-
- float3 g_vecDirectionalLight;
- float3 g_rgbDirectionalLight;
-
- float2 g_dimsShadowMap;
- float g_normalOffsetShadow;
- float g_shadowSharpening;
-
- float g_exposure; // Exposure multiplier
-}
-
-Texture2D<float3> g_texDiffuse : register(t0);
-SamplerState g_ss : register(s0);
-
-void main(
- in Vertex i_vtx,
- in float3 i_vecCamera : CAMERA,
- in float4 i_uvzwShadow : UVZW_SHADOW,
- out float3 o_rgb : SV_Target)
-{
- float3 normal = normalize(i_vtx.m_normal);
-
- // Sample shadow map
- float shadow = EvaluateShadow(i_uvzwShadow, normal);
-
- // Evaluate diffuse lighting
- float3 diffuseColor = g_texDiffuse.Sample(g_ss, i_vtx.m_uv);
- float3 diffuseLight = g_rgbDirectionalLight * (shadow * saturate(dot(normal, g_vecDirectionalLight)));
- diffuseLight += SimpleAmbient(normal);
-
- o_rgb = diffuseColor * diffuseLight;
-}
-
-[domain("quad")]
-void ds(
- in float edgeFactors[4] : SV_TessFactor,
- in float insideFactors[2] : SV_InsideTessFactor,
- in OutputPatch<VData, 4> inp,
- in float2 uv : SV_DomainLocation,
- out float4 o_pos : SV_Position)
-{
- o_pos = lerp(lerp(inp[0].pos, inp[1].pos, uv.x), lerp(inp[2].pos, inp[3].pos, uv.x), uv.y);
-}
diff --git a/tests/examplefiles/example.hs b/tests/examplefiles/example.hs
deleted file mode 100644
index 764cab77..00000000
--- a/tests/examplefiles/example.hs
+++ /dev/null
@@ -1,41 +0,0 @@
-module ĈrazyThings where
-
-import "base" Data.Char
-import "base" Data.Char (isControl, isSpace)
-import "base" Data.Char (isControl, --isSpace)
- isSpace)
-import "base" Data.Char (isControl, -- isSpace)
- isSpace)
-
-(-->) :: Num a => a -- signature
-(-->) = 2 -- >implementation
-
---test comment
--- test comment
-
-main :: IO ()
-main = putStrLn "hello world"
-
-gádd x y = x + y
-ádd x y = x + y
-
-
-data ĈrazyThings =
- Ĉar |
- House |
- Peár
- deriving (Show, Eq)
-
--- some char literals:
-
-charl = ['"', 'a', '\ESC', '\'', ' ']
-
--- closed type families
-type family Fam (a :: Type) = r :: Type where
- Fam Int = True
- Fam a = False
-
--- type literals
-type IntChar = '[Int, Char]
-type Falsy = 'False
-type Falsy = '(10, 20, 30)
diff --git a/tests/examplefiles/example.hx b/tests/examplefiles/example.hx
deleted file mode 100644
index 7584fc81..00000000
--- a/tests/examplefiles/example.hx
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- * This is not really a valid Haxe file, but just an demo...
- */
-
-package;
-package net.onthewings;
-
-import net.onthewings.Test;
-import net.onthewings.*;
-
-using Lambda;
-using net.onthewings.Test;
-
-#if flash8
-// Haxe code specific for flash player 8
-#elseif flash
-// Haxe code specific for flash platform (any version)
-#elseif js
-// Haxe code specific for javascript plaform
-#elseif neko
-// Haxe code specific for neko plaform
-#else
-// do something else
- #error // will display an error "Not implemented on this platform"
- #error "Custom error message" // will display an error "Custom error message"
-#end
-
-0; // Int
--134; // Int
-0xFF00; // Int
-
-123.0; // Float
-.14179; // Float
-13e50; // Float
--1e-99; // Float
-
-"hello"; // String
-"hello \"world\" !"; // String
-'hello "world" !'; // String
-
-true; // Bool
-false; // Bool
-
-null; // Unknown<0>
-
-~/[a-z]+/i; // EReg : regular expression
-
-var point = { "x" : 1, "y" : -5 };
-
-{
- var x;
- var y = 3;
- var z : String;
- var w : String = "";
- var a, b : Bool, c : Int = 0;
-}
-
-//haxe3 pattern matching
-switch(e.expr) {
- case EConst(CString(s)) if (StringTools.startsWith(s, "foo")):
- "1";
- case EConst(CString(s)) if (StringTools.startsWith(s, "bar")):
- "2";
- case EConst(CInt(i)) if (switch(Std.parseInt(i) * 2) { case 4: true; case _: false; }):
- "3";
- case EConst(_):
- "4";
- case _:
- "5";
-}
-
-switch [true, 1, "foo"] {
- case [true, 1, "foo"]: "0";
- case [true, 1, _]: "1";
- case _: "_";
-}
-
-
-class Test <T:Void->Void> {
- private function new():Void {
- inline function innerFun(a:Int, b:Int):Int {
- return readOnlyField = a + b;
- }
-
- _innerFun(1, 2.3);
- }
-
- static public var instance(get,null):Test;
- static function get_instance():Test {
- return instance != null ? instance : instance = new Test();
- }
-}
-
-@:native("Test") private class Test2 {}
-
-extern class Ext {}
-
-@:macro class M {
- @:macro static function test(e:Array<Expr>):ExprOf<String> {
- return macro "ok";
- }
-}
-
-enum Color {
- Red;
- Green;
- Blue;
- Grey( v : Int );
- Rgb( r : Int, g : Int, b : Int );
- Alpha( a : Int, col : Color );
-}
-
-class Colors {
- static function toInt( c : Color ) : Int {
- return switch( c ) {
- case Red: 0xFF0000;
- case Green: 0x00FF00;
- case Blue: 0x0000FF;
- case Grey(v): (v << 16) | (v << 8) | v;
- case Rgb(r,g,b): (r << 16) | (g << 8) | b;
- case Alpha(a,c): (a << 24) | (toInt(c) & 0xFFFFFF);
- }
- }
-}
-
-class EvtQueue<T : (Event, EventDispatcher)> {
- var evt : T;
-}
-
-typedef DS = Dynamic<String>;
-typedef Pt = {
- var x:Float;
- var y:Float;
- @:optional var z:Float; /* optional z */
- function add(pt:Pt):Void;
-}
-typedef Pt2 = {
- x:Float,
- y:Float,
- ?z:Float, //optional z
- add : Point -> Void,
-}
-
-
-//top-level class members
-public function test();
-private var attr(get, set) = 1;
-
-
-//pre-proc number
-public static inline function indexOf<T>(arr:Array<T>, v:T) : Int
-{
- #if (haxe_ver >= 3.1)
- return arr.indexOf(v);
- #else
- #if (flash || js)
- return untyped arr.indexOf(v);
- #else
- return std.Lambda.indexOf(arr, v);
- #end
- #end
-}
-
-//macro reification
-var e = macro var $myVar = 0;
-var e = macro ${v}.toLowerCase();
-var e = macro o.$myField;
-var e = macro { $myField : 0 };
-var e = macro $i{varName}++;
-var e = macro $v{myStr};
-var args = [macro "sub", macro 3];
-var e = macro "Hello".toLowerCase($a{args});
-(macro $i{tmp}.addAtom($v{name}, $atom)).finalize(op.pos);
-
-var c = macro class MyClass {
- public function new() { }
- public function $funcName() {
- trace($v{funcName} + " was called");
- }
-}
-
-var c = macro interface IClass {};
-
-//macro class could have no name...
-var def = macro class {
- private inline function new(loader) this = loader;
- private var loader(get,never) : $loaderType;
- inline private function get_loader() : $loaderType return this;
-};
-
-//ECheckType
-var f = (123:Float); \ No newline at end of file
diff --git a/tests/examplefiles/example.i6t b/tests/examplefiles/example.i6t
deleted file mode 100644
index 0f41b425..00000000
--- a/tests/examplefiles/example.i6t
+++ /dev/null
@@ -1,32 +0,0 @@
-B/examt: Example Template.
-
-@Purpose: To show the syntax of I6T, specifically the parts relating to the
-inclusion of I7 and at signs in the first column.
-
-@-------------------------------------------------------------------------------
-
-@p Lines.
-
-@c
-{-lines:type}
-! This is a comment.
-{-endlines}
-
-@-This line begins with @-, so it is ignored.
-
-@p Paragraph.
-This is a paragraph.
-@p Another paragraph.
-So
-
-is
-
-this.
-
-@Purpose: This purpose line is ignored.
-
-@c At signs and (+ +).
-[ Foo i;
-print (+score [an I7 value]+), "^";
-@add sp 1 -> i; ! Assembly works even in the first column.
-];
diff --git a/tests/examplefiles/example.i7x b/tests/examplefiles/example.i7x
deleted file mode 100644
index ab94ac69..00000000
--- a/tests/examplefiles/example.i7x
+++ /dev/null
@@ -1,45 +0,0 @@
-example by David Corbett begins here.
-
-"Implements testable examples."
-
-An example is a kind of thing. An example can be tested. An example is seldom tested.
-
-example ends here.
-
-----
-[The] documentation [starts here.]
-----
-
-This extension adds examples, which may be tested.
-
-Chapter: Usage
-
-To add an example to the story, we write:
-
- The foobar is an example.
-
-To interact with it in Inform 6, we write something like:
-
- To say (E - example): (-
- print (object) {E};
- -).
- [The IDE's documentation viewer does not display the closing -). I don't know how to fix that.]
-
-Section: Testing
-
-We can make an example be tested using:
-
- now the foobar is tested;
-
-Example: * Exempli Gratia - A simple example.
-
- *: "Exempli Gratia"
-
- Include example by David Corbett.
-
- The Kitchen is a room. The egg is an example, here.
-
- Before dropping the egg:
- now the egg is tested.
-
- Test me with "get egg / drop egg".
diff --git a/tests/examplefiles/example.icn b/tests/examplefiles/example.icn
deleted file mode 100644
index c8fcf335..00000000
--- a/tests/examplefiles/example.icn
+++ /dev/null
@@ -1,283 +0,0 @@
-#
-# $Id: button.icn,v 1.7 2006-07-09 23:43:07 rparlett Exp $
-#
-# This file is in the public domain.
-#
-# Author: Robert Parlett (parlett@dial.pipex.com)
-#
-
-package gui
-link graphics
-
-$include "guih.icn"
-
-
-#
-# This is the parent class of the button classes, including
-# checkboxes.
-#
-# A {Button} produces a BUTTON_PRESS_EVENT when the button is
-# depressed, and code BUTTON_RELEASE_EVENT when it is released,
-# as well as an ACTION_EVENT.
-#
-# By default, when a button holds the keyboard focus a dashed
-# line appears just within the button. Then, when return is
-# pressed an ACTION_EVENT is generated. The method
-# {Dialog.set_initial_focus()} can be used to have the button
-# have the focus when the dialog is first displayed.
-#
-# Buttons also repeatedly produce a BUTTON_HELD_EVENT whilst they
-# are held down, rather like a repeating keyboard press. The
-# delay between the initial repeat event and subsequent repeat
-# events is set in the parent dialog (see above).
-#
-class Button : Toggle : Component(
- is_down, #
- is_held, #
- is_checked_flag, #
- label,
- img_up, #
- img_down, #
- img_w, #
- img_h, #
- parent_check_box_group, #
- parent_button_group, #
- repeat_delay,
- no_keyboard_flag, #
- toggles_flag
- )
-
- method set_parent_button_group(x)
- return self.parent_button_group := x
- end
-
- #
- # Invoking this method disables the keyboard control over the
- # button described above. No dashed line will ever appear in
- # the button display and return will have no effect on the
- # button even if it has the focus.
- #
- method set_no_keyboard()
- self.no_keyboard_flag := 1
- self.accepts_focus_flag := &null
- end
-
- #
- # Clear the no keyboard behaviour (the default)
- #
- method clear_no_keyboard()
- self.no_keyboard_flag := &null
- self.accepts_focus_flag := 1
- end
-
- method tick()
- if dispatcher.curr_time_of_day() > self.repeat_delay then
- fire(BUTTON_HELD_EVENT)
- end
-
- method go_down()
- self.is_down := 1
- set_ticker(self.parent_dialog.repeat_rate)
- end
-
- method go_up()
- self.is_down := &null
- stop_ticker()
- end
-
- method handle_press(e)
- local b
- if self.in_region() then {
- go_down()
- self.repeat_delay := dispatcher.curr_time_of_day() + self.parent_dialog.repeat_delay
- self.is_held := 1
- every b := !(\self.parent_button_group).buttons do {
- if b.is_unhidden() then {
- b.is_held := 1
- b.repeat_delay := self.repeat_delay
- }
- }
- self.invalidate()
- fire(BUTTON_PRESS_EVENT, e)
- }
- end
-
- method handle_drag(e)
- if \self.is_held then {
- #
- # Button held down; toggle on/off as it goes over the button
- #
- if self.in_region() then {
- if /self.is_down then {
- go_down()
- invalidate()
- }
- } else {
- if \self.is_down then {
- go_up()
- invalidate()
- }
- }
- }
- end
-
- method handle_release(e)
- if \self.is_held then {
- self.is_held := &null
- if \self.is_down then {
- go_up()
- fire(BUTTON_RELEASE_EVENT, e)
- on_action(e)
- }
- }
- end
-
- method on_action(e)
- if \self.toggles_flag then {
- if \self.parent_check_box_group then
- self.parent_check_box_group.set_which_one(self)
- else
- self.toggle_is_checked()
- }
- self.invalidate()
- fire(ACTION_EVENT, e)
- end
-
- method handle_accel(e)
- self.Component.handle_accel(e)
- on_action(e)
- end
-
- method handle_default(e)
- if \self.has_focus then {
- if /self.no_keyboard_flag & e == ("\r" | "\l" | " ") then {
- on_action(e)
- }
- }
- end
-
- method handle_event(e)
- if e === (&lpress | &rpress | &mpress) then {
- handle_press(e)
- } else if e === (&ldrag | &rdrag | &mdrag) then {
- handle_drag(e)
- } else if e === (&lrelease | &rrelease | &mrelease) then {
- handle_release(e)
- } else
- handle_default(e)
- end
-
- #
- # Set the up/down images (if any) to the strings provided,
- # which should be in Icon image format.
- # The two images must have the same dimensions.
- # @param x The up image
- # @param y The down image
- #
- method set_imgs(x, y)
- self.img_up := x
- self.img_w := img_width(x) = img_width(y) | fatal("Image widths differ")
- self.img_h := img_height(x) = img_height(y) | fatal("Image heights differ")
-
- self.img_down := y
-
- return
- end
-
- #
- # Set the image (if any) to the given string, which should be in Icon image
- # format.
- # @param x The image
- #
- method set_img(x)
- self.img_up := self.img_down := x
- self.img_w := img_width(x)
- self.img_h := img_height(x)
- return x
- end
-
- #
- # Toggle the checked status of the button. This method, and
- # the following two methods, may be
- # inappropriate for non-toggle styles of button.
- #
- method toggle_is_checked()
- self.Toggle.toggle_is_checked()
- self.invalidate()
- end
-
- #
- # Set the status to checked.
- #
- method set_is_checked()
- self.Toggle.set_is_checked()
- self.invalidate()
- end
-
- #
- # Set the status to unchecked.
- #
- method clear_is_checked()
- self.Toggle.clear_is_checked()
- self.invalidate()
- end
-
- #
- # Set the button so that when it is pressed, it toggles
- # between two states, as indicated by the is_checked
- # flag.
- #
- # Instances of Checkbox have this flag on by default, but
- # TextButton and IconButton do not. When the flag is on,
- # the latter classes indicate their checked status by
- # showing the button as being "down".
- #
- method set_toggles()
- self.toggles_flag := 1
- self.invalidate()
- end
-
- #
- # Clear the toggles flag.
- #
- method clear_toggles()
- self.toggles_flag := &null
- self.invalidate()
- end
-
- #
- # Set the label of the button, if any.
- # @param x The label
- #
- method set_label(x)
- self.label := x
- self.invalidate()
- return x
- end
-
- method set_one(attr, val)
- case attr of {
- "label" : set_label(string_val(attr, val))
- "is_checked" :
- if test_flag(attr, val) then
- set_is_checked()
- else
- clear_is_checked()
- "toggles" :
- if test_flag(attr, val) then
- set_toggles()
- else
- clear_toggles()
- "no_keyboard" :
- if test_flag(attr, val) then
- set_no_keyboard()
- else
- clear_no_keyboard()
- default: self.Component.set_one(attr, val)
- }
- end
-
- initially()
- self.Component.initially()
- self.accepts_focus_flag := 1
-end \ No newline at end of file
diff --git a/tests/examplefiles/example.icon b/tests/examplefiles/example.icon
deleted file mode 100644
index 29bc548b..00000000
--- a/tests/examplefiles/example.icon
+++ /dev/null
@@ -1,381 +0,0 @@
-############################################################################
-#
-# File: kaleid.icn
-#
-# Subject: Program to produce kaleidoscope
-#
-# Author: Stephen B. Wampler
-#
-# Date: May 2, 2001
-#
-############################################################################
-#
-# This file is in the public domain.
-#
-############################################################################
-#
-# Lots of options, most easily set by with the interface after
-# startup. The only one that isn't set that way is -wn where 'n' is
-# the size of the kaleidoscope window (default is 600 square).
-#
-# Terminology (and options):
-#
-# Window_size (-wN): How big of a display window to use.
-# At the current time, this can only be set via a
-# command line argument.
-#
-# Density (-dN): How many circles per octant to keep on display
-# at any one time. There is NO LIMIT to the density.
-#
-# Duration (-lN): How long to keep drawing circles (measured in
-# in circles) once the density is reached. There is NO LIMIT
-# to the duration.
-#
-# MaxRadius (-MN): Maximum radius of any circle.
-#
-# MinRadius (-mN): Preferred minimum radius. Circles with centers
-# near the edge have their radii forced down to fit entirely
-# on the display
-#
-# MaxOffset (-XN): Maximum offset from center of display (may wrap).
-#
-# MinOffset (-xN): Minimum offset
-#
-# Skew (-sN): Shift probability of placing a circle at a 'typical'
-# offset.
-#
-# Fill (-F): Turns off filling the circles.
-#
-# Clear (-C): After the duration, reduces density back to 0 before
-# quitting.
-#
-# Random Seed: (-rN): Sets the random number seed.
-#
-# Thanks to Jon Lipp for help on using vidgets, and to Mary Camaron
-# for her Interface Builder.
-#
-############################################################################
-#
-# Requires: Version 9 graphics
-#
-############################################################################
-#
-# Links: vidgets, vslider, vtext, vbuttons, vradio, wopen, xcompat
-#
-############################################################################
-
-link vidgets
-link vslider
-link vtext
-link vbuttons
-link vradio
-link wopen
-link xcompat
-
-global Clear, fill, duration, density, maxoff, minoff
-global maxradius, minradius, r_seed, skew, win_size, mid_win
-global root, check1, mainwin, use_dialog
-global draw_circle
-
-global du_v, de_v, rs_v, sk_v
-
-procedure main (args)
-
- draw_circle := DrawCircle
-
- init_globs()
- process_args(args)
-
- if \use_dialog then { # have vidgets, so use them for args.
- mainwin := WOpen("label=Kaleidoscope", "width=404", "height=313",
- "font=6x12") |
- stop ("bad mainwin")
- root := ui (mainwin)
- GetEvents (root, quit)
- }
- else { # just rely on command line arguments
- kaleidoscope(r_seed)
- }
-
-end
-
-procedure init_globs()
-
- duration := 500 # set default characteristics
- density := 30
- win_size := 600
- minoff := 1
- maxradius := 150
- minradius := 1
- skew := 1
- fill := "On"
- draw_circle := FillCircle
- Clear := "Off"
- r_seed := map("HhMmYy", "Hh:Mm:Yy", &clock)
- # See if the Vidget library is available or not
- if \VSet then use_dialog := "yes"
- else use_dialog := &null
-
-end
-
-procedure process_args(args)
- local arg
-
- # really only needed if you don't use the dialog box
- every arg := !args do case arg[1+:2] of {
- "-w" : win_size := integer(arg[3:0]) # window size
- "-d" : density := integer(arg[3:0]) # density of circles
- "-l" : duration := integer(arg[3:0]) # duration
- "-M" : maxradius := integer(arg[3:0]) # maximum radius
- "-m" : minradius := integer(arg[3:0]) # minimum radius
- "-X" : maxoff := integer(arg[3:0]) # maximum offset
- "-x" : minoff := integer(arg[3:0]) # minimum offset
- "-s" : skew := numeric(arg[3:0]) # set skewedness
- "-F" : fill := &null # turn off fill
- "-C" : Clear := "yes" # turn on clear mode
- "-r" : r_seed := integer(arg[3:0]) # random seed
- "-h" : stop("usage: kal [-wn] [-dn] [-ln] [-Mn] [-mn] [-Xn] [-xn] _
- [-sn] [-F] [-C] [-rn]")
- }
- # adjust parameters that depend on the window size...
- mid_win := win_size/2
- maxoff := win_size-1
-end
-
-# Lorraine Callahan's kaleidoscope program, translated into icon.
-# (some of the things she did were too sophisticated for me
-# to spend time to figure out, so the output is square instead of
-# round), and I use 'xor' to draw instead of writing to separate
-# bit planes.
-
-global putcircle, clrcircle
-
-procedure kaleidoscope(r)
- local colors
-
- # What colors to use? This can be changed to whatever!
- colors := ["red","green","blue","cyan","magenta","yellow"]
-
- &window := WOpen("label=Kaleidoscope: 'q' quits", "width="||win_size,
- "height="||win_size, "bg=black")
- WAttrib("drawop=xor")
-
- # Create two *indentical* sequences of circles, one to use when
- # when drawing, one for erasing. (Since 'xor' is used to
- # place them, these both just draw the circles!)
-
- putcircle := create { # draws sequence of circles
- &random :=: r
- |{
- Fg(?colors)
- outcircle()
- &random <-> r
- }
- }
-
- clrcircle := create { # erases sequence of circles
- &random :=: r
- |{
- Fg(?colors)
- outcircle()
- &random <-> r
- }
- }
-
- every 1 to density do @putcircle # fill screen to density
-
- every 1 to duration do { # maintain steady state
- @putcircle
- @clrcircle
- if *Pending(&window) > 0 then break
- }
-
- every (Clear == "On") & 1 to density do @clrcircle
-
- close(&window)
-end
-
-
-procedure outcircle() # select a circle at random,
-local radius, xoff, yoff # draw it in kaleidoscopic form
-
- # get a random center point and radius
- xoff := (?(maxoff - minoff) + minoff) % mid_win
- yoff := (?(maxoff - minoff) + minoff) % mid_win
- radius := ?0 ^ skew
- # force radius to 'fit'
- radius := ((maxradius-minradius) * radius + minradius) %
- (mid_win - ((xoff < yoff)|xoff))
-
- # put into all 8 octants
- draw_circle(mid_win+xoff, mid_win+yoff, radius)
- draw_circle(mid_win+xoff, mid_win-yoff, radius)
- draw_circle(mid_win-xoff, mid_win+yoff, radius)
- draw_circle(mid_win-xoff, mid_win-yoff, radius)
-
- draw_circle(mid_win+yoff, mid_win+xoff, radius)
- draw_circle(mid_win+yoff, mid_win-xoff, radius)
- draw_circle(mid_win-yoff, mid_win+xoff, radius)
- draw_circle(mid_win-yoff, mid_win-xoff, radius)
-
- return
-end
-
-
-############################################################################
-#
-# Vidget-based user interface -- developed originally using Mary
-# Camaron's XIB program. Don't expect this to be very readable -
-# you should have to play with it!
-#
-############################################################################
-procedure ui (win)
- local cv1, cv2, cv3, cv4
- local
- radio_button2,
- radio_button1,
- text_input6,
- text_input5,
- slider4,
- slider3,
- text_input4,
- text_input3,
- slider2,
- slider1
-
- /win := WOpen("label=ui", "width=404", "height=313", "font=6x12") |
- stop ("bad win")
- root := Vroot_frame (win)
-
- VInsert (root, Vmessage(win, win_size/2), 168, 98)
- VInsert (root, Vmessage(win, "1"), 108, 97)
-
- VInsert (root, sk_v := Vtext(win,"Skew:\\=1",get_skew,,6), 280, 39)
-
- VInsert (root, du_v := Vtext(win, "Duration:\\="||duration, get_duration,,9),
- 237, 15)
-
- VInsert (root, Vmessage(win, "Clear at end?"), 232, 145)
- VInsert (root, Vmessage(win, "Fill?"), 105, 142)
- VInsert (root, Vmessage(win,"Quit?"), 267, 259)
- VInsert (root, Vmessage(win,"Display it?"), 26, 260)
-
- VInsert (root, Vcheckbox(win, do_quit, "check2",20), 305, 255, 20, 20)
-
- VInsert (root, check1:=Vcheckbox(win, do_display, "check1",20),
- 106, 258, 20, 20)
-
- radio_button2 := Vradio_buttons (win, ["On", "Off"], get_clear, , V_CIRCLE)
- VSet(radio_button2,Clear)
- VInsert (root, radio_button2, 253, 165)
-
- radio_button1 := Vradio_buttons (win, ["On", "Off"], get_fill, , V_CIRCLE)
- VSet(radio_button1,fill)
- VInsert (root, radio_button1, 99, 165)
-
- cv1 := Vcoupler()
- VAddClient(cv1, get_max_offset)
- text_input6 := Vtext (win, "Max Offset:\\="||(win_size-1), cv1, , 3)
- VAddClient(cv1, text_input6)
- slider4 := Vhoriz_slider (win, cv1, "slider4", 70, 12, 0,
- win_size-1, win_size-1, )
- VAddClient(cv1, slider4)
- VInsert (root, text_input6, 196, 103)
- VInsert (root, slider4, 306, 106)
-
- cv2 := Vcoupler()
- VAddClient(cv2, get_min_offset)
- text_input5 := Vtext (win, "Min Offset\\=1", cv2, , 3)
- VAddClient(cv2, text_input5)
- slider3 := Vhoriz_slider (win, cv2, "slider3", 70, 12, 1, win_size-1, 1, )
- VAddClient(cv2, slider3)
- VInsert (root, text_input5, 201, 80)
- VInsert (root, slider3, 307, 82)
-
- cv3 := Vcoupler()
- VAddClient(cv3, get_max_radius)
- text_input4 := Vtext (win, "Max Radius\\="||(win_size/4), cv3, , 3)
- VAddClient(cv3, text_input4)
- slider2 := Vhoriz_slider (win, cv3, "slider2", 70, 12, 1, win_size/2,
- win_size/4, )
- VAddClient(cv3, slider2)
- VInsert (root, text_input4, 10, 104)
- VInsert (root, slider2, 110, 108)
-
- cv4 := Vcoupler()
- VAddClient(cv4, get_min_radius)
- text_input3 := Vtext (win, "Min Radius\\=1", cv4, , 3)
- VAddClient(cv4, text_input3)
- slider1 := Vhoriz_slider (win, cv4, "slider1", 70, 12, 1, win_size/2, 1, )
- VAddClient(cv4, slider1)
- VInsert (root, text_input3, 10, 81)
- VInsert (root, slider1, 110, 84)
-
- VInsert (root, rs_v := Vtext(win,"Random Seed:\\="||r_seed, get_random,, 11),
- 30, 41)
- VInsert (root, de_v := Vtext(win,"Density:\\="||density, get_density,,8),
- 71, 16)
-
- VResize (root)
- return root
-end
-
-procedure get_skew (wit, value)
- skew := value
-end
-
-procedure get_duration (wit, value)
- duration := value
-end
-
-procedure do_quit (wit, value)
- stop()
-end
-
-procedure do_display (wit, value)
- r_seed := numeric(rs_v.data)
- duration := integer(du_v.data)
- density := integer(de_v.data)
- skew := integer(sk_v.data)
- kaleidoscope(r_seed)
- wit.callback.value := &null
- VDraw(check1)
-end
-
-procedure get_clear (wit, value)
- Clear := value
-end
-
-procedure get_fill (wit, value)
- fill := value
- if fill == "Off" then draw_circle := DrawCircle
- else draw_circle := FillCircle
-end
-
-procedure get_max_offset (wit, value)
- maxoff := value
-end
-
-procedure get_min_offset (wit, value)
- minoff := value
-end
-
-procedure get_max_radius (wit, value)
- maxradius := value
-end
-
-procedure get_min_radius (wit, value)
- minradius := value
-end
-
-procedure get_random (wit, value)
- r_seed := integer(value)
-end
-
-procedure get_density (wit, value)
- density := integer(value)
-end
-
-procedure quit(e)
- if e === "q" then stop ("Exiting Kaleidoscope")
-end
diff --git a/tests/examplefiles/example.j b/tests/examplefiles/example.j
deleted file mode 100644
index 16cdde86..00000000
--- a/tests/examplefiles/example.j
+++ /dev/null
@@ -1,564 +0,0 @@
-; Example JVM assembly
-; Tested with JasminXT 2.4
-
-.bytecode 49.0
-.source HelloWorld.java
-.class public final enum HelloWorld
-.super java/lang/Object
-.implements java/io/Serializable
-.signature "Ljava/lang/Object;Ljava/io/Serializable;"
-.enclosing method hw/jasmin.HelloWorldRunner.run()V
-.deprecated
-.annotation visible HelloWorld
- I I = 0
-.end annotation
-.debug "Happy debugging!"
-
-.inner interface public InnerInterface inner 'HelloWorld$InnerInterface' outer HelloWorld
-.inner class public InnerClass inner HelloWorld$InnerClass outer 'HelloWorld'
-
-.field public volatile transient I I
-.field static protected final serialVersionUID 'J' signature "TJ;" = 2147483648
-.field annotation protected 'protected' [[[Lcom/oracle/util/Checksums;
- .deprecated
- .signature "[[[Lcom/oracle/util/Checksums;"
- .attribute foo "foo.txt"
- .attribute 'foo' "foo.txt"
-.end field
-.field public newline I
-.field public static defaultString 'Ljava/lang/String;'
-
-.method public <init>()V
- .limit stack 3
-.line 7
- .var 0 is self LHelloWorld; from 0 to 1
- aload_0
- invokenonvirtual java/lang/Object/<init>()V
- return
-.end method
-
-.method static public main([Ljava/lang/String;)V
- .limit locals 7
- .limit stack 10
- .throws java.lang/RuntimeException
- .catch java/lang.ClassCastException from cast to 'extra_l' using /extra
- .signature "([Ljava/lang/String;)V"
- .stack
- offset /Input
- locals Object java/lang/String
- locals Uninitialized 'End'
- locals Uninitialized 0
- locals Top
- locals Integer
- locals Float
- locals Long
- locals Double
- locals Null
- locals UninitializedThis
- stack Object java/lang/String
- stack Uninitialized End
- stack 'Uninitialized' 0
- stack 'Top'
- stack Integer
- stack Float
- stack Long
- stack Double
- stack Null
- stack UninitializedThis
- .end stack
- .stack use 1 locals
- offset 'extra'
- .end stack
- .stack use locals
- .end stack
-.line 0xd
- .var 0 is args [Ljava/lang/String;
- aload_w 0
- arraylength
- ifne /Input
- iconst_1
- anewarray java/lang/String
- checkcast [Ljava/lang/String;
- astore_0
- aload_0
- iconst_0
- ldc "World"
- dup
- putstatic HelloWorld.defaultString Ljava/lang/String;
- aastore
-/Input:
- iconst_2
- iconst_3
- multianewarray [[C 2
- astore_1
- aload_1
- iconst_0
- aaload
- astore_2
- aload_1
- iconst_1
- aaload
- astore_3
-
-<<o:
- aload_3
- iconst_0
- invokestatic HelloWorld/int()I
- castore
-
-<<\u0020:
- aload_3
- dconst_1
- dconst_0
- dsub
- d2i
- invokestatic HelloWorld/double()D
- d2i
- castore
-
-<<!:
- aload_3
- lconst_0
- dup2
- lxor
- lconst_1
- dup2
- ladd
- lsub
- lneg
- l2i
- invokestatic HelloWorld/long()J
- l2i
- castore
-
-<<H:
- aload_2
- fconst_0
- fconst_1
- fconst_2
- dup_x2
- fdiv
- fmul
- f2l
- l2i
- swap
- invokestatic HelloWorld/float(F)F
- f2i
- castore
-
-<<e :
- aload_2
- iconst_1
- i2s
- i2c
- i2b
- iconst_1
- newarray short
- dup
- iconst_0
- iconst_1
- newarray byte
- dup
- iconst_0
- sipush 0x65
- bastore
- iconst_0
- baload
- sastore
- iconst_0
- saload
- int2short
- int2char
- int2byte
- castore
-
- <<l :
- aload_2
- iconst_2
- bipush 0x1b
-*2:
- iconst_1
- ishl
- dup
- lookupswitch
- 0: '/lookupswitch'
- 0x6c: /lookupswitch
- default: *2
-/lookupswitch:
- castore
-
- ldc2_w 2
- dup2
- lcmp
- .set i 4
- .set 'j' 5
- .var 4 is i I from 'i++' to End
- .var 5 is j I signature "I" from i++ to End
- istore 4
- goto 1
-i++:
- iinc 4 1
-1: iconst_0
- istore_w 5
- goto_w 2
-j++:
- iinc_w 5 1
-2: getstatic java/lang/System/out Ljava/io/PrintStream;
- aload_1
- iload 4
- aaload
- iload_w 5
- caload
- invokevirtual java/io/PrintStream/print(C)V
- iload 5
- iconst_1
- if_icmpne $+6
- jsr extra
- iload 5
- iconst_2
- if_icmplt j++
- iconst_1
- iload 4
- if_icmpgt i++
-
-<<\u00a0:
- getstatic java/lang/System/out Ljava/io/PrintStream;
- invokestatic HelloWorld/get"example()LHelloWorld;
- getfield HelloWorld/newline I
- invokevirtual java/io/PrintStream/print(C)V
-End:
- return
-
-extra:
- astore 6
- iload 4
- tableswitch 0 1
- extra_l
- extra_string
- default: 'End'
- nop
-extra_string:
- getstatic java/lang/System/out Ljava/io/PrintStream;
- aload 0
- iconst_0
- aaload
- invokevirtual java/io/PrintStream/print(Ljava/lang/String;)V
-cast:
- ldc java/lang/String
- checkcast java/lang/Class
- pop
- ldc Ljava/lang/String;
- checkcast Ljava/lang/Class;
- pop
- iconst_1
- dup
- newarray boolean
- checkcast [Z
- pop
- newarray 'int'
- checkcast HelloWorld
- checkcast LHelloWorld;
- pop
-extra_l:
- getstatic java/lang/System/out Ljava/io/PrintStream;
- dup
- ldc "\123.\456.\u006c.\n.\r.\t.\f.\b.\".\'.\\"
- iconst_5
- invokeinterface java/lang/CharSequence/charAt(I)C 2
- invokevirtual java/io/PrintStream/print(C)V
-/extra:
- pop
- ret 6
-.end method
-
-.method private static get"example()LHelloWorld;
- .limit locals 3
- .limit stack 4
- .catch all from 7 to 53 using 59
- aconst_null
- dup
- dup
- astore_w 0
-try:
- goto $+0x11
-finally:
- astore_w 2
- putfield HelloWorld/newline I
- ret_w 2
- nop
- aload_0
- areturn
- ifnonnull $-2
- ifnull $+3
- new HelloWorld
- dup
- dup
- invokespecial HelloWorld/<init>()V
- astore 0
- aload 0
- monitorenter
- monitorexit
- new java/lang/RuntimeException
- dup
- invokespecial java/lang/RuntimeException/<init>()V
- athrow
- aconst_null
-/try:
- dup
- aconst_null
- if_acmpeq $+3
- areturn
-catch:
- jsr $+10
- aload_0
- dup
- aconst_null
- if_acmpne /try
- areturn
- astore_1
- aload_0
- ldc 10
- jsr_w finally
- ret 1
-'single\u0020quoted\u0020label': ; Messes up [@ below if lexed sloppily
-.end method
-
-.method varargs private static int()I
- .annotation invisible HelloWorld
- [@ [@ WhatIsThis??? = .annotation ; name, type, exttype
- I I = 1 ; name, type
- another-I I = 2
- Enum e Ljava/util/logging/Level; = FINE
- .end annotation
- .annotation
- s s = "foo"
- another-s s = "bar"
- Enum [e Ljava/util/logging/Level; = FINE FINE 'FINE' FINE
- .end annotation
- float F = 123.456
- .end annotation
- .annotation visibleparam 1 LHelloWorld;
- x [I = 0x01 0x02 0x03
- y I = 2
- .end annotation
- .annotation invisibleparam 255 HelloWorld
- a F = 1.2
- b D = 3.4
- .end annotation
- .annotation default
- I = 0
- .end annotation
- .limit locals 4
- .limit stack 20
- iconst_1
- newarray int
- dup
- dup
- instanceof [Z
- bipush 0x9
- bipush 0xB
- iand
- iconst_5
- iconst_4
- dup_x1
- iconst_m1
- iadd
- bipush +-111
- ineg
- swap
- idiv
- dup_x2
- dup
- ishr
- ishl
- imul
- ior
- bipush -73
- ixor
- isub
- dup
- iconst_1
- iadd
- irem
- iastore
- iconst_0
- iaload
- istore_0
- iload_0
- istore_1
- iload_1
- istore_2
- iload_2
- istore_3
- iload_3
- dup
- dup
- dup2_x1
- if_icmpeq $+33
- dup
- dup
- if_icmpge $+28
- dup
- dup
- if_icmple $+23
- dup
- ifle $+19
- dup
- ifeq $+15
- dup
- iflt $+11
- dup
- ifgt $+7
- dup
- ifge $+3
- ireturn
-.end method
-
-.method static private fpstrict double()D
- .limit locals 7
- .limit stack 11
- dconst_1
- dconst_0
- dcmpg
- newarray double
- dup
- dconst_0
- dup2
- dcmpl
- ldc2_w 128.
- ldc2_w -240.221d
- dneg
- ldc2_w 158.d
- dup2
- dadd
- dup2_x2
- drem
- ddiv
- pop2
- dconst_1
- dmul
- d2f
- f2d
- d2l
- l2i
- iconst_2
- iushr
- i2d
- dastore
- iconst_0
- daload
- dstore_0
- dload_0
- dstore_1
- dload_1
- dstore_2
- dload_2
- dstore_3
- dload_3
- dstore 4
- dload 4
- dstore_w 5
- dload_w 5
- dreturn
-.end method
-
-.method static long()J
- .limit locals 7
- .limit stack 11
- iconst_1
- newarray long
- dup
- iconst_0
- ldc2_w 5718613688
- ldc2_w 3143486100
- ldc2_w 0x3
- ldiv
- lmul
- ldc2_w -10000000000
- lrem
- ldc_w 0x60
- i2l
- lor
- ldc 0x33
- i2l
- land
- dup2
- iconst_1
- lshl
- iconst_3
- lshr
- iconst_3
- lushr
- ladd
- l2d
- d2l
- l2f
- f2l
- lastore
- iconst_0
- laload
- lstore_0
- lload_0
- lstore_1
- lload_1
- lstore_2
- lload_2
- lstore_3
- lload_3
- lstore 4
- lload 4
- lstore_w 5
- lload_w 5
- lreturn
-.end method
-
-.method private static float(F)F
- .limit locals 6
- .limit stack 9
- iconst_1
- newarray float
- dup
- fload_0
- dup
- fcmpg
- fload_0
- dup
- dup
- dup
- dup2_x2
- fadd
- fsub
- fneg
- frem
- ldc 70
- i2f
- fadd
- fadd
- swap
- pop
- fastore
- fload_0
- dup
- fcmpl
- faload
- fstore_0
- fload_0
- fstore_1
- fload_1
- fstore_2
- fload_2
- fstore_3
- fload_3
- fstore 4
- fload 4
- fstore_w 5
- fload_w 5
- freturn
-.end method
-
-.method abstract bridge synthetic 'acc1()V'
- breakpoint
-.end method
-
-.method native synchronized acc2()V
-.end method
diff --git a/tests/examplefiles/example.jag b/tests/examplefiles/example.jag
deleted file mode 100644
index cae34beb..00000000
--- a/tests/examplefiles/example.jag
+++ /dev/null
@@ -1,48 +0,0 @@
-# lsat.jags example from classic-bugs examples in JAGS
-# See http://sourceforge.net/projects/mcmc-jags/files/Examples/2.x/
-var
- response[R,T], m[R], culm[R], alpha[T], a[T], theta[N], r[N,T],
- p[N,T], beta, theta.new, p.theta[T], p.item[R,T], P.theta[R];
-data {
- for (j in 1:culm[1]) {
- r[j, ] <- response[1, ];
- }
- for (i in 2:R) {
- for (j in (culm[i - 1] + 1):culm[i]) {
- r[j, ] <- response[i, ];
- }
- }
-}
-model {
- # 2-parameter Rasch model
- for (j in 1:N) {
- for (k in 1:T) {
- probit(p[j,k]) <- delta[k]*theta[j] - eta[k];
- r[j,k] ~ dbern(p[j,k]);
- }
- theta[j] ~ dnorm(0,1);
- }
-
- # Priors
- for (k in 1:T) {
- eta[k] ~ dnorm(0,0.0001);
- e[k] <- eta[k] - mean(eta[]); # sum-to-zero constraint
-
- delta[k] ~ dnorm(0,1) T(0,); # constrain variance to 1, slope +ve
- d[k] <- delta[k]/pow(prod(delta), 1/T); # PRODUCT_k (d_k) = 1
-
- g[k] <- e[k]/d[k]; # equivalent to B&A's threshold parameters
- }
-
- # Compute probability of response pattern i, for later use in computing G^2
- theta.new ~ dnorm(0,1); # ability parameter for random student
- for(k in 1:T) {
- probit(p.theta[k]) <- delta[k]*theta.new - eta[k];
- for(i in 1:R) {
- p.item[i,k] <- p.theta[k]^response[i,k] * (1-p.theta[k])^(1-response[i,k]);
- }
- }
- for(i in 1:R) {
- P.theta[i] <- prod(p.item[i,])
- }
-}
diff --git a/tests/examplefiles/example.java b/tests/examplefiles/example.java
deleted file mode 100644
index 78f9d727..00000000
--- a/tests/examplefiles/example.java
+++ /dev/null
@@ -1,16 +0,0 @@
-class _PostUnico$deClassá
-{void fo$o() {}
-
- void PostUnicodeFunctioná() {
- láb$el:
- break láb$el;
-
- }
-}
-
-class áPreUnicode$Class
-{
- public int $foo;
- public int á$foo;
- _PostUnico$deClassá áPreUnicodeFunction() { return null; }
-}
diff --git a/tests/examplefiles/example.jcl b/tests/examplefiles/example.jcl
deleted file mode 100644
index 18d4ae37..00000000
--- a/tests/examplefiles/example.jcl
+++ /dev/null
@@ -1,31 +0,0 @@
-//IS198CPY JOB (PYGM-TEST-001),'PYGMENTS TEST JOB',
-// CLASS=L,MSGCLASS=X,TIME=(00,10)
-//* Copy 'OLDFILE' to 'NEWFILE'.
-//COPY01 EXEC PGM=IEBGENER
-//SYSPRINT DD SYSOUT=*
-//SYSUT1 DD DSN=OLDFILE,DISP=SHR
-//SYSUT2 DD DSN=NEWFILE,
-// DISP=(NEW,CATLG,DELETE),
-// SPACE=(CYL,(40,5),RLSE), Some comment
-// DCB=(LRECL=115,BLKSIZE=1150)
-//SYSIN DD DUMMY
-/*
-//* Test line continuation in strings.
-//CONT01 EXEC PGM=IEFBR14,PARM='THIS IS A LONG PARAMETER WITHIN APOST
-// ROPHES, CONTINUED IN COLUMN 15 OF THE NEXT RECORD'
-//* Sort a couple of lines and show the result in the job log.
-//SORT01 EXEC PGM=IEFBR14
-//SORTIN DD *
-spam
-eggs
-ham
-/*
-//SORTOUT DD SYSOUT=*
-/*
-//* Test line continuation with comment at end of line continued by a
-//* character at column 72 (in this case 'X').
-//STP4 EXEC PROC=BILLING,COND.PAID=((20,LT),EVEN),
-// COND.LATE=(60,GT,FIND),
-// COND.BILL=((20,GE),(30,LT,CHGE)) THIS STATEMENT CALLS THE X
-// BILLING PROCEDURE AND SPECIFIES RETURN CODE TESTS FOR THREEX
-// PROCEDURE STEPS.
diff --git a/tests/examplefiles/example.jsgf b/tests/examplefiles/example.jsgf
deleted file mode 100644
index cd79dbed..00000000
--- a/tests/examplefiles/example.jsgf
+++ /dev/null
@@ -1,28 +0,0 @@
-#JSGF V1.0 UTF-8 en;
-
-grammar org.pygments.example;
-
-// comment /*
-/*
- multi-line
- comment
- /* without nesting
- @example doesn't mean anything here.
-*/
-/**/
-
-/**
- * A silly @example grammar.
- *
- * @author David Corbett
- * @version 1
-* @see <org.pygments.example.en>
- * @example hello world
- @example hello ","
- *
- **@blah
- **world
- */
-public <sentence> = (/1/<en> | / 0.8f /<fr> |/0/<VOID>""""{}{})*<NULL>;
-<org.pygments.example.fr> = bonjour {hello} [,] "le monde" {world};
-<en> = (/56/hello|/3.14e3/"\"hello\"") {hello} {{ {\\//\} } world {world} !+ ;
diff --git a/tests/examplefiles/example.jsonld b/tests/examplefiles/example.jsonld
deleted file mode 100644
index 48787d75..00000000
--- a/tests/examplefiles/example.jsonld
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "@context": {
- "schema": "http://schema.org/",
- "name": "schema:name",
- "body": "schema:articleBody",
- "words": "schema:wordCount",
- "post": {
- "@id": "schema:blogPost",
- "@container": "@index"
- }
- },
- "@id": "http://example.com/",
- "@type": "schema:Blog",
- "name": "World Financial News",
- "post": {
- "en": {
- "@id": "http://example.com/posts/1/en",
- "body": "World commodities were up today with heavy trading of crude oil...",
- "words": 1539
- },
- "de": {
- "@id": "http://example.com/posts/1/de",
- "body": "Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl...",
- "words": 1204
- }
- }
-}
diff --git a/tests/examplefiles/example.juttle b/tests/examplefiles/example.juttle
deleted file mode 100644
index ae861996..00000000
--- a/tests/examplefiles/example.juttle
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Block comment */
-/*
- Multiline block
- comment
-*/
-
-// inline comment
-function juttleFunction(arg) {
- if (arg == null) {
- return null;
- }
- else if (arg == 0) {
- return 'zero';
- }
- else if (arg == 1) {
- return "one";
- }
- else {
- return 1.1;
- }
-}
-
-reducer juttleReducer(field) {
- var x = 0;
- function update() {
- x = *field;
- }
-
- function result() {
- return x;
- }
-}
-
-sub myemit(limit) {
- emit -limit limit
-}
-
-input test: text -default 'input';
-const object = {
- xyz: 123,
- name: 'something'
-};
-
-const array = [
- :2016-01-01:,
- :2016-01-01T01:00:00:,
- :2016-01-01T01:00:00.000:,
- :2016-01-01T01:00:00.000Z:,
- :2016-01-01T01:00:00.000-0800:,
- :2016-01-01T01:00:00.000-08:00:,
- :00:00:01:,
- :00:00:00.001:,
- :now:,
- :beginning:,
- :end:,
- :forever:,
- :yesterday:,
- :today:,
- :tomorrow:,
- :1:,
- :1.1:,
- :1s:,
- :1 second:,
- :1 seconds:,
- :100ms:,
- :100 millisecond:,
- :100 milliseconds:,
- :1d:,
- :1 day:,
- :1 days:,
- :.2h:,
- :1.2h:,
- :.2 hour:,
- :1.2 hours:,
- :.5d:,
- :1.5d:,
- :.5 day:,
- :1.5 days:,
- :5m:,
- :5 minutes:,
- :10w:,
- :10 weeks:,
- :10M:,
- :10 months:,
- :100y:,
- :100 years:,
- :1 year and 2 months and 2 days:
-];
-
-emit
- | batch :10 minutes:
- | filter x=true
- | head 1
- | join
- | keep x
- | pace -every :1 minute:
- | pass
- | put y=false
- | remove z
- | sequence
- | skip 1
- | sort field -desc
- | split field
- | tail 10
- | unbatch
- | uniq field
-;
-
-read adapter -last :day: 'search' AND field~/pattern/ OR field == 'string'
- | write adapter
diff --git a/tests/examplefiles/example.kal b/tests/examplefiles/example.kal
deleted file mode 100644
index c05c14ca..00000000
--- a/tests/examplefiles/example.kal
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env kal
-
-# This demo executes GET requests in parallel and in series
-# using `for` loops and `wait for` statements.
-
-# Notice how the serial GET requests always return in order
-# and take longer in total. Parallel requests come back in
-# order of receipt.
-
-http = require 'http'
-
-urls = ['http://www.google.com'
- 'http://www.apple.com'
- 'http://www.microsoft.com'
- 'http://www.nodejs.org'
- 'http://www.yahoo.com']
-
-# This function does a GET request for each URL in series
-# It will wait for a response from each request before moving on
-# to the next request. Notice the output will be in the same order as the
-# urls variable every time regardless of response time.
-# It is a task rather than a function because it is called asynchronously
-# This allows us to use `return` to implicitly call back
-task series_demo()
- # The `series` keyword is optional here (for loops are serial by default)
- total_time = 0
-
- for series url in urls
- timer = new Date
-
- # we use the `safe` keyword because get is a "nonstandard" task
- # that does not call back with an error argument
- safe wait for response from http.get url
-
- delay = new Date() - timer
- total_time += delay
-
- print "GET #{url} - #{response.statusCode} - #{response.connection.bytesRead} bytes - #{delay} ms"
-
- # because we are in a task rather than a function, this actually exectutes a callback
- return total_time
-
-# This function does a GET request for each URL in parallel
-# It will NOT wait for a response from each request before moving on
-# to the next request. Notice the output will be determined by the order in which
-# the requests complete!
-task parallel_demo()
- total_time = 0
-
- # The `parallel` keyword is only meaningful here because the loop contains
- # a `wait for` statement (meaning callbacks are used)
- for parallel url in urls
- timer = new Date
-
- # we use the `safe` keyword because get is a "nonstandard" task
- # that does not call back with an error argument
- safe wait for response from http.get url
-
- delay = new Date() - timer
- total_time += delay
-
- print "GET #{url} - #{response.statusCode} - #{response.connection.bytesRead} bytes - #{delay}ms"
-
- # because we are in a task rather than a function, this actually exectutes a callback
- return total_time
-
-print 'Series Requests...'
-wait for time1 from series_demo()
-print "Total duration #{time1}ms"
-
-print ''
-
-print 'Parallel Requests...'
-wait for time2 from parallel_demo()
-print "Total duration #{time2}ms"
diff --git a/tests/examplefiles/example.kt b/tests/examplefiles/example.kt
deleted file mode 100644
index 59291333..00000000
--- a/tests/examplefiles/example.kt
+++ /dev/null
@@ -1,47 +0,0 @@
-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.lagda b/tests/examplefiles/example.lagda
deleted file mode 100644
index b5476fa0..00000000
--- a/tests/examplefiles/example.lagda
+++ /dev/null
@@ -1,19 +0,0 @@
-\documentclass{article}
-% this is a LaTeX comment
-\usepackage{agda}
-
-\begin{document}
-
-Here's how you can define \emph{RGB} colors in Agda:
-
-\begin{code}
-module example where
-
-open import Data.Fin
-open import Data.Nat
-
-data Color : Set where
- RGB : Fin 256 → Fin 256 → Fin 256 → Color
-\end{code}
-
-\end{document} \ No newline at end of file
diff --git a/tests/examplefiles/example.liquid b/tests/examplefiles/example.liquid
deleted file mode 100644
index 8f3ea9e9..00000000
--- a/tests/examplefiles/example.liquid
+++ /dev/null
@@ -1,42 +0,0 @@
-# This is an example file. Process it with `./pygmentize -O full -f html -o /liquid-example.html example.liquid`.
-
-{% raw %}
-some {{raw}} liquid syntax
-
-{% raw %}
-{% endraw %}
-
-Just regular text - what happens?
-
-{% comment %}My lovely {{comment}} {% comment %}{% endcomment %}
-
-{% custom_tag params: true %}
-{% custom_block my="abc" c = false %}
- Just usual {{liquid}}.
-{% endcustom_block %}
-
-{% another_tag "my string param" %}
-
-{{ variable | upcase }}
-{{ var.field | textilize | markdownify }}
-{{ var.field.property | textilize | markdownify }}
-{{ 'string' | truncate: 100 param='df"g' }}
-
-{% cycle '1', 2, var %}
-{% cycle 'group1': '1', var, 2 %}
-{% cycle group2: '1', var, 2 %}
-
-{% if a == 'B' %}
-{% elsif a == 'C%}' %}
-{% else %}
-{% endif %}
-
-{% unless not a %}
-{% else %}
-{% endunless %}
-
-{% case a %}
-{% when 'B' %}
-{% when 'C' %}
-{% else %}
-{% endcase %} \ No newline at end of file
diff --git a/tests/examplefiles/example.lua b/tests/examplefiles/example.lua
deleted file mode 100644
index 8ecd6a13..00000000
--- a/tests/examplefiles/example.lua
+++ /dev/null
@@ -1,274 +0,0 @@
---[[
- Auctioneer Advanced
- Version: <%version%> (<%codename%>)
- Revision: $Id: CoreMain.lua 2233 2007-09-25 03:57:33Z norganna $
- URL: http://auctioneeraddon.com/
-
- This is an addon for World of Warcraft that adds statistical history to the auction data that is collected
- when the auction is scanned, so that you can easily determine what price
- you will be able to sell an item for at auction or at a vendor whenever you
- mouse-over an item in the game
-
- License:
- 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
- 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program(see GPL.txt); if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- Note:
- This AddOn's source code is specifically designed to work with
- World of Warcraft's interpreted AddOn system.
- You have an implicit licence to use this AddOn with these facilities
- since that is its designated purpose as per:
- http://www.fsf.org/licensing/licenses/gpl-faq.html#InterpreterIncompat
-]]
-
-
---[[
- See CoreAPI.lua for a description of the modules API
-]]
-
-if (not AucAdvanced) then AucAdvanced = {} end
-if (not AucAdvancedData) then AucAdvancedData = {} end
-if (not AucAdvancedLocal) then AucAdvancedLocal = {} end
-if (not AucAdvancedConfig) then AucAdvancedConfig = {} end
-
-AucAdvanced.Version="<%version%>";
-if (AucAdvanced.Version == "<".."%version%>") then
- AucAdvanced.Version = "5.0.DEV";
-end
-
-local private = {}
-
--- For our modular stats system, each stats engine should add their
--- subclass to AucAdvanced.Modules.<type>.<name> and store their data into their own
--- data table in AucAdvancedData.Stats.<type><name>
-if (not AucAdvanced.Modules) then AucAdvanced.Modules = {Stat={},Util={},Filter={}} end
-if (not AucAdvancedData.Stats) then AucAdvancedData.Stats = {} end
-if (not AucAdvancedLocal.Stats) then AucAdvancedLocal.Stats = {} end
-
-function private.TooltipHook(vars, ret, frame, name, hyperlink, quality, quantity, cost, additional)
- if EnhTooltip.LinkType(hyperlink) ~= "item" then
- return -- Auctioneer hooks into item tooltips only
- end
-
- -- Check to see if we need to force load scandata
- local getter = AucAdvanced.Settings.GetSetting
- if (getter("scandata.tooltip.display") and getter("scandata.force")) then
- AucAdvanced.Scan.GetImage()
- end
-
- for system, systemMods in pairs(AucAdvanced.Modules) do
- for engine, engineLib in pairs(systemMods) do
- if (engineLib.Processor) then engineLib.Processor("tooltip", frame, name, hyperlink, quality, quantity, cost, additional) end
- end
- end
-end
-
-function private.HookAH()
- hooksecurefunc("AuctionFrameBrowse_Update", AucAdvanced.API.ListUpdate)
- for system, systemMods in pairs(AucAdvanced.Modules) do
- for engine, engineLib in pairs(systemMods) do
- if (engineLib.Processor) then
- engineLib.Processor("auctionui")
- end
- end
- end
-end
-
-function private.OnLoad(addon)
- addon = addon:lower()
-
- -- Check if the actual addon itself is loading
- if (addon == "auc-advanced") then
- Stubby.RegisterAddOnHook("Blizzard_AuctionUi", "Auc-Advanced", private.HookAH)
- Stubby.RegisterFunctionHook("EnhTooltip.AddTooltip", 600, private.TooltipHook)
- for pos, module in ipairs(AucAdvanced.EmbeddedModules) do
- -- These embedded modules have also just been loaded
- private.OnLoad(module)
- end
- end
-
- -- Notify the actual module if it exists
- local auc, sys, eng = strsplit("-", addon)
- if (auc == "auc" and sys and eng) then
- for system, systemMods in pairs(AucAdvanced.Modules) do
- if (sys == system:lower()) then
- for engine, engineLib in pairs(systemMods) do
- if (eng == engine:lower() and engineLib.OnLoad) then
- engineLib.OnLoad(addon)
- end
- end
- end
- end
- end
-
- -- Check all modules' load triggers and pass event to processors
- for system, systemMods in pairs(AucAdvanced.Modules) do
- for engine, engineLib in pairs(systemMods) do
- if (engineLib.LoadTriggers and engineLib.LoadTriggers[addon]) then
- if (engineLib.OnLoad) then
- engineLib.OnLoad(addon)
- end
- end
- if (engineLib.Processor and auc == "auc" and sys and eng) then
- engineLib.Processor("load", addon)
- end
- end
- end
-end
-
-function private.OnUnload()
- for system, systemMods in pairs(AucAdvanced.Modules) do
- for engine, engineLib in pairs(systemMods) do
- if (engineLib.OnUnload) then
- engineLib.OnUnload()
- end
- end
- end
-end
-
-private.Schedule = {}
-function private.OnEvent(...)
- local event, arg = select(2, ...)
- if (event == "ADDON_LOADED") then
- local addon = string.lower(arg)
- if (addon:sub(1,4) == "auc-") then
- private.OnLoad(addon)
- end
- elseif (event == "AUCTION_HOUSE_SHOW") then
- -- Do Nothing for now
- elseif (event == "AUCTION_HOUSE_CLOSED") then
- AucAdvanced.Scan.Interrupt()
- elseif (event == "PLAYER_LOGOUT") then
- AucAdvanced.Scan.Commit(true)
- private.OnUnload()
- elseif event == "UNIT_INVENTORY_CHANGED"
- or event == "ITEM_LOCK_CHANGED"
- or event == "CURSOR_UPDATE"
- or event == "BAG_UPDATE"
- then
- private.Schedule["inventory"] = GetTime() + 0.15
- end
-end
-
-function private.OnUpdate(...)
- if event == "inventory" then
- AucAdvanced.Post.AlertBagsChanged()
- end
-
- local now = GetTime()
- for event, time in pairs(private.Schedule) do
- if time > now then
- for system, systemMods in pairs(AucAdvanced.Modules) do
- for engine, engineLib in pairs(systemMods) do
- if engineLib.Processor then
- engineLib.Processor(event, time)
- end
- end
- end
- end
- private.Schedule[event] = nil
- end
-end
-
-private.Frame = CreateFrame("Frame")
-private.Frame:RegisterEvent("ADDON_LOADED")
-private.Frame:RegisterEvent("AUCTION_HOUSE_SHOW")
-private.Frame:RegisterEvent("AUCTION_HOUSE_CLOSED")
-private.Frame:RegisterEvent("UNIT_INVENTORY_CHANGED")
-private.Frame:RegisterEvent("ITEM_LOCK_CHANGED")
-private.Frame:RegisterEvent("CURSOR_UPDATE")
-private.Frame:RegisterEvent("BAG_UPDATE")
-private.Frame:RegisterEvent("PLAYER_LOGOUT")
-private.Frame:SetScript("OnEvent", private.OnEvent)
-private.Frame:SetScript("OnUpdate", private.OnUpdate)
-
--- Auctioneer's debug functions
-AucAdvanced.Debug = {}
-local addonName = "Auctioneer" -- the addon's name as it will be displayed in
- -- the debug messages
--------------------------------------------------------------------------------
--- Prints the specified message to nLog.
---
--- syntax:
--- errorCode, message = debugPrint([message][, category][, title][, errorCode][, level])
---
--- parameters:
--- message - (string) the error message
--- nil, no error message specified
--- category - (string) the category of the debug message
--- nil, no category specified
--- title - (string) the title for the debug message
--- nil, no title specified
--- errorCode - (number) the error code
--- nil, no error code specified
--- level - (string) nLog message level
--- Any nLog.levels string is valid.
--- nil, no level specified
---
--- returns:
--- errorCode - (number) errorCode, if one is specified
--- nil, otherwise
--- message - (string) message, if one is specified
--- nil, otherwise
--------------------------------------------------------------------------------
-function AucAdvanced.Debug.DebugPrint(message, category, title, errorCode, level)
- return DebugLib.DebugPrint(addonName, message, category, title, errorCode, level)
-end
-
--------------------------------------------------------------------------------
--- Used to make sure that conditions are met within functions.
--- If test is false, the error message will be written to nLog and the user's
--- default chat channel.
---
--- syntax:
--- assertion = assert(test, message)
---
--- parameters:
--- test - (any) false/nil, if the assertion failed
--- anything else, otherwise
--- message - (string) the message which will be output to the user
---
--- returns:
--- assertion - (boolean) true, if the test passed
--- false, otherwise
--------------------------------------------------------------------------------
-function AucAdvanced.Debug.Assert(test, message)
- return DebugLib.Assert(addonName, test, message)
-end
-
---[==[
-Here follow further tests of Lua syntax.
-]]==]
----[[
-local t = {
- [ [[
-x
-]==] \]]]=1|2; a={b={c={}}},
- 1, 1., 1.2, .2, 1e3, 1.e3, 1.2e3, .2e3, 1.2e+3, 1.2E-3;
- 0xA, 0Xa, 0xA., 0x.F, 0xA.F, 0xA.Fp1, 0xA.FP+1, 0Xa.fp-1;
-}
-
-function t.f()
- goto eof
- os.exit()
- :: eof ::
-end
-
-function t . a --[==[x]==] .b --[==[y]==] --
--- () end
- . c : d (file)
- return '.\a.\b.\f.\n.\r.\t.\v.\\.\".\'.\
-.\z
- .\0.\00.\000.\0000.\xFa.\u{1}.\u{1234}'
-end
diff --git a/tests/examplefiles/example.ma b/tests/examplefiles/example.ma
deleted file mode 100644
index a8119ea5..00000000
--- a/tests/examplefiles/example.ma
+++ /dev/null
@@ -1,8 +0,0 @@
-1 + 1 (* This is a comment *)
-Global`
-SomeNamespace`Foo
-f[x_, y__, 3, z___] := tsneirsnteintie "fosrt" neisnrteiasrn
-E + 3
-Plus[1,Times[2,3]]
-Map[#1 + #2&, SomePairList]
-Plus[1.,-1,-1.,-1.0,] \ No newline at end of file
diff --git a/tests/examplefiles/example.mac b/tests/examplefiles/example.mac
deleted file mode 100644
index 1c3831d1..00000000
--- a/tests/examplefiles/example.mac
+++ /dev/null
@@ -1,6 +0,0 @@
-* Example Easytrieve macro declaration. For an example on calling this
-* macro, see example.ezt.
-MACRO FILENAME PREFIX
-&FILENAME.
-&PREFIX.-LINE 1 80 A
-&PREFIX.-KEY 1 8 A
diff --git a/tests/examplefiles/example.md b/tests/examplefiles/example.md
deleted file mode 100644
index e2bbacf1..00000000
--- a/tests/examplefiles/example.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# this is a header
-
-## this is a 2nd level header
-
-* list item 1
- * list item 1.1
-* list item 2
-- list item 3
-
-1. numbered list item 1
-1. numbered list item 2
-
-- [ ] todo
-- [x] done
-- [X] done
-
-The following is italic: *italic*
-The following is italic: _italic_
-
-The following is not italic: \*italic\*
-The following is not italic: \_italic\_
-
-The following is not italic: snake*case*word
-The following is not italic: snake_case_word
-
-The following is bold: **bold** **two or more words**
-The following is bold: __bold__ __two or more words__
-
-The following is not bold: snake**case**word
-The following is not bold: snake__case__word
-
-The following is strikethrough: ~~bold~~
-The following is not strikethrough: snake~~case~~word
-
-The following is bold with italics inside: **the next _word_ should have been italics**
-
-> this is a quote
-
-> this is a multiline
-> quote string thing
-
-this sentence `has monospace` in it
-
-this sentence @tweets a person about a #topic.
-
-[google](https://google.com/some/path.html)
-![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png)
-
-[reference link][id]
-[id]: http://example.com/
-
-```
- * this is just unformated
- __text__
-```
-
-some other text
-
-```python
-from pygments import token
-# comment
-```
-
-some more text
diff --git a/tests/examplefiles/example.monkey b/tests/examplefiles/example.monkey
deleted file mode 100644
index facd3a73..00000000
--- a/tests/examplefiles/example.monkey
+++ /dev/null
@@ -1,152 +0,0 @@
-Strict
-
-' single line comment
-
-#rem
-multi
-line
-comment
-#end
-
-#rem
-nested
-#rem
-multi
-line
-#end
-comment
-#end
-
-Import mojo
-
-Const ONECONST:Int = 1
-Const TWOCONST := 2
-Const THREECONST := 3, FOURCONST:Int = 4
-
-Global someVariable:Int = 4
-
-' sample class from the documentation
-Class Game Extends App
-
- Function New()
- End
-
- Function DrawSpiral(clock)
- Local w=DeviceWidth/2
- For Local i#=0 Until w*1.5 Step .2
- Local x#,y#
- x=w+i*Sin(i*3+clock)
- y=w+i*Cos(i*2+clock)
- DrawRect x,y,1,1
- Next
- hitbox.Collide(event.pos)
- End
-
- Field updateCount
-
- Method OnCreate()
- Print "spiral"
-
- SetUpdateRate 60
- End
-
- Method OnUpdate()
- updateCount+=1
- End
-
- Method OnRender()
- Cls
- DrawSpiral updateCount
- DrawSpiral updateCount*1.1
- End
-
-End
-
-Class Enemy
- Method Die () Abstract
-End
-
-' extending
-Class Hoodlum Extends Enemy
- ' field
- Field testField:Bool = True
-
- ' naming class with modulepath
- Local currentNode:list.Node<Vector2D>
-
- Method Die ()
- Print "B'oss, he-- he killed me, b'oss!"
- End
-End
-
-' extending with generics
-Class VectorNode Extends Node<Vector2D>
-End
-
-' interfaces
-Interface Computer
- Method Boot ()
- Method Process ()
- Method Display ()
-End
-
-Class PC Implements Computer
-End
-
-' array syntax
-Global listOfStuff:String[42]
-Global lessStuff:String[5] = listOfStuff[4..8]
-Global oneStuff:String = listOfStuff[23]
-
-'a comma separated sequence
-Global scores:Int[]=[10,20,30]
-'a comma separated sequence
-Global text:String[]=["Hello","There","World"]
-Global worstCase:worst.List<String[]>
-
-' string type
-Global string1:String = "Hello world"
-Global string2$ = "Hello world"
-
-' escape characers in strings
-Global string3 := "Hello~zWorld"
-Global string4 := "~qHello World~q"
-Global string5 := "~tIndented~n"
-Global string6 := "tilda is wavey... ~~"
-
-' string pseudofunctions
-Print " Hello World ~n".Trim() ' prints "Hello World"
-Print "Hello World".ToUpper() ' prints "HELLO WORLD"
-
-' Boolean shorttype
-Global boolVariable1:Bool = True
-Global boolVariable2? = False
-
-' number formats
-Global hexNum1:Int = $3d0dead
-Global hexNum2% = $CAFEBABE
-
-Global floatNum1:Float = 3.141516
-Global floatNum2# = 3.141516
-Global floatNum3 := .141516
-
-' preprocessor keywords
-#If TARGET = "android"
-DoStuff()
-#ElseIf TARGET = "ios"
-DoOtherStuff()
-#End
-
-' preprocessor variable
-#SOMETHING = True
-#Print SOMETHING
-#If SOMETHING
-#End
-
-' operators
-Global a = 32
-Global b = 32 ~ 0
-b ~= 16
-b |= 16
-b &= 16
-Global c = a | b
diff --git a/tests/examplefiles/example.moo b/tests/examplefiles/example.moo
deleted file mode 100644
index 1a15914d..00000000
--- a/tests/examplefiles/example.moo
+++ /dev/null
@@ -1,26 +0,0 @@
-if (this.running)
- player:tell("[Train] Error: already a jump in progress");
- return;
-endif
-this.running = 1;
-this.aborted = 0;
-this:announce_all("[Train] departure in 20 seconds");
-dest = this.targets[random(length(this.targets))];
-this:announce_all("[Train] Next stop is '", dest:title(), "'");
-this:announce_all("You hear the engines starting up");
-this.location:announce("The MOOTrain starts up his engines");
-suspend(20);
-if (this.aborted)
- this.running = 0;
- this.aborted = 0;
- return;
-endif
-this:announce_all("[Train] Departure!");
-this.location:announce_all("The MOOTrain leaves into the 42th dimension!");
-this:announce_all("Outside you see the lights of the 42th dimension");
-this:moveto(dest);
-suspend(4);
-this:announce_all("The glowing gets less, until you can see the clear shape of the room, the MOOTrain has landed in");
-this.location:announce_all("The MOOTrain arrives out of the 42th dimension!");
-this:announce_all("[Train] arrived in '", dest:title(), "'");
-this.running = 0; \ No newline at end of file
diff --git a/tests/examplefiles/example.moon b/tests/examplefiles/example.moon
deleted file mode 100644
index d4415e32..00000000
--- a/tests/examplefiles/example.moon
+++ /dev/null
@@ -1,629 +0,0 @@
--- 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.mq4 b/tests/examplefiles/example.mq4
deleted file mode 100644
index 54a5fa60..00000000
--- a/tests/examplefiles/example.mq4
+++ /dev/null
@@ -1,187 +0,0 @@
-//+------------------------------------------------------------------+
-//| PeriodConverter.mq4 |
-//| Copyright 2006-2014, MetaQuotes Software Corp. |
-//| http://www.metaquotes.net |
-//+------------------------------------------------------------------+
-#property copyright "2006-2014, MetaQuotes Software Corp."
-#property link "http://www.mql4.com"
-#property description "Period Converter to updated format of history base"
-#property strict
-#property show_inputs
-#include <WinUser32.mqh>
-
-input int InpPeriodMultiplier=3; // Period multiplier factor
-int ExtHandle=-1;
-//+------------------------------------------------------------------+
-//| script program start function |
-//+------------------------------------------------------------------+
-void OnStart()
- {
- datetime time0;
- ulong last_fpos=0;
- long last_volume=0;
- int i,start_pos,periodseconds;
- int hwnd=0,cnt=0;
-//---- History header
- int file_version=401;
- string c_copyright;
- string c_symbol=Symbol();
- int i_period=Period()*InpPeriodMultiplier;
- int i_digits=Digits;
- int i_unused[13];
- MqlRates rate;
-//---
- ExtHandle=FileOpenHistory(c_symbol+(string)i_period+".hst",FILE_BIN|FILE_WRITE|FILE_SHARE_WRITE|FILE_SHARE_READ|FILE_ANSI);
- if(ExtHandle<0)
- return;
- c_copyright="(C)opyright 2003, MetaQuotes Software Corp.";
- ArrayInitialize(i_unused,0);
-//--- write history file header
- FileWriteInteger(ExtHandle,file_version,LONG_VALUE);
- FileWriteString(ExtHandle,c_copyright,64);
- FileWriteString(ExtHandle,c_symbol,12);
- FileWriteInteger(ExtHandle,i_period,LONG_VALUE);
- FileWriteInteger(ExtHandle,i_digits,LONG_VALUE);
- FileWriteInteger(ExtHandle,0,LONG_VALUE);
- FileWriteInteger(ExtHandle,0,LONG_VALUE);
- FileWriteArray(ExtHandle,i_unused,0,13);
-//--- write history file
- periodseconds=i_period*60;
- start_pos=Bars-1;
- rate.open=Open[start_pos];
- rate.low=Low[start_pos];
- rate.high=High[start_pos];
- rate.tick_volume=(long)Volume[start_pos];
- rate.spread=0;
- rate.real_volume=0;
- //--- normalize open time
- rate.time=Time[start_pos]/periodseconds;
- rate.time*=periodseconds;
- for(i=start_pos-1; i>=0; i--)
- {
- if(IsStopped())
- break;
- time0=Time[i];
- //--- history may be updated
- if(i==0)
- {
- //--- modify index if history was updated
- if(RefreshRates())
- i=iBarShift(NULL,0,time0);
- }
- //---
- if(time0>=rate.time+periodseconds || i==0)
- {
- if(i==0 && time0<rate.time+periodseconds)
- {
- rate.tick_volume+=(long)Volume[0];
- if(rate.low>Low[0])
- rate.low=Low[0];
- if(rate.high<High[0])
- rate.high=High[0];
- rate.close=Close[0];
- }
- last_fpos=FileTell(ExtHandle);
- last_volume=(long)Volume[i];
- FileWriteStruct(ExtHandle,rate);
- cnt++;
- if(time0>=rate.time+periodseconds)
- {
- rate.time=time0/periodseconds;
- rate.time*=periodseconds;
- rate.open=Open[i];
- rate.low=Low[i];
- rate.high=High[i];
- rate.close=Close[i];
- rate.tick_volume=last_volume;
- }
- }
- else
- {
- rate.tick_volume+=(long)Volume[i];
- if(rate.low>Low[i])
- rate.low=Low[i];
- if(rate.high<High[i])
- rate.high=High[i];
- rate.close=Close[i];
- }
- }
- FileFlush(ExtHandle);
- Print(cnt," record(s) written");
-//--- collect incoming ticks
- datetime last_time=LocalTime()-5;
- while(!IsStopped())
- {
- datetime cur_time=LocalTime();
- //--- check for new rates
- if(RefreshRates())
- {
- time0=Time[0];
- FileSeek(ExtHandle,last_fpos,SEEK_SET);
- //--- is there current bar?
- if(time0<rate.time+periodseconds)
- {
- rate.tick_volume+=(long)Volume[0]-last_volume;
- last_volume=(long)Volume[0];
- if(rate.low>Low[0])
- rate.low=Low[0];
- if(rate.high<High[0])
- rate.high=High[0];
- rate.close=Close[0];
- }
- else
- {
- //--- no, there is new bar
- rate.tick_volume+=(long)Volume[1]-last_volume;
- if(rate.low>Low[1])
- rate.low=Low[1];
- if(rate.high<High[1])
- rate.high=High[1];
- //--- write previous bar remains
- FileWriteStruct(ExtHandle,rate);
- last_fpos=FileTell(ExtHandle);
- //----
- rate.time=time0/periodseconds;
- rate.time*=periodseconds;
- rate.open=Open[0];
- rate.low=Low[0];
- rate.high=High[0];
- rate.close=Close[0];
- rate.tick_volume=(long)Volume[0];
- last_volume=rate.tick_volume;
- }
- //----
- FileWriteStruct(ExtHandle,rate);
- FileFlush(ExtHandle);
- //---
- if(hwnd==0)
- {
- hwnd=WindowHandle(Symbol(),i_period);
- if(hwnd!=0)
- Print("Chart window detected");
- }
- //--- refresh window not frequently than 1 time in 2 seconds
- if(hwnd!=0 && cur_time-last_time>=2)
- {
- PostMessageA(hwnd,WM_COMMAND,33324,0);
- last_time=cur_time;
- }
- }
- Sleep(50);
- }
-//---
- }
-//+------------------------------------------------------------------+
-//| |
-//+------------------------------------------------------------------+
-void OnDeinit(const int reason)
- {
-//---
- if(ExtHandle>=0)
- {
- FileClose(ExtHandle);
- ExtHandle=-1;
- }
-//---
- }
-//+------------------------------------------------------------------+ \ No newline at end of file
diff --git a/tests/examplefiles/example.mqh b/tests/examplefiles/example.mqh
deleted file mode 100644
index ee80ed52..00000000
--- a/tests/examplefiles/example.mqh
+++ /dev/null
@@ -1,123 +0,0 @@
-//+------------------------------------------------------------------+
-//| Array.mqh |
-//| Copyright 2009-2013, MetaQuotes Software Corp. |
-//| http://www.mql4.com |
-//+------------------------------------------------------------------+
-#include <Object.mqh>
-//+------------------------------------------------------------------+
-//| Class CArray |
-//| Purpose: Base class of dynamic arrays. |
-//| Derives from class CObject. |
-//+------------------------------------------------------------------+
-class CArray : public CObject
- {
-protected:
- int m_step_resize; // increment size of the array
- int m_data_total; // number of elements
- int m_data_max; // maximmum size of the array without memory reallocation
- int m_sort_mode; // mode of array sorting
-
-public:
- CArray(void);
- ~CArray(void);
- //--- methods of access to protected data
- int Step(void) const { return(m_step_resize); }
- bool Step(const int step);
- int Total(void) const { return(m_data_total); }
- int Available(void) const { return(m_data_max-m_data_total); }
- int Max(void) const { return(m_data_max); }
- bool IsSorted(const int mode=0) const { return(m_sort_mode==mode); }
- int SortMode(void) const { return(m_sort_mode); }
- //--- cleaning method
- void Clear(void) { m_data_total=0; }
- //--- methods for working with files
- virtual bool Save(const int file_handle);
- virtual bool Load(const int file_handle);
- //--- sorting method
- void Sort(const int mode=0);
-
-protected:
- virtual void QuickSort(int beg,int end,const int mode=0) { }
- };
-//+------------------------------------------------------------------+
-//| Constructor |
-//+------------------------------------------------------------------+
-CArray::CArray(void) : m_step_resize(16),
- m_data_total(0),
- m_data_max(0),
- m_sort_mode(-1)
- {
- }
-//+------------------------------------------------------------------+
-//| Destructor |
-//+------------------------------------------------------------------+
-CArray::~CArray(void)
- {
- }
-//+------------------------------------------------------------------+
-//| Method Set for variable m_step_resize |
-//+------------------------------------------------------------------+
-bool CArray::Step(const int step)
- {
-//--- check
- if(step>0)
- {
- m_step_resize=step;
- return(true);
- }
-//--- failure
- return(false);
- }
-//+------------------------------------------------------------------+
-//| Sorting an array in ascending order |
-//+------------------------------------------------------------------+
-void CArray::Sort(const int mode)
- {
-//--- check
- if(IsSorted(mode))
- return;
- m_sort_mode=mode;
- if(m_data_total<=1)
- return;
-//--- sort
- QuickSort(0,m_data_total-1,mode);
- }
-//+------------------------------------------------------------------+
-//| Writing header of array to file |
-//+------------------------------------------------------------------+
-bool CArray::Save(const int file_handle)
- {
-//--- check handle
- if(file_handle!=INVALID_HANDLE)
- {
- //--- write start marker - 0xFFFFFFFFFFFFFFFF
- if(FileWriteLong(file_handle,-1)==sizeof(long))
- {
- //--- write array type
- if(FileWriteInteger(file_handle,Type(),INT_VALUE)==INT_VALUE)
- return(true);
- }
- }
-//--- failure
- return(false);
- }
-//+------------------------------------------------------------------+
-//| Reading header of array from file |
-//+------------------------------------------------------------------+
-bool CArray::Load(const int file_handle)
- {
-//--- check handle
- if(file_handle!=INVALID_HANDLE)
- {
- //--- read and check start marker - 0xFFFFFFFFFFFFFFFF
- if(FileReadLong(file_handle)==-1)
- {
- //--- read and check array type
- if(FileReadInteger(file_handle,INT_VALUE)==Type())
- return(true);
- }
- }
-//--- failure
- return(false);
- }
-//+------------------------------------------------------------------+
diff --git a/tests/examplefiles/example.msc b/tests/examplefiles/example.msc
deleted file mode 100644
index d51b32a6..00000000
--- a/tests/examplefiles/example.msc
+++ /dev/null
@@ -1,43 +0,0 @@
-msc {
- hscale=5;
-
- //test comment
-
- a,b,c,d;
-
-/* another
-comment
-goes here */ /* too */ // now
-
- ... [label="test1", id="1"];
- --- [label="test2", id="2"];
- ||| [label="test3", id="2"];
- a ABOX b;
- a--b [label="test4", id="2"];
- a == b [label="test5", id="2"];
- a .. b [label="test6", id="2"];
- a::b [label="test7", id="2"];
- a<<=>> b [label="test8", id="2"],
- b <->c [label="test9", id="2"],
- b RBOX c;
- a BOX d;
- a<=> b [label="test10", id="2"];
- a <<>> b [label="test11", id="2"];
- a<:>b [label="test12", id="2"];
- a->b [label="test13", id="2"];
- a =>> b [label="test14", id="2"],
- b >> c [label="test15", id="2"],
- a=> b [label="test16", id="2"];
- a :>b [label="test17", id="2"];
- a-x b [label="test18", id="2"];
- a -Xb [label="test19", id="2"];
- a<- b [label="test20", id="2"];
- a <<=b [label="test21", id="2"];
- a<< b [label="test22", id="2"];
- a <= b [label="test23", id="2"];
- a<: b [label="test24", id="2"];
- a -xb [label="test25", id="2"];
- a-X b [ label="test26",id="2" ];
- a->* [label="test27" , id="2"];
- *<-b [label="test28",id="28"];
-}
diff --git a/tests/examplefiles/example.ng2 b/tests/examplefiles/example.ng2
deleted file mode 100644
index 0f424aca..00000000
--- a/tests/examplefiles/example.ng2
+++ /dev/null
@@ -1,11 +0,0 @@
-<div>
- <p>{{order.DueTime | date:'d. MMMM yyyy HH:mm'}}</p>
- <p>Status: {{order.OrderState}}</p>
- <button (click)="deleteOrder()" *ngIf="cancelable" [value]="test" [(twoWayTest)]="foo.bar">Remove</button>
- <ul>
- <li *ngFor="#meal of order.Positions">
- {{meal.Name}}
- </li>
- </ul>
- <p>Preis: <b>{{order.TotalPrice | currency:'EUR':true:'1.2-2'}}</b></p>
-</div> \ No newline at end of file
diff --git a/tests/examplefiles/example.ni b/tests/examplefiles/example.ni
deleted file mode 100644
index 32279e80..00000000
--- a/tests/examplefiles/example.ni
+++ /dev/null
@@ -1,57 +0,0 @@
- | | |
-"Informal by Nature"
-[ * * * ]
-by
-[ * * * ]
-David Corbett
-
-[This is a [nested] comment.]
-
-Section 1 - Use option translation
-
-Use maximum tests of at least 100 translates as (-
-@c
-Constant MAX_TESTS = {N}; —). | Section 2
-
-A room has a number called size.
-
-The Kitchen is a room. "A nondescript kitchen.“ The Kitchen has size 2.
-
-When play begins:
- say "Testing:[line break]";
- test 0.
-
-To test (N — number): (—
- if (Test({N}) == (+size of the Kitchen [this should succeed]+)) {-open—brace}
- print ”Success.^”;
- {-close-brace} else {
- print “Failure.^";
- }
-]; ! You shouldn't end a routine within a phrase definition, but it works.
-[ Unused;
- #Include "\
-@p \
-"; ! At signs hold no power here.
-! Of course, the file "@p .h" must exist.
--).
-
-Include (-!% This is not ICL.
-
-[ Test x;
- if (x) {x++;}
- {–! Single line comment.}
-@inc x;
-@p At signs.
-...
-@Purpose: ...
-...
-@-...
-@c ...
-@inc x;
-@c
-@c
- return x;
-];
-@Purpose: ...
-@-------------------------------------------------------------------------------
--).
diff --git a/tests/examplefiles/example.nim b/tests/examplefiles/example.nim
deleted file mode 100644
index 319da016..00000000
--- a/tests/examplefiles/example.nim
+++ /dev/null
@@ -1,1010 +0,0 @@
-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.nix b/tests/examplefiles/example.nix
deleted file mode 100644
index 515b686f..00000000
--- a/tests/examplefiles/example.nix
+++ /dev/null
@@ -1,80 +0,0 @@
-{ stdenv, fetchurl, fetchgit, openssl, zlib, pcre, libxml2, libxslt, expat
-, rtmp ? false
-, fullWebDAV ? false
-, syslog ? false
-, moreheaders ? false, ...}:
-
-let
- version = "1.4.4";
- mainSrc = fetchurl {
- url = "http://nginx.org/download/nginx-${version}.tar.gz";
- sha256 = "1f82845mpgmhvm151fhn2cnqjggw9w7cvsqbva9rb320wmc9m63w";
- };
-
- rtmp-ext = fetchgit {
- url = git://github.com/arut/nginx-rtmp-module.git;
- rev = "1cfb7aeb582789f3b15a03da5b662d1811e2a3f1";
- sha256 = "03ikfd2l8mzsjwx896l07rdrw5jn7jjfdiyl572yb9jfrnk48fwi";
- };
-
- dav-ext = fetchgit {
- url = git://github.com/arut/nginx-dav-ext-module.git;
- rev = "54cebc1f21fc13391aae692c6cce672fa7986f9d";
- sha256 = "1dvpq1fg5rslnl05z8jc39sgnvh3akam9qxfl033akpczq1bh8nq";
- };
-
- syslog-ext = fetchgit {
- url = https://github.com/yaoweibin/nginx_syslog_patch.git;
- rev = "165affd9741f0e30c4c8225da5e487d33832aca3";
- sha256 = "14dkkafjnbapp6jnvrjg9ip46j00cr8pqc2g7374z9aj7hrvdvhs";
- };
-
- moreheaders-ext = fetchgit {
- url = https://github.com/agentzh/headers-more-nginx-module.git;
- rev = "refs/tags/v0.23";
- sha256 = "12pbjgsxnvcf2ff2i2qdn39q4cm5czlgrng96j8ml4cgxvnbdh39";
- };
-in
-
-stdenv.mkDerivation rec {
- name = "nginx-${version}";
- src = mainSrc;
-
- buildInputs = [ openssl zlib pcre libxml2 libxslt
- ] ++ stdenv.lib.optional fullWebDAV expat;
-
- patches = if syslog then [ "${syslog-ext}/syslog_1.4.0.patch" ] else [];
-
- configureFlags = [
- "--with-http_ssl_module"
- "--with-http_spdy_module"
- "--with-http_xslt_module"
- "--with-http_sub_module"
- "--with-http_dav_module"
- "--with-http_gzip_static_module"
- "--with-http_secure_link_module"
- "--with-ipv6"
- # Install destination problems
- # "--with-http_perl_module"
- ] ++ stdenv.lib.optional rtmp "--add-module=${rtmp-ext}"
- ++ stdenv.lib.optional fullWebDAV "--add-module=${dav-ext}"
- ++ stdenv.lib.optional syslog "--add-module=${syslog-ext}"
- ++ stdenv.lib.optional moreheaders "--add-module=${moreheaders-ext}";
-
- preConfigure = ''
- export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2 }/include/libxml2"
- '';
-
- # escape example
- postInstall = ''
- mv $out/sbin $out/bin ''' ''${
- ${ if true then ${ "" } else false }
- '';
-
- meta = {
- description = "A reverse proxy and lightweight webserver";
- maintainers = [ stdenv.lib.maintainers.raskin];
- platforms = stdenv.lib.platforms.all;
- inherit version;
- };
-}
diff --git a/tests/examplefiles/example.ns2 b/tests/examplefiles/example.ns2
deleted file mode 100644
index b1c6b92e..00000000
--- a/tests/examplefiles/example.ns2
+++ /dev/null
@@ -1,69 +0,0 @@
-Newsqueak2
-'Langexplr
-'
-
-class ShapesExperiment usingLib: platform = (
-"A small experiment for using Hopscotch shape classes ."
-|
- CanvasDependent = platform CanvasDependent.
- Presenter = platform HPresenter.
- Subject = platform Subject.
- EllipseShape = platform EllipseShape.
- Color = platform Color.
-|
-)
-(
-
-class ShapesExperimentSubject = Subject(
-"Subject for shapes experiment"
-|
-
-|
-)
-('as yet unclassified'
-createPresenter = (
- ^ShapesExperimentPresenter new subject: self.
-)
-
-)
-
-class ShapesExperimentPresenter = Presenter (
-"A presenter for a small experiment of using shape classes"
-|
-|
-)
-('as yet unclassified'
-controlPoint = (
- ^ControlPoint new.
-)
-
-definition = (
- ^ column: {
- canvas: {
- at: 10 @ 10 display: controlPoint.
- at: 15 @ 10 display: controlPoint.
- }
- }
-)
-
-)
-
-class ControlPoint = CanvasDependent(
-"A class that represents a small point in the screen"
-|
-|
-)
-('as yet unclassified'
-addVisualsTo: container = (
- container add: visual.
- updateLayout.
-)
-
-createVisual = (
- | s |
- s:: EllipseShape new size: 5@5 .
- s color: Color red.
- ^ s
-)
-
-))
diff --git a/tests/examplefiles/example.pas b/tests/examplefiles/example.pas
deleted file mode 100644
index ab11ee67..00000000
--- a/tests/examplefiles/example.pas
+++ /dev/null
@@ -1,2708 +0,0 @@
-// vim:ft=pascal
-
-unit YTools;
-
-{===============================================================================
-
- cYcnus.YTools 1.0.3 Beta for Delphi 4+
- by licenser and Murphy
-
- 2000-2003 by cYcnus
- visit www.cYcnus.de
-
- licenser@cYcnus.de (Heinz N. Gies)
- murphy@cYcnus.de (Kornelius Kalnbach)
-
- this unit is published under the terms of the GPL
-
-===============================================================================}
-
-interface
-
-uses
- Windows, SysUtils, Classes, YTypes;
-
-const
- BackSpace = #8;
- Tab = #9;
- LF = #10; //Line Feed
- CR = #13; //Carriage Return
- Space = #32;
- EOLChars = [CR, LF];
-{$IFNDEF VER140}
- sLineBreak = #13#10;
- SwitchChars = ['/', '-'];
-{$ENDIF}
- EOL = sLineBreak;
- MaxCard = High(Cardinal);
- AllChars = [#0..#255];
- Alphabetical = ['A'..'Z', 'a'..'z'];
- DecimalChars = ['0'..'9'];
- AlphaNumerical = Alphabetical + DecimalChars;
- StrangeChars = [#0..#31, #127, #129, #141..#144, #157, #158];
-
- HexadecimalChars = DecimalChars + ['A'..'F', 'a'..'f'];
- OctalChars = ['0'..'7'];
- BinaryChars = ['0', '1'];
-
- QuoteChars = ['''', '"'];
- WildCards = ['*', '?'];
- FileNameEnemies = WildCards + ['\', '/', ':', '<', '>', '|'];
-
- HexChar: array[THex] of Char = (
- '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
- LowerHexChar: array[THex] of Char = (
- '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
- BaseNChar: array[TBaseN] of Char = (
- '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H',
- 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
-
- cYcnusOverlayColor = $050001;
-
- faFindEveryFile = faReadOnly + faHidden + faSysFile + faArchive;
-
- platWin9x = [VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS];
-
-
-{ Debugging }
-procedure ClearReport(const ReportName: string);
-procedure Report(const ReportName, Text: string);
-procedure ReportFmt(const ReportName, Fmt: string; const Args: array of const);
-
-{ Params }
-procedure GetParams(Strings: TStrings); overload;
-function GetParams(const Separator: string = ' '): string; overload;
-
-function ParamNum(const S: string): Integer;
-function ParamPrefixNum(const Prefix: string): Integer;
-function Param(const S: string): Boolean;
-function ParamPrefix(const Prefix: string): Boolean;
-
-function Switch(const Switch: string; const PrefixChars: TCharSet = SwitchChars;
- IgnoreCase: Boolean = True): Boolean;
-function GetParam(const Prefix: string = ''; const Default: string = ''): string;
-
-{ Dirs & UserName}
-function GetMyDir(FullPath: Boolean = False): string;
-function WinDir: string;
-function SysDir: string;
-function UserName: string;
-
-{ Strings & Chars}
-function FirstChar(const S: string): Char;
-function LastChar(const S: string): Char;
-
-function CharPos(C: Char; const S: string; Offset: Integer = 1): Integer; overload;
-function CharPos(C: TCharSet; const S: string; Offset: Integer = 1): Integer; overload;
-function CharPosR(C: Char; const S: string; Offset: Integer = -1): Integer;
-function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer;
-function PosExText(const SubStr, S: string; Offset: Integer = 1): Integer;
-function PosExAnsiText(const SubStr, S: string; Offset: Integer = 1): Integer;
-
-function UntilChar(const S: string; Brake: Char): string; overload;
-function UntilChar(const S: string; Brake: TCharSet): string; overload;
-function UntilLastChar(const S: string; Brake: Char;
- IgnoreNoBrake: Boolean = True): string;
-
-function FromChar(const S: string; Brake: Char): string; overload;
-function FromChar(const S: string; Brake: TCharSet): string; overload;
-function FromLastChar(const S: string; Brake: Char;
- IgnoreNoBrake: Boolean = False): string;
-
-function BetweenChars(const S: string; Start, Finish: Char;
- Inclusive: Boolean = False): string;
-
-function UntilStr(const S: string; Brake: string): string;
-function FromStr(const S: string; Brake: string): string;
-
-function StringWrap(const S: string; Width: Integer; const LineEnd: string = EOL): string;
-
-{ Splitting & Combining }
-function Split(const S, Separator: string; IgnoreMultiSep: Boolean = True;
- MinCount: Integer = 0): TStrA; overload;
-procedure Split(const S, Separator: string; Strings: TStrings;
- IgnoreMultiSep: Boolean = True); overload;
-function Split(const S: string; Separators: TCharSet;
- IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA; overload;
-
-procedure TileStr(const S: string; BrakeStart: Integer; BrakeEnd: Integer;
- out Left, Right: string);
-
-function Join(Strings: TStrings; Separator: string = ' '): string; overload;
-function Join(StrA: TStrA; Separator: string = ' '): string; overload;
-
-function MulStr(const S: string; Count: Integer): string;
-
-{ Strings ausrichten }
-function AlignR(const S: string; Width: Integer; Filler: Char = ' '): string;
-function MaxStr(const S: string; MaxLen: Integer): string;
-
-{ Stringing }
-function TrimAll(const S: string): string;
-
-function ControlChar(C: Char): Boolean;
-function FriendlyChar(C: Char): Char;
-
-function FriendlyStr(const S: string): string; overload;
-function FriendlyStr(a: TByteA): string; overload;
-
-function Quote(const S: string; Quoter: Char = '"'): string;
-function UnQuote(const S: string): string;
-function DeQuote(const S: string): string;
-
-function StrNumerus(const Value: Integer; const Singular, Plural: string;
- const Zero: string = '0'): string;
-
-function MakeStr(const Items: array of const; Separator: string = ''): string;
-procedure ShowText(const Items: array of const; Separator: string = '');
-
-{ Delete }
-function DeleteChars(const S: string; C: Char): string; overload;
-function DeleteChars(const S: string; C: TCharSet): string; overload;
-function ExtractChars(const S: string; C: TCharSet): string;
-
-{ Find }
-function CharCount(const S: string; C: Char): Integer;
-
-function CharIn(const S: string; C: Char): Boolean; overload;
-function CharIn(const S: string; C: TCharSet): Boolean; overload;
-
-function StrAtPos(const S: string; Pos: Integer; const Str: string): Boolean;
-function StrAtBegin(const S, Str: string): Boolean;
-function StrIn(const S, SubStr: string): Boolean; overload;
-function StrIn(A: TStrA; const S: string): Boolean; overload;
-function StrIn(SL: TStrings; const S: string): Boolean; overload;
-function StrIndex(A: TStrA; const S: string): Integer; overload;
-function StrIndex(SL: TStrings; const S: string): Integer; overload;
-
-function TextAtPos(const S: string; Pos: Integer; const Text: string): Boolean;
-function TextAtBegin(const S, Text: string): Boolean;
-function TextIn(const S, Text: string): Boolean; overload;
-function TextIn(A: TStrA; const Text: string): Boolean; overload;
-function TextIn(SL: TStrings; const Text: string): Boolean; overload;
-function TextIndex(A: TStrA; const Text: string): Integer; overload;
-function TextIndex(SL: TStrings; const Text: string): Integer; overload;
-
-{ Replace }
-function ReplaceChars(const S: string; Old, New: Char): string; overload;
-function ReplaceChars(const S: string; Old: TCharSet; New: Char): string; overload;
-
-function Replace(const S, Old, New: string): string;
-
-{ TStrings }
-function SLOfFile(const FileName: string): TStringList;
-function ContainsEmptyLines(SL: TStrings): Boolean;
-procedure DeleteEmptyLines(SL: TStrings);
-procedure DeleteCommentLines(SL: TStrings; const CommentSign: string = '//');
-procedure WriteSL(Strings: TStrings; const Prefix: string = '';
- const Suffix: string = '');
-
-function FindLine(SL: TStrings; const S: string): Integer;
-
-procedure QuickSortSL(SL: TStringList);
-
-{ TStrA }
-function IncStrA(StrA: TStrA): Integer;
-
-{ TByteA }
-function StrOfByteA(a: TByteA): string;
-function ByteAOfStr(const S: string): TByteA;
-function ByteAOfInt(i: Integer): TByteA;
-function IntOfByteA(A: TByteA): Integer;
-function ByteAOfHex(const Hex: string): TByteA;
-
-function SameByteA(const A, B: TByteA): Boolean;
-function Reverse(a: TByteA): TByteA;
-function SaveByteA(Data: TByteA; const FileName: string; Overwrite: Boolean = True): Boolean;
-function LoadByteA(const FileName: string): TByteA;
-
-function Endian(i: Integer): Integer;
-
-{ Files }
-function SizeOfFile(const FileName: string): Integer;
-function FileEx(const FileName: string; AllowFolders: Boolean = False): Boolean;
-function LWPSolve(const Dir: string): string;
-function LWPSlash(const Dir: string): string;
-
-function ExtractDrive(const FileName: string): string;
-function ExtractPath(const FileName: string): string;
-function ExtractPrefix(const FileName: string): string;
-function ExtractSuffix(const FileName: string): string;
-
-function IsValidFileName(const FileName: string): Boolean;
-function MakeValidFileName(FileName: string; const Default: string = 'File'): string;
-
-{ Converting }
-function IsValidInteger(const S: string): Boolean;
-function IsValidCardinal(const S: string): Boolean;
-
-function StrOfBool(flag: Boolean; const TrueStr: string = 'True';
- const FalseStr: string = 'False'): string;
-function StrOfInt(i: Integer): string;
-function CardOfStr(const S: string): Cardinal;
-
-function HexOrd(Hex: Char): THex;
-function ByteOfHex(Hex: THexByteStr): Byte;
-
-function DecOfHex(const Hex: string): string;
-function HexOfByte(b: Byte): THexByteStr;
-function HexOfCard(i: Cardinal): string; overload;
-function HexOfCard(i: Cardinal; Digits: Integer): string; overload;
-
-function PascalHexArray(a: TByteA; Name: string): string;
-
-function HexOfByteA(a: TByteA; Blocks: Integer = 1;
- const Splitter: string = ' '): string;
-function BinOfByteA(a: TByteA; Blocks: Integer = 4;
- const Splitter: string = ' '): string;
-
-function CardOfHex(Hex: string): Cardinal;
-function IntOfBin(Bin: string): Cardinal;
-
-function BinOfIntFill(n: cardinal; MinCount: Integer = 8): string;
-function BinOfInt(n: cardinal): string;
-
-function BaseNOfInt(I: Cardinal; B: TBaseN): string;
-function IntOfBaseN(V: string; B: TBaseN): Cardinal;
-
-{ Ranges }
-function KeepIn(i, Bottom, Top: Variant): Variant;
-function InRange(Value, Bottom, Top: Variant): Boolean;
-function InStrictRange(Value, Bottom, Top: Variant): Boolean;
-function Min(const A, B: Integer): Integer; overload;
-function Min(const A: TIntA): Integer; overload;
-function Max(const A, B: Integer): Integer; overload;
-function Max(const A: TIntA): Integer; overload;
-
-const
- RangesSeparator = ',';
- RangeInnerSeparator = '-';
- RangeInfinite = '*';
- RangeSpecialChars = [RangesSeparator, RangeInnerSeparator, RangeInfinite];
-
-function RangesOfStr(const S: string): TRanges;
-function InRanges(Ranges: TRanges; TestValue: Cardinal): Boolean;
-
-function Success(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean;
-function Failure(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean;
-
-function ExpandString(const S: string): string;
-
-{ Files }
-procedure DeleteFiles(const Mask: string; ScanSubDirs: Boolean = True;
- Attributes: Integer = faFindEveryFile);
-procedure FileNew(const FileName: string);
-function DateTimeOfFileTime(const FileTime: TFileTime): TDateTime;
-
-{ FileNames }
-function GetFileNew(FileName: string; NoFloppyDrives: Boolean = True): string;
-
-{ Finding Files }
-function FindAll(Strings: TStrings; const Mask: string;
- ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile;
- FileReturn: TFileNameFunc = nil): Boolean;
-function FindAllFirst(const Mask: string; ScanSubDirs: Boolean = True;
- Attributes: Integer = faFindEveryFile): string;
-
-function FullOSInfo: string;
-function Win32PlatformStr: string;
-function Win9x: Boolean;
-function WinNT: Boolean;
-function Win2000: Boolean;
-function WinXP: Boolean;
-
-var
- MyDir: string = '';
- LastSuccessRes: Integer = 0;
-
-{ Backward compatibility }
-{$IFNDEF VER130}
-function SameText(const S1, S2: string): Boolean;
-{$ENDIF}
-
-implementation
-{$IFNDEF VER140}
-uses FileCtrl;
-{$ENDIF}
-
-{$IFNDEF VER130}
-function SameText(const S1, S2: string): Boolean;
-begin
- Result := CompareText(S1, S2) = 0;
-end;
-{$ENDIF}
-
-procedure Report(const ReportName, Text: string);
-var
- F: TextFile;
- FileName: string;
-begin
- FileName := MyDir + ReportName + '.rep';
- Assign(F, FileName);
- try
- if not FileExists(FileName) then
- Rewrite(F)
- else
- Append(F);
- WriteLn(F, Text);
- finally
- Close(F);
- end;
-end;
-
-procedure ClearReport(const ReportName: string);
-var
- FileName: string;
-begin
- FileName := MyDir + ReportName + '.rep';
- DeleteFile(FileName);
-end;
-
-procedure ReportFmt(const ReportName, Fmt: string; const Args: array of const);
-begin
- Report(ReportName, Format(Fmt, Args));
-end;
-
-procedure GetParams(Strings: TStrings);
-var
- P: PChar;
- Param: string;
-
- function GetParamStr(var P: PChar; var Param: string): Boolean;
- var
- Quoted: Boolean;
- begin
- Param := '';
-
- repeat
- while (P[0] <> #0) and (P[0] <= ' ') do
- Inc(P);
-
- Quoted := False;
- while P[0] <> #0 do begin
- if P[0] = '"' then begin
- Quoted := not Quoted;
- Inc(P);
- Continue; end;
- if (P[0] <= ' ') and not Quoted then
- Break;
- Param := Param + P[0];
- Inc(P);
- end;
- until (Param <> '') or (P[0] = #0);
-
- Result := Param <> '';
- end;
-
-begin
- Strings.Clear;
- P := GetCommandLine;
- GetParamStr(P, Param);
- while GetParamStr(P, Param) do
- Strings.Add(Param);
-end;
-
-function GetParams(const Separator: string = ' '): string;
-var
- SL: TStringList;
-begin
- SL := TStringList.Create;
- GetParams(SL);
- Result := Join(SL, Separator);
- SL.Free;
-end;
-
-function Switch(const Switch: string; const PrefixChars: TCharSet = SwitchChars;
- IgnoreCase: Boolean = True): Boolean;
-//= SysUtils.FindCmdLineSwitch
-var
- i: Integer;
- s: string;
-begin
- Result := True;
-
- for i := 1 to ParamCount do begin
- s := ParamStr(i);
-
- if (s <> '') and (s[1] in PrefixChars) then begin
- //i know that always s <> '', but this is saver
- s := Copy(s, 2, MaxInt);
- if (s = Switch) or (IgnoreCase and (0=AnsiCompareText(s, Switch))) then
- Exit;
- end;
- end;
-
- Result := False;
-end;
-
-function ParamNum(const S: string): Integer;
-begin
- for Result := 1 to ParamCount do
- if 0=AnsiCompareText(ParamStr(Result), S) then
- Exit;
-
- Result := 0;
-end;
-
-function ParamPrefixNum(const Prefix: string): Integer;
-var
- Len: Integer;
-begin
- Len := Length(Prefix);
- for Result := 1 to ParamCount do
- if 0=AnsiCompareText(Copy(ParamStr(Result), 1, Len), Prefix) then
- Exit;
-
- Result := 0;
-end;
-
-function Param(const S: string): Boolean;
-begin
- Result := ParamNum(S) > 0;
-end;
-
-function ParamPrefix(const Prefix: string): Boolean;
-begin
- Result := ParamPrefixNum(Prefix) > 0;
-end;
-
-function GetParam(const Prefix: string = ''; const Default: string = ''): string;
-var
- i: Integer;
-begin
- Result := Default;
-
- if Prefix = '' then begin
- Result := ParamStr(1);
- Exit; end;
-
- i := ParamPrefixNum(Prefix);
- if i > 0 then
- Result := Copy(ParamStr(i), Length(Prefix) + 1, MaxInt);
-end;
-
-function GetMyDir(FullPath: Boolean = False): string;
-var
- Buffer: array[0..260] of Char;
-begin
- Result := '';
- SetString(Result, Buffer, GetModuleFileName(0, Buffer, SizeOf(Buffer)));
- if FullPath then
- Result := GetFileNew(Result);
- Result := ExtractPath(Result);
-end;
-
-function WinDir: string;
-var
- Res: PChar;
-begin
- Result := '\';
- GetMem(Res, MAX_PATH);
- GetWindowsDirectory(Res, MAX_PATH);
- Result := Res + '\';
- FreeMem(Res, MAX_PATH);
-end;
-
-function SysDir: string;
-var
- Res: PChar;
-begin
- Result := '\';
- GetMem(Res, MAX_PATH);
- GetSystemDirectory(Res, MAX_PATH);
- Result := Res + '\';
- FreeMem(Res, MAX_PATH);
-end;
-
-function UserName: string;
-var
- Len: Cardinal;
- Res: PChar;
-begin
- Result := '';
- GetMem(Res, MAX_PATH);
- Len := MAX_PATH;
- GetUserName(Res, Len);
- Result := Res;
- FreeMem(Res, MAX_PATH);
-end;
-
-function FirstChar(const S: string): Char;
-begin
- if s = '' then
- Result := #0
- else
- Result := s[1];
-end;
-
-function LastChar(const S: string): Char;
-begin
- if s = '' then
- Result := #0
- else
- Result := s[Length(s)];
-end;
-
-function CharPos(C: Char; const S: string; Offset: Integer = 1): Integer;
-var
- MaxPosToSearch: Integer;
-begin
- Result := Offset;
- MaxPosToSearch := Length(S);
-
- while Result <= MaxPosToSearch do begin
- if S[Result] = C then
- Exit;
- Inc(Result);
- end;
-
- Result := 0;
-end;
-
-function CharPos(C: TCharSet; const S: string; Offset: Integer = 1): Integer;
-var
- MaxPosToSearch: Integer;
-begin
- Result := Offset;
- MaxPosToSearch := Length(S);
-
- while Result <= MaxPosToSearch do begin
- if S[Result] in C then
- Exit;
- Inc(Result);
- end;
-
- Result := 0;
-end;
-
-function CharPosR(C: Char; const S: string; Offset: Integer = -1): Integer;
-begin
- if Offset < 0 then
- Result := Length(S) + 1 - Offset
- else
- Result := Offset;
- if Result > Length(S) then
- Result := Length(S);
-
- while Result > 0 do begin
- if S[Result] = C then
- Exit;
- Dec(Result);
- end;
-end;
-
-function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer;
-var
- MaxPosToSearch, LenSubStr, i: Integer;
-begin
- if SubStr = '' then begin
- Result := 0;
- Exit; end;
-
- if Offset < 1 then
- Result := 1
- else
- Result := Offset;
-
- LenSubStr := Length(SubStr);
- MaxPosToSearch := Length(S) - LenSubStr + 1;
-
- while Result <= MaxPosToSearch do begin
- if S[Result] = SubStr[1] then begin
- i := 1;
-
- while (i < LenSubStr)
- and (S[Result + i] = SubStr[i + 1]) do
- Inc(i);
-
- if i = LenSubStr then
- Exit;
- end;
- Inc(Result);
- end;
-
- Result := 0;
-end;
-
-function PosExText(const SubStr, S: string; Offset: Integer = 1): Integer;
-var
- MaxPosToSearch, LenSubStr, i: Integer;
-
- function SameChar(a, b: Char): Boolean;
- begin
- Result := UpCase(a) = UpCase(b)
- end;
-
-begin
- if SubStr = '' then begin
- Result := 0;
- Exit; end;
-
- if Offset < 1 then
- Result := 1
- else
- Result := Offset;
-
- LenSubStr := Length(SubStr);
- MaxPosToSearch := Length(S) - LenSubStr + 1;
-
- while Result <= MaxPosToSearch do begin
- if SameChar(S[Result], SubStr[1]) then begin
- i := 1;
-
- while (i < LenSubStr)
- and (SameChar(S[Result + i], SubStr[i + 1])) do
- Inc(i);
-
- if i = LenSubStr then
- Exit;
- end;
- Inc(Result);
- end;
-
- Result := 0;
-end;
-
-function PosExAnsiText(const SubStr, S: string; Offset: Integer = 1): Integer;
-var
- MaxPosToSearch, LenSubStr, i: Integer;
-
- function SameChar(a, b: Char): Boolean;
- begin
- Result := CharLower(PChar(a)) = CharLower(PChar(b));
- end;
-
-begin
- if SubStr = '' then begin
- Result := 0;
- Exit; end;
-
- if Offset < 1 then
- Result := 1
- else
- Result := Offset;
-
- LenSubStr := Length(SubStr);
- MaxPosToSearch := Length(S) - LenSubStr + 1;
-
- while Result <= MaxPosToSearch do begin
- if SameChar(S[Result], SubStr[1]) then begin
- i := 1;
-
- while (i < LenSubStr)
- and (SameChar(S[Result + i], SubStr[i + 1])) do
- Inc(i);
-
- if i = LenSubStr then
- Exit;
- end;
- Inc(Result);
- end;
-
- Result := 0;
-end;
-
-function UntilChar(const S: string; Brake: Char): string;
-var
- p: Integer;
-begin
- p := CharPos(Brake, S);
-
- if p > 0 then
- Result := Copy(S, 1, p - 1)
- else
- Result := S;
-end;
-
-function UntilChar(const S: string; Brake: TCharSet): string;
-var
- p: Integer;
-begin
- Result := '';
- p := CharPos(Brake, S);
-
- if p > 0 then
- Result := Copy(S, 1, p - 1)
- else
- Result := S;
-end;
-
-function UntilLastChar(const S: string; Brake: Char;
- IgnoreNoBrake: Boolean = True): string;
-var
- p: Integer;
-begin
- Result := '';
- p := CharPosR(Brake, S);
-
- if p > 0 then
- Result := Copy(S, 1, p - 1)
- else if IgnoreNoBrake then
- Result := S;
-end;
-
-function FromChar(const S: string; Brake: Char): string;
-var
- p: Integer;
-begin
- Result := '';
- p := CharPos(Brake, S);
-
- if p > 0 then
- Result := Copy(S, p + 1, Length(S) - p);
-end;
-
-function FromChar(const S: string; Brake: TCharSet): string;
-var
- p: Integer;
-begin
- Result := '';
- p := CharPos(Brake, S);
-
- if p > 0 then
- Result := Copy(S, p + 1, Length(S) - p);
-end;
-
-function FromLastChar(const S: string; Brake: Char;
- IgnoreNoBrake: Boolean = False): string;
-var
- p: Integer;
-begin
- Result := '';
- p := CharPosR(Brake, S);
-
- if p > 0 then
- Result := Copy(S, p + 1, Length(S) - p)
- else if IgnoreNoBrake then
- Result := S;
-end;
-
-function BetweenChars(const S: string; Start, Finish: Char;
- Inclusive: Boolean = False): string;
-var
- p, fin: Integer;
-begin
- Result := '';
-
- p := CharPos(Start, S);
- if p = 0 then
- Exit;
-
- fin := CharPos(Finish, S, p + 1);
- if fin = 0 then
- Exit;
-
- if not Inclusive then begin
- Inc(p);
- Dec(fin);
- end;
-
- Result := Copy(S, p, fin - p + 1);
-end;
-
-function UntilStr(const S: string; Brake: string): string;
-var
- p: Integer;
-begin
- if Length(Brake) = 1 then begin
- Result := UntilChar(S, Brake[1]);
- Exit; end;
-
- p := PosEx(Brake, S);
-
- if p > 0 then
- Result := Copy(S, 1, p - 1)
- else
- Result := S;
-end;
-
-function FromStr(const S: string; Brake: string): string;
-var
- p: Integer;
-begin
- if Length(Brake) = 1 then begin
- Result := FromChar(S, Brake[1]);
- Exit; end;
-
- Result := '';
- p := PosEx(Brake, s);
-
- if p > 0 then begin
- Inc(p, Length(Brake));
- Result := Copy(S, p, Length(S) - p + 1);
- end;
-end;
-
-function StringWrap(const S: string; Width: Integer; const LineEnd: string = EOL): string;
-var
- i: Integer;
-begin
- Result := '';
- if (S = '') or (Width < 1) then
- Exit;
-
- i := 1;
- while True do begin
- Result := Result + Copy(S, i, Width);
- Inc(i, Width);
- if i <= Length(S) then
- Result := Result + LineEnd
- else
- Exit;
- end;
-end;
-
-function Split(const S, Separator: string; IgnoreMultiSep: Boolean = True;
- MinCount: Integer = 0): TStrA;
-var
- p, fin, SepLen: Integer;
-
- procedure Add(const S: string);
- begin
- if IgnoreMultiSep and (S = '') then
- Exit;
- SetLength(Result, Length(Result) + 1);
- Result[High(Result)] := S;
- end;
-
-begin
- if S = '' then begin
- if Length(Result) < MinCount then
- SetLength(Result, MinCount);
- Exit; end;
-
- Result := nil;
- SepLen := Length(Separator);
-
- p := 1;
- fin := PosEx(Separator, S);
- while fin > 0 do begin
- Add(Copy(S, p, fin - p));
- p := fin + SepLen;
- fin := PosEx(Separator, S, p);
- end;
- Add(Copy(S, p, Length(S) - p + 1));
-
- if Length(Result) < MinCount then
- SetLength(Result, MinCount);
-end;
-
-procedure Split(const S, Separator: string; Strings: TStrings;
- IgnoreMultiSep: Boolean = True);
-var
- p, fin, SepLen: Integer;
-
- procedure Add(const S: string);
- begin
- if IgnoreMultiSep and (S = '') then
- Exit;
- Strings.Add(S);
- end;
-
-begin
- if S = '' then
- Exit;
-
- Strings.BeginUpdate;
- SepLen := Length(Separator);
- p := 1;
- fin := PosEx(Separator, S);
- while fin > 0 do begin
- Add(Copy(S, p, fin - p));
- p := fin + SepLen;
- fin := PosEx(Separator, S, p);
- end;
- Add(Copy(S, p, Length(S) - p + 1));
- Strings.EndUpdate;
-end;
-
-function Split(const S: string; Separators: TCharSet;
- IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA;
-var
- p, fin: Integer;
-
- procedure Add(const S: string);
- begin
- if IgnoreMultiSep and (S = '') then
- Exit;
- SetLength(Result, Length(Result) + 1);
- Result[High(Result)] := S;
- end;
-
-begin
- if S = '' then begin
- if Length(Result) < MinCount then
- SetLength(Result, MinCount);
- Exit; end;
-
- Result := nil;
-
- p := 1;
- fin := CharPos(Separators, S);
- while fin > 0 do begin
- Add(Copy(S, p, fin - p));
- p := fin + 1;
- fin := CharPos(Separators, S, p);
- end;
- Add(Copy(S, p, Length(S) - p + 1));
-
- if Length(Result) < MinCount then
- SetLength(Result, MinCount);
-end;
-
-procedure TileStr(const S: string; BrakeStart: Integer; BrakeEnd: Integer;
- out Left, Right: string);
-begin
- Left := Copy(S, 1, BrakeStart-1);
- Right := Copy(S, BrakeEnd + 1, MaxInt);
-end;
-
-function Join(Strings: TStrings; Separator: string = ' '): string;
-var
- i, imax: Integer;
-begin
- Result := '';
- imax := Strings.Count-1;
- for i := 0 to imax do begin
- Result := Result + Strings[i];
- if i < imax then
- Result := Result + Separator;
- end;
-end;
-
-function Join(StrA: TStrA; Separator: string = ' '): string; overload;
-var
- i: Integer;
-begin
- Result := '';
- for i := 0 to High(StrA) do begin
- Result := Result + StrA[i];
- if i < High(StrA) then
- Result := Result + Separator;
- end;
-end;
-
-function MulStr(const S: string; Count: Integer): string;
-var
- P: PChar;
- Len, i: Integer;
-begin
- Result := '';
- if Count = 0 then
- Exit;
-
- Len := Length(S);
- SetLength(Result, Len * Count);
-
- P := Pointer(Result);
- for i := 1 to Count do begin
- Move(Pointer(S)^, P^, Len);
- Inc(P, Len);
- end;
-end;
-
-function AlignR(const S: string; Width: Integer; Filler: Char = ' '): string;
-begin
- Result := MulStr(Filler, Width - Length(S)) + S;
-end;
-
-function MaxStr(const S: string; MaxLen: Integer): string;
-var
- Len: Integer;
-begin
- Len := Length(S);
- if Len <= MaxLen then begin
- Result := S;
- Exit end;
-
- Result := Copy(S, 1, MaxLen - 3) + '...';
-end;
-
-function TrimAll(const S: string): string;
-var
- i: Integer;
-begin
- for i := 1 to Length(S) do
- if S[i] > #32 then
- Result := Result + S[i];
-end;
-
-function ControlChar(C: Char): Boolean;
-begin
- Result := C in StrangeChars;
-end;
-
-function FriendlyChar(C: Char): Char;
-begin
- case C of
- #0: Result := '.';
- #1..#31: Result := '?';
- #255: Result := '#';
- else
- Result := C;
- end;
-end;
-
-function FriendlyStr(const S: string): string;
-var
- i: Integer;
-begin
- SetLength(Result, Length(S));
- for i := 1 to Length(S) do
- Result[i] := FriendlyChar(S[i]);
-end;
-
-function FriendlyStr(a: TByteA): string;
-var
- i: Integer;
-begin
- SetLength(Result, Length(a));
- for i := 0 to High(a) do
- Result[i + 1] := FriendlyChar(Char(a[i]));
-end;
-
-function Quote(const S: string; Quoter: Char = '"'): string;
-begin
- Result := S;
-
- if FirstChar(S) <> Quoter then
- Result := Quoter + Result;
-
- if LastChar(S) <> Quoter then
- Result := Result + Quoter;
-end;
-
-function DeQuote(const S: string): string;
-begin
- Result := '';
- if Length(S) > 2 then
- Result := Copy(S, 2, Length(S) - 2);
-end;
-
-function UnQuote(const S: string): string;
-var
- Start, Len: Integer;
-begin
- Start := 1;
- Len := Length(S);
-
- if (S <> '') and (S[1] in ([#0..#32] + QuoteChars)) then begin
- if (LastChar(S) = S[1]) then
- Dec(Len);
- Inc(Start);
- end;
-
- Result := Copy(S, Start, Len - Start + 1);
-end;
-
-function StrNumerus(const Value: Integer; const Singular, Plural: string;
- const Zero: string = '0'): string;
-begin
- if Abs(Value) = 1 then
- Result := IntToStr(Value) + ' ' + Singular
- else if Value = 0 then
- Result := Zero + ' ' + Plural
- else
- Result := IntToStr(Value) + ' ' + Plural;
-end;
-
-function MakeStr(const Items: array of const; Separator: string = ''): string;
-const
- BoolStrings: array[Boolean] of string = ('False', 'True');
-
-var
- i: Integer;
-
- function StrOfP(P: Pointer): string;
- begin
- if P = nil then
- Result := '[nil]'
- else
- Result := '[' + IntToStr(Cardinal(P)) + ']';
- end;
-
- procedure Add(const S: string);
- begin
- Result := Result + s + Separator;
- end;
-
-begin
- Result := '';
- for i := 0 to High(Items) do
- with Items[i] do
- case VType of
- vtString: Add(VString^);
- vtInteger: Add(IntToStr(VInteger));
- vtBoolean: Add(BoolStrings[VBoolean]);
- vtChar: Add(VChar);
- vtPChar: Add(VPChar);
- vtExtended: Add(FloatToStr(VExtended^));
- vtObject: if VObject is TComponent then
- Add(TComponent(VObject).Name)
- else
- Add(VObject.ClassName);
- vtClass: Add(VClass.ClassName);
- vtAnsiString: Add(string(VAnsiString));
- vtCurrency: Add(CurrToStr(VCurrency^));
- vtInt64: Add(IntToStr(VInt64^));
- vtVariant: Add(string(VVariant^));
-
- vtWideChar: Add(VWideChar);
- vtPWideChar: Add(VPWideChar);
- vtInterface: Add(StrOfP(VInterface));
- vtPointer: Add(StrOfP(VPointer));
- vtWideString: Add(WideString(VWideString));
- end;
- if Result <> '' then
- SetLength(result, Length(Result) - Length(Separator));
-end;
-
-procedure ShowText(const Items: array of const; Separator: string = '');
-var
- Text: string;
-begin
- Text := MakeStr(Items, Separator);
-
- MessageBox(0, PChar(Text), 'Info', MB_OK and MB_APPLMODAL);
-end;
-
-function DeleteChars(const S: string; C: Char): string;
-var
- i: Integer;
-begin
- Result := '';
- for i := 1 to Length(S) do
- if S[i] <> C then
- Result := Result + S[i];
-end;
-
-function DeleteChars(const S: string; C: TCharSet): string;
-var
- i: Integer;
-begin
- Result := '';
- for i := 1 to Length(S) do
- if not (S[i] in C) then
- Result := Result + S[i];
-end;
-
-function ExtractChars(const S: string; C: TCharSet): string;
-var
- i: Integer;
-begin
- Result := '';
- for i := 1 to Length(S) do
- if S[i] in C then
- Result := Result + S[i];
-end;
-
-function CharCount(const S: string; C: Char): Integer;
-var
- i: Integer;
-begin
- Result := 0;
- for i := 1 to Length(S) do
- if S[i] = C then
- Inc(Result);
-end;
-
-function StrAtPos(const S: string; Pos: Integer; const Str: string): Boolean;
-begin
- Result := (Str <> '') and (Str = Copy(S, Pos, Length(Str)));
-end;
-
-function TextAtPos(const S: string; Pos: Integer; const Text: string): Boolean;
-begin
- Result := (Text <> '') and SameText(Text, Copy(S, Pos, Length(Text)));
-end;
-
-function StrAtBegin(const S, Str: string): Boolean;
-begin
- Result := StrAtPos(S, 1, Str);
-end;
-
-function TextAtBegin(const S, Text: string): Boolean;
-begin
- Result := TextAtPos(S, 1, Text);
-end;
-
-function CharIn(const S: string; C: Char): Boolean;
-var
- i: Integer;
-begin
- Result := True;
- for i := 1 to Length(S) do
- if S[i] = C then Exit;
- Result := False;
-end;
-
-function CharIn(const S: string; C: TCharSet): Boolean;
-var
- i: Integer;
-begin
- Result := False;
- for i := 1 to Length(S) do begin
- Result := S[i] in C;
- if Result then
- Exit;
- end;
-end;
-
-function StrIn(const S, SubStr: string): Boolean;
-begin
- Result := PosEx(SubStr, S) > 0;
-end;
-
-function StrIn(SL: TStrings; const S: string): Boolean;
-var
- i: Integer;
-begin
- Result := False;
- for i := 0 to SL.Count-1 do begin
- Result := (S = SL[i]);
- if Result then
- Exit;
- end;
-end;
-
-function StrIn(A: TStrA; const S: string): Boolean;
-var
- i: Integer;
-begin
- Result := False;
- for i := Low(A) to High(A) do begin
- Result := (S = A[i]);
- if Result then
- Exit;
- end;
-end;
-
-function TextIn(const S, Text: string): Boolean;
-begin
- Result := PosExText(Text, S) > 0;
-end;
-
-function TextIn(SL: TStrings; const Text: string): Boolean;
-var
- i: Integer;
-begin
- Result := False;
- for i := 0 to SL.Count-1 do begin
- Result := SameText(Text, SL[i]);
- if Result then
- Exit;
- end;
-end;
-
-function TextIn(A: TStrA; const Text: string): Boolean;
-var
- i: Integer;
-begin
- Result := False;
- for i := Low(A) to High(A) do begin
- Result := SameText(Text, A[i]);
- if Result then
- Exit;
- end;
-end;
-
-function StrIndex(SL: TStrings; const S: string): Integer;
-begin
- for Result := 0 to SL.Count-1 do
- if S = SL[Result] then
- Exit;
- Result := -1;
-end;
-
-function StrIndex(A: TStrA; const S: string): Integer;
-begin
- for Result := Low(A) to High(A) do
- if S = A[Result] then
- Exit;
- Result := -1;
-end;
-
-function TextIndex(SL: TStrings; const Text: string): Integer;
-begin
- for Result := 0 to SL.Count-1 do
- if SameText(Text, SL[Result]) then
- Exit;
- Result := -1;
-end;
-
-function TextIndex(A: TStrA; const Text: string): Integer;
-begin
- for Result := Low(A) to High(A) do
- if SameText(Text, A[Result]) then
- Exit;
- Result := -1;
-end;
-
-function ReplaceChars(const S: string; Old, New: Char): string;
-var
- i: Integer;
-begin
- Result := S;
- for i := 1 to Length(Result) do
- if Result[i] = Old then
- Result[i] := New;
-end;
-
-function ReplaceChars(const S: string; Old: TCharSet; New: Char): string;
-var
- i: Integer;
-begin
- Result := S;
- for i := 1 to Length(Result) do
- if Result[i] in Old then
- Result[i] := New;
-end;
-
-function Replace(const S, Old, New: string): string;
-var
- oldp, ps: Integer;
-begin
- ps := 1;
- Result := '';
- while True do begin
- oldp := ps;
- ps := PosEx(Old, S, oldp);
- if ps = 0 then begin
- Result := Result + Copy(S, oldp, Length(S) - oldp + 1);
- Exit; end;
- Result := Result + Copy(S, oldp, ps - oldp) + New;
- Inc(ps, Length(Old));
- end;
-end;
-
-function SLOfFile(const FileName: string): TStringList;
-begin
- Result := TStringList.Create;
- if FileExists(FileName) then
- Result.LoadFromFile(FileName);
-end;
-
-function ContainsEmptyLines(SL: TStrings): Boolean;
-begin
- Result := StrIn(SL, '');
-end;
-
-procedure DeleteEmptyLines(SL: TStrings);
-var
- i: Integer;
-begin
- i := 0;
- while i < SL.Count do begin
- if SL[i] = '' then
- SL.Delete(i)
- else
- Inc(i);
- end;
-end;
-
-procedure DeleteCommentLines(SL: TStrings; const CommentSign: string = '//');
-var
- i: Integer;
-begin
- i := 0;
- while i < SL.Count do begin
- if (SL[i] = '') or (StrAtBegin(TrimLeft(SL[i]), CommentSign)) then
- SL.Delete(i)
- else
- Inc(i);
- end;
-end;
-
-function FindLine(SL: TStrings; const S: string): Integer;
-begin
- for Result := 0 to SL.Count-1 do
- if TextAtBegin(SL[Result], S) then
- Exit;
- Result := -1;
-end;
-
-procedure QuickSortSL(SL: TStringList);
-
- procedure Sort(l, r: Integer);
- var
- i,j: Integer;
- z,x: string;
- begin
- i := l;
- j := r;
- x := SL[(j + i) div 2];
- repeat
- while SL[i] < x do Inc(i);
- while SL[j] > x do Dec(j);
- if i <= j then begin
- z := SL[i];
- SL[i] := SL[j];
- SL[j] := z;
- Inc(i); Dec(j);
- end;
- until i > j;
- if j > l then Sort(l, j);
- if i < r then Sort(i, r);
- end;
-
-begin
- if SL.Count > 0 then
- Sort(0, SL.Count-1);
-end;
-
-function IncStrA(StrA: TStrA): Integer;
-begin
- SetLength(StrA, Length(StrA) + 1);
- Result := High(StrA);
-end;
-
-function StrOfByteA(a: TByteA): string;
-begin
- Result := string(Copy(a, 0, Length(a)));
-end;
-
-function ByteAOfStr(const S: string): TByteA;
-begin
- Result := TByteA(Copy(S, 1, Length(s)));
-end;
-
-function ByteAOfInt(i: Integer): TByteA;
-begin
- SetLength(Result, SizeOf(Integer));
- Move(i, Pointer(Result)^, SizeOf(Integer));
-end;
-
-function IntOfByteA(A: TByteA): Integer;
-begin
- Result := 0;
- Move(Pointer(A)^, Result, Min(Length(A), SizeOf(Integer)));
-end;
-
-function ByteAOfHex(const Hex: string): TByteA;
-var
- i: Integer;
- h: string;
-begin
- h := ExtractChars(Hex, HexadecimalChars);
- SetLength(Result, Length(h) div 2);
- for i := 0 to High(Result) do
- Result[i] := ByteOfHex(Copy(h, (i shl 1) + 1, 2));
-end;
-
-function SizeOfFile(const FileName: string): Integer;
-var
- F: file;
-begin
- AssignFile(F, FileName);
- {$I-}Reset(F, 1);{$I+}
- if IOResult = 0 then begin
- Result := FileSize(F);
- CloseFile(F);
- end else
- Result := 0;
-end;
-
-function FileEx(const FileName: string; AllowFolders: Boolean = False): Boolean;
-var
- FindData: TWin32FindData;
-begin
- if FileName = '' then begin
- Result := False;
- Exit; end;
-
- Result := (AllowFolders and DirectoryExists(FileName)) or
- (FindFirstFile(PChar(FileName), FindData) <> INVALID_HANDLE_VALUE);
- Result := Result and not CharIn(FileName, WildCards);
- Result := Result and (AllowFolders
- or ((FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0));
-end;
-
-function LWPSolve(const Dir: string): string;
-begin
- if (Dir <> '') and (Dir[Length(Dir)] = '\') then begin
- Result := Copy(Dir, 1, Length(Dir) - 1);
- end else
- Result := Dir;
-end;
-
-function LWPSlash(const Dir: string): string;
-begin
- if (Dir <> '') and (Dir[Length(Dir)] = '\') then begin
- Result := Copy(Dir, 1, Length(Dir));
- end else
- Result := Dir + '\';
-end;
-
-function ExtractDrive(const FileName: string): string;
-begin
- Result := '';
- if (Length(FileName) >= 2) and (FileName[2] = ':') then
- Result := UpperCase(FileName[1] + ':\');
-end;
-
-function ExtractPath(const FileName: string): string;
-var
- p: Integer;
-begin
- p := CharPosR('\', FileName);
- if P > 0 then
- Result := Copy(FileName, 1, p)
- else
- Result := FileName;
-end;
-
-function ExtractPrefix(const FileName: string): string;
-begin
- Result := UntilLastChar(ExtractFileName(FileName), '.');
-end;
-
-function ExtractSuffix(const FileName: string): string;
-begin
- Result := FromLastChar(ExtractFileName(FileName), '.');
-end;
-
-function SameByteA(const A, B: TByteA): Boolean;
-begin
- Result := (A = B) or ((Length(A) = Length(B)) and CompareMem(A, B, Length(A)));
-end;
-
-function Reverse(A: TByteA): TByteA;
-var
- i: Integer;
-begin
- SetLength(Result, Length(A));
-
- for i := 0 to High(A) do
- Result[High(Result) - i] := A[i];
-end;
-
-function Endian(i: Integer): Integer;
-type
- EndianArray = packed array[0..3] of Byte;
-var
- a, b: EndianArray;
-begin
- a := EndianArray(i);
- b[0] := a[3];
- b[1] := a[2];
- b[2] := a[1];
- b[3] := a[0];
- Result := Integer(b);
-end;
-
-function SaveByteA(Data: TByteA; const FileName: string;
- Overwrite: Boolean = True): Boolean;
-var
- F: file;
-begin
- if FileExists(FileName) and not Overwrite then begin
- Result := False;
- Exit end;
-
- AssignFile(F, FileName);
- {$I-}Rewrite(F, 1);{$I+}
- if IOResult = 0 then begin
- if Length(Data) > 0 then
- BlockWrite(F, Data[0], Length(Data));
- CloseFile(F);
- Result := True;
- end else
- Result := False;
-end;
-
-function LoadByteA(const FileName: string): TByteA;
-var
- F: file;
-begin
- AssignFile(F, FileName);
- {$I-}Reset(F, 1);{$I+}
- if IOResult = 0 then begin
- SetLength(Result, FileSize(F));
- if Length(Result) > 0 then
- BlockRead(F, Result[0], FileSize(F));
- CloseFile(F);
- end else
- SetLength(Result, 0);
-end;
-
-function IsValidFileName(const FileName: string): Boolean;
-begin
- Result := (FileName <> '') and not CharIn(FileName, FileNameEnemies)
- and CharIn(Trim(FileName), AllChars - ['.']);
-end;
-
-function MakeValidFileName(FileName: string; const Default: string = 'File'): string;
-begin
- if FileName = '' then
- FileName := Default;
-
- if CharIn(FileName, FileNameEnemies) then
- Result := ReplaceChars(FileName, FileNameEnemies, '_')
- else if not CharIn(Trim(FileName), AllChars - ['.']) then
- Result := Default
- else
- Result := FileName;
-end;
-
-function IsValidInteger(const S: string): Boolean;
-{const
- LowInt = '2147483648';
- HighInt = '2147483647';
-var
- len, RealLen, i, o: Integer;
- c: Char;
-begin
- Result := False;
- if S = '' then
- Exit;
-
- len := Length(S);
- o := 1;
-
- if S[1] = '-' then begin
- if len = 1 then
- Exit;
- Inc(o);
- while (o <= len) and (S[o] = '0') do
- Inc(o);
- if o > len then
- Exit;
- if o < len then begin
- RealLen := len - o + 1;
- if RealLen > Length(LowInt) then
- Exit
- else if RealLen = Length(LowInt) then begin
- for i := 1 to Length(LowInt) do begin
- c := S[i + o - 1];
- if (c < '0') or (c > LowInt[i]) then
- Exit;
- if c in ['0'..Char((Byte(LowInt[i])-1))] then
- Break;
- end;
- Inc(o, i);
- end;
- end;
- end else begin
- while (o <= len) and (S[o] = '0') do
- Inc(o);
- if o <= len then begin
- RealLen := len - o + 1;
- if RealLen > Length(HighInt) then
- Exit
- else if RealLen = Length(HighInt) then begin
- for i := 1 to Length(HighInt) do begin
- c := S[i + o - 1];
- if (c < '0') or (c > HighInt[i]) then
- Exit;
- if c in ['0'..Char((Byte(HighInt[i])-1))] then
- Break;
- end;
- Inc(o, i);
- end;
- end;
- end;
-
- for i := o to len do
- if not (S[i] in ['0'..'9']) then
- Exit;
-
- Result := True; }
-var
- i: Int64;
-begin
- i := StrToInt64Def(S, High(Int64));
- Result := (i >= Low(Integer)) and (i <= High(Integer));
-end;
-
-function IsValidCardinal(const S: string): Boolean;
-{const
- HighCard = '4294967295';
-var
- len, RealLen, i, o: Integer;
-begin
- Result := False;
- if S = '' then
- Exit;
-
- len := Length(S);
- o := 1;
-
- while (o <= len) and (S[o] = '0') do
- Inc(o);
- if o <= len then begin
- RealLen := len - o + 1;
- if RealLen > Length(HighCard) then
- Exit
- else if RealLen = Length(HighCard) then begin
- for i := 1 to Length(HighCard) do begin
- if S[i + o - 1] > HighCard[i] then
- Exit;
- if S[i + o - 1] in ['0'..Char((Byte(HighCard[i])-1))] then
- Break;
- end;
- Inc(o, i);
- end;
- end;
-
- for i := o to len do
- if not (S[i] in ['0'..'9']) then
- Exit;
-
- Result := True; }
-var
- i: Int64;
-begin
- i := StrToInt64Def(S, -1);
- Result := (i >= 0) and (i <= High(Cardinal));
-end;
-
-function StrOfBool(flag: Boolean; const TrueStr: string = 'True';
- const FalseStr: string = 'False'): string;
-begin
- if Flag then
- Result := TrueStr
- else
- Result := FalseStr;
-end;
-
-function StrOfInt(i: Integer): string;
-begin
-{ if i = 0 then begin
- Result := '0';
- Exit end;
-
- while i > 0 do begin
- Result := Char(Byte('0') + (i mod 10)) + Result;
- i := i div 10;
- end;}
- Result := IntToStr(i);
-end;
-
-function CardOfStr(const S: string): Cardinal;
-var
- Res: Int64;
-begin
- Res := StrToInt64Def(S, -1);
- if Res > High(Cardinal) then
- Res := High(Cardinal)
- else if Res < 0 then
- Res := 0;
- Result := Cardinal(Res);
-end;
-
-function HexOrd(Hex: Char): THex;
-begin
- case Hex of
- '0'..'9':
- Result := Byte(Hex) - 48;
- 'A'..'F':
- Result := Byte(Hex) - 55;
- 'a'..'f':
- Result := Byte(Hex) - 87;
- else
- Result := 0;
- end;
-end;
-
-function ByteOfHex(Hex: THexByteStr): Byte;
-begin
- Result := (HexOrd(Hex[1]) shl 4) + HexOrd(Hex[2]);
-end;
-
-function DecOfHex(const Hex: string): string;
-begin
- Result := IntToStr(CardOfHex(Hex));
-end;
-
-function HexOfByte(b: Byte): THexByteStr;
-begin
- Result := HexChar[(b and $F0) shr 4]
- + HexChar[ b and $0F ];
-end;
-
-{function HexOfCard2(c: Cardinal): string;
-var
- Data: array[0..(1 shl 4) - 1] of Char;
- i: Integer;
-begin
- for i := 0 to (1 shl 4) - 1 do
- if i < 10 then
- Data[i] := Char(Ord('0') + i)
- else
- Data[i] := Char(Ord('A') + i - 10);
-
- Result := Data[(c and (((1 shl (1 shl 2)) - 1) shl (7 shl 2))) shr (7 shl 2)]
- + Data[(c and (((1 shl (1 shl 2)) - 1) shl (6 shl 2))) shr (6 shl 2)]
- + Data[(c and (((1 shl (1 shl 2)) - 1) shl (5 shl 2))) shr (5 shl 2)]
- + Data[(c and (((1 shl (1 shl 2)) - 1) shl (4 shl 2))) shr (4 shl 2)]
- + Data[(c and (((1 shl (1 shl 2)) - 1) shl (3 shl 2))) shr (3 shl 2)]
- + Data[(c and (((1 shl (1 shl 2)) - 1) shl (2 shl 2))) shr (2 shl 2)]
- + Data[(c and (((1 shl (1 shl 2)) - 1) shl (1 shl 2))) shr (1 shl 2)]
- + Data[(c and (((1 shl (1 shl 2)) - 1) shl (0 shl 2))) shr (0 shl 2)];
-end; }
-
-function HexOfCard(i: Cardinal): string;
-var
- a: Cardinal;
-begin
- Result := '';
- while i > 0 do begin
- a := i and $F;
- Result := HexChar[a] + Result;
- i := i shr 4;
- end;
-end;
-
-function HexOfCard(i: Cardinal; Digits: Integer): string;
-var
- a: Cardinal;
-begin
- Result := '';
- while i > 0 do begin
- a := i and $F;
- Result := HexChar[a] + Result;
- i := i shr 4;
- end;
- Result := MulStr('0', Digits - Length(Result)) + Result;
-end;
-
-function PascalHexArray(a: TByteA; Name: string): string;
-var
- i, len: Integer;
-begin
- Result := 'const' + EOL +
- ' ' + Name + ': array[0..' + IntToStr(High(a)) + '] of Byte = (';
-
- len := Length(a);
- for i := 0 to len-1 do begin
- if (i mod 19) = 0 then
- Result := Result + EOL + ' ' + ' ';
- Result := Result + '$' + HexOfByte(a[i]);
- if i < len-1 then
- Result := Result + ',';
- end;
- Result := Result + EOL + ' );';
-end;
-
-function HexOfByteA(a: TByteA; Blocks: Integer = 1;
- const Splitter: string = ' '): string;
-var
- i: Integer;
-begin
- Result := '';
-
- if Blocks > 0 then
- for i := 0 to High(a) do begin
- Result := Result + HexOfByte(a[i]);
- if i < High(a) then
- if ((i+1) mod Blocks) = 0 then
- Result := Result + Splitter;
- end
- else
- for i := 0 to High(a) do
- Result := Result + HexOfByte(a[i]);
-end;
-
-function BinOfByteA(a: TByteA; Blocks: Integer = 4;
- const Splitter: string = ' '): string;
-var
- i, max: Integer;
- Bit: Boolean;
-begin
- Result := '';
-
- if Blocks > 0 then begin
- max := 8 * (High(a)) + 7;
- for i := 0 to max do begin
- Bit := 7-(i mod 8) in TBitSet(a[i div 8]);
- Result := Result + Char(Byte('0') + Byte(Bit));
- if i < max then
- if ((i+1) mod Blocks) = 0 then
- Result := Result + Splitter;
- end;
- end else
- for i := 0 to High(a) do
- Result := Result + Char(Byte('0') + a[i] shr (i and 8));
-end;
-
-function CardOfHex(Hex: string): Cardinal;
-var
- i: Integer;
-begin
- Result := 0;
- Hex := Copy(ExtractChars(Hex, HexadecimalChars), 1, 8);
-
- for i := 1 to Length(Hex) do
- if Hex[i] <> '0' then
- Inc(Result, HexOrd(Hex[i]) shl ((Length(Hex) - i) shl 2));
-end;
-
-function IntOfBin(Bin: string): Cardinal;
-var
- i: Integer;
-begin
- Result := 0;
- Bin := Copy(ExtractChars(Bin, BinaryChars), 1, 32);
-
- for i := Length(Bin) downto 1 do
- if Bin[i] = '1' then
- Inc(Result, 1 shl (Length(Bin) - i));
-end;
-
-function BinOfInt(n: Cardinal): string;
-var
- a: Integer;
-begin
- if n = 0 then begin
- Result := '0';
- exit; end;
-
- Result := '';
- while n > 0 do begin
- a := n and 1;
- Result := Char(a + Byte('0')) + Result;
- n := n shr 1;
- end;
-end;
-
-function BinOfIntFill(n: Cardinal; MinCount: Integer = 8): string;
-var
- a: Integer;
-begin
- if n = 0 then begin
- Result := MulStr('0', MinCount);
- Exit; end;
-
- Result := '';
- while n > 0 do begin
- a := n and 1;
- Result := Char(a + Byte('0')) + Result;
- n := n shr 1;
- end;
- Result := MulStr('0', MinCount - Length(Result)) + Result;
-end;
-
-function BaseNOfInt(I: Cardinal; B: TBaseN): string;
-var
- a: Integer;
-begin
- if (B < 2) or (i = 0) then begin
- Result := '0';
- Exit; end;
-
- Result := '';
- while i > 0 do begin
- a := i mod B;
- Result := BaseNChar[a] + Result;
- i := i div B;
- end;
-end;
-
-function IntOfBaseN(V: string; B: TBaseN): Cardinal;
-var
- i: Integer;
- F: Cardinal;
- c: Byte;
-begin
- Result := 0;
- V := TrimAll(V);
- F := 1;
- for i := Length(V) downto 1 do begin
- c := Byte(UpCase(V[i]));
- case Char(c) of
- '0'..'9': c := c - 48;
- 'A'..'Z': c := c - 55;
- end;
- if c < B then
- Result := Result + Byte(c) * F;
- F := F * B;
- end;
-end;
-
-function KeepIn(i, Bottom, Top: Variant): Variant;
-begin
- Result := i;
- if Result > Top then
- Result := Top
- else if Result < Bottom then
- Result := Bottom;
-end;
-
-function InRange(Value, Bottom, Top: Variant): Boolean;
-begin
- Result := (Value >= Bottom) and (Value <= Top);
-end;
-
-function InStrictRange(Value, Bottom, Top: Variant): Boolean;
-begin
- Result := (Value > Bottom) and (Value < Top);
-end;
-
-function Min(const A, B: Integer): Integer;
-begin
- if A < B then
- Result := A
- else
- Result := B;
-end;
-
-function Min(const A: TIntA): Integer;
-var
- i: Integer;
-begin
- Result := 0;
- if Length(A) = 0 then
- Exit;
-
- Result := A[0];
- for i := 1 to High(A) do
- if A[i] < Result then
- Result := A[i];
-end;
-
-function Max(const A, B: Integer): Integer;
-begin
- if A > B then
- Result := A
- else
- Result := B;
-end;
-
-function Max(const A: TIntA): Integer;
-var
- i: Integer;
-begin
- Result := 0;
- if Length(A) = 0 then
- Exit;
-
- Result := A[0];
- for i := 1 to High(A) do
- if A[i] > Result then
- Result := A[i];
-end;
-
-function RangesOfStr(const S: string): TRanges;
-var
- SL: TStringList;
- r, b, t: string;
- i, p: Integer;
-
- function TryStrToCard(const S: string; out Value: Cardinal): Boolean;
- var
- E: Integer;
- begin
- Val(S, Value, E);
- Result := E = 0;
- end;
-
-begin
- Result := nil;
- SL := TStringList.Create;
- try
- Split(S, RangesSeparator, SL);
- SetLength(Result, SL.Count);
- for i := 0 to SL.Count-1 do begin
- r := SL[i];
- with Result[i] do begin
- p := CharPos(RangeInnerSeparator, r);
- Simple := p = 0; // no '-' found
- if Simple then begin
- if r = RangeInfinite then begin // * --> *-*
- Simple := False;
- Bottom := Low(Bottom);
- Top := High(Top);
- end else if not TryStrToCard(r, Value) then
- Break;
-
- end else begin
- TileStr(r, p, p, b, t);
-
- if b = RangeInfinite then
- Bottom := Low(Bottom)
- else if not TryStrToCard(b, Bottom) then
- Break;
-
- if t = RangeInfinite then
- Top := High(Top)
- else if not TryStrToCard(t, Top) then
- Break;
- if Bottom > Top then begin
- p := Bottom; Bottom := Top; Top := p;
- end;
- end;
- end;
- end;
-
- if i <> SL.Count then
- Result := nil;
-
- finally
- SL.Free;
- end;
-end;
-
-function InRanges(Ranges: TRanges; TestValue: Cardinal): Boolean;
-var
- i: Integer;
-begin
- Result := True;
-
- for i := 0 to High(Ranges) do
- with Ranges[i] do
- if Simple then begin
- if TestValue = Value then
- Exit;
- end else begin
- if InRange(TestValue, Bottom, Top) then
- Exit;
- end;
-
- Result := False;
-end;
-
-procedure WriteSL(Strings: TStrings; const Prefix: string = '';
- const Suffix: string = '');
-var
- i: Integer;
-begin
- for i := 0 to Strings.Count-1 do
- WriteLn(Prefix + Strings[i] + Suffix);
-end;
-
-function Success(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean;
-begin
- Result := (Res = ResultOnSuccess);
- LastSuccessRes := Res;
-end;
-
-function Failure(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean;
-begin
- Result := not Success(Res, ResultOnSuccess);
-end;
-
-function ExpandString(const S: string): string;
-var
- Len: Integer;
- P, Res: PChar;
-begin
- Result := '';
- P := PChar(S);
- Len := ExpandEnvironmentStrings(P, nil, 0);
- if Len = 0 then
- Exit;
-
- GetMem(Res, Len);
- ExpandEnvironmentStrings(P, Res, Len);
-
- Result := Res;
- FreeMem(Res, Len);
-end;
-
-function FindAll(Strings: TStrings; const Mask: string;
- ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile;
- FileReturn: TFileNameFunc = nil): Boolean;
-var
- Path, FileName: string;
-
- procedure ScanDir(const Path, FileName: string);
- var
- PSR: TSearchRec;
- Res: Integer;
-
- procedure Add(const S: string);
- begin
- if S <> '' then
- Strings.Add(S);
- end;
-
- begin
- Res := FindFirst(Path + FileName, Attributes, PSR);
- while Success(Res, 0) do begin
- if Assigned(FileReturn) then
- Add(FileReturn(Path + PSR.Name))
- else
- Add(Path + PSR.Name);
- Res := FindNext(PSR);
- end;
- FindClose(PSR);
- if not ScanSubDirs then
- Exit;
-
- Res := FindFirst(Path + '*', faDirectory, PSR);
- while Success(Res, 0) do begin
- if (PSR.Attr and faDirectory > 0)
- and (PSR.Name <> '.') and (PSR.Name <> '..') then
- ScanDir(Path + PSR.Name + '\', FileName);
- Res := FindNext(PSR);
- end;
- FindClose(PSR);
- end;
-
-begin
- Strings.Clear;
- Path := ExtractPath(Mask);
- FileName := ExtractFileName(Mask);
- ScanDir(Path, FileName);
- Result := Strings.Count > 0;
-end;
-
-function FindAllFirst(const Mask: string; ScanSubDirs: Boolean = True;
- Attributes: Integer = faFindEveryFile): string;
-var
- Path, FileName: string;
-
- function ScanDir(const Path, FileName: string): Boolean;
- var
- PSR: TSearchRec;
- Res: Integer;
- begin
- Result := False;
- if Success(FindFirst(Path + FileName, Attributes, PSR), 0) then begin
- FindAllFirst := Path + PSR.Name;
- Result := True;
- FindClose(PSR);
- Exit; end;
- if not ScanSubDirs then
- Exit;
-
- Res := FindFirst(Path + '*', faDirectory, PSR);
- while not Result and Success(Res, 0) do begin
- if (PSR.Attr and faDirectory > 0)
- and (PSR.Name <> '.') and (PSR.Name <> '..') then
- Result := ScanDir(Path + PSR.Name + '\', FileName);
- Res := FindNext(PSR);
- end;
- FindClose(PSR);
- end;
-begin
- Result := '';
- Path := ExtractPath(Mask);
- FileName := ExtractFileName(Mask);
- ScanDir(Path, FileName);
-end;
-
-procedure DeleteFiles(const Mask: string; ScanSubDirs: Boolean = True;
- Attributes: Integer = faFindEveryFile);
-var
- Path, FileName: string;
-
- procedure ScanDir(const Path, FileName: string);
- var
- PSR: TSearchRec;
- Res: Integer;
-
- procedure TryDeleteFile(const FileName: string);
- begin
- try
- DeleteFile(Path + PSR.Name);
- except
- end;
- end;
-
- begin
- Res := FindFirst(Path + FileName, Attributes, PSR);
- while Success(Res, 0) do begin
- TryDeleteFile(Path + PSR.Name);
- Res := FindNext(PSR);
- end;
- FindClose(PSR);
- if not ScanSubDirs then
- Exit;
-
- Res := FindFirst(Path + '*', faDirectory, PSR);
- while Success(Res, 0) do begin
- if (PSR.Attr and faDirectory > 0)
- and (PSR.Name <> '.') and (PSR.Name <> '..') then begin
- ScanDir(Path + PSR.Name + '\', FileName);
- TryDeleteFile(Path + PSR.Name);
- end;
- Res := FindNext(PSR);
- end;
- FindClose(PSR);
- end;
-begin
- Path := ExtractPath(Mask);
- FileName := ExtractFileName(Mask);
- ScanDir(Path, FileName);
-end;
-
-function GetFileNew(FileName: string; NoFloppyDrives: Boolean = True): string;
-var
- Drive: string;
- pf, pd, Len: Integer;
- PSR: TSearchRec;
-begin
- Result := '';
- FileName := Trim(FileName);
- if Length(FileName) < 2 then
- Exit;
-
- Drive := ExtractDrive(FileName);
- if not DirectoryExists(Drive) then
- Exit;
-
- if NoFloppyDrives and (Drive[1] in ['A', 'B']) then
- Exit;
-
- Len := Length(FileName);
- Result := Drive;
- pf := Length(Drive) + 1;
- while pf <= Len do begin
- if FileName[pf] = '\' then begin
- Result := Result + '\';
- Inc(pf);
- Continue; end;
-
- pd := CharPos('\', FileName, pf);
- if pd = 0 then begin
- if 0=FindFirst(Result + Copy(FileName, pf, MaxInt), faFindEveryFile, PSR) then begin
- Result := Result + PSR.Name;
- Break; end else begin
- FindClose(PSR);
- if 0=FindFirst(Result + Copy(FileName, pf, MaxInt), faDirectory, PSR) then
- Result := Result + PSR.Name + '\'
- else
- Result := '';
- FindClose(PSR);
- if Result = '' then
- Break;
- end;
- end;
-
- if 0=FindFirst(Result + Copy(FileName, pf, pd - pf), faDirectory, PSR) then
- Result := Result + PSR.Name + '\'
- else
- Result := '';
- FindClose(PSR);
- if Result = '' then
- Break;
-
- pf := pd + 1;
- end;
-
- if (Result <> '') and not FileEx(Result, True) then
- Result := '';
-end;
-
-function DateTimeOfFileTime(const FileTime: TFileTime): TDateTime;
-var
- LocalFileTime: TFileTime;
- Res: Integer;
-begin
- Result := 0;
-
- FileTimeToLocalFileTime(FileTime, LocalFileTime);
- if not FileTimeToDosDateTime(LocalFileTime, LongRec(Res).Hi,
- LongRec(Res).Lo) then
- Res := -1;
-
- if (Res = -1) or (Res = 0) then
- Exit;
- try
- Result := FileDateToDateTime(Res);
- except
- end;
-end;
-
-procedure FileNew(const FileName: string);
-var
- Handle: Integer;
-begin
- Handle := FileCreate(FileName);
- FileClose(Handle);
-end;
-
-function Win32PlatformStr: string;
-const
- PlatformStrings: array[VER_PLATFORM_WIN32s..VER_PLATFORM_WIN32_NT] of string =
- ('VER_PLATFORM_WIN32s', 'VER_PLATFORM_WIN32_WINDOWS', 'VER_PLATFORM_WIN32_NT');
-begin
- Result := PlatformStrings[Win32Platform];
-end;
-
-function FullOSInfo: string;
-begin
- Result := Format(
- 'Platform: %s' + EOL +
- 'Version: %d.%d Build %d' + EOL +
- 'CSD: %s',
- [
- Win32PlatformStr,
- Win32MajorVersion, Win32MinorVersion, Win32BuildNumber,
- Win32CSDVersion
- ]
- );
-end;
-
-function Win9x: Boolean;
-begin
- Result := Win32Platform = VER_PLATFORM_WIN32_WINDOWS;
-end;
-
-function WinNT: Boolean;
-begin
- Result := Win32Platform = VER_PLATFORM_WIN32_NT;
-end;
-
-function Win2000: Boolean;
-begin
- Result := (Win32Platform = VER_PLATFORM_WIN32_NT)
- and (Win32MajorVersion = 4);
-end;
-
-function WinXP: Boolean;
-begin
- Result := Win32MajorVersion >= 5;
-end;
-
-initialization
- MyDir := GetMyDir;
-
-end.
-
-unit FifoStream;
-
-interface
-
-uses Classes, windows, Dialogs;
-
-const
- DefaultChunksize = 32768; // 32kb per chunk as default.
-
-type
- PMemChunk = ^TMemChunk;
- TMemChunk = record
- Filled: Longword;
- Read: Longword;
- Data: pointer;
- end;
-
- TFifo = class
- private
- FBuffers: TList;
- FChunksize: Longword;
- FCritSect: TRTLCriticalSection;
- FIsWinNT: boolean;
- FBytesInFifo: LongWord;
- protected
- function GetBytesInFifo: LongWord;
- public
- constructor Create;
- destructor Destroy; override;
- procedure Write(Data: pointer; Size: LongWord);
- procedure Read(Buff: pointer; var ReqSize: LongWord);
- procedure PeekData(Buff: pointer; var ReqSize: LongWord);
- published
- property BytesInFifo: LongWord read FBytesInFifo;
- end;
-
-implementation
-
-constructor TFifo.Create;
-begin
- inherited;
- FBuffers := TList.Create;
- // set default chunksize...
- FChunksize := DefaultChunksize;
- InitializeCriticalSection(FCritSect);
-end;
-
-destructor TFifo.Destroy;
-var
- I: Integer;
-begin
- EnterCriticalSection(FCritSect);
- for I := 0 to FBuffers.count - 1 do
- begin
- FreeMem(PMemChunk(Fbuffers[I]).Data);
- Dispose(PMemChunk(Fbuffers[I]));
- end;
- FBuffers.Clear;
- FBuffers.Free;
- LeaveCriticalSection(FCritSect);
-
- DeleteCriticalSection(FCritSect);
- inherited;
-end;
-
-function TFifo.GetBytesInFifo: LongWord;
-begin
- Result := 0;
- if FBuffers.Count = 0 then
- begin
- exit;
- end
- else
- begin
- if FBuffers.Count > 1 then
- Inc(Result, (FBuffers.Count - 1) * FChunkSize);
- Inc(Result, PMemChunk(FBuffers[Fbuffers.Count - 1]).Filled);
- Dec(Result, PMemChunk(FBuffers[0]).Read);
- end;
-end;
-
-procedure TFifo.Write(Data: pointer; Size: LongWord);
-var
- Privpointer: pointer;
- PrivSize: LongWord;
- Chunk: PMemChunk;
- PosInChunk: pointer;
-begin
- if LongWord(Data) = 0 then
- begin
- // null pointer? somebody is trying to fool us, get out...
- Exit;
- end;
- EnterCriticalSection(FCritSect);
- PrivPointer := Data;
- PrivSize := 0;
- // are already buffers there?
- if FBuffers.count > 0 then
- begin
- // is the last one of them not completely filled?
- if PMemChunk(FBuffers[FBuffers.count - 1]).filled < FChunksize then
- // not completely filled, so fill up the buffer.
- begin
- Chunk := PMemChunk(FBuffers[FBuffers.count - 1]);
- // fetch chunkdata.
- PosInChunk := Chunk.Data;
- // move to current fill pos...
- Inc(LongWord(PosInChunk), Chunk.Filled);
- // can we fill the chunk completely?
- if Size > FChunksize - Chunk.Filled then
- begin
- // yes we can.
- Move(PrivPointer^, PosInChunk^, FChunksize - Chunk.Filled);
- Inc(PrivSize, FChunksize - Chunk.Filled);
- Inc(LongWord(PrivPointer), FChunksize - Chunk.Filled);
- Chunk.Filled := FChunkSize;
- end
- else
- // we have to less data for filling the chunk completely,
- // just put everything in.
- begin
- Move(PrivPointer^, PosInChunk^, Size);
- Inc(PrivSize, Size);
- Inc(Chunk.Filled, Size);
- end;
- end;
- end;
- // as long as we have remaining stuff put it into new chunks.
- while (PrivSize < Size) do
- begin
- new(Chunk);
- GetMem(Chunk.Data, FChunksize);
- Chunk.Read := 0;
- // can we fill an entire chunk with the remaining data?
- if Privsize + FChunksize < Size then
- begin
- // yes we can, so put the stuff in.
- Move(Privpointer^, Chunk.Data^, FChunksize);
- Inc(LongWord(PrivPointer), FChunksize);
- Inc(PrivSize, FChunksize);
- Chunk.Filled := FChunksize;
- end
- else // we have to less data to fill the entire chunk, just put the remaining stuff in.
- begin
- Move(Privpointer^, Chunk.Data^, Size - Privsize);
- Chunk.Filled := Size - Privsize;
- Inc(PrivSize, Size - Privsize);
- end;
- Fbuffers.Add(Chunk);
- end;
- if Size <> Privsize then
- Showmessage('miscalculation in TFifo.write');
- FBytesInFifo := GetBytesInFifo;
- LeaveCriticalSection(FCritSect);
-end;
-
-procedure TFifo.Read(Buff: pointer; var ReqSize: LongWord);
-var
- PrivSize: Integer;
- Privpos: pointer;
- Chunk: PMemChunk;
- ChunkPos: pointer;
-begin
- if LongWord(Buff) = 0 then
- begin
- // null pointer? somebody is trying to fool us, get out...
- Exit;
- end;
- EnterCriticalSection(FCritSect);
- PrivSize := 0;
- Privpos := Buff;
- while FBuffers.Count > 0 do
- begin
- Chunk := PMemChunk(FBuffers[0]);
- ChunkPos := Chunk.data;
- Inc(LongWord(ChunkPos), Chunk.Read);
- // does the remaining part of the chunk fit into the buffer?
- if PrivSize + (Chunk.Filled - Chunk.read) < ReqSize then
- begin // yep, it fits
- Move(ChunkPos^, Privpos^, Chunk.Filled - Chunk.read);
- Inc(PrivSize, Chunk.Filled - Chunk.read);
- FreeMem(Chunk.Data);
- Dispose(Chunk);
- FBuffers.Delete(0);
- end
- else // remaining part didn't fit, get as much as we can and increment the
- // read attribute.
- begin
- Move(ChunkPos^, Privpos^, ReqSize - PrivSize);
- Inc(Chunk.read, ReqSize - PrivSize);
- Inc(PrivSize, ReqSize - PrivSize);
- // as we filled the buffer, we'll have to break here.
- break;
- end;
- end;
- FBytesInFifo := GetBytesInFifo;
- LeaveCriticalSection(FCritSect);
- ReqSize := PrivSize;
-end;
-
-// read Data from Stream without removing it from the Stream...
-
-procedure TFifo.PeekData(Buff: pointer; var ReqSize: LongWord);
-var
- PrivSize: Integer;
- Privpos: pointer;
- Chunk: PMemChunk;
- ChunkPos: pointer;
- ChunkNr: Integer;
-begin
- if LongWord(Buff) = 0 then
- begin
- // null pointer? somebody is trying to fool us, get out...
- Exit;
- end;
- EnterCriticalSection(FCritSect);
- PrivSize := 0;
- Privpos := Buff;
- ChunkNr := 0;
- while FBuffers.Count > ChunkNr do
- begin
- Chunk := PMemChunk(FBuffers[ChunkNr]);
- ChunkPos := Chunk.data;
- Inc(LongWord(ChunkPos), Chunk.Read);
- // does the remaining part of the chunk fit into the buffer?
- if PrivSize + (Chunk.Filled - Chunk.read) < ReqSize then
- begin // yep, it fits
- Move(ChunkPos^, Privpos^, Chunk.Filled - Chunk.read);
- Inc(PrivSize, Chunk.Filled - Chunk.read);
- Inc(ChunkNr);
- end
- else // remaining part didn't fit, get as much as we can and increment the
- // read attribute.
- begin
- Move(ChunkPos^, Privpos^, ReqSize - PrivSize);
- Inc(PrivSize, ReqSize - PrivSize);
- // as we filled the buffer, we'll have to break here.
- break;
- end;
- end;
- LeaveCriticalSection(FCritSect);
- ReqSize := PrivSize;
-end;
-
-end.
diff --git a/tests/examplefiles/example.pcmk b/tests/examplefiles/example.pcmk
deleted file mode 100644
index 22cc60e4..00000000
--- a/tests/examplefiles/example.pcmk
+++ /dev/null
@@ -1,115 +0,0 @@
-node 167906355: sle12-a
-node 167906357: sle12-c \
- description="The second node" \
- utilization memory=64
-node node1 \
- attributes mem=16G
-node node2 utilization cpu=4
-primitive st stonith:ssh \
- params hostlist="node1 node2" \
- meta target-role="Started" \
- op start requires=nothing timeout=60s \
- op monitor interval=60m timeout=60s
-primitive d1 ocf:pacemaker:Dummy \
- operations $id=d1-ops \
- op monitor interval=60m \
- op monitor interval=120m OCF_CHECK_LEVEL=10
-primitive fs1 Filesystem \
- params device="/dev/nfs-vg/fs1" directory="/srv/nfs" fstype=ext3 \
- op monitor interval=10s
-primitive nfs-server nfsserver \
- params nfs_shared_infodir="/srv/nfs/state" nfs_ip=10.2.12.100 \
- op monitor interval=0 trace_ra=1
-primitive nfs-vg LVM \
- params volgrpname=nfs-vg
-primitive p_drbd_nfs ocf:linbit:drbd \
- params drbd_resource=nfs \
- op monitor interval=15 role=Master \
- op monitor interval=30 role=Slave \
- op start interval=0 timeout=300 \
- op stop interval=0 timeout=120
-primitive s-libvirt stonith:external/libvirt \
- params hostlist="sle12-a sle12-c" hypervisor_uri="qemu+ssh://hex-10.suse.de/system?keyfile=/root/.ssh/xen" reset_method=reboot \
- op monitor interval=5m timeout=60s
-primitive virtual-ip IPaddr2 \
- params ip=10.2.12.100
-primitive xen0 @vm_scheme1 xmfile=/etc/xen/vm/xen0
-primitive d7 Dummy \
- params rule inf: #uname eq node1 fake=1 \
- params rule inf: #uname eq node2 fake=2
-primitive very-primitive Dummy \
- params 3: rule #uname eq node1 interface=eth1 \
- params 2: rule #uname string:eq node2 interface=eth2 port=8888 \
- params 1: interface=eth0 port=9999 \
- operations $id-ref=those_other_ops
-fencing_topology poison-pill power
-fencing_topology \
- node-a: poison-pill power \
- node-b: ipmi serial
-role nfs_admin \
- write meta:nfs-server:target-role \
- write meta:nfs-server:is-managed \
- write location:nfs-server \
- read ref:nfs-server
-role basic-read \
- read status \
- read type:node attribute:uname \
- read type:node attribute:type \
- read property
-role basic-read-basic \
- read cib
-role d0-admin \
- write meta:d0:target-role \
- write meta:d0:is-managed \
- read xpath:"//nodes//attributes" \
- read ref:d0
-acl_target joe \
- nfs_admin
-tag nfs: nfs-server nfs-vg
-group nfs-disk nfs-vg fs1
-group nfs-srv virtual-ip nfs-server
-ms ms_drbd_nfs p_drbd_nfs \
- meta notify=true clone-max=2
-location nfs-pref virtual-ip 100: sle12-a
-location l1 nfs-srv 100: node1
-location l2 d1 \
- rule 100: #uname eq node1
-location l3 d1 \
- rule inf: #uname eq node1 and pingd gt 0
-location l4 d1 \
- rule -inf: not_defined pingd or pingd lte 0
-location l5 fs1 \
- rule -inf: not_defined pingd or pingd lte 0 \
- rule #uname eq node1 and pingd gt 0 \
- rule date lt 2009-05-26 and date in start=2009-05-26 end=2009-07-26 and date in start=2009-05-26 years=2009 and date spec years=2009 hours=09-17
-location l6 d1 \
- rule $id-ref=l2-rule1
-location l7 d1 \
- rule $id-ref=l2
-colocation c-nfs inf: nfs-server fs1
-colocation vg-with-drbd inf: nfs-vg ms_drbd_nfs:Master
-# drbd device is the nfs-vg PV
-order drbd-before-vg inf: ms_drbd_nfs:promote nfs-vg:start
-# need fs1 for the NFS server
-order o-nfs inf: fs1 nfs-server
-rsc_ticket ticket-A_m6 ticket-A: d1
-rsc_ticket ticket-B_m6_m5 ticket-B: d1 d7 loss-policy=fence
-rsc_ticket ticket-C_master ticket-C: d1 ms_drbd_nfs:Master loss-policy=fence
-property cpset2: \
- maintenance-mode=true
-property cib-bootstrap-options: \
- dc-version=1.1.12-ad083a8 \
- cluster-infrastructure=corosync \
- cluster-name=sle12-test3l-public \
- no-quorum-policy=ignore \
- startup-fencing=false \
- last-lrm-refresh=1415877622 \
- maintenance-mode=false
-op_defaults op-options: \
- timeout=120s
-rsc_defaults rsc-options: \
- failure-timeout=10m
-op_defaults opsdef2: \
- rule 100: #uname eq node1 \
- record-pending=true
-tag t1: d1 d7 opsdef2
diff --git a/tests/examplefiles/example.pony b/tests/examplefiles/example.pony
deleted file mode 100644
index 654f2376..00000000
--- a/tests/examplefiles/example.pony
+++ /dev/null
@@ -1,18 +0,0 @@
-use "somepkg"
-
-/*
- /* Nested */
-*/
-
-class trn Foo[A: Stringable ref] is Stringable
- let _x = "\""
-
- fun val dofoo() =>
- """
- DocString
- """
- (U64(2), "foo")._2
-
-actor Main
- new create(env: Env) =>
- env.out.print("Hello world")
diff --git a/tests/examplefiles/example.pp b/tests/examplefiles/example.pp
deleted file mode 100644
index ea697be2..00000000
--- a/tests/examplefiles/example.pp
+++ /dev/null
@@ -1,8 +0,0 @@
-exec { 'grep':
- command => 'grep "\'" -rI *',
- path => '/bin:/usr/bin',
-}
-
-node default {
- notify {"Hello World":;}
-}
diff --git a/tests/examplefiles/example.praat b/tests/examplefiles/example.praat
deleted file mode 100644
index 85573919..00000000
--- a/tests/examplefiles/example.praat
+++ /dev/null
@@ -1,280 +0,0 @@
-form Highlighter test
- sentence Blank
- sentence My_sentence This should all be a string
- text My_text This should also all be a string
- word My_word Only the first word is a string, the rest is discarded
- boolean Binary 1
- boolean Text no
- boolean Quoted "yes"
- comment This should be a string
- optionmenu Choice: 1
- option Foo
- option Bar
- option 100
- real left_Range -123.6
- positive right_Range_max 3.3
- integer Int 4
- natural Nat 4
-endform
-
-# Periods do not establish boundaries for keywords
-form.var = 10
-# Or operators
-not.an.operator$ = "Bad variable name"
-bad.or.not = 1
-
-# External scripts
-include /path/to/file
-runScript: "/path/to/file"
-execute /path/to/file
-
-# Predefined variables
-a = praatVersion
-a = e
-a = pi
-a$ = homeDirectory$ + tab$ + newline$
-a$ = temporaryDirectory$
-a$ = praatVersion$
-a$ = shellDirectory$
-a$ = homeDirectory$
-a$ = preferencesDirectory$
-a$ = defaultDirectory$
-nocheck selectObject: undefined
-
-# Arrays are not comments
-a# = zero# (5, 6)
-a [3], 5 = 7
-printline 'a[3,5]', 'a[3]'
-a [1] = 2
-b [a [1]] = 3
-assert b [a [1]] = 3
-printline 'b[2]'
-
-# if-block with built-in variables
-if windows
- # We are on Windows
-elsif unix = 1 or !macintosh
- exitScript: "We are on Linux"
-else macintosh == 1
- exit We are on Mac
-endif
-
-string$ = "Strings can be 'interpolated'"
-string$ = "But don't interpolate everything!"
-string$(10)
-
-repeat
- string$ = string$ - right$(string$)
-until !length(string$)
-
-Text... 1 Right 0.2 Half many----hyphens
-Text... 1 Right -0.4 Bottom aحبيبa
-Text... 1 Right -0.6 Bottom 日本
-Draw circle (mm)... 0.5 0.5 i
-
-rows = Object_'table'.nrow
-value$ = Table_'table'$[25, "f0"]
-fixed = Sound_10.xmin
-fixed = Object_foo.xmin
-fixed = Procrustes_foo.nx
-
-# old-style procedure call
-call oldStyle "quoted" 2 unquoted string
-assert oldStyle.local = 1
-
-# New-style procedure call with parens
-@newStyle("quoted", 2, "quoted string")
-if praatVersion >= 5364
- # New-style procedure call with colon
- @newStyle: "quoted", 2, "quoted string"
-endif
-
-# inline if with inline comment
-var = if macintosh = 1 then 0 else 1 fi ; This is an inline comment
-
-# for-loop with explicit from using local variable
-# and paren-style function calls and variable interpolation
-n = numberOfSelected("Sound")
-for i from newStyle.local to n
- name = selected$(extractWord$(selected$(), " "))
- sound'i' = selected("Sound", i+(a*b))
- sound[i] = sound'i'
-endfor
-
-i = 1
-while i < n
- i++
- # Different styles of object selection
- select sound'i'
- sound = selected()
- sound$ = selected$("Sound")
- select Sound 'sound$'
- selectObject( sound[i])
- selectObject: sound
-
- # Pause commands
- beginPause("Viewing " + sound$)
- if i > 1
- button = endPause("Stop", "Previous",
- ...if i = total_sounds then "Finish" else "Next" fi,
- ...3, 1)
- else
- button = endPause("Stop",
- ...if i = total_sounds then "Finish" else "Next" fi,
- ...2, 1)
- endif
- editor_name$ = if total_textgrids then "TextGrid " else "Sound " fi + name$
- nocheck editor Sound 'editor_name$'
- nocheck Close
- nocheck endeditor
- editor_id = editor: editor_name$
- Close
- endeditor
-
- # New-style standalone command call
- Rename: "SomeName"
-
- # Command call with assignment
- duration = Get total duration
-
- # Multi-line command with modifier
- pitch = noprogress To Pitch (ac): 0, 75, 15, "no",
- ...0.03, 0.45, 0.01, 0.35, 0.14, 600
- # Formulas are strings
- Formula: "if col = 1 then row * Object_'pitch'.dx + 'first' else self fi"
-
- # do-style command with assignment
- minimum = do("Get minimum...", 0, 0, "Hertz", "Parabolic")
-
- # New-style multi-line command call with broken strings
- table = Create Table with column names: "table", 0,
- ..."file subject speaker
- ... f0 f1 f2 f" + string$(3) + " " +
- ..."duration response"
-
- # Function call with trailing space
- removeObject: pitch, table
-
- # Picture window commands
- selectObject: sound
- # do-style command
- do("Select inner viewport...", 1, 6, 0.5, 1.5)
- Black
- Draw... 0 0 0 0 "no" Curve
- Draw inner box
- Text bottom: "yes", sound$
- Erase all
-
- # Demo window commands
- demo Erase all
- demo Select inner viewport... 0 100 0 100
- demo Axes... 0 100 0 100
- demo Paint rectangle... white 0 100 0 100
- demo Text... 50 centre 50 half Click to finish
- demoWaitForInput ( )
- demo Erase all
- demo Text: 50, "centre", 50, "half", "Finished"
-endwhile
-
-switch$ = if switch == 1 then "a" else
- ... if switch == 2 then "b" else
- ... if switch == 3 then "c" else
- ... if switch == 4 then "d" else
- ... "default" fi fi fi fi
-
-# An old-style sendpraat block
-# All these lines should be a string!
-sendpraat Praat
- ...'newline$' Create Sound as pure tone... "tone" 1 0 0.4 44100 440 0.2 0.01 0.01
- ...'newline$' Play
- ...'newline$' Remove
-
-# A new-style sendpraat block
-beginSendPraat: "Praat"
- Create Sound as pure tone: "tone", 1, 0, 0.4, 44100, 440, 0.2, 0.01, 0.01
- duration = Get total duration
- Remove
-endSendPraat: "duration"
-appendInfoLine: "The generated sound lasted for ", duration, "seconds"
-
-# Number types
-a = 10%
-a = -10
-a = +10
-a = 10.4
-a = 294e12
-a = 2.94e12
-
-# Operators
-a = 2 ^ -6
-a = -(1+1)^6
-a = 4^3 ^ 2
-a = 54 div 5.1
-a = 54.3 mod 5
-a = 3 ** 8 - 7
-a = 3 / (8 + 7)
-a = (7 * (3 + 5)) / ((2 + 3) - 1)
-
-# Logical operators
-assert (a = b) and c
-assert a == (b or c)
-assert a <= b not c
-assert a >= b !c
-assert a != b & c
-assert a != b && c
-assert a <> b || c
-assert a < b | c
-assert a > b
-
-assert (a)or (b)
-assert (a) or(b)
-assert (a)and(b)
-
-assert "hello" = "he" + "llo"
-assert "hello" == "hello world" - " world"
-
-stopwatch
-time = stopwatch
-clearinfo
-echo This script took
-print 'time' seconds to
-printline execute.
-
-# Old-style procedure declaration
-procedure oldStyle .str1$ .num .str2$
- .local = 1
-endproc
-
-# New-style procedure declaration with parentheses
-procedure newStyle (.str1$, .num, .str2$)
- # Command with "local" variable
- .local = Get total duration
- .local = Get 'some' duration
- .local = Get 'some[1]' value... hello 10 p[i]
- .local = Get 'some[1,3]' value: "hello", 10, 'p[i]'
- .local = Get 'some$' duration
- .local = Get 'some$[1]' duration
-endproc
-
-# New-style procedure declaration with colon
-procedure _new_style: .str1$, .num, .str2$
- # Command with "local" variable
- # Initial underscores in variables not allowed (unless interpolated)
- _new_style.local = Get total duration
-endproc
-
-asserterror Unknown symbol:'newline$'« _
-assert '_new_style.local'
-
-@proc: a, selected("string"), b
-# Comment
-
-for i to saveSelection.n
- selectObject: saveSelection.id[i]
- appendInfoLine: selected$()
-endfor
-
-@ok(if selected$("Sound") = "tone" then 1 else 0 fi,
- ... "selected sound is tone")
-
-@ok_formula("selected$(""Sound"") = ""tone""", "selected sound is tone")
diff --git a/tests/examplefiles/example.prg b/tests/examplefiles/example.prg
deleted file mode 100644
index b70d9e42..00000000
--- a/tests/examplefiles/example.prg
+++ /dev/null
@@ -1,161 +0,0 @@
-&& This is a concatenation of all VFP examples on Wikipedia.
-&& Copyright 2013 Wikimedia, under the GFDL.
-
-FOR i = 1 to 10
- x = x + 6.5
-ENDFOR
-
-IF i = 25
- i = i + 1
-ELSE
- i = i + 3
-ENDIF
-
-x = 1
-DO WHILE x < 50
- x = x + 1
-ENDDO
-
-x = 1
-DO WHILE .T.
- x = x + 1
- IF x < 50
- LOOP
- ELSE
- EXIT
- ENDIF
-ENDDO
-
-nMonth = MONTH(DATE())
-DO CASE
- CASE nMonth <= 3
- MESSAGEBOX("Q1")
-
- CASE nMonth <= 6
- MESSAGEBOX("Q2")
-
- CASE nMonth <= 9
- MESSAGEBOX("Q3")
-
- OTHERWISE
- MESSAGEBOX("Q4")
-ENDCASE
-
-FOR EACH oControl IN THISFORM.Controls
- MESSAGEBOX(oControl.Name)
-ENDFOR
-
-f = Factorial(10)
-
-FUNCTION Factorial(n)
- LOCAL i,r
- r = 1
- FOR i = n TO 1 STEP -1
- r = r * n
- ENDFOR
- RETURN r
-ENDFUNC
-
-loForm = CREATEOBJECT("HiForm")
-loForm.Show(1)
-
-DEFINE CLASS HiForm AS Form
- AutoCenter = .T.
- Caption = "Hello, World"
-
- ADD OBJECT lblHi as Label WITH ;
- Caption = "Hello, World!"
-ENDDEFINE
-
-loMine = CREATEOBJECT("MyClass")
-? loMine.cProp1 && This will work. (Double-ampersand marks an end-of-line comment)
-? loMine.cProp2 && Program Error: Property CPROP2 is not found.
-
-? loMine.MyMethod1() && This will work.
-? loMine.MyMethod2() && Program Error: Property MYMETHOD2 is not found.
-
-DEFINE CLASS MyClass AS Custom
- cProp1 = "My Property" && This is a public property
- HIDDEN cProp2 && This is a private (hidden) property
- dProp3 = {} && Another public property
-
- PROCEDURE Init() && Class constructor
- This.cProp2 = "This is a hidden property."
- ENDPROC
-
- PROCEDURE dProp3_Access && Property Getter
- RETURN DATE()
- ENDPROC
- PROCEDURE dProp3_Assign(vNewVal) && Property Setter
- IF VARTYPE(vNewVal) = "D"
- THIS.dProp3 = vNewVal
- ENDIF
- ENDPROC
-
- PROCEDURE MyMethod1()
- * This is a public method, calling a hidden method that returns
- * the value of a hidden property.
- RETURN This.MyMethod2()
- ENDPROC
-
- HIDDEN PROCEDURE MyMethod2() && This is a private (hidden) method
- RETURN This.cProp2
- ENDPROC
-ENDDEFINE
-
-&& Create a table
-CREATE TABLE randData (iData I)
-
-&& Populate with random data using xBase and SQL DML commands
-FOR i = 1 TO 50
- APPEND BLANK
- REPLACE iData WITH (RAND() * 100)
-
- INSERT INTO randData (iData) VALUES (RAND() * 100)
-ENDFOR
-
-&& Place a structural index on the data
-INDEX ON iData TAG iData
-CLOSE ALL
-
-&& Display ordered data using xBase-style commands
-USE randData
-SET ORDER TO iData
-GO TOP
-LIST NEXT 10 && First 10
-GO BOTTOM
-SKIP -10
-LIST REST && Last 10
-CLOSE ALL
-
-&& Browse ordered data using SQL DML commands
-SELECT * ;
- FROM randData ;
- ORDER BY iData DESCENDING
-
-
-&& Connect to an ODBC data source
-LOCAL nHnd
-nHnd = SQLCONNECT ("ODBCDSN", "user", "pwd")
-
-&& Execute a SQL command
-LOCAL nResult
-nResult = SQLEXEC (nHnd, "USE master")
-IF nResult < 0
- MESSAGEBOX ("MASTER database does not exist!")
- RETURN
-ENDIF
-
-&& Retrieve data from the remote server and stores it in
-&& a local data cursor
-nResult = SQLEXEC (nHnd, "SELECT * FROM authors", "QAUTHORS")
-
-&& Update a record in a remote table using parameters
-PRIVATE cAuthorID, cAuthorName
-cAuthorID = "1001"
-cAuthorName = "New name"
-nResult = SQLEXEC (nHnd, "UPDATE authors SET auth_name = ?cAuthorName WHERE auth_id = ?cAuthorID")
-
-&& Close the connection
-SQLDISCONNECT(nHnd)
-
diff --git a/tests/examplefiles/example.rb b/tests/examplefiles/example.rb
deleted file mode 100644
index 93f8dc2b..00000000
--- a/tests/examplefiles/example.rb
+++ /dev/null
@@ -1,1852 +0,0 @@
-module CodeRay
- module Scanners
-
-class Ruby < Scanner
-
- RESERVED_WORDS = [
- 'and', 'def', 'end', 'in', 'or', 'unless', 'begin',
- 'defined?', 'ensure', 'module', 'redo', 'super', 'until',
- 'BEGIN', 'break', 'do', 'next', 'rescue', 'then',
- 'when', 'END', 'case', 'else', 'for', 'retry',
- 'while', 'alias', 'class', 'elsif', 'if', 'not', 'return',
- 'undef', 'yield',
- ]
-
- DEF_KEYWORDS = ['def']
- MODULE_KEYWORDS = ['class', 'module']
- DEF_NEW_STATE = WordList.new(:initial).
- add(DEF_KEYWORDS, :def_expected).
- add(MODULE_KEYWORDS, :module_expected)
-
- WORDS_ALLOWING_REGEXP = [
- 'and', 'or', 'not', 'while', 'until', 'unless', 'if', 'elsif', 'when'
- ]
- REGEXP_ALLOWED = WordList.new(false).
- add(WORDS_ALLOWING_REGEXP, :set)
-
- PREDEFINED_CONSTANTS = [
- 'nil', 'true', 'false', 'self',
- 'DATA', 'ARGV', 'ARGF', '__FILE__', '__LINE__',
- ]
-
- IDENT_KIND = WordList.new(:ident).
- add(RESERVED_WORDS, :reserved).
- add(PREDEFINED_CONSTANTS, :pre_constant)
-
- METHOD_NAME = / #{IDENT} [?!]? /xo
- METHOD_NAME_EX = /
- #{METHOD_NAME} # common methods: split, foo=, empty?, gsub!
- | \*\*? # multiplication and power
- | [-+~]@? # plus, minus
- | [\/%&|^`] # division, modulo or format strings, &and, |or, ^xor, `system`
- | \[\]=? # array getter and setter
- | <=?>? | >=? # comparison, rocket operator
- | << | >> # append or shift left, shift right
- | ===? # simple equality and case equality
- /ox
- GLOBAL_VARIABLE = / \$ (?: #{IDENT} | \d+ | [~&+`'=\/,;_.<>!@0$?*":F\\] | -[a-zA-Z_0-9] ) /ox
-
- DOUBLEQ = / " [^"\#\\]* (?: (?: \#\{.*?\} | \#(?:$")? | \\. ) [^"\#\\]* )* "? /ox
- SINGLEQ = / ' [^'\\]* (?: \\. [^'\\]* )* '? /ox
- STRING = / #{SINGLEQ} | #{DOUBLEQ} /ox
- SHELL = / ` [^`\#\\]* (?: (?: \#\{.*?\} | \#(?:$`)? | \\. ) [^`\#\\]* )* `? /ox
- REGEXP = / \/ [^\/\#\\]* (?: (?: \#\{.*?\} | \#(?:$\/)? | \\. ) [^\/\#\\]* )* \/? /ox
-
- DECIMAL = /\d+(?:_\d+)*/ # doesn't recognize 09 as octal error
- OCTAL = /0_?[0-7]+(?:_[0-7]+)*/
- HEXADECIMAL = /0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*/
- BINARY = /0b[01]+(?:_[01]+)*/
-
- EXPONENT = / [eE] [+-]? #{DECIMAL} /ox
- FLOAT = / #{DECIMAL} (?: #{EXPONENT} | \. #{DECIMAL} #{EXPONENT}? ) /
- INTEGER = /#{OCTAL}|#{HEXADECIMAL}|#{BINARY}|#{DECIMAL}/
-
- def reset
- super
- @regexp_allowed = false
- end
-
- def next_token
- return if @scanner.eos?
-
- kind = :error
- if @scanner.scan(/\s+/) # in every state
- kind = :space
- @regexp_allowed = :set if @regexp_allowed or @scanner.matched.index(?\n) # delayed flag setting
-
- elsif @state == :def_expected
- if @scanner.scan(/ (?: (?:#{IDENT}(?:\.|::))* | (?:@@?|$)? #{IDENT}(?:\.|::) ) #{METHOD_NAME_EX} /ox)
- kind = :method
- @state = :initial
- else
- @scanner.getch
- end
- @state = :initial
-
- elsif @state == :module_expected
- if @scanner.scan(/<</)
- kind = :operator
- else
- if @scanner.scan(/ (?: #{IDENT} (?:\.|::))* #{IDENT} /ox)
- kind = :method
- else
- @scanner.getch
- end
- @state = :initial
- end
-
- elsif # state == :initial
- # IDENTIFIERS, KEYWORDS
- if @scanner.scan(GLOBAL_VARIABLE)
- kind = :global_variable
- elsif @scanner.scan(/ @@ #{IDENT} /ox)
- kind = :class_variable
- elsif @scanner.scan(/ @ #{IDENT} /ox)
- kind = :instance_variable
- elsif @scanner.scan(/ __END__\n ( (?!\#CODE\#) .* )? | \#[^\n]* | =begin(?=\s).*? \n=end(?=\s|\z)(?:[^\n]*)? /mx)
- kind = :comment
- elsif @scanner.scan(METHOD_NAME)
- if @last_token_dot
- kind = :ident
- else
- matched = @scanner.matched
- kind = IDENT_KIND[matched]
- if kind == :ident and matched =~ /^[A-Z]/
- kind = :constant
- elsif kind == :reserved
- @state = DEF_NEW_STATE[matched]
- @regexp_allowed = REGEXP_ALLOWED[matched]
- end
- end
-
- elsif @scanner.scan(STRING)
- kind = :string
- elsif @scanner.scan(SHELL)
- kind = :shell
- elsif @scanner.scan(/<<
- (?:
- ([a-zA-Z_0-9]+)
- (?: .*? ^\1$ | .* )
- |
- -([a-zA-Z_0-9]+)
- (?: .*? ^\s*\2$ | .* )
- |
- (["\'`]) (.+?) \3
- (?: .*? ^\4$ | .* )
- |
- - (["\'`]) (.+?) \5
- (?: .*? ^\s*\6$ | .* )
- )
- /mxo)
- kind = :string
- elsif @scanner.scan(/\//) and @regexp_allowed
- @scanner.unscan
- @scanner.scan(REGEXP)
- kind = :regexp
-/%(?:[Qqxrw](?:\([^)#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^)#\\\\]*)*\)?|\[[^\]#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^\]#\\\\]*)*\]?|\{[^}#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^}#\\\\]*)*\}?|<[^>#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^>#\\\\]*)*>?|([^a-zA-Z\\\\])(?:(?!\1)[^#\\\\])*(?:(?:#\{.*?\}|#|\\\\.)(?:(?!\1)[^#\\\\])*)*\1?)|\([^)#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^)#\\\\]*)*\)?|\[[^\]#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^\]#\\\\]*)*\]?|\{[^}#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^}#\\\\]*)*\}?|<[^>#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^>#\\\\]*)*>?|([^a-zA-Z\s\\\\])(?:(?!\2)[^#\\\\])*(?:(?:#\{.*?\}|#|\\\\.)(?:(?!\2)[^#\\\\])*)*\2?|\\\\[^#\\\\]*(?:(?:#\{.*?\}|#)[^#\\\\]*)*\\\\?)/
- elsif @scanner.scan(/:(?:#{GLOBAL_VARIABLE}|#{METHOD_NAME_EX}|#{STRING})/ox)
- kind = :symbol
- elsif @scanner.scan(/
- \? (?:
- [^\s\\]
- |
- \\ (?:M-\\C-|C-\\M-|M-\\c|c\\M-|c|C-|M-))? (?: \\ (?: . | [0-7]{3} | x[0-9A-Fa-f][0-9A-Fa-f] )
- )
- /mox)
- kind = :integer
-
- elsif @scanner.scan(/ [-+*\/%=<>;,|&!()\[\]{}~?] | \.\.?\.? | ::? /x)
- kind = :operator
- @regexp_allowed = :set if @scanner.matched[-1,1] =~ /[~=!<>|&^,\(\[+\-\/\*%]\z/
- elsif @scanner.scan(FLOAT)
- kind = :float
- elsif @scanner.scan(INTEGER)
- kind = :integer
- else
- @scanner.getch
- end
- end
-
- token = Token.new @scanner.matched, kind
-
- if kind == :regexp
- token.text << @scanner.scan(/[eimnosux]*/)
- end
-
- @regexp_allowed = (@regexp_allowed == :set) # delayed flag setting
-
- token
- end
-end
-
-register Ruby, 'ruby', 'rb'
-
- end
-end
-class Set
- include Enumerable
-
- # Creates a new set containing the given objects.
- def self.[](*ary)
- new(ary)
- end
-
- # Creates a new set containing the elements of the given enumerable
- # object.
- #
- # If a block is given, the elements of enum are preprocessed by the
- # given block.
- def initialize(enum = nil, &block) # :yields: o
- @hash ||= Hash.new
-
- enum.nil? and return
-
- if block
- enum.each { |o| add(block[o]) }
- else
- merge(enum)
- end
- end
-
- # Copy internal hash.
- def initialize_copy(orig)
- @hash = orig.instance_eval{@hash}.dup
- end
-
- # Returns the number of elements.
- def size
- @hash.size
- end
- alias length size
-
- # Returns true if the set contains no elements.
- def empty?
- @hash.empty?
- end
-
- # Removes all elements and returns self.
- def clear
- @hash.clear
- self
- end
-
- # Replaces the contents of the set with the contents of the given
- # enumerable object and returns self.
- def replace(enum)
- if enum.class == self.class
- @hash.replace(enum.instance_eval { @hash })
- else
- enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
- clear
- enum.each { |o| add(o) }
- end
-
- self
- end
-
- # Converts the set to an array. The order of elements is uncertain.
- def to_a
- @hash.keys
- end
-
- def flatten_merge(set, seen = Set.new)
- set.each { |e|
- if e.is_a?(Set)
- if seen.include?(e_id = e.object_id)
- raise ArgumentError, "tried to flatten recursive Set"
- end
-
- seen.add(e_id)
- flatten_merge(e, seen)
- seen.delete(e_id)
- else
- add(e)
- end
- }
-
- self
- end
- protected :flatten_merge
-
- # Returns a new set that is a copy of the set, flattening each
- # containing set recursively.
- def flatten
- self.class.new.flatten_merge(self)
- end
-
- # Equivalent to Set#flatten, but replaces the receiver with the
- # result in place. Returns nil if no modifications were made.
- def flatten!
- if detect { |e| e.is_a?(Set) }
- replace(flatten())
- else
- nil
- end
- end
-
- # Returns true if the set contains the given object.
- def include?(o)
- @hash.include?(o)
- end
- alias member? include?
-
- # Returns true if the set is a superset of the given set.
- def superset?(set)
- set.is_a?(Set) or raise ArgumentError, "value must be a set"
- return false if size < set.size
- set.all? { |o| include?(o) }
- end
-
- # Returns true if the set is a proper superset of the given set.
- def proper_superset?(set)
- set.is_a?(Set) or raise ArgumentError, "value must be a set"
- return false if size <= set.size
- set.all? { |o| include?(o) }
- end
-
- # Returns true if the set is a subset of the given set.
- def subset?(set)
- set.is_a?(Set) or raise ArgumentError, "value must be a set"
- return false if set.size < size
- all? { |o| set.include?(o) }
- end
-
- # Returns true if the set is a proper subset of the given set.
- def proper_subset?(set)
- set.is_a?(Set) or raise ArgumentError, "value must be a set"
- return false if set.size <= size
- all? { |o| set.include?(o) }
- end
-
- # Calls the given block once for each element in the set, passing
- # the element as parameter.
- def each
- @hash.each_key { |o| yield(o) }
- self
- end
-
- # Adds the given object to the set and returns self. Use +merge+ to
- # add several elements at once.
- def add(o)
- @hash[o] = true
- self
- end
- alias << add
-
- # Adds the given object to the set and returns self. If the
- # object is already in the set, returns nil.
- def add?(o)
- if include?(o)
- nil
- else
- add(o)
- end
- end
-
- # Deletes the given object from the set and returns self. Use +subtract+ to
- # delete several items at once.
- def delete(o)
- @hash.delete(o)
- self
- end
-
- # Deletes the given object from the set and returns self. If the
- # object is not in the set, returns nil.
- def delete?(o)
- if include?(o)
- delete(o)
- else
- nil
- end
- end
-
- # Deletes every element of the set for which block evaluates to
- # true, and returns self.
- def delete_if
- @hash.delete_if { |o,| yield(o) }
- self
- end
-
- # Do collect() destructively.
- def collect!
- set = self.class.new
- each { |o| set << yield(o) }
- replace(set)
- end
- alias map! collect!
-
- # Equivalent to Set#delete_if, but returns nil if no changes were
- # made.
- def reject!
- n = size
- delete_if { |o| yield(o) }
- size == n ? nil : self
- end
-
- # Merges the elements of the given enumerable object to the set and
- # returns self.
- def merge(enum)
- if enum.is_a?(Set)
- @hash.update(enum.instance_eval { @hash })
- else
- enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
- enum.each { |o| add(o) }
- end
-
- self
- end
-
- # Deletes every element that appears in the given enumerable object
- # and returns self.
- def subtract(enum)
- enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
- enum.each { |o| delete(o) }
- self
- end
-
- # Returns a new set built by merging the set and the elements of the
- # given enumerable object.
- def |(enum)
- enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
- dup.merge(enum)
- end
- alias + | ##
- alias union | ##
-
- # Returns a new set built by duplicating the set, removing every
- # element that appears in the given enumerable object.
- def -(enum)
- enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
- dup.subtract(enum)
- end
- alias difference - ##
-
- # Returns a new array containing elements common to the set and the
- # given enumerable object.
- def &(enum)
- enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
- n = self.class.new
- enum.each { |o| n.add(o) if include?(o) }
- n
- end
- alias intersection & ##
-
- # Returns a new array containing elements exclusive between the set
- # and the given enumerable object. (set ^ enum) is equivalent to
- # ((set | enum) - (set & enum)).
- def ^(enum)
- enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
- n = dup
- enum.each { |o| if n.include?(o) then n.delete(o) else n.add(o) end }
- n
- end
-
- # Returns true if two sets are equal. The equality of each couple
- # of elements is defined according to Object#eql?.
- def ==(set)
- equal?(set) and return true
-
- set.is_a?(Set) && size == set.size or return false
-
- hash = @hash.dup
- set.all? { |o| hash.include?(o) }
- end
-
- def hash # :nodoc:
- @hash.hash
- end
-
- def eql?(o) # :nodoc:
- return false unless o.is_a?(Set)
- @hash.eql?(o.instance_eval{@hash})
- end
-
- # Classifies the set by the return value of the given block and
- # returns a hash of {value => set of elements} pairs. The block is
- # called once for each element of the set, passing the element as
- # parameter.
- #
- # e.g.:
- #
- # require 'set'
- # files = Set.new(Dir.glob("*.rb"))
- # hash = files.classify { |f| File.mtime(f).year }
- # p hash # => {2000=>#<Set: {"a.rb", "b.rb"}>,
- # # 2001=>#<Set: {"c.rb", "d.rb", "e.rb"}>,
- # # 2002=>#<Set: {"f.rb"}>}
- def classify # :yields: o
- h = {}
-
- each { |i|
- x = yield(i)
- (h[x] ||= self.class.new).add(i)
- }
-
- h
- end
-
- # Divides the set into a set of subsets according to the commonality
- # defined by the given block.
- #
- # If the arity of the block is 2, elements o1 and o2 are in common
- # if block.call(o1, o2) is true. Otherwise, elements o1 and o2 are
- # in common if block.call(o1) == block.call(o2).
- #
- # e.g.:
- #
- # require 'set'
- # numbers = Set[1, 3, 4, 6, 9, 10, 11]
- # set = numbers.divide { |i,j| (i - j).abs == 1 }
- # p set # => #<Set: {#<Set: {1}>,
- # # #<Set: {11, 9, 10}>,
- # # #<Set: {3, 4}>,
- # # #<Set: {6}>}>
- def divide(&func)
- if func.arity == 2
- require 'tsort'
-
- class << dig = {} # :nodoc:
- include TSort
-
- alias tsort_each_node each_key
- def tsort_each_child(node, &block)
- fetch(node).each(&block)
- end
- end
-
- each { |u|
- dig[u] = a = []
- each{ |v| func.call(u, v) and a << v }
- }
-
- set = Set.new()
- dig.each_strongly_connected_component { |css|
- set.add(self.class.new(css))
- }
- set
- else
- Set.new(classify(&func).values)
- end
- end
-
- InspectKey = :__inspect_key__ # :nodoc:
-
- # Returns a string containing a human-readable representation of the
- # set. ("#<Set: {element1, element2, ...}>")
- def inspect
- ids = (Thread.current[InspectKey] ||= [])
-
- if ids.include?(object_id)
- return sprintf('#<%s: {...}>', self.class.name)
- end
-
- begin
- ids << object_id
- return sprintf('#<%s: {%s}>', self.class, to_a.inspect[1..-2])
- ensure
- ids.pop
- end
- end
-
- def pretty_print(pp) # :nodoc:
- pp.text sprintf('#<%s: {', self.class.name)
- pp.nest(1) {
- pp.seplist(self) { |o|
- pp.pp o
- }
- }
- pp.text "}>"
- end
-
- def pretty_print_cycle(pp) # :nodoc:
- pp.text sprintf('#<%s: {%s}>', self.class.name, empty? ? '' : '...')
- end
-end
-
-# SortedSet implements a set which elements are sorted in order. See Set.
-class SortedSet < Set
- @@setup = false
-
- class << self
- def [](*ary) # :nodoc:
- new(ary)
- end
-
- def setup # :nodoc:
- @@setup and return
-
- begin
- require 'rbtree'
-
- module_eval %{
- def initialize(*args, &block)
- @hash = RBTree.new
- super
- end
- }
- rescue LoadError
- module_eval %{
- def initialize(*args, &block)
- @keys = nil
- super
- end
-
- def clear
- @keys = nil
- super
- end
-
- def replace(enum)
- @keys = nil
- super
- end
-
- def add(o)
- @keys = nil
- @hash[o] = true
- self
- end
- alias << add
-
- def delete(o)
- @keys = nil
- @hash.delete(o)
- self
- end
-
- def delete_if
- n = @hash.size
- @hash.delete_if { |o,| yield(o) }
- @keys = nil if @hash.size != n
- self
- end
-
- def merge(enum)
- @keys = nil
- super
- end
-
- def each
- to_a.each { |o| yield(o) }
- end
-
- def to_a
- (@keys = @hash.keys).sort! unless @keys
- @keys
- end
- }
- end
-
- @@setup = true
- end
- end
-
- def initialize(*args, &block) # :nodoc:
- SortedSet.setup
- initialize(*args, &block)
- end
-end
-
-module Enumerable
- # Makes a set from the enumerable object with given arguments.
- def to_set(klass = Set, *args, &block)
- klass.new(self, *args, &block)
- end
-end
-
-# =begin
-# == RestricedSet class
-# RestricedSet implements a set with restrictions defined by a given
-# block.
-#
-# === Super class
-# Set
-#
-# === Class Methods
-# --- RestricedSet::new(enum = nil) { |o| ... }
-# --- RestricedSet::new(enum = nil) { |rset, o| ... }
-# Creates a new restricted set containing the elements of the given
-# enumerable object. Restrictions are defined by the given block.
-#
-# If the block's arity is 2, it is called with the RestrictedSet
-# itself and an object to see if the object is allowed to be put in
-# the set.
-#
-# Otherwise, the block is called with an object to see if the object
-# is allowed to be put in the set.
-#
-# === Instance Methods
-# --- restriction_proc
-# Returns the restriction procedure of the set.
-#
-# =end
-#
-# class RestricedSet < Set
-# def initialize(*args, &block)
-# @proc = block or raise ArgumentError, "missing a block"
-#
-# if @proc.arity == 2
-# instance_eval %{
-# def add(o)
-# @hash[o] = true if @proc.call(self, o)
-# self
-# end
-# alias << add
-#
-# def add?(o)
-# if include?(o) || !@proc.call(self, o)
-# nil
-# else
-# @hash[o] = true
-# self
-# end
-# end
-#
-# def replace(enum)
-# enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-# clear
-# enum.each { |o| add(o) }
-#
-# self
-# end
-#
-# def merge(enum)
-# enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-# enum.each { |o| add(o) }
-#
-# self
-# end
-# }
-# else
-# instance_eval %{
-# def add(o)
-# if @proc.call(o)
-# @hash[o] = true
-# end
-# self
-# end
-# alias << add
-#
-# def add?(o)
-# if include?(o) || !@proc.call(o)
-# nil
-# else
-# @hash[o] = true
-# self
-# end
-# end
-# }
-# end
-#
-# super(*args)
-# end
-#
-# def restriction_proc
-# @proc
-# end
-# end
-
-if $0 == __FILE__
- eval DATA.read, nil, $0, __LINE__+4
-end
-
-# = rweb - CGI Support Library
-#
-# Author:: Johannes Barre (mailto:rweb@igels.net)
-# Copyright:: Copyright (c) 2003, 04 by Johannes Barre
-# License:: GNU Lesser General Public License (COPYING, http://www.gnu.org/copyleft/lesser.html)
-# Version:: 0.1.0
-# CVS-ID:: $Id: example.rb 39 2005-11-05 03:33:55Z murphy $
-#
-# == What is Rweb?
-# Rweb is a replacement for the cgi class included in the ruby distribution.
-#
-# == How to use
-#
-# === Basics
-#
-# This class is made to be as easy as possible to use. An example:
-#
-# require "rweb"
-#
-# web = Rweb.new
-# web.out do
-# web.puts "Hello world!"
-# end
-#
-# The visitor will get a simple "Hello World!" in his browser. Please notice,
-# that won't set html-tags for you, so you should better do something like this:
-#
-# require "rweb"
-#
-# web = Rweb.new
-# web.out do
-# web.puts "<html><body>Hello world!</body></html>"
-# end
-#
-# === Set headers
-# Of course, it's also possible to tell the browser, that the content of this
-# page is plain text instead of html code:
-#
-# require "rweb"
-#
-# web = Rweb.new
-# web.out do
-# web.header("content-type: text/plain")
-# web.puts "Hello plain world!"
-# end
-#
-# Please remember, headers can't be set after the page content has been send.
-# You have to set all nessessary headers before the first puts oder print. It's
-# possible to cache the content until everything is complete. Doing it this
-# way, you can set headers everywhere.
-#
-# If you set a header twice, the second header will replace the first one. The
-# header name is not casesensitive, it will allways converted in to the
-# capitalised form suggested by the w3c (http://w3.org)
-#
-# === Set cookies
-# Setting cookies is quite easy:
-# include 'rweb'
-#
-# web = Rweb.new
-# Cookie.new("Visits", web.cookies['visits'].to_i +1)
-# web.out do
-# web.puts "Welcome back! You visited this page #{web.cookies['visits'].to_i +1} times"
-# end
-#
-# See the class Cookie for more details.
-#
-# === Get form and cookie values
-# There are four ways to submit data from the browser to the server and your
-# ruby script: via GET, POST, cookies and file upload. Rweb doesn't support
-# file upload by now.
-#
-# include 'rweb'
-#
-# web = Rweb.new
-# web.out do
-# web.print "action: #{web.get['action']} "
-# web.puts "The value of the cookie 'visits' is #{web.cookies['visits']}"
-# web.puts "The post parameter 'test['x']' is #{web.post['test']['x']}"
-# end
-
-RWEB_VERSION = "0.1.0"
-RWEB = "rweb/#{RWEB_VERSION}"
-
-#require 'rwebcookie' -> edit by bunny :-)
-
-class Rweb
- # All parameter submitted via the GET method are available in attribute
- # get. This is Hash, where every parameter is available as a key-value
- # pair.
- #
- # If your input tag has a name like this one, it's value will be available
- # as web.get["fieldname"]
- # <input name="fieldname">
- # You can submit values as a Hash
- # <input name="text['index']">
- # <input name="text['index2']">
- # will be available as
- # web.get["text"]["index"]
- # web.get["text"]["index2"]
- # Integers are also possible
- # <input name="int[2]">
- # <input name="int[3]['hi']>
- # will be available as
- # web.get["int"][2]
- # web.get["int"][3]["hi"]
- # If you specify no index, the lowest unused index will be used:
- # <input name="int[]"><!-- First Field -->
- # <input name="int[]"><!-- Second one -->
- # will be available as
- # web.get["int"][0] # First Field
- # web.get["int"][1] # Second one
- # Please notice, this doesn'd work like you might expect:
- # <input name="text[index]">
- # It will not be available as web.get["text"]["index"] but
- # web.get["text[index]"]
- attr_reader :get
-
- # All parameters submitted via POST are available in the attribute post. It
- # works like the get attribute.
- # <input name="text[0]">
- # will be available as
- # web.post["text"][0]
- attr_reader :post
-
- # All cookies submitted by the browser are available in cookies. This is a
- # Hash, where every cookie is a key-value pair.
- attr_reader :cookies
-
- # The name of the browser identification is submitted as USER_AGENT and
- # available in this attribute.
- attr_reader :user_agent
-
- # The IP address of the client.
- attr_reader :remote_addr
-
- # Creates a new Rweb object. This should only done once. You can set various
- # options via the settings hash.
- #
- # "cache" => true: Everything you script send to the client will be cached
- # until the end of the out block or until flush is called. This way, you
- # can modify headers and cookies even after printing something to the client.
- #
- # "safe" => level: Changes the $SAFE attribute. By default, $SAFE will be set
- # to 1. If $SAFE is already higher than this value, it won't be changed.
- #
- # "silend" => true: Normaly, Rweb adds automaticly a header like this
- # "X-Powered-By: Rweb/x.x.x (Ruby/y.y.y)". With the silend option you can
- # suppress this.
- def initialize (settings = {})
- # {{{
- @header = {}
- @cookies = {}
- @get = {}
- @post = {}
-
- # Internal attributes
- @status = nil
- @reasonPhrase = nil
- @setcookies = []
- @output_started = false;
- @output_allowed = false;
-
- @mod_ruby = false
- @env = ENV.to_hash
-
- if defined?(MOD_RUBY)
- @output_method = "mod_ruby"
- @mod_ruby = true
- elsif @env['SERVER_SOFTWARE'] =~ /^Microsoft-IIS/i
- @output_method = "nph"
- else
- @output_method = "ph"
- end
-
- unless settings.is_a?(Hash)
- raise TypeError, "settings must be a Hash"
- end
- @settings = settings
-
- unless @settings.has_key?("safe")
- @settings["safe"] = 1
- end
-
- if $SAFE < @settings["safe"]
- $SAFE = @settings["safe"]
- end
-
- unless @settings.has_key?("cache")
- @settings["cache"] = false
- end
-
- # mod_ruby sets no QUERY_STRING variable, if no GET-Parameters are given
- unless @env.has_key?("QUERY_STRING")
- @env["QUERY_STRING"] = ""
- end
-
- # Now we split the QUERY_STRING by the seperators & and ; or, if
- # specified, settings['get seperator']
- unless @settings.has_key?("get seperator")
- get_args = @env['QUERY_STRING'].split(/[&;]/)
- else
- get_args = @env['QUERY_STRING'].split(@settings['get seperator'])
- end
-
- get_args.each do | arg |
- arg_key, arg_val = arg.split(/=/, 2)
- arg_key = Rweb::unescape(arg_key)
- arg_val = Rweb::unescape(arg_val)
-
- # Parse names like name[0], name['text'] or name[]
- pattern = /^(.+)\[("[^\]]*"|'[^\]]*'|[0-9]*)\]$/
- keys = []
- while match = pattern.match(arg_key)
- arg_key = match[1]
- keys = [match[2]] + keys
- end
- keys = [arg_key] + keys
-
- akt = @get
- last = nil
- lastkey = nil
- keys.each do |key|
- if key == ""
- # No key specified (like in "test[]"), so we use the
- # lowerst unused Integer as key
- key = 0
- while akt.has_key?(key)
- key += 1
- end
- elsif /^[0-9]*$/ =~ key
- # If the index is numerical convert it to an Integer
- key = key.to_i
- elsif key[0].chr == "'" || key[0].chr == '"'
- key = key[1, key.length() -2]
- end
- if !akt.has_key?(key) || !akt[key].class == Hash
- # create an empty Hash if there isn't already one
- akt[key] = {}
- end
- last = akt
- lastkey = key
- akt = akt[key]
- end
- last[lastkey] = arg_val
- end
-
- if @env['REQUEST_METHOD'] == "POST"
- if @env.has_key?("CONTENT_TYPE") && @env['CONTENT_TYPE'] == "application/x-www-form-urlencoded" && @env.has_key?('CONTENT_LENGTH')
- unless @settings.has_key?("post seperator")
- post_args = $stdin.read(@env['CONTENT_LENGTH'].to_i).split(/[&;]/)
- else
- post_args = $stdin.read(@env['CONTENT_LENGTH'].to_i).split(@settings['post seperator'])
- end
- post_args.each do | arg |
- arg_key, arg_val = arg.split(/=/, 2)
- arg_key = Rweb::unescape(arg_key)
- arg_val = Rweb::unescape(arg_val)
-
- # Parse names like name[0], name['text'] or name[]
- pattern = /^(.+)\[("[^\]]*"|'[^\]]*'|[0-9]*)\]$/
- keys = []
- while match = pattern.match(arg_key)
- arg_key = match[1]
- keys = [match[2]] + keys
- end
- keys = [arg_key] + keys
-
- akt = @post
- last = nil
- lastkey = nil
- keys.each do |key|
- if key == ""
- # No key specified (like in "test[]"), so we use
- # the lowerst unused Integer as key
- key = 0
- while akt.has_key?(key)
- key += 1
- end
- elsif /^[0-9]*$/ =~ key
- # If the index is numerical convert it to an Integer
- key = key.to_i
- elsif key[0].chr == "'" || key[0].chr == '"'
- key = key[1, key.length() -2]
- end
- if !akt.has_key?(key) || !akt[key].class == Hash
- # create an empty Hash if there isn't already one
- akt[key] = {}
- end
- last = akt
- lastkey = key
- akt = akt[key]
- end
- last[lastkey] = arg_val
- end
- else
- # Maybe we should print a warning here?
- $stderr.print("Unidentified form data recived and discarded.")
- end
- end
-
- if @env.has_key?("HTTP_COOKIE")
- cookie = @env['HTTP_COOKIE'].split(/; ?/)
- cookie.each do | c |
- cookie_key, cookie_val = c.split(/=/, 2)
-
- @cookies [Rweb::unescape(cookie_key)] = Rweb::unescape(cookie_val)
- end
- end
-
- if defined?(@env['HTTP_USER_AGENT'])
- @user_agent = @env['HTTP_USER_AGENT']
- else
- @user_agent = nil;
- end
-
- if defined?(@env['REMOTE_ADDR'])
- @remote_addr = @env['REMOTE_ADDR']
- else
- @remote_addr = nil
- end
- # }}}
- end
-
- # Prints a String to the client. If caching is enabled, the String will
- # buffered until the end of the out block ends.
- def print(str = "")
- # {{{
- unless @output_allowed
- raise "You just can write to output inside of a Rweb::out-block"
- end
-
- if @settings["cache"]
- @buffer += [str.to_s]
- else
- unless @output_started
- sendHeaders
- end
- $stdout.print(str)
- end
- nil
- # }}}
- end
-
- # Prints a String to the client and adds a line break at the end. Please
- # remember, that a line break is not visible in HTML, use the <br> HTML-Tag
- # for this. If caching is enabled, the String will buffered until the end
- # of the out block ends.
- def puts(str = "")
- # {{{
- self.print(str + "\n")
- # }}}
- end
-
- # Alias to print.
- def write(str = "")
- # {{{
- self.print(str)
- # }}}
- end
-
- # If caching is enabled, all cached data are send to the cliend and the
- # cache emptied.
- def flush
- # {{{
- unless @output_allowed
- raise "You can't use flush outside of a Rweb::out-block"
- end
- buffer = @buffer.join
-
- unless @output_started
- sendHeaders
- end
- $stdout.print(buffer)
-
- @buffer = []
- # }}}
- end
-
- # Sends one or more header to the client. All headers are cached just
- # before body data are send to the client. If the same header are set
- # twice, only the last value is send.
- #
- # Example:
- # web.header("Last-Modified: Mon, 16 Feb 2004 20:15:41 GMT")
- # web.header("Location: http://www.ruby-lang.org")
- #
- # You can specify more than one header at the time by doing something like
- # this:
- # web.header("Content-Type: text/plain\nContent-Length: 383")
- # or
- # web.header(["Content-Type: text/plain", "Content-Length: 383"])
- def header(str)
- # {{{
- if @output_started
- raise "HTTP-Headers are already send. You can't change them after output has started!"
- end
- unless @output_allowed
- raise "You just can set headers inside of a Rweb::out-block"
- end
- if str.is_a?Array
- str.each do | value |
- self.header(value)
- end
-
- elsif str.split(/\n/).length > 1
- str.split(/\n/).each do | value |
- self.header(value)
- end
-
- elsif str.is_a? String
- str.gsub!(/\r/, "")
-
- if (str =~ /^HTTP\/1\.[01] [0-9]{3} ?.*$/) == 0
- pattern = /^HTTP\/1.[01] ([0-9]{3}) ?(.*)$/
-
- result = pattern.match(str)
- self.setstatus(result[0], result[1])
- elsif (str =~ /^status: [0-9]{3} ?.*$/i) == 0
- pattern = /^status: ([0-9]{3}) ?(.*)$/i
-
- result = pattern.match(str)
- self.setstatus(result[0], result[1])
- else
- a = str.split(/: ?/, 2)
-
- @header[a[0].downcase] = a[1]
- end
- end
- # }}}
- end
-
- # Changes the status of this page. There are several codes like "200 OK",
- # "302 Found", "404 Not Found" or "500 Internal Server Error". A list of
- # all codes is available at
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10
- #
- # You can just send the code number, the reason phrase will be added
- # automaticly with the recommendations from the w3c if not specified. If
- # you set the status twice or more, only the last status will be send.
- # Examples:
- # web.status("401 Unauthorized")
- # web.status("410 Sad but true, this lonely page is gone :(")
- # web.status(206)
- # web.status("400")
- #
- # The default status is "200 OK". If a "Location" header is set, the
- # default status is "302 Found".
- def status(str)
- # {{{
- if @output_started
- raise "HTTP-Headers are already send. You can't change them after output has started!"
- end
- unless @output_allowed
- raise "You just can set headers inside of a Rweb::out-block"
- end
- if str.is_a?Integer
- @status = str
- elsif str.is_a?String
- p1 = /^([0-9]{3}) ?(.*)$/
- p2 = /^HTTP\/1\.[01] ([0-9]{3}) ?(.*)$/
- p3 = /^status: ([0-9]{3}) ?(.*)$/i
-
- if (a = p1.match(str)) == nil
- if (a = p2.match(str)) == nil
- if (a = p3.match(str)) == nil
- raise ArgumentError, "Invalid argument", caller
- end
- end
- end
- @status = a[1].to_i
- if a[2] != ""
- @reasonPhrase = a[2]
- else
- @reasonPhrase = getReasonPhrase(@status)
- end
- else
- raise ArgumentError, "Argument of setstatus must be integer or string", caller
- end
- # }}}
- end
-
- # Handles the output of your content and rescues all exceptions. Send all
- # data in the block to this method. For example:
- # web.out do
- # web.header("Content-Type: text/plain")
- # web.puts("Hello, plain world!")
- # end
- def out
- # {{{
- @output_allowed = true
- @buffer = []; # We use an array as buffer, because it's more performant :)
-
- begin
- yield
- rescue Exception => exception
- $stderr.puts "Ruby exception rescued (#{exception.class}): #{exception.message}"
- $stderr.puts exception.backtrace.join("\n")
-
- unless @output_started
- self.setstatus(500)
- @header = {}
- end
-
- unless (@settings.has_key?("hide errors") and @settings["hide errors"] == true)
- unless @output_started
- self.header("Content-Type: text/html")
- self.puts "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Strict//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"
- self.puts "<html>"
- self.puts "<head>"
- self.puts "<title>500 Internal Server Error</title>"
- self.puts "</head>"
- self.puts "<body>"
- end
- if @header.has_key?("content-type") and (@header["content-type"] =~ /^text\/html/i) == 0
- self.puts "<h1>Internal Server Error</h1>"
- self.puts "<p>The server encountered an exception and was unable to complete your request.</p>"
- self.puts "<p>The exception has provided the following information:</p>"
- self.puts "<pre style=\"background: #FFCCCC; border: black solid 2px; margin-left: 2cm; margin-right: 2cm; padding: 2mm;\"><b>#{exception.class}</b>: #{exception.message} <b>on</b>"
- self.puts
- self.puts "#{exception.backtrace.join("\n")}</pre>"
- self.puts "</body>"
- self.puts "</html>"
- else
- self.puts "The server encountered an exception and was unable to complete your request"
- self.puts "The exception has provided the following information:"
- self.puts "#{exception.class}: #{exception.message}"
- self.puts
- self.puts exception.backtrace.join("\n")
- end
- end
- end
-
- if @settings["cache"]
- buffer = @buffer.join
-
- unless @output_started
- unless @header.has_key?("content-length")
- self.header("content-length: #{buffer.length}")
- end
-
- sendHeaders
- end
- $stdout.print(buffer)
- elsif !@output_started
- sendHeaders
- end
- @output_allowed = false;
- # }}}
- end
-
- # Decodes URL encoded data, %20 for example stands for a space.
- def Rweb.unescape(str)
- # {{{
- if defined? str and str.is_a? String
- str.gsub!(/\+/, " ")
- str.gsub(/%.{2}/) do | s |
- s[1,2].hex.chr
- end
- end
- # }}}
- end
-
- protected
- def sendHeaders
- # {{{
-
- Cookie.disallow # no more cookies can be set or modified
- if !(@settings.has_key?("silent") and @settings["silent"] == true) and !@header.has_key?("x-powered-by")
- if @mod_ruby
- header("x-powered-by: #{RWEB} (Ruby/#{RUBY_VERSION}, #{MOD_RUBY})");
- else
- header("x-powered-by: #{RWEB} (Ruby/#{RUBY_VERSION})");
- end
- end
-
- if @output_method == "ph"
- if ((@status == nil or @status == 200) and !@header.has_key?("content-type") and !@header.has_key?("location"))
- header("content-type: text/html")
- end
-
- if @status != nil
- $stdout.print "Status: #{@status} #{@reasonPhrase}\r\n"
- end
-
- @header.each do |key, value|
- key = key *1 # "unfreeze" key :)
- key[0] = key[0,1].upcase![0]
-
- key = key.gsub(/-[a-z]/) do |char|
- "-" + char[1,1].upcase
- end
-
- $stdout.print "#{key}: #{value}\r\n"
- end
- cookies = Cookie.getHttpHeader # Get all cookies as an HTTP Header
- if cookies
- $stdout.print cookies
- end
-
- $stdout.print "\r\n"
-
- elsif @output_method == "nph"
- elsif @output_method == "mod_ruby"
- r = Apache.request
-
- if ((@status == nil or @status == 200) and !@header.has_key?("content-type") and !@header.has_key?("location"))
- header("text/html")
- end
-
- if @status != nil
- r.status_line = "#{@status} #{@reasonPhrase}"
- end
-
- r.send_http_header
- @header.each do |key, value|
- key = key *1 # "unfreeze" key :)
-
- key[0] = key[0,1].upcase![0]
- key = key.gsub(/-[a-z]/) do |char|
- "-" + char[1,1].upcase
- end
- puts "#{key}: #{value.class}"
- #r.headers_out[key] = value
- end
- end
- @output_started = true
- # }}}
- end
-
- def getReasonPhrase (status)
- # {{{
- if status == 100
- "Continue"
- elsif status == 101
- "Switching Protocols"
- elsif status == 200
- "OK"
- elsif status == 201
- "Created"
- elsif status == 202
- "Accepted"
- elsif status == 203
- "Non-Authoritative Information"
- elsif status == 204
- "No Content"
- elsif status == 205
- "Reset Content"
- elsif status == 206
- "Partial Content"
- elsif status == 300
- "Multiple Choices"
- elsif status == 301
- "Moved Permanently"
- elsif status == 302
- "Found"
- elsif status == 303
- "See Other"
- elsif status == 304
- "Not Modified"
- elsif status == 305
- "Use Proxy"
- elsif status == 307
- "Temporary Redirect"
- elsif status == 400
- "Bad Request"
- elsif status == 401
- "Unauthorized"
- elsif status == 402
- "Payment Required"
- elsif status == 403
- "Forbidden"
- elsif status == 404
- "Not Found"
- elsif status == 405
- "Method Not Allowed"
- elsif status == 406
- "Not Acceptable"
- elsif status == 407
- "Proxy Authentication Required"
- elsif status == 408
- "Request Time-out"
- elsif status == 409
- "Conflict"
- elsif status == 410
- "Gone"
- elsif status == 411
- "Length Required"
- elsif status == 412
- "Precondition Failed"
- elsif status == 413
- "Request Entity Too Large"
- elsif status == 414
- "Request-URI Too Large"
- elsif status == 415
- "Unsupported Media Type"
- elsif status == 416
- "Requested range not satisfiable"
- elsif status == 417
- "Expectation Failed"
- elsif status == 500
- "Internal Server Error"
- elsif status == 501
- "Not Implemented"
- elsif status == 502
- "Bad Gateway"
- elsif status == 503
- "Service Unavailable"
- elsif status == 504
- "Gateway Time-out"
- elsif status == 505
- "HTTP Version not supported"
- else
- raise "Unknown Statuscode. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1 for more information."
- end
- # }}}
- end
-end
-
-class Cookie
- attr_reader :name, :value, :maxage, :path, :domain, :secure, :comment
-
- # Sets a cookie. Please see below for details of the attributes.
- def initialize (name, value = nil, maxage = nil, path = nil, domain = nil, secure = false)
- # {{{
- # HTTP headers (Cookies are a HTTP header) can only set, while no content
- # is send. So an exception will be raised, when @@allowed is set to false
- # and a new cookie has set.
- unless defined?(@@allowed)
- @@allowed = true
- end
- unless @@allowed
- raise "You can't set cookies after the HTTP headers are send."
- end
-
- unless defined?(@@list)
- @@list = []
- end
- @@list += [self]
-
- unless defined?(@@type)
- @@type = "netscape"
- end
-
- unless name.class == String
- raise TypeError, "The name of a cookie must be a string", caller
- end
- if value.class.superclass == Integer || value.class == Float
- value = value.to_s
- elsif value.class != String && value != nil
- raise TypeError, "The value of a cookie must be a string, integer, float or nil", caller
- end
- if maxage.class == Time
- maxage = maxage - Time.now
- elsif !maxage.class.superclass == Integer || !maxage == nil
- raise TypeError, "The maxage date of a cookie must be an Integer or Time object or nil.", caller
- end
- unless path.class == String || path == nil
- raise TypeError, "The path of a cookie must be nil or a string", caller
- end
- unless domain.class == String || domain == nil
- raise TypeError, "The value of a cookie must be nil or a string", caller
- end
- unless secure == true || secure == false
- raise TypeError, "The secure field of a cookie must be true or false", caller
- end
-
- @name, @value, @maxage, @path, @domain, @secure = name, value, maxage, path, domain, secure
- @comment = nil
- # }}}
- end
-
- # Modifies the value of this cookie. The information you want to store. If the
- # value is nil, the cookie will be deleted by the client.
- #
- # This attribute can be a String, Integer or Float object or nil.
- def value=(value)
- # {{{
- if value.class.superclass == Integer || value.class == Float
- value = value.to_s
- elsif value.class != String && value != nil
- raise TypeError, "The value of a cookie must be a string, integer, float or nil", caller
- end
- @value = value
- # }}}
- end
-
- # Modifies the maxage of this cookie. This attribute defines the lifetime of
- # the cookie, in seconds. A value of 0 means the cookie should be discarded
- # imediatly. If it set to nil, the cookie will be deleted when the browser
- # will be closed.
- #
- # Attention: This is different from other implementations like PHP, where you
- # gives the seconds since 1/1/1970 0:00:00 GMT.
- #
- # This attribute must be an Integer or Time object or nil.
- def maxage=(maxage)
- # {{{
- if maxage.class == Time
- maxage = maxage - Time.now
- elsif maxage.class.superclass == Integer || !maxage == nil
- raise TypeError, "The maxage of a cookie must be an Interger or Time object or nil.", caller
- end
- @maxage = maxage
- # }}}
- end
-
- # Modifies the path value of this cookie. The client will send this cookie
- # only, if the requested document is this directory or a subdirectory of it.
- #
- # The value of the attribute must be a String object or nil.
- def path=(path)
- # {{{
- unless path.class == String || path == nil
- raise TypeError, "The path of a cookie must be nil or a string", caller
- end
- @path = path
- # }}}
- end
-
- # Modifies the domain value of this cookie. The client will send this cookie
- # only if it's connected with this domain (or a subdomain, if the first
- # character is a dot like in ".ruby-lang.org")
- #
- # The value of this attribute must be a String or nil.
- def domain=(domain)
- # {{{
- unless domain.class == String || domain == nil
- raise TypeError, "The domain of a cookie must be a String or nil.", caller
- end
- @domain = domain
- # }}}
- end
-
- # Modifies the secure flag of this cookie. If it's true, the client will only
- # send this cookie if it is secured connected with us.
- #
- # The value od this attribute has to be true or false.
- def secure=(secure)
- # {{{
- unless secure == true || secure == false
- raise TypeError, "The secure field of a cookie must be true or false", caller
- end
- @secure = secure
- # }}}
- end
-
- # Modifies the comment value of this cookie. The comment won't be send, if
- # type is "netscape".
- def comment=(comment)
- # {{{
- unless comment.class == String || comment == nil
- raise TypeError, "The comment of a cookie must be a string or nil", caller
- end
- @comment = comment
- # }}}
- end
-
- # Changes the type of all cookies.
- # Allowed values are RFC2109 and netscape (default).
- def Cookie.type=(type)
- # {{{
- unless @@allowed
- raise "The cookies are allready send, so you can't change the type anymore."
- end
- unless type.downcase == "rfc2109" && type.downcase == "netscape"
- raise "The type of the cookies must be \"RFC2109\" or \"netscape\"."
- end
- @@type = type;
- # }}}
- end
-
- # After sending this message, no cookies can be set or modified. Use it, when
- # HTTP-Headers are send. Rweb does this for you.
- def Cookie.disallow
- # {{{
- @@allowed = false
- true
- # }}}
- end
-
- # Returns a HTTP header (type String) with all cookies. Rweb does this for
- # you.
- def Cookie.getHttpHeader
- # {{{
- if defined?(@@list)
- if @@type == "netscape"
- str = ""
- @@list.each do |cookie|
- if cookie.value == nil
- cookie.maxage = 0
- cookie.value = ""
- end
- # TODO: Name and value should be escaped!
- str += "Set-Cookie: #{cookie.name}=#{cookie.value}"
- unless cookie.maxage == nil
- expire = Time.now + cookie.maxage
- expire.gmtime
- str += "; Expire=#{expire.strftime("%a, %d-%b-%Y %H:%M:%S %Z")}"
- end
- unless cookie.domain == nil
- str += "; Domain=#{cookie.domain}"
- end
- unless cookie.path == nil
- str += "; Path=#{cookie.path}"
- end
- if cookie.secure
- str += "; Secure"
- end
- str += "\r\n"
- end
- return str
- else # type == "RFC2109"
- str = "Set-Cookie: "
- comma = false;
-
- @@list.each do |cookie|
- if cookie.value == nil
- cookie.maxage = 0
- cookie.value = ""
- end
- if comma
- str += ","
- end
- comma = true
-
- str += "#{cookie.name}=\"#{cookie.value}\""
- unless cookie.maxage == nil
- str += "; Max-Age=\"#{cookie.maxage}\""
- end
- unless cookie.domain == nil
- str += "; Domain=\"#{cookie.domain}\""
- end
- unless cookie.path == nil
- str += "; Path=\"#{cookie.path}\""
- end
- if cookie.secure
- str += "; Secure"
- end
- unless cookie.comment == nil
- str += "; Comment=\"#{cookie.comment}\""
- end
- str += "; Version=\"1\""
- end
- str
- end
- else
- false
- end
- # }}}
- end
-end
-
-require 'strscan'
-
-module BBCode
- DEBUG = true
-
- use 'encoder', 'tags', 'tagstack', 'smileys'
-
-=begin
- The Parser class takes care of the encoding.
- It scans the given BBCode (as plain text), finds tags
- and smilies and also makes links of urls in text.
-
- Normal text is send directly to the encoder.
-
- If a tag was found, an instance of a Tag subclass is created
- to handle the case.
-
- The @tagstack manages tag nesting and ensures valid HTML.
-=end
-
- class Parser
- class Attribute
- # flatten and use only one empty_arg
- def self.create attr
- attr = flatten attr
- return @@empty_attr if attr.empty?
- new attr
- end
-
- private_class_method :new
-
- # remove leading and trailing whitespace; concat lines
- def self.flatten attr
- attr.strip.gsub(/\n/, ' ')
- # -> ^ and $ can only match at begin and end now
- end
-
- ATTRIBUTE_SCAN = /
- (?!$) # don't match at end
- \s*
- ( # $1 = key
- [^=\s\]"\\]*
- (?:
- (?: \\. | "[^"\\]*(?:\\.[^"\\]*)*"? )
- [^=\s\]"\\]*
- )*
- )
- (?:
- =
- ( # $2 = value
- [^\s\]"\\]*
- (?:
- (?: \\. | "[^"\\]*(?:\\.[^"\\]*)*"? )
- [^\s\]"\\]*
- )*
- )?
- )?
- \s*
- /x
-
- def self.parse source
- source = source.dup
- # empty_tag: the tag looks like [... /]
- # slice!: this deletes the \s*/] at the end
- # \s+ because [url=http://rubybb.org/forum/] is NOT an empty tag.
- # In RubyBBCode, you can use [url=http://rubybb.org/forum/ /], and this has to be
- # interpreted correctly.
- empty_tag = source.sub!(/^:/, '=') or source.slice!(/\/$/)
- debug 'PARSE: ' + source.inspect + ' => ' + empty_tag.inspect
- #-> we have now an attr that's EITHER empty OR begins and ends with non-whitespace.
-
- attr = Hash.new
- attr[:flags] = []
- source.scan(ATTRIBUTE_SCAN) { |key, value|
- if not value
- attr[:flags] << unescape(key)
- else
- next if value.empty? and key.empty?
- attr[unescape(key)] = unescape(value)
- end
- }
- debug attr.inspect
-
- return empty_tag, attr
- end
-
- def self.unescape_char esc
- esc[1]
- end
-
- def self.unquote qt
- qt[1..-1].chomp('"').gsub(/\\./) { |esc| unescape_char esc }
- end
-
- def self.unescape str
- str.gsub(/ (\\.) | (" [^"\\]* (?:\\.[^"\\]*)* "?) /x) {
- if $1
- unescape_char $1
- else
- unquote $2
- end
- }
- end
-
- include Enumerable
- def each &block
- @args.each(&block)
- end
-
- attr_reader :source, :args, :value
-
- def initialize source
- @source = source
- debug 'Attribute#new(%p)' % source
- @empty_tag, @attr = Attribute.parse source
- @value = @attr[''].to_s
- end
-
- def empty?
- self == @@empty_attr
- end
-
- def empty_tag?
- @empty_tag
- end
-
- def [] *keys
- res = @attr[*keys]
- end
-
- def flags
- attr[:flags]
- end
-
- def to_s
- @attr
- end
-
- def inspect
- 'ATTR[' + @attr.inspect + (@empty_tag ? ' | empty tag' : '') + ']'
- end
- end
- class Attribute
- @@empty_attr = new ''
- end
- end
-
diff --git a/tests/examplefiles/example.red b/tests/examplefiles/example.red
deleted file mode 100644
index 37c17ef8..00000000
--- a/tests/examplefiles/example.red
+++ /dev/null
@@ -1,257 +0,0 @@
-Red [
- Title: "Red console"
- Author: ["Nenad Rakocevic" "Kaj de Vos"]
- File: %console.red
- Tabs: 4
- Rights: "Copyright (C) 2012-2013 Nenad Rakocevic. All rights reserved."
- License: {
- Distributed under the Boost Software License, Version 1.0.
- See https://github.com/dockimbel/Red/blob/master/BSL-License.txt
- }
- Purpose: "Just some code for testing Pygments colorizer"
- Language: http://www.red-lang.org/
-]
-
-#system-global [
- #either OS = 'Windows [
- #import [
- "kernel32.dll" stdcall [
- AttachConsole: "AttachConsole" [
- processID [integer!]
- return: [integer!]
- ]
- SetConsoleTitle: "SetConsoleTitleA" [
- title [c-string!]
- return: [integer!]
- ]
- ReadConsole: "ReadConsoleA" [
- consoleInput [integer!]
- buffer [byte-ptr!]
- charsToRead [integer!]
- numberOfChars [int-ptr!]
- inputControl [int-ptr!]
- return: [integer!]
- ]
- ]
- ]
- line-buffer-size: 16 * 1024
- line-buffer: allocate line-buffer-size
- ][
- #switch OS [
- MacOSX [
- #define ReadLine-library "libreadline.dylib"
- ]
- #default [
- #define ReadLine-library "libreadline.so.6"
- #define History-library "libhistory.so.6"
- ]
- ]
- #import [
- ReadLine-library cdecl [
- read-line: "readline" [ ; Read a line from the console.
- prompt [c-string!]
- return: [c-string!]
- ]
- rl-bind-key: "rl_bind_key" [
- key [integer!]
- command [integer!]
- return: [integer!]
- ]
- rl-insert: "rl_insert" [
- count [integer!]
- key [integer!]
- return: [integer!]
- ]
- ]
- #if OS <> 'MacOSX [
- History-library cdecl [
- add-history: "add_history" [ ; Add line to the history.
- line [c-string!]
- ]
- ]
- ]
- ]
-
- rl-insert-wrapper: func [
- [cdecl]
- count [integer!]
- key [integer!]
- return: [integer!]
- ][
- rl-insert count key
- ]
-
- ]
-]
-
-Windows?: system/platform = 'Windows
-
-read-argument: routine [
- /local
- args [str-array!]
- str [red-string!]
-][
- if system/args-count <> 2 [
- SET_RETURN(none-value)
- exit
- ]
- args: system/args-list + 1 ;-- skip binary filename
- str: simple-io/read-txt args/item
- SET_RETURN(str)
-]
-
-init-console: routine [
- str [string!]
- /local
- ret
-][
- #either OS = 'Windows [
- ;ret: AttachConsole -1
- ;if zero? ret [print-line "ReadConsole failed!" halt]
-
- ret: SetConsoleTitle as c-string! string/rs-head str
- if zero? ret [print-line "SetConsoleTitle failed!" halt]
- ][
- rl-bind-key as-integer tab as-integer :rl-insert-wrapper
- ]
-]
-
-input: routine [
- prompt [string!]
- /local
- len ret str buffer line
-][
- #either OS = 'Windows [
- len: 0
- print as c-string! string/rs-head prompt
- ret: ReadConsole stdin line-buffer line-buffer-size :len null
- if zero? ret [print-line "ReadConsole failed!" halt]
- len: len + 1
- line-buffer/len: null-byte
- str: string/load as c-string! line-buffer len
- ][
- line: read-line as c-string! string/rs-head prompt
- if line = null [halt] ; EOF
-
- #if OS <> 'MacOSX [add-history line]
-
- str: string/load line 1 + length? line
-; free as byte-ptr! line
- ]
- SET_RETURN(str)
-]
-
-count-delimiters: function [
- buffer [string!]
- return: [block!]
-][
- list: copy [0 0]
- c: none
-
- foreach c buffer [
- case [
- escaped? [
- escaped?: no
- ]
- in-comment? [
- switch c [
- #"^/" [in-comment?: no]
- ]
- ]
- 'else [
- switch c [
- #"^^" [escaped?: yes]
- #";" [if zero? list/2 [in-comment?: yes]]
- #"[" [list/1: list/1 + 1]
- #"]" [list/1: list/1 - 1]
- #"{" [list/2: list/2 + 1]
- #"}" [list/2: list/2 - 1]
- ]
- ]
- ]
- ]
- list
-]
-
-do-console: function [][
- buffer: make string! 10000
- prompt: red-prompt: "red>> "
- mode: 'mono
-
- switch-mode: [
- mode: case [
- cnt/1 > 0 ['block]
- cnt/2 > 0 ['string]
- 'else [
- prompt: red-prompt
- do eval
- 'mono
- ]
- ]
- prompt: switch mode [
- block ["[^-"]
- string ["{^-"]
- mono [red-prompt]
- ]
- ]
-
- eval: [
- code: load/all buffer
-
- unless tail? code [
- set/any 'result do code
-
- unless unset? :result [
- if 67 = length? result: mold/part :result 67 [ ;-- optimized for width = 72
- clear back tail result
- append result "..."
- ]
- print ["==" result]
- ]
- ]
- clear buffer
- ]
-
- while [true][
- unless tail? line: input prompt [
- append buffer line
- cnt: count-delimiters buffer
-
- either Windows? [
- remove skip tail buffer -2 ;-- clear extra CR (Windows)
- ][
- append buffer lf ;-- Unix
- ]
-
- switch mode [
- block [if cnt/1 <= 0 [do switch-mode]]
- string [if cnt/2 <= 0 [do switch-mode]]
- mono [do either any [cnt/1 > 0 cnt/2 > 0][switch-mode][eval]]
- ]
- ]
- ]
-]
-
-q: :quit
-
-if script: read-argument [
- script: load script
- either any [
- script/1 <> 'Red
- not block? script/2
- ][
- print "*** Error: not a Red program!"
- ][
- do skip script 2
- ]
- quit
-]
-
-init-console "Red Console"
-
-print {
--=== Red Console alpha version ===-
-(only ASCII input supported)
-}
-
-do-console \ No newline at end of file
diff --git a/tests/examplefiles/example.reds b/tests/examplefiles/example.reds
deleted file mode 100644
index eb92310d..00000000
--- a/tests/examplefiles/example.reds
+++ /dev/null
@@ -1,150 +0,0 @@
-Red/System [
- Title: "Red/System example file"
- Purpose: "Just some code for testing Pygments colorizer"
- Language: http://www.red-lang.org/
-]
-
-#include %../common/FPU-configuration.reds
-
-; C types
-
-#define time! long!
-#define clock! long!
-
-date!: alias struct! [
- second [integer!] ; 0-61 (60?)
- minute [integer!] ; 0-59
- hour [integer!] ; 0-23
-
- day [integer!] ; 1-31
- month [integer!] ; 0-11
- year [integer!] ; Since 1900
-
- weekday [integer!] ; 0-6 since Sunday
- yearday [integer!] ; 0-365
- daylight-saving-time? [integer!] ; Negative: unknown
-]
-
-#either OS = 'Windows [
- #define clocks-per-second 1000
-][
- ; CLOCKS_PER_SEC value for Syllable, Linux (XSI-conformant systems)
- ; TODO: check for other systems
- #define clocks-per-second 1000'000
-]
-
-#import [LIBC-file cdecl [
-
- ; Error handling
-
- form-error: "strerror" [ ; Return error description.
- code [integer!]
- return: [c-string!]
- ]
- print-error: "perror" [ ; Print error to standard error output.
- string [c-string!]
- ]
-
-
- ; Memory management
-
- make: "calloc" [ ; Allocate zero-filled memory.
- chunks [size!]
- size [size!]
- return: [binary!]
- ]
- resize: "realloc" [ ; Resize memory allocation.
- memory [binary!]
- size [size!]
- return: [binary!]
- ]
- ]
-
- JVM!: alias struct! [
- reserved0 [int-ptr!]
- reserved1 [int-ptr!]
- reserved2 [int-ptr!]
-
- DestroyJavaVM [function! [[JNICALL] vm [JVM-ptr!] return: [jint!]]]
- AttachCurrentThread [function! [[JNICALL] vm [JVM-ptr!] penv [struct! [p [int-ptr!]]] args [byte-ptr!] return: [jint!]]]
- DetachCurrentThread [function! [[JNICALL] vm [JVM-ptr!] return: [jint!]]]
- GetEnv [function! [[JNICALL] vm [JVM-ptr!] penv [struct! [p [int-ptr!]]] version [integer!] return: [jint!]]]
- AttachCurrentThreadAsDaemon [function! [[JNICALL] vm [JVM-ptr!] penv [struct! [p [int-ptr!]]] args [byte-ptr!] return: [jint!]]]
-]
-
- ;just some datatypes for testing:
-
- #some-hash
- 10-1-2013
- quit
-
- ;binary:
- #{00FF0000}
- #{00FF0000 FF000000}
- #{00FF0000 FF000000} ;with tab instead of space
- 2#{00001111}
- 64#{/wAAAA==}
- 64#{/wAAA A==} ;with space inside
- 64#{/wAAA A==} ;with tab inside
-
-
- ;string with char
- {bla ^(ff) foo}
- {bla ^(( foo}
- ;some numbers:
- 12
- 1'000
- 1.2
- FF00FF00h
-
- ;some tests of hexa number notation with not common ending
- [ff00h ff00h] ff00h{} FFh"foo" 00h(1 + 2) (AEh)
-
-;normal words:
-foo char
-
-;get-word
-:foo
-
-;lit-word:
-'foo 'foo
-
-;multiple comment tests...
-1 + 1
-comment "aa"
-2 + 2
-comment {aa}
-3 + 3
-comment {a^{}
-4 + 4
-comment {{}}
-5 + 5
-comment {
- foo: 6
-}
-6 + 6
-comment [foo: 6]
-7 + 7
-comment [foo: "[" ]
-8 + 8
-comment [foo: {^{} ]
-9 + 9
-comment [foo: {boo} ]
-10 + 10
-comment 5-May-2014/11:17:34+2:00
-11 + 11
-
-
-to-integer foo
-foo/(a + 1)/b
-
-call/output reform ['which interpreter] path: copy ""
-
- version-1.1: 00010001h
-
- #if type = 'exe [
- push system/stack/frame ;-- save previous frame pointer
- system/stack/frame: system/stack/top ;-- @@ reposition frame pointer just after the catch flag
-]
-push CATCH_ALL ;-- exceptions root barrier
-push 0 ;-- keep stack aligned on 64-bit \ No newline at end of file
diff --git a/tests/examplefiles/example.reg b/tests/examplefiles/example.reg
deleted file mode 100644
index bc4e9df4..00000000
--- a/tests/examplefiles/example.reg
+++ /dev/null
@@ -1,19 +0,0 @@
-Windows Registry Editor Version 5.00
-; comment
-
-[HKEY_CURRENT_USER\SOFTWARE\Pygments]
-@="Hello"
-"Key With Spaces"="Something"
-"Key With ="="With Quotes"
-"Key With = 2"=dword:123
-"Key" = "Value"
-"Hex"=hex(0):1,2,3,a,b,f
-"Hex 2"=hex(5):80,00,00,ff
-
-[-HKEY_CURRENT_USER\SOFTWARE\Pygments\Subkey]
-
-[HKEY_CURRENT_USER\SOFTWARE\Pygments\Subkey2]
-; comment
-@=-
-"Foo"=-
-"Foo"="Value"
diff --git a/tests/examplefiles/example.rexx b/tests/examplefiles/example.rexx
deleted file mode 100644
index ec4da5ad..00000000
--- a/tests/examplefiles/example.rexx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* REXX example. */
-
-/* Some basic constructs. */
-almost_pi = 0.1415 + 3
-if almost_pi < 3 then
- say 'huh?'
-else do
- say 'almost_pi=' almost_pi || " - ok"
-end
-x = '"' || "'" || '''' || """" /* quotes */
-
-/* A comment
- * spawning multiple
- lines. /* / */
-
-/* Built-in functions. */
-line = 'line containing some short text'
-say WordPos(line, 'some')
-say Word(line, 4)
-
-/* Labels and procedures. */
-some_label :
-
-divide: procedure
- parse arg some other
- return some / other
-
-call divide(5, 2)
-
-/* Loops */
-do i = 1 to 5
- do j = -3 to -9 by -3
- say i '+' j '=' i + j
- end j
-end i
-
-do forever
- leave
-end
-
-/* Print a text file on MVS. */
-ADDRESS TSO
-"ALLOC F(TEXTFILE) DSN('some.text.dsn') SHR REU"
-"EXECIO * DISKR TEXTFILE ( FINIS STEM LINES."
-"FREE F(TEXTFILE)"
-I = 1
-DO WHILE I <= LINES.0
- SAY ' LINE ' I ' : ' LINES.I
- I = I + 1
-END
diff --git a/tests/examplefiles/example.rhtml b/tests/examplefiles/example.rhtml
deleted file mode 100644
index 041bec17..00000000
--- a/tests/examplefiles/example.rhtml
+++ /dev/null
@@ -1,561 +0,0 @@
-<% @title = 'Moderatoren-Interface' %>
-
-<dl>
- <dt><%= link_to 'Proben', :controller => '/admin/proben' %></dt>
- <dd>Die angesetzten Proben des Orchesters</dd>
- <dt><%= link_to 'Auftritte', :controller => '/admin/proben' %></dt>
- <dd>Die Auftritte des Orchesters</dd>
- <%- if @valid_user and @valid_user.admin? -%>
- <dt><%= link_to 'Benutzer', :controller => '/admin/user' %></dt>
- <dd>Benutzer organisieren (nur für den Admin)</dd>
- <%- end -%>
-</dl>
-<% @title = 'Anmeldung' %>
-
-<%= render :partial => 'user_form', :object => @user %>
-<% @title = 'Administrator erstellen' %>
-
-<%= render :partial => 'user_form', :object => @user %>
-<%= form_tag %>
-<table>
- <tr>
- <td>Name:</td>
- <td><%= text_field 'user', 'name' %></td>
- </tr>
- <tr>
- <td>Passwort:</td>
- <td><%= password_field 'user', 'password' %></td>
- </tr>
- <tr>
- <td></td>
- <td><%= submit_tag 'Anmelden' %></td>
-</table>
-<%= end_form_tag %>
-<% @title = 'Neuer Benutzer' -%>
-<%= error_messages_for :user %>
-<%= render :partial => 'form', :object => @user %>
-<%= form_tag %>
-<table>
- <tr>
- <td>Name:</td>
- <td><%= text_field 'user', 'name' %></td>
- </tr>
- <tr>
- <td>Passwort:</td>
- <td><%= password_field 'user', 'password' %></td>
- </tr>
- <tr>
- <td></td>
- <td><%= submit_tag 'Anlegen' %></td>
-</table>
-<%= end_form_tag %>
-<% @title = 'Auftritte' %>
-
-<table cellspacing="0" summary="Auftritte: Wann treten wir Wo auf?">
- <%= render :partial => 'head' %>
- <%= render :partial => 'day', :collection => @days %>
-</table>
-<% day, auftritte = *day -%>
-<%
- for auftritt in auftritte
--%>
-
-<tr>
- <td class="pplan_datum">
- <%= colorize day.to_s(:dots) if day %>
- <% if day and day.wday == 6 %><br /><em>Samstag</em><% end %>
- </td>
- <td class="pplan_zeit">
- <%= colorize auftritt.time %>
- </td>
- <td class="pplan_stueck">
- <%= colorize auftritt.program %>
- <%= link_to 'E', :controller => 'admin/auftritte', :action => :edit, :id => auftritt %>
- </td>
- <td class="pplan_besetzung">
- <%= colorize(auftritt.place, 'Ort: ') + '<br />' unless auftritt.place.blank? %>
- </td>
-</tr>
-
-<%
- day = nil
- end
--%>
-<tr>
- <th scope="col" class="pplan_datum">Datum</th>
- <th scope="col" class="pplan_zeit">Zeit</th>
- <th scope="col" class="pplan_stueck">Programm</th>
- <th scope="col" class="pplan_besetzung">Ort</th>
-</tr>
-<% @title = "Besetzung - #{@instrument.name}" %>
-
-<p>
-<%= pluralize(@members.size, 'Schüler spielt', 'Schüler spielen') %> <%= h @instrument.name %>:
-</p>
-
-<table class="members">
- <%= render :partial => 'member', :collection => @members %>
-</table>
-<% @title = 'Besetzung: %d Mitglieder' % Member.count -%>
-
-<div class="page-links">
-<% if params[:action] == 'all' -%>
-<%= link_to 'seitenweise', :action => :index %>
-<% else -%>
-<%= link_to_if @member_pages.current.previous, '<<', :page => @member_pages.current.previous %>
-| <%= link_to 'alle', :action => :all %> |
-<%= link_to_if @member_pages.current.next, '>>', :page => @member_pages.current.next %>
-<% end -%>
-| <%= link_to 'Nach Instrumenten', :action => :select_instrument %>
-</div>
-
-<table class="members">
-<%= render :partial => 'member', :collection => @members %>
-</table>
-<% @title = "Besetzung - Instrument wählen" %>
-
-<ul>
-<% for instr in @instruments -%>
-<li>
- <%= link_to h(instr.name), :action => :instrument, :id => instr.name %>
- <span class="counter">(<%= h instr.members.size %>)</span>
-</li>
-<% end -%>
-</ul>
-<% @title = "Besetzung: #{@member.name}" -%>
-
-<dl>
-
-<dt>Instrument / Aufgabe:</dt>
-<dd><%= link_to_instruments_of @member %></dd>
-
-<dt>Geburtstag:</dt>
-<dd><%= h @member.birthday.to_s(:dots) %></dd>
-
-<dt>Adresse:</dt>
-<dd><%= h @member.street %><br /><%= h @member.plz %></dd>
-
-<dt>Telefon:</dt>
-<dd><%= h @member.phone %></dd>
-
-<dt>Email:</dt>
-<dd><%= mail_to @member.email, @member.email, :encode => 'javascript' %></dd>
-
-</dl>
-<tr class="member">
- <td><%= link_to member.name, :action => :show, :id => member %>:
- <%= link_to_instruments_of member %>
- </td>
-</tr>
-<% @title = 'Arbeitsgruppen' -%>
-<p>
- Die Arbeitsgruppen sind verantwortlich für die Organisation und Durchführung verschiedenster Aufgaben:
-</p>
-
-<ul class="liste">
-
- <li><b>Plakate und Konzertkarten</b>
- <ul>
- <li>Frau Schraps</li>
- <li>Paul-Robert Achcenich</li>
- <li>Josefine Dahms</li>
- </ul>
- </li>
-
- <li><b>Noten</b><br />
- <ul>
- <li>Frau Puppe</li>
- <li>Theresa Rebin</li>
- </ul>
- </li>
-
- <li><b>Programme</b><br />
- <ul>
- <li>?</li>
- </ul>
- </li>
-
- <li><b>Instrumentenstransporte</b><br />
- <ul>
- <li>Frau Feldmann</li>
- <li>Knut Müller</li>
- <li>Patrick Wolter</li>
- <li>Alexaner Wolf</li>
- </ul>
- </li>
-
- <li><b>Internetseite</b><br />
- <ul>
- <li>Frau Sternbeck</li>
- <li>Uwe Ritzschke</li>
- <li>Paul-Robert Achcenich</li>
- <li>Knut Müller</li>
- <li>Alexander Wolf</li>
- </ul>
- </li>
-
-</ul>
-<% @title = 'Chronik' -%>
-<p>
- Das Jugendsinfonieorchester Marzahn-Hellersdorf wurde im Januar 2005 an der
- Musikschule Marzahn-Hellersdorf gegründet und gab im Mai 2005 sein erstes
- umjubeltes Konzert im FEZ Wuhlheide. Das Orchester umfasst zur Zeit ca. 65
- jugendliche Musiker und soll auf die Größe eines ausgewachsenen
- Sinfonieorchesters erweitert werden (80-100 Musiker).
-</p>
-
-<p>
- Als musikalischer Leiter konnte der Dirigent und Echo-Preisträger Jobst
- Liebrecht gewonnen werden, der die Musikschule schon aus einer früheren
- Zusammenarbeit anlässlich der Kinderoper 'Pollicino' von Hans Werner Henze
- kennt. Das Orchester probt wöchentlich. Neben den Tuttiproben finden außerdem
- ebenfalls wöchentlich Stimmsatzproben statt, die von Lehrkräften betreut werden.
- Das gemeinsame Ziel ist der Aufbau eines leistungsstarken, lebendigen
- Klangkörpers, der die Jugendlichen und die Zuhörer ganz neu und direkt für die
- Orchestermusik begeistert und diese Musik in den sozialen Brennpunkt Marzahn-
- Hellersdorf trägt.
-</p>
-
-<p>
- Im Jahr sind etwa 2-3 Konzertprogramme geplant, mit denen wir in Konzertsälen
- auftreten. Das erste Konzert des Jugendsinfonieorchesters Marzahn-Hellersdorf
- wurde von DeutschlandRadio Kultur aufgezeichnet und in einer Sendung mit dem
- Titel &bdquo;EINSTAND: Nicht nur auf der Strasse herumhängen&rdquo; porträtiert.
- Wir wollen außerdem vor Ort in Marzahn und Hellersdorf in die Öffentlichkeit
- gehen und spielen, um so für die Kultur zu werben und auch weitere Kinder und
- Jugendliche für die Musik und fürs Mitmachen zu gewinnen. Durch die Einrichtung
- eines zusätzlichen Vororchesters wird längerfristig versucht, die Arbeit auf ein
- breites Fundament zu stellen, eine Werkstatt, ein musikalisches Bauhaus zu
- gründen. Wenn die Orchesterarbeit erfolgreich angelaufen ist, sollen auch
- übergreifende Projekte (Theater, Tanz, Chor) stattfinden.
-</p>
-
-<p>
- Das Orchester will Musik von heute spielen in jedem Sinn, ob es sich um Stücke
- aus der sinfonischen Tradition handelt oder um zeitgenössische Musik. Wir kennen
- keine Berührungsängste und sind neugierig auf Musik aller Art und möchten diese
- Neugierde mit unserem Publikum teilen.
-</p>
-<% @title = 'Dirigent - Jobst Liebrecht' -%>
-<p>
- <%= image_tag 'jobstliebrecht.jpg', :alt => 'Jobst Liebrecht', :title => 'Jobst Liebrecht', :class => 'pic_right' %>
- Jobst Liebrecht studierte Dirigieren an der Musikhochschule in München und bei Peter Eötvös. Sein spezielles Interesse
- für neue Musik führte schnell zur Zusammenarbeit mit renommierten Ensembles auf dem Gebiet wie dem Ensemble Modern,
- Frankfurt, dem Klangforum-Ensemble, Wien, dem Ensemble Köln sowie dem Ensemble United Berlin. Aufnahmen entstanden beim
- WDR, beim DeutschlandRadio Berlin, beim BR und beim SFB. Er dirigierte u.a. das Rundfunk Sinfonieorchester Berlin, die
- Duisburger Philharmoniker und das Münchner Kammerorchester sowie in den Opernhäusern in Halle und Giessen. Tourneen im
- Ausland führten ihn nach Argentinien, Georgien, Südkorea und in die USA.
-</p>
-
-<p>
- Zu den Ur- und Erstaufführungen, die er betreut hat, gehören die Opern 'Lunu' von Moritz Eggert, 'Gloria von Jaxtberg' von
- HK Gruber sowie in Zusammenarbeit mit dem Regisseur Einar Schleef das Musiktheaterspiel 'Der Golem in Bayreuth' von Ulla
- Berkewicz/Lesch Schmidt am Wiener Burgtheater.
-</p>
-
-<p>
- Jobst Liebrecht war mehrere Jahre lang Assistent von Hans Werner Henze und auch immer wieder pädagogisch tätig. Seine
- Aufnahme von Henzes Märchenoper 'Pollicino', die als CD bei Wergo erschienen ist, wurde mit dem ECHO-Preis 2004 in der
- Sparte 'Klassik für Kinder' ausgezeichnet.
-</p>
-
-<p>
- Als Komponist ist Jobst Liebrecht mit Liedern, Kammermusik sowie Bühnenmusiken an die Öffentlichkeit getreten.
-</p>
-<% message, backtrace = session[:boom] -%>
-<% @title = 'Fehler in Zeile %d' % [backtrace[/line\s+#(\d+)/,1]] -%>
-<div class="flash">
-<div class="error"><%= h message %></div>
-</div>
-<%= debug backtrace %>
-<% cache :action_suffix => (action = params[:action]) do -%>
-<p>
-Der Inhalt für die Aktion <%= h action.inspect %> fehlt noch.
-</p>
-<% end -%>
-<% @title = 'Schulferien Berlin' -%>
-<p>
- Unser Orchester besteht zu einem sehr großen Teil aus Schülern und auch die
- Musikschule, der die meisten von uns entstammen, hat in den Schulferien
- geschlossen.<br />
- Deshalb finden innerhalb der <strong>Berliner Ferienzeiten keine Proben</strong> statt.
-</p>
-
-<table cellspacing="0" summary="Schulferien" class="ferien">
- <tr>
- <th scope="col" class="ferien_zeitraum">Zeitraum</th>
- <th scope="col" class="ferien_jahr">2006</th>
- <th scope="col" class="ferien_jahr">2007</th>
- <th scope="col" class="ferien_jahr">2008</th>
- </tr>
-
- <tr>
- <td class="ferien_zeitraum">
- Winter</td>
- <td class="ferien_jahr">
- 30.01. - 03.02.</td>
- <td class="ferien_jahr">
- 05.02. - 10.02.</td>
- <td class="ferien_jahr">
- 04.02. - 09.02.</td>
- </tr>
-
- <tr>
- <td class="ferien_zeitraum">
- Ostern/Frühjahr</td>
- <td class="ferien_jahr">
- 10.04. - 21.04.</td>
- <td class="ferien_jahr">
- 02.04. - 13.04.</td>
- <td class="ferien_jahr">
- 17.03. - 28.03.</td>
- </tr>
-
- <tr>
- <td class="ferien_zeitraum">
- Himmelf./Pfingsten</td>
- <td class="ferien_jahr">
- 30.04. / 18.05.</td>
- <td class="ferien_jahr">
- 30.04. / 18.05.</td>
- <td class="ferien_jahr">
- 02.05.</td>
- </tr>
-
- <tr>
- <td class="ferien_zeitraum">
- Sommer</td>
- <td class="ferien_jahr">
- 06.07. - 19.08.</td>
- <td class="ferien_jahr">
- 12.07. - 25.08.</td>
- <td class="ferien_jahr">
- 17.07. - 30.08.</td>
- </tr>
-
- <tr>
- <td class="ferien_zeitraum">
- Herbst</td>
- <td class="ferien_jahr">
- 02.10. - 14.10.</td>
- <td class="ferien_jahr">
- 15.10. - 27.10.</td>
- <td class="ferien_jahr">
- </td>
- </tr>
-
- <tr>
- <td class="ferien_zeitraum">
- Weihnachten</td>
- <td class="ferien_jahr">
- 27.12. - 05.01.07</td>
- <td class="ferien_jahr">
- 24.12. - 04.01.08</td>
- <td class="ferien_jahr">
- </td>
- </tr>
-
-</table>
-<% @title = 'Termine' -%>
-
-<ul>
- <li><%= link_to 'Auftritte', :controller => '/auftritte' %></li>
- <li><%= link_to 'Schulferien', :controller => '/content', :action => :schulferien %></li>
-</ul>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
-<head>
- <%= tag 'meta', :'http-equiv' => 'content-language', :content => 'de' %>
- <%= tag 'meta', :'http-equiv' => 'content-type', :content => 'text/html; charset=UTF-8' %>
- <meta name="AUTHOR" content="Knut Müller, Alexander Wolf, Uwe Ritzschke, Paul-Robert Achcenich" />
- <meta name="Publisher" content="Knut Müller, Alexander Wolf, Uwe Ritzschke, Paul-Robert Achcenich" />
- <meta name="Copyright" content="Knut Müller, Alexander Wolf, Uwe Ritzschke, Paul-Robert Achcenich, 2006" />
- <meta name="Keywords" content="Jugendsinfonieorchester,Marzahn,Hellersdorf,Marzahn-Hellersdorf,Berlin,Orchester,Jobst Liebrecht,FEZ,Pollicino,Moritz Eggert,Popel,Konzert" />
- <meta name="Description" content="JSO - JugendSinfonieOrchester der Musikschule Marzahn-Hellerdorf in Berlin" />
- <meta name="Page-topic" content="JSO Marzahn-Hellersdorf - " />
-
- <meta name="Audience" content="Alle" />
- <meta name="content-language" content="DE" />
- <meta name="Page-Type" content="Homepage" />
- <meta name="robots" content="all" />
-
- <title>JSO<%-if @title-%> - <%= h @title %><%- end -%></title>
- <%= stylesheet_link_tag '/rcss/main' %>
- <%#= stylesheet_link_tag 'main' %>
- <%= javascript_include_tag 'nospam' %>
- <%#= javascript_include_tag :defaults %>
-</head>
-
-<body>
-
-<table style="width:100%; height:100%;" cellspacing="10">
- <tr>
- <td style="height:120px; width:15%;text-align:center;vertical-align:middle;">
- <%= image_tag 'JSO-Logo.gif', :alt => 'JSO-Logo' %>
- </td>
- <td id="title">
- <div id="musikschule"><a href="http://www.musikschule-marzahn-hellersdorf.de">Musikschule Marzahn Hellersdorf</a></div>
- <div id="orchester"><strong>j</strong>ugend<strong>s</strong>infonie<strong>o</strong>rchester</div>
- </td>
- </tr>
- <tr>
- <td style="width:15%;">
-<% if valid_user -%>
-<ul>
- <li class="menu2"><%= link_to "Logout #{valid_user.name}", :controller => '/admin/admin', :action => :logout %></li>
-</ul>
-<% end -%>
-<% cache :controller => 'menu', :action => 'main_menu' do -%>
- <%= render_component :controller => 'menu', :action => 'index' %>
-<% end -%>
- </td>
- <td id="main">
-<% unless @flash.keys.empty? -%>
-<div class="flash">
- <%- for kind, msg in @flash -%>
- <div class="<%= h kind %>"><%= h msg %></div>
- <%- end -%>
-</div>
-<% end -%>
-<%= content_tag 'h3', h(@title) if @title %>
-<%= @content_for_layout %>
- </td>
- </tr>
- <tr>
- <td style="height:80px; width:15%;">
- </td>
- <td style="height:80px;">
- <div style="position:relative; top:80px; right:0px; text-align:right; font-size: x-small; color: #003;">
- powered by <a href="http://rubyonrails.org">Ruby on Rails</a> <%= Rails::Info.properties.value_for 'Rails version' %> [<%= h RAILS_ENV[/^./] %>]
- <%= image_tag 'css.png', :alt => 'valid CSS', :title => 'valid Cascading Style Sheet', :style => 'display: inline; vertical-align: middle' %>
- <%= image_tag 'xhtml11.png', :alt => 'valid XHTML 1.1', :title => 'valid eXtensible Hypertext Markup Language 1.1', :style => 'display: inline; vertical-align: middle' %>
- </div>
- </td>
- </tr>
-</table>
-
-</body>
-
-</html>
-<% @title = 'Übersicht' -%>
-
-<h4>nächste Probe</h4>
-<table cellspacing="0" summary="Probenplan: Wann wird Was geprobt?" class="proben">
- <%= render :partial => 'proben/head' %>
- <%= render :partial => 'proben/day', :object => @next_probe %>
-</table>
-<h4><%= link_to 'weitere Proben...', :controller => 'proben' %></h4>
-
-<h4>nächster Auftritt</h4>
-<table cellspacing="0" summary="Auftritte: Wann treten wir Wo auf?" class="auftritte">
- <%= render :partial => 'auftritte/head' %>
- <%= render :partial => 'auftritte/day', :object => @next_auftritt %>
-</table>
-<h4><%= link_to 'mehr Auftritte...', :controller => 'auftritte' %></h4>
-<ul>
- <%= category 'Übersicht', home_url %>
- <%= subcat 'Wer sind wir?', :wer %>
- <%= subcat 'Dirigent' %>
- <%= subcat 'Besetzung', url_for(:controller => '/besetzung') %>
- <%= subcat 'Repertoire' %>
-
- <%= category 'Termine' %>
- <%= subcat 'Auftritte', url_for(:controller => '/auftritte', :action => :plan) %>
- <%= subcat 'Schulferien' %>
-
- <%= category 'Probenplan', url_for(:controller => '/proben', :action => :plan) %>
-
- <%= category 'Organisation' %>
- <%= subcat 'Orchesterrat' %>
- <%= subcat 'Arbeitsgruppen' %>
-
- <%= category 'Chronik' %>
- <%= subcat 'Konzerte' %>
- <%= subcat 'Audio' %>
- <%= subcat 'Presse' %>
-
- <%= category 'Links', '#' %>
- <%= subcat 'Bilderseite', 'http://musikschule.iden04.de' %>
- <%= subcat 'Musikschule', 'http://www.musikschule-marzahn-hellersdorf.de' %>
-
- <li><br /></li>
-
- <%= category 'Kontakt' %>
-</ul>
-<% @title = 'Probenplan' %>
-
-<table cellspacing="0" summary="Probenplan: Wann wird Was geprobt?">
- <%= render :partial => 'head' %>
- <%= render :partial => 'day', :collection => @days %>
-</table>
-
-<p style="font-size:14px; margin-top:-10px; padding-top:0px; padding-left:40px;">
-Ort (wenn nicht anders angegeben): Schule am Pappelhof
-</p>
-
-<%= render_partial 'raum' %>
-<% day, proben = *day -%>
-<%
- for probe in proben
--%>
-
-<tr>
- <td class="pplan_datum">
- <%= colorize day.to_s(:dots) if day %>
- <% if day and day.wday == 6 %><br /><em>Samstag</em><% end %>
- </td>
- <td class="pplan_zeit">
- <%= colorize probe.time %>
- </td>
- <td class="pplan_stueck">
- <%= colorize(probe.place, 'Ort: ') + '<br />' unless probe.place.blank? %>
- <%= colorize probe.program %>
- <%= link_to 'E', :controller => 'admin/proben', :action => :edit, :id => probe %>
- </td>
- <td class="pplan_besetzung">
- <%= h probe.instrumentation %>
- </td>
-</tr>
-
-<%
- day = nil
- end
--%>
-<tr>
- <th scope="col" class="pplan_datum">Datum</th>
- <th scope="col" class="pplan_zeit">Zeit</th>
- <th scope="col" class="pplan_stueck">Stücke</th>
- <th scope="col" class="pplan_besetzung">Besetzung</th>
-</tr>
-<h4>Probenräume</h4>
-<table cellspacing="0" summary="Probenräume: Wer probt Wo?">
- <tr>
- <th scope="col" class="praum_wer">Wer</th>
- <th scope="col" class="praum_raum">Raum</th>
- <th scope="col" class="praum_adresse">Adresse</th>
-
- </tr>
- <tr>
- <td class="praum_wer">Streicher</td>
- <td class="praum_raum">Schule am Pappelhof<br />(Raum Nr.)</td>
- <td class="praum_adresse">(Anschrifft Pappelhofschule)</td>
- </tr>
- <tr>
-
- <td class="praum_wer">Blechbläser</td>
- <td class="praum_raum">Musikschule Marzahn<br />(Raum Nr.)</td>
- <td class="praum_adresse">(Anschrifft Musikscule Marzahn)</td>
- </tr>
- <tr>
- <td class="praum_wer">Holzbläser</td>
-
- <td class="praum_raum">Schule am Pappelhof<br />(Raum Nr.)</td>
- <td class="praum_adresse">(Anschrifft Pappelhofschule)</td>
- </tr>
- <tr>
- <td class="praum_wer">...</td>
- <td class="praum_raum">(Ort)<br />(Raum Nr.)</td>
-
- <td class="praum_adresse">(Anschrifft)</td>
- </tr>
-</table>
diff --git a/tests/examplefiles/example.rkt b/tests/examplefiles/example.rkt
deleted file mode 100644
index acc0328e..00000000
--- a/tests/examplefiles/example.rkt
+++ /dev/null
@@ -1,743 +0,0 @@
-#lang racket
-
-(require (only-in srfi/13 string-contains))
-
-; Single-line comment style.
-
-;; Single-line comment style.
-
-#| Multi-line comment style ... on one line |#
-
-#|
-Multi-line comment style ...
-#|### #| nested |#||| |#
-... on multiple lines
-|#
-
-#;(s-expression comment (one line))
-
-#;
-(s-expression comment
- (multiple lines))
-
-#! shebang comment
-
-#!/shebang comment
-
-#! shebang \
-comment
-
-#!/shebang \
-comment
-
-;; Uncommented numbers after single-line comments
-;; NEL…133
-;; LS
8232
-;; PS
8233
-
-#reader racket
-(define(a-function x #:keyword [y 0])
- (define foo0 'symbol) ; ()
- [define foo1 'symbol] ; []
- {define foo2 'symbol} ; {}
- (define 100-Continue 'symbol)
- (and (append (car'(1 2 3))))
- (regexp-match? #rx"foobar" "foobar")
- (regexp-match? #px"\"foo\\(bar\\)?\"" "foobar")
- (regexp-match? #rx#"foobar" "foobar")
- (regexp-match? #px#"foobar" "foobar")
- (define #csa 1)
- #Ci (let ([#%A|||b #true C
-\|d "foo"])
- (displayln #cS #%\ab\ #true\ C\
-\\d||))
- (for/list ([x (in-list (list 1 2 (list 3 4)))])
- (cond
- [(pair? x) (car x)]
- [else x])))
-
-;; Literals
-(values
- ;; #b
- #b1
- #b+1
- #b-1
- #b.1
- #b1.
- #b0.1
- #b+0.1
- #b-0.1
- #b1/10
- #b+1/10
- #b-1/10
- #b1e11
- #b+1e11
- #b-1e11
- #b.1e11
- #b1.e11
- #b0.1e11
- #b+0.1e11
- #b-0.1e11
- #b1/10e11
- #b+1/10e11
- #b-1/10e11
- #b+i
- #b1+i
- #b+1+i
- #b-1+i
- #b.1+i
- #b1.+i
- #b0.1+i
- #b+0.1+i
- #b-0.1+i
- #b1/10+i
- #b+1/10+i
- #b-1/10+i
- #b1e11+i
- #b+1e11+i
- #b-1e11+i
- #b1.e11+i
- #b.1e11+i
- #b0.1e11+i
- #b+0.1e11+i
- #b-0.1e11+i
- #b1/10e11+i
- #b+1/10e11+i
- #b-1/10e11+i
- #b+1i
- #b1+1i
- #b+1+1i
- #b-1+1i
- #b1.+1i
- #b.1+1i
- #b0.1+1i
- #b+0.1+1i
- #b-0.1+1i
- #b1/10+1i
- #b+1/10+1i
- #b-1/10+1i
- #b1e11+1i
- #b+1e11+1i
- #b-1e11+1i
- #b.1e11+1i
- #b0.1e11+1i
- #b+0.1e11+1i
- #b-0.1e11+1i
- #b1/10e11+1i
- #b+1/10e11+1i
- #b-1/10e11+1i
- #b+1/10e11i
- #b1+1/10e11i
- #b+1+1/10e11i
- #b-1+1/10e11i
- #b.1+1/10e11i
- #b0.1+1/10e11i
- #b+0.1+1/10e11i
- #b-0.1+1/10e11i
- #b1/10+1/10e11i
- #b+1/10+1/10e11i
- #b-1/10+1/10e11i
- #b1e11+1/10e11i
- #b+1e11+1/10e11i
- #b-1e11+1/10e11i
- #b.1e11+1/10e11i
- #b0.1e11+1/10e11i
- #b+0.1e11+1/10e11i
- #b-0.1e11+1/10e11i
- #b1/10e11+1/10e11i
- #b+1/10e11+1/10e11i
- #b-1/10e11+1/10e11i
- ;; #d
- #d1
- #d+1
- #d-1
- #d.1
- #d1.
- #d1.2
- #d+1.2
- #d-1.2
- #d1/2
- #d+1/2
- #d-1/2
- #d1e3
- #d+1e3
- #d-1e3
- #d.1e3
- #d1.e3
- #d1.2e3
- #d+1.2e3
- #d-1.2e3
- #d1/2e3
- #d+1/2e3
- #d-1/2e3
- #d+i
- #d1+i
- #d+1+i
- #d-1+i
- #d.1+i
- #d1.+i
- #d1.2+i
- #d+1.2+i
- #d-1.2+i
- #d1/2+i
- #d+1/2+i
- #d-1/2+i
- #d1e3+i
- #d+1e3+i
- #d-1e3+i
- #d1.e3+i
- #d.1e3+i
- #d1.2e3+i
- #d+1.2e3+i
- #d-1.2e3+i
- #d1/2e3+i
- #d+1/2e3+i
- #d-1/2e3+i
- #d+1i
- #d1+1i
- #d+1+1i
- #d-1+1i
- #d1.+1i
- #d.1+1i
- #d1.2+1i
- #d+1.2+1i
- #d-1.2+1i
- #d1/2+1i
- #d+1/2+1i
- #d-1/2+1i
- #d1e3+1i
- #d+1e3+1i
- #d-1e3+1i
- #d.1e3+1i
- #d1.2e3+1i
- #d+1.2e3+1i
- #d-1.2e3+1i
- #d1/2e3+1i
- #d+1/2e3+1i
- #d-1/2e3+1i
- #d+1/2e3i
- #d1+1/2e3i
- #d+1+1/2e3i
- #d-1+1/2e3i
- #d.1+1/2e3i
- #d1.2+1/2e3i
- #d+1.2+1/2e3i
- #d-1.2+1/2e3i
- #d1/2+1/2e3i
- #d+1/2+1/2e3i
- #d-1/2+1/2e3i
- #d1e3+1/2e3i
- #d+1e3+1/2e3i
- #d-1e3+1/2e3i
- #d.1e3+1/2e3i
- #d1.2e3+1/2e3i
- #d+1.2e3+1/2e3i
- #d-1.2e3+1/2e3i
- #d1/2e3+1/2e3i
- #d+1/2e3+1/2e3i
- #d-1/2e3+1/2e3i
- ;; Extflonums
- +nan.t
- 1t3
- +1t3
- -1t3
- .1t3
- 1.t3
- 1.2t3
- +1.2t3
- -1.2t3
- 1/2t3
- +1/2t3
- -1/2t3
- 1#t0
- 1.#t0
- .2#t0
- 1.2#t0
- 1#/2t0
- 1/2#t0
- 1#/2#t0
- 1#t3
- 1.#t3
- .2#t3
- 1.2#t3
- 1#/2t3
- 1/2#t3
- 1#/2#t3
- ;; No # reader prefix -- same as #d
- -1.23
- 1.123
- 1e3
- 1e-22
- 1/2
- -1/2
- 1
- -1
- ;; #e
- #e-1.23
- #e1.123
- #e1e3
- #e1e-22
- #e1
- #e-1
- #e1/2
- #e-1/2
- ;; #d#e
- #d#e-1.23
- #d#e1.123
- #d#e1e3
- #d#e1e-22
- #d#e1
- #d#e-1
- #d#e1/2
- #d#e-1/2
- ;; #e#d
- #e#d-1.23
- #e#d1.123
- #e#d1e3
- #e#d1e-22
- #e#d1
- #e#d-1
- #e#d1/2
- #e#d-1/2
- ;; #i always float
- #i-1.23
- #i1.123
- #i1e3
- #i1e-22
- #i1/2
- #i-1/2
- #i1
- #i-1
- ;; Implicitly inexact numbers
- +nan.0
- 1#
- 1.#
- .2#
- 1.2#
- 1#/2
- 1/2#
- 1#/2#
- 1#e3
- 1.#e3
- .2#e3
- 1.2#e3
- 1#/2e3
- 1/2#e3
- 1#/2#e3
- +nan.0+i
- 1#+i
- 1.#+i
- .2#+i
- 1.2#+i
- 1#/2+i
- 1/2#+i
- 1#/2#+i
- 1#e3+i
- 1.#e3+i
- .2#e3+i
- 1.2#e3+i
- 1#/2e3+i
- 1/2#e3+i
- 1#/2#e3+i
- +nan.0i
- +1#i
- +1.#i
- +.2#i
- +1.2#i
- +1#/2i
- +1/2#i
- +1#/2#i
- +1#e3i
- +1.#e3i
- +.2#e3i
- +1.2#e3i
- +1#/2e3i
- +1/2#e3i
- +1#/2#e3i
- 0+nan.0i
- 0+1#i
- 0+1.#i
- 0+.2#i
- 0+1.2#i
- 0+1#/2i
- 0+1/2#i
- 0+1#/2#i
- 0+1#e3i
- 0+1.#e3i
- 0+.2#e3i
- 0+1.2#e3i
- 0+1#/2e3i
- 0+1/2#e3i
- 0+1#/2#e3i
- 1#/2#e3+nan.0i
- 1#/2#e3+1#i
- 1#/2#e3+1.#i
- 1#/2#e3+.2#i
- 1#/2#e3+1.2#i
- 1#/2#e3+1#/2i
- 1#/2#e3+1/2#i
- 1#/2#e3+1#/2#i
- 1#/2#e3+1#e3i
- 1#/2#e3+1.#e3i
- 1#/2#e3+.2#e3i
- 1#/2#e3+1.2#e3i
- 1#/2#e3+1#/2e3i
- 1#/2#e3+1/2#e3i
- 1#/2#e3+1#/2#e3i
- +nan.0@1
- 1#@1
- 1.#@1
- .2#@1
- 1.2#@1
- 1#/2@1
- 1/2#@1
- 1#/2#@1
- 1#e3@1
- 1.#e3@1
- .2#e3@1
- 1.2#e3@1
- 1#/2e3@1
- 1/2#e3@1
- 1#/2#e3@1
- 1@+nan.0
- 1@1#
- 1@1.#
- 1@.2#
- 1@1.2#
- 1@1#/2
- 1@1/2#
- 1@1#/2#
- 1@1#e3
- 1@1.#e3
- 1@.2#e3
- 1@1.2#e3
- 1@1#/2e3
- 1@1/2#e3
- 1@1#/2#e3
- 1#/2#e3@1#
- 1#/2#e3@1.#
- 1#/2#e3@.2#
- 1#/2#e3@1.2#
- 1#/2#e3@1#/2
- 1#/2#e3@1/2#
- 1#/2#e3@1#/2#
- 1#/2#e3@1#e3
- 1#/2#e3@1.#e3
- 1#/2#e3@.2#e3
- 1#/2#e3@1.2#e3
- 1#/2#e3@1#/2e3
- 1#/2#e3@1/2#e3
- 1#/2#e3@1#/2#e3
- ;; #o
- #o777.777
- #o-777.777
- #o777e777
- #o777e-777
- #o3/7
- #o-3/7
- #o777
- #o-777
- #e#o777.777
- #e#o-777.777
- #e#o777e777
- #e#o777e-777
- #e#o3/7
- #e#o-3/7
- #e#o777
- #e#o-777
- #i#o777.777
- #i#o-777.777
- #i#o777e777
- #i#o777e-777
- #i#o3/7
- #i#o-3/7
- #i#o777
- #i#o-777
- ;; #x
- #x-f.f
- #xf.f
- #xfsf
- #xfs-f
- #x7/f
- #x-7/f
- #x-f
- #xf
- #e#x-f.f
- #e#xf.f
- #e#xfsf
- #e#xfs-f
- #e#x7/f
- #e#x-7/f
- #e#x-f
- #e#xf
- #i#x-f.f
- #i#xf.f
- #i#xfsf
- #i#xfs-f
- #i#x7/f
- #i#x-7/f
- #i#x-f
- #i#xf
- ;; Not numbers
- '-1.23x
- '1.123x
- '1e3x
- '1e-22x
- '1/2x
- '-1/2x
- '1x
- '-1x
- '/
- '1/
- '/2
- '1//2
- '1e3.
- '1e
- 'e3
- '.i
- '1.2.3
- '1..2
- '.1.
- '@
- '1@
- '@2
- '1@@2
- '1@2@3
- '1@2i
- '1+-2i
- '1i+2
- '1i+2i
- '1+2i+3i
- '-
- '--1
- '+
- '++1
- '1/2.3
- '1#2
- '1#.2
- '1.#2
- '.#2
- '+nan.t+nan.ti
- '+nan.t@nan.t
- ;; Booleans
- #t
- #T
- #true
- #f
- #F
- #false
- ;; Characters, strings, and byte strings
- #\
- #\Null9
- #\n9
- #\99
- #\0009
- #\u3BB
- #\u03BB9
- #\U3BB
- #\U000003BB9
- #\λ9
- "string\
- \a.\b.\t.\n.\v.\f.\r.\e.\".\'.\\.\1.\123.\1234.\x9.\x30.\x303"
- "\u9.\u1234.\u12345.\U9.\U00100000.\U001000000"
- #"byte-string\7\xff\t"
- #<<HERE STRING
-lorem ipsum
-dolor sit amet
-consectetur HERE STRING
-HERE STRING adipisicing elit
-HERE STRING
- #|
-HERE STRING
-|#
- ;; Other literals
- #(vector)
- #20()
- #s[prefab-structure 1 2 3]
- #&{box}
- #hash(("a" . 5))
- #hasheq((a . 5) (b . 7))
- #hasheqv((a . 5) (b . 7))
- #'(define x 1)
- #`(define x #,pi)
- ;; quote, quasiquote, and unquote
- 'pi
- ' pi
- ''pi
- '`pi
- '`,pi
- ',pi
- `pi
- ` pi
- `'pi
- ``pi
- `,pi
- ` , pi
- `,'pi
- `,`pi
- `,`,pi
- '(+)
- ' (+)
- ''(+)
- '`(+)
- ',(+)
- `(+)
- ` (+)
- `'(+)
- ``(+)
- `,(+)
- ` , (+)
- `,'(+)
- `,`(+)
- `,`,(+)
- #readerracket/base'pi.f
- '#readerracket/base pi.f
- #readerracket/base`pi.f
- `#readerracket/base pi.f
- #readerracket/base`,pi.f
- `#readerracket/base,pi.f
- `,#readerracket/base pi.f
- #readerracket/base'`,pi.f
- '#readerracket/base`,pi.f
- '`#readerracket/base,pi.f
- '`,#readerracket/base pi.f
- #readerracket/base'(*)
- '#readerracket/base(*)
- #readerracket/base`(*)
- `#readerracket/base(*)
- #readerracket/base`,(*)
- `#readerracket/base,(*)
- `,#readerracket/base(*)
- #readerracket/base'`,(*)
- '#readerracket/base`,(*)
- '`#readerracket/base,(*)
- '`,#readerracket/base(*)
- (quote pi)
- (quote (quote pi))
- (quote (quasiquote pi))
- (quote (quasiquote (unquote pi)))
- (quote (unquote pi))
- (quasiquote pi)
- (quasiquote (quote pi))
- (quasiquote (quasiquote pi))
- (quasiquote (unquote pi))
- (quasiquote (unquote (quote pi)))
- (quasiquote (unquote (quasiquote pi)))
- (quasiquote (unquote (quasiquote (unquote pi))))
- (quote (+))
- (quote (quote (+)))
- (quote (quasiquote (+)))
- (quote (unquote (+)))
- (quasiquote (+))
- (quasiquote (quote (+)))
- (quasiquote (quasiquote (+)))
- (quasiquote (unquote (+)))
- (quasiquote (unquote (quote (+))))
- (quasiquote (unquote (quasiquote (+))))
- (quasiquote (unquote (quasiquote (unquote (+)))))
- #reader racket/base (quote pi.f)
- (quote #reader racket/base pi.f)
- #reader racket/base (quasiquote pi.f)
- (quasiquote #reader racket/base pi.f)
- #reader racket/base (quasiquote (unquote pi.f))
- (quasiquote #reader racket/base (unquote pi.f))
- (quasiquote (unquote #reader racket/base pi.f))
- #reader racket/base (quote (quasiquote (unquote pi.f)))
- (quote #reader racket/base (quasiquote (unquote pi.f)))
- (quote (quasiquote #reader racket/base (unquote pi.f)))
- (quote (quasiquote (unquote #reader racket/base pi.f)))
- #reader racket/base (quote (*))
- (quote #reader racket/base (*))
- #reader racket/base (quasiquote (*))
- (quasiquote #reader racket/base (*))
- #reader racket/base (quasiquote (unquote (*)))
- (quasiquote #reader racket/base (unquote (*)))
- (quasiquote (unquote #reader racket/base (*)))
- #reader racket/base (quote (quasiquote (unquote (*))))
- (quote #reader racket/base (quasiquote (unquote (*))))
- (quote (quasiquote #reader racket/base (unquote (*))))
- (quote (quasiquote (unquote #reader racket/base (*))))
- ;; Make sure non-identifiers work with quotes
- ' "" pi
- ' #t pi
- ' #() pi
- ' #s(s) pi
- ' #\u3BB pi
- ' #\U000003BB pi
- ' #\space pi
- ' #\. pi
- ' #"" pi
- ' #:kw pi
- ' #&b pi
- ' #'(define x 1) pi
- ' #`(define x #,pi) pi
- ' #I0 pi
- ' #E0 pi
- ' #X0 pi
- ' #O0 pi
- ' #D0 pi
- ' #B0 pi
- ' #<<EOF
-EOF
- pi
- ' #rx"" pi
- ' #rx#"" pi
- ' #px"" pi
- ' #px#"" pi
- ' #hash() pi
- ' #hasheq[] pi
- ' #hasheqv{} pi
- ' #1(v) pi
- )
-
-;; Use the following to generate lists of built-ins and keywords.
-;; Run
-;; (displayln (wrap-lines KEYWORDS))
-;; (displayln (wrap-lines BUILTINS))
-;; and copy the results into RacketLexer._keywords and RacketLexer._builtins.
-
-;; (-> (listof string?) string?)
-;; Appends all the strings together, quoting them as appropriate for Python,
-;; with commas and spaces between them, wrapping at 80 characters, with an
-;; indentation of 8 spaces.
-(define (wrap-lines lst)
- (define INDENTATION '" ")
- (define WIDTH '80)
- (define (wrap-lines* lst done-lines current-line)
- (if (null? lst)
- (string-append (foldr string-append "" done-lines) current-line)
- (let* ([str (first lst)]
- [wrapped-str (if (regexp-match-exact? '#px"[[:ascii:]]+" str)
- (string-append "'" str "',")
- (string-append "u'" str "',"))]
- [new-line (string-append current-line " " wrapped-str)])
- (if ((string-length new-line) . >= . WIDTH)
- (wrap-lines* (rest lst)
- (append done-lines
- `(,(string-append current-line "\n")))
- (string-append INDENTATION wrapped-str))
- (wrap-lines* (rest lst)
- done-lines
- new-line)))))
- (wrap-lines* lst '() INDENTATION))
-
-;; (-> string? boolean?)
-;; Returns #t if str represents a syntax identifier in the current namespace,
-;; otherwise #f.
-(define (syntax-identifier? str)
- (with-handlers ([exn? exn?])
- (not (eval (call-with-input-string str read)))))
-
-(define RACKET-NAMESPACE
- (parameterize ([current-namespace (make-base-namespace)])
- (namespace-require 'racket)
- (current-namespace)))
-
-(define BOUND-IDENTIFIERS
- (parameterize ([current-namespace RACKET-NAMESPACE])
- (sort (map symbol->string (namespace-mapped-symbols))
- string<=?)))
-
-(define-values (KEYWORDS BUILTINS)
- (parameterize ([current-namespace RACKET-NAMESPACE])
- (partition syntax-identifier? BOUND-IDENTIFIERS)))
diff --git a/tests/examplefiles/example.rpf b/tests/examplefiles/example.rpf
deleted file mode 100644
index 162b5ed3..00000000
--- a/tests/examplefiles/example.rpf
+++ /dev/null
@@ -1,4 +0,0 @@
-declare xyz true
-declare s "some string"
-i = 2
-f = 0.2
diff --git a/tests/examplefiles/example.rts b/tests/examplefiles/example.rts
deleted file mode 100644
index 1f9cfc59..00000000
--- a/tests/examplefiles/example.rts
+++ /dev/null
@@ -1,118 +0,0 @@
-# Example of a Riverbed TrafficScript (*.rts) file.
-
-http.setHeader( "Host", "secure.mysite.com" );
-$body = http.getBody( ); # get the POST data
-$single = 'Hello \
-world';
-$double = "Hello \
-world";
-$pi = 3.14157;
-$message = "The URL path is " . http.GetPath();
-$four = 2 + 2;
-# Sets $ratio to "75%" (for example)
-$ratio = ( $a / ($a + $b) * 100 ) . "%";
-$contentLength = http.getHeader( "Content-Length" );
-if( $contentLength > 1024 * 1024 ) {
- log.warn( "Large request body: ".$contentLength );
-}
-4 + 7.5 * $a
--$b / $c - 1
-7 % 3 # Returns 1
-"foo" && !0 # true
-( 1 < 2 ) && ( 3 < 4 ) # true
-$a || $b # true if $a or $b is true
-0x1234 & 255 # 0x34
-1|2|4 #7
-1^3 #2
-~1 & 0xffff # 65534
-1 << 2 # 4
-2 >> 1 # 1
-$foo *= 5 # Product equals ($foo = $foo * 5)
-$foo /= 2 # Quotient equals ($foo = $foo / 5)
-$foo %= 2 # Modulo equals ($foo = $foo % 5)
-$foo <<= 2 # Bit-shift left equals ($foo = $foo << 2)
-$foo >>= 2 # Bit-shift right equals ($foo = $foo >> 2)
-$foo &= 2 # Bitwise AND equals ($foo = $foo & 2)
-$foo |= 2 # Bitwise OR equals ($foo = $foo | 2)
-$foo ^= 2 # Bitwise XOR equals ($foo = $foo ^ 2)
-$int = 10;
-$double = 2.71828;
-string.len( $double ); # casts to string, returns 7
-# Convert $string to a number, and add 4:
-$r = $string + 4; # $r is 14
-if( string.startsWith( $path, "/secure" ) ) {
- pool.use( "secure pool" );
-} else {
- pool.use( "non-secure pool" );
-}
-
-for( $count = 0; $count < 10; $count++ ) {
- log.info( "In loop, count = " . $count );
-}
-
-i$count = 0;
-while( $count < 10 ) {
- log.info( "In loop, count = " . $count );
- $count = $count + 1;
-}
-
-$count = 0;
-do {
- log.info( "In loop, count = " . $count );
- $count = $count + 1;
-} while( $count < 10 );
-
-$mime = http.getResponseHeader( "Content-Type" );
-if( !string.startsWith( $mime, "text/html" )) break;
-$array = [ "Alex", "Matt", "Oliver", "Laurence" ];
-$someone = $array[0];
-$arraylen = array.length($array);
-log.info("My array has " . $arraylen . " elements.\n");
-
-for ( $i = 0; $i < $arraylen; $i++ ){
- log.info ( "Element #" . $i . " " . $array[$i]);
-}
-
-$hash = [ "orange" => "fruit",
- "apple" => "fruit",
- "cabbage" => "vegetable",
- "pear" => "fruit" ];
-
-foreach ( $key in hash.keys($hash)){
- log.info("Key: " . $key . "; Value: " . $hash[$key] .
-";"); }
-
-# Declare a subroutine to calculate factorials
-sub factorial( $n ) {
- if( $n == 0 ) return 1;
- return $n*factorial( $n-1 );
-}
-# Put entries into the array
-$c = 0;
-while( $c <= 10 ) {
- $msg = "Did you know that ". $c ."! is ". factorial( $c )
-."?" ;
- data.set( "myarray".$c, $msg );
-$c++; }
-# Look up several entries. Note: the 1000th entry is empty
-$msg = "";
-$msg .= "Index 1000: ".data.get( "myarray1000" )."\n";
-# delete the entire array (but no other data stored by data.set)
-data.reset( "myarray" );
-http.sendResponse( "200 OK", "text/plain", $msg, "" );
-sub headbug(){
- # Prints each header to the event log.
- $headers = http.listHeaderNames();
- foreach ($header in $headers){
- log.info( $header . ": " . http.getheader($header));
-} }
-
-import foo;
-foo.headbug();
-# Sets the regex string as ^192\.168\. ; the two examples
-# below have the same effect
-$regex = "^(192)\\.168\\.";
-$regex = '^192\.168\.';
-if ( string.regexMatch( $ip, $regex ) ) {
- # IP is on 192.168.* network
-}
diff --git a/tests/examplefiles/example.sbl b/tests/examplefiles/example.sbl
deleted file mode 100644
index 94efada5..00000000
--- a/tests/examplefiles/example.sbl
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Stemmer for Esperanto in UTF-8 */
-
-strings ()
-
-integers ()
-
-booleans ( foreign )
-
-routines (
- apostrophe
- canonical_form
- correlative
- interjection
- short_word
- standard_suffix
- unuj
-)
-
-externals ( stem )
-
-groupings ( vowel aiou ao ou )
-
-stringdef a' decimal '225'
-stringdef e' hex 'E9'
-stringdef i' hex 'ED'
-stringdef o' hex ' f3'
-stringdef u' hex 'fa '
-
-stringdef cx hex '0109'
-stringdef gx hex '011D'
-stringdef hx hex '0125'
-stringdef jx hex '0135'
-stringdef sx hex '015D'
-stringdef ux hex '016D'
-
-define canonical_form as repeat (
- [substring]
- among (
-stringescapes //
- '/a'/' (<- 'a' set foreign)
- '/e'/' (<- 'e' set foreign)
- '/i'/' (<- 'i' set foreign)
- '/o'/' (<- 'o' set foreign)
- '/u'/' (<- 'u' set foreign)
-stringescapes `'
- 'cx' (<- '`cx'')
- 'gx' (<- '`gx'')
- 'hx' (<- '`hx'')
- 'jx' (<- '`jx'')
- 'sx' (<- '`sx'')
- 'ux' (<- '`ux'')
- '' (next)
- )
-)
-
-backwardmode (
- stringescapes { }
-
- define apostrophe as (
- (['un{'}'] atlimit <- 'unu') or
- (['l{'}'] atlimit <- 'la') or
- (['{'}'] <- 'o')
- )
-
- define vowel 'aeiou'
- define aiou vowel - 'e'
- define ao 'ao'
- define ou 'ou'
-
- define short_word as not (loop (maxint * 0 + 4 / 2) gopast vowel)
-
- define interjection as (
- among ('adia{ux}' 'aha' 'amen' 'hola' 'hura' 'mia{ux}' 'muu' 'oho')
- atlimit
- )
-
- define correlative as (
- []
- // Ignore -al, -am, etc. since they can't be confused with suffixes.
- test (
- ('a' or (try 'n'] 'e') or (try 'n' try 'j'] ou))
- 'i'
- try ('k' or 't' or '{cx}' or 'nen')
- atlimit
- )
- delete
- )
-
- define unuj as (
- [try 'n' 'j'] 'unu' atlimit delete
- )
-
- define standard_suffix as (
- [
- try ((try 'n' try 'j' ao) or (try 's' aiou) or (try 'n' 'e'))
- try '-' try 'a{ux}'
- ] delete
- )
-)
-
-define stem as (
- do canonical_form
- not foreign
- backwards (
- do apostrophe
- short_word or interjection or
- correlative or unuj or do standard_suffix
- )
-)
diff --git a/tests/examplefiles/example.scd b/tests/examplefiles/example.scd
deleted file mode 100644
index a27247e9..00000000
--- a/tests/examplefiles/example.scd
+++ /dev/null
@@ -1,76 +0,0 @@
-Instr("cs.fm.BasicFM", {
- arg freq = 440,
- amp = 0.9,
- gate = 0,
- carrierFreqRatio = 1.0,
- modulatorFreqRatio = 1.0,
- // not sure if having these defaults here actually does anything.
- modEnvShape = Env.adsr(
- attackTime: 0.05,
- decayTime: 0.1,
- sustainLevel: 0.5 * amp,
- releaseTime: 0.1,
- peakLevel: amp,
- curve: [4, -4, -2]
- ),
- carrierEnvShape = Env.adsr(
- attackTime: 0.05,
- decayTime: 0.1,
- sustainLevel: 0.5 * amp,
- releaseTime: 0.1,
- peakLevel: amp,
- curve: [4, -4, -2]
- );
-
- var carrier,
- modulator,
- carrierEnv,
- modEnv,
- out;
-
- modEnv = EnvGen.kr(
- envelope: modEnvShape,
- gate: gate
- );
-
- modulator = modEnv * SinOsc.ar(freq * modulatorFreqRatio);
-
- // carrier sustains until noteoff
- carrierEnvShape.releaseNode = 2;
-
- carrierEnv = EnvGen.kr(
- envelope: carrierEnvShape,
- gate: gate
- );
-
- carrier = carrierEnv * SinOsc.ar(
- (freq * carrierFreqRatio) + (modulator * freq)
- );
-
- // free synth when both carrier and modulator envelopes are done
- FreeSelf.kr(Done.kr(carrierEnv) + Done.kr(modEnv) - 1);
-
- out = amp * carrier;
-}, [
- \freq.asSpec(),
- \amp.asSpec(),
- \nil,
- ControlSpec(0.1, 10),
- ControlSpec(0.1, 10),
- EnvSpec(Env.adsr(
- attackTime: 0.05,
- decayTime: 0.1,
- sustainLevel: 0.8,
- releaseTime: 0.1,
- peakLevel: 1.0,
- curve: [4, -4, -2]
- )),
- EnvSpec(Env.adsr(
- attackTime: 0.05,
- decayTime: 0.1,
- sustainLevel: 0.8,
- releaseTime: 0.1,
- peakLevel: 1.0,
- curve: [4, -4, -2]
- ))
-]);
diff --git a/tests/examplefiles/example.sgf b/tests/examplefiles/example.sgf
deleted file mode 100644
index 024a461e..00000000
--- a/tests/examplefiles/example.sgf
+++ /dev/null
@@ -1,35 +0,0 @@
-(;FF[4]GM[1]SZ[19]FG[257:Figure 1]PM[1]
-PB[Takemiya Masaki]BR[9 dan]PW[Cho Chikun]
-WR[9 dan]RE[W+Resign]KM[5.5]TM[28800]DT[1996-10-18,19]
-EV[21st Meijin]RO[2 (final)]SO[Go World #78]US[Arno Hollosi]
-;B[pd];W[dp];B[pp];W[dd];B[pj];W[nc];B[oe];W[qc];B[pc];W[qd]
-(;B[qf];W[rf];B[rg];W[re];B[qg];W[pb];B[ob];W[qb]
-(;B[mp];W[fq];B[ci];W[cg];B[dl];W[cn];B[qo];W[ec];B[jp];W[jd]
-;B[ei];W[eg];B[kk]LB[qq:a][dj:b][ck:c][qp:d]N[Figure 1]
-
-;W[me]FG[257:Figure 2];B[kf];W[ke];B[lf];W[jf];B[jg]
-(;W[mf];B[if];W[je];B[ig];W[mg];B[mj];W[mq];B[lq];W[nq]
-(;B[lr];W[qq];B[pq];W[pr];B[rq];W[rr];B[rp];W[oq];B[mr];W[oo];B[mn]
-(;W[nr];B[qp]LB[kd:a][kh:b]N[Figure 2]
-
-;W[pk]FG[257:Figure 3];B[pm];W[oj];B[ok];W[qr];B[os];W[ol];B[nk];W[qj]
-;B[pi];W[pl];B[qm];W[ns];B[sr];W[om];B[op];W[qi];B[oi]
-(;W[rl];B[qh];W[rm];B[rn];W[ri];B[ql];W[qk];B[sm];W[sk];B[sh];W[og]
-;B[oh];W[np];B[no];W[mm];B[nn];W[lp];B[kp];W[lo];B[ln];W[ko];B[mo]
-;W[jo];B[km]N[Figure 3])
-
-(;W[ql]VW[ja:ss]FG[257:Dia. 6]MN[1];B[rm];W[ph];B[oh];W[pg];B[og];W[pf]
-;B[qh];W[qe];B[sh];W[of];B[sj]TR[oe][pd][pc][ob]LB[pe:a][sg:b][si:c]
-N[Diagram 6]))
-
-(;W[no]VW[jj:ss]FG[257:Dia. 5]MN[1];B[pn]N[Diagram 5]))
-
-(;B[pr]FG[257:Dia. 4]MN[1];W[kq];B[lp];W[lr];B[jq];W[jr];B[kp];W[kr];B[ir]
-;W[hr]LB[is:a][js:b][or:c]N[Diagram 4]))
-
-(;W[if]FG[257:Dia. 3]MN[1];B[mf];W[ig];B[jh]LB[ki:a]N[Diagram 3]))
-
-(;W[oc]VW[aa:sk]FG[257:Dia. 2]MN[1];B[md];W[mc];B[ld]N[Diagram 2]))
-
-(;B[qe]VW[aa:sj]FG[257:Dia. 1]MN[1];W[re];B[qf];W[rf];B[qg];W[pb];B[ob]
-;W[qb]LB[rg:a]N[Diagram 1]))
diff --git a/tests/examplefiles/example.sh b/tests/examplefiles/example.sh
deleted file mode 100644
index 2112cdd1..00000000
--- a/tests/examplefiles/example.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-printf "%d %s\n" 10 "foo"
-printf "%d %s\n" $((10#1)) "bar"
-
-let "m = 10#${1:1:2}"
-echo $m
-
-m=$((10#${1:4:3} + 10#${1:1:3}))
-echo $m
-
-m=$((10#${1:4:3}))
-echo $m
-
-m=$((10#$1))
-echo $m
-
-m=$((10#1))
-echo $m
-
-m=$((10))
-echo $m
diff --git a/tests/examplefiles/example.sh-session b/tests/examplefiles/example.sh-session
deleted file mode 100644
index 02f3bb0d..00000000
--- a/tests/examplefiles/example.sh-session
+++ /dev/null
@@ -1,19 +0,0 @@
-user@host:~/path$ ls -a
-. .. a b c
-user@host:~/path$ diff -u a b
---- a 2008-07-26 17:10:07.000000000 -0700
-+++ b 2008-07-26 17:10:10.000000000 -0700
-@@ -1,3 +1,3 @@
- a
--b
-+x
- c
-user@host:~/path$ echo \
-> a
-a
-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.shell-session b/tests/examplefiles/example.shell-session
deleted file mode 100644
index 66984aa5..00000000
--- a/tests/examplefiles/example.shell-session
+++ /dev/null
@@ -1,45 +0,0 @@
-[user@linuxbox imx-bootlets-src-10.05.02]$ make CROSS_COMPILE=arm-none-eabi- clean
-rm -rf *.sb
-rm -f sd_mmc_bootstream.raw
-rm -f linux_prep/board/*.o
-...
-Files:
-rm -f power_prep.o eabi.o
-Build output:
-make[1]: Leaving directory `/home/...'
-[user@linuxbox imx-bootlets-src-10.05.02]$ make CROSS_COMPILE=arm-none-eabi-
-make[1]: Entering directory `/home/...'
-...
-#@echo "generating U-Boot boot stream image"
-#elftosb2 -z -c ./uboot_prebuilt.db -o imx23_uboot.sb
-echo "generating kernel bootstream file sd_mmc_bootstream.raw"
-generating kernel bootstream file sd_mmc_bootstream.raw
-#Please use cfimager to burn xxx_linux.sb. The below way will no
-#work at imx28 platform.
-> test
-$ test
-rm -f sd_mmc_bootstream.raw
-[user@linuxbox imx-bootlets-src-10.05.02]$
-pi@raspberrypi ~ $ sudo sh -c "echo 17 > /sys/class/gpio/export"
-pi@raspberrypi ~ $ sudo sh -c "echo out > /sys/class/gpio/gpio17/direction"
-pi@raspberrypi ~ $ sudo sh -c "echo 1 > /sys/class/gpio/gpio17/value"
-pi@raspberrypi ~ $ sudo sh -c "echo 0 > /sys/class/gpio/gpio17/value"
-pi@raspberrypi ~ $
-[user@linuxbox ~]$ # copy other stuff to the SD card
-root@imx233-olinuxino-micro:~# lsmod
- Not tainted
-[user@linuxbox ~]$ tail -n 2 /mnt/rpi/etc/inittab
-#Spawn a getty on Raspberry Pi serial line
-T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
-pi@raspberrypi:~/Adafruit-WebIDE$ mkdir tmp
-pi@raspberrypi:~/Adafruit-WebIDE$ npm config set tmp tmp
-pi@raspberrypi:~/Adafruit-WebIDE$ npm install
-pi@raspberrypi ~/Adafruit-WebIDE $ ifconfig eth0
-eth0 Link encap:Ethernet HWaddr b5:33:ff:33:ee:aq
- inet addr:10.42.0.60 Bcast:10.42.0.255 Mask:255.255.255.0
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:21867 errors:0 dropped:0 overruns:0 frame:0
- TX packets:8684 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:27338495 (26.0 MiB) TX bytes:1268356 (1.2 MiB)
-
diff --git a/tests/examplefiles/example.shex b/tests/examplefiles/example.shex
deleted file mode 100644
index 8fab2c85..00000000
--- a/tests/examplefiles/example.shex
+++ /dev/null
@@ -1,20 +0,0 @@
-PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-PREFIX schema: <http://schema.org/>
-PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX ex: <http://pygments.example/#>
-
-ex:Lexer {
- rdfs:label xsd:string;
- skos:altLabel xsd:string*;
- ex:filenames xsd:string+;
- ex:mimetypes xsd:string+;
- ex:priority xsd:decimal MinInclusive 0.0 MaxExclusive 1.0; # seems to be the de facto range of currently defined priorities
- ex:lexes @ex:Language*;
-}
-
-ex:Language {
- schema:description rdf:langString*;
- schema:url IRI?;
-}
diff --git a/tests/examplefiles/example.sl b/tests/examplefiles/example.sl
deleted file mode 100644
index 5fb430de..00000000
--- a/tests/examplefiles/example.sl
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-#SBATCH --partition=part
-#SBATCH --job-name=job
-#SBATCH --mem=1G
-#SBATCH --cpus-per-task=8
-srun /usr/bin/sleep \ No newline at end of file
diff --git a/tests/examplefiles/example.slim b/tests/examplefiles/example.slim
deleted file mode 100644
index 0e209200..00000000
--- a/tests/examplefiles/example.slim
+++ /dev/null
@@ -1,31 +0,0 @@
-doctype html
-html
- head
- title Slim Examples
- meta name="keywords" content="template language"
- meta name="author" content=author
- javascript:
- alert('Slim supports embedded javascript!')
-
- body
- h1 Markup examples
-
- #content
- p This example shows you how a basic Slim file looks like.
-
- == yield
-
- - unless items.empty?
- table
- - for item in items do
- tr
- td.name = item.name
- td.price = item.price
- - else
- p
- | No items found. Please add some inventory.
- Thank you!
-
- div id="footer"
- = render 'footer'
- | Copyright (C) #{year} #{author}
diff --git a/tests/examplefiles/example.sls b/tests/examplefiles/example.sls
deleted file mode 100644
index 824700e7..00000000
--- a/tests/examplefiles/example.sls
+++ /dev/null
@@ -1,51 +0,0 @@
-include:
- - moosefs
-
-{% for mnt in salt['cmd.run']('ls /dev/data/moose*').split() %}
-/mnt/moose{{ mnt[-1] }}:
- mount.mounted:
- - device: {{ mnt }}
- - fstype: xfs
- - mkmnt: True
- file.directory:
- - user: mfs
- - group: mfs
- - require:
- - user: mfs
- - group: mfs
-{% endfor %}
-
-/etc/mfshdd.cfg:
- file.managed:
- - source: salt://moosefs/mfshdd.cfg
- - user: root
- - group: root
- - mode: 644
- - template: jinja
- - require:
- - pkg: mfs-chunkserver
-
-/etc/mfschunkserver.cfg:
- file.managed:
- - source: salt://moosefs/mfschunkserver.cfg
- - user: root
- - group: root
- - mode: 644
- - template: jinja
- - require:
- - pkg: mfs-chunkserver
-
-mfs-chunkserver:
- pkg:
- - installed
-mfschunkserver:
- service:
- - running
- - require:
-{% for mnt in salt['cmd.run']('ls /dev/data/moose*') %}
- - mount: /mnt/moose{{ mnt[-1] }}
- - file: /mnt/moose{{ mnt[-1] }}
-{% endfor %}
- - file: /etc/mfschunkserver.cfg
- - file: /etc/mfshdd.cfg
- - file: /var/lib/mfs
diff --git a/tests/examplefiles/example.sml b/tests/examplefiles/example.sml
deleted file mode 100644
index 31db47d2..00000000
--- a/tests/examplefiles/example.sml
+++ /dev/null
@@ -1,156 +0,0 @@
-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
deleted file mode 100644
index 26ca5cf4..00000000
--- a/tests/examplefiles/example.snobol
+++ /dev/null
@@ -1,15 +0,0 @@
--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.stan b/tests/examplefiles/example.stan
deleted file mode 100644
index 03b7b1b5..00000000
--- a/tests/examplefiles/example.stan
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
-A file for testing Stan syntax highlighting.
-
-It is not a real model and will not compile
-*/
-# also a comment
-// also a comment
-functions {
- void f1(void a, real b) {
- return 1 / a;
- }
- real f2(int a, vector b, real c) {
- return a + b + c;
- }
-}
-data {
- // valid name
- int abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_abc;
- // all types should be highlighted
- int a3;
- real foo[2];
- vector[3] bar;
- row_vector[3] baz;
- matrix[3,3] qux;
- simplex[3] quux;
- ordered[3] corge;
- positive_ordered[3] wibble;
- corr_matrix[3] grault;
- cov_matrix[3] garply;
- cholesky_factor_cov[3] waldo;
- cholesky_factor_corr[3] waldo2;
-
- real<lower=-1,upper=1> foo1;
- real<lower=0> foo2;
- real<upper=0> foo3;
-}
-transformed data {
- real xyzzy;
- int thud;
- row_vector grault2;
- matrix qux2;
-
- // all floating point literals should be recognized
- // all operators should be recognized
- // paren should be recognized;
- xyzzy <- 1234.5687 + .123 - (2.7e3 / 2E-5 * 135e-5);
- // integer literal
- thud <- -12309865;
- // ./ and .* should be recognized as operators
- grault2 <- grault .* garply ./ garply;
- // ' and \ should be recognized as operators
- qux2 <- qux' \ bar;
-
-}
-parameters {
- real fred;
- real plugh;
-}
-transformed parameters {
-}
-model {
- // ~, <- are operators,
- // T may be be recognized
- // normal is a function
- fred ~ normal(0, 1) T(-0.5, 0.5);
- real tmp;
- // C++ reserved
- real public;
-
- // control structures
- for (i in 1:10) {
- tmp <- tmp + 0.1;
- }
- tmp <- 0.0;
- while (tmp < 5.0) {
- tmp <- tmp + 1;
- }
- if (tmp > 0.0) {
- print(tmp);
- } else {
- print(tmp);
- }
-
- // operators
- tmp || tmp;
- tmp && tmp;
- tmp == tmp;
- tmp != tmp;
- tmp < tmp;
- tmp <= tmp;
- tmp > tmp;
- tmp >= tmp;
- tmp + tmp;
- tmp - tmp;
- tmp * tmp;
- tmp / tmp;
- tmp .* tmp;
- tmp ./ tmp;
- tmp ^ tmp;
- ! tmp;
- - tmp;
- + tmp;
- tmp ';
-
- // lp__ should be highlighted
- // normal_log as a function
- lp__ <- lp__ + normal_log(plugh, 0, 1);
- increment_log_prob(normal_log(plugh, 0, 1));
-
- // print statement and string literal
- print("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_~@#$%^&*`'-+={}[].,;: ");
- print("Hello, world!");
- print("");
-
- // reject statement
- reject("I just don't like it");
-
-}
-generated quantities {
- real bar1;
- bar1 <- foo + 1;
-}
diff --git a/tests/examplefiles/example.tap b/tests/examplefiles/example.tap
deleted file mode 100644
index a70a239d..00000000
--- a/tests/examplefiles/example.tap
+++ /dev/null
@@ -1,37 +0,0 @@
-TAP version 13
-1..42
-1..13 A plan only supports directives so this text is wrong.
-ok 1 A normal test line includes a number.
-ok But a test line may also omit a number.
-
-A random line that does not look like a test or diagnostic should be ignored.
- No matter how it is spaced out.
-
-Or if it is a totally blank line.
-
-not ok 3 This is a failing test line.
-
-# Diagnostics are any lines...
-# ... beginning with a hash character.
-
-not ok 4 There are a couple of directives. # TODO is one of those directives.
-not ok 5 # TODO: is invalid because the directive must be followed by a space.
-ok 6 - Another directive line # toDO is not case sensitive.
-
-ok 7 A line that is a # SKIP
-ok 8 Tests can be # skipped as long as the directive has the "skip" stem.
-ok 9 The TODO directive must be followed by a space, but # skip: is valid.
-1..0 # Skipped directives can show on a plan line too.
-
-Bail out! is a special phrase emitted when a TAP file aborted.
-
-not ok 10 Having TAP version 13 in the middle of a line is not a TAP version.
-not ok 11 Having Bail out! in the middle of a line is not a bail out.
-
-ok 12 Here is an empty directive. #
-
-# The most basic valid test lines.
-ok
-not ok
-
-ok 15 Only the test number should look different. Not another 42, for example.
diff --git a/tests/examplefiles/example.tasm b/tests/examplefiles/example.tasm
deleted file mode 100644
index d7202ffb..00000000
--- a/tests/examplefiles/example.tasm
+++ /dev/null
@@ -1,527 +0,0 @@
-;----------------------------------------------------------------------------;
-; Does A* pathfinding for rockraiders and vehicles
-;
-; Copyright 2015 Ruben De Smet
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions are
-; met:
-;
-; (1) Redistributions of source code must retain the above copyright
-; notice, this list of conditions and the following disclaimer.
-;
-; (2) Redistributions in binary form must reproduce the above copyright
-; notice, this list of conditions and the following disclaimer in
-; the documentation and/or other materials provided with the
-; distribution.
-;
-; (3) The name of the author may not be used to
-; endorse or promote products derived from this software without
-; specific prior written permission.
-;
-; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-; DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
-; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-; STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-; IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-; POSSIBILITY OF SUCH DAMAGE.
-;
-;----------------------------------------------------------------------------;
-
-IDEAL
-P386
-MODEL FLAT, C
-ASSUME cs:_TEXT,ds:FLAT,es:FLAT,fs:FLAT,gs:FLAT
-
-INCLUDE "ASTAR.INC"
-INCLUDE "READLVL.INC"
-INCLUDE "DEBUG.INC"
-
-STRUC TPriorityField
- heuristic dd ?
- distance dd ?
- x db ?
- y db ?
- fromx db ?
- fromy db ?
-ENDS
-
-STRUC TField
- distance dd ?
- x db ?
- y db ?
-ENDS
-
-CODESEG
-
-PROC getPath
- USES ecx
- ARG @@tgtx:dword, \
- @@tgty:dword \
- RETURNS eax, ebx ; eax contains x, ebx contains y
-
- call getLevelWidth
- imul eax, [@@tgty]
- add eax, [@@tgtx]
- imul eax, SIZE TField
- add eax, offset backtraceGraph
- mov ecx, eax
-
- xor eax, eax
- xor ebx, ebx
-
- mov al, [(TField ptr ecx).x]
- mov bl, [(TField ptr ecx).y]
-
- ret
-ENDP getPath
-
-PROC findPath
- ; eax will contain a 1 when a path has been found
- ; 0 otherwise.
- ARG @@srcx:dword, \
- @@srcy:dword, \
- @@tgtx:dword, \
- @@tgty:dword, \
- @@type:dword \
- RETURNS eax
-
- ; Check whether the target field is "allowed" for
- ; the selected vehicle or rock raider
- call getField, [@@tgtx], [@@tgty]
- mov al, [byte ptr eax]
- and eax, 0FFh
-
- add eax, offset actionTable
- mov eax, [eax]
- and eax, [@@type] ; TODO: for now, rock raider is hard coded
- jnz @canGoToTarget
-
- mov eax, 0
- ret
-@canGoToTarget:
-
- call cleanData
- mov eax, [@@type]
- mov [currentType], eax
-
- mov eax, [@@srcx]
- mov [currentOpen.x], al
- mov eax, [@@srcy]
- mov [currentOpen.y], al
-
- call distance, [@@srcx], [@@srcy], [@@tgtx], [@@tgty]
- ; eax <- distance
- call addOpen, [@@srcx], [@@srcy], eax, 0
-
-@openListNotEmpty:
- call popOpen
- cmp eax, 0
- je @openListEmpty
-
- call addToMap
-
- call addClosed
-
- mov eax, [@@tgtx]
- cmp [currentOpen.x], al
- jne @nextOpen
- mov eax, [@@tgty]
- cmp [currentOpen.y], al
- jne @nextOpen
-
- jmp @routeFound
-
- @nextOpen:
- call addNeighbours, [@@tgtx], [@@tgty]
-
- jmp @openListNotEmpty
-
-@openListEmpty:
- mov eax, 0
- ret
-
-@routeFound:
- mov eax, 1
- ret
-ENDP findPath
-
-PROC addToMap
- USES eax, ecx
-
- call getLevelWidth
- xor ecx, ecx
- mov cl, [currentOpen.y]
- imul eax, ecx
- mov cl, [currentOpen.x]
- add eax, ecx
- imul eax, SIZE TField
- add eax, offset backtraceGraph
-
- mov ecx, [currentOpen.distance]
- cmp [(TField ptr eax).distance], ecx
- jbe @dontAdd
-
- mov [(TField ptr eax).distance], ecx
- mov cl, [currentOpen.fromx]
- mov [(TField ptr eax).x], cl
- mov cl, [currentOpen.fromy]
- mov [(TField ptr eax).y], cl
-
-@dontAdd:
- ret
-ENDP addToMap
-
-; Is closed checks whether the field considered is "closed" for being added to the open list.
-; So, it also checks whether we can go on the selected field.
-PROC isClosed
- USES ebx, ecx, edx
- ARG @@x:dword, \
- @@y:dword RETURNS eax
-
- ; Check bounds first:
-
- call getLevelWidth
- cmp [@@x], eax
- ja notWithinBounds ; ja considers -1 > 10
-
- call getLevelHeight
- cmp [@@y], eax
- ja notWithinBounds
-
- ; Check whether this field is "allowed" for
- ; the selected vehicle or rock raider
- call getField, [@@x], [@@y]
- mov al, [byte ptr eax]
- and eax, 0FFh
-
- add eax, offset actionTable
- mov eax, [eax]
- and eax, [currentType] ; TODO: for now, rock raider is hard coded
- jnz @canGoHere
-
-
- inc eax ; mov eax, 1
- ret
-
-@canGoHere:
-
- ; Getting here means the field is okay to walk/fly/whatever on
-
- xor ecx, ecx
- mov cx, [closedlistSize]
- cmp cx, 0 ; If empty, return 0
- jne @closedNotEmpty
-
- mov eax, 0
- ret
-
-@closedNotEmpty:
- mov ebx, offset closedlist
-
-@loopClosed:
- mov edx, [@@x]
- cmp [(TField ptr ebx).x], dl
- jne @nextClosed
- mov edx, [@@y]
- cmp [(TField ptr ebx).y], dl
- jne @nextClosed
-
- ; If reached here, yep, contained in closed list
- mov eax, 1
- ret
-
- @nextClosed:
- add ebx, SIZE TField
- dec ecx
- jnz @loopClosed
-
- mov eax, 0
- ret
-
-notWithinBounds:
- mov eax, 1
- ret
-ENDP isClosed
-
-PROC addNeighbours
- USES eax, ebx, ecx, edx
- ARG @@tgtx:dword, \
- @@tgty:dword
- ; Push all neighbours of currentOpen on openList
-
- xor ebx, ebx
- xor ecx, ecx
-
- mov bl, [currentOpen.x]
- mov cl, [currentOpen.y]
- mov edx, [currentOpen.distance]
- inc edx ; Next distance is one more.
-
- ; Up
- dec ecx
- call isClosed, ebx, ecx
- cmp eax, 0
- jne @noUp
- call distance, ebx, ecx, [@@tgtx], [@@tgty]
- add eax, edx
- call addOpen, ebx, ecx, eax, edx
- @noUp:
- inc ecx
-
- ; Right
- inc ebx
- call isClosed, ebx, ecx
- cmp eax, 0
- jne @noRight
- call distance, ebx, ecx, [@@tgtx], [@@tgty]
- add eax, edx
- call addOpen, ebx, ecx, eax, edx
- @noRight:
- dec ebx
-
- ; Left
- dec ebx
- call isClosed, ebx, ecx
- cmp eax, 0
- jne @noLeft
- call distance, ebx, ecx, [@@tgtx], [@@tgty]
- add eax, edx
- call addOpen, ebx, ecx, eax, edx
- @noLeft:
- inc ebx
-
- ; Down
- inc ecx
- call isClosed, ebx, ecx
- cmp eax, 0
- jne @noDown
- call distance, ebx, ecx, [@@tgtx], [@@tgty]
- add eax, edx
- call addOpen, ebx, ecx, eax, edx
- @noDown:
- dec ecx
-
- ret
-ENDP addNeighbours
-
-PROC popOpen
- ARG RETURNS eax
- USES ebx, ecx, edx, esi, edi
- ; eax contains the smallest current heuristic
- ; ebx contains the index of that field
-
- cmp [openlistSize], 0 ; If empty, return 0
- jne @goForth
-
- mov eax, 0
- ret
-
-@goForth:
-
- mov eax, 0FFFFFFFFh ; Longest distance possible in 32 bits.
- xor ebx, ebx
- xor ecx, ecx ; ecx contains the current index
-
-@searchFurther:
- mov edx, ecx
- imul edx, SIZE TPriorityField
- cmp [(TPriorityField ptr (openlist + edx)).heuristic], eax
- ja @notBetter
- ; Better guess found, put right values in eax and ebx
- mov eax, [(TPriorityField ptr (openlist + edx)).heuristic]
- mov ebx, ecx
-
-@notBetter:
-
- inc ecx
- cmp cx, [openlistSize]
- jne @searchFurther
-
- ; By now, we have found the right item to pop from the priorityqueue.
-
- ; Move the correct item in currentOpen
- mov ecx, SIZE TPriorityField
- mov esi, ebx
- imul esi, ecx
- add esi, offset openlist
-
- mov edi, offset currentOpen
- rep movsb
-
- ; Now make the remove the thing from the vector
-
- xor ecx, ecx
- mov cx, [openlistSize]
- sub ecx, ebx
- dec ecx
- imul ecx, SIZE TPriorityField
- mov edi, esi
- sub edi, SIZE TPriorityField
- rep movsb
-
- dec [openlistSize]
- mov eax, 1
- ret
-ENDP popOpen
-
-PROC addClosed
- USES eax, ebx
-
- xor ebx, ebx
- xor eax, eax
-
- mov bx, [closedlistSize]
- imul ebx, SIZE TField
- add ebx, offset closedlist ; ebx contains the target TField
-
- mov al, [currentOpen.x]
- mov [(TField ptr ebx).x], al
- mov al, [currentOpen.y]
- mov [(TField ptr ebx).y], al
- mov eax, [currentOpen.distance]
- mov [(TField ptr ebx).distance], eax
-
- inc [closedlistSize]
- cmp [closedlistSize], CLOSED_LIST_SIZE_MAX
- jne @noProblemWithClosedVector
-
- xor eax, eax
- mov ax, [closedlistSize]
- call crash, offset closedOutOfMemory, eax
-
-@noProblemWithClosedVector:
- ret
-ENDP addClosed
-
-PROC addOpen
- USES eax, ebx
- ARG @@x:dword, \
- @@y:dword, \
- @@priority:dword, \
- @@distance:dword
-
- xor eax, eax
- mov ax, [openlistSize]
- imul eax, SIZE TPriorityField
- add eax, offset openlist
-
- mov ebx, [@@x]
- mov [(TPriorityField ptr eax).x], bl
- mov ebx, [@@y]
- mov [(TPriorityField ptr eax).y], bl
-
- mov bl, [currentOpen.x]
- mov [(TPriorityField ptr eax).fromx], bl
- mov bl, [currentOpen.y]
- mov [(TPriorityField ptr eax).fromy], bl
-
- mov ebx, [@@priority]
- mov [(TPriorityField ptr eax).heuristic], ebx
- mov ebx, [@@distance]
- mov [(TPriorityField ptr eax).distance], ebx
-
- inc [openlistSize]
- cmp [openlistSize], OPEN_LIST_SIZE_MAX
- jne @noProblem
-
- xor eax, eax
- mov ax, [openlistSize]
- call crash, offset openOutOfMemory, eax
-
-@noProblem:
- ret
-ENDP
-
-PROC distance
- USES ebx
- ARG @@srcx:dword, \
- @@srcy:dword, \
- @@tgtx:dword, \
- @@tgty:dword \
- RETURNS eax
-
- mov eax, [@@srcx]
- sub eax, [@@tgtx]
-
- jns @noSignChangex
- neg eax
-
- @noSignChangex:
-
- mov ebx, [@@srcy]
- sub ebx, [@@tgty]
-
- jns @noSignChangey
- neg ebx
-
- @noSignChangey:
- add eax, ebx
- ret
-ENDP distance
-
-PROC cleanData
- USES eax, ecx
- mov [openlistSize], 0
- mov [closedlistSize], 0
-
- mov [currentOpen.x], -1
- mov [currentOpen.y], -1
- mov [currentOpen.distance], 0
-
- call getLevelWidth
- mov ecx, eax
- call getLevelHeight
- imul ecx, eax
-
- mov eax, offset backtraceGraph
-@fieldIter:
- mov [(TField ptr eax).distance], 0ffffffffh ; Set to approximately +inf
- mov [(TField ptr eax).x], 0
- mov [(TField ptr eax).y], 0
- add eax, SIZE TField
- dec ecx
- jnz @fieldIter
-
- ret
-ENDP cleanData
-
-DATASEG
-
-openOutOfMemory db "Out of openlistSize memory. Hi dev: Please increase$"
-closedOutOfMemory db "Out of closedlistSize memory. Hi dev: Please increase$"
-
-; power | discover | walking | sailing | flying
-actionTable db 00001101b, \ ;EMPTY
- 00001101b, \ ;RUBBLE
- 00000000b, \ ;GRAVEL
- 00000000b, \ ;LOOSE ROCK
- 00000000b, \ ;HARD ROCK
- 00000000b, \ ;MASSIVE ROCK
- 00000000b, \ ;KRISTAL SOURCE
- 00000000b, \ ;OREROCK
- 00001011b, \ ;WATER
- 00001001b, \ ;LAVA
- 00001101b, \ ;SNAIL HOLE
- 00001101b, \ ;EROSION
- 00011101b, \ ;POWER PATH
- 00011101b, \ ;BUILDING POWER PATH
- 00011000b \ ;BUILDING
-
-UDATASEG
-
-currentType dd ?
-currentOpen TPriorityField ?
-
-openlist TPriorityField OPEN_LIST_SIZE_MAX dup(?)
-openlistSize dw ?
-closedlist TField CLOSED_LIST_SIZE_MAX dup(?)
-closedlistSize dw ?
-backtraceGraph TField MAX_LEVEL_SIZE dup(?)
-
-END
diff --git a/tests/examplefiles/example.tea b/tests/examplefiles/example.tea
deleted file mode 100644
index 6859e34d..00000000
--- a/tests/examplefiles/example.tea
+++ /dev/null
@@ -1,34 +0,0 @@
-<% 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.tf b/tests/examplefiles/example.tf
deleted file mode 100644
index 4cbef52c..00000000
--- a/tests/examplefiles/example.tf
+++ /dev/null
@@ -1,208 +0,0 @@
-variable "key_name" {
- description = "Name of the SSH keypair to use in AWS."
-}
-
-variable "key_path" {
- description = "Path to the private portion of the SSH key specified."
-}
-
-variable "aws_region" {
- description = "AWS region to launch servers."
- default = "us-west-2"
- somevar = true
-}
-
-# Ubuntu Precise 12.04 LTS (x64)
-variable "aws_amis" {
- default = {
- eu-west-1 = "ami-b1cf19c6"
- us-east-1 = "ami-de7ab6b6"
- us-west-1 = "ami-3f75767a"
- us-west-2 = "ami-21f78e11"
- }
-}
-
-
-resource "aws_internet_gateway" "base_igw" {
- vpc_id = "${aws_vpc.something.id}"
- tags {
- Name = "igw-${var.something}-${var.something}"
- }
-}
-
-
-
-
-
-
-provider "aws" {
- access_key = "${myvar}"
- secret_key = "your aws secret key"
- region = "us-east-1"
-}
-/* multiline
-
- comment
-
-*/
-
-
-resource "aws_route53_record" "test" {
- zone_id = "zone"
- name = "name"
- type = "A"
- alias {
- name = "alias name"
- }
-}
-
-
-# Single line comment
-resource "aws_instance" "example" {
- ami = "ami-408c7f28"
- instance_type = "t1.micro"
- key_name = "your-aws-key-name"
-}
-
-# Create our Heroku application. Heroku will
-# automatically assign a name.
-resource "heroku_app" "web" {}
-
-# Create our DNSimple record to point to the
-# heroku application.
-resource "dnsimple_record" "web" {
- domain = "${var.dnsimple_domain}"
-
-
- # heroku_hostname is a computed attribute on the heroku
- # application we can use to determine the hostname
- value = "${heroku_app.web.heroku_hostname}"
-
- type = "CNAME"
- ttl = 3600
-}
-
-# The Heroku domain, which will be created and added
-# to the heroku application after we have assigned the domain
-# in DNSimple
-resource "heroku_domain" "foobar" {
- app = "${heroku_app.web.name}"
- hostname = "${dnsimple_record.web.hostname}"
-}
-
-
-# Specify the provider and access details
-provider "aws" {
- region = "${var.aws_region}"
- value = ${file("path.txt")}
-}
-
-# Our default security group to access
-# the instances over SSH and HTTP
-resource "aws_security_group" "default" {
- name = "terraform_example"
- description = "Used in the terraform"
-
- # SSH access from anywhere
- ingress {
- from_port = 22
- to_port = 22
- protocol = "tcp"
- cidr_blocks = ["0.0.0.0/0"]
- }
-
- # HTTP access from anywhere
- ingress {
- from_port = 80
- to_port = 80
- protocol = "tcp"
- cidr_blocks = ["0.0.0.0/0"]
- }
-}
-
-
-resource "aws_elb" "web" {
- name = "terraform-example-elb"
-
- # The same availability zone as our instance
- availability_zones = ["${aws_instance.web.availability_zone}"]
-
- listener {
- instance_port = 80
- instance_protocol = "http"
- lb_port = 80
- lb_protocol = "http"
- }
-
- # The instance is registered automatically
- instances = ["${aws_instance.web.id}"]
-}
-
-
-resource "aws_instance" "web" {
- # The connection block tells our provisioner how to
- # communicate with the resource (instance)
- connection {
- # The default username for our AMI
- user = "ubuntu"
-
- # The path to your keyfile
- key_file = "${var.key_path}"
- }
-
- instance_type = "m1.small"
-
- # Lookup the correct AMI based on the region
- # we specified
- ami = "${lookup(var.aws_amis, var.aws_region)}"
-
- # The name of our SSH keypair you've created and downloaded
- # from the AWS console.
- #
- # https://console.aws.amazon.com/ec2/v2/home?region=us-west-2#KeyPairs:
- #
- key_name = "${var.key_name}"
-
- # Our Security group to allow HTTP and SSH access
- security_groups = ["${aws_security_group.default.name}"]
-
- # We run a remote provisioner on the instance after creating it.
- # In this case, we just install nginx and start it. By default,
- # this should be on port 80
- provisioner "remote-exec" {
- inline = [
- "sudo apt-get -y update",
- "sudo apt-get -y install nginx",
- "sudo service nginx start"
- ]
- }
-}
-
-
-
-resource "aws_autoscaling_group" "bar" {
- name = "terraform-asg-example"
- launch_configuration = "${aws_launch_configuration.as_conf.name}"
- min_size = 1
- max_size = 2
-
- lifecycle {
- create_before_destroy = true
- }
-}
-
-
-resource "aws_db_instance" "timeout_example" {
- allocated_storage = 10
- engine = "mysql"
- engine_version = "5.6.17"
- instance_class = "db.t1.micro"
- name = "mydb"
-
- timeouts {
- create = "60m"
- delete = "2h"
- }
-}
-
-
diff --git a/tests/examplefiles/example.thy b/tests/examplefiles/example.thy
deleted file mode 100644
index abaa1af8..00000000
--- a/tests/examplefiles/example.thy
+++ /dev/null
@@ -1,751 +0,0 @@
-(* from Isabelle2013-2 src/HOL/Power.thy; BSD license *)
-
-(* Title: HOL/Power.thy
- Author: Lawrence C Paulson, Cambridge University Computer Laboratory
- Copyright 1997 University of Cambridge
-*)
-
-header {* Exponentiation *}
-
-theory Power
-imports Num
-begin
-
-subsection {* Powers for Arbitrary Monoids *}
-
-class power = one + times
-begin
-
-primrec power :: "'a \<Rightarrow> nat \<Rightarrow> 'a" (infixr "^" 80) where
- power_0: "a ^ 0 = 1"
- | power_Suc: "a ^ Suc n = a * a ^ n"
-
-notation (latex output)
- power ("(_\<^bsup>_\<^esup>)" [1000] 1000)
-
-notation (HTML output)
- power ("(_\<^bsup>_\<^esup>)" [1000] 1000)
-
-text {* Special syntax for squares. *}
-
-abbreviation (xsymbols)
- power2 :: "'a \<Rightarrow> 'a" ("(_\<^sup>2)" [1000] 999) where
- "x\<^sup>2 \<equiv> x ^ 2"
-
-notation (latex output)
- power2 ("(_\<^sup>2)" [1000] 999)
-
-notation (HTML output)
- power2 ("(_\<^sup>2)" [1000] 999)
-
-end
-
-context monoid_mult
-begin
-
-subclass power .
-
-lemma power_one [simp]:
- "1 ^ n = 1"
- by (induct n) simp_all
-
-lemma power_one_right [simp]:
- "a ^ 1 = a"
- by simp
-
-lemma power_commutes:
- "a ^ n * a = a * a ^ n"
- by (induct n) (simp_all add: mult_assoc)
-
-lemma power_Suc2:
- "a ^ Suc n = a ^ n * a"
- by (simp add: power_commutes)
-
-lemma power_add:
- "a ^ (m + n) = a ^ m * a ^ n"
- by (induct m) (simp_all add: algebra_simps)
-
-lemma power_mult:
- "a ^ (m * n) = (a ^ m) ^ n"
- by (induct n) (simp_all add: power_add)
-
-lemma power2_eq_square: "a\<^sup>2 = a * a"
- by (simp add: numeral_2_eq_2)
-
-lemma power3_eq_cube: "a ^ 3 = a * a * a"
- by (simp add: numeral_3_eq_3 mult_assoc)
-
-lemma power_even_eq:
- "a ^ (2 * n) = (a ^ n)\<^sup>2"
- by (subst mult_commute) (simp add: power_mult)
-
-lemma power_odd_eq:
- "a ^ Suc (2*n) = a * (a ^ n)\<^sup>2"
- by (simp add: power_even_eq)
-
-lemma power_numeral_even:
- "z ^ numeral (Num.Bit0 w) = (let w = z ^ (numeral w) in w * w)"
- unfolding numeral_Bit0 power_add Let_def ..
-
-lemma power_numeral_odd:
- "z ^ numeral (Num.Bit1 w) = (let w = z ^ (numeral w) in z * w * w)"
- unfolding numeral_Bit1 One_nat_def add_Suc_right add_0_right
- unfolding power_Suc power_add Let_def mult_assoc ..
-
-lemma funpow_times_power:
- "(times x ^^ f x) = times (x ^ f x)"
-proof (induct "f x" arbitrary: f)
- case 0 then show ?case by (simp add: fun_eq_iff)
-next
- case (Suc n)
- def g \<equiv> "\<lambda>x. f x - 1"
- with Suc have "n = g x" by simp
- with Suc have "times x ^^ g x = times (x ^ g x)" by simp
- moreover from Suc g_def have "f x = g x + 1" by simp
- ultimately show ?case by (simp add: power_add funpow_add fun_eq_iff mult_assoc)
-qed
-
-end
-
-context comm_monoid_mult
-begin
-
-lemma power_mult_distrib:
- "(a * b) ^ n = (a ^ n) * (b ^ n)"
- by (induct n) (simp_all add: mult_ac)
-
-end
-
-context semiring_numeral
-begin
-
-lemma numeral_sqr: "numeral (Num.sqr k) = numeral k * numeral k"
- by (simp only: sqr_conv_mult numeral_mult)
-
-lemma numeral_pow: "numeral (Num.pow k l) = numeral k ^ numeral l"
- by (induct l, simp_all only: numeral_class.numeral.simps pow.simps
- numeral_sqr numeral_mult power_add power_one_right)
-
-lemma power_numeral [simp]: "numeral k ^ numeral l = numeral (Num.pow k l)"
- by (rule numeral_pow [symmetric])
-
-end
-
-context semiring_1
-begin
-
-lemma of_nat_power:
- "of_nat (m ^ n) = of_nat m ^ n"
- by (induct n) (simp_all add: of_nat_mult)
-
-lemma power_zero_numeral [simp]: "(0::'a) ^ numeral k = 0"
- by (simp add: numeral_eq_Suc)
-
-lemma zero_power2: "0\<^sup>2 = 0" (* delete? *)
- by (rule power_zero_numeral)
-
-lemma one_power2: "1\<^sup>2 = 1" (* delete? *)
- by (rule power_one)
-
-end
-
-context comm_semiring_1
-begin
-
-text {* The divides relation *}
-
-lemma le_imp_power_dvd:
- assumes "m \<le> n" shows "a ^ m dvd a ^ n"
-proof
- have "a ^ n = a ^ (m + (n - m))"
- using `m \<le> n` by simp
- also have "\<dots> = a ^ m * a ^ (n - m)"
- by (rule power_add)
- finally show "a ^ n = a ^ m * a ^ (n - m)" .
-qed
-
-lemma power_le_dvd:
- "a ^ n dvd b \<Longrightarrow> m \<le> n \<Longrightarrow> a ^ m dvd b"
- by (rule dvd_trans [OF le_imp_power_dvd])
-
-lemma dvd_power_same:
- "x dvd y \<Longrightarrow> x ^ n dvd y ^ n"
- by (induct n) (auto simp add: mult_dvd_mono)
-
-lemma dvd_power_le:
- "x dvd y \<Longrightarrow> m \<ge> n \<Longrightarrow> x ^ n dvd y ^ m"
- by (rule power_le_dvd [OF dvd_power_same])
-
-lemma dvd_power [simp]:
- assumes "n > (0::nat) \<or> x = 1"
- shows "x dvd (x ^ n)"
-using assms proof
- assume "0 < n"
- then have "x ^ n = x ^ Suc (n - 1)" by simp
- then show "x dvd (x ^ n)" by simp
-next
- assume "x = 1"
- then show "x dvd (x ^ n)" by simp
-qed
-
-end
-
-context ring_1
-begin
-
-lemma power_minus:
- "(- a) ^ n = (- 1) ^ n * a ^ n"
-proof (induct n)
- case 0 show ?case by simp
-next
- case (Suc n) then show ?case
- by (simp del: power_Suc add: power_Suc2 mult_assoc)
-qed
-
-lemma power_minus_Bit0:
- "(- x) ^ numeral (Num.Bit0 k) = x ^ numeral (Num.Bit0 k)"
- by (induct k, simp_all only: numeral_class.numeral.simps power_add
- power_one_right mult_minus_left mult_minus_right minus_minus)
-
-lemma power_minus_Bit1:
- "(- x) ^ numeral (Num.Bit1 k) = - (x ^ numeral (Num.Bit1 k))"
- by (simp only: eval_nat_numeral(3) power_Suc power_minus_Bit0 mult_minus_left)
-
-lemma power_neg_numeral_Bit0 [simp]:
- "neg_numeral k ^ numeral (Num.Bit0 l) = numeral (Num.pow k (Num.Bit0 l))"
- by (simp only: neg_numeral_def power_minus_Bit0 power_numeral)
-
-lemma power_neg_numeral_Bit1 [simp]:
- "neg_numeral k ^ numeral (Num.Bit1 l) = neg_numeral (Num.pow k (Num.Bit1 l))"
- by (simp only: neg_numeral_def power_minus_Bit1 power_numeral pow.simps)
-
-lemma power2_minus [simp]:
- "(- a)\<^sup>2 = a\<^sup>2"
- by (rule power_minus_Bit0)
-
-lemma power_minus1_even [simp]:
- "-1 ^ (2*n) = 1"
-proof (induct n)
- case 0 show ?case by simp
-next
- case (Suc n) then show ?case by (simp add: power_add power2_eq_square)
-qed
-
-lemma power_minus1_odd:
- "-1 ^ Suc (2*n) = -1"
- by simp
-
-lemma power_minus_even [simp]:
- "(-a) ^ (2*n) = a ^ (2*n)"
- by (simp add: power_minus [of a])
-
-end
-
-context ring_1_no_zero_divisors
-begin
-
-lemma field_power_not_zero:
- "a \<noteq> 0 \<Longrightarrow> a ^ n \<noteq> 0"
- by (induct n) auto
-
-lemma zero_eq_power2 [simp]:
- "a\<^sup>2 = 0 \<longleftrightarrow> a = 0"
- unfolding power2_eq_square by simp
-
-lemma power2_eq_1_iff:
- "a\<^sup>2 = 1 \<longleftrightarrow> a = 1 \<or> a = - 1"
- unfolding power2_eq_square by (rule square_eq_1_iff)
-
-end
-
-context idom
-begin
-
-lemma power2_eq_iff: "x\<^sup>2 = y\<^sup>2 \<longleftrightarrow> x = y \<or> x = - y"
- unfolding power2_eq_square by (rule square_eq_iff)
-
-end
-
-context division_ring
-begin
-
-text {* FIXME reorient or rename to @{text nonzero_inverse_power} *}
-lemma nonzero_power_inverse:
- "a \<noteq> 0 \<Longrightarrow> inverse (a ^ n) = (inverse a) ^ n"
- by (induct n)
- (simp_all add: nonzero_inverse_mult_distrib power_commutes field_power_not_zero)
-
-end
-
-context field
-begin
-
-lemma nonzero_power_divide:
- "b \<noteq> 0 \<Longrightarrow> (a / b) ^ n = a ^ n / b ^ n"
- by (simp add: divide_inverse power_mult_distrib nonzero_power_inverse)
-
-end
-
-
-subsection {* Exponentiation on ordered types *}
-
-context linordered_ring (* TODO: move *)
-begin
-
-lemma sum_squares_ge_zero:
- "0 \<le> x * x + y * y"
- by (intro add_nonneg_nonneg zero_le_square)
-
-lemma not_sum_squares_lt_zero:
- "\<not> x * x + y * y < 0"
- by (simp add: not_less sum_squares_ge_zero)
-
-end
-
-context linordered_semidom
-begin
-
-lemma zero_less_power [simp]:
- "0 < a \<Longrightarrow> 0 < a ^ n"
- by (induct n) (simp_all add: mult_pos_pos)
-
-lemma zero_le_power [simp]:
- "0 \<le> a \<Longrightarrow> 0 \<le> a ^ n"
- by (induct n) (simp_all add: mult_nonneg_nonneg)
-
-lemma power_mono:
- "a \<le> b \<Longrightarrow> 0 \<le> a \<Longrightarrow> a ^ n \<le> b ^ n"
- by (induct n) (auto intro: mult_mono order_trans [of 0 a b])
-
-lemma one_le_power [simp]: "1 \<le> a \<Longrightarrow> 1 \<le> a ^ n"
- using power_mono [of 1 a n] by simp
-
-lemma power_le_one: "\<lbrakk>0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> a ^ n \<le> 1"
- using power_mono [of a 1 n] by simp
-
-lemma power_gt1_lemma:
- assumes gt1: "1 < a"
- shows "1 < a * a ^ n"
-proof -
- from gt1 have "0 \<le> a"
- by (fact order_trans [OF zero_le_one less_imp_le])
- have "1 * 1 < a * 1" using gt1 by simp
- also have "\<dots> \<le> a * a ^ n" using gt1
- by (simp only: mult_mono `0 \<le> a` one_le_power order_less_imp_le
- zero_le_one order_refl)
- finally show ?thesis by simp
-qed
-
-lemma power_gt1:
- "1 < a \<Longrightarrow> 1 < a ^ Suc n"
- by (simp add: power_gt1_lemma)
-
-lemma one_less_power [simp]:
- "1 < a \<Longrightarrow> 0 < n \<Longrightarrow> 1 < a ^ n"
- by (cases n) (simp_all add: power_gt1_lemma)
-
-lemma power_le_imp_le_exp:
- assumes gt1: "1 < a"
- shows "a ^ m \<le> a ^ n \<Longrightarrow> m \<le> n"
-proof (induct m arbitrary: n)
- case 0
- show ?case by simp
-next
- case (Suc m)
- show ?case
- proof (cases n)
- case 0
- with Suc.prems Suc.hyps have "a * a ^ m \<le> 1" by simp
- with gt1 show ?thesis
- by (force simp only: power_gt1_lemma
- not_less [symmetric])
- next
- case (Suc n)
- with Suc.prems Suc.hyps show ?thesis
- by (force dest: mult_left_le_imp_le
- simp add: less_trans [OF zero_less_one gt1])
- qed
-qed
-
-text{*Surely we can strengthen this? It holds for @{text "0<a<1"} too.*}
-lemma power_inject_exp [simp]:
- "1 < a \<Longrightarrow> a ^ m = a ^ n \<longleftrightarrow> m = n"
- by (force simp add: order_antisym power_le_imp_le_exp)
-
-text{*Can relax the first premise to @{term "0<a"} in the case of the
-natural numbers.*}
-lemma power_less_imp_less_exp:
- "1 < a \<Longrightarrow> a ^ m < a ^ n \<Longrightarrow> m < n"
- by (simp add: order_less_le [of m n] less_le [of "a^m" "a^n"]
- power_le_imp_le_exp)
-
-lemma power_strict_mono [rule_format]:
- "a < b \<Longrightarrow> 0 \<le> a \<Longrightarrow> 0 < n \<longrightarrow> a ^ n < b ^ n"
- by (induct n)
- (auto simp add: mult_strict_mono le_less_trans [of 0 a b])
-
-text{*Lemma for @{text power_strict_decreasing}*}
-lemma power_Suc_less:
- "0 < a \<Longrightarrow> a < 1 \<Longrightarrow> a * a ^ n < a ^ n"
- by (induct n)
- (auto simp add: mult_strict_left_mono)
-
-lemma power_strict_decreasing [rule_format]:
- "n < N \<Longrightarrow> 0 < a \<Longrightarrow> a < 1 \<longrightarrow> a ^ N < a ^ n"
-proof (induct N)
- case 0 then show ?case by simp
-next
- case (Suc N) then show ?case
- apply (auto simp add: power_Suc_less less_Suc_eq)
- apply (subgoal_tac "a * a^N < 1 * a^n")
- apply simp
- apply (rule mult_strict_mono) apply auto
- done
-qed
-
-text{*Proof resembles that of @{text power_strict_decreasing}*}
-lemma power_decreasing [rule_format]:
- "n \<le> N \<Longrightarrow> 0 \<le> a \<Longrightarrow> a \<le> 1 \<longrightarrow> a ^ N \<le> a ^ n"
-proof (induct N)
- case 0 then show ?case by simp
-next
- case (Suc N) then show ?case
- apply (auto simp add: le_Suc_eq)
- apply (subgoal_tac "a * a^N \<le> 1 * a^n", simp)
- apply (rule mult_mono) apply auto
- done
-qed
-
-lemma power_Suc_less_one:
- "0 < a \<Longrightarrow> a < 1 \<Longrightarrow> a ^ Suc n < 1"
- using power_strict_decreasing [of 0 "Suc n" a] by simp
-
-text{*Proof again resembles that of @{text power_strict_decreasing}*}
-lemma power_increasing [rule_format]:
- "n \<le> N \<Longrightarrow> 1 \<le> a \<Longrightarrow> a ^ n \<le> a ^ N"
-proof (induct N)
- case 0 then show ?case by simp
-next
- case (Suc N) then show ?case
- apply (auto simp add: le_Suc_eq)
- apply (subgoal_tac "1 * a^n \<le> a * a^N", simp)
- apply (rule mult_mono) apply (auto simp add: order_trans [OF zero_le_one])
- done
-qed
-
-text{*Lemma for @{text power_strict_increasing}*}
-lemma power_less_power_Suc:
- "1 < a \<Longrightarrow> a ^ n < a * a ^ n"
- by (induct n) (auto simp add: mult_strict_left_mono less_trans [OF zero_less_one])
-
-lemma power_strict_increasing [rule_format]:
- "n < N \<Longrightarrow> 1 < a \<longrightarrow> a ^ n < a ^ N"
-proof (induct N)
- case 0 then show ?case by simp
-next
- case (Suc N) then show ?case
- apply (auto simp add: power_less_power_Suc less_Suc_eq)
- apply (subgoal_tac "1 * a^n < a * a^N", simp)
- apply (rule mult_strict_mono) apply (auto simp add: less_trans [OF zero_less_one] less_imp_le)
- done
-qed
-
-lemma power_increasing_iff [simp]:
- "1 < b \<Longrightarrow> b ^ x \<le> b ^ y \<longleftrightarrow> x \<le> y"
- by (blast intro: power_le_imp_le_exp power_increasing less_imp_le)
-
-lemma power_strict_increasing_iff [simp]:
- "1 < b \<Longrightarrow> b ^ x < b ^ y \<longleftrightarrow> x < y"
-by (blast intro: power_less_imp_less_exp power_strict_increasing)
-
-lemma power_le_imp_le_base:
- assumes le: "a ^ Suc n \<le> b ^ Suc n"
- and ynonneg: "0 \<le> b"
- shows "a \<le> b"
-proof (rule ccontr)
- assume "~ a \<le> b"
- then have "b < a" by (simp only: linorder_not_le)
- then have "b ^ Suc n < a ^ Suc n"
- by (simp only: assms power_strict_mono)
- from le and this show False
- by (simp add: linorder_not_less [symmetric])
-qed
-
-lemma power_less_imp_less_base:
- assumes less: "a ^ n < b ^ n"
- assumes nonneg: "0 \<le> b"
- shows "a < b"
-proof (rule contrapos_pp [OF less])
- assume "~ a < b"
- hence "b \<le> a" by (simp only: linorder_not_less)
- hence "b ^ n \<le> a ^ n" using nonneg by (rule power_mono)
- thus "\<not> a ^ n < b ^ n" by (simp only: linorder_not_less)
-qed
-
-lemma power_inject_base:
- "a ^ Suc n = b ^ Suc n \<Longrightarrow> 0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> a = b"
-by (blast intro: power_le_imp_le_base antisym eq_refl sym)
-
-lemma power_eq_imp_eq_base:
- "a ^ n = b ^ n \<Longrightarrow> 0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> 0 < n \<Longrightarrow> a = b"
- by (cases n) (simp_all del: power_Suc, rule power_inject_base)
-
-lemma power2_le_imp_le:
- "x\<^sup>2 \<le> y\<^sup>2 \<Longrightarrow> 0 \<le> y \<Longrightarrow> x \<le> y"
- unfolding numeral_2_eq_2 by (rule power_le_imp_le_base)
-
-lemma power2_less_imp_less:
- "x\<^sup>2 < y\<^sup>2 \<Longrightarrow> 0 \<le> y \<Longrightarrow> x < y"
- by (rule power_less_imp_less_base)
-
-lemma power2_eq_imp_eq:
- "x\<^sup>2 = y\<^sup>2 \<Longrightarrow> 0 \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> x = y"
- unfolding numeral_2_eq_2 by (erule (2) power_eq_imp_eq_base) simp
-
-end
-
-context linordered_ring_strict
-begin
-
-lemma sum_squares_eq_zero_iff:
- "x * x + y * y = 0 \<longleftrightarrow> x = 0 \<and> y = 0"
- by (simp add: add_nonneg_eq_0_iff)
-
-lemma sum_squares_le_zero_iff:
- "x * x + y * y \<le> 0 \<longleftrightarrow> x = 0 \<and> y = 0"
- by (simp add: le_less not_sum_squares_lt_zero sum_squares_eq_zero_iff)
-
-lemma sum_squares_gt_zero_iff:
- "0 < x * x + y * y \<longleftrightarrow> x \<noteq> 0 \<or> y \<noteq> 0"
- by (simp add: not_le [symmetric] sum_squares_le_zero_iff)
-
-end
-
-context linordered_idom
-begin
-
-lemma power_abs:
- "abs (a ^ n) = abs a ^ n"
- by (induct n) (auto simp add: abs_mult)
-
-lemma abs_power_minus [simp]:
- "abs ((-a) ^ n) = abs (a ^ n)"
- by (simp add: power_abs)
-
-lemma zero_less_power_abs_iff [simp, no_atp]:
- "0 < abs a ^ n \<longleftrightarrow> a \<noteq> 0 \<or> n = 0"
-proof (induct n)
- case 0 show ?case by simp
-next
- case (Suc n) show ?case by (auto simp add: Suc zero_less_mult_iff)
-qed
-
-lemma zero_le_power_abs [simp]:
- "0 \<le> abs a ^ n"
- by (rule zero_le_power [OF abs_ge_zero])
-
-lemma zero_le_power2 [simp]:
- "0 \<le> a\<^sup>2"
- by (simp add: power2_eq_square)
-
-lemma zero_less_power2 [simp]:
- "0 < a\<^sup>2 \<longleftrightarrow> a \<noteq> 0"
- by (force simp add: power2_eq_square zero_less_mult_iff linorder_neq_iff)
-
-lemma power2_less_0 [simp]:
- "\<not> a\<^sup>2 < 0"
- by (force simp add: power2_eq_square mult_less_0_iff)
-
-lemma abs_power2 [simp]:
- "abs (a\<^sup>2) = a\<^sup>2"
- by (simp add: power2_eq_square abs_mult abs_mult_self)
-
-lemma power2_abs [simp]:
- "(abs a)\<^sup>2 = a\<^sup>2"
- by (simp add: power2_eq_square abs_mult_self)
-
-lemma odd_power_less_zero:
- "a < 0 \<Longrightarrow> a ^ Suc (2*n) < 0"
-proof (induct n)
- case 0
- then show ?case by simp
-next
- case (Suc n)
- have "a ^ Suc (2 * Suc n) = (a*a) * a ^ Suc(2*n)"
- by (simp add: mult_ac power_add power2_eq_square)
- thus ?case
- by (simp del: power_Suc add: Suc mult_less_0_iff mult_neg_neg)
-qed
-
-lemma odd_0_le_power_imp_0_le:
- "0 \<le> a ^ Suc (2*n) \<Longrightarrow> 0 \<le> a"
- using odd_power_less_zero [of a n]
- by (force simp add: linorder_not_less [symmetric])
-
-lemma zero_le_even_power'[simp]:
- "0 \<le> a ^ (2*n)"
-proof (induct n)
- case 0
- show ?case by simp
-next
- case (Suc n)
- have "a ^ (2 * Suc n) = (a*a) * a ^ (2*n)"
- by (simp add: mult_ac power_add power2_eq_square)
- thus ?case
- by (simp add: Suc zero_le_mult_iff)
-qed
-
-lemma sum_power2_ge_zero:
- "0 \<le> x\<^sup>2 + y\<^sup>2"
- by (intro add_nonneg_nonneg zero_le_power2)
-
-lemma not_sum_power2_lt_zero:
- "\<not> x\<^sup>2 + y\<^sup>2 < 0"
- unfolding not_less by (rule sum_power2_ge_zero)
-
-lemma sum_power2_eq_zero_iff:
- "x\<^sup>2 + y\<^sup>2 = 0 \<longleftrightarrow> x = 0 \<and> y = 0"
- unfolding power2_eq_square by (simp add: add_nonneg_eq_0_iff)
-
-lemma sum_power2_le_zero_iff:
- "x\<^sup>2 + y\<^sup>2 \<le> 0 \<longleftrightarrow> x = 0 \<and> y = 0"
- by (simp add: le_less sum_power2_eq_zero_iff not_sum_power2_lt_zero)
-
-lemma sum_power2_gt_zero_iff:
- "0 < x\<^sup>2 + y\<^sup>2 \<longleftrightarrow> x \<noteq> 0 \<or> y \<noteq> 0"
- unfolding not_le [symmetric] by (simp add: sum_power2_le_zero_iff)
-
-end
-
-
-subsection {* Miscellaneous rules *}
-
-lemma power_eq_if: "p ^ m = (if m=0 then 1 else p * (p ^ (m - 1)))"
- unfolding One_nat_def by (cases m) simp_all
-
-lemma power2_sum:
- fixes x y :: "'a::comm_semiring_1"
- shows "(x + y)\<^sup>2 = x\<^sup>2 + y\<^sup>2 + 2 * x * y"
- by (simp add: algebra_simps power2_eq_square mult_2_right)
-
-lemma power2_diff:
- fixes x y :: "'a::comm_ring_1"
- shows "(x - y)\<^sup>2 = x\<^sup>2 + y\<^sup>2 - 2 * x * y"
- by (simp add: ring_distribs power2_eq_square mult_2) (rule mult_commute)
-
-lemma power_0_Suc [simp]:
- "(0::'a::{power, semiring_0}) ^ Suc n = 0"
- by simp
-
-text{*It looks plausible as a simprule, but its effect can be strange.*}
-lemma power_0_left:
- "0 ^ n = (if n = 0 then 1 else (0::'a::{power, semiring_0}))"
- by (induct n) simp_all
-
-lemma power_eq_0_iff [simp]:
- "a ^ n = 0 \<longleftrightarrow>
- a = (0::'a::{mult_zero,zero_neq_one,no_zero_divisors,power}) \<and> n \<noteq> 0"
- by (induct n)
- (auto simp add: no_zero_divisors elim: contrapos_pp)
-
-lemma (in field) power_diff:
- assumes nz: "a \<noteq> 0"
- shows "n \<le> m \<Longrightarrow> a ^ (m - n) = a ^ m / a ^ n"
- by (induct m n rule: diff_induct) (simp_all add: nz field_power_not_zero)
-
-text{*Perhaps these should be simprules.*}
-lemma power_inverse:
- fixes a :: "'a::division_ring_inverse_zero"
- shows "inverse (a ^ n) = inverse a ^ n"
-apply (cases "a = 0")
-apply (simp add: power_0_left)
-apply (simp add: nonzero_power_inverse)
-done (* TODO: reorient or rename to inverse_power *)
-
-lemma power_one_over:
- "1 / (a::'a::{field_inverse_zero, power}) ^ n = (1 / a) ^ n"
- by (simp add: divide_inverse) (rule power_inverse)
-
-lemma power_divide:
- "(a / b) ^ n = (a::'a::field_inverse_zero) ^ n / b ^ n"
-apply (cases "b = 0")
-apply (simp add: power_0_left)
-apply (rule nonzero_power_divide)
-apply assumption
-done
-
-text {* Simprules for comparisons where common factors can be cancelled. *}
-
-lemmas zero_compare_simps =
- add_strict_increasing add_strict_increasing2 add_increasing
- zero_le_mult_iff zero_le_divide_iff
- zero_less_mult_iff zero_less_divide_iff
- mult_le_0_iff divide_le_0_iff
- mult_less_0_iff divide_less_0_iff
- zero_le_power2 power2_less_0
-
-
-subsection {* Exponentiation for the Natural Numbers *}
-
-lemma nat_one_le_power [simp]:
- "Suc 0 \<le> i \<Longrightarrow> Suc 0 \<le> i ^ n"
- by (rule one_le_power [of i n, unfolded One_nat_def])
-
-lemma nat_zero_less_power_iff [simp]:
- "x ^ n > 0 \<longleftrightarrow> x > (0::nat) \<or> n = 0"
- by (induct n) auto
-
-lemma nat_power_eq_Suc_0_iff [simp]:
- "x ^ m = Suc 0 \<longleftrightarrow> m = 0 \<or> x = Suc 0"
- by (induct m) auto
-
-lemma power_Suc_0 [simp]:
- "Suc 0 ^ n = Suc 0"
- by simp
-
-text{*Valid for the naturals, but what if @{text"0<i<1"}?
-Premises cannot be weakened: consider the case where @{term "i=0"},
-@{term "m=1"} and @{term "n=0"}.*}
-lemma nat_power_less_imp_less:
- assumes nonneg: "0 < (i\<Colon>nat)"
- assumes less: "i ^ m < i ^ n"
- shows "m < n"
-proof (cases "i = 1")
- case True with less power_one [where 'a = nat] show ?thesis by simp
-next
- case False with nonneg have "1 < i" by auto
- from power_strict_increasing_iff [OF this] less show ?thesis ..
-qed
-
-lemma power_dvd_imp_le:
- "i ^ m dvd i ^ n \<Longrightarrow> (1::nat) < i \<Longrightarrow> m \<le> n"
- apply (rule power_le_imp_le_exp, assumption)
- apply (erule dvd_imp_le, simp)
- done
-
-lemma power2_nat_le_eq_le:
- fixes m n :: nat
- shows "m\<^sup>2 \<le> n\<^sup>2 \<longleftrightarrow> m \<le> n"
- by (auto intro: power2_le_imp_le power_mono)
-
-lemma power2_nat_le_imp_le:
- fixes m n :: nat
- assumes "m\<^sup>2 \<le> n"
- shows "m \<le> n"
- using assms by (cases m) (simp_all add: power2_eq_square)
-
-
-
-subsection {* Code generator tweak *}
-
-lemma power_power_power [code]:
- "power = power.power (1::'a::{power}) (op *)"
- unfolding power_def power.power_def ..
-
-declare power.power.simps [code]
-
-code_identifier
- code_module Power \<rightharpoonup> (SML) Arith and (OCaml) Arith and (Haskell) Arith
-
-end
-
diff --git a/tests/examplefiles/example.todotxt b/tests/examplefiles/example.todotxt
deleted file mode 100644
index 55ee5286..00000000
--- a/tests/examplefiles/example.todotxt
+++ /dev/null
@@ -1,9 +0,0 @@
-(A) Call Mom @Phone +Family
-(A) 2014-01-08 Schedule annual checkup +Health
-(B) Outline chapter 5 +Novel @Computer
-(C) Add cover sheets @Office +TPSReports
-Plan backyard herb garden @Home
-Pick up milk @GroceryStore
-Research self-publishing services +Novel @Computer
-x 2014-01-10 Download Todo.txt mobile app @Phone
-x 2014-01-10 2014-01-07 Download Todo.txt CLI @Computer
diff --git a/tests/examplefiles/example.toml b/tests/examplefiles/example.toml
deleted file mode 100644
index 9c60c79f..00000000
--- a/tests/examplefiles/example.toml
+++ /dev/null
@@ -1,181 +0,0 @@
-# This is a TOML document comment
-
-title = "TOML example file" # This is an inline comment
-
-[examples]
-# Examples taken from https://github.com/toml-lang/toml/blob/master/README.md
-key = "value"
-bare_key = "value"
-bare-key = "value"
-1234 = "value"
-"127.0.0.1" = "value"
-"character encoding" = "value"
-"ʎǝʞ" = "value"
-'key2' = "value"
-'quoted "value"' = "value"
-name = "Orange"
-physical.color = "orange"
-physical.shape = "round"
-site."google.com" = true
-a.b.c = 1
-a.d = 2
-
-[strings]
-str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF."
-str1 = """
-Roses are red
-Violets are blue"""
-str2 = "Roses are red\nViolets are blue"
-str3 = "Roses are red\r\nViolets are blue"
-
- [strings.equivalents]
- str1 = "The quick brown fox jumps over the lazy dog."
- str2 = """
-The quick brown \
-
-
- fox jumps over \
- the lazy dog."""
- str3 = """\
- The quick brown \
- fox jumps over \
- the lazy dog.\
- """
-
- [strings.literal]
- winpath = 'C:\Users\nodejs\templates'
- winpath2 = '\\ServerX\admin$\system32\'
- quoted = 'Tom "Dubs" Preston-Werner'
- regex = '<\i\c*\s*>'
-
- [strings.multiline]
- regex2 = '''I [dw]on't need \d{2} apples'''
- lines = '''
-The first newline is
-trimmed in raw strings.
- All other whitespace
- is preserved.
-'''
-
-[integers]
-int1 = +99
-int2 = 42
-int3 = 0
-int4 = -17
-int5 = 1_000
-int6 = 5_349_221
-int7 = 1_2_3_4_5 # discouraged format
-# hexadecimal with prefix `0x`
-hex1 = 0xDEADBEEF
-hex2 = 0xdeadbeef
-hex3 = 0xdead_beef
-# octal with prefix `0o`
-oct1 = 0o01234567
-oct2 = 0o755 # useful for Unix file permissions
-# binary with prefix `0b`
-bin1 = 0b11010110
-
-[floats]
-# fractional
-flt1 = +1.0
-flt2 = 3.1415
-flt3 = -0.01
-# exponent
-flt4 = 5e+22
-flt5 = 1e6
-flt6 = -2E-2
-# both
-flt7 = 6.626e-34
-# with underscores, for readability
-flt8 = 224_617.445_991_228
-# infinity
-sf1 = inf # positive infinity
-sf2 = +inf # positive infinity
-sf3 = -inf # negative infinity
-# not a number
-sf4 = nan # actual sNaN/qNaN encoding is implementation specific
-sf5 = +nan # same as `nan`
-sf6 = -nan # valid, actual encoding is implementation specific
-# plus/minus zero
-sf0_1 = +0.0
-sf0_2 = -0.0
-
-[booleans]
-bool1 = true
-bool2 = false
-
-[datetime.offset]
-odt1 = 1979-05-27T07:32:00Z
-odt2 = 1979-05-27T00:32:00-07:00
-odt3 = 1979-05-27T00:32:00.999999-07:00
-odt4 = 1979-05-27 07:32:00Z
-
-[datetime.local]
-ldt1 = 1979-05-27T07:32:00
-ldt2 = 1979-05-27T00:32:00.999999
-
-[date.local]
-ld1 = 1979-05-27
-
-[time.local]
-lt1 = 07:32:00
-lt2 = 00:32:00.999999
-
-[arrays]
-arr1 = [ 1, 2, 3 ]
-arr2 = [ "red", "yellow", "green" ]
-arr3 = [ [ 1, 2 ], [3, 4, 5] ]
-arr4 = [ "all", 'strings', """are the same""", '''type''']
-arr5 = [ [ 1, 2 ], ["a", "b", "c"] ]
-arr6 = [ 1, 2.0 ] # INVALID
-arr7 = [
- 1, 2, 3
-]
-arr8 = [
- 1,
- 2, # this is ok
-]
-
-["inline tables"]
-name = { first = "Tom", last = "Preston-Werner" }
-point = { x = 1, y = 2 }
-animal = { type.name = "pug" }
-
-["arrays of tables"]
-points = [ { x = 1, y = 2, z = 3 },
- { x = 7, y = 8, z = 9 },
- { x = 2, y = 4, z = 8 } ]
-
- [products]
-
- [[products]]
- name = "Hammer"
- sku = 738594937
-
- [[products]]
-
- [[products]]
- name = "Nail"
- sku = 284758393
- color = "gray"
-
- [fruits]
-
- [[fruit]]
- name = "apple"
-
- [fruit.physical]
- color = "red"
- shape = "round"
-
- [[fruit.variety]]
- name = "red delicious"
-
- [[fruit.variety]]
- name = "granny smith"
-
- [[fruit]]
- name = "banana"
-
- [[fruit.variety]]
- name = "plantain"
diff --git a/tests/examplefiles/example.ttl b/tests/examplefiles/example.ttl
deleted file mode 100644
index e524d86c..00000000
--- a/tests/examplefiles/example.ttl
+++ /dev/null
@@ -1,43 +0,0 @@
-@base <http://example.com> .
-@prefix dcterms: <http://purl.org/dc/terms/>. @prefix xs: <http://www.w3.org/2001/XMLSchema> .
-@prefix mads: <http://www.loc.gov/mads/rdf/v1#> .
-@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
-@PREFIX dc: <http://purl.org/dc/elements/1.1/> # SPARQL-like syntax is OK
-@prefix : <http://xmlns.com/foaf/0.1/> . # empty prefix is OK
-
-<http://example.org/#spiderman> <http://www.perceive.net/schemas/relationship/enemyOf> <http://example.org/#green-goblin> .
-
-<#doc1> a <#document>
- dc:creator "Smith", "Jones";
- :knows <http://getopenid.com/jsmith>
- dcterms:hasPart [ # A comment
- dc:title "Some title", "Some other title";
- dc:creator "برشت، برتولد"@ar;
- dc:date "2009"^^xs:date
- ];
- dc:title "A sample title", 23.0;
- dcterms:isPartOf [
- dc:title "another", "title"
- ] ;
- :exists true .
-
-<http://data.ub.uio.no/realfagstermer/006839> a mads:Topic,
- skos:Concept ;
- dcterms:created "2014-08-25"^^xsd:date ;
- dcterms:modified "2014-11-12"^^xsd:date ;
- dcterms:identifier "REAL006839" ;
- skos:prefLabel "Flerbørstemarker"@nb,
- "Polychaeta"@la ;
- skos:altLabel "Flerbørsteormer"@nb,
- "Mangebørstemark"@nb,
- "Mangebørsteormer"@nb,
- "Havbørsteormer"@nb,
- "Havbørstemarker"@nb,
- "Polycheter"@nb.
- skos:inScheme <http://data.ub.uio.no/realfagstermer/> ;
- skos:narrower <http://data.ub.uio.no/realfagstermer/018529>,
- <http://data.ub.uio.no/realfagstermer/024538>,
- <http://data.ub.uio.no/realfagstermer/026723> ;
- skos:exactMatch <http://ntnu.no/ub/data/tekord#NTUB17114>,
- <http://dewey.info/class/592.62/e23/>,
- <http://aims.fao.org/aos/agrovoc/c_29110> .
diff --git a/tests/examplefiles/example.u b/tests/examplefiles/example.u
deleted file mode 100644
index 8c6686eb..00000000
--- a/tests/examplefiles/example.u
+++ /dev/null
@@ -1,547 +0,0 @@
- // 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.u1 b/tests/examplefiles/example.u1
deleted file mode 100644
index 92c45365..00000000
--- a/tests/examplefiles/example.u1
+++ /dev/null
@@ -1,111 +0,0 @@
-version U12.1.00
-uid version.u1-1494453463-0
-impl local
-global 1
- 0,000005,version,0
-
-
-proc version
- local 0,000000,tab
- local 1,000000,find
- local 2,000000,many
- con 0,010000,8,126,145,162,163,151,157,156,040
- con 1,002000,1,8
- con 2,020000,11,060,061,062,063,064,065,066,067,070,071,056
- con 3,002000,1,1
- declend
- filen version.icn
- line 23
- colm 11
- synt any
- mark L1
- line 25
- colm 4
- synt any
- keywd version
- line 25
- colm 13
- synt any
- bscan
- mark L2
- mark L3
- var 0
- pnull
- var 1
- str 0
- line 26
- colm 15
- synt any
- invoke 1
- int 1
- line 26
- colm 28
- synt any
- plus
- line 26
- colm 10
- synt any
- invoke 1
- line 26
- colm 33
- synt any
- esusp
- goto L4
-lab L3
- line 26
- colm 35
- synt any
- pfail
-lab L4
- unmark
-lab L2
- var 0
- var 2
- cset 2
- line 27
- colm 15
- synt any
- invoke 1
- line 27
- colm 10
- synt any
- invoke 1
- line 27
- colm 32
- synt any
- bscan
- mark L5
- var 0
- pnull
- int 3
- line 27
- colm 45
- synt any
- neg
- line 27
- colm 44
- synt any
- invoke 1
- line 27
- colm 34
- synt any
- pret
-lab L5
- synt any
- pfail
- line 27
- colm 32
- synt any
- escan
- line 25
- colm 13
- synt any
- escan
- unmark
-lab L1
- pnull
- line 30
- colm 1
- synt any
- pfail
- end \ No newline at end of file
diff --git a/tests/examplefiles/example.vbs b/tests/examplefiles/example.vbs
deleted file mode 100644
index d962b73d..00000000
--- a/tests/examplefiles/example.vbs
+++ /dev/null
@@ -1,55 +0,0 @@
-rem VBScript examples
-
-' Various constants of different types
-const someText = "some " & """text"""
-const someInt = 123
-const someHex = &h3110c0d3
-const someFloat = 123.45e-67
-const someDate = #1/2/2016#
-const someTime = #12:34:56 AM#
-const someBool = vbTrue ' -1
-
-' Do some math.
-radius = 1.e2
-area = radius ^ 2 * 3.1315
-a = 17 : b = 23
-c = sqr(a ^2 + b ^ 2)
-
-' Write 10 files.
-For i = 1 to 10
- createFile( i )
-Next
-
-Public Sub createFile(a)
- Dim fso, TargetFile
- TargetPath = "C:\some_" & a & ".tmp"
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set TargetFile = fso.CreateTextFile(TargetPath)
- TargetFile.WriteLine("Hello " & vbCrLf & "world!")
- TargetFile.Close
-End Sub
-
-' Define a class with a property.
-Class Customer
- Private m_CustomerName
-
- Private Sub Class_Initialize
- m_CustomerName = ""
- End Sub
-
- ' CustomerName property.
- Public Property Get CustomerName
- CustomerName = m_CustomerName
- End Property
-
- Public Property Let CustomerName(custname)
- m_CustomerName = custname
- End Property
-End Class
-
-' Special constructs
-Option Explicit
-On Error Resume Next
-On Error Goto 0
-
-' Comment without terminating CR/LF. \ No newline at end of file
diff --git a/tests/examplefiles/example.weechatlog b/tests/examplefiles/example.weechatlog
deleted file mode 100644
index 15e8130f..00000000
--- a/tests/examplefiles/example.weechatlog
+++ /dev/null
@@ -1,11 +0,0 @@
-**** Beginning of log 2007 Sep 01 00:23:55 ****
-2007 Sep 01 00:23:55 --> weechat_user (weechat@localhost.) ist in den Channel &bitlbee gekommen
-2007 Sep 01 00:23:55 -=- Modus &bitlbee [+t] durch localhost.
-2007 Sep 01 00:23:55 -@- Nicks &bitlbee: [@root @weechat_user]
-2007 Sep 01 00:23:55 -=- Channel &bitlbee: 2 Nicks (2 Operatoren, 0 Halb-Operator, 0 Gevoiceter, 0 normal)
-2007 Sep 01 00:23:55 -=- Das Topic von &bitlbee lautet: "Welcome to the control channel. Type help for help information."
-2007 Sep 01 00:23:55 <root> Welcome to the BitlBee gateway!
-2007 Sep 01 00:23:55 <root>
-2007 Sep 01 00:23:55 <root> If you've never used BitlBee before, please do read the help information using the help command. Lots of FAQ's are answered there.
-# check for fixed pathological matching behavior
-1111111111111111111111111111111
diff --git a/tests/examplefiles/example.whiley b/tests/examplefiles/example.whiley
deleted file mode 100644
index 74b39370..00000000
--- a/tests/examplefiles/example.whiley
+++ /dev/null
@@ -1,296 +0,0 @@
-/**
- * Example Whiley program, taken from the Whiley benchmark suite.
- * https://github.com/Whiley/WyBench/blob/master/src/101_interpreter/Main.whiley
- */
-
-import whiley.lang.System
-import whiley.lang.Int
-import whiley.io.File
-import string from whiley.lang.ASCII
-import char from whiley.lang.ASCII
-
-// ====================================================
-// A simple calculator for expressions
-// ====================================================
-
-constant ADD is 0
-constant SUB is 1
-constant MUL is 2
-constant DIV is 3
-
-// binary operation
-type BOp is (int x) where ADD <= x && x <= DIV
-type BinOp is { BOp op, Expr lhs, Expr rhs }
-
-// variables
-type Var is { string id }
-
-// list access
-type ListAccess is {
- Expr src,
- Expr index
-}
-
-// expression tree
-type Expr is int | // constant
- Var | // variable
- BinOp | // binary operator
- Expr[] | // array constructor
- ListAccess // list access
-
-// values
-type Value is int | Value[]
-
-// stmts
-type Print is { Expr rhs }
-type Set is { string lhs, Expr rhs }
-type Stmt is Print | Set
-
-// ====================================================
-// Expression Evaluator
-// ====================================================
-
-type RuntimeError is { string msg }
-type Environment is [{string k, Value v}]
-
-// Evaluate an expression in a given environment reducing either to a
-// value, or a runtime error. The latter occurs if evaluation gets
-// "stuck" (e.g. expression is // not well-formed)
-function evaluate(Expr e, Environment env) -> Value | RuntimeError:
- //
- if e is int:
- return e
- else if e is Var:
- return env[e.id]
- else if e is BinOp:
- Value|RuntimeError lhs = evaluate(e.lhs, env)
- Value|RuntimeError rhs = evaluate(e.rhs, env)
- // check if stuck
- if !(lhs is int && rhs is int):
- return {msg: "arithmetic attempted on non-numeric value"}
- // switch statement would be good
- if e.op == ADD:
- return lhs + rhs
- else if e.op == SUB:
- return lhs - rhs
- else if e.op == MUL:
- return lhs * rhs
- else if rhs != 0:
- return lhs / rhs
- return {msg: "divide-by-zero"}
- else if e is Expr[]:
- [Value] r = []
- for i in e:
- Value|RuntimeError v = evaluate(i, env)
- if v is RuntimeError:
- return v
- else:
- r = r ++ [v]
- return r
- else if e is ListAccess:
- Value|RuntimeError src = evaluate(e.src, env)
- Value|RuntimeError index = evaluate(e.index, env)
- // santity checks
- if src is [Value] && index is int && index >= 0 && index < |src|:
- return src[index]
- else:
- return {msg: "invalid list access"}
- else:
- return 0 // dead-code
-
-// ====================================================
-// Expression Parser
-// ====================================================
-
-type State is { string input, int pos }
-type SyntaxError is { string msg, int start, int end }
-
-function SyntaxError(string msg, int start, int end) -> SyntaxError:
- return { msg: msg, start: start, end: end }
-
-// Top-level parse method
-function parse(State st) -> (Stmt,State)|SyntaxError:
- //
- Var keyword, Var v
- Expr e
- int start = st.pos
- //
- keyword,st = parseIdentifier(st)
- switch keyword.id:
- case "print":
- any r = parseAddSubExpr(st)
- if !(r is SyntaxError):
- e,st = r
- return {rhs: e},st
- else:
- return r // error case
- case "set":
- st = parseWhiteSpace(st)
- v,st = parseIdentifier(st)
- any r = parseAddSubExpr(st)
- if !(r is SyntaxError):
- e,st = r
- return {lhs: v.id, rhs: e},st
- else:
- return r // error case
- default:
- return SyntaxError("unknown statement",start,st.pos-1)
-
-function parseAddSubExpr(State st) -> (Expr, State)|SyntaxError:
- //
- Expr lhs, Expr rhs
- // First, pass left-hand side
- any r = parseMulDivExpr(st)
- //
- if r is SyntaxError:
- return r
- //
- lhs,st = r
- st = parseWhiteSpace(st)
- // Second, see if there is a right-hand side
- if st.pos < |st.input| && st.input[st.pos] == '+':
- // add expression
- st.pos = st.pos + 1
- r = parseAddSubExpr(st)
- if !(r is SyntaxError):
- rhs,st = r
- return {op: ADD, lhs: lhs, rhs: rhs},st
- else:
- return r
- else if st.pos < |st.input| && st.input[st.pos] == '-':
- // subtract expression
- st.pos = st.pos + 1
- r = parseAddSubExpr(st)
- if !(r is SyntaxError):
- rhs,st = r
- return {op: SUB, lhs: lhs, rhs: rhs},st
- else:
- return r
- // No right-hand side
- return (lhs,st)
-
-function parseMulDivExpr(State st) -> (Expr, State)|SyntaxError:
- // First, parse left-hand side
- Expr lhs, Expr rhs
- any r = parseTerm(st)
- if r is SyntaxError:
- return r
- //
- lhs,st = r
- st = parseWhiteSpace(st)
- // Second, see if there is a right-hand side
- if st.pos < |st.input| && st.input[st.pos] == '*':
- // add expression
- st.pos = st.pos + 1
- r = parseMulDivExpr(st)
- if !(r is SyntaxError):
- rhs,st = r
- return {op: MUL, lhs: lhs, rhs: rhs}, st
- else:
- return r
- else if st.pos < |st.input| && st.input[st.pos] == '/':
- // subtract expression
- st.pos = st.pos + 1
- r = parseMulDivExpr(st)
- if !(r is SyntaxError):
- rhs,st = r
- return {op: DIV, lhs: lhs, rhs: rhs}, st
- else:
- return r
- // No right-hand side
- return (lhs,st)
-
-function parseTerm(State st) -> (Expr, State)|SyntaxError:
- //
- st = parseWhiteSpace(st)
- if st.pos < |st.input|:
- if ASCII.isLetter(st.input[st.pos]):
- return parseIdentifier(st)
- else if ASCII.isDigit(st.input[st.pos]):
- return parseNumber(st)
- else if st.input[st.pos] == '[':
- return parseList(st)
- //
- return SyntaxError("expecting number or variable",st.pos,st.pos)
-
-function parseIdentifier(State st) -> (Var, State):
- //
- string txt = ""
- // inch forward until end of identifier reached
- while st.pos < |st.input| && ASCII.isLetter(st.input[st.pos]):
- txt = txt ++ [st.input[st.pos]]
- st.pos = st.pos + 1
- return ({id:txt}, st)
-
-function parseNumber(State st) -> (Expr, State)|SyntaxError:
- // inch forward until end of identifier reached
- int start = st.pos
- while st.pos < |st.input| && ASCII.isDigit(st.input[st.pos]):
- st.pos = st.pos + 1
- //
- int|null iv = Int.parse(st.input[start..st.pos])
- if iv == null:
- return SyntaxError("Error parsing number",start,st.pos)
- else:
- return iv, st
-
-function parseList(State st) -> (Expr, State)|SyntaxError:
- //
- st.pos = st.pos + 1 // skip '['
- st = parseWhiteSpace(st)
- [Expr] l = [] // initial list
- bool firstTime = true
- while st.pos < |st.input| && st.input[st.pos] != ']':
- if !firstTime && st.input[st.pos] != ',':
- return SyntaxError("expecting comma",st.pos,st.pos)
- else if !firstTime:
- st.pos = st.pos + 1 // skip ','
- firstTime = false
- any r = parseAddSubExpr(st)
- if r is SyntaxError:
- return r
- else:
- Expr e
- e,st = r
- // perform annoying error check
- l = l ++ [e]
- st = parseWhiteSpace(st)
- st.pos = st.pos + 1
- return l,st
-
-// Parse all whitespace upto end-of-file
-function parseWhiteSpace(State st) -> State:
- while st.pos < |st.input| && ASCII.isWhiteSpace(st.input[st.pos]):
- st.pos = st.pos + 1
- return st
-
-// ====================================================
-// Main Method
-// ====================================================
-
-public method main(System.Console sys):
- if(|sys.args| == 0):
- sys.out.println("no parameter provided!")
- else:
- File.Reader file = File.Reader(sys.args[0])
- string input = ASCII.fromBytes(file.readAll())
-
- Environment env = Environment()
- State st = {pos: 0, input: input}
- while st.pos < |st.input|:
- Stmt s
- any r = parse(st)
- if r is SyntaxError:
- sys.out.println("syntax error: " ++ r.msg)
- return
- s,st = r
- Value|RuntimeError v = evaluate(s.rhs,env)
- if v is RuntimeError:
- sys.out.println("runtime error: " ++ v.msg)
- return
- if s is Set:
- env[s.lhs] = v
- else:
- sys.out.println(r)
- st = parseWhiteSpace(st)
-
diff --git a/tests/examplefiles/example.x10 b/tests/examplefiles/example.x10
deleted file mode 100644
index 9cca164c..00000000
--- a/tests/examplefiles/example.x10
+++ /dev/null
@@ -1,9 +0,0 @@
-/** Example file for the X10 programming langauge (http://x10-lang.org).
- */
-class Example {
-
- public static def main(Rail[String]) {
- Console.OUT.println("Hello World!"); // say hello.
- }
-
-}
diff --git a/tests/examplefiles/example.xhtml b/tests/examplefiles/example.xhtml
deleted file mode 100644
index a08cf753..00000000
--- a/tests/examplefiles/example.xhtml
+++ /dev/null
@@ -1,376 +0,0 @@
-<html>
- <head>
- <script lang="javascript" type="text/javascript">
- // <!--
- function toggleVisible(element) {
- if (element.style.display == 'block') {
- element.style.display = 'none';
- } else {
- element.style.display = 'block';
- }
- return false;
- }
- // -->
- </script>
- <title>Error</title>
- <style>
- .path {
- padding: 5px;
- font-size: 140%;
- background: #ddd;
- }
- .error {
- padding: 5px;
- padding-top: 15px;
- font-size: 140%;
- color: #f00;
- }
- .load {
- padding: 5px;
- color: #555;
- }
- .source {
- border: 1px solid #ccc;
- padding: 10px;
- margin-top: 10px; margin-bottom: 10px;
- }
- h2 {
- padding-left: 5px;
- background: #eee;
- }
- </style>
- </head>
- <body>
- <h1>Error</h1>
-
-<?r
- if Run.mode == :debug
- require 'cgi'
-?>
- <?r for error, path in @context.rendering_errors ?>
- <div class="path"><strong>Path:</strong> #{path}</div>
- <div class="error"><strong>#{CGI.escapeHTML(error.to_s)}</strong></div>
- <div class="load">
- <strong><a href="#{request.uri}">Reload</a></strong> this page.
- Go to the <strong><a href="#{request.referer}">referer</a></strong> or the <strong><a href="/">home page</a></strong>.
- </div>
- <div class="source">
- <?r
- extract = error.source_extract.split("\n")
- ?>
- In file <b>'#{error.hot_file}'</b> #{error.hot_file =~ /\.xhtml$/ ? '(line numbering is aproximate due to template transformation)' : nil}:
- <br /><br />
- <?r
- extract.each_with_index do |line, idx|
- line = sanitize(line)
- if 5 == idx
- ?>
- <div style="background: #eee">#{line}</div>
- <?r else ?>
- <div>#{line}</div>
- <?r
- end
- end
- ?>
- </div>
- <h2><a href="#" onclick="return toggleVisible(document.getElementById('trace'));">Stack Trace</a></h2>
- <div id="trace" style="display: none;">
- <?r error.backtrace.zip(error.source_for_backtrace).each_with_index do |step,step_idx| ?>
- <div><a href="#" onclick="return toggleVisible(document.getElementById('trace_#{step_idx}'));">#{sanitize(step.first)}</a></div>
- <div class="source" id="trace_#{step_idx}" style="display: none;">
- <?r
- extract = step.last.split("\n")
- extract.each_with_index do |line, idx|
- line = sanitize(line)
- if 5 == idx
- ?>
- <div style="background: #eee">#{line}</div>
- <?r else ?>
- <div>#{line}</div>
- <?r
- end
- end
- ?>
- </div>
-
-
- <?r end ?>
- </div>
- <?r end ?>
-
- <h2><a href="#" onclick="document.getElementById('request').style.display = 'block'; return false">Request</a></h2>
- <div id="request" style="display: none">
- <p><strong>Parameters:</strong> #{request.params.reject{ |k,v| k == :__RELOADED__ }.inspect}</p>
- <p><strong>Cookies:</strong> #{request.cookies.inspect}</p>
- <p><strong>Headers:</strong><br />#{request.headers.collect { |k, v| "#{k} => #{v}" }.join('<br />')}</p>
- </div>
-
- <h2><a href="#" onclick="document.getElementById('response').style.display = 'block'; return false">Response</a></h2>
- <div id="response" style="display: none">
- <p><strong>Headers:</strong> #{request.response_headers.inspect}</p>
- <p><strong>Cookies:</strong> #{request.response_cookies.inspect}</p>
- </div>
-
- <h2><a href="#" onclick="document.getElementById('session').style.display = 'block'; return false">Session</a></h2>
- <div id="session" style="display: none">
- <p><strong>Values:</strong> #{session.inspect}</p>
- </div>
-
- <br /><br />
- Powered by <a href="http://www.nitrohq.com">Nitro</a> version #{Nitro::Version}
-<?r end ?>
- </body>
-</html>
-<SystemPage>
- <?r base = "#{@base}/%base%" ?>
- <h1><a href="/"> Home</a> > <a href="#@base">System</a> > <a href="#{base}/list">#{"%plural%".humanize}</a> > Edit #{"%name%".humanize} </h1>
- <?r if @all ?>
- <a href="#{request.uri.gsub(/\/all$/, '')}">Show editable</a>
- #{form_for @obj, :action => "#{base}/save", :cancel => "#{base}/list", :all => true}
- <?r else ?>
- <a href="#{request.uri}/all">Show all</a>
- #{form_for @obj, :action => "#{base}/save", :cancel => "#{base}/list"}
- <?r end ?>
-</SystemPage>
-#{form_for(@%name%)}
-<SystemPage>
- <?r base = "#{@base}/%base%" ?>
- <h1>#{"%plural%".humanize}</h1>
- <h2><a href="#{base}/new">New #{"%name%".humanize}</a></h2>
- <form action="search">
- Search #{"%plural%".humanize}: <input type="text" name="q" />&nbsp;<input type="submit" value="Search" />
- </form>
- <table>
- <?r for obj in @list ?>
- <tr>
- <td width="100%"><a href="#{base}/edit/#{obj.oid}">#{obj.to_s}</a></td>
- <?r if obj.respond_to?(:update_time) ?>
- <td nowrap="1">#{obj.update_time.stamp(:db)}</td>
- <?r end ?>
- <td><a href="#{base}/edit/#{obj.oid}">edit</a></td>
- <td><a href="#{base}/delete/#{obj.oid}">del</a></td>
- </tr>
- <?r end ?>
- </table>
-</SystemPage>
-<SystemPage>
- <?r base = "#{@base}/%base%" ?>
- <h1><a href="/"> Home</a> > <a href="#@base">System</a> > #{"%plural%".humanize}</h1>
- <a href="#{base}/new">New #{"%name%".humanize}</a>
- <p>
- <form action="#{base}/search">
- Search #{"%plural%".humanize}: <input type="text" name="q" />&nbsp;<input type="submit" value="Search" />
- </form>
- </p>
- <table>
- <?r for obj in @list ?>
- <tr>
- <td width="100%"><a href="#{base}/edit/#{obj.oid}">#(obj.to_s)</a></td>
- <?r if obj.respond_to?(:update_time) ?>
- <td nowrap="1">#{obj.update_time.stamp(:db)}</td>
- <?r end ?>
- <td><a href="#{base}/edit/#{obj.oid}">edit</a></td>
- <td><a href="#{base}/delete/#{obj.oid}" onclick="confirm('Are you sure?')">del</a></td>
- </tr>
- <?r end ?>
- </table>
- <div class="pager" if="@pager and @pager.navigation?">
- #{@pager.navigation}
- </div>
-</SystemPage>
-<SystemPage>
- <?r base = "#{@base}/%base%" ?>
- <h1><a href="/"> Home</a> > <a href="#@base">System</a> > <a href="#{base}/list">#{"%plural%".humanize}</a> > New #{"%name%".humanize}</h1>
- <?r if @all ?>
- <a href="#{request.uri.gsub(/\/all$/, '')}">Show editable</a>
- #{form_for @obj, :action => "#{base}/save", :cancel => "#{base}/list", :all => true, :enctype => "multipart/form-data"}
- <?r else ?>
- <a href="#{request.uri}/all">Show all</a>
- #{form_for @obj, :action => "#{base}/save", :cancel => "#{base}/list", :enctype => "multipart/form-data"}
- <?r end ?>
-</SystemPage>
-<SystemPage>
- <?r base = "#{@base}/%base%" ?>
- <h1><a href="/"> Home</a> > <a href="#@base">System</a> > <a href="#{base}/list">#{"%plural%".humanize}</a> > Search for '#@query'</h1>
- <p>
- <form action="#{base}/search">
- Search #{"%plural%".humanize}: <input type="text" name="q" />&nbsp;<input type="submit" value="Search" />
- </form>
- </p>
- <?r if @list.nil? ?>
- <p>Search method is not implemented for this object</p>
- <?r else ?>
- <table>
- <?r for obj in @list ?>
- <tr>
- <td width="100%"><a href="#{base}/edit/#{obj.oid}">#(obj.to_s)</a></td>
- <?r if obj.respond_to?(:update_time) ?>
- <td nowrap="1">#{obj.update_time.stamp(:db)}</td>
- <?r end ?>
- <td><a href="#{base}/edit/#{obj.oid}">edit</a></td>
- <td><a href="#{base}/delete/#{obj.oid}">del</a></td>
- </tr>
- <?r end ?>
- </table>
- <div class="pager" if="@pager and @pager.navigation?">
- #{@pager.navigation}
- </div>
- <?r end ?>
-</SystemPage>
-<SystemPage>
- <?r base = "#{@base}/%base%" ?>
- <h1>View %name%</h1>
- <h2><a href="#{base}/list">List of %plural%</a></h2>
- <code>
- #{@obj.to_yaml}
- </code>
-</SystemPage>
-<strong>Access denied</strong>
-<SystemPage>
- <?r base = "#{@base}/%base%" ?>
- <h1><a href='/'>Home</a> > System</h1>
-
- <h2>Og managed classes</h2>
-
- <table>
- <tr>
- <th>Class</th>
- <th>Count</th>
- <th colspan="2">Cleanup</th>
- <th>Properties</th>
- </tr>
- <?r for c in @classes ?>
- <tr>
- <td><a href="#@base/#{Scaffolding.class_to_path(c).plural}/list">#{c.name}</a></td>
- <td>#{c.count}</td>
- <td><a href="delete_all/#{c.name}" onclick="return confirm('Delete all instances?')">delete</a></td>
- <td><a href="destroy/#{c.name}" onclick="return confirm('Drop the schema?')">destroy</a></td>
- <td width="100%">#{c.properties.values.join(', ')}</td>
- </tr>
- <?r end ?>
- </table>
-
- <h2>System configuration</h2>
-
- <table width="100%">
- <tr>
- <th>Name</th>
- <th>Value</th>
- <th>Type</th>
- <th>Description</th>
- </tr>
- <?r for s in @settings ?>
- <tr>
- <td>#{s.owner}.<strong>#{s.name}</strong></td>
- <td>#{s.value.inspect}</td>
- <td>#{s.type}</td>
- <td>#{s.options[:doc]}</td>
- </tr>
- <?r end ?>
- </table>
-</SystemPage>
-
-<b><?r $include1 = true ?></b>
-<b><?r $include2 = true ?></b>
-<html>
- <b>Test</b>
-
-<?r @tflag = true ?>
-
-<render href="blog/inc1" />
-<render href='blog/inc2' />
-
-</html>
-<html>hello</html>
-Hello #{username}
-
-how do you feel?
-
-Here is your <b>Token</b>: #{token}
-<Page title="Questions and Tips by Tags">
- <div id="left">
- <?r if @tags ?>
- <h1>Questions with Tags: #{@tags.join(" ")}</h1>
-
- <?r if @questions && @questions.size > 0 ?>
- <?r if @qtags ?>
- Too many results for that Tag, please reduce the number by using one of the following Tags:
- #{cloud_of(@qtags)}
- <?r end ?>
- <div class="results">
- <?r @questions.each do |q| ?>
- <h2><a href="/question/#{q.oid}">#{q.question}</a></h2>
- <p>
- <?r excerpt = excerpt_with_words(q.text, @tags) ?>
- #{excerpt}
- </p>
- <p style="float:right;">#{q.answers.size.to_i} answers</p>
- <?r end ?>
- </div>
- <div class="pager">
- #{@qpager.navigation}
- </div>
- <?r else ?>
- <div class="results_none">
- <h2>no question with this/these tag(s) found</h2>
- <p><a href="/ask">Ask a question here.</a></p>
- </div>
- <?r end ?>
-
- <?r if @tips && @tips.size > 0 ?>
- <h1>Tips with Tags: #{@tags.join(" ")}</h1>
- <?r if @ttags ?>
- Too many results for that Tag, please reduce the number by using one of the following Tags:
- #{cloud_of(@ttags)}
- <?r end ?>
- <div class="results">
- <?r @tips.each do |t| ?>
- <h2><a href="/tip/#{t.oid}">#{t.title}</a></h2>
- <p>
- <?r excerpt = excerpt_with_words(t.text, @tags) ?>
- #{excerpt}
- </p>
- <?r end ?>
- </div>
- <div class="pager">
- #{@tpager.navigation}
- </div>
- <?r end ?>
-
- <?r if @tutorials && @tutorials.size > 0 ?>
- <h1>Tutorials with Tags: #{@tags.join(" ")}</h1>
- <?r if @tuttags ?>
- Too many results for that Tag, please reduce the number by using one of the following Tags:
- #{cloud_of(@tuttags)}
- <?r end ?>
- <div class="results">
- <?r @tutorials.each do |t| ?>
- <h2><a href="/tutorial/#{t.oid}">#{t.title}</a></h2>
- <p>
- <?r excerpt = excerpt_with_words(t.text, @tags) ?>
- #{excerpt}
- </p>
- <?r end ?>
- </div>
- <div class="pager">
- #{@tpager.navigation}
- </div>
- <?r end ?>
-
-
- <?r else ?>
- <div class="cloud">
- <?r
- sum = all_tags.inject(0) { |sum, t| sum + t.popularity.to_i }
- ?>
- <?r all_tags.each do |t| ?>
- <a href="/tags/#{t.name}" style="font-size:#{(1+((t.popularity.to_i/sum.to_f)*2)).to_s[0..3]}em;">#{t.name}</a>
- <?r end ?>
- </div> <!-- #cloud -->
- <?r end ?>
- </div> <!-- #left -->
-
- <render href="/right" />
-</Page>
-
-<!-- Copyright 2006 Kashia Buch (kashia@vfemail.net), Fabian Buch (fabian@fabian-buch.de). All rights reserved. -->
diff --git a/tests/examplefiles/example.xtend b/tests/examplefiles/example.xtend
deleted file mode 100644
index f6a51f7a..00000000
--- a/tests/examplefiles/example.xtend
+++ /dev/null
@@ -1,34 +0,0 @@
-package beer
-
-import static extension beer.BottleSupport.*
-import org.junit.Test
-
-class BottleSong {
-
- @Test
- def void singIt() {
- println(singTheSong(99))
- }
-
- def singTheSong(int all) '''
- FOR i : all .. 1
- i.Bottles of beer on the wall, i.bottles of beer.
- Take one down and pass it around, (i - 1).bottles of beer on the wall.
-
- ENDFOR
- No more bottles of beer on the wall, no more bottles of beer.
- Go to the store and buy some more, all.bottles of beer on the wall.
- '''
-
- def private java.lang.String bottles(int i) {
- switch i {
- case 0 : 'no more bottles'
- case 1 : 'one bottle'
- default : '''i bottles'''
- }.toString
- }
-
- def String Bottles(int i) {
- bottles(i).toFirstUpper
- }
-} \ No newline at end of file
diff --git a/tests/examplefiles/example.xtm b/tests/examplefiles/example.xtm
deleted file mode 100644
index 927117da..00000000
--- a/tests/examplefiles/example.xtm
+++ /dev/null
@@ -1,1101 +0,0 @@
-;;; example.xtm -- Extempore code examples
-
-;; Author: Ben Swift, Andrew Sorensen
-;; Keywords: extempore
-
-;;; Commentary:
-
-
-
-;;; Code:
-
-;; bit twiddling
-
-(xtmtest '(bind-func test_bit_twiddle_1
- (lambda ()
- (bitwise-and 65535 255 15 1)))
-
- (test_bit_twiddle_1) 1)
-
-(xtmtest '(bind-func test_bit_twiddle_2
- (lambda ()
- (bitwise-not -1)))
-
- (test_bit_twiddle_2) 0)
-
-(xtmtest '(bind-func test_bit_twiddle_3
- (lambda ()
- (bitwise-not 0)))
-
- (test_bit_twiddle_3) -1)
-
-(xtmtest '(bind-func test_bit_twiddle_4
- (lambda ()
- (bitwise-shift-right 65535 8)
- (bitwise-shift-right 65535 4 4)))
-
- (test_bit_twiddle_4) 255)
-
-(xtmtest '(bind-func test_bit_twiddle_5
- (lambda ()
- (bitwise-shift-left (bitwise-shift-right 65535 8) 4 4)))
-
- (test_bit_twiddle_5) 65280)
-
-(xtmtest '(bind-func test_bit_twiddle_6
- (lambda ()
- (bitwise-and (bitwise-or (bitwise-eor 21844 65534) (bitwise-eor 43690 65534)) 1)))
-
- (test_bit_twiddle_6) 0)
-
-;; integer literals default to 64 bit integers
-(xtmtest '(bind-func int-literal-test
- (lambda (a)
- (* a 5)))
-
- (int-literal-test 6) 30)
-
-;; float literals default to doubles
-(xtmtest '(bind-func float-literal-test
- (lambda (a)
- (* a 5.0)))
-
- (float-literal-test 6.0) 30.0)
-
-;; you are free to recompile an existing closure
-(xtmtest '(bind-func int-literal-test
- (lambda (a)
- (/ a 5)))
-
- (int-literal-test 30))
-
-(xtmtest '(bind-func closure-test1
- (let ((power 0))
- (lambda (x)
- (set! power (+ power 1)) ;; set! for closure mutation as per scheme
- (* x power))))
-
- (closure-test1 2))
-
-(xtmtest '(bind-func closure-returns-closure-test
- (lambda ()
- (lambda (x)
- (* x 3))))
-
- (closure-returns-closure-test))
-
-(xtmtest '(bind-func incrementer-test1
- (lambda (i:i64)
- (lambda (incr)
- (set! i (+ i incr))
- i)))
-
- (incrementer-test1 0))
-
-(define myf (incrementer-test1 0))
-
-;; so we need to type f properly
-(xtmtest '(bind-func incrementer-test2
- (lambda (f:[i64,i64]* x)
- (f x)))
- (incrementer-test2 myf 1) 1)
-
-;; and we can call my-in-maker-wrapper
-;; to appy myf
-(xtmtest-result (incrementer-test2 myf 1) 2)
-(xtmtest-result (incrementer-test2 myf 1) 3)
-(xtmtest-result (incrementer-test2 myf 1) 4)
-
-;; of course the wrapper is only required if you
-;; need interaction with the scheme world.
-;; otherwise you just call my-inc-maker directly
-
-;; this avoids the wrapper completely
-(xtmtest '(bind-func incrementer-test3
- (let ((f (incrementer-test1 0)))
- (lambda ()
- (f 1))))
-
- (incrementer-test3) 1)
-
-(xtmtest-result (incrementer-test3) 2)
-(xtmtest-result (incrementer-test3) 3)
-
-;; hopefully you're getting the idea.
-;; note that once we've compiled something
-;; we can then use it any of our new
-;; function definitions.
-
-;; do a little 16bit test
-(xtmtest '(bind-func bitsize-sixteen
- (lambda (a:i16)
- (dtoi16 (* (i16tod a) 5.0))))
-
- (bitsize-sixteen 5) 25)
-
-;; while loop test
-
-(xtmtest '(bind-func test_while_loop_1
- (lambda ()
- (let ((count 0))
- (while (< count 5)
- (printf "count = %lld\n" count)
- (set! count (+ count 1)))
- count)))
-
- (test_while_loop_1) 5)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Closures can be recursive
-;;
-
-(xtmtest '(bind-func recursive-closure-test
- (lambda (a)
- (if (< a 1)
- (printf "done\n")
- (begin (printf "a: %lld\n" a)
- (recursive-closure-test (- a 1))))))
-
- (recursive-closure-test 3))
-
-;; check TAIL OPTIMIZATION
-;; if there is no tail call optimiation
-;; in place then this should blow the
-;; stack and crash the test
-
-;; CANNOT RUN THIS TEST ON WINDOWS (i.e. no salloc)!
-(if (not (equal? (sys:platform) "Windows"))
- (xtmtest '(bind-func tail_opt_test
- (lambda (n:i64)
- (let ((a:float* (salloc 8000)))
- (if (= n 0)
- (printf "tail opt test passed!\n")
- (tail_opt_test (- n 1))))))
-
- (tail_opt_test 200)))
-
-(println 'A 'segfault 'here 'incidates 'that 'tail-call-optimizations 'are 'not 'working!)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; some anon lambda tests
-;;
-
-(xtmtest '(bind-func infer_lambdas_test
- (lambda ()
- (let ((a 5)
- (b (lambda (x) (* x x)))
- (c (lambda (y) (* y y))))
- (c (b a)))))
-
- (infer_lambdas_test))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; a simple tuple example
-;;
-;; tuple types are represented as <type,type,type>*
-;;
-
-;; make and return a simple tuple
-(xtmtest '(bind-func tuple-test1
- (lambda ()
- (let ((t:<i64,double,i32>* (alloc)))
- t)))
-
- (tuple-test1))
-
-;; logview shows [<i64,double,i32>*]*
-;; i.e. a closure that takes no arguments
-;; and returns the tuple <i64,double,i32>*
-
-
-;; here's another tuple example
-;; note that my-test-7's return type is inferred
-;; by the tuple-reference index
-;; (i.e. i64 being tuple index 0)
-(xtmtest '(bind-func tuple-test2
- (lambda ()
- (let ((a:<i64,double>* (alloc)) ; returns pointer to type <i64,double>
- (b 37)
- (c 6.4))
- (tuple-set! a 0 b) ;; set i64 to 64
- (tset! a 1 c) ;; set double to 6.4 - tset! is an alias for tuple-set!
- (printf "tuple:1 %lld::%f\n" (tuple-ref a 0) (tref a 1))
- ;; we can fill a tuple in a single call by using tfill!
- (tfill! a 77 77.7)
- (printf "tuple:2 %lld::%f\n" (tuple-ref a 0) (tuple-ref a 1))
- (tuple-ref a 0))))
-
- (tuple-test2) 77)
-
-;; return first element which is i64
-;; should be 64 as we return the
-;; first element of the tuple
-;; (println (my-test-7)) ; 77
-
-
-;; tbind binds variables to values
-;; based on tuple structure
-;; _ (underscore) means don't attempt
-;; to match against this position in
-;; the tuple (i.e. skip)
-(xtmtest '(bind-func tuple-bind-test
- (lambda ()
- (let ((t1:<i32,float,<i32,float>*,double>* (alloc))
- (t2:<i32,float>* (alloc))
- (a 0) (b:float 0.0) (c 0.0))
- (tfill! t2 3 3.3)
- (tfill! t1 1 2.0 t2 4.0)
- (tbind t1 a b _ c)
- c)))
-
- (tuple-bind-test) 4.0)
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; some array code with *casting*
-;; this function returns void
-(xtmtest '(bind-func array-test1
- (lambda ()
- (let ((v1:|5,float|* (alloc))
- (v2:|5,float|* (alloc))
- (i 0)
- (k 0))
- (dotimes (i 5)
- ;; random returns double so "truncate" to float
- ;; which is what v expects
- (array-set! v1 i (dtof (random))))
- ;; we can use the afill! function to fill an array
- (afill! v2 1.1 2.2 3.3 4.4 5.5)
- (dotimes (k 5)
- ;; unfortunately printf doesn't like floats
- ;; so back to double for us :(
- (printf "val: %lld::%f::%f\n" k
- (ftod (array-ref v1 k))
- (ftod (aref v2 k)))))))
-
- (array-test1))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; some crazy array code with
-;; closures and arrays
-;; try to figure out what this all does
-;;
-;; this example uses the array type
-;; the pretty print for this type is
-;; |num,type| num elements of type
-;; |5,i64| is an array of 5 x i64
-;;
-;; An array is not a pointer type
-;; i.e. |5,i64| cannot be bitcast to i64*
-;;
-;; However an array can be a pointer
-;; i.e. |5,i64|* can be bitcast to i64*
-;; i.e. |5,i64|** to i64** etc..
-;;
-;; make-array returns a pointer to an array
-;; i.e. (make-array 5 i64) returns type |5,i64|*
-;;
-;; aref (array-ref) and aset! (array-set!)
-;; can operate with either pointers to arrays or
-;; standard pointers.
-;;
-;; in other words aref and aset! are happy
-;; to work with either i64* or |5,i64|*
-
-(bind-func array-test2
- (lambda (v:|5,i64|*)
- (let ((f (lambda (x)
- (* (array-ref v 2) x))))
- f)))
-
-(bind-func array-test3
- (lambda (v:|5,[i64,i64]*|*)
- (let ((ff (aref v 0))) ; aref alias for array-ref
- (ff 5))))
-
-(xtmtest '(bind-func array-test4
- (lambda ()
- (let ((v:|5,[i64,i64]*|* (alloc)) ;; make an array of closures!
- (vv:|5,i64|* (alloc)))
- (array-set! vv 2 3)
- (aset! v 0 (array-test2 vv)) ;; aset! alias for array-set!
- (array-test3 v))))
-
- ;; try to guess the answer before you call this!!
- (array-test4))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; some conditionals
-
-(xtmtest '(bind-func cond-test1
- (lambda (x:i64 y)
- (if (> x y)
- x
- y)))
-
- (cond-test1 12 13))
-
-;; returns boolean true
-(xtmtest '(bind-func cond-test2
- (lambda (x:i64)
- (cond ((= x 1) (printf "A\n"))
- ((= x 2) (printf "B\n"))
- ((= x 3) (printf "C\n"))
- ((= x 4) (printf "D\n"))
- (else (printf "E\n")))
- #t))
-
- (cond-test2 1))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; making a linear envelop generator
-;; for signal processing and alike
-
-(bind-func envelope-segments
- (lambda (points:double* num-of-points:i64)
- (let ((lines:[double,double]** (zone-alloc num-of-points))
- (k 0))
- (dotimes (k num-of-points)
- (let* ((idx (* k 2))
- (x1 (pointer-ref points (+ idx 0)))
- (y1 (pointer-ref points (+ idx 1)))
- (x2 (pointer-ref points (+ idx 2)))
- (y2 (pointer-ref points (+ idx 3)))
- (m (if (= 0.0 (- x2 x1)) 0.0 (/ (- y2 y1) (- x2 x1))))
- (c (- y2 (* m x2)))
- (l (lambda (time) (+ (* m time) c))))
- (pointer-set! lines k l)))
- lines)))
-
-(bind-func make-envelope
- (lambda (points:double* num-of-points)
- (let ((klines:[double,double]** (envelope-segments points num-of-points))
- (line-length num-of-points))
- (lambda (time)
- (let ((res -1.0)
- (k:i64 0))
- (dotimes (k num-of-points)
- (let ((line (pointer-ref klines k))
- (time-point (pointer-ref points (* k 2))))
- (if (or (= time time-point)
- (< time-point time))
- (set! res (line time)))))
- res)))))
-
-;; make a convenience wrapper
-(xtmtest '(bind-func env-wrap
- (let* ((points 3)
- (data:double* (zone-alloc (* points 2))))
- (pointer-set! data 0 0.0) ;; point data
- (pset! data 1 0.0)
- (pset! data 2 2.0)
- (pset! data 3 1.0)
- (pset! data 4 4.0)
- (pset! data 5 0.0)
- (let ((f (make-envelope data points)))
- (lambda (time:double)
- (f time)))))
- (env-wrap 0.0) 0.0)
-
-(xtmtest-result (env-wrap 1.0) 0.5)
-(xtmtest-result (env-wrap 2.0) 1.0)
-(xtmtest-result (env-wrap 2.5) 0.75)
-(xtmtest-result (env-wrap 4.0) 0.0)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; direct access to a closures environment
-;;
-;; it is possible to directly access a closures
-;; environment in order to read or modify data
-;; at runtime.
-;;
-;; You do this using a dot operator
-;; To access an environment slot you use
-;; closure.slot:type
-;; So for example
-;; (f.a:i32)
-;; would return the 32bit integer symbol 'a'
-;; from the closure 'f'
-;;
-;; To set an environment slot you just
-;; add a value of the correct type
-;; for example
-;; (f.a:i32 565)
-;; would set 'a' in 'f' to 565
-;;
-;; let's create a closure that capture's 'a'
-
-
-(xtmtest '(bind-func dot-access-test1
- (let ((a:i32 6))
- (lambda ()
- (printf "a:%d\n" a)
- a)))
- (dot-access-test1))
-
-;; now let's create a new function
-;; that calls my-test14 twice
-;; once normally
-;; then we directly set the closures 'a' binding
-;; then call again
-;;
-(xtmtest '(bind-func dot-access-test2
- (lambda (x:i32)
- (dot-access-test1)
- (dot-access-test1.a:i32 x)
- (dot-access-test1)))
-
- (dot-access-test2 9))
-
-;; of course this works just as well for
-;; non-global closures
-(xtmtest '(bind-func dot-access-test3
- (lambda (a:i32)
- (let ((f (lambda ()
- (* 3 a))))
- f)))
- (dot-access-test3 1))
-
-(xtmtest '(bind-func dot-access-test4
- (lambda ()
- (let ((f (dot-access-test3 5)))
- (f.a:i32 7)
- (f))))
-
- (dot-access-test4)
- 21)
-
-;; and you can get and set closures also!
-(xtmtest '(bind-func dot-access-test5
- (lambda ()
- (let ((f (lambda (x:i64) x)))
- (lambda (z)
- (f z)))))
-
- (dot-access-test5))
-
-(xtmtest '(bind-func dot-access-test6
- (lambda ()
- (let ((t1 (dot-access-test5))
- (t2 (dot-access-test5)))
- ;; identity of 5
- (printf "%lld:%lld\n" (t1 5) (t2 5))
- (t1.f:[i64,i64]* (lambda (x:i64) (* x x)))
- ;; square of 5
- (printf "%lld:%lld\n" (t1 5) (t2 5))
- ;; cube of 5
- (t2.f:[i64,i64]* (lambda (y:i64) (* y y y)))
- (printf "%lld:%lld\n" (t1 5) (t2 5))
- void)))
-
- (dot-access-test6)) ;; 5:5 > 25:5 > 25:125
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; named types
-
-;; it can sometimes be helpful to allocate
-;; a predefined tuple type on the stack
-;; you can do this using allocate
-(bind-type vec3 <double,double,double>)
-
-;; String printing!
-(bind-func vec3_print:[void,vec3*]*
- (lambda (x)
- (printf "<%d,%d,%d>" (tref x 0) (tref x 1) (tref x 2))
- void))
-
-(bind-poly print vec3_print)
-
-;; note that point is deallocated at the
-;; end of the function call. You can
-;; stack allocate (stack-alloc)
-;; any valid type (i64 for example)
-(xtmtest '(bind-func salloc-test
- (lambda ()
- (let ((point:vec3* (stack-alloc)))
- (tset! point 0 0.0)
- (tset! point 1 -1.0)
- (tset! point 2 1.0)
- 1)))
-
- (salloc-test)) ;; 1
-
-;; all named types have 2 default constructors
-;; name (zone alloation) + name_h (heap allocation)
-;; and a default print poly
-(xtmtest '(bind-func data-constructor-test
- (lambda ()
- (let ((v1 (vec3 1.0 2.0 3.0))
- (v2 (vec3_h 4.0 5.0 6.0)))
- (println v1 v2)
- ;; halloced vec3 needs freeing
- (free v2)
- void)))
-
- (data-constructor-test))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; aref-ptr and tref-ptr
-;;
-
-;; aref-ptr and tref-ptr return a pointer to an element
-;; just as aref and tref return elements aref-ptr and
-;; tref-ptr return a pointer to those elements.
-
-;; This allows you to do things like create an array
-;; with an offset
-(xtmtest '(bind-func aref-ptr-test
- (lambda ()
- (let ((arr:|32,i64|* (alloc))
- (arroff (aref-ptr arr 16))
- (i 0)
- (k 0))
- ;; load arr
- (dotimes (i 32) (aset! arr i i))
- (dotimes (k 16)
- (printf "index: %lld\tarr: %lld\tarroff: %lld\n"
- k (aref arr k) (pref arroff k))))))
-
- (aref-ptr-test))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; arrays
-;; Extempore lang supports arrays as for first class
-;; aggregate types (in other words as distinct from
-;; a pointer).
-;;
-;; an array is made up of a size and a type
-;; |32,i64| is an array of 32 elements of type i64
-;;
-
-(bind-type tuple-with-array <double,|32,|4,i32||,float>)
-
-(xtmtest '(bind-func array-test5
- (lambda ()
- (let ((tup:tuple-with-array* (stack-alloc))
- (t2:|32,i64|* (stack-alloc)))
- (aset! t2 0 9)
- (tset! tup 2 5.5)
- (aset! (aref-ptr (tref-ptr tup 1) 0) 0 0)
- (aset! (aref-ptr (tref-ptr tup 1) 0) 1 1)
- (aset! (aref-ptr (tref-ptr tup 1) 0) 2 2)
- (printf "val: %lld %lld %f\n"
- (aref (aref-ptr (tref-ptr tup 1) 0) 1)
- (aref t2 0) (ftod (tref tup 2)))
- (aref (aref-ptr (tref-ptr tup 1) 0) 1))))
-
- (array-test5) 1) ;; val: 1 9 5.5
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Global Variables
-;;
-;; You can allocate global variables using bind-val
-;;
-
-(bind-val g_var_a i32 5)
-
-;; increment g_var_a by inc
-;; and return new value of g_var_a
-(xtmtest '(bind-func global_var_test1
- (lambda (incr)
- (set! g_var_a (+ g_var_a incr))
- g_var_a))
-
- (global_var_test1 3) 8) ;; 8
-
-;; you can bind any primitive type
-(bind-val g_var_b double 5.5)
-(bind-val g_var_c i1 0)
-
-(xtmtest '(bind-func global_var_test1b
- (lambda ()
- (* g_var_b (if g_var_c 1.0 4.0))))
-
- (global_var_test1b) 22.0)
-
-;; global strings
-
-(bind-val g_cstring i8* "Jiblet.")
-
-(xtmtest '(bind-func test_g_cstring
- (lambda ()
- (let ((i 0))
- (dotimes (i 7)
- (printf "g_cstring[%lld] = %c\n" i (pref g_cstring i)))
- (printf "\nSpells... %s\n" g_cstring))))
-
- (test_g_cstring))
-
-(xtmtest '(bind-func test_g_cstring1
- (lambda ()
- (let ((test_cstring "Niblot.")
- (i 0)
- (total 0))
- (dotimes (i 7)
- (let ((c1 (pref g_cstring i))
- (c2 (pref test_cstring i)))
- (printf "checking %c against %c\n" c1 c2)
- (if (= c1 c2)
- (set! total (+ total 1)))))
- total)))
-
- (test_g_cstring1) 5)
-
-
-
-
-
-;; for tuples, arrays and vectors, bind-val only takes *two*
-;; arguments. The tuple/array/vector will be initialised to zero.
-
-(bind-val g_tuple1 <i64,i64>)
-(bind-val g_tuple2 <double,double>)
-
-(xtmtest '(bind-func test_g_tuple
- (lambda ()
- (tfill! g_tuple1 1 4)
- (tfill! g_tuple2 4.0 1.0)
- (and (= (tref g_tuple1 0) (dtoi64 (tref g_tuple2 1)))
- (= (dtoi64 (tref g_tuple2 0)) (tref g_tuple1 1)))))
-
- (test_g_tuple) 1)
-
-;; same thing with arrays
-
-(bind-val g_array1 |10,double|)
-(bind-val g_array2 |10,i64|)
-
-;; if we just loop over and print the values in each array
-
-(xtmtest '(bind-func test_g_array11
- (lambda ()
- (let ((i 0))
- (dotimes (i 10)
- (printf "garray_1[%lld] = %f garray_2[%lld] = %lld\n"
- i (aref g_array1 i) i (aref g_array2 i))))))
-
- (test_g_array11) 1)
-
-;; but if we loop over and set some values into the arrays
-
-(xtmtest '(bind-func test_g_array2
- (lambda ()
- (let ((i 0))
- (dotimes (i 10)
- (aset! g_array1 i (i64tod i))
- (aset! g_array2 i i)
- (printf "garray_1[%lld] = %f garray_2[%lld] = %lld\n"
- i (aref g_array1 i) i (aref g_array2 i)))
- (= (dtoi64 (aref g_array1 5))
- (aref g_array2 5)))))
-
- (test_g_array2) 1)
-
-;; just to test, let's try a large array
-
-(bind-val g_array3 |100000000,i64|)
-
-(xtmtest '(bind-func test_g_array3
- (lambda ()
- (let ((i 0))
- (dotimes (i 100000000)
- (aset! g_array3 i i))
- (= (pref g_array3 87654321)
- 87654321))))
-
- (test_g_array3) 1)
-
-;; if you want to bind a global pointer, then the third 'value'
-;; argument is the size of the memory to allocate (in elements, not in bytes)
-
-(bind-val g_ptr0 double* 10)
-
-(xtmtest '(bind-func test_g_ptr0
- (lambda ()
- (let ((total 0.0)
- (i 0))
- (dotimes (i 10)
- (pset! g_ptr0 i (i64tod i))
- (set! total (+ total (pref g_ptr0 i))))
- total)))
-
- (test_g_ptr0) 45.0)
-
-(bind-val g_ptr1 |4,i32|* 2)
-(bind-val g_ptr2 <i64,double>* 4)
-
-(xtmtest '(bind-func test_g_ptr1
- (lambda ()
- (afill! g_ptr1 11 66 35 81)
- (tset! g_ptr2 1 35.0)
- (printf "%f :: %d\n" (tref g_ptr2 1) (aref g_ptr1 2))
- (aref g_ptr1 3)))
-
- (test_g_ptr1) 81) ;; should also print 35.000000 :: 35
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Callbacks
-
-(xtmtest '(bind-func callback-test
- (lambda (time:i64 count:i64)
- (printf "time: %lld:%lld\n" time count)
- (callback (+ time 1000) callback-test (+ time 22050) (+ count 1))))
-
- (callback-test (now) 0))
-
-;; compiling this will stop the callbacks
-;;
-;; of course we need to keep the type
-;; signature the same [void,i64,i64]*
-;;
-(xtmtest '(bind-func callback-test
- (lambda (time:i64 count:i64)
- #t))
-
- (callback-test))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; some memzone tests
-
-(xtmtest '(bind-func memzone-test1
- (lambda ()
- (let ((b:|5,double|* (zalloc)))
- (aset! b 0
- (memzone 1024
- (let ((a:|10,double|* (zalloc)))
- (aset! a 0 3.5)
- (aref a 0))))
- (let ((c:|9,i32|* (zalloc)))
- (aset! c 0 99)
- (aref b 0)))))
-
- (memzone-test1) 3.5)
-
-(xtmtest '(bind-func memzone-test2
- (lambda ()
- (memzone 1024
- (let ((k:|15,double|* (zalloc))
- (f (lambda (fa:|15,double|*)
- (memzone 1024
- (let ((a:|10,double|* (zalloc))
- (i 0))
- (dotimes (i 10)
- (aset! a i (* (aref fa i) (random))))
- a)))))
- (f k)))))
-
- (memzone-test2))
-
-(xtmtest '(bind-func memzone-test3
- (lambda ()
- (let ((v (memzone-test2))
- (i 0))
- (dotimes (i 10) (printf "%lld:%f\n" i (aref v i))))))
-
- (memzone-test3)) ;; should print all 0.0's
-
-(xtmtest '(bind-func memzone-test4
- (lambda ()
- (memzone 1024 (* 44100 10)
- (let ((a:|5,double|* (alloc)))
- (aset! a 0 5.5)
- (aref a 0)))))
-
- (memzone-test4) 5.50000)
-
-;;
-;; Large allocation of memory on BUILD (i.e. when the closure is created)
-;; requires an optional argument (i.e. an amount of memory to allocate
-;; specifically for closure creation)
-;;
-;; This memory is automatically free'd whenever you recompile the closure
-;; (it will be destroyed and replaced by a new allocation of the
-;; same amount or whatever new amount you have allocated for closure
-;; compilation)
-;;
-(xtmtest '(bind-func closure-zalloc-test 1000000
- (let ((k:|100000,double|* (zalloc)))
- (lambda ()
- (aset! k 0 1.0)
- (aref k 0))))
-
- (closure-zalloc-test 1000000))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Ad-Hoc Polymorphism
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;; extempore supports ad-hoc polymorphism
-;; at some stage in the future this will
-;; be implicit - but for the moment
-;; it is explicitly defined using bind-poly
-
-;; ad-hoc polymorphism allows you to provide
-;; different specialisations depending on
-;; type. In other words, a single 'name'
-;; can be bound to multiple function
-;; implementations each with a uniqute
-;; type.
-
-
-;; poly variables can be for functions of
-;; mixed argument lengths
-;;
-;; so for example:
-(bind-func poly-test4
- (lambda (a:i8*)
- (printf "%s\n" a)))
-
-(bind-func poly-test5
- (lambda (a:i8* b:i8*)
- (printf "%s %s\n" a b)))
-
-(bind-func poly-test6
- (lambda (a:i8* b:i8* c:i8*)
- (printf "%s %s %s\n" a b c)))
-
-;; bind these three functions to poly 'print'
-(bind-poly testprint poly-test4)
-(bind-poly testprint poly-test5)
-(bind-poly testprint poly-test6)
-
-(xtmtest '(bind-func poly-test7
- (lambda ()
- (testprint "extempore's")
- (testprint "extempore's" "polymorphism")
- (testprint "extempore's" "polymorphism" "rocks")))
-
- (poly-test7))
-
-;; polys can Also specialize
-;; on the return type
-(bind-func poly-test8
- (lambda (a:double)
- (* a a)))
-
-(bind-func poly-test9
- (lambda (a:double)
- (dtoi64 (* a a))))
-
-(bind-poly sqrd poly-test8)
-(bind-poly sqrd poly-test9)
-
-;; specialize on [i64,double]*
-;;
-(xtmtest '(bind-func poly-test10:[i64,double]*
- (lambda (a)
- (+ 1 (sqrd a))))
- (poly-test10 5.0))
-
-;; specialize on [double,doube]*
-(xtmtest '(bind-func poly-test11:[double,double]*
- (lambda (a)
- (+ 1.0 (sqrd a))))
-
- (poly-test11 5.0))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; a little test for zone cleanup
-;;
-(bind-func MyLittleCleanupTest
- (lambda ()
- (let ((tmp2:i8* (alloc 8)))
- (cleanup (println "Clean up before leaving zone!"))
- tmp2)))
-
-(xtmtest '(bind-func cleanup-test
- (lambda ()
- (letz ((tmp:i8* (alloc 8))
- (t2 (MyLittleCleanupTest)))
- (begin
- (println "In Zone ...")
- 1))
- (println "Out of zone ...")
- void))
-
- (cleanup-test))
-
-;;;;;;;;;;;;;;;;;;
-;; vector types
-
-;; (bind-func vector-test1
-;; (lambda ()
-;; (let ((v1:/4,float/* (alloc))
-;; (v2:/4,float/* (alloc))
-;; (v3:/4,float/* (alloc)))
-;; (vfill! v1 4.0 3.0 2.0 1.0)
-;; (vfill! v2 1.0 2.0 3.0 4.0)
-;; (vfill! v3 5.0 5.0 5.0 5.0)
-;; (let ((v4 (* v1 v2))
-;; (v5 (> v3 v4))) ;; unforunately vector conditionals don't work!
-;; (printf "mul:%f:%f:%f:%f\n" (ftod (vref v4 0)) (ftod (vref v4 1)) (ftod (vref v4 2)) (ftod (vref v4 3)))
-;; (printf "cmp:%d:%d:%d:%d\n" (i1toi32 (vref v5 0)) (i1toi32 (vref v5 1)) (i1toi32 (vref v5 2)) (i1toi32 (vref v5 3)))
-;; void))))
-
-;; (test-xtfunc (vector-test1))
-
-(bind-func vector-test2
- (lambda ()
- (let ((v1:/4,float/* (alloc))
- (v2:/4,float/* (alloc)))
- (vfill! v1 1.0 2.0 4.0 8.0)
- (vfill! v2 2.0 2.5 2.25 2.125)
- (* v1 v2))))
-
-(xtmtest '(bind-func vector-test3
- (lambda ()
- (let ((a (vector-test2)))
- (printf "%f:%f:%f:%f\n"
- (ftod (vref a 0))
- (ftod (vref a 1))
- (ftod (vref a 2))
- (ftod (vref a 3)))
- void)))
-
- (vector-test3))
-
-;; vectorised sine func
-(bind-func vsinf4
- (let ((p:/4,float/* (alloc))
- (b:/4,float/* (alloc))
- (c:/4,float/* (alloc))
- (f1:/4,float/* (alloc))
- (f2:/4,float/* (alloc))
- (i:i32 0)
- (p_ 0.225)
- (b_ (dtof (/ 4.0 3.1415)))
- (c_ (dtof (/ -4.0 (* 3.1415 3.1415)))))
- (dotimes (i 4) (vset! p i p_) (vset! b i b_) (vset! c i c_))
- (lambda (x:/4,float/)
- ;; no SIMD for abs yet!
- (dotimes (i 4) (vset! f1 i (fabs (vref x i))))
- (let ((y (+ (* b x) (* c x f1))))
- ;; no SIMD for abs yet!
- (dotimes (i 4) (vset! f2 i (fabs (vref y i))))
- (+ (* p (- (* y f2) y)) y)))))
-
-(bind-func vcosf4
- (let ((p:/4,float/* (alloc))
- (b:/4,float/* (alloc))
- (c:/4,float/* (alloc))
- (d:/4,float/* (alloc))
- (f1:/4,float/* (alloc))
- (f2:/4,float/* (alloc))
- (i:i32 0)
- (p_ 0.225)
- (d_ (dtof (/ 3.1415 2.0)))
- (b_ (dtof (/ 4.0 3.1415)))
- (c_ (dtof (/ -4.0 (* 3.1415 3.1415)))))
- (dotimes (i 4)
- (vset! p i p_) (vset! b i b_) (vset! c i c_) (vset! d i d_))
- (lambda (x:/4,float/)
- ;; offset x for cos
- (set! x (+ x d))
- ;; no SIMD for abs yet!
- (dotimes (i 4) (vset! f1 i (fabs (vref x i))))
- (let ((y (+ (* b x) (* c x f1))))
- ;; no SIMD for abs yet!
- (dotimes (i 4) (vset! f2 i (fabs (vref y i))))
- (+ (* p (- (* y f2) y)) y)))))
-
-
-(xtmtest '(bind-func vector-test4
- (lambda ()
- (let ((a:/4,float/* (alloc)))
- (vfill! a 0.1 0.2 0.3 0.4)
- (let ((b (vsinf4 (pref a 0)))
- (c (vcosf4 (pref a 0))))
- (printf "precision inaccuracy is expected:\n")
- (printf " sinf:\t%f,%f,%f,%f\n"
- (ftod (sin 0.1:f))
- (ftod (sin 0.2:f))
- (ftod (sin 0.3:f))
- (ftod (sin 0.4:f)))
- (printf "vsinf:\t%f,%f,%f,%f\n"
- (ftod (vref b 0))
- (ftod (vref b 1))
- (ftod (vref b 2))
- (ftod (vref b 3)))
- (printf " cosf:\t%f,%f,%f,%f\n"
- (ftod (cos 0.1:f))
- (ftod (cos 0.2:f))
- (ftod (cos 0.3:f))
- (ftod (cos 0.4:f)))
- (printf "vcosf:\t%f,%f,%f,%f\n"
- (ftod (vref c 0))
- (ftod (vref c 1))
- (ftod (vref c 2))
- (ftod (vref c 3)))
- void))))
-
- (vector-test4))
-
-;; test the call-as-xtlang macro
-
-;; make sure it'll handle multiple body forms
-(xtmtest-result (call-as-xtlang (println 1) (println 2) 5)
- 5)
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; test globalvar as closure
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(bind-func testinc
- (lambda (incr:i64)
- (lambda (x:i64)
- (+ x incr))))
-
-(bind-val GlobalInc [i64,i64]* (testinc 2))
-
-(xtmtest '(bind-func ginc
- (lambda ()
- (GlobalInc 5)))
- (ginc) 7)
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; syntax highlighting tests ;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; these don't return any values, they're visual tests---do they look
-;; right?
-
-(bind-func hl_test1a:[i32,double,|4,i32|**]* 4000
- "docstring"
- (lambda (a b)
- (printf "done\n")))
-
-(bind-func hl_test1b:[i32]*
- (lambda ()
- (let ((i:i32 6))
- (printf "done\n"))))
-
-(bind-val hl_test2 <i32,i32>)
-(bind-val hl_test3 |4,i8|)
-(bind-val hl_test4 double* 10)
-(bind-val hl_test5 i8* "teststr")
-
-(bind-type hl_test_type <i64>)
-
-(println '(bind-lib testlib testfn [i32,i32]*))
-
-;; (and 4 5)
-;; (bind-val hl_test4 double* 10)
-;; (bind-type hl_test_type <i64> "docstring")
-;; (bind-lib testlib testfn [i32,i32]*)
diff --git a/tests/examplefiles/example.yaml b/tests/examplefiles/example.yaml
deleted file mode 100644
index 17544c02..00000000
--- a/tests/examplefiles/example.yaml
+++ /dev/null
@@ -1,311 +0,0 @@
-#
-# Regression tests
-#
-
-%TAG ! tag:example.com:foo/
----
-test: !foo/bar {a: 'asdf'}
-test2: fred
-...
-
-#
-# Examples from the Preview section of the YAML specification
-# (http://yaml.org/spec/1.2/#Preview)
-#
-
-# Sequence of scalars
----
-- Mark McGwire
-- Sammy Sosa
-- Ken Griffey
-
-# Mapping scalars to scalars
----
-hr: 65 # Home runs
-avg: 0.278 # Batting average
-rbi: 147 # Runs Batted In
-
-# Mapping scalars to sequences
----
-american:
- - Boston Red Sox
- - Detroit Tigers
- - New York Yankees
-national:
- - New York Mets
- - Chicago Cubs
- - Atlanta Braves
-
-# Sequence of mappings
----
--
- name: Mark McGwire
- hr: 65
- avg: 0.278
--
- name: Sammy Sosa
- hr: 63
- avg: 0.288
-
-# Sequence of sequences
----
-- [name , hr, avg ]
-- [Mark McGwire, 65, 0.278]
-- [Sammy Sosa , 63, 0.288]
-
-# Mapping of mappings
----
-Mark McGwire: {hr: 65, avg: 0.278}
-Sammy Sosa: {
- hr: 63,
- avg: 0.288
- }
-
-# Two documents in a stream
---- # Ranking of 1998 home runs
-- Mark McGwire
-- Sammy Sosa
-- Ken Griffey
---- # Team ranking
-- Chicago Cubs
-- St Louis Cardinals
-
-# Documents with the end indicator
----
-time: 20:03:20
-player: Sammy Sosa
-action: strike (miss)
-...
----
-time: 20:03:47
-player: Sammy Sosa
-action: grand slam
-...
-
-# Comments
----
-hr: # 1998 hr ranking
- - Mark McGwire
- - Sammy Sosa
-rbi:
- # 1998 rbi ranking
- - Sammy Sosa
- - Ken Griffey
-
-# Anchors and aliases
----
-hr:
- - Mark McGwire
- # Following node labeled SS
- - &SS Sammy Sosa
-rbi:
- - *SS # Subsequent occurrence
- - Ken Griffey
-
-# Mapping between sequences
----
-? - Detroit Tigers
- - Chicago cubs
-:
- - 2001-07-23
-? [ New York Yankees,
- Atlanta Braves ]
-: [ 2001-07-02, 2001-08-12,
- 2001-08-14 ]
-
-# Inline nested mapping
----
-# products purchased
-- item : Super Hoop
- quantity: 1
-- item : Basketball
- quantity: 4
-- item : Big Shoes
- quantity: 1
-
-# Literal scalars
---- | # ASCII art
- \//||\/||
- // || ||__
-
-# Folded scalars
---- >
- Mark McGwire's
- year was crippled
- by a knee injury.
-
-# Preserved indented block in a folded scalar
----
->
- Sammy Sosa completed another
- fine season with great stats.
-
- 63 Home Runs
- 0.288 Batting Average
-
- What a year!
-
-# Indentation determines scope
----
-name: Mark McGwire
-accomplishment: >
- Mark set a major league
- home run record in 1998.
-stats: |
- 65 Home Runs
- 0.278 Batting Average
-
-# Quoted scalars
----
-unicode: "Sosa did fine.\u263A"
-control: "\b1998\t1999\t2000\n"
-hex esc: "\x0d\x0a is \r\n"
-single: '"Howdy!" he cried.'
-quoted: ' # not a ''comment''.'
-tie-fighter: '|\-*-/|'
-
-# Multi-line flow scalars
----
-plain:
- This unquoted scalar
- spans many lines.
-quoted: "So does this
- quoted scalar.\n"
-
-# Integers
----
-canonical: 12345
-decimal: +12_345
-sexagesimal: 3:25:45
-octal: 014
-hexadecimal: 0xC
-
-# Floating point
----
-canonical: 1.23015e+3
-exponential: 12.3015e+02
-sexagesimal: 20:30.15
-fixed: 1_230.15
-negative infinity: -.inf
-not a number: .NaN
-
-# Miscellaneous
----
-null: ~
-true: boolean
-false: boolean
-string: '12345'
-
-# Timestamps
----
-canonical: 2001-12-15T02:59:43.1Z
-iso8601: 2001-12-14t21:59:43.10-05:00
-spaced: 2001-12-14 21:59:43.10 -5
-date: 2002-12-14
-
-# Various explicit tags
----
-not-date: !!str 2002-04-28
-picture: !!binary |
- R0lGODlhDAAMAIQAAP//9/X
- 17unp5WZmZgAAAOfn515eXv
- Pz7Y6OjuDg4J+fn5OTk6enp
- 56enmleECcgggoBADs=
-application specific tag: !something |
- The semantics of the tag
- above may be different for
- different documents.
-
-# Global tags
-%TAG ! tag:clarkevans.com,2002:
---- !shape
- # Use the ! handle for presenting
- # tag:clarkevans.com,2002:circle
-- !circle
- center: &ORIGIN {x: 73, y: 129}
- radius: 7
-- !line
- start: *ORIGIN
- finish: { x: 89, y: 102 }
-- !label
- start: *ORIGIN
- color: 0xFFEEBB
- text: Pretty vector drawing.
-
-# Unordered sets
---- !!set
-# sets are represented as a
-# mapping where each key is
-# associated with the empty string
-? Mark McGwire
-? Sammy Sosa
-? Ken Griff
-
-# Ordered mappings
---- !!omap
-# ordered maps are represented as
-# a sequence of mappings, with
-# each mapping having one key
-- Mark McGwire: 65
-- Sammy Sosa: 63
-- Ken Griffy: 58
-
-# Full length example
---- !<tag:clarkevans.com,2002:invoice>
-invoice: 34843
-date : 2001-01-23
-bill-to: &id001
- given : Chris
- family : Dumars
- address:
- lines: |
- 458 Walkman Dr.
- Suite #292
- city : Royal Oak
- state : MI
- postal : 48046
-ship-to: *id001
-product:
- - sku : BL394D
- quantity : 4
- description : Basketball
- price : 450.00
- - sku : BL4438H
- quantity : 1
- description : Super Hoop
- price : 2392.00
-tax : 251.42
-total: 4443.52
-comments:
- Late afternoon is best.
- Backup contact is Nancy
- Billsmer @ 338-4338.
-
-# Another full-length example
----
-Time: 2001-11-23 15:01:42 -5
-User: ed
-Warning:
- This is an error message
- for the log file
----
-Time: 2001-11-23 15:02:31 -5
-User: ed
-Warning:
- A slightly different error
- message.
----
-Date: 2001-11-23 15:03:17 -5
-User: ed
-Fatal:
- Unknown variable "bar"
-Stack:
- - file: TopClass.py
- line: 23
- code: |
- x = MoreObject("345\n")
- - file: MoreClass.py
- line: 58
- code: |-
- foo = bar
-
diff --git a/tests/examplefiles/example.zig b/tests/examplefiles/example.zig
deleted file mode 100644
index 32e72849..00000000
--- a/tests/examplefiles/example.zig
+++ /dev/null
@@ -1,263 +0,0 @@
-const std = @import("std");
-const Allocator = mem.Allocator;
-const mem = std.mem;
-const ast = std.zig.ast;
-const Visib = @import("visib.zig").Visib;
-const event = std.event;
-const Value = @import("value.zig").Value;
-const Token = std.zig.Token;
-const errmsg = @import("errmsg.zig");
-const Scope = @import("scope.zig").Scope;
-const Compilation = @import("compilation.zig").Compilation;
-
-pub const Decl = struct {
- id: Id,
- name: []const u8,
- visib: Visib,
- resolution: event.Future(Compilation.BuildError!void),
- parent_scope: *Scope,
-
- // TODO when we destroy the decl, deref the tree scope
- tree_scope: *Scope.AstTree,
-
- pub const Table = std.HashMap([]const u8, *Decl, mem.hash_slice_u8, mem.eql_slice_u8);
-
- pub fn cast(base: *Decl, comptime T: type) ?*T {
- if (base.id != @field(Id, @typeName(T))) return null;
- return @fieldParentPtr(T, "base", base);
- }
-
- pub fn isExported(base: *const Decl, tree: *ast.Tree) bool {
- switch (base.id) {
- Id.Fn => {
- const fn_decl = @fieldParentPtr(Fn, "base", base);
- return fn_decl.isExported(tree);
- },
- else => return false,
- }
- }
-
- pub fn getSpan(base: *const Decl) errmsg.Span {
- switch (base.id) {
- Id.Fn => {
- const fn_decl = @fieldParentPtr(Fn, "base", base);
- const fn_proto = fn_decl.fn_proto;
- const start = fn_proto.fn_token;
- const end = fn_proto.name_token orelse start;
- return errmsg.Span{
- .first = start,
- .last = end + 1,
- };
- },
- else => @panic("TODO"),
- }
- }
-
- pub fn findRootScope(base: *const Decl) *Scope.Root {
- return base.parent_scope.findRoot();
- }
-
- pub const Id = enum {
- Var,
- Fn,
- CompTime,
- };
-
- pub const Var = struct {
- base: Decl,
- };
-
- pub const Fn = struct {
- base: Decl,
- value: Val,
- fn_proto: *ast.Node.FnProto,
-
- // TODO https://github.com/ziglang/zig/issues/683 and then make this anonymous
- pub const Val = union(enum) {
- Unresolved: void,
- Fn: *Value.Fn,
- FnProto: *Value.FnProto,
- };
-
- pub fn externLibName(self: Fn, tree: *ast.Tree) ?[]const u8 {
- return if (self.fn_proto.extern_export_inline_token) |tok_index| x: {
- const token = tree.tokens.at(tok_index);
- break :x switch (token.id) {
- Token.Id.Extern => tree.tokenSlicePtr(token),
- else => null,
- };
- } else null;
- }
-
- pub fn isExported(self: Fn, tree: *ast.Tree) bool {
- if (self.fn_proto.extern_export_inline_token) |tok_index| {
- const token = tree.tokens.at(tok_index);
- return token.id == Token.Id.Keyword_export;
- } else {
- return false;
- }
- }
- };
-
- pub const CompTime = struct {
- base: Decl,
- };
-};
-
-pub const info_zen =
- \\
- \\ * Communicate intent precisely.
- \\ * Edge cases matter.
- \\ * Favor reading code over writing code.
- \\ * Only one obvious way to do things.
- \\ * Runtime crashes are better than bugs.
- \\ * Compile errors are better than runtime crashes.
- \\ * Incremental improvements.
- \\ * Avoid local maximums.
- \\ * Reduce the amount one must remember.
- \\ * Minimize energy spent on coding style.
- \\ * Together we serve end users.
- \\
- \\
-;
-
-fn cmdZen(allocator: *Allocator, args: []const []const u8) !void {
- try stdout.write(info_zen);
-}
-
-const usage_internal =
- \\usage: zig internal [subcommand]
- \\
- \\Sub-Commands:
- \\ build-info Print static compiler build-info
- \\
- \\
-;
-
-fn cmdInternal(allocator: *Allocator, args: []const []const u8) !void {
- if (args.len == 0) {
- try stderr.write(usage_internal);
- os.exit(1);
- }
-
- const sub_commands = []Command{Command{
- .name = "build-info",
- .exec = cmdInternalBuildInfo,
- }};
-
- for (sub_commands) |sub_command| {
- if (mem.eql(u8, sub_command.name, args[0])) {
- try sub_command.exec(allocator, args[1..]);
- return;
- }
- }
-
- try stderr.print("unknown sub command: {}\n\n", args[0]);
- try stderr.write(usage_internal);
-}
-
-fn cmdInternalBuildInfo(allocator: *Allocator, args: []const []const u8) !void {
- try stdout.print(
- \\ZIG_CMAKE_BINARY_DIR {}
- \\ZIG_CXX_COMPILER {}
- \\ZIG_LLVM_CONFIG_EXE {}
- \\ZIG_LLD_INCLUDE_PATH {}
- \\ZIG_LLD_LIBRARIES {}
- \\ZIG_STD_FILES {}
- \\ZIG_C_HEADER_FILES {}
- \\ZIG_DIA_GUIDS_LIB {}
- \\
- ,
- std.cstr.toSliceConst(c.ZIG_CMAKE_BINARY_DIR),
- std.cstr.toSliceConst(c.ZIG_CXX_COMPILER),
- std.cstr.toSliceConst(c.ZIG_LLVM_CONFIG_EXE),
- std.cstr.toSliceConst(c.ZIG_LLD_INCLUDE_PATH),
- std.cstr.toSliceConst(c.ZIG_LLD_LIBRARIES),
- std.cstr.toSliceConst(c.ZIG_STD_FILES),
- std.cstr.toSliceConst(c.ZIG_C_HEADER_FILES),
- std.cstr.toSliceConst(c.ZIG_DIA_GUIDS_LIB),
- );
-}
-
-fn test__floatuntisf(a: u128, expected: f32) void {
- const x = __floatuntisf(a);
- testing.expect(x == expected);
-}
-
-test "floatuntisf" {
- test__floatuntisf(0, 0.0);
-
- test__floatuntisf(1, 1.0);
- test__floatuntisf(2, 2.0);
- test__floatuntisf(20, 20.0);
-
- test__floatuntisf(0x7FFFFF8000000000, 0x1.FFFFFEp+62);
- test__floatuntisf(0x7FFFFF0000000000, 0x1.FFFFFCp+62);
-
- test__floatuntisf(make_ti(0x8000008000000000, 0), 0x1.000001p+127);
- test__floatuntisf(make_ti(0x8000000000000800, 0), 0x1.0p+127);
- test__floatuntisf(make_ti(0x8000010000000000, 0), 0x1.000002p+127);
-
- test__floatuntisf(make_ti(0x8000000000000000, 0), 0x1.000000p+127);
-
- test__floatuntisf(0x0007FB72E8000000, 0x1.FEDCBAp+50);
-
- test__floatuntisf(0x0007FB72EA000000, 0x1.FEDCBA8p+50);
- test__floatuntisf(0x0007FB72EB000000, 0x1.FEDCBACp+50);
-
- test__floatuntisf(0x0007FB72EC000000, 0x1.FEDCBBp+50);
-
- test__floatuntisf(0x0007FB72E6000000, 0x1.FEDCB98p+50);
- test__floatuntisf(0x0007FB72E7000000, 0x1.FEDCB9Cp+50);
- test__floatuntisf(0x0007FB72E4000000, 0x1.FEDCB9p+50);
-
- test__floatuntisf(0xFFFFFFFFFFFFFFFE, 0x1p+64);
- test__floatuntisf(0xFFFFFFFFFFFFFFFF, 0x1p+64);
-
- test__floatuntisf(0x0007FB72E8000000, 0x1.FEDCBAp+50);
-
- test__floatuntisf(0x0007FB72EA000000, 0x1.FEDCBAp+50);
- test__floatuntisf(0x0007FB72EB000000, 0x1.FEDCBAp+50);
- test__floatuntisf(0x0007FB72EBFFFFFF, 0x1.FEDCBAp+50);
- test__floatuntisf(0x0007FB72EC000000, 0x1.FEDCBCp+50);
- test__floatuntisf(0x0007FB72E8000001, 0x1.FEDCBAp+50);
-
- test__floatuntisf(0x0007FB72E6000000, 0x1.FEDCBAp+50);
- test__floatuntisf(0x0007FB72E7000000, 0x1.FEDCBAp+50);
- test__floatuntisf(0x0007FB72E7FFFFFF, 0x1.FEDCBAp+50);
- test__floatuntisf(0x0007FB72E4000001, 0x1.FEDCBAp+50);
- test__floatuntisf(0x0007FB72E4000000, 0x1.FEDCB8p+50);
-
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCB90000000000001), 0x1.FEDCBAp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBA0000000000000), 0x1.FEDCBAp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBAFFFFFFFFFFFFF), 0x1.FEDCBAp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBB0000000000000), 0x1.FEDCBCp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBB0000000000001), 0x1.FEDCBCp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBBFFFFFFFFFFFFF), 0x1.FEDCBCp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBC0000000000000), 0x1.FEDCBCp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBC0000000000001), 0x1.FEDCBCp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBD0000000000000), 0x1.FEDCBCp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBD0000000000001), 0x1.FEDCBEp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBDFFFFFFFFFFFFF), 0x1.FEDCBEp+76);
- test__floatuntisf(make_ti(0x0000000000001FED, 0xCBE0000000000000), 0x1.FEDCBEp+76);
-}
-
-fn trimStart(slice: []const u8, ch: u8) []const u8 {
- var i: usize = 0;
- const test_string = "test\"string";
- for (slice) |b| {
- if (b == '\xa3') break;
- if (b == '\ua3d3') break;
- if (b == '\Ua3d3d3') break;
- if (b == '\t') break;
- if (b == '\n') break;
- if (b == '\\') break;
- if (b == '\'') break;
- if (b == '"') break;
- if (b != 'n') break;
- if (b != '-') break;
- i += 1;
- }
-
- return slice[i..];
-}
diff --git a/tests/examplefiles/example1.cadl b/tests/examplefiles/example1.cadl
deleted file mode 100644
index 3350fa3b..00000000
--- a/tests/examplefiles/example1.cadl
+++ /dev/null
@@ -1,149 +0,0 @@
- --
- -- Example fragment of an openEHR Archetype, written in cADL, a subsyntax of the Archetype Definition Language (ADL)
- -- definition available here: http://www.openehr.org/releases/trunk/architecture/am/adl2.pdf
- -- Author: Thomas Beale
- --
-
- EVALUATION[id1] matches { -- Adverse Reaction
- data matches {
- ITEM_TREE[id2] matches {
- items cardinality matches {1..*; unordered} matches {
- ELEMENT[id3] matches { -- Substance/Agent
- value matches {
- DV_TEXT[id51]
- }
- }
- ELEMENT[id5] occurrences matches {0..1} matches { -- Absolute Contraindication?
- value matches {
- DV_BOOLEAN[id52] matches {
- value matches {True}
- }
- }
- }
- ELEMENT[id50] occurrences matches {0..1} matches { -- Future Use
- value matches {
- DV_TEXT[id53]
- }
- }
- ELEMENT[id7] occurrences matches {0..1} matches { -- Overall Comment
- value matches {
- DV_TEXT[id54]
- }
- }
- CLUSTER[id10] matches { -- Reaction Event
- items matches {
- ELEMENT[id11] occurrences matches {0..1} matches { -- Specific Substance/Agent
- value matches {
- DV_TEXT[id55]
- }
- }
- ELEMENT[id12] matches { -- Manifestation
- value matches {
- DV_TEXT[id56]
- }
- }
- ELEMENT[id17] occurrences matches {0..1} matches { -- Reaction Type
- value matches {
- DV_TEXT[id57]
- }
- }
- ELEMENT[id22] occurrences matches {0..1} matches { -- Certainty
- value matches {
- DV_CODED_TEXT[id58] matches {
- defining_code matches {[ac1]} -- Certainty (synthesised)
- }
- }
- }
- ELEMENT[id13] occurrences matches {0..1} matches { -- Reaction Description
- value matches {
- DV_TEXT[id59]
- }
- }
- ELEMENT[id28] occurrences matches {0..1} matches { -- Onset of Reaction
- value matches {
- DV_DATE_TIME[id60]
- }
- }
- ELEMENT[id29] occurrences matches {0..1} matches { -- Duration of Reaction
- value matches {
- DV_DURATION[id61]
- }
- }
- allow_archetype CLUSTER[id30] matches { -- Additional Reaction Detail
- include
- archetype_id/value matches {/openEHR-EHR-CLUSTER\.anatomical_location(-a-zA-Z0-9_]+)*\.v1/}
- }
- ELEMENT[id19] occurrences matches {0..1} matches { -- Exposure Description
- value matches {
- DV_TEXT[id62]
- }
- }
- ELEMENT[id21] occurrences matches {0..1} matches { -- Earliest Exposure
- value matches {
- DV_DATE_TIME[id63]
- }
- }
- ELEMENT[id26] occurrences matches {0..1} matches { -- Duration of Exposure
- value matches {
- DV_DURATION[id64]
- }
- }
- allow_archetype CLUSTER[id20] matches { -- Additional Exposure Detail
- include
- archetype_id/value matches {/openEHR-EHR-CLUSTER\.amount(-a-zA-Z0-9_]+)*\.v1|openEHR-EHR-CLUSTER\.medication_admin(-a-zA-Z0-9_]+)*\.v1|openEHR-EHR-CLUSTER\.timing(-a-zA-Z0-9_]+)*\.v1/}
- }
- ELEMENT[id41] occurrences matches {0..1} matches { -- Clinical Management Description
- value matches {
- DV_TEXT[id65]
- }
- }
- ELEMENT[id32] matches { -- Multimedia
- value matches {
- DV_MULTIMEDIA[id66] matches {
- media_type
- }
- }
- }
- allow_archetype CLUSTER[id42] matches { -- Reporting Details
- include
- archetype_id/value matches {/.*/}
- }
- ELEMENT[id33] occurrences matches {0..1} matches { -- Reaction Comment
- value matches {
- DV_TEXT[id67]
- }
- }
- }
- }
- }
- }
- }
- protocol matches {
- ITEM_TREE[id43] matches {
- items matches {
- ELEMENT[id45] occurrences matches {0..1} matches { -- Reaction Reported?
- value matches {
- DV_BOOLEAN[id68] matches {
- value matches {True, False}
- }
- }
- }
- ELEMENT[id49] occurrences matches {0..1} matches { -- Report Comment
- value matches {
- DV_TEXT[id69]
- }
- }
- ELEMENT[id46] matches { -- Adverse Reaction Report
- value matches {
- DV_URI[id70]
- }
- }
- ELEMENT[id48] occurrences matches {0..1} matches { -- Supporting Clinical Record Information
- value matches {
- DV_EHR_URI[id71]
- }
- }
- }
- }
- }
- }
diff --git a/tests/examplefiles/example2.aspx b/tests/examplefiles/example2.aspx
deleted file mode 100644
index 52b7c001..00000000
--- a/tests/examplefiles/example2.aspx
+++ /dev/null
@@ -1,29 +0,0 @@
-<%@ Register TagPrefix="Acme" TagName="Message" Src="userctrl2_vb.ascx" %>
-
-<html>
-
- <script language="VB" runat="server">
-
- Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
- MyMessage.MessageText = "Message text changed!"
- MyMessage.Color = "red"
- End Sub
-
- </script>
-
-<body style="font: 10pt verdana">
-
- <h3>A Simple User Control w/ Properties</h3>
-
- <form runat="server">
-
- <Acme:Message id="MyMessage" MessageText="This is a custom message!" Color="blue" runat="server"/>
-
- <p>
-
- <asp:button text="Change Properties" OnClick="SubmitBtn_Click" runat=server/>
-
- </form>
-
-</body>
-</html>
diff --git a/tests/examplefiles/example2.cpp b/tests/examplefiles/example2.cpp
deleted file mode 100644
index ccd99383..00000000
--- a/tests/examplefiles/example2.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * A Test file for the different string literals.
- */
-
-#include <iostream>
-
-int main() {
- char *_str = "a normal string";
- wchar_t *L_str = L"a wide string";
- char *u8_str = u8"utf-8 string";
- char16_t *u_str = u"utf-16 string";
- char32_t *U_str = U"utf-32 string";
- char *R_str = R""""(raw string with
-"""
-as a delimiter)"""";
-
- std::cout << R_str << std::endl;
-
- return 0;
-}
diff --git a/tests/examplefiles/example2.msc b/tests/examplefiles/example2.msc
deleted file mode 100644
index 61e2ef83..00000000
--- a/tests/examplefiles/example2.msc
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/mscgen -Tpng
-#
-# testinput2.msc : Sample msc input file with URLs
-#
-# This file is PUBLIC DOMAIN and may be freely reproduced, distributed,
-# transmitted, used, modified, built upon, or otherwise exploited by
-# anyone for any purpose, commercial or non-commercial, and in any way,
-# including by methods that have not yet been invented or conceived.
-#
-# This file is provided "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
-# EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-#
-
-# Note: This is from mscgen-0.20
-
-msc {
-
-A,B;
-
---- [label="Start", ID="1"];
-
-A->B [label="signal"];
-A<-B [label="signal"];
-
-
-A=>B [label="method"];
-A<=B [label="method"];
-
-A>>B [label="return"];
-A<<B [label="return"];
-
-A=>>B [label="call-back"];
-A<<=B [label="call-back", URL="www.google.com"];
-
-A x- B [label="loss"];
-A -x B [label="loss"];
-
---- [label="Left arcs", ID="2", IDURL="www.google.co.uk"];
-
-A->A [label="signal"];
-A<-A [label="signal"];
-
-
-A=>A [label="method"];
-A<=A [label="method"];
-
-A>>A [label="return"];
-A<<A [label="return"];
-
-A=>>A [label="call-back"];
-A<<=A [label="call-back", URL="www.google.com", ID="3"];
-
-A x- A [label="loss"];
-A -x A [label="loss"];
-
---- [label="Right arcs"];
-
-B->B [label="signal"];
-B<-B [label="signal"];
-
-
-B=>B [label="method"];
-B<=B [label="method"];
-
-B>>B [label="return"];
-B<<B [label="return"];
-
-B=>>B [label="call-back", ID="4"];
-B<<=B [label="call-back", URL="www.google.com"];
-
-B x- B [label="loss"];
-B -x B [label="loss"];
-
---- [label="End of arcs", URL="www.google.com"];
-
-
-... [label="Some time passes", URL="www.google.com"];
-}
diff --git a/tests/examplefiles/exampleScript.cfc b/tests/examplefiles/exampleScript.cfc
deleted file mode 100644
index 002acbcd..00000000
--- a/tests/examplefiles/exampleScript.cfc
+++ /dev/null
@@ -1,241 +0,0 @@
-<cfscript>
-/**
-********************************************************************************
-ContentBox - A Modular Content Platform
-Copyright 2012 by Luis Majano and Ortus Solutions, Corp
-www.gocontentbox.org | www.luismajano.com | www.ortussolutions.com
-********************************************************************************
-Apache License, Version 2.0
-
-Copyright Since [2012] [Luis Majano and Ortus Solutions,Corp]
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-********************************************************************************
-* A generic content service for content objects
-*/
-component extends="coldbox.system.orm.hibernate.VirtualEntityService" singleton{
-
- // DI
- property name="settingService" inject="id:settingService@cb";
- property name="cacheBox" inject="cachebox";
- property name="log" inject="logbox:logger:{this}";
- property name="customFieldService" inject="customFieldService@cb";
- property name="categoryService" inject="categoryService@cb";
- property name="commentService" inject="commentService@cb";
- property name="contentVersionService" inject="contentVersionService@cb";
- property name="authorService" inject="authorService@cb";
- property name="populator" inject="wirebox:populator";
- property name="systemUtil" inject="SystemUtil@cb";
-
- /*
- * Constructor
- * @entityName.hint The content entity name to bind this service to.
- */
- ContentService function init(entityName="cbContent"){
- // init it
- super.init(entityName=arguments.entityName, useQueryCaching=true);
-
- // Test scope coloring in pygments
- this.colorTestVar = "Just for testing pygments!";
- cookie.colorTestVar = "";
- client.colorTestVar = ""
- session.colorTestVar = "";
- application.colorTestVar = "";
-
- return this;
- }
-
- /**
- * Clear all content caches
- * @async.hint Run it asynchronously or not, defaults to false
- */
- function clearAllCaches(boolean async=false){
- var settings = settingService.getAllSettings(asStruct=true);
- // Get appropriate cache provider
- var cache = cacheBox.getCache( settings.cb_content_cacheName );
- cache.clearByKeySnippet(keySnippet="cb-content",async=arguments.async);
- return this;
- }
-
- /**
- * Clear all page wrapper caches
- * @async.hint Run it asynchronously or not, defaults to false
- */
- function clearAllPageWrapperCaches(boolean async=false){
- var settings = settingService.getAllSettings(asStruct=true);
- // Get appropriate cache provider
- var cache = cacheBox.getCache( settings.cb_content_cacheName );
- cache.clearByKeySnippet(keySnippet="cb-content-pagewrapper",async=arguments.async);
- return this;
- }
-
- /**
- * Clear all page wrapper caches
- * @slug.hint The slug partial to clean on
- * @async.hint Run it asynchronously or not, defaults to false
- */
- function clearPageWrapperCaches(required any slug, boolean async=false){
- var settings = settingService.getAllSettings(asStruct=true);
- // Get appropriate cache provider
- var cache = cacheBox.getCache( settings.cb_content_cacheName );
- cache.clearByKeySnippet(keySnippet="cb-content-pagewrapper-#arguments.slug#",async=arguments.async);
- return this;
- }
-
- /**
- * Clear a page wrapper cache
- * @slug.hint The slug to clean
- * @async.hint Run it asynchronously or not, defaults to false
- */
- function clearPageWrapper(required any slug, boolean async=false){
- var settings = settingService.getAllSettings(asStruct=true);
- // Get appropriate cache provider
- var cache = cacheBox.getCache( settings.cb_content_cacheName );
- cache.clear("cb-content-pagewrapper-#arguments.slug#/");
- return this;
- }
-
- /**
- * Searches published content with cool paramters, remember published content only
- * @searchTerm.hint The search term to search
- * @max.hint The maximum number of records to paginate
- * @offset.hint The offset in the pagination
- * @asQuery.hint Return as query or array of objects, defaults to array of objects
- * @sortOrder.hint The sorting of the search results, defaults to publishedDate DESC
- * @isPublished.hint Search for published, non-published or both content objects [true, false, 'all']
- * @searchActiveContent.hint Search only content titles or both title and active content. Defaults to both.
- */
- function searchContent(
- any searchTerm="",
- numeric max=0,
- numeric offset=0,
- boolean asQuery=false,
- any sortOrder="publishedDate DESC",
- any isPublished=true,
- boolean searchActiveContent=true){
-
- var results = {};
- var c = newCriteria();
-
- // only published content
- if( isBoolean( arguments.isPublished ) ){
- // Published bit
- c.isEq( "isPublished", javaCast( "Boolean", arguments.isPublished ) );
- // Published eq true evaluate other params
- if( arguments.isPublished ){
- c.isLt("publishedDate", now() )
- .$or( c.restrictions.isNull("expireDate"), c.restrictions.isGT("expireDate", now() ) )
- .isEq("passwordProtection","");
- }
- }
-
- // Search Criteria
- if( len( arguments.searchTerm ) ){
- // like disjunctions
- c.createAlias("activeContent","ac");
- // Do we search title and active content or just title?
- if( arguments.searchActiveContent ){
- c.$or( c.restrictions.like("title","%#arguments.searchTerm#%"),
- c.restrictions.like("ac.content", "%#arguments.searchTerm#%") );
- }
- else{
- c.like( "title", "%#arguments.searchTerm#%" );
- }
- }
-
- // run criteria query and projections count
- results.count = c.count( "contentID" );
- results.content = c.resultTransformer( c.DISTINCT_ROOT_ENTITY )
- .list(offset=arguments.offset, max=arguments.max, sortOrder=arguments.sortOrder, asQuery=arguments.asQuery);
-
- return results;
- }
-
-/********************************************* PRIVATE *********************************************/
-
-
- /**
- * Update the content hits
- * @contentID.hint The content id to update
- */
- private function syncUpdateHits(required contentID){
- var q = new Query(sql="UPDATE cb_content SET hits = hits + 1 WHERE contentID = #arguments.contentID#").execute();
- return this;
- }
-
-
- private function closureTest(){
- methodCall(
- param1,
- function( arg1, required arg2 ){
- var settings = settingService.getAllSettings(asStruct=true);
- // Get appropriate cache provider
- var cache = cacheBox.getCache( settings.cb_content_cacheName );
- cache.clear("cb-content-pagewrapper-#arguments.slug#/");
- return this;
- },
- param1
- );
- }
-
- private function StructliteralTest(){
- return {
- foo = bar,
- brad = 'Wood',
- func = function( arg1, required arg2 ){
- var settings = settingService.getAllSettings(asStruct=true);
- // Get appropriate cache provider
- var cache = cacheBox.getCache( settings.cb_content_cacheName );
- cache.clear("cb-content-pagewrapper-#arguments.slug#/");
- return this;
- },
- array = [
- 1,
- 2,
- 3,
- 4,
- 5,
- 'test',
- 'testing',
- 'testerton',
- {
- foo = true,
- brad = false,
- wood = null
- }
- ],
- last = "final"
- };
- }
-
- private function arrayliteralTest(){
- return [
- 1,
- 2,
- 3,
- 4,
- 5,
- 'test',
- 'testing',
- 'testerton',
- {
- foo = true,
- brad = false,
- wood = null
- },
- 'testy-von-testavich'
- ];
- }
-
-}
-</cfscript> \ No newline at end of file
diff --git a/tests/examplefiles/exampleTag.cfc b/tests/examplefiles/exampleTag.cfc
deleted file mode 100644
index 753bb826..00000000
--- a/tests/examplefiles/exampleTag.cfc
+++ /dev/null
@@ -1,18 +0,0 @@
-<cfcomponent>
-
- <cffunction name="init" access="public" returntype="any">
- <cfargument name="arg1" type="any" required="true">
- <cfset this.myVariable = arguments.arg1>
-
- <cfreturn this>
- </cffunction>
-
- <cffunction name="testFunc" access="private" returntype="void">
- <cfargument name="arg1" type="any" required="false">
-
- <cfif structKeyExists(arguments, "arg1")>
- <cfset writeoutput("Argument exists")>
- </cfif>
- </cffunction>
-
-</cfcomponent> \ No newline at end of file
diff --git a/tests/examplefiles/example_coq.v b/tests/examplefiles/example_coq.v
deleted file mode 100644
index fd1a7bc8..00000000
--- a/tests/examplefiles/example_coq.v
+++ /dev/null
@@ -1,4 +0,0 @@
-Lemma FalseLemma : False <-> False.
-tauto.
-Qed.
-Check FalseLemma.
diff --git a/tests/examplefiles/example_elixir.ex b/tests/examplefiles/example_elixir.ex
deleted file mode 100644
index ddca7f60..00000000
--- a/tests/examplefiles/example_elixir.ex
+++ /dev/null
@@ -1,233 +0,0 @@
-# Numbers
-0b0101011
-1234 ; 0x1A ; 0xbeef ; 0763 ; 0o123
-3.14 ; 5.0e21 ; 0.5e-12
-100_000_000
-
-# these are not valid numbers
-0b012 ; 0xboar ; 0o888
-0B01 ; 0XAF ; 0O123
-
-# Characters
-?a ; ?1 ; ?\n ; ?\s ; ?\c ; ? ; ?,
-?\x{12} ; ?\x{abcd}
-?\x34 ; ?\xF
-
-# these show that only the first digit is part of the character
-?\123 ; ?\12 ; ?\7
-
-# Atoms
-:this ; :that
-:'complex atom'
-:"with' \"\" 'quotes"
-:" multi
- line ' \s \123 \xff
-atom"
-:... ; :<<>> ; :%{} ; :% ; :{}
-:++; :--; :*; :~~~; :::
-:% ; :. ; :<-
-
-# Strings
-"Hello world"
-"Interspersed \x{ff} codes \7 \8 \65 \016 and \t\s\\s\z\+ \\ escapes"
-"Quotes ' inside \" \123 the \"\" \xF \\xF string \\\" end"
-"Multiline
- string"
-
-# Char lists
-'this is a list'
-'escapes \' \t \\\''
-'Multiline
- char
- list
-'
-
-# Binaries
-<<1, 2, 3>>
-<<"hello"::binary, c :: utf8, x::[4, unit(2)]>> = "hello™1"
-
-# Sigils
-~r/this + i\s "a" regex/
-~R'this + i\s "a" regex too'
-~w(hello #{ ["has" <> "123", '\c\d', "\123 interpol" | []] } world)s
-~W(hello #{no "123" \c\d \123 interpol} world)s
-
-~s{Escapes terminators \{ and \}, but no {balancing} # outside of sigil here }
-
-~S"No escapes \s\t\n and no #{interpolation}"
-
-:"atoms work #{"to" <> "o"}"
-
-# Operators
-x = 1 + 2.0 * 3
-y = true and false; z = false or true
-... = 144
-... == !x && y || z
-"hello" |> String.upcase |> String.downcase()
-{^z, a} = {true, x}
-
-# Free operators (added in 1.0.0)
-p ~>> f = bind(p, f)
-p1 ~> p2 = pair_right(p1, p2)
-p1 <~ p2 = pair_left(p1, p2)
-p1 <~> p2 = pair_both(p1, p2)
-p |~> f = map(p, f)
-p1 <|> p2 = either(p1, p2)
-
-# Lists, tuples, maps, keywords
-[1, :a, 'hello'] ++ [2, 3]
-[:head | [?t, ?a, ?i, ?l]]
-
-{:one, 2.0, "three"}
-
-[...: "this", <<>>: "is", %{}: "a keyword", %: "list", {}: "too"]
-["this is an atom too": 1, "so is this": 2]
-[option: "value", key: :word]
-[++: "operator", ~~~: :&&&]
-
-map = %{shortcut: "syntax"}
-%{map | "update" => "me"}
-%{ 12 => 13, :weird => ['thing'] }
-
-# Comprehensions
-for x <- 1..10, x < 5, do: {x, x}
-pixels = "12345678"
-for << <<r::4, g::4, b::4, a::size(4)>> <- pixels >> do
- [r, {g, %{"b" => a}}]
-end
-
-# String interpolation
-"String #{inspect "interpolation"} is quite #{1+4+7} difficult"
-
-# Identifiers
-abc_123 = 1
-_018OP = 2
-A__0 == 3
-
-# Modules
-defmodule Long.Module.Name do
- @moduledoc "Simple module docstring"
-
- @doc """
- Multiline docstring
- "with quotes"
- and #{ inspect %{"interpolation" => "in" <> "action"} }
- now with #{ {:a, 'tuple'} }
- and #{ inspect {
- :tuple,
- %{ with: "nested #{ inspect %{ :interpolation => %{} } }" }
- } }
- """
- defstruct [:a, :name, :height]
-
- @doc ~S'''
- No #{interpolation} of any kind.
- \000 \x{ff}
-
- \n #{\x{ff}}
- '''
- def func(a, b \\ []), do: :ok
-
- @doc false
- def __before_compile__(_) do
- :ok
- end
-end
-
-# Structs
-defmodule Second.Module do
- s = %Long.Module.Name{name: "Silly"}
- %Long.Module.Name{s | height: {192, :cm}}
- ".. #{%Long.Module.Name{s | height: {192, :cm}}} .."
-end
-
-# Types, pseudo-vars, attributes
-defmodule M do
- @custom_attr :some_constant
-
- @before_compile Long.Module.Name
-
- @typedoc "This is a type"
- @type typ :: integer
-
- @typedoc """
- Another type
- """
- @opaque typtyp :: 1..10
-
- @spec func(typ, typtyp) :: :ok | :fail
- def func(a, b) do
- a || b || :ok || :fail
- Path.expand("..", __DIR__)
- IO.inspect __ENV__
- __NOTAPSEUDOVAR__ = 11
- __MODULE__.func(b, a)
- end
-
- defmacro m() do
- __CALLER__
- end
-end
-
-# Functions
-anon = fn x, y, z ->
- fn(a, b, c) ->
- &(x + y - z * a / &1 + b + div(&2, c))
- end
-end
-
-&Set.put(&1, &2) ; & Set.put(&1, &2) ; &( Set.put(&1, &1) )
-
-# Function calls
-anon.(1, 2, 3); self; hd([1,2,3])
-Kernel.spawn(fn -> :ok end)
-IO.ANSI.black
-
-# Control flow
-if :this do
- :that
-else
- :otherwise
-end
-
-pid = self
-receive do
- {:EXIT, _} -> :done
- {^pid, :_} -> nil
- after 100 -> :no_luck
-end
-
-case __ENV__.line do
- x when is_integer(x) -> x
- x when x in 1..12 -> -x
-end
-
-cond do
- false -> "too bad"
- 4 > 5 -> "oops"
- true -> nil
-end
-
-# Lexical scope modifiers
-import Kernel, except: [spawn: 1, +: 2, /: 2, Unless: 2]
-alias Long.Module.Name, as: N0men123_and4
-use Bitwise
-
-4 &&& 5
-2 <<< 3
-
-# Protocols
-defprotocol Useless do
- def func1(this)
- def func2(that)
-end
-
-defimpl Useless, for: Atom do
-end
-
-# Exceptions
-defmodule NotAnError do
- defexception [:message]
-end
-
-raise NotAnError, message: "This is not an error"
diff --git a/tests/examplefiles/example_file.fy b/tests/examplefiles/example_file.fy
deleted file mode 100644
index 43e80c1d..00000000
--- a/tests/examplefiles/example_file.fy
+++ /dev/null
@@ -1,128 +0,0 @@
-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/ezhil_primefactors.n b/tests/examplefiles/ezhil_primefactors.n
deleted file mode 100644
index 13390611..00000000
--- a/tests/examplefiles/ezhil_primefactors.n
+++ /dev/null
@@ -1,152 +0,0 @@
-# (C) முத்தையா அண்ணாமலை 2013
-# (A) என். சொக்கன்
-# எழில் தமிழ் நிரலாக்க மொழி உதாரணம்
-# Muthu A granted permission for this to be included under the BSD license
-# https://bitbucket.org/birkenfeld/pygments-main/pull-requests/443/ezhil-language-lexer-for-pygments/diff
-
-## Prime Factors Example
-## பகா எண் கூறுகளைக் கண்டறியும் உதாரணம்
-
-## இது நிரல் தரப்பட்ட எண்ணின் பகாஎண் கூறுகளைக் கண்டறியும்
-
-நிரல்பாகம் பகாஎண்ணா(எண்1)
-
- ## இது நிரல்பாகம் தரப்பட்ட எண் பகு எண்ணா அல்லது பகா எண்ணா என்று கண்டறிந்து சொல்லும்
- ## பகுஎண் என்றால் 0 திரும்பத் தரப்படும்
- ## பகாஎண் என்றால் 1 திரும்பத் தரப்படும்
-
- @(எண்1 < 0) ஆனால்
-
- ## எதிர்மறை எண்களை நேராக்குதல்
-
- எண்1 = எண்1 * (-1)
-
- முடி
-
- @(எண்1 < 2) ஆனால்
-
- ## பூஜ்ஜியம், ஒன்று ஆகியவை பகா எண்கள் அல்ல
-
- பின்கொடு 0
-
- முடி
-
- @(எண்1 == 2) ஆனால்
-
- ## இரண்டு என்ற எண் ஒரு பகா எண்
-
- பின்கொடு 1
-
- முடி
-
- மீதம் = எண்1%2
-
- @(மீதம் == 0) ஆனால்
-
- ## இரட்டைப்படை எண், ஆகவே, இது பகா எண் அல்ல
-
- பின்கொடு 0
-
- முடி
-
- எண்1வர்க்கமூலம் = எண்1^0.5
-
- @(எண்2 = 3, எண்2 <= எண்1வர்க்கமூலம், எண்2 = எண்2 + 2) ஆக
-
- மீதம்1 = எண்1%எண்2
-
- @(மீதம்1 == 0) ஆனால்
-
- ## ஏதேனும் ஓர் எண்ணால் முழுமையாக வகுபட்டுவிட்டது, ஆகவே அது பகா எண் அல்ல
-
- பின்கொடு 0
-
- முடி
-
- முடி
-
- பின்கொடு 1
-
-முடி
-
-நிரல்பாகம் பகுத்தெடு(எண்1)
-
- ## இது எண் தரப்பட்ட எண்ணின் பகா எண் கூறுகளைக் கண்டறிந்து பட்டியல் இடும்
-
- கூறுகள் = பட்டியல்()
-
- @(எண்1 < 0) ஆனால்
-
- ## எதிர்மறை எண்களை நேராக்குதல்
-
- எண்1 = எண்1 * (-1)
-
- முடி
-
- @(எண்1 <= 1) ஆனால்
-
- ## ஒன்று அல்லது அதற்குக் குறைவான எண்களுக்குப் பகா எண் விகிதம் கண்டறியமுடியாது
-
- பின்கொடு கூறுகள்
-
- முடி
-
- @(பகாஎண்ணா(எண்1) == 1) ஆனால்
-
- ## தரப்பட்ட எண்ணே பகா எண்ணாக அமைந்துவிட்டால், அதற்கு அதுவே பகாஎண் கூறு ஆகும்
-
- பின்இணை(கூறுகள், எண்1)
- பின்கொடு கூறுகள்
-
- முடி
-
- தாற்காலிகஎண் = எண்1
-
- எண்2 = 2
-
- @(எண்2 <= தாற்காலிகஎண்) வரை
-
- விடை1 = பகாஎண்ணா(எண்2)
- மீண்டும்தொடங்கு = 0
-
- @(விடை1 == 1) ஆனால்
-
- விடை2 = தாற்காலிகஎண்%எண்2
-
- @(விடை2 == 0) ஆனால்
-
- ## பகா எண்ணால் முழுமையாக வகுபட்டுள்ளது, அதனைப் பட்டியலில் இணைக்கிறோம்
-
- பின்இணை(கூறுகள், எண்2)
- தாற்காலிகஎண் = தாற்காலிகஎண்/எண்2
-
- ## மீண்டும் இரண்டில் தொடங்கி இதே கணக்கிடுதலைத் தொடரவேண்டும்
-
- எண்2 = 2
- மீண்டும்தொடங்கு = 1
-
- முடி
-
- முடி
-
- @(மீண்டும்தொடங்கு == 0) ஆனால்
-
- ## அடுத்த எண்ணைத் தேர்ந்தெடுத்துக் கணக்கிடுதலைத் தொடரவேண்டும்
-
- எண்2 = எண்2 + 1
-
- முடி
-
- முடி
-
- பின்கொடு கூறுகள்
-
-முடி
-
-அ = int(உள்ளீடு("உங்களுக்குப் பிடித்த ஓர் எண்ணைத் தாருங்கள்: "))
-
-பகாஎண்கூறுகள் = பட்டியல்()
-
-பகாஎண்கூறுகள் = பகுத்தெடு(அ)
-
-பதிப்பி "நீங்கள் தந்த எண்ணின் பகா எண் கூறுகள் இவை: ", பகாஎண்கூறுகள்
diff --git a/tests/examplefiles/fennelview.fnl b/tests/examplefiles/fennelview.fnl
deleted file mode 100644
index fd0fc648..00000000
--- a/tests/examplefiles/fennelview.fnl
+++ /dev/null
@@ -1,156 +0,0 @@
-;; A pretty-printer that outputs tables in Fennel syntax.
-;; Loosely based on inspect.lua: http://github.com/kikito/inspect.lua
-
-(local quote (fn [str] (.. '"' (: str :gsub '"' '\\"') '"')))
-
-(local short-control-char-escapes
- {"\a" "\\a" "\b" "\\b" "\f" "\\f" "\n" "\\n"
- "\r" "\\r" "\t" "\\t" "\v" "\\v"})
-
-(local long-control-char-esapes
- (let [long {}]
- (for [i 0 31]
- (let [ch (string.char i)]
- (when (not (. short-control-char-escapes ch))
- (tset short-control-char-escapes ch (.. "\\" i))
- (tset long ch (: "\\%03d" :format i)))))
- long))
-
-(fn escape [str]
- (let [str (: str :gsub "\\" "\\\\")
- str (: str :gsub "(%c)%f[0-9]" long-control-char-esapes)]
- (: str :gsub "%c" short-control-char-escapes)))
-
-(fn sequence-key? [k len]
- (and (= (type k) "number")
- (<= 1 k)
- (<= k len)
- (= (math.floor k) k)))
-
-(local type-order {:number 1 :boolean 2 :string 3 :table 4
- :function 5 :userdata 6 :thread 7})
-
-(fn sort-keys [a b]
- (let [ta (type a) tb (type b)]
- (if (and (= ta tb) (~= ta "boolean")
- (or (= ta "string") (= ta "number")))
- (< a b)
- (let [dta (. type-order a)
- dtb (. type-order b)]
- (if (and dta dtb)
- (< dta dtb)
- dta true
- dtb false
- :else (< ta tb))))))
-
-(fn get-sequence-length [t]
- (var len 1)
- (each [i (ipairs t)] (set len i))
- len)
-
-(fn get-nonsequential-keys [t]
- (let [keys {}
- sequence-length (get-sequence-length t)]
- (each [k (pairs t)]
- (when (not (sequence-key? k sequence-length))
- (table.insert keys k)))
- (table.sort keys sort-keys)
- (values keys sequence-length)))
-
-(fn count-table-appearances [t appearances]
- (if (= (type t) "table")
- (when (not (. appearances t))
- (tset appearances t 1)
- (each [k v (pairs t)]
- (count-table-appearances k appearances)
- (count-table-appearances v appearances)))
- (when (and t (= t t)) ; no nans please
- (tset appearances t (+ (or (. appearances t) 0) 1))))
- appearances)
-
-
-
-(var put-value nil) ; mutual recursion going on; defined below
-
-(fn puts [self ...]
- (each [_ v (ipairs [...])]
- (table.insert self.buffer v)))
-
-(fn tabify [self] (puts self "\n" (: self.indent :rep self.level)))
-
-(fn already-visited? [self v] (~= (. self.ids v) nil))
-
-(fn get-id [self v]
- (var id (. self.ids v))
- (when (not id)
- (let [tv (type v)]
- (set id (+ (or (. self.max-ids tv) 0) 1))
- (tset self.max-ids tv id)
- (tset self.ids v id)))
- (tostring id))
-
-(fn put-sequential-table [self t length]
- (puts self "[")
- (set self.level (+ self.level 1))
- (for [i 1 length]
- (puts self " ")
- (put-value self (. t i)))
- (set self.level (- self.level 1))
- (puts self " ]"))
-
-(fn put-key [self k]
- (if (and (= (type k) "string")
- (: k :find "^[-%w?\\^_`!#$%&*+./@~:|<=>]+$"))
- (puts self ":" k)
- (put-value self k)))
-
-(fn put-kv-table [self t]
- (puts self "{")
- (set self.level (+ self.level 1))
- (each [k v (pairs t)]
- (tabify self)
- (put-key self k)
- (puts self " ")
- (put-value self v))
- (set self.level (- self.level 1))
- (tabify self)
- (puts self "}"))
-
-(fn put-table [self t]
- (if (already-visited? self t)
- (puts self "#<table " (get-id self t) ">")
- (>= self.level self.depth)
- (puts self "{...}")
- :else
- (let [(non-seq-keys length) (get-nonsequential-keys t)
- id (get-id self t)]
- (if (> (. self.appearances t) 1)
- (puts self "#<" id ">")
- (and (= (# non-seq-keys) 0) (= (# t) 0))
- (puts self "{}")
- (= (# non-seq-keys) 0)
- (put-sequential-table self t length)
- :else
- (put-kv-table self t)))))
-
-(set put-value (fn [self v]
- (let [tv (type v)]
- (if (= tv "string")
- (puts self (quote (escape v)))
- (or (= tv "number") (= tv "boolean") (= tv "nil"))
- (puts self (tostring v))
- (= tv "table")
- (put-table self v)
- :else
- (puts self "#<" (tostring v) ">")))))
-
-
-
-(fn fennelview [root options]
- (let [options (or options {})
- inspector {:appearances (count-table-appearances root {})
- :depth (or options.depth 128)
- :level 0 :buffer {} :ids {} :max-ids {}
- :indent (or options.indent " ")}]
- (put-value inspector root)
- (table.concat inspector.buffer)))
diff --git a/tests/examplefiles/fibonacci.tokigun.aheui b/tests/examplefiles/fibonacci.tokigun.aheui
deleted file mode 100644
index afa2ca05..00000000
--- a/tests/examplefiles/fibonacci.tokigun.aheui
+++ /dev/null
@@ -1,4 +0,0 @@
-바싹반박나싼순
-뿌멓떠벌번멍뻐
-쌀삭쌀살다순옭
-어어선썬설썩옭
diff --git a/tests/examplefiles/firefox.mak b/tests/examplefiles/firefox.mak
deleted file mode 100644
index 4dc0f167..00000000
--- a/tests/examplefiles/firefox.mak
+++ /dev/null
@@ -1,586 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH = .
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/build/unix/modules.mk
-
-ifeq ($(BUILD_MODULES),all)
-#
-# And now for something completely different...
-# Divide the default build into tiers.
-# Tiers must be defined on module boundaries
-#
-SUPPRESS_DEFAULT_RULES = 1
-
-default alldep all:: $(SUBMAKEFILES)
- $(RM) -rf $(DIST)/sdk
- $(RM) -rf $(DIST)/include
- $(MAKE) -C config export
- $(MAKE) nspr
- $(MAKE) ldap
- $(MAKE) tier_0
- $(MAKE) tier_1
- $(MAKE) tier_2
- $(MAKE) tier_9
- $(MAKE) tier_50
- $(MAKE) tier_99
-
-# Make sure that the existing rulesets work
-DIRS = \
- $(tier_0_dirs) \
- $(tier_1_dirs) \
- $(tier_2_dirs) \
- $(tier_9_dirs) \
- $(tier_50_dirs) \
- $(NULL)
-
-ifdef GC_LEAK_DETECTOR
-DIRS += gc/boehm
-endif
-
-DIRS += $(tier_99_dirs)
-
-#
-# tier 0 - base build config dirs
-#
-tier_0_dirs = \
- config \
- build \
- $(NULL)
-
-#
-# tier 1 - 3rd party individual libraries
-#
-tier_1_dirs += dbm
-
-ifndef MOZ_NATIVE_JPEG
-tier_1_dirs += jpeg
-endif
-
-ifndef MOZ_NATIVE_ZLIB
-tier_1_dirs += modules/zlib
-endif
-
-# Installer needs standalone libjar, hence standalone zlib
-ifdef MOZ_INSTALLER
-tier_1_dirs += modules/zlib/standalone
-endif
-
-ifdef MOZ_UPDATER
-tier_1_dirs += modules/libbz2
-tier_1_dirs += modules/libmar
-endif
-
-ifdef MOZ_SVG_RENDERER_LIBART
-tier_1_dirs += other-licenses/libart_lgpl
-endif
-
-#
-# tier 2 - base libraries
-#
-tier_2_dirs = \
- js \
- xpcom \
- $(NULL)
-
-ifndef MOZ_NO_XPCOM_OBSOLETE
-tier_2_dirs += modules/libreg xpcom/obsolete
-endif
-
-ifdef NS_TRACE_MALLOC
-tier_2_dirs += tools/trace-malloc/lib
-endif
-
-#
-# tier 9 - core components (necko,gecko)
-#
-
-tier_9_dirs += \
- js/src/xpconnect \
- intl \
- db \
- $(NULL)
-
-ifdef MOZ_STORAGE
-tier_9_dirs += storage
-endif
-
-ifdef MOZ_ENABLE_XLIB
-tier_9_dirs += gfx/src/xlibrgb widget/src/xlibxtbin
-endif
-
-ifdef MOZ_ENABLE_GTK
-tier_9_dirs += widget/src/gtksuperwin widget/src/gtkxtbin
-endif
-
-ifdef MOZ_ENABLE_GTK2
-tier_9_dirs += widget/src/gtkxtbin
-endif
-
-ifdef MOZ_IPCD
-tier_9_dirs += ipc/ipcd
-endif
-
-ifdef MOZ_JSDEBUGGER
-tier_9_dirs += js/jsd
-endif
-
-tier_9_dirs += \
- modules/libutil \
- netwerk \
- modules/libjar \
- uriloader \
- modules/libpref \
- modules/libimg \
- caps \
- rdf \
- parser/expat \
- parser/xml \
- parser/htmlparser \
- gfx \
- modules/libpr0n \
- sun-java \
- modules/plugin \
- dom \
- view \
- widget \
- content \
- layout \
- xpfe/components/shistory \
- docshell \
- webshell \
- embedding \
- editor \
- xpfe/appshell \
- $(NULL)
-
-ifdef MOZ_OJI
-tier_9_dirs += \
- js/src/liveconnect \
- modules/oji \
- $(NULL)
-endif
-
-ifdef ACCESSIBILITY
-tier_9_dirs += accessible
-endif
-
-#
-# tier 50 - xpfe & toolkit
-#
-
-ifdef MOZ_XUL
-ifdef MOZ_XUL_APP
-tier_50_dirs += chrome
-else
-tier_50_dirs += rdf/chrome
-endif
-else
-tier_50_dirs += embedding/minimo/chromelite
-endif
-
-tier_50_dirs += profile
-
-# This must preceed xpfe
-ifdef MOZ_JPROF
-tier_50_dirs += tools/jprof
-endif
-
-ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
-tier_50_dirs += xpfe/bootstrap/appleevents
-endif
-
-tier_50_dirs += \
- xpfe \
- toolkit/components \
- $(NULL)
-
-ifndef MOZ_XUL_APP
-tier_50_dirs += themes
-endif
-
-ifdef MOZ_ENABLE_XREMOTE
-tier_50_dirs += widget/src/xremoteclient
-endif
-
-ifdef MOZ_XUL_APP
-tier_50_dirs += toolkit
-endif
-
-ifdef MOZ_PHOENIX
-#XXXBlake this shell path is a temp hack; toolkit shouldn't depend on browser
-tier_50_dirs += browser/components/shell/public
-endif
-
-ifdef MOZ_XPINSTALL
-tier_50_dirs += xpinstall
-endif
-
-# JavaXPCOM JNI code is compiled into libXUL
-ifdef MOZ_JAVAXPCOM
-tier_50_dirs += extensions/java/xpcom/src
-endif
-
-ifdef MOZ_ENABLE_LIBXUL
-tier_50_dirs += \
- toolkit/library \
- xpcom/stub \
- $(NULL)
-endif
-
-ifdef NS_TRACE_MALLOC
-tier_50_dirs += tools/trace-malloc
-endif
-
-ifdef MOZ_PSM
-tier_50_dirs += security/manager
-else
-tier_50_dirs += security/manager/boot/public security/manager/ssl/public
-endif
-
-ifdef MOZ_LDAP_XPCOM
-tier_50_dirs += directory/xpcom
-endif
-
-ifndef MINIMO
-ifdef MOZ_XUL_APP
-ifdef MOZ_ENABLE_GTK2
-tier_50_dirs += toolkit/components/gnome
-endif
-endif
-endif
-
-ifdef MOZ_LEAKY
-tier_50_dirs += tools/leaky
-endif
-
-ifdef MOZ_MAPINFO
-tier_50_dirs += tools/codesighs
-endif
-
-#
-# tier 99 - application features
-#
-
-ifdef MOZ_MAIL_NEWS
-tier_99_dirs += mailnews
-endif
-
-ifdef MOZ_CALENDAR
-tier_99_dirs += calendar
-endif
-
-ifdef MOZ_EXTENSIONS
-tier_99_dirs += extensions
-endif
-
-ifdef MOZ_JAVAXPCOM
-tier_99_dirs += extensions/java
-endif
-
-# axcontrol
-ifeq ($(OS_ARCH),WINNT)
-ifndef MOZ_NO_ACTIVEX_SUPPORT
-tier_99_dirs += \
- embedding/browser/activex/src/control \
- embedding/browser/activex/src/control_kicker \
- $(NULL)
-endif
-endif
-
-# Java Embedding Plugin
-ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
-tier_99_dirs += plugin/oji/JEP
-endif
-
-ifneq (,$(filter browser suite,$(MOZ_BUILD_APP)))
-tier_99_dirs += xpfe/components/search
-endif
-
-ifdef MOZ_BRANDING_DIRECTORY
-tier_99_dirs += $(MOZ_BRANDING_DIRECTORY)
-endif
-
-ifdef MOZ_PHOENIX
-tier_99_dirs += browser xpfe/bootstrap/init.d
-endif
-
-ifdef MOZ_XULRUNNER
-tier_99_dirs += xulrunner
-endif
-
-ifdef MOZ_COMPOSER
-tier_99_dirs += editor/ui
-endif
-
-ifdef MOZ_THUNDERBIRD
-tier_99_dirs += mail xpfe/bootstrap/init.d
-endif
-
-ifdef MOZ_STANDALONE_COMPOSER
-tier_99_dirs += composer
-endif
-
-ifdef MOZ_SUNBIRD
-tier_99_dirs += calendar/sunbird
-endif
-
-ifdef MOZ_SUITE
-tier_99_dirs += suite
-endif
-
-ifdef MINIMO
-tier_99_dirs += minimo
-endif
-
-ifdef MOZ_XUL_APP
-ifdef MOZ_INSTALLER
-tier_99_dirs += toolkit/mozapps/installer
-endif
-else
-ifneq (,$(MOZ_XPFE_COMPONENTS)$(MOZ_XUL))
-ifndef MINIMO
-tier_99_dirs += xpfe/bootstrap
-endif
-endif
-endif
-
-ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
-tier_99_dirs += embedding/browser/gtk
-endif
-
-# viewer
-ifneq (,$(ENABLE_TESTS))
-ifndef MOZ_ENABLE_LIBXUL
-tier_99_dirs += webshell/tests
-endif
-endif
-
-# winembed, mfcembed
-ifeq ($(OS_ARCH),WINNT)
-ifneq (,$(ENABLE_TESTS)$(MOZILLA_OFFICIAL))
-tier_99_dirs += embedding/tests
-endif
-endif
-
-# os2embed
-ifeq ($(OS_ARCH),OS2)
-ifneq (,$(ENABLE_TESTS)$(MOZILLA_OFFICIAL))
-tier_99_dirs += embedding/tests
-endif
-endif
-
-ifeq ($(MOZ_BUILD_APP),macbrowser)
-tier_99_dirs += \
- embedding/config \
- camino \
- $(NULL)
-endif
-
-# test harnesses
-ifdef ENABLE_TESTS
-tier_99_dirs += tools/test-harness
-endif
-
-else
-
-# Standalone build
-
-DIRS = $(BUILD_MODULE_DIRS)
-
-# Hack to generate xpidl Makefile
-ifneq ($(BUILD_MODULES),all)
-ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS)))
-DIRS := xpcom/typelib $(DIRS)
-SUBMAKEFILES := xpcom/typelib/Makefile
-endif
-endif
-
-default:: $(SUBMAKEFILES)
- $(MAKE) export
- $(MAKE) libs
-
-endif # BUILD_MODULES == all
-
-STATIC_MAKEFILES := nsprpub directory/c-sdk security/nss
-
-GARBAGE_DIRS += dist
-DIST_GARBAGE = config.cache config.log config.status config-defs.h \
- dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \
- unallmakefiles mozilla-config.h \
- $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
-
-# Build pseudo-external modules first when export is explicitly called
-export::
- $(RM) -rf $(DIST)/sdk
- $(MAKE) -C config export
- $(MAKE) nspr
- $(MAKE) ldap
-ifneq ($(BUILD_MODULES),all)
-ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS)))
- $(MAKE) -C xpcom/typelib
- $(MAKE) export-idl
-endif
-endif
-
-install::
-ifndef MOZ_NATIVE_NSPR
- $(MAKE) -C nsprpub real_install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/nspr
- $(RM) -f $(addprefix $(DESTDIR)$(mozappdir)/$(LIB_PREFIX), $(addsuffix .$(LIB_SUFFIX), nspr4 plds4 plc4))
- $(RM) -f $(addprefix $(DESTDIR)$(bindir)/,nspr-config compile-et.pl prerr.properties)
-endif
-ifdef MOZ_LDAP_XPCOM
- $(MAKE) -C directory/c-sdk real_install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/ldap
-endif
-
-include $(topsrcdir)/config/rules.mk
-
-# Clean up after pseudo-external modules
-clean clobber realclean clobber_all distclean::
-ifndef MOZ_NATIVE_NSPR
- $(MAKE) -C nsprpub $@
-endif
-ifdef MOZ_LDAP_XPCOM
- $(MAKE) -C directory/c-sdk $@
-endif
-
-# Map mozilla targets to standard automake target
-ifdef MOZ_ENABLE_LIBXUL
-tier_50: $(addsuffix /Makefile, $(filter-out $(STATIC_MAKEFILES), $($@_dirs)))
- @echo "tier_50: $(tier_50_dirs)"
- @$(EXIT_ON_ERROR) \
- for d in $(tier_50_dirs); do \
- $(UPDATE_TITLE) \
- if test ! -f $$d/Makefile; then \
- $(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $(CYGWIN_TOPSRCDIR) $$d/Makefile; \
- fi; \
- $(MAKE) -C $$d export; \
- done ; \
- for d in $(tier_50_dirs); do \
- $(UPDATE_TITLE) \
- $(MAKE) -C $$d libs; \
- done
- @echo "Building tools from tier 2/9/50"
- @$(EXIT_ON_ERROR) \
- for d in $(tier_2_dirs) $(tier_9_dirs) $(tier_50_dirs); do \
- $(UPDATE_TITLE) \
- $(MAKE) -C $$d tools; \
- done;
-endif
-
-tier_%:
- @echo "$@: $($@_dirs)"
- @$(EXIT_ON_ERROR) \
- for d in $($@_dirs); do \
- $(UPDATE_TITLE) \
- if test ! -f $$d/Makefile; then \
- $(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $(CYGWIN_TOPSRCDIR) $$d/Makefile; \
- fi; \
- $(MAKE) -C $$d export; \
- done ; \
- for d in $($@_dirs); do $(UPDATE_TITLE) \
- $(MAKE) -C $$d libs; \
- done
-
-#
-# Individual modules
-#
-boehm:
-ifdef GC_LEAK_DETECTOR
- $(MAKE) -C gc/boehm
-endif
-
-nspr: boehm
-ifndef MOZ_NATIVE_NSPR
- $(MAKE) -C nsprpub
-endif
-
-ldap:
-ifdef MOZ_LDAP_XPCOM
- $(MAKE) -C directory/c-sdk
-endif
-
-distclean::
- cat unallmakefiles | $(XARGS) rm -f
- rm -f unallmakefiles $(DIST_GARBAGE)
-
-ifeq ($(OS_ARCH),WINNT)
-rebase:
-ifdef MOZILLA_OFFICIAL
- echo rebasing $(DIST)
- /bin/find $(DIST) -name "*.dll" > rebase.lst
- rebase -b 60000000 -R . -G rebase.lst
- rm rebase.lst
-endif
-
-splitsymbols:
-ifdef MOZILLA_OFFICIAL
-ifdef MOZ_DEBUG_SYMBOLS
- echo finding pdb files
- mkdir -p $(DIST)/$(BUILDID)
- -cp `/bin/find . -path "./dist" -prune -o -name "*.dll" | sed "s/\.dll$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
- -cp `/bin/find . -path "./dist" -prune -o -name "*.exe" | sed "s/\.exe$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
- -cp `/bin/find . -path "./dist" -prune -o -name "*.EXE" | sed "s/\.EXE$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
-endif # MOZ_DEBUG_SYMBOLS
-ifdef MOZ_PROFILE
- echo splitting symbols out of binaries
- /bin/find $(DIST) -name "*.dll" -exec splitsym {} \;
- /bin/find $(DIST) -name "*.exe" -exec splitsym {} \;
- /bin/find $(DIST) -name "*.EXE" -exec splitsym {} \;
- mkdir -p $(DIST)/$(BUILDID)
- /bin/find $(DIST) -name "*.dbg" -exec mv {} $(DIST)/$(BUILDID) \;
-endif # MOZ_PROFILE
-endif # MOZILLA_OFFICIAL
-
-signnss:
-ifdef MOZILLA_OFFICIAL
- echo signing NSS libs
- cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
- cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
-endif # MOZILLA_OFFICIAL
-
-BUILDID = $(shell cat $(DEPTH)/config/build_number)
-deliver: splitsymbols rebase signnss
-
-endif # WINNT
-
diff --git a/tests/examplefiles/flatline_example b/tests/examplefiles/flatline_example
deleted file mode 100644
index 5ea73408..00000000
--- a/tests/examplefiles/flatline_example
+++ /dev/null
@@ -1,186 +0,0 @@
-(field "another field" 2)
-(f "000001" -2)
-
-(missing? "a field" 23)
-
-(random-value "age")
-(weighted-random-value "000001")
-
-(if (missing? "00000") (random-value "000000") (f "000000"))
-
-(ensure-value "000000")
-(ensure-weighted-value "000000")
-
-(normalize "000001")
-(normalize "length" 8 23)
-
-(z-score "a numeric field")
-(z-score 23)
-
-(field-prop string "00023" name)
-(field-prop numeric "00023" summary missing_count)
-
-(category-count "species" "Iris-versicolor")
-(category-count "species" (f "000004"))
-(bin-count "age" (f "bin-selector"))
-(bin-center "000003" 3)
-(bin-center (field "field-selector") 4)
-
-(let (v (f "age"))
- (cond (< v 2) "baby"
- (< v 10) "child"
- (< v 20) "teenager"
- "adult"))
-
-(segment-label "000000" "baby" 2 "child" 10 "teenager" 20 "adult")
-(segment-label 0 "1st fourth" "2nd fourth" "3rd fourth" "4th fourth")
-
-(let (max (maximum 0)
- min (minimum 0)
- step (/ (- max min) 4))
- (segment-label 0 "1st fourth" (+ min step)
- "2nd fourth" (+ min step step)
- "3rd fourth" (+ min step step step)
- "4th fourth"))
-
-(contains-items? "000000" "blue" "green" "darkblue")
-
-(<= (percentile "age" 0.5) (f "age") (percentile "age" 0.95))
-
-(within-percentiles? "age" 0.5 0.95)
-
-(percentile-label "000023" "1st" "2nd" "3rd" "4th")
-
-(cond (within-percentiles? "000023" 0 0.25) "1st"
- (within-percentiles? "000023" 0.25 0.5) "2nd"
- (within-percentiles? "000023" 0.5 0.75) "3rd"
- "4th")
-
-(str 1 "hello " (field "a"))
-(str "value_" (+ 3 4) "/" (name "000001"))
-
-(length "abc")
-(length "")
-
-(levenshtein (f 0) "a random string")
-(if (< (levenshtein (f 0) "bluething") 5) "bluething" (f 0))
-
-(occurrences "howdy woman, howdy" "howdy")
-(occurrences "howdy woman" "Man" true)
-(occurrences "howdy man" "Man" true)
-(occurrences "hola, Holas" "hola" true "es")
-
-(md5 "a text")
-(sha1 "a text")
-(sha256 "")
-
-(matches? (field "name") ".*\\sHal\\s.*")
-(matches? (field "name") "(?i).*\\shal\\s.*")
-
-(if (matches? (f "result") (re-quote (f "target"))) "GOOD" "MISS")
-(matches? (f "name") (str "^" (re-quote (f "salutation")) "\\s *$"))
-
-(replace "Almost Pig Latin" "\\b(\\w)(\\w+)\\b" "$2$1ay")
-(replace-first "swap first two words" "(\\w+)(\\s+)(\\w+)" "$3$2$1")
-
-(language "this is an English phrase")
-
-(< (field 0) (field 1))
-(<= (field 0 -1) (field 0) (field 0 1))
-(> (field "date") "07-14-1969")
-(>= 23 (f "000004" -2))
-
-(= "Dante" (field "Author"))
-(= 1300 (field "Year"))
-(= (field "Year" -2) (field "Year" -1) (field "Year"))
-(!= (field "00033" -1) (field "00033" 1))
-
-(and (= 3 (field 1)) (= "meh" (f "a")) (< (f "pregnancies") 5))
-(not true)
-
-(linear-regression 1 1 2 2 3 3 4 4)
-(linear-regression 2.0 3.1 2.3 3.3 24.3 45.2)
-
-(epoch-fields (f "milliseconds"))
-(epoch-year (* 1000 (f "seconds")))
-
-(/ (f "a-datetime-string") 1000)
-(/ (epoch (f "a-datetime-string")) 1000)
-
-(epoch-fields (epoch "1969-14-07T06:00:12"))
-(epoch-hour (epoch "11~22~30" "hh~mm~ss"))
-
-(let (x (+ (window "a" -10 10))
- a (/ (* x 3) 4.34)
- y (if (< a 10) "Good" "Bad"))
- (list x (str (f 10) "-" y) a y))
-
-(list (let (z (f 0)) (* 2 (* z z) (log z)))
- (let (pi 3.141592653589793 r (f "radius")) (* 4 pi r r)))
-
-(if (< (field "age") 18) "non-adult" "adult")
-
-(if (= "oh" (field "000000")) "OH")
-
-(if (> (field "000001") (mean "000001"))
- "above average"
- (if (< (field "000001") (mean "000001"))
- "below average"
- "mediocre"))
-
-(cond (> (f "000001") (mean "000001")) "above average"
- (= (f "000001") (mean "000001")) "below average"
- "mediocre")
-
-(cond (or (= "a" (f 0)) (= "a+" (f 0))) 1
- (or (= "b" (f 0)) (= "b+" (f 0))) 0
- (or (= "c" (f 0)) (= "c+" (f 0))) -1)
-
-(cond (< (f "age") 2) "baby"
- (and (<= 2 (f "age") 10) (= "F" (f "sex"))) "girl"
- (and (<= 2 (f "age") 10) (= "M" (f "sex"))) "boy"
- (< 10 (f "age") 20) "teenager"
- "adult")
-
-(list (field "age")
- (field "weight" -1)
- (population "age"))
-
-(list 1.23
- (if (< (field "age") 10) "child" "adult")
- (field 3))
-
-(head (cons x lst))
-(tail (cons x lst))
-
-(count (list (f 1) (f 2)))
-(mode (list a b b c b a c c c))
-(max (list -1 2 -2 0.38))
-(min (list -1.3 2 1))
-(avg (list -1 -2 1 2 0.8 -0.8))
-
-(in 3 (1 2 3 2))
-(in "abc" (1 2 3))
-(in (f "size") ("X" "XXL"))
-
-(< _ 3)
-(+ (f "000001" _) 3)
-(< -18 _ (f 3))
-
-(map (* 2 _) (list (f 0 -1) (f 0) (f 0 1)))
-
-(all-but "id" "000023")
-(fields "000003" 3 "a field" "another" "0002a3b-3")
-
-(all-with-defaults "species" "Iris-versicolor"
- "petal-width" 2.8
- "000002" 0)
-
-(all-with-numeric-default "median")
-(all-with-numeric-default 0)
-
-(window "000001" -1 2)
-(filter (< _ 99.9) (map (+ 32 (* 1.8 _)) (window "Temp" -2 0)))
-
-(let (now (f "epoch"))
- (avg (cond-window "temperature" (< (- (f "epoch") now) 240))))
diff --git a/tests/examplefiles/flipflop.sv b/tests/examplefiles/flipflop.sv
deleted file mode 100644
index fe52ed44..00000000
--- a/tests/examplefiles/flipflop.sv
+++ /dev/null
@@ -1,19 +0,0 @@
-module toplevel(clock,reset);
- input clock;
- input reset;
-
- reg flop1;
- reg flop2;
-
- always @ (posedge reset or posedge clock)
- if (reset)
- begin
- flop1 <= 0;
- flop2 <= 1;
- end
- else
- begin
- flop1 <= flop2;
- flop2 <= flop1;
- end
-endmodule
diff --git a/tests/examplefiles/foo.sce b/tests/examplefiles/foo.sce
deleted file mode 100644
index 0e5d6afe..00000000
--- a/tests/examplefiles/foo.sce
+++ /dev/null
@@ -1,6 +0,0 @@
-// Scilab
-//
-disp(%pi);
-
-assert_checkequal(2+2,4);
-
diff --git a/tests/examplefiles/format.ml b/tests/examplefiles/format.ml
deleted file mode 100644
index 49b40678..00000000
--- a/tests/examplefiles/format.ml
+++ /dev/null
@@ -1,1213 +0,0 @@
-(***********************************************************************)
-(* *)
-(* Objective Caml *)
-(* *)
-(* Pierre Weis, projet Cristal, INRIA Rocquencourt *)
-(* *)
-(* Copyright 1996 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed *)
-(* under the terms of the GNU Library General Public License, with *)
-(* the special exception on linking described in file ../LICENSE. *)
-(* *)
-(***********************************************************************)
-
-(* $Id: format.ml,v 1.65 2005/09/26 10:13:08 weis Exp $ *)
-
-(**************************************************************
-
- Data structures definitions.
-
- **************************************************************)
-
-type size;;
-
-external size_of_int : int -> size = "%identity";;
-external int_of_size : size -> int = "%identity";;
-
-(* Tokens are one of the following : *)
-
-type pp_token =
-| Pp_text of string (* normal text *)
-| Pp_break of int * int (* complete break *)
-| Pp_tbreak of int * int (* go to next tabulation *)
-| Pp_stab (* set a tabulation *)
-| Pp_begin of int * block_type (* beginning of a block *)
-| Pp_end (* end of a block *)
-| Pp_tbegin of tblock (* beginning of a tabulation block *)
-| Pp_tend (* end of a tabulation block *)
-| Pp_newline (* to force a newline inside a block *)
-| Pp_if_newline (* to do something only if this very
- line has been broken *)
-| Pp_open_tag of string (* opening a tag name *)
-| Pp_close_tag (* closing the most recently opened tag *)
-
-and tag = string
-
-and block_type =
-| Pp_hbox (* Horizontal block no line breaking *)
-| Pp_vbox (* Vertical block each break leads to a new line *)
-| Pp_hvbox (* Horizontal-vertical block: same as vbox, except if this block
- is small enough to fit on a single line *)
-| Pp_hovbox (* Horizontal or Vertical block: breaks lead to new line
- only when necessary to print the content of the block *)
-| Pp_box (* Horizontal or Indent block: breaks lead to new line
- only when necessary to print the content of the block, or
- when it leads to a new indentation of the current line *)
-| Pp_fits (* Internal usage: when a block fits on a single line *)
-
-and tblock = Pp_tbox of int list ref (* Tabulation box *)
-;;
-
-(* The Queue:
- contains all formatting elements.
- elements are tuples (size, token, length), where
- size is set when the size of the block is known
- len is the declared length of the token. *)
-type pp_queue_elem = {
- mutable elem_size : size; token : pp_token; length : int
-};;
-
-(* Scan stack:
- each element is (left_total, queue element) where left_total
- is the value of pp_left_total when the element has been enqueued. *)
-type pp_scan_elem = Scan_elem of int * pp_queue_elem;;
-
-(* Formatting stack:
- used to break the lines while printing tokens.
- The formatting stack contains the description of
- the currently active blocks. *)
-type pp_format_elem = Format_elem of block_type * int;;
-
-(* General purpose queues, used in the formatter. *)
-type 'a queue_elem = | Nil | Cons of 'a queue_cell
-and 'a queue_cell = {mutable head : 'a; mutable tail : 'a queue_elem};;
-
-type 'a queue = {
- mutable insert : 'a queue_elem;
- mutable body : 'a queue_elem
-};;
-
-(* The formatter specific tag handling functions. *)
-type formatter_tag_functions = {
- mark_open_tag : tag -> string;
- mark_close_tag : tag -> string;
- print_open_tag : tag -> unit;
- print_close_tag : tag -> unit;
-
-};;
-
-(* A formatter with all its machinery. *)
-type formatter = {
- mutable pp_scan_stack : pp_scan_elem list;
- mutable pp_format_stack : pp_format_elem list;
- mutable pp_tbox_stack : tblock list;
- mutable pp_tag_stack : tag list;
- mutable pp_mark_stack : tag list;
- (* Global variables: default initialization is
- set_margin 78
- set_min_space_left 0. *)
- (* Value of right margin. *)
- mutable pp_margin : int;
- (* Minimal space left before margin, when opening a block. *)
- mutable pp_min_space_left : int;
- (* Maximum value of indentation:
- no blocks can be opened further. *)
- mutable pp_max_indent : int;
- (* Space remaining on the current line. *)
- mutable pp_space_left : int;
- (* Current value of indentation. *)
- mutable pp_current_indent : int;
- (* True when the line has been broken by the pretty-printer. *)
- mutable pp_is_new_line : bool;
- (* Total width of tokens already printed. *)
- mutable pp_left_total : int;
- (* Total width of tokens ever put in queue. *)
- mutable pp_right_total : int;
- (* Current number of opened blocks. *)
- mutable pp_curr_depth : int;
- (* Maximum number of blocks which can be simultaneously opened. *)
- mutable pp_max_boxes : int;
- (* Ellipsis string. *)
- mutable pp_ellipsis : string;
- (* Output function. *)
- mutable pp_output_function : string -> int -> int -> unit;
- (* Flushing function. *)
- mutable pp_flush_function : unit -> unit;
- (* Output of new lines. *)
- mutable pp_output_newline : unit -> unit;
- (* Output of indentation spaces. *)
- mutable pp_output_spaces : int -> unit;
- (* Are tags printed ? *)
- mutable pp_print_tags : bool;
- (* Are tags marked ? *)
- mutable pp_mark_tags : bool;
- (* Find opening and closing markers of tags. *)
- mutable pp_mark_open_tag : tag -> string;
- mutable pp_mark_close_tag : tag -> string;
- mutable pp_print_open_tag : tag -> unit;
- mutable pp_print_close_tag : tag -> unit;
- (* The pretty-printer queue. *)
- mutable pp_queue : pp_queue_elem queue
-};;
-
-(**************************************************************
-
- Auxilliaries and basic functions.
-
- **************************************************************)
-
-
-(* Queues auxilliaries. *)
-let make_queue () = {insert = Nil; body = Nil};;
-
-let clear_queue q = q.insert <- Nil; q.body <- Nil;;
-
-let add_queue x q =
- let c = Cons {head = x; tail = Nil} in
- match q with
- | {insert = Cons cell} -> q.insert <- c; cell.tail <- c
- (* Invariant: when insert is Nil body should be Nil. *)
- | _ -> q.insert <- c; q.body <- c;;
-
-exception Empty_queue;;
-
-let peek_queue = function
- | {body = Cons {head = x}} -> x
- | _ -> raise Empty_queue;;
-
-let take_queue = function
- | {body = Cons {head = x; tail = tl}} as q ->
- q.body <- tl;
- if tl = Nil then q.insert <- Nil; (* Maintain the invariant. *)
- x
- | _ -> raise Empty_queue;;
-
-(* Enter a token in the pretty-printer queue. *)
-let pp_enqueue state ({length = len} as token) =
- state.pp_right_total <- state.pp_right_total + len;
- add_queue token state.pp_queue;;
-
-let pp_clear_queue state =
- state.pp_left_total <- 1; state.pp_right_total <- 1;
- clear_queue state.pp_queue;;
-
-(* Pp_infinity: large value for default tokens size.
-
- Pp_infinity is documented as being greater than 1e10; to avoid
- confusion about the word ``greater'', we choose pp_infinity greater
- than 1e10 + 1; for correct handling of tests in the algorithm,
- pp_infinity must be even one more than 1e10 + 1; let's stand on the
- safe side by choosing 1.e10+10.
-
- Pp_infinity could probably be 1073741823 that is 2^30 - 1, that is
- the minimal upper bound for integers; now that max_int is defined,
- this limit could also be defined as max_int - 1.
-
- However, before setting pp_infinity to something around max_int, we
- must carefully double-check all the integer arithmetic operations
- that involve pp_infinity, since any overflow would wreck havoc the
- pretty-printing algorithm's invariants. Given that this arithmetic
- correctness check is difficult and error prone and given that 1e10
- + 1 is in practice large enough, there is no need to attempt to set
- pp_infinity to the theoretically maximum limit. Is it not worth the
- burden ! *)
-
-let pp_infinity = 1000000010;;
-
-(* Output functions for the formatter. *)
-let pp_output_string state s = state.pp_output_function s 0 (String.length s)
-and pp_output_newline state = state.pp_output_newline ();;
-
-let pp_display_blanks state n = state.pp_output_spaces n;;
-
-(* To format a break, indenting a new line. *)
-let break_new_line state offset width =
- pp_output_newline state;
- state.pp_is_new_line <- true;
- let indent = state.pp_margin - width + offset in
- (* Don't indent more than pp_max_indent. *)
- let real_indent = min state.pp_max_indent indent in
- state.pp_current_indent <- real_indent;
- state.pp_space_left <- state.pp_margin - state.pp_current_indent;
- pp_display_blanks state state.pp_current_indent;;
-
-(* To force a line break inside a block: no offset is added. *)
-let break_line state width = break_new_line state 0 width;;
-
-(* To format a break that fits on the current line. *)
-let break_same_line state width =
- state.pp_space_left <- state.pp_space_left - width;
- pp_display_blanks state width;;
-
-(* To indent no more than pp_max_indent, if one tries to open a block
- beyond pp_max_indent, then the block is rejected on the left
- by simulating a break. *)
-let pp_force_break_line state =
- match state.pp_format_stack with
- | Format_elem (bl_ty, width) :: _ ->
- if width > state.pp_space_left then
- (match bl_ty with
- | Pp_fits -> () | Pp_hbox -> () | _ -> break_line state width)
- | _ -> pp_output_newline state;;
-
-(* To skip a token, if the previous line has been broken. *)
-let pp_skip_token state =
- (* When calling pp_skip_token the queue cannot be empty. *)
- match take_queue state.pp_queue with
- {elem_size = size; length = len} ->
- state.pp_left_total <- state.pp_left_total - len;
- state.pp_space_left <- state.pp_space_left + int_of_size size;;
-
-(**************************************************************
-
- The main pretting printing functions.
-
- **************************************************************)
-
-(* To format a token. *)
-let format_pp_token state size = function
-
- | Pp_text s ->
- state.pp_space_left <- state.pp_space_left - size;
- pp_output_string state s;
- state.pp_is_new_line <- false
-
- | Pp_begin (off, ty) ->
- let insertion_point = state.pp_margin - state.pp_space_left in
- if insertion_point > state.pp_max_indent then
- (* can't open a block right there. *)
- begin pp_force_break_line state end;
- let offset = state.pp_space_left - off in
- let bl_type =
- begin match ty with
- | Pp_vbox -> Pp_vbox
- | _ -> if size > state.pp_space_left then ty else Pp_fits
- end in
- state.pp_format_stack <-
- Format_elem (bl_type, offset) :: state.pp_format_stack
-
- | Pp_end ->
- begin match state.pp_format_stack with
- | x :: (y :: l as ls) -> state.pp_format_stack <- ls
- | _ -> () (* No more block to close. *)
- end
-
- | Pp_tbegin (Pp_tbox _ as tbox) ->
- state.pp_tbox_stack <- tbox :: state.pp_tbox_stack
-
- | Pp_tend ->
- begin match state.pp_tbox_stack with
- | x :: ls -> state.pp_tbox_stack <- ls
- | _ -> () (* No more tabulation block to close. *)
- end
-
- | Pp_stab ->
- begin match state.pp_tbox_stack with
- | Pp_tbox tabs :: _ ->
- let rec add_tab n = function
- | [] -> [n]
- | x :: l as ls -> if n < x then n :: ls else x :: add_tab n l in
- tabs := add_tab (state.pp_margin - state.pp_space_left) !tabs
- | _ -> () (* No opened tabulation block. *)
- end
-
- | Pp_tbreak (n, off) ->
- let insertion_point = state.pp_margin - state.pp_space_left in
- begin match state.pp_tbox_stack with
- | Pp_tbox tabs :: _ ->
- let rec find n = function
- | x :: l -> if x >= n then x else find n l
- | [] -> raise Not_found in
- let tab =
- match !tabs with
- | x :: l ->
- begin try find insertion_point !tabs with Not_found -> x end
- | _ -> insertion_point in
- let offset = tab - insertion_point in
- if offset >= 0 then break_same_line state (offset + n) else
- break_new_line state (tab + off) state.pp_margin
- | _ -> () (* No opened tabulation block. *)
- end
-
- | Pp_newline ->
- begin match state.pp_format_stack with
- | Format_elem (_, width) :: _ -> break_line state width
- | _ -> pp_output_newline state
- end
-
- | Pp_if_newline ->
- if state.pp_current_indent != state.pp_margin - state.pp_space_left
- then pp_skip_token state
-
- | Pp_break (n, off) ->
- begin match state.pp_format_stack with
- | Format_elem (ty, width) :: _ ->
- begin match ty with
- | Pp_hovbox ->
- if size > state.pp_space_left
- then break_new_line state off width
- else break_same_line state n
- | Pp_box ->
- (* Have the line just been broken here ? *)
- if state.pp_is_new_line then break_same_line state n else
- if size > state.pp_space_left
- then break_new_line state off width else
- (* break the line here leads to new indentation ? *)
- if state.pp_current_indent > state.pp_margin - width + off
- then break_new_line state off width
- else break_same_line state n
- | Pp_hvbox -> break_new_line state off width
- | Pp_fits -> break_same_line state n
- | Pp_vbox -> break_new_line state off width
- | Pp_hbox -> break_same_line state n
- end
- | _ -> () (* No opened block. *)
- end
-
- | Pp_open_tag tag_name ->
- let marker = state.pp_mark_open_tag tag_name in
- pp_output_string state marker;
- state.pp_mark_stack <- tag_name :: state.pp_mark_stack
-
- | Pp_close_tag ->
- begin match state.pp_mark_stack with
- | tag_name :: tags ->
- let marker = state.pp_mark_close_tag tag_name in
- pp_output_string state marker;
- state.pp_mark_stack <- tags
- | _ -> () (* No more tag to close. *)
- end;;
-
-(* Print if token size is known or printing is delayed.
- Size is known when not negative.
- Printing is delayed when the text waiting in the queue requires
- more room to format than exists on the current line. *)
-let rec advance_left state =
- try
- match peek_queue state.pp_queue with
- {elem_size = size; token = tok; length = len} ->
- let size = int_of_size size in
- if not
- (size < 0 &&
- (state.pp_right_total - state.pp_left_total < state.pp_space_left))
- then begin
- ignore(take_queue state.pp_queue);
- format_pp_token state (if size < 0 then pp_infinity else size) tok;
- state.pp_left_total <- len + state.pp_left_total;
- advance_left state
- end
- with Empty_queue -> ();;
-
-let enqueue_advance state tok = pp_enqueue state tok; advance_left state;;
-
-(* To enqueue a string : try to advance. *)
-let make_queue_elem size tok len =
- {elem_size = size; token = tok; length = len};;
-
-let enqueue_string_as state size s =
- let len = int_of_size size in
- enqueue_advance state (make_queue_elem size (Pp_text s) len);;
-
-let enqueue_string state s =
- let len = String.length s in
- enqueue_string_as state (size_of_int len) s;;
-
-(* Routines for scan stack
- determine sizes of blocks. *)
-
-(* The scan_stack is never empty. *)
-let scan_stack_bottom =
- let q_elem = make_queue_elem (size_of_int (-1)) (Pp_text "") 0 in
- [Scan_elem (-1, q_elem)];;
-
-(* Set size of blocks on scan stack:
- if ty = true then size of break is set else size of block is set;
- in each case pp_scan_stack is popped. *)
-let clear_scan_stack state = state.pp_scan_stack <- scan_stack_bottom;;
-
-(* Pattern matching on scan stack is exhaustive,
- since scan_stack is never empty.
- Pattern matching on token in scan stack is also exhaustive,
- since scan_push is used on breaks and opening of boxes. *)
-let set_size state ty =
- match state.pp_scan_stack with
- | Scan_elem
- (left_tot,
- ({elem_size = size; token = tok} as queue_elem)) :: t ->
- let size = int_of_size size in
- (* test if scan stack contains any data that is not obsolete. *)
- if left_tot < state.pp_left_total then clear_scan_stack state else
- begin match tok with
- | Pp_break (_, _) | Pp_tbreak (_, _) ->
- if ty then
- begin
- queue_elem.elem_size <- size_of_int (state.pp_right_total + size);
- state.pp_scan_stack <- t
- end
- | Pp_begin (_, _) ->
- if not ty then
- begin
- queue_elem.elem_size <- size_of_int (state.pp_right_total + size);
- state.pp_scan_stack <- t
- end
- | _ -> () (* scan_push is only used for breaks and boxes. *)
- end
- | _ -> () (* scan_stack is never empty. *);;
-
-(* Push a token on scan stack. If b is true set_size is called. *)
-let scan_push state b tok =
- pp_enqueue state tok;
- if b then set_size state true;
- state.pp_scan_stack <-
- Scan_elem (state.pp_right_total, tok) :: state.pp_scan_stack;;
-
-(* To open a new block :
- the user may set the depth bound pp_max_boxes
- any text nested deeper is printed as the ellipsis string. *)
-let pp_open_box_gen state indent br_ty =
- state.pp_curr_depth <- state.pp_curr_depth + 1;
- if state.pp_curr_depth < state.pp_max_boxes then
- let elem =
- make_queue_elem
- (size_of_int (- state.pp_right_total))
- (Pp_begin (indent, br_ty))
- 0 in
- scan_push state false elem else
- if state.pp_curr_depth = state.pp_max_boxes
- then enqueue_string state state.pp_ellipsis;;
-
-(* The box which is always opened. *)
-let pp_open_sys_box state = pp_open_box_gen state 0 Pp_hovbox;;
-
-(* Close a block, setting sizes of its subblocks. *)
-let pp_close_box state () =
- if state.pp_curr_depth > 1 then
- begin
- if state.pp_curr_depth < state.pp_max_boxes then
- begin
- pp_enqueue state
- {elem_size = size_of_int 0; token = Pp_end; length = 0};
- set_size state true; set_size state false
- end;
- state.pp_curr_depth <- state.pp_curr_depth - 1;
- end;;
-
-(* Open a tag, pushing it on the tag stack. *)
-let pp_open_tag state tag_name =
- if state.pp_print_tags then begin
- state.pp_tag_stack <- tag_name :: state.pp_tag_stack;
- state.pp_print_open_tag tag_name end;
- if state.pp_mark_tags then
- pp_enqueue state
- {elem_size = size_of_int 0; token = Pp_open_tag tag_name; length = 0};;
-
-(* Close a tag, popping it from the tag stack. *)
-let pp_close_tag state () =
- if state.pp_mark_tags then
- pp_enqueue state
- {elem_size = size_of_int 0; token = Pp_close_tag; length = 0};
- if state.pp_print_tags then
- begin match state.pp_tag_stack with
- | tag_name :: tags ->
- state.pp_print_close_tag tag_name;
- state.pp_tag_stack <- tags
- | _ -> () (* No more tag to close. *)
- end;;
-
-let pp_set_print_tags state b = state.pp_print_tags <- b;;
-let pp_set_mark_tags state b = state.pp_mark_tags <- b;;
-let pp_get_print_tags state () = state.pp_print_tags;;
-let pp_get_mark_tags state () = state.pp_mark_tags;;
-let pp_set_tags state b = pp_set_print_tags state b; pp_set_mark_tags state b;;
-
-let pp_get_formatter_tag_functions state () = {
- mark_open_tag = state.pp_mark_open_tag;
- mark_close_tag = state.pp_mark_close_tag;
- print_open_tag = state.pp_print_open_tag;
- print_close_tag = state.pp_print_close_tag;
-};;
-
-let pp_set_formatter_tag_functions state {
- mark_open_tag = mot;
- mark_close_tag = mct;
- print_open_tag = pot;
- print_close_tag = pct;
- } =
- state.pp_mark_open_tag <- mot;
- state.pp_mark_close_tag <- mct;
- state.pp_print_open_tag <- pot;
- state.pp_print_close_tag <- pct;;
-
-(* Initialize pretty-printer. *)
-let pp_rinit state =
- pp_clear_queue state;
- clear_scan_stack state;
- state.pp_format_stack <- [];
- state.pp_tbox_stack <- [];
- state.pp_tag_stack <- [];
- state.pp_mark_stack <- [];
- state.pp_current_indent <- 0;
- state.pp_curr_depth <- 0;
- state.pp_space_left <- state.pp_margin;
- pp_open_sys_box state;;
-
-(* Flushing pretty-printer queue. *)
-let pp_flush_queue state b =
- while state.pp_curr_depth > 1 do
- pp_close_box state ()
- done;
- state.pp_right_total <- pp_infinity;
- advance_left state;
- if b then pp_output_newline state;
- pp_rinit state;;
-
-(**************************************************************
-
- Procedures to format objects, and use boxes
-
- **************************************************************)
-
-(* To format a string. *)
-let pp_print_as_size state size s =
- if state.pp_curr_depth < state.pp_max_boxes
- then enqueue_string_as state size s;;
-
-let pp_print_as state isize s =
- pp_print_as_size state (size_of_int isize) s;;
-
-let pp_print_string state s =
- pp_print_as state (String.length s) s;;
-
-(* To format an integer. *)
-let pp_print_int state i = pp_print_string state (string_of_int i);;
-
-(* To format a float. *)
-let pp_print_float state f = pp_print_string state (string_of_float f);;
-
-(* To format a boolean. *)
-let pp_print_bool state b = pp_print_string state (string_of_bool b);;
-
-(* To format a char. *)
-let pp_print_char state c =
- let s = String.create 1 in
- s.[0] <- c;
- pp_print_as state 1 s;;
-
-(* Opening boxes. *)
-let pp_open_hbox state () = pp_open_box_gen state 0 Pp_hbox
-and pp_open_vbox state indent = pp_open_box_gen state indent Pp_vbox
-
-and pp_open_hvbox state indent = pp_open_box_gen state indent Pp_hvbox
-and pp_open_hovbox state indent = pp_open_box_gen state indent Pp_hovbox
-and pp_open_box state indent = pp_open_box_gen state indent Pp_box;;
-
-(* Print a new line after printing all queued text
- (same for print_flush but without a newline). *)
-let pp_print_newline state () =
- pp_flush_queue state true; state.pp_flush_function ()
-and pp_print_flush state () =
- pp_flush_queue state false; state.pp_flush_function ();;
-
-(* To get a newline when one does not want to close the current block. *)
-let pp_force_newline state () =
- if state.pp_curr_depth < state.pp_max_boxes then
- enqueue_advance state (make_queue_elem (size_of_int 0) Pp_newline 0);;
-
-(* To format something if the line has just been broken. *)
-let pp_print_if_newline state () =
- if state.pp_curr_depth < state.pp_max_boxes then
- enqueue_advance state (make_queue_elem (size_of_int 0) Pp_if_newline 0);;
-
-(* Breaks: indicate where a block may be broken.
- If line is broken then offset is added to the indentation of the current
- block else (the value of) width blanks are printed.
- To do (?) : add a maximum width and offset value. *)
-let pp_print_break state width offset =
- if state.pp_curr_depth < state.pp_max_boxes then
- let elem =
- make_queue_elem
- (size_of_int (- state.pp_right_total))
- (Pp_break (width, offset))
- width in
- scan_push state true elem;;
-
-let pp_print_space state () = pp_print_break state 1 0
-and pp_print_cut state () = pp_print_break state 0 0;;
-
-(* Tabulation boxes. *)
-let pp_open_tbox state () =
- state.pp_curr_depth <- state.pp_curr_depth + 1;
- if state.pp_curr_depth < state.pp_max_boxes then
- let elem =
- make_queue_elem (size_of_int 0) (Pp_tbegin (Pp_tbox (ref []))) 0 in
- enqueue_advance state elem;;
-
-(* Close a tabulation block. *)
-let pp_close_tbox state () =
- if state.pp_curr_depth > 1 then begin
- if state.pp_curr_depth < state.pp_max_boxes then
- let elem = make_queue_elem (size_of_int 0) Pp_tend 0 in
- enqueue_advance state elem;
- state.pp_curr_depth <- state.pp_curr_depth - 1 end;;
-
-(* Print a tabulation break. *)
-let pp_print_tbreak state width offset =
- if state.pp_curr_depth < state.pp_max_boxes then
- let elem =
- make_queue_elem
- (size_of_int (- state.pp_right_total))
- (Pp_tbreak (width, offset))
- width in
- scan_push state true elem;;
-
-let pp_print_tab state () = pp_print_tbreak state 0 0;;
-
-let pp_set_tab state () =
- if state.pp_curr_depth < state.pp_max_boxes then
- let elem =
- make_queue_elem (size_of_int 0) Pp_stab 0 in
- enqueue_advance state elem;;
-
-(**************************************************************
-
- Procedures to control the pretty-printers
-
- **************************************************************)
-
-(* Fit max_boxes. *)
-let pp_set_max_boxes state n = if n > 1 then state.pp_max_boxes <- n;;
-
-(* To know the current maximum number of boxes allowed. *)
-let pp_get_max_boxes state () = state.pp_max_boxes;;
-
-let pp_over_max_boxes state () = state.pp_curr_depth = state.pp_max_boxes;;
-
-(* Ellipsis. *)
-let pp_set_ellipsis_text state s = state.pp_ellipsis <- s
-and pp_get_ellipsis_text state () = state.pp_ellipsis;;
-
-(* To set the margin of pretty-printer. *)
-let pp_limit n =
- if n < pp_infinity then n else pred pp_infinity;;
-
-let pp_set_min_space_left state n =
- if n >= 1 then
- let n = pp_limit n in
- state.pp_min_space_left <- n;
- state.pp_max_indent <- state.pp_margin - state.pp_min_space_left;
- pp_rinit state;;
-
-(* Initially, we have :
- pp_max_indent = pp_margin - pp_min_space_left, and
- pp_space_left = pp_margin. *)
-let pp_set_max_indent state n =
- pp_set_min_space_left state (state.pp_margin - n);;
-let pp_get_max_indent state () = state.pp_max_indent;;
-
-let pp_set_margin state n =
- if n >= 1 then
- let n = pp_limit n in
- state.pp_margin <- n;
- let new_max_indent =
- (* Try to maintain max_indent to its actual value. *)
- if state.pp_max_indent <= state.pp_margin
- then state.pp_max_indent else
- (* If possible maintain pp_min_space_left to its actual value,
- if this leads to a too small max_indent, take half of the
- new margin, if it is greater than 1. *)
- max (max (state.pp_margin - state.pp_min_space_left)
- (state.pp_margin / 2)) 1 in
- (* Rebuild invariants. *)
- pp_set_max_indent state new_max_indent;;
-
-let pp_get_margin state () = state.pp_margin;;
-
-let pp_set_formatter_output_functions state f g =
- state.pp_output_function <- f; state.pp_flush_function <- g;;
-let pp_get_formatter_output_functions state () =
- (state.pp_output_function, state.pp_flush_function);;
-
-let pp_set_all_formatter_output_functions state
- ~out:f ~flush:g ~newline:h ~spaces:i =
- pp_set_formatter_output_functions state f g;
- state.pp_output_newline <- (function () -> h ());
- state.pp_output_spaces <- (function n -> i n);;
-let pp_get_all_formatter_output_functions state () =
- (state.pp_output_function, state.pp_flush_function,
- state.pp_output_newline, state.pp_output_spaces);;
-
-let pp_set_formatter_out_channel state os =
- state.pp_output_function <- output os;
- state.pp_flush_function <- (fun () -> flush os);;
-
-(**************************************************************
-
- Creation of specific formatters
-
- **************************************************************)
-
-let default_pp_mark_open_tag s = "<" ^ s ^ ">";;
-let default_pp_mark_close_tag s = "</" ^ s ^ ">";;
-
-let default_pp_print_open_tag s = ();;
-let default_pp_print_close_tag = default_pp_print_open_tag;;
-
-let pp_make_formatter f g h i =
- (* The initial state of the formatter contains a dummy box. *)
- let pp_q = make_queue () in
- let sys_tok =
- make_queue_elem (size_of_int (-1)) (Pp_begin (0, Pp_hovbox)) 0 in
- add_queue sys_tok pp_q;
- let sys_scan_stack =
- (Scan_elem (1, sys_tok)) :: scan_stack_bottom in
- {pp_scan_stack = sys_scan_stack;
- pp_format_stack = [];
- pp_tbox_stack = [];
- pp_tag_stack = [];
- pp_mark_stack = [];
- pp_margin = 78;
- pp_min_space_left = 10;
- pp_max_indent = 78 - 10;
- pp_space_left = 78;
- pp_current_indent = 0;
- pp_is_new_line = true;
- pp_left_total = 1;
- pp_right_total = 1;
- pp_curr_depth = 1;
- pp_max_boxes = max_int;
- pp_ellipsis = ".";
- pp_output_function = f;
- pp_flush_function = g;
- pp_output_newline = h;
- pp_output_spaces = i;
- pp_print_tags = false;
- pp_mark_tags = false;
- pp_mark_open_tag = default_pp_mark_open_tag;
- pp_mark_close_tag = default_pp_mark_close_tag;
- pp_print_open_tag = default_pp_print_open_tag;
- pp_print_close_tag = default_pp_print_close_tag;
- pp_queue = pp_q
- };;
-
-(* Default function to output spaces. *)
-let blank_line = String.make 80 ' ';;
-let rec display_blanks state n =
- if n > 0 then
- if n <= 80 then state.pp_output_function blank_line 0 n else
- begin
- state.pp_output_function blank_line 0 80;
- display_blanks state (n - 80)
- end;;
-
-(* Default function to output new lines. *)
-let display_newline state () = state.pp_output_function "\n" 0 1;;
-
-let make_formatter f g =
- let ff = pp_make_formatter f g ignore ignore in
- ff.pp_output_newline <- display_newline ff;
- ff.pp_output_spaces <- display_blanks ff;
- ff;;
-
-let formatter_of_out_channel oc =
- make_formatter (output oc) (fun () -> flush oc);;
-
-let formatter_of_buffer b =
- make_formatter (Buffer.add_substring b) ignore;;
-
-let stdbuf = Buffer.create 512;;
-
-let str_formatter = formatter_of_buffer stdbuf;;
-let std_formatter = formatter_of_out_channel stdout;;
-let err_formatter = formatter_of_out_channel stderr;;
-
-let flush_str_formatter () =
- pp_flush_queue str_formatter false;
- let s = Buffer.contents stdbuf in
- Buffer.reset stdbuf;
- s;;
-
-(**************************************************************
-
- Basic functions on the standard formatter
-
- **************************************************************)
-
-let open_hbox = pp_open_hbox std_formatter
-and open_vbox = pp_open_vbox std_formatter
-and open_hvbox = pp_open_hvbox std_formatter
-and open_hovbox = pp_open_hovbox std_formatter
-and open_box = pp_open_box std_formatter
-and close_box = pp_close_box std_formatter
-and open_tag = pp_open_tag std_formatter
-and close_tag = pp_close_tag std_formatter
-and print_as = pp_print_as std_formatter
-and print_string = pp_print_string std_formatter
-and print_int = pp_print_int std_formatter
-and print_float = pp_print_float std_formatter
-and print_char = pp_print_char std_formatter
-and print_bool = pp_print_bool std_formatter
-and print_break = pp_print_break std_formatter
-and print_cut = pp_print_cut std_formatter
-and print_space = pp_print_space std_formatter
-and force_newline = pp_force_newline std_formatter
-and print_flush = pp_print_flush std_formatter
-and print_newline = pp_print_newline std_formatter
-and print_if_newline = pp_print_if_newline std_formatter
-
-and open_tbox = pp_open_tbox std_formatter
-and close_tbox = pp_close_tbox std_formatter
-and print_tbreak = pp_print_tbreak std_formatter
-
-and set_tab = pp_set_tab std_formatter
-and print_tab = pp_print_tab std_formatter
-
-and set_margin = pp_set_margin std_formatter
-and get_margin = pp_get_margin std_formatter
-
-and set_max_indent = pp_set_max_indent std_formatter
-and get_max_indent = pp_get_max_indent std_formatter
-
-and set_max_boxes = pp_set_max_boxes std_formatter
-and get_max_boxes = pp_get_max_boxes std_formatter
-and over_max_boxes = pp_over_max_boxes std_formatter
-
-and set_ellipsis_text = pp_set_ellipsis_text std_formatter
-and get_ellipsis_text = pp_get_ellipsis_text std_formatter
-
-and set_formatter_out_channel =
- pp_set_formatter_out_channel std_formatter
-
-and set_formatter_output_functions =
- pp_set_formatter_output_functions std_formatter
-and get_formatter_output_functions =
- pp_get_formatter_output_functions std_formatter
-
-and set_all_formatter_output_functions =
- pp_set_all_formatter_output_functions std_formatter
-and get_all_formatter_output_functions =
- pp_get_all_formatter_output_functions std_formatter
-
-and set_formatter_tag_functions =
- pp_set_formatter_tag_functions std_formatter
-and get_formatter_tag_functions =
- pp_get_formatter_tag_functions std_formatter
-and set_print_tags =
- pp_set_print_tags std_formatter
-and get_print_tags =
- pp_get_print_tags std_formatter
-and set_mark_tags =
- pp_set_mark_tags std_formatter
-and get_mark_tags =
- pp_get_mark_tags std_formatter
-and set_tags =
- pp_set_tags std_formatter
-;;
-
-
-(**************************************************************
-
- Printf implementation.
-
- **************************************************************)
-
-(* Error messages when processing formats. *)
-
-(* Trailer: giving up at character number ... *)
-let giving_up mess fmt i =
- "fprintf: " ^ mess ^ " ``" ^ fmt ^ "'', \
- giving up at character number " ^ string_of_int i ^
- (if i < String.length fmt
- then " (" ^ String.make 1 fmt.[i] ^ ")."
- else String.make 1 '.');;
-
-(* When an invalid format deserves a special error explanation. *)
-let format_invalid_arg mess fmt i = invalid_arg (giving_up mess fmt i);;
-
-(* Standard invalid format. *)
-let invalid_format fmt i = format_invalid_arg "bad format" fmt i;;
-
-(* Cannot find a valid integer into that format. *)
-let invalid_integer fmt i =
- invalid_arg (giving_up "bad integer specification" fmt i);;
-
-(* Finding an integer out of a sub-string of the format. *)
-let format_int_of_string fmt i s =
- let sz =
- try int_of_string s with
- | Failure s -> invalid_integer fmt i in
- size_of_int sz;;
-
-(* Getting strings out of buffers. *)
-let get_buffer_out b =
- let s = Buffer.contents b in
- Buffer.reset b;
- s;;
-
-(* [ppf] is supposed to be a pretty-printer that outputs in buffer [b]:
- to extract contents of [ppf] as a string we flush [ppf] and get the string
- out of [b]. *)
-let string_out b ppf =
- pp_flush_queue ppf false;
- get_buffer_out b;;
-
-(* Applies [printer] to a formatter that outputs on a fresh buffer,
- then returns the resulting material. *)
-let exstring printer arg =
- let b = Buffer.create 512 in
- let ppf = formatter_of_buffer b in
- printer ppf arg;
- string_out b ppf;;
-
-(* To turn out a character accumulator into the proper string result. *)
-let implode_rev s0 = function
- | [] -> s0
- | l -> String.concat "" (List.rev (s0 :: l));;
-
-external format_to_string : ('a, 'b, 'c, 'd) format4 -> string = "%identity";;
-
-(* [fprintf_out] is the printf-like function generator: given the
- - [str] flag that tells if we are printing into a string,
- - the [out] function that has to be called at the end of formatting,
- it generates a [fprintf] function that takes as arguments a [ppf]
- formatter and a printing format to print the rest of arguments
- according to the format.
- Regular [fprintf]-like functions of this module are obtained via partial
- applications of [fprintf_out]. *)
-let mkprintf str get_out =
- let rec kprintf k fmt =
- let fmt = format_to_string fmt in
- let len = String.length fmt in
-
- let kpr fmt v =
- let ppf = get_out fmt in
- let print_as = ref None in
- let pp_print_as_char c =
- match !print_as with
- | None -> pp_print_char ppf c
- | Some size ->
- pp_print_as_size ppf size (String.make 1 c);
- print_as := None
- and pp_print_as_string s =
- match !print_as with
- | None -> pp_print_string ppf s
- | Some size ->
- pp_print_as_size ppf size s;
- print_as := None in
-
- let rec doprn n i =
- if i >= len then Obj.magic (k ppf) else
- match fmt.[i] with
- | '%' ->
- Printf.scan_format fmt v n i cont_s cont_a cont_t cont_f cont_m
- | '@' ->
- let i = succ i in
- if i >= len then invalid_format fmt i else
- begin match fmt.[i] with
- | '[' ->
- do_pp_open_box ppf n (succ i)
- | ']' ->
- pp_close_box ppf ();
- doprn n (succ i)
- | '{' ->
- do_pp_open_tag ppf n (succ i)
- | '}' ->
- pp_close_tag ppf ();
- doprn n (succ i)
- | ' ' ->
- pp_print_space ppf ();
- doprn n (succ i)
- | ',' ->
- pp_print_cut ppf ();
- doprn n (succ i)
- | '?' ->
- pp_print_flush ppf ();
- doprn n (succ i)
- | '.' ->
- pp_print_newline ppf ();
- doprn n (succ i)
- | '\n' ->
- pp_force_newline ppf ();
- doprn n (succ i)
- | ';' ->
- do_pp_break ppf n (succ i)
- | '<' ->
- let got_size size n i =
- print_as := Some size;
- doprn n (skip_gt i) in
- get_int n (succ i) got_size
- | '@' as c ->
- pp_print_as_char c;
- doprn n (succ i)
- | c -> invalid_format fmt i
- end
- | c ->
- pp_print_as_char c;
- doprn n (succ i)
-
- and cont_s n s i =
- pp_print_as_string s; doprn n i
- and cont_a n printer arg i =
- if str then
- pp_print_as_string ((Obj.magic printer : unit -> _ -> string) () arg)
- else
- printer ppf arg;
- doprn n i
- and cont_t n printer i =
- if str then
- pp_print_as_string ((Obj.magic printer : unit -> string) ())
- else
- printer ppf;
- doprn n i
- and cont_f n i =
- pp_print_flush ppf (); doprn n i
-
- and cont_m n sfmt i =
- kprintf (Obj.magic (fun _ -> doprn n i)) sfmt
-
- and get_int n i c =
- if i >= len then invalid_integer fmt i else
- match fmt.[i] with
- | ' ' -> get_int n (succ i) c
- | '%' ->
- let cont_s n s i = c (format_int_of_string fmt i s) n i
- and cont_a n printer arg i = invalid_integer fmt i
- and cont_t n printer i = invalid_integer fmt i
- and cont_f n i = invalid_integer fmt i
- and cont_m n sfmt i = invalid_integer fmt i in
- Printf.scan_format fmt v n i cont_s cont_a cont_t cont_f cont_m
- | _ ->
- let rec get j =
- if j >= len then invalid_integer fmt j else
- match fmt.[j] with
- | '0' .. '9' | '-' -> get (succ j)
- | _ ->
- let size =
- if j = i then size_of_int 0 else
- format_int_of_string fmt j (String.sub fmt i (j - i)) in
- c size n j in
- get i
-
- and skip_gt i =
- if i >= len then invalid_format fmt i else
- match fmt.[i] with
- | ' ' -> skip_gt (succ i)
- | '>' -> succ i
- | _ -> invalid_format fmt i
-
- and get_box_kind i =
- if i >= len then Pp_box, i else
- match fmt.[i] with
- | 'h' ->
- let i = succ i in
- if i >= len then Pp_hbox, i else
- begin match fmt.[i] with
- | 'o' ->
- let i = succ i in
- if i >= len then format_invalid_arg "bad box format" fmt i else
- begin match fmt.[i] with
- | 'v' -> Pp_hovbox, succ i
- | c ->
- format_invalid_arg
- ("bad box name ho" ^ String.make 1 c) fmt i end
- | 'v' -> Pp_hvbox, succ i
- | c -> Pp_hbox, i
- end
- | 'b' -> Pp_box, succ i
- | 'v' -> Pp_vbox, succ i
- | _ -> Pp_box, i
-
- and get_tag_name n i c =
- let rec get accu n i j =
- if j >= len
- then c (implode_rev (String.sub fmt i (j - i)) accu) n j else
- match fmt.[j] with
- | '>' -> c (implode_rev (String.sub fmt i (j - i)) accu) n j
- | '%' ->
- let s0 = String.sub fmt i (j - i) in
- let cont_s n s i = get (s :: s0 :: accu) n i i
- and cont_a n printer arg i =
- let s =
- if str
- then (Obj.magic printer : unit -> _ -> string) () arg
- else exstring printer arg in
- get (s :: s0 :: accu) n i i
- and cont_t n printer i =
- let s =
- if str
- then (Obj.magic printer : unit -> string) ()
- else exstring (fun ppf () -> printer ppf) () in
- get (s :: s0 :: accu) n i i
- and cont_f n i =
- format_invalid_arg "bad tag name specification" fmt i
- and cont_m n sfmt i =
- format_invalid_arg "bad tag name specification" fmt i in
- Printf.scan_format fmt v n j cont_s cont_a cont_t cont_f cont_m
- | c -> get accu n i (succ j) in
- get [] n i i
-
- and do_pp_break ppf n i =
- if i >= len then begin pp_print_space ppf (); doprn n i end else
- match fmt.[i] with
- | '<' ->
- let rec got_nspaces nspaces n i =
- get_int n i (got_offset nspaces)
- and got_offset nspaces offset n i =
- pp_print_break ppf (int_of_size nspaces) (int_of_size offset);
- doprn n (skip_gt i) in
- get_int n (succ i) got_nspaces
- | c -> pp_print_space ppf (); doprn n i
-
- and do_pp_open_box ppf n i =
- if i >= len then begin pp_open_box_gen ppf 0 Pp_box; doprn n i end else
- match fmt.[i] with
- | '<' ->
- let kind, i = get_box_kind (succ i) in
- let got_size size n i =
- pp_open_box_gen ppf (int_of_size size) kind;
- doprn n (skip_gt i) in
- get_int n i got_size
- | c -> pp_open_box_gen ppf 0 Pp_box; doprn n i
-
- and do_pp_open_tag ppf n i =
- if i >= len then begin pp_open_tag ppf ""; doprn n i end else
- match fmt.[i] with
- | '<' ->
- let got_name tag_name n i =
- pp_open_tag ppf tag_name;
- doprn n (skip_gt i) in
- get_tag_name n (succ i) got_name
- | c -> pp_open_tag ppf ""; doprn n i in
-
- doprn (Printf.index_of_int 0) 0 in
-
- Printf.kapr kpr fmt in
-
- kprintf;;
-
-(**************************************************************
-
- Defining [fprintf] and various flavors of [fprintf].
-
- **************************************************************)
-
-let kfprintf k ppf = mkprintf false (fun _ -> ppf) k;;
-
-let fprintf ppf = kfprintf ignore ppf;;
-let printf fmt = fprintf std_formatter fmt;;
-let eprintf fmt = fprintf err_formatter fmt;;
-
-let kbprintf k b =
- mkprintf false (fun _ -> formatter_of_buffer b) k;;
-
-let bprintf b = kbprintf ignore b;;
-
-let ksprintf k =
- let b = Buffer.create 512 in
- let k ppf = k (string_out b ppf) in
- mkprintf true (fun _ -> formatter_of_buffer b) k;;
-
-let kprintf = ksprintf;;
-
-let sprintf fmt = ksprintf (fun s -> s) fmt;;
-
-at_exit print_flush;;
diff --git a/tests/examplefiles/freefem.edp b/tests/examplefiles/freefem.edp
deleted file mode 100644
index d4313338..00000000
--- a/tests/examplefiles/freefem.edp
+++ /dev/null
@@ -1,94 +0,0 @@
-// Example of problem solving in parallel
-
-// Usage:
-// ff-mpirun -np 12 LaplacianParallel.edp (here 12 is the number of threads (command nproc to know that)
-// Need FreeFem++ with PETSc
-
-// Parallel stuff
-load "PETSc"
-macro partitioner()metis//
-macro dimension()2//
-include "./macro_ddm.idp"
-
-macro def(i)[i]//
-macro init(i)[i]//
-//macro meshN()mesh// //these macro are defined in macro_ddm.idp
-//macro intN()int2d//
-
-// Parameters
-int nn = 500;
-real L = 1.;
-real H = 1.;
-
-func f = 1.;
-
-func Pk = P1;
-
-// Mesh
-border b1(t=0, L){x=t; y=0; label=1;}
-border b2(t=0, H){x=L; y=t; label=2;}
-border b3(t=L, 0){x=t; y=H; label=3;}
-border b4(t=H, 0){x=0; y=t; label=4;}
-
-meshN Th = buildmesh(b1(1) + b2(1) + b3(1) + b4(1)); //build a really coarse mesh (just to build the fespace later)
-//meshN Th = square(1, 1, [L*x, H*y]);
-
-int[int] Wall = [1, 2, 3, 4];
-
-// Fespace
-fespace Uh(Th, Pk);
-
-// Mesh partition
-int[int] ArrayIntersection;
-int[int][int] RestrictionIntersection(0);
-real[int] D;
-
-meshN ThBorder;
-meshN ThGlobal = buildmesh(b1(nn*L) + b2(nn*H) + b3(nn*L) + b4(nn*H)); //build the mesh to partition
-//meshN ThGlobal = square(nn*L, nn*H, [L*x, H*y]);
-int InterfaceLabel = 10;
-int Split = 1;
-int Overlap = 1;
-build(Th, ThBorder, ThGlobal, InterfaceLabel, Split, Overlap, D, ArrayIntersection, RestrictionIntersection, Uh, Pk, mpiCommWorld, false); //see macro_ddm.idp for detailed parameters
-
-// Macro
-macro grad(u) [dx(u), dy(u)] //
-
-// Problem
-varf vLaplacian (u, uh) //Problem in varf formulation mandatory
- = intN(Th)(
- grad(u)' * grad(uh)
- )
- - intN(Th)(
- f * uh
- )
- + on(Wall, u=0)
- ;
-
-matrix<real> Laplacian = vLaplacian(Uh, Uh); //build the sequential matrix
-real[int] LaplacianBoundary = vLaplacian(0, Uh);// and right hand side
-
-//// In sequential, you normally do that:
-//// Solve
-//Uh def(u)=init(0);
-//u[] = Laplacian^-1 * LaplacianBoundary;
-
-//// Plot
-//plot(u);
-
-// In parallel:
-// Matrix construction
-dmatrix PLaplacian(Laplacian, ArrayIntersection, RestrictionIntersection, D, bs=1); //build the parallel matrix
-set(PLaplacian, sparams="-pc_type lu -pc_factor_mat_solver_package mumps"); //preconditioner LU and MUMPS solver (see PETSc doc for detailed parameters)
-
-// Solve
-Uh def(u)=init(0); //define the unknown (must be defined after mesh partitioning)
-u[] = PLaplacian^-1 * LaplacianBoundary;
-
-// Export results to vtk (there is not plot in parallel)
-{
- fespace PV(Th, P1);
- PV uu=u;
- int[int] Order = [1];
- export("Result", Th, uu, Order, mpiCommWorld);
-}
diff --git a/tests/examplefiles/fucked_up.rb b/tests/examplefiles/fucked_up.rb
deleted file mode 100644
index b1d0ee3b..00000000
--- a/tests/examplefiles/fucked_up.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-# vim:ft=ruby
-
-events = Hash.new { |h, k| h[k] = [] }
-DATA.read.split(/\n\n\n\s*/).each do |event|
- name = event[/^.*/].sub(/http:.*/, '')
- event[/\n.*/m].scan(/^([A-Z]{2}\S*)\s*(\S*)\s*(\S*)(\s*\S*)/) do |kind, day, daytime, comment|
- events[ [day, daytime] ] << [kind, name + comment]
- end
-end
-
-conflicts = 0
-events.to_a.sort_by do |(day, daytime),|
- [%w(Mo Di Mi Do Fr).index(day) || 0, daytime]
-end.each do |(day, daytime), names|
- if names.size > 1
- conflicts += 1
- print '!!! '
- end
- print "#{day} #{daytime}: "
- names.each { |kind, name| puts " #{kind} #{name}" }
- puts
-end
-
-puts '%d conflicts' % conflicts
-puts '%d SWS' % (events.inject(0) { |sum, ((day, daytime),)| sum + (daytime[/\d+$/].to_i - daytime[/^\d+/].to_i) })
-
-string = % foo # strange. huh?
-print "Escape here: \n"
-print 'Dont escape here: \n'
-
-__END__
-Informatik und Informationsgesellschaft I: Digitale Medien (32 214)
-Computer lassen ihre eigentliche Bestimmung durch Multimedia und Vernetzung erkennen: Es sind digitale Medien, die alle bisherigen Massen- und Kommunikationsmedien simulieren, kopieren oder ersetzen können. Die kurze Geschichte elektronischer Medien vom Telegramm bis zum Fernsehen wird so zur Vorgeschichte des Computers als Medium. Der Prozess der Mediatisierung der Rechnernetze soll in Technik, Theorie und Praxis untersucht werden. Das PR soll die Techniken der ortsverteilten und zeitversetzten Lehre an Hand praktischer Übungen vorführen und untersuchen.
-VL Di 15-17 wöch. RUD 25, 3.101 J. Koubek
-VL Do 15-17 wöch. RUD 25, 3.101
-UE/PR Do 17-19 wöch. RUD 25, 3.101 J.-M. Loebel
-
-
-Methoden und Modelle des Systementwurfs (32 223)
-Gute Methoden zum Entwurf und zur Verifikation von Systemen sind ein Schlüssel für gute Software. Dieses Seminar betrachtet moderne Entwurfsmethoden.
- VL Di 09-11 wöch. RUD 26, 0’313 W. Reisig
- VL Do 09-11 wöch. RUD 26, 0’313
- UE Di 11-13 wöch. RUD 26, 0’313
- PR Di 13-15 wöch. RUD 26, 0’313 D. Weinberg
-
-
-Komplexitätstheorie (32 229)
-In dieser Vorlesung untersuchen wir eine Reihe von wichtigen algorithmischen Problemstellungen aus verschiedenen Bereichen der Informatik. Unser besonderes Interesse gilt dabei der Abschätzung der Rechenressourcen, die zu ihrer Lösung aufzubringen sind. Die Vorlesung bildet eine wichtige Grundlage für weiterführende Veranstaltungen in den Bereichen Algorithmen, Kryptologie, Algorithmisches Lernen und Algorithmisches Beweisen.
- VL Di 09-11 wöch. RUD 26, 1’303 J. Köbler
- VL Do 09-11 wöch. RUD 26, 1’305
- UE Do 11-13 wöch. RUD 26, 1’305
-
-
-Zuverlässige Systeme (32 234)
-Mit zunehmender Verbreitung der Computertechnologie in immer mehr Bereichen des menschlichen Lebens wird die Zuverlässigkeit solcher Systeme zu einer immer zentraleren Frage.
-Der Halbkurs "Zuverlässige Systeme" konzentriert sich auf folgende Schwerpunkte: Zuverlässigkeit, Fehlertoleranz, Responsivität, Messungen, Anwendungen, Systemmodelle und Techniken, Ausfallverhalten, Fehlermodelle, Schedulingtechniken, Software/Hardware - responsives Systemdesign, Analyse und Synthese, Bewertung, Fallstudien in Forschung und Industrie.
-Der Halbkurs kann mit dem Halbkurs "Eigenschaften mobiler und eingebetteter Systeme" zu einem Projektkurs kombiniert werden. Ein gemeinsames Projekt begleitet beide Halbkurse.
-VL Di 09-11 wöch. RUD 26, 1’308 M. Malek
-VL Do 09-11 wöch. RUD 26, 1’308
-PR n.V.
-
-
-Stochastik für InformatikerInnen (32 239)
-Grundlagen der Wahrscheinlichkeitsrechnung, Diskrete und stetige Wahrscheinlichkeitsmodelle in der Informatik, Grenzwertsätze, Simulationsverfahren, Zufallszahlen, Statistische Schätz- und Testverfahren, Markoffsche Ketten, Simulated Annealing, Probabilistische Analyse von Algorithmen.
-VL Mo 09-11 wöch. RUD 25, 3.101 W. Kössler
-VL Mi 09-11 wöch. RUD 25, 3.101
-UE Mo 11-13 wöch. RUD 25, 3.101
- UE Mi 11-13 wöch. RUD 25. 3.101
-
-
-Geschichte der Informatik – Ausgewählte Kapitel (32 243)
-VL Mi 13-15 wöch. RUD 25, 3.113 W. Coy
-
-
-Aktuelle Themen der Theoretischen Informatik (32 260)
-In diesem Seminar sollen wichtige aktuelle Veröffentlichungen aus der theoretischen Informatik gemeinsam erarbeitet werden. Genaueres wird erst kurz vor dem Seminar entschieden. Bei Interesse wenden Sie sich bitte möglichst frühzeitig an den Veranstalter.
- SE Fr 09-11 wöch. RUD 26, 1’307 M. Grohe 
diff --git a/tests/examplefiles/function.mu b/tests/examplefiles/function.mu
deleted file mode 100644
index 46bb259d..00000000
--- a/tests/examplefiles/function.mu
+++ /dev/null
@@ -1 +0,0 @@
-a::b ()
diff --git a/tests/examplefiles/functional.rst b/tests/examplefiles/functional.rst
deleted file mode 100644
index bfe67d10..00000000
--- a/tests/examplefiles/functional.rst
+++ /dev/null
@@ -1,1472 +0,0 @@
-Functional Programming HOWTO
-================================
-
-**Version 0.30**
-
-(This is a first draft. Please send comments/error
-reports/suggestions to amk@amk.ca. This URL is probably not going to
-be the final location of the document, so be careful about linking to
-it -- you may want to add a disclaimer.)
-
-In this document, we'll take a tour of Python's features suitable for
-implementing programs in a functional style. After an introduction to
-the concepts of functional programming, we'll look at language
-features such as iterators and generators and relevant library modules
-such as ``itertools`` and ``functools``.
-
-
-.. contents::
-
-Introduction
-----------------------
-
-This section explains the basic concept of functional programming; if
-you're just interested in learning about Python language features,
-skip to the next section.
-
-Programming languages support decomposing problems in several different
-ways:
-
-* Most programming languages are **procedural**:
- programs are lists of instructions that tell the computer what to
- do with the program's input.
- C, Pascal, and even Unix shells are procedural languages.
-
-* In **declarative** languages, you write a specification that describes
- the problem to be solved, and the language implementation figures out
- how to perform the computation efficiently. SQL is the declarative
- language you're most likely to be familiar with; a SQL query describes
- the data set you want to retrieve, and the SQL engine decides whether to
- scan tables or use indexes, which subclauses should be performed first,
- etc.
-
-* **Object-oriented** programs manipulate collections of objects.
- Objects have internal state and support methods that query or modify
- this internal state in some way. Smalltalk and Java are
- object-oriented languages. C++ and Python are languages that
- support object-oriented programming, but don't force the use
- of object-oriented features.
-
-* **Functional** programming decomposes a problem into a set of functions.
- Ideally, functions only take inputs and produce outputs, and don't have any
- internal state that affects the output produced for a given input.
- Well-known functional languages include the ML family (Standard ML,
- OCaml, and other variants) and Haskell.
-
-The designers of some computer languages have chosen one approach to
-programming that's emphasized. This often makes it difficult to
-write programs that use a different approach. Other languages are
-multi-paradigm languages that support several different approaches. Lisp,
-C++, and Python are multi-paradigm; you can write programs or
-libraries that are largely procedural, object-oriented, or functional
-in all of these languages. In a large program, different sections
-might be written using different approaches; the GUI might be object-oriented
-while the processing logic is procedural or functional, for example.
-
-In a functional program, input flows through a set of functions. Each
-function operates on its input and produces some output. Functional
-style frowns upon functions with side effects that modify internal
-state or make other changes that aren't visible in the function's
-return value. Functions that have no side effects at all are
-called **purely functional**.
-Avoiding side effects means not using data structures
-that get updated as a program runs; every function's output
-must only depend on its input.
-
-Some languages are very strict about purity and don't even have
-assignment statements such as ``a=3`` or ``c = a + b``, but it's
-difficult to avoid all side effects. Printing to the screen or
-writing to a disk file are side effects, for example. For example, in
-Python a ``print`` statement or a ``time.sleep(1)`` both return no
-useful value; they're only called for their side effects of sending
-some text to the screen or pausing execution for a second.
-
-Python programs written in functional style usually won't go to the
-extreme of avoiding all I/O or all assignments; instead, they'll
-provide a functional-appearing interface but will use non-functional
-features internally. For example, the implementation of a function
-will still use assignments to local variables, but won't modify global
-variables or have other side effects.
-
-Functional programming can be considered the opposite of
-object-oriented programming. Objects are little capsules containing
-some internal state along with a collection of method calls that let
-you modify this state, and programs consist of making the right set of
-state changes. Functional programming wants to avoid state changes as
-much as possible and works with data flowing between functions. In
-Python you might combine the two approaches by writing functions that
-take and return instances representing objects in your application
-(e-mail messages, transactions, etc.).
-
-Functional design may seem like an odd constraint to work under. Why
-should you avoid objects and side effects? There are theoretical and
-practical advantages to the functional style:
-
-* Formal provability.
-* Modularity.
-* Composability.
-* Ease of debugging and testing.
-
-Formal provability
-''''''''''''''''''''''
-
-A theoretical benefit is that it's easier to construct a mathematical proof
-that a functional program is correct.
-
-For a long time researchers have been interested in finding ways to
-mathematically prove programs correct. This is different from testing
-a program on numerous inputs and concluding that its output is usually
-correct, or reading a program's source code and concluding that the
-code looks right; the goal is instead a rigorous proof that a program
-produces the right result for all possible inputs.
-
-The technique used to prove programs correct is to write down
-**invariants**, properties of the input data and of the program's
-variables that are always true. For each line of code, you then show
-that if invariants X and Y are true **before** the line is executed,
-the slightly different invariants X' and Y' are true **after**
-the line is executed. This continues until you reach the end of the
-program, at which point the invariants should match the desired
-conditions on the program's output.
-
-Functional programming's avoidance of assignments arose because
-assignments are difficult to handle with this technique;
-assignments can break invariants that were true before the assignment
-without producing any new invariants that can be propagated onward.
-
-Unfortunately, proving programs correct is largely impractical and not
-relevant to Python software. Even trivial programs require proofs that
-are several pages long; the proof of correctness for a moderately
-complicated program would be enormous, and few or none of the programs
-you use daily (the Python interpreter, your XML parser, your web
-browser) could be proven correct. Even if you wrote down or generated
-a proof, there would then be the question of verifying the proof;
-maybe there's an error in it, and you wrongly believe you've proved
-the program correct.
-
-Modularity
-''''''''''''''''''''''
-
-A more practical benefit of functional programming is that it forces
-you to break apart your problem into small pieces. Programs are more
-modular as a result. It's easier to specify and write a small
-function that does one thing than a large function that performs a
-complicated transformation. Small functions are also easier to read
-and to check for errors.
-
-
-Ease of debugging and testing
-''''''''''''''''''''''''''''''''''
-
-Testing and debugging a functional-style program is easier.
-
-Debugging is simplified because functions are generally small and
-clearly specified. When a program doesn't work, each function is an
-interface point where you can check that the data are correct. You
-can look at the intermediate inputs and outputs to quickly isolate the
-function that's responsible for a bug.
-
-Testing is easier because each function is a potential subject for a
-unit test. Functions don't depend on system state that needs to be
-replicated before running a test; instead you only have to synthesize
-the right input and then check that the output matches expectations.
-
-
-
-Composability
-''''''''''''''''''''''
-
-As you work on a functional-style program, you'll write a number of
-functions with varying inputs and outputs. Some of these functions
-will be unavoidably specialized to a particular application, but
-others will be useful in a wide variety of programs. For example, a
-function that takes a directory path and returns all the XML files in
-the directory, or a function that takes a filename and returns its
-contents, can be applied to many different situations.
-
-Over time you'll form a personal library of utilities. Often you'll
-assemble new programs by arranging existing functions in a new
-configuration and writing a few functions specialized for the current
-task.
-
-
-
-Iterators
------------------------
-
-I'll start by looking at a Python language feature that's an important
-foundation for writing functional-style programs: iterators.
-
-An iterator is an object representing a stream of data; this object
-returns the data one element at a time. A Python iterator must
-support a method called ``next()`` that takes no arguments and always
-returns the next element of the stream. If there are no more elements
-in the stream, ``next()`` must raise the ``StopIteration`` exception.
-Iterators don't have to be finite, though; it's perfectly reasonable
-to write an iterator that produces an infinite stream of data.
-
-The built-in ``iter()`` function takes an arbitrary object and tries
-to return an iterator that will return the object's contents or
-elements, raising ``TypeError`` if the object doesn't support
-iteration. Several of Python's built-in data types support iteration,
-the most common being lists and dictionaries. An object is called
-an **iterable** object if you can get an iterator for it.
-
-You can experiment with the iteration interface manually::
-
- >>> L = [1,2,3]
- >>> it = iter(L)
- >>> print it
- <iterator object at 0x8116870>
- >>> it.next()
- 1
- >>> it.next()
- 2
- >>> it.next()
- 3
- >>> it.next()
- Traceback (most recent call last):
- File "<stdin>", line 1, in ?
- StopIteration
- >>>
-
-Python expects iterable objects in several different contexts, the
-most important being the ``for`` statement. In the statement ``for X in Y``,
-Y must be an iterator or some object for which ``iter()`` can create
-an iterator. These two statements are equivalent::
-
- for i in iter(obj):
- print i
-
- for i in obj:
- print i
-
-Iterators can be materialized as lists or tuples by using the
-``list()`` or ``tuple()`` constructor functions::
-
- >>> L = [1,2,3]
- >>> iterator = iter(L)
- >>> t = tuple(iterator)
- >>> t
- (1, 2, 3)
-
-Sequence unpacking also supports iterators: if you know an iterator
-will return N elements, you can unpack them into an N-tuple::
-
- >>> L = [1,2,3]
- >>> iterator = iter(L)
- >>> a,b,c = iterator
- >>> a,b,c
- (1, 2, 3)
-
-Built-in functions such as ``max()`` and ``min()`` can take a single
-iterator argument and will return the largest or smallest element.
-The ``"in"`` and ``"not in"`` operators also support iterators: ``X in
-iterator`` is true if X is found in the stream returned by the
-iterator. You'll run into obvious problems if the iterator is
-infinite; ``max()``, ``min()``, and ``"not in"`` will never return, and
-if the element X never appears in the stream, the ``"in"`` operator
-won't return either.
-
-Note that you can only go forward in an iterator; there's no way to
-get the previous element, reset the iterator, or make a copy of it.
-Iterator objects can optionally provide these additional capabilities,
-but the iterator protocol only specifies the ``next()`` method.
-Functions may therefore consume all of the iterator's output, and if
-you need to do something different with the same stream, you'll have
-to create a new iterator.
-
-
-
-Data Types That Support Iterators
-'''''''''''''''''''''''''''''''''''
-
-We've already seen how lists and tuples support iterators. In fact,
-any Python sequence type, such as strings, will automatically support
-creation of an iterator.
-
-Calling ``iter()`` on a dictionary returns an iterator that will loop
-over the dictionary's keys::
-
- >>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,
- ... 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12}
- >>> for key in m:
- ... print key, m[key]
- Mar 3
- Feb 2
- Aug 8
- Sep 9
- May 5
- Jun 6
- Jul 7
- Jan 1
- Apr 4
- Nov 11
- Dec 12
- Oct 10
-
-Note that the order is essentially random, because it's based on the
-hash ordering of the objects in the dictionary.
-
-Applying ``iter()`` to a dictionary always loops over the keys, but
-dictionaries have methods that return other iterators. If you want to
-iterate over keys, values, or key/value pairs, you can explicitly call
-the ``iterkeys()``, ``itervalues()``, or ``iteritems()`` methods to
-get an appropriate iterator.
-
-The ``dict()`` constructor can accept an iterator that returns a
-finite stream of ``(key, value)`` tuples::
-
- >>> L = [('Italy', 'Rome'), ('France', 'Paris'), ('US', 'Washington DC')]
- >>> dict(iter(L))
- {'Italy': 'Rome', 'US': 'Washington DC', 'France': 'Paris'}
-
-Files also support iteration by calling the ``readline()``
-method until there are no more lines in the file. This means you can
-read each line of a file like this::
-
- for line in file:
- # do something for each line
- ...
-
-Sets can take their contents from an iterable and let you iterate over
-the set's elements::
-
- S = set((2, 3, 5, 7, 11, 13))
- for i in S:
- print i
-
-
-
-Generator expressions and list comprehensions
-----------------------------------------------------
-
-Two common operations on an iterator's output are 1) performing some
-operation for every element, 2) selecting a subset of elements that
-meet some condition. For example, given a list of strings, you might
-want to strip off trailing whitespace from each line or extract all
-the strings containing a given substring.
-
-List comprehensions and generator expressions (short form: "listcomps"
-and "genexps") are a concise notation for such operations, borrowed
-from the functional programming language Haskell
-(http://www.haskell.org). You can strip all the whitespace from a
-stream of strings with the following code::
-
- line_list = [' line 1\n', 'line 2 \n', ...]
-
- # Generator expression -- returns iterator
- stripped_iter = (line.strip() for line in line_list)
-
- # List comprehension -- returns list
- stripped_list = [line.strip() for line in line_list]
-
-You can select only certain elements by adding an ``"if"`` condition::
-
- stripped_list = [line.strip() for line in line_list
- if line != ""]
-
-With a list comprehension, you get back a Python list;
-``stripped_list`` is a list containing the resulting lines, not an
-iterator. Generator expressions return an iterator that computes the
-values as necessary, not needing to materialize all the values at
-once. This means that list comprehensions aren't useful if you're
-working with iterators that return an infinite stream or a very large
-amount of data. Generator expressions are preferable in these
-situations.
-
-Generator expressions are surrounded by parentheses ("()") and list
-comprehensions are surrounded by square brackets ("[]"). Generator
-expressions have the form::
-
- ( expression for expr in sequence1
- if condition1
- for expr2 in sequence2
- if condition2
- for expr3 in sequence3 ...
- if condition3
- for exprN in sequenceN
- if conditionN )
-
-Again, for a list comprehension only the outside brackets are
-different (square brackets instead of parentheses).
-
-The elements of the generated output will be the successive values of
-``expression``. The ``if`` clauses are all optional; if present,
-``expression`` is only evaluated and added to the result when
-``condition`` is true.
-
-Generator expressions always have to be written inside parentheses,
-but the parentheses signalling a function call also count. If you
-want to create an iterator that will be immediately passed to a
-function you can write::
-
- obj_total = sum(obj.count for obj in list_all_objects())
-
-The ``for...in`` clauses contain the sequences to be iterated over.
-The sequences do not have to be the same length, because they are
-iterated over from left to right, **not** in parallel. For each
-element in ``sequence1``, ``sequence2`` is looped over from the
-beginning. ``sequence3`` is then looped over for each
-resulting pair of elements from ``sequence1`` and ``sequence2``.
-
-To put it another way, a list comprehension or generator expression is
-equivalent to the following Python code::
-
- for expr1 in sequence1:
- if not (condition1):
- continue # Skip this element
- for expr2 in sequence2:
- if not (condition2):
- continue # Skip this element
- ...
- for exprN in sequenceN:
- if not (conditionN):
- continue # Skip this element
-
- # Output the value of
- # the expression.
-
-This means that when there are multiple ``for...in`` clauses but no
-``if`` clauses, the length of the resulting output will be equal to
-the product of the lengths of all the sequences. If you have two
-lists of length 3, the output list is 9 elements long::
-
- seq1 = 'abc'
- seq2 = (1,2,3)
- >>> [ (x,y) for x in seq1 for y in seq2]
- [('a', 1), ('a', 2), ('a', 3),
- ('b', 1), ('b', 2), ('b', 3),
- ('c', 1), ('c', 2), ('c', 3)]
-
-To avoid introducing an ambiguity into Python's grammar, if
-``expression`` is creating a tuple, it must be surrounded with
-parentheses. The first list comprehension below is a syntax error,
-while the second one is correct::
-
- # Syntax error
- [ x,y for x in seq1 for y in seq2]
- # Correct
- [ (x,y) for x in seq1 for y in seq2]
-
-
-Generators
------------------------
-
-Generators are a special class of functions that simplify the task of
-writing iterators. Regular functions compute a value and return it,
-but generators return an iterator that returns a stream of values.
-
-You're doubtless familiar with how regular function calls work in
-Python or C. When you call a function, it gets a private namespace
-where its local variables are created. When the function reaches a
-``return`` statement, the local variables are destroyed and the
-value is returned to the caller. A later call to the same function
-creates a new private namespace and a fresh set of local
-variables. But, what if the local variables weren't thrown away on
-exiting a function? What if you could later resume the function where
-it left off? This is what generators provide; they can be thought of
-as resumable functions.
-
-Here's the simplest example of a generator function::
-
- def generate_ints(N):
- for i in range(N):
- yield i
-
-Any function containing a ``yield`` keyword is a generator function;
-this is detected by Python's bytecode compiler which compiles the
-function specially as a result.
-
-When you call a generator function, it doesn't return a single value;
-instead it returns a generator object that supports the iterator
-protocol. On executing the ``yield`` expression, the generator
-outputs the value of ``i``, similar to a ``return``
-statement. The big difference between ``yield`` and a
-``return`` statement is that on reaching a ``yield`` the
-generator's state of execution is suspended and local variables are
-preserved. On the next call to the generator's ``.next()`` method,
-the function will resume executing.
-
-Here's a sample usage of the ``generate_ints()`` generator::
-
- >>> gen = generate_ints(3)
- >>> gen
- <generator object at 0x8117f90>
- >>> gen.next()
- 0
- >>> gen.next()
- 1
- >>> gen.next()
- 2
- >>> gen.next()
- Traceback (most recent call last):
- File "stdin", line 1, in ?
- File "stdin", line 2, in generate_ints
- StopIteration
-
-You could equally write ``for i in generate_ints(5)``, or
-``a,b,c = generate_ints(3)``.
-
-Inside a generator function, the ``return`` statement can only be used
-without a value, and signals the end of the procession of values;
-after executing a ``return`` the generator cannot return any further
-values. ``return`` with a value, such as ``return 5``, is a syntax
-error inside a generator function. The end of the generator's results
-can also be indicated by raising ``StopIteration`` manually, or by
-just letting the flow of execution fall off the bottom of the
-function.
-
-You could achieve the effect of generators manually by writing your
-own class and storing all the local variables of the generator as
-instance variables. For example, returning a list of integers could
-be done by setting ``self.count`` to 0, and having the
-``next()`` method increment ``self.count`` and return it.
-However, for a moderately complicated generator, writing a
-corresponding class can be much messier.
-
-The test suite included with Python's library, ``test_generators.py``,
-contains a number of more interesting examples. Here's one generator
-that implements an in-order traversal of a tree using generators
-recursively.
-
-::
-
- # A recursive generator that generates Tree leaves in in-order.
- def inorder(t):
- if t:
- for x in inorder(t.left):
- yield x
-
- yield t.label
-
- for x in inorder(t.right):
- yield x
-
-Two other examples in ``test_generators.py`` produce
-solutions for the N-Queens problem (placing N queens on an NxN
-chess board so that no queen threatens another) and the Knight's Tour
-(finding a route that takes a knight to every square of an NxN chessboard
-without visiting any square twice).
-
-
-
-Passing values into a generator
-''''''''''''''''''''''''''''''''''''''''''''''
-
-In Python 2.4 and earlier, generators only produced output. Once a
-generator's code was invoked to create an iterator, there was no way to
-pass any new information into the function when its execution is
-resumed. You could hack together this ability by making the
-generator look at a global variable or by passing in some mutable object
-that callers then modify, but these approaches are messy.
-
-In Python 2.5 there's a simple way to pass values into a generator.
-``yield`` became an expression, returning a value that can be assigned
-to a variable or otherwise operated on::
-
- val = (yield i)
-
-I recommend that you **always** put parentheses around a ``yield``
-expression when you're doing something with the returned value, as in
-the above example. The parentheses aren't always necessary, but it's
-easier to always add them instead of having to remember when they're
-needed.
-
-(PEP 342 explains the exact rules, which are that a
-``yield``-expression must always be parenthesized except when it
-occurs at the top-level expression on the right-hand side of an
-assignment. This means you can write ``val = yield i`` but have to
-use parentheses when there's an operation, as in ``val = (yield i)
-+ 12``.)
-
-Values are sent into a generator by calling its
-``send(value)`` method. This method resumes the
-generator's code and the ``yield`` expression returns the specified
-value. If the regular ``next()`` method is called, the
-``yield`` returns ``None``.
-
-Here's a simple counter that increments by 1 and allows changing the
-value of the internal counter.
-
-::
-
- def counter (maximum):
- i = 0
- while i < maximum:
- val = (yield i)
- # If value provided, change counter
- if val is not None:
- i = val
- else:
- i += 1
-
-And here's an example of changing the counter:
-
- >>> it = counter(10)
- >>> print it.next()
- 0
- >>> print it.next()
- 1
- >>> print it.send(8)
- 8
- >>> print it.next()
- 9
- >>> print it.next()
- Traceback (most recent call last):
- File ``t.py'', line 15, in ?
- print it.next()
- StopIteration
-
-Because ``yield`` will often be returning ``None``, you
-should always check for this case. Don't just use its value in
-expressions unless you're sure that the ``send()`` method
-will be the only method used resume your generator function.
-
-In addition to ``send()``, there are two other new methods on
-generators:
-
-* ``throw(type, value=None, traceback=None)`` is used to raise an exception inside the
- generator; the exception is raised by the ``yield`` expression
- where the generator's execution is paused.
-
-* ``close()`` raises a ``GeneratorExit``
- exception inside the generator to terminate the iteration.
- On receiving this
- exception, the generator's code must either raise
- ``GeneratorExit`` or ``StopIteration``; catching the
- exception and doing anything else is illegal and will trigger
- a ``RuntimeError``. ``close()`` will also be called by
- Python's garbage collector when the generator is garbage-collected.
-
- If you need to run cleanup code when a ``GeneratorExit`` occurs,
- I suggest using a ``try: ... finally:`` suite instead of
- catching ``GeneratorExit``.
-
-The cumulative effect of these changes is to turn generators from
-one-way producers of information into both producers and consumers.
-
-Generators also become **coroutines**, a more generalized form of
-subroutines. Subroutines are entered at one point and exited at
-another point (the top of the function, and a ``return``
-statement), but coroutines can be entered, exited, and resumed at
-many different points (the ``yield`` statements).
-
-
-Built-in functions
-----------------------------------------------
-
-Let's look in more detail at built-in functions often used with iterators.
-
-Two Python's built-in functions, ``map()`` and ``filter()``, are
-somewhat obsolete; they duplicate the features of list comprehensions
-but return actual lists instead of iterators.
-
-``map(f, iterA, iterB, ...)`` returns a list containing ``f(iterA[0],
-iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``.
-
-::
-
- def upper(s):
- return s.upper()
- map(upper, ['sentence', 'fragment']) =>
- ['SENTENCE', 'FRAGMENT']
-
- [upper(s) for s in ['sentence', 'fragment']] =>
- ['SENTENCE', 'FRAGMENT']
-
-As shown above, you can achieve the same effect with a list
-comprehension. The ``itertools.imap()`` function does the same thing
-but can handle infinite iterators; it'll be discussed later, in the section on
-the ``itertools`` module.
-
-``filter(predicate, iter)`` returns a list
-that contains all the sequence elements that meet a certain condition,
-and is similarly duplicated by list comprehensions.
-A **predicate** is a function that returns the truth value of
-some condition; for use with ``filter()``, the predicate must take a
-single value.
-
-::
-
- def is_even(x):
- return (x % 2) == 0
-
- filter(is_even, range(10)) =>
- [0, 2, 4, 6, 8]
-
-This can also be written as a list comprehension::
-
- >>> [x for x in range(10) if is_even(x)]
- [0, 2, 4, 6, 8]
-
-``filter()`` also has a counterpart in the ``itertools`` module,
-``itertools.ifilter()``, that returns an iterator and
-can therefore handle infinite sequences just as ``itertools.imap()`` can.
-
-``reduce(func, iter, [initial_value])`` doesn't have a counterpart in
-the ``itertools`` module because it cumulatively performs an operation
-on all the iterable's elements and therefore can't be applied to
-infinite iterables. ``func`` must be a function that takes two elements
-and returns a single value. ``reduce()`` takes the first two elements
-A and B returned by the iterator and calculates ``func(A, B)``. It
-then requests the third element, C, calculates ``func(func(A, B),
-C)``, combines this result with the fourth element returned, and
-continues until the iterable is exhausted. If the iterable returns no
-values at all, a ``TypeError`` exception is raised. If the initial
-value is supplied, it's used as a starting point and
-``func(initial_value, A)`` is the first calculation.
-
-::
-
- import operator
- reduce(operator.concat, ['A', 'BB', 'C']) =>
- 'ABBC'
- reduce(operator.concat, []) =>
- TypeError: reduce() of empty sequence with no initial value
- reduce(operator.mul, [1,2,3], 1) =>
- 6
- reduce(operator.mul, [], 1) =>
- 1
-
-If you use ``operator.add`` with ``reduce()``, you'll add up all the
-elements of the iterable. This case is so common that there's a special
-built-in called ``sum()`` to compute it::
-
- reduce(operator.add, [1,2,3,4], 0) =>
- 10
- sum([1,2,3,4]) =>
- 10
- sum([]) =>
- 0
-
-For many uses of ``reduce()``, though, it can be clearer to just write
-the obvious ``for`` loop::
-
- # Instead of:
- product = reduce(operator.mul, [1,2,3], 1)
-
- # You can write:
- product = 1
- for i in [1,2,3]:
- product *= i
-
-
-``enumerate(iter)`` counts off the elements in the iterable, returning
-2-tuples containing the count and each element.
-
-::
-
- enumerate(['subject', 'verb', 'object']) =>
- (0, 'subject'), (1, 'verb'), (2, 'object')
-
-``enumerate()`` is often used when looping through a list
-and recording the indexes at which certain conditions are met::
-
- f = open('data.txt', 'r')
- for i, line in enumerate(f):
- if line.strip() == '':
- print 'Blank line at line #%i' % i
-
-``sorted(iterable, [cmp=None], [key=None], [reverse=False)``
-collects all the elements of the iterable into a list, sorts
-the list, and returns the sorted result. The ``cmp``, ``key``,
-and ``reverse`` arguments are passed through to the
-constructed list's ``.sort()`` method.
-
-::
-
- import random
- # Generate 8 random numbers between [0, 10000)
- rand_list = random.sample(range(10000), 8)
- rand_list =>
- [769, 7953, 9828, 6431, 8442, 9878, 6213, 2207]
- sorted(rand_list) =>
- [769, 2207, 6213, 6431, 7953, 8442, 9828, 9878]
- sorted(rand_list, reverse=True) =>
- [9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]
-
-(For a more detailed discussion of sorting, see the Sorting mini-HOWTO
-in the Python wiki at http://wiki.python.org/moin/HowTo/Sorting.)
-
-The ``any(iter)`` and ``all(iter)`` built-ins look at
-the truth values of an iterable's contents. ``any()`` returns
-True if any element in the iterable is a true value, and ``all()``
-returns True if all of the elements are true values::
-
- any([0,1,0]) =>
- True
- any([0,0,0]) =>
- False
- any([1,1,1]) =>
- True
- all([0,1,0]) =>
- False
- all([0,0,0]) =>
- False
- all([1,1,1]) =>
- True
-
-
-Small functions and the lambda statement
-----------------------------------------------
-
-When writing functional-style programs, you'll often need little
-functions that act as predicates or that combine elements in some way.
-
-If there's a Python built-in or a module function that's suitable, you
-don't need to define a new function at all::
-
- stripped_lines = [line.strip() for line in lines]
- existing_files = filter(os.path.exists, file_list)
-
-If the function you need doesn't exist, you need to write it. One way
-to write small functions is to use the ``lambda`` statement. ``lambda``
-takes a number of parameters and an expression combining these parameters,
-and creates a small function that returns the value of the expression::
-
- lowercase = lambda x: x.lower()
-
- print_assign = lambda name, value: name + '=' + str(value)
-
- adder = lambda x, y: x+y
-
-An alternative is to just use the ``def`` statement and define a
-function in the usual way::
-
- def lowercase(x):
- return x.lower()
-
- def print_assign(name, value):
- return name + '=' + str(value)
-
- def adder(x,y):
- return x + y
-
-Which alternative is preferable? That's a style question; my usual
-course is to avoid using ``lambda``.
-
-One reason for my preference is that ``lambda`` is quite limited in
-the functions it can define. The result has to be computable as a
-single expression, which means you can't have multiway
-``if... elif... else`` comparisons or ``try... except`` statements.
-If you try to do too much in a ``lambda`` statement, you'll end up
-with an overly complicated expression that's hard to read. Quick,
-what's the following code doing?
-
-::
-
- total = reduce(lambda a, b: (0, a[1] + b[1]), items)[1]
-
-You can figure it out, but it takes time to disentangle the expression
-to figure out what's going on. Using a short nested
-``def`` statements makes things a little bit better::
-
- def combine (a, b):
- return 0, a[1] + b[1]
-
- total = reduce(combine, items)[1]
-
-But it would be best of all if I had simply used a ``for`` loop::
-
- total = 0
- for a, b in items:
- total += b
-
-Or the ``sum()`` built-in and a generator expression::
-
- total = sum(b for a,b in items)
-
-Many uses of ``reduce()`` are clearer when written as ``for`` loops.
-
-Fredrik Lundh once suggested the following set of rules for refactoring
-uses of ``lambda``:
-
-1) Write a lambda function.
-2) Write a comment explaining what the heck that lambda does.
-3) Study the comment for a while, and think of a name that captures
- the essence of the comment.
-4) Convert the lambda to a def statement, using that name.
-5) Remove the comment.
-
-I really like these rules, but you're free to disagree that this
-lambda-free style is better.
-
-
-The itertools module
------------------------
-
-The ``itertools`` module contains a number of commonly-used iterators
-as well as functions for combining several iterators. This section
-will introduce the module's contents by showing small examples.
-
-The module's functions fall into a few broad classes:
-
-* Functions that create a new iterator based on an existing iterator.
-* Functions for treating an iterator's elements as function arguments.
-* Functions for selecting portions of an iterator's output.
-* A function for grouping an iterator's output.
-
-Creating new iterators
-''''''''''''''''''''''
-
-``itertools.count(n)`` returns an infinite stream of
-integers, increasing by 1 each time. You can optionally supply the
-starting number, which defaults to 0::
-
- itertools.count() =>
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
- itertools.count(10) =>
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...
-
-``itertools.cycle(iter)`` saves a copy of the contents of a provided
-iterable and returns a new iterator that returns its elements from
-first to last. The new iterator will repeat these elements infinitely.
-
-::
-
- itertools.cycle([1,2,3,4,5]) =>
- 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ...
-
-``itertools.repeat(elem, [n])`` returns the provided element ``n``
-times, or returns the element endlessly if ``n`` is not provided.
-
-::
-
- itertools.repeat('abc') =>
- abc, abc, abc, abc, abc, abc, abc, abc, abc, abc, ...
- itertools.repeat('abc', 5) =>
- abc, abc, abc, abc, abc
-
-``itertools.chain(iterA, iterB, ...)`` takes an arbitrary number of
-iterables as input, and returns all the elements of the first
-iterator, then all the elements of the second, and so on, until all of
-the iterables have been exhausted.
-
-::
-
- itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>
- a, b, c, 1, 2, 3
-
-``itertools.izip(iterA, iterB, ...)`` takes one element from each iterable
-and returns them in a tuple::
-
- itertools.izip(['a', 'b', 'c'], (1, 2, 3)) =>
- ('a', 1), ('b', 2), ('c', 3)
-
-It's similiar to the built-in ``zip()`` function, but doesn't
-construct an in-memory list and exhaust all the input iterators before
-returning; instead tuples are constructed and returned only if they're
-requested. (The technical term for this behaviour is
-`lazy evaluation <http://en.wikipedia.org/wiki/Lazy_evaluation>`__.)
-
-This iterator is intended to be used with iterables that are all of
-the same length. If the iterables are of different lengths, the
-resulting stream will be the same length as the shortest iterable.
-
-::
-
- itertools.izip(['a', 'b'], (1, 2, 3)) =>
- ('a', 1), ('b', 2)
-
-You should avoid doing this, though, because an element may be taken
-from the longer iterators and discarded. This means you can't go on
-to use the iterators further because you risk skipping a discarded
-element.
-
-``itertools.islice(iter, [start], stop, [step])`` returns a stream
-that's a slice of the iterator. With a single ``stop`` argument,
-it will return the first ``stop``
-elements. If you supply a starting index, you'll get ``stop-start``
-elements, and if you supply a value for ``step``, elements will be
-skipped accordingly. Unlike Python's string and list slicing, you
-can't use negative values for ``start``, ``stop``, or ``step``.
-
-::
-
- itertools.islice(range(10), 8) =>
- 0, 1, 2, 3, 4, 5, 6, 7
- itertools.islice(range(10), 2, 8) =>
- 2, 3, 4, 5, 6, 7
- itertools.islice(range(10), 2, 8, 2) =>
- 2, 4, 6
-
-``itertools.tee(iter, [n])`` replicates an iterator; it returns ``n``
-independent iterators that will all return the contents of the source
-iterator. If you don't supply a value for ``n``, the default is 2.
-Replicating iterators requires saving some of the contents of the source
-iterator, so this can consume significant memory if the iterator is large
-and one of the new iterators is consumed more than the others.
-
-::
-
- itertools.tee( itertools.count() ) =>
- iterA, iterB
-
- where iterA ->
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
-
- and iterB ->
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
-
-
-Calling functions on elements
-'''''''''''''''''''''''''''''
-
-Two functions are used for calling other functions on the contents of an
-iterable.
-
-``itertools.imap(f, iterA, iterB, ...)`` returns
-a stream containing ``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]),
-f(iterA[2], iterB[2]), ...``::
-
- itertools.imap(operator.add, [5, 6, 5], [1, 2, 3]) =>
- 6, 8, 8
-
-The ``operator`` module contains a set of functions
-corresponding to Python's operators. Some examples are
-``operator.add(a, b)`` (adds two values),
-``operator.ne(a, b)`` (same as ``a!=b``),
-and
-``operator.attrgetter('id')`` (returns a callable that
-fetches the ``"id"`` attribute).
-
-``itertools.starmap(func, iter)`` assumes that the iterable will
-return a stream of tuples, and calls ``f()`` using these tuples as the
-arguments::
-
- itertools.starmap(os.path.join,
- [('/usr', 'bin', 'java'), ('/bin', 'python'),
- ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')])
- =>
- /usr/bin/java, /bin/python, /usr/bin/perl, /usr/bin/ruby
-
-
-Selecting elements
-''''''''''''''''''
-
-Another group of functions chooses a subset of an iterator's elements
-based on a predicate.
-
-``itertools.ifilter(predicate, iter)`` returns all the elements for
-which the predicate returns true::
-
- def is_even(x):
- return (x % 2) == 0
-
- itertools.ifilter(is_even, itertools.count()) =>
- 0, 2, 4, 6, 8, 10, 12, 14, ...
-
-``itertools.ifilterfalse(predicate, iter)`` is the opposite,
-returning all elements for which the predicate returns false::
-
- itertools.ifilterfalse(is_even, itertools.count()) =>
- 1, 3, 5, 7, 9, 11, 13, 15, ...
-
-``itertools.takewhile(predicate, iter)`` returns elements for as long
-as the predicate returns true. Once the predicate returns false,
-the iterator will signal the end of its results.
-
-::
-
- def less_than_10(x):
- return (x < 10)
-
- itertools.takewhile(less_than_10, itertools.count()) =>
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
-
- itertools.takewhile(is_even, itertools.count()) =>
- 0
-
-``itertools.dropwhile(predicate, iter)`` discards elements while the
-predicate returns true, and then returns the rest of the iterable's
-results.
-
-::
-
- itertools.dropwhile(less_than_10, itertools.count()) =>
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...
-
- itertools.dropwhile(is_even, itertools.count()) =>
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...
-
-
-Grouping elements
-'''''''''''''''''
-
-The last function I'll discuss, ``itertools.groupby(iter,
-key_func=None)``, is the most complicated. ``key_func(elem)`` is a
-function that can compute a key value for each element returned by the
-iterable. If you don't supply a key function, the key is simply each
-element itself.
-
-``groupby()`` collects all the consecutive elements from the
-underlying iterable that have the same key value, and returns a stream
-of 2-tuples containing a key value and an iterator for the elements
-with that key.
-
-::
-
- city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'),
- ('Anchorage', 'AK'), ('Nome', 'AK'),
- ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'),
- ...
- ]
-
- def get_state ((city, state)):
- return state
-
- itertools.groupby(city_list, get_state) =>
- ('AL', iterator-1),
- ('AK', iterator-2),
- ('AZ', iterator-3), ...
-
- where
- iterator-1 =>
- ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL')
- iterator-2 =>
- ('Anchorage', 'AK'), ('Nome', 'AK')
- iterator-3 =>
- ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')
-
-``groupby()`` assumes that the underlying iterable's contents will
-already be sorted based on the key. Note that the returned iterators
-also use the underlying iterable, so you have to consume the results
-of iterator-1 before requesting iterator-2 and its corresponding key.
-
-
-The functools module
-----------------------------------------------
-
-The ``functools`` module in Python 2.5 contains some higher-order
-functions. A **higher-order function** takes one or more functions as
-input and returns a new function. The most useful tool in this module
-is the ``partial()`` function.
-
-For programs written in a functional style, you'll sometimes want to
-construct variants of existing functions that have some of the
-parameters filled in. Consider a Python function ``f(a, b, c)``; you
-may wish to create a new function ``g(b, c)`` that's equivalent to
-``f(1, b, c)``; you're filling in a value for one of ``f()``'s parameters.
-This is called "partial function application".
-
-The constructor for ``partial`` takes the arguments ``(function, arg1,
-arg2, ... kwarg1=value1, kwarg2=value2)``. The resulting object is
-callable, so you can just call it to invoke ``function`` with the
-filled-in arguments.
-
-Here's a small but realistic example::
-
- import functools
-
- def log (message, subsystem):
- "Write the contents of 'message' to the specified subsystem."
- print '%s: %s' % (subsystem, message)
- ...
-
- server_log = functools.partial(log, subsystem='server')
- server_log('Unable to open socket')
-
-
-The operator module
--------------------
-
-The ``operator`` module was mentioned earlier. It contains a set of
-functions corresponding to Python's operators. These functions
-are often useful in functional-style code because they save you
-from writing trivial functions that perform a single operation.
-
-Some of the functions in this module are:
-
-* Math operations: ``add()``, ``sub()``, ``mul()``, ``div()``, ``floordiv()``,
- ``abs()``, ...
-* Logical operations: ``not_()``, ``truth()``.
-* Bitwise operations: ``and_()``, ``or_()``, ``invert()``.
-* Comparisons: ``eq()``, ``ne()``, ``lt()``, ``le()``, ``gt()``, and ``ge()``.
-* Object identity: ``is_()``, ``is_not()``.
-
-Consult `the operator module's documentation <http://docs.python.org/lib/module-operator.html>`__ for a complete
-list.
-
-
-
-The functional module
----------------------
-
-Collin Winter's `functional module <http://oakwinter.com/code/functional/>`__
-provides a number of more
-advanced tools for functional programming. It also reimplements
-several Python built-ins, trying to make them more intuitive to those
-used to functional programming in other languages.
-
-This section contains an introduction to some of the most important
-functions in ``functional``; full documentation can be found at `the
-project's website <http://oakwinter.com/code/functional/documentation/>`__.
-
-``compose(outer, inner, unpack=False)``
-
-The ``compose()`` function implements function composition.
-In other words, it returns a wrapper around the ``outer`` and ``inner`` callables, such
-that the return value from ``inner`` is fed directly to ``outer``. That is,
-
-::
-
- >>> def add(a, b):
- ... return a + b
- ...
- >>> def double(a):
- ... return 2 * a
- ...
- >>> compose(double, add)(5, 6)
- 22
-
-is equivalent to
-
-::
-
- >>> double(add(5, 6))
- 22
-
-The ``unpack`` keyword is provided to work around the fact that Python functions are not always
-`fully curried <http://en.wikipedia.org/wiki/Currying>`__.
-By default, it is expected that the ``inner`` function will return a single object and that the ``outer``
-function will take a single argument. Setting the ``unpack`` argument causes ``compose`` to expect a
-tuple from ``inner`` which will be expanded before being passed to ``outer``. Put simply,
-
-::
-
- compose(f, g)(5, 6)
-
-is equivalent to::
-
- f(g(5, 6))
-
-while
-
-::
-
- compose(f, g, unpack=True)(5, 6)
-
-is equivalent to::
-
- f(*g(5, 6))
-
-Even though ``compose()`` only accepts two functions, it's trivial to
-build up a version that will compose any number of functions. We'll
-use ``reduce()``, ``compose()`` and ``partial()`` (the last of which
-is provided by both ``functional`` and ``functools``).
-
-::
-
- from functional import compose, partial
-
- multi_compose = partial(reduce, compose)
-
-
-We can also use ``map()``, ``compose()`` and ``partial()`` to craft a
-version of ``"".join(...)`` that converts its arguments to string::
-
- from functional import compose, partial
-
- join = compose("".join, partial(map, str))
-
-
-``flip(func)``
-
-``flip()`` wraps the callable in ``func`` and
-causes it to receive its non-keyword arguments in reverse order.
-
-::
-
- >>> def triple(a, b, c):
- ... return (a, b, c)
- ...
- >>> triple(5, 6, 7)
- (5, 6, 7)
- >>>
- >>> flipped_triple = flip(triple)
- >>> flipped_triple(5, 6, 7)
- (7, 6, 5)
-
-``foldl(func, start, iterable)``
-
-``foldl()`` takes a binary function, a starting value (usually some kind of 'zero'), and an iterable.
-The function is applied to the starting value and the first element of the list, then the result of
-that and the second element of the list, then the result of that and the third element of the list,
-and so on.
-
-This means that a call such as::
-
- foldl(f, 0, [1, 2, 3])
-
-is equivalent to::
-
- f(f(f(0, 1), 2), 3)
-
-
-``foldl()`` is roughly equivalent to the following recursive function::
-
- def foldl(func, start, seq):
- if len(seq) == 0:
- return start
-
- return foldl(func, func(start, seq[0]), seq[1:])
-
-Speaking of equivalence, the above ``foldl`` call can be expressed in terms of the built-in ``reduce`` like
-so::
-
- reduce(f, [1, 2, 3], 0)
-
-
-We can use ``foldl()``, ``operator.concat()`` and ``partial()`` to
-write a cleaner, more aesthetically-pleasing version of Python's
-``"".join(...)`` idiom::
-
- from functional import foldl, partial
- from operator import concat
-
- join = partial(foldl, concat, "")
-
-
-Revision History and Acknowledgements
-------------------------------------------------
-
-The author would like to thank the following people for offering
-suggestions, corrections and assistance with various drafts of this
-article: Ian Bicking, Nick Coghlan, Nick Efford, Raymond Hettinger,
-Jim Jewett, Mike Krell, Leandro Lameiro, Jussi Salmela,
-Collin Winter, Blake Winton.
-
-Version 0.1: posted June 30 2006.
-
-Version 0.11: posted July 1 2006. Typo fixes.
-
-Version 0.2: posted July 10 2006. Merged genexp and listcomp
-sections into one. Typo fixes.
-
-Version 0.21: Added more references suggested on the tutor mailing list.
-
-Version 0.30: Adds a section on the ``functional`` module written by
-Collin Winter; adds short section on the operator module; a few other
-edits.
-
-
-References
---------------------
-
-General
-'''''''''''''''
-
-**Structure and Interpretation of Computer Programs**, by
-Harold Abelson and Gerald Jay Sussman with Julie Sussman.
-Full text at http://mitpress.mit.edu/sicp/.
-In this classic textbook of computer science, chapters 2 and 3 discuss the
-use of sequences and streams to organize the data flow inside a
-program. The book uses Scheme for its examples, but many of the
-design approaches described in these chapters are applicable to
-functional-style Python code.
-
-http://www.defmacro.org/ramblings/fp.html: A general
-introduction to functional programming that uses Java examples
-and has a lengthy historical introduction.
-
-http://en.wikipedia.org/wiki/Functional_programming:
-General Wikipedia entry describing functional programming.
-
-http://en.wikipedia.org/wiki/Coroutine:
-Entry for coroutines.
-
-http://en.wikipedia.org/wiki/Currying:
-Entry for the concept of currying.
-
-Python-specific
-'''''''''''''''''''''''''''
-
-http://gnosis.cx/TPiP/:
-The first chapter of David Mertz's book :title-reference:`Text Processing in Python`
-discusses functional programming for text processing, in the section titled
-"Utilizing Higher-Order Functions in Text Processing".
-
-Mertz also wrote a 3-part series of articles on functional programming
-for IBM's DeveloperWorks site; see
-`part 1 <http://www-128.ibm.com/developerworks/library/l-prog.html>`__,
-`part 2 <http://www-128.ibm.com/developerworks/library/l-prog2.html>`__, and
-`part 3 <http://www-128.ibm.com/developerworks/linux/library/l-prog3.html>`__,
-
-
-Python documentation
-'''''''''''''''''''''''''''
-
-http://docs.python.org/lib/module-itertools.html:
-Documentation for the ``itertools`` module.
-
-http://docs.python.org/lib/module-operator.html:
-Documentation for the ``operator`` module.
-
-http://www.python.org/dev/peps/pep-0289/:
-PEP 289: "Generator Expressions"
-
-http://www.python.org/dev/peps/pep-0342/
-PEP 342: "Coroutines via Enhanced Generators" describes the new generator
-features in Python 2.5.
-
-.. comment
-
- Topics to place
- -----------------------------
-
- XXX os.walk()
-
- XXX Need a large example.
-
- But will an example add much? I'll post a first draft and see
- what the comments say.
-
-.. comment
-
- Original outline:
- Introduction
- Idea of FP
- Programs built out of functions
- Functions are strictly input-output, no internal state
- Opposed to OO programming, where objects have state
-
- Why FP?
- Formal provability
- Assignment is difficult to reason about
- Not very relevant to Python
- Modularity
- Small functions that do one thing
- Debuggability:
- Easy to test due to lack of state
- Easy to verify output from intermediate steps
- Composability
- You assemble a toolbox of functions that can be mixed
-
- Tackling a problem
- Need a significant example
-
- Iterators
- Generators
- The itertools module
- List comprehensions
- Small functions and the lambda statement
- Built-in functions
- map
- filter
- reduce
-
-.. comment
-
- Handy little function for printing part of an iterator -- used
- while writing this document.
-
- import itertools
- def print_iter(it):
- slice = itertools.islice(it, 10)
- for elem in slice[:-1]:
- sys.stdout.write(str(elem))
- sys.stdout.write(', ')
- print elem[-1]
-
-
diff --git a/tests/examplefiles/garcia-wachs.kk b/tests/examplefiles/garcia-wachs.kk
deleted file mode 100644
index 91a01fbe..00000000
--- a/tests/examplefiles/garcia-wachs.kk
+++ /dev/null
@@ -1,133 +0,0 @@
-// Koka language test module
-
-// This module implements the GarsiaWachs algorithm.
-// It is an adaptation of the algorithm in ML as described by JeanChristophe Filli�tre:
-// in ''A functional implementation of the GarsiaWachs algorithm. (functional pearl). ML workshop 2008, pages 91--96''.
-// See: http://www.lri.fr/~filliatr/publis/gwWml08.pdf
-//
-// The algorithm is interesting since it uses mutable references shared between a list and tree but the
-// side effects are not observable from outside. Koka automatically infers that the final algorithm is pure.
-// Note: due to a current limitation in the divergence analysis, koka cannot yet infer that mutually recursive
-// definitions in "insert" and "extract" are terminating and the final algorithm still has a divergence effect.
-// However, koka does infer that no other effect (i.e. an exception due to a partial match) can occur.
-module garcsiaWachs
-
-import test = qualified std/flags
-
-# pre processor test
-
-public function main() {
- wlist = Cons1(('a',3), [('b',2),('c',1),('d',4),('e',5)])
- tree = wlist.garsiaWachs()
- tree.show.println()
-}
-
-//----------------------------------------------------
-// Trees
-//----------------------------------------------------
-public type tree<a> {
- con Leaf(value :a)
- con Node(left :tree<a>, right :tree<a>)
-}
-
-function show( t : tree<char> ) : string {
- match(t) {
- Leaf(c) -> core/show(c)
- Node(l,r) -> "Node(" + show(l) + "," + show(r) + ")"
- }
-}
-
-
-//----------------------------------------------------
-// Non empty lists
-//----------------------------------------------------
-public type list1<a> {
- Cons1( head : a, tail : list<a> )
-}
-
-function map( xs, f ) {
- val Cons1(y,ys) = xs
- return Cons1(f(y), core/map(ys,f))
-}
-
-function zip( xs :list1<a>, ys :list1<b> ) : list1<(a,b)> {
- Cons1( (xs.head, ys.head), zip(xs.tail, ys.tail))
-}
-
-
-//----------------------------------------------------
-// Phase 1
-//----------------------------------------------------
-
-function insert( after : list<(tree<a>,int)>, t : (tree<a>,int), before : list<(tree<a>,int)> ) : div tree<a>
-{
- match(before) {
- Nil -> extract( [], Cons1(t,after) )
- Cons(x,xs) -> {
- if (x.snd < t.snd) then return insert( Cons(x,after), t, xs )
- match(xs) {
- Nil -> extract( [], Cons1(x,Cons(t,after)) )
- Cons(y,ys) -> extract( ys, Cons1(y,Cons(x,Cons(t,after))) )
- }
- }
- }
-}
-
-function extract( before : list<(tree<a>,int)>, after : list1<(tree<a>,int)> ) : div tree<a>
-{
- val Cons1((t1,w1) as x, xs ) = after
- match(xs) {
- Nil -> t1
- Cons((t2,w2) as y, ys) -> match(ys) {
- Nil -> insert( [], (Node(t1,t2), w1+w2), before )
- Cons((_,w3),_zs) ->
- if (w1 <= w3)
- then insert(ys, (Node(t1,t2), w1+w2), before)
- else extract(Cons(x,before), Cons1(y,ys))
- }
- }
-}
-
-function balance( xs : list1<(tree<a>,int)> ) : div tree<a> {
- extract( [], xs )
-}
-
-//----------------------------------------------------
-// Phase 2
-//----------------------------------------------------
-
-function mark( depth :int, t :tree<(a,ref<h,int>)> ) : <write<h>> () {
- match(t) {
- Leaf((_,d)) -> d := depth
- Node(l,r) -> { mark(depth+1,l); mark(depth+1,r) }
- }
-}
-
-function build( depth :int, xs :list1<(a,ref<h,int>)> ) : <read<h>,div> (tree<a>,list<(a,ref<h,int>)>)
-{
- if (!(xs.head.snd) == depth) return (Leaf(xs.head.fst), xs.tail)
-
- l = build(depth+1, xs)
- match(l.snd) {
- Nil -> (l.fst, Nil)
- Cons(y,ys) -> {
- r = build(depth+1, Cons1(y,ys))
- (Node(l.fst,r.fst), r.snd)
- }
- }
-}
-
-//----------------------------------------------------
-// Main
-//----------------------------------------------------
-
-public function garsiaWachs( xs : list1<(a,int)> ) : div tree<a>
-{
- refs = xs.map(fst).map( fun(x) { (x, ref(0)) } )
- wleafs = zip( refs.map(Leaf), xs.map(snd) )
-
- tree = balance(wleafs)
- mark(0,tree)
- build(0,refs).fst
-}
-
diff --git a/tests/examplefiles/genclass.clj b/tests/examplefiles/genclass.clj
deleted file mode 100644
index c63da8fd..00000000
--- a/tests/examplefiles/genclass.clj
+++ /dev/null
@@ -1,510 +0,0 @@
-; Copyright (c) Rich Hickey. All rights reserved.
-; The use and distribution terms for this software are covered by the
-; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
-; which can be found in the file CPL.TXT at the root of this distribution.
-; By using this software in any fashion, you are agreeing to be bound by
-; the terms of this license.
-; You must not remove this notice, or any other, from this software.
-
-(in-ns 'clojure)
-
-(import '(java.lang.reflect Modifier Constructor)
- '(clojure.asm ClassWriter ClassVisitor Opcodes Type)
- '(clojure.asm.commons Method GeneratorAdapter)
- '(clojure.lang IPersistentMap))
-
-;(defn method-sig [#^java.lang.reflect.Method meth]
-; [(. meth (getName)) (seq (. meth (getParameterTypes)))])
-
-(defn- non-private-methods [#^Class c]
- (loop [mm {}
- considered #{}
- c c]
- (if c
- (let [[mm considered]
- (loop [mm mm
- considered considered
- meths (concat
- (seq (. c (getDeclaredMethods)))
- (seq (. c (getMethods))))]
- (if meths
- (let [#^Method meth (first meths)
- mods (. meth (getModifiers))
- mk (method-sig meth)]
- (if (or (considered mk)
- (. Modifier (isPrivate mods))
- (. Modifier (isStatic mods))
- (. Modifier (isFinal mods)))
- (recur mm (conj considered mk) (rest meths))
- (recur (assoc mm mk meth) (conj considered mk) (rest meths))))
- [mm considered]))]
- (recur mm considered (. c (getSuperclass))))
- mm)))
-
-(defn- ctor-sigs [super]
- (for [#^Constructor ctor (. super (getDeclaredConstructors))
- :when (not (. Modifier (isPrivate (. ctor (getModifiers)))))]
- (apply vector (. ctor (getParameterTypes)))))
-
-(defn- escape-class-name [c]
- (.. (.getSimpleName c)
- (replace "[]" "<>")))
-
-(defn- overload-name [mname pclasses]
- (if (seq pclasses)
- (apply str mname (interleave (repeat \-)
- (map escape-class-name pclasses)))
- (str mname "-void")))
-
-;(distinct (map first(keys (mapcat non-private-methods [Object IPersistentMap]))))
-
-(defn gen-class
- "Generates compiled bytecode for a class with the given
- package-qualified cname (which, as all names in these parameters, can
- be a string or symbol). The gen-class construct contains no
- implementation, as the implementation will be dynamically sought by
- the generated class in functions in a corresponding Clojure
- namespace. Given a generated class org.mydomain.MyClass, methods
- will be implemented that look for same-named functions in a Clojure
- namespace called org.domain.MyClass. The init and main
- functions (see below) will be found similarly. The static
- initializer for the generated class will attempt to load the Clojure
- support code for the class as a resource from the claspath, e.g. in
- the example case, org/mydomain/MyClass.clj
-
- Returns a map containing :name and :bytecode. Most uses will be
- satisfied by the higher-level gen-and-load-class and
- gen-and-store-class functions, which generate and immediately load,
- or generate and store to disk, respectively.
-
- Options should be a set of key/value pairs, all of which are optional:
-
- :extends aclass
-
- Specifies the superclass, the non-private methods of which will be
- overridden by the class. If not provided, defaults to Object.
-
- :implements [interface ...]
-
- One or more interfaces, the methods of which will be implemented by the class.
-
- :init name
-
- If supplied, names a function that will be called with the arguments
- to the constructor. Must return [[superclass-constructor-args] state]
- If not supplied, the constructor args are passed directly to
- the superclass constructor and the state will be nil
-
- :constructors {[param-types] [super-param-types], ...}
-
- By default, constructors are created for the generated class which
- match the signature(s) of the constructors for the superclass. This
- parameter may be used to explicitly specify constructors, each entry
- providing a mapping from a constructor signature to a superclass
- constructor signature. When you supply this, you must supply an :init
- specifier.
-
- :methods [[name [param-types] return-type], ...]
-
- The generated class automatically defines all of the non-private
- methods of its superclasses/interfaces. This parameter can be used
- to specify the signatures of additional methods of the generated
- class. Do not repeat superclass/interface signatures here.
-
- :main boolean
-
- If supplied and true, a static public main function will be
- generated. It will pass each string of the String[] argument as a
- separate argument to a function called 'main.
-
- :factory name
-
- If supplied, a (set of) public static factory function(s) will be
- created with the given name, and the same signature(s) as the
- constructor(s).
-
- :state name
-
- If supplied, a public final instance field with the given name will be
- created. You must supply an :init function in order to provide a
- value for the state. Note that, though final, the state can be a ref
- or agent, supporting the creation of Java objects with transactional
- or asynchronous mutation semantics.
-
- :exposes {protected-field-name {:get name :set name}, ...}
-
- Since the implementations of the methods of the generated class
- occur in Clojure functions, they have no access to the inherited
- protected fields of the superclass. This parameter can be used to
- generate public getter/setter methods exposing the protected field(s)
- for use in the implementation."
-
- [cname & options]
- (let [name (str cname)
- {:keys [extends implements constructors methods main factory state init exposes]} (apply hash-map options)
- super (or extends Object)
- interfaces implements
- supers (cons super (seq interfaces))
- ctor-sig-map (or constructors (zipmap (ctor-sigs super) (ctor-sigs super)))
- cv (new ClassWriter (. ClassWriter COMPUTE_MAXS))
- cname (. name (replace "." "/"))
- ctype (. Type (getObjectType cname))
- iname (fn [c] (.. Type (getType c) (getInternalName)))
- totype (fn [c] (. Type (getType c)))
- to-types (fn [cs] (if (pos? (count cs))
- (into-array (map totype cs))
- (make-array Type 0)))
- obj-type (totype Object)
- arg-types (fn [n] (if (pos? n)
- (into-array (replicate n obj-type))
- (make-array Type 0)))
- super-type (totype super)
- init-name (str init)
- factory-name (str factory)
- state-name (str state)
- main-name "main"
- var-name (fn [s] (str s "__var"))
- rt-type (totype clojure.lang.RT)
- var-type (totype clojure.lang.Var)
- ifn-type (totype clojure.lang.IFn)
- iseq-type (totype clojure.lang.ISeq)
- ex-type (totype java.lang.UnsupportedOperationException)
- all-sigs (distinct (concat (map #(let[[m p] (key %)] {m [p]}) (mapcat non-private-methods supers))
- (map (fn [[m p]] {(str m) [p]}) methods)))
- sigs-by-name (apply merge-with concat {} all-sigs)
- overloads (into {} (filter (fn [[m s]] (rest s)) sigs-by-name))
- var-fields (concat (and init [init-name])
- (and main [main-name])
- (distinct (concat (keys sigs-by-name)
- (mapcat (fn [[m s]] (map #(overload-name m %) s)) overloads)
- (mapcat (comp (partial map str) vals val) exposes))))
- emit-get-var (fn [gen v]
- (let [false-label (. gen newLabel)
- end-label (. gen newLabel)]
- (. gen getStatic ctype (var-name v) var-type)
- (. gen dup)
- (. gen invokeVirtual var-type (. Method (getMethod "boolean isBound()")))
- (. gen ifZCmp (. GeneratorAdapter EQ) false-label)
- (. gen invokeVirtual var-type (. Method (getMethod "Object get()")))
- (. gen goTo end-label)
- (. gen mark false-label)
- (. gen pop)
- (. gen visitInsn (. Opcodes ACONST_NULL))
- (. gen mark end-label)))
- emit-forwarding-method
- (fn [mname pclasses rclass else-gen]
- (let [ptypes (to-types pclasses)
- rtype (totype rclass)
- m (new Method mname rtype ptypes)
- is-overload (overloads mname)
- gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)
- found-label (. gen (newLabel))
- else-label (. gen (newLabel))
- end-label (. gen (newLabel))]
- (. gen (visitCode))
- (when is-overload
- (emit-get-var gen (overload-name mname pclasses))
- (. gen (dup))
- (. gen (ifNonNull found-label))
- (. gen (pop)))
- (emit-get-var gen mname)
- (. gen (dup))
- (. gen (ifNull else-label))
- (when is-overload
- (. gen (mark found-label)))
- ;if found
- (. gen (loadThis))
- ;box args
- (dotimes i (count ptypes)
- (. gen (loadArg i))
- (. clojure.lang.Compiler$HostExpr (emitBoxReturn nil gen (nth pclasses i))))
- ;call fn
- (. gen (invokeInterface ifn-type (new Method "invoke" obj-type
- (into-array (cons obj-type
- (replicate (count ptypes) obj-type))))))
- ;unbox return
- (. gen (unbox rtype))
- (when (= (. rtype (getSort)) (. Type VOID))
- (. gen (pop)))
- (. gen (goTo end-label))
-
- ;else call supplied alternative generator
- (. gen (mark else-label))
- (. gen (pop))
-
- (else-gen gen m)
-
- (. gen (mark end-label))
- (. gen (returnValue))
- (. gen (endMethod))))
- ]
- ;start class definition
- (. cv (visit (. Opcodes V1_5) (. Opcodes ACC_PUBLIC)
- cname nil (iname super)
- (when interfaces
- (into-array (map iname interfaces)))))
-
- ;static fields for vars
- (doseq v var-fields
- (. cv (visitField (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_FINAL) (. Opcodes ACC_STATIC))
- (var-name v)
- (. var-type getDescriptor)
- nil nil)))
-
- ;instance field for state
- (when state
- (. cv (visitField (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_FINAL))
- state-name
- (. obj-type getDescriptor)
- nil nil)))
-
- ;static init to set up var fields and load clj
- (let [gen (new GeneratorAdapter (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_STATIC))
- (. Method getMethod "void <clinit> ()")
- nil nil cv)]
- (. gen (visitCode))
- (doseq v var-fields
- (. gen push name)
- (. gen push v)
- (. gen (invokeStatic rt-type (. Method (getMethod "clojure.lang.Var var(String,String)"))))
- (. gen putStatic ctype (var-name v) var-type))
-
- (. gen push ctype)
- (. gen push (str (. name replace \. (. java.io.File separatorChar)) ".clj"))
- (. gen (invokeStatic rt-type (. Method (getMethod "void loadResourceScript(Class,String)"))))
-
- (. gen (returnValue))
- (. gen (endMethod)))
-
- ;ctors
- (doseq [pclasses super-pclasses] ctor-sig-map
- (let [ptypes (to-types pclasses)
- super-ptypes (to-types super-pclasses)
- m (new Method "<init>" (. Type VOID_TYPE) ptypes)
- super-m (new Method "<init>" (. Type VOID_TYPE) super-ptypes)
- gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)
- no-init-label (. gen newLabel)
- end-label (. gen newLabel)
- nth-method (. Method (getMethod "Object nth(Object,int)"))
- local (. gen newLocal obj-type)]
- (. gen (visitCode))
-
- (if init
- (do
- (emit-get-var gen init-name)
- (. gen dup)
- (. gen ifNull no-init-label)
- ;box init args
- (dotimes i (count pclasses)
- (. gen (loadArg i))
- (. clojure.lang.Compiler$HostExpr (emitBoxReturn nil gen (nth pclasses i))))
- ;call init fn
- (. gen (invokeInterface ifn-type (new Method "invoke" obj-type
- (arg-types (count ptypes)))))
- ;expecting [[super-ctor-args] state] returned
- (. gen dup)
- (. gen push 0)
- (. gen (invokeStatic rt-type nth-method))
- (. gen storeLocal local)
-
- (. gen (loadThis))
- (. gen dupX1)
- (dotimes i (count super-pclasses)
- (. gen loadLocal local)
- (. gen push i)
- (. gen (invokeStatic rt-type nth-method))
- (. clojure.lang.Compiler$HostExpr (emitUnboxArg nil gen (nth super-pclasses i))))
- (. gen (invokeConstructor super-type super-m))
-
- (if state
- (do
- (. gen push 1)
- (. gen (invokeStatic rt-type nth-method))
- (. gen (putField ctype state-name obj-type)))
- (. gen pop))
-
- (. gen goTo end-label)
- ;no init found
- (. gen mark no-init-label)
- (. gen (throwException ex-type (str init-name " not defined")))
- (. gen mark end-label))
- (if (= pclasses super-pclasses)
- (do
- (. gen (loadThis))
- (. gen (loadArgs))
- (. gen (invokeConstructor super-type super-m)))
- (throw (new Exception ":init not specified, but ctor and super ctor args differ"))))
-
- (. gen (returnValue))
- (. gen (endMethod))
- ;factory
- (when factory
- (let [fm (new Method factory-name ctype ptypes)
- gen (new GeneratorAdapter (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_STATIC))
- fm nil nil cv)]
- (. gen (visitCode))
- (. gen newInstance ctype)
- (. gen dup)
- (. gen (loadArgs))
- (. gen (invokeConstructor ctype m))
- (. gen (returnValue))
- (. gen (endMethod))))))
-
- ;add methods matching supers', if no fn -> call super
- (let [mm (non-private-methods super)]
- (doseq #^java.lang.reflect.Method meth (vals mm)
- (emit-forwarding-method (.getName meth) (.getParameterTypes meth) (.getReturnType meth)
- (fn [gen m]
- (. gen (loadThis))
- ;push args
- (. gen (loadArgs))
- ;call super
- (. gen (visitMethodInsn (. Opcodes INVOKESPECIAL)
- (. super-type (getInternalName))
- (. m (getName))
- (. m (getDescriptor)))))))
- ;add methods matching interfaces', if no fn -> throw
- (doseq #^Class iface interfaces
- (doseq #^java.lang.reflect.Method meth (. iface (getMethods))
- (when-not (contains? mm (method-sig meth))
- (emit-forwarding-method (.getName meth) (.getParameterTypes meth) (.getReturnType meth)
- (fn [gen m]
- (. gen (throwException ex-type (. m (getName)))))))))
- ;extra methods
- (doseq [mname pclasses rclass :as msig] methods
- (emit-forwarding-method (str mname) pclasses rclass
- (fn [gen m]
- (. gen (throwException ex-type (. m (getName))))))))
-
- ;main
- (when main
- (let [m (. Method getMethod "void main (String[])")
- gen (new GeneratorAdapter (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_STATIC))
- m nil nil cv)
- no-main-label (. gen newLabel)
- end-label (. gen newLabel)]
- (. gen (visitCode))
-
- (emit-get-var gen main-name)
- (. gen dup)
- (. gen ifNull no-main-label)
- (. gen loadArgs)
- (. gen (invokeStatic rt-type (. Method (getMethod "clojure.lang.ISeq seq(Object)"))))
- (. gen (invokeInterface ifn-type (new Method "applyTo" obj-type
- (into-array [iseq-type]))))
- (. gen pop)
- (. gen goTo end-label)
- ;no main found
- (. gen mark no-main-label)
- (. gen (throwException ex-type (str main-name " not defined")))
- (. gen mark end-label)
- (. gen (returnValue))
- (. gen (endMethod))))
- ;field exposers
- (doseq [f {getter :get setter :set}] exposes
- (let [fld (.getField super (str f))
- ftype (totype (.getType fld))]
- (when getter
- (let [m (new Method (str getter) ftype (to-types []))
- gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)]
- (. gen (visitCode))
- (. gen loadThis)
- (. gen getField ctype (str f) ftype)
- (. gen (returnValue))
- (. gen (endMethod))))
- (when setter
- (let [m (new Method (str setter) (. Type VOID_TYPE) (into-array [ftype]))
- gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)]
- (. gen (visitCode))
- (. gen loadThis)
- (. gen loadArgs)
- (. gen putField ctype (str f) ftype)
- (. gen (returnValue))
- (. gen (endMethod))))))
- ;finish class def
- (. cv (visitEnd))
- {:name name :bytecode (. cv (toByteArray))}))
-
-(defn gen-and-load-class
- "Generates and immediately loads the bytecode for the specified
- class. Note that a class generated this way can be loaded only once
- - the JVM supports only one class with a given name per
- classloader. Subsequent to generation you can import it into any
- desired namespaces just like any other class. See gen-class for a
- description of the options."
-
- [name & options]
- (let [{:keys [name bytecode]}
- (apply gen-class (str name) options)]
- (.. clojure.lang.RT ROOT_CLASSLOADER (defineClass (str name) bytecode))))
-
-(defn gen-and-save-class
- "Generates the bytecode for the named class and stores in a .class
- file in a subpath of the supplied path, the directories for which
- must already exist. See gen-class for a description of the options"
-
- [path name & options]
- (let [{:keys [name bytecode]} (apply gen-class (str name) options)
- file (java.io.File. path (str (. name replace \. (. java.io.File separatorChar)) ".class"))]
- (.createNewFile file)
- (with-open f (java.io.FileOutputStream. file)
- (.write f bytecode))))
-
-(comment
-;usage
-(gen-class
- package-qualified-name
- ;all below are optional
- :extends aclass
- :implements [interface ...]
- :constructors {[param-types] [super-param-types], }
- :methods [[name [param-types] return-type], ]
- :main boolean
- :factory name
- :state name
- :init name
- :exposes {protected-field {:get name :set name}, })
-
-;(gen-and-load-class
-(clojure/gen-and-save-class
- "/Users/rich/Downloads"
- 'fred.lucy.Ethel
- :extends clojure.lang.Box ;APersistentMap
- :implements [clojure.lang.IPersistentMap]
- :state 'state
- ;:constructors {[Object] [Object]}
- ;:init 'init
- :main true
- :factory 'create
- :methods [['foo [Object] Object]
- ['foo [] Object]]
- :exposes {'val {:get 'getVal :set 'setVal}})
-
-(in-ns 'fred.lucy.Ethel__2276)
-(clojure/refer 'clojure :exclude '(assoc seq count cons))
-(defn init [n] [[] n])
-(defn foo
- ([this] :foo)
- ([this x] x))
-(defn main [x y] (println x y))
-(in-ns 'user)
-(def ethel (new fred.lucy.Ethel__2276 42))
-(def ethel (fred.lucy.Ethel__2276.create 21))
-(fred.lucy.Ethel__2276.main (into-array ["lucy" "ricky"]))
-(.state ethel)
-(.foo ethel 7)
-(.foo ethel)
-(.getVal ethel)
-(.setVal ethel 12)
-
-(gen-class org.clojure.MyComparator :implements [Comparator])
-(in-ns 'org.clojure.MyComparator)
-(defn compare [this x y] ...)
-
-(load-file "/Users/rich/dev/clojure/src/genclass.clj")
-
-(clojure/gen-and-save-class "/Users/rich/dev/clojure/gen/"
- 'org.clojure.ClojureServlet
- :extends javax.servlet.http.HttpServlet)
-
-)
diff --git a/tests/examplefiles/genshi_example.xml+genshi b/tests/examplefiles/genshi_example.xml+genshi
deleted file mode 100644
index 8576b042..00000000
--- a/tests/examplefiles/genshi_example.xml+genshi
+++ /dev/null
@@ -1,193 +0,0 @@
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:py="http://genshi.edgewall.org/"
- xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:include href="layout.html" />
- <head>
- <title>$title</title>
- <script type="text/javascript">
- $(document).ready(function() {
- $("#group").change(function() {
- $("#groupdesc").enable(this.selectedIndex != 0)
- }).change();
- });
- </script>
- </head>
-
- <body>
- <div id="ctxtnav" class="nav">
- <ul py:if="report_href">
- <li class="first"><a href="$report_href">Available Reports</a></li>
- <li class="last">Custom Query</li>
- </ul>
- </div>
-
- <py:def function="num_matches(v)">
- <span class="numrows">(${v or 'No'} match${v != 1 and 'es' or ''})</span>
- </py:def>
-
- <div id="content" class="query">
- <h1>$title ${num_matches(len(tickets))}</h1>
-
- <form id="query" method="post" action="${href.query}">
- <fieldset id="filters">
- <legend>Filters</legend>
- <table summary="Query filters">
- <tbody>
- <tr style="height: 1px"><td colspan="4"></td></tr>
- </tbody>
- <py:for each="field_name, field in fields.iteritems()">
- <py:for each="constraint_name, constraint in constraints.iteritems()">
- <tbody py:if="field_name == constraint_name"
- py:with="multiline = field.type in ('select', 'text')">
- <py:for each="constraint_idx, constraint_value in enumerate(constraint['values'])">
- <tr class="${field_name}" py:if="multiline or constraint_idx == 0">
- <py:choose test="constraint_idx">
- <py:when test="0">
- <th scope="row"><label>$field.label</label></th>
- <td py:if="field.type not in ('radio', 'checkbox')" class="mode">
- <select name="${field_name}_mode">
- <option py:for="mode in modes[field.type]" value="$mode.value"
- selected="${mode.value == constraint.mode and 'selected' or None}">$mode.name
- </option>
- </select>
- </td>
- </py:when>
- <py:otherwise><!--! not the first line of a multiline constraint -->
- <th colspan="2"><label>or</label></th>
- </py:otherwise>
- </py:choose>
-
- <td class="filter" colspan="${field.type in ('radio', 'checkbox') and 2 or None}"
- py:choose="field.type">
-
- <py:when test="'select'">
- <select name="${constraint_name}">
- <option></option>
- <option py:for="option in field.options"
- selected="${option == constraint_value and 'selected' or None}">$option
- </option>
- </select>
- </py:when>
-
-
- <py:when test="'radio'">
- <py:for each="option in field.options">
- <input type="checkbox" id="${field_name}_$option" name="${field_name}"
- value="$option"
- checked="${any([(value == option) == (constraint.mode == '')
- for value in constraint['values']]) and 'checked' or None}" />
- <label for="${field_name}_$option">${option or 'none'}</label>
- </py:for>
- </py:when>
-
- <py:when test="'checkbox'">
- <input type="radio" id="${field_name}_on" name="$field_name" value="1"
- checked="${constraint.mode != '!' or None}" />
- <label for="${field_name}_on">yes</label>
- <input type="radio" id="${field_name}_off" name="$field_name" value="0"
- checked="${constraint.mode == '!' or None}" />
- <label for="${field_name}_off">no</label>
- </py:when>
-
- <py:when test="'text'">
- <input type="text" name="${field_name}" value="$constraint_value" size="42" />
- </py:when>
-
- </td>
- <td class="actions"
- py:with="rm_idx = multiline and idx or len(constraint['values'])-1">
- <input type="submit" name="rm_filter_${field_name}${
- field.type != 'radio' and '_%d' % rm_idx or ''}" value="-" />
- </td>
- </tr>
- </py:for>
- </tbody>
- </py:for>
- </py:for>
-
- <tbody>
- <tr class="actions">
- <td class="actions" colspan="4" style="text-align: right">
- <label for="add_filter">Add filter</label>&nbsp;
- <select name="add_filter" id="add_filter">
- <option></option>
- <option py:for="field_name, field in fields.iteritems()"
- value="$field_name"
- disabled="${(field.type == 'radio' and
- constraints[field_name] and
- len(constraints[field_name])) or None}">
- ${field.label}
- </option>
- </select>
- <input type="submit" name="add" value="+" />
- </td>
- </tr>
- </tbody>
- </table>
- </fieldset>
-
- <p class="option">
- <label for="group">Group results by</label>
- <select name="group" id="group">
- <option></option>
- <option py:for="field_name, field in fields.iteritems()"
- py:if="field.type in ('select', 'radio') or field_name == 'owner'"
- selected="${field_name == query.group or None}"
- value="${field_name}">${field.label}</option>
- </select>
- <input type="checkbox" name="groupdesc" id="groupdesc"
- checked="${query.groupdesc or None}" />
- <label for="groupdesc">descending</label>
- </p>
-
- <p class="option">
- <input type="checkbox" name="verbose" id="verbose"
- checked="${query.verbose or None}" />
- <label for="verbose">Show full description under each result</label>
- </p>
-
- <div class="buttons">
- <input type="hidden" name="order" value="$query.order" />
- <input py:if="desc" type="hidden" name="desc" value="1" />
- <input type="submit" name="update" value="Update" />
- </div>
- <hr />
- </form>
-
- <script type="text/javascript">
- var properties={
- <py:for each="idx, (field_name, field) in enumerate(fields.items())">
- $field_name: { type: "$field.type", label: "$field.label"
- <py:if test="field.options">, options: [
- <py:for each="idx, option in enumerate(field.options)">"$option"<py:if
- test="idx &lt; len(field.options)-1">,</py:if>
- </py:for>]
- </py:if>}<py:if test="idx &lt; len(fields)-1">,</py:if>
- </py:for>
- };
- var modes = {
- <py:for each="idx, (type_name, type_modes) in enumerate(modes.items())">
- $type_name: [
- <py:for each="idx, mode in enumerate(type_modes)">
- {text: "$mode.name", value: "$mode.value" }<py:if
- test="idx &lt; len(type_modes)-1">,</py:if>
- </py:for>
- ]<py:if test="idx &lt; len(modes)-1">,</py:if>
- </py:for>
- };
- initializeFilters();
- </script>
-
- <xi:include href="query_div.html" />
-
- <div id="help">
- <strong>Note:</strong> See <a href="${href.wiki('TracQuery')}">TracQuery</a>
- for help on using queries.
- </div>
-
- </div>
- </body>
-</html>
diff --git a/tests/examplefiles/genshitext_example.genshitext b/tests/examplefiles/genshitext_example.genshitext
deleted file mode 100644
index b82708d2..00000000
--- a/tests/examplefiles/genshitext_example.genshitext
+++ /dev/null
@@ -1,33 +0,0 @@
- ## a comment
-
-\## not a comment
-
-#if foo
- ${bar}
-#endif
-
-The answer is:
-#choose
- #when 0 == 1
- 0
- #end
- #when 1 == 1
- 1
- #end
- #otherwise
- 2
- #end
-#end -- comment about choose
-
-#for item in items
- * ${item}
-#end
-
-#def greeting(name)
- Hello, ${name}!
-#end
-${greeting('world')}
-
-#with y=7; z=x+10
- $x $y $z
-#end
diff --git a/tests/examplefiles/glsl.frag b/tests/examplefiles/glsl.frag
deleted file mode 100644
index 132b0353..00000000
--- a/tests/examplefiles/glsl.frag
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Fragment shader */
-void main()
-{
- gl_FragColor[0] = gl_FragCoord[0] / 400.0;
- gl_FragColor[1] = gl_FragCoord[1] / 400.0;
- gl_FragColor[2] = 1.0;
-}
diff --git a/tests/examplefiles/glsl.vert b/tests/examplefiles/glsl.vert
deleted file mode 100644
index 23dc6a6b..00000000
--- a/tests/examplefiles/glsl.vert
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Vertex shader */
-uniform float waveTime;
-uniform float waveWidth;
-uniform float waveHeight;
-
-void main(void)
-{
- vec4 v = vec4(gl_Vertex);
-
- v.z = sin(waveWidth * v.x + waveTime) * cos(waveWidth * v.y + waveTime) * waveHeight;
-
- gl_Position = gl_ModelViewProjectionMatrix * v;
-}
diff --git a/tests/examplefiles/grammar-test.p6 b/tests/examplefiles/grammar-test.p6
deleted file mode 100644
index 28107f3e..00000000
--- a/tests/examplefiles/grammar-test.p6
+++ /dev/null
@@ -1,22 +0,0 @@
-token pod_formatting_code {
- $<code>=<[A..Z]>
- '<' { $*POD_IN_FORMATTINGCODE := 1 }
- $<content>=[ <!before '>'> <pod_string_character> ]+
- '>' { $*POD_IN_FORMATTINGCODE := 0 }
-}
-
-token pod_string {
- <pod_string_character>+
-}
-
-token something:sym«<» {
- <!>
-}
-
-token name {
- <!>
-}
-
-token comment:sym<#> {
- '#' {} \N*
-}
diff --git a/tests/examplefiles/guidance.smv b/tests/examplefiles/guidance.smv
deleted file mode 100644
index 671d1e1c..00000000
--- a/tests/examplefiles/guidance.smv
+++ /dev/null
@@ -1,1124 +0,0 @@
---
--- Shuttle Digital Autopilot
--- by Sergey Berezin (berez@cs.cmu.edu)
---
-MODULE cont_3eo_mode_select(start,smode5,vel,q_bar,apogee_alt_LT_alt_ref,
- h_dot_LT_hdot_reg2,alpha_n_GRT_alpha_reg2,
- delta_r_GRT_del_r_usp,v_horiz_dnrng_LT_0,
- high_rate_sep,meco_confirmed)
-
-VAR cont_3EO_start: boolean;
- RTLS_abort_declared: boolean;
- region_selected : boolean;
- m_mode: {mm102, mm103, mm601};
- r: {reg-1, reg0, reg1, reg2, reg3, reg102};
- step : {1,2,3,4,5,6,7,8,9,10, exit, undef};
-
-ASSIGN
- init(cont_3EO_start) := FALSE;
- init(m_mode) := {mm102, mm103};
- init(region_selected) := FALSE;
- init(RTLS_abort_declared) := FALSE;
- init(r) := reg-1;
- init(step) := undef;
-
- next(step) :=
- case
- step = 1 & m_mode = mm102 : exit;
- step = 1 : 2;
- step = 2 & smode5 : 5;
- step = 2 & vel = GRT_vi_3eo_max: exit;
- step = 2 : 3;
- step = 3 & vel = LEQ_vi_3eo_min : 6;
- step = 3 : 4;
- step = 4 & apogee_alt_LT_alt_ref: exit;
- step = 4 : 6;
- step = 5 : 6;
- step = 6 & r = reg0 : exit;
- step = 6 : 7;
- step = 7 : 8;
- step = 8 & q_bar = GRT_qbar_reg3 & !high_rate_sep : 10;
- step = 8 : 9;
- step = 9 : 10;
- step = 10: exit;
- next(start): 1;
- step = exit : undef;
- TRUE: step;
- esac;
-
- next(cont_3EO_start) :=
- case
- step = 1 & m_mode = mm102 : TRUE;
- step = 10 & meco_confirmed : TRUE;
- TRUE : cont_3EO_start;
- esac;
-
- next(r) :=
- case
- step = 1 & m_mode = mm102 : reg102;
- step = 2 & !smode5 & vel = GRT_vi_3eo_max: reg0;
- step = 4 & apogee_alt_LT_alt_ref: reg0;
- step = 5 & v_horiz_dnrng_LT_0 & delta_r_GRT_del_r_usp : reg0;
- step = 8 & q_bar = GRT_qbar_reg3 & !high_rate_sep : reg3;
- step = 9: case
- (h_dot_LT_hdot_reg2 & alpha_n_GRT_alpha_reg2 &
- q_bar = GRT_qbar_reg1) | high_rate_sep : reg2;
- TRUE : reg1;
- esac;
- next(step) = 1 : reg-1;
- TRUE: r;
- esac;
-
- next(RTLS_abort_declared) :=
- case
- step = 10 & meco_confirmed & m_mode = mm103 : TRUE;
- TRUE: RTLS_abort_declared;
- esac;
-
- next(m_mode) :=
- case
- step = 10 & meco_confirmed & m_mode = mm103 : mm601;
- TRUE: m_mode;
- esac;
-
- next(region_selected) :=
- case
- next(step) = 1 : FALSE;
- next(step) = exit : TRUE;
- TRUE : region_selected;
- esac;
-
-MODULE cont_3eo_guide(start,cont_3EO_start, mode_select_completed, et_sep_cmd,
- h_dot_LT_0, q_bar_a_GRT_qbar_max_sep, m_mode, r0,
- cont_minus_z_compl, t_nav-t_et_sep_GRT_dt_min_z_102,
- ABS_q_orb_GRT_q_minus_z_max, ABS_r_orb_GRT_r_minus_z_max,
- excess_OMS_propellant, q_bar_a_LT_qbar_oms_dump,
- entry_mnvr_couter_LE_0, rcs_all_jet_inhibit,
- alt_GRT_alt_min_102_dump, t_nav-t_gmtlo_LT_t_dmp_last,
- pre_sep, cond_18, q_orb_LT_0, ABS_alf_err_LT_alf_sep_err,
- cond_20b, cond_21, ABS_beta_n_GRT_beta_max, cond_24, cond_26,
- cond_27, cond_29, mm602_OK)
-VAR
- step: {1,a1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
- b20, c20, d20, 21,22,23,24,25,26,27,28,29,exit, undef};
- call_RTLS_abort_task : boolean;
- first3: boolean; -- indicates if it is the first pass
- first8: boolean;
- first27: boolean;
- s_unconv : boolean;
- mode_2_indicator : boolean;
- et_sep_man_initiate : boolean;
- emerg_sep : boolean;
- cont_3eo_pr_delay : {minus_z_reg1, minus_z_reg2,
- minus_z_reg3, minus_z_reg4, minus_z_reg102, 0, 5};
- etsep_y_drift : {undef, minus_z_reg1, minus_z_reg2,
- minus_z_reg3, minus_z_reg4, minus_z_reg102, 0};
- fwd_rcs_dump_enable : boolean;
- fcs_accept_icnct : boolean;
- oms_rcs_i_c_inh_ena_cmd : boolean;
- orbiter_dump_ena : boolean;
- frz_3eo : boolean;
- high_rate_sep: boolean;
- entry_gains : boolean;
- cont_sep_cplt : boolean;
- pch_cmd_reg4 : boolean;
- alpha_ok : boolean;
- r : {reg-1, reg0, reg1, reg2, reg3, reg4, reg102};
- early_sep : boolean;
---------------------------------------------
------ Additional Variables -----------------
---------------------------------------------
- rtls_lo_f_d_delay : {undef, 0};
- wcb2 : {undef, reg1_0, reg2_neg4, wcb2_3eo, reg4_0,
- reg102_undef, post_sep_0};
- q_gcb_i : {undef, quat_reg1, quat_reg2, quat_reg3, quat_reg4,
- quat_reg102_undef, quat_entry_M50_to_cmdbody};
- oms_nz_lim : {undef, oms_nz_lim_3eo, oms_nz_lim_iload, oms_nz_lim_std};
- contingency_nz_lim : {undef, contingency_nz_lim_3eo,
- contingency_nz_lim_iload, contingency_nz_lim_std};
-
-
-
-ASSIGN
- init(entry_gains) := FALSE;
- init(frz_3eo) := FALSE;
- init(cont_3eo_pr_delay) := 5;
- init(etsep_y_drift) := undef;
- init(r) := reg-1;
- init(step) := undef;
- init(call_RTLS_abort_task) := FALSE;
- init(first3) := TRUE;
- init(first8) := TRUE;
- init(first27) := TRUE;
- init(cont_sep_cplt) := FALSE;
- init(et_sep_man_initiate) := FALSE;
- init(alpha_ok) := FALSE;
- init(pch_cmd_reg4) := FALSE;
-
--- Assumed initializations:
-
- init(rtls_lo_f_d_delay) := undef;
- init(wcb2) := undef;
- init(q_gcb_i) := undef;
- init(oms_nz_lim) := undef;
- init(contingency_nz_lim) := undef;
- init(oms_rcs_i_c_inh_ena_cmd) := FALSE;
- init(orbiter_dump_ena) := FALSE;
--- init(early_sep) := FALSE;
-
--------------
-
- next(step) := nextstep;
-
- next(r) :=
- case
- step = a1 & (cont_3EO_start | mode_select_completed) : r0;
- step = 21 & cond_21 : reg4;
- step = 23 & ABS_beta_n_GRT_beta_max & !high_rate_sep : reg1;
- TRUE : r;
- esac;
-
- next(first3) :=
- case
- step = 3 & cont_3EO_start : FALSE;
- TRUE : first3;
- esac;
-
- next(first8) :=
- case
- step = 8 & excess_OMS_propellant & cont_3EO_start : FALSE;
- TRUE : first8;
- esac;
-
- next(first27) :=
- case
- step = 27 : FALSE;
- TRUE: first27;
- esac;
-
- next(s_unconv) :=
- case
- step = 3 : FALSE;
- TRUE : s_unconv;
- esac;
-
- next(call_RTLS_abort_task) :=
- case
- step = 3 : TRUE;
- TRUE : call_RTLS_abort_task;
- esac;
-
- next(mode_2_indicator) :=
- case
- step = 4 : TRUE;
- TRUE : mode_2_indicator;
- esac;
-
- next(et_sep_man_initiate) :=
- case
- step = 5 & h_dot_LT_0 & q_bar_a_GRT_qbar_max_sep & m_mode != mm102 : TRUE;
- step = 14 & pre_sep : TRUE;
- step = 19 & q_orb_LT_0 : TRUE;
- step = d20 : TRUE;
- step = 26 & cond_26 : TRUE;
- step = 29 & cond_29 : TRUE;
- TRUE : et_sep_man_initiate;
- esac;
-
- next(emerg_sep) :=
- case
- next(step) = 1 : FALSE;
- step = 5 & h_dot_LT_0 & q_bar_a_GRT_qbar_max_sep & m_mode != mm102: TRUE;
- TRUE : emerg_sep;
- esac;
-
- next(cont_3eo_pr_delay) :=
- case
- next(step) = 1 : 5;
- step = 5 & h_dot_LT_0 & q_bar_a_GRT_qbar_max_sep & m_mode != mm102 :
- minus_z_reg3;
- step = 7 & !cont_minus_z_compl & r = reg102 &
- t_nav-t_et_sep_GRT_dt_min_z_102 &
- (ABS_q_orb_GRT_q_minus_z_max | ABS_r_orb_GRT_r_minus_z_max) : 0;
- step = 14 & pre_sep : minus_z_reg102;
- step = 19 & q_orb_LT_0 : minus_z_reg4;
- step = d20 : minus_z_reg3;
- step = 26 & cond_26 : minus_z_reg2;
- step = 27 & first27 : minus_z_reg1;
- TRUE : cont_3eo_pr_delay;
- esac;
-
- next(etsep_y_drift) :=
- case
- step = 5 & h_dot_LT_0 & q_bar_a_GRT_qbar_max_sep & m_mode != mm102 :
- minus_z_reg3;
- step = 7 & !cont_minus_z_compl & r = reg102 &
- t_nav-t_et_sep_GRT_dt_min_z_102 &
- (ABS_q_orb_GRT_q_minus_z_max | ABS_r_orb_GRT_r_minus_z_max) : 0;
- step = 14 & pre_sep : minus_z_reg102;
- step = 19 & q_orb_LT_0 : minus_z_reg4;
- step = d20 : minus_z_reg3;
- step = 26 & cond_26 : minus_z_reg2;
- step = 27 & first27 : minus_z_reg1;
- TRUE : etsep_y_drift;
- esac;
-
- next(fwd_rcs_dump_enable) :=
- case
- step = 8 & excess_OMS_propellant & first8 : FALSE;
- TRUE : fwd_rcs_dump_enable;
- esac;
-
- next(fcs_accept_icnct) :=
- case
- step = 9 & q_bar_a_LT_qbar_oms_dump & r != reg102 : TRUE;
- TRUE : fcs_accept_icnct;
- esac;
-
- next(oms_rcs_i_c_inh_ena_cmd) :=
- case
--- next(step) = 1 & oms_rcs_i_c_inh_ena_cmd : {0,1};
- next(step) = 1 & oms_rcs_i_c_inh_ena_cmd : FALSE; -- Assumed initialization
- step = 9 & q_bar_a_LT_qbar_oms_dump & r != reg102 : TRUE;
- TRUE : oms_rcs_i_c_inh_ena_cmd;
- esac;
-
- next(orbiter_dump_ena) :=
- case
- next(start) = TRUE : FALSE; -- Assumed initialization
- step = 9 & q_bar_a_LT_qbar_oms_dump & r != reg102 : TRUE;
- step = 13 & alt_GRT_alt_min_102_dump & t_nav-t_gmtlo_LT_t_dmp_last : TRUE;
- TRUE : orbiter_dump_ena;
- esac;
-
- next(frz_3eo) :=
- case
- next(step) = 1 : FALSE;
- step = 10 & entry_mnvr_couter_LE_0 & !rcs_all_jet_inhibit : FALSE;
- step = 28 & !et_sep_man_initiate : TRUE;
- TRUE : frz_3eo;
- esac;
-
- next(high_rate_sep) :=
- case
- step = 10 & entry_mnvr_couter_LE_0 & !rcs_all_jet_inhibit : FALSE;
- step = 25 : TRUE;
- TRUE : high_rate_sep;
- esac;
-
- next(entry_gains) :=
- case
- next(step) = 1 : FALSE;
- step = 10 & entry_mnvr_couter_LE_0 & !rcs_all_jet_inhibit : TRUE;
- TRUE : entry_gains;
- esac;
-
- next(cont_sep_cplt) :=
- case
- next(step) = 1 : FALSE;
- step = 12 & mm602_OK : TRUE;
- TRUE : cont_sep_cplt;
- esac;
-
- next(pch_cmd_reg4) :=
- case
- next(step) = 1 : FALSE;
- step = 18 & !pch_cmd_reg4 & cond_18 : TRUE;
- TRUE : pch_cmd_reg4;
- esac;
-
- next(alpha_ok) :=
- case
- next(step) = 1 : FALSE;
- step = 20 & ABS_alf_err_LT_alf_sep_err : TRUE;
- TRUE : alpha_ok;
- esac;
-
- next(early_sep) :=
- case
- step = 27 & first27 :
- case
- cond_27 : TRUE;
- TRUE : FALSE;
- esac;
- TRUE : early_sep;
- esac;
-
---------------------------------------------
------ Additional Variables -----------------
---------------------------------------------
-
- next(rtls_lo_f_d_delay) :=
- case
- next(start) = TRUE : undef; -- Assumed initialization
- step = 8 & first8 & excess_OMS_propellant : 0;
- TRUE : rtls_lo_f_d_delay;
- esac;
-
- next(wcb2) :=
- case
- next(start) = TRUE : undef; -- Assumed initialization
- step = 10 & entry_mnvr_couter_LE_0 : post_sep_0;
- step = 12 : case
- r = reg4 : reg4_0;
- TRUE : wcb2_3eo;
- esac;
- step = 14 & pre_sep : reg102_undef;
- step = 15 : case
- r = reg4 : reg4_0;
- TRUE : wcb2_3eo;
- esac;
- step = 25 : reg2_neg4;
- TRUE : wcb2;
- esac;
-
- next(q_gcb_i) :=
- case
- next(start) = TRUE : undef; -- Assumed initialization
- step = 11 : quat_entry_M50_to_cmdbody;
- step = 14 & pre_sep : quat_reg102_undef;
- step = 16 : case
- r = reg4 : quat_reg4;
- TRUE : quat_reg3;
- esac;
- step = 22 : quat_reg2;
-
--- Without this step the value "quat_reg2" would remain in "reg1":
--- step = 23 & ABS_beta_n_GRT_beta_max & !high_rate_sep : undef;
-
- TRUE : q_gcb_i;
- esac;
-
- next(oms_nz_lim) :=
- case
- next(start) = TRUE : undef; -- Assumed initialization
- step = 9 & q_bar_a_LT_qbar_oms_dump & r != reg102 : oms_nz_lim_3eo;
- step = 12 & mm602_OK : oms_nz_lim_std;
- TRUE : oms_nz_lim;
- esac;
-
- next(contingency_nz_lim) :=
- case
- next(start) = TRUE : undef; -- Assumed initialization
- step = 9 & q_bar_a_LT_qbar_oms_dump & r != reg102 :
- contingency_nz_lim_3eo;
- step = 12 & mm602_OK : contingency_nz_lim_std;
- TRUE : contingency_nz_lim;
- esac;
-
-DEFINE
- finished := step = exit;
- idle := step = undef;
-
- start_cont_3eo_mode_select :=
- case
- step = 1 & !cont_3EO_start : TRUE;
- TRUE : FALSE;
- esac;
-
- nextstep :=
- case
- step = 1 : a1;
- step = a1 : case
- (cont_3EO_start | mode_select_completed) : 2;
- TRUE : step;
- esac;
- step = 2 : case
- !cont_3EO_start : exit;
- first3 : 3;
- TRUE: 4;
- esac;
- step = 3 : 4;
- step = 4 : case
- et_sep_cmd : 7;
- TRUE : 5;
- esac;
- step = 5 : case
- h_dot_LT_0 & q_bar_a_GRT_qbar_max_sep &
- m_mode != mm102 : exit;
- TRUE : 6;
- esac;
- step = 6 :
- case
- r = reg102 : 13;
- r in {reg3, reg4} : 15;
- r = reg2 : 22;
- r = reg1 : 27;
- TRUE : exit;
- esac;
- step = 7 : case
- cont_minus_z_compl : 8;
- TRUE : exit;
- esac;
- step = 8 : case
- excess_OMS_propellant & first8 : 9;
- TRUE : 10;
- esac;
- step = 9 : exit;
- step = 10 : case
- !entry_mnvr_couter_LE_0 | rcs_all_jet_inhibit : exit;
- TRUE : 11;
- esac;
- step = 11 : 12;
- step = 12 : exit;
- step = 13 : 14;
- step = 14 : exit;
- step = 15 : 16;
- step = 16 : 17;
- step = 17 : case
- r = reg4 : 18;
- TRUE : 20;
- esac;
- step = 18 : case
- pch_cmd_reg4 | cond_18 : 19;
- TRUE : exit;
- esac;
- step = 19 : exit;
- step = 20 : case
- ABS_alf_err_LT_alf_sep_err : b20;
- TRUE : c20;
- esac;
- step = b20 : case
- cond_20b : d20;
- TRUE : exit;
- esac;
- step = c20 : case
- alpha_ok : d20;
- TRUE : 21;
- esac;
- step = d20 : exit;
- TRUE : nextstep21;
- esac;
-
- nextstep21 :=
- case
- step = 21 : case
- cond_21 : 15;
- TRUE : exit;
- esac;
- step = 22 : 23;
- step = 23 : case
- ABS_beta_n_GRT_beta_max & !high_rate_sep : 27;
- TRUE : 24;
- esac;
- step = 24 : case
- cond_24 | high_rate_sep : 25;
- TRUE : exit;
- esac;
- step = 25 : 26;
- step = 26 : exit;
- step = 27 : 28;
- step = 28 : case
- !et_sep_man_initiate : 29;
- TRUE : exit;
- esac;
- step = 29 : exit;
- start : 1;
- step = exit : undef;
- TRUE : step;
- esac;
-
- post_sep_mode := step in {7,8,9,10,11,12};
-
-------------------------------------------------------------------
-------------------------------------------------------------------
-
-MODULE main
-VAR
- smode5: boolean;
- vel : {GRT_vi_3eo_max, GRT_vi_3eo_min, LEQ_vi_3eo_min};
- q_bar: {GRT_qbar_reg3, GRT_qbar_reg1, LEQ_qbar_reg1};
- q_bar_a_GRT_qbar_max_sep : boolean;
- q_bar_a_LT_qbar_oms_dump : boolean;
- apogee_alt_LT_alt_ref : boolean;
- h_dot_LT_hdot_reg2 : boolean;
- h_dot_LT_0 : boolean;
- alpha_n_GRT_alpha_reg2 : boolean;
- delta_r_GRT_del_r_usp : boolean;
- v_horiz_dnrng_LT_0: boolean;
- meco_confirmed: boolean;
- et_sep_cmd : boolean;
- cont_minus_z_compl : boolean;
- t_nav-t_et_sep_GRT_dt_min_z_102 : boolean;
- ABS_q_orb_GRT_q_minus_z_max : boolean;
- ABS_r_orb_GRT_r_minus_z_max : boolean;
- excess_OMS_propellant : boolean;
- entry_mnvr_couter_LE_0 : boolean;
- rcs_all_jet_inhibit : boolean;
- alt_GRT_alt_min_102_dump : boolean;
- t_nav-t_gmtlo_LT_t_dmp_last : boolean;
- pre_sep : boolean;
- cond_18 : boolean;
- q_orb_LT_0 : boolean;
- ABS_alf_err_LT_alf_sep_err : boolean;
- cond_20b : boolean;
- cond_21 : boolean;
- ABS_beta_n_GRT_beta_max : boolean;
- cond_24 : boolean;
- cond_26 : boolean;
- cond_27 : boolean;
- cond_29 : boolean;
- mm602_OK : boolean;
- start_guide : boolean;
- mated_coast_mnvr : boolean;
-
- cs: cont_3eo_mode_select(cg.start_cont_3eo_mode_select,
- smode5,vel,q_bar,apogee_alt_LT_alt_ref,
- h_dot_LT_hdot_reg2,alpha_n_GRT_alpha_reg2,
- delta_r_GRT_del_r_usp,v_horiz_dnrng_LT_0,
- cg.high_rate_sep,meco_confirmed);
-
- cg: cont_3eo_guide(start_guide,
- cs.cont_3EO_start, cs.region_selected, et_sep_cmd,
- h_dot_LT_0, q_bar_a_GRT_qbar_max_sep, cs.m_mode, cs.r,
- cont_minus_z_compl, t_nav-t_et_sep_GRT_dt_min_z_102,
- ABS_q_orb_GRT_q_minus_z_max, ABS_r_orb_GRT_r_minus_z_max,
- excess_OMS_propellant, q_bar_a_LT_qbar_oms_dump,
- entry_mnvr_couter_LE_0, rcs_all_jet_inhibit,
- alt_GRT_alt_min_102_dump, t_nav-t_gmtlo_LT_t_dmp_last,
- pre_sep, cond_18, q_orb_LT_0, ABS_alf_err_LT_alf_sep_err,
- cond_20b, cond_21, ABS_beta_n_GRT_beta_max, cond_24, cond_26,
- cond_27, cond_29, mm602_OK);
-
-ASSIGN
- init(start_guide) := FALSE;
- init(mated_coast_mnvr) := FALSE;
-
- next(entry_mnvr_couter_LE_0) :=
- case
- !entry_mnvr_couter_LE_0 : {FALSE, TRUE};
- TRUE : TRUE;
- esac;
-
----------------------------------------------------------------------
----------------------------------------------------------------------
- next(start_guide) :=
- case
- start_guide : FALSE;
- !cg.idle : FALSE;
- TRUE : {FALSE, TRUE};
- esac;
-
- next(smode5) :=
- case
- fixed_values : smode5;
- cg.idle : { FALSE, TRUE };
- TRUE : smode5;
- esac;
-
- next(vel) :=
- case
- fixed_values : vel;
- cg.idle : {GRT_vi_3eo_max, GRT_vi_3eo_min, LEQ_vi_3eo_min};
- TRUE : vel;
- esac;
-
- next(q_bar) :=
- case
- fixed_values : q_bar;
- cg.idle : {GRT_qbar_reg3, GRT_qbar_reg1, LEQ_qbar_reg1};
- TRUE : q_bar;
- esac;
-
- next(q_bar_a_GRT_qbar_max_sep) :=
- case
- fixed_values : q_bar_a_GRT_qbar_max_sep;
- cg.idle : { FALSE, TRUE };
- TRUE : q_bar_a_GRT_qbar_max_sep;
- esac;
-
- next(apogee_alt_LT_alt_ref) :=
- case
- fixed_values : apogee_alt_LT_alt_ref;
- cg.idle : { FALSE, TRUE };
- TRUE : apogee_alt_LT_alt_ref;
- esac;
-
- next(h_dot_LT_hdot_reg2) :=
- case
- fixed_values : h_dot_LT_hdot_reg2;
- cg.idle : { FALSE, TRUE };
- TRUE : h_dot_LT_hdot_reg2;
- esac;
-
- next(h_dot_LT_0) :=
- case
- fixed_values : h_dot_LT_0;
- cg.idle : { FALSE, TRUE };
- TRUE : h_dot_LT_0;
- esac;
-
- next(alpha_n_GRT_alpha_reg2) :=
- case
- fixed_values : alpha_n_GRT_alpha_reg2;
- cg.idle : { FALSE, TRUE };
- TRUE : alpha_n_GRT_alpha_reg2;
- esac;
-
- next(delta_r_GRT_del_r_usp) :=
- case
- fixed_values : delta_r_GRT_del_r_usp;
- cg.idle : { FALSE, TRUE };
- TRUE : delta_r_GRT_del_r_usp;
- esac;
-
- next(v_horiz_dnrng_LT_0) :=
- case
- fixed_values : v_horiz_dnrng_LT_0;
- cg.idle : { FALSE, TRUE };
- TRUE : v_horiz_dnrng_LT_0;
- esac;
-
- next(meco_confirmed) :=
- case
- fixed_values : meco_confirmed;
- meco_confirmed : TRUE;
- cg.idle : { FALSE, TRUE };
- TRUE : meco_confirmed;
- esac;
-
- next(et_sep_cmd) :=
- case
- fixed_values : et_sep_cmd;
- et_sep_cmd : TRUE;
- cg.idle : { FALSE, TRUE };
- TRUE : et_sep_cmd;
- esac;
-
- next(cont_minus_z_compl) :=
- case
- fixed_values : cont_minus_z_compl;
- cg.idle : { FALSE, TRUE };
- TRUE : cont_minus_z_compl;
- esac;
-
- next(t_nav-t_et_sep_GRT_dt_min_z_102) :=
- case
- fixed_values : t_nav-t_et_sep_GRT_dt_min_z_102;
- cg.idle : { FALSE, TRUE };
- TRUE : t_nav-t_et_sep_GRT_dt_min_z_102;
- esac;
-
- next(ABS_q_orb_GRT_q_minus_z_max) :=
- case
- fixed_values : ABS_q_orb_GRT_q_minus_z_max;
- cg.idle : { FALSE, TRUE };
- TRUE : ABS_q_orb_GRT_q_minus_z_max;
- esac;
-
- next(ABS_r_orb_GRT_r_minus_z_max) :=
- case
- fixed_values : ABS_r_orb_GRT_r_minus_z_max;
- cg.idle : { FALSE, TRUE };
- TRUE : ABS_r_orb_GRT_r_minus_z_max;
- esac;
-
- next(excess_OMS_propellant) :=
- case
- fixed_values : excess_OMS_propellant;
- cg.idle & excess_OMS_propellant : { FALSE, TRUE };
- TRUE : excess_OMS_propellant;
- esac;
-
- next(q_bar_a_LT_qbar_oms_dump) :=
- case
- fixed_values : q_bar_a_LT_qbar_oms_dump;
- cg.idle : { FALSE, TRUE };
- TRUE : q_bar_a_LT_qbar_oms_dump;
- esac;
-
- next(rcs_all_jet_inhibit) :=
- case
- fixed_values : rcs_all_jet_inhibit;
- cg.idle : { FALSE, TRUE };
- TRUE : rcs_all_jet_inhibit;
- esac;
-
- next(alt_GRT_alt_min_102_dump) :=
- case
- fixed_values : alt_GRT_alt_min_102_dump;
- cg.idle : { FALSE, TRUE };
- TRUE : alt_GRT_alt_min_102_dump;
- esac;
-
- next(t_nav-t_gmtlo_LT_t_dmp_last) :=
- case
- fixed_values : t_nav-t_gmtlo_LT_t_dmp_last;
- cg.idle : { FALSE, TRUE };
- TRUE : t_nav-t_gmtlo_LT_t_dmp_last;
- esac;
-
- next(pre_sep) :=
- case
- fixed_values : pre_sep;
- cg.idle : { FALSE, TRUE };
- TRUE : pre_sep;
- esac;
-
- next(cond_18) :=
- case
- fixed_values : cond_18;
- cg.idle : { FALSE, TRUE };
- TRUE : cond_18;
- esac;
-
- next(q_orb_LT_0) :=
- case
- fixed_values : q_orb_LT_0;
- cg.idle : { FALSE, TRUE };
- TRUE : q_orb_LT_0;
- esac;
-
- next(ABS_alf_err_LT_alf_sep_err) :=
- case
- fixed_values : ABS_alf_err_LT_alf_sep_err;
- cg.idle : { FALSE, TRUE };
- TRUE : ABS_alf_err_LT_alf_sep_err;
- esac;
-
- next(cond_20b) :=
- case
- fixed_values : cond_20b;
- cg.idle : { FALSE, TRUE };
- TRUE : cond_20b;
- esac;
-
- next(cond_21) :=
- case
- fixed_values : cond_21;
- cg.idle : { FALSE, TRUE };
- TRUE : cond_21;
- esac;
-
- next(ABS_beta_n_GRT_beta_max) :=
- case
- fixed_values : ABS_beta_n_GRT_beta_max;
- cg.idle : { FALSE, TRUE };
- TRUE : ABS_beta_n_GRT_beta_max;
- esac;
-
- next(cond_24) :=
- case
- fixed_values : cond_24;
- cg.idle : { FALSE, TRUE };
- TRUE : cond_24;
- esac;
-
- next(cond_26) :=
- case
- fixed_values : cond_26;
- cg.idle : { FALSE, TRUE };
- TRUE : cond_26;
- esac;
-
- next(cond_27) :=
- case
- fixed_values : cond_27;
- cg.idle : { FALSE, TRUE };
- TRUE : cond_27;
- esac;
-
- next(cond_29) :=
- case
- fixed_values : cond_29;
- cg.idle : { FALSE, TRUE };
- TRUE : cond_29;
- esac;
-
- next(mm602_OK) :=
- case
- fixed_values : mm602_OK;
- cg.idle : { FALSE, TRUE };
- TRUE : mm602_OK;
- esac;
-
- next(mated_coast_mnvr) :=
- case
- next(cg.step) = 1 : FALSE;
- cg.step = 6 & cg.r in {reg1, reg2, reg3, reg4, reg102} : TRUE;
- TRUE : mated_coast_mnvr;
- esac;
-
----------------------------------------------------------------------
----------------------------------------------------------------------
-DEFINE
- fixed_values := FALSE;
-
- output_ok :=
- case
- cg.q_gcb_i = undef | cg.wcb2 = undef |
- cg.cont_3eo_pr_delay = 5 |
- cg.etsep_y_drift = undef :
- case
- !mated_coast_mnvr: 1;
- TRUE : undef;
- esac;
- !mated_coast_mnvr: toint(cg.q_gcb_i = quat_entry_M50_to_cmdbody &
- cg.wcb2 = post_sep_0);
--- reg1 never happens?
--- cg.r = reg1 : (cg.q_gcb_i = quat_reg1 & cg.wcb2 = reg1_0 &
--- cg.cont_3eo_pr_delay = minus_z_reg1 &
--- cg.etsep_y_drift = minus_z_reg1) | cg.emerg_sep;
- cg.r = reg2 : toint((cg.q_gcb_i = quat_reg2 & cg.wcb2 = reg2_neg4 &
- cg.cont_3eo_pr_delay = minus_z_reg2 &
- cg.etsep_y_drift = minus_z_reg2) | cg.emerg_sep);
-
- cg.r = reg3 : toint((cg.q_gcb_i = quat_reg3 & cg.wcb2 = wcb2_3eo &
- cg.cont_3eo_pr_delay = minus_z_reg3 &
- cg.etsep_y_drift = minus_z_reg3) | cg.emerg_sep);
- cg.r = reg4 : toint((cg.q_gcb_i = quat_reg4 & cg.wcb2 = reg4_0 &
- cg.cont_3eo_pr_delay = minus_z_reg4 &
- cg.etsep_y_drift = minus_z_reg4) | cg.emerg_sep);
- cg.r = reg102 : toint((cg.q_gcb_i = quat_reg102_undef &
- cg.wcb2 = reg102_undef &
- cg.cont_3eo_pr_delay = minus_z_reg102 &
- cg.etsep_y_drift = minus_z_reg102) | cg.emerg_sep);
- TRUE : 0;
- esac;
-
----------------------------------------------------------------------
--------- Specifications ---------------------------------------------
----------------------------------------------------------------------
-
--- Contingency Guide terminates
-
-SPEC AG(!cg.idle -> AF(cg.finished))
-
--- Contingency guide can be executed infinitely often
-
-SPEC AG( (cg.idle | cg.finished) ->
- EF(!(cg.idle | cg.finished) & EF(cg.finished)))
-
--- Contingency mode select task works fine
-
-SPEC AG(cs.cont_3EO_start & cs.region_selected ->
- ((cs.m_mode = mm102 | meco_confirmed) &
- cs.r != reg-1 & cs.r != reg0))
-
--- Bad (initial) value never happens again once region is computed
--- unless we restart the task
-
---SPEC AG(cs.r != reg-1 -> !E[!cg.start_cont_3eo_mode_select U
--- cs.r = reg-1 & !cg.start_cont_3eo_mode_select])
-
--- Comment out each of the regions and see if this is still true
--- (Check, if ALL of the regions can happen)
-
---SPEC AG(cs.r in {reg-1
--- ,reg0
--- ,reg1
--- ,reg2
--- ,reg3
--- ,reg102
--- })
-
--- Comment out each of the regions and see if this is still true
--- (Check, if ALL of the regions can happen)
-
---SPEC AG(cg.r in {reg-1
--- ,reg0
--- ,reg1
--- ,reg2
--- ,reg3
--- ,reg4
--- ,reg102
--- })
-
--- Mode_select starts at the next step after its "start" bit is set:
-
---SPEC AG(!cg.start_cont_3eo_mode_select ->
--- AX(cg.start_cont_3eo_mode_select & cs.step in {exit, undef} ->
--- AX(cs.step = 1 & !cs.region_selected)))
-
--- During major mode 103, the inertial velocity is monitored.
--- Below an I-loaded velocity, a MECO would constitute a contingency
--- abort. (Must NOT be in SMODE=5 (??))
-
-SPEC AG(cg.start_cont_3eo_mode_select & cs.m_mode = mm103 &
- vel = LEQ_vi_3eo_min & meco_confirmed & !smode5 ->
- A[!cs.region_selected U cs.region_selected & cs.cont_3EO_start])
-
--- Above a certain inertial velocity (in mode 103), the 3E/O field
--- is blanked, indicating that a MECO at this point would not require
--- an OPS 6 contingency abort.
-
-SPEC AG(cs.region_selected ->
- (cs.m_mode = mm103 & vel = GRT_vi_3eo_max -> !cs.cont_3EO_start))
-
--- Between the two velocities, an apogee altitude - velocity curve is
--- constructed based on the current inertial velocity. If the apogee
--- altitude is above this curve, a contingency abort capability is
--- still required and a 3E/O region index will be calculated.
--- Otherwise, the 3E/O field is blanked out and no further contingency
--- abort calculations will be performed. (Must NOT be in SMODE=5 (??))
-
-SPEC AG(cg.start_cont_3eo_mode_select & cs.m_mode = mm103 &
- vel = GRT_vi_3eo_min & meco_confirmed & !smode5 ->
- A[!cs.region_selected U cs.region_selected &
- apogee_alt_LT_alt_ref = !cs.cont_3EO_start])
-
--- For an RTLS trajectory (SMODE=5), a check is made on the downrange
--- velocity to see if the vehicle is heading away from the landing site.
--- If this is the case, a 3E/O region index is calculated. If the vehicle
--- is heading back to the landing site, and the current range to the MECO
--- R-V line is greater than an I-loaded value, a 3E/O region index is
--- calculated. Otherwise, an intact abort is possible and the 3E/O field
--- is blanked.
-
-SPEC AG(cg.start_cont_3eo_mode_select & smode5 & meco_confirmed &
- (!v_horiz_dnrng_LT_0 | !delta_r_GRT_del_r_usp) ->
- A[!cs.region_selected U cs.region_selected & cs.cont_3EO_start])
-
--- If this task is called prior to SRB separation [mm102], the 3E/O region
--- index is set to 102 and the 3E/O contingency flag is set.
-
-SPEC AG(cs.m_mode = mm102 & cg.start_cont_3eo_mode_select ->
- AX (A [ !cs.region_selected U cs.region_selected &
- cs.r = reg102 & cs.cont_3EO_start]))
-
--- After SRB separation, on every pass that the 3E/O region index is
--- calculated, a check is made to see if MECO confirmed has occured. If
--- so, a check is made to see if the major mode is 103. If so, an RTLS is
--- automatically invoked to transition to major mode 601.
-
-SPEC AG(!cs.region_selected & cs.m_mode = mm103 & meco_confirmed ->
- A[!cs.region_selected U cs.region_selected & cs.r != reg0 ->
- cs.m_mode = mm601 & cs.RTLS_abort_declared])
-
--- Once the 3E/O contingency flag has been set, this task is no longer
--- executed.
-
-SPEC AG(cs.cont_3EO_start -> AG(!cg.start_cont_3eo_mode_select))
-
--- If MECO confirmed occurs in MM103 and an OPS 6 contingency abort
--- procedure is still required, contingency 3E/O guidance sets the
--- CONT_3EO_START flag ON. Contingency 3E/O guidance then switches
--- from its display support function into an actual auto guidance
--- steering process. [...] Contingency 3E/O guidance sets the RTLS abort
--- declared flag and the MSC performs the transition from from major mode
--- 103 to 601.
-
-SPEC AG(!cg.idle & !cg.finished & !cs.region_selected & cs.m_mode = mm103 ->
- A[ !cg.finished U cg.finished & cs.region_selected &
- (cs.cont_3EO_start -> cs.m_mode = mm601 & cs.RTLS_abort_declared) ])
-
--- If MECO confirmed occurs in a major mode 601 and a contingency abort
--- procedure is still required, contingency 3E/O guidance sets the
--- CONT_3EO_START flag ON. [...] Contingency 3E/O guidance then commands
--- 3E/O auto maneuvers in major mode 601. [What are these maneuvers??]
-
-SPEC AG(cg.finished & cs.m_mode = mm601 & !et_sep_cmd &
- meco_confirmed & cs.cont_3EO_start ->
- cg.q_gcb_i in {quat_reg1, quat_reg2, quat_reg3, quat_reg4, undef}
- | cg.emerg_sep)
-
--- If MECO confirmed occurs in a first stage (MM102) [...], contingency
--- 3E/O guidance will command a fast ET separation during SRB tailoff in
--- major mode 102. CONT 3E/O GUID will then command maneuver post-sep in
--- MM601 (???). [ I'm not sure what indicates fast ET sep.: emerg_sep or
--- early_sep, or what? ]
-
-SPEC AG(cg.finished & cs.m_mode = mm102 & meco_confirmed & pre_sep ->
- cg.emerg_sep | et_sep_cmd
- | cg.et_sep_man_initiate
- | cg.early_sep
- )
-
----------------------------------------------
--- Invariants from Murphi code --------------
----------------------------------------------
-
---SPEC AG(cg.finished -> (output_ok != 0 | (output_ok = undef &
--- (cg.emerg_sep | !cg.cont_sep_cplt))))
-
---SPEC AG(!cg.finished & !cg.idle -> !mated_coast_mnvr | !et_sep_cmd)
-
--- Stronger version !!!
-
-SPEC AG(cg.finished -> output_ok != 0)
-
--- Contingency Guidance shall command an ET separation
--- [under certain conditions :-].
-
-SPEC AG(cs.cont_3EO_start & cg.finished &
- (cg.r = reg1 -> cond_29) &
- (cg.r = reg2 -> cond_24 & cond_26) &
- (cg.r = reg3 -> cg.alpha_ok &
- (ABS_alf_err_LT_alf_sep_err -> cond_20b)) &
- (cg.r = reg4 -> cond_18 & q_orb_LT_0) &
- (cg.r = reg102 -> pre_sep) ->
- et_sep_cmd | cg.et_sep_man_initiate
- | cg.early_sep
- | cg.emerg_sep
- )
-
--- Contingency Guidance shall command at most one interconnected OMS dump.
-
-SPEC AG(cg.finished & cg.oms_rcs_i_c_inh_ena_cmd ->
- AG(!cg.oms_rcs_i_c_inh_ena_cmd -> AG(!cg.oms_rcs_i_c_inh_ena_cmd)))
-
--- Contingency Guidance shall command a transition to glide RTLS
--- (flight mode 602)
-
-SPEC AG(cg.finished & cs.m_mode = mm601 ->
- --cg.cont_sep_cplt | cg.emerg_sep |
- cg.call_RTLS_abort_task)
-
--- Paper, p. 28, unstated assumption 2: at step 6 the region is
--- among 102, 1-4.
-
-SPEC AG(cg.step = 6 -> cg.r in {reg102, reg1, reg2, reg3, reg4})
-
--- The transition to mode 602 shall not occur until the entry maneuver
--- has been calculated
-
-SPEC !E[cg.q_gcb_i = undef U cg.cont_sep_cplt & cg.q_gcb_i = undef]
-
--- The entry maneuver calculations shall not commence until the OMS/RCS
--- interconnect, if any, is complete (??? What does it exactly mean???)
--- !!!
---SPEC AG(cg.oms_rcs_i_c_inh_ena_cmd ->
--- !E[cg.oms_rcs_i_c_inh_ena_cmd U
--- cg.q_gcb_i != undef & cg.oms_rcs_i_c_inh_ena_cmd])
-
-SPEC AG(cg.oms_rcs_i_c_inh_ena_cmd ->
- !E[rcs_all_jet_inhibit U
- cg.q_gcb_i != undef & rcs_all_jet_inhibit])
-
--- The OMS dump shall not be considered until the -Z translation is complete.
-
-SPEC !E[!cont_minus_z_compl & cg.r != reg102 U cg.orbiter_dump_ena]
-
--- Completion of -Z translation shall not be checked until ET separation
--- has been commanded
-
-SPEC !E[!et_sep_cmd U cg.step = 7]
-
--- ET separation shall be commanded if and only if an abort maneuver
--- region is assigned [and again there are *certain conditions*].
-
-SPEC AG(cg.finished & cs.cont_3EO_start &
- (cg.r = reg1 -> cond_29) &
- (cg.r = reg2 -> cond_24 & cond_26) &
- (cg.r = reg3 -> cg.alpha_ok &
- (ABS_alf_err_LT_alf_sep_err -> cond_20b)) &
- (cg.r = reg4 -> cond_18 & q_orb_LT_0) &
- (cg.r = reg102 -> pre_sep) ->
- (cg.et_sep_man_initiate | et_sep_cmd
- <-> cg.r in {reg1, reg2, reg3, reg4, reg102}))
-
--- The assigned region can not change arbitrarily.
-
--- Regions 1 and 2 may interchange, but will not switch to any other region:
-
-SPEC AG(cg.finished & cs.cont_3EO_start & cg.r in {reg1,reg2} ->
- AG(cg.finished -> cg.r in {reg1,reg2}))
-
--- Regions 3 and 4 may interchange, but will not switch to any other region:
-
-SPEC AG(cg.finished & cs.cont_3EO_start & cg.r in {reg3,reg4} ->
- AG(cg.finished -> cg.r in {reg3,reg4}))
-
--- Region 102 never changes:
-
-SPEC AG(cg.finished & cg.r = reg102 -> AG(cg.finished -> cg.r = reg102))
diff --git a/tests/examplefiles/hash_syntax.rb b/tests/examplefiles/hash_syntax.rb
deleted file mode 100644
index 35b27723..00000000
--- a/tests/examplefiles/hash_syntax.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-{ :old_syntax => 'ok' }
-{ 'stings as key' => 'should be ok' }
-{ new_syntax: 'broken until now' }
-{ withoutunderscore: 'should be ok' }
-{ _underscoreinfront: 'might be ok, if I understand the pygments code correct' }
diff --git a/tests/examplefiles/hello-world.puzzlet.aheui b/tests/examplefiles/hello-world.puzzlet.aheui
deleted file mode 100644
index e7ef3a62..00000000
--- a/tests/examplefiles/hello-world.puzzlet.aheui
+++ /dev/null
@@ -1,10 +0,0 @@
-밤밣따빠밣밟따뿌
-빠맣파빨받밤뚜뭏
-돋밬탕빠맣붏두붇
-볻뫃박발뚷투뭏붖
-뫃도뫃희멓뭏뭏붘
-뫃봌토범더벌뿌뚜
-뽑뽀멓멓더벓뻐뚠
-뽀덩벐멓뻐덕더벅
-
-https://github.com/aheui/snippets/blob/master/hello-world/hello-world.puzzlet.aheui
diff --git a/tests/examplefiles/hello.at b/tests/examplefiles/hello.at
deleted file mode 100644
index 23af2f2d..00000000
--- a/tests/examplefiles/hello.at
+++ /dev/null
@@ -1,6 +0,0 @@
-def me := object: {
- def name := "Kevin";
- def sayHello(peerName) {
- system.println(peerName + " says hello!");
- };
-};
diff --git a/tests/examplefiles/hello.golo b/tests/examplefiles/hello.golo
deleted file mode 100644
index 7e8ca214..00000000
--- a/tests/examplefiles/hello.golo
+++ /dev/null
@@ -1,5 +0,0 @@
-module hello.World
-
-function main = |args| {
- println("Hello world!")
-}
diff --git a/tests/examplefiles/hello.lsl b/tests/examplefiles/hello.lsl
deleted file mode 100644
index 61697e7f..00000000
--- a/tests/examplefiles/hello.lsl
+++ /dev/null
@@ -1,12 +0,0 @@
-default
-{
- state_entry()
- {
- llSay(0, "Hello, Avatar!");
- }
-
- touch_start(integer total_number)
- {
- llSay(0, "Touched.");
- }
-}
diff --git a/tests/examplefiles/hello.smali b/tests/examplefiles/hello.smali
deleted file mode 100644
index e539f00e..00000000
--- a/tests/examplefiles/hello.smali
+++ /dev/null
@@ -1,40 +0,0 @@
-# To Recreate:
-#
-# echo -e 'class hello {\n public static void main(String[] args) {\n
-# System.out.println("hi");\n }\n}\n' > hello.java
-# javac -target 1.4 -source 1.4 hello.java
-# dx --dex --output=hello.dex hello.class
-# baksmali hello.dex
-# cat out/hello.smali
-
-.class Lhello;
-.super Ljava/lang/Object;
-.source "hello.java"
-
-
-# direct methods
-.method constructor <init>()V
- .registers 1
-
- .prologue
- .line 1
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
-
- return-void
-.end method
-
-.method public static main([Ljava/lang/String;)V
- .registers 3
- .parameter
-
- .prologue
- .line 3
- sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
-
- const-string v1, "hi"
-
- invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
-
- .line 4
- return-void
-.end method
diff --git a/tests/examplefiles/hello.sp b/tests/examplefiles/hello.sp
deleted file mode 100644
index 7102d273..00000000
--- a/tests/examplefiles/hello.sp
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sourcemod>
-
-// Single line comment
-/* Multi line
- comment */
-
-public OnPluginStart() {
- PrintToServer("Hello.");
-}
diff --git a/tests/examplefiles/hexdump_debugexe b/tests/examplefiles/hexdump_debugexe
deleted file mode 100644
index 31fefdb7..00000000
--- a/tests/examplefiles/hexdump_debugexe
+++ /dev/null
@@ -1,309 +0,0 @@
-0000:0000 2F 2F 20 43 72 65 61 74-65 64 20 62 79 20 4C 69 // Created by Li
-0000:0010 6F 6E 65 6C 6C 6F 20 4C-75 6E 65 73 75 20 61 6E onello Lunesu an
-0000:0020 64 20 70 6C 61 63 65 64-20 69 6E 20 74 68 65 20 d placed in the
-0000:0030 70 75 62 6C 69 63 20 64-6F 6D 61 69 6E 2E 0A 2F public domain.◙/
-0000:0040 2F 20 54 68 69 73 20 66-69 6C 65 20 68 61 73 20 / This file has
-0000:0050 62 65 65 6E 20 6D 6F 64-69 66 69 65 64 20 66 72 been modified fr
-0000:0060 6F 6D 20 69 74 73 20 6F-72 69 67 69 6E 61 6C 20 om its original
-0000:0070 76 65 72 73 69 6F 6E 2E-0A 2F 2F 20 49 74 20 68 version.◙// It h
-0000:0080 61 73 20 62 65 65 6E 20-66 6F 72 6D 61 74 74 65 as been formatte
-0000:0090 64 20 74 6F 20 66 69 74-20 79 6F 75 72 20 73 63 d to fit your sc
-0000:00A0 72 65 65 6E 2E 0A 6D 6F-64 75 6C 65 20 70 68 6F reen.◙module pho
-0000:00B0 6E 65 6E 6F 3B 20 20 20-20 20 2F 2F 20 6F 70 74 neno; // opt
-0000:00C0 69 6F 6E 61 6C 0A 69 6D-70 6F 72 74 20 73 74 64 ional◙import std
-0000:00D0 2E 73 74 64 69 6F 3B 20-20 20 2F 2F 20 77 72 69 .stdio; // wri
-0000:00E0 74 65 66 6C 6E 20 20 20-20 20 0A 69 6D 70 6F 72 tefln ◙impor
-0000:00F0 74 20 73 74 64 2E 63 74-79 70 65 3B 20 20 20 2F t std.ctype; /
-0000:0100 2F 20 69 73 64 69 67 69-74 20 20 20 20 20 0A 69 / isdigit ◙i
-0000:0110 6D 70 6F 72 74 20 73 74-64 2E 73 74 72 65 61 6D mport std.stream
-0000:0120 3B 20 20 2F 2F 20 42 75-66 66 65 72 65 64 46 69 ; // BufferedFi
-0000:0130 6C 65 0A 0A 2F 2F 20 4A-75 73 74 20 66 6F 72 20 le◙◙// Just for
-0000:0140 72 65 61 64 61 62 69 6C-69 74 79 20 28 69 6D 61 readability (ima
-0000:0150 67 69 6E 65 20 63 68 61-72 5B 5D 5B 5D 5B 63 68 gine char[][][ch
-0000:0160 61 72 5B 5D 5D 29 20 20-20 20 0A 61 6C 69 61 73 ar[]]) ◙alias
-0000:0170 20 63 68 61 72 5B 5D 20-73 74 72 69 6E 67 3B 0A char[] string;◙
-0000:0180 61 6C 69 61 73 20 73 74-72 69 6E 67 5B 5D 20 73 alias string[] s
-0000:0190 74 72 69 6E 67 61 72 72-61 79 3B 0A 0A 2F 2F 2F tringarray;◙◙///
-0000:01A0 20 53 74 72 69 70 73 20-6E 6F 6E 2D 64 69 67 69 Strips non-digi
-0000:01B0 74 20 63 68 61 72 61 63-74 65 72 73 20 66 72 6F t characters fro
-0000:01C0 6D 20 74 68 65 20 73 74-72 69 6E 67 20 28 43 4F m the string (CO
-0000:01D0 57 29 0A 73 74 72 69 6E-67 20 73 74 72 69 70 4E W)◙string stripN
-0000:01E0 6F 6E 44 69 67 69 74 28-20 69 6E 20 73 74 72 69 onDigit( in stri
-0000:01F0 6E 67 20 6C 69 6E 65 20-29 20 0A 7B 0A 20 20 20 ng line ) ◙{◙
-0000:0200 20 73 74 72 69 6E 67 20-72 65 74 3B 0A 20 20 20 string ret;◙
-0000:0210 20 66 6F 72 65 61 63 68-28 75 69 6E 74 20 69 2C foreach(uint i,
-0000:0220 20 63 3B 20 6C 69 6E 65-29 20 7B 0A 20 20 20 20 c; line) {◙
-0000:0230 20 20 20 20 2F 2F 20 45-72 72 6F 72 3A 20 73 74 // Error: st
-0000:0240 64 2E 63 74 79 70 65 2E-69 73 64 69 67 69 74 20 d.ctype.isdigit
-0000:0250 61 74 20 43 3A 5C 64 6D-64 5C 73 72 63 5C 70 68 at C:\dmd\src\ph
-0000:0260 6F 62 6F 73 5C 73 74 64-5C 63 74 79 70 65 2E 64 obos\std\ctype.d
-0000:0270 28 33 37 29 20 0A 20 20-20 20 20 20 20 20 2F 2F (37) ◙ //
-0000:0280 20 63 6F 6E 66 6C 69 63-74 73 20 77 69 74 68 20 conflicts with
-0000:0290 73 74 64 2E 73 74 72 65-61 6D 2E 69 73 64 69 67 std.stream.isdig
-0000:02A0 69 74 20 61 74 20 43 3A-5C 64 6D 64 5C 73 72 63 it at C:\dmd\src
-0000:02B0 5C 70 68 6F 62 6F 73 5C-73 74 64 5C 73 74 72 65 \phobos\std\stre
-0000:02C0 61 6D 2E 64 28 32 39 32-34 29 0A 20 20 20 20 20 am.d(2924)◙
-0000:02D0 20 20 20 69 66 20 28 21-73 74 64 2E 63 74 79 70 if (!std.ctyp
-0000:02E0 65 2E 69 73 64 69 67 69-74 28 63 29 29 20 7B 0A e.isdigit(c)) {◙
-0000:02F0 20 20 20 20 20 20 20 20-20 20 20 20 69 66 20 28 if (
-0000:0300 21 72 65 74 29 0A 20 20-20 20 20 20 20 20 20 20 !ret)◙
-0000:0310 20 20 20 20 20 20 72 65-74 20 3D 20 6C 69 6E 65 ret = line
-0000:0320 5B 30 2E 2E 69 5D 3B 20-20 20 20 0A 20 20 20 20 [0..i]; ◙
-0000:0330 20 20 20 20 7D 20 20 20-20 0A 20 20 20 20 20 20 } ◙
-0000:0340 20 20 65 6C 73 65 20 69-66 20 28 72 65 74 29 0A else if (ret)◙
-0000:0350 20 20 20 20 20 20 20 20-20 20 20 20 72 65 74 20 ret
-0000:0360 7E 3D 20 63 3B 20 20 20-20 0A 20 20 20 20 7D 20 ~= c; ◙ }
-0000:0370 20 20 20 0A 20 20 20 20-72 65 74 75 72 6E 20 72 ◙ return r
-0000:0380 65 74 3F 72 65 74 3A 6C-69 6E 65 3B 0A 7D 0A 0A et?ret:line;◙}◙◙
-0000:0390 75 6E 69 74 74 65 73 74-20 7B 0A 20 20 20 20 61 unittest {◙ a
-0000:03A0 73 73 65 72 74 28 20 73-74 72 69 70 4E 6F 6E 44 ssert( stripNonD
-0000:03B0 69 67 69 74 28 22 61 73-64 66 22 29 20 3D 3D 20 igit("asdf") ==
-0000:03C0 22 22 20 20 29 3B 0A 20-20 20 20 61 73 73 65 72 "" );◙ asser
-0000:03D0 74 28 20 73 74 72 69 70-4E 6F 6E 44 69 67 69 74 t( stripNonDigit
-0000:03E0 28 22 5C 27 31 33 2D 3D-32 20 34 6B 6F 70 22 29 ("\'13-=2 4kop")
-0000:03F0 20 3D 3D 20 20 22 31 33-32 34 22 20 20 29 3B 0A == "1324" );◙
-0000:0400 7D 0A 0A 2F 2F 2F 20 43-6F 6E 76 65 72 74 73 20 }◙◙/// Converts
-0000:0410 61 20 77 6F 72 64 20 69-6E 74 6F 20 61 20 6E 75 a word into a nu
-0000:0420 6D 62 65 72 2C 20 69 67-6E 6F 72 69 6E 67 20 61 mber, ignoring a
-0000:0430 6C 6C 20 6E 6F 6E 20 61-6C 70 68 61 20 63 68 61 ll non alpha cha
-0000:0440 72 61 63 74 65 72 73 20-20 0A 73 74 72 69 6E 67 racters ◙string
-0000:0450 20 77 6F 72 64 54 6F 4E-75 6D 28 20 69 6E 20 73 wordToNum( in s
-0000:0460 74 72 69 6E 67 20 77 6F-72 64 20 29 0A 7B 0A 2F tring word )◙{◙/
-0000:0470 2F 20 74 72 61 6E 73 6C-61 74 69 6F 6E 20 74 61 / translation ta
-0000:0480 62 6C 65 20 66 6F 72 20-74 68 65 20 74 61 73 6B ble for the task
-0000:0490 20 61 74 20 68 61 6E 64-0A 63 6F 6E 73 74 20 63 at hand◙const c
-0000:04A0 68 61 72 5B 32 35 36 5D-20 54 52 41 4E 53 4C 41 har[256] TRANSLA
-0000:04B0 54 45 20 3D 20 20 20 20-0A 20 20 20 20 22 20 20 TE = ◙ "
-0000:04C0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
-0000:04D0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 22 20 "
-0000:04E0 20 2F 2F 20 30 20 20 20-0A 20 20 20 20 22 20 20 // 0 ◙ "
-0000:04F0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 30 31 01
-0000:0500 32 33 34 35 36 37 38 39-20 20 20 20 20 20 22 20 23456789 "
-0000:0510 20 2F 2F 20 33 32 20 20-20 20 20 0A 20 20 20 20 // 32 ◙
-0000:0520 22 20 35 37 36 33 30 34-39 39 36 31 37 38 35 31 " 57630499617851
-0000:0530 38 38 31 32 33 34 37 36-32 32 33 39 20 20 20 20 881234762239
-0000:0540 20 22 20 20 2F 2F 20 36-34 20 20 20 0A 20 20 20 " // 64 ◙
-0000:0550 20 22 20 35 37 36 33 30-34 39 39 36 31 37 38 35 " 5763049961785
-0000:0560 31 38 38 31 32 33 34 37-36 32 32 33 39 20 20 20 1881234762239
-0000:0570 20 20 22 0A 20 20 20 20-22 20 20 20 20 20 20 20 "◙ "
-0000:0580 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
-0000:0590 20 20 20 20 20 20 20 20-20 22 0A 20 20 20 20 22 "◙ "
-0000:05A0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
-0000:05B0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
-0000:05C0 22 0A 20 20 20 20 22 20-20 20 20 20 20 20 20 20 "◙ "
-0000:05D0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
-0000:05E0 20 20 20 20 20 20 20 22-20 20 20 20 0A 20 20 20 " ◙
-0000:05F0 20 22 20 20 20 20 20 20-20 20 20 20 20 20 20 20 "
-0000:0600 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
-0000:0610 20 20 22 3B 0A 20 20 20-20 73 74 72 69 6E 67 20 ";◙ string
-0000:0620 72 65 74 3B 0A 20 20 20-20 66 6F 72 65 61 63 68 ret;◙ foreach
-0000:0630 28 63 3B 20 63 61 73 74-28 75 62 79 74 65 5B 5D (c; cast(ubyte[]
-0000:0640 29 77 6F 72 64 29 0A 20-20 20 20 20 20 20 20 69 )word)◙ i
-0000:0650 66 20 28 54 52 41 4E 53-4C 41 54 45 5B 63 5D 20 f (TRANSLATE[c]
-0000:0660 21 3D 20 27 20 27 29 0A-20 20 20 20 20 20 20 20 != ' ')◙
-0000:0670 20 20 20 20 72 65 74 20-7E 3D 20 54 52 41 4E 53 ret ~= TRANS
-0000:0680 4C 41 54 45 5B 63 5D 3B-0A 20 20 20 20 72 65 74 LATE[c];◙ ret
-0000:0690 75 72 6E 20 72 65 74 3B-0A 7D 0A 0A 75 6E 69 74 urn ret;◙}◙◙unit
-0000:06A0 74 65 73 74 20 7B 0A 20-2F 2F 20 54 65 73 74 20 test {◙ // Test
-0000:06B0 77 6F 72 64 54 6F 4E 75-6D 20 75 73 69 6E 67 20 wordToNum using
-0000:06C0 74 68 65 20 74 61 62 6C-65 20 66 72 6F 6D 20 74 the table from t
-0000:06D0 68 65 20 74 61 73 6B 20-64 65 73 63 72 69 70 74 he task descript
-0000:06E0 69 6F 6E 2E 0A 20 61 73-73 65 72 74 28 20 22 30 ion.◙ assert( "0
-0000:06F0 31 31 31 32 32 32 33 33-33 34 34 35 35 36 36 36 1112223334455666
-0000:0700 37 37 37 38 38 38 39 39-39 22 20 3D 3D 0A 20 20 777888999" ==◙
-0000:0710 20 77 6F 72 64 54 6F 4E-75 6D 28 22 45 20 7C 20 wordToNum("E |
-0000:0720 4A 20 4E 20 51 20 7C 20-52 20 57 20 58 20 7C 20 J N Q | R W X |
-0000:0730 44 20 53 20 59 20 7C 20-46 20 54 20 7C 20 41 20 D S Y | F T | A
-0000:0740 4D 20 7C 20 43 20 49 20-56 20 7C 20 42 20 4B 20 M | C I V | B K
-0000:0750 55 20 7C 20 4C 20 4F 20-50 20 7C 20 47 20 48 20 U | L O P | G H
-0000:0760 5A 22 29 29 3B 0A 20 61-73 73 65 72 74 28 20 22 Z"));◙ assert( "
-0000:0770 30 31 31 31 32 32 32 33-33 33 34 34 35 35 36 36 0111222333445566
-0000:0780 36 37 37 37 38 38 38 39-39 39 22 20 3D 3D 20 0A 6777888999" == ◙
-0000:0790 20 20 20 77 6F 72 64 54-6F 4E 75 6D 28 22 65 20 wordToNum("e
-0000:07A0 7C 20 6A 20 6E 20 71 20-7C 20 72 20 77 20 78 20 | j n q | r w x
-0000:07B0 7C 20 64 20 73 20 79 20-7C 20 66 20 74 20 7C 20 | d s y | f t |
-0000:07C0 61 20 6D 20 7C 20 63 20-69 20 76 20 7C 20 62 20 a m | c i v | b
-0000:07D0 6B 20 75 20 7C 20 6C 20-6F 20 70 20 7C 20 67 20 k u | l o p | g
-0000:07E0 68 20 7A 22 29 29 3B 0A-20 61 73 73 65 72 74 28 h z"));◙ assert(
-0000:07F0 20 22 30 31 32 33 34 35-36 37 38 39 22 20 3D 3D "0123456789" ==
-0000:0800 20 0A 20 20 20 77 6F 72-64 54 6F 4E 75 6D 28 22 ◙ wordToNum("
-0000:0810 30 20 7C 20 20 20 31 20-20 20 7C 20 20 20 32 20 0 | 1 | 2
-0000:0820 20 20 7C 20 20 20 33 20-20 20 7C 20 20 34 20 20 | 3 | 4
-0000:0830 7C 20 20 35 20 20 7C 20-20 20 36 20 20 20 7C 20 | 5 | 6 |
-0000:0840 20 20 37 20 20 20 7C 20-20 20 38 20 20 20 7C 20 7 | 8 |
-0000:0850 20 20 39 22 29 29 3B 0A-7D 0A 0A 76 6F 69 64 20 9"));◙}◙◙void
-0000:0860 6D 61 69 6E 28 20 73 74-72 69 6E 67 5B 5D 20 61 main( string[] a
-0000:0870 72 67 73 20 29 0A 7B 0A-20 20 20 20 2F 2F 20 54 rgs )◙{◙ // T
-0000:0880 68 69 73 20 61 73 73 6F-63 69 61 74 69 76 65 20 his associative
-0000:0890 61 72 72 61 79 20 6D 61-70 73 20 61 20 6E 75 6D array maps a num
-0000:08A0 62 65 72 20 74 6F 20 61-6E 20 61 72 72 61 79 20 ber to an array
-0000:08B0 6F 66 20 77 6F 72 64 73-2E 20 20 20 20 0A 20 20 of words. ◙
-0000:08C0 20 20 73 74 72 69 6E 67-61 72 72 61 79 5B 73 74 stringarray[st
-0000:08D0 72 69 6E 67 5D 20 20 20-20 6E 75 6D 32 77 6F 72 ring] num2wor
-0000:08E0 64 73 3B 0A 0A 20 20 20-20 66 6F 72 65 61 63 68 ds;◙◙ foreach
-0000:08F0 28 73 74 72 69 6E 67 20-77 6F 72 64 3B 20 6E 65 (string word; ne
-0000:0900 77 20 42 75 66 66 65 72-65 64 46 69 6C 65 28 22 w BufferedFile("
-0000:0910 64 69 63 74 69 6F 6E 61-72 79 2E 74 78 74 22 20 dictionary.txt"
-0000:0920 29 20 29 0A 20 20 20 20-20 20 20 20 6E 75 6D 32 ) )◙ num2
-0000:0930 77 6F 72 64 73 5B 20 77-6F 72 64 54 6F 4E 75 6D words[ wordToNum
-0000:0940 28 77 6F 72 64 29 20 5D-20 7E 3D 20 77 6F 72 64 (word) ] ~= word
-0000:0950 2E 64 75 70 3B 20 20 20-20 20 20 20 20 2F 2F 20 .dup; //
-0000:0960 6D 75 73 74 20 64 75 70-0A 0A 20 20 20 20 2F 2F must dup◙◙ //
-0000:0970 2F 20 46 69 6E 64 73 20-61 6C 6C 20 61 6C 74 65 / Finds all alte
-0000:0980 72 6E 61 74 69 76 65 73-20 66 6F 72 20 74 68 65 rnatives for the
-0000:0990 20 67 69 76 65 6E 20 6E-75 6D 62 65 72 0A 20 20 given number◙
-0000:09A0 20 20 2F 2F 2F 20 28 73-68 6F 75 6C 64 20 68 61 /// (should ha
-0000:09B0 76 65 20 62 65 65 6E 20-73 74 72 69 70 70 65 64 ve been stripped
-0000:09C0 20 66 72 6F 6D 20 6E 6F-6E 2D 64 69 67 69 74 20 from non-digit
-0000:09D0 63 68 61 72 61 63 74 65-72 73 29 0A 20 20 20 20 characters)◙
-0000:09E0 73 74 72 69 6E 67 61 72-72 61 79 20 5F 46 69 6E stringarray _Fin
-0000:09F0 64 57 6F 72 64 73 28 20-73 74 72 69 6E 67 20 6E dWords( string n
-0000:0A00 75 6D 62 65 72 73 2C 20-62 6F 6F 6C 20 64 69 67 umbers, bool dig
-0000:0A10 69 74 6F 6B 20 29 0A 20-20 20 20 69 6E 20 7B 0A itok )◙ in {◙
-0000:0A20 20 20 20 20 20 20 20 20-61 73 73 65 72 74 28 6E assert(n
-0000:0A30 75 6D 62 65 72 73 2E 6C-65 6E 67 74 68 20 3E 20 umbers.length >
-0000:0A40 20 30 29 3B 20 20 20 20-0A 20 20 20 20 7D 20 20 0); ◙ }
-0000:0A50 20 20 0A 20 20 20 20 6F-75 74 28 72 65 73 75 6C ◙ out(resul
-0000:0A60 74 29 20 7B 0A 20 20 20-20 20 20 20 20 66 6F 72 t) {◙ for
-0000:0A70 65 61 63 68 20 28 61 3B-20 72 65 73 75 6C 74 29 each (a; result)
-0000:0A80 0A 20 20 20 20 20 20 20-20 20 20 20 20 61 73 73 ◙ ass
-0000:0A90 65 72 74 28 20 77 6F 72-64 54 6F 4E 75 6D 28 61 ert( wordToNum(a
-0000:0AA0 29 20 3D 3D 20 6E 75 6D-62 65 72 73 20 29 3B 0A ) == numbers );◙
-0000:0AB0 20 20 20 20 7D 20 20 20-20 0A 20 20 20 20 62 6F } ◙ bo
-0000:0AC0 64 79 20 7B 0A 20 20 20-20 20 20 20 20 73 74 72 dy {◙ str
-0000:0AD0 69 6E 67 61 72 72 61 79-20 72 65 74 3B 0A 20 20 ingarray ret;◙
-0000:0AE0 20 20 20 20 20 20 62 6F-6F 6C 20 66 6F 75 6E 64 bool found
-0000:0AF0 77 6F 72 64 20 3D 20 66-61 6C 73 65 3B 0A 20 20 word = false;◙
-0000:0B00 20 20 20 20 20 20 66 6F-72 20 28 75 69 6E 74 20 for (uint
-0000:0B10 74 3D 31 3B 20 74 3C 3D-6E 75 6D 62 65 72 73 2E t=1; t<=numbers.
-0000:0B20 6C 65 6E 67 74 68 3B 20-2B 2B 74 29 20 7B 0A 20 length; ++t) {◙
-0000:0B30 20 20 20 20 20 20 20 20-20 20 20 61 75 74 6F 20 auto
-0000:0B40 61 6C 74 65 72 6E 61 74-69 76 65 73 20 3D 20 6E alternatives = n
-0000:0B50 75 6D 62 65 72 73 5B 30-2E 2E 74 5D 20 69 6E 20 umbers[0..t] in
-0000:0B60 6E 75 6D 32 77 6F 72 64-73 3B 0A 20 20 20 20 20 num2words;◙
-0000:0B70 20 20 20 20 20 20 20 69-66 20 28 21 61 6C 74 65 if (!alte
-0000:0B80 72 6E 61 74 69 76 65 73-29 0A 20 20 20 20 20 20 rnatives)◙
-0000:0B90 20 20 20 20 20 20 20 20-20 20 63 6F 6E 74 69 6E contin
-0000:0BA0 75 65 3B 0A 20 20 20 20-20 20 20 20 20 20 20 20 ue;◙
-0000:0BB0 66 6F 75 6E 64 77 6F 72-64 20 3D 20 74 72 75 65 foundword = true
-0000:0BC0 3B 0A 20 20 20 20 20 20-20 20 20 20 20 20 69 66 ;◙ if
-0000:0BD0 20 28 6E 75 6D 62 65 72-73 2E 6C 65 6E 67 74 68 (numbers.length
-0000:0BE0 20 3E 20 20 74 29 20 7B-0A 20 20 20 20 20 20 20 > t) {◙
-0000:0BF0 20 20 20 20 20 20 20 20-20 2F 2F 20 43 6F 6D 62 // Comb
-0000:0C00 69 6E 65 20 61 6C 6C 20-63 75 72 72 65 6E 74 20 ine all current
-0000:0C10 61 6C 74 65 72 6E 61 74-69 76 65 73 20 77 69 74 alternatives wit
-0000:0C20 68 20 61 6C 6C 20 61 6C-74 65 72 6E 61 74 69 76 h all alternativ
-0000:0C30 65 73 20 20 20 20 20 0A-20 20 20 20 20 20 20 20 es ◙
-0000:0C40 20 20 20 20 20 20 20 20-2F 2F 20 6F 66 20 74 68 // of th
-0000:0C50 65 20 72 65 73 74 20 28-6E 65 78 74 20 70 69 65 e rest (next pie
-0000:0C60 63 65 20 63 61 6E 20 73-74 61 72 74 20 77 69 74 ce can start wit
-0000:0C70 68 20 61 20 64 69 67 69-74 29 20 20 20 20 20 20 h a digit)
-0000:0C80 20 20 20 20 20 20 20 20-0A 20 20 20 20 20 20 20 ◙
-0000:0C90 20 20 20 20 20 20 20 20-20 66 6F 72 65 61 63 68 foreach
-0000:0CA0 20 28 61 32 3B 20 5F 46-69 6E 64 57 6F 72 64 73 (a2; _FindWords
-0000:0CB0 28 20 6E 75 6D 62 65 72-73 5B 74 2E 2E 24 5D 2C ( numbers[t..$],
-0000:0CC0 20 74 72 75 65 20 20 20-20 20 29 20 29 0A 20 20 true ) )◙
-0000:0CD0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
-0000:0CE0 20 20 66 6F 72 65 61 63-68 28 61 31 3B 20 2A 61 foreach(a1; *a
-0000:0CF0 6C 74 65 72 6E 61 74 69-76 65 73 29 0A 20 20 20 lternatives)◙
-0000:0D00 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
-0000:0D10 20 20 20 20 72 65 74 20-7E 3D 20 61 31 20 7E 20 ret ~= a1 ~
-0000:0D20 22 20 22 20 7E 20 61 32-3B 0A 20 20 20 20 20 20 " " ~ a2;◙
-0000:0D30 20 20 20 20 20 20 7D 0A-20 20 20 20 20 20 20 20 }◙
-0000:0D40 20 20 20 20 65 6C 73 65-20 20 20 20 0A 20 20 20 else ◙
-0000:0D50 20 20 20 20 20 20 20 20-20 20 20 20 20 72 65 74 ret
-0000:0D60 20 7E 3D 20 2A 61 6C 74-65 72 6E 61 74 69 76 65 ~= *alternative
-0000:0D70 73 3B 20 20 20 20 2F 2F-20 61 70 70 65 6E 64 20 s; // append
-0000:0D80 74 68 65 73 65 20 61 6C-74 65 72 6E 61 74 69 76 these alternativ
-0000:0D90 65 73 0A 20 20 20 20 20-20 20 20 7D 0A 20 20 20 es◙ }◙
-0000:0DA0 20 20 20 20 20 2F 2F 20-54 72 79 20 74 6F 20 6B // Try to k
-0000:0DB0 65 65 70 20 31 20 64 69-67 69 74 2C 20 6F 6E 6C eep 1 digit, onl
-0000:0DC0 79 20 69 66 20 77 65 27-72 65 20 61 6C 6C 6F 77 y if we're allow
-0000:0DD0 65 64 20 61 6E 64 20 6E-6F 20 6F 74 68 65 72 0A ed and no other◙
-0000:0DE0 20 20 20 20 20 20 20 20-2F 2F 20 61 6C 74 65 72 // alter
-0000:0DF0 6E 61 74 69 76 65 73 20-77 65 72 65 20 66 6F 75 natives were fou
-0000:0E00 6E 64 0A 20 20 20 20 20-20 20 20 2F 2F 20 54 65 nd◙ // Te
-0000:0E10 73 74 69 6E 67 20 22 72-65 74 2E 6C 65 6E 67 74 sting "ret.lengt
-0000:0E20 68 22 20 6D 61 6B 65 73-20 6D 6F 72 65 20 73 65 h" makes more se
-0000:0E30 6E 73 65 20 74 68 61 6E-20 74 65 73 74 69 6E 67 nse than testing
-0000:0E40 20 22 66 6F 75 6E 64 77-6F 72 64 22 2C 0A 20 20 "foundword",◙
-0000:0E50 20 20 20 20 20 20 2F 2F-20 62 75 74 20 74 68 65 // but the
-0000:0E60 20 6F 74 68 65 72 20 69-6D 70 6C 65 6D 65 6E 74 other implement
-0000:0E70 61 74 69 6F 6E 73 20 73-65 65 6D 20 74 6F 20 64 ations seem to d
-0000:0E80 6F 20 6A 75 73 74 20 74-68 69 73 2E 0A 20 20 20 o just this.◙
-0000:0E90 20 20 20 20 20 69 66 20-28 64 69 67 69 74 6F 6B if (digitok
-0000:0EA0 20 26 26 20 21 66 6F 75-6E 64 77 6F 72 64 29 20 && !foundword)
-0000:0EB0 7B 20 2F 2F 72 65 74 2E-6C 65 6E 67 74 68 20 3D { //ret.length =
-0000:0EC0 3D 20 30 20 20 0A 20 20-20 20 20 20 20 20 20 20 = 0 ◙
-0000:0ED0 20 20 69 66 28 6E 75 6D-62 65 72 73 2E 6C 65 6E if(numbers.len
-0000:0EE0 67 74 68 20 3E 20 20 31-29 20 7B 0A 20 20 20 20 gth > 1) {◙
-0000:0EF0 20 20 20 20 20 20 20 20-20 20 20 20 2F 2F 20 43 // C
-0000:0F00 6F 6D 62 69 6E 65 20 31-20 64 69 67 69 74 20 77 ombine 1 digit w
-0000:0F10 69 74 68 20 61 6C 6C 20-61 6C 74 65 6E 61 74 69 ith all altenati
-0000:0F20 76 65 73 20 66 72 6F 6D-20 74 68 65 20 72 65 73 ves from the res
-0000:0F30 74 20 20 20 20 0A 20 20-20 20 20 20 20 20 20 20 t ◙
-0000:0F40 20 20 20 20 20 20 2F 2F-20 28 6E 65 78 74 20 70 // (next p
-0000:0F50 69 65 63 65 20 63 61 6E-20 6E 6F 74 20 73 74 61 iece can not sta
-0000:0F60 72 74 20 77 69 74 68 20-61 20 64 69 67 69 74 29 rt with a digit)
-0000:0F70 20 20 20 20 20 20 20 20-20 20 0A 20 20 20 20 20 ◙
-0000:0F80 20 20 20 20 20 20 20 20-20 20 20 66 6F 72 65 61 forea
-0000:0F90 63 68 20 28 61 3B 20 5F-46 69 6E 64 57 6F 72 64 ch (a; _FindWord
-0000:0FA0 73 28 20 6E 75 6D 62 65-72 73 5B 31 2E 2E 24 5D s( numbers[1..$]
-0000:0FB0 2C 20 66 61 6C 73 65 20-29 20 29 0A 20 20 20 20 , false ) )◙
-0000:0FC0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
-0000:0FD0 72 65 74 20 7E 3D 20 6E-75 6D 62 65 72 73 5B 30 ret ~= numbers[0
-0000:0FE0 2E 2E 31 5D 20 7E 20 22-20 22 20 7E 20 61 3B 0A ..1] ~ " " ~ a;◙
-0000:0FF0 20 20 20 20 20 20 20 20-20 20 20 20 7D 20 20 20 }
-0000:1000 20 0A 20 20 20 20 20 20-20 20 20 20 20 20 65 6C ◙ el
-0000:1010 73 65 20 20 20 20 0A 20-20 20 20 20 20 20 20 20 se ◙
-0000:1020 20 20 20 20 20 20 20 72-65 74 20 7E 3D 20 6E 75 ret ~= nu
-0000:1030 6D 62 65 72 73 5B 30 2E-2E 31 5D 3B 20 20 20 20 mbers[0..1];
-0000:1040 2F 2F 20 6A 75 73 74 20-61 70 70 65 6E 64 20 74 // just append t
-0000:1050 68 69 73 20 64 69 67 69-74 20 20 20 20 20 20 20 his digit
-0000:1060 20 20 20 20 20 20 0A 20-20 20 20 20 20 20 20 7D ◙ }
-0000:1070 20 20 20 20 0A 20 20 20-20 20 20 20 20 72 65 74 ◙ ret
-0000:1080 75 72 6E 20 72 65 74 3B-0A 20 20 20 20 7D 0A 0A urn ret;◙ }◙◙
-0000:1090 20 20 20 20 2F 2F 2F 20-28 54 68 69 73 20 66 75 /// (This fu
-0000:10A0 6E 63 74 69 6F 6E 20 77-61 73 20 69 6E 6C 69 6E nction was inlin
-0000:10B0 65 64 20 69 6E 20 74 68-65 20 6F 72 69 67 69 6E ed in the origin
-0000:10C0 61 6C 20 70 72 6F 67 72-61 6D 29 20 0A 20 20 20 al program) ◙
-0000:10D0 20 2F 2F 2F 20 46 69 6E-64 73 20 61 6C 6C 20 61 /// Finds all a
-0000:10E0 6C 74 65 72 6E 61 74 69-76 65 73 20 66 6F 72 20 lternatives for
-0000:10F0 74 68 65 20 67 69 76 65-6E 20 70 68 6F 6E 65 20 the given phone
-0000:1100 6E 75 6D 62 65 72 20 0A-20 20 20 20 2F 2F 2F 20 number ◙ ///
-0000:1110 52 65 74 75 72 6E 73 3A-20 61 72 72 61 79 20 6F Returns: array o
-0000:1120 66 20 73 74 72 69 6E 67-73 20 0A 20 20 20 20 73 f strings ◙ s
-0000:1130 74 72 69 6E 67 61 72 72-61 79 20 46 69 6E 64 57 tringarray FindW
-0000:1140 6F 72 64 73 28 20 73 74-72 69 6E 67 20 70 68 6F ords( string pho
-0000:1150 6E 65 5F 6E 75 6D 62 65-72 20 29 0A 20 20 20 20 ne_number )◙
-0000:1160 7B 0A 20 20 20 20 20 20-20 20 69 66 20 28 21 70 {◙ if (!p
-0000:1170 68 6F 6E 65 5F 6E 75 6D-62 65 72 2E 6C 65 6E 67 hone_number.leng
-0000:1180 74 68 29 0A 20 20 20 20-20 20 20 20 20 20 20 20 th)◙
-0000:1190 72 65 74 75 72 6E 20 6E-75 6C 6C 3B 0A 20 20 20 return null;◙
-0000:11A0 20 20 20 20 20 2F 2F 20-53 74 72 69 70 20 74 68 // Strip th
-0000:11B0 65 20 6E 6F 6E 2D 64 69-67 69 74 20 63 68 61 72 e non-digit char
-0000:11C0 61 63 74 65 72 73 20 66-72 6F 6D 20 74 68 65 20 acters from the
-0000:11D0 70 68 6F 6E 65 20 6E 75-6D 62 65 72 2C 20 61 6E phone number, an
-0000:11E0 64 0A 20 20 20 20 20 20-20 20 2F 2F 20 70 61 73 d◙ // pas
-0000:11F0 73 20 69 74 20 74 6F 20-74 68 65 20 72 65 63 75 s it to the recu
-0000:1200 72 73 69 76 65 20 66 75-6E 63 74 69 6F 6E 20 28 rsive function (
-0000:1210 6C 65 61 64 69 6E 67 20-64 69 67 69 74 20 69 73 leading digit is
-0000:1220 20 61 6C 6C 6F 77 65 64-29 0A 20 20 20 20 20 20 allowed)◙
-0000:1230 20 20 72 65 74 75 72 6E-20 5F 46 69 6E 64 57 6F return _FindWo
-0000:1240 72 64 73 28 20 73 74 72-69 70 4E 6F 6E 44 69 67 rds( stripNonDig
-0000:1250 69 74 28 70 68 6F 6E 65-5F 6E 75 6D 62 65 72 29 it(phone_number)
-0000:1260 2C 20 74 72 75 65 20 29-3B 20 20 20 20 0A 20 20 , true ); ◙
-0000:1270 20 20 7D 20 20 20 20 0A-20 20 20 20 0A 20 20 20 } ◙ ◙
-0000:1280 20 2F 2F 20 52 65 61 64-20 74 68 65 20 70 68 6F // Read the pho
-0000:1290 6E 65 20 6E 75 6D 62 65-72 73 20 20 20 20 20 0A ne numbers ◙
-0000:12A0 20 20 20 20 66 6F 72 65-61 63 68 28 73 74 72 69 foreach(stri
-0000:12B0 6E 67 20 70 68 6F 6E 65-3B 20 6E 65 77 20 42 75 ng phone; new Bu
-0000:12C0 66 66 65 72 65 64 46 69-6C 65 28 22 69 6E 70 75 fferedFile("inpu
-0000:12D0 74 2E 74 78 74 22 20 20-20 29 20 29 0A 20 20 20 t.txt" ) )◙
-0000:12E0 20 20 20 20 20 66 6F 72-65 61 63 68 28 61 6C 74 foreach(alt
-0000:12F0 65 72 6E 61 74 69 76 65-3B 20 46 69 6E 64 57 6F ernative; FindWo
-0000:1300 72 64 73 28 20 70 68 6F-6E 65 20 29 20 29 0A 20 rds( phone ) )◙
-0000:1310 20 20 20 20 20 20 20 20-20 20 20 77 72 69 74 65 write
-0000:1320 66 6C 6E 28 70 68 6F 6E-65 2C 20 22 3A 20 22 2C fln(phone, ": ",
-0000:1330 20 61 6C 74 65 72 6E 61-74 69 76 65 20 29 3B 0A alternative );◙
-0000:1340 7D 0A 0A }◙◙
diff --git a/tests/examplefiles/hexdump_hd b/tests/examplefiles/hexdump_hd
deleted file mode 100644
index 4af46fcb..00000000
--- a/tests/examplefiles/hexdump_hd
+++ /dev/null
@@ -1,310 +0,0 @@
-00000000 2f 2f 20 43 72 65 61 74 65 64 20 62 79 20 4c 69 |// Created by Li|
-00000010 6f 6e 65 6c 6c 6f 20 4c 75 6e 65 73 75 20 61 6e |onello Lunesu an|
-00000020 64 20 70 6c 61 63 65 64 20 69 6e 20 74 68 65 20 |d placed in the |
-00000030 70 75 62 6c 69 63 20 64 6f 6d 61 69 6e 2e 0a 2f |public domain../|
-00000040 2f 20 54 68 69 73 20 66 69 6c 65 20 68 61 73 20 |/ This file has |
-00000050 62 65 65 6e 20 6d 6f 64 69 66 69 65 64 20 66 72 |been modified fr|
-00000060 6f 6d 20 69 74 73 20 6f 72 69 67 69 6e 61 6c 20 |om its original |
-00000070 76 65 72 73 69 6f 6e 2e 0a 2f 2f 20 49 74 20 68 |version..// It h|
-00000080 61 73 20 62 65 65 6e 20 66 6f 72 6d 61 74 74 65 |as been formatte|
-00000090 64 20 74 6f 20 66 69 74 20 79 6f 75 72 20 73 63 |d to fit your sc|
-000000a0 72 65 65 6e 2e 0a 6d 6f 64 75 6c 65 20 70 68 6f |reen..module pho|
-000000b0 6e 65 6e 6f 3b 20 20 20 20 20 2f 2f 20 6f 70 74 |neno; // opt|
-000000c0 69 6f 6e 61 6c 0a 69 6d 70 6f 72 74 20 73 74 64 |ional.import std|
-000000d0 2e 73 74 64 69 6f 3b 20 20 20 2f 2f 20 77 72 69 |.stdio; // wri|
-000000e0 74 65 66 6c 6e 20 20 20 20 20 0a 69 6d 70 6f 72 |tefln .impor|
-000000f0 74 20 73 74 64 2e 63 74 79 70 65 3b 20 20 20 2f |t std.ctype; /|
-00000100 2f 20 69 73 64 69 67 69 74 20 20 20 20 20 0a 69 |/ isdigit .i|
-00000110 6d 70 6f 72 74 20 73 74 64 2e 73 74 72 65 61 6d |mport std.stream|
-00000120 3b 20 20 2f 2f 20 42 75 66 66 65 72 65 64 46 69 |; // BufferedFi|
-00000130 6c 65 0a 0a 2f 2f 20 4a 75 73 74 20 66 6f 72 20 |le..// Just for |
-00000140 72 65 61 64 61 62 69 6c 69 74 79 20 28 69 6d 61 |readability (ima|
-00000150 67 69 6e 65 20 63 68 61 72 5b 5d 5b 5d 5b 63 68 |gine char[][][ch|
-00000160 61 72 5b 5d 5d 29 20 20 20 20 0a 61 6c 69 61 73 |ar[]]) .alias|
-00000170 20 63 68 61 72 5b 5d 20 73 74 72 69 6e 67 3b 0a | char[] string;.|
-00000180 61 6c 69 61 73 20 73 74 72 69 6e 67 5b 5d 20 73 |alias string[] s|
-00000190 74 72 69 6e 67 61 72 72 61 79 3b 0a 0a 2f 2f 2f |tringarray;..///|
-000001a0 20 53 74 72 69 70 73 20 6e 6f 6e 2d 64 69 67 69 | Strips non-digi|
-000001b0 74 20 63 68 61 72 61 63 74 65 72 73 20 66 72 6f |t characters fro|
-000001c0 6d 20 74 68 65 20 73 74 72 69 6e 67 20 28 43 4f |m the string (CO|
-000001d0 57 29 0a 73 74 72 69 6e 67 20 73 74 72 69 70 4e |W).string stripN|
-000001e0 6f 6e 44 69 67 69 74 28 20 69 6e 20 73 74 72 69 |onDigit( in stri|
-000001f0 6e 67 20 6c 69 6e 65 20 29 20 0a 7b 0a 20 20 20 |ng line ) .{. |
-00000200 20 73 74 72 69 6e 67 20 72 65 74 3b 0a 20 20 20 | string ret;. |
-00000210 20 66 6f 72 65 61 63 68 28 75 69 6e 74 20 69 2c | foreach(uint i,|
-00000220 20 63 3b 20 6c 69 6e 65 29 20 7b 0a 20 20 20 20 | c; line) {. |
-00000230 20 20 20 20 2f 2f 20 45 72 72 6f 72 3a 20 73 74 | // Error: st|
-00000240 64 2e 63 74 79 70 65 2e 69 73 64 69 67 69 74 20 |d.ctype.isdigit |
-00000250 61 74 20 43 3a 5c 64 6d 64 5c 73 72 63 5c 70 68 |at C:\dmd\src\ph|
-00000260 6f 62 6f 73 5c 73 74 64 5c 63 74 79 70 65 2e 64 |obos\std\ctype.d|
-00000270 28 33 37 29 20 0a 20 20 20 20 20 20 20 20 2f 2f |(37) . //|
-00000280 20 63 6f 6e 66 6c 69 63 74 73 20 77 69 74 68 20 | conflicts with |
-00000290 73 74 64 2e 73 74 72 65 61 6d 2e 69 73 64 69 67 |std.stream.isdig|
-000002a0 69 74 20 61 74 20 43 3a 5c 64 6d 64 5c 73 72 63 |it at C:\dmd\src|
-000002b0 5c 70 68 6f 62 6f 73 5c 73 74 64 5c 73 74 72 65 |\phobos\std\stre|
-000002c0 61 6d 2e 64 28 32 39 32 34 29 0a 20 20 20 20 20 |am.d(2924). |
-000002d0 20 20 20 69 66 20 28 21 73 74 64 2e 63 74 79 70 | if (!std.ctyp|
-000002e0 65 2e 69 73 64 69 67 69 74 28 63 29 29 20 7b 0a |e.isdigit(c)) {.|
-000002f0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 | if (|
-00000300 21 72 65 74 29 0a 20 20 20 20 20 20 20 20 20 20 |!ret). |
-00000310 20 20 20 20 20 20 72 65 74 20 3d 20 6c 69 6e 65 | ret = line|
-00000320 5b 30 2e 2e 69 5d 3b 20 20 20 20 0a 20 20 20 20 |[0..i]; . |
-00000330 20 20 20 20 7d 20 20 20 20 0a 20 20 20 20 20 20 | } . |
-00000340 20 20 65 6c 73 65 20 69 66 20 28 72 65 74 29 0a | else if (ret).|
-00000350 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 20 | ret |
-00000360 7e 3d 20 63 3b 20 20 20 20 0a 20 20 20 20 7d 20 |~= c; . } |
-00000370 20 20 20 0a 20 20 20 20 72 65 74 75 72 6e 20 72 | . return r|
-00000380 65 74 3f 72 65 74 3a 6c 69 6e 65 3b 0a 7d 0a 0a |et?ret:line;.}..|
-00000390 75 6e 69 74 74 65 73 74 20 7b 0a 20 20 20 20 61 |unittest {. a|
-000003a0 73 73 65 72 74 28 20 73 74 72 69 70 4e 6f 6e 44 |ssert( stripNonD|
-000003b0 69 67 69 74 28 22 61 73 64 66 22 29 20 3d 3d 20 |igit("asdf") == |
-000003c0 22 22 20 20 29 3b 0a 20 20 20 20 61 73 73 65 72 |"" );. asser|
-000003d0 74 28 20 73 74 72 69 70 4e 6f 6e 44 69 67 69 74 |t( stripNonDigit|
-000003e0 28 22 5c 27 31 33 2d 3d 32 20 34 6b 6f 70 22 29 |("\'13-=2 4kop")|
-000003f0 20 3d 3d 20 20 22 31 33 32 34 22 20 20 29 3b 0a | == "1324" );.|
-00000400 7d 0a 0a 2f 2f 2f 20 43 6f 6e 76 65 72 74 73 20 |}../// Converts |
-00000410 61 20 77 6f 72 64 20 69 6e 74 6f 20 61 20 6e 75 |a word into a nu|
-00000420 6d 62 65 72 2c 20 69 67 6e 6f 72 69 6e 67 20 61 |mber, ignoring a|
-00000430 6c 6c 20 6e 6f 6e 20 61 6c 70 68 61 20 63 68 61 |ll non alpha cha|
-00000440 72 61 63 74 65 72 73 20 20 0a 73 74 72 69 6e 67 |racters .string|
-00000450 20 77 6f 72 64 54 6f 4e 75 6d 28 20 69 6e 20 73 | wordToNum( in s|
-00000460 74 72 69 6e 67 20 77 6f 72 64 20 29 0a 7b 0a 2f |tring word ).{./|
-00000470 2f 20 74 72 61 6e 73 6c 61 74 69 6f 6e 20 74 61 |/ translation ta|
-00000480 62 6c 65 20 66 6f 72 20 74 68 65 20 74 61 73 6b |ble for the task|
-00000490 20 61 74 20 68 61 6e 64 0a 63 6f 6e 73 74 20 63 | at hand.const c|
-000004a0 68 61 72 5b 32 35 36 5d 20 54 52 41 4e 53 4c 41 |har[256] TRANSLA|
-000004b0 54 45 20 3d 20 20 20 20 0a 20 20 20 20 22 20 20 |TE = . " |
-000004c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
-000004d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 20 | " |
-000004e0 20 2f 2f 20 30 20 20 20 0a 20 20 20 20 22 20 20 | // 0 . " |
-000004f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 31 | 01|
-00000500 32 33 34 35 36 37 38 39 20 20 20 20 20 20 22 20 |23456789 " |
-00000510 20 2f 2f 20 33 32 20 20 20 20 20 0a 20 20 20 20 | // 32 . |
-00000520 22 20 35 37 36 33 30 34 39 39 36 31 37 38 35 31 |" 57630499617851|
-00000530 38 38 31 32 33 34 37 36 32 32 33 39 20 20 20 20 |881234762239 |
-00000540 20 22 20 20 2f 2f 20 36 34 20 20 20 0a 20 20 20 | " // 64 . |
-00000550 20 22 20 35 37 36 33 30 34 39 39 36 31 37 38 35 | " 5763049961785|
-00000560 31 38 38 31 32 33 34 37 36 32 32 33 39 20 20 20 |1881234762239 |
-00000570 20 20 22 0a 20 20 20 20 22 20 20 20 20 20 20 20 | ". " |
-00000580 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
-00000590 20 20 20 20 20 20 20 20 20 22 0a 20 20 20 20 22 | ". "|
-000005a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
-*
-000005c0 22 0a 20 20 20 20 22 20 20 20 20 20 20 20 20 20 |". " |
-000005d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
-000005e0 20 20 20 20 20 20 20 22 20 20 20 20 0a 20 20 20 | " . |
-000005f0 20 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | " |
-00000600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
-00000610 20 20 22 3b 0a 20 20 20 20 73 74 72 69 6e 67 20 | ";. string |
-00000620 72 65 74 3b 0a 20 20 20 20 66 6f 72 65 61 63 68 |ret;. foreach|
-00000630 28 63 3b 20 63 61 73 74 28 75 62 79 74 65 5b 5d |(c; cast(ubyte[]|
-00000640 29 77 6f 72 64 29 0a 20 20 20 20 20 20 20 20 69 |)word). i|
-00000650 66 20 28 54 52 41 4e 53 4c 41 54 45 5b 63 5d 20 |f (TRANSLATE[c] |
-00000660 21 3d 20 27 20 27 29 0a 20 20 20 20 20 20 20 20 |!= ' '). |
-00000670 20 20 20 20 72 65 74 20 7e 3d 20 54 52 41 4e 53 | ret ~= TRANS|
-00000680 4c 41 54 45 5b 63 5d 3b 0a 20 20 20 20 72 65 74 |LATE[c];. ret|
-00000690 75 72 6e 20 72 65 74 3b 0a 7d 0a 0a 75 6e 69 74 |urn ret;.}..unit|
-000006a0 74 65 73 74 20 7b 0a 20 2f 2f 20 54 65 73 74 20 |test {. // Test |
-000006b0 77 6f 72 64 54 6f 4e 75 6d 20 75 73 69 6e 67 20 |wordToNum using |
-000006c0 74 68 65 20 74 61 62 6c 65 20 66 72 6f 6d 20 74 |the table from t|
-000006d0 68 65 20 74 61 73 6b 20 64 65 73 63 72 69 70 74 |he task descript|
-000006e0 69 6f 6e 2e 0a 20 61 73 73 65 72 74 28 20 22 30 |ion.. assert( "0|
-000006f0 31 31 31 32 32 32 33 33 33 34 34 35 35 36 36 36 |1112223334455666|
-00000700 37 37 37 38 38 38 39 39 39 22 20 3d 3d 0a 20 20 |777888999" ==. |
-00000710 20 77 6f 72 64 54 6f 4e 75 6d 28 22 45 20 7c 20 | wordToNum("E | |
-00000720 4a 20 4e 20 51 20 7c 20 52 20 57 20 58 20 7c 20 |J N Q | R W X | |
-00000730 44 20 53 20 59 20 7c 20 46 20 54 20 7c 20 41 20 |D S Y | F T | A |
-00000740 4d 20 7c 20 43 20 49 20 56 20 7c 20 42 20 4b 20 |M | C I V | B K |
-00000750 55 20 7c 20 4c 20 4f 20 50 20 7c 20 47 20 48 20 |U | L O P | G H |
-00000760 5a 22 29 29 3b 0a 20 61 73 73 65 72 74 28 20 22 |Z"));. assert( "|
-00000770 30 31 31 31 32 32 32 33 33 33 34 34 35 35 36 36 |0111222333445566|
-00000780 36 37 37 37 38 38 38 39 39 39 22 20 3d 3d 20 0a |6777888999" == .|
-00000790 20 20 20 77 6f 72 64 54 6f 4e 75 6d 28 22 65 20 | wordToNum("e |
-000007a0 7c 20 6a 20 6e 20 71 20 7c 20 72 20 77 20 78 20 || j n q | r w x |
-000007b0 7c 20 64 20 73 20 79 20 7c 20 66 20 74 20 7c 20 || d s y | f t | |
-000007c0 61 20 6d 20 7c 20 63 20 69 20 76 20 7c 20 62 20 |a m | c i v | b |
-000007d0 6b 20 75 20 7c 20 6c 20 6f 20 70 20 7c 20 67 20 |k u | l o p | g |
-000007e0 68 20 7a 22 29 29 3b 0a 20 61 73 73 65 72 74 28 |h z"));. assert(|
-000007f0 20 22 30 31 32 33 34 35 36 37 38 39 22 20 3d 3d | "0123456789" ==|
-00000800 20 0a 20 20 20 77 6f 72 64 54 6f 4e 75 6d 28 22 | . wordToNum("|
-00000810 30 20 7c 20 20 20 31 20 20 20 7c 20 20 20 32 20 |0 | 1 | 2 |
-00000820 20 20 7c 20 20 20 33 20 20 20 7c 20 20 34 20 20 | | 3 | 4 |
-00000830 7c 20 20 35 20 20 7c 20 20 20 36 20 20 20 7c 20 || 5 | 6 | |
-00000840 20 20 37 20 20 20 7c 20 20 20 38 20 20 20 7c 20 | 7 | 8 | |
-00000850 20 20 39 22 29 29 3b 0a 7d 0a 0a 76 6f 69 64 20 | 9"));.}..void |
-00000860 6d 61 69 6e 28 20 73 74 72 69 6e 67 5b 5d 20 61 |main( string[] a|
-00000870 72 67 73 20 29 0a 7b 0a 20 20 20 20 2f 2f 20 54 |rgs ).{. // T|
-00000880 68 69 73 20 61 73 73 6f 63 69 61 74 69 76 65 20 |his associative |
-00000890 61 72 72 61 79 20 6d 61 70 73 20 61 20 6e 75 6d |array maps a num|
-000008a0 62 65 72 20 74 6f 20 61 6e 20 61 72 72 61 79 20 |ber to an array |
-000008b0 6f 66 20 77 6f 72 64 73 2e 20 20 20 20 0a 20 20 |of words. . |
-000008c0 20 20 73 74 72 69 6e 67 61 72 72 61 79 5b 73 74 | stringarray[st|
-000008d0 72 69 6e 67 5d 20 20 20 20 6e 75 6d 32 77 6f 72 |ring] num2wor|
-000008e0 64 73 3b 0a 0a 20 20 20 20 66 6f 72 65 61 63 68 |ds;.. foreach|
-000008f0 28 73 74 72 69 6e 67 20 77 6f 72 64 3b 20 6e 65 |(string word; ne|
-00000900 77 20 42 75 66 66 65 72 65 64 46 69 6c 65 28 22 |w BufferedFile("|
-00000910 64 69 63 74 69 6f 6e 61 72 79 2e 74 78 74 22 20 |dictionary.txt" |
-00000920 29 20 29 0a 20 20 20 20 20 20 20 20 6e 75 6d 32 |) ). num2|
-00000930 77 6f 72 64 73 5b 20 77 6f 72 64 54 6f 4e 75 6d |words[ wordToNum|
-00000940 28 77 6f 72 64 29 20 5d 20 7e 3d 20 77 6f 72 64 |(word) ] ~= word|
-00000950 2e 64 75 70 3b 20 20 20 20 20 20 20 20 2f 2f 20 |.dup; // |
-00000960 6d 75 73 74 20 64 75 70 0a 0a 20 20 20 20 2f 2f |must dup.. //|
-00000970 2f 20 46 69 6e 64 73 20 61 6c 6c 20 61 6c 74 65 |/ Finds all alte|
-00000980 72 6e 61 74 69 76 65 73 20 66 6f 72 20 74 68 65 |rnatives for the|
-00000990 20 67 69 76 65 6e 20 6e 75 6d 62 65 72 0a 20 20 | given number. |
-000009a0 20 20 2f 2f 2f 20 28 73 68 6f 75 6c 64 20 68 61 | /// (should ha|
-000009b0 76 65 20 62 65 65 6e 20 73 74 72 69 70 70 65 64 |ve been stripped|
-000009c0 20 66 72 6f 6d 20 6e 6f 6e 2d 64 69 67 69 74 20 | from non-digit |
-000009d0 63 68 61 72 61 63 74 65 72 73 29 0a 20 20 20 20 |characters). |
-000009e0 73 74 72 69 6e 67 61 72 72 61 79 20 5f 46 69 6e |stringarray _Fin|
-000009f0 64 57 6f 72 64 73 28 20 73 74 72 69 6e 67 20 6e |dWords( string n|
-00000a00 75 6d 62 65 72 73 2c 20 62 6f 6f 6c 20 64 69 67 |umbers, bool dig|
-00000a10 69 74 6f 6b 20 29 0a 20 20 20 20 69 6e 20 7b 0a |itok ). in {.|
-00000a20 20 20 20 20 20 20 20 20 61 73 73 65 72 74 28 6e | assert(n|
-00000a30 75 6d 62 65 72 73 2e 6c 65 6e 67 74 68 20 3e 20 |umbers.length > |
-00000a40 20 30 29 3b 20 20 20 20 0a 20 20 20 20 7d 20 20 | 0); . } |
-00000a50 20 20 0a 20 20 20 20 6f 75 74 28 72 65 73 75 6c | . out(resul|
-00000a60 74 29 20 7b 0a 20 20 20 20 20 20 20 20 66 6f 72 |t) {. for|
-00000a70 65 61 63 68 20 28 61 3b 20 72 65 73 75 6c 74 29 |each (a; result)|
-00000a80 0a 20 20 20 20 20 20 20 20 20 20 20 20 61 73 73 |. ass|
-00000a90 65 72 74 28 20 77 6f 72 64 54 6f 4e 75 6d 28 61 |ert( wordToNum(a|
-00000aa0 29 20 3d 3d 20 6e 75 6d 62 65 72 73 20 29 3b 0a |) == numbers );.|
-00000ab0 20 20 20 20 7d 20 20 20 20 0a 20 20 20 20 62 6f | } . bo|
-00000ac0 64 79 20 7b 0a 20 20 20 20 20 20 20 20 73 74 72 |dy {. str|
-00000ad0 69 6e 67 61 72 72 61 79 20 72 65 74 3b 0a 20 20 |ingarray ret;. |
-00000ae0 20 20 20 20 20 20 62 6f 6f 6c 20 66 6f 75 6e 64 | bool found|
-00000af0 77 6f 72 64 20 3d 20 66 61 6c 73 65 3b 0a 20 20 |word = false;. |
-00000b00 20 20 20 20 20 20 66 6f 72 20 28 75 69 6e 74 20 | for (uint |
-00000b10 74 3d 31 3b 20 74 3c 3d 6e 75 6d 62 65 72 73 2e |t=1; t<=numbers.|
-00000b20 6c 65 6e 67 74 68 3b 20 2b 2b 74 29 20 7b 0a 20 |length; ++t) {. |
-00000b30 20 20 20 20 20 20 20 20 20 20 20 61 75 74 6f 20 | auto |
-00000b40 61 6c 74 65 72 6e 61 74 69 76 65 73 20 3d 20 6e |alternatives = n|
-00000b50 75 6d 62 65 72 73 5b 30 2e 2e 74 5d 20 69 6e 20 |umbers[0..t] in |
-00000b60 6e 75 6d 32 77 6f 72 64 73 3b 0a 20 20 20 20 20 |num2words;. |
-00000b70 20 20 20 20 20 20 20 69 66 20 28 21 61 6c 74 65 | if (!alte|
-00000b80 72 6e 61 74 69 76 65 73 29 0a 20 20 20 20 20 20 |rnatives). |
-00000b90 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e | contin|
-00000ba0 75 65 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 |ue;. |
-00000bb0 66 6f 75 6e 64 77 6f 72 64 20 3d 20 74 72 75 65 |foundword = true|
-00000bc0 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 |;. if|
-00000bd0 20 28 6e 75 6d 62 65 72 73 2e 6c 65 6e 67 74 68 | (numbers.length|
-00000be0 20 3e 20 20 74 29 20 7b 0a 20 20 20 20 20 20 20 | > t) {. |
-00000bf0 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6d 62 | // Comb|
-00000c00 69 6e 65 20 61 6c 6c 20 63 75 72 72 65 6e 74 20 |ine all current |
-00000c10 61 6c 74 65 72 6e 61 74 69 76 65 73 20 77 69 74 |alternatives wit|
-00000c20 68 20 61 6c 6c 20 61 6c 74 65 72 6e 61 74 69 76 |h all alternativ|
-00000c30 65 73 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 |es . |
-00000c40 20 20 20 20 20 20 20 20 2f 2f 20 6f 66 20 74 68 | // of th|
-00000c50 65 20 72 65 73 74 20 28 6e 65 78 74 20 70 69 65 |e rest (next pie|
-00000c60 63 65 20 63 61 6e 20 73 74 61 72 74 20 77 69 74 |ce can start wit|
-00000c70 68 20 61 20 64 69 67 69 74 29 20 20 20 20 20 20 |h a digit) |
-00000c80 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 | . |
-00000c90 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 | foreach|
-00000ca0 20 28 61 32 3b 20 5f 46 69 6e 64 57 6f 72 64 73 | (a2; _FindWords|
-00000cb0 28 20 6e 75 6d 62 65 72 73 5b 74 2e 2e 24 5d 2c |( numbers[t..$],|
-00000cc0 20 74 72 75 65 20 20 20 20 20 29 20 29 0a 20 20 | true ) ). |
-00000cd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
-00000ce0 20 20 66 6f 72 65 61 63 68 28 61 31 3b 20 2a 61 | foreach(a1; *a|
-00000cf0 6c 74 65 72 6e 61 74 69 76 65 73 29 0a 20 20 20 |lternatives). |
-00000d00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
-00000d10 20 20 20 20 72 65 74 20 7e 3d 20 61 31 20 7e 20 | ret ~= a1 ~ |
-00000d20 22 20 22 20 7e 20 61 32 3b 0a 20 20 20 20 20 20 |" " ~ a2;. |
-00000d30 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 | }. |
-00000d40 20 20 20 20 65 6c 73 65 20 20 20 20 0a 20 20 20 | else . |
-00000d50 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 | ret|
-00000d60 20 7e 3d 20 2a 61 6c 74 65 72 6e 61 74 69 76 65 | ~= *alternative|
-00000d70 73 3b 20 20 20 20 2f 2f 20 61 70 70 65 6e 64 20 |s; // append |
-00000d80 74 68 65 73 65 20 61 6c 74 65 72 6e 61 74 69 76 |these alternativ|
-00000d90 65 73 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 |es. }. |
-00000da0 20 20 20 20 20 2f 2f 20 54 72 79 20 74 6f 20 6b | // Try to k|
-00000db0 65 65 70 20 31 20 64 69 67 69 74 2c 20 6f 6e 6c |eep 1 digit, onl|
-00000dc0 79 20 69 66 20 77 65 27 72 65 20 61 6c 6c 6f 77 |y if we're allow|
-00000dd0 65 64 20 61 6e 64 20 6e 6f 20 6f 74 68 65 72 0a |ed and no other.|
-00000de0 20 20 20 20 20 20 20 20 2f 2f 20 61 6c 74 65 72 | // alter|
-00000df0 6e 61 74 69 76 65 73 20 77 65 72 65 20 66 6f 75 |natives were fou|
-00000e00 6e 64 0a 20 20 20 20 20 20 20 20 2f 2f 20 54 65 |nd. // Te|
-00000e10 73 74 69 6e 67 20 22 72 65 74 2e 6c 65 6e 67 74 |sting "ret.lengt|
-00000e20 68 22 20 6d 61 6b 65 73 20 6d 6f 72 65 20 73 65 |h" makes more se|
-00000e30 6e 73 65 20 74 68 61 6e 20 74 65 73 74 69 6e 67 |nse than testing|
-00000e40 20 22 66 6f 75 6e 64 77 6f 72 64 22 2c 0a 20 20 | "foundword",. |
-00000e50 20 20 20 20 20 20 2f 2f 20 62 75 74 20 74 68 65 | // but the|
-00000e60 20 6f 74 68 65 72 20 69 6d 70 6c 65 6d 65 6e 74 | other implement|
-00000e70 61 74 69 6f 6e 73 20 73 65 65 6d 20 74 6f 20 64 |ations seem to d|
-00000e80 6f 20 6a 75 73 74 20 74 68 69 73 2e 0a 20 20 20 |o just this.. |
-00000e90 20 20 20 20 20 69 66 20 28 64 69 67 69 74 6f 6b | if (digitok|
-00000ea0 20 26 26 20 21 66 6f 75 6e 64 77 6f 72 64 29 20 | && !foundword) |
-00000eb0 7b 20 2f 2f 72 65 74 2e 6c 65 6e 67 74 68 20 3d |{ //ret.length =|
-00000ec0 3d 20 30 20 20 0a 20 20 20 20 20 20 20 20 20 20 |= 0 . |
-00000ed0 20 20 69 66 28 6e 75 6d 62 65 72 73 2e 6c 65 6e | if(numbers.len|
-00000ee0 67 74 68 20 3e 20 20 31 29 20 7b 0a 20 20 20 20 |gth > 1) {. |
-00000ef0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 | // C|
-00000f00 6f 6d 62 69 6e 65 20 31 20 64 69 67 69 74 20 77 |ombine 1 digit w|
-00000f10 69 74 68 20 61 6c 6c 20 61 6c 74 65 6e 61 74 69 |ith all altenati|
-00000f20 76 65 73 20 66 72 6f 6d 20 74 68 65 20 72 65 73 |ves from the res|
-00000f30 74 20 20 20 20 0a 20 20 20 20 20 20 20 20 20 20 |t . |
-00000f40 20 20 20 20 20 20 2f 2f 20 28 6e 65 78 74 20 70 | // (next p|
-00000f50 69 65 63 65 20 63 61 6e 20 6e 6f 74 20 73 74 61 |iece can not sta|
-00000f60 72 74 20 77 69 74 68 20 61 20 64 69 67 69 74 29 |rt with a digit)|
-00000f70 20 20 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 | . |
-00000f80 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 | forea|
-00000f90 63 68 20 28 61 3b 20 5f 46 69 6e 64 57 6f 72 64 |ch (a; _FindWord|
-00000fa0 73 28 20 6e 75 6d 62 65 72 73 5b 31 2e 2e 24 5d |s( numbers[1..$]|
-00000fb0 2c 20 66 61 6c 73 65 20 29 20 29 0a 20 20 20 20 |, false ) ). |
-00000fc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
-00000fd0 72 65 74 20 7e 3d 20 6e 75 6d 62 65 72 73 5b 30 |ret ~= numbers[0|
-00000fe0 2e 2e 31 5d 20 7e 20 22 20 22 20 7e 20 61 3b 0a |..1] ~ " " ~ a;.|
-00000ff0 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 20 20 | } |
-00001000 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c | . el|
-00001010 73 65 20 20 20 20 0a 20 20 20 20 20 20 20 20 20 |se . |
-00001020 20 20 20 20 20 20 20 72 65 74 20 7e 3d 20 6e 75 | ret ~= nu|
-00001030 6d 62 65 72 73 5b 30 2e 2e 31 5d 3b 20 20 20 20 |mbers[0..1]; |
-00001040 2f 2f 20 6a 75 73 74 20 61 70 70 65 6e 64 20 74 |// just append t|
-00001050 68 69 73 20 64 69 67 69 74 20 20 20 20 20 20 20 |his digit |
-00001060 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 7d | . }|
-00001070 20 20 20 20 0a 20 20 20 20 20 20 20 20 72 65 74 | . ret|
-00001080 75 72 6e 20 72 65 74 3b 0a 20 20 20 20 7d 0a 0a |urn ret;. }..|
-00001090 20 20 20 20 2f 2f 2f 20 28 54 68 69 73 20 66 75 | /// (This fu|
-000010a0 6e 63 74 69 6f 6e 20 77 61 73 20 69 6e 6c 69 6e |nction was inlin|
-000010b0 65 64 20 69 6e 20 74 68 65 20 6f 72 69 67 69 6e |ed in the origin|
-000010c0 61 6c 20 70 72 6f 67 72 61 6d 29 20 0a 20 20 20 |al program) . |
-000010d0 20 2f 2f 2f 20 46 69 6e 64 73 20 61 6c 6c 20 61 | /// Finds all a|
-000010e0 6c 74 65 72 6e 61 74 69 76 65 73 20 66 6f 72 20 |lternatives for |
-000010f0 74 68 65 20 67 69 76 65 6e 20 70 68 6f 6e 65 20 |the given phone |
-00001100 6e 75 6d 62 65 72 20 0a 20 20 20 20 2f 2f 2f 20 |number . /// |
-00001110 52 65 74 75 72 6e 73 3a 20 61 72 72 61 79 20 6f |Returns: array o|
-00001120 66 20 73 74 72 69 6e 67 73 20 0a 20 20 20 20 73 |f strings . s|
-00001130 74 72 69 6e 67 61 72 72 61 79 20 46 69 6e 64 57 |tringarray FindW|
-00001140 6f 72 64 73 28 20 73 74 72 69 6e 67 20 70 68 6f |ords( string pho|
-00001150 6e 65 5f 6e 75 6d 62 65 72 20 29 0a 20 20 20 20 |ne_number ). |
-00001160 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 70 |{. if (!p|
-00001170 68 6f 6e 65 5f 6e 75 6d 62 65 72 2e 6c 65 6e 67 |hone_number.leng|
-00001180 74 68 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 |th). |
-00001190 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 20 20 20 |return null;. |
-000011a0 20 20 20 20 20 2f 2f 20 53 74 72 69 70 20 74 68 | // Strip th|
-000011b0 65 20 6e 6f 6e 2d 64 69 67 69 74 20 63 68 61 72 |e non-digit char|
-000011c0 61 63 74 65 72 73 20 66 72 6f 6d 20 74 68 65 20 |acters from the |
-000011d0 70 68 6f 6e 65 20 6e 75 6d 62 65 72 2c 20 61 6e |phone number, an|
-000011e0 64 0a 20 20 20 20 20 20 20 20 2f 2f 20 70 61 73 |d. // pas|
-000011f0 73 20 69 74 20 74 6f 20 74 68 65 20 72 65 63 75 |s it to the recu|
-00001200 72 73 69 76 65 20 66 75 6e 63 74 69 6f 6e 20 28 |rsive function (|
-00001210 6c 65 61 64 69 6e 67 20 64 69 67 69 74 20 69 73 |leading digit is|
-00001220 20 61 6c 6c 6f 77 65 64 29 0a 20 20 20 20 20 20 | allowed). |
-00001230 20 20 72 65 74 75 72 6e 20 5f 46 69 6e 64 57 6f | return _FindWo|
-00001240 72 64 73 28 20 73 74 72 69 70 4e 6f 6e 44 69 67 |rds( stripNonDig|
-00001250 69 74 28 70 68 6f 6e 65 5f 6e 75 6d 62 65 72 29 |it(phone_number)|
-00001260 2c 20 74 72 75 65 20 29 3b 20 20 20 20 0a 20 20 |, true ); . |
-00001270 20 20 7d 20 20 20 20 0a 20 20 20 20 0a 20 20 20 | } . . |
-00001280 20 2f 2f 20 52 65 61 64 20 74 68 65 20 70 68 6f | // Read the pho|
-00001290 6e 65 20 6e 75 6d 62 65 72 73 20 20 20 20 20 0a |ne numbers .|
-000012a0 20 20 20 20 66 6f 72 65 61 63 68 28 73 74 72 69 | foreach(stri|
-000012b0 6e 67 20 70 68 6f 6e 65 3b 20 6e 65 77 20 42 75 |ng phone; new Bu|
-000012c0 66 66 65 72 65 64 46 69 6c 65 28 22 69 6e 70 75 |fferedFile("inpu|
-000012d0 74 2e 74 78 74 22 20 20 20 29 20 29 0a 20 20 20 |t.txt" ) ). |
-000012e0 20 20 20 20 20 66 6f 72 65 61 63 68 28 61 6c 74 | foreach(alt|
-000012f0 65 72 6e 61 74 69 76 65 3b 20 46 69 6e 64 57 6f |ernative; FindWo|
-00001300 72 64 73 28 20 70 68 6f 6e 65 20 29 20 29 0a 20 |rds( phone ) ). |
-00001310 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 | write|
-00001320 66 6c 6e 28 70 68 6f 6e 65 2c 20 22 3a 20 22 2c |fln(phone, ": ",|
-00001330 20 61 6c 74 65 72 6e 61 74 69 76 65 20 29 3b 0a | alternative );.|
-00001340 7d 0a 0a |}..|
-00001343
diff --git a/tests/examplefiles/hexdump_hexcat b/tests/examplefiles/hexdump_hexcat
deleted file mode 100644
index 522074cf..00000000
--- a/tests/examplefiles/hexdump_hexcat
+++ /dev/null
@@ -1,247 +0,0 @@
-00000000 2F 2F 20 43 72 65 61 74 65 64 20 62 79 20 4C 69 6F 6E 65 6C //.Created.by.Lionel
-00000014 6C 6F 20 4C 75 6E 65 73 75 20 61 6E 64 20 70 6C 61 63 65 64 lo.Lunesu.and.placed
-00000028 20 69 6E 20 74 68 65 20 70 75 62 6C 69 63 20 64 6F 6D 61 69 .in.the.public.domai
-0000003C 6E 2E 0A 2F 2F 20 54 68 69 73 20 66 69 6C 65 20 68 61 73 20 n..//.This.file.has.
-00000050 62 65 65 6E 20 6D 6F 64 69 66 69 65 64 20 66 72 6F 6D 20 69 been.modified.from.i
-00000064 74 73 20 6F 72 69 67 69 6E 61 6C 20 76 65 72 73 69 6F 6E 2E ts.original.version.
-00000078 0A 2F 2F 20 49 74 20 68 61 73 20 62 65 65 6E 20 66 6F 72 6D .//.It.has.been.form
-0000008C 61 74 74 65 64 20 74 6F 20 66 69 74 20 79 6F 75 72 20 73 63 atted.to.fit.your.sc
-000000A0 72 65 65 6E 2E 0A 6D 6F 64 75 6C 65 20 70 68 6F 6E 65 6E 6F reen..module.phoneno
-000000B4 3B 20 20 20 20 20 2F 2F 20 6F 70 74 69 6F 6E 61 6C 0A 69 6D ;.....//.optional.im
-000000C8 70 6F 72 74 20 73 74 64 2E 73 74 64 69 6F 3B 20 20 20 2F 2F port.std.stdio;...//
-000000DC 20 77 72 69 74 65 66 6C 6E 20 20 20 20 20 0A 69 6D 70 6F 72 .writefln......impor
-000000F0 74 20 73 74 64 2E 63 74 79 70 65 3B 20 20 20 2F 2F 20 69 73 t.std.ctype;...//.is
-00000104 64 69 67 69 74 20 20 20 20 20 0A 69 6D 70 6F 72 74 20 73 74 digit......import.st
-00000118 64 2E 73 74 72 65 61 6D 3B 20 20 2F 2F 20 42 75 66 66 65 72 d.stream;..//.Buffer
-0000012C 65 64 46 69 6C 65 0A 0A 2F 2F 20 4A 75 73 74 20 66 6F 72 20 edFile..//.Just.for.
-00000140 72 65 61 64 61 62 69 6C 69 74 79 20 28 69 6D 61 67 69 6E 65 readability.(imagine
-00000154 20 63 68 61 72 5B 5D 5B 5D 5B 63 68 61 72 5B 5D 5D 29 20 20 .char[][][char[]])..
-00000168 20 20 0A 61 6C 69 61 73 20 63 68 61 72 5B 5D 20 73 74 72 69 ...alias.char[].stri
-0000017C 6E 67 3B 0A 61 6C 69 61 73 20 73 74 72 69 6E 67 5B 5D 20 73 ng;.alias.string[].s
-00000190 74 72 69 6E 67 61 72 72 61 79 3B 0A 0A 2F 2F 2F 20 53 74 72 tringarray;..///.Str
-000001A4 69 70 73 20 6E 6F 6E 2D 64 69 67 69 74 20 63 68 61 72 61 63 ips.non-digit.charac
-000001B8 74 65 72 73 20 66 72 6F 6D 20 74 68 65 20 73 74 72 69 6E 67 ters.from.the.string
-000001CC 20 28 43 4F 57 29 0A 73 74 72 69 6E 67 20 73 74 72 69 70 4E .(COW).string.stripN
-000001E0 6F 6E 44 69 67 69 74 28 20 69 6E 20 73 74 72 69 6E 67 20 6C onDigit(.in.string.l
-000001F4 69 6E 65 20 29 20 0A 7B 0A 20 20 20 20 73 74 72 69 6E 67 20 ine.)..{.....string.
-00000208 72 65 74 3B 0A 20 20 20 20 66 6F 72 65 61 63 68 28 75 69 6E ret;.....foreach(uin
-0000021C 74 20 69 2C 20 63 3B 20 6C 69 6E 65 29 20 7B 0A 20 20 20 20 t.i,.c;.line).{.....
-00000230 20 20 20 20 2F 2F 20 45 72 72 6F 72 3A 20 73 74 64 2E 63 74 ....//.Error:.std.ct
-00000244 79 70 65 2E 69 73 64 69 67 69 74 20 61 74 20 43 3A 5C 64 6D ype.isdigit.at.C:\dm
-00000258 64 5C 73 72 63 5C 70 68 6F 62 6F 73 5C 73 74 64 5C 63 74 79 d\src\phobos\std\cty
-0000026C 70 65 2E 64 28 33 37 29 20 0A 20 20 20 20 20 20 20 20 2F 2F pe.d(37)..........//
-00000280 20 63 6F 6E 66 6C 69 63 74 73 20 77 69 74 68 20 73 74 64 2E .conflicts.with.std.
-00000294 73 74 72 65 61 6D 2E 69 73 64 69 67 69 74 20 61 74 20 43 3A stream.isdigit.at.C:
-000002A8 5C 64 6D 64 5C 73 72 63 5C 70 68 6F 62 6F 73 5C 73 74 64 5C \dmd\src\phobos\std\
-000002BC 73 74 72 65 61 6D 2E 64 28 32 39 32 34 29 0A 20 20 20 20 20 stream.d(2924)......
-000002D0 20 20 20 69 66 20 28 21 73 74 64 2E 63 74 79 70 65 2E 69 73 ...if.(!std.ctype.is
-000002E4 64 69 67 69 74 28 63 29 29 20 7B 0A 20 20 20 20 20 20 20 20 digit(c)).{.........
-000002F8 20 20 20 20 69 66 20 28 21 72 65 74 29 0A 20 20 20 20 20 20 ....if.(!ret).......
-0000030C 20 20 20 20 20 20 20 20 20 20 72 65 74 20 3D 20 6C 69 6E 65 ..........ret.=.line
-00000320 5B 30 2E 2E 69 5D 3B 20 20 20 20 0A 20 20 20 20 20 20 20 20 [0..i];.............
-00000334 7D 20 20 20 20 0A 20 20 20 20 20 20 20 20 65 6C 73 65 20 69 }.............else.i
-00000348 66 20 28 72 65 74 29 0A 20 20 20 20 20 20 20 20 20 20 20 20 f.(ret).............
-0000035C 72 65 74 20 7E 3D 20 63 3B 20 20 20 20 0A 20 20 20 20 7D 20 ret.~=.c;.........}.
-00000370 20 20 20 0A 20 20 20 20 72 65 74 75 72 6E 20 72 65 74 3F 72 ........return.ret?r
-00000384 65 74 3A 6C 69 6E 65 3B 0A 7D 0A 0A 75 6E 69 74 74 65 73 74 et:line;.}..unittest
-00000398 20 7B 0A 20 20 20 20 61 73 73 65 72 74 28 20 73 74 72 69 70 .{.....assert(.strip
-000003AC 4E 6F 6E 44 69 67 69 74 28 22 61 73 64 66 22 29 20 3D 3D 20 NonDigit("asdf").==.
-000003C0 22 22 20 20 29 3B 0A 20 20 20 20 61 73 73 65 72 74 28 20 73 ""..);.....assert(.s
-000003D4 74 72 69 70 4E 6F 6E 44 69 67 69 74 28 22 5C 27 31 33 2D 3D tripNonDigit("\'13-=
-000003E8 32 20 34 6B 6F 70 22 29 20 3D 3D 20 20 22 31 33 32 34 22 20 2.4kop").==.."1324".
-000003FC 20 29 3B 0A 7D 0A 0A 2F 2F 2F 20 43 6F 6E 76 65 72 74 73 20 .);.}..///.Converts.
-00000410 61 20 77 6F 72 64 20 69 6E 74 6F 20 61 20 6E 75 6D 62 65 72 a.word.into.a.number
-00000424 2C 20 69 67 6E 6F 72 69 6E 67 20 61 6C 6C 20 6E 6F 6E 20 61 ,.ignoring.all.non.a
-00000438 6C 70 68 61 20 63 68 61 72 61 63 74 65 72 73 20 20 0A 73 74 lpha.characters...st
-0000044C 72 69 6E 67 20 77 6F 72 64 54 6F 4E 75 6D 28 20 69 6E 20 73 ring.wordToNum(.in.s
-00000460 74 72 69 6E 67 20 77 6F 72 64 20 29 0A 7B 0A 2F 2F 20 74 72 tring.word.).{.//.tr
-00000474 61 6E 73 6C 61 74 69 6F 6E 20 74 61 62 6C 65 20 66 6F 72 20 anslation.table.for.
-00000488 74 68 65 20 74 61 73 6B 20 61 74 20 68 61 6E 64 0A 63 6F 6E the.task.at.hand.con
-0000049C 73 74 20 63 68 61 72 5B 32 35 36 5D 20 54 52 41 4E 53 4C 41 st.char[256].TRANSLA
-000004B0 54 45 20 3D 20 20 20 20 0A 20 20 20 20 22 20 20 20 20 20 20 TE.=........."......
-000004C4 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....................
-000004D8 20 20 20 20 20 20 22 20 20 2F 2F 20 30 20 20 20 0A 20 20 20 ......"..//.0.......
-000004EC 20 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 31 ."................01
-00000500 32 33 34 35 36 37 38 39 20 20 20 20 20 20 22 20 20 2F 2F 20 23456789......"..//.
-00000514 33 32 20 20 20 20 20 0A 20 20 20 20 22 20 35 37 36 33 30 34 32..........".576304
-00000528 39 39 36 31 37 38 35 31 38 38 31 32 33 34 37 36 32 32 33 39 99617851881234762239
-0000053C 20 20 20 20 20 22 20 20 2F 2F 20 36 34 20 20 20 0A 20 20 20 ....."..//.64.......
-00000550 20 22 20 35 37 36 33 30 34 39 39 36 31 37 38 35 31 38 38 31 .".57630499617851881
-00000564 32 33 34 37 36 32 32 33 39 20 20 20 20 20 22 0A 20 20 20 20 234762239.....".....
-00000578 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 "...................
-0000058C 20 20 20 20 20 20 20 20 20 20 20 20 20 22 0A 20 20 20 20 22 ............."....."
-000005A0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....................
-000005B4 20 20 20 20 20 20 20 20 20 20 20 20 22 0A 20 20 20 20 22 20 ............".....".
-000005C8 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....................
-000005DC 20 20 20 20 20 20 20 20 20 20 20 22 20 20 20 20 0A 20 20 20 ..........."........
-000005F0 20 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ."..................
-00000604 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 3B 0A 20 20 20 ..............";....
-00000618 20 73 74 72 69 6E 67 20 72 65 74 3B 0A 20 20 20 20 66 6F 72 .string.ret;.....for
-0000062C 65 61 63 68 28 63 3B 20 63 61 73 74 28 75 62 79 74 65 5B 5D each(c;.cast(ubyte[]
-00000640 29 77 6F 72 64 29 0A 20 20 20 20 20 20 20 20 69 66 20 28 54 )word).........if.(T
-00000654 52 41 4E 53 4C 41 54 45 5B 63 5D 20 21 3D 20 27 20 27 29 0A RANSLATE[c].!=.'.').
-00000668 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 20 7E 3D 20 54 ............ret.~=.T
-0000067C 52 41 4E 53 4C 41 54 45 5B 63 5D 3B 0A 20 20 20 20 72 65 74 RANSLATE[c];.....ret
-00000690 75 72 6E 20 72 65 74 3B 0A 7D 0A 0A 75 6E 69 74 74 65 73 74 urn.ret;.}..unittest
-000006A4 20 7B 0A 20 2F 2F 20 54 65 73 74 20 77 6F 72 64 54 6F 4E 75 .{..//.Test.wordToNu
-000006B8 6D 20 75 73 69 6E 67 20 74 68 65 20 74 61 62 6C 65 20 66 72 m.using.the.table.fr
-000006CC 6F 6D 20 74 68 65 20 74 61 73 6B 20 64 65 73 63 72 69 70 74 om.the.task.descript
-000006E0 69 6F 6E 2E 0A 20 61 73 73 65 72 74 28 20 22 30 31 31 31 32 ion...assert(."01112
-000006F4 32 32 33 33 33 34 34 35 35 36 36 36 37 37 37 38 38 38 39 39 22333445566677788899
-00000708 39 22 20 3D 3D 0A 20 20 20 77 6F 72 64 54 6F 4E 75 6D 28 22 9".==....wordToNum("
-0000071C 45 20 7C 20 4A 20 4E 20 51 20 7C 20 52 20 57 20 58 20 7C 20 E.|.J.N.Q.|.R.W.X.|.
-00000730 44 20 53 20 59 20 7C 20 46 20 54 20 7C 20 41 20 4D 20 7C 20 D.S.Y.|.F.T.|.A.M.|.
-00000744 43 20 49 20 56 20 7C 20 42 20 4B 20 55 20 7C 20 4C 20 4F 20 C.I.V.|.B.K.U.|.L.O.
-00000758 50 20 7C 20 47 20 48 20 5A 22 29 29 3B 0A 20 61 73 73 65 72 P.|.G.H.Z"));..asser
-0000076C 74 28 20 22 30 31 31 31 32 32 32 33 33 33 34 34 35 35 36 36 t(."0111222333445566
-00000780 36 37 37 37 38 38 38 39 39 39 22 20 3D 3D 20 0A 20 20 20 77 6777888999".==.....w
-00000794 6F 72 64 54 6F 4E 75 6D 28 22 65 20 7C 20 6A 20 6E 20 71 20 ordToNum("e.|.j.n.q.
-000007A8 7C 20 72 20 77 20 78 20 7C 20 64 20 73 20 79 20 7C 20 66 20 |.r.w.x.|.d.s.y.|.f.
-000007BC 74 20 7C 20 61 20 6D 20 7C 20 63 20 69 20 76 20 7C 20 62 20 t.|.a.m.|.c.i.v.|.b.
-000007D0 6B 20 75 20 7C 20 6C 20 6F 20 70 20 7C 20 67 20 68 20 7A 22 k.u.|.l.o.p.|.g.h.z"
-000007E4 29 29 3B 0A 20 61 73 73 65 72 74 28 20 22 30 31 32 33 34 35 ));..assert(."012345
-000007F8 36 37 38 39 22 20 3D 3D 20 0A 20 20 20 77 6F 72 64 54 6F 4E 6789".==.....wordToN
-0000080C 75 6D 28 22 30 20 7C 20 20 20 31 20 20 20 7C 20 20 20 32 20 um("0.|...1...|...2.
-00000820 20 20 7C 20 20 20 33 20 20 20 7C 20 20 34 20 20 7C 20 20 35 ..|...3...|..4..|..5
-00000834 20 20 7C 20 20 20 36 20 20 20 7C 20 20 20 37 20 20 20 7C 20 ..|...6...|...7...|.
-00000848 20 20 38 20 20 20 7C 20 20 20 39 22 29 29 3B 0A 7D 0A 0A 76 ..8...|...9"));.}..v
-0000085C 6F 69 64 20 6D 61 69 6E 28 20 73 74 72 69 6E 67 5B 5D 20 61 oid.main(.string[].a
-00000870 72 67 73 20 29 0A 7B 0A 20 20 20 20 2F 2F 20 54 68 69 73 20 rgs.).{.....//.This.
-00000884 61 73 73 6F 63 69 61 74 69 76 65 20 61 72 72 61 79 20 6D 61 associative.array.ma
-00000898 70 73 20 61 20 6E 75 6D 62 65 72 20 74 6F 20 61 6E 20 61 72 ps.a.number.to.an.ar
-000008AC 72 61 79 20 6F 66 20 77 6F 72 64 73 2E 20 20 20 20 0A 20 20 ray.of.words........
-000008C0 20 20 73 74 72 69 6E 67 61 72 72 61 79 5B 73 74 72 69 6E 67 ..stringarray[string
-000008D4 5D 20 20 20 20 6E 75 6D 32 77 6F 72 64 73 3B 0A 0A 20 20 20 ]....num2words;.....
-000008E8 20 66 6F 72 65 61 63 68 28 73 74 72 69 6E 67 20 77 6F 72 64 .foreach(string.word
-000008FC 3B 20 6E 65 77 20 42 75 66 66 65 72 65 64 46 69 6C 65 28 22 ;.new.BufferedFile("
-00000910 64 69 63 74 69 6F 6E 61 72 79 2E 74 78 74 22 20 29 20 29 0A dictionary.txt".).).
-00000924 20 20 20 20 20 20 20 20 6E 75 6D 32 77 6F 72 64 73 5B 20 77 ........num2words[.w
-00000938 6F 72 64 54 6F 4E 75 6D 28 77 6F 72 64 29 20 5D 20 7E 3D 20 ordToNum(word).].~=.
-0000094C 77 6F 72 64 2E 64 75 70 3B 20 20 20 20 20 20 20 20 2F 2F 20 word.dup;........//.
-00000960 6D 75 73 74 20 64 75 70 0A 0A 20 20 20 20 2F 2F 2F 20 46 69 must.dup......///.Fi
-00000974 6E 64 73 20 61 6C 6C 20 61 6C 74 65 72 6E 61 74 69 76 65 73 nds.all.alternatives
-00000988 20 66 6F 72 20 74 68 65 20 67 69 76 65 6E 20 6E 75 6D 62 65 .for.the.given.numbe
-0000099C 72 0A 20 20 20 20 2F 2F 2F 20 28 73 68 6F 75 6C 64 20 68 61 r.....///.(should.ha
-000009B0 76 65 20 62 65 65 6E 20 73 74 72 69 70 70 65 64 20 66 72 6F ve.been.stripped.fro
-000009C4 6D 20 6E 6F 6E 2D 64 69 67 69 74 20 63 68 61 72 61 63 74 65 m.non-digit.characte
-000009D8 72 73 29 0A 20 20 20 20 73 74 72 69 6E 67 61 72 72 61 79 20 rs).....stringarray.
-000009EC 5F 46 69 6E 64 57 6F 72 64 73 28 20 73 74 72 69 6E 67 20 6E _FindWords(.string.n
-00000A00 75 6D 62 65 72 73 2C 20 62 6F 6F 6C 20 64 69 67 69 74 6F 6B umbers,.bool.digitok
-00000A14 20 29 0A 20 20 20 20 69 6E 20 7B 0A 20 20 20 20 20 20 20 20 .).....in.{.........
-00000A28 61 73 73 65 72 74 28 6E 75 6D 62 65 72 73 2E 6C 65 6E 67 74 assert(numbers.lengt
-00000A3C 68 20 3E 20 20 30 29 3B 20 20 20 20 0A 20 20 20 20 7D 20 20 h.>..0);.........}..
-00000A50 20 20 0A 20 20 20 20 6F 75 74 28 72 65 73 75 6C 74 29 20 7B .......out(result).{
-00000A64 0A 20 20 20 20 20 20 20 20 66 6F 72 65 61 63 68 20 28 61 3B .........foreach.(a;
-00000A78 20 72 65 73 75 6C 74 29 0A 20 20 20 20 20 20 20 20 20 20 20 .result)............
-00000A8C 20 61 73 73 65 72 74 28 20 77 6F 72 64 54 6F 4E 75 6D 28 61 .assert(.wordToNum(a
-00000AA0 29 20 3D 3D 20 6E 75 6D 62 65 72 73 20 29 3B 0A 20 20 20 20 ).==.numbers.);.....
-00000AB4 7D 20 20 20 20 0A 20 20 20 20 62 6F 64 79 20 7B 0A 20 20 20 }.........body.{....
-00000AC8 20 20 20 20 20 73 74 72 69 6E 67 61 72 72 61 79 20 72 65 74 .....stringarray.ret
-00000ADC 3B 0A 20 20 20 20 20 20 20 20 62 6F 6F 6C 20 66 6F 75 6E 64 ;.........bool.found
-00000AF0 77 6F 72 64 20 3D 20 66 61 6C 73 65 3B 0A 20 20 20 20 20 20 word.=.false;.......
-00000B04 20 20 66 6F 72 20 28 75 69 6E 74 20 74 3D 31 3B 20 74 3C 3D ..for.(uint.t=1;.t<=
-00000B18 6E 75 6D 62 65 72 73 2E 6C 65 6E 67 74 68 3B 20 2B 2B 74 29 numbers.length;.++t)
-00000B2C 20 7B 0A 20 20 20 20 20 20 20 20 20 20 20 20 61 75 74 6F 20 .{.............auto.
-00000B40 61 6C 74 65 72 6E 61 74 69 76 65 73 20 3D 20 6E 75 6D 62 65 alternatives.=.numbe
-00000B54 72 73 5B 30 2E 2E 74 5D 20 69 6E 20 6E 75 6D 32 77 6F 72 64 rs[0..t].in.num2word
-00000B68 73 3B 0A 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 s;.............if.(!
-00000B7C 61 6C 74 65 72 6E 61 74 69 76 65 73 29 0A 20 20 20 20 20 20 alternatives).......
-00000B90 20 20 20 20 20 20 20 20 20 20 63 6F 6E 74 69 6E 75 65 3B 0A ..........continue;.
-00000BA4 20 20 20 20 20 20 20 20 20 20 20 20 66 6F 75 6E 64 77 6F 72 ............foundwor
-00000BB8 64 20 3D 20 74 72 75 65 3B 0A 20 20 20 20 20 20 20 20 20 20 d.=.true;...........
-00000BCC 20 20 69 66 20 28 6E 75 6D 62 65 72 73 2E 6C 65 6E 67 74 68 ..if.(numbers.length
-00000BE0 20 3E 20 20 74 29 20 7B 0A 20 20 20 20 20 20 20 20 20 20 20 .>..t).{............
-00000BF4 20 20 20 20 20 2F 2F 20 43 6F 6D 62 69 6E 65 20 61 6C 6C 20 .....//.Combine.all.
-00000C08 63 75 72 72 65 6E 74 20 61 6C 74 65 72 6E 61 74 69 76 65 73 current.alternatives
-00000C1C 20 77 69 74 68 20 61 6C 6C 20 61 6C 74 65 72 6E 61 74 69 76 .with.all.alternativ
-00000C30 65 73 20 20 20 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 es..................
-00000C44 20 20 20 20 2F 2F 20 6F 66 20 74 68 65 20 72 65 73 74 20 28 ....//.of.the.rest.(
-00000C58 6E 65 78 74 20 70 69 65 63 65 20 63 61 6E 20 73 74 61 72 74 next.piece.can.start
-00000C6C 20 77 69 74 68 20 61 20 64 69 67 69 74 29 20 20 20 20 20 20 .with.a.digit)......
-00000C80 20 20 20 20 20 20 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 ....................
-00000C94 20 20 20 20 20 66 6F 72 65 61 63 68 20 28 61 32 3B 20 5F 46 .....foreach.(a2;._F
-00000CA8 69 6E 64 57 6F 72 64 73 28 20 6E 75 6D 62 65 72 73 5B 74 2E indWords(.numbers[t.
-00000CBC 2E 24 5D 2C 20 74 72 75 65 20 20 20 20 20 29 20 29 0A 20 20 .$],.true.....).)...
-00000CD0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6F ..................fo
-00000CE4 72 65 61 63 68 28 61 31 3B 20 2A 61 6C 74 65 72 6E 61 74 69 reach(a1;.*alternati
-00000CF8 76 65 73 29 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ves)................
-00000D0C 20 20 20 20 20 20 20 20 72 65 74 20 7E 3D 20 61 31 20 7E 20 ........ret.~=.a1.~.
-00000D20 22 20 22 20 7E 20 61 32 3B 0A 20 20 20 20 20 20 20 20 20 20 ".".~.a2;...........
-00000D34 20 20 7D 0A 20 20 20 20 20 20 20 20 20 20 20 20 65 6C 73 65 ..}.............else
-00000D48 20 20 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....................
-00000D5C 20 72 65 74 20 7E 3D 20 2A 61 6C 74 65 72 6E 61 74 69 76 65 .ret.~=.*alternative
-00000D70 73 3B 20 20 20 20 2F 2F 20 61 70 70 65 6E 64 20 74 68 65 73 s;....//.append.thes
-00000D84 65 20 61 6C 74 65 72 6E 61 74 69 76 65 73 0A 20 20 20 20 20 e.alternatives......
-00000D98 20 20 20 7D 0A 20 20 20 20 20 20 20 20 2F 2F 20 54 72 79 20 ...}.........//.Try.
-00000DAC 74 6F 20 6B 65 65 70 20 31 20 64 69 67 69 74 2C 20 6F 6E 6C to.keep.1.digit,.onl
-00000DC0 79 20 69 66 20 77 65 27 72 65 20 61 6C 6C 6F 77 65 64 20 61 y.if.we're.allowed.a
-00000DD4 6E 64 20 6E 6F 20 6F 74 68 65 72 0A 20 20 20 20 20 20 20 20 nd.no.other.........
-00000DE8 2F 2F 20 61 6C 74 65 72 6E 61 74 69 76 65 73 20 77 65 72 65 //.alternatives.were
-00000DFC 20 66 6F 75 6E 64 0A 20 20 20 20 20 20 20 20 2F 2F 20 54 65 .found.........//.Te
-00000E10 73 74 69 6E 67 20 22 72 65 74 2E 6C 65 6E 67 74 68 22 20 6D sting."ret.length".m
-00000E24 61 6B 65 73 20 6D 6F 72 65 20 73 65 6E 73 65 20 74 68 61 6E akes.more.sense.than
-00000E38 20 74 65 73 74 69 6E 67 20 22 66 6F 75 6E 64 77 6F 72 64 22 .testing."foundword"
-00000E4C 2C 0A 20 20 20 20 20 20 20 20 2F 2F 20 62 75 74 20 74 68 65 ,.........//.but.the
-00000E60 20 6F 74 68 65 72 20 69 6D 70 6C 65 6D 65 6E 74 61 74 69 6F .other.implementatio
-00000E74 6E 73 20 73 65 65 6D 20 74 6F 20 64 6F 20 6A 75 73 74 20 74 ns.seem.to.do.just.t
-00000E88 68 69 73 2E 0A 20 20 20 20 20 20 20 20 69 66 20 28 64 69 67 his..........if.(dig
-00000E9C 69 74 6F 6B 20 26 26 20 21 66 6F 75 6E 64 77 6F 72 64 29 20 itok.&&.!foundword).
-00000EB0 7B 20 2F 2F 72 65 74 2E 6C 65 6E 67 74 68 20 3D 3D 20 30 20 {.//ret.length.==.0.
-00000EC4 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 69 66 28 6E 75 6D ..............if(num
-00000ED8 62 65 72 73 2E 6C 65 6E 67 74 68 20 3E 20 20 31 29 20 7B 0A bers.length.>..1).{.
-00000EEC 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2F 2F 20 43 ................//.C
-00000F00 6F 6D 62 69 6E 65 20 31 20 64 69 67 69 74 20 77 69 74 68 20 ombine.1.digit.with.
-00000F14 61 6C 6C 20 61 6C 74 65 6E 61 74 69 76 65 73 20 66 72 6F 6D all.altenatives.from
-00000F28 20 74 68 65 20 72 65 73 74 20 20 20 20 0A 20 20 20 20 20 20 .the.rest...........
-00000F3C 20 20 20 20 20 20 20 20 20 20 2F 2F 20 28 6E 65 78 74 20 70 ..........//.(next.p
-00000F50 69 65 63 65 20 63 61 6E 20 6E 6F 74 20 73 74 61 72 74 20 77 iece.can.not.start.w
-00000F64 69 74 68 20 61 20 64 69 67 69 74 29 20 20 20 20 20 20 20 20 ith.a.digit)........
-00000F78 20 20 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 ...................f
-00000F8C 6F 72 65 61 63 68 20 28 61 3B 20 5F 46 69 6E 64 57 6F 72 64 oreach.(a;._FindWord
-00000FA0 73 28 20 6E 75 6D 62 65 72 73 5B 31 2E 2E 24 5D 2C 20 66 61 s(.numbers[1..$],.fa
-00000FB4 6C 73 65 20 29 20 29 0A 20 20 20 20 20 20 20 20 20 20 20 20 lse.).).............
-00000FC8 20 20 20 20 20 20 20 20 72 65 74 20 7E 3D 20 6E 75 6D 62 65 ........ret.~=.numbe
-00000FDC 72 73 5B 30 2E 2E 31 5D 20 7E 20 22 20 22 20 7E 20 61 3B 0A rs[0..1].~.".".~.a;.
-00000FF0 20 20 20 20 20 20 20 20 20 20 20 20 7D 20 20 20 20 0A 20 20 ............}.......
-00001004 20 20 20 20 20 20 20 20 20 20 65 6C 73 65 20 20 20 20 0A 20 ..........else......
-00001018 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 20 7E ...............ret.~
-0000102C 3D 20 6E 75 6D 62 65 72 73 5B 30 2E 2E 31 5D 3B 20 20 20 20 =.numbers[0..1];....
-00001040 2F 2F 20 6A 75 73 74 20 61 70 70 65 6E 64 20 74 68 69 73 20 //.just.append.this.
-00001054 64 69 67 69 74 20 20 20 20 20 20 20 20 20 20 20 20 20 0A 20 digit...............
-00001068 20 20 20 20 20 20 20 7D 20 20 20 20 0A 20 20 20 20 20 20 20 .......}............
-0000107C 20 72 65 74 75 72 6E 20 72 65 74 3B 0A 20 20 20 20 7D 0A 0A .return.ret;.....}..
-00001090 20 20 20 20 2F 2F 2F 20 28 54 68 69 73 20 66 75 6E 63 74 69 ....///.(This.functi
-000010A4 6F 6E 20 77 61 73 20 69 6E 6C 69 6E 65 64 20 69 6E 20 74 68 on.was.inlined.in.th
-000010B8 65 20 6F 72 69 67 69 6E 61 6C 20 70 72 6F 67 72 61 6D 29 20 e.original.program).
-000010CC 0A 20 20 20 20 2F 2F 2F 20 46 69 6E 64 73 20 61 6C 6C 20 61 .....///.Finds.all.a
-000010E0 6C 74 65 72 6E 61 74 69 76 65 73 20 66 6F 72 20 74 68 65 20 lternatives.for.the.
-000010F4 67 69 76 65 6E 20 70 68 6F 6E 65 20 6E 75 6D 62 65 72 20 0A given.phone.number..
-00001108 20 20 20 20 2F 2F 2F 20 52 65 74 75 72 6E 73 3A 20 61 72 72 ....///.Returns:.arr
-0000111C 61 79 20 6F 66 20 73 74 72 69 6E 67 73 20 0A 20 20 20 20 73 ay.of.strings......s
-00001130 74 72 69 6E 67 61 72 72 61 79 20 46 69 6E 64 57 6F 72 64 73 tringarray.FindWords
-00001144 28 20 73 74 72 69 6E 67 20 70 68 6F 6E 65 5F 6E 75 6D 62 65 (.string.phone_numbe
-00001158 72 20 29 0A 20 20 20 20 7B 0A 20 20 20 20 20 20 20 20 69 66 r.).....{.........if
-0000116C 20 28 21 70 68 6F 6E 65 5F 6E 75 6D 62 65 72 2E 6C 65 6E 67 .(!phone_number.leng
-00001180 74 68 29 0A 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 th).............retu
-00001194 72 6E 20 6E 75 6C 6C 3B 0A 20 20 20 20 20 20 20 20 2F 2F 20 rn.null;.........//.
-000011A8 53 74 72 69 70 20 74 68 65 20 6E 6F 6E 2D 64 69 67 69 74 20 Strip.the.non-digit.
-000011BC 63 68 61 72 61 63 74 65 72 73 20 66 72 6F 6D 20 74 68 65 20 characters.from.the.
-000011D0 70 68 6F 6E 65 20 6E 75 6D 62 65 72 2C 20 61 6E 64 0A 20 20 phone.number,.and...
-000011E4 20 20 20 20 20 20 2F 2F 20 70 61 73 73 20 69 74 20 74 6F 20 ......//.pass.it.to.
-000011F8 74 68 65 20 72 65 63 75 72 73 69 76 65 20 66 75 6E 63 74 69 the.recursive.functi
-0000120C 6F 6E 20 28 6C 65 61 64 69 6E 67 20 64 69 67 69 74 20 69 73 on.(leading.digit.is
-00001220 20 61 6C 6C 6F 77 65 64 29 0A 20 20 20 20 20 20 20 20 72 65 .allowed).........re
-00001234 74 75 72 6E 20 5F 46 69 6E 64 57 6F 72 64 73 28 20 73 74 72 turn._FindWords(.str
-00001248 69 70 4E 6F 6E 44 69 67 69 74 28 70 68 6F 6E 65 5F 6E 75 6D ipNonDigit(phone_num
-0000125C 62 65 72 29 2C 20 74 72 75 65 20 29 3B 20 20 20 20 0A 20 20 ber),.true.);.......
-00001270 20 20 7D 20 20 20 20 0A 20 20 20 20 0A 20 20 20 20 2F 2F 20 ..}..............//.
-00001284 52 65 61 64 20 74 68 65 20 70 68 6F 6E 65 20 6E 75 6D 62 65 Read.the.phone.numbe
-00001298 72 73 20 20 20 20 20 0A 20 20 20 20 66 6F 72 65 61 63 68 28 rs..........foreach(
-000012AC 73 74 72 69 6E 67 20 70 68 6F 6E 65 3B 20 6E 65 77 20 42 75 string.phone;.new.Bu
-000012C0 66 66 65 72 65 64 46 69 6C 65 28 22 69 6E 70 75 74 2E 74 78 fferedFile("input.tx
-000012D4 74 22 20 20 20 29 20 29 0A 20 20 20 20 20 20 20 20 66 6F 72 t"...).).........for
-000012E8 65 61 63 68 28 61 6C 74 65 72 6E 61 74 69 76 65 3B 20 46 69 each(alternative;.Fi
-000012FC 6E 64 57 6F 72 64 73 28 20 70 68 6F 6E 65 20 29 20 29 0A 20 ndWords(.phone.).)..
-00001310 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 66 6C 6E 28 ...........writefln(
-00001324 70 68 6F 6E 65 2C 20 22 3A 20 22 2C 20 61 6C 74 65 72 6E 61 phone,.":.",.alterna
-00001338 74 69 76 65 20 29 3B 0A 7D 0A 0A tive.);.}..
diff --git a/tests/examplefiles/hexdump_hexdump b/tests/examplefiles/hexdump_hexdump
deleted file mode 100644
index 06c2e861..00000000
--- a/tests/examplefiles/hexdump_hexdump
+++ /dev/null
@@ -1,310 +0,0 @@
-0000000 2f2f 4320 6572 7461 6465 6220 2079 694c
-0000010 6e6f 6c65 6f6c 4c20 6e75 7365 2075 6e61
-0000020 2064 6c70 6361 6465 6920 206e 6874 2065
-0000030 7570 6c62 6369 6420 6d6f 6961 2e6e 2f0a
-0000040 202f 6854 7369 6620 6c69 2065 6168 2073
-0000050 6562 6e65 6d20 646f 6669 6569 2064 7266
-0000060 6d6f 6920 7374 6f20 6972 6967 616e 206c
-0000070 6576 7372 6f69 2e6e 2f0a 202f 7449 6820
-0000080 7361 6220 6565 206e 6f66 6d72 7461 6574
-0000090 2064 6f74 6620 7469 7920 756f 2072 6373
-00000a0 6572 6e65 0a2e 6f6d 7564 656c 7020 6f68
-00000b0 656e 6f6e 203b 2020 2020 2f2f 6f20 7470
-00000c0 6f69 616e 0a6c 6d69 6f70 7472 7320 6474
-00000d0 732e 6474 6f69 203b 2020 2f2f 7720 6972
-00000e0 6574 6c66 206e 2020 2020 690a 706d 726f
-00000f0 2074 7473 2e64 7463 7079 3b65 2020 2f20
-0000100 202f 7369 6964 6967 2074 2020 2020 690a
-0000110 706d 726f 2074 7473 2e64 7473 6572 6d61
-0000120 203b 2f20 202f 7542 6666 7265 6465 6946
-0000130 656c 0a0a 2f2f 4a20 7375 2074 6f66 2072
-0000140 6572 6461 6261 6c69 7469 2079 6928 616d
-0000150 6967 656e 6320 6168 5b72 5b5d 5b5d 6863
-0000160 7261 5d5b 295d 2020 2020 610a 696c 7361
-0000170 6320 6168 5b72 205d 7473 6972 676e 0a3b
-0000180 6c61 6169 2073 7473 6972 676e 5d5b 7320
-0000190 7274 6e69 6167 7272 7961 0a3b 2f0a 2f2f
-00001a0 5320 7274 7069 2073 6f6e 2d6e 6964 6967
-00001b0 2074 6863 7261 6361 6574 7372 6620 6f72
-00001c0 206d 6874 2065 7473 6972 676e 2820 4f43
-00001d0 2957 730a 7274 6e69 2067 7473 6972 4e70
-00001e0 6e6f 6944 6967 2874 6920 206e 7473 6972
-00001f0 676e 6c20 6e69 2065 2029 7b0a 200a 2020
-0000200 7320 7274 6e69 2067 6572 3b74 200a 2020
-0000210 6620 726f 6165 6863 7528 6e69 2074 2c69
-0000220 6320 203b 696c 656e 2029 0a7b 2020 2020
-0000230 2020 2020 2f2f 4520 7272 726f 203a 7473
-0000240 2e64 7463 7079 2e65 7369 6964 6967 2074
-0000250 7461 4320 5c3a 6d64 5c64 7273 5c63 6870
-0000260 626f 736f 735c 6474 635c 7974 6570 642e
-0000270 3328 2937 0a20 2020 2020 2020 2020 2f2f
-0000280 6320 6e6f 6c66 6369 7374 7720 7469 2068
-0000290 7473 2e64 7473 6572 6d61 692e 6473 6769
-00002a0 7469 6120 2074 3a43 645c 646d 735c 6372
-00002b0 705c 6f68 6f62 5c73 7473 5c64 7473 6572
-00002c0 6d61 642e 3228 3239 2934 200a 2020 2020
-00002d0 2020 6920 2066 2128 7473 2e64 7463 7079
-00002e0 2e65 7369 6964 6967 2874 2963 2029 0a7b
-00002f0 2020 2020 2020 2020 2020 2020 6669 2820
-0000300 7221 7465 0a29 2020 2020 2020 2020 2020
-0000310 2020 2020 2020 6572 2074 203d 696c 656e
-0000320 305b 2e2e 5d69 203b 2020 0a20 2020 2020
-0000330 2020 2020 207d 2020 0a20 2020 2020 2020
-0000340 2020 6c65 6573 6920 2066 7228 7465 0a29
-0000350 2020 2020 2020 2020 2020 2020 6572 2074
-0000360 3d7e 6320 203b 2020 0a20 2020 2020 207d
-0000370 2020 0a20 2020 2020 6572 7574 6e72 7220
-0000380 7465 723f 7465 6c3a 6e69 3b65 7d0a 0a0a
-0000390 6e75 7469 6574 7473 7b20 200a 2020 6120
-00003a0 7373 7265 2874 7320 7274 7069 6f4e 446e
-00003b0 6769 7469 2228 7361 6664 2922 3d20 203d
-00003c0 2222 2020 3b29 200a 2020 6120 7373 7265
-00003d0 2874 7320 7274 7069 6f4e 446e 6769 7469
-00003e0 2228 275c 3331 3d2d 2032 6b34 706f 2922
-00003f0 3d20 203d 2220 3331 3432 2022 2920 0a3b
-0000400 0a7d 2f0a 2f2f 4320 6e6f 6576 7472 2073
-0000410 2061 6f77 6472 6920 746e 206f 2061 756e
-0000420 626d 7265 202c 6769 6f6e 6972 676e 6120
-0000430 6c6c 6e20 6e6f 6120 706c 6168 6320 6168
-0000440 6172 7463 7265 2073 0a20 7473 6972 676e
-0000450 7720 726f 5464 4e6f 6d75 2028 6e69 7320
-0000460 7274 6e69 2067 6f77 6472 2920 7b0a 2f0a
-0000470 202f 7274 6e61 6c73 7461 6f69 206e 6174
-0000480 6c62 2065 6f66 2072 6874 2065 6174 6b73
-0000490 6120 2074 6168 646e 630a 6e6f 7473 6320
-00004a0 6168 5b72 3532 5d36 5420 4152 534e 414c
-00004b0 4554 3d20 2020 2020 200a 2020 2220 2020
-00004c0 2020 2020 2020 2020 2020 2020 2020 2020
-00004d0 2020 2020 2020 2020 2020 2020 2020 2022
-00004e0 2f20 202f 2030 2020 200a 2020 2220 2020
-00004f0 2020 2020 2020 2020 2020 2020 2020 3130
-0000500 3332 3534 3736 3938 2020 2020 2020 2022
-0000510 2f20 202f 3233 2020 2020 0a20 2020 2020
-0000520 2022 3735 3336 3430 3939 3136 3837 3135
-0000530 3838 3231 3433 3637 3232 3933 2020 2020
-0000540 2220 2020 2f2f 3620 2034 2020 200a 2020
-0000550 2220 3520 3637 3033 3934 3639 3731 3538
-0000560 3831 3138 3332 3734 3236 3332 2039 2020
-0000570 2020 0a22 2020 2020 2022 2020 2020 2020
-0000580 2020 2020 2020 2020 2020 2020 2020 2020
-0000590 2020 2020 2020 2020 2220 200a 2020 2220
-00005a0 2020 2020 2020 2020 2020 2020 2020 2020
-*
-00005c0 0a22 2020 2020 2022 2020 2020 2020 2020
-00005d0 2020 2020 2020 2020 2020 2020 2020 2020
-00005e0 2020 2020 2020 2220 2020 2020 200a 2020
-00005f0 2220 2020 2020 2020 2020 2020 2020 2020
-0000600 2020 2020 2020 2020 2020 2020 2020 2020
-0000610 2020 3b22 200a 2020 7320 7274 6e69 2067
-0000620 6572 3b74 200a 2020 6620 726f 6165 6863
-0000630 6328 203b 6163 7473 7528 7962 6574 5d5b
-0000640 7729 726f 2964 200a 2020 2020 2020 6920
-0000650 2066 5428 4152 534e 414c 4554 635b 205d
-0000660 3d21 2720 2720 0a29 2020 2020 2020 2020
-0000670 2020 2020 6572 2074 3d7e 5420 4152 534e
-0000680 414c 4554 635b 3b5d 200a 2020 7220 7465
-0000690 7275 206e 6572 3b74 7d0a 0a0a 6e75 7469
-00006a0 6574 7473 7b20 200a 2f2f 5420 7365 2074
-00006b0 6f77 6472 6f54 754e 206d 7375 6e69 2067
-00006c0 6874 2065 6174 6c62 2065 7266 6d6f 7420
-00006d0 6568 7420 7361 206b 6564 6373 6972 7470
-00006e0 6f69 2e6e 200a 7361 6573 7472 2028 3022
-00006f0 3131 3231 3232 3333 3433 3534 3635 3636
-0000700 3737 3837 3838 3939 2239 3d20 0a3d 2020
-0000710 7720 726f 5464 4e6f 6d75 2228 2045 207c
-0000720 204a 204e 2051 207c 2052 2057 2058 207c
-0000730 2044 2053 2059 207c 2046 2054 207c 2041
-0000740 204d 207c 2043 2049 2056 207c 2042 204b
-0000750 2055 207c 204c 204f 2050 207c 2047 2048
-0000760 225a 2929 0a3b 6120 7373 7265 2874 2220
-0000770 3130 3131 3232 3332 3333 3434 3535 3636
-0000780 3736 3737 3838 3938 3939 2022 3d3d 0a20
-0000790 2020 7720 726f 5464 4e6f 6d75 2228 2065
-00007a0 207c 206a 206e 2071 207c 2072 2077 2078
-00007b0 207c 2064 2073 2079 207c 2066 2074 207c
-00007c0 2061 206d 207c 2063 2069 2076 207c 2062
-00007d0 206b 2075 207c 206c 206f 2070 207c 2067
-00007e0 2068 227a 2929 0a3b 6120 7373 7265 2874
-00007f0 2220 3130 3332 3534 3736 3938 2022 3d3d
-0000800 0a20 2020 7720 726f 5464 4e6f 6d75 2228
-0000810 2030 207c 2020 2031 2020 207c 2020 2032
-0000820 2020 207c 2020 2033 2020 207c 3420 2020
-0000830 207c 3520 2020 207c 2020 2036 2020 207c
-0000840 2020 2037 2020 207c 2020 2038 2020 207c
-0000850 2020 2239 2929 0a3b 0a7d 760a 696f 2064
-0000860 616d 6e69 2028 7473 6972 676e 5d5b 6120
-0000870 6772 2073 0a29 0a7b 2020 2020 2f2f 5420
-0000880 6968 2073 7361 6f73 6963 7461 7669 2065
-0000890 7261 6172 2079 616d 7370 6120 6e20 6d75
-00008a0 6562 2072 6f74 6120 206e 7261 6172 2079
-00008b0 666f 7720 726f 7364 202e 2020 0a20 2020
-00008c0 2020 7473 6972 676e 7261 6172 5b79 7473
-00008d0 6972 676e 205d 2020 6e20 6d75 7732 726f
-00008e0 7364 0a3b 200a 2020 6620 726f 6165 6863
-00008f0 7328 7274 6e69 2067 6f77 6472 203b 656e
-0000900 2077 7542 6666 7265 6465 6946 656c 2228
-0000910 6964 7463 6f69 616e 7972 742e 7478 2022
-0000920 2029 0a29 2020 2020 2020 2020 756e 326d
-0000930 6f77 6472 5b73 7720 726f 5464 4e6f 6d75
-0000940 7728 726f 2964 5d20 7e20 203d 6f77 6472
-0000950 642e 7075 203b 2020 2020 2020 2f20 202f
-0000960 756d 7473 6420 7075 0a0a 2020 2020 2f2f
-0000970 202f 6946 646e 2073 6c61 206c 6c61 6574
-0000980 6e72 7461 7669 7365 6620 726f 7420 6568
-0000990 6720 7669 6e65 6e20 6d75 6562 0a72 2020
-00009a0 2020 2f2f 202f 7328 6f68 6c75 2064 6168
-00009b0 6576 6220 6565 206e 7473 6972 7070 6465
-00009c0 6620 6f72 206d 6f6e 2d6e 6964 6967 2074
-00009d0 6863 7261 6361 6574 7372 0a29 2020 2020
-00009e0 7473 6972 676e 7261 6172 2079 465f 6e69
-00009f0 5764 726f 7364 2028 7473 6972 676e 6e20
-0000a00 6d75 6562 7372 202c 6f62 6c6f 6420 6769
-0000a10 7469 6b6f 2920 200a 2020 6920 206e 0a7b
-0000a20 2020 2020 2020 2020 7361 6573 7472 6e28
-0000a30 6d75 6562 7372 6c2e 6e65 7467 2068 203e
-0000a40 3020 3b29 2020 2020 200a 2020 7d20 2020
-0000a50 2020 200a 2020 6f20 7475 7228 7365 6c75
-0000a60 2974 7b20 200a 2020 2020 2020 6620 726f
-0000a70 6165 6863 2820 3b61 7220 7365 6c75 2974
-0000a80 200a 2020 2020 2020 2020 2020 6120 7373
-0000a90 7265 2874 7720 726f 5464 4e6f 6d75 6128
-0000aa0 2029 3d3d 6e20 6d75 6562 7372 2920 0a3b
-0000ab0 2020 2020 207d 2020 0a20 2020 2020 6f62
-0000ac0 7964 7b20 200a 2020 2020 2020 7320 7274
-0000ad0 6e69 6167 7272 7961 7220 7465 0a3b 2020
-0000ae0 2020 2020 2020 6f62 6c6f 6620 756f 646e
-0000af0 6f77 6472 3d20 6620 6c61 6573 0a3b 2020
-0000b00 2020 2020 2020 6f66 2072 7528 6e69 2074
-0000b10 3d74 3b31 7420 3d3c 756e 626d 7265 2e73
-0000b20 656c 676e 6874 203b 2b2b 2974 7b20 200a
-0000b30 2020 2020 2020 2020 2020 6120 7475 206f
-0000b40 6c61 6574 6e72 7461 7669 7365 3d20 6e20
-0000b50 6d75 6562 7372 305b 2e2e 5d74 6920 206e
-0000b60 756e 326d 6f77 6472 3b73 200a 2020 2020
-0000b70 2020 2020 2020 6920 2066 2128 6c61 6574
-0000b80 6e72 7461 7669 7365 0a29 2020 2020 2020
-0000b90 2020 2020 2020 2020 2020 6f63 746e 6e69
-0000ba0 6575 0a3b 2020 2020 2020 2020 2020 2020
-0000bb0 6f66 6e75 7764 726f 2064 203d 7274 6575
-0000bc0 0a3b 2020 2020 2020 2020 2020 2020 6669
-0000bd0 2820 756e 626d 7265 2e73 656c 676e 6874
-0000be0 3e20 2020 2974 7b20 200a 2020 2020 2020
-0000bf0 2020 2020 2020 2020 2f20 202f 6f43 626d
-0000c00 6e69 2065 6c61 206c 7563 7272 6e65 2074
-0000c10 6c61 6574 6e72 7461 7669 7365 7720 7469
-0000c20 2068 6c61 206c 6c61 6574 6e72 7461 7669
-0000c30 7365 2020 2020 0a20 2020 2020 2020 2020
-0000c40 2020 2020 2020 2020 2f2f 6f20 2066 6874
-0000c50 2065 6572 7473 2820 656e 7478 7020 6569
-0000c60 6563 6320 6e61 7320 6174 7472 7720 7469
-0000c70 2068 2061 6964 6967 2974 2020 2020 2020
-0000c80 2020 2020 2020 2020 200a 2020 2020 2020
-0000c90 2020 2020 2020 2020 6620 726f 6165 6863
-0000ca0 2820 3261 203b 465f 6e69 5764 726f 7364
-0000cb0 2028 756e 626d 7265 5b73 2e74 242e 2c5d
-0000cc0 7420 7572 2065 2020 2020 2029 0a29 2020
-0000cd0 2020 2020 2020 2020 2020 2020 2020 2020
-0000ce0 2020 6f66 6572 6361 2868 3161 203b 612a
-0000cf0 746c 7265 616e 6974 6576 2973 200a 2020
-0000d00 2020 2020 2020 2020 2020 2020 2020 2020
-0000d10 2020 2020 6572 2074 3d7e 6120 2031 207e
-0000d20 2022 2022 207e 3261 0a3b 2020 2020 2020
-0000d30 2020 2020 2020 0a7d 2020 2020 2020 2020
-0000d40 2020 2020 6c65 6573 2020 2020 200a 2020
-0000d50 2020 2020 2020 2020 2020 2020 7220 7465
-0000d60 7e20 203d 612a 746c 7265 616e 6974 6576
-0000d70 3b73 2020 2020 2f2f 6120 7070 6e65 2064
-0000d80 6874 7365 2065 6c61 6574 6e72 7461 7669
-0000d90 7365 200a 2020 2020 2020 7d20 200a 2020
-0000da0 2020 2020 2f20 202f 7254 2079 6f74 6b20
-0000db0 6565 2070 2031 6964 6967 2c74 6f20 6c6e
-0000dc0 2079 6669 7720 2765 6572 6120 6c6c 776f
-0000dd0 6465 6120 646e 6e20 206f 746f 6568 0a72
-0000de0 2020 2020 2020 2020 2f2f 6120 746c 7265
-0000df0 616e 6974 6576 2073 6577 6572 6620 756f
-0000e00 646e 200a 2020 2020 2020 2f20 202f 6554
-0000e10 7473 6e69 2067 7222 7465 6c2e 6e65 7467
-0000e20 2268 6d20 6b61 7365 6d20 726f 2065 6573
-0000e30 736e 2065 6874 6e61 7420 7365 6974 676e
-0000e40 2220 6f66 6e75 7764 726f 2264 0a2c 2020
-0000e50 2020 2020 2020 2f2f 6220 7475 7420 6568
-0000e60 6f20 6874 7265 6920 706d 656c 656d 746e
-0000e70 7461 6f69 736e 7320 6565 206d 6f74 6420
-0000e80 206f 756a 7473 7420 6968 2e73 200a 2020
-0000e90 2020 2020 6920 2066 6428 6769 7469 6b6f
-0000ea0 2620 2026 6621 756f 646e 6f77 6472 2029
-0000eb0 207b 2f2f 6572 2e74 656c 676e 6874 3d20
-0000ec0 203d 2030 0a20 2020 2020 2020 2020 2020
-0000ed0 2020 6669 6e28 6d75 6562 7372 6c2e 6e65
-0000ee0 7467 2068 203e 3120 2029 0a7b 2020 2020
-0000ef0 2020 2020 2020 2020 2020 2020 2f2f 4320
-0000f00 6d6f 6962 656e 3120 6420 6769 7469 7720
-0000f10 7469 2068 6c61 206c 6c61 6574 616e 6974
-0000f20 6576 2073 7266 6d6f 7420 6568 7220 7365
-0000f30 2074 2020 0a20 2020 2020 2020 2020 2020
-0000f40 2020 2020 2020 2f2f 2820 656e 7478 7020
-0000f50 6569 6563 6320 6e61 6e20 746f 7320 6174
-0000f60 7472 7720 7469 2068 2061 6964 6967 2974
-0000f70 2020 2020 2020 2020 2020 200a 2020 2020
-0000f80 2020 2020 2020 2020 2020 6620 726f 6165
-0000f90 6863 2820 3b61 5f20 6946 646e 6f57 6472
-0000fa0 2873 6e20 6d75 6562 7372 315b 2e2e 5d24
-0000fb0 202c 6166 736c 2065 2029 0a29 2020 2020
-0000fc0 2020 2020 2020 2020 2020 2020 2020 2020
-0000fd0 6572 2074 3d7e 6e20 6d75 6562 7372 305b
-0000fe0 2e2e 5d31 7e20 2220 2220 7e20 6120 0a3b
-0000ff0 2020 2020 2020 2020 2020 2020 207d 2020
-0001000 0a20 2020 2020 2020 2020 2020 2020 6c65
-0001010 6573 2020 2020 200a 2020 2020 2020 2020
-0001020 2020 2020 2020 7220 7465 7e20 203d 756e
-0001030 626d 7265 5b73 2e30 312e 3b5d 2020 2020
-0001040 2f2f 6a20 7375 2074 7061 6570 646e 7420
-0001050 6968 2073 6964 6967 2074 2020 2020 2020
-0001060 2020 2020 2020 200a 2020 2020 2020 7d20
-0001070 2020 2020 200a 2020 2020 2020 7220 7465
-0001080 7275 206e 6572 3b74 200a 2020 7d20 0a0a
-0001090 2020 2020 2f2f 202f 5428 6968 2073 7566
-00010a0 636e 6974 6e6f 7720 7361 6920 6c6e 6e69
-00010b0 6465 6920 206e 6874 2065 726f 6769 6e69
-00010c0 6c61 7020 6f72 7267 6d61 2029 200a 2020
-00010d0 2f20 2f2f 4620 6e69 7364 6120 6c6c 6120
-00010e0 746c 7265 616e 6974 6576 2073 6f66 2072
-00010f0 6874 2065 6967 6576 206e 6870 6e6f 2065
-0001100 756e 626d 7265 0a20 2020 2020 2f2f 202f
-0001110 6552 7574 6e72 3a73 6120 7272 7961 6f20
-0001120 2066 7473 6972 676e 2073 200a 2020 7320
-0001130 7274 6e69 6167 7272 7961 4620 6e69 5764
-0001140 726f 7364 2028 7473 6972 676e 7020 6f68
-0001150 656e 6e5f 6d75 6562 2072 0a29 2020 2020
-0001160 0a7b 2020 2020 2020 2020 6669 2820 7021
-0001170 6f68 656e 6e5f 6d75 6562 2e72 656c 676e
-0001180 6874 0a29 2020 2020 2020 2020 2020 2020
-0001190 6572 7574 6e72 6e20 6c75 3b6c 200a 2020
-00011a0 2020 2020 2f20 202f 7453 6972 2070 6874
-00011b0 2065 6f6e 2d6e 6964 6967 2074 6863 7261
-00011c0 6361 6574 7372 6620 6f72 206d 6874 2065
-00011d0 6870 6e6f 2065 756e 626d 7265 202c 6e61
-00011e0 0a64 2020 2020 2020 2020 2f2f 7020 7361
-00011f0 2073 7469 7420 206f 6874 2065 6572 7563
-0001200 7372 7669 2065 7566 636e 6974 6e6f 2820
-0001210 656c 6461 6e69 2067 6964 6967 2074 7369
-0001220 6120 6c6c 776f 6465 0a29 2020 2020 2020
-0001230 2020 6572 7574 6e72 5f20 6946 646e 6f57
-0001240 6472 2873 7320 7274 7069 6f4e 446e 6769
-0001250 7469 7028 6f68 656e 6e5f 6d75 6562 2972
-0001260 202c 7274 6575 2920 203b 2020 0a20 2020
-0001270 2020 207d 2020 0a20 2020 2020 200a 2020
-0001280 2f20 202f 6552 6461 7420 6568 7020 6f68
-0001290 656e 6e20 6d75 6562 7372 2020 2020 0a20
-00012a0 2020 2020 6f66 6572 6361 2868 7473 6972
-00012b0 676e 7020 6f68 656e 203b 656e 2077 7542
-00012c0 6666 7265 6465 6946 656c 2228 6e69 7570
-00012d0 2e74 7874 2274 2020 2920 2920 200a 2020
-00012e0 2020 2020 6620 726f 6165 6863 6128 746c
-00012f0 7265 616e 6974 6576 203b 6946 646e 6f57
-0001300 6472 2873 7020 6f68 656e 2920 2920 200a
-0001310 2020 2020 2020 2020 2020 7720 6972 6574
-0001320 6c66 286e 6870 6e6f 2c65 2220 203a 2c22
-0001330 6120 746c 7265 616e 6974 6576 2920 0a3b
-0001340 0a7d 000a
-0001343
diff --git a/tests/examplefiles/hexdump_od b/tests/examplefiles/hexdump_od
deleted file mode 100644
index a407aef0..00000000
--- a/tests/examplefiles/hexdump_od
+++ /dev/null
@@ -1,310 +0,0 @@
-0000000 2f 2f 20 43 72 65 61 74 65 64 20 62 79 20 4c 69 >// Created by Li<
-0000020 6f 6e 65 6c 6c 6f 20 4c 75 6e 65 73 75 20 61 6e >onello Lunesu an<
-0000040 64 20 70 6c 61 63 65 64 20 69 6e 20 74 68 65 20 >d placed in the <
-0000060 70 75 62 6c 69 63 20 64 6f 6d 61 69 6e 2e 0a 2f >public domain../<
-0000100 2f 20 54 68 69 73 20 66 69 6c 65 20 68 61 73 20 >/ This file has <
-0000120 62 65 65 6e 20 6d 6f 64 69 66 69 65 64 20 66 72 >been modified fr<
-0000140 6f 6d 20 69 74 73 20 6f 72 69 67 69 6e 61 6c 20 >om its original <
-0000160 76 65 72 73 69 6f 6e 2e 0a 2f 2f 20 49 74 20 68 >version..// It h<
-0000200 61 73 20 62 65 65 6e 20 66 6f 72 6d 61 74 74 65 >as been formatte<
-0000220 64 20 74 6f 20 66 69 74 20 79 6f 75 72 20 73 63 >d to fit your sc<
-0000240 72 65 65 6e 2e 0a 6d 6f 64 75 6c 65 20 70 68 6f >reen..module pho<
-0000260 6e 65 6e 6f 3b 20 20 20 20 20 2f 2f 20 6f 70 74 >neno; // opt<
-0000300 69 6f 6e 61 6c 0a 69 6d 70 6f 72 74 20 73 74 64 >ional.import std<
-0000320 2e 73 74 64 69 6f 3b 20 20 20 2f 2f 20 77 72 69 >.stdio; // wri<
-0000340 74 65 66 6c 6e 20 20 20 20 20 0a 69 6d 70 6f 72 >tefln .impor<
-0000360 74 20 73 74 64 2e 63 74 79 70 65 3b 20 20 20 2f >t std.ctype; /<
-0000400 2f 20 69 73 64 69 67 69 74 20 20 20 20 20 0a 69 >/ isdigit .i<
-0000420 6d 70 6f 72 74 20 73 74 64 2e 73 74 72 65 61 6d >mport std.stream<
-0000440 3b 20 20 2f 2f 20 42 75 66 66 65 72 65 64 46 69 >; // BufferedFi<
-0000460 6c 65 0a 0a 2f 2f 20 4a 75 73 74 20 66 6f 72 20 >le..// Just for <
-0000500 72 65 61 64 61 62 69 6c 69 74 79 20 28 69 6d 61 >readability (ima<
-0000520 67 69 6e 65 20 63 68 61 72 5b 5d 5b 5d 5b 63 68 >gine char[][][ch<
-0000540 61 72 5b 5d 5d 29 20 20 20 20 0a 61 6c 69 61 73 >ar[]]) .alias<
-0000560 20 63 68 61 72 5b 5d 20 73 74 72 69 6e 67 3b 0a > char[] string;.<
-0000600 61 6c 69 61 73 20 73 74 72 69 6e 67 5b 5d 20 73 >alias string[] s<
-0000620 74 72 69 6e 67 61 72 72 61 79 3b 0a 0a 2f 2f 2f >tringarray;..///<
-0000640 20 53 74 72 69 70 73 20 6e 6f 6e 2d 64 69 67 69 > Strips non-digi<
-0000660 74 20 63 68 61 72 61 63 74 65 72 73 20 66 72 6f >t characters fro<
-0000700 6d 20 74 68 65 20 73 74 72 69 6e 67 20 28 43 4f >m the string (CO<
-0000720 57 29 0a 73 74 72 69 6e 67 20 73 74 72 69 70 4e >W).string stripN<
-0000740 6f 6e 44 69 67 69 74 28 20 69 6e 20 73 74 72 69 >onDigit( in stri<
-0000760 6e 67 20 6c 69 6e 65 20 29 20 0a 7b 0a 20 20 20 >ng line ) .{. <
-0001000 20 73 74 72 69 6e 67 20 72 65 74 3b 0a 20 20 20 > string ret;. <
-0001020 20 66 6f 72 65 61 63 68 28 75 69 6e 74 20 69 2c > foreach(uint i,<
-0001040 20 63 3b 20 6c 69 6e 65 29 20 7b 0a 20 20 20 20 > c; line) {. <
-0001060 20 20 20 20 2f 2f 20 45 72 72 6f 72 3a 20 73 74 > // Error: st<
-0001100 64 2e 63 74 79 70 65 2e 69 73 64 69 67 69 74 20 >d.ctype.isdigit <
-0001120 61 74 20 43 3a 5c 64 6d 64 5c 73 72 63 5c 70 68 >at C:\dmd\src\ph<
-0001140 6f 62 6f 73 5c 73 74 64 5c 63 74 79 70 65 2e 64 >obos\std\ctype.d<
-0001160 28 33 37 29 20 0a 20 20 20 20 20 20 20 20 2f 2f >(37) . //<
-0001200 20 63 6f 6e 66 6c 69 63 74 73 20 77 69 74 68 20 > conflicts with <
-0001220 73 74 64 2e 73 74 72 65 61 6d 2e 69 73 64 69 67 >std.stream.isdig<
-0001240 69 74 20 61 74 20 43 3a 5c 64 6d 64 5c 73 72 63 >it at C:\dmd\src<
-0001260 5c 70 68 6f 62 6f 73 5c 73 74 64 5c 73 74 72 65 >\phobos\std\stre<
-0001300 61 6d 2e 64 28 32 39 32 34 29 0a 20 20 20 20 20 >am.d(2924). <
-0001320 20 20 20 69 66 20 28 21 73 74 64 2e 63 74 79 70 > if (!std.ctyp<
-0001340 65 2e 69 73 64 69 67 69 74 28 63 29 29 20 7b 0a >e.isdigit(c)) {.<
-0001360 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 > if (<
-0001400 21 72 65 74 29 0a 20 20 20 20 20 20 20 20 20 20 >!ret). <
-0001420 20 20 20 20 20 20 72 65 74 20 3d 20 6c 69 6e 65 > ret = line<
-0001440 5b 30 2e 2e 69 5d 3b 20 20 20 20 0a 20 20 20 20 >[0..i]; . <
-0001460 20 20 20 20 7d 20 20 20 20 0a 20 20 20 20 20 20 > } . <
-0001500 20 20 65 6c 73 65 20 69 66 20 28 72 65 74 29 0a > else if (ret).<
-0001520 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 20 > ret <
-0001540 7e 3d 20 63 3b 20 20 20 20 0a 20 20 20 20 7d 20 >~= c; . } <
-0001560 20 20 20 0a 20 20 20 20 72 65 74 75 72 6e 20 72 > . return r<
-0001600 65 74 3f 72 65 74 3a 6c 69 6e 65 3b 0a 7d 0a 0a >et?ret:line;.}..<
-0001620 75 6e 69 74 74 65 73 74 20 7b 0a 20 20 20 20 61 >unittest {. a<
-0001640 73 73 65 72 74 28 20 73 74 72 69 70 4e 6f 6e 44 >ssert( stripNonD<
-0001660 69 67 69 74 28 22 61 73 64 66 22 29 20 3d 3d 20 >igit("asdf") == <
-0001700 22 22 20 20 29 3b 0a 20 20 20 20 61 73 73 65 72 >"" );. asser<
-0001720 74 28 20 73 74 72 69 70 4e 6f 6e 44 69 67 69 74 >t( stripNonDigit<
-0001740 28 22 5c 27 31 33 2d 3d 32 20 34 6b 6f 70 22 29 >("\'13-=2 4kop")<
-0001760 20 3d 3d 20 20 22 31 33 32 34 22 20 20 29 3b 0a > == "1324" );.<
-0002000 7d 0a 0a 2f 2f 2f 20 43 6f 6e 76 65 72 74 73 20 >}../// Converts <
-0002020 61 20 77 6f 72 64 20 69 6e 74 6f 20 61 20 6e 75 >a word into a nu<
-0002040 6d 62 65 72 2c 20 69 67 6e 6f 72 69 6e 67 20 61 >mber, ignoring a<
-0002060 6c 6c 20 6e 6f 6e 20 61 6c 70 68 61 20 63 68 61 >ll non alpha cha<
-0002100 72 61 63 74 65 72 73 20 20 0a 73 74 72 69 6e 67 >racters .string<
-0002120 20 77 6f 72 64 54 6f 4e 75 6d 28 20 69 6e 20 73 > wordToNum( in s<
-0002140 74 72 69 6e 67 20 77 6f 72 64 20 29 0a 7b 0a 2f >tring word ).{./<
-0002160 2f 20 74 72 61 6e 73 6c 61 74 69 6f 6e 20 74 61 >/ translation ta<
-0002200 62 6c 65 20 66 6f 72 20 74 68 65 20 74 61 73 6b >ble for the task<
-0002220 20 61 74 20 68 61 6e 64 0a 63 6f 6e 73 74 20 63 > at hand.const c<
-0002240 68 61 72 5b 32 35 36 5d 20 54 52 41 4e 53 4c 41 >har[256] TRANSLA<
-0002260 54 45 20 3d 20 20 20 20 0a 20 20 20 20 22 20 20 >TE = . " <
-0002300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 > <
-0002320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 20 > " <
-0002340 20 2f 2f 20 30 20 20 20 0a 20 20 20 20 22 20 20 > // 0 . " <
-0002360 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 31 > 01<
-0002400 32 33 34 35 36 37 38 39 20 20 20 20 20 20 22 20 >23456789 " <
-0002420 20 2f 2f 20 33 32 20 20 20 20 20 0a 20 20 20 20 > // 32 . <
-0002440 22 20 35 37 36 33 30 34 39 39 36 31 37 38 35 31 >" 57630499617851<
-0002460 38 38 31 32 33 34 37 36 32 32 33 39 20 20 20 20 >881234762239 <
-0002500 20 22 20 20 2f 2f 20 36 34 20 20 20 0a 20 20 20 > " // 64 . <
-0002520 20 22 20 35 37 36 33 30 34 39 39 36 31 37 38 35 > " 5763049961785<
-0002540 31 38 38 31 32 33 34 37 36 32 32 33 39 20 20 20 >1881234762239 <
-0002560 20 20 22 0a 20 20 20 20 22 20 20 20 20 20 20 20 > ". " <
-0002600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 > <
-0002620 20 20 20 20 20 20 20 20 20 22 0a 20 20 20 20 22 > ". "<
-0002640 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 > <
-*
-0002700 22 0a 20 20 20 20 22 20 20 20 20 20 20 20 20 20 >". " <
-0002720 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 > <
-0002740 20 20 20 20 20 20 20 22 20 20 20 20 0a 20 20 20 > " . <
-0002760 20 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 > " <
-0003000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 > <
-0003020 20 20 22 3b 0a 20 20 20 20 73 74 72 69 6e 67 20 > ";. string <
-0003040 72 65 74 3b 0a 20 20 20 20 66 6f 72 65 61 63 68 >ret;. foreach<
-0003060 28 63 3b 20 63 61 73 74 28 75 62 79 74 65 5b 5d >(c; cast(ubyte[]<
-0003100 29 77 6f 72 64 29 0a 20 20 20 20 20 20 20 20 69 >)word). i<
-0003120 66 20 28 54 52 41 4e 53 4c 41 54 45 5b 63 5d 20 >f (TRANSLATE[c] <
-0003140 21 3d 20 27 20 27 29 0a 20 20 20 20 20 20 20 20 >!= ' '). <
-0003160 20 20 20 20 72 65 74 20 7e 3d 20 54 52 41 4e 53 > ret ~= TRANS<
-0003200 4c 41 54 45 5b 63 5d 3b 0a 20 20 20 20 72 65 74 >LATE[c];. ret<
-0003220 75 72 6e 20 72 65 74 3b 0a 7d 0a 0a 75 6e 69 74 >urn ret;.}..unit<
-0003240 74 65 73 74 20 7b 0a 20 2f 2f 20 54 65 73 74 20 >test {. // Test <
-0003260 77 6f 72 64 54 6f 4e 75 6d 20 75 73 69 6e 67 20 >wordToNum using <
-0003300 74 68 65 20 74 61 62 6c 65 20 66 72 6f 6d 20 74 >the table from t<
-0003320 68 65 20 74 61 73 6b 20 64 65 73 63 72 69 70 74 >he task descript<
-0003340 69 6f 6e 2e 0a 20 61 73 73 65 72 74 28 20 22 30 >ion.. assert( "0<
-0003360 31 31 31 32 32 32 33 33 33 34 34 35 35 36 36 36 >1112223334455666<
-0003400 37 37 37 38 38 38 39 39 39 22 20 3d 3d 0a 20 20 >777888999" ==. <
-0003420 20 77 6f 72 64 54 6f 4e 75 6d 28 22 45 20 7c 20 > wordToNum("E | <
-0003440 4a 20 4e 20 51 20 7c 20 52 20 57 20 58 20 7c 20 >J N Q | R W X | <
-0003460 44 20 53 20 59 20 7c 20 46 20 54 20 7c 20 41 20 >D S Y | F T | A <
-0003500 4d 20 7c 20 43 20 49 20 56 20 7c 20 42 20 4b 20 >M | C I V | B K <
-0003520 55 20 7c 20 4c 20 4f 20 50 20 7c 20 47 20 48 20 >U | L O P | G H <
-0003540 5a 22 29 29 3b 0a 20 61 73 73 65 72 74 28 20 22 >Z"));. assert( "<
-0003560 30 31 31 31 32 32 32 33 33 33 34 34 35 35 36 36 >0111222333445566<
-0003600 36 37 37 37 38 38 38 39 39 39 22 20 3d 3d 20 0a >6777888999" == .<
-0003620 20 20 20 77 6f 72 64 54 6f 4e 75 6d 28 22 65 20 > wordToNum("e <
-0003640 7c 20 6a 20 6e 20 71 20 7c 20 72 20 77 20 78 20 >| j n q | r w x <
-0003660 7c 20 64 20 73 20 79 20 7c 20 66 20 74 20 7c 20 >| d s y | f t | <
-0003700 61 20 6d 20 7c 20 63 20 69 20 76 20 7c 20 62 20 >a m | c i v | b <
-0003720 6b 20 75 20 7c 20 6c 20 6f 20 70 20 7c 20 67 20 >k u | l o p | g <
-0003740 68 20 7a 22 29 29 3b 0a 20 61 73 73 65 72 74 28 >h z"));. assert(<
-0003760 20 22 30 31 32 33 34 35 36 37 38 39 22 20 3d 3d > "0123456789" ==<
-0004000 20 0a 20 20 20 77 6f 72 64 54 6f 4e 75 6d 28 22 > . wordToNum("<
-0004020 30 20 7c 20 20 20 31 20 20 20 7c 20 20 20 32 20 >0 | 1 | 2 <
-0004040 20 20 7c 20 20 20 33 20 20 20 7c 20 20 34 20 20 > | 3 | 4 <
-0004060 7c 20 20 35 20 20 7c 20 20 20 36 20 20 20 7c 20 >| 5 | 6 | <
-0004100 20 20 37 20 20 20 7c 20 20 20 38 20 20 20 7c 20 > 7 | 8 | <
-0004120 20 20 39 22 29 29 3b 0a 7d 0a 0a 76 6f 69 64 20 > 9"));.}..void <
-0004140 6d 61 69 6e 28 20 73 74 72 69 6e 67 5b 5d 20 61 >main( string[] a<
-0004160 72 67 73 20 29 0a 7b 0a 20 20 20 20 2f 2f 20 54 >rgs ).{. // T<
-0004200 68 69 73 20 61 73 73 6f 63 69 61 74 69 76 65 20 >his associative <
-0004220 61 72 72 61 79 20 6d 61 70 73 20 61 20 6e 75 6d >array maps a num<
-0004240 62 65 72 20 74 6f 20 61 6e 20 61 72 72 61 79 20 >ber to an array <
-0004260 6f 66 20 77 6f 72 64 73 2e 20 20 20 20 0a 20 20 >of words. . <
-0004300 20 20 73 74 72 69 6e 67 61 72 72 61 79 5b 73 74 > stringarray[st<
-0004320 72 69 6e 67 5d 20 20 20 20 6e 75 6d 32 77 6f 72 >ring] num2wor<
-0004340 64 73 3b 0a 0a 20 20 20 20 66 6f 72 65 61 63 68 >ds;.. foreach<
-0004360 28 73 74 72 69 6e 67 20 77 6f 72 64 3b 20 6e 65 >(string word; ne<
-0004400 77 20 42 75 66 66 65 72 65 64 46 69 6c 65 28 22 >w BufferedFile("<
-0004420 64 69 63 74 69 6f 6e 61 72 79 2e 74 78 74 22 20 >dictionary.txt" <
-0004440 29 20 29 0a 20 20 20 20 20 20 20 20 6e 75 6d 32 >) ). num2<
-0004460 77 6f 72 64 73 5b 20 77 6f 72 64 54 6f 4e 75 6d >words[ wordToNum<
-0004500 28 77 6f 72 64 29 20 5d 20 7e 3d 20 77 6f 72 64 >(word) ] ~= word<
-0004520 2e 64 75 70 3b 20 20 20 20 20 20 20 20 2f 2f 20 >.dup; // <
-0004540 6d 75 73 74 20 64 75 70 0a 0a 20 20 20 20 2f 2f >must dup.. //<
-0004560 2f 20 46 69 6e 64 73 20 61 6c 6c 20 61 6c 74 65 >/ Finds all alte<
-0004600 72 6e 61 74 69 76 65 73 20 66 6f 72 20 74 68 65 >rnatives for the<
-0004620 20 67 69 76 65 6e 20 6e 75 6d 62 65 72 0a 20 20 > given number. <
-0004640 20 20 2f 2f 2f 20 28 73 68 6f 75 6c 64 20 68 61 > /// (should ha<
-0004660 76 65 20 62 65 65 6e 20 73 74 72 69 70 70 65 64 >ve been stripped<
-0004700 20 66 72 6f 6d 20 6e 6f 6e 2d 64 69 67 69 74 20 > from non-digit <
-0004720 63 68 61 72 61 63 74 65 72 73 29 0a 20 20 20 20 >characters). <
-0004740 73 74 72 69 6e 67 61 72 72 61 79 20 5f 46 69 6e >stringarray _Fin<
-0004760 64 57 6f 72 64 73 28 20 73 74 72 69 6e 67 20 6e >dWords( string n<
-0005000 75 6d 62 65 72 73 2c 20 62 6f 6f 6c 20 64 69 67 >umbers, bool dig<
-0005020 69 74 6f 6b 20 29 0a 20 20 20 20 69 6e 20 7b 0a >itok ). in {.<
-0005040 20 20 20 20 20 20 20 20 61 73 73 65 72 74 28 6e > assert(n<
-0005060 75 6d 62 65 72 73 2e 6c 65 6e 67 74 68 20 3e 20 >umbers.length > <
-0005100 20 30 29 3b 20 20 20 20 0a 20 20 20 20 7d 20 20 > 0); . } <
-0005120 20 20 0a 20 20 20 20 6f 75 74 28 72 65 73 75 6c > . out(resul<
-0005140 74 29 20 7b 0a 20 20 20 20 20 20 20 20 66 6f 72 >t) {. for<
-0005160 65 61 63 68 20 28 61 3b 20 72 65 73 75 6c 74 29 >each (a; result)<
-0005200 0a 20 20 20 20 20 20 20 20 20 20 20 20 61 73 73 >. ass<
-0005220 65 72 74 28 20 77 6f 72 64 54 6f 4e 75 6d 28 61 >ert( wordToNum(a<
-0005240 29 20 3d 3d 20 6e 75 6d 62 65 72 73 20 29 3b 0a >) == numbers );.<
-0005260 20 20 20 20 7d 20 20 20 20 0a 20 20 20 20 62 6f > } . bo<
-0005300 64 79 20 7b 0a 20 20 20 20 20 20 20 20 73 74 72 >dy {. str<
-0005320 69 6e 67 61 72 72 61 79 20 72 65 74 3b 0a 20 20 >ingarray ret;. <
-0005340 20 20 20 20 20 20 62 6f 6f 6c 20 66 6f 75 6e 64 > bool found<
-0005360 77 6f 72 64 20 3d 20 66 61 6c 73 65 3b 0a 20 20 >word = false;. <
-0005400 20 20 20 20 20 20 66 6f 72 20 28 75 69 6e 74 20 > for (uint <
-0005420 74 3d 31 3b 20 74 3c 3d 6e 75 6d 62 65 72 73 2e >t=1; t<=numbers.<
-0005440 6c 65 6e 67 74 68 3b 20 2b 2b 74 29 20 7b 0a 20 >length; ++t) {. <
-0005460 20 20 20 20 20 20 20 20 20 20 20 61 75 74 6f 20 > auto <
-0005500 61 6c 74 65 72 6e 61 74 69 76 65 73 20 3d 20 6e >alternatives = n<
-0005520 75 6d 62 65 72 73 5b 30 2e 2e 74 5d 20 69 6e 20 >umbers[0..t] in <
-0005540 6e 75 6d 32 77 6f 72 64 73 3b 0a 20 20 20 20 20 >num2words;. <
-0005560 20 20 20 20 20 20 20 69 66 20 28 21 61 6c 74 65 > if (!alte<
-0005600 72 6e 61 74 69 76 65 73 29 0a 20 20 20 20 20 20 >rnatives). <
-0005620 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e > contin<
-0005640 75 65 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 >ue;. <
-0005660 66 6f 75 6e 64 77 6f 72 64 20 3d 20 74 72 75 65 >foundword = true<
-0005700 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 >;. if<
-0005720 20 28 6e 75 6d 62 65 72 73 2e 6c 65 6e 67 74 68 > (numbers.length<
-0005740 20 3e 20 20 74 29 20 7b 0a 20 20 20 20 20 20 20 > > t) {. <
-0005760 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6d 62 > // Comb<
-0006000 69 6e 65 20 61 6c 6c 20 63 75 72 72 65 6e 74 20 >ine all current <
-0006020 61 6c 74 65 72 6e 61 74 69 76 65 73 20 77 69 74 >alternatives wit<
-0006040 68 20 61 6c 6c 20 61 6c 74 65 72 6e 61 74 69 76 >h all alternativ<
-0006060 65 73 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 >es . <
-0006100 20 20 20 20 20 20 20 20 2f 2f 20 6f 66 20 74 68 > // of th<
-0006120 65 20 72 65 73 74 20 28 6e 65 78 74 20 70 69 65 >e rest (next pie<
-0006140 63 65 20 63 61 6e 20 73 74 61 72 74 20 77 69 74 >ce can start wit<
-0006160 68 20 61 20 64 69 67 69 74 29 20 20 20 20 20 20 >h a digit) <
-0006200 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 > . <
-0006220 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 > foreach<
-0006240 20 28 61 32 3b 20 5f 46 69 6e 64 57 6f 72 64 73 > (a2; _FindWords<
-0006260 28 20 6e 75 6d 62 65 72 73 5b 74 2e 2e 24 5d 2c >( numbers[t..$],<
-0006300 20 74 72 75 65 20 20 20 20 20 29 20 29 0a 20 20 > true ) ). <
-0006320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 > <
-0006340 20 20 66 6f 72 65 61 63 68 28 61 31 3b 20 2a 61 > foreach(a1; *a<
-0006360 6c 74 65 72 6e 61 74 69 76 65 73 29 0a 20 20 20 >lternatives). <
-0006400 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 > <
-0006420 20 20 20 20 72 65 74 20 7e 3d 20 61 31 20 7e 20 > ret ~= a1 ~ <
-0006440 22 20 22 20 7e 20 61 32 3b 0a 20 20 20 20 20 20 >" " ~ a2;. <
-0006460 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 > }. <
-0006500 20 20 20 20 65 6c 73 65 20 20 20 20 0a 20 20 20 > else . <
-0006520 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 > ret<
-0006540 20 7e 3d 20 2a 61 6c 74 65 72 6e 61 74 69 76 65 > ~= *alternative<
-0006560 73 3b 20 20 20 20 2f 2f 20 61 70 70 65 6e 64 20 >s; // append <
-0006600 74 68 65 73 65 20 61 6c 74 65 72 6e 61 74 69 76 >these alternativ<
-0006620 65 73 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 >es. }. <
-0006640 20 20 20 20 20 2f 2f 20 54 72 79 20 74 6f 20 6b > // Try to k<
-0006660 65 65 70 20 31 20 64 69 67 69 74 2c 20 6f 6e 6c >eep 1 digit, onl<
-0006700 79 20 69 66 20 77 65 27 72 65 20 61 6c 6c 6f 77 >y if we're allow<
-0006720 65 64 20 61 6e 64 20 6e 6f 20 6f 74 68 65 72 0a >ed and no other.<
-0006740 20 20 20 20 20 20 20 20 2f 2f 20 61 6c 74 65 72 > // alter<
-0006760 6e 61 74 69 76 65 73 20 77 65 72 65 20 66 6f 75 >natives were fou<
-0007000 6e 64 0a 20 20 20 20 20 20 20 20 2f 2f 20 54 65 >nd. // Te<
-0007020 73 74 69 6e 67 20 22 72 65 74 2e 6c 65 6e 67 74 >sting "ret.lengt<
-0007040 68 22 20 6d 61 6b 65 73 20 6d 6f 72 65 20 73 65 >h" makes more se<
-0007060 6e 73 65 20 74 68 61 6e 20 74 65 73 74 69 6e 67 >nse than testing<
-0007100 20 22 66 6f 75 6e 64 77 6f 72 64 22 2c 0a 20 20 > "foundword",. <
-0007120 20 20 20 20 20 20 2f 2f 20 62 75 74 20 74 68 65 > // but the<
-0007140 20 6f 74 68 65 72 20 69 6d 70 6c 65 6d 65 6e 74 > other implement<
-0007160 61 74 69 6f 6e 73 20 73 65 65 6d 20 74 6f 20 64 >ations seem to d<
-0007200 6f 20 6a 75 73 74 20 74 68 69 73 2e 0a 20 20 20 >o just this.. <
-0007220 20 20 20 20 20 69 66 20 28 64 69 67 69 74 6f 6b > if (digitok<
-0007240 20 26 26 20 21 66 6f 75 6e 64 77 6f 72 64 29 20 > && !foundword) <
-0007260 7b 20 2f 2f 72 65 74 2e 6c 65 6e 67 74 68 20 3d >{ //ret.length =<
-0007300 3d 20 30 20 20 0a 20 20 20 20 20 20 20 20 20 20 >= 0 . <
-0007320 20 20 69 66 28 6e 75 6d 62 65 72 73 2e 6c 65 6e > if(numbers.len<
-0007340 67 74 68 20 3e 20 20 31 29 20 7b 0a 20 20 20 20 >gth > 1) {. <
-0007360 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 > // C<
-0007400 6f 6d 62 69 6e 65 20 31 20 64 69 67 69 74 20 77 >ombine 1 digit w<
-0007420 69 74 68 20 61 6c 6c 20 61 6c 74 65 6e 61 74 69 >ith all altenati<
-0007440 76 65 73 20 66 72 6f 6d 20 74 68 65 20 72 65 73 >ves from the res<
-0007460 74 20 20 20 20 0a 20 20 20 20 20 20 20 20 20 20 >t . <
-0007500 20 20 20 20 20 20 2f 2f 20 28 6e 65 78 74 20 70 > // (next p<
-0007520 69 65 63 65 20 63 61 6e 20 6e 6f 74 20 73 74 61 >iece can not sta<
-0007540 72 74 20 77 69 74 68 20 61 20 64 69 67 69 74 29 >rt with a digit)<
-0007560 20 20 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 > . <
-0007600 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 > forea<
-0007620 63 68 20 28 61 3b 20 5f 46 69 6e 64 57 6f 72 64 >ch (a; _FindWord<
-0007640 73 28 20 6e 75 6d 62 65 72 73 5b 31 2e 2e 24 5d >s( numbers[1..$]<
-0007660 2c 20 66 61 6c 73 65 20 29 20 29 0a 20 20 20 20 >, false ) ). <
-0007700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 > <
-0007720 72 65 74 20 7e 3d 20 6e 75 6d 62 65 72 73 5b 30 >ret ~= numbers[0<
-0007740 2e 2e 31 5d 20 7e 20 22 20 22 20 7e 20 61 3b 0a >..1] ~ " " ~ a;.<
-0007760 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 20 20 > } <
-0010000 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c > . el<
-0010020 73 65 20 20 20 20 0a 20 20 20 20 20 20 20 20 20 >se . <
-0010040 20 20 20 20 20 20 20 72 65 74 20 7e 3d 20 6e 75 > ret ~= nu<
-0010060 6d 62 65 72 73 5b 30 2e 2e 31 5d 3b 20 20 20 20 >mbers[0..1]; <
-0010100 2f 2f 20 6a 75 73 74 20 61 70 70 65 6e 64 20 74 >// just append t<
-0010120 68 69 73 20 64 69 67 69 74 20 20 20 20 20 20 20 >his digit <
-0010140 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 7d > . }<
-0010160 20 20 20 20 0a 20 20 20 20 20 20 20 20 72 65 74 > . ret<
-0010200 75 72 6e 20 72 65 74 3b 0a 20 20 20 20 7d 0a 0a >urn ret;. }..<
-0010220 20 20 20 20 2f 2f 2f 20 28 54 68 69 73 20 66 75 > /// (This fu<
-0010240 6e 63 74 69 6f 6e 20 77 61 73 20 69 6e 6c 69 6e >nction was inlin<
-0010260 65 64 20 69 6e 20 74 68 65 20 6f 72 69 67 69 6e >ed in the origin<
-0010300 61 6c 20 70 72 6f 67 72 61 6d 29 20 0a 20 20 20 >al program) . <
-0010320 20 2f 2f 2f 20 46 69 6e 64 73 20 61 6c 6c 20 61 > /// Finds all a<
-0010340 6c 74 65 72 6e 61 74 69 76 65 73 20 66 6f 72 20 >lternatives for <
-0010360 74 68 65 20 67 69 76 65 6e 20 70 68 6f 6e 65 20 >the given phone <
-0010400 6e 75 6d 62 65 72 20 0a 20 20 20 20 2f 2f 2f 20 >number . /// <
-0010420 52 65 74 75 72 6e 73 3a 20 61 72 72 61 79 20 6f >Returns: array o<
-0010440 66 20 73 74 72 69 6e 67 73 20 0a 20 20 20 20 73 >f strings . s<
-0010460 74 72 69 6e 67 61 72 72 61 79 20 46 69 6e 64 57 >tringarray FindW<
-0010500 6f 72 64 73 28 20 73 74 72 69 6e 67 20 70 68 6f >ords( string pho<
-0010520 6e 65 5f 6e 75 6d 62 65 72 20 29 0a 20 20 20 20 >ne_number ). <
-0010540 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 70 >{. if (!p<
-0010560 68 6f 6e 65 5f 6e 75 6d 62 65 72 2e 6c 65 6e 67 >hone_number.leng<
-0010600 74 68 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 >th). <
-0010620 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 20 20 20 >return null;. <
-0010640 20 20 20 20 20 2f 2f 20 53 74 72 69 70 20 74 68 > // Strip th<
-0010660 65 20 6e 6f 6e 2d 64 69 67 69 74 20 63 68 61 72 >e non-digit char<
-0010700 61 63 74 65 72 73 20 66 72 6f 6d 20 74 68 65 20 >acters from the <
-0010720 70 68 6f 6e 65 20 6e 75 6d 62 65 72 2c 20 61 6e >phone number, an<
-0010740 64 0a 20 20 20 20 20 20 20 20 2f 2f 20 70 61 73 >d. // pas<
-0010760 73 20 69 74 20 74 6f 20 74 68 65 20 72 65 63 75 >s it to the recu<
-0011000 72 73 69 76 65 20 66 75 6e 63 74 69 6f 6e 20 28 >rsive function (<
-0011020 6c 65 61 64 69 6e 67 20 64 69 67 69 74 20 69 73 >leading digit is<
-0011040 20 61 6c 6c 6f 77 65 64 29 0a 20 20 20 20 20 20 > allowed). <
-0011060 20 20 72 65 74 75 72 6e 20 5f 46 69 6e 64 57 6f > return _FindWo<
-0011100 72 64 73 28 20 73 74 72 69 70 4e 6f 6e 44 69 67 >rds( stripNonDig<
-0011120 69 74 28 70 68 6f 6e 65 5f 6e 75 6d 62 65 72 29 >it(phone_number)<
-0011140 2c 20 74 72 75 65 20 29 3b 20 20 20 20 0a 20 20 >, true ); . <
-0011160 20 20 7d 20 20 20 20 0a 20 20 20 20 0a 20 20 20 > } . . <
-0011200 20 2f 2f 20 52 65 61 64 20 74 68 65 20 70 68 6f > // Read the pho<
-0011220 6e 65 20 6e 75 6d 62 65 72 73 20 20 20 20 20 0a >ne numbers .<
-0011240 20 20 20 20 66 6f 72 65 61 63 68 28 73 74 72 69 > foreach(stri<
-0011260 6e 67 20 70 68 6f 6e 65 3b 20 6e 65 77 20 42 75 >ng phone; new Bu<
-0011300 66 66 65 72 65 64 46 69 6c 65 28 22 69 6e 70 75 >fferedFile("inpu<
-0011320 74 2e 74 78 74 22 20 20 20 29 20 29 0a 20 20 20 >t.txt" ) ). <
-0011340 20 20 20 20 20 66 6f 72 65 61 63 68 28 61 6c 74 > foreach(alt<
-0011360 65 72 6e 61 74 69 76 65 3b 20 46 69 6e 64 57 6f >ernative; FindWo<
-0011400 72 64 73 28 20 70 68 6f 6e 65 20 29 20 29 0a 20 >rds( phone ) ). <
-0011420 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 > write<
-0011440 66 6c 6e 28 70 68 6f 6e 65 2c 20 22 3a 20 22 2c >fln(phone, ": ",<
-0011460 20 61 6c 74 65 72 6e 61 74 69 76 65 20 29 3b 0a > alternative );.<
-0011500 7d 0a 0a >}..<
-0011503
diff --git a/tests/examplefiles/hexdump_xxd b/tests/examplefiles/hexdump_xxd
deleted file mode 100644
index 33a8a6e1..00000000
--- a/tests/examplefiles/hexdump_xxd
+++ /dev/null
@@ -1,309 +0,0 @@
-0000000: 2f2f 2043 7265 6174 6564 2062 7920 4c69 // Created by Li
-0000010: 6f6e 656c 6c6f 204c 756e 6573 7520 616e onello Lunesu an
-0000020: 6420 706c 6163 6564 2069 6e20 7468 6520 d placed in the
-0000030: 7075 626c 6963 2064 6f6d 6169 6e2e 0a2f public domain../
-0000040: 2f20 5468 6973 2066 696c 6520 6861 7320 / This file has
-0000050: 6265 656e 206d 6f64 6966 6965 6420 6672 been modified fr
-0000060: 6f6d 2069 7473 206f 7269 6769 6e61 6c20 om its original
-0000070: 7665 7273 696f 6e2e 0a2f 2f20 4974 2068 version..// It h
-0000080: 6173 2062 6565 6e20 666f 726d 6174 7465 as been formatte
-0000090: 6420 746f 2066 6974 2079 6f75 7220 7363 d to fit your sc
-00000a0: 7265 656e 2e0a 6d6f 6475 6c65 2070 686f reen..module pho
-00000b0: 6e65 6e6f 3b20 2020 2020 2f2f 206f 7074 neno; // opt
-00000c0: 696f 6e61 6c0a 696d 706f 7274 2073 7464 ional.import std
-00000d0: 2e73 7464 696f 3b20 2020 2f2f 2077 7269 .stdio; // wri
-00000e0: 7465 666c 6e20 2020 2020 0a69 6d70 6f72 tefln .impor
-00000f0: 7420 7374 642e 6374 7970 653b 2020 202f t std.ctype; /
-0000100: 2f20 6973 6469 6769 7420 2020 2020 0a69 / isdigit .i
-0000110: 6d70 6f72 7420 7374 642e 7374 7265 616d mport std.stream
-0000120: 3b20 202f 2f20 4275 6666 6572 6564 4669 ; // BufferedFi
-0000130: 6c65 0a0a 2f2f 204a 7573 7420 666f 7220 le..// Just for
-0000140: 7265 6164 6162 696c 6974 7920 2869 6d61 readability (ima
-0000150: 6769 6e65 2063 6861 725b 5d5b 5d5b 6368 gine char[][][ch
-0000160: 6172 5b5d 5d29 2020 2020 0a61 6c69 6173 ar[]]) .alias
-0000170: 2063 6861 725b 5d20 7374 7269 6e67 3b0a char[] string;.
-0000180: 616c 6961 7320 7374 7269 6e67 5b5d 2073 alias string[] s
-0000190: 7472 696e 6761 7272 6179 3b0a 0a2f 2f2f tringarray;..///
-00001a0: 2053 7472 6970 7320 6e6f 6e2d 6469 6769 Strips non-digi
-00001b0: 7420 6368 6172 6163 7465 7273 2066 726f t characters fro
-00001c0: 6d20 7468 6520 7374 7269 6e67 2028 434f m the string (CO
-00001d0: 5729 0a73 7472 696e 6720 7374 7269 704e W).string stripN
-00001e0: 6f6e 4469 6769 7428 2069 6e20 7374 7269 onDigit( in stri
-00001f0: 6e67 206c 696e 6520 2920 0a7b 0a20 2020 ng line ) .{.
-0000200: 2073 7472 696e 6720 7265 743b 0a20 2020 string ret;.
-0000210: 2066 6f72 6561 6368 2875 696e 7420 692c foreach(uint i,
-0000220: 2063 3b20 6c69 6e65 2920 7b0a 2020 2020 c; line) {.
-0000230: 2020 2020 2f2f 2045 7272 6f72 3a20 7374 // Error: st
-0000240: 642e 6374 7970 652e 6973 6469 6769 7420 d.ctype.isdigit
-0000250: 6174 2043 3a5c 646d 645c 7372 635c 7068 at C:\dmd\src\ph
-0000260: 6f62 6f73 5c73 7464 5c63 7479 7065 2e64 obos\std\ctype.d
-0000270: 2833 3729 200a 2020 2020 2020 2020 2f2f (37) . //
-0000280: 2063 6f6e 666c 6963 7473 2077 6974 6820 conflicts with
-0000290: 7374 642e 7374 7265 616d 2e69 7364 6967 std.stream.isdig
-00002a0: 6974 2061 7420 433a 5c64 6d64 5c73 7263 it at C:\dmd\src
-00002b0: 5c70 686f 626f 735c 7374 645c 7374 7265 \phobos\std\stre
-00002c0: 616d 2e64 2832 3932 3429 0a20 2020 2020 am.d(2924).
-00002d0: 2020 2069 6620 2821 7374 642e 6374 7970 if (!std.ctyp
-00002e0: 652e 6973 6469 6769 7428 6329 2920 7b0a e.isdigit(c)) {.
-00002f0: 2020 2020 2020 2020 2020 2020 6966 2028 if (
-0000300: 2172 6574 290a 2020 2020 2020 2020 2020 !ret).
-0000310: 2020 2020 2020 7265 7420 3d20 6c69 6e65 ret = line
-0000320: 5b30 2e2e 695d 3b20 2020 200a 2020 2020 [0..i]; .
-0000330: 2020 2020 7d20 2020 200a 2020 2020 2020 } .
-0000340: 2020 656c 7365 2069 6620 2872 6574 290a else if (ret).
-0000350: 2020 2020 2020 2020 2020 2020 7265 7420 ret
-0000360: 7e3d 2063 3b20 2020 200a 2020 2020 7d20 ~= c; . }
-0000370: 2020 200a 2020 2020 7265 7475 726e 2072 . return r
-0000380: 6574 3f72 6574 3a6c 696e 653b 0a7d 0a0a et?ret:line;.}..
-0000390: 756e 6974 7465 7374 207b 0a20 2020 2061 unittest {. a
-00003a0: 7373 6572 7428 2073 7472 6970 4e6f 6e44 ssert( stripNonD
-00003b0: 6967 6974 2822 6173 6466 2229 203d 3d20 igit("asdf") ==
-00003c0: 2222 2020 293b 0a20 2020 2061 7373 6572 "" );. asser
-00003d0: 7428 2073 7472 6970 4e6f 6e44 6967 6974 t( stripNonDigit
-00003e0: 2822 5c27 3133 2d3d 3220 346b 6f70 2229 ("\'13-=2 4kop")
-00003f0: 203d 3d20 2022 3133 3234 2220 2029 3b0a == "1324" );.
-0000400: 7d0a 0a2f 2f2f 2043 6f6e 7665 7274 7320 }../// Converts
-0000410: 6120 776f 7264 2069 6e74 6f20 6120 6e75 a word into a nu
-0000420: 6d62 6572 2c20 6967 6e6f 7269 6e67 2061 mber, ignoring a
-0000430: 6c6c 206e 6f6e 2061 6c70 6861 2063 6861 ll non alpha cha
-0000440: 7261 6374 6572 7320 200a 7374 7269 6e67 racters .string
-0000450: 2077 6f72 6454 6f4e 756d 2820 696e 2073 wordToNum( in s
-0000460: 7472 696e 6720 776f 7264 2029 0a7b 0a2f tring word ).{./
-0000470: 2f20 7472 616e 736c 6174 696f 6e20 7461 / translation ta
-0000480: 626c 6520 666f 7220 7468 6520 7461 736b ble for the task
-0000490: 2061 7420 6861 6e64 0a63 6f6e 7374 2063 at hand.const c
-00004a0: 6861 725b 3235 365d 2054 5241 4e53 4c41 har[256] TRANSLA
-00004b0: 5445 203d 2020 2020 0a20 2020 2022 2020 TE = . "
-00004c0: 2020 2020 2020 2020 2020 2020 2020 2020
-00004d0: 2020 2020 2020 2020 2020 2020 2020 2220 "
-00004e0: 202f 2f20 3020 2020 0a20 2020 2022 2020 // 0 . "
-00004f0: 2020 2020 2020 2020 2020 2020 2020 3031 01
-0000500: 3233 3435 3637 3839 2020 2020 2020 2220 23456789 "
-0000510: 202f 2f20 3332 2020 2020 200a 2020 2020 // 32 .
-0000520: 2220 3537 3633 3034 3939 3631 3738 3531 " 57630499617851
-0000530: 3838 3132 3334 3736 3232 3339 2020 2020 881234762239
-0000540: 2022 2020 2f2f 2036 3420 2020 0a20 2020 " // 64 .
-0000550: 2022 2035 3736 3330 3439 3936 3137 3835 " 5763049961785
-0000560: 3138 3831 3233 3437 3632 3233 3920 2020 1881234762239
-0000570: 2020 220a 2020 2020 2220 2020 2020 2020 ". "
-0000580: 2020 2020 2020 2020 2020 2020 2020 2020
-0000590: 2020 2020 2020 2020 2022 0a20 2020 2022 ". "
-00005a0: 2020 2020 2020 2020 2020 2020 2020 2020
-00005b0: 2020 2020 2020 2020 2020 2020 2020 2020
-00005c0: 220a 2020 2020 2220 2020 2020 2020 2020 ". "
-00005d0: 2020 2020 2020 2020 2020 2020 2020 2020
-00005e0: 2020 2020 2020 2022 2020 2020 0a20 2020 " .
-00005f0: 2022 2020 2020 2020 2020 2020 2020 2020 "
-0000600: 2020 2020 2020 2020 2020 2020 2020 2020
-0000610: 2020 223b 0a20 2020 2073 7472 696e 6720 ";. string
-0000620: 7265 743b 0a20 2020 2066 6f72 6561 6368 ret;. foreach
-0000630: 2863 3b20 6361 7374 2875 6279 7465 5b5d (c; cast(ubyte[]
-0000640: 2977 6f72 6429 0a20 2020 2020 2020 2069 )word). i
-0000650: 6620 2854 5241 4e53 4c41 5445 5b63 5d20 f (TRANSLATE[c]
-0000660: 213d 2027 2027 290a 2020 2020 2020 2020 != ' ').
-0000670: 2020 2020 7265 7420 7e3d 2054 5241 4e53 ret ~= TRANS
-0000680: 4c41 5445 5b63 5d3b 0a20 2020 2072 6574 LATE[c];. ret
-0000690: 7572 6e20 7265 743b 0a7d 0a0a 756e 6974 urn ret;.}..unit
-00006a0: 7465 7374 207b 0a20 2f2f 2054 6573 7420 test {. // Test
-00006b0: 776f 7264 546f 4e75 6d20 7573 696e 6720 wordToNum using
-00006c0: 7468 6520 7461 626c 6520 6672 6f6d 2074 the table from t
-00006d0: 6865 2074 6173 6b20 6465 7363 7269 7074 he task descript
-00006e0: 696f 6e2e 0a20 6173 7365 7274 2820 2230 ion.. assert( "0
-00006f0: 3131 3132 3232 3333 3334 3435 3536 3636 1112223334455666
-0000700: 3737 3738 3838 3939 3922 203d 3d0a 2020 777888999" ==.
-0000710: 2077 6f72 6454 6f4e 756d 2822 4520 7c20 wordToNum("E |
-0000720: 4a20 4e20 5120 7c20 5220 5720 5820 7c20 J N Q | R W X |
-0000730: 4420 5320 5920 7c20 4620 5420 7c20 4120 D S Y | F T | A
-0000740: 4d20 7c20 4320 4920 5620 7c20 4220 4b20 M | C I V | B K
-0000750: 5520 7c20 4c20 4f20 5020 7c20 4720 4820 U | L O P | G H
-0000760: 5a22 2929 3b0a 2061 7373 6572 7428 2022 Z"));. assert( "
-0000770: 3031 3131 3232 3233 3333 3434 3535 3636 0111222333445566
-0000780: 3637 3737 3838 3839 3939 2220 3d3d 200a 6777888999" == .
-0000790: 2020 2077 6f72 6454 6f4e 756d 2822 6520 wordToNum("e
-00007a0: 7c20 6a20 6e20 7120 7c20 7220 7720 7820 | j n q | r w x
-00007b0: 7c20 6420 7320 7920 7c20 6620 7420 7c20 | d s y | f t |
-00007c0: 6120 6d20 7c20 6320 6920 7620 7c20 6220 a m | c i v | b
-00007d0: 6b20 7520 7c20 6c20 6f20 7020 7c20 6720 k u | l o p | g
-00007e0: 6820 7a22 2929 3b0a 2061 7373 6572 7428 h z"));. assert(
-00007f0: 2022 3031 3233 3435 3637 3839 2220 3d3d "0123456789" ==
-0000800: 200a 2020 2077 6f72 6454 6f4e 756d 2822 . wordToNum("
-0000810: 3020 7c20 2020 3120 2020 7c20 2020 3220 0 | 1 | 2
-0000820: 2020 7c20 2020 3320 2020 7c20 2034 2020 | 3 | 4
-0000830: 7c20 2035 2020 7c20 2020 3620 2020 7c20 | 5 | 6 |
-0000840: 2020 3720 2020 7c20 2020 3820 2020 7c20 7 | 8 |
-0000850: 2020 3922 2929 3b0a 7d0a 0a76 6f69 6420 9"));.}..void
-0000860: 6d61 696e 2820 7374 7269 6e67 5b5d 2061 main( string[] a
-0000870: 7267 7320 290a 7b0a 2020 2020 2f2f 2054 rgs ).{. // T
-0000880: 6869 7320 6173 736f 6369 6174 6976 6520 his associative
-0000890: 6172 7261 7920 6d61 7073 2061 206e 756d array maps a num
-00008a0: 6265 7220 746f 2061 6e20 6172 7261 7920 ber to an array
-00008b0: 6f66 2077 6f72 6473 2e20 2020 200a 2020 of words. .
-00008c0: 2020 7374 7269 6e67 6172 7261 795b 7374 stringarray[st
-00008d0: 7269 6e67 5d20 2020 206e 756d 3277 6f72 ring] num2wor
-00008e0: 6473 3b0a 0a20 2020 2066 6f72 6561 6368 ds;.. foreach
-00008f0: 2873 7472 696e 6720 776f 7264 3b20 6e65 (string word; ne
-0000900: 7720 4275 6666 6572 6564 4669 6c65 2822 w BufferedFile("
-0000910: 6469 6374 696f 6e61 7279 2e74 7874 2220 dictionary.txt"
-0000920: 2920 290a 2020 2020 2020 2020 6e75 6d32 ) ). num2
-0000930: 776f 7264 735b 2077 6f72 6454 6f4e 756d words[ wordToNum
-0000940: 2877 6f72 6429 205d 207e 3d20 776f 7264 (word) ] ~= word
-0000950: 2e64 7570 3b20 2020 2020 2020 202f 2f20 .dup; //
-0000960: 6d75 7374 2064 7570 0a0a 2020 2020 2f2f must dup.. //
-0000970: 2f20 4669 6e64 7320 616c 6c20 616c 7465 / Finds all alte
-0000980: 726e 6174 6976 6573 2066 6f72 2074 6865 rnatives for the
-0000990: 2067 6976 656e 206e 756d 6265 720a 2020 given number.
-00009a0: 2020 2f2f 2f20 2873 686f 756c 6420 6861 /// (should ha
-00009b0: 7665 2062 6565 6e20 7374 7269 7070 6564 ve been stripped
-00009c0: 2066 726f 6d20 6e6f 6e2d 6469 6769 7420 from non-digit
-00009d0: 6368 6172 6163 7465 7273 290a 2020 2020 characters).
-00009e0: 7374 7269 6e67 6172 7261 7920 5f46 696e stringarray _Fin
-00009f0: 6457 6f72 6473 2820 7374 7269 6e67 206e dWords( string n
-0000a00: 756d 6265 7273 2c20 626f 6f6c 2064 6967 umbers, bool dig
-0000a10: 6974 6f6b 2029 0a20 2020 2069 6e20 7b0a itok ). in {.
-0000a20: 2020 2020 2020 2020 6173 7365 7274 286e assert(n
-0000a30: 756d 6265 7273 2e6c 656e 6774 6820 3e20 umbers.length >
-0000a40: 2030 293b 2020 2020 0a20 2020 207d 2020 0); . }
-0000a50: 2020 0a20 2020 206f 7574 2872 6573 756c . out(resul
-0000a60: 7429 207b 0a20 2020 2020 2020 2066 6f72 t) {. for
-0000a70: 6561 6368 2028 613b 2072 6573 756c 7429 each (a; result)
-0000a80: 0a20 2020 2020 2020 2020 2020 2061 7373 . ass
-0000a90: 6572 7428 2077 6f72 6454 6f4e 756d 2861 ert( wordToNum(a
-0000aa0: 2920 3d3d 206e 756d 6265 7273 2029 3b0a ) == numbers );.
-0000ab0: 2020 2020 7d20 2020 200a 2020 2020 626f } . bo
-0000ac0: 6479 207b 0a20 2020 2020 2020 2073 7472 dy {. str
-0000ad0: 696e 6761 7272 6179 2072 6574 3b0a 2020 ingarray ret;.
-0000ae0: 2020 2020 2020 626f 6f6c 2066 6f75 6e64 bool found
-0000af0: 776f 7264 203d 2066 616c 7365 3b0a 2020 word = false;.
-0000b00: 2020 2020 2020 666f 7220 2875 696e 7420 for (uint
-0000b10: 743d 313b 2074 3c3d 6e75 6d62 6572 732e t=1; t<=numbers.
-0000b20: 6c65 6e67 7468 3b20 2b2b 7429 207b 0a20 length; ++t) {.
-0000b30: 2020 2020 2020 2020 2020 2061 7574 6f20 auto
-0000b40: 616c 7465 726e 6174 6976 6573 203d 206e alternatives = n
-0000b50: 756d 6265 7273 5b30 2e2e 745d 2069 6e20 umbers[0..t] in
-0000b60: 6e75 6d32 776f 7264 733b 0a20 2020 2020 num2words;.
-0000b70: 2020 2020 2020 2069 6620 2821 616c 7465 if (!alte
-0000b80: 726e 6174 6976 6573 290a 2020 2020 2020 rnatives).
-0000b90: 2020 2020 2020 2020 2020 636f 6e74 696e contin
-0000ba0: 7565 3b0a 2020 2020 2020 2020 2020 2020 ue;.
-0000bb0: 666f 756e 6477 6f72 6420 3d20 7472 7565 foundword = true
-0000bc0: 3b0a 2020 2020 2020 2020 2020 2020 6966 ;. if
-0000bd0: 2028 6e75 6d62 6572 732e 6c65 6e67 7468 (numbers.length
-0000be0: 203e 2020 7429 207b 0a20 2020 2020 2020 > t) {.
-0000bf0: 2020 2020 2020 2020 202f 2f20 436f 6d62 // Comb
-0000c00: 696e 6520 616c 6c20 6375 7272 656e 7420 ine all current
-0000c10: 616c 7465 726e 6174 6976 6573 2077 6974 alternatives wit
-0000c20: 6820 616c 6c20 616c 7465 726e 6174 6976 h all alternativ
-0000c30: 6573 2020 2020 200a 2020 2020 2020 2020 es .
-0000c40: 2020 2020 2020 2020 2f2f 206f 6620 7468 // of th
-0000c50: 6520 7265 7374 2028 6e65 7874 2070 6965 e rest (next pie
-0000c60: 6365 2063 616e 2073 7461 7274 2077 6974 ce can start wit
-0000c70: 6820 6120 6469 6769 7429 2020 2020 2020 h a digit)
-0000c80: 2020 2020 2020 2020 0a20 2020 2020 2020 .
-0000c90: 2020 2020 2020 2020 2066 6f72 6561 6368 foreach
-0000ca0: 2028 6132 3b20 5f46 696e 6457 6f72 6473 (a2; _FindWords
-0000cb0: 2820 6e75 6d62 6572 735b 742e 2e24 5d2c ( numbers[t..$],
-0000cc0: 2074 7275 6520 2020 2020 2920 290a 2020 true ) ).
-0000cd0: 2020 2020 2020 2020 2020 2020 2020 2020
-0000ce0: 2020 666f 7265 6163 6828 6131 3b20 2a61 foreach(a1; *a
-0000cf0: 6c74 6572 6e61 7469 7665 7329 0a20 2020 lternatives).
-0000d00: 2020 2020 2020 2020 2020 2020 2020 2020
-0000d10: 2020 2020 7265 7420 7e3d 2061 3120 7e20 ret ~= a1 ~
-0000d20: 2220 2220 7e20 6132 3b0a 2020 2020 2020 " " ~ a2;.
-0000d30: 2020 2020 2020 7d0a 2020 2020 2020 2020 }.
-0000d40: 2020 2020 656c 7365 2020 2020 0a20 2020 else .
-0000d50: 2020 2020 2020 2020 2020 2020 2072 6574 ret
-0000d60: 207e 3d20 2a61 6c74 6572 6e61 7469 7665 ~= *alternative
-0000d70: 733b 2020 2020 2f2f 2061 7070 656e 6420 s; // append
-0000d80: 7468 6573 6520 616c 7465 726e 6174 6976 these alternativ
-0000d90: 6573 0a20 2020 2020 2020 207d 0a20 2020 es. }.
-0000da0: 2020 2020 202f 2f20 5472 7920 746f 206b // Try to k
-0000db0: 6565 7020 3120 6469 6769 742c 206f 6e6c eep 1 digit, onl
-0000dc0: 7920 6966 2077 6527 7265 2061 6c6c 6f77 y if we're allow
-0000dd0: 6564 2061 6e64 206e 6f20 6f74 6865 720a ed and no other.
-0000de0: 2020 2020 2020 2020 2f2f 2061 6c74 6572 // alter
-0000df0: 6e61 7469 7665 7320 7765 7265 2066 6f75 natives were fou
-0000e00: 6e64 0a20 2020 2020 2020 202f 2f20 5465 nd. // Te
-0000e10: 7374 696e 6720 2272 6574 2e6c 656e 6774 sting "ret.lengt
-0000e20: 6822 206d 616b 6573 206d 6f72 6520 7365 h" makes more se
-0000e30: 6e73 6520 7468 616e 2074 6573 7469 6e67 nse than testing
-0000e40: 2022 666f 756e 6477 6f72 6422 2c0a 2020 "foundword",.
-0000e50: 2020 2020 2020 2f2f 2062 7574 2074 6865 // but the
-0000e60: 206f 7468 6572 2069 6d70 6c65 6d65 6e74 other implement
-0000e70: 6174 696f 6e73 2073 6565 6d20 746f 2064 ations seem to d
-0000e80: 6f20 6a75 7374 2074 6869 732e 0a20 2020 o just this..
-0000e90: 2020 2020 2069 6620 2864 6967 6974 6f6b if (digitok
-0000ea0: 2026 2620 2166 6f75 6e64 776f 7264 2920 && !foundword)
-0000eb0: 7b20 2f2f 7265 742e 6c65 6e67 7468 203d { //ret.length =
-0000ec0: 3d20 3020 200a 2020 2020 2020 2020 2020 = 0 .
-0000ed0: 2020 6966 286e 756d 6265 7273 2e6c 656e if(numbers.len
-0000ee0: 6774 6820 3e20 2031 2920 7b0a 2020 2020 gth > 1) {.
-0000ef0: 2020 2020 2020 2020 2020 2020 2f2f 2043 // C
-0000f00: 6f6d 6269 6e65 2031 2064 6967 6974 2077 ombine 1 digit w
-0000f10: 6974 6820 616c 6c20 616c 7465 6e61 7469 ith all altenati
-0000f20: 7665 7320 6672 6f6d 2074 6865 2072 6573 ves from the res
-0000f30: 7420 2020 200a 2020 2020 2020 2020 2020 t .
-0000f40: 2020 2020 2020 2f2f 2028 6e65 7874 2070 // (next p
-0000f50: 6965 6365 2063 616e 206e 6f74 2073 7461 iece can not sta
-0000f60: 7274 2077 6974 6820 6120 6469 6769 7429 rt with a digit)
-0000f70: 2020 2020 2020 2020 2020 0a20 2020 2020 .
-0000f80: 2020 2020 2020 2020 2020 2066 6f72 6561 forea
-0000f90: 6368 2028 613b 205f 4669 6e64 576f 7264 ch (a; _FindWord
-0000fa0: 7328 206e 756d 6265 7273 5b31 2e2e 245d s( numbers[1..$]
-0000fb0: 2c20 6661 6c73 6520 2920 290a 2020 2020 , false ) ).
-0000fc0: 2020 2020 2020 2020 2020 2020 2020 2020
-0000fd0: 7265 7420 7e3d 206e 756d 6265 7273 5b30 ret ~= numbers[0
-0000fe0: 2e2e 315d 207e 2022 2022 207e 2061 3b0a ..1] ~ " " ~ a;.
-0000ff0: 2020 2020 2020 2020 2020 2020 7d20 2020 }
-0001000: 200a 2020 2020 2020 2020 2020 2020 656c . el
-0001010: 7365 2020 2020 0a20 2020 2020 2020 2020 se .
-0001020: 2020 2020 2020 2072 6574 207e 3d20 6e75 ret ~= nu
-0001030: 6d62 6572 735b 302e 2e31 5d3b 2020 2020 mbers[0..1];
-0001040: 2f2f 206a 7573 7420 6170 7065 6e64 2074 // just append t
-0001050: 6869 7320 6469 6769 7420 2020 2020 2020 his digit
-0001060: 2020 2020 2020 0a20 2020 2020 2020 207d . }
-0001070: 2020 2020 0a20 2020 2020 2020 2072 6574 . ret
-0001080: 7572 6e20 7265 743b 0a20 2020 207d 0a0a urn ret;. }..
-0001090: 2020 2020 2f2f 2f20 2854 6869 7320 6675 /// (This fu
-00010a0: 6e63 7469 6f6e 2077 6173 2069 6e6c 696e nction was inlin
-00010b0: 6564 2069 6e20 7468 6520 6f72 6967 696e ed in the origin
-00010c0: 616c 2070 726f 6772 616d 2920 0a20 2020 al program) .
-00010d0: 202f 2f2f 2046 696e 6473 2061 6c6c 2061 /// Finds all a
-00010e0: 6c74 6572 6e61 7469 7665 7320 666f 7220 lternatives for
-00010f0: 7468 6520 6769 7665 6e20 7068 6f6e 6520 the given phone
-0001100: 6e75 6d62 6572 200a 2020 2020 2f2f 2f20 number . ///
-0001110: 5265 7475 726e 733a 2061 7272 6179 206f Returns: array o
-0001120: 6620 7374 7269 6e67 7320 0a20 2020 2073 f strings . s
-0001130: 7472 696e 6761 7272 6179 2046 696e 6457 tringarray FindW
-0001140: 6f72 6473 2820 7374 7269 6e67 2070 686f ords( string pho
-0001150: 6e65 5f6e 756d 6265 7220 290a 2020 2020 ne_number ).
-0001160: 7b0a 2020 2020 2020 2020 6966 2028 2170 {. if (!p
-0001170: 686f 6e65 5f6e 756d 6265 722e 6c65 6e67 hone_number.leng
-0001180: 7468 290a 2020 2020 2020 2020 2020 2020 th).
-0001190: 7265 7475 726e 206e 756c 6c3b 0a20 2020 return null;.
-00011a0: 2020 2020 202f 2f20 5374 7269 7020 7468 // Strip th
-00011b0: 6520 6e6f 6e2d 6469 6769 7420 6368 6172 e non-digit char
-00011c0: 6163 7465 7273 2066 726f 6d20 7468 6520 acters from the
-00011d0: 7068 6f6e 6520 6e75 6d62 6572 2c20 616e phone number, an
-00011e0: 640a 2020 2020 2020 2020 2f2f 2070 6173 d. // pas
-00011f0: 7320 6974 2074 6f20 7468 6520 7265 6375 s it to the recu
-0001200: 7273 6976 6520 6675 6e63 7469 6f6e 2028 rsive function (
-0001210: 6c65 6164 696e 6720 6469 6769 7420 6973 leading digit is
-0001220: 2061 6c6c 6f77 6564 290a 2020 2020 2020 allowed).
-0001230: 2020 7265 7475 726e 205f 4669 6e64 576f return _FindWo
-0001240: 7264 7328 2073 7472 6970 4e6f 6e44 6967 rds( stripNonDig
-0001250: 6974 2870 686f 6e65 5f6e 756d 6265 7229 it(phone_number)
-0001260: 2c20 7472 7565 2029 3b20 2020 200a 2020 , true ); .
-0001270: 2020 7d20 2020 200a 2020 2020 0a20 2020 } . .
-0001280: 202f 2f20 5265 6164 2074 6865 2070 686f // Read the pho
-0001290: 6e65 206e 756d 6265 7273 2020 2020 200a ne numbers .
-00012a0: 2020 2020 666f 7265 6163 6828 7374 7269 foreach(stri
-00012b0: 6e67 2070 686f 6e65 3b20 6e65 7720 4275 ng phone; new Bu
-00012c0: 6666 6572 6564 4669 6c65 2822 696e 7075 fferedFile("inpu
-00012d0: 742e 7478 7422 2020 2029 2029 0a20 2020 t.txt" ) ).
-00012e0: 2020 2020 2066 6f72 6561 6368 2861 6c74 foreach(alt
-00012f0: 6572 6e61 7469 7665 3b20 4669 6e64 576f ernative; FindWo
-0001300: 7264 7328 2070 686f 6e65 2029 2029 0a20 rds( phone ) ).
-0001310: 2020 2020 2020 2020 2020 2077 7269 7465 write
-0001320: 666c 6e28 7068 6f6e 652c 2022 3a20 222c fln(phone, ": ",
-0001330: 2061 6c74 6572 6e61 7469 7665 2029 3b0a alternative );.
-0001340: 7d0a 0a }..
diff --git a/tests/examplefiles/html+php_faulty.php b/tests/examplefiles/html+php_faulty.php
deleted file mode 100644
index b3d9bbc7..00000000
--- a/tests/examplefiles/html+php_faulty.php
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/tests/examplefiles/http_request_example b/tests/examplefiles/http_request_example
deleted file mode 100644
index 675d1691..00000000
--- a/tests/examplefiles/http_request_example
+++ /dev/null
@@ -1,15 +0,0 @@
-POST /demo/submit/ HTTP/1.1
-Host: pygments.org
-Connection: keep-alivk
-Cache-Control: max-age=0
-Origin: http://pygments.org
-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
-Content-Type: application/x-www-form-urlencoded
-Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
-Referer: http://pygments.org/
-Accept-Encoding: gzip,deflate,sdch
-Accept-Language: en-US,en;q=0.8
-Accept-Charset: windows-949,utf-8;q=0.7,*;q=0.3
-
-name=test&lang=text&code=asdf&user=
diff --git a/tests/examplefiles/http_response_example b/tests/examplefiles/http_response_example
deleted file mode 100644
index 51340ca4..00000000
--- a/tests/examplefiles/http_response_example
+++ /dev/null
@@ -1,29 +0,0 @@
-HTTP/1.1 200 OK
-Date: Tue, 13 Dec 2011 00:11:44 GMT
-Status: 200 OK
-X-Transaction: 50b85fff78dab4a3
-X-RateLimit-Limit: 150
-ETag: "b31143be48ebfe7512b65fe64fe092f3"
-X-Frame-Options: SAMEORIGIN
-Last-Modified: Tue, 13 Dec 2011 00:11:44 GMT
-X-RateLimit-Remaining: 145
-X-Runtime: 0.01190
-X-Transaction-Mask: a6183ffa5f8ca943ff1b53b5644ef1145f6f285d
-Content-Type: application/json; charset=utf-8
-Content-Length: 2389
-Pragma: no-cache
-X-RateLimit-Class: api
-X-Revision: DEV
-Expires: Tue, 31 Mar 1981 05:00:00 GMT
-Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
-X-MID: a55f21733bc52bb11d1fc58f9b51b4974fbb8f83
-X-RateLimit-Reset: 1323738416
-Set-Cookie: k=10.34.234.116.1323735104238974; path=/;
- expires=Tue, 20-Dec-11 00:11:44 GMT; domain=.twitter.com
-Set-Cookie: guest_id=v1%3A13237351042425496; domain=.twitter.com; path=/;
- expires=Thu, 12-Dec-2013 12:11:44 GMT
-Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCPS6wjQ0AToHaWQiJTFiMTlhY2E1ZjczYThk%250ANDUwMWQxNjMwZGU2YTQ1ODBhIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--6b502f30a083e8a41a64f10930e142ea362b1561; domain=.twitter.com; path=/; HttpOnly
-Vary: Accept-Encoding
-Server: tfe
-
-[{"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/hybris_File.hy b/tests/examplefiles/hybris_File.hy
deleted file mode 100644
index 9c86c641..00000000
--- a/tests/examplefiles/hybris_File.hy
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * This file is part of the Hybris programming language.
- *
- * Copyleft of Francesco Morucci aka merlok <merlok@ihteam.net>
- *
- * Hybris 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 3 of the License, or
- * (at your option) any later version.
- *
- * Hybris 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 Hybris. If not, see <http://www.gnu.org/licenses/>.
-*/
-import std.io.file;
-
-class File {
-
- protected file, fileName, mode;
-
- public method File( fileName, mode ){
- me.fileName = fileName;
- me.mode = mode;
- me.file = fopen ( me.fileName, me.mode);
- }
-
- private method isBinary(){
- return me.mode.find("b") != false;
- }
-
- public method File ( file ){
- me.file = file;
- }
-
- private method __expire() {
- me.close();
- }
-
- public method close(){
- fclose( me.file );
- }
-
- public method readLine(){
- return line = fgets( me.file );
- }
-
- public method getFileName(){
- return me.fileName;
- }
-
- public method getSize(){
- return fsize( me.fileName );
- }
-
- public method getPosition(){
- return ftell( me.file );
- }
-
- public method readAll(){
- text = "";
- line = "";
- while ( ( line = fgets(me.file) ) != 0 ){
- text += line;
- }
- return text;
- }
-
- public method read(){
- byte = ' ';
- if ( fread( me.file, byte) > 0 ) {
- return byte;
- }
- else {
- return -1;
- }
- }
-
- public method read( bytes ) {
- word = "";
- byte = ' ';
- if ( fread( me.file, byte, bytes) > 0 ) {
- word += byte;
- }
- else {
- return -1;
- }
- return word;
- }
-
- public method read ( seek, seekType ){
- if ( me.seek( seek, seekType) == 0 ) {
- return -1;
- }
-
- return me.read();
- }
-
- public method read ( bytes, seek, seekType ){
- if ( me.seek( seek, seekType) == 0 ) {
- return -1;
- }
-
- return me.read( bytes );
- }
-
- public method readType ( type ){
- if ( me.isBinary() == false ) {
- return -1;
- }
- if ( fread (me.file, type ) > 0 ) {
- return type;
- }
- else {
- return -1;
- }
- }
-
- operator >> ( object ){
- return me.readType(object);
- }
-
- public method readType ( type, bytes ){
- if ( me.isBinary() == false ) {
- return -1;
- }
- if ( fread (me.file, type, bytes ) > 0){
- return type;
- }
- else {
- return -1;
- }
- }
-
- public method readType ( type, seek, seekType ){
- if ( ( me.isBinary() == false ) | ( me.seek( seek, seekType) == 0 ) ) {
- return -1;
- }
-
- return me.readType( type );
- }
-
- public method readType( type, bytes, seek, seekType){
- if ( ( me.isBinary() == false ) | ( me.seek( seek, seekType) == 0 ) ) {
- return -1;
- }
-
- return me.readType( type, bytes );
- }
-
- public method write( data ){
- return fwrite( me.file, data );
- }
-
- operator << ( object ){
- return me.write(object);
- }
-
- public method write ( data, bytes ){
- return fwrite( me.file, data, bytes);
- }
-
- public method seek( pos, mode ){
- return fseek( me.file, pos, mode );
- }
-
- public method merge ( fileName ){
- text = file ( fileName );
- return me.write ( me.file, text );
- }
-}
diff --git a/tests/examplefiles/idl_sample.pro b/tests/examplefiles/idl_sample.pro
deleted file mode 100644
index 814d510d..00000000
--- a/tests/examplefiles/idl_sample.pro
+++ /dev/null
@@ -1,73 +0,0 @@
-; docformat = 'rst'
-
-; Example IDL (Interactive Data Language) source code.
-
-;+
-; Get `nIndices` random indices for an array of size `nValues` (without
-; repeating an index).
-;
-; :Examples:
-; Try::
-;
-; IDL> r = randomu(seed, 10)
-; IDL> print, r, format='(4F)'
-; 0.6297589 0.7815896 0.2508559 0.7546844
-; 0.1353382 0.1245834 0.8733745 0.0753110
-; 0.8054136 0.9513228
-; IDL> ind = mg_sample(10, 3, seed=seed)
-; IDL> print, ind
-; 2 4 7
-; IDL> print, r[ind]
-; 0.250856 0.135338 0.0753110
-;
-; :Returns:
-; lonarr(`nIndices`)
-;
-; :Params:
-; nValues : in, required, type=long
-; size of array to choose indices from
-; nIndices : in, required, type=long
-; number of indices needed
-;
-; :Keywords:
-; seed : in, out, optional, type=integer or lonarr(36)
-; seed to use for random number generation, leave undefined to use a
-; seed generated from the system clock; new seed will be output
-;-
-function mg_sample, nValues, nIndices, seed=seed
- compile_opt strictarr
-
- ; get random nIndices by finding the indices of the smallest nIndices in a
- ; array of random values
- values = randomu(seed, nValues)
-
- ; our random values are uniformly distributed, so ideally the nIndices
- ; smallest values are in the first bin of the below histogram
- nBins = nValues / nIndices
- h = histogram(values, nbins=nBins, reverse_indices=ri)
-
- ; the candidates for being in the first nIndices will live in bins 0..bin
- nCandidates = 0L
- for bin = 0L, nBins - 1L do begin
- nCandidates += h[bin]
- if (nCandidates ge nIndices) then break
- endfor
-
- ; get the candidates and sort them
- candidates = ri[ri[0] : ri[bin + 1L] - 1L]
- sortedCandidates = sort(values[candidates])
-
- ; return the first nIndices of them
- return, (candidates[sortedCandidates])[0:nIndices-1L]
-end
-
-
-; main-level example program
-
-r = randomu(seed, 10)
-print, r
-ind = mg_sample(10, 3, seed=seed)
-print, ind
-print, r[ind]
-
-end \ No newline at end of file
diff --git a/tests/examplefiles/iex_example b/tests/examplefiles/iex_example
deleted file mode 100644
index 22407e4e..00000000
--- a/tests/examplefiles/iex_example
+++ /dev/null
@@ -1,23 +0,0 @@
-iex> :" multi
-...> line ' \s \123 \x20
-...> atom"
-:" multi\n line ' S \natom"
-
-iex(1)> <<"hello"::binary, c :: utf8, x::[4, unit(2)]>> = "hello™1"
-"hello™1"
-
-iex(2)> c
-8482
-
-iex> 1 + :atom
-** (ArithmeticError) bad argument in arithmetic expression
- :erlang.+(1, :atom)
-
-iex(3)> 1 +
-...(3)> 2 +
-...(3)> 3
-6
-
-iex> IO.puts "Hello world"
-Hello world
-:ok
diff --git a/tests/examplefiles/inet_pton6.dg b/tests/examplefiles/inet_pton6.dg
deleted file mode 100644
index 3813d5b8..00000000
--- a/tests/examplefiles/inet_pton6.dg
+++ /dev/null
@@ -1,71 +0,0 @@
-import '/re'
-import '/sys'
-
-
-# IPv6address = hexpart [ ":" IPv4address ]
-# IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
-# hexpart = [ hexseq ] [ "::" [ hexseq ] ]
-# hexseq = hex4 *( ":" hex4)
-# hex4 = 1*4HEXDIG
-hexpart = r'({0}|)(?:::({0}|)|)'.format r'(?:[\da-f]{1,4})(?::[\da-f]{1,4})*'
-addrv4 = r'(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})'
-addrv6 = re.compile $ r'(?i)(?:{})(?::{})?$'.format hexpart addrv4
-
-
-# Parse a base-N number given a list of its digits.
-#
-# :param q: the number of digits in that numeral system
-#
-# :param digits: an iterable of integers in range [0..q]
-#
-# :return: a decimal integer
-#
-base_n = q digits -> foldl (x y -> x * q + y) 0 digits
-
-
-# Parse a sequence of hexadecimal numbers
-#
-# :param q: a string of colon-separated base-16 integers
-#
-# :return: an iterable of Python ints
-#
-unhex = q -> q and map (p -> int p 16) (q.split ':')
-
-
-# Parse an IPv6 address as specified in RFC 4291.
-#
-# :param address: a string, obviously.
-#
-# :return: an integer which, written in binary form, points to the same node.
-#
-inet_pton6 = address ->
- not (match = addrv6.match address) => raise $ ValueError 'not a valid IPv6 address'
- start, end, *ipv4 = match.groups!
-
- is_ipv4 = not $ None in ipv4
- shift = (7 - start.count ':' - 2 * is_ipv4) * 16
-
- (end is None and shift) or shift < 0 => raise $ ValueError 'not a valid IPv6 address'
- hexaddr = (base_n 0x10000 (unhex start) << shift) + base_n 0x10000 (unhex $ end or '')
- if (is_ipv4 => (hexaddr << 32) + base_n 0x100 (map int ipv4)) (otherwise => hexaddr)
-
-
-inet6_type = q -> if
- q == 0 => 'unspecified'
- q == 1 => 'loopback'
- (q >> 32) == 0x000000000000ffff => 'IPv4-mapped'
- (q >> 64) == 0xfe80000000000000 => 'link-local'
- (q >> 120) != 0x00000000000000ff => 'general unicast'
- (q >> 112) % (1 << 4) == 0x0000000000000000 => 'multicast w/ reserved scope value'
- (q >> 112) % (1 << 4) == 0x000000000000000f => 'multicast w/ reserved scope value'
- (q >> 112) % (1 << 4) == 0x0000000000000001 => 'interface-local multicast'
- (q >> 112) % (1 << 4) == 0x0000000000000004 => 'admin-local multicast'
- (q >> 112) % (1 << 4) == 0x0000000000000005 => 'site-local multicast'
- (q >> 112) % (1 << 4) == 0x0000000000000008 => 'organization-local multicast'
- (q >> 112) % (1 << 4) == 0x000000000000000e => 'global multicast'
- (q >> 112) % (1 << 4) != 0x0000000000000002 => 'multicast w/ unknown scope value'
- (q >> 24) % (1 << 112) == 0x00000000000001ff => 'solicited-node multicast'
- otherwise => 'link-local multicast'
-
-
-print $ (x -> inet6_type x, hex x) $ inet_pton6 $ sys.stdin.read!.strip!
diff --git a/tests/examplefiles/inform6_example b/tests/examplefiles/inform6_example
deleted file mode 100644
index 6fa1fe5b..00000000
--- a/tests/examplefiles/inform6_example
+++ /dev/null
@@ -1,375 +0,0 @@
-!% $SMALL ! This is ICL, not a comment.
-!% -w
-
-!% A comprehensive test of Inform6Lexer.
-
-Switches d2SDq;
-
-Constant Story "Informal Testing";
-Constant Headline "^Not a game.^";!% This is a comment, not ICL.
-
-Release 3;
-Serial "151213";
-Version 5;
-
-Ifndef TARGET_ZCODE;
-Ifndef TARGET_GLULX;
-Ifndef WORDSIZE;
-Default WORDSIZE 2;
-Constant TARGET_ZCODE;
-Endif;
-Endif;
-Endif;
-
-Ifv3; Message "Compiling to version 3"; Endif;
-Ifv5; Message "Not compiling to version 3"; endif;
-ifdef TARGET_ZCODE;
-#IFTRUE (#version_number == 5);
-Message "Compiling to version 5";
-#ENDIF;
-endif ;
-
-Replace CreatureTest;
-
-Include "Parser";
-Include "VerbLib";
-
-# ! A hash is optional at the top level.
-Object kitchen "Kitchen"
- with description "You are in a kitchen.",
- arr 1 2 3 4,
- has light;
-
-#[ Initialise;
- location = kitchen;
- print "v"; inversion; "^";
-];
-
-Ifdef VN_1633;
-Replace IsSeeThrough IsSeeThroughOrig;
-[ IsSeeThrough * o;
- return o hasnt opaque || IsSeeThroughOrig(o);
-];
-Endif;
-
-Abbreviate "test";
-
-Array table buffer 260;
-
-Attribute reversed;
-Attribute opaque alias locked;
-Constant to reversed;
-
-Property long additive additive long alias;
-Property long long long wingspan alias alias;
-
-Class Flier with wingspan 5;
-Class Bird(10) has animate class Flier with wingspan 2;
-
-Constant Constant1;
-Constant Constant2 Constant1;
-Constant Constant3 = Constant2;
-Ifdef VN_1633; Undef Constant; Endif;
-
-Ifdef VN_1633;
-Dictionary 'word' 1 2;
-Ifnot;
-Dictionary dict_word "word";
-Endif;
-
-Fake_action NotReal;
-
-Global global1;
-Global global2 = 69105;
-
-Lowstring low_string "low string";
-
-Iftrue false;
-Message error "Uh-oh!^~false~ shouldn't be ~true~.";
-Endif;
-Iffalse true;
-Message fatalerror "Uh-oh!^~true~ shouldn't be ~false~.";
-Endif;
-
-Nearby person "person"
- with name 'person',
- description "This person is barely implemented.",
- life [ * x y z;
- Ask: print_ret (The) self, " says nothing.";
- Answer: print (The) self, " didn't say anything.^"; rfalse;
- ]
- has has animate transparent;
-
-Object -> -> test_tube "test tube"
- with name 'test' "tube" 'testtube',
- has ~openable ~opaque container;
-
-Bird -> pigeon
- with name 'pigeon',
- description [;
- "The pigeon has a wingspan of ", self.&wingspan-->0, " wing units.";
- ];
-
-Object -> "thimble" with name 'thimble';
-
-Object -> pebble "pebble" with name 'pebble';
-
-Ifdef TARGET_ZCODE; Trace objects; Endif;
-
-Statusline score;
-
-Stub StubR 3;
-
-Ifdef TARGET_ZCODE;
-Zcharacter "abcdefghijklmnopqrstuvwxyz"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "123456789.,!?_#'0/@{005C}-:()";
-Zcharacter table '@!!' '@<<' '@'A';
-Zcharacter table + '@AE' '@{dc}' '@et' '@:y';
-Ifnot;
-Ifdef TARGET_GLULX;
-Message "Glulx doesn't use ~Zcharacter~.^Oh well."; ! '~' and '^' work here.
-Ifnot;
-Message warning "Uh-oh! ^~^"; ! They don't work in other Messages.
-Endif;
-Endif;
-
-Include "Grammar";
-
-Verb"acquire"'collect'='take';
-
-[ NounFilter; return noun ofclass Bird; ];
-
-[ ScopeFilter obj;
- switch (scope_stage) {
- 1: rtrue;
- 2: objectloop (obj in compass) PlaceInScope(obj);
- 3: "Nothing is in scope.";
- }
-];
-
-Verb meta "t" 'test'
- * 'held' held -> TestHeld
- * number -> TestNumber
- * reversed -> TestAttribute
- * 'creature' creature -> TestCreature
- * 'multiheld' multiheld -> TestMultiheld
- * 'm' multiexcept 'into'/"in" noun -> TestMultiexcept
- * 'm' multiinside 'from' noun -> TestMultiinside
- * multi -> TestMulti
- * 'filter'/'f' noun=NounFilter -> TestNounFilter
- * 'filter'/'f' scope=ScopeFilter -> TestScopeFilter
- * 'special' special -> TestSpecial
- * topic -> TestTopic;
-
-Verb 'reverse' 'swap' 'exchange'
- * held 'for' noun -> reverse
- * noun 'with' noun -> reverse reverse;
-
-Extend "t" last * noun -> TestNoun;
-
-Extend 't' first * -> Test;
-
-Extend 'wave' replace * -> NewWave;
-
-Extend only 'feel' 'touch' replace * noun -> Feel;
-
-[ TestSub "a\
- " b o "@@98"; ! Not an escape sequence.
- string 25 low_string;
- print "Test what?> ";
- table->0 = 260;
- parse->0 = 61;
- #Ifdef TARGET_ZCODE;
- read buffer parse;
- #Ifnot; ! TARGET_GLULX
- KeyboardPrimitive(buffer, parse);
- #Endif; ! TARGET_
- switch (parse-->1) {
- 'save':
- #Ifdef TARGET_ZCODE;
- #Ifv3;
- @save ?saved;
- #Ifnot;
- save saved;
- #Endif;
- #Endif;
- print "Saving failed.^";
- 'restore':
- #Ifdef TARGET_ZCODE;
- restore saved;
- #Endif;
- print "Restoring failed.^";
- 'restart':
- @restart;
- 'quit', 'q//':
- quit;
- return 2; rtrue; rfalse; return;
- 'print', 'p//':
- print "Print:^",
- " (string): ", (string) "xyzzy^",
- " (number): ", (number) 123, "^",
- " (char): ", (char) 'x', "^",
- " (address): ", (address) 'plugh//p', "^",
- " (The): ", (The) person, "^",
- " (the): ", (the) person, "^",
- " (A): ", (A) person, "^",
- " (a): ", (a) person, "^",
- " (an): ", (an) person, "^",
- " (name): ", (name) person, "^",
- " (object): ", (object) person, "^",
- " (property): ", (property) alias, "^",
- " (<routine>): ", (LanguageNumber) 123, "^",
- " <expression>: ", a * 2 - 1, "^",
- " (<expression>): ", (a + person), "^";
- print "Escapes:^",
- " by mnemonic: @!! @<< @'A @AE @et @:y^",
- " by decimal value: @@64 @@126^",
- " by Unicode value: @{DC}@{002b}^",
- " by string variable: @25^";
- 'font', 'style':
- font off; print "font off^";
- font on; print "font on^";
- style reverse; print "style reverse^"; style roman;
- style bold; print "style bold^";
- style underline; print "style underline^";
- style fixed; print "style fixed^";
- style roman; print "style roman^";
- 'statements':
- spaces 8;
- objectloop (o) {
- print "objectloop (o): ", (the) o, "^";
- }
- objectloop (o in compass) { ! 'in' is a keyword
- print "objectloop (o in compass): ", (the) o, "^";
- }
- objectloop (o in compass && true) { ! 'in' is an operator
- print "objectloop (o in compass && true): ", (the) o, "^";
- }
- objectloop (o from se_obj) {
- print "objectloop (o from se_obj): ", (the) o, "^";
- }
- objectloop (o near person) {
- print "objectloop (o near person): ", (the) o, "^";
- }
- #Ifdef TARGET_ZCODE;
- #Trace assembly on;
-@ ! This is assembly.
- add -4 ($$1+$3)*2 -> b;
- @get_sibling test_tube -> b ?saved;
- @inc [b];
- @je sp (1+3*0) ? equal;
- @je 1 ((sp)) ?~ different;
- .! This is a label:
- equal;
- print "sp == 1^";
- jump label;
- .different;
- print "sp @@126= 1^";
- .label;
- #Trace off; #Endif; ! TARGET_ZCODE
- a = random(10);
- switch (a) {
- 1, 9:
- box "Testing oneself is best when done alone."
- " -- Jimmy Carter";
- 2, 6, to, 3 to 5, to to to:
- <Take pigeon>;
- #Ifdef VN_1633;
- <Jump, person>;
- #Endif;
- a = ##Drop;
- < ! The angle brackets may be separated by whitespace.
- < (a) pigeon > >;
- default:
- do {
- give person general ~general;
- } until (person provides life && ~~false);
- if (a == 7) a = 4;
- else a = 5;
- }
- 'expressions':
- a = 1+1-1*1/1%1&1|1&&1||1==(1~=(1>(1<(1>=(1<=1)))));
- a++; ++a; a--; --a;
- a = person.life;
- a = kitchen.&arr;
- a = kitchen.#arr;
- a = Bird::wingspan;
- a = kitchen has general;
- a = kitchen hasnt general;
- a = kitchen provides arr;
- a = person in kitchen;
- a = person notin kitchen;
- a = person ofclass Bird;
- a = a == 0 or 1;
- a = StubR();
- a = StubR(a);
- a = StubR(, a);
- a = "string";
- a = 'word';
- a = '''; ! character
- a = $09afAF;
- a = $$01;
- a = ##Eat; a = #a$Eat;
- a = #g$self;
- a = #n$!word;
- a = #r$StubR;
- a = #dict_par1;
- default:
- for (a = 2, b = a; (a < buffer->1 + 2) && (Bird::wingspan): ++a, b--) {
- print (char) buffer->a;
- }
- new_line;
- for (::) break;
- }
- .saved;;
-];
-
-[ TestNumberSub;
- print_ret parsed_number, " is ", (number) parsed_number, ".";
-];
-
-[ TestAttributeSub; print_ret (The) noun, " has been reversed."; ];
-
-[ CreatureTest obj; return obj has animate; ];
-
-[ TestCreatureSub; print_ret (The) noun, " is a creature."; ];
-
-[ TestMultiheldSub; print_ret "You are holding ", (the) noun, "."; ];
-
-[ TestMultiexceptSub; "You test ", (the) noun, " with ", (the) second, "."; ];
-
-[ TestMultiinsideSub; "You test ", (the) noun, " from ", (the) second, "."; ];
-
-[ TestMultiSub; print_ret (The) noun, " is a thing."; ];
-
-[ TestNounFilterSub; print_ret (The) noun, " is a bird."; ];
-
-[ TestScopeFilterSub; print_ret (The) noun, " is a direction."; ];
-
-[ TestSpecialSub; "Your lucky number is ", parsed_number, "."; ];
-
-[ TestTopicSub; "You discuss a topic."; ];
-
-[ TestNounSub; "That is ", (a) noun, "."; ];
-
-[ TestHeldSub; "You are holding ", (a) noun, "."; ];
-
-[ NewWaveSub; "That would be foolish."; ];
-
-[ FeelSub; print_ret (The) noun, " feels normal."; ];
-
-[ ReverseSub from;
- from = parent(noun);
- move noun to parent(second);
- if (from == to)
- move second to to;
- else
- move second to from;
- give noun to;
- from = to;
- give second from;
- "You swap ", (the) noun, " and ", (the) second, ".";
-];
-
-End: The End directive ends the source code.
diff --git a/tests/examplefiles/interp.scala b/tests/examplefiles/interp.scala
deleted file mode 100644
index 4131b75e..00000000
--- a/tests/examplefiles/interp.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-val n = 123;
-val a = s"n=$n";
-val a2 = s"n=$n''";
-val b = s"""n=$n""";
-val c = f"n=$n%f";
-val d = f"""n=$n%f""";
-val d2 = s"""a"""";
-val e = s"abc\u00e9";
-val f = s"a${n}b";
-val g = s"a${n + 1}b";
diff --git a/tests/examplefiles/intro.ik b/tests/examplefiles/intro.ik
deleted file mode 100644
index 03fcee39..00000000
--- a/tests/examplefiles/intro.ik
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/ioke
-
-Ioke = LanguageExperiment with(
- goal: :expressiveness,
- data: as(code),
- code: as(data),
- features: [
- :dynamic,
- :object_oriented,
- :prototype_based,
- :homoiconic,
- :macros
- ],
- runtimes:(JVM, CLR),
- inspirations: set(Io, Smalltalk, Ruby, Lisp)
-)
-
-hello = method("Every example needs a hello world!",
- name,
- "hello, #{name}!" println)
-
-Ioke inspirations select(
- features include?(:object_oriented)
-) each(x, hello(x name))
diff --git a/tests/examplefiles/ints.php b/tests/examplefiles/ints.php
deleted file mode 100644
index 516ab2c8..00000000
--- a/tests/examplefiles/ints.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-$x = array(0123, 0x0a, -0x0a, -0123, 12, -12);
-
-?>
-<?php
-$a = 1.234;
-$b = 1.2e3;
-$c = 7E-10;
-?>
diff --git a/tests/examplefiles/intsyn.fun b/tests/examplefiles/intsyn.fun
deleted file mode 100644
index 777b0fdb..00000000
--- a/tests/examplefiles/intsyn.fun
+++ /dev/null
@@ -1,675 +0,0 @@
-(* 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
deleted file mode 100644
index ea505362..00000000
--- a/tests/examplefiles/intsyn.sig
+++ /dev/null
@@ -1,286 +0,0 @@
-(* 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/irb_heredoc b/tests/examplefiles/irb_heredoc
deleted file mode 100644
index 3dc205e3..00000000
--- a/tests/examplefiles/irb_heredoc
+++ /dev/null
@@ -1,8 +0,0 @@
-irb(main):001:0> puts <<XYZ
-irb(main):002:0" a
-irb(main):003:0" b
-irb(main):004:0" XYZ
-a
-b
-=> nil
-irb(main):005:0>
diff --git a/tests/examplefiles/irc.lsp b/tests/examplefiles/irc.lsp
deleted file mode 100755
index 6f45976a..00000000
--- a/tests/examplefiles/irc.lsp
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/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/java.properties b/tests/examplefiles/java.properties
deleted file mode 100644
index 72ad0f96..00000000
--- a/tests/examplefiles/java.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-foo = bar
-foo: bar
-foo.oof: \
- bar=baz; \
- asdf
-
-// comment
-# comment
-; comment
-
-x:a\
-b
-x: a \
- b
-
-x = \
diff --git a/tests/examplefiles/jbst_example1.jbst b/tests/examplefiles/jbst_example1.jbst
deleted file mode 100644
index 0e7d014f..00000000
--- a/tests/examplefiles/jbst_example1.jbst
+++ /dev/null
@@ -1,28 +0,0 @@
-<%@ Control Name="MyApp.MyJbstControl" Language="JavaScript" %>
-
-<script type="text/javascript">
-
- /* initialization code block, executed only once as control is loaded */
- this.generateValue = function() {
- return new Date().toString();
- };
-
-</script>
-
-<%!
- /* initialization code block, executed only once as control is loaded */
- /* alternate syntax to script block above */
- this.myInitTime = this.generateValue();
-%>
-
-<%
- /* data binding code block, executed each time as control is data bound */
- this.myBindTime = this.generateValue();
-%>
-
-<%-- JBST Comment --%>
-<span style="color:red"><%= this.myBindTime /* data binding expression */ %></span>
-<span style="color:green"><%= this.myInitTime /* data binding expression */ %></span>
-
-<!-- HTML Comment -->
-<span style="color:blue"><%$ Resources: localizationKey %><%-- JBST globalization--%></span> \ No newline at end of file
diff --git a/tests/examplefiles/jbst_example2.jbst b/tests/examplefiles/jbst_example2.jbst
deleted file mode 100644
index 2b5e0489..00000000
--- a/tests/examplefiles/jbst_example2.jbst
+++ /dev/null
@@ -1,45 +0,0 @@
-<%@ Control Name="Foo.MyZebraList" Language="JavaScript" %>
-
-<script type="text/javascript">
-
- /* private members ------------------------------------------ */
-
- /*int*/ function digits(/*int*/ n) {
- return (n < 10) ? '0' + n : n;
- }
-
- /* public members ------------------------------------------- */
-
- // use the item index to alternate colors and highlight
- /*string*/ this.zebraStripe = function(/*bool*/ selected, /*int*/ index, /*int*/ count) {
- var css = [ "item" ];
- if (index % 2 === 0) {
- css.push("item-alt");
- }
- if (selected) {
- css.push("item-selected");
- }
- return css.join(" ");
- };
-
- /*string*/ this.formatTime = function(/*Date*/ time) {
- return time.getHours() + ':' + digits(time.getMinutes()) + ':' + digits(time.getSeconds());
- };
-
-</script>
-
-<div class="example">
- <h2><%= this.data.title %> as of <%= this.formatTime(this.data.timestamp) %>!</h2>
- <p><%= this.data.description %></p>
- <ul class="items" jbst:visible="<%= this.data.children.length > 0 %>">
-
- <!-- anonymous inner template -->
- <jbst:control data="<%= this.data.children %>">
- <!-- populate list item for each item of the parent's children property -->
- <li class="<%= Foo.MyZebraList.zebraStripe(this.data.selected, this.index, this.count) %>">
- <%= this.data.label %> (<%= this.index+1 %> of <%= this.count %>)
- </li>
- </jbst:control>
-
- </ul>
-</div> \ No newline at end of file
diff --git a/tests/examplefiles/jinjadesignerdoc.rst b/tests/examplefiles/jinjadesignerdoc.rst
deleted file mode 100644
index b4b6c44b..00000000
--- a/tests/examplefiles/jinjadesignerdoc.rst
+++ /dev/null
@@ -1,713 +0,0 @@
-======================
-Designer Documentation
-======================
-
-This part of the Jinja documentaton is meant for template designers.
-
-Basics
-======
-
-The Jinja template language is designed to strike a balance between content
-and application logic. Nevertheless you can use a python like statement
-language. You don't have to know how Python works to create Jinja templates,
-but if you know it you can use some additional statements you may know from
-Python.
-
-Here is a small example template:
-
-.. sourcecode:: html+jinja
-
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- <head>
- <title>My Webpage</title>
- </head>
- <body>
- <ul id="navigation">
- {% for item in navigation %}
- <li><a href="{{ item.href|e }}">{{ item.caption|e }}</a></li>
- {% endfor %}
- </ul>
-
- <h1>My Webpage</h1>
- {{ variable }}
- </body>
- </html>
-
-This covers the default settings. The application developer might have changed
-the syntax from ``{% foo %}`` to ``<% foo %>`` or something similar. This
-documentation just covers the default values.
-
-A variable looks like ``{{ foobar }}`` where foobar is the variable name. Inside
-of statements (``{% some content here %}``) variables are just normal names
-without the braces around it. In fact ``{{ foobar }}`` is just an alias for
-the statement ``{% print foobar %}``.
-
-Variables are coming from the context provided by the application. Normally there
-should be a documentation regarding the context contents but if you want to know
-the content of the current context, you can add this to your template:
-
-.. sourcecode:: html+jinja
-
- <pre>{{ debug()|e }}</pre>
-
-A context isn't flat which means that each variable can has subvariables, as long
-as it is representable as python data structure. You can access attributes of
-a variable using the dot and bracket operators. The following examples show
-this:
-
-.. sourcecode:: jinja
-
- {{ user.username }}
- is the same as
- {{ user['username'] }}
- you can also use a variable to access an attribute:
- {{ users[current_user].username }}
- If you have numerical indices you have to use the [] syntax:
- {{ users[0].username }}
-
-Filters
-=======
-
-In the examples above you might have noticed the pipe symbols. Pipe symbols tell
-the engine that it has to apply a filter on the variable. Here is a small example:
-
-.. sourcecode:: jinja
-
- {{ variable|replace('foo', 'bar')|escape }}
-
-If you want, you can also put whitespace between the filters.
-
-This will look for a variable `variable`, pass it to the filter `replace`
-with the arguments ``'foo'`` and ``'bar'``, and pass the result to the filter
-`escape` that automatically XML-escapes the value. The `e` filter is an alias for
-`escape`. Here is the complete list of supported filters:
-
-[[list_of_filters]]
-
-.. admonition:: note
-
- Filters have a pretty low priority. If you want to add fitered values
- you have to put them into parentheses. The same applies if you want to access
- attributes:
-
- .. sourcecode:: jinja
-
- correct:
- {{ (foo|filter) + (bar|filter) }}
- wrong:
- {{ foo|filter + bar|filter }}
-
- correct:
- {{ (foo|filter).attribute }}
- wrong:
- {{ foo|filter.attribute }}
-
-Tests
-=====
-
-You can use the `is` operator to perform tests on a value:
-
-.. sourcecode:: jinja
-
- {{ 42 is numeric }} -> true
- {{ "foobar" is numeric }} -> false
- {{ 'FOO' is upper }} -> true
-
-These tests are especially useful when used in `if` conditions.
-
-[[list_of_tests]]
-
-Global Functions
-================
-
-Test functions and filter functions live in their own namespace. Global
-functions not. They behave like normal objects in the context. Beside the
-functions added by the application or framewhere there are two functions
-available per default:
-
-`range`
-
- Works like the python `range function`_ just that it doesn't support
- ranges greater than ``1000000``.
-
-`debug`
-
- Function that outputs the contents of the context.
-
-Loops
-=====
-
-To iterate over a sequence, you can use the `for` loop. It basically looks like a
-normal Python `for` loop and works pretty much the same:
-
-.. sourcecode:: html+jinja
-
- <h1>Members</h1>
- <ul>
- {% for user in users %}
- <li>{{ loop.index }} / {{ loop.length }} - {{ user.username|escape }}</li>
- {% else %}
- <li><em>no users found</em></li>
- {% endfor %}
- </ul>
-
-*Important* Contrary to Python is the optional ``else`` block only
-executed if there was no iteration because the sequence was empty.
-
-Inside of a `for` loop block you can access some special variables:
-
-+----------------------+----------------------------------------+
-| Variable | Description |
-+======================+========================================+
-| `loop.index` | The current iteration of the loop. |
-+----------------------+----------------------------------------+
-| `loop.index0` | The current iteration of the loop, |
-| | starting counting by 0. |
-+----------------------+----------------------------------------+
-| `loop.revindex` | The number of iterations from the end |
-| | of the loop. |
-+----------------------+----------------------------------------+
-| `loop.revindex0` | The number of iterations from the end |
-| | of the loop, starting counting by 0. |
-+----------------------+----------------------------------------+
-| `loop.first` | True if first iteration. |
-+----------------------+----------------------------------------+
-| `loop.last` | True if last iteration. |
-+----------------------+----------------------------------------+
-| `loop.even` | True if current iteration is even. |
-+----------------------+----------------------------------------+
-| `loop.odd` | True if current iteration is odd. |
-+----------------------+----------------------------------------+
-| `loop.length` | Total number of items in the sequence. |
-+----------------------+----------------------------------------+
-| `loop.parent` | The context of the parent loop. |
-+----------------------+----------------------------------------+
-
-Loops also support recursion. Let's assume you have a sitemap where each item
-might have a number of child items. A template for that could look like this:
-
-.. sourcecode:: html+jinja
-
- <h1>Sitemap
- <ul id="sitemap">
- {% for item in sitemap recursive %}
- <li><a href="{{ item.url|e }}">{{ item.title|e }}</a>
- {% if item.children %}<ul>{{ loop(item.children) }}</ul>{% endif %}</li>
- {% endfor %}
- </ul>
-
-What happens here? Basically the first thing that is different to a normal
-loop is the additional ``recursive`` modifier in the `for`-loop declaration.
-It tells the template engine that we want recursion. If recursion is enabled
-the special `loop` variable is callable. If you call it with a sequence it will
-automatically render the loop at that position with the new sequence as argument.
-
-Cycling
-=======
-
-Sometimes you might want to have different text snippets for each row in a list,
-for example to have alternating row colors. You can easily do this by using the
-``{% cycle %}`` tag:
-
-.. sourcecode:: html+jinja
-
- <ul id="messages">
- {% for message in messages %}
- <li class="{% cycle 'row1', 'row2' %}">{{ message|e }}</li>
- {% endfor %}
- </ul>
-
-Each time Jinja encounters a `cycle` tag it will cycle through the list
-of given items and return the next one. If you pass it one item jinja assumes
-that this item is a sequence from the context and uses this:
-
-.. sourcecode:: html+jinja
-
- <li style="color: {% cycle rowcolors %}">...</li>
-
-Conditions
-==========
-
-Jinja supports Python-like `if` / `elif` / `else` constructs:
-
-.. sourcecode:: jinja
-
- {% if user.active %}
- user {{ user.name|e }} is active.
- {% elif user.deleted %}
- user {{ user.name|e }} was deleted some time ago.
- {% else %}
- i don't know what's wrong with {{ user.username|e }}
- {% endif %}
-
-If the user is active the first block is rendered. If not and the user was
-deleted the second one, in all other cases the third one.
-
-You can also use comparison operators:
-
-.. sourcecode:: html+jinja
-
- {% if amount < 0 %}
- <span style="color: red">{{ amount }}</span>
- {% else %}
- <span style="color: black">{{ amount }}</span>
- {% endif %}
-
-.. admonition:: Note
-
- Of course you can use `or` / `and` and parentheses to create more complex
- conditions, but usually the logic is already handled in the application and
- you don't have to create such complex constructs in the template code. However
- in some situations it might be a good thing to have the abilities to create
- them.
-
-Operators
-=========
-
-Inside ``{{ variable }}`` blocks, `if` conditions and many other parts you can
-can use expressions. In expressions you can use any of the following operators:
-
- ======= ===================================================================
- ``+`` add the right operand to the left one.
- ``{{ 1 + 2 }}`` would return ``3``.
- ``-`` subtract the right operand from the left one.
- ``{{ 1 - 1 }}`` would return ``0``.
- ``/`` divide the left operand by the right one.
- ``{{ 1 / 2 }}`` would return ``0.5``.
- ``*`` multiply the left operand with the right one.
- ``{{ 2 * 2 }}`` would return ``4``.
- ``**`` raise the left operand to the power of the right
- operand. ``{{ 2**3 }}`` would return ``8``.
- ``in`` perform sequence membership test. ``{{ 1 in [1,2,3] }}`` would
- return true.
- ``is`` perform a test on the value. See the section about
- tests for more information.
- ``|`` apply a filter on the value. See the section about
- filters for more information.
- ``and`` return true if the left and the right operand is true.
- ``or`` return true if the left or the right operand is true.
- ``not`` negate a statement (see below)
- ``()`` call a callable: ``{{ user.get_username() }}``. Inside of the
- parentheses you can use variables: ``{{ user.get(username) }}``.
- ======= ===================================================================
-
-Note that there is no support for any bit operations or something similar.
-
-* special note regarding `not`: The `is` and `in` operators support negation
- using an infix notation too: ``foo is not bar`` and ``foo not in bar``
- instead of ``not foo is bar`` and ``not foo in bar``. All other expressions
- require a prefix notation: ``not (foo and bar)``.
-
-Boolean Values
-==============
-
-In If-Conditions Jinja performs a boolean check. All empty values (eg: empty
-lists ``[]``, empty dicts ``{}`` etc) evaluate to `false`. Numbers that are
-equal to `0`/`0.00` are considered `false` too. The boolean value of other
-objects depends on the behavior the application developer gave it. Usually
-items are `true`.
-
-Here some examples that should explain it:
-
-.. sourcecode:: jinja
-
- {% if [] %}
- will always be false because it's an empty list
-
- {% if {} %}
- false too.
-
- {% if ['foo'] %}
- this is true. Because the list is not empty.
-
- {% if "foobar" %}
- this is also true because the string is not empty.
-
-Slicing
-=======
-
-Some objects support slicing operations. For example lists:
-
-.. sourcecode:: jinja
-
- {% for item in items[:5] %}
- This will only iterate over the first 5 items of the list
-
- {% for item in items[5:10] %}
- This will only iterate from item 5 to 10.
-
- {% for item in items[:10:2] %}
- This will only yield items from start to ten and only returing
- even items.
-
-For more informations about slicing have a look at the `slicing chapter`_
-in the "Dive into Python" e-book.
-
-Macros
-======
-
-If you want to use a partial template in more than one place, you might want to
-create a macro from it:
-
-.. sourcecode:: html+jinja
-
- {% macro show_user user %}
- <h1>{{ user.name|e }}</h1>
- <div class="test">
- {{ user.description }}
- </div>
- {% endmacro %}
-
-Now you can use it from everywhere in the code by passing it an item:
-
-.. sourcecode:: jinja
-
- {% for user in users %}
- {{ show_user(user) }}
- {% endfor %}
-
-You can also specify more than one value:
-
-.. sourcecode:: html+jinja
-
- {% macro show_dialog title, text %}
- <div class="dialog">
- <h1>{{ title|e }}</h1>
- <div class="test">{{ text|e }}</div>
- </div>
- {% endmacro %}
-
- {{ show_dialog('Warning', 'something went wrong i guess') }}
-
-Inheritance
-===========
-
-The most powerful part of Jinja is template inheritance. Template inheritance
-allows you to build a base "skeleton" template that contains all the common
-elements of your site and defines **blocks** that child templates can override.
-
-Sounds complicated but is very basic. It's easiest to understand it by starting
-with an example.
-
-Base Template
--------------
-
-This template, which we'll call ``base.html``, defines a simple HTML skeleton
-document that you might use for a simple two-column page. It's the job of
-"child" templates to fill the empty blocks with content:
-
-.. sourcecode:: html+jinja
-
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <link rel="stylesheet" href="style.css" />
- <title>{% block title %}{% endblock %} - My Webpage</title>
- {% block html_head %}{% endblock %}
- </head>
- <body>
- <div id="content">
- {% block content %}{% endblock %}
- </div>
-
- <div id="footer">
- {% block footer %}
- &copy; Copyright 2006 by <a href="http://mydomain.tld">myself</a>.
- {% endblock %}
- </div>
- </body>
-
-In this example, the ``{% block %}`` tags define four blocks that child templates
-can fill in. All the `block` tag does is to tell the template engine that a
-child template may override those portions of the template.
-
-Child Template
---------------
-
-A child template might look like this:
-
-.. sourcecode:: html+jinja
-
- {% extends "base.html" %}
- {% block title %}Index{% endblock %}
-
- {% block html_head %}
- <style type="text/css">
- .important {
- color: #336699;
- }
- </style>
- {% endblock %}
-
- {% block content %}
- <h1>Index</h1>
- <p class="important">
- Welcome on my awsome homepage.
- </p>
- {% endblock %}
-
-The ``{% extends %}`` tag is the key here. It tells the template engine that
-this template "extends" another template. When the template system evaluates
-this template, first it locates the parent.
-
-The filename of the template depends on the template loader. For example the
-``FileSystemLoader`` allows you to access other templates by giving the
-filename. You can access templates in subdirectories with an slash:
-
-.. sourcecode:: jinja
-
- {% extends "layout/default.html" %}
-
-But this behavior can depend on the application using Jinja.
-
-Note that since the child template didn't define the ``footer`` block, the
-value from the parent template is used instead.
-
-.. admonition:: Note
-
- You can't define multiple ``{% block %}`` tags with the same name in the
- same template. This limitation exists because a block tag works in "both"
- directions. That is, a block tag doesn't just provide a hole to fill - it
- also defines the content that fills the hole in the *parent*. If there were
- two similarly-named ``{% block %}`` tags in a template, that template's
- parent wouldn't know which one of the blocks' content to use.
-
-Template Inclusion
-==================
-
-You can load another template at a given position using ``{% include %}``.
-Usually it's a better idea to use inheritance but if you for example want to
-load macros, `include` works better than `extends`:
-
-.. sourcecode:: jinja
-
- {% include "myhelpers.html" %}
- {{ my_helper("foo") }}
-
-If you define a macro called ``my_helper`` in ``myhelpers.html``, you can now
-use it from the template as shown above.
-
-Filtering Blocks
-================
-
-Sometimes it could be a good idea to filter a complete block of text. For
-example, if you want to escape some html code:
-
-.. sourcecode:: jinja
-
- {% filter escape %}
- <html>
- <code>goes here</code>
- </html>
- {% endfilter %}
-
-Of course you can chain filters too:
-
-.. sourcecode:: jinja
-
- {% filter lower|escape %}
- <B>SOME TEXT</B>
- {% endfilter %}
-
-returns ``"&lt;b&gt;some text&lt;/b&gt;"``.
-
-Defining Variables
-==================
-
-You can also define variables in the namespace using the ``{% set %}`` tag:
-
-.. sourcecode:: jinja
-
- {% set foo = 'foobar' %}
- {{ foo }}
-
-This should ouput ``foobar``.
-
-Scopes
-======
-
-Jinja has multiple scopes. A scope is something like a new transparent foil on
-a stack of foils. You can only write to the outermost foil but read all of them
-since you can look through them. If you remove the top foil all data on that
-foil disappears. Some tags in Jinja add a new layer to the stack. Currently
-these are `block`, `for`, `macro` and `filter`. This means that variables and
-other elements defined inside a macro, loop or some of the other tags listed
-above will be only available in that block. Here an example:
-
-.. sourcecode:: jinja
-
- {% macro angryhello name %}
- {% set angryname = name|upper %}
- Hello {{ name }}. Hello {{ name }}!
- HELLO {{ angryname }}!!!!!!111
- {% endmacro %}
-
-The variable ``angryname`` just exists inside the macro, not outside it.
-
-Defined macros appear on the context as variables. Because of this, they are
-affected by the scoping too. A macro defined inside of a macro is just available
-in those two macros (the macro itself and the macro it's defined in). For `set`
-and `macro` two additional rules exist: If a macro is defined in an extended
-template but outside of a visible block (thus outside of any block) will be
-available in all blocks below. This allows you to use `include` statements to
-load often used macros at once.
-
-Undefined Variables
-===================
-
-If you have already worked with python you probably know about the fact that
-undefined variables raise an exception. This is different in Jinja. There is a
-special value called `undefined` that represents values that do not exist.
-
-This special variable works complete different from any variables you maybe
-know. If you print it using ``{{ variable }}`` it will not appear because it's
-literally empty. If you try to iterate over it, it will work. But no items
-are returned. Comparing this value to any other value results in `false`.
-Even if you compare it to itself:
-
-.. sourcecode:: jinja
-
- {{ undefined == undefined }}
- will return false. Not even undefined is undefined :)
- Use `is defined` / `is not defined`:
-
- {{ undefined is not defined }}
- will return true.
-
-There are also some additional rules regarding this special value. Any
-mathematical operators (``+``, ``-``, ``*``, ``/``) return the operand
-as result:
-
-.. sourcecode:: jinja
-
- {{ undefined + "foo" }}
- returns "foo"
-
- {{ undefined - 42 }}
- returns 42. Note: not -42!
-
-In any expression `undefined` evaluates to `false`. It has no length, all
-attribute calls return undefined, calling too:
-
-.. sourcecode:: jinja
-
- {{ undefined.attribute().attribute_too[42] }}
- still returns `undefined`.
-
-Escaping
-========
-
-Sometimes you might want to add Jinja syntax elements into the template
-without executing them. In that case you have quite a few possibilities.
-
-For small parts this might be a good way:
-
-.. sourcecode:: jinja
-
- {{ "{{ foo }} is variable syntax and {% foo %} is block syntax" }}
-
-When you have multiple elements you can use the ``raw`` block:
-
-.. sourcecode:: jinja
-
- {% raw %}
- Filtering blocks works like this in Jinja:
- {% filter escape %}
- <html>
- <code>goes here</code>
- </html>
- {% endfilter %}
- {% endraw %}
-
-Reserved Keywords
-=================
-
-Jinja has some keywords you cannot use a variable names. This limitation
-exists to make look coherent. Syntax highlighters won't mess things up and
-you will don't have unexpected output.
-
-The following keywords exist and cannot be used as identifiers:
-
- `and`, `block`, `cycle`, `elif`, `else`, `endblock`, `endfilter`,
- `endfor`, `endif`, `endmacro`, `endraw`, `endtrans`, `extends`, `filter`,
- `for`, `if`, `in`, `include`, `is`, `macro`, `not`, `or`, `pluralize`,
- `raw`, `recursive`, `set`, `trans`
-
-If you want to use such a name you have to prefix or suffix it or use
-alternative names:
-
-.. sourcecode:: jinja
-
- {% for macro_ in macros %}
- {{ macro_('foo') }}
- {% endfor %}
-
-If future Jinja releases add new keywords those will be "light" keywords which
-means that they won't raise an error for several releases but yield warnings
-on the application side. But it's very unlikely that new keywords will be
-added.
-
-Internationalization
-====================
-
-If the application is configured for i18n, you can define translatable blocks
-for translators using the `trans` tag or the special underscore function:
-
-.. sourcecode:: jinja
-
- {% trans %}
- this is a translatable block
- {% endtrans %}
-
- {% trans "This is a translatable string" %}
-
- {{ _("This is a translatable string") }}
-
-The latter one is useful if you want translatable arguments for filters etc.
-
-If you want to have plural forms too, use the `pluralize` block:
-
-.. sourcecode:: jinja
-
- {% trans users=users %}
- One user found.
- {% pluralize %}
- {{ users }} users found.
- {% endtrans %}
-
- {% trans first=(users|first).username|escape, user=users|length %}
- one user {{ first }} found.
- {% pluralize users %}
- {{ users }} users found, the first one is called {{ first }}.
- {% endtrans %}
-
-If you have multiple arguments, the first one is assumed to be the indicator (the
-number that is used to determine the correct singular or plural form. If you
-don't have the indicator variable on position 1 you have to tell the `pluralize`
-tag the correct variable name.
-
-Inside translatable blocks you cannot use blocks or expressions (however you can
-still use the ``raw`` block which will work as expected). The variable
-print syntax (``{{ variablename }}``) is the only way to insert the variables
-defined in the ``trans`` header. Filters must be applied in the header.
-
-.. admonition:: note
-
- Please make sure that you always use pluralize blocks where required.
- Many languages have more complex plural forms than the English language.
-
- Never try to workaround that issue by using something like this:
-
- .. sourcecode:: jinja
-
- {% if count != 1 %}
- {{ count }} users found.
- {% else %}
- one user found.
- {% endif %}
-
-.. _slicing chapter: http://diveintopython.org/native_data_types/lists.html#odbchelper.list.slice
-.. _range function: http://docs.python.org/tut/node6.html#SECTION006300000000000000000
diff --git a/tests/examplefiles/json.lasso b/tests/examplefiles/json.lasso
deleted file mode 100644
index 72926112..00000000
--- a/tests/examplefiles/json.lasso
+++ /dev/null
@@ -1,301 +0,0 @@
-<?LassoScript
-
- //
- // JSON Encoding and Decoding
- //
- // Copyright 2007-2012 LassoSoft Inc.
- //
- // <http://json.org/>
- // <http://json-rpc.org/>
- // <http://www.ietf.org/rfc/rfc4627.txt?number=4627>
- //
-
-If: (Lasso_TagExists: 'Encode_JSON') == False;
-
- Define_Tag: 'JSON', -Namespace='Encode_', -Required='value', -Optional='options';
-
- Local: 'escapes' = Map('\\' = '\\', '"' = '"', '\r' = 'r', '\n' = 'n', '\t' = 't', '\f' = 'f', '\b' = 'b');
- Local: 'output' = '';
- Local: 'newoptions' = (Array: -Internal);
- If: !(Local_Defined: 'options') || (#options->(IsA: 'array') == False);
- Local: 'options' = (Array);
- /If;
- If: (#options >> -UseNative) || (Params >> -UseNative);
- #newoptions->(Insert: -UseNative);
- /If;
- If: (#options >> -NoNative) || (Params >> -NoNative);
- #newoptions->(Insert: -NoNative);
- /If;
- If: (#options !>> -UseNative) && ((#value->(IsA: 'set')) || (#value->(IsA: 'list')) || (#value->(IsA: 'queue')) || (#value->(IsA: 'priorityqueue')) || (#value->(IsA: 'stack')));
- #output += (Encode_JSON: Array->(insertfrom: #value->iterator) &, -Options=#newoptions);
- Else: (#options !>> -UseNative) && (#value->(IsA: 'pair'));
- #output += (Encode_JSON: (Array: #value->First, #value->Second));
- Else: (#options !>> -Internal) && (#value->(Isa: 'array') == False) && (#value->(IsA: 'map') == False);
- #output += '[' + (Encode_JSON: #value, -Options=#newoptions) + ']';
- Else: (#value->(IsA: 'literal'));
- #output += #value;
- Else: (#value->(IsA: 'string'));
- #output += '"';
- Loop: (#value->Length);
- Local('character' = #value->(Get: Loop_Count));
- #output->(Append:
- (Match_RegExp('[\\x{0020}-\\x{21}\\x{23}-\\x{5b}\\x{5d}-\\x{10fff}]') == #character) ? #character |
- '\\' + (#escapes->(Contains: #character) ? #escapes->(Find: #character) | 'u' + String(Encode_Hex(#character))->PadLeading(4, '0')&)
- );
- /Loop;
- #output += '"';
- Else: (#value->(IsA: 'integer')) || (#value->(IsA: 'decimal')) || (#value->(IsA: 'boolean'));
- #output += (String: #value);
- Else: (#value->(IsA: 'null'));
- #output += 'null';
- Else: (#value->(IsA: 'date'));
- If: #value->gmt;
- #output += '"' + #value->(format: '%QT%TZ') + '"';
- Else;
- #output += '"' + #value->(format: '%QT%T') + '"';
- /If;
- Else: (#value->(IsA: 'array'));
- #output += '[';
- Iterate: #value, (Local: 'temp');
- #output += (Encode_JSON: #temp, -Options=#newoptions);
- If: #value->Size != Loop_Count;
- #output += ', ';
- /If;
- /Iterate;
- #output += ']';
- Else: (#value->(IsA: 'object'));
- #output += '{';
- Iterate: #value, (Local: 'temp');
- #output += #temp->First + ': ' + (Encode_JSON: #temp->Second, -Options=#newoptions);
- If: (#value->Size != Loop_Count);
- #output += ', ';
- /If;
- /Iterate;
- #output += '}';
- Else: (#value->(IsA: 'map'));
- #output += '{';
- Iterate: #value, (Local: 'temp');
- #output += (Encode_JSON: #temp->First, -Options=#newoptions) + ': ' + (Encode_JSON: #temp->Second, -Options=#newoptions);
- If: (#value->Size != Loop_Count);
- #output += ', ';
- /If;
- /Iterate;
- #output += '}';
- Else: (#value->(IsA: 'client_ip')) || (#value->(IsA: 'client_address'));
- #output += (Encode_JSON: (String: #value), -Options=#newoptions);
- Else: (#options !>> -UseNative) && (#value->(IsA: 'set')) || (#value->(IsA: 'list')) || (#value->(IsA: 'queue')) || (#value->(IsA: 'priorityqueue')) || (#value->(IsA: 'stack'));
- #output += (Encode_JSON: Array->(insertfrom: #value->iterator) &, -Options=#newoptions);
- Else: (#options !>> -NoNative);
- #output += (Encode_JSON: (Map: '__jsonclass__'=(Array:'deserialize',(Array:'<LassoNativeType>' + #value->Serialize + '</LassoNativeType>'))));
- /If;
- Return: @#output;
-
- /Define_Tag;
-
-/If;
-
-If: (Lasso_TagExists: 'Decode_JSON') == False;
-
- Define_Tag: 'JSON', -Namespace='Decode_', -Required='value';
-
- (#value == '') ? Return: Null;
-
- Define_Tag: 'consume_string', -Required='ibytes';
- Local: 'unescapes' = (map: 34 = '"', 92 = '\\', 98 = '\b', 102 = '\f', 110 = '\n', 114 = '\r', 116 = '\t');
- Local: 'temp' = 0, 'obytes' = Bytes;
- While: ((#temp := #ibytes->export8bits) != 34); // '"'
- If: (#temp === 92); // '\'
- #temp = #ibytes->export8bits;
- If: (#temp === 117); // 'u'
- #obytes->(ImportString: (Decode_Hex: (String: #ibytes->(GetRange: #ibytes->Position + 1, 4)))->(ExportString: 'UTF-16'), 'UTF-8');
- #ibytes->(SetPosition: #ibytes->Position + 4);
- Else;
- If: (#unescapes->(Contains: #temp));
- #obytes->(ImportString: #unescapes->(Find: #temp), 'UTF-8');
- Else;
- #obytes->(Import8Bits: #temp);
- /If;
- /If;
- Else;
- #obytes->(Import8Bits: #temp);
- /If;
- /While;
- Local('output' = #obytes->(ExportString: 'UTF-8'));
- If: #output->(BeginsWith: '<LassoNativeType>') && #output->(EndsWith: '</LassoNativeType>');
- Local: 'temp' = #output - '<LassoNativeType>' - '</LassoNativeType>';
- Local: 'output' = null;
- Protect;
- #output->(Deserialize: #temp);
- /Protect;
- Else: (Valid_Date: #output, -Format='%QT%TZ');
- Local: 'output' = (Date: #output, -Format='%QT%TZ');
- Else: (Valid_Date: #output, -Format='%QT%T');
- Local: 'output' = (Date: #output, -Format='%QT%T');
- /If;
- Return: @#output;
- /Define_Tag;
-
- Define_Tag: 'consume_token', -Required='ibytes', -required='temp';
- Local: 'obytes' = bytes->(import8bits: #temp) &;
- local: 'delimit' = (array: 9, 10, 13, 32, 44, 58, 93, 125); // \t\r\n ,:]}
- While: (#delimit !>> (#temp := #ibytes->export8bits));
- #obytes->(import8bits: #temp);
- /While;
- Local: 'output' = (String: #obytes);
- If: (#output == 'true') || (#output == 'false');
- Return: (Boolean: #output);
- Else: (#output == 'null');
- Return: Null;
- Else: (String_IsNumeric: #output);
- Return: (#output >> '.') ? (Decimal: #output) | (Integer: #output);
- /If;
- Return: @#output;
- /Define_Tag;
-
- Define_Tag: 'consume_array', -Required='ibytes';
- Local: 'output' = array;
- local: 'delimit' = (array: 9, 10, 13, 32, 44); // \t\r\n ,
- local: 'temp' = 0;
- While: ((#temp := #ibytes->export8bits) != 93); // ]
- If: (#delimit >> #temp);
- // Discard whitespace
- Else: (#temp == 34); // "
- #output->(insert: (consume_string: @#ibytes));
- Else: (#temp == 91); // [
- #output->(insert: (consume_array: @#ibytes));
- Else: (#temp == 123); // {
- #output->(insert: (consume_object: @#ibytes));
- Else;
- #output->(insert: (consume_token: @#ibytes, @#temp));
- (#temp == 93) ? Loop_Abort;
- /If;
- /While;
- Return: @#output;
- /Define_Tag;
-
- Define_Tag: 'consume_object', -Required='ibytes';
- Local: 'output' = map;
- local: 'delimit' = (array: 9, 10, 13, 32, 44); // \t\r\n ,
- local: 'temp' = 0;
- local: 'key' = null;
- local: 'val' = null;
- While: ((#temp := #ibytes->export8bits) != 125); // }
- If: (#delimit >> #temp);
- // Discard whitespace
- Else: (#key !== null) && (#temp == 34); // "
- #output->(insert: #key = (consume_string: @#ibytes));
- #key = null;
- Else: (#key !== null) && (#temp == 91); // [
- #output->(insert: #key = (consume_array: @#ibytes));
- #key = null;
- Else: (#key !== null) && (#temp == 123); // {
- #output->(insert: #key = (consume_object: @#ibytes));
- #key = null;
- Else: (#key !== null);
- #output->(insert: #key = (consume_token: @#ibytes, @#temp));
- (#temp == 125) ? Loop_abort;
- #key = null;
- Else;
- #key = (consume_string: @#ibytes);
- while(#delimit >> (#temp := #ibytes->export8bits));
- /while;
- #temp != 58 ? Loop_Abort;
- /If;
- /While;
- If: (#output >> '__jsonclass__') && (#output->(Find: '__jsonclass__')->(isa: 'array')) && (#output->(Find: '__jsonclass__')->size >= 2) && (#output->(Find: '__jsonclass__')->First == 'deserialize');
- Return: #output->(find: '__jsonclass__')->Second->First;
- Else: (#output >> 'native') && (#output >> 'comment') && (#output->(find: 'comment') == 'http://www.lassosoft.com/json');
- Return: #output->(find: 'native');
- /If;
- Return: @#output;
- /Define_Tag;
-
- Local: 'ibytes' = (bytes: #value);
- Local: 'start' = 1;
- #ibytes->removeLeading(BOM_UTF8);
- Local: 'temp' = #ibytes->export8bits;
- If: (#temp == 91); // [
- Local: 'output' = (consume_array: @#ibytes);
- Return: @#output;
- Else: (#temp == 123); // {
- Local: 'output' = (consume_object: @#ibytes);
- Return: @#output;
- /If;
-
- /Define_Tag;
-
-/If;
-
-If: (Lasso_TagExists: 'Literal') == False;
-
- Define_Type: 'Literal', 'String';
- /Define_Type;
-
-/If;
-
-If: (Lasso_TagExists: 'Object') == False;
-
- Define_Type: 'Object', 'Map';
- /Define_Type;
-
-/If;
-
-If: (Lasso_TagExists: 'JSON_RPCCall') == False;
-
- Define_Tag: 'RPCCall', -Namespace='JSON_',
- -Required='method',
- -Optional='params',
- -Optional='id',
- -Optional='host';
-
- !(Local_Defined: 'host') ? Local: 'host' = 'http://localhost/lassoapps.8/rpc/rpc.lasso';
- !(Local_Defined: 'id') ? Local: 'id' = Lasso_UniqueID;
- Local: 'request' = (Map: 'method' = #method, 'params' = #params, 'id' = #id);
- Local: 'request' = (Encode_JSON: #request);
- Local: 'result' = (Include_URL: #host, -PostParams=#request);
- Local: 'result' = (Decode_JSON: #result);
- Return: @#result;
-
- /Define_Tag;
-
-/If;
-
-If: (Lasso_TagExists: 'JSON_Records') == False;
-
- Define_Tag: 'JSON_Records',
- -Optional='KeyField',
- -Optional='ReturnField',
- -Optional='ExcludeField',
- -Optional='Fields';
-
- Local: '_fields' = (Local_Defined: 'fields') && #fields->(IsA: 'array') ? #fields | Field_Names;
- Fail_If: #_fields->size == 0, -1, 'No fields found for [JSON_Records]';
- Local: '_keyfield' = (Local: 'keyfield');
- If: #_fields !>> #_keyfield;
- Local: '_keyfield' = (KeyField_Name);
- If: #_fields !>> #_keyfield;
- Local: '_keyfield' = 'ID';
- If: #_fields !>> #_keyfield;
- Local: '_keyfield' = #_fields->First;
- /If;
- /If;
- /If;
- Local: '_index' = #_fields->(FindPosition: #_keyfield)->First;
- Local: '_return' = (Local_Defined: 'returnfield') ? (Params->(Find: -ReturnField)->(ForEach: {Params->First = Params->First->Second; Return: True}) &) | @#_fields;
- Local: '_exclude' = (Local_Defined: 'excludefield') ? (Params->(Find: -ExcludeField)->(ForEach: {Params->First = Params->First->Second; Return: True}) &) | Array;
- Local: '_records' = Array;
- Iterate: Records_Array, (Local: '_record');
- Local: '_temp' = Map;
- Iterate: #_fields, (Local: '_field');
- ((#_return >> #_field) && (#_exclude !>> #_field)) ? #_temp->Insert(#_field = #_record->(Get: Loop_Count));
- /Iterate;
- #_records->Insert(#_temp);
- /Iterate;
- Local: '_output' = (Encode_JSON: (Object: 'error_msg'=Error_Msg, 'error_code'=Error_Code, 'found_count'=Found_Count, 'keyfield'=#_keyfield, 'rows'=#_records));
- Return: @#_output;
-
- /Define_Tag;
-
-/If;
-
-?>
diff --git a/tests/examplefiles/json.lasso9 b/tests/examplefiles/json.lasso9
deleted file mode 100644
index 732ab2af..00000000
--- a/tests/examplefiles/json.lasso9
+++ /dev/null
@@ -1,213 +0,0 @@
-
-/**
- trait_json_serialize
- Objects with this trait will be assumed to convert to json data
- when its ->asString method is called
-*/
-define trait_json_serialize => trait {
- require asString()
-}
-
-define json_serialize(e::bytes)::string => ('"' + (string(#e)->Replace(`\`, `\\`) & Replace('\"', '\\"') & Replace('\r', '\\r') & Replace('\n', '\\n') & Replace('\t', '\\t') & Replace('\f', '\\f') & Replace('\b', '\\b') &) + '"')
-define json_serialize(e::string)::string => ('"' + (string(#e)->Replace(`\`, `\\`) & Replace('\"', '\\"') & Replace('\r', '\\r') & Replace('\n', '\\n') & Replace('\t', '\\t') & Replace('\f', '\\f') & Replace('\b', '\\b') &) + '"')
-define json_serialize(e::json_literal)::string => (#e->asstring)
-define json_serialize(e::integer)::string => (#e->asstring)
-define json_serialize(e::decimal)::string => (#e->asstring)
-define json_serialize(e::boolean)::string => (#e->asstring)
-define json_serialize(e::null)::string => ('null')
-define json_serialize(e::date)::string => ('"' + #e->format(#e->gmt ? '%QT%TZ' | '%Q%T') + '"')
-/*
-define json_serialize(e::array)::string => {
- local(output) = '';
- local(delimit) = '';
- #e->foreach => { #output += #delimit + json_serialize(#1); #delimit = ', '; }
- return('[' + #output + ']');
-}
-define json_serialize(e::staticarray)::string => {
- local(output) = '';
- local(delimit) = '';
- #e->foreach => { #output += #delimit + json_serialize(#1); #delimit = ', '; }
- return('[' + #output + ']');
-}
-*/
-define json_serialize(e::trait_forEach)::string => {
- local(output) = '';
- local(delimit) = '';
- #e->foreach => { #output += #delimit + json_serialize(#1); #delimit = ', '; }
- return('[' + #output + ']');
-}
-define json_serialize(e::map)::string => {
- local(output = with pr in #e->eachPair
- select json_serialize(#pr->first->asString) + ': ' + json_serialize(#pr->second))
- return '{' + #output->join(',') + '}'
-}
-define json_serialize(e::json_object)::string => {
- local(output) = '';
- local(delimit) = '';
- #e->foreachpair => { #output += #delimit + #1->first + ': ' + json_serialize(#1->second); #delimit = ', '; }
- return('{' + #output + '}');
-}
-define json_serialize(e::trait_json_serialize) => #e->asString
-define json_serialize(e::any)::string => json_serialize('<LassoNativeType>' + #e->serialize + '</LassoNativeType>')
-
-// Bil Corry fixes for decoding json
-define json_consume_string(ibytes::bytes) => {
- local(obytes) = bytes;
- local(temp) = 0;
- while((#temp := #ibytes->export8bits) != 34);
- #obytes->import8bits(#temp);
- (#temp == 92) ? #obytes->import8bits(#ibytes->export8bits); // Escape \
- /while;
- local(output = string(#obytes)->unescape)
- //Replace('\\"', '\"') & Replace('\\r', '\r') & Replace('\\n', '\n') & Replace('\\t', '\t') & Replace('\\f', '\f') & Replace('\\b', '\b') &;
- if(#output->BeginsWith('<LassoNativeType>') && #output->EndsWith('</LassoNativeType>'));
- Protect;
- return serialization_reader(xml(#output - '<LassoNativeType>' - '</LassoNativeType>'))->read
- /Protect;
- else( (#output->size == 16 or #output->size == 15) and regexp(`\d{8}T\d{6}Z?`, '', #output)->matches)
- return date(#output, -Format=#output->size == 16?`yyyyMMdd'T'HHmmssZ`|`yyyyMMdd'T'HHmmss`)
- /if
- return #output
-}
-
-// Bil Corry fix + Ke fix
-define json_consume_token(ibytes::bytes, temp::integer) => {
-
- local(obytes = bytes->import8bits(#temp) &,
- delimit = array(9, 10, 13, 32, 44, 58, 93, 125)) // \t\r\n ,:]}
-
- while(#delimit !>> (#temp := #ibytes->export8bits))
- #obytes->import8bits(#temp)
- /while
-
- #temp == 125? // }
- #ibytes->marker -= 1
-//============================================================================
-// Is also end of token if end of array[]
- #temp == 93? // ]
- #ibytes->marker -= 1
-//............................................................................
-
- local(output = string(#obytes))
- #output == 'true'?
- return true
- #output == 'false'?
- return false
- #output == 'null'?
- return null
- string_IsNumeric(#output)?
- return (#output >> '.')? decimal(#output) | integer(#output)
-
- return #output
-}
-
-// Bil Corry fix
-define json_consume_array(ibytes::bytes)::array => {
- Local(output) = array;
- local(delimit) = array( 9, 10, 13, 32, 44); // \t\r\n ,
- local(temp) = 0;
- While((#temp := #ibytes->export8bits) != 93); // ]
- If(#delimit >> #temp);
- // Discard whitespace
- Else(#temp == 34); // "
- #output->insert(json_consume_string(#ibytes));
- Else(#temp == 91); // [
- #output->insert(json_consume_array(#ibytes));
- Else(#temp == 123); // {
- #output->insert(json_consume_object(#ibytes));
- Else;
- #output->insert(json_consume_token(#ibytes, #temp));
- (#temp == 93) ? Loop_Abort;
- /If;
- /While;
- Return(#output);
-}
-
-// Bil Corry fix
-define json_consume_object(ibytes::bytes)::map => {
- Local('output' = map,
- 'delimit' = array( 9, 10, 13, 32, 44), // \t\r\n ,
- 'temp' = 0,
- 'key' = null,
- 'val' = null);
- While((#temp := #ibytes->export8bits) != 125); // }
- If(#delimit >> #temp);
- // Discard whitespace
- Else((#key !== null) && (#temp == 34)); // "
- #output->insert(#key = json_consume_string(#ibytes));
- #key = null;
- Else((#key !== null) && (#temp == 91)); // [
- #output->insert(#key = json_consume_array(#ibytes));
- #key = null;
- Else((#key !== null) && (#temp == 123)); // {
- #output->insert(#key = json_consume_object(#ibytes));
- #key = null;
- Else((#key !== null));
- #output->insert(#key = json_consume_token(#ibytes, #temp));
- #key = null;
- Else;
- #key = json_consume_string(#ibytes);
- while(#delimit >> (#temp := #ibytes->export8bits));
- /while;
- #temp != 58 ? Loop_Abort;
- /If;
- /While;
-
- If((#output >> '__jsonclass__') && (#output->Find('__jsonclass__')->isa('array')) && (#output->Find('__jsonclass__')->size >= 2) && (#output->Find('__jsonclass__')->First == 'deserialize'));
- Return(#output->find('__jsonclass__')->Second->First);
- Else((#output >> 'native') && (#output >> 'comment') && (#output->find('comment') == 'http://www.lassosoft.com/json'));
- Return(#output->find('native'));
- /If;
- Return(#output);
-}
-
-// Bil Corry fix + Ke fix
-define json_deserialize(ibytes::bytes)::any => {
- #ibytes->removeLeading(bom_utf8);
-
-//============================================================================
-// Reset marker on provided bytes
- #ibytes->marker = 0
-//............................................................................
-
- Local(temp) = #ibytes->export8bits;
- If(#temp == 91); // [
- Return(json_consume_array(#ibytes));
- Else(#temp == 123); // {
- Return(json_consume_object(#ibytes));
- else(#temp == 34) // "
- return json_consume_string(#ibytes)
- /If;
-}
-
-define json_deserialize(s::string) => json_deserialize(bytes(#s))
-
-/**! json_literal - This is a subclass of String used for JSON encoding.
-
- A json_literal works exactly like a string, but will be inserted directly
- rather than being encoded into JSON. This allows JavaScript elements
- like functions to be inserted into JSON objects. This is most useful
- when the JSON object will be used within a JavaScript on the local page.
- [Map: 'fn'=Literal('function(){ ...})] => {'fn': function(){ ...}}
-**/
-define json_literal => type {
- parent string
-}
-
-/**! json_object - This is a subclass of Map used for JSON encoding.
-
- An object works exactly like a map, but when it is encoded into JSON all
- of the keys will be inserted literally. This makes it easy to create a
- JavaScript object without extraneous quote marks.
- Object('name'='value') => {name: "value"}
-**/
-define json_object => type {
- parent map
- public onCreate(...) => ..onCreate(:#rest or (:))
-}
-
-define json_rpccall(method::string, params=map, id='', host='') => {
- #id == '' ? #host = Lasso_UniqueID;
- #host == '' ? #host = 'http://localhost/lassoapps.8/rpc/rpc.lasso';
- Return(Decode_JSON(Include_URL(#host, -PostParams=Encode_JSON(Map('method' = #method, 'params' = #params, 'id' = #id)))));
-}
diff --git a/tests/examplefiles/language.hy b/tests/examplefiles/language.hy
deleted file mode 100644
index 9768c39c..00000000
--- a/tests/examplefiles/language.hy
+++ /dev/null
@@ -1,165 +0,0 @@
-;;;; This contains some of the core Hy functions used
-;;;; to make functional programming slightly easier.
-;;;;
-
-
-(defn _numeric-check [x]
- (if (not (numeric? x))
- (raise (TypeError (.format "{0!r} is not a number" x)))))
-
-(defn cycle [coll]
- "Yield an infinite repetition of the items in coll"
- (setv seen [])
- (for [x coll]
- (yield x)
- (.append seen x))
- (while seen
- (for [x seen]
- (yield x))))
-
-(defn dec [n]
- "Decrement n by 1"
- (_numeric-check n)
- (- n 1))
-
-(defn distinct [coll]
- "Return a generator from the original collection with duplicates
- removed"
- (let [[seen []] [citer (iter coll)]]
- (for [val citer]
- (if (not_in val seen)
- (do
- (yield val)
- (.append seen val))))))
-
-(defn drop [count coll]
- "Drop `count` elements from `coll` and yield back the rest"
- (let [[citer (iter coll)]]
- (try (for [i (range count)]
- (next citer))
- (catch [StopIteration]))
- citer))
-
-(defn even? [n]
- "Return true if n is an even number"
- (_numeric-check n)
- (= (% n 2) 0))
-
-(defn filter [pred coll]
- "Return all elements from `coll` that pass `pred`"
- (let [[citer (iter coll)]]
- (for [val citer]
- (if (pred val)
- (yield val)))))
-
-(defn inc [n]
- "Increment n by 1"
- (_numeric-check n)
- (+ n 1))
-
-(defn instance? [klass x]
- (isinstance x klass))
-
-(defn iterable? [x]
- "Return true if x is iterable"
- (try (do (iter x) true)
- (catch [Exception] false)))
-
-(defn iterate [f x]
- (setv val x)
- (while true
- (yield val)
- (setv val (f val))))
-
-(defn iterator? [x]
- "Return true if x is an iterator"
- (try (= x (iter x))
- (catch [TypeError] false)))
-
-(defn neg? [n]
- "Return true if n is < 0"
- (_numeric-check n)
- (< n 0))
-
-(defn none? [x]
- "Return true if x is None"
- (is x None))
-
-(defn numeric? [x]
- (import numbers)
- (instance? numbers.Number x))
-
-(defn nth [coll index]
- "Return nth item in collection or sequence, counting from 0"
- (if (not (neg? index))
- (if (iterable? coll)
- (try (first (list (take 1 (drop index coll))))
- (catch [IndexError] None))
- (try (get coll index)
- (catch [IndexError] None)))
- None))
-
-(defn odd? [n]
- "Return true if n is an odd number"
- (_numeric-check n)
- (= (% n 2) 1))
-
-(defn pos? [n]
- "Return true if n is > 0"
- (_numeric_check n)
- (> n 0))
-
-(defn remove [pred coll]
- "Return coll with elements removed that pass `pred`"
- (let [[citer (iter coll)]]
- (for [val citer]
- (if (not (pred val))
- (yield val)))))
-
-(defn repeat [x &optional n]
- "Yield x forever or optionally n times"
- (if (none? n)
- (setv dispatch (fn [] (while true (yield x))))
- (setv dispatch (fn [] (for [_ (range n)] (yield x)))))
- (dispatch))
-
-(defn repeatedly [func]
- "Yield result of running func repeatedly"
- (while true
- (yield (func))))
-
-(defn take [count coll]
- "Take `count` elements from `coll`, or the whole set if the total
- number of entries in `coll` is less than `count`."
- (let [[citer (iter coll)]]
- (for [_ (range count)]
- (yield (next citer)))))
-
-(defn take-nth [n coll]
- "Return every nth member of coll
- raises ValueError for (not (pos? n))"
- (if (pos? n)
- (let [[citer (iter coll)] [skip (dec n)]]
- (for [val citer]
- (yield val)
- (for [_ (range skip)]
- (next citer))))
- (raise (ValueError "n must be positive"))))
-
-(defn take-while [pred coll]
- "Take all elements while `pred` is true"
- (let [[citer (iter coll)]]
- (for [val citer]
- (if (pred val)
- (yield val)
- (break)))))
-
-(defn zero? [n]
- "Return true if n is 0"
- (_numeric_check n)
- (= n 0))
-
-(def *exports* ["cycle" "dec" "distinct" "drop" "even?" "filter" "inc"
- "instance?" "iterable?" "iterate" "iterator?" "neg?"
- "none?" "nth" "numeric?" "odd?" "pos?" "remove" "repeat"
- "repeatedly" "take" "take_nth" "take_while" "zero?"])
diff --git a/tests/examplefiles/lighttpd_config.conf b/tests/examplefiles/lighttpd_config.conf
deleted file mode 100644
index 8475f378..00000000
--- a/tests/examplefiles/lighttpd_config.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-fastcgi.server = ( ".php" => ((
- "bin-path" => "/path/to/php-cgi",
- "socket" => "/tmp/php.socket",
- "max-procs" => 2,
- "bin-environment" => (
- "PHP_FCGI_CHILDREN" => "16",
- "PHP_FCGI_MAX_REQUESTS" => "10000"
- ),
- "bin-copy-environment" => (
- "PATH", "SHELL", "USER"
- ),
- "broken-scriptfilename" => "enable"
- )))
diff --git a/tests/examplefiles/limbo.b b/tests/examplefiles/limbo.b
deleted file mode 100644
index e55a0a62..00000000
--- a/tests/examplefiles/limbo.b
+++ /dev/null
@@ -1,456 +0,0 @@
-implement Ninewin;
-include "sys.m";
- sys: Sys;
-include "draw.m";
- draw: Draw;
- Image, Display, Pointer: import draw;
-include "arg.m";
-include "keyboard.m";
-include "tk.m";
-include "wmclient.m";
- wmclient: Wmclient;
- Window: import wmclient;
-include "sh.m";
- sh: Sh;
-
-# run a p9 graphics program (default rio) under inferno wm,
-# making available to it:
-# /dev/winname - naming the current inferno window (changing on resize)
-# /dev/mouse - pointer file + resize events; write to change position
-# /dev/cursor - change appearance of cursor.
-# /dev/draw - inferno draw device
-# /dev/cons - read keyboard events, write to 9win stdout.
-
-Ninewin: module {
- init: fn(ctxt: ref Draw->Context, argv: list of string);
-};
-winname: string;
-
-init(ctxt: ref Draw->Context, argv: list of string)
-{
- size := Draw->Point(500, 500);
- sys = load Sys Sys->PATH;
- draw = load Draw Draw->PATH;
- wmclient = load Wmclient Wmclient->PATH;
- wmclient->init();
- sh = load Sh Sh->PATH;
-
- buts := Wmclient->Resize;
- if(ctxt == nil){
- ctxt = wmclient->makedrawcontext();
- buts = Wmclient->Plain;
- }
- arg := load Arg Arg->PATH;
- arg->init(argv);
- arg->setusage("9win [-s] [-x width] [-y height]");
- exportonly := 0;
- while(((opt := arg->opt())) != 0){
- case opt {
- 's' =>
- exportonly = 1;
- 'x' =>
- size.x = int arg->earg();
- 'y' =>
- size.y = int arg->earg();
- * =>
- arg->usage();
- }
- }
- if(size.x < 1 || size.y < 1)
- arg->usage();
- argv = arg->argv();
- if(argv != nil && hd argv == "-s"){
- exportonly = 1;
- argv = tl argv;
- }
- if(argv == nil && !exportonly)
- argv = "rio" :: nil;
- if(argv != nil && exportonly){
- sys->fprint(sys->fildes(2), "9win: no command allowed with -s flag\n");
- raise "fail:usage";
- }
- title := "9win";
- if(!exportonly)
- title += " " + hd argv;
- w := wmclient->window(ctxt, title, buts);
- w.reshape(((0, 0), size));
- w.onscreen(nil);
- if(w.image == nil){
- sys->fprint(sys->fildes(2), "9win: cannot get image to draw on\n");
- raise "fail:no window";
- }
-
- sys->pctl(Sys->FORKNS|Sys->NEWPGRP, nil);
- ld := "/n/9win";
- if(sys->bind("#s", ld, Sys->MREPL) == -1 &&
- sys->bind("#s", ld = "/n/local", Sys->MREPL) == -1){
- sys->fprint(sys->fildes(2), "9win: cannot bind files: %r\n");
- raise "fail:error";
- }
- w.startinput("kbd" :: "ptr" :: nil);
- spawn ptrproc(rq := chan of Sys->Rread, ptr := chan[10] of ref Pointer, reshape := chan[1] of int);
-
-
- fwinname := sys->file2chan(ld, "winname");
- fconsctl := sys->file2chan(ld, "consctl");
- fcons := sys->file2chan(ld, "cons");
- fmouse := sys->file2chan(ld, "mouse");
- fcursor := sys->file2chan(ld, "cursor");
- if(!exportonly){
- spawn run(sync := chan of string, w.ctl, ld, argv);
- if((e := <-sync) != nil){
- sys->fprint(sys->fildes(2), "9win: %s", e);
- raise "fail:error";
- }
- }
- spawn serveproc(w, rq, fwinname, fconsctl, fcons, fmouse, fcursor);
- if(!exportonly){
- # handle events synchronously so that we don't get a "killed" message
- # from the shell.
- handleevents(w, ptr, reshape);
- }else{
- spawn handleevents(w, ptr, reshape);
- sys->bind(ld, "/dev", Sys->MBEFORE);
- export(sys->fildes(0), w.ctl);
- }
-}
-
-handleevents(w: ref Window, ptr: chan of ref Pointer, reshape: chan of int)
-{
- for(;;)alt{
- c := <-w.ctxt.ctl or
- c = <-w.ctl =>
- e := w.wmctl(c);
- if(e != nil)
- sys->fprint(sys->fildes(2), "9win: ctl error: %s\n", e);
- if(e == nil && c != nil && c[0] == '!'){
- alt{
- reshape <-= 1 =>
- ;
- * =>
- ;
- }
- winname = nil;
- }
- p := <-w.ctxt.ptr =>
- if(w.pointer(*p) == 0){
- # XXX would block here if client isn't reading mouse... but we do want to
- # extert back-pressure, which conflicts.
- alt{
- ptr <-= p =>
- ;
- * =>
- ; # sys->fprint(sys->fildes(2), "9win: discarding mouse event\n");
- }
- }
- }
-}
-
-serveproc(w: ref Window, mouserq: chan of Sys->Rread, fwinname, fconsctl, fcons, fmouse, fcursor: ref Sys->FileIO)
-{
- winid := 0;
- krc: list of Sys->Rread;
- ks: string;
-
- for(;;)alt {
- c := <-w.ctxt.kbd =>
- ks[len ks] = inf2p9key(c);
- if(krc != nil){
- hd krc <-= (array of byte ks, nil);
- ks = nil;
- krc = tl krc;
- }
- (nil, d, nil, wc) := <-fcons.write =>
- if(wc != nil){
- sys->write(sys->fildes(1), d, len d);
- wc <-= (len d, nil);
- }
- (nil, nil, nil, rc) := <-fcons.read =>
- if(rc != nil){
- if(ks != nil){
- rc <-= (array of byte ks, nil);
- ks = nil;
- }else
- krc = rc :: krc;
- }
- (offset, nil, nil, rc) := <-fwinname.read =>
- if(rc != nil){
- if(winname == nil){
- winname = sys->sprint("noborder.9win.%d", winid++);
- if(w.image.name(winname, 1) == -1){
- sys->fprint(sys->fildes(2), "9win: namewin %q failed: %r", winname);
- rc <-= (nil, "namewin failure");
- break;
- }
- }
- d := array of byte winname;
- if(offset < len d)
- d = d[offset:];
- else
- d = nil;
- rc <-= (d, nil);
- }
- (nil, nil, nil, wc) := <-fwinname.write =>
- if(wc != nil)
- wc <-= (-1, "permission denied");
- (nil, nil, nil, rc) := <-fconsctl.read =>
- if(rc != nil)
- rc <-= (nil, "permission denied");
- (nil, d, nil, wc) := <-fconsctl.write =>
- if(wc != nil){
- if(string d != "rawon")
- wc <-= (-1, "cannot change console mode");
- else
- wc <-= (len d, nil);
- }
- (nil, nil, nil, rc) := <-fmouse.read =>
- if(rc != nil)
- mouserq <-= rc;
- (nil, d, nil, wc) := <-fmouse.write =>
- if(wc != nil){
- e := cursorset(w, string d);
- if(e == nil)
- wc <-= (len d, nil);
- else
- wc <-= (-1, e);
- }
- (nil, nil, nil, rc) := <-fcursor.read =>
- if(rc != nil)
- rc <-= (nil, "permission denied");
- (nil, d, nil, wc) := <-fcursor.write =>
- if(wc != nil){
- e := cursorswitch(w, d);
- if(e == nil)
- wc <-= (len d, nil);
- else
- wc <-= (-1, e);
- }
- }
-}
-
-ptrproc(rq: chan of Sys->Rread, ptr: chan of ref Pointer, reshape: chan of int)
-{
- rl: list of Sys->Rread;
- c := ref Pointer(0, (0, 0), 0);
- for(;;){
- ch: int;
- alt{
- p := <-ptr =>
- ch = 'm';
- c = p;
- <-reshape =>
- ch = 'r';
- rc := <-rq =>
- rl = rc :: rl;
- continue;
- }
- if(rl == nil)
- rl = <-rq :: rl;
- hd rl <-= (sys->aprint("%c%11d %11d %11d %11d ", ch, c.xy.x, c.xy.y, c.buttons, c.msec), nil);
- rl = tl rl;
- }
-}
-
-cursorset(w: ref Window, m: string): string
-{
- if(m == nil || m[0] != 'm')
- return "invalid mouse message";
- x := int m[1:];
- for(i := 1; i < len m; i++)
- if(m[i] == ' '){
- while(m[i] == ' ')
- i++;
- break;
- }
- if(i == len m)
- return "invalid mouse message";
- y := int m[i:];
- return w.wmctl(sys->sprint("ptr %d %d", x, y));
-}
-
-cursorswitch(w: ref Window, d: array of byte): string
-{
- Hex: con "0123456789abcdef";
- if(len d != 2*4+64)
- return w.wmctl("cursor");
- hot := Draw->Point(bglong(d, 0*4), bglong(d, 1*4));
- s := sys->sprint("cursor %d %d 16 32 ", hot.x, hot.y);
- for(i := 2*4; i < len d; i++){
- c := int d[i];
- s[len s] = Hex[c >> 4];
- s[len s] = Hex[c & 16rf];
- }
- return w.wmctl(s);
-}
-
-run(sync, ctl: chan of string, ld: string, argv: list of string)
-{
- Rcmeta: con "|<>&^*[]?();";
- sys->pctl(Sys->FORKNS, nil);
- if(sys->bind("#₪", "/srv", Sys->MCREATE) == -1){
- sync <-= sys->sprint("cannot bind srv device: %r");
- exit;
- }
- srvname := "/srv/9win."+string sys->pctl(0, nil); # XXX do better.
- fd := sys->create(srvname, Sys->ORDWR, 8r600);
- if(fd == nil){
- sync <-= sys->sprint("cannot create %s: %r", srvname);
- exit;
- }
- sync <-= nil;
- spawn export(fd, ctl);
- sh->run(nil, "os" ::
- "rc" :: "-c" ::
- "mount "+srvname+" /mnt/term;"+
- "rm "+srvname+";"+
- "bind -b /mnt/term"+ld+" /dev;"+
- "bind /mnt/term/dev/draw /dev/draw ||"+
- "bind -a /mnt/term/dev /dev;"+
- quotedc("cd"::"/mnt/term"+cwd()::nil, Rcmeta)+";"+
- quotedc(argv, Rcmeta)+";"::
- nil
- );
-}
-
-export(fd: ref Sys->FD, ctl: chan of string)
-{
- sys->export(fd, "/", Sys->EXPWAIT);
- ctl <-= "exit";
-}
-
-inf2p9key(c: int): int
-{
- KF: import Keyboard;
-
- P9KF: con 16rF000;
- Spec: con 16rF800;
- Khome: con P9KF|16r0D;
- Kup: con P9KF|16r0E;
- Kpgup: con P9KF|16r0F;
- Kprint: con P9KF|16r10;
- Kleft: con P9KF|16r11;
- Kright: con P9KF|16r12;
- Kdown: con Spec|16r00;
- Kview: con Spec|16r00;
- Kpgdown: con P9KF|16r13;
- Kins: con P9KF|16r14;
- Kend: con P9KF|16r18;
- Kalt: con P9KF|16r15;
- Kshift: con P9KF|16r16;
- Kctl: con P9KF|16r17;
-
- case c {
- Keyboard->LShift =>
- return Kshift;
- Keyboard->LCtrl =>
- return Kctl;
- Keyboard->LAlt =>
- return Kalt;
- Keyboard->Home =>
- return Khome;
- Keyboard->End =>
- return Kend;
- Keyboard->Up =>
- return Kup;
- Keyboard->Down =>
- return Kdown;
- Keyboard->Left =>
- return Kleft;
- Keyboard->Right =>
- return Kright;
- Keyboard->Pgup =>
- return Kpgup;
- Keyboard->Pgdown =>
- return Kpgdown;
- Keyboard->Ins =>
- return Kins;
-
- # function keys
- KF|1 or
- KF|2 or
- KF|3 or
- KF|4 or
- KF|5 or
- KF|6 or
- KF|7 or
- KF|8 or
- KF|9 or
- KF|10 or
- KF|11 or
- KF|12 =>
- return (c - KF) + P9KF;
- }
- return c;
-}
-
-cwd(): string
-{
- return sys->fd2path(sys->open(".", Sys->OREAD));
-}
-
-# from string.b, waiting for declaration to be uncommented.
-quotedc(argv: list of string, cl: string): string
-{
- s := "";
- while (argv != nil) {
- arg := hd argv;
- for (i := 0; i < len arg; i++) {
- c := arg[i];
- if (c == ' ' || c == '\t' || c == '\n' || c == '\'' || in(c, cl))
- break;
- }
- if (i < len arg || arg == nil) {
- s += "'" + arg[0:i];
- for (; i < len arg; i++) {
- if (arg[i] == '\'')
- s[len s] = '\'';
- s[len s] = arg[i];
- }
- s[len s] = '\'';
- } else
- s += arg;
- if (tl argv != nil)
- s[len s] = ' ';
- argv = tl argv;
- }
- return s;
-}
-
-in(c: int, s: string): int
-{
- n := len s;
- if(n == 0)
- return 0;
- ans := 0;
- negate := 0;
- if(s[0] == '^') {
- negate = 1;
- s = s[1:];
- n--;
- }
- for(i := 0; i < n; i++) {
- if(s[i] == '-' && i > 0 && i < n-1) {
- if(c >= s[i-1] && c <= s[i+1]) {
- ans = 1;
- break;
- }
- i++;
- }
- else
- if(c == s[i]) {
- ans = 1;
- break;
- }
- }
- if(negate)
- ans = !ans;
-
- # just to showcase labels
-skip:
- return ans;
-}
-
-bglong(d: array of byte, i: int): int
-{
- return int d[i] | (int d[i+1]<<8) | (int d[i+2]<<16) | (int d[i+3]<<24);
-}
diff --git a/tests/examplefiles/linecontinuation.py b/tests/examplefiles/linecontinuation.py
deleted file mode 100644
index 2a41c31c..00000000
--- a/tests/examplefiles/linecontinuation.py
+++ /dev/null
@@ -1,47 +0,0 @@
-apple.filter(x, y)
-apple.\
- filter(x, y)
-
-1 \
- . \
- __str__
-
-from os import path
-from \
- os \
- import \
- path
-
-import os.path as something
-
-import \
- os.path \
- as \
- something
-
-class \
- Spam:
- pass
-
-class Spam: pass
-
-class Spam(object):
- pass
-
-class \
- Spam \
- (
- object
- ) \
- :
- pass
-
-
-def \
- spam \
- ( \
- ) \
- : \
- pass
-
-
diff --git a/tests/examplefiles/livescript-demo.ls b/tests/examplefiles/livescript-demo.ls
deleted file mode 100644
index 03cbcc99..00000000
--- a/tests/examplefiles/livescript-demo.ls
+++ /dev/null
@@ -1,43 +0,0 @@
-a = -> [1 to 50]
-const b = --> [2 til 5]
-var c = ~~> 10_000_000km * 500ms - 16~ff / 32~lol
-e = (a) -> (b) ~> (c) --> (d, e) ~~> <[list of words]>
-dashes-identifiers = ->
- a - a b -- c 1-1 1- -1 a- a a -a
-underscores_i$d = ->
- /regexp1/
- //regexp2//g
- 'strings' and "strings" and \strings and \#$-"\'strings
-
-another-word-list = <[ more words ]>
-
-[2 til 10]
- |> map (* 2)
- |> filter (> 5)
- |> fold (+)
-
-obj =
- prop1: 1
- prop2: 2
-
-class Class extends Anc-est-or
- (args) ->
- <- # Comment
- <~ /* Comment */
- void undefined yes no on off
- a.void b.undefined c.off d.if f.no g.not
- avoid bundefined coff dif fno gnot
- "inter #{2 + 2} #variable"
- '''HELLO 'world' '''
-
-copy = (from, to, callback) -->
- error, data <- read file
- return callback error if error?
- error <~ write file, data
- return callback error if error?
- callback()
-
-take(n, [x, ...xs]:list) =
- | n <= 0 => []
- | empty list => []
- | otherwise => [x] +++ take n - 1, xs
diff --git a/tests/examplefiles/logos_example.xm b/tests/examplefiles/logos_example.xm
deleted file mode 100644
index 39753e23..00000000
--- a/tests/examplefiles/logos_example.xm
+++ /dev/null
@@ -1,28 +0,0 @@
-%hook ABC
-- (id)a:(B)b {
- %log;
- return %orig(nil);
-}
-%end
-
-%subclass DEF: NSObject
-- (id)init {
- [%c(RuntimeAccessibleClass) alloc];
- return nil;
-}
-%end
-
-%group OptionalHooks
-%hook ABC
-- (void)release {
- [self retain];
- %orig;
-}
-%end
-%end
-
-%ctor {
- %init;
- if(OptionalCondition)
- %init(OptionalHooks);
-}
diff --git a/tests/examplefiles/ltmain.sh b/tests/examplefiles/ltmain.sh
deleted file mode 100644
index 5b5f845f..00000000
--- a/tests/examplefiles/ltmain.sh
+++ /dev/null
@@ -1,2849 +0,0 @@
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun configure.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# 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 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
-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-basename="s,^.*/,,g"
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-# define SED for historic ltconfig's generated by Libtool 1.3
-test -z "$SED" && SED=sed
-
-# The name of this program:
-progname=`echo "$progpath" | $SED $basename`
-modename="$progname"
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION=1.5.22
-TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes.
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-# Same for EGREP, and just to be sure, do LTCC as well
-if test "X$EGREP" = X ; then
- EGREP=egrep
-fi
-if test "X$LTCC" = X ; then
- LTCC=${CC-gcc}
-fi
-
-# Check that we have a working $echo.
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell, and then maybe $echo will work.
- exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit $EXIT_SUCCESS
-fi
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- SP2NL='tr \040 \012'
- NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- SP2NL='tr \100 \n'
- NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
- save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
- save_LANG="$LANG"; LANG=C; export LANG
-fi
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- $echo "$modename: not configured to build any kind of library" 1>&2
- $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
- exit $EXIT_FAILURE
-fi
-
-# Global variables.
-mode=$default_mode
-nonopt=
-prev=
-prevopt=
-run=
-show="$echo"
-show_help=
-execute_dlfiles=
-duplicate_deps=no
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-
-if test -z "$max_cmd_len"; then
- i=0
- testring="ABCD"
- new_result=
-
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
- = "XX$testring") >/dev/null 2>&1 &&
- new_result=`expr "X$testring" : ".*" 2>&1` &&
- max_cmd_len="$new_result" &&
- test "$i" != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- testring="$testring$testring"
- done
- testring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- max_cmd_len=`expr $max_cmd_len \/ 2`
-fi
-
-#####################################
-# Shell function definitions:
-# This seems to be the best place for them
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
-
- if test "$run" = ":"; then
- # Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
- else
-
- # If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$my_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
-
- save_mktempdir_umask=`umask`
- umask 0077
- $mkdir "$my_tmpdir"
- umask $save_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || {
- $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
- exit $EXIT_FAILURE
- }
- fi
-
- $echo "X$my_tmpdir" | $Xsed
-}
-
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
-{
- win32_libid_type="unknown"
- win32_fileres=`file -L $1 2>/dev/null`
- case $win32_fileres in
- *ar\ archive\ import\ library*) # definitely import
- win32_libid_type="x86 archive import"
- ;;
- *ar\ archive*) # could be an import, or static
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
- $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
- win32_nmres=`eval $NM -f posix -A $1 | \
- $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- esac
- fi
- ;;
- *DLL*)
- win32_libid_type="x86 DLL"
- ;;
- *executable*) # but shell scripts are "executable" too...
- case $win32_fileres in
- *MS\ Windows\ PE\ Intel*)
- win32_libid_type="x86 DLL"
- ;;
- esac
- ;;
- esac
- $echo $win32_libid_type
-}
-
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
- if test -n "$available_tags" && test -z "$tagname"; then
- CC_quoted=
- for arg in $CC; do
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- CC_quoted="$CC_quoted $arg"
- done
- case $@ in
- # Blanks in the command may have been stripped by the calling shell,
- # but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
- # Blanks at the start of $base_compile will cause this to fail
- # if we don't check for them as well.
- *)
- for z in $available_tags; do
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
- CC_quoted=
- for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- CC_quoted="$CC_quoted $arg"
- done
- # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
- trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
- # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
- extendcc=${host}-${CC}
- # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
- # (Gentoo-specific hack because we always export $CHOST)
- mungedcc=${CHOST-${host}}-${trimedcc}
- case "$@ " in
- "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
- "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
- tagname=CC
- break ;;
- "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
- "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
- "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
- " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
- ;;
- esac
- fi
- done
- # If $tagname still isn't set, then no tagged configuration
- # was found and let the user know that the "--tag" command
- # line option must be used.
- if test -z "$tagname"; then
- $echo "$modename: unable to infer tagged configuration"
- $echo "$modename: specify a tag with \`--tag'" 1>&2
- exit $EXIT_FAILURE
-# else
-# $echo "$modename: using $tagname tagged configuration"
- fi
- ;;
- esac
- fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
-
- $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
- $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
- if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
- exit $EXIT_FAILURE
- fi
-}
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
- my_gentop="$1"; shift
- my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
- my_status=""
-
- $show "${rm}r $my_gentop"
- $run ${rm}r "$my_gentop"
- $show "$mkdir $my_gentop"
- $run $mkdir "$my_gentop"
- my_status=$?
- if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
- exit $my_status
- fi
-
- for my_xlib in $my_oldlibs; do
- # Extract the objects.
- case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
- *) my_xabs=`pwd`"/$my_xlib" ;;
- esac
- my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
- my_xdir="$my_gentop/$my_xlib"
-
- $show "${rm}r $my_xdir"
- $run ${rm}r "$my_xdir"
- $show "$mkdir $my_xdir"
- $run $mkdir "$my_xdir"
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
- exit $exit_status
- fi
- case $host in
- *-darwin*)
- $show "Extracting $my_xabs"
- # Do not bother doing anything if just a dry run
- if test -z "$run"; then
- darwin_orig_dir=`pwd`
- cd $my_xdir || exit $?
- darwin_archive=$my_xabs
- darwin_curdir=`pwd`
- darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
- darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
- if test -n "$darwin_arches"; then
- darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
- darwin_arch=
- $show "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
- cd "$darwin_curdir"
- $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
- done # $darwin_arches
- ## Okay now we have a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
- darwin_file=
- darwin_files=
- for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
- lipo -create -output "$darwin_file" $darwin_files
- done # $darwin_filelist
- ${rm}r unfat-$$
- cd "$darwin_orig_dir"
- else
- cd "$darwin_orig_dir"
- func_extract_an_archive "$my_xdir" "$my_xabs"
- fi # $darwin_arches
- fi # $run
- ;;
- *)
- func_extract_an_archive "$my_xdir" "$my_xabs"
- ;;
- esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
- done
- func_extract_archives_result="$my_oldobjs"
-}
-# End of Shell function definitions
-#####################################
-
-# Darwin sucks
-eval std_shrext=\"$shrext_cmds\"
-
-disable_libs=no
-
-# Parse our command line options once, thoroughly.
-while test "$#" -gt 0
-do
- arg="$1"
- shift
-
- case $arg in
- -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
- *) optarg= ;;
- esac
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- execute_dlfiles)
- execute_dlfiles="$execute_dlfiles $arg"
- ;;
- tag)
- tagname="$arg"
- preserve_args="${preserve_args}=$arg"
-
- # Check whether tagname contains only valid characters
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- $echo "$progname: invalid tag name: $tagname" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $tagname in
- CC)
- # Don't test for the "default" C tag, as we know, it's there, but
- # not specially marked.
- ;;
- *)
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
- taglist="$taglist $tagname"
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
- else
- $echo "$progname: ignoring unknown tag $tagname" 1>&2
- fi
- ;;
- esac
- ;;
- *)
- eval "$prev=\$arg"
- ;;
- esac
-
- prev=
- prevopt=
- continue
- fi
-
- # Have we seen a non-optional argument yet?
- case $arg in
- --help)
- show_help=yes
- ;;
-
- --version)
- $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
- $echo
- $echo "Copyright (C) 2005 Free Software Foundation, Inc."
- $echo "This is free software; see the source for copying conditions. There is NO"
- $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- exit $?
- ;;
-
- --config)
- ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
- # Now print the configurations for the tags.
- for tagname in $taglist; do
- ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
- done
- exit $?
- ;;
-
- --debug)
- $echo "$progname: enabling shell trace mode"
- set -x
- preserve_args="$preserve_args $arg"
- ;;
-
- --dry-run | -n)
- run=:
- ;;
-
- --features)
- $echo "host: $host"
- if test "$build_libtool_libs" = yes; then
- $echo "enable shared libraries"
- else
- $echo "disable shared libraries"
- fi
- if test "$build_old_libs" = yes; then
- $echo "enable static libraries"
- else
- $echo "disable static libraries"
- fi
- exit $?
- ;;
-
- --finish) mode="finish" ;;
-
- --mode) prevopt="--mode" prev=mode ;;
- --mode=*) mode="$optarg" ;;
-
- --preserve-dup-deps) duplicate_deps="yes" ;;
-
- --quiet | --silent)
- show=:
- preserve_args="$preserve_args $arg"
- ;;
-
- --tag)
- prevopt="--tag"
- prev=tag
- preserve_args="$preserve_args --tag"
- ;;
- --tag=*)
- set tag "$optarg" ${1+"$@"}
- shift
- prev=tag
- preserve_args="$preserve_args --tag"
- ;;
-
- -dlopen)
- prevopt="-dlopen"
- prev=execute_dlfiles
- ;;
-
- -*)
- $echo "$modename: unrecognized option \`$arg'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
-
- *)
- nonopt="$arg"
- break
- ;;
- esac
-done
-
-if test -n "$prevopt"; then
- $echo "$modename: option \`$prevopt' requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
-fi
-
-case $disable_libs in
-no)
- ;;
-shared)
- build_libtool_libs=no
- build_old_libs=yes
- ;;
-static)
- build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
- ;;
-esac
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-if test -z "$show_help"; then
-
- # Infer the operation mode.
- if test -z "$mode"; then
- $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
- $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
- case $nonopt in
- *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
- mode=link
- for arg
- do
- case $arg in
- -c)
- mode=compile
- break
- ;;
- esac
- done
- ;;
- *db | *dbx | *strace | *truss)
- mode=execute
- ;;
- *install*|cp|mv)
- mode=install
- ;;
- *rm)
- mode=uninstall
- ;;
- *)
- # If we have no mode, but dlfiles were specified, then do execute mode.
- test -n "$execute_dlfiles" && mode=execute
-
- # Just use the default operation mode.
- if test -z "$mode"; then
- if test -n "$nonopt"; then
- $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
- else
- $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
- fi
- fi
- ;;
- esac
- fi
-
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$execute_dlfiles" && test "$mode" != execute; then
- $echo "$modename: unrecognized option \`-dlopen'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$modename --help --mode=$mode' for more information."
-
- # These modes are in order of execution frequency so that they run quickly.
- case $mode in
- # libtool compile mode
- compile)
- modename="$modename: compile"
- # Get the compilation command and the source file.
- base_compile=
- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
- suppress_opt=yes
- suppress_output=
- arg_mode=normal
- libobj=
- later=
-
- for arg
- do
- case $arg_mode in
- arg )
- # do not "continue". Instead, add this to base_compile
- lastarg="$arg"
- arg_mode=normal
- ;;
-
- target )
- libobj="$arg"
- arg_mode=normal
- continue
- ;;
-
- normal )
- # Accept any command-line options.
- case $arg in
- -o)
- if test -n "$libobj" ; then
- $echo "$modename: you cannot specify \`-o' more than once" 1>&2
- exit $EXIT_FAILURE
- fi
- arg_mode=target
- continue
- ;;
-
- -static | -prefer-pic | -prefer-non-pic)
- later="$later $arg"
- continue
- ;;
-
- -no-suppress)
- suppress_opt=no
- continue
- ;;
-
- -Xcompiler)
- arg_mode=arg # the next one goes into the "base_compile" arg list
- continue # The current "srcfile" will either be retained or
- ;; # replaced later. I would guess that would be a bug.
-
- -Wc,*)
- args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
- lastarg=
- save_ifs="$IFS"; IFS=','
- for arg in $args; do
- IFS="$save_ifs"
-
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- lastarg="$lastarg $arg"
- done
- IFS="$save_ifs"
- lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
-
- # Add the arguments to base_compile.
- base_compile="$base_compile $lastarg"
- continue
- ;;
-
- * )
- # Accept the current argument as the source file.
- # The previous "srcfile" becomes the current argument.
- #
- lastarg="$srcfile"
- srcfile="$arg"
- ;;
- esac # case $arg
- ;;
- esac # case $arg_mode
-
- # Aesthetically quote the previous argument.
- lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
-
- case $lastarg in
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, and some SunOS ksh mistreat backslash-escaping
- # in scan sets (worked around with variable expansion),
- # and furthermore cannot handle '|' '&' '(' ')' in scan sets
- # at all, so we specify them separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- lastarg="\"$lastarg\""
- ;;
- esac
-
- base_compile="$base_compile $lastarg"
- done # for arg
-
- case $arg_mode in
- arg)
- $echo "$modename: you must specify an argument for -Xcompile"
- exit $EXIT_FAILURE
- ;;
- target)
- $echo "$modename: you must specify a target with \`-o'" 1>&2
- exit $EXIT_FAILURE
- ;;
- *)
- # Get the name of the library object.
- [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
- ;;
- esac
-
- # Recognize several different file suffixes.
- # If the user specifies -o file.o, it is replaced with file.lo
- xform='[cCFSifmso]'
- case $libobj in
- *.ada) xform=ada ;;
- *.adb) xform=adb ;;
- *.ads) xform=ads ;;
- *.asm) xform=asm ;;
- *.c++) xform=c++ ;;
- *.cc) xform=cc ;;
- *.ii) xform=ii ;;
- *.class) xform=class ;;
- *.cpp) xform=cpp ;;
- *.cxx) xform=cxx ;;
- *.f90) xform=f90 ;;
- *.for) xform=for ;;
- *.java) xform=java ;;
- esac
-
- libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
- case $libobj in
- *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
- *)
- $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- func_infer_tag $base_compile
-
- for arg in $later; do
- case $arg in
- -static)
- build_old_libs=yes
- continue
- ;;
-
- -prefer-pic)
- pic_mode=yes
- continue
- ;;
-
- -prefer-non-pic)
- pic_mode=no
- continue
- ;;
- esac
- done
-
- qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
- case $qlibobj in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qlibobj="\"$qlibobj\"" ;;
- esac
- test "X$libobj" != "X$qlibobj" \
- && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
- objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
- xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$obj"; then
- xdir=
- else
- xdir=$xdir/
- fi
- lobj=${xdir}$objdir/$objname
-
- if test -z "$base_compile"; then
- $echo "$modename: you must specify a compilation command" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Delete any leftover library objects.
- if test "$build_old_libs" = yes; then
- removelist="$obj $lobj $libobj ${libobj}T"
- else
- removelist="$lobj $libobj ${libobj}T"
- fi
-
- $run $rm $removelist
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
-
- # On Cygwin there's no "real" PIC flag so we must build both object types
- case $host_os in
- cygwin* | mingw* | pw32* | os2*)
- pic_mode=default
- ;;
- esac
- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
- # non-PIC code in shared libraries is not supported
- pic_mode=default
- fi
-
- # Calculate the filename of the output object if compiler does
- # not support -o with -c
- if test "$compiler_c_o" = no; then
- output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
- lockfile="$output_obj.lock"
- removelist="$removelist $output_obj $lockfile"
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
- else
- output_obj=
- need_locks=no
- lockfile=
- fi
-
- # Lock this critical section if it is needed
- # We use this script file to make the link, it avoids creating a new file
- if test "$need_locks" = yes; then
- until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
- $show "Waiting for $lockfile to be removed"
- sleep 2
- done
- elif test "$need_locks" = warn; then
- if test -f "$lockfile"; then
- $echo "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
- $echo "$srcfile" > "$lockfile"
- fi
-
- if test -n "$fix_srcfile_path"; then
- eval srcfile=\"$fix_srcfile_path\"
- fi
- qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
- case $qsrcfile in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qsrcfile="\"$qsrcfile\"" ;;
- esac
-
- $run $rm "$libobj" "${libobj}T"
-
- # Create a libtool object file (analogous to a ".la" file),
- # but don't create it if we're doing a dry run.
- test -z "$run" && cat > ${libobj}T <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-EOF
-
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- if test ! -d "${xdir}$objdir"; then
- $show "$mkdir ${xdir}$objdir"
- $run $mkdir ${xdir}$objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
- exit $exit_status
- fi
- fi
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- command="$command -o $lobj"
- fi
-
- $run $rm "$lobj" "$output_obj"
-
- $show "$command"
- if $run eval "$command"; then :
- else
- test -n "$output_obj" && $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed, then go on to compile the next one
- if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- $show "$mv $output_obj $lobj"
- if $run $mv $output_obj $lobj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
-
- # Append the name of the PIC object to the libtool object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object='$objdir/$objname'
-
-EOF
-
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- else
- # No PIC object so indicate it doesn't exist in the libtool
- # object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
-
-EOF
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
- $run $rm "$obj" "$output_obj"
- $show "$command"
- if $run eval "$command"; then :
- else
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed
- if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- $show "$mv $output_obj $obj"
- if $run $mv $output_obj $obj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
-
- # Append the name of the non-PIC object the libtool object file.
- # Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
-
-EOF
- else
- # Append the name of the non-PIC object the libtool object file.
- # Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
-
-EOF
- fi
-
- $run $mv "${libobj}T" "${libobj}"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- $run $rm "$lockfile"
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- # libtool link mode
- link | relink)
- modename="$modename: link"
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args="$nonopt"
- base_compile="$nonopt $@"
- compile_command="$nonopt"
- finalize_command="$nonopt"
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
-
- avoid_version=no
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- notinst_path= # paths that contain not-installed libtool libraries
- precious_files_regex=
- prefer_static_libs=no
- preload=no
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
-
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -all-static | -static)
- if test "X$arg" = "X-all-static"; then
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
- fi
- if test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- else
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=built
- fi
- build_libtool_libs=no
- build_old_libs=yes
- break
- ;;
- esac
- done
-
- # See if our shared archives depend on static archives.
- test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
- # Go through the arguments, transforming them on the way.
- while test "$#" -gt 0; do
- arg="$1"
- shift
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
- ;;
- *) qarg=$arg ;;
- esac
- libtool_args="$libtool_args $qarg"
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- output)
- compile_command="$compile_command @OUTPUT@"
- finalize_command="$finalize_command @OUTPUT@"
- ;;
- esac
-
- case $prev in
- dlfiles|dlprefiles)
- if test "$preload" = no; then
- # Add the symbol object into the linking commands.
- compile_command="$compile_command @SYMFILE@"
- finalize_command="$finalize_command @SYMFILE@"
- preload=yes
- fi
- case $arg in
- *.la | *.lo) ;; # We handle these cases below.
- force)
- if test "$dlself" = no; then
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- self)
- if test "$prev" = dlprefiles; then
- dlself=yes
- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
- dlself=yes
- else
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- *)
- if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $arg"
- else
- dlprefiles="$dlprefiles $arg"
- fi
- prev=
- continue
- ;;
- esac
- ;;
- expsyms)
- export_symbols="$arg"
- if test ! -f "$arg"; then
- $echo "$modename: symbol file \`$arg' does not exist"
- exit $EXIT_FAILURE
- fi
- prev=
- continue
- ;;
- expsyms_regex)
- export_symbols_regex="$arg"
- prev=
- continue
- ;;
- inst_prefix)
- inst_prefix_dir="$arg"
- prev=
- continue
- ;;
- precious_regex)
- precious_files_regex="$arg"
- prev=
- continue
- ;;
- release)
- release="-$arg"
- prev=
- continue
- ;;
- objectlist)
- if test -f "$arg"; then
- save_arg=$arg
- moreargs=
- for fil in `cat $save_arg`
- do
-# moreargs="$moreargs $fil"
- arg=$fil
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- # If there is no directory component, then add one.
- case $arg in
- */* | *\\*) . $arg ;;
- *) . ./$arg ;;
- esac
-
- if test -z "$pic_object" || \
- test -z "$non_pic_object" ||
- test "$pic_object" = none && \
- test "$non_pic_object" = none; then
- $echo "$modename: cannot find name of object for \`$arg'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- libobjs="$libobjs $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- non_pic_objects="$non_pic_objects $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if test -z "$run"; then
- $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
- exit $EXIT_FAILURE
- else
- # Dry-run case.
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- libobjs="$libobjs $pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- fi
- done
- else
- $echo "$modename: link input file \`$save_arg' does not exist"
- exit $EXIT_FAILURE
- fi
- arg=$save_arg
- prev=
- continue
- ;;
- rpath | xrpath)
- # We need an absolute path.
- case $arg in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- $echo "$modename: only absolute run-paths are allowed" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- if test "$prev" = rpath; then
- case "$rpath " in
- *" $arg "*) ;;
- *) rpath="$rpath $arg" ;;
- esac
- else
- case "$xrpath " in
- *" $arg "*) ;;
- *) xrpath="$xrpath $arg" ;;
- esac
- fi
- prev=
- continue
- ;;
- xcompiler)
- compiler_flags="$compiler_flags $qarg"
- prev=
- compile_command="$compile_command $qarg"
- finalize_command="$finalize_command $qarg"
- continue
- ;;
- xlinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $wl$qarg"
- prev=
- compile_command="$compile_command $wl$qarg"
- finalize_command="$finalize_command $wl$qarg"
- continue
- ;;
- xcclinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $qarg"
- prev=
- compile_command="$compile_command $qarg"
- finalize_command="$finalize_command $qarg"
- continue
- ;;
- shrext)
- shrext_cmds="$arg"
- prev=
- continue
- ;;
- darwin_framework|darwin_framework_skip)
- test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- prev=
- continue
- ;;
- *)
- eval "$prev=\"\$arg\""
- prev=
- continue
- ;;
- esac
- fi # test -n "$prev"
-
- prevarg="$arg"
-
- case $arg in
- -all-static)
- if test -n "$link_static_flag"; then
- compile_command="$compile_command $link_static_flag"
- finalize_command="$finalize_command $link_static_flag"
- fi
- continue
- ;;
-
- -allow-undefined)
- # FIXME: remove this flag sometime in the future.
- $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
- continue
- ;;
-
- -avoid-version)
- avoid_version=yes
- continue
- ;;
-
- -dlopen)
- prev=dlfiles
- continue
- ;;
-
- -dlpreopen)
- prev=dlprefiles
- continue
- ;;
-
- -export-dynamic)
- export_dynamic=yes
- continue
- ;;
-
- -export-symbols | -export-symbols-regex)
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: more than one -exported-symbols argument is not allowed"
- exit $EXIT_FAILURE
- fi
- if test "X$arg" = "X-export-symbols"; then
- prev=expsyms
- else
- prev=expsyms_regex
- fi
- continue
- ;;
-
- -framework|-arch|-isysroot)
- case " $CC " in
- *" ${arg} ${1} "* | *" ${arg} ${1} "*)
- prev=darwin_framework_skip ;;
- *) compiler_flags="$compiler_flags $arg"
- prev=darwin_framework ;;
- esac
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- continue
- ;;
-
- -inst-prefix-dir)
- prev=inst_prefix
- continue
- ;;
-
- # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- # so, if we see these flags be careful not to treat them like -L
- -L[A-Z][A-Z]*:*)
- case $with_gcc/$host in
- no/*-*-irix* | /*-*-irix*)
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- ;;
- esac
- continue
- ;;
-
- -L*)
- dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
- absdir="$dir"
- notinst_path="$notinst_path $dir"
- fi
- dir="$absdir"
- ;;
- esac
- case "$deplibs " in
- *" -L$dir "*) ;;
- *)
- deplibs="$deplibs -L$dir"
- lib_search_path="$lib_search_path $dir"
- ;;
- esac
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$dir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$dir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
- esac
- ;;
- esac
- continue
- ;;
-
- -l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
- # These systems don't actually have a C or math library (as such)
- continue
- ;;
- *-*-os2*)
- # These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C and math libraries are in the System framework
- deplibs="$deplibs -framework System"
- continue
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
- ;;
- esac
- elif test "X$arg" = "X-lc_r"; then
- case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc_r directly, use -pthread flag.
- continue
- ;;
- esac
- fi
- deplibs="$deplibs $arg"
- continue
- ;;
-
- # Tru64 UNIX uses -model [arg] to determine the layout of C++
- # classes, name mangling, and exception handling.
- -model)
- compile_command="$compile_command $arg"
- compiler_flags="$compiler_flags $arg"
- finalize_command="$finalize_command $arg"
- prev=xcompiler
- continue
- ;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
- compiler_flags="$compiler_flags $arg"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- continue
- ;;
-
- -module)
- module=yes
- continue
- ;;
-
- # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
- # -r[0-9][0-9]* specifies the processor on the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
- # +DA*, +DD* enable 64-bit mode on the HP compiler
- # -q* pass through compiler args for the IBM compiler
- # -m* pass through architecture-specific compiler args for GCC
- # -m*, -t[45]*, -txscale* pass through architecture-specific
- # compiler args for GCC
- # -pg pass through profiling flag for GCC
- # @file GCC response files
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
- -t[45]*|-txscale*|@*)
-
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- compiler_flags="$compiler_flags $arg"
- continue
- ;;
-
- -shrext)
- prev=shrext
- continue
- ;;
-
- -no-fast-install)
- fast_install=no
- continue
- ;;
-
- -no-install)
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- # The PATH hackery in wrapper scripts is required on Windows
- # in order for the loader to find any dlls it needs.
- $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
- $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
- fast_install=no
- ;;
- *) no_install=yes ;;
- esac
- continue
- ;;
-
- -no-undefined)
- allow_undefined=no
- continue
- ;;
-
- -objectlist)
- prev=objectlist
- continue
- ;;
-
- -o) prev=output ;;
-
- -precious-files-regex)
- prev=precious_regex
- continue
- ;;
-
- -release)
- prev=release
- continue
- ;;
-
- -rpath)
- prev=rpath
- continue
- ;;
-
- -R)
- prev=xrpath
- continue
- ;;
-
- -R*)
- dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- $echo "$modename: only absolute run-paths are allowed" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- continue
- ;;
-
- -static)
- # The effects of -static are defined in a previous loop.
- # We used to do the same as -all-static on platforms that
- # didn't have a PIC flag, but the assumption that the effects
- # would be equivalent was wrong. It would break on at least
- # Digital Unix and AIX.
- continue
- ;;
-
- -thread-safe)
- thread_safe=yes
- continue
- ;;
-
- -version-info)
- prev=vinfo
- continue
- ;;
- -version-number)
- prev=vinfo
- vinfo_number=yes
- continue
- ;;
-
- -Wc,*)
- args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- case $flag in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- flag="\"$flag\""
- ;;
- esac
- arg="$arg $wl$flag"
- compiler_flags="$compiler_flags $flag"
- done
- IFS="$save_ifs"
- arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
- ;;
-
- -Wl,*)
- args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- case $flag in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- flag="\"$flag\""
- ;;
- esac
- arg="$arg $wl$flag"
- compiler_flags="$compiler_flags $wl$flag"
- linker_flags="$linker_flags $flag"
- done
- IFS="$save_ifs"
- arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
- ;;
-
- -Xcompiler)
- prev=xcompiler
- continue
- ;;
-
- -Xlinker)
- prev=xlinker
- continue
- ;;
-
- -XCClinker)
- prev=xcclinker
- continue
- ;;
-
- # Some other compiler flag.
- -* | +*)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- ;;
-
- *.$objext)
- # A standard object.
- objs="$objs $arg"
- ;;
-
- *.lo)
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- # If there is no directory component, then add one.
- case $arg in
- */* | *\\*) . $arg ;;
- *) . ./$arg ;;
- esac
-
- if test -z "$pic_object" || \
- test -z "$non_pic_object" ||
- test "$pic_object" = none && \
- test "$non_pic_object" = none; then
- $echo "$modename: cannot find name of object for \`$arg'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- libobjs="$libobjs $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- non_pic_objects="$non_pic_objects $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if test -z "$run"; then
- $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
- exit $EXIT_FAILURE
- else
- # Dry-run case.
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- libobjs="$libobjs $pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- fi
- ;;
-
- *.$libext)
- # An archive.
- deplibs="$deplibs $arg"
- old_deplibs="$old_deplibs $arg"
- continue
- ;;
-
- *.la)
- # A libtool-controlled library.
-
- if test "$prev" = dlfiles; then
- # This library was specified with -dlopen.
- dlfiles="$dlfiles $arg"
- prev=
- elif test "$prev" = dlprefiles; then
- # The library was specified with -dlpreopen.
- dlprefiles="$dlprefiles $arg"
- prev=
- else
- deplibs="$deplibs $arg"
- fi
- continue
- ;;
-
- # Some other compiler argument.
- *)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- ;;
- esac # arg
-
- # Now actually substitute the argument into the commands.
- if test -n "$arg"; then
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- fi
- done # argument parsing loop
-
- if test -n "$prev"; then
- $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- fi
-
- oldlibs=
- # calculate the name of the file, without its directory
- outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
- libobjs_save="$libobjs"
-
- if test -n "$shlibpath_var"; then
- # get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
- else
- shlib_search_path=
- fi
- eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
- output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$output_objdir" = "X$output"; then
- output_objdir="$objdir"
- else
- output_objdir="$output_objdir/$objdir"
- fi
- # Create the object directory.
- if test ! -d "$output_objdir"; then
- $show "$mkdir $output_objdir"
- $run $mkdir $output_objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
- exit $exit_status
- fi
- fi
-
- # Determine the type of output
- case $output in
- "")
- $echo "$modename: you must specify an output file" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- *.$libext) linkmode=oldlib ;;
- *.lo | *.$objext) linkmode=obj ;;
- *.la) linkmode=lib ;;
- *) linkmode=prog ;; # Anything else should be a program.
- esac
-
- case $host in
- *cygwin* | *mingw* | *pw32*)
- # don't eliminate duplications in $postdeps and $predeps
- duplicate_compiler_generated_deps=yes
- ;;
- *)
- duplicate_compiler_generated_deps=$duplicate_deps
- ;;
- esac
- specialdeplibs=
-
- libs=
- # Find all interdependent deplibs by searching for libraries
- # that are linked more than once (e.g. -la -lb -la)
- for deplib in $deplibs; do
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- libs="$libs $deplib"
- done
-
- if test "$linkmode" = lib; then
- libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
- # Compute libraries that are listed more than once in $predeps
- # $postdeps and mark them as special (i.e., whose duplicates are
- # not to be eliminated).
- pre_post_deps=
- if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
- for pre_post_dep in $predeps $postdeps; do
- case "$pre_post_deps " in
- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
- esac
- pre_post_deps="$pre_post_deps $pre_post_dep"
- done
- fi
- pre_post_deps=
- fi
-
- deplibs=
- newdependency_libs=
- newlib_search_path=
- need_relink=no # whether we're linking any uninstalled libtool libraries
- notinst_deplibs= # not-installed libtool libraries
- case $linkmode in
- lib)
- passes="conv link"
- for file in $dlfiles $dlprefiles; do
- case $file in
- *.la) ;;
- *)
- $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- done
- ;;
- prog)
- compile_deplibs=
- finalize_deplibs=
- alldeplibs=no
- newdlfiles=
- newdlprefiles=
- passes="conv scan dlopen dlpreopen link"
- ;;
- *) passes="conv"
- ;;
- esac
- for pass in $passes; do
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
- deplibs=
- fi
- if test "$linkmode" = prog; then
- case $pass in
- dlopen) libs="$dlfiles" ;;
- dlpreopen) libs="$dlprefiles" ;;
- link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
- esac
- fi
- if test "$pass" = dlopen; then
- # Collect dlpreopened libraries
- save_deplibs="$deplibs"
- deplibs=
- fi
- for deplib in $libs; do
- lib=
- found=no
- case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- compiler_flags="$compiler_flags $deplib"
- fi
- continue
- ;;
- -l*)
- if test "$linkmode" != lib && test "$linkmode" != prog; then
- $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
- continue
- fi
- name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
- for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
- for search_ext in .la $std_shrext .so .a; do
- # Search the libtool library
- lib="$searchdir/lib${name}${search_ext}"
- if test -f "$lib"; then
- if test "$search_ext" = ".la"; then
- found=yes
- else
- found=no
- fi
- break 2
- fi
- done
- done
- if test "$found" != yes; then
- # deplib doesn't seem to be a libtool library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- else # deplib is a libtool library
- # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- # We need to do some special things here, and not later.
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $deplib "*)
- if (${SED} -e '2q' $lib |
- grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- library_names=
- old_library=
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
- for l in $old_library $library_names; do
- ll="$l"
- done
- if test "X$ll" = "X$old_library" ; then # only static version available
- found=no
- ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$ladir" = "X$lib" && ladir="."
- lib=$ladir/$old_library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- fi
- fi
- ;;
- *) ;;
- esac
- fi
- fi
- ;; # -l
- -L*)
- case $linkmode in
- lib)
- deplibs="$deplib $deplibs"
- test "$pass" = conv && continue
- newdependency_libs="$deplib $newdependency_libs"
- newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
- ;;
- prog)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- if test "$pass" = scan; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
- ;;
- *)
- $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
- ;;
- esac # linkmode
- continue
- ;; # -L
- -R*)
- if test "$pass" = link; then
- dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
- # Make sure the xrpath contains only unique directories.
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- fi
- deplibs="$deplib $deplibs"
- continue
- ;;
- *.la) lib="$deplib" ;;
- *.$libext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- case $linkmode in
- lib)
- valid_a_lib=no
- case $deplibs_check_method in
- match_pattern*)
- set dummy $deplibs_check_method
- match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- if eval $echo \"$deplib\" 2>/dev/null \
- | $SED 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
- fi
- ;;
- pass_all)
- valid_a_lib=yes
- ;;
- esac
- if test "$valid_a_lib" != yes; then
- $echo
- $echo "*** Warning: Trying to link with static lib archive $deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because the file extensions .$libext of this argument makes me believe"
- $echo "*** that it is just a static archive that I should not used here."
- else
- $echo
- $echo "*** Warning: Linking the shared library $output against the"
- $echo "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
- fi
- continue
- ;;
- prog)
- if test "$pass" != link; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- continue
- ;;
- esac # linkmode
- ;; # *.$libext
- *.lo | *.$objext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- elif test "$linkmode" = prog; then
- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- newdlfiles="$newdlfiles $deplib"
- fi
- fi
- continue
- ;;
- %DEPLIBS%)
- alldeplibs=yes
- continue
- ;;
- esac # case $deplib
- if test "$found" = yes || test -f "$lib"; then :
- else
- $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
-
- ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$ladir" = "X$lib" && ladir="."
-
- dlname=
- dlopen=
- dlpreopen=
- libdir=
- library_names=
- old_library=
- # If the library was installed with an old release of libtool,
- # it will not redefine variables installed, or shouldnotlink
- installed=yes
- shouldnotlink=no
- avoidtemprpath=
-
-
- # Read the .la file
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
-
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan" ||
- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
- fi
-
- if test "$pass" = conv; then
- # Only check for convenience libraries
- deplibs="$lib $deplibs"
- if test -z "$libdir"; then
- if test -z "$old_library"; then
- $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- # It is a libtool convenience library, so add in its objects.
- convenience="$convenience $ladir/$objdir/$old_library"
- old_convenience="$old_convenience $ladir/$objdir/$old_library"
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- $echo "$modename: \`$lib' is not a convenience library" 1>&2
- exit $EXIT_FAILURE
- fi
- continue
- fi # $pass = conv
-
-
- # Get the name of the library we link against.
- linklib=
- for l in $old_library $library_names; do
- linklib="$l"
- done
- if test -z "$linklib"; then
- $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # This library was specified with -dlopen.
- if test "$pass" = dlopen; then
- if test -z "$libdir"; then
- $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- if test -z "$dlname" ||
- test "$dlopen_support" != yes ||
- test "$build_libtool_libs" = no; then
- # If there is no dlname, no dlopen support or we're linking
- # statically, we need to preload. We also need to preload any
- # dependent libraries so libltdl's deplib preloader doesn't
- # bomb out in the load deplibs phase.
- dlprefiles="$dlprefiles $lib $dependency_libs"
- else
- newdlfiles="$newdlfiles $lib"
- fi
- continue
- fi # $pass = dlopen
-
- # We need an absolute path.
- case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
- *)
- abs_ladir=`cd "$ladir" && pwd`
- if test -z "$abs_ladir"; then
- $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
- $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
- abs_ladir="$ladir"
- fi
- ;;
- esac
- laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-
- # Find the relevant object directory and library name.
- if test "X$installed" = Xyes; then
- if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- $echo "$modename: warning: library \`$lib' was moved." 1>&2
- dir="$ladir"
- absdir="$abs_ladir"
- libdir="$abs_ladir"
- else
- dir="$libdir"
- absdir="$libdir"
- fi
- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- else
- if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir="$ladir"
- absdir="$abs_ladir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- else
- dir="$ladir/$objdir"
- absdir="$abs_ladir/$objdir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- fi
- fi # $installed = yes
- name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-
- # This library was specified with -dlpreopen.
- if test "$pass" = dlpreopen; then
- if test -z "$libdir"; then
- $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- newdlprefiles="$newdlprefiles $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- newdlprefiles="$newdlprefiles $dir/$dlname"
- else
- newdlprefiles="$newdlprefiles $dir/$linklib"
- fi
- fi # $pass = dlpreopen
-
- if test -z "$libdir"; then
- # Link the convenience library
- if test "$linkmode" = lib; then
- deplibs="$dir/$old_library $deplibs"
- elif test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$dir/$old_library $compile_deplibs"
- finalize_deplibs="$dir/$old_library $finalize_deplibs"
- else
- deplibs="$lib $deplibs" # used for prog,scan pass
- fi
- continue
- fi
-
-
- if test "$linkmode" = prog && test "$pass" != link; then
- newlib_search_path="$newlib_search_path $ladir"
- deplibs="$lib $deplibs"
-
- linkalldeplibs=no
- if test "$link_all_deplibs" != no || test -z "$library_names" ||
- test "$build_libtool_libs" = no; then
- linkalldeplibs=yes
- fi
-
- tmp_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
- esac
- # Need to link against all dependency_libs?
- if test "$linkalldeplibs" = yes; then
- deplibs="$deplib $deplibs"
- else
- # Need to hardcode shared library paths
- # or/and link against static libraries
- newdependency_libs="$deplib $newdependency_libs"
- fi
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done # for deplib
- continue
- fi # $linkmode = prog...
-
- if test "$linkmode,$pass" = "prog,link"; then
- if test -n "$library_names" &&
- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
- # Make sure the rpath contains only unique directories.
- case "$temp_rpath " in
- *" $dir "*) ;;
- *" $absdir "*) ;;
- *) temp_rpath="$temp_rpath $absdir" ;;
- esac
- fi
-
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi # $linkmode,$pass = prog,link...
-
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
- test -n "$library_names"; }; }; then
- # We only need to search for static libraries
- continue
- fi
- fi
-
- link_static=no # Whether the deplib will be linked statically
- use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes ; then
- use_static_libs=no
- fi
- if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
- if test "$installed" = no; then
- notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
- fi
- # This is a shared library
-
- # Warn about portability, can't link against -module's on
- # some systems (darwin)
- if test "$shouldnotlink" = yes && test "$pass" = link ; then
- $echo
- if test "$linkmode" = prog; then
- $echo "*** Warning: Linking the executable $output against the loadable module"
- else
- $echo "*** Warning: Linking the shared library $output against the loadable module"
- fi
- $echo "*** $linklib is not portable!"
- fi
- if test "$linkmode" = lib &&
- test "$hardcode_into_libs" = yes; then
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi
-
- if test -n "$old_archive_from_expsyms_cmds"; then
- # figure out the soname
- set dummy $library_names
- realname="$2"
- shift; shift
- libname=`eval \\$echo \"$libname_spec\"`
- # use dlname if we got it. it's perfectly good, no?
- if test -n "$dlname"; then
- soname="$dlname"
- elif test -n "$soname_spec"; then
- # bleh windows
- case $host in
- *cygwin* | mingw*)
- major=`expr $current - $age`
- versuffix="-$major"
- ;;
- esac
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
-
- # Make a new name for the extract_expsyms_cmds to use
- soroot="$soname"
- soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
- newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
-
- # If the library has no export list, then create one now
- if test -f "$output_objdir/$soname-def"; then :
- else
- $show "extracting exported symbol list from \`$soname'"
- save_ifs="$IFS"; IFS='~'
- cmds=$extract_expsyms_cmds
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
-
- # Create $newlib
- if test -f "$output_objdir/$newlib"; then :; else
- $show "generating import library for \`$soname'"
- save_ifs="$IFS"; IFS='~'
- cmds=$old_archive_from_expsyms_cmds
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
- # make sure the library variables are pointing to the new library
- dir=$output_objdir
- linklib=$newlib
- fi # test -n "$old_archive_from_expsyms_cmds"
-
- if test "$linkmode" = prog || test "$mode" != relink; then
- add_shlibpath=
- add_dir=
- add=
- lib_linked=yes
- case $hardcode_action in
- immediate | unsupported)
- if test "$hardcode_direct" = no; then
- add="$dir/$linklib"
- case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
- *-*-darwin* )
- # if the lib is a module then we can not link against
- # it, someone is ignoring the new warnings I added
- if /usr/bin/file -L $add 2> /dev/null |
- $EGREP ": [^:]* bundle" >/dev/null ; then
- $echo "** Warning, lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
- $echo
- $echo "** And there doesn't seem to be a static archive available"
- $echo "** The link will probably fail, sorry"
- else
- add="$dir/$old_library"
- fi
- fi
- esac
- elif test "$hardcode_minus_L" = no; then
- case $host in
- *-*-sunos*) add_shlibpath="$dir" ;;
- esac
- add_dir="-L$dir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = no; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- relink)
- if test "$hardcode_direct" = yes; then
- add="$dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$dir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- *) lib_linked=no ;;
- esac
-
- if test "$lib_linked" != yes; then
- $echo "$modename: configuration error: unsupported hardcode properties"
- exit $EXIT_FAILURE
- fi
-
- if test -n "$add_shlibpath"; then
- case :$compile_shlibpath: in
- *":$add_shlibpath:"*) ;;
- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
- esac
- fi
- if test "$linkmode" = prog; then
- test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- test -n "$add" && compile_deplibs="$add $compile_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- if test "$hardcode_direct" != yes && \
- test "$hardcode_minus_L" != yes && \
- test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- fi
- fi
- fi
-
- if test "$linkmode" = prog || test "$mode" = relink; then
- add_shlibpath=
- add_dir=
- add=
- # Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes; then
- add="$libdir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- add="-l$name"
- elif test "$hardcode_automatic" = yes; then
- if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
- else
- add="$libdir/$linklib"
- fi
- else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- fi
-
- if test "$linkmode" = prog; then
- test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- fi
- fi
- elif test "$linkmode" = prog; then
- # Here we assume that one of hardcode_direct or hardcode_minus_L
- # is not unsupported. This is valid on all known static and
- # shared platforms.
- if test "$hardcode_direct" != unsupported; then
- test -n "$old_library" && linklib="$old_library"
- compile_deplibs="$dir/$linklib $compile_deplibs"
- finalize_deplibs="$dir/$linklib $finalize_deplibs"
- else
- compile_deplibs="-l$name -L$dir $compile_deplibs"
- finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- fi
- elif test "$build_libtool_libs" = yes; then
- # Not a shared library
- if test "$deplibs_check_method" != pass_all; then
- # We're trying link a shared library against a static one
- # but the system doesn't support it.
-
diff --git a/tests/examplefiles/main.cmake b/tests/examplefiles/main.cmake
deleted file mode 100644
index 6dfcab10..00000000
--- a/tests/examplefiles/main.cmake
+++ /dev/null
@@ -1,45 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
-
-SET( SOURCES back.c io.c main.c )
-SET( PATH $ENV{PATH} )
-MESSAGE( ${SOURCES} ) # three arguments, prints "back.cio.cmain.c"
-MESSAGE( "${SOURCES}" ) # one argument, prints "back.c;io.c;main.c"
-MESSAGE( "" ) # one argument, prints "" an empty line
-MESSAGE( "${EMPTY_STRING}" ) # one argument, prints "" an empty line
-MESSAGE( ${EMPTY_STRING} ) # zero arguments, causes CMake Error
- # "MESSAGE called with incorrect number of arguments"
-MESSAGE( \\\"\ \(\)\#\$\^ ) # this message contains literal characters
-
-MESSAGE( "This is practice." ) # prints "This is practice."
-MESSAGE( "This;is;practice." ) # prints "This;is;practice."
-MESSAGE( "Hi. ) MESSAGE( x )" ) # prints "Hi. ) MESSAGE( x )"
-
-MESSAGE( "Welc"ome ) # rule 1
-MESSAGE( Welc"ome" ) # rule 3
-MESSAGE( Welc"ome)" ) # rule 2
-MESSAGE( ""Thanks ) # rule 1
-MESSAGE( Thanks"" ) # rule 3
-
-SET( x y A B C ) # stores "y;A;B;C" in x (without quote)
-SET( ${x} ) # => SET( y;A;B;C ) => SET( y A B C)
-MESSAGE( ${y} ) # prints "ABC" to stdout (without quotes)
-SET( y x ) # stores "x" in y (without quotes)
-SET( ${y} y = x ) # => SET( x y )
-MESSAGE( "\${x} = '${x}'" ) # prints "${x} = 'y;=;x'" to stdout (without quotes)
-SET( y ${x} ) # => SET( y y = x ) => stores "y;=;x" in y (without quotes)
-MESSAGE( ${y} ) # prints "y=x" to stdout (without quotes)
-
-SET( x a b c ) # stores "a;b;c" in x (without quotes)
-SET( y "a b c" ) # stores "a b c" in y (without quotes)
-MESSAGE( a b c ) # prints "abc" to stdout (without quotes)
-MESSAGE( ${x} ) # prints "abc" to stdout (without quotes)
-MESSAGE("${x}") # prints "a;b;c" to stdout (without quotes)
-MESSAGE( ${y} ) # prints "a b c" to stdout (without quotes)
-MESSAGE("${y}") # prints "a b c" to stdout (without quotes)
-
-# This is a comment.
-COMMAND( arguments go here )
-ANOTHER_COMMAND() # this command has no arguments
-YET_ANOTHER_COMMAND( these
- arguments are spread # another comment
- over several lines )
diff --git a/tests/examplefiles/markdown.lsp b/tests/examplefiles/markdown.lsp
deleted file mode 100755
index 8159082b..00000000
--- a/tests/examplefiles/markdown.lsp
+++ /dev/null
@@ -1,679 +0,0 @@
-#!/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/matlab_noreturn b/tests/examplefiles/matlab_noreturn
deleted file mode 100644
index 78027827..00000000
--- a/tests/examplefiles/matlab_noreturn
+++ /dev/null
@@ -1,3 +0,0 @@
- function myfunc(s)
- a = 1;
- end
diff --git a/tests/examplefiles/matlab_sample b/tests/examplefiles/matlab_sample
deleted file mode 100644
index bb00b517..00000000
--- a/tests/examplefiles/matlab_sample
+++ /dev/null
@@ -1,34 +0,0 @@
-function zz=sample(aa)
-%%%%%%%%%%%%%%%%%%
-% some comments
-%%%%%%%%%%%%%%%%%%
-
-x = 'a string'; % some 'ticks' in a comment
-y = 'a string with ''interal'' quotes';
-
-for i=1:20
- disp(i);
-end
-
-a = rand(30);
-b = rand(30);
-
-c = a .* b ./ a \ ... comment at end of line and continuation
- (b .* a + b - a);
-
-c = a' * b'; % note: these ticks are for transpose, not quotes.
-
-disp('a comment symbol, %, in a string');
-
-!echo abc % this isn't a comment - it's passed to system command
-
-function y=myfunc(x)
-y = exp(x);
-
- {%
-a block comment
- %}
-
-function no_arg_func
-fprintf('%s\n', 'function with no args')
-end
diff --git a/tests/examplefiles/matlabsession_sample.txt b/tests/examplefiles/matlabsession_sample.txt
deleted file mode 100644
index 1b33c9c4..00000000
--- a/tests/examplefiles/matlabsession_sample.txt
+++ /dev/null
@@ -1,37 +0,0 @@
->>
->>
->> a = 'okay'
-
-a =
-
-okay
-
->> x = rand(3) % a matrix
-
-x =
-
- 0.8147 0.9134 0.2785
- 0.9058 0.6324 0.5469
- 0.1270 0.0975 0.9575
-
->> 1/0
-
-ans =
-
- Inf
-
->> foo
-??? Undefined function or variable 'foo'.
-
->>
->>
->> {cos(2*pi), 'testing'}
-
-ans =
-
- [1] 'testing'
-
->>
->>
->>
-
diff --git a/tests/examplefiles/metagrammar.treetop b/tests/examplefiles/metagrammar.treetop
deleted file mode 100644
index acd6af63..00000000
--- a/tests/examplefiles/metagrammar.treetop
+++ /dev/null
@@ -1,455 +0,0 @@
-module Treetop
- module Compiler
- grammar Metagrammar
- rule treetop_file
- requires:(space? require_statement)* prefix:space? module_or_grammar suffix:space? {
- def compile
- requires.text_value + prefix.text_value + module_or_grammar.compile + suffix.text_value
- end
- }
- end
-
- rule require_statement
- prefix:space? "require" [ \t]+ [^\n\r]+ [\n\r]
- end
-
- rule module_or_grammar
- module_declaration / grammar
- end
-
- rule module_declaration
- prefix:('module' space name:([A-Z] alphanumeric_char* ('::' [A-Z] alphanumeric_char*)*) space) module_contents:(module_declaration / grammar) suffix:(space 'end') {
- def compile
- prefix.text_value + module_contents.compile + suffix.text_value
- end
-
- def parser_name
- prefix.name.text_value+'::'+module_contents.parser_name
- end
- }
- end
-
- rule grammar
- 'grammar' space grammar_name space ('do' space)? declaration_sequence space? 'end' <Grammar>
- end
-
- rule grammar_name
- ([A-Z] alphanumeric_char*)
- end
-
- rule declaration_sequence
- head:declaration tail:(space declaration)* <DeclarationSequence> {
- def declarations
- [head] + tail
- end
-
- def tail
- super.elements.map { |elt| elt.declaration }
- end
- }
- /
- '' {
- def compile(builder)
- end
- }
- end
-
- rule declaration
- parsing_rule / include_declaration
- end
-
- rule include_declaration
- 'include' space [A-Z] (alphanumeric_char / '::')* {
- def compile(builder)
- builder << text_value
- end
- }
- end
-
- rule parsing_rule
- 'rule' space nonterminal space ('do' space)? parsing_expression space 'end' <ParsingRule>
- end
-
- rule parsing_expression
- choice / sequence / primary
- end
-
- rule choice
- head:alternative tail:(space? '/' space? alternative)+ <Choice> {
- def alternatives
- [head] + tail
- end
-
- def tail
- super.elements.map {|elt| elt.alternative}
- end
-
- def inline_modules
- (alternatives.map {|alt| alt.inline_modules }).flatten
- end
- }
- end
-
- rule sequence
- head:labeled_sequence_primary tail:(space labeled_sequence_primary)+ node_class_declarations <Sequence> {
- def sequence_elements
- [head] + tail
- end
-
- def tail
- super.elements.map {|elt| elt.labeled_sequence_primary }
- end
-
- def inline_modules
- (sequence_elements.map {|elt| elt.inline_modules}).flatten +
- [sequence_element_accessor_module] +
- node_class_declarations.inline_modules
- end
-
- def inline_module_name
- node_class_declarations.inline_module_name
- end
- }
- end
-
- rule alternative
- sequence / primary
- end
-
- rule primary
- prefix atomic {
- def compile(address, builder, parent_expression=nil)
- prefix.compile(address, builder, self)
- end
-
- def prefixed_expression
- atomic
- end
-
- def inline_modules
- atomic.inline_modules
- end
-
- def inline_module_name
- nil
- end
- }
- /
- prefix space? predicate_block {
- def compile(address, builder, parent_expression=nil)
- prefix.compile(address, builder, self)
- end
- def prefixed_expression
- predicate_block
- end
- def inline_modules
- []
- end
- }
- /
- atomic suffix node_class_declarations {
- def compile(address, builder, parent_expression=nil)
- suffix.compile(address, builder, self)
- end
-
- def optional_expression
- atomic
- end
-
- def node_class_name
- node_class_declarations.node_class_name
- end
-
- def inline_modules
- atomic.inline_modules + node_class_declarations.inline_modules
- end
-
- def inline_module_name
- node_class_declarations.inline_module_name
- end
- }
- /
- atomic node_class_declarations {
- def compile(address, builder, parent_expression=nil)
- atomic.compile(address, builder, self)
- end
-
- def node_class_name
- node_class_declarations.node_class_name
- end
-
- def inline_modules
- atomic.inline_modules + node_class_declarations.inline_modules
- end
-
- def inline_module_name
- node_class_declarations.inline_module_name
- end
- }
- end
-
- rule labeled_sequence_primary
- label sequence_primary {
- def compile(lexical_address, builder)
- sequence_primary.compile(lexical_address, builder)
- end
-
- def inline_modules
- sequence_primary.inline_modules
- end
-
- def label_name
- if label.name
- label.name
- elsif sequence_primary.instance_of?(Nonterminal)
- sequence_primary.text_value
- else
- nil
- end
- end
- }
- end
-
- rule label
- (alpha_char alphanumeric_char*) ':' {
- def name
- elements[0].text_value
- end
- }
- /
- '' {
- def name
- nil
- end
- }
- end
-
- rule sequence_primary
- prefix atomic {
- def compile(lexical_address, builder)
- prefix.compile(lexical_address, builder, self)
- end
-
- def prefixed_expression
- elements[1]
- end
-
- def inline_modules
- atomic.inline_modules
- end
-
- def inline_module_name
- nil
- end
- }
- /
- prefix space? predicate_block {
- def compile(address, builder, parent_expression=nil)
- prefix.compile(address, builder, self)
- end
- def prefixed_expression
- predicate_block
- end
- def inline_modules
- []
- end
- }
- /
- atomic suffix {
- def compile(lexical_address, builder)
- suffix.compile(lexical_address, builder, self)
- end
-
- def node_class_name
- nil
- end
-
- def inline_modules
- atomic.inline_modules
- end
-
- def inline_module_name
- nil
- end
- }
- /
- atomic
- end
-
- rule suffix
- repetition_suffix / optional_suffix
- end
-
- rule optional_suffix
- '?' <Optional>
- end
-
- rule node_class_declarations
- node_class_expression trailing_inline_module {
- def node_class_name
- node_class_expression.node_class_name
- end
-
- def inline_modules
- trailing_inline_module.inline_modules
- end
-
- def inline_module
- trailing_inline_module.inline_module
- end
-
- def inline_module_name
- inline_module.module_name if inline_module
- end
- }
- end
-
- rule repetition_suffix
- '+' <OneOrMore> / '*' <ZeroOrMore> / occurrence_range
- end
-
- rule occurrence_range
- space? min:([0-9])* '..' max:([0-9])* <OccurrenceRange>
- end
-
- rule prefix
- '&' <AndPredicate> / '!' <NotPredicate> / '~' <TransientPrefix>
- end
-
- rule atomic
- terminal
- /
- nonterminal
- /
- parenthesized_expression
- end
-
- rule parenthesized_expression
- '(' space? parsing_expression space? ')' <ParenthesizedExpression> {
- def inline_modules
- parsing_expression.inline_modules
- end
- }
- end
-
- rule nonterminal
- !keyword_inside_grammar (alpha_char alphanumeric_char*) <Nonterminal>
- end
-
- rule terminal
- quoted_string / character_class / anything_symbol
- end
-
- rule quoted_string
- (single_quoted_string / double_quoted_string) {
- def string
- super.text_value
- end
- }
- end
-
- rule double_quoted_string
- '"' string:(!'"' ("\\\\" / '\"' / .))* '"' <Terminal>
- end
-
- rule single_quoted_string
- "'" string:(!"'" ("\\\\" / "\\'" / .))* "'" <Terminal>
- end
-
- rule character_class
- '[' characters:(!']' ('\\' . / bracket_expression / !'\\' .))+ ']' <CharacterClass> {
- def characters
- super.text_value
- end
- }
- end
-
- rule bracket_expression
- '[:' '^'? (
- 'alnum' / 'alpha' / 'blank' / 'cntrl' / 'digit' / 'graph' / 'lower' /
- 'print' / 'punct' / 'space' / 'upper' / 'xdigit' / 'word'
- ) ':]'
- end
-
- rule anything_symbol
- '.' <AnythingSymbol>
- end
-
- rule node_class_expression
- space '<' (!'>' .)+ '>' {
- def node_class_name
- elements[2].text_value
- end
- }
- /
- '' {
- def node_class_name
- nil
- end
- }
- end
-
- rule trailing_inline_module
- space inline_module {
- def inline_modules
- [inline_module]
- end
-
- def inline_module_name
- inline_module.module_name
- end
- }
- /
- '' {
- def inline_modules
- []
- end
-
- def inline_module
- nil
- end
-
- def inline_module_name
- nil
- end
- }
- end
-
- rule predicate_block
- '' inline_module <PredicateBlock>
- end
-
- rule inline_module
- '{' (inline_module / ![{}] .)* '}' <InlineModule>
- end
-
- rule keyword_inside_grammar
- ('rule' / 'end') !non_space_char
- end
-
- rule non_space_char
- !space .
- end
-
- rule alpha_char
- [A-Za-z_]
- end
-
- rule alphanumeric_char
- alpha_char / [0-9]
- end
-
- rule space
- (white / comment_to_eol)+
- end
-
- rule comment_to_eol
- '#' (!"\n" .)*
- end
-
- rule white
- [ \t\n\r]
- end
- end
- end
-end
diff --git a/tests/examplefiles/minehunt.qml b/tests/examplefiles/minehunt.qml
deleted file mode 100644
index 548e7e89..00000000
--- a/tests/examplefiles/minehunt.qml
+++ /dev/null
@@ -1,112 +0,0 @@
- /****************************************************************************
- **
- ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- ** All rights reserved.
- ** Contact: Nokia Corporation (qt-info@nokia.com)
- **
- ** This file is part of the QtDeclarative module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
- ** GNU Lesser General Public License Usage
- ** This file may be used under the terms of the GNU Lesser General Public
- ** License version 2.1 as published by the Free Software Foundation and
- ** appearing in the file LICENSE.LGPL included in the packaging of this
- ** file. Please review the following information to ensure the GNU Lesser
- ** General Public License version 2.1 requirements will be met:
- ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
- **
- ** In addition, as a special exception, Nokia gives you certain additional
- ** rights. These rights are described in the Nokia Qt LGPL Exception
- ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
- **
- ** GNU General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU General
- ** Public License version 3.0 as published by the Free Software Foundation
- ** and appearing in the file LICENSE.GPL included in the packaging of this
- ** file. Please review the following information to ensure the GNU General
- ** Public License version 3.0 requirements will be met:
- ** http://www.gnu.org/copyleft/gpl.html.
- **
- ** Other Usage
- ** Alternatively, this file may be used in accordance with the terms and
- ** conditions contained in a signed written agreement between you and Nokia.
- **
- **
- **
- **
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
-
- import QtQuick 1.0
- import "MinehuntCore" 1.0
-
- Item {
- id: field
- property int clickx: 0
- property int clicky: 0
-
- width: 450; height: 450
-
- Image { source: "MinehuntCore/pics/background.png"; anchors.fill: parent; fillMode: Image.Tile }
-
- Grid {
- anchors.horizontalCenter: parent.horizontalCenter
- columns: 9; spacing: 1
-
- Repeater {
- id: repeater
- model: tiles
- delegate: Tile {}
- }
- }
-
- Row {
- id: gamedata
- x: 20; spacing: 20
- anchors.bottom: field.bottom; anchors.bottomMargin: 15
-
- Image {
- source: "MinehuntCore/pics/quit.png"
- scale: quitMouse.pressed ? 0.8 : 1.0
- smooth: quitMouse.pressed
- y: 10
- MouseArea {
- id: quitMouse
- anchors.fill: parent
- anchors.margins: -20
- onClicked: Qt.quit()
- }
- }
- Column {
- spacing: 2
- Image { source: "MinehuntCore/pics/bomb-color.png" }
- Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numMines }
- }
-
- Column {
- spacing: 2
- Image { source: "MinehuntCore/pics/flag-color.png" }
- Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numFlags }
- }
- }
-
- Image {
- anchors.bottom: field.bottom; anchors.bottomMargin: 15
- anchors.right: field.right; anchors.rightMargin: 20
- source: isPlaying ? 'MinehuntCore/pics/face-smile.png' :
- hasWon ? 'MinehuntCore/pics/face-smile-big.png': 'MinehuntCore/pics/face-sad.png'
-
- MouseArea { anchors.fill: parent; onPressed: reset() }
- }
- Text {
- anchors.centerIn: parent; width: parent.width - 20
- horizontalAlignment: Text.AlignHCenter
- wrapMode: Text.WordWrap
- text: "Minehunt demo has to be compiled to run.\n\nPlease see README."
- color: "white"; font.bold: true; font.pixelSize: 14
- visible: tiles == undefined
- }
-
- }
diff --git a/tests/examplefiles/minimal.ns2 b/tests/examplefiles/minimal.ns2
deleted file mode 100644
index e8a92693..00000000
--- a/tests/examplefiles/minimal.ns2
+++ /dev/null
@@ -1,4 +0,0 @@
-class A = ( | a = self m. | ) (
- m = (^a isNil ifTrue: [0] ifFalse: [1])
-)
-class B = C ( | b0 = 0. b1 = b0 + 1. | ) ()
diff --git a/tests/examplefiles/modula2_test_cases.def b/tests/examplefiles/modula2_test_cases.def
deleted file mode 100644
index ce86a55b..00000000
--- a/tests/examplefiles/modula2_test_cases.def
+++ /dev/null
@@ -1,354 +0,0 @@
-(* Test Cases for Modula-2 Lexer *)
-
-(* Notes:
- (1) Without dialect option nor embedded dialect tag, the lexer operates in
- fallback mode, recognising the *combined* literals, punctuation symbols
- and operators of all supported dialects, and the *combined* reserved
- words and builtins of PIM Modula-2, ISO Modula-2 and Modula-2 R10.
- (1) If multiple embedded dialect tags are present, the lexer will use the
- first valid tag and ignore any subsequent dialect tags in the file.
- (2) An embedded dialect tag overrides any command line dialect option. *)
-
-
-(* Testing command line dialect option *)
-
-(* for PIM Modula-2 : pygmentize -O full,dialect=m2pim ...
- for ISO Modula-2 : pygmentize -O full,dialect=m2iso ...
- for Modula-2 R10 : pygmentize -O full,dialect=m2r10 ...
- for Objective Modula-2 : pygmentize -O full,dialect=objm2 ... *)
-
-(* for Aglet extensions : pygmentize -O full,dialect=m2iso+aglet ...
- for GNU extensions : pygmentize -O full,dialect=m2pim+gm2 ...
- for p1 extensions : pygmentize -O full,dialect=m2iso+p1 ...
- for XDS extensions : pygmentize -O full,dialect=m2iso+xds ...
-
-
-(* Testing embedded dialect tags *)
-
-(* !m2pim*) (* <-- remove whitespace before ! for PIM Modula-2 *)
-(* !m2iso*) (* <-- remove whitespace before ! for ISO Modula-2 *)
-(* !m2r10*) (* <-- remove whitespace before ! for Modula-2 R10 *)
-(* !objm2*) (* <-- remove whitespace before ! for Objective Modula-2 *)
-
-(* !m2iso+aglet*) (* <-- remove whitespace before ! for Aglet extensions *)
-(* !m2pim+gm2*) (* <-- remove whitespace before ! for GNU extensions *)
-(* !m2iso+p1*) (* <-- remove whitespace before ! for p1 extensions *)
-(* !m2iso+xds*) (* <-- remove whitespace before ! for XDS extensions *)
-
-
-(* Dialect Indicating Names *)
-
-(* recognised names should be highlighted *)
-
-QUALIFIED (* PIM and ISO *)
-
-PACKEDSET (* ISO only *)
-
-ARGLIST (* M2 R10 and ObjM2 *)
-
-BYCOPY (* ObjM2 only *)
-
-BITSET8 (* Aglet, GNU and M2 R10 *)
-
-__FILE__ (* GNU only *)
-
-BCD (* p1 and M2 R10 *)
-
-SEQ (* XDS only *)
-
-
-(* Literal Tests *)
-
-(* recognised literals should be rendered as one unit
- unrecognised literals should be rendered as error *)
-
-ch := 'a'; ch := "a"; (* all dialects *)
-ch := 0u20; unich := 0u2038 (* M2 R10 *)
-
-s := 'The cat said "meow!".';
-s := "It is eight O'clock.";
-
-
-n := 123; n = 1000000; (* all dialects *)
-n := 123; n = 1'000'000; (* M2 R10 *)
-
-n := 0b0110; n:= 0b0110'1100'0111; (* M2 R10 *)
-n := 0xFF00; n:= 0xDEAD'BEEF'0F00; (* M2 R10 *)
-
-r := 1.23; r := 1000000.000001; (* all dialects *)
-r := 1.23; r := 1'000'000.000'001; (* M2 R10 *)
-
-r := 1.234E6; r:= 1.234E-6; r := 1.234567E1000; (* PIM + ISO *)
-r := 1.234e6; r:= 1.234e-6; r := 1.234'567e1'000; (* M2 R10 *)
-
-ch := 0377C; n := 0377B; n := 07FF0H; (* ISO + PIM *)
-
-
-(* Non-Alphabetic Operator Tests *)
-
-(* supported operators should be rendered as one unit
- unsupported operators should be rendered as errors *)
-
-a := b + c - d * e / f; (* all dialects *)
-
-SetDiff := A \ B; (* M2 R10 *)
-
-dotProduct := v1 *. v2; catArray := array1 +> array2; (* M2 R10 *)
-
-bool := a = b; bool := a > b; bool := a < b;
-bool := a # b; bool := a >= b; bool := a <= b;
-
-bool := a <> b; (* PIM + ISO *)
-
-bool := a == b; (* M2 R10 *)
-
-(*&*) IF a & b THEN ... END; (* PIM + ISO *)
-
-(*~*) IF ~ b THEN ... END; (* PIM + ISO *)
-
-(*::*) int := real :: INTEGER; (* M2 R10 *)
-
-(*++*) FOR i++ IN range DO ... END; (* M2 R10 *)
-(*--*) FOR i-- IN range DO ... END; (* M2 R10 *)
-
-(*^*) next := this^.next; (* all dialects *)
-(*@*) next := this@.next; (* ISO *)
-
-(*`*) str := `NSString alloc init; (* ObjM2 *)
-
-
-(* Punctuation Tests *)
-
-(* supported punctuation should be rendered as one unit
- unsupported punctuation should be rendered as an error *)
-
-(*.*) Foo.Bar.Baz; (*..*) TYPE Sign = [-1..1] OF INTEGER;
-
-(*|:*) CASE foo OF | 1 : bar | 2 : bam | 3 : boo END;
-(*!:*) CASE foo OF 1 : bar ! 2 : bam ! 3 : boo END; (* ISO *)
-
-(*[]()*) array[n] := foo();
-
-(*{}*) CONST Bar = { 1, 2, 3 };
-
-(*?*) TPROPERTIES = isCollection, isIndexed | isRigid?; (* M2 R10 *)
-
-(*~*) CONST ~ isFoobar = Foo AND Bar; (* M2 R10 *)
-(*->*) isFoobar -> PROCEDURE [ABS]; (* M2 R10 *)
-
-(*<<>>*) GENLIB Foo FROM Template FOR Bar = <<ARRAY OF CHAR>> END; (* M2 R10 *)
-
-
-(* Single Line Comment Test *)
-
-(* should be rendered as comment if supported, as error if unsupported *)
-
-// This is a single line comment (M2 R10 + ObjM2)
-
-
-(* Pragma Delimiter Tests *)
-
-(* PIM style pragma should be rendered as pragma in PIM dialects,
- as multiline comment in all other dialects. *)
-
-(*$INLINE*) (* PIM *)
-
-(* ISO style pragma should be rendered as error in PIM dialects,
- as pragma in all other dialects. *)
-
-<*INLINE*> (* all other dialects *)
-
-
-(* Operator Substitution Test When in Algol mode *)
-
-IF foo # bar THEN ... END; (* # should be rendered as not equal symbol *)
-
-IF foo >= bar THEN ... END; (* >= should be rendered as not less symbol *)
-
-IF foo <= bar THEN ... END; (* <= should be rendered as not greater symbol *)
-
-IF foo == bar THEN ... END; (* == should be rendered as identity symbol *)
-
-dotProduct := v1 *. v2; (* *. should be rendered as dot product symbol *)
-
-
-(* Reserved Words and Builtins Test *)
-
-(* supported reserved words and builtins should be highlighted *)
-
-(* reserved words common to all dialects *)
-
-AND ARRAY BEGIN BY CASE CONST DEFINITION DIV DO ELSE ELSIF END EXIT FOR FROM
-IF IMPLEMENTATION IMPORT IN LOOP MOD MODULE NOT OF OR POINTER PROCEDURE
-RECORD REPEAT RETURN SET THEN TO TYPE UNTIL VAR WHILE
-
-(* builtins common to all dialects *)
-
-ABS BOOLEAN CARDINAL CHAR CHR FALSE INTEGER LONGINT LONGREAL
-MAX MIN NIL ODD ORD REAL TRUE
-
-(* pseudo builtins common to all dialects *)
-
-ADDRESS BYTE WORD ADR
-
-
-(* additional reserved words for PIM *)
-
-EXPORT QUALIFIED WITH
-
-(* additional builtins for PIM *)
-
-BITSET CAP DEC DISPOSE EXCL FLOAT HALT HIGH INC INCL NEW NIL PROC SIZE TRUNC VAL
-
-(* additional pseudo-builtins for PIM *)
-
-SYSTEM PROCESS TSIZE NEWPROCESS TRANSFER
-
-
-(* additional reserved words for ISO 10514-1 *)
-
-EXCEPT EXPORT FINALLY FORWARD PACKEDSET QUALIFIED REM RETRY WITH
-
-(* additional reserved words for ISO 10514-2 & ISO 10514-3 *)
-
-ABSTRACT AS CLASS GUARD INHERIT OVERRIDE READONLY REVEAL TRACED UNSAFEGUARDED
-
-(* additional builtins for ISO 10514-1 *)
-
-BITSET CAP CMPLX COMPLEX DEC DISPOSE EXCL FLOAT HALT HIGH IM INC INCL INT
-INTERRUPTIBLE LENGTH LFLOAT LONGCOMPLEX NEW PROC PROTECTION RE SIZE TRUNC
-UNINTERRUBTIBLE VAL
-
-(* additional builtins for ISO 10514-2 & ISO 10514-3 *)
-
-CREATE DESTROY EMPTY ISMEMBER SELF
-
-
-(* additional pseudo-builtins for ISO *)
-
-(* SYSTEM *)
-SYSTEM BITSPERLOC LOCSPERBYTE LOCSPERWORD LOC ADDADR SUBADR DIFADR MAKEADR
-ADR ROTATE SHIFT CAST TSIZE
-
-(* COROUTINES *)
-COROUTINES ATTACH COROUTINE CURRENT DETACH HANDLER INTERRUPTSOURCE IOTRANSFER
-IsATTACHED LISTEN NEWCOROUTINE PROT TRANSFER
-
-(* EXCEPTIONS *)
-EXCEPTIONS AllocateSource CurrentNumber ExceptionNumber ExceptionSource
-GetMessage IsCurrentSource IsExceptionalExecution RAISE
-
-(* TERMINATION *)
-TERMINATION IsTerminating HasHalted
-
-(* M2EXCEPTION *)
-M2EXCEPTION M2Exceptions M2Exception IsM2Exception indexException rangeException
-caseSelectException invalidLocation functionException wholeValueException
-wholeDivException realValueException realDivException complexValueException
-complexDivException protException sysException coException exException
-
-
-(* additional reserved words for M2 R10 *)
-
-ALIAS ARGLIST BLUEPRINT COPY GENLIB INDETERMINATE NEW NONE OPAQUE REFERENTIAL
-RELEASE RETAIN
-
-(* with symbolic assembler language extension *)
-ASM REG
-
-(* additional builtins for M2 R10 *)
-
-CARDINAL COUNT EMPTY EXISTS INSERT LENGTH LONGCARD OCTET PTR PRED READ READNEW
-REMOVE RETRIEVE SORT STORE SUBSET SUCC TLIMIT TMAX TMIN TRUE TSIZE UNICHAR
-WRITE WRITEF
-
-(* additional pseudo-builtins for M2 R10 *)
-
-(* TPROPERTIES *)
-TPROPERTIES PROPERTY LITERAL TPROPERTY TLITERAL TBUILTIN TDYN TREFC TNIL
-TBASE TPRECISION TMAXEXP TMINEXP
-
-(* CONVERSION *)
-CONVERSION TSXFSIZE SXF VAL
-
-(* UNSAFE *)
-UNSAFE CAST INTRINSIC AVAIL ADD SUB ADDC SUBC FETCHADD FETCHSUB SHL SHR ASHR
-ROTL ROTR ROTLC ROTRC BWNOT BWAND BWOR BWXOR BWNAND BWNOR SETBIT TESTBIT
-LSBIT MSBIT CSBITS BAIL HALT TODO FFI ADDR VARGLIST VARGC
-
-(* ATOMIC *)
-ATOMIC INTRINSIC AVAIL SWAP CAS INC DEC BWAND BWNAND BWOR BWXOR
-
-(* COMPILER *)
-COMPILER DEBUG MODNAME PROCNAME LINENUM DEFAULT HASH
-
-(* ASSEMBLER *)
-ASSEMBLER REGISTER SETREG GETREG CODE
-
-
-(* standard library ADT identifiers for M2 R10 *)
-
-(* rendered as builtins when dialect is set to Modula-2 R10,
- this can be turned off by option treat_stdlib_adts_as_builtins=off *)
-BCD LONGBCD BITSET SHORTBITSET LONGBITSET LONGLONGBITSET COMPLEX LONGCOMPLEX
-SHORTCARD LONGLONGCARD SHORTINT LONGLONGINT POSINT SHORTPOSINT LONGPOSINT
-LONGLONGPOSINT BITSET8 BITSET16 BITSET32 BITSET64 BITSET128 BS8 BS16 BS32
-BS64 BS128 CARDINAL8 CARDINAL16 CARDINAL32 CARDINAL64 CARDINAL128 CARD8
-CARD16 CARD32 CARD64 CARD128 INTEGER8 INTEGER16 INTEGER32 INTEGER64
-INTEGER128 INT8 INT16 INT32 INT64 INT128 STRING UNISTRING
-
-
-(* additional reserved words for ObjM2 *)
-
-(* Note: ObjM2 is a superset of M2 R10 *)
-
-BYCOPY BYREF CLASS CONTINUE CRITICAL INOUT METHOD ON OPTIONAL OUT PRIVATE
-PROTECTED PROTOCOL PUBLIC SUPER TRY
-
-(* additional builtins for ObjM2 *)
-
-OBJECT NO YES
-
-
-(* additional builtins for Aglet Extensions to ISO *)
-
-BITSET8 BITSET16 BITSET32 CARDINAL8 CARDINAL16 CARDINAL32 INTEGER8 INTEGER16
-INTEGER32
-
-
-(* additional reserved words for GNU Extensions to PIM *)
-
-ASM __ATTRIBUTE__ __BUILTIN__ __COLUMN__ __DATE__ __FILE__ __FUNCTION__
-__LINE__ __MODULE__ VOLATILE
-
-(* additional builtins for GNU Extensions to PIM *)
-
-BITSET8 BITSET16 BITSET32 CARDINAL8 CARDINAL16 CARDINAL32 CARDINAL64 COMPLEX32
-COMPLEX64 COMPLEX96 COMPLEX128 INTEGER8 INTEGER16 INTEGER32 INTEGER64 REAL8
-REAL16 REAL32 REAL96 REAL128 THROW
-
-
-(* additional pseudo-builtins for p1 Extensions to ISO *)
-
-BCD
-
-
-(* additional reserved words for XDS Extensions to ISO *)
-
-SEQ
-
-(* additional builtins for XDS Extensions to ISO *)
-
-ASH ASSERT DIFFADR_TYPE ENTIER INDEX LEN LONGCARD SHORTCARD SHORTINT
-
-(* additional pseudo-builtins for XDS Extensions to ISO *)
-
-(* SYSTEM *)
-PROCESS NEWPROCESS BOOL8 BOOL16 BOOL32 CARD8 CARD16 CARD32 INT8 INT16 INT32
-REF MOVE FILL GET PUT CC int unsigned size_t void
-
-(* COMPILER *)
-COMPILER OPTION EQUATION
-
-
-(* end of file *) \ No newline at end of file
diff --git a/tests/examplefiles/moin_SyntaxReference.txt b/tests/examplefiles/moin_SyntaxReference.txt
deleted file mode 100644
index a88fea4c..00000000
--- a/tests/examplefiles/moin_SyntaxReference.txt
+++ /dev/null
@@ -1,340 +0,0 @@
-## Please edit system and help pages ONLY in the moinmaster wiki! For more
-## information, please see MoinMaster:MoinPagesEditorGroup.
-##master-page:Unknown-Page
-##master-date:Unknown-Date
-#acl MoinPagesEditorGroup:read,write,delete,revert All:read
-#format wiki
-#language en
-
-This page aims to introduce the most important elements of MoinMoin``'s syntax at a glance, showing first the markup verbatim and then how it is rendered by the wiki engine. Additionally, you'll find links to the relative help pages. Please note that some of the features depend on your configuration.
-
-= Table of Contents =
-{{{
-'''Contents''' (up to the 2nd level)
-[[TableOfContents(2)]]
-}}}
-'''Contents''' (up to the 2nd level)
-[[TableOfContents(2)]]
-
-= Headings =
-'''''see:''' HelpOnHeadlines''
-{{{
-= heading 1st level =
-== heading 2nd level ==
-=== heading 3rd level ===
-==== heading 4th level ====
-===== heading 5th level =====
-}}}
-= heading 1st level =
-== heading 2nd level ==
-=== heading 3rd level ===
-==== heading 4th level ====
-===== heading 5th level =====
-
-= Text Formatting =
-'''''see:''' HelpOnFormatting''
-{{{
- * ''emphasized (italics)''
- * '''boldface'''
- * '''''bold italics'''''
- * `monospace`
- * {{{source code}}}
- * __underline__
- * ,,sub,,script
- * ^super^script
- * ~-smaller-~
- * ~+larger+~
- * --(strike through)--
-}}}
- * ''emphasized (italics)''
- * '''boldface'''
- * '''''bold italics'''''
- * `monospace`
- * {{{source code}}}
- * __underline__
- * ,,sub,,script
- * ^super^script
- * ~-smaller-~
- * ~+larger+~
- * --(strike through)--
-
-= Hyperlinks =
-'''''see:''' HelpOnLinking''
-== Internal Links ==
-{{{
- * FrontPage
- * ["FrontPage"]
- * HelpOnEditing/SubPages
- * /SubPage
- * ../SiblingPage
- * [:FrontPage:named link]
- * [#anchorname]
- * [#anchorname description]
- * [wiki:Self:PageName#anchorname]
- * [wiki:Self:PageName#anchorname description]
- * attachment:filename.txt
-}}}
- * FrontPage
- * ["FrontPage"]
- * HelpOnEditing/SubPages
- * /SubPage
- * ../SiblingPage
- * [:FrontPage:named link]
- * [#anchorname]
- * [#anchorname description]
- * [wiki:Self:PageName#anchorname]
- * [wiki:Self:PageName#anchorname description]
- * attachment:filename.txt
-
-== External Links ==
-{{{
- * http://moinmoin.wikiwikiweb.de/
- * [http://moinmoin.wikiwikiweb.de/]
- * [http://moinmoin.wikiwikiweb.de/ MoinMoin Wiki]
- * [http://moinmoin.wikiwikiweb.de/wiki/moinmoin.png]
- * http://moinmoin.wikiwikiweb.de/wiki/moinmoin.png
- * [http://moinmoin.wikiwikiweb.de/wiki/moinmoin.png moinmoin.png]
- * MeatBall:InterWiki
- * wiki:MeatBall/InterWiki
- * [wiki:MeatBall/InterWiki]
- * [wiki:MeatBall/InterWiki InterWiki page on MeatBall]
- * [file://///servername/share/full/path/to/file/filename%20with%20spaces.txt link to file filename with spaces.txt]
- * user@example.com
-}}}
- * http://moinmoin.wikiwikiweb.de/
- * [http://moinmoin.wikiwikiweb.de/]
- * [http://moinmoin.wikiwikiweb.de/ MoinMoin Wiki]
- * [http://moinmoin.wikiwikiweb.de/wiki/moinmoin.png]
- * http://moinmoin.wikiwikiweb.de/wiki/moinmoin.png
- * [http://moinmoin.wikiwikiweb.de/wiki/moinmoin.png moinmoin.png]
- * MeatBall:InterWiki
- * wiki:MeatBall/InterWiki
- * [wiki:MeatBall/InterWiki]
- * [wiki:MeatBall/InterWiki InterWiki page on MeatBall]
- * [file://///servername/share/full/path/to/file/filename%20with%20spaces.txt link to file filename with spaces.txt]
- * user@example.com
-
-== Avoid or Limit Automatical Linking ==
-{{{
- * Wiki''''''Name
- * Wiki``Name
- * !WikiName
- * WikiName''''''s
- * WikiName``s
- * `http://www.example.com`
-}}}
- * Wiki''''''Name
- * Wiki``Name
- * !WikiName
- * WikiName''''''s
- * WikiName``s
- * `http://www.example.com`
-
-= Blockquotes and Indentions =
-{{{
- indented text
- text indented to the 2nd level
-}}}
- indented text
- text indented to the 2nd level
-
-= Lists =
-'''''see:''' HelpOnLists''
-== Unordered Lists ==
-{{{
- * item 1
-
- * item 2 (preceding white space)
- * item 2.1
- * item 2.1.1
- * item 3
- . item 3.1 (bulletless)
- . item 4 (bulletless)
- * item 4.1
- . item 4.1.1 (bulletless)
-}}}
- * item 1
-
- * item 2 (preceding white space)
- * item 2.1
- * item 2.1.1
- * item 3
- . item 3.1 (bulletless)
- . item 4 (bulletless)
- * item 4.1
- . item 4.1.1 (bulletless)
-
-== Ordered Lists ==
-=== with Numbers ===
-{{{
- 1. item 1
- 1. item 1.1
- 1. item 1.2
- 1. item 2
-}}}
- 1. item 1
- 1. item 1.1
- 1. item 1.2
- 1. item 2
-
-=== with Roman Numbers ===
-{{{
- I. item 1
- i. item 1.1
- i. item 1.2
- I. item 2
-}}}
- I. item 1
- i. item 1.1
- i. item 1.2
- I. item 2
-
-=== with Letters ===
-{{{
- A. item A
- a. item A. a)
- a. item A. b)
- A. item B
-}}}
- A. item A
- a. item A. a)
- a. item A. b)
- A. item B
-
-== Definition Lists ==
-{{{
- term:: definition
- object:: description 1
- :: description 2
- Action Items::
- :: First Item
- :: Second Item
-}}}
- term:: definition
- object:: description 1
- :: description 2
- Action Items::
- :: First Item
- :: Second Item
-
-= Horizontal Rules =
-'''''see:''' HelpOnRules''
-{{{
-----
------
-------
--------
---------
----------
-----------
-}}}
-----
------
-------
--------
---------
----------
-----------
-
-= Tables =
-'''''see:''' HelpOnTables''
-== Tables ==
-{{{
-||'''A'''||'''B'''||'''C'''||
-||1 ||2 ||3 ||
-}}}
-||'''A'''||'''B'''||'''C'''||
-||1 ||2 ||3 ||
-
-== Cell Width ==
-{{{
-||minimal width ||<99%>maximal width ||
-}}}
-||minimal width ||<99%>maximal width ||
-
-== Spanning Rows and Columns ==
-{{{
-||<|2> cell spanning 2 rows ||cell in the 2nd column ||
-||cell in the 2nd column of the 2nd row ||
-||<-2> cell spanning 2 columns ||
-||||use empty cells as a shorthand ||
-}}}
-||<|2> cell spanning 2 rows ||cell in the 2nd column ||
-||cell in the 2nd column of the 2nd row ||
-||<-2> cell spanning 2 columns ||
-||||use empty cells as a shorthand ||
-
-== Alignment of Cell Contents ==
-{{{
-||<^|3> top (combined) ||<:99%> center (combined) ||<v|3> bottom (combined) ||
-||<)> right ||
-||<(> left ||
-}}}
-||<^|3> top (combined) ||<:99%> center (combined) ||<v|3> bottom (combined) ||
-||<)> right ||
-||<(> left ||
-
-== Coulored Table Cells ==
-{{{
-||<#0000FF> blue ||<#00FF00> green ||<#FF0000> red ||
-||<#00FFFF> cyan ||<#FF00FF> magenta ||<#FFFF00> yellow ||
-}}}
-||<#0000FF> blue ||<#00FF00> green ||<#FF0000> red ||
-||<#00FFFF> cyan ||<#FF00FF> magenta ||<#FFFF00> yellow ||
-
-== HTML-like Options for Tables ==
-{{{
-||A ||<rowspan="2"> like <|2> ||
-||<bgcolor="#00FF00"> like <#00FF00> ||
-||<colspan="2"> like <-2>||
-}}}
-||A ||<rowspan="2"> like <|2> ||
-||<bgcolor="#00FF00"> like <#00FF00> ||
-||<colspan="2"> like <-2>||
-
-= Macros and Variables =
-== Macros ==
-'''''see:''' HelpOnMacros''
- * `[[Anchor(anchorname)]]` inserts a link anchor `anchorname`
- * `[[BR]]` inserts a hard line break
- * `[[FootNote(Note)]]` inserts a footnote saying `Note`
- * `[[Include(HelpOnMacros/Include)]]` inserts the contents of the page `HelpOnMacros/Include` inline
- * `[[MailTo(user AT example DOT com)]]` obfuscates the email address `user@example.com` to users not logged in
-
-== Variables ==
-'''''see:''' HelpOnVariables''
- * `@``SIG``@` inserts your login name and timestamp of modification
- * `@``TIME``@` inserts date and time of modification
-
-= Smileys and Icons =
-'''''see:''' HelpOnSmileys''
-[[ShowSmileys]]
-
-= Source code =
-'''''see:''' HelpOnParsers''
-== Verbatim Display ==
-{{{
-{ { {
-def hello():
- print "Hello World!"
-} } }
-}}}
-/!\ Remove spaces between "`{ { {`" and "`} } }`".
-{{{
-def hello():
- print "Hello World!"
-}}}
-
-== Syntax Highlighting ==
-{{{
-{ { {#!python
-def hello():
- print "Hello World!"
-} } }
-}}}
-/!\ Remove spaces between "`{ { {`" and "`} } }`".
-{{{#!python
-def hello():
- print "Hello World!"
-}}}
-
diff --git a/tests/examplefiles/multiline_regexes.rb b/tests/examplefiles/multiline_regexes.rb
deleted file mode 100644
index 1b1e7612..00000000
--- a/tests/examplefiles/multiline_regexes.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-/
-this is a
-multiline
-regex
-/
-
-this /is a
-multiline regex too/
-
-foo = /is also
-one/
-
-also /4
-is one/
-
-this(/
-too
-/)
-
-# this not
-2 /4
-asfsadf/
-
-# this is also not one
-0x4d /25
-foo/
-
-42 and /this
-is also a multiline
-regex/
-
-
-# And here some special string cases
-foo = % blah # comment here to ensure whitespace
-foo(% blah )
-foo << % blah # stupid but has to work
-foo = % blah + % blub # wicked
-foo = %q wicked # works too
diff --git a/tests/examplefiles/nanomsg.intr b/tests/examplefiles/nanomsg.intr
deleted file mode 100644
index d21f62cc..00000000
--- a/tests/examplefiles/nanomsg.intr
+++ /dev/null
@@ -1,95 +0,0 @@
-module: nanomsg
-synopsis: generated bindings for the nanomsg library
-author: Bruce Mitchener, Jr.
-copyright: See LICENSE file in this distribution.
-
-define simple-C-mapped-subtype <C-buffer-offset> (<C-char*>)
- export-map <machine-word>, export-function: identity;
-end;
-
-define interface
- #include {
- "sp/sp.h",
- "sp/fanin.h",
- "sp/inproc.h",
- "sp/pair.h",
- "sp/reqrep.h",
- "sp/survey.h",
- "sp/fanout.h",
- "sp/ipc.h",
- "sp/pubsub.h",
- "sp/tcp.h"
- },
-
- exclude: {
- "SP_HAUSNUMERO",
- "SP_PAIR_ID",
- "SP_PUBSUB_ID",
- "SP_REQREP_ID",
- "SP_FANIN_ID",
- "SP_FANOUT_ID",
- "SP_SURVEY_ID"
- },
-
- equate: {"char *" => <c-string>},
-
- rename: {
- "sp_recv" => %sp-recv,
- "sp_send" => %sp-send,
- "sp_setsockopt" => %sp-setsockopt
- };
-
- function "sp_version",
- output-argument: 1,
- output-argument: 2,
- output-argument: 3;
-
- function "sp_send",
- map-argument: { 2 => <C-buffer-offset> };
-
- function "sp_recv",
- map-argument: { 2 => <C-buffer-offset> };
-
-end interface;
-
-// Function for adding the base address of the repeated slots of a <buffer>
-// to an offset and returning the result as a <machine-word>. This is
-// necessary for passing <buffer> contents across the FFI.
-
-define function buffer-offset
- (the-buffer :: <buffer>, data-offset :: <integer>)
- => (result-offset :: <machine-word>)
- u%+(data-offset,
- primitive-wrap-machine-word
- (primitive-repeated-slot-as-raw
- (the-buffer, primitive-repeated-slot-offset(the-buffer))))
-end function;
-
-define inline function sp-send (socket :: <integer>, data :: <buffer>, flags :: <integer>) => (res :: <integer>)
- %sp-send(socket, buffer-offset(data, 0), data.size, flags)
-end;
-
-define inline function sp-recv (socket :: <integer>, data :: <buffer>, flags :: <integer>) => (res :: <integer>)
- %sp-recv(socket, buffer-offset(data, 0), data.size, flags);
-end;
-
-define inline method sp-setsockopt (socket :: <integer>, level :: <integer>, option :: <integer>, value :: <integer>)
- with-stack-structure (int :: <C-int*>)
- pointer-value(int) := value;
- let setsockopt-result =
- %sp-setsockopt(socket, level, option, int, size-of(<C-int*>));
- if (setsockopt-result < 0)
- // Check error!
- end;
- setsockopt-result
- end;
-end;
-
-define inline method sp-setsockopt (socket :: <integer>, level :: <integer>, option :: <integer>, data :: <byte-string>)
- let setsockopt-result =
- %sp-setsockopt(socket, level, option, as(<c-string>, data), data.size);
- if (setsockopt-result < 0)
- // Check error!
- end;
- setsockopt-result
-end;
diff --git a/tests/examplefiles/nasm_aoutso.asm b/tests/examplefiles/nasm_aoutso.asm
deleted file mode 100644
index 9fd9727e..00000000
--- a/tests/examplefiles/nasm_aoutso.asm
+++ /dev/null
@@ -1,96 +0,0 @@
-; test source file for assembling to NetBSD/FreeBSD a.out shared library
-; build with:
-; nasm -f aoutb aoutso.asm
-; ld -Bshareable -o aoutso.so aoutso.o
-; test with:
-; cc -o aoutso aouttest.c aoutso.so
-; ./aoutso
-
-; This file should test the following:
-; [1] Define and export a global text-section symbol
-; [2] Define and export a global data-section symbol
-; [3] Define and export a global BSS-section symbol
-; [4] Define a non-global text-section symbol
-; [5] Define a non-global data-section symbol
-; [6] Define a non-global BSS-section symbol
-; [7] Define a COMMON symbol
-; [8] Define a NASM local label
-; [9] Reference a NASM local label
-; [10] Import an external symbol
-; [11] Make a PC-relative call to an external symbol
-; [12] Reference a text-section symbol in the text section
-; [13] Reference a data-section symbol in the text section
-; [14] Reference a BSS-section symbol in the text section
-; [15] Reference a text-section symbol in the data section
-; [16] Reference a data-section symbol in the data section
-; [17] Reference a BSS-section symbol in the data section
-
- BITS 32
- EXTERN __GLOBAL_OFFSET_TABLE_
- GLOBAL _lrotate:function ; [1]
- GLOBAL _greet:function ; [1]
- GLOBAL _asmstr:data _asmstr.end-_asmstr ; [2]
- GLOBAL _textptr:data 4 ; [2]
- GLOBAL _selfptr:data 4 ; [2]
- GLOBAL _integer:data 4 ; [3]
- EXTERN _printf ; [10]
- COMMON _commvar 4 ; [7]
-
- SECTION .text
-
-; prototype: long lrotate(long x, int num);
-_lrotate: ; [1]
- push ebp
- mov ebp,esp
- mov eax,[ebp+8]
- mov ecx,[ebp+12]
-.label rol eax,1 ; [4] [8]
- loop .label ; [9] [12]
- mov esp,ebp
- pop ebp
- ret
-
-; prototype: void greet(void);
-_greet push ebx ; we'll use EBX for GOT, so save it
- call .getgot
-.getgot: pop ebx
- add ebx,__GLOBAL_OFFSET_TABLE_ + $$ - .getgot wrt ..gotpc
- mov eax,[ebx+_integer wrt ..got] ; [14]
- mov eax,[eax]
- inc eax
- mov [ebx+localint wrt ..gotoff],eax ; [14]
- mov eax,[ebx+_commvar wrt ..got]
- push dword [eax]
- mov eax,[ebx+localptr wrt ..gotoff] ; [13]
- push dword [eax]
- mov eax,[ebx+_integer wrt ..got] ; [1] [14]
- push dword [eax]
- lea eax,[ebx+_printfstr wrt ..gotoff]
- push eax ; [13]
- call _printf wrt ..plt ; [11]
- add esp,16
- pop ebx
- ret
-
- SECTION .data
-
-; a string
-_asmstr db 'hello, world', 0 ; [2]
-.end
-
-; a string for Printf
-_printfstr db "integer==%d, localint==%d, commvar=%d"
- db 10, 0
-
-; some pointers
-localptr dd localint ; [5] [17]
-_textptr dd _greet wrt ..sym ; [15]
-_selfptr dd _selfptr wrt ..sym ; [16]
-
- SECTION .bss
-
-; an integer
-_integer resd 1 ; [3]
-
-; a local integer
-localint resd 1 ; [6]
diff --git a/tests/examplefiles/nasm_objexe.asm b/tests/examplefiles/nasm_objexe.asm
deleted file mode 100644
index dcae5eed..00000000
--- a/tests/examplefiles/nasm_objexe.asm
+++ /dev/null
@@ -1,30 +0,0 @@
-; Demonstration of how to write an entire .EXE format program as a .OBJ
-; file to be linked. Tested with the VAL free linker.
-; To build:
-; nasm -fobj objexe.asm
-; val objexe.obj,objexe.exe;
-; To test:
-; objexe
-; (should print `hello, world')
-
- segment code
-
-..start: mov ax,data
- mov ds,ax
- mov ax,stack
- mov ss,ax
- mov sp,stacktop
-
- mov dx,hello
- mov ah,9
- int 0x21
-
- mov ax,0x4c00
- int 0x21
-
- segment data
-hello: db 'hello, world', 13, 10, '$'
-
- segment stack stack
- resb 64
-stacktop:
diff --git a/tests/examplefiles/nemerle_sample.n b/tests/examplefiles/nemerle_sample.n
deleted file mode 100644
index 5236857d..00000000
--- a/tests/examplefiles/nemerle_sample.n
+++ /dev/null
@@ -1,87 +0,0 @@
-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)) ]>
- }
-}
diff --git a/tests/examplefiles/nginx_nginx.conf b/tests/examplefiles/nginx_nginx.conf
deleted file mode 100644
index 9dcdc8ab..00000000
--- a/tests/examplefiles/nginx_nginx.conf
+++ /dev/null
@@ -1,118 +0,0 @@
-
-#user nobody;
-worker_processes 1;
-
-#error_log logs/error.log;
-#error_log logs/error.log notice;
-#error_log logs/error.log info;
-
-#pid logs/nginx.pid;
-
-
-events {
- worker_connections 1024;
-}
-
-
-http {
- include mime.types;
- default_type application/octet-stream;
-
- log_format main '$remote_addr - $remote_user [$time_local] $request '
- '"$status" $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
-
- #access_log logs/access.log main;
-
- sendfile on;
- #tcp_nopush on;
-
- #keepalive_timeout 0;
- keepalive_timeout 65;
-
- #gzip on;
-
- server {
- listen 80;
- server_name localhost;
-
- charset koi8-r;
-
- #access_log logs/host.access.log main;
-
- location / {
- root html;
- index index.html index.htm;
- }
-
- #error_page 404 /404.html;
-
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
-
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
- #
- location ~ \.php$ {
- proxy_pass http://127.0.0.1;
- }
-
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- root html;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
- include fastcgi_params;
- }
-
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
- }
-
-
- # another virtual host using mix of IP-, name-, and port-based configuration
- #
- server {
- listen 8000;
- listen somename:8080;
- server_name somename alias another.alias;
-
- location / {
- root html;
- index index.html index.htm;
- }
- }
-
-
- # HTTPS server
- #
- server {
- listen 443;
- server_name localhost;
-
- ssl on;
- ssl_certificate cert.pem;
- ssl_certificate_key cert.key;
-
- ssl_session_timeout 5m;
-
- ssl_protocols SSLv2 SSLv3 TLSv1;
- ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
- ssl_prefer_server_ciphers on;
-
- location / {
- root html;
- index index.html index.htm;
- }
- }
-
-}
diff --git a/tests/examplefiles/noexcept.cpp b/tests/examplefiles/noexcept.cpp
deleted file mode 100644
index f83e50db..00000000
--- a/tests/examplefiles/noexcept.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-void* operator new (std::size_t size);
-void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) noexcept;
-void* operator new (std::size_t size, const std::nothrow_t& nothrow_value)noexcept;
-void* operator new (std::size_t size, const std::nothrow_t& nothrow_value);
-void* operator new (std::size_t size);
-void* operator new (std::size_t size) noexcept;
-void* operator new (std::size_t size)noexcept;
-
diff --git a/tests/examplefiles/numbers.c b/tests/examplefiles/numbers.c
deleted file mode 100644
index 80662ead..00000000
--- a/tests/examplefiles/numbers.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Some Number Test
- */
-
-int i = 24241424;
-float f1 = 342423423.24234;
-float f2 = 25235235.;
-float f3 = .234234;
-float f4 = 234243e+34343;
-float f5 = 24234e-234;
-int o = 0234;
-int h = 0x2342;
diff --git a/tests/examplefiles/objc_example.m b/tests/examplefiles/objc_example.m
deleted file mode 100644
index f3f85f65..00000000
--- a/tests/examplefiles/objc_example.m
+++ /dev/null
@@ -1,179 +0,0 @@
-// Test various types of includes
-#import <Foundation/Foundation.h>
-# import <AppKit/AppKit.h>
-#import "stdio.h"
-#\
- import \
- "stdlib.h"
-# /*line1*/ \
-import /* line 2 */ \
-"stdlib.h" // line 3
-
-// Commented out code with preprocessor
-#if 0
-#define MY_NUMBER 3
-#endif
-
- #\
- if 1
-#define TEST_NUMBER 3
-#endif
-
-// Empty preprocessor
-#
-
-// Class forward declaration
-@class MyClass;
-
-// Empty classes
-@interface EmptyClass
-@end
-@interface EmptyClass2
-{
-}
-@end
-@interface EmptyClass3 : EmptyClass2
-{
-}
-@end
-
-// Custom class inheriting from built-in
-@interface MyClass : NSObject
-{
-@public
- NSString *myString;
- __weak NSString *_weakString;
-@protected
- NSTextField *_textField;
-@private
- NSDate *privateDate;
-}
-
-// Various property aatributes
-@property(copy, readwrite, nonatomic) NSString *myString;
-@property(weak) NSString *weakString;
-@property(retain, strong, atomic) IBOutlet NSTextField *textField;
-
-// Class methods
-+ (void)classMethod1:(NSString *)arg;
-+ (void)classMethod2:(NSString *) arg; // Test space before arg
-
-@end
-
-typedef id B;
-
-#pragma mark MyMarker
-
-// MyClass.m
-// Class extension to declare private property
-@interface MyClass ()
-@property(retain) NSDate *privateDate;
-- (void)hiddenMethod;
-@end
-
-// Special category
-@interface MyClass (Special)
-@property(retain) NSDate *specialDate;
-@end
-
-@implementation MyClass
-@synthesize myString;
-@synthesize privateDate;
-
-- (id)a:(B)b {
- /**
- * C-style comment
- */
-
- // Selector keywords/types
- SEL someMethod = @selector(hiddenMethod);
-
- // Boolean types
- Boolean b1 = FALSE;
- BOOL b2 = NO;
- bool b3 = true;
-
- /**
- * Number literals
- */
- // Int Literal
- NSNumber *n1 = @( 1 );
- // Method call
- NSNumber *n2 = @( [b length] );
- // Define variable
- NSNumber *n3 = @( TEST_NUMBER );
- // Arthimetic expression
- NSNumber *n4 = @(1 + 2);
- // From variable
- int myInt = 5;
- NSNumber *n5 = @(myInt);
- // Nest expression
- NSNumber *n6 = @(1 + (2 + 6.0));
- // Bool literal
- NSNumber *n7 = @NO;
- // Bool expression
- NSNumber *n8 = @(YES);
- // Character
- NSNumber *n9 = @'a';
- // int
- NSNumber *n10 = @123;
- // unsigned
- NSNumber *n11 = @1234U;
- // long
- NSNumber *n12 = @1234567890L;
- // float
- NSNumber *n13 = @3.14F;
- // double
- NSNumber *n14 = @3.14F;
-
- // Array literals
- NSArray *arr = @[ @"1", @"2" ];
- arr = @[ @[ @"1", @"2" ], [arr lastObject] ];
- [arr lastObject];
- [@[ @"1", @"2" ] lastObject];
-
- // Dictionary literals
- NSDictionary *d = @{ @"key": @"value" };
- [[d allKeys] lastObject];
- [[@{ @"key": @"value" } allKeys] lastObject];
- d = @{ @"key": @{ @"key": @"value" } };
-
- [self hiddenMethod];
- [b length];
- [privateDate class];
-
- NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
- @"1", @"one", @"2", @"two", @"3", @"three", nil];
-
- NSString *key;
- for (key in dictionary) {
- NSLog(@"Number: %@, Word: %@", key, [dictionary valueForKey:key]);
- }
-
- // Blocks
- int (^myBlock)(int arg1, int arg2);
- NSString *(^myName)(NSString *) = ^(NSString *value) {
- return value;
- };
-
- return nil;
-}
-
-- (void)hiddenMethod {
- // Synchronized block
- @synchronized(self) {
- [myString retain];
- [myString release];
- }
-}
-
-+ (void)classMethod1:(NSString *)arg {}
-+ (void)classMethod2:(NSString *) arg
-{
- // Autorelease pool block
- @autoreleasepool {
- NSLog(@"Hello, World!");
- }
-}
-
-@end
diff --git a/tests/examplefiles/openedge_example b/tests/examplefiles/openedge_example
deleted file mode 100644
index e8c17e33..00000000
--- a/tests/examplefiles/openedge_example
+++ /dev/null
@@ -1,34 +0,0 @@
-{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.
diff --git a/tests/examplefiles/pacman.conf b/tests/examplefiles/pacman.conf
deleted file mode 100644
index 78dbf5e1..00000000
--- a/tests/examplefiles/pacman.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# /etc/pacman.conf
-#
-# This example file has no relation to `pacman.ijs`
-# but is of configuration of Arch Linux's package manager `pacman`.
-#
-
-#
-# GENERAL OPTIONS
-#
-[options]
-RootDir = /opt/local/site-private
-#DBPath = /var/lib/pacman/
-#CacheDir = /var/cache/pacman/pkg/
-LogFile = /opt/local/site-private/var/log/pacman.log
-#GPGDir = /etc/pacman.d/gnupg/
-HoldPkg = pacman
-#XferCommand = /usr/bin/curl -C - -f %u > %o
-XferCommand = /usr/local/bin/wget --passive-ftp -c -O %o %u
-#CleanMethod = KeepInstalled
-#UseDelta = 0.7
-Architecture = auto
-
-#IgnorePkg =
-#IgnoreGroup =
-
-NoUpgrade = etc/passwd etc/group etc/shadow
-NoUpgrade = etc/fstab
-#NoExtract =
-
-#UseSyslog
-Color
-#TotalDownload
-CheckSpace
-#VerbosePkgLists
-
-#SigLevel = Never
-SigLevel = Required DatabaseOptional
-LocalFileSigLevel = Optional
-RemoteFileSigLevel = Required
-
-Server = ftp://ftp9.yaphatchpotchgen.net/$repo/os/$arch
-
-[fubar32]
-Include = /etc/pacman.d/mirrorlist.fubar32 # comment is allowed here
-
-#[custom]
-#SigLevel = Optional TrustAll
-#Server = file:///home/custompkgs
diff --git a/tests/examplefiles/pacman.ijs b/tests/examplefiles/pacman.ijs
deleted file mode 100644
index f067b6e2..00000000
--- a/tests/examplefiles/pacman.ijs
+++ /dev/null
@@ -1,1107 +0,0 @@
-cocurrent 'jpacman'
-coinsert 'j'
-
-BASELIB=: 'base library'
-DATAMASK=: 0
-HWNDP=: ''
-ISGUI=: 0
-ONLINE=: 0
-PKGDATA=: 0 7$a:
-SECTION=: ,<'All'
-SYSNAME=: 'Package Manager'
-TIMEOUT=: 60
-WWWREV=: REV=: _1
-
-IgnoreIOS=: 0 : 0
-api/jni
-data/dbman
-data/ddmysql
-data/odbc
-demos/isigraph
-demos/wd
-demos/wdplot
-games/minesweeper
-games/nurikabe
-games/pousse
-games/solitaire
-general/pcall
-general/sfl
-graphics/d3
-graphics/fvj3
-graphics/gl2
-graphics/gnuplot
-graphics/graph
-graphics/graphviz
-graphics/jturtle
-graphics/print
-graphics/tgsj
-graphics/treemap
-graphics/viewmat
-gui/monthview
-gui/util
-ide/qt
-math/tabula
-media/animate
-media/gdiplus
-media/image3
-media/ming
-media/paint
-media/wav
-)
-
-Ignore=: 3 : 0''
-if. IFIOS do.
- <;._2 IgnoreIOS
-else.
- <'ide/ios'
-end.
-)
-3 : 0''
-nc=. '--no-cache'
-if. IFUNIX do.
- if. UNAME-:'Darwin' do.
- HTTPCMD=: 'curl -o %O --stderr %L -f -s -S %U'
- elseif. do.
- if. 'Android'-:UNAME do. nc=. ''
- else. try. nc=. nc #~ 1 e. nc E. shell 'wget --help' catch. nc=. '' end. end.
- HTTPCMD=: 'wget ',nc,' -O %O -o %L -t %t %U'
- end.
-else.
- if. fexist exe=. jpath '~tools/ftp/wget.exe' do. exe=. '"',exe,'"' else. exe=. 'wget.exe' end.
- try. nc=. nc #~ 1 e. nc E. shell exe,' --help' catch. nc=. '' end.
- HTTPCMD=: exe,' ',nc,' -O %O -o %L -t %t -T %T %U'
- if. fexist UNZIP=: jpath '~tools/zip/unzip.exe' do. UNZIP=: '"',UNZIP,'" -o -C ' else. UNZIP=: 'unzip.exe -o -C ' end.
-end.
-)
-setfiles=: 3 : 0
-ADDCFG=: jpath '~addons/config/'
-makedir ADDCFG
-ADDCFGIJS=: ADDCFG,'config.ijs'
-JRELEASE=: ({.~i.&'/') 9!:14''
-JRELEASE=: 'j802'
-LIBTREE=: readtree''
-if. IFIOS do.
- WWW=: '/jal/',JRELEASE,'/'
-else.
- WWW=: 'http://www.jsoftware.com/jal/',JRELEASE,'/'
-end.
-LIBVER=: jpath '~system/config/version.txt'
-)
-destroy=: codestroy
-CFGFILES=: <;._2 (0 : 0)
-addons.txt
-library.txt
-release.txt
-revision.txt
-zips.txt
-)
-LIBDESC=: 0 : 0
-This is the base library of scripts and labs included in the J system.
-
-Reinstalling or upgrading this library will overwrite files in the system subdirectory. Restart J afterwards.
-
-Files outside the system subdirectory, such as profile.ijs, are not changed.
-)
-cutjal=: ([: (* 4 > +/\) ' ' = ]) <;._1 ]
-cutjsp=: ([: (* 5 > +/\) ' ' = ]) <;._1 ]
-dquote=: '"'&, @ (,&'"')
-fname=: #~ ([: *./\. ~:&'/')
-hostcmd=: [: 2!:0 '(' , ] , ' || true)'"_
-ischar=: 2 = 3!:0
-rnd=: [ * [: <. 0.5 + %~
-sep2under=: '/' & (I.@('_' = ])})
-termLF=: , (0 < #) # LF -. {:
-todel=: ; @: (DEL&, @ (,&(DEL,' ')) each)
-tolist=: }. @ ; @: (LF&,@,@":each)
-isjpkgout=: ((4 = {:) *. 2 = #)@$ *. 1 = L.
-getintro=: ('...' ,~ -&3@[ {. ])^:(<#)
-info=: smoutput
-getnames=: 3 : 0
-select. L.y
-case. 0 do.
- if. +/ BASELIB E. y do.
- y=. (<BASELIB), cutnames y rplc BASELIB;''
- else.
- y=. cutnames y
- end.
-case. 1 do.
- if. 2 = #$y do.
- y=. {."1 y
- else.
- y=. ,y
- end.
-case. do.
- '' return.
-end.
-y
-)
-curtailcaption=: 3 : 0
-idx=. <_1;~I. 45<#&>{:"1 y
-y=. (45&getintro &.> idx{y) idx}y
-)
-deltree=: 3 : 0
-try.
- res=. 0< ferase {."1 dirtree y
- *./ res,0<ferase |.dirpath y
-catch. 0 end.
-)
-fixjal=: 3 : 0
-if. 2 > #y do. i.0 5 return. end.
-m=. _2 |. (LF,')',LF) E. y
-r=. _2 }. each m <;._2 y
-x=. r i.&> LF
-d=. (x+1) }.each r
-r=. x {.each r
-r=. 3 {."1 cutjal &> ' ' ,each r
-x=. d i.&> LF
-c=. x {.each d
-d=. (x+1) }.each d
-r,.c,.d
-)
-fixjal2=: 3 : 0
-if. 2 > #y do. i.0 2 return. end.
-cutjal &> ' ' ,each <;._2 y
-)
-fixjsp=: 3 : 0
-if. 2 > #y do. i.0 5 return. end.
-m=. _2 |. (LF,')',LF) E. y
-r=. _2 }. each m <;._2 y
-x=. r i.&> LF
-d=. (x+1) }.each r
-r=. x {.each r
-r=. ' ' ,each r
-(cutjsp &> r),.d
-)
-fixlib=: 3 : 0
-msk=. (<LIBTREE) = 1 {"1 y
-if. -. 1 e. msk do. ($0);'';0 return. end.
-'ver fln siz'=. 2 4 5 { (msk i.1) { y
-ver=. fixver ver
-ver;fln;siz
-)
-fixlibs=: 3 : 0
-if. 2 > #y do.
- i.0 6 return.
-end.
-fls=. <;._2 y
-ndx=. fls i.&> ' '
-siz=. <&> 0 ". (ndx+1) }.&> fls
-fls=. ndx {.each fls
-zps=. <;._2 &> fls ,each '_'
-pfm=. 3 {"1 zps
-uname=. tolower UNAME
-msk=. (uname -: ({.~ i.&'.')) &> pfm
-if. 1 ~: +/msk do. msk=. 1,~ }:0*.msk end.
-msk # zps,.fls,.siz
-)
-fixrev=: 3 : 0
-{. _1 ". :: _1: y -. CRLF
-)
-fixupd=: 3 : 0
-_1 ". :: _1: y -. CRLF
-)
-fixver=: 3 : 0
-if. ischar y do.
- y=. y -. CRLF
- y=. 0 ". ' ' (I. y='.') } y
-end.
-3 {. y
-)
-fixvers=: 3 : 0
-s=. $y
-y=. ,y
-3 {."1 [ 0 ". s $ ' ' (I. y e. './') } y
-)
-fmtjal=: 3 : 0
-if. 0 = #y do. '' return. end.
-r=. (4 {."1 y) ,each "1 ' ',LF2
-r=. <@; "1 r
-; r ,each ({:"1 y) ,each <')',LF
-)
-fmtjal2=: 3 : 0
-if. 0 = #y do. '' return. end.
-; (2 {."1 y) ,each "1 ' ',LF
-)
-fmtdep=: 3 : 0
-}. ; ',' ,each a: -.~ <;._2 y
-)
-fmtjsp=: 3 : 0
-if. 0 = #y do. '' return. end.
-r=. (4 {."1 y) ,each "1 ' ',LF
-r=. <@; "1 r
-; r ,each ({:"1 y) ,each <')',LF
-)
-fmtlib=: 3 : 0
-, 'q<.>,q<.>r<0>3.0,r<0>3.0' 8!:2 y
-)
-fmtver=: 3 : 0
-if. 0=#y do. '' return. end.
-if. ischar y do. y return. end.
-}. ; '.' ,each ": each y
-)
-fmtverlib=: 3 : 0
-fmtver y
-)
-fixzips=: 3 : 0
-if. 2 > #y do. i.0 5 return. end.
-fls=. <;._2 y
-ndx=. fls i.&> ' '
-siz=. 0 ". (ndx+1) }.&> fls
-fls=. ndx {.each fls
-zps=. <;._2 &> fls ,each '_'
-zps=. zps,.fls,.<&>siz
-pfm=. 3 {"1 zps
-and=. (1 e. 'android'&E.) &> pfm
-lnx=. (1 e. 'linux'&E.) &> pfm
-mac=. (1 e. 'darwin'&E.) &> pfm
-win=. mac < (1 e. 'win'&E.) &> pfm
-
-select. UNAME
-case. 'Win' do.
- zps=. win # zps
-case. 'Linux' do.
- zps=. lnx # zps
-case. 'Android' do.
- zps=. and # zps
-case. 'Darwin' do.
- zps=. mac # zps
- zps=. zps /: 3 {"1 zps
- zps=. (~: 3 {."1 zps) # zps
-end.
-
-bit=. IF64 pick '64';'32'
-pfm=. 3 {"1 zps
-exc=. (1 e. bit&E.) &> pfm
-zps=. zps \: exc
-zps=. (~: 3 {."1 zps) # zps
-fnm=. 0 {"1 zps
-lnm=. 1 {"1 zps
-ver=. 2 {"1 zps
-pfm=. 3 {"1 zps
-fls=. 4 {"1 zps
-siz=. 5 {"1 zps
-nms=. fnm ,each '/' ,each lnm
-pfm=. (pfm i.&> '.') {.each pfm
-ndx=. \: # &> pfm
-sort ndx { nms,.pfm,.ver,.fls,.siz
-)
-fwritenew=: 4 : 0
-if. x -: fread y do.
- 0
-else.
- x fwrite y
-end.
-)
-platformparent=: 3 : 0
-((< _2 {. y) e. '32';'64') # _2 }. y
-)
-makedir=: 1!:5 :: 0: @ <
-plural=: 4 : 0
-y,(1=x)#'s'
-)
-sizefmt=: 3 : 0
-select. +/ y >: 1e3 1e4 1e6 1e7 1e9
-case. 0 do.
- (": y), ' byte',(y~:1)#'s'
-case. 1 do.
- (": 0.1 rnd y%1e3),' KB'
-case. 2 do.
- (": 1 rnd y%1e3),' KB'
-case. 3 do.
- (": 0.1 rnd y%1e6),' MB'
-case. 4 do.
- (": 1 rnd y%1e6),' MB'
-case. do.
- (": 0.1 rnd y%1e9),' GB'
-end.
-)
-shellcmd=: 3 : 0
-if. IFUNIX do.
- hostcmd y
-else.
- spawn_jtask_ y
-end.
-)
-subdir=: 3 : 0
-if. 0=#y do. '' return. end.
-a=. 1!:0 y,'*'
-if. 0=#a do. '' return. end.
-a=. a #~ '-d' -:"1 [ 1 4 {"1 > 4 {"1 a
-(<y) ,each ({."1 a) ,each '/'
-)
-testaccess=: 3 : 0
-f=. <jpath'~install/testaccess.txt'
-try.
- '' 1!:2 f
- 1!:55 f
- 1
-catch.
- 0
-end.
-)
-toupper1=: 3 : 0
-if. 0=#y do. '' return. end.
-(toupper {. y),tolower }. y
-)
-unzip=: 3 : 0
-'file dir'=. dquote each y
-e=. 'Unexpected unzip error'
-if. IFUNIX do.
- notarcmd=. 0
- if. IFIOS +. UNAME-:'Android' do.
- notarcmd=. _1-: 2!:0 ::_1: 'which tar'
- if. (UNAME-:'Android') > '/mnt/sdcard'-:2!:5'EXTERNAL_STORAGE' do. notarcmd=. 1 end.
- end.
- if. notarcmd do.
- require 'tar'
- 'file dir'=. y
- if. (i.0 0) -: tar 'x';file;dir do. e=. '' end.
- else.
- e=. shellcmd 'tar ',((IFIOS+:UNAME-:'Android')#(('Darwin'-:UNAME){::'--no-same-owner --no-same-permissions';'-o -p')),' -xzf ',file,' -C ',dir
- end.
- if. (0~:FHS) *. ('root'-:2!:5'USER') +. (<2!:5'HOME') e. 0;'/var/root';'/root';'';,'/' do.
- shellcmd ::0: 'find ',dir,' -type d -exec chmod a+rx {} \+'
- shellcmd ::0: 'find ',dir,' -type f -exec chmod a+r {} \+'
- end.
-else.
- dir=. (_2&}. , '/' -.~ _2&{.) dir
- e=. shellcmd UNZIP,' ',file,' -d ',dir
-end.
-e
-)
-zipext=: 3 : 0
-y, IFUNIX pick '.zip';'.tar.gz'
-)
-CHECKADDONSDIR=: 0 : 0
-The addons directory does not exist and cannot be created.
-
-It is set to: XX.
-
-You can either create the directory manually, or set a new addons directory in your profile script.
-)
-CHECKASK=: 0 : 0
-Read catalog from the server using Internet connection now?
-
-Otherwise the local catalog is used offline.
-)
-CHECKONLINE=: 0 : 0
-An active Internet connection is needed to install packages.
-
-Continue only if you have an active Internet connection.
-
-OK to continue?
-)
-CHECKREADSVR=: 0 : 0
-An active Internet connection is needed to read the server repository catalog.
-
-Continue only if you have an active Internet connection.
-
-OK to continue?
-)
-CHECKSTARTUP=: 0 : 0
-Setup repository using Internet connection now?
-
-Select No if not connected, to complete setup later. After Setup is done, repository can be used offline with more options in Tools menu and Preferences dialog.
-)
-checkaccess=: 3 : 0
-if. testaccess'' do. 1 return. end.
-msg=. 'Unable to run Package Manager, as you do not have access to the installation folder.'
-if. IFWIN do.
- msg=. msg,LF2,'To run as Administrator, right-click the J icon, select Run as... and '
- msg=. msg,'then select Adminstrator.'
-end.
-info msg
-0
-)
-checkaddonsdir=: 3 : 0
-d=. jpath '~addons'
-if. # 1!:0 d do. 1 return. end.
-if. 1!:5 :: 0: <d do.
- log 'Created addons directory: ',d
- 1 return.
-end.
-info CHECKADDONSDIR rplc 'XX';d
-0
-)
-getonline=: 3 : 0
-ONLINE=: 2=3 2 wdquery y
-)
-getserver=: 3 : 0
-'rc p'=. httpgetr (WWW,'revision.txt');2
-if. rc do. 0 return. end.
-write_lastupdate''
-WWWREV=: fixrev p
-if. WWWREV = REV do. 1 return. end.
-refreshweb''
-)
-checkonline=: 3 : 0
-select. ReadCatalog_j_
-case. 0 do.
- if. REV >: 0 do.
- ONLINE=: 0
- log 'Using local copy of catalog. See Preferences to change the setting.'
- 1 return.
- end.
- if. 0 = getonline 'Read Catalog from Server';CHECKREADSVR do. 0 return. end.
-case. 1 do.
- ONLINE=: 1
-case. 2 do.
- if. REV >: 0 do.
- if. 0 = getonline 'Read Catalog from Server';CHECKASK do.
- log 'Using local copy of catalog. See Preferences to change the setting.'
- 1 return.
- end.
- else.
- if. 0 = getonline 'Setup Repository';CHECKSTARTUP do. 0 return. end.
- end.
-end.
-log 'Updating server catalog...'
-if. 0 = getserver'' do.
- ONLINE=: 0
- log 'Working offline using local copy of catalog.'
-else.
- log 'Done.'
-end.
-1
-)
-checkstatus=: 3 : 0
-if. 0 e. #LIBS do. '' return. end.
-msk=. masklib PKGDATA
-ups=. pkgups''
-libupm=. 1 e. msk *. ups
-msk=. -. msk
-addnim=. +/msk *. pkgnew''
-addupm=. +/msk *. pkgups''
-tot=. +/addnim,addupm,libupm
-if. 0 = tot do.
- 'All available packages are installed and up to date.' return.
-end.
-select. 0 < addnim,addupm
-case. 0 0 do.
- msg=. 'Addons are up to date.'
-case. 0 1 do.
- msg=. 'All addons are installed, ',(":addupm), ' can be upgraded.'
-case. 1 0 do.
- if. addnim = <:#PKGDATA do.
- msg=. 'No addons are installed.'
- else.
- j=. ' addon',('s'#~1<addnim),' are not yet installed.'
- msg=. 'Installed addons are up to date, ',(":addnim),j
- end.
-case. 1 1 do.
- j=. (":addupm),' addon',('s'#~1<addupm),' can be upgraded, '
- msg=. j,(":addnim), ' addon',('s'#~1<addnim),' are not yet installed.'
-end.
-if. 0 = libupm do.
- msg,LF,'The base library is up to date.'
-else.
- msg,LF,'There is a newer version of the base library.'
-end.
-)
-write_lastupdate=: 3 : 0
-txt=. ": 6!:0 ''
-txt fwrites ADDCFG,'lastupdate.txt'
-)
-checklastupdate=: 3 : 0
-if. _1 -: LASTUPD do.
- res=. 'has never been updated.'
-else.
- res=. 'was last updated: ',timestamp LASTUPD
-end.
-'Local JAL information ',res
-)
-getdepend=: 3 : 0
-if. 0 = #y do. y return. end.
-dep=. getdepend_console 1{"1 y
-PKGDATA #~ (1{"1 PKGDATA) e. dep
-)
-getdepend_console=: 3 : 0
-if. 0 = #y do. y return. end.
-old=. ''
-ids=. 1{"1 PKGDATA
-dep=. 6{"1 PKGDATA
-res=. ~. <;._1 ; ',' ,each (ids e. y) # dep
-whilst. -. res-:old do.
- old=. res
- res=. ~. res, <;._1 ; ',' ,each (ids e. res) # dep
-end.
-~. y, res -. a:, {."1 ADDINS
-)
-httpget=: 3 : 0
-'f t'=. 2 {. (boxxopen y),a:
-n=. f #~ -. +./\. f e. '=/'
-p=. jpath '~temp/',n
-q=. jpath '~temp/httpget.log'
-t=. ":{.t,3
-ferase p;q
-fail=. 0
-cmd=. HTTPCMD rplc '%O';(dquote p);'%L';(dquote q);'%t';t;'%T';(":TIMEOUT);'%U';f
-if. IFIOS +. UNAME-:'Android' do.
- require 'socket'
- 1!:55 ::0: <p
- rc=. 0 [ e=. pp=. ''
- whilst. 0 do.
- 'rc sk'=. sdsocket_jsocket_''
- if. 0~:rc do. break. end.
- rc=. sdconnect_jsocket_ sk;PF_INET_jsocket_;'23.21.67.48';80
- if. 0~:rc do. break. end.
- 'rc sent'=. ('GET ',f,' HTTP/1.0',LF2) sdsend_jsocket_ sk;0
- if. 0~:rc do. break. end.
- while. ((0=rc)*.(*#m)) [[ 'rc m'=. sdrecv_jsocket_ sk,4096 do.
- pp=. pp,m
- end.
- end.
- sdclose_jsocket_ sk
- if. 0~:rc do. fail=. 1
- elseif. 1 -.@e. '200 OK' E. (20{.pp) do. fail=. 1 [ e=. ({.~ i.&LF) pp
- elseif. #p1=. I. (CRLF,CRLF) E. 500{.pp do. p2=. 4
- elseif. #p1=. I. LF2 E. 500{.pp do. p2=. 2
- elseif. do. fail=. 1
- end.
- if. 0=fail do.
- ((p2+{.p1)}.pp) 1!:2 <p
- else.
- if. 0~:rc do. e=. sderror_jsocket_ rc end.
- end.
-elseif. do.
- try.
- e=. shellcmd cmd
- catch. fail=. 1 end.
-end.
-if. fail +. 0 >: fsize p do.
- if. _1-:msg=. freads q do.
- if. 0=#msg=. e do. msg=. 'Unexpected error' end. end.
- log 'Connection failed: ',msg
- info 'Connection failed:',LF2,msg
- r=. 1;msg
- ferase p;q
-else.
- r=. 0;p
- ferase q
-end.
-r
-)
-httpgetr=: 3 : 0
-res=. httpget y
-if. 0 = 0 pick res do.
- f=. 1 pick res
- txt=. freads f
- ferase f
- 0;txt
-end.
-)
-install=: 3 : 0
-dat=. getdepend y
-'num siz'=. pmview_applycounts dat
-many=. 1 < num
-msg=. 'Installing ',(":num),' package',many#'s'
-msg=. msg,' of ',(many#'total '),'size ',sizefmt siz
-log msg
-installdo 1 {"1 dat
-log 'Done.'
-readlocal''
-pacman_init 0
-)
-install_console=: 3 : 0
- if. -. init_console 'server' do. '' return. end.
- pkgs=. getnames y
- if. pkgs -: ,<'all' do. pkgs=. 1 {"1 PKGDATA end.
- pkgs=. pkgs (e. # [) ~. (<'base library'), ((pkgnew +. pkgups) # 1&{"1@]) PKGDATA
- pkgs=. pkgs -. Ignore
- pkgs=. getdepend_console pkgs
- if. 0 = num=. #pkgs do. '' return. end.
- many=. 1 < num
- msg=. 'Installing ',(":num),' package',many#'s'
- log msg
- installdo pkgs
- log 'Done.'
- readlocal''
- pacman_init ''
- checkstatus''
-)
-upgrade_console=: 3 : 0
- if. -. init_console 'read' do. '' return. end.
- pkgs=. getnames y
- if. (0=#pkgs) +. pkgs -: ,<'all' do. pkgs=. 1{"1 PKGDATA end.
- pkgs=. pkgs (e. # [) (pkgups # 1&{"1@])PKGDATA
- install_console pkgs
-)
-installdo=: 3 : 0
-msk=. -. y e. <BASELIB
-if. 0 e. msk do.
- install_library''
-end.
-install_addon each msk # y
-)
-install_addon=: 3 : 0
-ndx=. ({."1 ZIPS) i. <y
-if. ndx = #ZIPS do. EMPTY return. end.
-log 'Downloading ',y,'...'
-f=. 3 pick ndx { ZIPS
-'rc p'=. httpget WWW,'addons/',f
-if. rc do. return. end.
-log 'Installing ',y,'...'
-msg=. unzip p;jpath'~addons'
-ferase p
-if. 0>:fsize jpath'~addons/',y,'/manifest.ijs' do.
- log 'Extraction failed: ',msg
- info 'Extraction failed:',LF2,msg
- return.
-end.
-install_addins y
-install_config y
-)
-install_addins=: 3 :0
-fl=. ADDCFG,'addins.txt'
-ins=. fixjal2 freads fl
-ins=. ins #~ (<y) ~: {."1 ins
-ndx=. ({."1 ADDONS) i. <y
-ins=. sort ins, 2 {. ndx { ADDONS
-(fmtjal2 ins) fwrites fl
-)
-install_config=: 3 : 0
-ADDLABS=: ''
-0!:0 :: ] < ADDCFGIJS
-install_labs y
-write_config''
-)
-install_labs=: 3 : 0
-labs=. dirtree jpath '~addons/',y,'/*.ijt'
-if. 0=#labs do. return. end.
-pfx=. jpath '~addons/'
-labs=. (#pfx) }.each {."1 labs
-LABCATEGORY=: ''
-0!:0 ::] <jpath '~addons/',y,'/manifest.ijs'
-cat=. LABCATEGORY
-if. 0 = #cat do.
- cat=. toupper1 (y i. '/') {. y
-end.
-new=. labs ,each <' ',cat
-txt=. sort ~. new,<;._2 ADDLABS
-ndx=. 4 + (1 i.~ '.ijt'&E.) &> txt
-msk=. fexist &> (<pfx) ,each ndx {.each txt
-txt=. msk # txt
-ADDLABS=: ; txt ,each LF
-)
-install_library=: 3 : 0
-log 'Downloading base library...'
-f=. 1 pick LIB
-'rc p'=. httpget WWW,'library/',f
-if. rc do. return. end.
-log 'Installing base library...'
-unzip p;jpath'~system'
-ferase p
-readlin''
-)
-write_config=: 3 : 0
-txt=. 'NB. Addon configuration',LF2
-txt=. txt,'ADDLABS=: 0 : 0',LF,ADDLABS,')',LF
-txt fwrites ADDCFGIJS
-)
-show_console=: 4 : 0
- if. -. init_console 'read' do. '' return. end.
- select. x
- case. 'search' do.
- pkgs=. getnames y
- res=. (pkgsearch pkgs) # 1 2 3 4 {"1 PKGDATA
- res=. curtailcaption res
- case. 'show' do.
- pkgs=. getnames y
- if. pkgs -: ,<'all' do. pkgs=. 1 {"1 PKGDATA end.
- res=. (msk=. pkgshow pkgs) # 5 {"1 PKGDATA
- if. #res do.
- res=. ,((<'== '), &.> msk # 1 {"1 PKGDATA) ,. res
- res=. (2#LF) joinstring (70&foldtext)&.> res
- end.
- case. 'showinstalled' do.
- dat=. (isjpkgout y) {:: (1 2 3 4 {"1 PKGDATA);<y
- res=. (-.@pkgnew # ])dat
- res=. curtailcaption res
- case. 'shownotinstalled' do.
- dat=. (isjpkgout y) {:: (1 2 3 4 {"1 PKGDATA);<y
- res=. (pkgnew # 0 2 3&{"1@])dat
- res=. curtailcaption res
- case. 'showupgrade' do.
- dat=. (isjpkgout y) {:: (1 2 3 4 {"1 PKGDATA);<y
- res=. (pkgups # ])dat
- res=. curtailcaption res
- case. 'status' do.
- res=. checklastupdate''
- res=. res,LF,checkstatus''
- end.
- res
-)
-showfiles_console=: 4 : 0
- if. -. init_console 'read' do. '' return. end.
- pkgs=. getnames y
- pkgs=. pkgs (e. # [) (-.@pkgnew # 1&{"1@]) PKGDATA
- pkgs=. pkgs -. <BASELIB
- if. 0=#pkgs do. '' return. end.
- fn=. (<'~addons/') ,&.> (pkgs) ,&.> <'/',x,(x-:'history'){::'.ijs';'.txt'
- res=. res #~ msk=. (<_1) ~: res=. fread@jpath &.> fn
- if. #res do.
- res=. ,((<'== '), &.> msk#pkgs) ,. res
- res=. (2#LF) joinstring res
- end.
-)
-remove_console=: 3 : 0
- if. -. init_console 'edit' do. '' return. end.
- pkgs=. getnames y
- if. pkgs -: ,<'all' do. pkgs=. 1 {"1 PKGDATA end.
- pkgs=. pkgs (e. # [) (-.@pkgnew # 1&{"1@]) PKGDATA
- pkgs=. pkgs -. <BASELIB
- if. 0 = num=. #pkgs do. '' return. end.
- many=. 1 < num
- msg=. 'Removing ',(":num),' package',many#'s'
- log msg
- remove_addon each pkgs
- log 'Done.'
- readlocal''
- pacman_init ''
- checkstatus''
-)
-
-remove_addon=: 3 : 0
- log 'Removing ',y,'...'
- treepath=. jpath '~addons/',y
- if. ((0 < #@dirtree) *. -.@deltree) treepath do.
- nf=. #dirtree treepath
- nd=. <: # dirpath treepath
- nd=. nd + (tolower treepath) e. dirpath jpath '~addons/', '/' taketo y
- msg=. (":nd),' directories and ',(":nf),' files not removed.'
- log 'Remove failed: ',msg
- info 'Remove failed:',LF2,msg
- return.
- end.
- remove_addins y
- remove_config y
-)
-remove_addins=: 3 :0
- fl=. ADDCFG,'addins.txt'
- ins=. fixjal2 freads fl
- ins=. ins #~ (<y) ~: {."1 ins
- (fmtjal2 ins) fwrites fl
-)
-remove_config=: 3 : 0
- ADDLABS=: ''
- 0!:0 :: ] < ADDCFGIJS
- remove_labs y
- write_config''
-)
-remove_labs=: 3 : 0
- txt=. <;._2 ADDLABS
- txt=. txt #~ (<jpathsep y) ~: (#y)&{. each txt
- ADDLABS=: ; txt ,each LF
-)
-LOG=: 1
-log=: 3 : 0
-if. LOG do. smoutput y end.
-)
-logstatus=: 3 : 0
-if. ONLINE do.
- log checkstatus''
-end.
-)
-readlin=: 3 : 0
-LIN=: 6 1 1 >. fixver freads LIBVER
-)
-readlocal=: 3 : 0
-readlin''
-ADDONS=: fixjal freads ADDCFG,'addons.txt'
-ADDINS=: fixjal2 freads ADDCFG,'addins.txt'
-REV=: fixrev freads ADDCFG,'revision.txt'
-LASTUPD=: fixupd freads ADDCFG,'lastupdate.txt'
-LIBS=: fixlibs freads ADDCFG,'library.txt'
-LIB=: fixlib LIBS
-ZIPS=: fixzips freads ADDCFG,'zips.txt'
-EMPTY
-)
-readtree=: 3 : 0
-f=. ADDCFG,'tree.txt'
-tree=. LF -.~ freads f
-if. -. (<tree) e. 'current';'stable' do.
- tree=. 'current'
- writetree tree
-end.
-tree
-)
-writetree=: 3 : 0
-y fwritenew ADDCFG,'tree.txt'
-)
-refreshweb=: 3 : 0
-if. 0 = refreshjal'' do. 0 return. end.
-readlocal''
-1
-)
-refreshaddins=: 3 : 0
-ADDLABS=: ''
-f=. ADDCFG,'addins.txt'
-p=. jpath '~addons/'
-sd=. ;subdir each subdir p
-if. 0=#sd do.
- '' fwrite f
- write_config'' return.
-end.
-r=. s=. ''
-for_d. sd do.
- mft=. freads (>d),'manifest.ijs'
- if. mft -: _1 do. continue. end.
- VERSION=: ''
- 0!:100 mft
- ver=. fmtver fixver VERSION
- n=. }: (#p) }. >d
- n=. '/' (I.n='\') } n
- r=. r,n,' ',ver,LF
- s=. s,d
-end.
-r fwritenew f
-s=. (#p) }.each }: each s
-install_labs each s
-write_config''
-)
-refreshjal=: 3 : 0
-'rc p'=. httpget WWW,zipext 'jal'
-if. rc do. 0 return. end.
-unzip p;ADDCFG
-ferase p
-if. *./ CFGFILES e. {."1 [ 1!:0 ADDCFG,'*' do. 1 return. end.
-msg=. 'Could not install the local repository catalog.'
-log msg
-info msg
-0
-)
-updatejal=: 3 : 0
- log 'Updating server catalog...'
- if. -. init_console 'server' do. '' return. end.
- refreshaddins''
- readlocal''
- pacman_init''
- res=. checklastupdate''
- res,LF,checkstatus''
-)
-RELIBMSG=: 0 : 0
-You are now using the XX base library, and can switch to the YY base library.
-
-This will download the YY version of the base library and overwrite existing files. Addons are not affected.
-
-OK to switch to the YY library?
-)
-prelib=: 3 : 0
-old=. LIBTREE
-new=. (('stable';'current') i. <old) pick 'current';'beta'
-msg=. RELIBMSG rplc ('XX';'YY'),.old;new
-if. 0 = query SYSNAME;msg do.
- info 'Not done.' return.
-end.
-switchlibrary 1 pick new
-)
-switchlibrary=: 3 : 0
-'' fwrite LIBVER
-writetree LIBTREE=: y
-refreshjal''
-readlocal''
-pmview_setpn''
-)
-masklib=: 3 : 0
-(1 {"1 y) = <BASELIB
-)
-pkglater=: 3 : 0
-dat=. (s=.isjpkgout y){:: PKGDATA;<y
-if. 0=#dat do. $0 return. end.
-loc=. fixvers > (2-s) {"1 dat
-srv=. fixvers > (3-s) {"1 dat
-{."1 /:"2 srv ,:"1 loc
-)
-pkgnew=: 3 : 0
-dat=. (s=.isjpkgout y){:: PKGDATA;<y
-if. 0=#dat do. $0 return. end.
-0 = # &> (2-s) {"1 dat
-)
-pkgups=: pkgnew < pkglater
-pkgsearch=: 3 : 0
- +./"1 +./ y E."1&>"(0 _) 1{"1 PKGDATA
-)
-pkgshow=: 3 : 0
- y e.~ 1{"1 PKGDATA
-)
-setshowall=: 3 : 0
-PKGDATA=: (<y) (<(I.DATAMASK);0) } PKGDATA
-)
-setshownew=: 3 : 0
-ndx=. I. DATAMASK *. pkgnew''
-PKGDATA=: (<y) (<ndx;0) } PKGDATA
-)
-setshowups=: 3 : 0
-ndx=. I. DATAMASK *. pkgups''
-PKGDATA=: (<y) (<ndx;0) } PKGDATA
-)
-splitlib=: 3 : 0
-if. 0=#y do.
- 2 $ <y return.
-end.
-msk=. masklib y
-(msk#y) ; <(-.msk)#y
-)
-pacman_init=: 3 : 0
-dat=. ADDONS #~ ({."1 ADDONS) e. {."1 ZIPS
-if. 0=#dat do.
- dat=. i.0 6
-else.
- ndx=. ({."1 ADDINS) i. {."1 dat
- ins=. ndx { (1 {"1 ADDINS),<''
- dat=. dat,.<''
- dat=. 0 5 1 3 4 2 {"1 dat
- dat=. ins 1 }"0 1 dat
-end.
-lib=. 'base library';(fmtver LIN);(fmtver 0 pick LIB);'base library scripts';LIBDESC;''
-dat=. dat,lib
-dat=. (<0),.dat
-PKGDATA=: sort dat
-nms=. 1 {"1 PKGDATA
-nms=. ~. (nms i.&> '/') {.each nms
-SECTION=: 'All';nms
-DATAMASK=: (#PKGDATA) $ 1
-EMPTY
-)
-init_console=: 3 : 0
- if. 0=#y do. y=. 'read' end.
- select. y
- fcase. 'edit';'server' do.
- if. -. checkaccess'' do. 0 return. end.
- case. 'read' do.
- if. -. checkaddonsdir'' do. 0 return. end.
- setfiles''
- readlocal''
- pacman_init ''
- res=. 1
- case. do. res=. 0
- end.
- if. y -: 'server' do. res=. getserver'' end.
- res
-)
-jpkg=: 4 : 0
- select. x
- case. 'history';'manifest' do.
- x showfiles_console y
- case. 'install' do.
- install_console y
- case. 'reinstall' do.
- remove_console y
- install_console y
- case. 'remove' do.
- remove_console y
- case. ;:'show search showinstalled shownotinstalled showupgrade status' do.
- x show_console y
- case. 'update' do.
- updatejal ''
- case. 'upgrade' do.
- upgrade_console y
- case. do.
- msg=. 'Valid options are:',LF
- msg=. msg,' history, install, manifest, remove, reinstall, show, search,',LF
- msg=. msg,' showinstalled, shownotinstalled, showupgrade, status,',LF
- msg,' update, upgrade'
- end.
-)
-do_install=: 3 : 0
-if. -. checkaccess_jpacman_ '' do. return. end.
-'update' jpkg ''
-select. y
-case. 'qtide';'angle' do.
- 'install' jpkg 'base library ide/qt'
- getqtbin (y-:'angle'){::0;'angle'
- msg=. (+/ 2 1 * IFWIN,'Darwin'-:UNAME) pick 'jqt.sh';'the jqt icon';'jqt.cmd'
- smoutput 'exit and restart J using ',msg
-case. 'all' do.
- 'install' jpkg 'all'
- getqtbin 0
-end.
-)
-do_getqtbin=: 3 : 0
-smoutput 'Installing JQt binaries...'
-if. 'Linux'-:UNAME do.
- if. IFRASPI do.
- z=. 'jqt-raspi-32.tar.gz'
- else.
- z=. 'jqt-',((y-:'slim') pick 'linux';'slim'),'-',(IF64 pick 'x86';'x64'),'.tar.gz'
- end.
- z1=. 'libjqt.so'
-elseif. IFWIN do.
- z=. 'jqt-win',((y-:'slim')#'slim'),'-',(IF64 pick 'x86';'x64'),'.zip'
- z1=. 'jqt.dll'
-elseif. do.
- z=. 'jqt-mac',((y-:'slim')#'slim'),'-',(IF64 pick 'x86';'x64'),'.zip'
- z1=. 'libjqt.dylib'
-end.
-'rc p'=. httpget_jpacman_ 'http://www.jsoftware.com/download/j802/qtide/',z
-if. rc do.
- smoutput 'unable to download: ',z return.
-end.
-d=. jpath '~bin'
-if. IFWIN do.
- unzip_jpacman_ p;d
-else.
- if. 'Linux'-:UNAME do.
- if. (0~:FHS) do.
- if. IFRASPI do.
- d1=. '/usr/lib/arm-linux-gnueabihf/.'
- elseif. IF64 do.
- d1=. '/usr/lib/x86_64-linux-gnu/.'
- elseif. do.
- d1=. '/usr/lib/i386-linux-gnu/.'
- end.
- hostcmd_jpacman_ 'cd /usr/bin && tar --no-same-owner --no-same-permissions -xzf ',(dquote p), ' && chmod 755 jqt && chmod 644 libjqt.so && mv libjqt.so ',d1
- else.
- hostcmd_jpacman_ 'cd ',(dquote d),' && tar xzf ',(dquote p)
- end.
- else.
- hostcmd_jpacman_ 'unzip -o ',(dquote p),' -d ',dquote d
- end.
-end.
-ferase p
-if. #1!:0 ((0~:FHS)*.'Linux'-:UNAME){::(jpath '~bin/',z1);'/usr/bin/jqt' do.
- m=. 'Finished install of JQt binaries.'
-else.
- m=. 'Unable to install JQt binaries.',LF
- m=. m,'check that you have write permission for: ',LF,((0~:FHS)*.'Linux'-:UNAME){::(jpath '~bin');'/usr/bin'
-end.
-smoutput m
-if. 'Linux'-:UNAME do. return. end.
-
-tgt=. jpath IFWIN{::'~install/Qt';'~bin/Qt5Core.dll'
-y=. (*#y){::0;y
-smoutput 'Installing Qt library...'
-if. IFWIN do.
- z=. 'qt53-',((y-:'angle') pick 'win';'angle'),'-',((y-:'slim')#'slim-'),(IF64 pick 'x86';'x64'),'.zip'
-else.
- z=. 'qt53-mac-',((y-:'slim')#'slim-'),(IF64 pick 'x86';'x64'),'.zip'
-end.
-'rc p'=. httpget_jpacman_ 'http://www.jsoftware.com/download/j802/qtlib/',z
-if. rc do.
- smoutput 'unable to download: ',z return.
-end.
-d=. jpath IFWIN{::'~install';'~bin'
-if. IFWIN do.
- unzip_jpacman_ p;d
-else.
- hostcmd_jpacman_ 'unzip -o ',(dquote p),' -d ',dquote d
-end.
-ferase p
-if. #1!:0 tgt do.
- m=. 'Finished install of Qt binaries.'
-else.
- m=. 'Unable to install Qt binaries.',LF
- m=. m,'check that you have write permission for: ',LF,IFWIN{::tgt;jpath'~bin'
-end.
-smoutput m
-
-)
-jpkg_z_=: 3 : 0
- 'help' jpkg y
- :
- a=. conew 'jpacman'
- res=. x jpkg__a y
- destroy__a''
- res
-)
-jpkgv_z_=: (<@:>"1@|:^:(0 ~: #))@jpkg \ No newline at end of file
diff --git a/tests/examplefiles/pawn_example b/tests/examplefiles/pawn_example
deleted file mode 100644
index ee2ecca2..00000000
--- a/tests/examplefiles/pawn_example
+++ /dev/null
@@ -1,25 +0,0 @@
-{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 */
-
-CREATE ttNames.
-ASSIGN ttNames.cName = {&MY_NAME}.
-
-FOR EACH ttNames:
- MESSAGE "Hello, " + ttNames.cName + '!' VIEW-AS ALERT-BOX.
-END.
diff --git a/tests/examplefiles/perl_misc b/tests/examplefiles/perl_misc
deleted file mode 100644
index e6dbfb28..00000000
--- a/tests/examplefiles/perl_misc
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/perl
-
-# from http://gist.github.com/485595
-use strict;
-use warnings;
-use Time::HiRes 'usleep';
-
-for (1..5) {
- open my $in, '<', '/proc/sys/kernel/random/entropy_avail' or die;
- print <$in>;
- close $in;
- usleep 100_000;
-}
-
-# other miscellaneous tests of numbers separated by _
-#usleep 100_000;
-100_000_000;
-my $nichts = 0.005_006;
-print "$nichts\n";
-my $nichts2 = 0.005_006_007;
-print 900_800_700.005_006_007, $/;
-
-# numbers from `man 1 perlnumber`
-my $n;
-$n = 1234; # decimal integer
-$n = 0b1110011; # binary integer
-$n = 01234; # octal integer
-$n = 0x1234; # hexadecimal integer
-$n = 12.34e-56; # exponential notation
-$n = "-12.34e56"; # number specified as a string
-$n = "1234"; # number specified as a string
-
-# other numbers
-for (
- -9876,
- +8765,
- -9876.02,
- -9876.02e+10,
- +765_432e30,
- 2002.,
- .2002,
-) {
- print $_, "\n";
-}
-
-# operators on numbers
-for (
- $n + 300,
- $n - 300,
- $n / 300 + 10,
- $n * 250 / 2.0,
- $n == 100,
- $n != 100,
- $n > 100,
- $n >= 100,
- $n < 100,
- $n <= 100,
- $n % 2,
- abs $n,
-) {
- print $_, "\n";
-}
diff --git a/tests/examplefiles/perl_perl5db b/tests/examplefiles/perl_perl5db
deleted file mode 100644
index ab9d5e30..00000000
--- a/tests/examplefiles/perl_perl5db
+++ /dev/null
@@ -1,998 +0,0 @@
-
-=head1 NAME
-
-perl5db.pl - the perl debugger
-
-=head1 SYNOPSIS
-
- perl -d your_Perl_script
-
-=head1 DESCRIPTION
-
-After this routine is over, we don't have user code executing in the debugger's
-context, so we can use C<my> freely.
-
-=cut
-
-############################################## Begin lexical danger zone
-
-# 'my' variables used here could leak into (that is, be visible in)
-# the context that the code being evaluated is executing in. This means that
-# the code could modify the debugger's variables.
-#
-# Fiddling with the debugger's context could be Bad. We insulate things as
-# much as we can.
-
-sub eval {
-
- # 'my' would make it visible from user code
- # but so does local! --tchrist
- # Remember: this localizes @DB::res, not @main::res.
- local @res;
- {
-
- # Try to keep the user code from messing with us. Save these so that
- # even if the eval'ed code changes them, we can put them back again.
- # Needed because the user could refer directly to the debugger's
- # package globals (and any 'my' variables in this containing scope)
- # inside the eval(), and we want to try to stay safe.
- local $otrace = $trace;
- local $osingle = $single;
- local $od = $^D;
-
- # Untaint the incoming eval() argument.
- { ($evalarg) = $evalarg =~ /(.*)/s; }
-
- # $usercontext built in DB::DB near the comment
- # "set up the context for DB::eval ..."
- # Evaluate and save any results.
- @res = eval "$usercontext $evalarg;\n"; # '\n' for nice recursive debug
-
- # Restore those old values.
- $trace = $otrace;
- $single = $osingle;
- $^D = $od;
- }
-
- # Save the current value of $@, and preserve it in the debugger's copy
- # of the saved precious globals.
- my $at = $@;
-
- # Since we're only saving $@, we only have to localize the array element
- # that it will be stored in.
- local $saved[0]; # Preserve the old value of $@
- eval { &DB::save };
-
- # Now see whether we need to report an error back to the user.
- if ($at) {
- local $\ = '';
- print $OUT $at;
- }
-
- # Display as required by the caller. $onetimeDump and $onetimedumpDepth
- # are package globals.
- elsif ($onetimeDump) {
- if ( $onetimeDump eq 'dump' ) {
- local $option{dumpDepth} = $onetimedumpDepth
- if defined $onetimedumpDepth;
- dumpit( $OUT, \@res );
- }
- elsif ( $onetimeDump eq 'methods' ) {
- methods( $res[0] );
- }
- } ## end elsif ($onetimeDump)
- @res;
-} ## end sub eval
-
-############################################## End lexical danger zone
-
-# After this point it is safe to introduce lexicals.
-# The code being debugged will be executing in its own context, and
-# can't see the inside of the debugger.
-#
-# However, one should not overdo it: leave as much control from outside as
-# possible. If you make something a lexical, it's not going to be addressable
-# from outside the debugger even if you know its name.
-
-# This file is automatically included if you do perl -d.
-# It's probably not useful to include this yourself.
-#
-# Before venturing further into these twisty passages, it is
-# wise to read the perldebguts man page or risk the ire of dragons.
-#
-# (It should be noted that perldebguts will tell you a lot about
-# the underlying mechanics of how the debugger interfaces into the
-# Perl interpreter, but not a lot about the debugger itself. The new
-# comments in this code try to address this problem.)
-
-# Note that no subroutine call is possible until &DB::sub is defined
-# (for subroutines defined outside of the package DB). In fact the same is
-# true if $deep is not defined.
-
-# Enhanced by ilya@math.ohio-state.edu (Ilya Zakharevich)
-
-# modified Perl debugger, to be run from Emacs in perldb-mode
-# Ray Lischner (uunet!mntgfx!lisch) as of 5 Nov 1990
-# Johan Vromans -- upgrade to 4.0 pl 10
-# Ilya Zakharevich -- patches after 5.001 (and some before ;-)
-
-# (We have made efforts to clarify the comments in the change log
-# in other places; some of them may seem somewhat obscure as they
-# were originally written, and explaining them away from the code
-# in question seems conterproductive.. -JM)
-
-=head1 DEBUGGER INITIALIZATION
-
-The debugger starts up in phases.
-
-=head2 BASIC SETUP
-
-First, it initializes the environment it wants to run in: turning off
-warnings during its own compilation, defining variables which it will need
-to avoid warnings later, setting itself up to not exit when the program
-terminates, and defaulting to printing return values for the C<r> command.
-
-=cut
-
-# Needed for the statement after exec():
-#
-# This BEGIN block is simply used to switch off warnings during debugger
-# compiliation. Probably it would be better practice to fix the warnings,
-# but this is how it's done at the moment.
-
-BEGIN {
- $ini_warn = $^W;
- $^W = 0;
-} # Switch compilation warnings off until another BEGIN.
-
-# test if assertions are supported and actived:
-BEGIN {
- $ini_assertion = eval "sub asserting_test : assertion {1}; 1";
-
- # $ini_assertion = undef => assertions unsupported,
- # " = 1 => assertions supported
- # print "\$ini_assertion=$ini_assertion\n";
-}
-
-local ($^W) = 0; # Switch run-time warnings off during init.
-
-=head2 THREADS SUPPORT
-
-If we are running under a threaded Perl, we require threads and threads::shared
-if the environment variable C<PERL5DB_THREADED> is set, to enable proper
-threaded debugger control. C<-dt> can also be used to set this.
-
-Each new thread will be announced and the debugger prompt will always inform
-you of each new thread created. It will also indicate the thread id in which
-we are currently running within the prompt like this:
-
- [tid] DB<$i>
-
-Where C<[tid]> is an integer thread id and C<$i> is the familiar debugger
-command prompt. The prompt will show: C<[0]> when running under threads, but
-not actually in a thread. C<[tid]> is consistent with C<gdb> usage.
-
-While running under threads, when you set or delete a breakpoint (etc.), this
-will apply to all threads, not just the currently running one. When you are
-in a currently executing thread, you will stay there until it completes. With
-the current implementation it is not currently possible to hop from one thread
-to another.
-
-The C<e> and C<E> commands are currently fairly minimal - see C<h e> and C<h E>.
-
-Note that threading support was built into the debugger as of Perl version
-C<5.8.6> and debugger version C<1.2.8>.
-
-=cut
-
-BEGIN {
- # ensure we can share our non-threaded variables or no-op
- if ($ENV{PERL5DB_THREADED}) {
- require threads;
- require threads::shared;
- import threads::shared qw(share);
- $DBGR;
- share(\$DBGR);
- lock($DBGR);
- print "Threads support enabled\n";
- } else {
- *lock = sub(*) {};
- *share = sub(*) {};
- }
-}
-
-# This would probably be better done with "use vars", but that wasn't around
-# when this code was originally written. (Neither was "use strict".) And on
-# the principle of not fiddling with something that was working, this was
-# left alone.
-warn( # Do not ;-)
- # These variables control the execution of 'dumpvar.pl'.
- $dumpvar::hashDepth,
- $dumpvar::arrayDepth,
- $dumpvar::dumpDBFiles,
- $dumpvar::dumpPackages,
- $dumpvar::quoteHighBit,
- $dumpvar::printUndef,
- $dumpvar::globPrint,
- $dumpvar::usageOnly,
-
- # used to save @ARGV and extract any debugger-related flags.
- @ARGS,
-
- # used to control die() reporting in diesignal()
- $Carp::CarpLevel,
-
- # used to prevent multiple entries to diesignal()
- # (if for instance diesignal() itself dies)
- $panic,
-
- # used to prevent the debugger from running nonstop
- # after a restart
- $second_time,
- )
- if 0;
-
-foreach my $k (keys (%INC)) {
- &share(\$main::{'_<'.$filename});
-};
-
-# Command-line + PERLLIB:
-# Save the contents of @INC before they are modified elsewhere.
-@ini_INC = @INC;
-
-# This was an attempt to clear out the previous values of various
-# trapped errors. Apparently it didn't help. XXX More info needed!
-# $prevwarn = $prevdie = $prevbus = $prevsegv = ''; # Does not help?!
-
-# We set these variables to safe values. We don't want to blindly turn
-# off warnings, because other packages may still want them.
-$trace = $signal = $single = 0; # Uninitialized warning suppression
- # (local $^W cannot help - other packages!).
-
-# Default to not exiting when program finishes; print the return
-# value when the 'r' command is used to return from a subroutine.
-$inhibit_exit = $option{PrintRet} = 1;
-
-=head1 OPTION PROCESSING
-
-The debugger's options are actually spread out over the debugger itself and
-C<dumpvar.pl>; some of these are variables to be set, while others are
-subs to be called with a value. To try to make this a little easier to
-manage, the debugger uses a few data structures to define what options
-are legal and how they are to be processed.
-
-First, the C<@options> array defines the I<names> of all the options that
-are to be accepted.
-
-=cut
-
-@options = qw(
- CommandSet
- hashDepth arrayDepth dumpDepth
- DumpDBFiles DumpPackages DumpReused
- compactDump veryCompact quote
- HighBit undefPrint globPrint
- PrintRet UsageOnly frame
- AutoTrace TTY noTTY
- ReadLine NonStop LineInfo
- maxTraceLen recallCommand ShellBang
- pager tkRunning ornaments
- signalLevel warnLevel dieLevel
- inhibit_exit ImmediateStop bareStringify
- CreateTTY RemotePort windowSize
- DollarCaretP OnlyAssertions WarnAssertions
-);
-
-@RememberOnROptions = qw(DollarCaretP OnlyAssertions);
-
-=pod
-
-Second, C<optionVars> lists the variables that each option uses to save its
-state.
-
-=cut
-
-%optionVars = (
- hashDepth => \$dumpvar::hashDepth,
- arrayDepth => \$dumpvar::arrayDepth,
- CommandSet => \$CommandSet,
- DumpDBFiles => \$dumpvar::dumpDBFiles,
- DumpPackages => \$dumpvar::dumpPackages,
- DumpReused => \$dumpvar::dumpReused,
- HighBit => \$dumpvar::quoteHighBit,
- undefPrint => \$dumpvar::printUndef,
- globPrint => \$dumpvar::globPrint,
- UsageOnly => \$dumpvar::usageOnly,
- CreateTTY => \$CreateTTY,
- bareStringify => \$dumpvar::bareStringify,
- frame => \$frame,
- AutoTrace => \$trace,
- inhibit_exit => \$inhibit_exit,
- maxTraceLen => \$maxtrace,
- ImmediateStop => \$ImmediateStop,
- RemotePort => \$remoteport,
- windowSize => \$window,
- WarnAssertions => \$warnassertions,
-);
-
-=pod
-
-Third, C<%optionAction> defines the subroutine to be called to process each
-option.
-
-=cut
-
-%optionAction = (
- compactDump => \&dumpvar::compactDump,
- veryCompact => \&dumpvar::veryCompact,
- quote => \&dumpvar::quote,
- TTY => \&TTY,
- noTTY => \&noTTY,
- ReadLine => \&ReadLine,
- NonStop => \&NonStop,
- LineInfo => \&LineInfo,
- recallCommand => \&recallCommand,
- ShellBang => \&shellBang,
- pager => \&pager,
- signalLevel => \&signalLevel,
- warnLevel => \&warnLevel,
- dieLevel => \&dieLevel,
- tkRunning => \&tkRunning,
- ornaments => \&ornaments,
- RemotePort => \&RemotePort,
- DollarCaretP => \&DollarCaretP,
- OnlyAssertions=> \&OnlyAssertions,
-);
-
-=pod
-
-Last, the C<%optionRequire> notes modules that must be C<require>d if an
-option is used.
-
-=cut
-
-# Note that this list is not complete: several options not listed here
-# actually require that dumpvar.pl be loaded for them to work, but are
-# not in the table. A subsequent patch will correct this problem; for
-# the moment, we're just recommenting, and we are NOT going to change
-# function.
-%optionRequire = (
- compactDump => 'dumpvar.pl',
- veryCompact => 'dumpvar.pl',
- quote => 'dumpvar.pl',
-);
-
-=pod
-
-There are a number of initialization-related variables which can be set
-by putting code to set them in a BEGIN block in the C<PERL5DB> environment
-variable. These are:
-
-=over 4
-
-=item C<$rl> - readline control XXX needs more explanation
-
-=item C<$warnLevel> - whether or not debugger takes over warning handling
-
-=item C<$dieLevel> - whether or not debugger takes over die handling
-
-=item C<$signalLevel> - whether or not debugger takes over signal handling
-
-=item C<$pre> - preprompt actions (array reference)
-
-=item C<$post> - postprompt actions (array reference)
-
-=item C<$pretype>
-
-=item C<$CreateTTY> - whether or not to create a new TTY for this debugger
-
-=item C<$CommandSet> - which command set to use (defaults to new, documented set)
-
-=back
-
-=cut
-
-# These guys may be defined in $ENV{PERL5DB} :
-$rl = 1 unless defined $rl;
-$warnLevel = 1 unless defined $warnLevel;
-$dieLevel = 1 unless defined $dieLevel;
-$signalLevel = 1 unless defined $signalLevel;
-$pre = [] unless defined $pre;
-$post = [] unless defined $post;
-$pretype = [] unless defined $pretype;
-$CreateTTY = 3 unless defined $CreateTTY;
-$CommandSet = '580' unless defined $CommandSet;
-
-share($rl);
-share($warnLevel);
-share($dieLevel);
-share($signalLevel);
-share($pre);
-share($post);
-share($pretype);
-share($rl);
-share($CreateTTY);
-share($CommandSet);
-
-=pod
-
-The default C<die>, C<warn>, and C<signal> handlers are set up.
-
-=cut
-
-warnLevel($warnLevel);
-dieLevel($dieLevel);
-signalLevel($signalLevel);
-
-=pod
-
-The pager to be used is needed next. We try to get it from the
-environment first. if it's not defined there, we try to find it in
-the Perl C<Config.pm>. If it's not there, we default to C<more>. We
-then call the C<pager()> function to save the pager name.
-
-=cut
-
-# This routine makes sure $pager is set up so that '|' can use it.
-pager(
-
- # If PAGER is defined in the environment, use it.
- defined $ENV{PAGER}
- ? $ENV{PAGER}
-
- # If not, see if Config.pm defines it.
- : eval { require Config }
- && defined $Config::Config{pager}
- ? $Config::Config{pager}
-
- # If not, fall back to 'more'.
- : 'more'
- )
- unless defined $pager;
-
-=pod
-
-We set up the command to be used to access the man pages, the command
-recall character (C<!> unless otherwise defined) and the shell escape
-character (C<!> unless otherwise defined). Yes, these do conflict, and
-neither works in the debugger at the moment.
-
-=cut
-
-setman();
-
-# Set up defaults for command recall and shell escape (note:
-# these currently don't work in linemode debugging).
-&recallCommand("!") unless defined $prc;
-&shellBang("!") unless defined $psh;
-
-=pod
-
-We then set up the gigantic string containing the debugger help.
-We also set the limit on the number of arguments we'll display during a
-trace.
-
-=cut
-
-sethelp();
-
-# If we didn't get a default for the length of eval/stack trace args,
-# set it here.
-$maxtrace = 400 unless defined $maxtrace;
-
-=head2 SETTING UP THE DEBUGGER GREETING
-
-The debugger I<greeting> helps to inform the user how many debuggers are
-running, and whether the current debugger is the primary or a child.
-
-If we are the primary, we just hang onto our pid so we'll have it when
-or if we start a child debugger. If we are a child, we'll set things up
-so we'll have a unique greeting and so the parent will give us our own
-TTY later.
-
-We save the current contents of the C<PERLDB_PIDS> environment variable
-because we mess around with it. We'll also need to hang onto it because
-we'll need it if we restart.
-
-Child debuggers make a label out of the current PID structure recorded in
-PERLDB_PIDS plus the new PID. They also mark themselves as not having a TTY
-yet so the parent will give them one later via C<resetterm()>.
-
-=cut
-
-# Save the current contents of the environment; we're about to
-# much with it. We'll need this if we have to restart.
-$ini_pids = $ENV{PERLDB_PIDS};
-
-if ( defined $ENV{PERLDB_PIDS} ) {
-
- # We're a child. Make us a label out of the current PID structure
- # recorded in PERLDB_PIDS plus our (new) PID. Mark us as not having
- # a term yet so the parent will give us one later via resetterm().
- $pids = "[$ENV{PERLDB_PIDS}]";
- $ENV{PERLDB_PIDS} .= "->$$";
- $term_pid = -1;
-} ## end if (defined $ENV{PERLDB_PIDS...
-else {
-
- # We're the parent PID. Initialize PERLDB_PID in case we end up with a
- # child debugger, and mark us as the parent, so we'll know to set up
- # more TTY's is we have to.
- $ENV{PERLDB_PIDS} = "$$";
- $pids = "{pid=$$}";
- $term_pid = $$;
-}
-
-$pidprompt = '';
-
-# Sets up $emacs as a synonym for $slave_editor.
-*emacs = $slave_editor if $slave_editor; # May be used in afterinit()...
-
-=head2 READING THE RC FILE
-
-The debugger will read a file of initialization options if supplied. If
-running interactively, this is C<.perldb>; if not, it's C<perldb.ini>.
-
-=cut
-
-# As noted, this test really doesn't check accurately that the debugger
-# is running at a terminal or not.
-
-if ( -e "/dev/tty" ) { # this is the wrong metric!
- $rcfile = ".perldb";
-}
-else {
- $rcfile = "perldb.ini";
-}
-
-=pod
-
-The debugger does a safety test of the file to be read. It must be owned
-either by the current user or root, and must only be writable by the owner.
-
-=cut
-
-# This wraps a safety test around "do" to read and evaluate the init file.
-#
-# This isn't really safe, because there's a race
-# between checking and opening. The solution is to
-# open and fstat the handle, but then you have to read and
-# eval the contents. But then the silly thing gets
-# your lexical scope, which is unfortunate at best.
-sub safe_do {
- my $file = shift;
-
- # Just exactly what part of the word "CORE::" don't you understand?
- local $SIG{__WARN__};
- local $SIG{__DIE__};
-
- unless ( is_safe_file($file) ) {
- CORE::warn <<EO_GRIPE;
-perldb: Must not source insecure rcfile $file.
- You or the superuser must be the owner, and it must not
- be writable by anyone but its owner.
-EO_GRIPE
- return;
- } ## end unless (is_safe_file($file...
-
- do $file;
- CORE::warn("perldb: couldn't parse $file: $@") if $@;
-} ## end sub safe_do
-
-# This is the safety test itself.
-#
-# Verifies that owner is either real user or superuser and that no
-# one but owner may write to it. This function is of limited use
-# when called on a path instead of upon a handle, because there are
-# no guarantees that filename (by dirent) whose file (by ino) is
-# eventually accessed is the same as the one tested.
-# Assumes that the file's existence is not in doubt.
-sub is_safe_file {
- my $path = shift;
- stat($path) || return; # mysteriously vaporized
- my ( $dev, $ino, $mode, $nlink, $uid, $gid ) = stat(_);
-
- return 0 if $uid != 0 && $uid != $<;
- return 0 if $mode & 022;
- return 1;
-} ## end sub is_safe_file
-
-# If the rcfile (whichever one we decided was the right one to read)
-# exists, we safely do it.
-if ( -f $rcfile ) {
- safe_do("./$rcfile");
-}
-
-# If there isn't one here, try the user's home directory.
-elsif ( defined $ENV{HOME} && -f "$ENV{HOME}/$rcfile" ) {
- safe_do("$ENV{HOME}/$rcfile");
-}
-
-# Else try the login directory.
-elsif ( defined $ENV{LOGDIR} && -f "$ENV{LOGDIR}/$rcfile" ) {
- safe_do("$ENV{LOGDIR}/$rcfile");
-}
-
-# If the PERLDB_OPTS variable has options in it, parse those out next.
-if ( defined $ENV{PERLDB_OPTS} ) {
- parse_options( $ENV{PERLDB_OPTS} );
-}
-
-=pod
-
-The last thing we do during initialization is determine which subroutine is
-to be used to obtain a new terminal when a new debugger is started. Right now,
-the debugger only handles X Windows and OS/2.
-
-=cut
-
-# Set up the get_fork_TTY subroutine to be aliased to the proper routine.
-# Works if you're running an xterm or xterm-like window, or you're on
-# OS/2. This may need some expansion: for instance, this doesn't handle
-# OS X Terminal windows.
-
-if (
- not defined &get_fork_TTY # no routine exists,
- and defined $ENV{TERM} # and we know what kind
- # of terminal this is,
- and $ENV{TERM} eq 'xterm' # and it's an xterm,
-# and defined $ENV{WINDOWID} # and we know what window this is, <- wrong metric
- and defined $ENV{DISPLAY} # and what display it's on,
- )
-{
- *get_fork_TTY = \&xterm_get_fork_TTY; # use the xterm version
-} ## end if (not defined &get_fork_TTY...
-elsif ( $^O eq 'os2' ) { # If this is OS/2,
- *get_fork_TTY = \&os2_get_fork_TTY; # use the OS/2 version
-}
-
-# untaint $^O, which may have been tainted by the last statement.
-# see bug [perl #24674]
-$^O =~ m/^(.*)\z/;
-$^O = $1;
-
-# Here begin the unreadable code. It needs fixing.
-
-=head2 RESTART PROCESSING
-
-This section handles the restart command. When the C<R> command is invoked, it
-tries to capture all of the state it can into environment variables, and
-then sets C<PERLDB_RESTART>. When we start executing again, we check to see
-if C<PERLDB_RESTART> is there; if so, we reload all the information that
-the R command stuffed into the environment variables.
-
- PERLDB_RESTART - flag only, contains no restart data itself.
- PERLDB_HIST - command history, if it's available
- PERLDB_ON_LOAD - breakpoints set by the rc file
- PERLDB_POSTPONE - subs that have been loaded/not executed, and have actions
- PERLDB_VISITED - files that had breakpoints
- PERLDB_FILE_... - breakpoints for a file
- PERLDB_OPT - active options
- PERLDB_INC - the original @INC
- PERLDB_PRETYPE - preprompt debugger actions
- PERLDB_PRE - preprompt Perl code
- PERLDB_POST - post-prompt Perl code
- PERLDB_TYPEAHEAD - typeahead captured by readline()
-
-We chug through all these variables and plug the values saved in them
-back into the appropriate spots in the debugger.
-
-=cut
-
-if ( exists $ENV{PERLDB_RESTART} ) {
-
- # We're restarting, so we don't need the flag that says to restart anymore.
- delete $ENV{PERLDB_RESTART};
-
- # $restart = 1;
- @hist = get_list('PERLDB_HIST');
- %break_on_load = get_list("PERLDB_ON_LOAD");
- %postponed = get_list("PERLDB_POSTPONE");
-
- share(@hist);
- share(@truehist);
- share(%break_on_load);
- share(%postponed);
-
- # restore breakpoints/actions
- my @had_breakpoints = get_list("PERLDB_VISITED");
- for ( 0 .. $#had_breakpoints ) {
- my %pf = get_list("PERLDB_FILE_$_");
- $postponed_file{ $had_breakpoints[$_] } = \%pf if %pf;
- }
-
- # restore options
- my %opt = get_list("PERLDB_OPT");
- my ( $opt, $val );
- while ( ( $opt, $val ) = each %opt ) {
- $val =~ s/[\\\']/\\$1/g;
- parse_options("$opt'$val'");
- }
-
- # restore original @INC
- @INC = get_list("PERLDB_INC");
- @ini_INC = @INC;
-
- # return pre/postprompt actions and typeahead buffer
- $pretype = [ get_list("PERLDB_PRETYPE") ];
- $pre = [ get_list("PERLDB_PRE") ];
- $post = [ get_list("PERLDB_POST") ];
- @typeahead = get_list( "PERLDB_TYPEAHEAD", @typeahead );
-} ## end if (exists $ENV{PERLDB_RESTART...
-
-=head2 SETTING UP THE TERMINAL
-
-Now, we'll decide how the debugger is going to interact with the user.
-If there's no TTY, we set the debugger to run non-stop; there's not going
-to be anyone there to enter commands.
-
-=cut
-
-if ($notty) {
- $runnonstop = 1;
- share($runnonstop);
-}
-
-=pod
-
-If there is a TTY, we have to determine who it belongs to before we can
-proceed. If this is a slave editor or graphical debugger (denoted by
-the first command-line switch being '-emacs'), we shift this off and
-set C<$rl> to 0 (XXX ostensibly to do straight reads).
-
-=cut
-
-else {
-
- # Is Perl being run from a slave editor or graphical debugger?
- # If so, don't use readline, and set $slave_editor = 1.
- $slave_editor =
- ( ( defined $main::ARGV[0] ) and ( $main::ARGV[0] eq '-emacs' ) );
- $rl = 0, shift(@main::ARGV) if $slave_editor;
-
- #require Term::ReadLine;
-
-=pod
-
-We then determine what the console should be on various systems:
-
-=over 4
-
-=item * Cygwin - We use C<stdin> instead of a separate device.
-
-=cut
-
- if ( $^O eq 'cygwin' ) {
-
- # /dev/tty is binary. use stdin for textmode
- undef $console;
- }
-
-=item * Unix - use C</dev/tty>.
-
-=cut
-
- elsif ( -e "/dev/tty" ) {
- $console = "/dev/tty";
- }
-
-=item * Windows or MSDOS - use C<con>.
-
-=cut
-
- elsif ( $^O eq 'dos' or -e "con" or $^O eq 'MSWin32' ) {
- $console = "con";
- }
-
-=item * MacOS - use C<Dev:Console:Perl Debug> if this is the MPW version; C<Dev:
-Console> if not.
-
-Note that Mac OS X returns C<darwin>, not C<MacOS>. Also note that the debugger doesn't do anything special for C<darwin>. Maybe it should.
-
-=cut
-
- elsif ( $^O eq 'MacOS' ) {
- if ( $MacPerl::Version !~ /MPW/ ) {
- $console =
- "Dev:Console:Perl Debug"; # Separate window for application
- }
- else {
- $console = "Dev:Console";
- }
- } ## end elsif ($^O eq 'MacOS')
-
-=item * VMS - use C<sys$command>.
-
-=cut
-
- else {
-
- # everything else is ...
- $console = "sys\$command";
- }
-
-=pod
-
-=back
-
-Several other systems don't use a specific console. We C<undef $console>
-for those (Windows using a slave editor/graphical debugger, NetWare, OS/2
-with a slave editor, Epoc).
-
-=cut
-
- if ( ( $^O eq 'MSWin32' ) and ( $slave_editor or defined $ENV{EMACS} ) ) {
-
- # /dev/tty is binary. use stdin for textmode
- $console = undef;
- }
-
- if ( $^O eq 'NetWare' ) {
-
- # /dev/tty is binary. use stdin for textmode
- $console = undef;
- }
-
- # In OS/2, we need to use STDIN to get textmode too, even though
- # it pretty much looks like Unix otherwise.
- if ( defined $ENV{OS2_SHELL} and ( $slave_editor or $ENV{WINDOWID} ) )
- { # In OS/2
- $console = undef;
- }
-
- # EPOC also falls into the 'got to use STDIN' camp.
- if ( $^O eq 'epoc' ) {
- $console = undef;
- }
-
-=pod
-
-If there is a TTY hanging around from a parent, we use that as the console.
-
-=cut
-
- $console = $tty if defined $tty;
-
-=head2 SOCKET HANDLING
-
-The debugger is capable of opening a socket and carrying out a debugging
-session over the socket.
-
-If C<RemotePort> was defined in the options, the debugger assumes that it
-should try to start a debugging session on that port. It builds the socket
-and then tries to connect the input and output filehandles to it.
-
-=cut
-
- # Handle socket stuff.
-
- if ( defined $remoteport ) {
-
- # If RemotePort was defined in the options, connect input and output
- # to the socket.
- require IO::Socket;
- $OUT = new IO::Socket::INET(
- Timeout => '10',
- PeerAddr => $remoteport,
- Proto => 'tcp',
- );
- if ( !$OUT ) { die "Unable to connect to remote host: $remoteport\n"; }
- $IN = $OUT;
- } ## end if (defined $remoteport)
-
-=pod
-
-If no C<RemotePort> was defined, and we want to create a TTY on startup,
-this is probably a situation where multiple debuggers are running (for example,
-a backticked command that starts up another debugger). We create a new IN and
-OUT filehandle, and do the necessary mojo to create a new TTY if we know how
-and if we can.
-
-=cut
-
- # Non-socket.
- else {
-
- # Two debuggers running (probably a system or a backtick that invokes
- # the debugger itself under the running one). create a new IN and OUT
- # filehandle, and do the necessary mojo to create a new tty if we
- # know how, and we can.
- create_IN_OUT(4) if $CreateTTY & 4;
- if ($console) {
-
- # If we have a console, check to see if there are separate ins and
- # outs to open. (They are assumed identiical if not.)
-
- my ( $i, $o ) = split /,/, $console;
- $o = $i unless defined $o;
-
- # read/write on in, or just read, or read on STDIN.
- open( IN, "+<$i" )
- || open( IN, "<$i" )
- || open( IN, "<&STDIN" );
-
- # read/write/create/clobber out, or write/create/clobber out,
- # or merge with STDERR, or merge with STDOUT.
- open( OUT, "+>$o" )
- || open( OUT, ">$o" )
- || open( OUT, ">&STDERR" )
- || open( OUT, ">&STDOUT" ); # so we don't dongle stdout
-
- } ## end if ($console)
- elsif ( not defined $console ) {
-
- # No console. Open STDIN.
- open( IN, "<&STDIN" );
-
- # merge with STDERR, or with STDOUT.
- open( OUT, ">&STDERR" )
- || open( OUT, ">&STDOUT" ); # so we don't dongle stdout
- $console = 'STDIN/OUT';
- } ## end elsif (not defined $console)
-
- # Keep copies of the filehandles so that when the pager runs, it
- # can close standard input without clobbering ours.
- $IN = \*IN, $OUT = \*OUT if $console or not defined $console;
- } ## end elsif (from if(defined $remoteport))
-
- # Unbuffer DB::OUT. We need to see responses right away.
- my $previous = select($OUT);
- $| = 1; # for DB::OUT
- select($previous);
-
- # Line info goes to debugger output unless pointed elsewhere.
- # Pointing elsewhere makes it possible for slave editors to
- # keep track of file and position. We have both a filehandle
- # and a I/O description to keep track of.
- $LINEINFO = $OUT unless defined $LINEINFO;
- $lineinfo = $console unless defined $lineinfo;
- # share($LINEINFO); # <- unable to share globs
- share($lineinfo); #
-
-=pod
-
-To finish initialization, we show the debugger greeting,
-and then call the C<afterinit()> subroutine if there is one.
-
-=cut
-
- # Show the debugger greeting.
- $header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
- unless ($runnonstop) {
- local $\ = '';
- local $, = '';
- if ( $term_pid eq '-1' ) {
- print $OUT "\nDaughter DB session started...\n";
- }
- else {
- print $OUT "\nLoading DB routines from $header\n";
- print $OUT (
- "Editor support ",
- $slave_editor ? "enabled" : "available", ".\n"
- );
- print $OUT
-"\nEnter h or `h h' for help, or `$doccmd perldebug' for more help.\n\n";
- } ## end else [ if ($term_pid eq '-1')
- } ## end unless ($runnonstop)
-} ## end else [ if ($notty)
-
-# XXX This looks like a bug to me.
-# Why copy to @ARGS and then futz with @args?
-@ARGS = @ARGV;
-for (@args) {
- # Make sure backslashes before single quotes are stripped out, and
- # keep args unless they are numeric (XXX why?)
- # s/\'/\\\'/g; # removed while not justified understandably
- # s/(.*)/'$1'/ unless /^-?[\d.]+$/; # ditto
-}
-
-# If there was an afterinit() sub defined, call it. It will get
-# executed in our scope, so it can fiddle with debugger globals.
-if ( defined &afterinit ) { # May be defined in $rcfile
- &afterinit();
-}
-
-# Inform us about "Stack dump during die enabled ..." in dieLevel().
-$I_m_init = 1;
-
-
diff --git a/tests/examplefiles/perl_regex-delims b/tests/examplefiles/perl_regex-delims
deleted file mode 100644
index 6da5298d..00000000
--- a/tests/examplefiles/perl_regex-delims
+++ /dev/null
@@ -1,120 +0,0 @@
-#! /usr/bin/env perl
-
-use strict;
-use warnings;
-
-# common delimiters
-print "a: ";
-my $a = "foo";
-print $a, " - ";
-$a =~ s/foo/bar/;
-print $a, "\n";
-
-print "b: ";
-my $b = "foo";
-print $b, " - ";
-$b =~ s!foo!bar!;
-print $b, "\n";
-
-print "c: ";
-my $c = "foo";
-print $c, " - ";
-$c =~ s@foo@bar@;
-print $c, "\n";
-
-print "d: ";
-my $d = "foo";
-print $d, " - ";
-$d =~ s\foo\bar\;
-print $d, "\n";
-
-print "\n";
-
-# balanced delimiters
-print "e: ";
-my $e = "foo";
-print $e, " - ";
-$e =~ s{foo}{bar};
-print $e, "\n";
-
-print "f: ";
-my $f = "foo";
-print $f, " - ";
-$f =~ s(foo)(bar);
-print $f, "\n";
-
-print "g: ";
-my $g = "foo";
-print $g, " - ";
-$g =~ s<foo><bar>;
-print $g, "\n";
-
-print "h: ";
-my $h = "foo";
-print $h, " - ";
-$h =~ s[foo][bar];
-print $h, "\n";
-
-print "\n";
-
-# balanced delimiters with whitespace
-print "i: ";
-my $i = "foo";
-print $i, " - ";
-$i =~ s{foo} {bar};
-print $i, "\n";
-
-print "j: ";
-my $j = "foo";
-print $j, " - ";
-$j =~ s<foo> <bar>;
-print $j, "\n";
-
-print "k: ";
-my $k = "foo";
-print $k, " - ";
-$k =~
- s(foo)
-
- (bar);
-print $k, "\n";
-
-print "\n";
-
-# mixed delimiters
-print "l: ";
-my $l = "foo";
-print $l, " - ";
-$l =~ s{foo} <bar>;
-print $l, "\n";
-
-print "m: ";
-my $m = "foo";
-print $m, " - ";
-$m =~ s(foo) !bar!;
-print $m, "\n";
-
-print "n: ";
-my $n = "foo";
-print $n, " - ";
-$n =~ s[foo] $bar$;
-print $n, "\n";
-
-print "\n";
-
-# /x modifier
-print "o: ";
-my $o = "foo";
-print $o, " - ";
-$o =~ s{
- foo
- } {bar}x;
-print $o, "\n";
-
-print "p: ";
-my $p = "foo";
-print $p, " - ";
-$p =~ s%
- foo
- %bar%x;
-print $p, "\n";
diff --git a/tests/examplefiles/perlfunc.1 b/tests/examplefiles/perlfunc.1
deleted file mode 100644
index 5f80f0d0..00000000
--- a/tests/examplefiles/perlfunc.1
+++ /dev/null
@@ -1,856 +0,0 @@
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
-.\"
-.\" Standard preamble:
-.\" ========================================================================
-.de Sh \" Subsection heading
-.br
-.if t .Sp
-.ne 5
-.PP
-\fB\\$1\fR
-.PP
-..
-.de Sp \" Vertical space (when we can't use .PP)
-.if t .sp .5v
-.if n .sp
-..
-.de Vb \" Begin verbatim text
-.ft CW
-.nf
-.ne \\$1
-..
-.de Ve \" End verbatim text
-.ft R
-.fi
-..
-.\" Set up some character translations and predefined strings. \*(-- will
-.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
-.\" double quote, and \*(R" will give a right double quote. | will give a
-.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
-.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
-.\" expand to `' in nroff, nothing in troff, for use with C<>.
-.tr \(*W-|\(bv\*(Tr
-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
-.ie n \{\
-. ds -- \(*W-
-. ds PI pi
-. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
-. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
-. ds L" ""
-. ds R" ""
-. ds C` ""
-. ds C' ""
-'br\}
-.el\{\
-. ds -- \|\(em\|
-. ds PI \(*p
-. ds L" ``
-. ds R" ''
-'br\}
-.\"
-.\" If the F register is turned on, we'll generate index entries on stderr for
-.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
-.\" entries marked with X<> in POD. Of course, you'll have to process the
-.\" output yourself in some meaningful fashion.
-.if \nF \{\
-. de IX
-. tm Index:\\$1\t\\n%\t"\\$2"
-..
-. nr % 0
-. rr F
-.\}
-.\"
-.\" For nroff, turn off justification. Always turn off hyphenation; it makes
-.\" way too many mistakes in technical documents.
-.hy 0
-.if n .na
-.\"
-.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
-.\" Fear. Run. Save yourself. No user-serviceable parts.
-. \" fudge factors for nroff and troff
-.if n \{\
-. ds #H 0
-. ds #V .8m
-. ds #F .3m
-. ds #[ \f1
-. ds #] \fP
-.\}
-.if t \{\
-. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
-. ds #V .6m
-. ds #F 0
-. ds #[ \&
-. ds #] \&
-.\}
-. \" simple accents for nroff and troff
-.if n \{\
-. ds ' \&
-. ds ` \&
-. ds ^ \&
-. ds , \&
-. ds ~ ~
-. ds /
-.\}
-.if t \{\
-. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
-. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
-. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
-. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
-. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
-. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
-.\}
-. \" troff and (daisy-wheel) nroff accents
-.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
-.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
-.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
-.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
-.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
-.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
-.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
-.ds ae a\h'-(\w'a'u*4/10)'e
-.ds Ae A\h'-(\w'A'u*4/10)'E
-. \" corrections for vroff
-.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
-.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
-. \" for low resolution devices (crt and lpr)
-.if \n(.H>23 .if \n(.V>19 \
-\{\
-. ds : e
-. ds 8 ss
-. ds o a
-. ds d- d\h'-1'\(ga
-. ds D- D\h'-1'\(hy
-. ds th \o'bp'
-. ds Th \o'LP'
-. ds ae ae
-. ds Ae AE
-.\}
-.rm #[ #] #H #V #F C
-.\" ========================================================================
-.\"
-.IX Title "PERLFUNC 1"
-.TH PERLFUNC 1 "2006-01-07" "perl v5.8.8" "Perl Programmers Reference Guide"
-.SH "NAME"
-.IX Xref "function"
-perlfunc \- Perl builtin functions
-.SH "DESCRIPTION"
-.IX Header "DESCRIPTION"
-The functions in this section can serve as terms in an expression.
-They fall into two major categories: list operators and named unary
-operators. These differ in their precedence relationship with a
-following comma. (See the precedence table in perlop.) List
-operators take more than one argument, while unary operators can never
-take more than one argument. Thus, a comma terminates the argument of
-a unary operator, but merely separates the arguments of a list
-operator. A unary operator generally provides a scalar context to its
-argument, while a list operator may provide either scalar or list
-contexts for its arguments. If it does both, the scalar arguments will
-be first, and the list argument will follow. (Note that there can ever
-be only one such list argument.) For instance, \fIsplice()\fR has three scalar
-arguments followed by a list, whereas \fIgethostbyname()\fR has four scalar
-arguments.
-.PP
-In the syntax descriptions that follow, list operators that expect a
-list (and provide list context for the elements of the list) are shown
-with \s-1LIST\s0 as an argument. Such a list may consist of any combination
-of scalar arguments or list values; the list values will be included
-in the list as if each individual element were interpolated at that
-point in the list, forming a longer single-dimensional list value.
-Commas should separate elements of the \s-1LIST\s0.
-.PP
-Any function in the list below may be used either with or without
-parentheses around its arguments. (The syntax descriptions omit the
-parentheses.) If you use the parentheses, the simple (but occasionally
-surprising) rule is this: It \fIlooks\fR like a function, therefore it \fIis\fR a
-function, and precedence doesn't matter. Otherwise it's a list
-operator or unary operator, and precedence does matter. And whitespace
-between the function and left parenthesis doesn't count\*(--so you need to
-be careful sometimes:
-.PP
-.Vb 5
-\& print 1+2+4; # Prints 7.
-\& print(1+2) + 4; # Prints 3.
-\& print (1+2)+4; # Also prints 3!
-\& print +(1+2)+4; # Prints 7.
-\& print ((1+2)+4); # Prints 7.
-.Ve
-.PP
-If you run Perl with the \fB\-w\fR switch it can warn you about this. For
-example, the third line above produces:
-.PP
-.Vb 2
-\& print (...) interpreted as function at - line 1.
-\& Useless use of integer addition in void context at - line 1.
-.Ve
-.PP
-A few functions take no arguments at all, and therefore work as neither
-unary nor list operators. These include such functions as \f(CW\*(C`time\*(C'\fR
-and \f(CW\*(C`endpwent\*(C'\fR. For example, \f(CW\*(C`time+86_400\*(C'\fR always means
-\&\f(CW\*(C`time() + 86_400\*(C'\fR.
-.PP
-For functions that can be used in either a scalar or list context,
-nonabortive failure is generally indicated in a scalar context by
-returning the undefined value, and in a list context by returning the
-null list.
-.PP
-Remember the following important rule: There is \fBno rule\fR that relates
-the behavior of an expression in list context to its behavior in scalar
-context, or vice versa. It might do two totally different things.
-Each operator and function decides which sort of value it would be most
-appropriate to return in scalar context. Some operators return the
-length of the list that would have been returned in list context. Some
-operators return the first value in the list. Some operators return the
-last value in the list. Some operators return a count of successful
-operations. In general, they do what you want, unless you want
-consistency.
-.IX Xref "context"
-.PP
-A named array in scalar context is quite different from what would at
-first glance appear to be a list in scalar context. You can't get a list
-like \f(CW\*(C`(1,2,3)\*(C'\fR into being in scalar context, because the compiler knows
-the context at compile time. It would generate the scalar comma operator
-there, not the list construction version of the comma. That means it
-was never a list to start with.
-.PP
-In general, functions in Perl that serve as wrappers for system calls
-of the same name (like \fIchown\fR\|(2), \fIfork\fR\|(2), \fIclosedir\fR\|(2), etc.) all return
-true when they succeed and \f(CW\*(C`undef\*(C'\fR otherwise, as is usually mentioned
-in the descriptions below. This is different from the C interfaces,
-which return \f(CW\*(C`\-1\*(C'\fR on failure. Exceptions to this rule are \f(CW\*(C`wait\*(C'\fR,
-\&\f(CW\*(C`waitpid\*(C'\fR, and \f(CW\*(C`syscall\*(C'\fR. System calls also set the special \f(CW$!\fR
-variable on failure. Other functions do not, except accidentally.
-.Sh "Perl Functions by Category"
-.IX Xref "function"
-.IX Subsection "Perl Functions by Category"
-Here are Perl's functions (including things that look like
-functions, like some keywords and named operators)
-arranged by category. Some functions appear in more
-than one place.
-.IP "Functions for SCALARs or strings" 4
-.IX Xref "scalar string character"
-.IX Item "Functions for SCALARs or strings"
-\&\f(CW\*(C`chomp\*(C'\fR, \f(CW\*(C`chop\*(C'\fR, \f(CW\*(C`chr\*(C'\fR, \f(CW\*(C`crypt\*(C'\fR, \f(CW\*(C`hex\*(C'\fR, \f(CW\*(C`index\*(C'\fR, \f(CW\*(C`lc\*(C'\fR, \f(CW\*(C`lcfirst\*(C'\fR,
-\&\f(CW\*(C`length\*(C'\fR, \f(CW\*(C`oct\*(C'\fR, \f(CW\*(C`ord\*(C'\fR, \f(CW\*(C`pack\*(C'\fR, \f(CW\*(C`q/STRING/\*(C'\fR, \f(CW\*(C`qq/STRING/\*(C'\fR, \f(CW\*(C`reverse\*(C'\fR,
-\&\f(CW\*(C`rindex\*(C'\fR, \f(CW\*(C`sprintf\*(C'\fR, \f(CW\*(C`substr\*(C'\fR, \f(CW\*(C`tr///\*(C'\fR, \f(CW\*(C`uc\*(C'\fR, \f(CW\*(C`ucfirst\*(C'\fR, \f(CW\*(C`y///\*(C'\fR
-.IP "Regular expressions and pattern matching" 4
-.IX Xref "regular expression regex regexp"
-.IX Item "Regular expressions and pattern matching"
-\&\f(CW\*(C`m//\*(C'\fR, \f(CW\*(C`pos\*(C'\fR, \f(CW\*(C`quotemeta\*(C'\fR, \f(CW\*(C`s///\*(C'\fR, \f(CW\*(C`split\*(C'\fR, \f(CW\*(C`study\*(C'\fR, \f(CW\*(C`qr//\*(C'\fR
-.IP "Numeric functions" 4
-.IX Xref "numeric number trigonometric trigonometry"
-.IX Item "Numeric functions"
-\&\f(CW\*(C`abs\*(C'\fR, \f(CW\*(C`atan2\*(C'\fR, \f(CW\*(C`cos\*(C'\fR, \f(CW\*(C`exp\*(C'\fR, \f(CW\*(C`hex\*(C'\fR, \f(CW\*(C`int\*(C'\fR, \f(CW\*(C`log\*(C'\fR, \f(CW\*(C`oct\*(C'\fR, \f(CW\*(C`rand\*(C'\fR,
-\&\f(CW\*(C`sin\*(C'\fR, \f(CW\*(C`sqrt\*(C'\fR, \f(CW\*(C`srand\*(C'\fR
-.ie n .IP "Functions for real @ARRAYs" 4
-.el .IP "Functions for real \f(CW@ARRAYs\fR" 4
-.IX Xref "array"
-.IX Item "Functions for real @ARRAYs"
-\&\f(CW\*(C`pop\*(C'\fR, \f(CW\*(C`push\*(C'\fR, \f(CW\*(C`shift\*(C'\fR, \f(CW\*(C`splice\*(C'\fR, \f(CW\*(C`unshift\*(C'\fR
-.IP "Functions for list data" 4
-.IX Xref "list"
-.IX Item "Functions for list data"
-\&\f(CW\*(C`grep\*(C'\fR, \f(CW\*(C`join\*(C'\fR, \f(CW\*(C`map\*(C'\fR, \f(CW\*(C`qw/STRING/\*(C'\fR, \f(CW\*(C`reverse\*(C'\fR, \f(CW\*(C`sort\*(C'\fR, \f(CW\*(C`unpack\*(C'\fR
-.ie n .IP "Functions for real %HASHes" 4
-.el .IP "Functions for real \f(CW%HASHes\fR" 4
-.IX Xref "hash"
-.IX Item "Functions for real %HASHes"
-\&\f(CW\*(C`delete\*(C'\fR, \f(CW\*(C`each\*(C'\fR, \f(CW\*(C`exists\*(C'\fR, \f(CW\*(C`keys\*(C'\fR, \f(CW\*(C`values\*(C'\fR
-.IP "Input and output functions" 4
-.IX Xref "I O input output dbm"
-.IX Item "Input and output functions"
-\&\f(CW\*(C`binmode\*(C'\fR, \f(CW\*(C`close\*(C'\fR, \f(CW\*(C`closedir\*(C'\fR, \f(CW\*(C`dbmclose\*(C'\fR, \f(CW\*(C`dbmopen\*(C'\fR, \f(CW\*(C`die\*(C'\fR, \f(CW\*(C`eof\*(C'\fR,
-\&\f(CW\*(C`fileno\*(C'\fR, \f(CW\*(C`flock\*(C'\fR, \f(CW\*(C`format\*(C'\fR, \f(CW\*(C`getc\*(C'\fR, \f(CW\*(C`print\*(C'\fR, \f(CW\*(C`printf\*(C'\fR, \f(CW\*(C`read\*(C'\fR,
-\&\f(CW\*(C`readdir\*(C'\fR, \f(CW\*(C`rewinddir\*(C'\fR, \f(CW\*(C`seek\*(C'\fR, \f(CW\*(C`seekdir\*(C'\fR, \f(CW\*(C`select\*(C'\fR, \f(CW\*(C`syscall\*(C'\fR,
-\&\f(CW\*(C`sysread\*(C'\fR, \f(CW\*(C`sysseek\*(C'\fR, \f(CW\*(C`syswrite\*(C'\fR, \f(CW\*(C`tell\*(C'\fR, \f(CW\*(C`telldir\*(C'\fR, \f(CW\*(C`truncate\*(C'\fR,
-\&\f(CW\*(C`warn\*(C'\fR, \f(CW\*(C`write\*(C'\fR
-.IP "Functions for fixed length data or records" 4
-.IX Item "Functions for fixed length data or records"
-\&\f(CW\*(C`pack\*(C'\fR, \f(CW\*(C`read\*(C'\fR, \f(CW\*(C`syscall\*(C'\fR, \f(CW\*(C`sysread\*(C'\fR, \f(CW\*(C`syswrite\*(C'\fR, \f(CW\*(C`unpack\*(C'\fR, \f(CW\*(C`vec\*(C'\fR
-.IP "Functions for filehandles, files, or directories" 4
-.IX Xref "file filehandle directory pipe link symlink"
-.IX Item "Functions for filehandles, files, or directories"
-\&\f(CW\*(C`\-\f(CIX\f(CW\*(C'\fR, \f(CW\*(C`chdir\*(C'\fR, \f(CW\*(C`chmod\*(C'\fR, \f(CW\*(C`chown\*(C'\fR, \f(CW\*(C`chroot\*(C'\fR, \f(CW\*(C`fcntl\*(C'\fR, \f(CW\*(C`glob\*(C'\fR,
-\&\f(CW\*(C`ioctl\*(C'\fR, \f(CW\*(C`link\*(C'\fR, \f(CW\*(C`lstat\*(C'\fR, \f(CW\*(C`mkdir\*(C'\fR, \f(CW\*(C`open\*(C'\fR, \f(CW\*(C`opendir\*(C'\fR,
-\&\f(CW\*(C`readlink\*(C'\fR, \f(CW\*(C`rename\*(C'\fR, \f(CW\*(C`rmdir\*(C'\fR, \f(CW\*(C`stat\*(C'\fR, \f(CW\*(C`symlink\*(C'\fR, \f(CW\*(C`sysopen\*(C'\fR,
-\&\f(CW\*(C`umask\*(C'\fR, \f(CW\*(C`unlink\*(C'\fR, \f(CW\*(C`utime\*(C'\fR
-.IP "Keywords related to the control flow of your Perl program" 4
-.IX Xref "control flow"
-.IX Item "Keywords related to the control flow of your Perl program"
-\&\f(CW\*(C`caller\*(C'\fR, \f(CW\*(C`continue\*(C'\fR, \f(CW\*(C`die\*(C'\fR, \f(CW\*(C`do\*(C'\fR, \f(CW\*(C`dump\*(C'\fR, \f(CW\*(C`eval\*(C'\fR, \f(CW\*(C`exit\*(C'\fR,
-\&\f(CW\*(C`goto\*(C'\fR, \f(CW\*(C`last\*(C'\fR, \f(CW\*(C`next\*(C'\fR, \f(CW\*(C`redo\*(C'\fR, \f(CW\*(C`return\*(C'\fR, \f(CW\*(C`sub\*(C'\fR, \f(CW\*(C`wantarray\*(C'\fR
-.IP "Keywords related to scoping" 4
-.IX Item "Keywords related to scoping"
-\&\f(CW\*(C`caller\*(C'\fR, \f(CW\*(C`import\*(C'\fR, \f(CW\*(C`local\*(C'\fR, \f(CW\*(C`my\*(C'\fR, \f(CW\*(C`our\*(C'\fR, \f(CW\*(C`package\*(C'\fR, \f(CW\*(C`use\*(C'\fR
-.IP "Miscellaneous functions" 4
-.IX Item "Miscellaneous functions"
-\&\f(CW\*(C`defined\*(C'\fR, \f(CW\*(C`dump\*(C'\fR, \f(CW\*(C`eval\*(C'\fR, \f(CW\*(C`formline\*(C'\fR, \f(CW\*(C`local\*(C'\fR, \f(CW\*(C`my\*(C'\fR, \f(CW\*(C`our\*(C'\fR, \f(CW\*(C`reset\*(C'\fR,
-\&\f(CW\*(C`scalar\*(C'\fR, \f(CW\*(C`undef\*(C'\fR, \f(CW\*(C`wantarray\*(C'\fR
-.IP "Functions for processes and process groups" 4
-.IX Xref "process pid process id"
-.IX Item "Functions for processes and process groups"
-\&\f(CW\*(C`alarm\*(C'\fR, \f(CW\*(C`exec\*(C'\fR, \f(CW\*(C`fork\*(C'\fR, \f(CW\*(C`getpgrp\*(C'\fR, \f(CW\*(C`getppid\*(C'\fR, \f(CW\*(C`getpriority\*(C'\fR, \f(CW\*(C`kill\*(C'\fR,
-\&\f(CW\*(C`pipe\*(C'\fR, \f(CW\*(C`qx/STRING/\*(C'\fR, \f(CW\*(C`setpgrp\*(C'\fR, \f(CW\*(C`setpriority\*(C'\fR, \f(CW\*(C`sleep\*(C'\fR, \f(CW\*(C`system\*(C'\fR,
-\&\f(CW\*(C`times\*(C'\fR, \f(CW\*(C`wait\*(C'\fR, \f(CW\*(C`waitpid\*(C'\fR
-.IP "Keywords related to perl modules" 4
-.IX Xref "module"
-.IX Item "Keywords related to perl modules"
-\&\f(CW\*(C`do\*(C'\fR, \f(CW\*(C`import\*(C'\fR, \f(CW\*(C`no\*(C'\fR, \f(CW\*(C`package\*(C'\fR, \f(CW\*(C`require\*(C'\fR, \f(CW\*(C`use\*(C'\fR
-.IP "Keywords related to classes and object-orientedness" 4
-.IX Xref "object class package"
-.IX Item "Keywords related to classes and object-orientedness"
-\&\f(CW\*(C`bless\*(C'\fR, \f(CW\*(C`dbmclose\*(C'\fR, \f(CW\*(C`dbmopen\*(C'\fR, \f(CW\*(C`package\*(C'\fR, \f(CW\*(C`ref\*(C'\fR, \f(CW\*(C`tie\*(C'\fR, \f(CW\*(C`tied\*(C'\fR,
-\&\f(CW\*(C`untie\*(C'\fR, \f(CW\*(C`use\*(C'\fR
-.IP "Low-level socket functions" 4
-.IX Xref "socket sock"
-.IX Item "Low-level socket functions"
-\&\f(CW\*(C`accept\*(C'\fR, \f(CW\*(C`bind\*(C'\fR, \f(CW\*(C`connect\*(C'\fR, \f(CW\*(C`getpeername\*(C'\fR, \f(CW\*(C`getsockname\*(C'\fR,
-\&\f(CW\*(C`getsockopt\*(C'\fR, \f(CW\*(C`listen\*(C'\fR, \f(CW\*(C`recv\*(C'\fR, \f(CW\*(C`send\*(C'\fR, \f(CW\*(C`setsockopt\*(C'\fR, \f(CW\*(C`shutdown\*(C'\fR,
-\&\f(CW\*(C`socket\*(C'\fR, \f(CW\*(C`socketpair\*(C'\fR
-.IP "System V interprocess communication functions" 4
-.IX Xref "IPC System V semaphore shared memory memory message"
-.IX Item "System V interprocess communication functions"
-\&\f(CW\*(C`msgctl\*(C'\fR, \f(CW\*(C`msgget\*(C'\fR, \f(CW\*(C`msgrcv\*(C'\fR, \f(CW\*(C`msgsnd\*(C'\fR, \f(CW\*(C`semctl\*(C'\fR, \f(CW\*(C`semget\*(C'\fR, \f(CW\*(C`semop\*(C'\fR,
-\&\f(CW\*(C`shmctl\*(C'\fR, \f(CW\*(C`shmget\*(C'\fR, \f(CW\*(C`shmread\*(C'\fR, \f(CW\*(C`shmwrite\*(C'\fR
-.IP "Fetching user and group info" 4
-.IX Xref "user group password uid gid passwd etc passwd"
-.IX Item "Fetching user and group info"
-\&\f(CW\*(C`endgrent\*(C'\fR, \f(CW\*(C`endhostent\*(C'\fR, \f(CW\*(C`endnetent\*(C'\fR, \f(CW\*(C`endpwent\*(C'\fR, \f(CW\*(C`getgrent\*(C'\fR,
-\&\f(CW\*(C`getgrgid\*(C'\fR, \f(CW\*(C`getgrnam\*(C'\fR, \f(CW\*(C`getlogin\*(C'\fR, \f(CW\*(C`getpwent\*(C'\fR, \f(CW\*(C`getpwnam\*(C'\fR,
-\&\f(CW\*(C`getpwuid\*(C'\fR, \f(CW\*(C`setgrent\*(C'\fR, \f(CW\*(C`setpwent\*(C'\fR
-.IP "Fetching network info" 4
-.IX Xref "network protocol host hostname IP address service"
-.IX Item "Fetching network info"
-\&\f(CW\*(C`endprotoent\*(C'\fR, \f(CW\*(C`endservent\*(C'\fR, \f(CW\*(C`gethostbyaddr\*(C'\fR, \f(CW\*(C`gethostbyname\*(C'\fR,
-\&\f(CW\*(C`gethostent\*(C'\fR, \f(CW\*(C`getnetbyaddr\*(C'\fR, \f(CW\*(C`getnetbyname\*(C'\fR, \f(CW\*(C`getnetent\*(C'\fR,
-\&\f(CW\*(C`getprotobyname\*(C'\fR, \f(CW\*(C`getprotobynumber\*(C'\fR, \f(CW\*(C`getprotoent\*(C'\fR,
-\&\f(CW\*(C`getservbyname\*(C'\fR, \f(CW\*(C`getservbyport\*(C'\fR, \f(CW\*(C`getservent\*(C'\fR, \f(CW\*(C`sethostent\*(C'\fR,
-\&\f(CW\*(C`setnetent\*(C'\fR, \f(CW\*(C`setprotoent\*(C'\fR, \f(CW\*(C`setservent\*(C'\fR
-.IP "Time-related functions" 4
-.IX Xref "time date"
-.IX Item "Time-related functions"
-\&\f(CW\*(C`gmtime\*(C'\fR, \f(CW\*(C`localtime\*(C'\fR, \f(CW\*(C`time\*(C'\fR, \f(CW\*(C`times\*(C'\fR
-.IP "Functions new in perl5" 4
-.IX Xref "perl5"
-.IX Item "Functions new in perl5"
-\&\f(CW\*(C`abs\*(C'\fR, \f(CW\*(C`bless\*(C'\fR, \f(CW\*(C`chomp\*(C'\fR, \f(CW\*(C`chr\*(C'\fR, \f(CW\*(C`exists\*(C'\fR, \f(CW\*(C`formline\*(C'\fR, \f(CW\*(C`glob\*(C'\fR,
-\&\f(CW\*(C`import\*(C'\fR, \f(CW\*(C`lc\*(C'\fR, \f(CW\*(C`lcfirst\*(C'\fR, \f(CW\*(C`map\*(C'\fR, \f(CW\*(C`my\*(C'\fR, \f(CW\*(C`no\*(C'\fR, \f(CW\*(C`our\*(C'\fR, \f(CW\*(C`prototype\*(C'\fR,
-\&\f(CW\*(C`qx\*(C'\fR, \f(CW\*(C`qw\*(C'\fR, \f(CW\*(C`readline\*(C'\fR, \f(CW\*(C`readpipe\*(C'\fR, \f(CW\*(C`ref\*(C'\fR, \f(CW\*(C`sub*\*(C'\fR, \f(CW\*(C`sysopen\*(C'\fR, \f(CW\*(C`tie\*(C'\fR,
-\&\f(CW\*(C`tied\*(C'\fR, \f(CW\*(C`uc\*(C'\fR, \f(CW\*(C`ucfirst\*(C'\fR, \f(CW\*(C`untie\*(C'\fR, \f(CW\*(C`use\*(C'\fR
-.Sp
-* \- \f(CW\*(C`sub\*(C'\fR was a keyword in perl4, but in perl5 it is an
-operator, which can be used in expressions.
-.IP "Functions obsoleted in perl5" 4
-.IX Item "Functions obsoleted in perl5"
-\&\f(CW\*(C`dbmclose\*(C'\fR, \f(CW\*(C`dbmopen\*(C'\fR
-.Sh "Portability"
-.IX Xref "portability Unix portable"
-.IX Subsection "Portability"
-Perl was born in Unix and can therefore access all common Unix
-system calls. In non-Unix environments, the functionality of some
-Unix system calls may not be available, or details of the available
-functionality may differ slightly. The Perl functions affected
-by this are:
-.PP
-\&\f(CW\*(C`\-X\*(C'\fR, \f(CW\*(C`binmode\*(C'\fR, \f(CW\*(C`chmod\*(C'\fR, \f(CW\*(C`chown\*(C'\fR, \f(CW\*(C`chroot\*(C'\fR, \f(CW\*(C`crypt\*(C'\fR,
-\&\f(CW\*(C`dbmclose\*(C'\fR, \f(CW\*(C`dbmopen\*(C'\fR, \f(CW\*(C`dump\*(C'\fR, \f(CW\*(C`endgrent\*(C'\fR, \f(CW\*(C`endhostent\*(C'\fR,
-\&\f(CW\*(C`endnetent\*(C'\fR, \f(CW\*(C`endprotoent\*(C'\fR, \f(CW\*(C`endpwent\*(C'\fR, \f(CW\*(C`endservent\*(C'\fR, \f(CW\*(C`exec\*(C'\fR,
-\&\f(CW\*(C`fcntl\*(C'\fR, \f(CW\*(C`flock\*(C'\fR, \f(CW\*(C`fork\*(C'\fR, \f(CW\*(C`getgrent\*(C'\fR, \f(CW\*(C`getgrgid\*(C'\fR, \f(CW\*(C`gethostbyname\*(C'\fR,
-\&\f(CW\*(C`gethostent\*(C'\fR, \f(CW\*(C`getlogin\*(C'\fR, \f(CW\*(C`getnetbyaddr\*(C'\fR, \f(CW\*(C`getnetbyname\*(C'\fR, \f(CW\*(C`getnetent\*(C'\fR,
-\&\f(CW\*(C`getppid\*(C'\fR, \f(CW\*(C`getpgrp\*(C'\fR, \f(CW\*(C`getpriority\*(C'\fR, \f(CW\*(C`getprotobynumber\*(C'\fR,
-\&\f(CW\*(C`getprotoent\*(C'\fR, \f(CW\*(C`getpwent\*(C'\fR, \f(CW\*(C`getpwnam\*(C'\fR, \f(CW\*(C`getpwuid\*(C'\fR,
-\&\f(CW\*(C`getservbyport\*(C'\fR, \f(CW\*(C`getservent\*(C'\fR, \f(CW\*(C`getsockopt\*(C'\fR, \f(CW\*(C`glob\*(C'\fR, \f(CW\*(C`ioctl\*(C'\fR,
-\&\f(CW\*(C`kill\*(C'\fR, \f(CW\*(C`link\*(C'\fR, \f(CW\*(C`lstat\*(C'\fR, \f(CW\*(C`msgctl\*(C'\fR, \f(CW\*(C`msgget\*(C'\fR, \f(CW\*(C`msgrcv\*(C'\fR,
-\&\f(CW\*(C`msgsnd\*(C'\fR, \f(CW\*(C`open\*(C'\fR, \f(CW\*(C`pipe\*(C'\fR, \f(CW\*(C`readlink\*(C'\fR, \f(CW\*(C`rename\*(C'\fR, \f(CW\*(C`select\*(C'\fR, \f(CW\*(C`semctl\*(C'\fR,
-\&\f(CW\*(C`semget\*(C'\fR, \f(CW\*(C`semop\*(C'\fR, \f(CW\*(C`setgrent\*(C'\fR, \f(CW\*(C`sethostent\*(C'\fR, \f(CW\*(C`setnetent\*(C'\fR,
-\&\f(CW\*(C`setpgrp\*(C'\fR, \f(CW\*(C`setpriority\*(C'\fR, \f(CW\*(C`setprotoent\*(C'\fR, \f(CW\*(C`setpwent\*(C'\fR,
-\&\f(CW\*(C`setservent\*(C'\fR, \f(CW\*(C`setsockopt\*(C'\fR, \f(CW\*(C`shmctl\*(C'\fR, \f(CW\*(C`shmget\*(C'\fR, \f(CW\*(C`shmread\*(C'\fR,
-\&\f(CW\*(C`shmwrite\*(C'\fR, \f(CW\*(C`socket\*(C'\fR, \f(CW\*(C`socketpair\*(C'\fR,
-\&\f(CW\*(C`stat\*(C'\fR, \f(CW\*(C`symlink\*(C'\fR, \f(CW\*(C`syscall\*(C'\fR, \f(CW\*(C`sysopen\*(C'\fR, \f(CW\*(C`system\*(C'\fR,
-\&\f(CW\*(C`times\*(C'\fR, \f(CW\*(C`truncate\*(C'\fR, \f(CW\*(C`umask\*(C'\fR, \f(CW\*(C`unlink\*(C'\fR,
-\&\f(CW\*(C`utime\*(C'\fR, \f(CW\*(C`wait\*(C'\fR, \f(CW\*(C`waitpid\*(C'\fR
-.PP
-For more information about the portability of these functions, see
-perlport and other available platform-specific documentation.
-.Sh "Alphabetical Listing of Perl Functions"
-.IX Subsection "Alphabetical Listing of Perl Functions"
-.IP "\-X \s-1FILEHANDLE\s0" 8
-.IX Xref "-r -w -x -o -R -W -X -O -e -z -s -f -d -l -p -S -b -c -t -u -g -k -T -B -M -A -C"
-.IX Item "-X FILEHANDLE"
-.PD 0
-.IP "\-X \s-1EXPR\s0" 8
-.IX Item "-X EXPR"
-.IP "\-X" 8
-.IX Item "-X"
-.PD
-A file test, where X is one of the letters listed below. This unary
-operator takes one argument, either a filename or a filehandle, and
-tests the associated file to see if something is true about it. If the
-argument is omitted, tests \f(CW$_\fR, except for \f(CW\*(C`\-t\*(C'\fR, which tests \s-1STDIN\s0.
-Unless otherwise documented, it returns \f(CW1\fR for true and \f(CW''\fR for false, or
-the undefined value if the file doesn't exist. Despite the funny
-names, precedence is the same as any other named unary operator, and
-the argument may be parenthesized like any other unary operator. The
-operator may be any of:
-.Sp
-.Vb 4
-\& -r File is readable by effective uid/gid.
-\& -w File is writable by effective uid/gid.
-\& -x File is executable by effective uid/gid.
-\& -o File is owned by effective uid.
-.Ve
-.Sp
-.Vb 4
-\& -R File is readable by real uid/gid.
-\& -W File is writable by real uid/gid.
-\& -X File is executable by real uid/gid.
-\& -O File is owned by real uid.
-.Ve
-.Sp
-.Vb 3
-\& -e File exists.
-\& -z File has zero size (is empty).
-\& -s File has nonzero size (returns size in bytes).
-.Ve
-.Sp
-.Vb 8
-\& -f File is a plain file.
-\& -d File is a directory.
-\& -l File is a symbolic link.
-\& -p File is a named pipe (FIFO), or Filehandle is a pipe.
-\& -S File is a socket.
-\& -b File is a block special file.
-\& -c File is a character special file.
-\& -t Filehandle is opened to a tty.
-.Ve
-.Sp
-.Vb 3
-\& -u File has setuid bit set.
-\& -g File has setgid bit set.
-\& -k File has sticky bit set.
-.Ve
-.Sp
-.Vb 2
-\& -T File is an ASCII text file (heuristic guess).
-\& -B File is a "binary" file (opposite of -T).
-.Ve
-.Sp
-.Vb 3
-\& -M Script start time minus file modification time, in days.
-\& -A Same for access time.
-\& -C Same for inode change time (Unix, may differ for other platforms)
-.Ve
-.Sp
-Example:
-.Sp
-.Vb 5
-\& while (<>) {
-\& chomp;
-\& next unless -f $_; # ignore specials
-\& #...
-\& }
-.Ve
-.Sp
-The interpretation of the file permission operators \f(CW\*(C`\-r\*(C'\fR, \f(CW\*(C`\-R\*(C'\fR,
-\&\f(CW\*(C`\-w\*(C'\fR, \f(CW\*(C`\-W\*(C'\fR, \f(CW\*(C`\-x\*(C'\fR, and \f(CW\*(C`\-X\*(C'\fR is by default based solely on the mode
-of the file and the uids and gids of the user. There may be other
-reasons you can't actually read, write, or execute the file. Such
-reasons may be for example network filesystem access controls, ACLs
-(access control lists), read-only filesystems, and unrecognized
-executable formats.
-.Sp
-Also note that, for the superuser on the local filesystems, the \f(CW\*(C`\-r\*(C'\fR,
-\&\f(CW\*(C`\-R\*(C'\fR, \f(CW\*(C`\-w\*(C'\fR, and \f(CW\*(C`\-W\*(C'\fR tests always return 1, and \f(CW\*(C`\-x\*(C'\fR and \f(CW\*(C`\-X\*(C'\fR return 1
-if any execute bit is set in the mode. Scripts run by the superuser
-may thus need to do a \fIstat()\fR to determine the actual mode of the file,
-or temporarily set their effective uid to something else.
-.Sp
-If you are using ACLs, there is a pragma called \f(CW\*(C`filetest\*(C'\fR that may
-produce more accurate results than the bare \fIstat()\fR mode bits.
-When under the \f(CW\*(C`use filetest 'access'\*(C'\fR the above-mentioned filetests
-will test whether the permission can (not) be granted using the
-\&\fIaccess()\fR family of system calls. Also note that the \f(CW\*(C`\-x\*(C'\fR and \f(CW\*(C`\-X\*(C'\fR may
-under this pragma return true even if there are no execute permission
-bits set (nor any extra execute permission ACLs). This strangeness is
-due to the underlying system calls' definitions. Read the
-documentation for the \f(CW\*(C`filetest\*(C'\fR pragma for more information.
-.Sp
-Note that \f(CW\*(C`\-s/a/b/\*(C'\fR does not do a negated substitution. Saying
-\&\f(CW\*(C`\-exp($foo)\*(C'\fR still works as expected, however\*(--only single letters
-following a minus are interpreted as file tests.
-.Sp
-The \f(CW\*(C`\-T\*(C'\fR and \f(CW\*(C`\-B\*(C'\fR switches work as follows. The first block or so of the
-file is examined for odd characters such as strange control codes or
-characters with the high bit set. If too many strange characters (>30%)
-are found, it's a \f(CW\*(C`\-B\*(C'\fR file; otherwise it's a \f(CW\*(C`\-T\*(C'\fR file. Also, any file
-containing null in the first block is considered a binary file. If \f(CW\*(C`\-T\*(C'\fR
-or \f(CW\*(C`\-B\*(C'\fR is used on a filehandle, the current \s-1IO\s0 buffer is examined
-rather than the first block. Both \f(CW\*(C`\-T\*(C'\fR and \f(CW\*(C`\-B\*(C'\fR return true on a null
-file, or a file at \s-1EOF\s0 when testing a filehandle. Because you have to
-read a file to do the \f(CW\*(C`\-T\*(C'\fR test, on most occasions you want to use a \f(CW\*(C`\-f\*(C'\fR
-against the file first, as in \f(CW\*(C`next unless \-f $file && \-T $file\*(C'\fR.
-.Sp
-If any of the file tests (or either the \f(CW\*(C`stat\*(C'\fR or \f(CW\*(C`lstat\*(C'\fR operators) are given
-the special filehandle consisting of a solitary underline, then the stat
-structure of the previous file test (or stat operator) is used, saving
-a system call. (This doesn't work with \f(CW\*(C`\-t\*(C'\fR, and you need to remember
-that \fIlstat()\fR and \f(CW\*(C`\-l\*(C'\fR will leave values in the stat structure for the
-symbolic link, not the real file.) (Also, if the stat buffer was filled by
-an \f(CW\*(C`lstat\*(C'\fR call, \f(CW\*(C`\-T\*(C'\fR and \f(CW\*(C`\-B\*(C'\fR will reset it with the results of \f(CW\*(C`stat _\*(C'\fR).
-Example:
-.Sp
-.Vb 1
-\& print "Can do.\en" if -r $a || -w _ || -x _;
-.Ve
-.Sp
-.Vb 9
-\& stat($filename);
-\& print "Readable\en" if -r _;
-\& print "Writable\en" if -w _;
-\& print "Executable\en" if -x _;
-\& print "Setuid\en" if -u _;
-\& print "Setgid\en" if -g _;
-\& print "Sticky\en" if -k _;
-\& print "Text\en" if -T _;
-\& print "Binary\en" if -B _;
-.Ve
-.IP "abs \s-1VALUE\s0" 8
-.IX Xref "abs absolute"
-.IX Item "abs VALUE"
-.PD 0
-.IP "abs" 8
-.IX Item "abs"
-.PD
-Returns the absolute value of its argument.
-If \s-1VALUE\s0 is omitted, uses \f(CW$_\fR.
-.IP "accept \s-1NEWSOCKET\s0,GENERICSOCKET" 8
-.IX Xref "accept"
-.IX Item "accept NEWSOCKET,GENERICSOCKET"
-Accepts an incoming socket connect, just as the \fIaccept\fR\|(2) system call
-does. Returns the packed address if it succeeded, false otherwise.
-See the example in \*(L"Sockets: Client/Server Communication\*(R" in perlipc.
-.Sp
-On systems that support a close-on-exec flag on files, the flag will
-be set for the newly opened file descriptor, as determined by the
-value of $^F. See \*(L"$^F\*(R" in perlvar.
-.IP "alarm \s-1SECONDS\s0" 8
-.IX Xref "alarm SIGALRM timer"
-.IX Item "alarm SECONDS"
-.PD 0
-.IP "alarm" 8
-.IX Item "alarm"
-.PD
-Arranges to have a \s-1SIGALRM\s0 delivered to this process after the
-specified number of wallclock seconds has elapsed. If \s-1SECONDS\s0 is not
-specified, the value stored in \f(CW$_\fR is used. (On some machines,
-unfortunately, the elapsed time may be up to one second less or more
-than you specified because of how seconds are counted, and process
-scheduling may delay the delivery of the signal even further.)
-.Sp
-Only one timer may be counting at once. Each call disables the
-previous timer, and an argument of \f(CW0\fR may be supplied to cancel the
-previous timer without starting a new one. The returned value is the
-amount of time remaining on the previous timer.
-.Sp
-For delays of finer granularity than one second, you may use Perl's
-four-argument version of \fIselect()\fR leaving the first three arguments
-undefined, or you might be able to use the \f(CW\*(C`syscall\*(C'\fR interface to
-access \fIsetitimer\fR\|(2) if your system supports it. The Time::HiRes
-module (from \s-1CPAN\s0, and starting from Perl 5.8 part of the standard
-distribution) may also prove useful.
-.Sp
-It is usually a mistake to intermix \f(CW\*(C`alarm\*(C'\fR and \f(CW\*(C`sleep\*(C'\fR calls.
-(\f(CW\*(C`sleep\*(C'\fR may be internally implemented in your system with \f(CW\*(C`alarm\*(C'\fR)
-.Sp
-If you want to use \f(CW\*(C`alarm\*(C'\fR to time out a system call you need to use an
-\&\f(CW\*(C`eval\*(C'\fR/\f(CW\*(C`die\*(C'\fR pair. You can't rely on the alarm causing the system call to
-fail with \f(CW$!\fR set to \f(CW\*(C`EINTR\*(C'\fR because Perl sets up signal handlers to
-restart system calls on some systems. Using \f(CW\*(C`eval\*(C'\fR/\f(CW\*(C`die\*(C'\fR always works,
-modulo the caveats given in \*(L"Signals\*(R" in perlipc.
-.Sp
-.Vb 13
-\& eval {
-\& local $SIG{ALRM} = sub { die "alarm\en" }; # NB: \en required
-\& alarm $timeout;
-\& $nread = sysread SOCKET, $buffer, $size;
-\& alarm 0;
-\& };
-\& if ($@) {
-\& die unless $@ eq "alarm\en"; # propagate unexpected errors
-\& # timed out
-\& }
-\& else {
-\& # didn't
-\& }
-.Ve
-.Sp
-For more information see perlipc.
-.IP "atan2 Y,X" 8
-.IX Xref "atan2 arctangent tan tangent"
-.IX Item "atan2 Y,X"
-Returns the arctangent of Y/X in the range \-PI to \s-1PI\s0.
-.Sp
-For the tangent operation, you may use the \f(CW\*(C`Math::Trig::tan\*(C'\fR
-function, or use the familiar relation:
-.Sp
-.Vb 1
-\& sub tan { sin($_[0]) / cos($_[0]) }
-.Ve
-.Sp
-Note that atan2(0, 0) is not well\-defined.
-.IP "bind \s-1SOCKET\s0,NAME" 8
-.IX Xref "bind"
-.IX Item "bind SOCKET,NAME"
-Binds a network address to a socket, just as the bind system call
-does. Returns true if it succeeded, false otherwise. \s-1NAME\s0 should be a
-packed address of the appropriate type for the socket. See the examples in
-\&\*(L"Sockets: Client/Server Communication\*(R" in perlipc.
-.IP "binmode \s-1FILEHANDLE\s0, \s-1LAYER\s0" 8
-.IX Xref "binmode binary text DOS Windows"
-.IX Item "binmode FILEHANDLE, LAYER"
-.PD 0
-.IP "binmode \s-1FILEHANDLE\s0" 8
-.IX Item "binmode FILEHANDLE"
-.PD
-Arranges for \s-1FILEHANDLE\s0 to be read or written in \*(L"binary\*(R" or \*(L"text\*(R"
-mode on systems where the run-time libraries distinguish between
-binary and text files. If \s-1FILEHANDLE\s0 is an expression, the value is
-taken as the name of the filehandle. Returns true on success,
-otherwise it returns \f(CW\*(C`undef\*(C'\fR and sets \f(CW$!\fR (errno).
-.Sp
-On some systems (in general, \s-1DOS\s0 and Windows-based systems) \fIbinmode()\fR
-is necessary when you're not working with a text file. For the sake
-of portability it is a good idea to always use it when appropriate,
-and to never use it when it isn't appropriate. Also, people can
-set their I/O to be by default \s-1UTF\-8\s0 encoded Unicode, not bytes.
-.Sp
-In other words: regardless of platform, use \fIbinmode()\fR on binary data,
-like for example images.
-.Sp
-If \s-1LAYER\s0 is present it is a single string, but may contain multiple
-directives. The directives alter the behaviour of the file handle.
-When \s-1LAYER\s0 is present using binmode on text file makes sense.
-.Sp
-If \s-1LAYER\s0 is omitted or specified as \f(CW\*(C`:raw\*(C'\fR the filehandle is made
-suitable for passing binary data. This includes turning off possible \s-1CRLF\s0
-translation and marking it as bytes (as opposed to Unicode characters).
-Note that, despite what may be implied in \fI\*(L"Programming Perl\*(R"\fR (the
-Camel) or elsewhere, \f(CW\*(C`:raw\*(C'\fR is \fInot\fR the simply inverse of \f(CW\*(C`:crlf\*(C'\fR
-\&\*(-- other layers which would affect binary nature of the stream are
-\&\fIalso\fR disabled. See PerlIO, perlrun and the discussion about the
-\&\s-1PERLIO\s0 environment variable.
-.Sp
-The \f(CW\*(C`:bytes\*(C'\fR, \f(CW\*(C`:crlf\*(C'\fR, and \f(CW\*(C`:utf8\*(C'\fR, and any other directives of the
-form \f(CW\*(C`:...\*(C'\fR, are called I/O \fIlayers\fR. The \f(CW\*(C`open\*(C'\fR pragma can be used to
-establish default I/O layers. See open.
-.Sp
-\&\fIThe \s-1LAYER\s0 parameter of the \fIbinmode()\fI function is described as \*(L"\s-1DISCIPLINE\s0\*(R"
-in \*(L"Programming Perl, 3rd Edition\*(R". However, since the publishing of this
-book, by many known as \*(L"Camel \s-1III\s0\*(R", the consensus of the naming of this
-functionality has moved from \*(L"discipline\*(R" to \*(L"layer\*(R". All documentation
-of this version of Perl therefore refers to \*(L"layers\*(R" rather than to
-\&\*(L"disciplines\*(R". Now back to the regularly scheduled documentation...\fR
-.Sp
-To mark \s-1FILEHANDLE\s0 as \s-1UTF\-8\s0, use \f(CW\*(C`:utf8\*(C'\fR.
-.Sp
-In general, \fIbinmode()\fR should be called after \fIopen()\fR but before any I/O
-is done on the filehandle. Calling \fIbinmode()\fR will normally flush any
-pending buffered output data (and perhaps pending input data) on the
-handle. An exception to this is the \f(CW\*(C`:encoding\*(C'\fR layer that
-changes the default character encoding of the handle, see open.
-The \f(CW\*(C`:encoding\*(C'\fR layer sometimes needs to be called in
-mid\-stream, and it doesn't flush the stream. The \f(CW\*(C`:encoding\*(C'\fR
-also implicitly pushes on top of itself the \f(CW\*(C`:utf8\*(C'\fR layer because
-internally Perl will operate on \s-1UTF\-8\s0 encoded Unicode characters.
-.Sp
-The operating system, device drivers, C libraries, and Perl run-time
-system all work together to let the programmer treat a single
-character (\f(CW\*(C`\en\*(C'\fR) as the line terminator, irrespective of the external
-representation. On many operating systems, the native text file
-representation matches the internal representation, but on some
-platforms the external representation of \f(CW\*(C`\en\*(C'\fR is made up of more than
-one character.
-.Sp
-Mac \s-1OS\s0, all variants of Unix, and Stream_LF files on \s-1VMS\s0 use a single
-character to end each line in the external representation of text (even
-though that single character is \s-1CARRIAGE\s0 \s-1RETURN\s0 on Mac \s-1OS\s0 and \s-1LINE\s0 \s-1FEED\s0
-on Unix and most \s-1VMS\s0 files). In other systems like \s-1OS/2\s0, \s-1DOS\s0 and the
-various flavors of MS-Windows your program sees a \f(CW\*(C`\en\*(C'\fR as a simple \f(CW\*(C`\ecJ\*(C'\fR,
-but what's stored in text files are the two characters \f(CW\*(C`\ecM\ecJ\*(C'\fR. That
-means that, if you don't use \fIbinmode()\fR on these systems, \f(CW\*(C`\ecM\ecJ\*(C'\fR
-sequences on disk will be converted to \f(CW\*(C`\en\*(C'\fR on input, and any \f(CW\*(C`\en\*(C'\fR in
-your program will be converted back to \f(CW\*(C`\ecM\ecJ\*(C'\fR on output. This is what
-you want for text files, but it can be disastrous for binary files.
-.Sp
-Another consequence of using \fIbinmode()\fR (on some systems) is that
-special end-of-file markers will be seen as part of the data stream.
-For systems from the Microsoft family this means that if your binary
-data contains \f(CW\*(C`\ecZ\*(C'\fR, the I/O subsystem will regard it as the end of
-the file, unless you use \fIbinmode()\fR.
-.Sp
-\&\fIbinmode()\fR is not only important for \fIreadline()\fR and \fIprint()\fR operations,
-but also when using \fIread()\fR, \fIseek()\fR, \fIsysread()\fR, \fIsyswrite()\fR and \fItell()\fR
-(see perlport for more details). See the \f(CW$/\fR and \f(CW\*(C`$\e\*(C'\fR variables
-in perlvar for how to manually set your input and output
-line-termination sequences.
-.IP "bless \s-1REF\s0,CLASSNAME" 8
-.IX Xref "bless"
-.IX Item "bless REF,CLASSNAME"
-.PD 0
-.IP "bless \s-1REF\s0" 8
-.IX Item "bless REF"
-.PD
-This function tells the thingy referenced by \s-1REF\s0 that it is now an object
-in the \s-1CLASSNAME\s0 package. If \s-1CLASSNAME\s0 is omitted, the current package
-is used. Because a \f(CW\*(C`bless\*(C'\fR is often the last thing in a constructor,
-it returns the reference for convenience. Always use the two-argument
-version if a derived class might inherit the function doing the blessing.
-See perltoot and perlobj for more about the blessing (and blessings)
-of objects.
-.Sp
-Consider always blessing objects in CLASSNAMEs that are mixed case.
-Namespaces with all lowercase names are considered reserved for
-Perl pragmata. Builtin types have all uppercase names. To prevent
-confusion, you may wish to avoid such package names as well. Make sure
-that \s-1CLASSNAME\s0 is a true value.
-.Sp
-See \*(L"Perl Modules\*(R" in perlmod.
-.IP "caller \s-1EXPR\s0" 8
-.IX Xref "caller call stack stack stack trace"
-.IX Item "caller EXPR"
-.PD 0
-.IP "caller" 8
-.IX Item "caller"
-.PD
-Returns the context of the current subroutine call. In scalar context,
-returns the caller's package name if there is a caller, that is, if
-we're in a subroutine or \f(CW\*(C`eval\*(C'\fR or \f(CW\*(C`require\*(C'\fR, and the undefined value
-otherwise. In list context, returns
-.Sp
-.Vb 1
-\& ($package, $filename, $line) = caller;
-.Ve
-.Sp
-With \s-1EXPR\s0, it returns some extra information that the debugger uses to
-print a stack trace. The value of \s-1EXPR\s0 indicates how many call frames
-to go back before the current one.
-.Sp
-.Vb 2
-\& ($package, $filename, $line, $subroutine, $hasargs,
-\& $wantarray, $evaltext, $is_require, $hints, $bitmask) = caller($i);
-.Ve
-.Sp
-Here \f(CW$subroutine\fR may be \f(CW\*(C`(eval)\*(C'\fR if the frame is not a subroutine
-call, but an \f(CW\*(C`eval\*(C'\fR. In such a case additional elements \f(CW$evaltext\fR and
-\&\f(CW$is_require\fR are set: \f(CW$is_require\fR is true if the frame is created by a
-\&\f(CW\*(C`require\*(C'\fR or \f(CW\*(C`use\*(C'\fR statement, \f(CW$evaltext\fR contains the text of the
-\&\f(CW\*(C`eval EXPR\*(C'\fR statement. In particular, for an \f(CW\*(C`eval BLOCK\*(C'\fR statement,
-\&\f(CW$filename\fR is \f(CW\*(C`(eval)\*(C'\fR, but \f(CW$evaltext\fR is undefined. (Note also that
-each \f(CW\*(C`use\*(C'\fR statement creates a \f(CW\*(C`require\*(C'\fR frame inside an \f(CW\*(C`eval EXPR\*(C'\fR
-frame.) \f(CW$subroutine\fR may also be \f(CW\*(C`(unknown)\*(C'\fR if this particular
-subroutine happens to have been deleted from the symbol table.
-\&\f(CW$hasargs\fR is true if a new instance of \f(CW@_\fR was set up for the frame.
-\&\f(CW$hints\fR and \f(CW$bitmask\fR contain pragmatic hints that the caller was
-compiled with. The \f(CW$hints\fR and \f(CW$bitmask\fR values are subject to change
-between versions of Perl, and are not meant for external use.
-.Sp
-Furthermore, when called from within the \s-1DB\s0 package, caller returns more
-detailed information: it sets the list variable \f(CW@DB::args\fR to be the
-arguments with which the subroutine was invoked.
-.Sp
-Be aware that the optimizer might have optimized call frames away before
-\&\f(CW\*(C`caller\*(C'\fR had a chance to get the information. That means that \f(CWcaller(N)\fR
-might not return information about the call frame you expect it do, for
-\&\f(CW\*(C`N > 1\*(C'\fR. In particular, \f(CW@DB::args\fR might have information from the
-previous time \f(CW\*(C`caller\*(C'\fR was called.
-.IP "chdir \s-1EXPR\s0" 8
-.IX Xref "chdir cd"
-.IX Item "chdir EXPR"
-.PD 0
-.IP "chdir \s-1FILEHANDLE\s0" 8
-.IX Item "chdir FILEHANDLE"
-.IP "chdir \s-1DIRHANDLE\s0" 8
-.IX Item "chdir DIRHANDLE"
-.IP "chdir" 8
-.IX Item "chdir"
-.PD
-Changes the working directory to \s-1EXPR\s0, if possible. If \s-1EXPR\s0 is omitted,
-changes to the directory specified by \f(CW$ENV{HOME}\fR, if set; if not,
-changes to the directory specified by \f(CW$ENV{LOGDIR}\fR. (Under \s-1VMS\s0, the
-variable \f(CW$ENV{SYS$LOGIN}\fR is also checked, and used if it is set.) If
-neither is set, \f(CW\*(C`chdir\*(C'\fR does nothing. It returns true upon success,
-false otherwise. See the example under \f(CW\*(C`die\*(C'\fR.
-.Sp
-On systems that support fchdir, you might pass a file handle or
-directory handle as argument. On systems that don't support fchdir,
-passing handles produces a fatal error at run time.
-.IP "chmod \s-1LIST\s0" 8
-.IX Xref "chmod permission mode"
-.IX Item "chmod LIST"
-Changes the permissions of a list of files. The first element of the
-list must be the numerical mode, which should probably be an octal
-number, and which definitely should \fInot\fR be a string of octal digits:
-\&\f(CW0644\fR is okay, \f(CW'0644'\fR is not. Returns the number of files
-successfully changed. See also \*(L"oct\*(R", if all you have is a string.
-.Sp
-.Vb 6
-\& $cnt = chmod 0755, 'foo', 'bar';
-\& chmod 0755, @executables;
-\& $mode = '0644'; chmod $mode, 'foo'; # !!! sets mode to
-\& # --w----r-T
-\& $mode = '0644'; chmod oct($mode), 'foo'; # this is better
-\& $mode = 0644; chmod $mode, 'foo'; # this is best
-.Ve
-.Sp
-On systems that support fchmod, you might pass file handles among the
-files. On systems that don't support fchmod, passing file handles
-produces a fatal error at run time.
-.Sp
-.Vb 3
-\& open(my $fh, "<", "foo");
-\& my $perm = (stat $fh)[2] & 07777;
-\& chmod($perm | 0600, $fh);
-.Ve
-.Sp
-You can also import the symbolic \f(CW\*(C`S_I*\*(C'\fR constants from the Fcntl
-module:
-.Sp
-.Vb 1
-\& use Fcntl ':mode';
-.Ve
-.Sp
-.Vb 2
-\& chmod S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH, @executables;
-\& # This is identical to the chmod 0755 of the above example.
-.Ve
-.IP "chomp \s-1VARIABLE\s0" 8
-.IX Xref "chomp INPUT_RECORD_SEPARATOR $ newline eol"
-.IX Item "chomp VARIABLE"
-.PD 0
-.IP "chomp( \s-1LIST\s0 )" 8
-.IX Item "chomp( LIST )"
-.IP "chomp" 8
-.IX Item "chomp"
-.PD
-This safer version of \*(L"chop\*(R" removes any trailing string
-that corresponds to the current value of \f(CW$/\fR (also known as
-\&\f(CW$INPUT_RECORD_SEPARATOR\fR in the \f(CW\*(C`English\*(C'\fR module). It returns the total
-number of characters removed from all its arguments. It's often used to
-remove the newline from the end of an input record when you're worried
-that the final record may be missing its newline. When in paragraph
-mode (\f(CW\*(C`$/ = ""\*(C'\fR), it removes all trailing newlines from the string.
-When in slurp mode (\f(CW\*(C`$/ = undef\*(C'\fR) or fixed-length record mode (\f(CW$/\fR is
-a reference to an integer or the like, see perlvar) \fIchomp()\fR won't
-remove anything.
-If \s-1VARIABLE\s0 is omitted, it chomps \f(CW$_\fR. Example:
-.Sp
-.Vb 5
-\& while (<>) {
-\& chomp; # avoid \en on last field
-\& @array = split(/:/);
-\& # ...
-\& }
-.Ve
-.Sp
-If \s-1VARIABLE\s0 is a hash, it chomps the hash's values, but not its keys.
-.Sp
-
diff --git a/tests/examplefiles/phpMyAdmin.spec b/tests/examplefiles/phpMyAdmin.spec
deleted file mode 100644
index 120fbc92..00000000
--- a/tests/examplefiles/phpMyAdmin.spec
+++ /dev/null
@@ -1,163 +0,0 @@
-%define _myadminpath /var/www/myadmin
-%define pkgrelease rc1
-%define microrelease 1
-
-Name: phpMyAdmin
-Version: 3.1.1
-Release: %{pkgrelease}.%{microrelease}
-License: GPL
-Group: Applications/Databases/Interfaces
-Source0: http://prdownloads.sourceforge.net/phpmyadmin/%{name}-%{version}-%{pkgrelease}.tar.bz2
-Source1: phpMyAdmin-http.conf
-URL: http://sourceforge.net/projects/phpmyadmin/
-Requires: mysql
-Requires: php-mysql
-Buildarch: noarch
-#BuildRoot: %{_tmppath}/%{name}-root
-
-Summary: phpMyAdmin - web-based MySQL administration
-
-%description
-phpMyAdmin can manage a whole MySQL-server (needs a super-user) but
-also a single database. To accomplish the latter you'll need a
-properly set up MySQL-user which can read/write only the desired
-database. It's up to you to look up the appropiate part in the MySQL
-manual. Currently phpMyAdmin can:
- - create and drop databases
- - create, copy, drop and alter tables
- - delete, edit and add fields
- - execute any SQL-statement, even batch-queries
- - manage keys on fields
- - load text files into tables
- - create (*) and read dumps of tables
- - export (*) and import data to CSV values
- - administer multiple servers and single databases
- - check referencial integrity
- - create complex queries automatically connecting required tables
- - create PDF graphics of your database layout
- - communicate in more than 38 different languages
-
-
-%prep
-%setup -q -n %{name}-%{version}-%{pkgrelease}
-
-
-%build
-
-
-%install
-[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d "${RPM_BUILD_ROOT}" ] && \
- rm -rf "${RPM_BUILD_ROOT}"
-
-# Create directories.
-
-install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/{css,js,lang,libraries,themes}
-install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/libraries/{auth,dbg,dbi,engines}
-install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/libraries/{export,tcpdf,import}
-install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/libraries/transformations
-install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/libraries/tcpdf/font
-install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/themes/{darkblue_orange,original}
-install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/themes/darkblue_orange/{css,img}
-install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/themes/original/{css,img}
-
-# Install files.
-
-install libraries/config.default.php \
- "${RPM_BUILD_ROOT}%{_myadminpath}"/config.inc.php
-install *.{php,ico} "${RPM_BUILD_ROOT}%{_myadminpath}"/
-install ChangeLog LICENSE README "${RPM_BUILD_ROOT}%{_myadminpath}"/
-install Documentation.html docs.css "${RPM_BUILD_ROOT}%{_myadminpath}"/
-install css/* "${RPM_BUILD_ROOT}%{_myadminpath}/css"/
-install js/* "${RPM_BUILD_ROOT}%{_myadminpath}/js"/
-install lang/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/lang"/
-install libraries/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries"/
-install libraries/auth/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/auth"/
-install libraries/dbg/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/dbg"/
-install libraries/dbi/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/dbi"/
-install libraries/engines/*.php \
- "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/engines"/
-install libraries/export/*.php \
- "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/export"/
-install libraries/tcpdf/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/tcpdf"/
-install libraries/tcpdf/font/*.{php,z} \
- "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/tcpdf/font"/
-install libraries/import/*.php \
- "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/import"/
-install libraries/transformations/*.php \
- "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/transformations"/
-install themes/darkblue_orange/*.{php,png} \
- "${RPM_BUILD_ROOT}%{_myadminpath}/themes/darkblue_orange"/
-install themes/darkblue_orange/css/*.php \
- "${RPM_BUILD_ROOT}%{_myadminpath}/themes/darkblue_orange/css"/
-install themes/darkblue_orange/img/*.{png,ico} \
- "${RPM_BUILD_ROOT}%{_myadminpath}/themes/darkblue_orange/img"/
-install themes/original/*.{php,png} \
- "${RPM_BUILD_ROOT}%{_myadminpath}/themes/original"/
-install themes/original/css/*.php \
- "${RPM_BUILD_ROOT}%{_myadminpath}/themes/original/css"/
-install themes/original/img/*.{png,ico} \
- "${RPM_BUILD_ROOT}%{_myadminpath}/themes/original/img"/
-
-# Create documentation directories.
-
-DOCROOT="${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}"
-install -d "${DOCROOT}"
-install -d "${DOCROOT}"/{lang,scripts,transformations}
-
-# Install documentation files.
-
-install RELEASE-DATE-* "${DOCROOT}"/
-install CREDITS ChangeLog INSTALL LICENSE "${DOCROOT}"/
-install README TODO "${DOCROOT}"/
-install Documentation.* docs.css "${DOCROOT}"/
-install translators.html "${DOCROOT}"/
-install lang/*.sh "${DOCROOT}"/lang/
-install scripts/* "${DOCROOT}"/scripts/
-install libraries/tcpdf/README "${DOCROOT}"/README.tcpdf
-install libraries/import/README "${DOCROOT}"/README.import
-install libraries/transformations/README "${DOCROOT}"/transformations/
-install libraries/transformations/TEMPLATE* "${DOCROOT}"/transformations/
-install libraries/transformations/*.sh "${DOCROOT}"/transformations/
-
-# Install configuration file for Apache.
-
-install -d "${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d"
-install "%{SOURCE1}" \
- "${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/phpMyAdmin.conf"
-
-# Generate non-configuration file list.
-
-(cd "${RPM_BUILD_ROOT}"; ls -d ."%{_myadminpath}"/*) |
- sed -e '/\/config\.inc\.php$/d' -e 's/^.//' > files.list
-
-
-
-%clean
-[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d "${RPM_BUILD_ROOT}" ] && \
- rm -rf "${RPM_BUILD_ROOT}"
-
-
-%files -f files.list
-%defattr(644, root, root, 755)
-%doc %{_docdir}/%{name}-%{version}
-%dir %{_myadminpath}
-%attr(640,root,apache) %config(noreplace) %verify(not size mtime md5) %{_myadminpath}/config.inc.php
-%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/conf.d/*
-
-
-%changelog
-* Thu Feb 23 2006 Patrick Monnerat <pm@datasphere.ch>
-- Version 2.8.0-rc1.1.
-
-* Thu Dec 22 2005 Patrick Monnerat <patrick.monnerat@econophone.ch>
-- Path "nullpw" to allow trying connection with null password after failure.
-- Version 2.7.0-pl1.1.
-
-* Mon Aug 22 2005 Patrick Monnerat <patrick.monnerat@econophone.ch>
-- Version 2.6.3-pl1.
-
-* Wed Jul 21 2004 Patrick Monnerat <patrick.monnerat@econophone.ch>
-- Version 2.5.7-pl1.
-
-* Fri Nov 22 2002 Patrick Monnerat <patrick.monnerat@econophone.ch>
-- Version 2.3.0-rc1.
diff --git a/tests/examplefiles/phpcomplete.vim b/tests/examplefiles/phpcomplete.vim
deleted file mode 100644
index 17d74fd8..00000000
--- a/tests/examplefiles/phpcomplete.vim
+++ /dev/null
@@ -1,567 +0,0 @@
-" Vim completion script
-" Language: PHP
-" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2006 May 9
-"
-" TODO:
-" - Class aware completion:
-" a) caching?
-" - Switching to HTML (XML?) completion (SQL) inside of phpStrings
-" - allow also for XML completion <- better do html_flavor for HTML
-" completion
-" - outside of <?php?> getting parent tag may cause problems. Heh, even in
-" perfect conditions GetLastOpenTag doesn't cooperate... Inside of
-" phpStrings this can be even a bonus but outside of <?php?> it is not the
-" best situation
-
-function! phpcomplete#CompletePHP(findstart, base)
- if a:findstart
- unlet! b:php_menu
- " Check if we are inside of PHP markup
- let pos = getpos('.')
- let phpbegin = searchpairpos('<?', '', '?>', 'bWn',
- \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\|comment"')
- let phpend = searchpairpos('<?', '', '?>', 'Wn',
- \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\|comment"')
-
- if phpbegin == [0,0] && phpend == [0,0]
- " We are outside of any PHP markup. Complete HTML
- let htmlbegin = htmlcomplete#CompleteTags(1, '')
- let cursor_col = pos[2]
- let base = getline('.')[htmlbegin : cursor_col]
- let b:php_menu = htmlcomplete#CompleteTags(0, base)
- return htmlbegin
- else
- " locate the start of the word
- let line = getline('.')
- let start = col('.') - 1
- let curline = line('.')
- let compl_begin = col('.') - 2
- while start >= 0 && line[start - 1] =~ '[a-zA-Z_0-9\x7f-\xff$]'
- let start -= 1
- endwhile
- let b:compl_context = getline('.')[0:compl_begin]
- return start
-
- " We can be also inside of phpString with HTML tags. Deal with
- " it later (time, not lines).
- endif
-
- endif
- " If exists b:php_menu it means completion was already constructed we
- " don't need to do anything more
- if exists("b:php_menu")
- return b:php_menu
- endif
- " Initialize base return lists
- let res = []
- let res2 = []
- " a:base is very short - we need context
- if exists("b:compl_context")
- let context = b:compl_context
- unlet! b:compl_context
- endif
-
- if !exists('g:php_builtin_functions')
- call phpcomplete#LoadData()
- endif
-
- let scontext = substitute(context, '\$\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*$', '', '')
-
- if scontext =~ '\(=\s*new\|extends\)\s\+$'
- " Complete class name
- " Internal solution for finding classes in current file.
- let file = getline(1, '$')
- call filter(file,
- \ 'v:val =~ "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
- let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
- let jfile = join(file, ' ')
- let int_values = split(jfile, 'class\s\+')
- let int_classes = {}
- for i in int_values
- let c_name = matchstr(i, '^[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
- if c_name != ''
- let int_classes[c_name] = ''
- endif
- endfor
-
- " Prepare list of classes from tags file
- let ext_classes = {}
- let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
- if fnames != ''
- exe 'silent! vimgrep /^'.a:base.'.*\tc\(\t\|$\)/j '.fnames
- let qflist = getqflist()
- if len(qflist) > 0
- for field in qflist
- " [:space:] thing: we don't have to be so strict when
- " dealing with tags files - entries there were already
- " checked by ctags.
- let item = matchstr(field['text'], '^[^[:space:]]\+')
- let ext_classes[item] = ''
- endfor
- endif
- endif
-
- " Prepare list of built in classes from g:php_builtin_functions
- if !exists("g:php_omni_bi_classes")
- let g:php_omni_bi_classes = {}
- for i in keys(g:php_builtin_object_functions)
- let g:php_omni_bi_classes[substitute(i, '::.*$', '', '')] = ''
- endfor
- endif
-
- let classes = sort(keys(int_classes))
- let classes += sort(keys(ext_classes))
- let classes += sort(keys(g:php_omni_bi_classes))
-
- for m in classes
- if m =~ '^'.a:base
- call add(res, m)
- endif
- endfor
-
- let final_menu = []
- for i in res
- let final_menu += [{'word':i, 'kind':'c'}]
- endfor
-
- return final_menu
-
- elseif scontext =~ '\(->\|::\)$'
- " Complete user functions and variables
- " Internal solution for current file.
- " That seems as unnecessary repeating of functions but there are
- " few not so subtle differences as not appending of $ and addition
- " of 'kind' tag (not necessary in regular completion)
-
- if scontext =~ '->$' && scontext !~ '\$this->$'
-
- " Get name of the class
- let classname = phpcomplete#GetClassName(scontext)
-
- " Get location of class definition, we have to iterate through all
- " tags files separately because we need relative path from current
- " file to the exact file (tags file can be in different dir)
- if classname != ''
- let classlocation = phpcomplete#GetClassLocation(classname)
- else
- let classlocation = ''
- endif
-
- if classlocation == 'VIMPHP_BUILTINOBJECT'
-
- for object in keys(g:php_builtin_object_functions)
- if object =~ '^'.classname
- let res += [{'word':substitute(object, '.*::', '', ''),
- \ 'info': g:php_builtin_object_functions[object]}]
- endif
- endfor
-
- return res
-
- endif
-
- if filereadable(classlocation)
- let classfile = readfile(classlocation)
- let classcontent = ''
- let classcontent .= "\n".phpcomplete#GetClassContents(classfile, classname)
- let sccontent = split(classcontent, "\n")
-
- " YES, YES, YES! - we have whole content including extends!
- " Now we need to get two elements: public functions and public
- " vars
- " NO, NO, NO! - third separate filtering looking for content
- " :(, but all of them have differences. To squeeze them into
- " one implementation would require many additional arguments
- " and ifs. No good solution
- " Functions declared with public keyword or without any
- " keyword are public
- let functions = filter(deepcopy(sccontent),
- \ 'v:val =~ "^\\s*\\(static\\s\\+\\|public\\s\\+\\)*function"')
- let jfuncs = join(functions, ' ')
- let sfuncs = split(jfuncs, 'function\s\+')
- let c_functions = {}
- for i in sfuncs
- let f_name = matchstr(i,
- \ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
- let f_args = matchstr(i,
- \ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*{')
- if f_name != ''
- let c_functions[f_name.'('] = f_args
- endif
- endfor
- " Variables declared with var or with public keyword are
- " public
- let variables = filter(deepcopy(sccontent),
- \ 'v:val =~ "^\\s*\\(public\\|var\\)\\s\\+\\$"')
- let jvars = join(variables, ' ')
- let svars = split(jvars, '\$')
- let c_variables = {}
- for i in svars
- let c_var = matchstr(i,
- \ '^\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
- if c_var != ''
- let c_variables[c_var] = ''
- endif
- endfor
-
- let all_values = {}
- call extend(all_values, c_functions)
- call extend(all_values, c_variables)
-
- for m in sort(keys(all_values))
- if m =~ '^'.a:base && m !~ '::'
- call add(res, m)
- elseif m =~ '::'.a:base
- call add(res2, m)
- endif
- endfor
-
- let start_list = res + res2
-
- let final_list = []
- for i in start_list
- if has_key(c_variables, i)
- let class = ' '
- if all_values[i] != ''
- let class = i.' class '
- endif
- let final_list +=
- \ [{'word':i,
- \ 'info':class.all_values[i],
- \ 'kind':'v'}]
- else
- let final_list +=
- \ [{'word':substitute(i, '.*::', '', ''),
- \ 'info':i.all_values[i].')',
- \ 'kind':'f'}]
- endif
- endfor
-
- return final_list
-
- endif
-
- endif
-
- if a:base =~ '^\$'
- let adddollar = '$'
- else
- let adddollar = ''
- endif
- let file = getline(1, '$')
- let jfile = join(file, ' ')
- let sfile = split(jfile, '\$')
- let int_vars = {}
- for i in sfile
- if i =~ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*=\s*new'
- let val = matchstr(i, '^[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*').'->'
- else
- let val = matchstr(i, '^[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
- endif
- if val !~ ''
- let int_vars[adddollar.val] = ''
- endif
- endfor
-
- " ctags has good support for PHP, use tags file for external
- " variables
- let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
- let ext_vars = {}
- if fnames != ''
- let sbase = substitute(a:base, '^\$', '', '')
- exe 'silent! vimgrep /^'.sbase.'.*\tv\(\t\|$\)/j '.fnames
- let qflist = getqflist()
- if len(qflist) > 0
- for field in qflist
- let item = matchstr(field['text'], '^[^[:space:]]\+')
- " Add -> if it is possible object declaration
- let classname = ''
- if field['text'] =~ item.'\s*=\s*new\s\+'
- let item = item.'->'
- let classname = matchstr(field['text'],
- \ '=\s*new\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze')
- endif
- let ext_vars[adddollar.item] = classname
- endfor
- endif
- endif
-
- " Now we have all variables in int_vars dictionary
- call extend(int_vars, ext_vars)
-
- " Internal solution for finding functions in current file.
- let file = getline(1, '$')
- call filter(file,
- \ 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
- let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
- let jfile = join(file, ' ')
- let int_values = split(jfile, 'function\s\+')
- let int_functions = {}
- for i in int_values
- let f_name = matchstr(i,
- \ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
- let f_args = matchstr(i,
- \ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*{')
- let int_functions[f_name.'('] = f_args.')'
- endfor
-
- " Prepare list of functions from tags file
- let ext_functions = {}
- if fnames != ''
- exe 'silent! vimgrep /^'.a:base.'.*\tf\(\t\|$\)/j '.fnames
- let qflist = getqflist()
- if len(qflist) > 0
- for field in qflist
- " File name
- let item = matchstr(field['text'], '^[^[:space:]]\+')
- let fname = matchstr(field['text'], '\t\zs\f\+\ze')
- let prototype = matchstr(field['text'],
- \ 'function\s\+&\?[^[:space:]]\+\s*(\s*\zs.\{-}\ze\s*)\s*{\?')
- let ext_functions[item.'('] = prototype.') - '.fname
- endfor
- endif
- endif
-
- let all_values = {}
- call extend(all_values, int_functions)
- call extend(all_values, ext_functions)
- call extend(all_values, int_vars) " external variables are already in
- call extend(all_values, g:php_builtin_object_functions)
-
- for m in sort(keys(all_values))
- if m =~ '\(^\|::\)'.a:base
- call add(res, m)
- endif
- endfor
-
- let start_list = res
-
- let final_list = []
- for i in start_list
- if has_key(int_vars, i)
- let class = ' '
- if all_values[i] != ''
- let class = i.' class '
- endif
- let final_list += [{'word':i, 'info':class.all_values[i], 'kind':'v'}]
- else
- let final_list +=
- \ [{'word':substitute(i, '.*::', '', ''),
- \ 'info':i.all_values[i],
- \ 'kind':'f'}]
- endif
- endfor
-
- return final_list
- endif
-
- if a:base =~ '^\$'
- " Complete variables
- " Built-in variables {{{
- let g:php_builtin_vars = {'$GLOBALS':'',
- \ '$_SERVER':'',
- \ '$_GET':'',
- \ '$_POST':'',
- \ '$_COOKIE':'',
- \ '$_FILES':'',
- \ '$_ENV':'',
- \ '$_REQUEST':'',
- \ '$_SESSION':'',
- \ '$HTTP_SERVER_VARS':'',
- \ '$HTTP_ENV_VARS':'',
- \ '$HTTP_COOKIE_VARS':'',
- \ '$HTTP_GET_VARS':'',
- \ '$HTTP_POST_VARS':'',
- \ '$HTTP_POST_FILES':'',
- \ '$HTTP_SESSION_VARS':'',
- \ '$php_errormsg':'',
- \ '$this':''
- \ }
- " }}}
-
- " Internal solution for current file.
- let file = getline(1, '$')
- let jfile = join(file, ' ')
- let int_vals = split(jfile, '\ze\$')
- let int_vars = {}
- for i in int_vals
- if i =~ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*=\s*new'
- let val = matchstr(i,
- \ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*').'->'
- else
- let val = matchstr(i,
- \ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
- endif
- if val != ''
- let int_vars[val] = ''
- endif
- endfor
-
- call extend(int_vars,g:php_builtin_vars)
-
- " ctags has support for PHP, use tags file for external variables
- let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
- let ext_vars = {}
- if fnames != ''
- let sbase = substitute(a:base, '^\$', '', '')
- exe 'silent! vimgrep /^'.sbase.'.*\tv\(\t\|$\)/j '.fnames
- let qflist = getqflist()
- if len(qflist) > 0
- for field in qflist
- let item = '$'.matchstr(field['text'], '^[^[:space:]]\+')
- let m_menu = ''
- " Add -> if it is possible object declaration
- if field['text'] =~ item.'\s*=\s*new\s\+'
- let item = item.'->'
- let m_menu = matchstr(field['text'],
- \ '=\s*new\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze')
- endif
- let ext_vars[item] = m_menu
- endfor
- endif
- endif
-
- call extend(int_vars, ext_vars)
- let g:a0 = keys(int_vars)
-
- for m in sort(keys(int_vars))
- if m =~ '^\'.a:base
- call add(res, m)
- endif
- endfor
-
- let int_list = res
-
- let int_dict = []
- for i in int_list
- if int_vars[i] != ''
- let class = ' '
- if int_vars[i] != ''
- let class = i.' class '
- endif
- let int_dict += [{'word':i, 'info':class.int_vars[i], 'kind':'v'}]
- else
- let int_dict += [{'word':i, 'kind':'v'}]
- endif
- endfor
-
- return int_dict
-
- else
- " Complete everything else -
- " + functions, DONE
- " + keywords of language DONE
- " + defines (constant definitions), DONE
- " + extend keywords for predefined constants, DONE
- " + classes (after new), DONE
- " + limit choice after -> and :: to funcs and vars DONE
-
- " Internal solution for finding functions in current file.
- let file = getline(1, '$')
- call filter(file,
- \ 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
- let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
- let jfile = join(file, ' ')
- let int_values = split(jfile, 'function\s\+')
- let int_functions = {}
- for i in int_values
- let f_name = matchstr(i,
- \ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
- let f_args = matchstr(i,
- \ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\s*\zs.\{-}\ze\s*)\_s*{')
- let int_functions[f_name.'('] = f_args.')'
- endfor
-
- " Prepare list of functions from tags file
- let ext_functions = {}
- if fnames != ''
- exe 'silent! vimgrep /^'.a:base.'.*\tf\(\t\|$\)/j '.fnames
- let qflist = getqflist()
- if len(qflist) > 0
- for field in qflist
- " File name
- let item = matchstr(field['text'], '^[^[:space:]]\+')
- let fname = matchstr(field['text'], '\t\zs\f\+\ze')
- let prototype = matchstr(field['text'],
- \ 'function\s\+&\?[^[:space:]]\+\s*(\s*\zs.\{-}\ze\s*)\s*{\?')
- let ext_functions[item.'('] = prototype.') - '.fname
- endfor
- endif
- endif
-
- " All functions
- call extend(int_functions, ext_functions)
- call extend(int_functions, g:php_builtin_functions)
-
- " Internal solution for finding constants in current file
- let file = getline(1, '$')
- call filter(file, 'v:val =~ "define\\s*("')
- let jfile = join(file, ' ')
- let int_values = split(jfile, 'define\s*(\s*')
- let int_constants = {}
- for i in int_values
- let c_name = matchstr(i, '\(["'']\)\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze\1')
- " let c_value = matchstr(i,
- " \ '\(["'']\)[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\1\s*,\s*\zs.\{-}\ze\s*)')
- if c_name != ''
- let int_constants[c_name] = '' " c_value
- endif
- endfor
-
- " Prepare list of constants from tags file
- let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
- let ext_constants = {}
- if fnames != ''
- exe 'silent! vimgrep /^'.a:base.'.*\td\(\t\|$\)/j '.fnames
- let qflist = getqflist()
- if len(qflist) > 0
- for field in qflist
- let item = matchstr(field['text'], '^[^[:space:]]\+')
- let ext_constants[item] = ''
- endfor
- endif
- endif
-
- " All constants
- call extend(int_constants, ext_constants)
- " Treat keywords as constants
-
- let all_values = {}
-
- " One big dictionary of functions
- call extend(all_values, int_functions)
-
- " Add constants
- call extend(all_values, int_constants)
- " Add keywords
- call extend(all_values, g:php_keywords)
-
- for m in sort(keys(all_values))
- if m =~ '^'.a:base
- call add(res, m)
- endif
- endfor
-
- let int_list = res
-
- let final_list = []
- for i in int_list
- if has_key(int_functions, i)
- let final_list +=
- \ [{'word':i,
- \ 'info':i.int_functions[i],
- \ 'kind':'f'}]
- elseif has_key(int_constants, i)
- let final_list += [{'word':i, 'kind':'d'}]
- else
- let final_list += [{'word':i}]
- endif
- endfor
-
- return final_list
-
- endif
-
-endfunction
-" vim:set foldmethod=marker:
diff --git a/tests/examplefiles/pkgconfig_example.pc b/tests/examplefiles/pkgconfig_example.pc
deleted file mode 100644
index 2a59204e..00000000
--- a/tests/examplefiles/pkgconfig_example.pc
+++ /dev/null
@@ -1,18 +0,0 @@
-# This is for a fictional package `yet another portable hatchpotch generator'.
-prefix=/usr/local/opt/site/private # define variable `prefix`
-exec_prefix=${prefix} # using variable reference
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
-just_for_test=$${this is not a part of variable reference} # escape with `$$`
-
-Name: YAPHatchPotchGen
-Description: Yet Another Portable HatchPotch GENerator.
-Version: 352.9.3
-URL: http://www9.yaphatchpotchgen.net # Don't access.
-Requires: piyohogelib-9.0 = 9.5.3
-Requires.private: nyorolib-3.0 = 3.0.9
-Conflicts: apiyohoge <= 8.3
-Libs: -L${libdir} -lyaphatchpotchgen-352.9 # using variable reference
-Libs.private: -ll -ly
-Cflags: -I${includedir}/piyohogelib-9.0 -I${libdir}/yaphatchpotchgen/include
-
diff --git a/tests/examplefiles/plain.bst b/tests/examplefiles/plain.bst
deleted file mode 100644
index 7adf4bb0..00000000
--- a/tests/examplefiles/plain.bst
+++ /dev/null
@@ -1,1097 +0,0 @@
-% BibTeX standard bibliography style `plain'
- % Version 0.99b (8-Dec-10 release) for BibTeX versions 0.99a or later.
- % Copyright (C) 1984, 1985, 1988, 2010 Howard Trickey and Oren Patashnik.
- % Unlimited copying and redistribution of this file are permitted as long as
- % it is unmodified. Modifications (and redistribution of modified versions)
- % are also permitted, but only if the resulting file is renamed to something
- % besides btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
- % This restriction helps ensure that all standard styles are identical.
- % The file btxbst.doc has the documentation for this style.
-
-ENTRY
- { address
- author
- booktitle
- chapter
- edition
- editor
- howpublished
- institution
- journal
- key
- month
- note
- number
- organization
- pages
- publisher
- school
- series
- title
- type
- volume
- year
- }
- {}
- { label }
-
-INTEGERS { output.state before.all mid.sentence after.sentence after.block }
-
-FUNCTION {init.state.consts}
-{ #0 'before.all :=
- #1 'mid.sentence :=
- #2 'after.sentence :=
- #3 'after.block :=
-}
-
-STRINGS { s t }
-
-FUNCTION {output.nonnull}
-{ 's :=
- output.state mid.sentence =
- { ", " * write$ }
- { output.state after.block =
- { add.period$ write$
- newline$
- "\newblock " write$
- }
- { output.state before.all =
- 'write$
- { add.period$ " " * write$ }
- if$
- }
- if$
- mid.sentence 'output.state :=
- }
- if$
- s
-}
-
-FUNCTION {output}
-{ duplicate$ empty$
- 'pop$
- 'output.nonnull
- if$
-}
-
-FUNCTION {output.check}
-{ 't :=
- duplicate$ empty$
- { pop$ "empty " t * " in " * cite$ * warning$ }
- 'output.nonnull
- if$
-}
-
-FUNCTION {output.bibitem}
-{ newline$
- "\bibitem{" write$
- cite$ write$
- "}" write$
- newline$
- ""
- before.all 'output.state :=
-}
-
-FUNCTION {fin.entry}
-{ add.period$
- write$
- newline$
-}
-
-FUNCTION {new.block}
-{ output.state before.all =
- 'skip$
- { after.block 'output.state := }
- if$
-}
-
-FUNCTION {new.sentence}
-{ output.state after.block =
- 'skip$
- { output.state before.all =
- 'skip$
- { after.sentence 'output.state := }
- if$
- }
- if$
-}
-
-FUNCTION {not}
-{ { #0 }
- { #1 }
- if$
-}
-
-FUNCTION {and}
-{ 'skip$
- { pop$ #0 }
- if$
-}
-
-FUNCTION {or}
-{ { pop$ #1 }
- 'skip$
- if$
-}
-
-FUNCTION {new.block.checka}
-{ empty$
- 'skip$
- 'new.block
- if$
-}
-
-FUNCTION {new.block.checkb}
-{ empty$
- swap$ empty$
- and
- 'skip$
- 'new.block
- if$
-}
-
-FUNCTION {new.sentence.checka}
-{ empty$
- 'skip$
- 'new.sentence
- if$
-}
-
-FUNCTION {new.sentence.checkb}
-{ empty$
- swap$ empty$
- and
- 'skip$
- 'new.sentence
- if$
-}
-
-FUNCTION {field.or.null}
-{ duplicate$ empty$
- { pop$ "" }
- 'skip$
- if$
-}
-
-FUNCTION {emphasize}
-{ duplicate$ empty$
- { pop$ "" }
- { "{\em " swap$ * "}" * }
- if$
-}
-
-INTEGERS { nameptr namesleft numnames }
-
-FUNCTION {format.names}
-{ 's :=
- #1 'nameptr :=
- s num.names$ 'numnames :=
- numnames 'namesleft :=
- { namesleft #0 > }
- { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
- nameptr #1 >
- { namesleft #1 >
- { ", " * t * }
- { numnames #2 >
- { "," * }
- 'skip$
- if$
- t "others" =
- { " et~al." * }
- { " and " * t * }
- if$
- }
- if$
- }
- 't
- if$
- nameptr #1 + 'nameptr :=
- namesleft #1 - 'namesleft :=
- }
- while$
-}
-
-FUNCTION {format.authors}
-{ author empty$
- { "" }
- { author format.names }
- if$
-}
-
-FUNCTION {format.editors}
-{ editor empty$
- { "" }
- { editor format.names
- editor num.names$ #1 >
- { ", editors" * }
- { ", editor" * }
- if$
- }
- if$
-}
-
-FUNCTION {format.title}
-{ title empty$
- { "" }
- { title "t" change.case$ }
- if$
-}
-
-FUNCTION {n.dashify}
-{ 't :=
- ""
- { t empty$ not }
- { t #1 #1 substring$ "-" =
- { t #1 #2 substring$ "--" = not
- { "--" *
- t #2 global.max$ substring$ 't :=
- }
- { { t #1 #1 substring$ "-" = }
- { "-" *
- t #2 global.max$ substring$ 't :=
- }
- while$
- }
- if$
- }
- { t #1 #1 substring$ *
- t #2 global.max$ substring$ 't :=
- }
- if$
- }
- while$
-}
-
-FUNCTION {format.date}
-{ year empty$
- { month empty$
- { "" }
- { "there's a month but no year in " cite$ * warning$
- month
- }
- if$
- }
- { month empty$
- 'year
- { month " " * year * }
- if$
- }
- if$
-}
-
-FUNCTION {format.btitle}
-{ title emphasize
-}
-
-FUNCTION {tie.or.space.connect}
-{ duplicate$ text.length$ #3 <
- { "~" }
- { " " }
- if$
- swap$ * *
-}
-
-FUNCTION {either.or.check}
-{ empty$
- 'pop$
- { "can't use both " swap$ * " fields in " * cite$ * warning$ }
- if$
-}
-
-FUNCTION {format.bvolume}
-{ volume empty$
- { "" }
- { "volume" volume tie.or.space.connect
- series empty$
- 'skip$
- { " of " * series emphasize * }
- if$
- "volume and number" number either.or.check
- }
- if$
-}
-
-FUNCTION {format.number.series}
-{ volume empty$
- { number empty$
- { series field.or.null }
- { output.state mid.sentence =
- { "number" }
- { "Number" }
- if$
- number tie.or.space.connect
- series empty$
- { "there's a number but no series in " cite$ * warning$ }
- { " in " * series * }
- if$
- }
- if$
- }
- { "" }
- if$
-}
-
-FUNCTION {format.edition}
-{ edition empty$
- { "" }
- { output.state mid.sentence =
- { edition "l" change.case$ " edition" * }
- { edition "t" change.case$ " edition" * }
- if$
- }
- if$
-}
-
-INTEGERS { multiresult }
-
-FUNCTION {multi.page.check}
-{ 't :=
- #0 'multiresult :=
- { multiresult not
- t empty$ not
- and
- }
- { t #1 #1 substring$
- duplicate$ "-" =
- swap$ duplicate$ "," =
- swap$ "+" =
- or or
- { #1 'multiresult := }
- { t #2 global.max$ substring$ 't := }
- if$
- }
- while$
- multiresult
-}
-
-FUNCTION {format.pages}
-{ pages empty$
- { "" }
- { pages multi.page.check
- { "pages" pages n.dashify tie.or.space.connect }
- { "page" pages tie.or.space.connect }
- if$
- }
- if$
-}
-
-FUNCTION {format.vol.num.pages}
-{ volume field.or.null
- number empty$
- 'skip$
- { "(" number * ")" * *
- volume empty$
- { "there's a number but no volume in " cite$ * warning$ }
- 'skip$
- if$
- }
- if$
- pages empty$
- 'skip$
- { duplicate$ empty$
- { pop$ format.pages }
- { ":" * pages n.dashify * }
- if$
- }
- if$
-}
-
-FUNCTION {format.chapter.pages}
-{ chapter empty$
- 'format.pages
- { type empty$
- { "chapter" }
- { type "l" change.case$ }
- if$
- chapter tie.or.space.connect
- pages empty$
- 'skip$
- { ", " * format.pages * }
- if$
- }
- if$
-}
-
-FUNCTION {format.in.ed.booktitle}
-{ booktitle empty$
- { "" }
- { editor empty$
- { "In " booktitle emphasize * }
- { "In " format.editors * ", " * booktitle emphasize * }
- if$
- }
- if$
-}
-
-FUNCTION {empty.misc.check}
-{ author empty$ title empty$ howpublished empty$
- month empty$ year empty$ note empty$
- and and and and and
- key empty$ not and
- { "all relevant fields are empty in " cite$ * warning$ }
- 'skip$
- if$
-}
-
-FUNCTION {format.thesis.type}
-{ type empty$
- 'skip$
- { pop$
- type "t" change.case$
- }
- if$
-}
-
-FUNCTION {format.tr.number}
-{ type empty$
- { "Technical Report" }
- 'type
- if$
- number empty$
- { "t" change.case$ }
- { number tie.or.space.connect }
- if$
-}
-
-FUNCTION {format.article.crossref}
-{ key empty$
- { journal empty$
- { "need key or journal for " cite$ * " to crossref " * crossref *
- warning$
- ""
- }
- { "In {\em " journal * "\/}" * }
- if$
- }
- { "In " key * }
- if$
- " \cite{" * crossref * "}" *
-}
-
-FUNCTION {format.crossref.editor}
-{ editor #1 "{vv~}{ll}" format.name$
- editor num.names$ duplicate$
- #2 >
- { pop$ " et~al." * }
- { #2 <
- 'skip$
- { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
- { " et~al." * }
- { " and " * editor #2 "{vv~}{ll}" format.name$ * }
- if$
- }
- if$
- }
- if$
-}
-
-FUNCTION {format.book.crossref}
-{ volume empty$
- { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
- "In "
- }
- { "Volume" volume tie.or.space.connect
- " of " *
- }
- if$
- editor empty$
- editor field.or.null author field.or.null =
- or
- { key empty$
- { series empty$
- { "need editor, key, or series for " cite$ * " to crossref " *
- crossref * warning$
- "" *
- }
- { "{\em " * series * "\/}" * }
- if$
- }
- { key * }
- if$
- }
- { format.crossref.editor * }
- if$
- " \cite{" * crossref * "}" *
-}
-
-FUNCTION {format.incoll.inproc.crossref}
-{ editor empty$
- editor field.or.null author field.or.null =
- or
- { key empty$
- { booktitle empty$
- { "need editor, key, or booktitle for " cite$ * " to crossref " *
- crossref * warning$
- ""
- }
- { "In {\em " booktitle * "\/}" * }
- if$
- }
- { "In " key * }
- if$
- }
- { "In " format.crossref.editor * }
- if$
- " \cite{" * crossref * "}" *
-}
-
-FUNCTION {article}
-{ output.bibitem
- format.authors "author" output.check
- new.block
- format.title "title" output.check
- new.block
- crossref missing$
- { journal emphasize "journal" output.check
- format.vol.num.pages output
- format.date "year" output.check
- }
- { format.article.crossref output.nonnull
- format.pages output
- }
- if$
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {book}
-{ output.bibitem
- author empty$
- { format.editors "author and editor" output.check }
- { format.authors output.nonnull
- crossref missing$
- { "author and editor" editor either.or.check }
- 'skip$
- if$
- }
- if$
- new.block
- format.btitle "title" output.check
- crossref missing$
- { format.bvolume output
- new.block
- format.number.series output
- new.sentence
- publisher "publisher" output.check
- address output
- }
- { new.block
- format.book.crossref output.nonnull
- }
- if$
- format.edition output
- format.date "year" output.check
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {booklet}
-{ output.bibitem
- format.authors output
- new.block
- format.title "title" output.check
- howpublished address new.block.checkb
- howpublished output
- address output
- format.date output
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {inbook}
-{ output.bibitem
- author empty$
- { format.editors "author and editor" output.check }
- { format.authors output.nonnull
- crossref missing$
- { "author and editor" editor either.or.check }
- 'skip$
- if$
- }
- if$
- new.block
- format.btitle "title" output.check
- crossref missing$
- { format.bvolume output
- format.chapter.pages "chapter and pages" output.check
- new.block
- format.number.series output
- new.sentence
- publisher "publisher" output.check
- address output
- }
- { format.chapter.pages "chapter and pages" output.check
- new.block
- format.book.crossref output.nonnull
- }
- if$
- format.edition output
- format.date "year" output.check
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {incollection}
-{ output.bibitem
- format.authors "author" output.check
- new.block
- format.title "title" output.check
- new.block
- crossref missing$
- { format.in.ed.booktitle "booktitle" output.check
- format.bvolume output
- format.number.series output
- format.chapter.pages output
- new.sentence
- publisher "publisher" output.check
- address output
- format.edition output
- format.date "year" output.check
- }
- { format.incoll.inproc.crossref output.nonnull
- format.chapter.pages output
- }
- if$
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {inproceedings}
-{ output.bibitem
- format.authors "author" output.check
- new.block
- format.title "title" output.check
- new.block
- crossref missing$
- { format.in.ed.booktitle "booktitle" output.check
- format.bvolume output
- format.number.series output
- format.pages output
- address empty$
- { organization publisher new.sentence.checkb
- organization output
- publisher output
- format.date "year" output.check
- }
- { address output.nonnull
- format.date "year" output.check
- new.sentence
- organization output
- publisher output
- }
- if$
- }
- { format.incoll.inproc.crossref output.nonnull
- format.pages output
- }
- if$
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {conference} { inproceedings }
-
-FUNCTION {manual}
-{ output.bibitem
- author empty$
- { organization empty$
- 'skip$
- { organization output.nonnull
- address output
- }
- if$
- }
- { format.authors output.nonnull }
- if$
- new.block
- format.btitle "title" output.check
- author empty$
- { organization empty$
- { address new.block.checka
- address output
- }
- 'skip$
- if$
- }
- { organization address new.block.checkb
- organization output
- address output
- }
- if$
- format.edition output
- format.date output
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {mastersthesis}
-{ output.bibitem
- format.authors "author" output.check
- new.block
- format.title "title" output.check
- new.block
- "Master's thesis" format.thesis.type output.nonnull
- school "school" output.check
- address output
- format.date "year" output.check
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {misc}
-{ output.bibitem
- format.authors output
- title howpublished new.block.checkb
- format.title output
- howpublished new.block.checka
- howpublished output
- format.date output
- new.block
- note output
- fin.entry
- empty.misc.check
-}
-
-FUNCTION {phdthesis}
-{ output.bibitem
- format.authors "author" output.check
- new.block
- format.btitle "title" output.check
- new.block
- "PhD thesis" format.thesis.type output.nonnull
- school "school" output.check
- address output
- format.date "year" output.check
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {proceedings}
-{ output.bibitem
- editor empty$
- { organization output }
- { format.editors output.nonnull }
- if$
- new.block
- format.btitle "title" output.check
- format.bvolume output
- format.number.series output
- address empty$
- { editor empty$
- { publisher new.sentence.checka }
- { organization publisher new.sentence.checkb
- organization output
- }
- if$
- publisher output
- format.date "year" output.check
- }
- { address output.nonnull
- format.date "year" output.check
- new.sentence
- editor empty$
- 'skip$
- { organization output }
- if$
- publisher output
- }
- if$
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {techreport}
-{ output.bibitem
- format.authors "author" output.check
- new.block
- format.title "title" output.check
- new.block
- format.tr.number output.nonnull
- institution "institution" output.check
- address output
- format.date "year" output.check
- new.block
- note output
- fin.entry
-}
-
-FUNCTION {unpublished}
-{ output.bibitem
- format.authors "author" output.check
- new.block
- format.title "title" output.check
- new.block
- note "note" output.check
- format.date output
- fin.entry
-}
-
-FUNCTION {default.type} { misc }
-
-MACRO {jan} {"January"}
-
-MACRO {feb} {"February"}
-
-MACRO {mar} {"March"}
-
-MACRO {apr} {"April"}
-
-MACRO {may} {"May"}
-
-MACRO {jun} {"June"}
-
-MACRO {jul} {"July"}
-
-MACRO {aug} {"August"}
-
-MACRO {sep} {"September"}
-
-MACRO {oct} {"October"}
-
-MACRO {nov} {"November"}
-
-MACRO {dec} {"December"}
-
-MACRO {acmcs} {"ACM Computing Surveys"}
-
-MACRO {acta} {"Acta Informatica"}
-
-MACRO {cacm} {"Communications of the ACM"}
-
-MACRO {ibmjrd} {"IBM Journal of Research and Development"}
-
-MACRO {ibmsj} {"IBM Systems Journal"}
-
-MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
-
-MACRO {ieeetc} {"IEEE Transactions on Computers"}
-
-MACRO {ieeetcad}
- {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
-
-MACRO {ipl} {"Information Processing Letters"}
-
-MACRO {jacm} {"Journal of the ACM"}
-
-MACRO {jcss} {"Journal of Computer and System Sciences"}
-
-MACRO {scp} {"Science of Computer Programming"}
-
-MACRO {sicomp} {"SIAM Journal on Computing"}
-
-MACRO {tocs} {"ACM Transactions on Computer Systems"}
-
-MACRO {tods} {"ACM Transactions on Database Systems"}
-
-MACRO {tog} {"ACM Transactions on Graphics"}
-
-MACRO {toms} {"ACM Transactions on Mathematical Software"}
-
-MACRO {toois} {"ACM Transactions on Office Information Systems"}
-
-MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
-
-MACRO {tcs} {"Theoretical Computer Science"}
-
-READ
-
-FUNCTION {sortify}
-{ purify$
- "l" change.case$
-}
-
-INTEGERS { len }
-
-FUNCTION {chop.word}
-{ 's :=
- 'len :=
- s #1 len substring$ =
- { s len #1 + global.max$ substring$ }
- 's
- if$
-}
-
-FUNCTION {sort.format.names}
-{ 's :=
- #1 'nameptr :=
- ""
- s num.names$ 'numnames :=
- numnames 'namesleft :=
- { namesleft #0 > }
- { nameptr #1 >
- { " " * }
- 'skip$
- if$
- s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
- nameptr numnames = t "others" = and
- { "et al" * }
- { t sortify * }
- if$
- nameptr #1 + 'nameptr :=
- namesleft #1 - 'namesleft :=
- }
- while$
-}
-
-FUNCTION {sort.format.title}
-{ 't :=
- "A " #2
- "An " #3
- "The " #4 t chop.word
- chop.word
- chop.word
- sortify
- #1 global.max$ substring$
-}
-
-FUNCTION {author.sort}
-{ author empty$
- { key empty$
- { "to sort, need author or key in " cite$ * warning$
- ""
- }
- { key sortify }
- if$
- }
- { author sort.format.names }
- if$
-}
-
-FUNCTION {author.editor.sort}
-{ author empty$
- { editor empty$
- { key empty$
- { "to sort, need author, editor, or key in " cite$ * warning$
- ""
- }
- { key sortify }
- if$
- }
- { editor sort.format.names }
- if$
- }
- { author sort.format.names }
- if$
-}
-
-FUNCTION {author.organization.sort}
-{ author empty$
- { organization empty$
- { key empty$
- { "to sort, need author, organization, or key in " cite$ * warning$
- ""
- }
- { key sortify }
- if$
- }
- { "The " #4 organization chop.word sortify }
- if$
- }
- { author sort.format.names }
- if$
-}
-
-FUNCTION {editor.organization.sort}
-{ editor empty$
- { organization empty$
- { key empty$
- { "to sort, need editor, organization, or key in " cite$ * warning$
- ""
- }
- { key sortify }
- if$
- }
- { "The " #4 organization chop.word sortify }
- if$
- }
- { editor sort.format.names }
- if$
-}
-
-FUNCTION {presort}
-{ type$ "book" =
- type$ "inbook" =
- or
- 'author.editor.sort
- { type$ "proceedings" =
- 'editor.organization.sort
- { type$ "manual" =
- 'author.organization.sort
- 'author.sort
- if$
- }
- if$
- }
- if$
- " "
- *
- year field.or.null sortify
- *
- " "
- *
- title field.or.null
- sort.format.title
- *
- #1 entry.max$ substring$
- 'sort.key$ :=
-}
-
-ITERATE {presort}
-
-SORT
-
-STRINGS { longest.label }
-
-INTEGERS { number.label longest.label.width }
-
-FUNCTION {initialize.longest.label}
-{ "" 'longest.label :=
- #1 'number.label :=
- #0 'longest.label.width :=
-}
-
-FUNCTION {longest.label.pass}
-{ number.label int.to.str$ 'label :=
- number.label #1 + 'number.label :=
- label width$ longest.label.width >
- { label 'longest.label :=
- label width$ 'longest.label.width :=
- }
- 'skip$
- if$
-}
-
-EXECUTE {initialize.longest.label}
-
-ITERATE {longest.label.pass}
-
-FUNCTION {begin.bib}
-{ preamble$ empty$
- 'skip$
- { preamble$ write$ newline$ }
- if$
- "\begin{thebibliography}{" longest.label * "}" * write$ newline$
-}
-
-EXECUTE {begin.bib}
-
-EXECUTE {init.state.consts}
-
-ITERATE {call.type$}
-
-FUNCTION {end.bib}
-{ newline$
- "\end{thebibliography}" write$ newline$
-}
-
-EXECUTE {end.bib}
diff --git a/tests/examplefiles/pleac.in.rb b/tests/examplefiles/pleac.in.rb
deleted file mode 100644
index d1dea9f4..00000000
--- a/tests/examplefiles/pleac.in.rb
+++ /dev/null
@@ -1,1223 +0,0 @@
-# -*- ruby -*-
-
-# Local variables:
-# indent-tabs-mode: nil
-# ruby-indent-level: 4
-# End:
-
-# @@PLEAC@@_NAME
-# @@SKIP@@ Ruby
-
-# @@PLEAC@@_WEB
-# @@SKIP@@ http://www.ruby-lang.org
-
-
-# @@PLEAC@@_1.0
-string = '\n' # two characters, \ and an n
-string = 'Jon \'Maddog\' Orwant' # literal single quotes
-
-string = "\n" # a "newline" character
-string = "Jon \"Maddog\" Orwant" # literal double quotes
-
-string = %q/Jon 'Maddog' Orwant/ # literal single quotes
-
-string = %q[Jon 'Maddog' Orwant] # literal single quotes
-string = %q{Jon 'Maddog' Orwant} # literal single quotes
-string = %q(Jon 'Maddog' Orwant) # literal single quotes
-string = %q<Jon 'Maddog' Orwant> # literal single quotes
-
-a = <<"EOF"
-This is a multiline here document
-terminated by EOF on a line by itself
-EOF
-
-
-# @@PLEAC@@_1.1
-value = string[offset,count]
-value = string[offset..-1]
-
-string[offset,count] = newstring
-string[offset..-1] = newtail
-
-# in Ruby we can also specify intervals by their two offsets
-value = string[offset..offs2]
-string[offset..offs2] = newstring
-
-leading, s1, s2, trailing = data.unpack("A5 x3 A8 A8 A*")
-
-fivers = string.unpack("A5" * (string.length/5))
-
-chars = string.unpack("A1" * string.length)
-
-string = "This is what you have"
-# +012345678901234567890 Indexing forwards (left to right)
-# 109876543210987654321- Indexing backwards (right to left)
-# note that 0 means 10 or 20, etc. above
-
-first = string[0, 1] # "T"
-start = string[5, 2] # "is"
-rest = string[13..-1] # "you have"
-last = string[-1, 1] # "e"
-end_ = string[-4..-1] # "have"
-piece = string[-8, 3] # "you"
-
-string[5, 2] = "wasn't" # change "is" to "wasn't"
-string[-12..-1] = "ondrous" # "This wasn't wondrous"
-string[0, 1] = "" # delete first character
-string[-10..-1] = "" # delete last 10 characters
-
-if string[-10..-1] =~ /pattern/
- puts "Pattern matches in last 10 characters"
-end
-
-string[0, 5].gsub!(/is/, 'at')
-
-a = "make a hat"
-a[0, 1], a[-1, 1] = a[-1, 1], a[0, 1]
-
-a = "To be or not to be"
-b = a.unpack("x6 A6")
-
-b, c = a.unpack("x6 A2 X5 A2")
-puts "#{b}\n#{c}\n"
-
-def cut2fmt(*args)
- template = ''
- lastpos = 1
- for place in args
- template += "A" + (place - lastpos).to_s + " "
- lastpos = place
- end
- template += "A*"
- return template
-end
-
-fmt = cut2fmt(8, 14, 20, 26, 30)
-
-
-# @@PLEAC@@_1.2
-# careful! "b is true" doesn't mean "b != 0" (0 is true in Ruby)
-# thus no problem of "defined" later since only nil is false
-# the following sets to `c' if `b' is nil or false
-a = b || c
-
-# if you need Perl's behaviour (setting to `c' if `b' is 0) the most
-# effective way is to use Numeric#nonzero? (thanks to Dave Thomas!)
-a = b.nonzero? || c
-
-# you will still want to use defined? in order to test
-# for scope existence of a given object
-a = defined?(b) ? b : c
-
-dir = ARGV.shift || "/tmp"
-
-
-# @@PLEAC@@_1.3
-v1, v2 = v2, v1
-
-alpha, beta, production = %w(January March August)
-alpha, beta, production = beta, production, alpha
-
-
-# @@PLEAC@@_1.4
-num = char[0]
-char = num.chr
-
-# Ruby also supports having a char from character constant
-num = ?r
-
-char = sprintf("%c", num)
-printf("Number %d is character %c\n", num, num)
-
-ascii = string.unpack("C*")
-string = ascii.pack("C*")
-
-hal = "HAL"
-ascii = hal.unpack("C*")
-# We can't use Array#each since we can't mutate a Fixnum
-ascii.collect! { |i|
- i + 1 # add one to each ASCII value
-}
-ibm = ascii.pack("C*")
-puts ibm
-
-
-# @@PLEAC@@_1.5
-array = string.split('')
-
-array = string.unpack("C*")
-
-string.scan(/./) { |b|
- # do something with b
-}
-
-string = "an apple a day"
-print "unique chars are: ", string.split('').uniq.sort, "\n"
-
-sum = 0
-for ascval in string.unpack("C*") # or use Array#each for a pure OO style :)
- sum += ascval
-end
-puts "sum is #{sum & 0xffffffff}" # since Ruby will go Bignum if necessary
-
-# @@INCLUDE@@ include/ruby/slowcat.rb
-
-
-# @@PLEAC@@_1.6
-revbytes = string.reverse
-
-revwords = string.split(" ").reverse.join(" ")
-
-revwords = string.split(/(\s+)/).reverse.join
-
-# using the fact that IO is Enumerable, you can directly "select" it
-long_palindromes = File.open("/usr/share/dict/words").
- select { |w| w.chomp!; w.reverse == w && w.length > 5 }
-
-
-# @@PLEAC@@_1.7
-while string.sub!("\t+") { ' ' * ($&.length * 8 - $`.length % 8) }
-end
-
-
-# @@PLEAC@@_1.8
-'You owe #{debt} to me'.gsub(/\#{(\w+)}/) { eval($1) }
-
-rows, cols = 24, 80
-text = %q(I am #{rows} high and #{cols} long)
-text.gsub!(/\#{(\w+)}/) { eval("#{$1}") }
-puts text
-
-'I am 17 years old'.gsub(/\d+/) { 2 * $&.to_i }
-
-
-# @@PLEAC@@_1.9
-e = "bo peep".upcase
-e.downcase!
-e.capitalize!
-
-"thIS is a loNG liNE".gsub!(/\w+/) { $&.capitalize }
-
-
-# @@PLEAC@@_1.10
-"I have #{n+1} guanacos."
-print "I have ", n+1, " guanacos."
-
-
-# @@PLEAC@@_1.11
-var = <<'EOF'.gsub(/^\s+/, '')
- your text
- goes here
-EOF
-
-
-# @@PLEAC@@_1.12
-string = "Folding and splicing is the work of an editor,\n"+
- "not a mere collection of silicon\n"+
- "and\n"+
- "mobile electrons!"
-
-def wrap(str, max_size)
- all = []
- line = ''
- for l in str.split
- if (line+l).length >= max_size
- all.push(line)
- line = ''
- end
- line += line == '' ? l : ' ' + l
- end
- all.push(line).join("\n")
-end
-
-print wrap(string, 20)
-#=> Folding and
-#=> splicing is the
-#=> work of an editor,
-#=> not a mere
-#=> collection of
-#=> silicon and mobile
-#=> electrons!
-
-
-# @@PLEAC@@_1.13
-string = %q(Mom said, "Don't do that.")
-string.gsub(/['"]/) { '\\'+$& }
-string.gsub(/['"]/, '\&\&')
-string.gsub(/[^A-Z]/) { '\\'+$& }
-"is a test!".gsub(/\W/) { '\\'+$& } # no function like quotemeta?
-
-
-# @@PLEAC@@_1.14
-string.strip!
-
-
-# @@PLEAC@@_1.15
-def parse_csv(text)
- new = text.scan(/"([^\"\\]*(?:\\.[^\"\\]*)*)",?|([^,]+),?|,/)
- new << nil if text[-1] == ?,
- new.flatten.compact
-end
-
-line = %q<XYZZY,"","O'Reilly, Inc","Wall, Larry","a \"glug\" bit,",5,"Error, Core Dumped">
-fields = parse_csv(line)
-fields.each_with_index { |v,i|
- print "#{i} : #{v}\n";
-}
-
-
-# @@PLEAC@@_1.16
-# Use the soundex.rb Library from Michael Neumann.
-# http://www.s-direktnet.de/homepages/neumann/rb_prgs/Soundex.rb
-require 'Soundex'
-
-code = Text::Soundex.soundex(string)
-codes = Text::Soundex.soundex(array)
-
-# substitution function for getpwent():
-# returns an array of user entries,
-# each entry contains the username and the full name
-def login_names
- result = []
- File.open("/etc/passwd") { |file|
- file.each_line { |line|
- next if line.match(/^#/)
- cols = line.split(":")
- result.push([cols[0], cols[4]])
- }
- }
- result
-end
-
-puts "Lookup user: "
-user = STDIN.gets
-user.chomp!
-exit unless user
-name_code = Text::Soundex.soundex(user)
-
-splitter = Regexp.new('(\w+)[^,]*\b(\w+)')
-for username, fullname in login_names do
- firstname, lastname = splitter.match(fullname)[1,2]
- if name_code == Text::Soundex.soundex(username)
- || name_code == Text::Soundex.soundex(firstname)
- || name_code == Text::Soundex.soundex(lastname)
- then
- puts "#{username}: #{firstname} #{lastname}"
- end
-end
-
-
-# @@PLEAC@@_1.17
-# @@INCLUDE@@ include/ruby/fixstyle.rb
-
-
-# @@PLEAC@@_1.18
-# @@INCLUDE@@ include/ruby/psgrep.rb
-
-
-# @@PLEAC@@_2.1
-# Matz tells that you can use Integer() for strict checked conversion.
-Integer("abc")
-#=> `Integer': invalid value for Integer: "abc" (ArgumentError)
-Integer("567")
-#=> 567
-
-# You may use Float() for floating point stuff
-Integer("56.7")
-#=> `Integer': invalid value for Integer: "56.7" (ArgumentError)
-Float("56.7")
-#=> 56.7
-
-# You may also use a regexp for that
-if string =~ /^[+-]?\d+$/
- p 'is an integer'
-else
- p 'is not'
-end
-
-if string =~ /^-?(?:\d+(?:\.\d*)?|\.\d+)$/
- p 'is a decimal number'
-else
- p 'is not'
-end
-
-
-# @@PLEAC@@_2.2
-# equal(num1, num2, accuracy) : returns true if num1 and num2 are
-# equal to accuracy number of decimal places
-def equal(i, j, a)
- sprintf("%.#{a}g", i) == sprintf("%.#{a}g", j)
-end
-
-wage = 536 # $5.36/hour
-week = 40 * wage # $214.40
-printf("One week's wage is: \$%.2f\n", week/100.0)
-
-
-# @@PLEAC@@_2.3
-num.round # rounds to integer
-
-a = 0.255
-b = sprintf("%.2f", a)
-print "Unrounded: #{a}\nRounded: #{b}\n"
-printf "Unrounded: #{a}\nRounded: %.2f\n", a
-
-print "number\tint\tfloor\tceil\n"
-a = [ 3.3 , 3.5 , 3.7, -3.3 ]
-for n in a
- printf("% .1f\t% .1f\t% .1f\t% .1f\n", # at least I don't fake my output :)
- n, n.to_i, n.floor, n.ceil)
-end
-
-
-# @@PLEAC@@_2.4
-def dec2bin(n)
- [n].pack("N").unpack("B32")[0].sub(/^0+(?=\d)/, '')
-end
-
-def bin2dec(n)
- [("0"*32+n.to_s)[-32..-1]].pack("B32").unpack("N")[0]
-end
-
-
-# @@PLEAC@@_2.5
-for i in x .. y
- # i is set to every integer from x to y, inclusive
-end
-
-x.step(y,7) { |i|
- # i is set to every integer from x to y, stepsize = 7
-}
-
-print "Infancy is: "
-(0..2).each { |i|
- print i, " "
-}
-print "\n"
-
-
-# @@PLEAC@@_2.6
-# We can add conversion methods to the Integer class,
-# this makes a roman number just a representation for normal numbers.
-class Integer
-
- @@romanlist = [["M", 1000],
- ["CM", 900],
- ["D", 500],
- ["CD", 400],
- ["C", 100],
- ["XC", 90],
- ["L", 50],
- ["XL", 40],
- ["X", 10],
- ["IX", 9],
- ["V", 5],
- ["IV", 4],
- ["I", 1]]
-
- def to_roman
- remains = self
- roman = ""
- for sym, num in @@romanlist
- while remains >= num
- remains -= num
- roman << sym
- end
- end
- roman
- end
-
- def Integer.from_roman(roman)
- ustr = roman.upcase
- sum = 0
- for entry in @@romanlist
- sym, num = entry[0], entry[1]
- while sym == ustr[0, sym.length]
- sum += num
- ustr.slice!(0, sym.length)
- end
- end
- sum
- end
-
-end
-
-
-roman_fifteen = 15.to_roman
-puts "Roman for fifteen is #{roman_fifteen}"
-i = Integer.from_roman(roman_fifteen)
-puts "Converted back, #{roman_fifteen} is #{i}"
-
-# check
-for i in (1..3900)
- r = i.to_roman
- j = Integer.from_roman(r)
- if i != j
- puts "error: #{i} : #{r} - #{j}"
- end
-end
-
-
-# @@PLEAC@@_2.7
-random = rand(y-x+1)+x
-
-chars = ["A".."Z","a".."z","0".."9"].collect { |r| r.to_a }.join + %q(!@$%^&*)
-password = (1..8).collect { chars[rand(chars.size)] }.pack("C*")
-
-
-# @@PLEAC@@_2.8
-srand # uses a combination of the time, the process id, and a sequence number
-srand(val) # for repeatable behaviour
-
-
-# @@PLEAC@@_2.9
-# from the randomr lib:
-# http://raa.ruby-lang.org/project/randomr/
-----> http://raa.ruby-lang.org/project/randomr/
-
-require 'random/mersenne_twister'
-mers = Random::MersenneTwister.new 123456789
-puts mers.rand(0) # 0.550321932544541
-puts mers.rand(10) # 2
-
-# using online sources of random data via the realrand package:
-# http://raa.ruby-lang.org/project/realrand/
-# **Note**
-# The following online services are used in this package:
-# http://www.random.org - source: atmospheric noise
-# http://www.fourmilab.ch/hotbits - source: radioactive decay timings
-# http://random.hd.org - source: entropy from local and network noise
-# Please visit the sites and respect the rules of each service.
-
-require 'random/online'
-
-generator1 = Random::RandomOrg.new
-puts generator1.randbyte(5).join(",")
-puts generator1.randnum(10, 1, 6).join(",") # Roll dice 10 times.
-
-generator2 = Random::FourmiLab.new
-puts generator2.randbyte(5).join(",")
-# randnum is not supported.
-
-generator3 = Random::EntropyPool.new
-puts generator3.randbyte(5).join(",")
-# randnum is not supported.
-
-
-# @@PLEAC@@_2.10
-def gaussian_rand
- begin
- u1 = 2 * rand() - 1
- u2 = 2 * rand() - 1
- w = u1*u1 + u2*u2
- end while (w >= 1)
- w = Math.sqrt((-2*Math.log(w))/w)
- [ u2*w, u1*w ]
-end
-
-mean = 25
-sdev = 2
-salary = gaussian_rand[0] * sdev + mean
-printf("You have been hired at \$%.2f\n", salary)
-
-
-# @@PLEAC@@_2.11
-def deg2rad(d)
- (d/180.0)*Math::PI
-end
-
-def rad2deg(r)
- (r/Math::PI)*180
-end
-
-
-# @@PLEAC@@_2.12
-sin_val = Math.sin(angle)
-cos_val = Math.cos(angle)
-tan_val = Math.tan(angle)
-
-# AFAIK Ruby's Math module doesn't provide acos/asin
-# While we're at it, let's also define missing hyperbolic functions
-module Math
- def Math.asin(x)
- atan2(x, sqrt(1 - x**2))
- end
- def Math.acos(x)
- atan2(sqrt(1 - x**2), x)
- end
- def Math.atan(x)
- atan2(x, 1)
- end
- def Math.sinh(x)
- (exp(x) - exp(-x)) / 2
- end
- def Math.cosh(x)
- (exp(x) + exp(-x)) / 2
- end
- def Math.tanh(x)
- sinh(x) / cosh(x)
- end
-end
-
-# The support for Complex numbers is not built-in
-y = Math.acos(3.7)
-#=> in `sqrt': square root for negative number (ArgumentError)
-
-# There is an implementation of Complex numbers in 'complex.rb' in current
-# Ruby distro, but it doesn't support atan2 with complex args, so it doesn't
-# solve this problem.
-
-
-# @@PLEAC@@_2.13
-log_e = Math.log(val)
-log_10 = Math.log10(val)
-
-def log_base(base, val)
- Math.log(val)/Math.log(base)
-end
-
-answer = log_base(10, 10_000)
-puts "log10(10,000) = #{answer}"
-
-
-# @@PLEAC@@_2.14
-require 'matrix.rb'
-
-a = Matrix[[3, 2, 3], [5, 9, 8]]
-b = Matrix[[4, 7], [9, 3], [8, 1]]
-c = a * b
-
-a.row_size
-a.column_size
-
-c.det
-a.transpose
-
-
-# @@PLEAC@@_2.15
-require 'complex.rb'
-require 'rational.rb'
-
-a = Complex(3, 5) # 3 + 5i
-b = Complex(2, -2) # 2 - 2i
-puts "c = #{a*b}"
-
-c = a * b
-d = 3 + 4*Complex::I
-
-printf "sqrt(#{d}) = %s\n", Math.sqrt(d)
-
-
-# @@PLEAC@@_2.16
-number = hexadecimal.hex
-number = octal.oct
-
-print "Gimme a number in decimal, octal, or hex: "
-num = gets.chomp
-exit unless defined?(num)
-num = num.oct if num =~ /^0/ # does both oct and hex
-printf "%d %x %o\n", num, num, num
-
-print "Enter file permission in octal: "
-permissions = gets.chomp
-raise "Exiting ...\n" unless defined?(permissions)
-puts "The decimal value is #{permissions.oct}"
-
-
-# @@PLEAC@@_2.17
-def commify(n)
- n.to_s =~ /([^\.]*)(\..*)?/
- int, dec = $1.reverse, $2 ? $2 : ""
- while int.gsub!(/(,|\.|^)(\d{3})(\d)/, '\1\2,\3')
- end
- int.reverse + dec
-end
-
-
-# @@PLEAC@@_2.18
-printf "It took %d hour%s\n", time, time == 1 ? "" : "s"
-
-# dunno if an equivalent to Lingua::EN::Inflect exists...
-
-
-# @@PLEAC@@_2.19
-#-----------------------------
-#!/usr/bin/ruby
-# bigfact - calculating prime factors
-def factorize(orig)
- factors = {}
- factors.default = 0 # return 0 instead nil if key not found in hash
- n = orig
- i = 2
- sqi = 4 # square of i
- while sqi <= n do
- while n.modulo(i) == 0 do
- n /= i
- factors[i] += 1
- # puts "Found factor #{i}"
- end
- # we take advantage of the fact that (i +1)**2 = i**2 + 2*i +1
- sqi += 2 * i + 1
- i += 1
- end
-
- if (n != 1) && (n != orig)
- factors[n] += 1
- end
- factors
-end
-
-def printfactorhash(orig, factorcount)
- print format("%-10d ", orig)
- if factorcount.length == 0
- print "PRIME"
- else
- # sorts after number, because the hash keys are numbers
- factorcount.sort.each { |factor,exponent|
- print factor
- if exponent > 1
- print "**", exponent
- end
- print " "
- }
- end
- puts
-end
-
-for arg in ARGV
- n = arg.to_i
- mfactors = factorize(n)
- printfactorhash(n, mfactors)
-end
-#-----------------------------
-
-
-# @@PLEAC@@_3.0
-puts Time.now
-
-print "Today is day ", Time.now.yday, " of the current year.\n"
-print "Today is day ", Time.now.day, " of the current month.\n"
-
-
-# @@PLEAC@@_3.1
-day, month, year = Time.now.day, Time.now.month, Time.now.year
-# or
-day, month, year = Time.now.to_a[3..5]
-
-tl = Time.now.localtime
-printf("The current date is %04d %02d %02d\n", tl.year, tl.month, tl.day)
-
-Time.now.localtime.strftime("%Y-%m-%d")
-
-
-# @@PLEAC@@_3.2
-Time.local(year, month, day, hour, minute, second).tv_sec
-Time.gm(year, month, day, hour, minute, second).tv_sec
-
-
-# @@PLEAC@@_3.3
-sec, min, hour, day, month, year, wday, yday, isdst, zone = Time.at(epoch_secs).to_a
-
-
-# @@PLEAC@@_3.4
-when_ = now + difference # now -> Time ; difference -> Numeric (delta in seconds)
-then_ = now - difference
-
-
-# @@PLEAC@@_3.5
-bree = 361535725
-nat = 96201950
-
-difference = bree - nat
-puts "There were #{difference} seconds between Nat and Bree"
-
-seconds = difference % 60
-difference = (difference - seconds) / 60
-minutes = difference % 60
-difference = (difference - minutes) / 60
-hours = difference % 24
-difference = (difference - hours) / 24
-days = difference % 7
-weeks = (difference - days) / 7
-
-puts "(#{weeks} weeks, #{days} days, #{hours}:#{minutes}:#{seconds})"
-
-
-# @@PLEAC@@_3.6
-monthday, weekday, yearday = date.mday, date.wday, date.yday
-
-# AFAIK the week number is not just a division since week boundaries are on sundays
-weeknum = d.strftime("%U").to_i + 1
-
-year = 1981
-month = "jun" # or `6' if you want to emulate a broken language
-day = 16
-t = Time.mktime(year, month, day)
-print "#{month}/#{day}/#{year} was a ", t.strftime("%A"), "\n"
-
-
-# @@PLEAC@@_3.7
-yyyy, mm, dd = $1, $2, $3 if "1998-06-25" =~ /(\d+)-(\d+)-(\d+)/
-
-epoch_seconds = Time.mktime(yyyy, mm, dd).tv_sec
-
-# dunno an equivalent to Date::Manip#ParseDate
-
-
-# @@PLEAC@@_3.8
-string = Time.at(epoch_secs)
-Time.at(1234567890).gmtime # gives: Fri Feb 13 23:31:30 UTC 2009
-
-time = Time.mktime(1973, "jan", 18, 3, 45, 50)
-print "In localtime it gives: ", time.localtime, "\n"
-
-
-# @@PLEAC@@_3.9
-# Ruby provides micro-seconds in Time object
-Time.now.usec
-
-# Ruby gives the seconds in floating format when substracting two Time objects
-before = Time.now
-line = gets
-elapsed = Time.now - before
-puts "You took #{elapsed} seconds."
-
-# On my Celeron-400 with Linux-2.2.19-14mdk, average for three execs are:
-# This Ruby version: average 0.00321 sec
-# Cookbook's Perl version: average 0.00981 sec
-size = 500
-number_of_times = 100
-total_time = 0
-number_of_times.times {
- # populate array
- array = []
- size.times { array << rand }
- # sort it
- begin_ = Time.now
- array.sort!
- time = Time.now - begin_
- total_time += time
-}
-printf "On average, sorting %d random numbers takes %.5f seconds\n",
- size, (total_time/Float(number_of_times))
-
-
-# @@PLEAC@@_3.10
-sleep(0.005) # Ruby is definitely not as broken as Perl :)
-# (may be interrupted by sending the process a SIGALRM)
-
-
-# @@PLEAC@@_3.11
-#!/usr/bin/ruby -w
-# hopdelta - feed mail header, produce lines
-# showing delay at each hop.
-require 'time'
-class MailHopDelta
-
- def initialize(mail)
- @head = mail.gsub(/\n\s+/,' ')
- @topline = %w-Sender Recipient Time Delta-
- @start_from = mail.match(/^From.*\@([^\s>]*)/)[1]
- @date = Time.parse(mail.match(/^Date:\s+(.*)/)[1])
- end
-
- def out(line)
- "%-20.20s %-20.20s %-20.20s %s" % line
- end
-
- def hop_date(day)
- day.strftime("%I:%M:%S %Y/%m/%d")
- end
-
- def puts_hops
- puts out(@topline)
- puts out(['Start', @start_from, hop_date(@date),''])
- @head.split(/\n/).reverse.grep(/^Received:/).each do |hop|
- hop.gsub!(/\bon (.*?) (id.*)/,'; \1')
- whence = hop.match(/;\s+(.*)$/)[1]
- unless whence
- warn "Bad received line: #{hop}"
- next
- end
- from = $+ if hop =~ /from\s+(\S+)|\((.*?)\)/
- by = $1 if hop =~ /by\s+(\S+\.\S+)/
- next unless now = Time.parse(whence).localtime
- delta = now - @date
- puts out([from, by, hop_date(now), hop_time(delta)])
- @date = now
- end
- end
-
- def hop_time(secs)
- sign = secs < 0 ? -1 : 1
- days, secs = secs.abs.divmod(60 * 60 * 24)
- hours,secs = secs.abs.divmod(60 * 60)
- mins, secs = secs.abs.divmod(60)
- rtn = "%3ds" % [secs * sign]
- rtn << "%3dm" % [mins * sign] if mins != 0
- rtn << "%3dh" % [hours * sign] if hours != 0
- rtn << "%3dd" % [days * sign] if days != 0
- rtn
- end
-end
-
-$/ = ""
-mail = MailHopDelta.new(ARGF.gets).puts_hops
-
-
-# @@PLEAC@@_4.0
-single_level = [ "this", "that", "the", "other" ]
-
-# Ruby directly supports nested arrays
-double_level = [ "this", "that", [ "the", "other" ] ]
-still_single_level = [ "this", "that", [ "the", "other" ] ].flatten
-
-
-# @@PLEAC@@_4.1
-a = [ "quick", "brown", "fox" ]
-a = %w(Why are you teasing me?)
-
-lines = <<"END_OF_HERE_DOC".gsub(/^\s*(.+)/, '\1')
- The boy stood on the burning deck,
- It was as hot as glass.
-END_OF_HERE_DOC
-
-bigarray = IO.readlines("mydatafile").collect { |l| l.chomp }
-
-name = "Gandalf"
-banner = %Q(Speak, #{name}, and welcome!)
-
-host_info = `host #{his_host}`
-
-%x(ps #{$$})
-
-banner = 'Costs only $4.95'.split(' ')
-
-rax = %w! ( ) < > { } [ ] !
-
-
-# @@PLEAC@@_4.2
-def commify_series(arr)
- return '' if not arr
- case arr.size
- when 0 then ''
- when 1 then arr[0]
- when 2 then arr.join(' and ')
- else arr[0..-2].join(', ') + ', and ' + arr[-1]
- end
-end
-
-array = [ "red", "yellow", "green" ]
-
-print "I have ", array, " marbles\n"
-# -> I have redyellowgreen marbles
-
-# But unlike Perl:
-print "I have #{array} marbles\n"
-# -> I have redyellowgreen marbles
-# So, needs:
-print "I have #{array.join(' ')} marbles\n"
-# -> I have red yellow green marbles
-
-#!/usr/bin/ruby
-# communify_series - show proper comma insertion in list output
-
-def commify_series(arr)
- return '' if not arr
- sepchar = arr.find { |p| p =~ /,/ } ? '; ' : ', '
- case arr.size
- when 0 then ''
- when 1 then arr[0]
- when 2 then arr.join(' and ')
- else arr[0..-2].join(sepchar) + sepchar + 'and ' + arr[-1]
- end
-end
-
-lists = [
- [ 'just one thing' ],
- %w(Mutt Jeff),
- %w(Peter Paul Mary),
- [ 'To our parents', 'Mother Theresa', 'God' ],
- [ 'pastrami', 'ham and cheese', 'peanut butter and jelly', 'tuna' ],
- [ 'recycle tired, old phrases', 'ponder big, happy thoughts' ],
- [ 'recycle tired, old phrases',
- 'ponder big, happy thoughts',
- 'sleep and dream peacefully' ],
-]
-
-for list in lists do
- puts "The list is: #{commify_series(list)}."
-end
-
-
-# @@PLEAC@@_4.3
-# (note: AFAIK Ruby doesn't allow gory change of Array length)
-# grow the array by assigning nil to past the end of array
-ary[new_size-1] = nil
-# shrink the array by slicing it down
-ary.slice!(new_size..-1)
-# init the array with given size
-Array.new(number_of_elems)
-# assign to an element past the original end enlarges the array
-ary[index_new_last_elem] = value
-
-def what_about_that_array(a)
- print "The array now has ", a.size, " elements.\n"
- # Index of last element is not really interesting in Ruby
- print "Element #3 is `#{a[3]}'.\n"
-end
-people = %w(Crosby Stills Nash Young)
-what_about_that_array(people)
-
-
-# @@PLEAC@@_4.4
-# OO style
-bad_users.each { |user|
- complain(user)
-}
-# or, functional style
-for user in bad_users
- complain(user)
-end
-
-for var in ENV.keys.sort
- puts "#{var}=#{ENV[var]}"
-end
-
-for user in all_users
- disk_space = get_usage(user)
- if (disk_space > MAX_QUOTA)
- complain(user)
- end
-end
-
-for l in IO.popen("who").readlines
- print l if l =~ /^gc/
-end
-
-# we can mimic the obfuscated Perl way
-while fh.gets # $_ is set to the line just read
- chomp # $_ has a trailing \n removed, if it had one
- split.each { |w| # $_ is split on whitespace
- # but $_ is not set to each chunk as in Perl
- print w.reverse
- }
-end
-# ...or use a cleaner way
-for l in fh.readlines
- l.chomp.split.each { |w| print w.reverse }
-end
-
-# same drawback as in problem 1.4, we can't mutate a Numeric...
-array.collect! { |v| v - 1 }
-
-a = [ .5, 3 ]; b = [ 0, 1 ]
-for ary in [ a, b ]
- ary.collect! { |v| v * 7 }
-end
-puts "#{a.join(' ')} #{b.join(' ')}"
-
-# we can mutate Strings, cool; we need a trick for the scalar
-for ary in [ [ scalar ], array, hash.values ]
- ary.each { |v| v.strip! } # String#strip rules :)
-end
-
-
-# @@PLEAC@@_4.5
-# not relevant in Ruby since we have always references
-for item in array
- # do somethingh with item
-end
-
-
-# @@PLEAC@@_4.6
-unique = list.uniq
-
-# generate a list of users logged in, removing duplicates
-users = `who`.collect { |l| l =~ /(\w+)/; $1 }.sort.uniq
-puts("users logged in: #{commify_series(users)}") # see 4.2 for commify_series
-
-
-# @@PLEAC@@_4.7
-a - b
-# [ 1, 1, 2, 2, 3, 3, 3, 4, 5 ] - [ 1, 2, 4 ] -> [3, 5]
-
-
-# @@PLEAC@@_4.8
-union = a | b
-intersection = a & b
-difference = a - b
-
-
-# @@PLEAC@@_4.9
-array1.concat(array2)
-# if you will assign to another object, better use:
-new_ary = array1 + array2
-
-members = [ "Time", "Flies" ]
-initiates = [ "An", "Arrow" ]
-members += initiates
-
-members = [ "Time", "Flies" ]
-initiates = [ "An", "Arrow" ]
-members[2,0] = [ "Like", initiates ].flatten
-
-members[0] = "Fruit"
-members[3,2] = "A", "Banana"
-
-
-# @@PLEAC@@_4.10
-reversed = ary.reverse
-
-ary.reverse_each { |e|
- # do something with e
-}
-
-descending = ary.sort.reverse
-descending = ary.sort { |a,b| b <=> a }
-
-
-# @@PLEAC@@_4.11
-# remove n elements from front of ary (shift n)
-front = ary.slice!(0, n)
-
-# remove n elements from the end of ary (pop n)
-end_ = ary.slice!(-n .. -1)
-
-# let's extend the Array class, to make that useful
-class Array
- def shift2()
- slice!(0 .. 1) # more symetric with pop2...
- end
- def pop2()
- slice!(-2 .. -1)
- end
-end
-
-friends = %w(Peter Paul Mary Jim Tim)
-this, that = friends.shift2
-
-beverages = %w(Dew Jolt Cola Sprite Fresca)
-pair = beverages.pop2
-
-
-# @@PLEAC@@_4.12
-# use Enumerable#detect (or the synonym Enumerable#find)
-highest_eng = employees.detect { |emp| emp.category == 'engineer' }
-
-
-# @@PLEAC@@_4.13
-# use Enumerable#select (or the synonym Enumerable#find_all)
-bigs = nums.select { |i| i > 1_000_000 }
-pigs = users.keys.select { |k| users[k] > 1e7 }
-
-matching = `who`.select { |u| u =~ /^gnat / }
-
-engineers = employees.select { |e| e.position == 'Engineer' }
-
-secondary_assistance = applicants.select { |a|
- a.income >= 26_000 && a.income < 30_000
-}
-
-
-# @@PLEAC@@_4.14
-# normally you would have an array of Numeric (Float or
-# Fixnum or Bignum), so you would use:
-sorted = unsorted.sort
-# if you have strings representing Integers or Floats
-# you may specify another sort method:
-sorted = unsorted.sort { |a,b| a.to_f <=> b.to_f }
-
-# let's use the list of my own PID's
-`ps ux`.split("\n")[1..-1].
- select { |i| i =~ /^#{ENV['USER']}/ }.
- collect { |i| i.split[1] }.
- sort { |a,b| a.to_i <=> b.to_i }.each { |i| puts i }
-puts "Select a process ID to kill:"
-pid = gets.chomp
-raise "Exiting ... \n" unless pid && pid =~ /^\d+$/
-Process.kill('TERM', pid.to_i)
-sleep 2
-Process.kill('KILL', pid.to_i)
-
-descending = unsorted.sort { |a,b| b.to_f <=> a.to_f }
-
-
-# @@PLEAC@@_4.15
-ordered = unordered.sort { |a,b| compare(a,b) }
-
-precomputed = unordered.collect { |e| [compute, e] }
-ordered_precomputed = precomputed.sort { |a,b| a[0] <=> b[0] }
-ordered = ordered_precomputed.collect { |e| e[1] }
-
-ordered = unordered.collect { |e| [compute, e] }.
- sort { |a,b| a[0] <=> b[0] }.
- collect { |e| e[1] }
-
-for employee in employees.sort { |a,b| a.name <=> b.name }
- print employee.name, " earns \$ ", employee.salary, "\n"
-end
-
-# Beware! `0' is true in Ruby.
-# For chaining comparisons, you may use Numeric#nonzero?, which
-# returns num if num is not zero, nil otherwise
-sorted = employees.sort { |a,b| (a.name <=> b.name).nonzero? || b.age <=> a.age }
-
-users = []
-# getpwent is not wrapped in Ruby... let's fallback
-IO.readlines('/etc/passwd').each { |u| users << u.split(':') }
-users.sort! { |a,b| a[0] <=> b[0] }
-for user in users
- puts user[0]
-end
-
-sorted = names.sort { |a,b| a[1, 1] <=> b[1, 1] }
-sorted = strings.sort { |a,b| a.length <=> b.length }
-
-# let's show only the compact version
-ordered = strings.collect { |e| [e.length, e] }.
- sort { |a,b| a[0] <=> b[0] }.
- collect { |e| e[1] }
-
-ordered = strings.collect { |e| [/\d+/.match(e)[0].to_i, e] }.
- sort { |a,b| a[0] <=> b[0] }.
- collect { |e| e[1] }
-
-print `cat /etc/passwd`.collect { |e| [e, e.split(':').indexes(3,2,0)].flatten }.
- sort { |a,b| (a[1] <=> b[1]).nonzero? || (a[2] <=> b[2]).nonzero? || a[3] <=> b[3] }.
- collect { |e| e[0] }
-
-
-# @@PLEAC@@_4.16
-circular.unshift(circular.pop) # the last shall be first
-circular.push(circular.shift) # and vice versa
-
-def grab_and_rotate(l)
- l.push(ret = l.shift)
- ret
-end
-
-processes = [1, 2, 3, 4, 5]
-while (1)
- process = grab_and_rotate(processes)
- puts "Handling process #{process}"
- sleep 1
-end
-
-
-# @@PLEAC@@_4.17
-def fisher_yates_shuffle(a)
- (a.size-1).downto(1) { |i|
- j = rand(i+1)
- a[i], a[j] = a[j], a[i] if i != j
- }
-end
-
-def naive_shuffle(a)
- for i in 0...a.size
- j = rand(a.size)
- a[i], a[j] = a[j], a[i]
- end
-end
-
-
diff --git a/tests/examplefiles/postgresql_test.txt b/tests/examplefiles/postgresql_test.txt
deleted file mode 100644
index 28db5ee3..00000000
--- a/tests/examplefiles/postgresql_test.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-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";
-
--- Escapes
-SELECT E'1\n2\n3';
-
--- DO example from postgresql documentation
-/*
- * PostgreSQL is Copyright © 1996-2016 by the PostgreSQL Global Development Group.
- *
- * Postgres95 is Copyright © 1994-5 by the Regents of the University of California.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without a written agreement
- * is hereby granted, provided that the above copyright notice and this paragraph
- * and the following two paragraphs appear in all copies.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
- * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
- * EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
- * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS-IS" BASIS,
- * AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE,
- * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
-DO $$DECLARE r record;
-BEGIN
- FOR r IN SELECT table_schema, table_name FROM information_schema.tables
- WHERE table_type = 'VIEW' AND table_schema = 'public'
- LOOP
- EXECUTE 'GRANT ALL ON ' || quote_ident(r.table_schema) || '.' || quote_ident(r.table_name) || ' TO webuser';
- END LOOP;
-END$$;
diff --git a/tests/examplefiles/pppoe.applescript b/tests/examplefiles/pppoe.applescript
deleted file mode 100644
index 4cb380e5..00000000
--- a/tests/examplefiles/pppoe.applescript
+++ /dev/null
@@ -1,10 +0,0 @@
-tell application "System Events"
- tell network preferences
- tell current location
- set aPPPoEService to a reference to (first service whose kind is 10)
- if exists aPPPoEService then
- connect aPPPoEService
- end if
- end tell
- end tell
-end tell
diff --git a/tests/examplefiles/psql_session.txt b/tests/examplefiles/psql_session.txt
deleted file mode 100644
index 7096072b..00000000
--- a/tests/examplefiles/psql_session.txt
+++ /dev/null
@@ -1,122 +0,0 @@
-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/py3_test.txt b/tests/examplefiles/py3_test.txt
deleted file mode 100644
index 21fea754..00000000
--- a/tests/examplefiles/py3_test.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-class Käse:
- pass
diff --git a/tests/examplefiles/py3tb_test.py3tb b/tests/examplefiles/py3tb_test.py3tb
deleted file mode 100644
index 706a540f..00000000
--- a/tests/examplefiles/py3tb_test.py3tb
+++ /dev/null
@@ -1,4 +0,0 @@
- File "<stdin>", line 1
- 1+
- ^
-SyntaxError: invalid syntax
diff --git a/tests/examplefiles/pycon_ctrlc_traceback b/tests/examplefiles/pycon_ctrlc_traceback
deleted file mode 100644
index 4998fd9c..00000000
--- a/tests/examplefiles/pycon_ctrlc_traceback
+++ /dev/null
@@ -1,118 +0,0 @@
-x = r"""
->>> import os
->>> print os
-<module 'os' from '/file/path.py'>
->>> for x in range(10):
-... y = x + 2
-... print(x)
-... if x > 5:
-... raise Exception
-...
-0
-1
-2
-3
-4
-5
-6
-Traceback (most recent call last):
- File "<stdin>", line 5, in <module>
-Exception
->>>
->>> while True:
-... pass
-...
-^CTraceback (most recent call last):
- File "<stdin>", line 1, in <module>
-KeyboardInterrupt
-
->>> class A(Exception):pass
-...
->>> class B(Exception):pass
-...
->>> try:
-... try:
-... raise A('first')
-... finally:
-... raise B('second')
-... except A as c:
-... print(c)
-...
-Traceback (most recent call last):
- File "<stdin>", line 3, in <module>
-__main__.A: first
-
-During handling of the above exception, another exception occurred:
-
-Traceback (most recent call last):
- File "<stdin>", line 5, in <module>
-__main__.B: second
-
->>> x =
- File "<stdin>", line 1
- x =
- ^
-SyntaxError: invalid syntax
->>>
-
->>> x = 3
->>> with 5 as y:
-... print(x + y)
-...
-8
-
-# TODO
-#>>> raise ValueError('multi\n line\ndetail')
-#Traceback (most recent call last):
-#........
-#ValueError: multi
-# line
-#detail
-
->>> raise ValueError('multi\n line\ndetail')
-Traceback (most recent call last):
- .123
-ValueError: multi
- line
-detail
-
->>> raise ValueError('multi\n line\ndetail')
-Traceback (most recent call last):
- ...
-ValueError: multi
- line
-detail
-
->>> raise ValueError('multi\n line\ndetail')
-Traceback (most recent call last):
- ....
-ValueError: multi
- line
-detail
-
->>> raise ValueError('multi\n line\ndetail')
-Traceback (most recent call last):
- ....
-ValueError: multi
- line
-detail
-
->>> raise ValueError('multi\n line\ndetail')
-Traceback (most recent call last):
- ...
-ValueError: multi
- line
-detail
-
->>> raise Exception
-Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
-Exception
->>> import somemodule
->>> somemodule.blah()
-Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "/path/to/stuff/somemodule/blah.py", line 658, in blah
- raise Exception('Hi.')
-Exception: Hi.
-
diff --git a/tests/examplefiles/pycon_test.pycon b/tests/examplefiles/pycon_test.pycon
deleted file mode 100644
index 9c4fc3d3..00000000
--- a/tests/examplefiles/pycon_test.pycon
+++ /dev/null
@@ -1,17 +0,0 @@
->>> :
- File "<stdin>", line 1
- :
- ^
-SyntaxError: invalid syntax
->>>
-KeyboardInterrupt
->>>
-
->>> 1/0
-Traceback (most recent call last):
- ...
-ZeroDivisionError
-
->>> 1/0 # this used to swallow the traceback
-Traceback (most recent call last):
- ...
diff --git a/tests/examplefiles/pytb_test2.pytb b/tests/examplefiles/pytb_test2.pytb
deleted file mode 100644
index c4d20339..00000000
--- a/tests/examplefiles/pytb_test2.pytb
+++ /dev/null
@@ -1,2 +0,0 @@
- File "temp.py", line 1
-SyntaxError: Non-ASCII character '\xc3' in file temp.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
diff --git a/tests/examplefiles/pytb_test3.pytb b/tests/examplefiles/pytb_test3.pytb
deleted file mode 100644
index 6947c1ef..00000000
--- a/tests/examplefiles/pytb_test3.pytb
+++ /dev/null
@@ -1,4 +0,0 @@
->>> 3/"3"
-Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
-TypeError: unsupported operand type(s) for /: 'int' and 'str'
diff --git a/tests/examplefiles/python25-bsd.mak b/tests/examplefiles/python25-bsd.mak
deleted file mode 100644
index 51c25967..00000000
--- a/tests/examplefiles/python25-bsd.mak
+++ /dev/null
@@ -1,234 +0,0 @@
-# New ports collection makefile for: python25
-# Date created: 3 July 2003
-# Whom: Hye-Shik Chang <perky@FreeBSD.org>
-#
-# $FreeBSD: ports/lang/python25/Makefile,v 1.145 2007/10/03 23:22:04 edwin Exp $
-
-PORTNAME= python25
-PORTVERSION= 2.5.1
-CATEGORIES= lang python ipv6
-MASTER_SITES= ${PYTHON_MASTER_SITES}
-MASTER_SITE_SUBDIR= ${PYTHON_MASTER_SITE_SUBDIR}
-DISTFILES= ${PYTHON_DISTFILE}
-
-MAINTAINER= python@FreeBSD.org
-COMMENT?= An interpreted object-oriented programming language
-
-DIST_SUBDIR= python
-WRKSRC= ${PYTHON_WRKSRC}/portbld.static
-PATCH_WRKSRC= ${PYTHON_WRKSRC}
-GNU_CONFIGURE= yes
-CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
-CONFIGURE_SCRIPT= ../configure # must be relative
-CONFIGURE_ENV= OPT="${CFLAGS}" SVNVERSION="echo freebsd"
-MAKE_ENV= VPATH="${PYTHON_WRKSRC}"
-INSTALLS_SHLIB= yes
-INSTALL_TARGET= altinstall
-MAN1= ${PYTHON_VERSION}.1
-
-USE_PYTHON= yes
-PYTHON_VERSION= python2.5
-PYTHON_NO_DEPENDS= yes
-
-SHARED_WRKSRC= ${PYTHON_WRKSRC}/portbld.shared
-PLIST= ${WRKDIR}/PLIST
-PLIST_TEMPLATE?=${PKGDIR}/pkg-plist
-PLIST_SUB= PYVER=${PYTHON_VERSION:S/python//} \
- PYVER_WITHPAT=${PORTVERSION:S/.c/c/}
-DEMODIR= ${PREFIX}/share/examples/${PYTHON_VERSION}
-TOOLSDIR= ${PREFIX}/share/${PYTHON_VERSION}
-
-BIN_SCRIPTS= idle pydoc python python-shared smtpd.py python-config \
- python-shared-config
-BINLINKS_SUB= -e 's,smtpd,smtpd${PYTHON_VER},' \
- -e 's,(idle|pydoc|python-shared|python),\1${PYTHON_VER},'
-
-OPTIONS= THREADS "Enable thread support" on \
- HUGE_STACK_SIZE "Use a larger thread stack" off \
- UCS4 "Use UCS4 for unicode support" on \
- PYMALLOC "Use python's internal malloc" on \
- IPV6 "Enable IPv6 support" on \
- FPECTL "Enable floating point exception handling" off
-
-.include <bsd.port.pre.mk>
-
-.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION}
-MLINKS= ${PYTHON_VERSION}.1 python.1
-PLIST_SUB+= IF_DEFAULT=""
-.else
-PLIST_SUB+= IF_DEFAULT="@comment "
-.endif
-
-# workaround for a bug in base curses.h.
-CFLAGS+= -D__wchar_t=wchar_t
-
-.if !defined(WITHOUT_THREADS)
-CONFIGURE_ARGS+= --with-threads
-CFLAGS+= ${PTHREAD_CFLAGS}
-.if defined(WITHOUT_HUGE_STACK_SIZE)
-CFLAGS+= -DTHREAD_STACK_SIZE=0x20000
-.else
-CFLAGS+= -DTHREAD_STACK_SIZE=0x100000
-.endif # defined(WITHOUT_HUGE_STACK_SIZE)
-CONFIGURE_ENV+= LDFLAGS="${PTHREAD_LIBS} ${LDFLAGS}"
-.else
-CONFIGURE_ARGS+= --without-threads
-.if defined(LDFLAGS)
-CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
-.endif # defined(LDFLAGS)
-.endif # !defined(WITHOUT_THREADS)
-
-.if !defined(WITHOUT_UCS4) && !defined(WITH_UCS2)
-CONFIGURE_ARGS+= --enable-unicode=ucs4
-.endif
-
-.if defined(WITHOUT_PYMALLOC)
-CONFIGURE_ARGS+= --without-pymalloc
-.endif
-
-.if ${ARCH} == i386
-PLIST_SUB+= X86_ONLY=""
-.else
-PLIST_SUB+= X86_ONLY="@comment "
-.endif
-.if ${ARCH} == amd64 || ${ARCH} == ia64 || ${ARCH} == sparc64 || ${ARCH} == alpha
-PLIST_SUB+= 32BIT_ONLY="@comment "
-.else
-PLIST_SUB+= 32BIT_ONLY=""
-.endif
-.if ${ARCH} == sparc64
-CFLAGS+= -DPYTHON_DEFAULT_RECURSION_LIMIT=900
-.endif
-
-.if !exists(/usr/bin/ypcat) # the world with NO_NIS
-PLIST_SUB+= NO_NIS="@comment "
-.else
-PLIST_SUB+= NO_NIS=""
-.endif
-
-.if !defined(WITHOUT_IPV6)
-CONFIGURE_ARGS+= --enable-ipv6
-.else
-CONFIGURE_ARGS+= --disable-ipv6
-.endif
-
-.if defined(WITH_FPECTL)
-CONFIGURE_ARGS+= --with-fpectl
-.endif
-
-.if ${OSVERSION} >= 700000
-PLATFORMS=plat-freebsd4 plat-freebsd5 plat-freebsd6
-.elif ${OSVERSION} >= 600000
-PLATFORMS=plat-freebsd4 plat-freebsd5 plat-freebsd7
-.else
-PLATFORMS=plat-freebsd4 plat-freebsd6 plat-freebsd7
-.endif
-
-pre-patch:
- ${MKDIR} ${WRKSRC} ${SHARED_WRKSRC}/Modules
- ${SED} -e '1s,^.*$$,#!${PREFIX}/bin/${PYTHON_VERSION},' \
- ${PATCH_WRKSRC}/Tools/scripts/pydoc > ${WRKDIR}/pydoc2.5
- ${SED} -e '1s,^.*$$,#!${PREFIX}/bin/${PYTHON_VERSION},' \
- ${PATCH_WRKSRC}/Tools/scripts/idle > ${WRKDIR}/idle2.5
- ${SED} -e '1s,^.*$$,#!${PREFIX}/bin/${PYTHON_VERSION},' \
- ${PATCH_WRKSRC}/Lib/smtpd.py > ${WRKDIR}/smtpd2.5.py
- ${REINPLACE_CMD} -e \
- 's,/usr/doc/python-docs-,${PREFIX}/share/doc/python,g' \
- ${PATCH_WRKSRC}/Lib/pydoc.py
- ${REINPLACE_CMD} -e \
- 's|^\( *prefixes = .*\)\]$$|\1, "${X11BASE}"]|g' \
- ${PATCH_WRKSRC}/Lib/site.py
- ${REINPLACE_CMD} -e \
- 's|^ \(..ASDLGEN.*\)$$| ${TRUE}|g' \
- ${PATCH_WRKSRC}/Makefile.pre.in
-
- ${REINPLACE_CMD} -e \
- 's|*\(..INSTALL_SCRIPT.*\)python-config$$|#port \1|' \
- ${PATCH_WRKSRC}/Makefile.pre.in
-
- ${SED} -e 's|^#!.*|#!${PREFIX}/bin/${PYTHON_VERSION}|' \
- ${PATCH_WRKSRC}/Misc/python-config.in > ${WRKDIR}/${PYTHON_VERSION}-config
- ${SED} -e 's|^#!.*|#!${PREFIX}/bin/${PYTHON_VERSION:S/thon/thon-shared/}|' \
- ${PATCH_WRKSRC}/Misc/python-config.in > ${WRKDIR}/${PYTHON_VERSION:S/thon/thon-shared/}-config
-
-.if defined(WITH_FPECTL) && ${ARCH} == i386
- ${MKDIR} ${WRKSRC}/Modules
- ${ECHO} "fpectl fpectlmodule.c" >> ${WRKSRC}/Modules/Setup.dist
-.endif
-
-post-configure:
- ${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${SHARED_WRKSRC} -xf -
- ${LN} -sf ${PYTHON_WRKSRC}/Lib ${WRKSRC}/Lib
- ${SED} -e 's,^\(LDLIBRARY=\).*$$,\1libpython$$(VERSION).so,' \
- -e 's,^\(BLDLIBRARY=\).*$$,\1-L. -lpython$$(VERSION),' \
- -e 's,^\(CFLAGSFORSHARED=\).*$$,\1$$(CCSHARED),' \
- -e 's,^\(Makefile Modules/config.c:.*\)Makefile.pre,\1,' \
- -e 's,^\(.(BUILDPYTHON)\: .*\).(LIBRARY),\1,' \
- -e 's,^\(.(BUILDPYTHON):.*\).(LIBRARY),\1,' \
- ${WRKSRC}/Makefile > ${SHARED_WRKSRC}/Makefile
-
-pre-build:
- cd ${SHARED_WRKSRC}; \
- ${SETENV} ${MAKE_ENV} ${MAKE} lib${PYTHON_VERSION}.so python; \
- ${LN} -f lib${PYTHON_VERSION}.so lib${PYTHON_VERSION}.so.1; \
- ${LN} -f python ${PYTHON_VERSION:S/thon/thon-shared/}
-
-pre-su-install:
-.for platform in ${PLATFORMS}
- ${MKDIR} ${PYTHONPREFIX_LIBDIR}/${platform}
-.for file in IN.py regen
- ${INSTALL_DATA} ${WRKSRC}/Lib/${platform}/${file} \
- ${PYTHONPREFIX_LIBDIR}/${platform}/
-.endfor
-.endfor
-
-pre-install:
- ${CAT} ${PLIST_TEMPLATE} | ${AWK} '{ print $$0; } \
- /LIBDIR.*\.py$$/ && !/\/bad/ { print $$0 "o"; print $$0 "c"; }' > ${PLIST}
-
- @# if openssl 0.9.8 is detected, _sha{256,512} module won't be installed
- ([ -f ${WRKSRC}/.without_own_sha ] && \
- ${GREP} -v 'lib-dynload/_sha' ${PLIST} > ${PLIST}.tmp && \
- ${CAT} ${PLIST}.tmp > ${PLIST}) || ${TRUE}
-
-post-install:
- @# install config providers
- ${INSTALL_SCRIPT} ${WRKDIR}/${PYTHON_VERSION}-config ${PREFIX}/bin
- ${INSTALL_SCRIPT} ${WRKDIR}/${PYTHON_VERSION:S/thon/thon-shared/}-config ${PREFIX}/bin
-
- @# shared version of executable and library
- ${INSTALL_PROGRAM} ${SHARED_WRKSRC}/lib${PYTHON_VERSION}.so.1 \
- ${PREFIX}/lib
- cd ${PREFIX}/lib; ${LN} -sf lib${PYTHON_VERSION}.so.1 \
- lib${PYTHON_VERSION}.so
- ${LN} -sf ${PREFIX}/lib/lib${PYTHON_VERSION}.so ${PYTHONPREFIX_LIBDIR}/config
- ${INSTALL_PROGRAM} \
- ${SHARED_WRKSRC}/${PYTHON_VERSION:S/thon/thon-shared/} \
- ${PREFIX}/bin
-
- @# additional files installing by ports
- ${INSTALL_SCRIPT} ${WRKDIR}/pydoc2.5 ${WRKDIR}/idle2.5 \
- ${WRKDIR}/smtpd2.5.py ${PREFIX}/bin
- @${MKDIR} ${MANPREFIX}/man/man1
- ${INSTALL_MAN} ${PYTHON_WRKSRC}/Misc/python.man \
- ${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
-
-.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION}
- for f in ${BIN_SCRIPTS}; do \
- TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \
- cd ${PREFIX}/bin && ${LN} -f $$TARGET $$f; \
- done
-.endif
-
-.if !defined(NOPORTDOCS)
- @${MKDIR} ${TOOLSDIR}
- @cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \
- (cd ${TOOLSDIR}; ${TAR} -xf -)
- @${MKDIR} ${DEMODIR}
- @cd ${PYTHON_WRKSRC}/Demo; ${TAR} -cf - * | \
- (cd ${DEMODIR}; ${TAR} -xf -)
-.endif
-
- @${CAT} ${PKGMESSAGE}
-
-.include <bsd.port.post.mk>
diff --git a/tests/examplefiles/qbasic_example b/tests/examplefiles/qbasic_example
deleted file mode 100644
index 27041af6..00000000
--- a/tests/examplefiles/qbasic_example
+++ /dev/null
@@ -1,2 +0,0 @@
-10 print RIGHT$("hi there", 5)
-20 goto 10
diff --git a/tests/examplefiles/qsort.prolog b/tests/examplefiles/qsort.prolog
deleted file mode 100644
index d78de6f1..00000000
--- a/tests/examplefiles/qsort.prolog
+++ /dev/null
@@ -1,13 +0,0 @@
-partition([], _, [], []).
-partition([X|Xs], Pivot, Smalls, Bigs) :-
- ( X @< Pivot ->
- Smalls = [X|Rest],
- partition(Xs, Pivot, Rest, Bigs)
- ; Bigs = [X|Rest],
- partition(Xs, Pivot, Smalls, Rest)
- ).
-
-quicksort([]) --> [].
-quicksort([X|Xs]) -->
- { partition(Xs, X, Smaller, Bigger) },
- quicksort(Smaller), [X], quicksort(Bigger).
diff --git a/tests/examplefiles/r-console-transcript.Rout b/tests/examplefiles/r-console-transcript.Rout
deleted file mode 100644
index d0cf34b9..00000000
--- a/tests/examplefiles/r-console-transcript.Rout
+++ /dev/null
@@ -1,38 +0,0 @@
-
-R version 2.9.2 (2009-08-24)
-Copyright (C) 2009 The R Foundation for Statistical Computing
-ISBN 3-900051-07-0
-
-R is free software and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute it under certain conditions.
-Type 'license()' or 'licence()' for distribution details.
-
- Natural language support but running in an English locale
-
-R is a collaborative project with many contributors.
-Type 'contributors()' for more information and
-'citation()' on how to cite R or R packages in publications.
-
-Type 'demo()' for some demos, 'help()' for on-line help, or
-'help.start()' for an HTML browser interface to help.
-Type 'q()' to quit R.
-
-[R.app GUI 1.29 (5464) i386-apple-darwin8.11.1]
-
-> x <- function {}
-Error: syntax error
-> x <- function() {}
-> x <- function() {
-+ cat("hello")
-+ cat("world")
-+ }
-> x
-function() {
-cat("hello")
-cat("world")
-}
-> x()
-helloworld
-> 2 + 2
-[1] 4
-> \ No newline at end of file
diff --git a/tests/examplefiles/r6rs-comments.scm b/tests/examplefiles/r6rs-comments.scm
deleted file mode 100644
index cd5c3636..00000000
--- a/tests/examplefiles/r6rs-comments.scm
+++ /dev/null
@@ -1,23 +0,0 @@
-#!r6rs
-
-#|
-
- The FACT procedure computes the factorial
-
- of a non-negative integer.
-
-|#
-
-(define fact
-
- (lambda (n)
-
- ;; base case
-
- (if (= n 0)
-
- #;(= n 1)
-
- 1 ; identity of *
-
- (* n (fact (- n 1))))))
diff --git a/tests/examplefiles/ragel-cpp_rlscan b/tests/examplefiles/ragel-cpp_rlscan
deleted file mode 100644
index 4b146329..00000000
--- a/tests/examplefiles/ragel-cpp_rlscan
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Lexes Ragel input files.
- *
- * @LANG: c++
- *
- * Test works with split code gen.
- */
-
-#include <iostream>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-using namespace std;
-
-void escapeXML( const char *data )
-{
- while ( *data != 0 ) {
- switch ( *data ) {
- case '<': cout << "&lt;"; break;
- case '>': cout << "&gt;"; break;
- case '&': cout << "&amp;"; break;
- default: cout << *data; break;
- }
- data += 1;
- }
-}
-
-void escapeXML( char c )
-{
- switch ( c ) {
- case '<': cout << "&lt;"; break;
- case '>': cout << "&gt;"; break;
- case '&': cout << "&amp;"; break;
- default: cout << c; break;
- }
-}
-
-void escapeXML( const char *data, int len )
-{
- for ( const char *end = data + len; data != end; data++ ) {
- switch ( *data ) {
- case '<': cout << "&lt;"; break;
- case '>': cout << "&gt;"; break;
- case '&': cout << "&amp;"; break;
- default: cout << *data; break;
- }
- }
-}
-
-inline void write( const char *data )
-{
- cout << data;
-}
-
-inline void write( char c )
-{
- cout << c;
-}
-
-inline void write( const char *data, int len )
-{
- cout.write( data, len );
-}
-
-
-%%{
- machine RagelScan;
-
- word = [a-zA-Z_][a-zA-Z_0-9]*;
- integer = [0-9]+;
- hex = '0x' [0-9a-fA-F] [0-9a-fA-F]*;
-
- default = ^0;
- EOF = 0;
-
- # Handles comments in outside code and inline blocks.
- c_comment :=
- ( default* :>> '*/' )
- ${ escapeXML( fc ); }
- @{ fret; };
-
- action emit {
- escapeXML( ts, te-ts );
- }
-
- #
- # Inline action code
- #
-
- ilscan := |*
-
- "'" ( [^'\\] | /\\./ )* "'" => emit;
- '"' ( [^"\\] | /\\./ )* '"' => emit;
- '/*' {
- write( "/*" );
- fcall c_comment;
- };
- '//' [^\n]* '\n' => emit;
-
- '{' {
- write( '{' );
- inline_depth += 1;
- };
-
- '}' {
- write( '}' );
- /* If dropping down to the last } then return
- * to ragel code. */
- if ( --inline_depth == 0 ) {
- write( "</inline>\n" );
- fgoto rlscan;
- }
- };
-
- default => { escapeXML( *ts ); };
- *|;
-
- #
- # Ragel Tokens
- #
-
- rlscan := |*
- '}%%' {
- if ( !single_line ) {
- write( "</section>\n" );
- fgoto main;
- }
- };
-
- '\n' {
- if ( single_line ) {
- write( "</section>\n" );
- fgoto main;
- }
- };
-
- # Word
- word {
- write( "<word>" );
- write( ts, te-ts );
- write( "</word>\n" );
- };
-
- # Decimal integer.
- integer {
- write( "<int>" );
- write( ts, te-ts );
- write( "</int>\n" );
- };
-
- # Hexidecimal integer.
- hex {
- write( "<hex>" );
- write( ts, te-ts );
- write( "</hex>\n" );
- };
-
- # Consume comments.
- '#' [^\n]* '\n';
-
- # Single literal string.
- "'" ( [^'\\] | /\\./ )* "'" {
- write( "<single_lit>" );
- escapeXML( ts, te-ts );
- write( "</single_lit>\n" );
- };
-
- # Double literal string.
- '"' ( [^"\\] | /\\./ )* '"' {
- write( "<double_lit>" );
- escapeXML( ts, te-ts );
- write( "</double_lit>\n" );
- };
-
- # Or literal.
- '[' ( [^\]\\] | /\\./ )* ']' {
- write( "<or_lit>" );
- escapeXML( ts, te-ts );
- write( "</or_lit>\n" );
- };
-
- # Regex Literal.
- '/' ( [^/\\] | /\\./ ) * '/' {
- write( "<re_lit>" );
- escapeXML( ts, te-ts );
- write( "</re_lit>\n" );
- };
-
- # Open an inline block
- '{' {
- inline_depth = 1;
- write( "<inline>{" );
- fgoto ilscan;
- };
-
- punct {
- write( "<symbol>" );
- escapeXML( fc );
- write( "</symbol>\n" );
- };
-
- default;
- *|;
-
- #
- # Outside code.
- #
-
- main := |*
-
- "'" ( [^'\\] | /\\./ )* "'" => emit;
- '"' ( [^"\\] | /\\./ )* '"' => emit;
-
- '/*' {
- escapeXML( ts, te-ts );
- fcall c_comment;
- };
-
- '//' [^\n]* '\n' => emit;
-
- '%%{' {
- write( "<section>\n" );
- single_line = false;
- fgoto rlscan;
- };
-
- '%%' {
- write( "<section>\n" );
- single_line = true;
- fgoto rlscan;
- };
-
- default {
- escapeXML( *ts );
- };
-
- # EOF.
- EOF;
- *|;
-}%%
-
-%% write data nofinal;
-
-void test( const char *data )
-{
- std::ios::sync_with_stdio(false);
-
- int cs, act;
- const char *ts, *te;
- int stack[1], top;
-
- bool single_line = false;
- int inline_depth = 0;
-
- %% write init;
-
- /* Read in a block. */
- const char *p = data;
- const char *pe = data + strlen( data );
- const char *eof = pe;
- %% write exec;
-
- if ( cs == RagelScan_error ) {
- /* Machine failed before finding a token. */
- cerr << "PARSE ERROR" << endl;
- exit(1);
- }
-}
-
-#define BUFSIZE 2048
-
-int main()
-{
- std::ios::sync_with_stdio(false);
-
- test("hi %%{ /'}%%'/ { /*{*/ {} } + '\\'' }%%there\n");
-
- return 0;
-}
diff --git a/tests/examplefiles/ragel-cpp_snippet b/tests/examplefiles/ragel-cpp_snippet
deleted file mode 100644
index 203ae28b..00000000
--- a/tests/examplefiles/ragel-cpp_snippet
+++ /dev/null
@@ -1,2 +0,0 @@
- %% write init;
- /* Read in a block. */
diff --git a/tests/examplefiles/regex.js b/tests/examplefiles/regex.js
deleted file mode 100644
index 7790cb00..00000000
--- a/tests/examplefiles/regex.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// regex
-
-blah(/abc/);
-x = /abc/;
-x = /abc/.match;
-
-// math
-
-blah(1/2); //comment
-x = 1 / 2 / 3;
-x = 1/1/.1;
-
-// broken
-
-x=/1/;
-x=1/a/g;
-x=a/a/g;
-
-// real-world
-
-var x = 1/(1+Math.sqrt(sum)); // convert to number between 1-0
-return Math.round((num / den) * 100)/100;
diff --git a/tests/examplefiles/resourcebundle_demo b/tests/examplefiles/resourcebundle_demo
deleted file mode 100644
index e1daa56a..00000000
--- a/tests/examplefiles/resourcebundle_demo
+++ /dev/null
@@ -1,9 +0,0 @@
-root:table {
- usage:string { "Usage: genrb [Options] files" }
- version:int { 122 }
- errorcodes:array {
- :string { "Invalid argument" }
- :string { "File not found" }
- :string { "\x00 \r \t \n \u1234" }
- }
-}
diff --git a/tests/examplefiles/reversi.lsp b/tests/examplefiles/reversi.lsp
deleted file mode 100644
index fa9a333c..00000000
--- a/tests/examplefiles/reversi.lsp
+++ /dev/null
@@ -1,427 +0,0 @@
-#!/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/rnc_example.rnc b/tests/examplefiles/rnc_example.rnc
deleted file mode 100644
index a1440302..00000000
--- a/tests/examplefiles/rnc_example.rnc
+++ /dev/null
@@ -1,33 +0,0 @@
-# This is a sample RNC file from the tutorial for the 2003 Working Draft
-# http://relaxng.org/compact-tutorial-20030326.html
-
-element html {
- element head {
- element title { text }
- },
- element body {
- element table {
- attribute class { "addressBook" },
- element tr {
- attribute class { "card" },
- element td {
- attribute class { "name" },
- mixed {
- element span {
- attribute class { "givenName" },
- text
- }?,
- element span {
- attribute class { "familyName" },
- text
- }?
- }
- },
- element td {
- attribute class { "email" },
- text
- }
- }+
- }
- }
-}
diff --git a/tests/examplefiles/roboconf.graph b/tests/examplefiles/roboconf.graph
deleted file mode 100644
index e5fdedff..00000000
--- a/tests/examplefiles/roboconf.graph
+++ /dev/null
@@ -1,40 +0,0 @@
-##################
-# A sample graph
-##################
-
-import some-definition.graph;
-import another-definition.graph;
-
-VM {
- installer : target;
- children: deployable;
-}
-
-facet deployable {
- # nothing
-}
-
-# Sample deployables
-mysql {
- insTaller: puppet;
- facets: deployable;
- exports: ip, port = 3306;
-}
-
-tomcat {
- installer: bash;
- facets: deployable;
- exports: ip;
- children: web-application;
-}
-
-facet web-application {
- exports: full-path = undefined;
-}
-
-my-war-1 {
- facets: web-application;
- installer: file;
- exports: full-path = apps/my-war-1; # the relative path
- imports: mysql.*;
-}
diff --git a/tests/examplefiles/roboconf.instances b/tests/examplefiles/roboconf.instances
deleted file mode 100644
index c69a2ab0..00000000
--- a/tests/examplefiles/roboconf.instances
+++ /dev/null
@@ -1,24 +0,0 @@
-
-# Deal with imports
-import others.instances;
-
-instance of VM {
- name: VM-mysql;
- instance of mysql {
- name: MySQL;
- }
-}
-
-instance of VM {
- name: VM ;
- count: 5;
-
- INSTANCE of tomcat {
- name: Tomcat;
-
- instance of my-war-1 {
- name: my-war-1;
- full-path: apps/my-war;
- }
- }
-}
diff --git a/tests/examplefiles/robotframework_test.txt b/tests/examplefiles/robotframework_test.txt
deleted file mode 100644
index 0d8179c0..00000000
--- a/tests/examplefiles/robotframework_test.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-*** Settings ***
-Documentation Simple example demonstrating syntax highlighting.
-Library ExampleLibrary
-Test Setup Keyword argument argument with ${VARIABLE}
-
-*** Variables ***
-${VARIABLE} Variable value
-@{LIST} List variable here
-&{DICT} Key1=Value1 Key2=Value2
-
-*** Test Cases ***
-Keyword-driven example
- Initialize System
- Do Something
- Result Should Be 42
- [Teardown] Cleanup System
-
-Data-driven example
- [Template] Keyword
- argument1 argument2
- argument ${VARIABLE}
- @{LIST}
-
-Gherkin
- Given system is initialized
- When something is done
- Then result should be "42"
-
-| Pipes |
-| | [Documentation] | Also pipe separated format is supported. |
-| | Log | As this example demonstrates. |
-
-*** Keywords ***
-Result Should Be
- [Arguments] ${expected}
- ${actual} = Get Value
- Should be Equal ${actual} ${expected}
-
-Then result should be "${expected}"
- Result Should Be ${expected}
diff --git a/tests/examplefiles/rql-queries.rql b/tests/examplefiles/rql-queries.rql
deleted file mode 100644
index 1d86df3c..00000000
--- a/tests/examplefiles/rql-queries.rql
+++ /dev/null
@@ -1,34 +0,0 @@
-Any N, N2 where N is Note, N2 is Note, N a_faire_par P1, P1 nom 'john', N2 a_faire_par P2, P2 nom 'jane' ;
-DISTINCT Any N, D, C, T, A ORDERBY D DESC LIMIT 40 where N is Note, N diem D, W is Workcase, W concerned_by N, N cost C, N text T, N author A, N diem <= today
-Bookmark B WHERE B owned_by G, G eid 5;
-Any X WHERE E eid 22762, NOT E is_in X, X modification_date D ORDERBY D DESC LIMIT 41;
-Any A, R, SUB ORDERBY R WHERE A is "Workcase", S is Division, S concerned_by A, A subject SUB, S eid 85, A ref R;
-Any D, T, L WHERE D is Document, A concerned_by D,A eid 14533, D title T, D location L;
-Any N,A,B,C,D ORDERBY A DESC WHERE N is Note, W concerned_by N, W eid 14533, N diem A,N author B,N text C,N cost D;
-Any X ORDERBY D DESC LIMIT 41 WHERE E eid 18134, NOT E concerned_by X, X modification_date D
-DISTINCT Any N, D, C, T, A ORDERBY D ASC LIMIT 40 WHERE N is Note, N diem D, P is Person, N to_be_contacted_by G, N cost C, N text T, N author A, G login "john";
-INSERT Person X: X surname "Doe", X firstname "John";
-Workcase W where W ref "ABCD12";
-Workcase W where W ref LIKE "AB%";
-Any X WHERE X X eid 53
-Any X WHERE X Document X occurence_of F, F class C, C name 'Comics' X owned_by U, U login 'syt' X available true
-Person P WHERE P work_for P, S name 'Acme', P interested_by T, T name 'training'
-Note N WHERE N written_on D, D day> (today -10), N written_by P, P name 'joe' or P name 'jack'
-Person P WHERE (P interested_by T, T name 'training') or (P city 'Paris')
-Any N, P WHERE X is Person, X name N, X first_name P
-String N, P WHERE X is Person, X name N, X first_name P
-INSERT Person X: X name 'widget'
-INSERT Person X, Person Y: X name 'foo', Y name 'nice', X friend Y
-INSERT Person X: X name 'foo', X friend Y WHERE name 'nice'
-SET X name 'bar', X first_name 'original' where X is Person X name 'foo'
-SET X know Y WHERE X friend Y
-DELETE Person X WHERE X name 'foo'
-DELETE X friend Y WHERE X is Person, X name 'foo'
-Any X WHERE X name LIKE '%lt'
-Any X WHERE X name IN ( 'joe', 'jack', 'william', 'averell')
-Any X, V WHERE X concerns P, P eid 42, X corrected_in V?
-Any C, P WHERE C is Card, P? documented_by C
-Point P where P abs X, P ord Y, P value X+Y
-Document X where X class C, C name 'Cartoon', X owned_by U, U login 'joe', X available true
-(Any X WHERE X is Document) UNION (Any X WHERE X is File)
-Any A,B WHERE A creation_date B WITH A BEING (Any X WHERE X is Document) UNION (Any X WHERE X is File)
diff --git a/tests/examplefiles/ruby_func_def.rb b/tests/examplefiles/ruby_func_def.rb
deleted file mode 100644
index a820c68f..00000000
--- a/tests/examplefiles/ruby_func_def.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class (get_foo("blub"))::Foo
- def (foo("bar") + bar("baz")).something argh, aaahaa
- 42
- end
-end
-
-class get_the_fuck("out")::Of::My
- def parser_definition
- ruby!
- end
-end
diff --git a/tests/examplefiles/sample.qvto b/tests/examplefiles/sample.qvto
deleted file mode 100644
index 6241ee23..00000000
--- a/tests/examplefiles/sample.qvto
+++ /dev/null
@@ -1,4 +0,0 @@
-transformation Foo(uml: SimpleUML,
- rdbms : SimpleRDBMS) {
-}
-/* comment */
diff --git a/tests/examplefiles/scilab.sci b/tests/examplefiles/scilab.sci
deleted file mode 100644
index 8dea7b9c..00000000
--- a/tests/examplefiles/scilab.sci
+++ /dev/null
@@ -1,30 +0,0 @@
-// 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
diff --git a/tests/examplefiles/scope.cirru b/tests/examplefiles/scope.cirru
deleted file mode 100644
index c3d1a2c6..00000000
--- a/tests/examplefiles/scope.cirru
+++ /dev/null
@@ -1,237 +0,0 @@
-
--- demo
-
-define a (read cd) $ if (> a cd)
- print demo
- print "not demo"
-
-say $ print a $ save $ b $ x $ c 8
-
-print fun
-
--- test on folding
-
-a $
-
-b $ c
-
-d $ e $ f
-
-g $ h $ i j $ k $
-
--- test on comma
-
-print (, a)
- a
- , b
- , c (, d)
-
--- test on HTML
-
-doctype
-
-html
- head
- title $ = Cirru
- script (:defer) $ :src build/build.js
- link (:rel stylesheet) $ :href css/page.css
- link (:rel icon)
- :href http://logo.cirru.org/cirru-32x32.png?v=3
- body
- textarea.demo.source $ :placeholder "Source Code"
- textarea.demo.target $ :placeholder "Compiled Data"
- @insert ../html/ga.html
-
--- test on indentation
-
-a $ b $ c
-
-e f
- (g)
- h
-
--- test on parentheses
-
-3 4 (1) 4
-
-((((1))))
-
-x
-
--- test on quotes
-
-a b c d
-
-"a b c d"
-
-"a b \" c d"
-
-"a b" "c d"
-
--- test on unfolding
-
-set
- add 1 $
- , x y
- add 5 $
- add 2
-
--- test on HTML attributes
-
-div
- div
- :class a
- div
- :class a b c d
-
- div
- :class a (@ b) (@ c) d
-
- div
- :class a
- @if (@ b)
- div b
- div c
- div
- :class a
- @if (@ b) b c
-
--- test on helpers
-
-@if (@call a b) (div) (span)
-
-@each members
- div (@ name)
-
-@each a
- div (@ b)
- @each c
- div (@ d)
-
--- test on HTML structure
-
-@rich more
- #demo-more-box
- #demo-more
- :data-lang-text demo-more
- #demo-more-list
- @each room
- .demo-more-room
- span.demo-name
- @ topic
- span.demo-join
- :data-lang-text demo-join
- :data-id (@ id)
-
--- text on bool
-
-print #true
-print #false
-print #yes
-print #no
-print #t
-print #f
-
--- test on Cirru js
-
-set a 1
-set a (= "This is a string")
-set b #t
-
--- this is comment
-
-number 1.4
-string x
-regex ^\s$
-regex "^\\s-\"$"
-sentence this is a string
-
-array 1 2 3 (= nothing) #t (= #t)
-
-set c (array 1 (= nothing))
-
-set d $ object (a (= google))
- b (= reader)
- c 1
- d $ array 1 2 (= string)
-
-1 c
--1 c
-
-:b d
-.log console a 2
-.log console
-
-set demo $ object
- call $ \ x (.log console x) (. this call)
-. demo (.call 1) (.call 4)
-
-=.x d 3
-
-set d null
-
-new Array 1 2 3
-
-set x (:length c)
-set str (= str)
-set c (.toUpperCase str)
-
-\ x (+ x 1)
-\ (x y) (+ x y)
-\ x (set aa 1) (+ aa x)
-
-set f (\ x (+ x 1))
-
-+ a 1 2
-+= a 1
-
-> 1 2 3
-
-if (> 2 1) (+ a 1)
-else 2
-
-if (> a 2)
- .log console (= "large")
-elseif (> a 1)
- .log console (= "still good")
-else
- .log console (= "so so")
-
-set a $ if (> 2 1) #t #f
-
-switch a
- 1 (.log console 1)
- 2 (.log console 2)
- else (.log console (= "something else"))
-
-set a $ array 2 +3 -4
-for (a x i) (.log console x i)
-
-set a 0
-while (< a 10) (+= a 1) (.log console a)
-
--- WebAssembly variable names
-
--- ":(c) 2015 Andreas Rossberg"
-
-module
- export :even $even
- export "odd" $odd
-
- func $even (param $n i32) (result i32)
- if (i32.eq (get_local $n) (i32.const 0))
- i32.const 1
- call $odd (i32.sub (get_local $n) (i32.const 1))
-
- func $odd (param $n i32) (result i32)
- store_global $scratch (get_local $n)
- if (i32.eq (get_local $n) (i32.const 0)
- i32.const 0
- call $even (i32.sub (get_local $n) (i32.const 1))
-
- global $scratch i32
-
-assert_eq (invoke :even (i32.const 13)) (i32.const 0)
-assert_eq (invoke :even (i32.const 20)) (i32.const 1)
-assert_eq (invoke :odd (i32.const 13)) (i32.const 1)
-assert_eq (invoke :odd (i32.const 20)) (i32.const 0)
diff --git a/tests/examplefiles/session.dylan-console b/tests/examplefiles/session.dylan-console
deleted file mode 100644
index 6f289c8e..00000000
--- a/tests/examplefiles/session.dylan-console
+++ /dev/null
@@ -1,9 +0,0 @@
-? 7 * 52;
-=> 364
-? define variable *your-variable* = $foo;
-? begin
- let yours = "apple";
- let mine = yours;
- mine == yours;
- end;
-=> #t
diff --git a/tests/examplefiles/sibling.prolog b/tests/examplefiles/sibling.prolog
deleted file mode 100644
index bc591502..00000000
--- a/tests/examplefiles/sibling.prolog
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Comments /* can nest */
-still a comment
-*/
-
-:- module(maplist, maplist/3)
-
-assert(world:done). % asserts
-
-sibling(X, Y) :- parent_child(Z, X), parent_child(Z, Y).
-
-parent_child(X, Y) :- father_child(X, Y).
-parent_child(X, Y) :- mother_child(X, Y).
-
-mother_child(trude, sally).
-
-father_child(tom, sally).
-father_child(tom, erica).
-father_child(mike, tom).
-
diff --git a/tests/examplefiles/simple.camkes b/tests/examplefiles/simple.camkes
deleted file mode 100644
index 43e11732..00000000
--- a/tests/examplefiles/simple.camkes
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Example input for CAmkES lexer.
- */
-
-import <std_connector.camkes>;
-
-// A single-line comment.
-
-import "components/Client/Client.camkes";
-import "components/Echo/Echo.camkes";
-
-component Foo {
- include "proc_defn.h";
- control;
- dataport Buf my_port;
-}
-
-#ifdef BAR_AVAILABLE
- component Bar {
- provides CharAccess ca;
- }
-#endif
-
- #define HASH_DEF_WITH_LEADING_SPACE
-
-assembly { /* Another multiline comment. */
- composition {
- component Echo echo;
- component Client client;
-
- connection seL4RPC simple(from client.s, to echo.s);
- }
-
- configuration {
- echo.dma_pool = 4096;
- }
-}
-
diff --git a/tests/examplefiles/simple.croc b/tests/examplefiles/simple.croc
deleted file mode 100644
index 8f12771a..00000000
--- a/tests/examplefiles/simple.croc
+++ /dev/null
@@ -1,747 +0,0 @@
-module simple;
-
-// Importing stuff.
-{
- function loadMod(name, ns)
- {
- assert(name == "mod");
-
- ns.x = "I'm x";
-
- ns.foo = function foo()
- {
- writefln("foo");
- };
-
- ns.bar = function bar(x)
- {
- return x[0];
- };
-
- ns.baz = function baz()
- {
- writefln(x);
- };
-
- foreach(k, v; ns)
- if(isFunction(v))
- v.environment(ns);
- }
-
- setModuleLoader("mod", loadMod);
-
- import mod : foo, bar;
- foo();
- writefln(bar([5]));
- mod.baz();
-
- writefln();
-}
-
-// Super calls.
-{
- class Base
- {
- function fork()
- {
- writefln("Base fork.");
- }
- }
-
- class Derived : Base
- {
- function fork()
- {
- writefln("Derived fork!");
- super.fork();
- }
- }
-
- local d = Derived();
- d.fork();
-
- writefln();
-}
-
-// Coroutines and coroutine iteration.
-{
- local countDown = coroutine function countDown(x)
- {
- yield();
-
- while(x > 0)
- {
- yield(x);
- x--;
- }
- };
-
- foreach(v; countDown, 5)
- writefln(v);
-
- writefln();
-
- local forEach = coroutine function forEach(t)
- {
- yield();
-
- foreach(k, v; t)
- yield(k, v);
- };
-
- foreach(_, k, v; forEach, {hi = 1, bye = 2})
- writefln("key: ", k, ", value: ", v);
-
- writefln();
-}
-
-// Testing tailcalls.
-{
- function recurse(x)
- {
- writefln("recurse: ", x);
-
- if(x == 0)
- return toString(x);
- else
- return recurse(x - 1);
- }
-
- writefln(recurse(5));
- writefln();
-
- class A
- {
- function f(x)
- {
- writefln("A.f: ", x);
-
- if(x == 0)
- return toString(x);
- else
- return this.f(x - 1); // call it as this.f to force a 'method' instruction to be generated
- }
- }
-
- local a = A();
- writefln(a.f(5));
- writefln();
-}
-
-{
- // A function which lets us define properties for a class.
- // The varargs should be a bunch of tables, each with a 'name' field, and 'getter' and/or 'setter' fields.
- function mixinProperties(classType, vararg)
- {
- classType.mProps = { };
-
- classType.opIndex = function opIndex(key)
- {
- local prop = mProps[key];
-
- if(prop is null)
- throw format(classType, ".opIndex() - Property '%s' does not exist", key);
-
- local getter = prop.getter;
-
- if(getter is null)
- throw format(classType, ".opIndex() - Property '%s' has no getter", key);
-
- return getter(with this);
- };
-
- classType.opIndexAssign = function opIndexAssign(key, value)
- {
- local prop = mProps[key];
-
- if(prop is null)
- throw format(classType, ".opIndexAssign() - Property '%s' does not exist", key);
-
- local setter = prop.setter;
-
- if(setter is null)
- throw format(classType, ".opIndexAssign() - Property '%s' has no setter", key);
-
- setter(with this, value);
- };
-
- foreach(i, prop; [vararg])
- {
- if(!isTable(prop))
- throw format("mixinProperties() - property ", i, " is not a table");
-
- if(prop.name is null)
- throw format("mixinProperties() - property ", i, " has no name");
-
- if(prop.setter is null && prop.getter is null)
- throw format("mixinProperties() - property '%s' has no getter or setter", prop.name);
-
- classType.mProps[prop.name] = prop;
- }
- }
-
- // Create a class to test out.
- class PropTest
- {
- mX = 0;
- mY = 0;
- mName = "";
-
- function constructor(name)
- {
- mName = name;
- }
-
- function toString()
- {
- return format("name = '", mName, "' x = ", mX, " y = ", mY);
- }
- }
-
- // Mix in the properties.
- mixinProperties
- (
- PropTest,
-
- {
- name = "x",
-
- function setter(value)
- {
- mX = value;
- }
-
- function getter()
- {
- return mX;
- }
- },
-
- {
- name = "y",
-
- function setter(value)
- {
- mY = value;
- }
-
- function getter()
- {
- return mY;
- }
- },
-
- {
- name = "name",
-
- function getter()
- {
- return mName;
- }
- }
- );
-
- // Create an instance and try it out.
- local p = PropTest("hello");
-
- writefln(p);
- p.x = 46;
- p.y = 123;
- p.x = p.x + p.y;
- writefln(p);
-
- // Try to access a nonexistent property.
- try
- p.name = "crap";
- catch(e)
- {
- writefln("caught: ", e);
- writefln(getTraceback());
- }
-
- writefln();
-}
-
-// Some container classes.
-{
- class PQ
- {
- mData;
- mLength = 0;
-
- function constructor()
- {
- mData = array.new(15);
- }
-
- function insert(data)
- {
- resizeArray();
- mData[mLength] = data;
-
- local index = mLength;
- local parentIndex = (index - 1) / 2;
-
- while(index > 0 && mData[parentIndex] > mData[index])
- {
- local temp = mData[parentIndex];
- mData[parentIndex] = mData[index];
- mData[index] = temp;
-
- index = parentIndex;
- parentIndex = (index - 1) / 2;
- }
-
- mLength += 1;
- }
-
- function remove()
- {
- if(mLength == 0)
- throw "PQ.remove() - No items to remove";
-
- local data = mData[0];
- mLength -= 1;
- mData[0] = mData[mLength];
-
- local index = 0;
- local left = 1;
- local right = 2;
-
- while(index < mLength)
- {
- local smaller;
-
- if(left >= mLength)
- {
- if(right >= mLength)
- break;
- else
- smaller = right;
- }
- else
- {
- if(right >= mLength)
- smaller = left;
- else
- {
- if(mData[left] < mData[right])
- smaller = left;
- else
- smaller = right;
- }
- }
-
- if(mData[index] > mData[smaller])
- {
- local temp = mData[index];
- mData[index] = mData[smaller];
- mData[smaller] = temp;
-
- index = smaller;
- left = (index * 2) + 1;
- right = left + 1;
- }
- else
- break;
- }
-
- return data;
- }
-
- function resizeArray()
- {
- if(mLength >= #mData)
- mData.length((#mData + 1) * 2 - 1);
- }
-
- function hasData()
- {
- return mLength != 0;
- }
- }
-
- class Stack
- {
- mHead = null;
-
- function push(data)
- {
- local t = { data = data, next = mHead };
- mHead = t;
- }
-
- function pop()
- {
- if(mHead is null)
- throw "Stack.pop() - No items to pop";
-
- local item = mHead;
- mHead = mHead.next;
-
- return item.data;
- }
-
- function hasData()
- {
- return mHead !is null;
- }
- }
-
- class Queue
- {
- mHead = null;
- mTail = null;
-
- function push(data)
- {
- local t = { data = data, next = null };
-
- if(mTail is null)
- {
- mHead = t;
- mTail = t;
- }
- else
- {
- mTail.next = t;
- mTail = t;
- }
- }
-
- function pop()
- {
- if(mTail is null)
- throw "Queue.pop() - No items to pop";
-
- local item = mHead;
- mHead = mHead.next;
-
- if(mHead is null)
- mTail = null;
-
- return item.data;
- }
-
- function hasData()
- {
- return mHead !is null;
- }
- }
-
- writefln("Priority queue (heap)");
-
- local prioQ = PQ();
-
- for(i : 0 .. 10)
- prioQ.insert(math.rand(0, 20));
-
- while(prioQ.hasData())
- writefln(prioQ.remove());
-
- writefln();
- writefln("Stack");
-
- local stack = Stack();
-
- for(i : 0 .. 5)
- stack.push(i + 1);
-
- while(stack.hasData())
- writefln(stack.pop());
-
- writefln();
- writefln("Queue");
-
- local queue = Queue();
-
- for(i : 0 .. 5)
- queue.push(i + 1);
-
- while(queue.hasData())
- writefln(queue.pop());
-
- writefln();
-}
-
-// opApply tests.
-{
- class Test
- {
- mData = [4, 5, 6];
-
- function opApply(extra)
- {
- if(isString(extra) && extra == "reverse")
- {
- local function iterator_reverse(index)
- {
- index--;
-
- if(index < 0)
- return;
-
- return index, mData[index];
- }
-
- return iterator_reverse, this, #mData;
- }
- else
- {
- local function iterator(index)
- {
- index++;
-
- if(index >= #mData)
- return;
-
- return index, mData[index];
- }
-
- return iterator, this, -1;
- }
- }
- }
-
- local test = Test();
-
- foreach(k, v; test)
- writefln("test[", k, "] = ", v);
-
- writefln();
-
- foreach(k, v; test, "reverse")
- writefln("test[", k, "] = ", v);
-
- writefln();
-
- test =
- {
- fork = 5,
- knife = 10,
- spoon = "hi"
- };
-
- foreach(k, v; test)
- writefln("test[", k, "] = ", v);
-
- test = [5, 10, "hi"];
-
- writefln();
-
- foreach(k, v; test)
- writefln("test[", k, "] = ", v);
-
- writefln();
-
- foreach(k, v; test, "reverse")
- writefln("test[", k, "] = ", v);
-
- writefln();
-
- foreach(k, v; "hello")
- writefln("str[", k, "] = ", v);
-
- writefln();
-
- foreach(k, v; "hello", "reverse")
- writefln("str[", k, "] = ", v);
-
- writefln();
-}
-
-// Testing upvalues in for loops.
-{
- local arr = array.new(10);
-
- for(i : 0 .. 10)
- arr[i] = function() { return i; };
-
- writefln("This should be the values 0 through 9:");
-
- foreach(func; arr)
- writefln(func());
-
- writefln();
-}
-
-// Testing nested functions.
-{
- function outer()
- {
- local x = 3;
-
- function inner()
- {
- x++;
- writefln("inner x: ", x);
- }
-
- writefln("outer x: ", x);
- inner();
- writefln("outer x: ", x);
-
- return inner;
- }
-
- local func = outer();
- func();
-
- writefln();
-}
-
-// Testing Exceptions.
-{
- function thrower(x)
- {
- if(x >= 3)
- throw "Sorry, x is too big for me!";
- }
-
- function tryCatch(iterations)
- {
- try
- {
- for(i : 0 .. iterations)
- {
- writefln("tryCatch: ", i);
- thrower(i);
- }
- }
- catch(e)
- {
- writefln("tryCatch caught: ", e);
- throw e;
- }
- finally
- writefln("tryCatch finally");
- }
-
- try
- {
- tryCatch(2);
- tryCatch(5);
- }
- catch(e)
- writefln("caught: ", e);
-
- writefln();
-}
-
-// Testing arrays.
-{
- local array = [7, 9, 2, 3, 6];
-
- array.sort();
-
- foreach(i, v; array)
- writefln("arr[", i, "] = ", v);
-
- array ~= ["foo", "far"];
-
- writefln();
-
- foreach(i, v; array)
- writefln("arr[", i, "] = ", v);
-
- writefln();
-}
-
-// Testing vararg functions.
-{
- function vargs(vararg)
- {
- local args = [vararg];
-
- writefln("num varargs: ", #args);
-
- foreach(i, v; args)
- writefln("args[", i, "] = ", v);
- }
-
- vargs();
-
- writefln();
-
- vargs(2, 3, 5, "foo", "bar");
-
- writefln();
-}
-
-// Testing switches.
-{
- foreach(v; ["hi", "bye", "foo"])
- {
- switch(v)
- {
- case "hi":
- writefln("switched to hi");
- break;
-
- case "bye":
- writefln("switched to bye");
- break;
-
- default:
- writefln("switched to something else");
- break;
- }
- }
-
- writefln();
-
- foreach(v; [null, false, 1, 2.3, 'x', "hi"])
- {
- switch(v)
- {
- case null: writefln("null"); break;
- case false: writefln("false"); break;
- case 1: writefln("1"); break;
- case 2.3: writefln("2.3"); break;
- case 'x': writefln("x"); break;
- case "hi": writefln("hi"); break;
- }
- }
-
- writefln();
-
- class A
- {
- mValue;
-
- this(value)
- {
- mValue = value;
- }
-
- function opCmp(other)
- {
- assert(other as A);
- return mValue <=> other.mValue;
- }
- }
-
- local a1 = A(1);
- local a2 = A(2);
- local a3 = A(3);
-
- for(s : 1 .. 4)
- {
- local ss = A(s);
-
- switch(ss)
- {
- case a1:
- writefln(1);
- break;
-
- case a2:
- writefln(2);
- break;
-
- case a3:
- writefln(3);
- break;
- }
- }
-} \ No newline at end of file
diff --git a/tests/examplefiles/smarty_example.html b/tests/examplefiles/smarty_example.html
deleted file mode 100644
index cf4ffdc3..00000000
--- a/tests/examplefiles/smarty_example.html
+++ /dev/null
@@ -1,209 +0,0 @@
-{php}
- include "some/php/file.php";
-
- foreach ($rows as $row) {
- echo $row;
- }
-{/php}
-
-{* smarty comment *}
-<!-- ENTRIES START -->
- {serendipity_hookPlugin hook="entries_header" addData="$entry_id"}
-
- {foreach from=$entries item="dategroup"}
- <div class="serendipity_Entry_Date">
- {if $dategroup.is_sticky}
- <h3 class="serendipity_date">{$CONST.STICKY_POSTINGS}</h3>
- {else}
- <h3 class="serendipity_date">{$dategroup.date|@formatTime:DATE_FORMAT_BARSINISTER}</h3>
- {/if}
-
- {foreach from=$dategroup.entries item="entry"}
- <h4 class="serendipity_title"><a href="{$entry.link}">{$entry.title}</a></h4>
-
- <div class="serendipity_entry serendipity_entry_author_{$entry.author|@makeFilename} {if $entry.is_entry_owner}serendipity_entry_author_self{/if}">
- {if $entry.categories}
- <span class="serendipity_entryIcon">
- {foreach from=$entry.categories item="category"}
- {if $category.category_icon}
- <a href="{$category.category_link}"><img class="serendipity_entryIcon" title="{$category.category_name|@escape}{$category.category_description|@emptyPrefix}" alt="{$category.category_name|@escape}" src="{$category.category_icon}" /></a>
- {/if}
- {/foreach}
- </span>
- {/if}
-
- <div class="serendipity_entry_body">
- {$entry.body}
- </div>
-
- {if $entry.is_extended}
- <div class="serendipity_entry_extended"><a id="extended"></a>{$entry.extended}</div>
- {/if}
-
- {if $entry.has_extended and not $is_single_entry and not $entry.is_extended}<br />
- <p class="continue_reading"><a href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a></p><br />
- {/if}
-
- <div class='serendipity_entryFooter'>
- {$CONST.POSTED_BY} <a href="{$entry.link_author}">{$entry.author}</a>
- {if $entry.categories}
- {$CONST.IN} {foreach from=$entry.categories item="category" name="categories"}<a href="{$category.category_link}">{$category.category_name|@escape}</a>{if not $smarty.foreach.categories.last}, {/if}{/foreach}
- {/if}
-
- {if $entry.has_comments}
- {if $use_popups}
- | <a href="{$entry.link_popup_comments}" onclick="window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;">{$entry.label_comments} ({$entry.comments})</a>
- {else}
- | <a href="{$entry.link}#comments">{$entry.label_comments} ({$entry.comments})</a>
- {/if}
- {/if}
-
- {if $entry.has_trackbacks}
- {if $use_popups}
- | <a href="{$entry.link_popup_trackbacks}" onclick="window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;">{$entry.label_trackbacks} ({$entry.trackbacks})</a>
- {else}
- | <a href="{$entry.link}#trackbacks">{$entry.label_trackbacks} ({$entry.trackbacks})</a>
- {/if}
- {/if}
-
- {if $entry.is_entry_owner and not $is_preview}
- | <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>
- {/if}
-
- {$entry.add_footer}
- </div>
- </div>
- <!--
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
- xmlns:dc="http://purl.org/dc/elements/1.1/">
- <rdf:Description
- rdf:about="{$entry.link_rdf}"
- trackback:ping="{$entry.link_trackback}"
- dc:title="{$entry.title}"
- dc:identifier="{$entry.rdf_ident}" />
- </rdf:RDF>
- -->
- {$entry.plugin_display_dat}
-
- {if $is_single_entry and not $use_popups and not $is_preview}
- {if $CONST.DATA_UNSUBSCRIBED}
- <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_UNSUBSCRIBED|@sprintf:$CONST.UNSUBSCRIBE_OK}</div><br />
- {/if}
-
- {if $CONST.DATA_TRACKBACK_DELETED}
- <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_TRACKBACK_DELETED|@sprintf:$CONST.TRACKBACK_DELETED}</div><br />
- {/if}
-
- {if $CONST.DATA_TRACKBACK_APPROVED}
- <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_TRACKBACK_APPROVED|@sprintf:$CONST.TRACKBACK_APPROVED}</div><br />
- {/if}
-
- {if $CONST.DATA_COMMENT_DELETED}
- <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_COMMENT_DELETED|@sprintf:$CONST.COMMENT_DELETED}</div><br />
- {/if}
-
- {if $CONST.DATA_COMMENT_APPROVED}
- <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_COMMENT_APPROVED|@sprintf:$CONST.COMMENT_APPROVED}</div><br />
- {/if}
-
- {/if}
-
- {if $is_single_entry and not $is_preview}
- <div class="serendipity_comments">
- <br />
- <a id="trackbacks"></a>
- <div class="serendipity_commentsTitle">{$CONST.TRACKBACKS}</div>
- <div class="serendipity_center">
- <a rel="nofollow" style="font-weight: normal" href="{$entry.link_trackback}" onclick="alert('{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape:htmlall}'); return false;" title="{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape}">{$CONST.TRACKBACK_SPECIFIC}</a>
- </div>
- <br />
- {serendipity_printTrackbacks entry=$entry.id}
- </div>
- <div class="serendipity_comments">
- <br />
- <a id="comments"></a>
- <div class="serendipity_commentsTitle">{$CONST.COMMENTS}</div>
- <div class="serendipity_center">{$CONST.DISPLAY_COMMENTS_AS}
- {if $entry.viewmode eq $CONST.VIEWMODE_LINEAR}
- ({$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$entry.link_viewmode_threaded}#comments">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>)
- {else}
- (<a href="{$entry.link_viewmode_linear}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED})
- {/if}
- </div>
- <br />
- {serendipity_printComments entry=$entry.id mode=$entry.viewmode}
-
- {if $entry.is_entry_owner}
- {if $entry.allow_comments}
- <div class="serendipity_center">(<a href="{$entry.link_deny_comments}">{$CONST.COMMENTS_DISABLE}</a>)</div>
- {else}
- <div class="serendipity_center">(<a href="{$entry.link_allow_comments}">{$CONST.COMMENTS_ENABLE}</a>)</div>
- {/if}
- {/if}
- <a id="feedback"></a>
-
- {foreach from=$comments_messagestack item="message"}
- <div class="serendipity_center serendipity_msg_important">{$message}</div>
- {/foreach}
-
- {if $is_comment_added}
-
- <br />
- <div class="serendipity_center serendipity_msg_notice">{$CONST.COMMENT_ADDED}</div>
-
- {elseif $is_comment_moderate}
-
- <br />
- <div class="serendipity_center serendipity_msg_notice">{$CONST.COMMENT_ADDED}<br />{$CONST.THIS_COMMENT_NEEDS_REVIEW}</div>
-
- {elseif not $entry.allow_comments}
-
- <br />
- <div class="serendipity_center serendipity_msg_important">{$CONST.COMMENTS_CLOSED}</div>
-
- {else}
-
- <br />
- <div class="serendipity_commentsTitle">{$CONST.ADD_COMMENT}</div>
- {$COMMENTFORM}
-
- {/if}
- </div>
- {/if}
-
- {$entry.backend_preview}
- {/foreach}
- </div>
- {foreachelse}
- {if not $plugin_clean_page}
- {$CONST.NO_ENTRIES_TO_PRINT}
- {/if}
- {/foreach}
-
-{if $footer_info}
- <div class="serendipity_pageFooter">
- {if $footer_info}
- {if $footer_prev_page}
- <span class="previous"><a href="{$footer_prev_page}">&laquo; {$CONST.PREVIOUS_PAGE}</a></span>
- {else}
- <span class="previous">&#160;</span>
- {/if}
- {else}
- {/if}
-
- {if $footer_info}
- <span class="entries_info">({$footer_info})</span>
- {/if}
-
- {if $footer_info}
- {if $footer_next_page}
- <span class="next"><a href="{$footer_next_page}">{$CONST.NEXT_PAGE} &raquo;</a></span>
- {else}
- <span class="next">&#160;</span>
- {/if}
- {else}
- {/if}
- </div>{/if}
- {serendipity_hookPlugin hook="entries_footer"}
-<!-- ENTRIES END -->
diff --git a/tests/examplefiles/source.lgt b/tests/examplefiles/source.lgt
deleted file mode 100644
index ce5abced..00000000
--- a/tests/examplefiles/source.lgt
+++ /dev/null
@@ -1,343 +0,0 @@
-
-% this is a single-line comment
-
-/*
-this is
-a block
-comment
-*/
-
-
-:- encoding(some_encoding).
-:- op(Precedence, Associativity, Operator).
-
-
-:- object(prototype,
- implements(protocol),
- imports(category),
- extends(parent)).
-
- :- info([
- version is 1.0,
- author is 'Paulo Moura',
- date is 2008/5/1,
- comment is 'Sample prototype for testing syntax coloring.']).
- :- threaded.
- :- synchronized.
- :- dynamic.
- :- initialization(some_goal(X, Y)).
- :- calls(some_other_protocol).
- :- uses(another_object).
-
- :- alias(set, member/2, set_member/2).
- :- alias(words, singular//0, peculiar//0).
-
- :- uses(list, [append/3, member/2]).
- :- uses(queues, [new/1::new_queue/1]).
-
- :- public(aaa/2).
- :- meta_predicate(aaa(::, *)).
- :- discontiguous(aaa/2).
- :- mode(aaa(+callable, ?integer), zero_or_one).
- :- info(position/2, [
- comment is 'Predicate brief description.',
- arguments is ['Arg1'-'Arg1 description', 'Arg2'-'Arg2 description']]).
-
- :- protected(bbb/2).
- :- synchronized(bbb/2).
- :- mode(bbb(+integer, -float), one).
- :- info(bbb/2, [
- comment is 'Predicate brief description.',
- argnames is ['Arg1', 'Arg2']]).
-
- :- private(ccc/2).
- :- dynamic(ccc/2).
- :- mode(ccc(@atom, ?atom), one_or_more).
- :- info(ccc/2, [
- comment is 'Predicate brief description.',
- argnames is ['Arg1', 'Arg2']]).
-
- enumerating_entities(Object, Protocol, Category) :-
- current_category(Category),
- current_object(Object),
- current_protocol(Protocol).
-
- enumerating_properties :-
- category_property(Category, Property),
- object_property(Object, Property),
- protocol_property(Protocol, Property).
-
- creating_entities(Object, Protocol, Category) :-
- create_category(Category, Relations, Directives, Clauses),
- create_object(Object, Relations, Directives, Clauses),
- create_protocol(Protocol, Relations, Directives).
-
- abolishing_entities(Object, Protocol, Category) :-
- abolish_category(Category),
- abolish_object(Object),
- abolish_protocol(Protocol).
-
- entity_relations :-
- extends_object(Prototype, Parent, Scope),
- extends_protocol(Protocol1, Protocol2, Scope),
- extends_category(Category1, Category2, Scope),
- implements_protocol(Object, Protocol, Scope),
- imports_category(Object, Category, Scope),
- instantiates_class(Instance, Class, Scope),
- specializes_class(Class, Superclass, Scope),
- complements_object(Category, Object).
-
- event_handling :-
- abolish_events(Event, Object, Message, Sender, Monitor),
- current_event(Event, Object, Message, Sender, Monitor),
- define_events(Event, Object, Message, Sender, Monitor).
-
- multi_threading :-
- threaded(Goals),
- threaded_call(Goal),
- threaded_once(Goal),
- threaded_ignore(Goal),
- threaded_exit(Goal),
- threaded_peek(Goal),
- threaded_wait(Goal),
- threaded_notify(Notification).
-
- compiling_and_loading :-
- logtalk_compile(File, Options),
- logtalk_load(File, Options),
- logtalk_library_path(Library, Path).
-
- flags :-
- current_logtalk_flag(Flag, Value),
- set_logtalk_flag(Flag, Value).
-
- execution_context_methods :-
- parameter(N, Parameter),
- self(Self),
- sender(Sender),
- this(This).
-
- reflection_methods :-
- current_predicate(Predicate),
- predicate_property(Predicate, Property).
-
- database_methods :-
- abolish(Functor/Arity),
- asserta(Clause),
- assertz(Clause),
- clause(Head, Body),
- retract(Clause),
- retractall(Head).
-
- meta_call_methods :-
- call(Goal).
-
- all_solutions_methods :-
- bagof(Term, Goal, List),
- findall(Term, Goal, List),
- forall(Generate, Test),
- setof(Term, Goal, List).
-
- event_handler_methods :-
- before(Object, Message, Sender),
- after(Object, Message, Sender).
-
- dcg_rules_parsing_methods :-
- phrase(NonTerminal, Input, Rest).
-
- term_expansion_methods :-
- expand_term(Term, Expanded),
- term_expansion(Term, Expanded),
- goal_expansion(Goal, Expanded).
-
- message_sending :-
- Object::Message,
- ::Message,
- ^^Message.
-
- calling_external_code :-
- {goal1, goal2, goal3}.
-
- context_switching_calls :-
- Object<<Goal.
-
- direct_calls_of_category_predicates :-
- :Goal.
-
- if_then_else :-
- ( If ->
- Then
- ; Else
- ).
-
- numbers :-
- X is 13,
- Y is 13.13,
- Z is 13.13e-23,
- C1 is 0'A, C2 is 0'', C3 is 0'",
- B is 0b1011101,
- O is 0o1234560,
- H is 0x1234567890abcDEF.
-
- functions :-
- A is atan(3.14) + sin(0.77) - cos(123.23),
- B is sign(-12) * abs(35/78),
- C is truncate(3.14) + round(-7.8) - ceiling(111.88),
- D is exp(3.8) - log(123.98) / sqrt(33) * 23 ** 4,
- E is rem(3, 2) + mod(5, 3) * 2 rem 2 // 5 mod 3,
- F is float_fractional_part(3.14) + float_integer_part(3.14),
- G is float(33) + floor(99.99).
-
- bitwise :-
- A is 16 >> 2,
- B is 16 << 2,
- C is 10 /\ 12,
- D is 10 \/ 12,
- E is \ 10.
-
- term_unification :-
- Term1 = Term2,
- Term1 \= Term2,
- unify_with_occurs_check(Term1, Term2).
-
- term_testing :-
- atom(Atom),
- atomic(Atomic),
- integer(Integer),
- float(Float),
- compound(Term),
- nonvar(Term),
- var(Term),
- number(Number).
-
- term_comparison :-
- Term1 == Term2,
- Term1 \== Term2,
- Term1 @< Term2,
- Term1 @=< Term2,
- Term1 @>= Term2,
- Term1 @> Term2.
-
- term_creation_and_decomposition :-
- functor(Term, Functor, Arity),
- arg(N, Term, Arg),
- Term =.. [Functor| Args],
- copy_term(Term, Copy).
-
- arithemtic_evaluation :-
- X is Expression.
-
- arithemtic_comparison :-
- Exp1 =:= Exp2,
- Exp1 =\= Exp2,
- Exp1 < Exp2,
- Exp1 =< Exp2,
- Exp1 > Exp2,
- Exp1 >= Exp2.
-
- stream_selection_and_control :-
- current_input(Stream),
- current_output(Stream),
- set_input(Stream),
- set_output(Stream),
- open(Source, Mode, Stream, Options),
- close(Stream),
- flush_output(Stream),
- stream_property(Stream, Property),
- at_end_of_stream(Stream),
- set_stream_position(Stream, Position),
- flush_output,
- at_end_of_stream.
-
- character_input_output :-
- get_char(Char),
- get_code(Code),
- peek_char(Char),
- peek_code(Code),
- put_char(Char),
- put_code(Code),
- nl(Stream),
- nl.
-
- byte_input_output :-
- get_byte(Byte),
- peek_byte(Byte),
- put_byte(Byte).
-
- term_input_output :-
- read(Term),
- read_term(Term),
- write(Term),
- write(Term),
- write_canonical(Term),
- write_term(Stream, Term, Options),
- current_op(Precedence, Associativity, Operator),
- op(Precedence, Associativity, Operator),
- current_char_conversion(InChar, OutChar),
- char_conversion(InChar, OutChar).
-
- logic_and_control :-
- \+ Goal,
- once(Goal),
- repeat,
- !.
-
- atomic_term_processing :-
- atom_length(Atom, Length),
- atom_chars(Atom, Chars),
- atom_codes(Atom, Codes),
- atom_concat(Atom1, Atom2, Atom),
- sub_atom(Atom, Before, Length, After, SubAtom),
- char_code(Char, Code),
- number_chars(Number, Chars),
- number_codes(Number, Codes).
-
- implementation_defined_hooks :-
- current_prolog_flag(Flag, Value),
- set_prolog_flag(Flag, Value),
- halt(ExitCode),
- halt.
-
- number(C) --> "+", number(C).
- number(C) --> "-", number(X), {C is -X}.
- number(X) --> [C], {0'0 =< C, C =< 0'9, X is C - 0'0}.
-
-:- end_object.
-
-
-
-:- object(class,
- implements(protocol),
- imports(category),
- instantiates(metaclass),
- specializes(superclass)).
-
-
-:- end_object.
-
-
-
-:- object(parametric(_Par1, _Par2),
- implements(protocol),
- imports(category),
- extends(parent(_Par))).
-
-
-:- end_object.
-
-
-
-:- category(category,
- implements(protocol),
- extends(other_category)).
-
-
-:- end_category.
-
-
-
-:- protocol(extended,
- extends(minimal)).
-
-
-:- end_protocol.
diff --git a/tests/examplefiles/sources.list b/tests/examplefiles/sources.list
deleted file mode 100644
index 3f363352..00000000
--- a/tests/examplefiles/sources.list
+++ /dev/null
@@ -1,62 +0,0 @@
-## CD ROM
-deb cdrom:[Xubuntu 6.06.1 _Dapper Drake_ - Release i386 (20060807)]/ dapper main restricted
-
-deb http://archive.ubuntu.com/ubuntu/ dapper main restricted
-deb-src http://archive.ubuntu.com/ubuntu/ dapper main restricted
-
-deb http://foo.com/$(ARCH)/ main foo
-
-## Major bug fix updates produced after the final release of the
-## distribution.
-deb http://archive.ubuntu.com/ubuntu/ dapper-updates main restricted
-deb-src http://archive.ubuntu.com/ubuntu/ dapper-updates main restricted
-
-## Uncomment the following two lines to add software from the 'universe'
-## repository.
-## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
-## team, and may not be under a free licence. Please satisfy yourself as to
-## your rights to use the software. Also, please note that software in
-## universe WILL NOT receive any review or updates from the Ubuntu security
-## team.
-deb http://archive.ubuntu.com/ubuntu/ dapper universe multiverse
-deb-src http://archive.ubuntu.com/ubuntu/ dapper universe multiverse
-
-## Uncomment the following two lines to add software from the 'backports'
-## repository.
-## N.B. software from this repository may not have been tested as
-## extensively as that contained in the main release, although it includes
-## newer versions of some applications which may provide useful features.
-## Also, please note that software in backports WILL NOT receive any review
-## or updates from the Ubuntu security team.
-deb http://archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
-deb-src http://archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
-
-deb http://security.ubuntu.com/ubuntu dapper-security main restricted
-deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted
-deb http://security.ubuntu.com/ubuntu dapper-security universe multiverse
-deb-src http://security.ubuntu.com/ubuntu dapper-security universe multiverse
-
-## dapper-commercial by canonical
-## currently has realplay (realplayer 10) and opera (opera 9)
-deb http://archive.canonical.com/ubuntu dapper-commercial main
-
-## Bleeding edge wine repository for Dapper
-## only uncomment it if you need it
-## deb http://wine.budgetdedicated.com/apt dapper main
-## deb-src http://wine.budgetdedicated.com/apt dapper main
-
-## skype
-## only uncomment it if you need it
-## deb http://download.skype.com/linux/repos/debian/ stable non-free
-
-deb http://de.archive.ubuntu.com/ubuntu/ edgy main restricted multiverse universe
-
-deb http://de.archive.ubuntu.com/ubuntu/ edgy-updates main restricted multiverse universe
-
-deb http://de.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse
-
-deb http://security.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
-
-deb http://wine.budgetdedicated.com/apt edgy main
-
-deb http://archive.czessi.net/ubuntu edgy main restricted universe multiverse i18n-de
diff --git a/tests/examplefiles/sparql.rq b/tests/examplefiles/sparql.rq
deleted file mode 100644
index d979d203..00000000
--- a/tests/examplefiles/sparql.rq
+++ /dev/null
@@ -1,48 +0,0 @@
-# This is a test SPARQL query
-
-BASE <http://pygments.org/examples/sparql.rq>
-
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX ex: <http://example.org/>
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX dcterms: <http://purl.org/dc/terms/>
-
-SELECT ?person (COUNT(?nick) AS ?nickCount) {
- <#jonny> foaf:knows ?person .
- ?person a foaf:Person .
- ?person foaf:firstName "Freddy" .
- ?person foaf:lastName "Smith" .
- # predicate-object list
- ?person foaf:nick ?nick ;
- foaf:age "21"^^xsd:int ; # typed literal
- ex:title 'Mr' ; # single-quoted string
- ex:width 2 ; # integer
- ex:height 1.80 ; # float
- ex:distanceToSun 1.4e8 ; # float with exponent
- ex:ownsACat true ;
- ex:catName "Kitty", "Kitty_" ; # object list
- # some other float values
- ex:float1 .125 ;
- ex:float2 +2.5e10 ;
- ex:float3 2.5e+10 ;
- ex:float4 -1.e-10 ;
- ex:float5 .0e1 ;
- ex:float6 5e11 ;
- ex:float7 1. ;
- ex:aUnicodeÀExample "somestring" ;
- ex:catName "Kitty", "Kitty_" ; # object list
- ex:escape "\n\u00c0\U00010000";
- ex:catAge ?catage ;
- dcterms:description "Someone with a cat called \"cat\"."@en . # language tag
- ?person foaf:knows _:b0 .
- _:b0 foaf:knows [ _:b1 a foaf:Person; foaf:name "Jonny" . ] .
- OPTIONAL { ?person foaf:isPrimaryTopicOf ?page }
- OPTIONAL { ?person foaf:name ?name
- { ?person foaf:depiction ?img }
- UNION
- { ?person foaf:firstName ?firstN } }
- FILTER ( bound(?page) || bound(?img) || bound(?firstN) )
- FILTER ( ?catage < 101 && ?catage > 9 && ?catage >= 10 && ?catage <= 100 && ?catage != 20 )
-}
-GROUP BY ?person
-ORDER BY ?img ASC(?firstN) DESC(?page)
diff --git a/tests/examplefiles/sphere.pov b/tests/examplefiles/sphere.pov
deleted file mode 100644
index 847ed451..00000000
--- a/tests/examplefiles/sphere.pov
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "colors.inc"
-
-background { color Cyan }
-
-camera {
- location <0, 2, -3>
- look_at <0, 1, 2>
-}
-
-sphere {
- <0, 1, 2>, 2
- texture {
- pigment { color Yellow }
- }
-}
-
-light_source { <2, 4, -3> color White}
-
diff --git a/tests/examplefiles/sqlite3.sqlite3-console b/tests/examplefiles/sqlite3.sqlite3-console
deleted file mode 100644
index 3ec27135..00000000
--- a/tests/examplefiles/sqlite3.sqlite3-console
+++ /dev/null
@@ -1,27 +0,0 @@
-SQLite version 3.4.2
-Enter ".help" for instructions
-sqlite> .schema
-CREATE TABLE paste (paste_id integer, code text, parsed_code text, pub_date
-varchar(24), language varchar(64), parent_id integer, url varchar(128));
-CREATE TABLE vars (key varchar(24), value varchar(128));
-sqlite> a '
- ...> '
- ...> ;
-SQL error: near "a": syntax error
-sqlite> %;
-SQL error: near "%": syntax error
-sqlite> select count(language), language from paste group by language order
- ...> by count(language) desc;
-144|python
-76|text
-22|pycon
-9|ruby
-7|c
-7|js
-6|html+django
-4|html
-4|tex
-2|html+php
-1|cpp
-1|scheme
-sqlite>
diff --git a/tests/examplefiles/squid.conf b/tests/examplefiles/squid.conf
deleted file mode 100644
index 833d4fca..00000000
--- a/tests/examplefiles/squid.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-# Some multiline comments
-
-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/string.jl b/tests/examplefiles/string.jl
deleted file mode 100644
index 67bf6c70..00000000
--- a/tests/examplefiles/string.jl
+++ /dev/null
@@ -1,1031 +0,0 @@
-## core string functions ##
-
-length(s::String) = error("you must implement length(",typeof(s),")")
-next(s::String, i::Int) = error("you must implement next(",typeof(s),",Int)")
-next(s::DirectIndexString, i::Int) = (s[i],i+1)
-next(s::String, i::Integer) = next(s,int(i))
-
-## generic supplied functions ##
-
-start(s::String) = 1
-done(s::String,i) = (i > length(s))
-isempty(s::String) = done(s,start(s))
-ref(s::String, i::Int) = next(s,i)[1]
-ref(s::String, i::Integer) = s[int(i)]
-ref(s::String, x::Real) = s[iround(x)]
-ref{T<:Integer}(s::String, r::Range1{T}) = s[int(first(r)):int(last(r))]
-
-symbol(s::String) = symbol(cstring(s))
-string(s::String) = s
-
-print(s::String) = for c=s; print(c); end
-print(x...) = for i=x; print(i); end
-println(args...) = print(args..., '\n')
-
-show(s::String) = print_quoted(s)
-
-(*)(s::String...) = strcat(s...)
-(^)(s::String, r::Integer) = repeat(s,r)
-
-size(s::String) = (length(s),)
-size(s::String, d::Integer) = d==1 ? length(s) :
- error("in size: dimension ",d," out of range")
-
-strlen(s::DirectIndexString) = length(s)
-function strlen(s::String)
- i = start(s)
- if done(s,i)
- return 0
- end
- n = 1
- while true
- c, j = next(s,i)
- if done(s,j)
- return n
- end
- n += 1
- i = j
- end
-end
-
-isvalid(s::DirectIndexString, i::Integer) = (start(s) <= i <= length(s))
-function isvalid(s::String, i::Integer)
- try
- next(s,i)
- true
- catch
- false
- end
-end
-
-prevind(s::DirectIndexString, i::Integer) = i-1
-thisind(s::DirectIndexString, i::Integer) = i
-nextind(s::DirectIndexString, i::Integer) = i+1
-
-prevind(s::String, i::Integer) = thisind(s,thisind(s,i)-1)
-
-function thisind(s::String, i::Integer)
- for j = i:-1:1
- if isvalid(s,j)
- return j
- end
- end
- return 0 # out of range
-end
-
-function nextind(s::String, i::Integer)
- for j = i+1:length(s)
- if isvalid(s,j)
- return j
- end
- end
- length(s)+1 # out of range
-end
-
-ind2chr(s::DirectIndexString, i::Integer) = i
-chr2ind(s::DirectIndexString, i::Integer) = i
-
-function ind2chr(s::String, i::Integer)
- s[i] # throws error if invalid
- j = 1
- k = start(s)
- while true
- c, l = next(s,k)
- if i <= k
- return j
- end
- j += 1
- k = l
- end
-end
-
-function chr2ind(s::String, i::Integer)
- if i < 1
- return i
- end
- j = 1
- k = start(s)
- while true
- c, l = next(s,k)
- if i == j
- return k
- end
- j += 1
- k = l
- end
-end
-
-function strchr(s::String, c::Char, i::Integer)
- i = nextind(s,i)
- while !done(s,i)
- d, j = next(s,i)
- if c == d
- return i
- end
- i = j
- end
- return 0
-end
-strchr(s::String, c::Char) = strchr(s, c, start(s))
-contains(s::String, c::Char) = (strchr(s,c)!=0)
-
-function chars(s::String)
- cx = Array(Char,strlen(s))
- i = 0
- for c in s
- cx[i += 1] = c
- end
- return cx
-end
-
-function cmp(a::String, b::String)
- i = start(a)
- j = start(b)
- while !done(a,i) && !done(b,i)
- c, i = next(a,i)
- d, j = next(b,j)
- if c != d
- return c < d ? -1 : +1
- end
- end
- done(a,i) && !done(b,j) ? -1 :
- !done(a,i) && done(b,j) ? +1 : 0
-end
-
-isequal(a::String, b::String) = cmp(a,b) == 0
-isless(a::String, b::String) = cmp(a,b) < 0
-
-# faster comparisons for byte strings
-
-cmp(a::ByteString, b::ByteString) = lexcmp(a.data, b.data)
-isequal(a::ByteString, b::ByteString) = length(a)==length(b) && cmp(a,b)==0
-
-## character column width function ##
-
-charwidth(c::Char) = max(0,int(ccall(:wcwidth, Int32, (Char,), c)))
-strwidth(s::String) = (w=0; for c in s; w += charwidth(c); end; w)
-strwidth(s::ByteString) = ccall(:u8_strwidth, Int, (Ptr{Uint8},), s.data)
-# TODO: implement and use u8_strnwidth that takes a length argument
-
-## generic string uses only length and next ##
-
-type GenericString <: String
- string::String
-end
-
-length(s::GenericString) = length(s.string)
-next(s::GenericString, i::Int) = next(s.string, i)
-
-## plain old character arrays ##
-
-type CharString <: String
- chars::Array{Char,1}
-
- CharString(a::Array{Char,1}) = new(a)
- CharString(c::Char...) = new([ c[i] | i=1:length(c) ])
-end
-CharString(x...) = CharString(map(char,x)...)
-
-next(s::CharString, i::Int) = (s.chars[i], i+1)
-length(s::CharString) = length(s.chars)
-strlen(s::CharString) = length(s)
-
-string(c::Char) = CharString(c)
-string(c::Char, x::Char...) = CharString(c, x...)
-
-## substrings reference original strings ##
-
-type SubString <: String
- string::String
- offset::Int
- length::Int
-
- SubString(s::String, i::Int, j::Int) = new(s, i-1, j-i+1)
- SubString(s::SubString, i::Int, j::Int) =
- new(s.string, i-1+s.offset, j-i+1)
-end
-SubString(s::String, i::Integer, j::Integer) = SubString(s, int(i), int(j))
-
-function next(s::SubString, i::Int)
- if i < 1 || i > s.length
- error("string index out of bounds")
- end
- c, i = next(s.string, i+s.offset)
- c, i-s.offset
-end
-
-length(s::SubString) = s.length
-# TODO: strlen(s::SubString) = ??
-# default implementation will work but it's slow
-# can this be delegated efficiently somehow?
-# that may require additional string interfaces
-
-function ref(s::String, r::Range1{Int})
- if first(r) < 1 || length(s) < last(r)
- error("in substring slice: index out of range")
- end
- SubString(s, first(r), last(r))
-end
-
-## efficient representation of repeated strings ##
-
-type RepString <: String
- string::String
- repeat::Integer
-end
-
-length(s::RepString) = length(s.string)*s.repeat
-strlen(s::RepString) = strlen(s.string)*s.repeat
-
-function next(s::RepString, i::Int)
- if i < 1 || i > length(s)
- error("string index out of bounds")
- end
- j = mod1(i,length(s.string))
- c, k = next(s.string, j)
- c, k-j+i
-end
-
-function repeat(s::String, r::Integer)
- r < 0 ? error("can't repeat a string ",r," times") :
- r == 0 ? "" :
- r == 1 ? s :
- RepString(s,r)
-end
-
-## reversed strings without data movement ##
-
-type RevString <: String
- string::String
-end
-
-length(s::RevString) = length(s.string)
-strlen(s::RevString) = strlen(s.string)
-
-start(s::RevString) = (n=length(s); n-thisind(s.string,n)+1)
-function next(s::RevString, i::Int)
- n = length(s); j = n-i+1
- (s.string[j], n-thisind(s.string,j-1)+1)
-end
-
-reverse(s::String) = RevString(s)
-reverse(s::RevString) = s.string
-
-## ropes for efficient concatenation, etc. ##
-
-# Idea: instead of this standard binary tree structure,
-# how about we keep an array of substrings, with an
-# offset array. We can do binary search on the offset
-# array so we get O(log(n)) indexing time still, but we
-# can compute the offsets lazily and avoid all the
-# futzing around while the string is being constructed.
-
-type RopeString <: String
- head::String
- tail::String
- depth::Int32
- length::Int
-
- RopeString(h::RopeString, t::RopeString) =
- depth(h.tail) + depth(t) < depth(h.head) ?
- RopeString(h.head, RopeString(h.tail, t)) :
- new(h, t, max(h.depth,t.depth)+1, length(h)+length(t))
-
- RopeString(h::RopeString, t::String) =
- depth(h.tail) < depth(h.head) ?
- RopeString(h.head, RopeString(h.tail, t)) :
- new(h, t, h.depth+1, length(h)+length(t))
-
- RopeString(h::String, t::RopeString) =
- depth(t.head) < depth(t.tail) ?
- RopeString(RopeString(h, t.head), t.tail) :
- new(h, t, t.depth+1, length(h)+length(t))
-
- RopeString(h::String, t::String) =
- new(h, t, 1, length(h)+length(t))
-end
-
-depth(s::String) = 0
-depth(s::RopeString) = s.depth
-
-function next(s::RopeString, i::Int)
- if i <= length(s.head)
- return next(s.head, i)
- else
- c, j = next(s.tail, i-length(s.head))
- return c, j+length(s.head)
- end
-end
-
-length(s::RopeString) = s.length
-strlen(s::RopeString) = strlen(s.head) + strlen(s.tail)
-
-strcat() = ""
-strcat(s::String) = s
-strcat(x...) = strcat(map(string,x)...)
-strcat(s::String, t::String...) =
- (t = strcat(t...); isempty(s) ? t : isempty(t) ? s : RopeString(s, t))
-
-print(s::RopeString) = print(s.head, s.tail)
-
-## transformed strings ##
-
-type TransformedString <: String
- transform::Function
- string::String
-end
-
-length(s::TransformedString) = length(s.string)
-strlen(s::TransformedString) = strlen(s.string)
-
-function next(s::TransformedString, i::Int)
- c, j = next(s.string,i)
- c = s.transform(c, i)
- return c, j
-end
-
-## uppercase and lowercase transformations ##
-
-uppercase(c::Char) = ccall(:towupper, Char, (Char,), c)
-lowercase(c::Char) = ccall(:towlower, Char, (Char,), c)
-
-uppercase(s::String) = TransformedString((c,i)->uppercase(c), s)
-lowercase(s::String) = TransformedString((c,i)->lowercase(c), s)
-
-ucfirst(s::String) = TransformedString((c,i)->i==1 ? uppercase(c) : c, s)
-lcfirst(s::String) = TransformedString((c,i)->i==1 ? lowercase(c) : c, s)
-
-const uc = uppercase
-const lc = lowercase
-
-## string map ##
-
-function map(f::Function, s::String)
- out = memio(length(s))
- for c in s
- write(out, f(c)::Char)
- end
- takebuf_string(out)
-end
-
-## conversion of general objects to strings ##
-
-string(x) = print_to_string(show, x)
-cstring(x...) = print_to_string(print, x...)
-
-function cstring(p::Ptr{Uint8})
- p == C_NULL ? error("cannot convert NULL to string") :
- ccall(:jl_cstr_to_string, Any, (Ptr{Uint8},), p)::ByteString
-end
-
-## string promotion rules ##
-
-promote_rule(::Type{UTF8String} , ::Type{ASCIIString}) = UTF8String
-promote_rule(::Type{UTF8String} , ::Type{CharString} ) = UTF8String
-promote_rule(::Type{ASCIIString}, ::Type{CharString} ) = UTF8String
-
-## printing literal quoted string data ##
-
-# TODO: this is really the inverse of print_unbackslashed
-
-function print_quoted_literal(s::String)
- print('"')
- for c = s; c == '"' ? print("\\\"") : print(c); end
- print('"')
-end
-
-## string escaping & unescaping ##
-
-escape_nul(s::String, i::Int) =
- !done(s,i) && '0' <= next(s,i)[1] <= '7' ? L"\x00" : L"\0"
-
-is_hex_digit(c::Char) = '0'<=c<='9' || 'a'<=c<='f' || 'A'<=c<='F'
-need_full_hex(s::String, i::Int) = !done(s,i) && is_hex_digit(next(s,i)[1])
-
-function print_escaped(s::String, esc::String)
- i = start(s)
- while !done(s,i)
- c, j = next(s,i)
- c == '\0' ? print(escape_nul(s,j)) :
- c == '\e' ? print(L"\e") :
- c == '\\' ? print("\\\\") :
- contains(esc,c) ? print('\\', c) :
- iswprint(c) ? print(c) :
- 7 <= c <= 13 ? print('\\', "abtnvfr"[c-6]) :
- c <= '\x7f' ? print(L"\x", hex(c, 2)) :
- c <= '\uffff' ? print(L"\u", hex(c, need_full_hex(s,j) ? 4 : 2)) :
- print(L"\U", hex(c, need_full_hex(s,j) ? 8 : 4))
- i = j
- end
-end
-
-escape_string(s::String) = print_to_string(length(s), print_escaped, s, "\"")
-print_quoted(s::String) = (print('"'); print_escaped(s, "\"\$"); print('"'))
-#" # work around syntax highlighting problem
-quote_string(s::String) = print_to_string(length(s)+2, print_quoted, s)
-
-# bare minimum unescaping function unescapes only given characters
-
-function print_unescaped_chars(s::String, esc::String)
- if !contains(esc,'\\')
- esc = strcat("\\", esc)
- end
- i = start(s)
- while !done(s,i)
- c, i = next(s,i)
- if c == '\\' && !done(s,i) && contains(esc,s[i])
- c, i = next(s,i)
- end
- print(c)
- end
-end
-
-unescape_chars(s::String, esc::String) =
- print_to_string(length(s), print_unescaped_chars, s, esc)
-
-# general unescaping of traditional C and Unicode escape sequences
-
-function print_unescaped(s::String)
- i = start(s)
- while !done(s,i)
- c, i = next(s,i)
- if !done(s,i) && c == '\\'
- c, i = next(s,i)
- if c == 'x' || c == 'u' || c == 'U'
- n = k = 0
- m = c == 'x' ? 2 :
- c == 'u' ? 4 : 8
- while (k+=1) <= m && !done(s,i)
- c, j = next(s,i)
- n = '0' <= c <= '9' ? n<<4 + c-'0' :
- 'a' <= c <= 'f' ? n<<4 + c-'a'+10 :
- 'A' <= c <= 'F' ? n<<4 + c-'A'+10 : break
- i = j
- end
- if k == 1
- error("\\x used with no following hex digits")
- end
- if m == 2 # \x escape sequence
- write(uint8(n))
- else
- print(char(n))
- end
- elseif '0' <= c <= '7'
- k = 1
- n = c-'0'
- while (k+=1) <= 3 && !done(s,i)
- c, j = next(s,i)
- n = '0' <= c <= '7' ? n<<3 + c-'0' : break
- i = j
- end
- if n > 255
- error("octal escape sequence out of range")
- end
- write(uint8(n))
- else
- print(c == 'a' ? '\a' :
- c == 'b' ? '\b' :
- c == 't' ? '\t' :
- c == 'n' ? '\n' :
- c == 'v' ? '\v' :
- c == 'f' ? '\f' :
- c == 'r' ? '\r' :
- c == 'e' ? '\e' : c)
- end
- else
- print(c)
- end
- end
-end
-
-unescape_string(s::String) = print_to_string(length(s), print_unescaped, s)
-
-## checking UTF-8 & ACSII validity ##
-
-byte_string_classify(s::ByteString) =
- ccall(:u8_isvalid, Int32, (Ptr{Uint8}, Int), s.data, length(s))
- # 0: neither valid ASCII nor UTF-8
- # 1: valid ASCII
- # 2: valid UTF-8
-
-is_valid_ascii(s::ByteString) = byte_string_classify(s) == 1
-is_valid_utf8 (s::ByteString) = byte_string_classify(s) != 0
-
-check_ascii(s::ByteString) = is_valid_ascii(s) ? s : error("invalid ASCII sequence")
-check_utf8 (s::ByteString) = is_valid_utf8(s) ? s : error("invalid UTF-8 sequence")
-
-## string interpolation parsing ##
-
-function _jl_interp_parse(s::String, unescape::Function, printer::Function)
- sx = {}
- i = j = start(s)
- while !done(s,j)
- c, k = next(s,j)
- if c == '$'
- if !isempty(s[i:j-1])
- push(sx, unescape(s[i:j-1]))
- end
- ex, j = parseatom(s,k)
- push(sx, ex)
- i = j
- elseif c == '\\' && !done(s,k)
- if s[k] == '$'
- if !isempty(s[i:j-1])
- push(sx, unescape(s[i:j-1]))
- end
- i = k
- end
- c, j = next(s,k)
- else
- j = k
- end
- end
- if !isempty(s[i:])
- push(sx, unescape(s[i:j-1]))
- end
- length(sx) == 1 && isa(sx[1],ByteString) ? sx[1] :
- expr(:call, :print_to_string, printer, sx...)
-end
-
-_jl_interp_parse(s::String, u::Function) = _jl_interp_parse(s, u, print)
-_jl_interp_parse(s::String) = _jl_interp_parse(s, x->check_utf8(unescape_string(x)))
-
-function _jl_interp_parse_bytes(s::String)
- writer(x...) = for w=x; write(w); end
- _jl_interp_parse(s, unescape_string, writer)
-end
-
-## core string macros ##
-
-macro str(s); _jl_interp_parse(s); end
-macro S_str(s); _jl_interp_parse(s); end
-macro I_str(s); _jl_interp_parse(s, x->unescape_chars(x,"\"")); end
-macro E_str(s); check_utf8(unescape_string(s)); end
-macro B_str(s); _jl_interp_parse_bytes(s); end
-macro b_str(s); ex = _jl_interp_parse_bytes(s); :(($ex).data); end
-
-## shell-like command parsing ##
-
-function _jl_shell_parse(s::String, interp::Bool)
-
- in_single_quotes = false
- in_double_quotes = false
-
- args = {}
- arg = {}
- i = start(s)
- j = i
-
- function update_arg(x)
- if !isa(x,String) || !isempty(x)
- push(arg, x)
- end
- end
- function append_arg()
- if isempty(arg); arg = {"",}; end
- push(args, arg)
- arg = {}
- end
-
- while !done(s,j)
- c, k = next(s,j)
- if !in_single_quotes && !in_double_quotes && iswspace(c)
- update_arg(s[i:j-1])
- append_arg()
- j = k
- while !done(s,j)
- c, k = next(s,j)
- if !iswspace(c)
- i = j
- break
- end
- j = k
- end
- elseif interp && !in_single_quotes && c == '$'
- update_arg(s[i:j-1]); i = k; j = k
- if done(s,k)
- error("\$ right before end of command")
- end
- if iswspace(s[k])
- error("space not allowed right after \$")
- end
- ex, j = parseatom(s,j)
- update_arg(ex); i = j
- else
- if !in_double_quotes && c == '\''
- in_single_quotes = !in_single_quotes
- update_arg(s[i:j-1]); i = k
- elseif !in_single_quotes && c == '"'
- in_double_quotes = !in_double_quotes
- update_arg(s[i:j-1]); i = k
- elseif c == '\\'
- if in_double_quotes
- if done(s,k)
- error("unterminated double quote")
- end
- if s[k] == '"' || s[k] == '$'
- update_arg(s[i:j-1]); i = k
- c, k = next(s,k)
- end
- elseif !in_single_quotes
- if done(s,k)
- error("dangling backslash")
- end
- update_arg(s[i:j-1]); i = k
- c, k = next(s,k)
- end
- end
- j = k
- end
- end
-
- if in_single_quotes; error("unterminated single quote"); end
- if in_double_quotes; error("unterminated double quote"); end
-
- update_arg(s[i:])
- append_arg()
-
- if !interp
- return args
- end
-
- # construct an expression
- exprs = {}
- for arg in args
- push(exprs, expr(:tuple, arg))
- end
- expr(:tuple,exprs)
-end
-_jl_shell_parse(s::String) = _jl_shell_parse(s,true)
-
-function shell_split(s::String)
- parsed = _jl_shell_parse(s,false)
- args = String[]
- for arg in parsed
- push(args, strcat(arg...))
- end
- args
-end
-
-function print_shell_word(word::String)
- if isempty(word)
- print("''")
- end
- has_single = false
- has_special = false
- for c in word
- if iswspace(c) || c=='\\' || c=='\'' || c=='"' || c=='$'
- has_special = true
- if c == '\''
- has_single = true
- end
- end
- end
- if !has_special
- print(word)
- elseif !has_single
- print('\'', word, '\'')
- else
- print('"')
- for c in word
- if c == '"' || c == '$'
- print('\\')
- end
- print(c)
- end
- print('"')
- end
-end
-
-function print_shell_escaped(cmd::String, args::String...)
- print_shell_word(cmd)
- for arg in args
- print(' ')
- print_shell_word(arg)
- end
-end
-
-shell_escape(cmd::String, args::String...) =
- print_to_string(print_shell_escaped, cmd, args...)
-
-## interface to parser ##
-
-function parse(s::String, pos, greedy)
- # returns (expr, end_pos). expr is () in case of parse error.
- ex, pos = ccall(:jl_parse_string, Any,
- (Ptr{Uint8}, Int32, Int32),
- cstring(s), pos-1, greedy ? 1:0)
- if isa(ex,Expr) && is(ex.head,:error)
- throw(ParseError(ex.args[1]))
- end
- if ex == (); throw(ParseError("end of input")); end
- ex, pos+1 # C is zero-based, Julia is 1-based
-end
-
-parse(s::String) = parse(s, 1, true)
-parse(s::String, pos) = parse(s, pos, true)
-parseatom(s::String) = parse(s, 1, false)
-parseatom(s::String, pos) = parse(s, pos, false)
-
-## miscellaneous string functions ##
-
-function lpad(s::String, n::Integer, p::String)
- m = n - strlen(s)
- if m <= 0; return s; end
- l = strlen(p)
- if l==1
- return p^m * s
- end
- q = div(m,l)
- r = m - q*l
- cstring(p^q*p[1:chr2ind(p,r)]*s)
-end
-
-function rpad(s::String, n::Integer, p::String)
- m = n - strlen(s)
- if m <= 0; return s; end
- l = strlen(p)
- if l==1
- return s * p^m
- end
- q = div(m,l)
- r = m - q*l
- cstring(s*p^q*p[1:chr2ind(p,r)])
-end
-
-lpad(s, n::Integer, p) = lpad(string(s), n, string(p))
-rpad(s, n::Integer, p) = rpad(string(s), n, string(p))
-
-lpad(s, n::Integer) = lpad(string(s), n, " ")
-rpad(s, n::Integer) = rpad(string(s), n, " ")
-
-function split(s::String, delims, include_empty::Bool)
- i = 1
- strs = String[]
- len = length(s)
- while true
- tokstart = tokend = i
- while !done(s,i)
- (c,i) = next(s,i)
- if contains(delims, c)
- break
- end
- tokend = i
- end
- tok = s[tokstart:(tokend-1)]
- if include_empty || !isempty(tok)
- push(strs, tok)
- end
- if !((i <= len) || (i==len+1 && tokend!=i))
- break
- end
- end
- strs
-end
-
-split(s::String) = split(s, (' ','\t','\n','\v','\f','\r'), false)
-split(s::String, x) = split(s, x, true)
-split(s::String, x::Char, incl::Bool) = split(s, (x,), incl)
-
-function print_joined(strings, delim, last)
- i = start(strings)
- if done(strings,i)
- return
- end
- str, i = next(strings,i)
- print(str)
- while !done(strings,i)
- str, i = next(strings,i)
- print(done(strings,i) ? last : delim)
- print(str)
- end
-end
-
-function print_joined(strings, delim)
- i = start(strings)
- while !done(strings,i)
- str, i = next(strings,i)
- print(str)
- if !done(strings,i)
- print(delim)
- end
- end
-end
-print_joined(strings) = print_joined(strings, "")
-
-join(args...) = print_to_string(print_joined, args...)
-
-chop(s::String) = s[1:thisind(s,length(s))-1]
-chomp(s::String) = (i=thisind(s,length(s)); s[i]=='\n' ? s[1:i-1] : s)
-chomp(s::ByteString) = s.data[end]==0x0a ? s[1:end-1] : s
-
-function lstrip(s::String)
- i = start(s)
- while !done(s,i)
- c, j = next(s,i)
- if !iswspace(c)
- return s[i:end]
- end
- i = j
- end
- ""
-end
-
-function rstrip(s::String)
- r = reverse(s)
- i = start(r)
- while !done(r,i)
- c, j = next(r,i)
- if !iswspace(c)
- return s[1:end-i+1]
- end
- i = j
- end
- ""
-end
-
-strip(s::String) = lstrip(rstrip(s))
-
-## string to integer functions ##
-
-function parse_int{T<:Integer}(::Type{T}, s::String, base::Integer)
- if !(2 <= base <= 36); error("invalid base: ",base); end
- i = start(s)
- if done(s,i)
- error("premature end of integer (in ",show_to_string(s),")")
- end
- c,i = next(s,i)
- sgn = one(T)
- if T <: Signed && c == '-'
- sgn = -sgn
- if done(s,i)
- error("premature end of integer (in ",show_to_string(s),")")
- end
- c,i = next(s,i)
- end
- base = convert(T,base)
- n::T = 0
- while true
- d = '0' <= c <= '9' ? c-'0' :
- 'A' <= c <= 'Z' ? c-'A'+10 :
- 'a' <= c <= 'z' ? c-'a'+10 : typemax(Int)
- if d >= base
- error(show_to_string(c)," is not a valid digit (in ",show_to_string(s),")")
- end
- # TODO: overflow detection?
- n = n*base + d
- if done(s,i)
- break
- end
- c,i = next(s,i)
- end
- return flipsign(n,sgn)
-end
-
-parse_int(s::String, base::Integer) = parse_int(Int,s,base)
-parse_int(T::Type, s::String) = parse_int(T,s,10)
-parse_int(s::String) = parse_int(Int,s,10)
-
-parse_bin(T::Type, s::String) = parse_int(T,s,2)
-parse_oct(T::Type, s::String) = parse_int(T,s,8)
-parse_hex(T::Type, s::String) = parse_int(T,s,16)
-
-parse_bin(s::String) = parse_int(Int,s,2)
-parse_oct(s::String) = parse_int(Int,s,8)
-parse_hex(s::String) = parse_int(Int,s,16)
-
-integer (s::String) = int(s)
-unsigned(s::String) = uint(s)
-int (s::String) = parse_int(Int,s)
-uint (s::String) = parse_int(Uint,s)
-int8 (s::String) = parse_int(Int8,s)
-uint8 (s::String) = parse_int(Uint8,s)
-int16 (s::String) = parse_int(Int16,s)
-uint16 (s::String) = parse_int(Uint16,s)
-int32 (s::String) = parse_int(Int32,s)
-uint32 (s::String) = parse_int(Uint32,s)
-int64 (s::String) = parse_int(Int64,s)
-uint64 (s::String) = parse_int(Uint64,s)
-
-## integer to string functions ##
-
-const _jl_dig_syms = "0123456789abcdefghijklmnopqrstuvwxyz".data
-
-function int2str(n::Union(Int64,Uint64), b::Integer, l::Int)
- if b < 2 || b > 36; error("int2str: invalid base ", b); end
- neg = n < 0
- n = unsigned(abs(n))
- b = convert(typeof(n), b)
- ndig = ndigits(n, b)
- sz = max(convert(Int, ndig), l) + neg
- data = Array(Uint8, sz)
- i = sz
- if ispow2(b)
- digmask = b-1
- shift = trailing_zeros(b)
- while i > neg
- ch = n & digmask
- data[i] = _jl_dig_syms[int(ch)+1]
- n >>= shift
- i -= 1
- end
- else
- while i > neg
- ch = n % b
- data[i] = _jl_dig_syms[int(ch)+1]
- n = div(n,b)
- i -= 1
- end
- end
- if neg
- data[1] = '-'
- end
- ASCIIString(data)
-end
-int2str(n::Integer, b::Integer) = int2str(n, b, 0)
-int2str(n::Integer, b::Integer, l::Int) = int2str(int64(n), b, l)
-
-string(x::Signed) = dec(int64(x))
-cstring(x::Signed) = dec(int64(x))
-
-## string to float functions ##
-
-function float64_isvalid(s::String, out::Array{Float64,1})
- s = cstring(s)
- return (ccall(:jl_strtod, Int32, (Ptr{Uint8},Ptr{Float64}), s, out)==0)
-end
-
-function float32_isvalid(s::String, out::Array{Float32,1})
- s = cstring(s)
- return (ccall(:jl_strtof, Int32, (Ptr{Uint8},Ptr{Float32}), s, out)==0)
-end
-
-begin
- local tmp::Array{Float64,1} = Array(Float64,1)
- local tmpf::Array{Float32,1} = Array(Float32,1)
- global float64, float32
- function float64(s::String)
- if !float64_isvalid(s, tmp)
- throw(ArgumentError("float64(String): invalid number format"))
- end
- return tmp[1]
- end
-
- function float32(s::String)
- if !float32_isvalid(s, tmpf)
- throw(ArgumentError("float32(String): invalid number format"))
- end
- return tmpf[1]
- end
-end
-
-float(x::String) = float64(x)
-parse_float(x::String) = float64(x)
-parse_float(::Type{Float64}, x::String) = float64(x)
-parse_float(::Type{Float32}, x::String) = float32(x)
-
-# copying a byte string (generally not needed due to "immutability")
-
-strcpy{T<:ByteString}(s::T) = T(copy(s.data))
-
-# lexicographically compare byte arrays (used by Latin-1 and UTF-8)
-
-function lexcmp(a::Array{Uint8,1}, b::Array{Uint8,1})
- c = ccall(:memcmp, Int32, (Ptr{Uint8}, Ptr{Uint8}, Uint),
- a, b, min(length(a),length(b)))
- c < 0 ? -1 : c > 0 ? +1 : cmp(length(a),length(b))
-end
-
-# find the index of the first occurrence of a byte value in a byte array
-
-function memchr(a::Array{Uint8,1}, b::Integer)
- p = pointer(a)
- q = ccall(:memchr, Ptr{Uint8}, (Ptr{Uint8}, Int32, Uint), p, b, length(a))
- q == C_NULL ? 0 : q - p + 1
-end
-
-# concatenate byte arrays into a single array
-
-memcat() = Array(Uint8,0)
-memcat(a::Array{Uint8,1}) = copy(a)
-
-function memcat(arrays::Array{Uint8,1}...)
- n = 0
- for a in arrays
- n += length(a)
- end
- arr = Array(Uint8, n)
- ptr = pointer(arr)
- offset = 0
- for a in arrays
- ccall(:memcpy, Ptr{Uint8}, (Ptr{Uint8}, Ptr{Uint8}, Uint),
- ptr+offset, a, length(a))
- offset += length(a)
- end
- return arr
-end
-
-# concatenate the data fields of byte strings
-
-memcat(s::ByteString) = memcat(s.data)
-memcat(sx::ByteString...) = memcat(map(s->s.data, sx)...)
diff --git a/tests/examplefiles/string_delimiters.d b/tests/examplefiles/string_delimiters.d
deleted file mode 100644
index 288aacc2..00000000
--- a/tests/examplefiles/string_delimiters.d
+++ /dev/null
@@ -1,21 +0,0 @@
-import std.stdio;
-
-void main() {
- // Nesting delimited strings
- auto a = q"{foo " {bar} baz}";
- auto b = q"[foo [bar] " baz]";
- auto c = q"(foo " (bar) baz)";
- auto d = q"<foo <bar> " baz>";
- // Non-nesting delimited strings
- auto e = q"/foo " bar/";
- auto f = q"-Another " string-";
- // "heredoc" strings
- auto g = q"FOO
- This is a string!
-FOO";
- // Token strings (only the q{} should be highlighted as a string)
- auto h = q{
- int i;
- void foo() { writefln("Hello, world!"); }
- };
-}
diff --git a/tests/examplefiles/stripheredoc.sh b/tests/examplefiles/stripheredoc.sh
deleted file mode 100644
index 33e7ff33..00000000
--- a/tests/examplefiles/stripheredoc.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-cat <<-EOF
- Hello world $PATH
- EOF
diff --git a/tests/examplefiles/subr.el b/tests/examplefiles/subr.el
deleted file mode 100644
index deadca6e..00000000
--- a/tests/examplefiles/subr.el
+++ /dev/null
@@ -1,4868 +0,0 @@
-;;; subr.el --- basic lisp subroutines for Emacs -*- coding: utf-8; lexical-binding:t -*-
-
-;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2015 Free Software
-;; Foundation, Inc.
-
-;; Maintainer: emacs-devel@gnu.org
-;; Keywords: internal
-;; Package: emacs
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;; Code:
-
-;; Beware: while this file has tag `utf-8', before it's compiled, it gets
-;; loaded as "raw-text", so non-ASCII chars won't work right during bootstrap.
-
-(defmacro declare-function (_fn _file &optional _arglist _fileonly)
- "Tell the byte-compiler that function FN is defined, in FILE.
-Optional ARGLIST is the argument list used by the function.
-The FILE argument is not used by the byte-compiler, but by the
-`check-declare' package, which checks that FILE contains a
-definition for FN. ARGLIST is used by both the byte-compiler
-and `check-declare' to check for consistency.
-
-FILE can be either a Lisp file (in which case the \".el\"
-extension is optional), or a C file. C files are expanded
-relative to the Emacs \"src/\" directory. Lisp files are
-searched for using `locate-library', and if that fails they are
-expanded relative to the location of the file containing the
-declaration. A FILE with an \"ext:\" prefix is an external file.
-`check-declare' will check such files if they are found, and skip
-them without error if they are not.
-
-FILEONLY non-nil means that `check-declare' will only check that
-FILE exists, not that it defines FN. This is intended for
-function-definitions that `check-declare' does not recognize, e.g.
-`defstruct'.
-
-To specify a value for FILEONLY without passing an argument list,
-set ARGLIST to t. This is necessary because nil means an
-empty argument list, rather than an unspecified one.
-
-Note that for the purposes of `check-declare', this statement
-must be the first non-whitespace on a line.
-
-For more information, see Info node `(elisp)Declaring Functions'."
- ;; Does nothing - byte-compile-declare-function does the work.
- nil)
-
-
-;;;; Basic Lisp macros.
-
-(defalias 'not 'null)
-
-(defmacro noreturn (form)
- "Evaluate FORM, expecting it not to return.
-If FORM does return, signal an error."
- (declare (debug t))
- `(prog1 ,form
- (error "Form marked with `noreturn' did return")))
-
-(defmacro 1value (form)
- "Evaluate FORM, expecting a constant return value.
-This is the global do-nothing version. There is also `testcover-1value'
-that complains if FORM ever does return differing values."
- (declare (debug t))
- form)
-
-(defmacro def-edebug-spec (symbol spec)
- "Set the `edebug-form-spec' property of SYMBOL according to SPEC.
-Both SYMBOL and SPEC are unevaluated. The SPEC can be:
-0 (instrument no arguments); t (instrument all arguments);
-a symbol (naming a function with an Edebug specification); or a list.
-The elements of the list describe the argument types; see
-Info node `(elisp)Specification List' for details."
- `(put (quote ,symbol) 'edebug-form-spec (quote ,spec)))
-
-(defmacro lambda (&rest cdr)
- "Return a lambda expression.
-A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is
-self-quoting; the result of evaluating the lambda expression is the
-expression itself. The lambda expression may then be treated as a
-function, i.e., stored as the function value of a symbol, passed to
-`funcall' or `mapcar', etc.
-
-ARGS should take the same form as an argument list for a `defun'.
-DOCSTRING is an optional documentation string.
- If present, it should describe how to call the function.
- But documentation strings are usually not useful in nameless functions.
-INTERACTIVE should be a call to the function `interactive', which see.
-It may also be omitted.
-BODY should be a list of Lisp expressions.
-
-\(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)"
- (declare (doc-string 2) (indent defun)
- (debug (&define lambda-list
- [&optional stringp]
- [&optional ("interactive" interactive)]
- def-body)))
- ;; Note that this definition should not use backquotes; subr.el should not
- ;; depend on backquote.el.
- (list 'function (cons 'lambda cdr)))
-
-(defmacro setq-local (var val)
- "Set variable VAR to value VAL in current buffer."
- ;; Can't use backquote here, it's too early in the bootstrap.
- (list 'set (list 'make-local-variable (list 'quote var)) val))
-
-(defmacro defvar-local (var val &optional docstring)
- "Define VAR as a buffer-local variable with default value VAL.
-Like `defvar' but additionally marks the variable as being automatically
-buffer-local wherever it is set."
- (declare (debug defvar) (doc-string 3))
- ;; Can't use backquote here, it's too early in the bootstrap.
- (list 'progn (list 'defvar var val docstring)
- (list 'make-variable-buffer-local (list 'quote var))))
-
-(defun apply-partially (fun &rest args)
- "Return a function that is a partial application of FUN to ARGS.
-ARGS is a list of the first N arguments to pass to FUN.
-The result is a new function which does the same as FUN, except that
-the first N arguments are fixed at the values with which this function
-was called."
- (lambda (&rest args2)
- (apply fun (append args args2))))
-
-(defmacro push (newelt place)
- "Add NEWELT to the list stored in the generalized variable PLACE.
-This is morally equivalent to (setf PLACE (cons NEWELT PLACE)),
-except that PLACE is only evaluated once (after NEWELT)."
- (declare (debug (form gv-place)))
- (if (symbolp place)
- ;; Important special case, to avoid triggering GV too early in
- ;; the bootstrap.
- (list 'setq place
- (list 'cons newelt place))
- (require 'macroexp)
- (macroexp-let2 macroexp-copyable-p v newelt
- (gv-letplace (getter setter) place
- (funcall setter `(cons ,v ,getter))))))
-
-(defmacro pop (place)
- "Return the first element of PLACE's value, and remove it from the list.
-PLACE must be a generalized variable whose value is a list.
-If the value is nil, `pop' returns nil but does not actually
-change the list."
- (declare (debug (gv-place)))
- ;; We use `car-safe' here instead of `car' because the behavior is the same
- ;; (if it's not a cons cell, the `cdr' would have signaled an error already),
- ;; but `car-safe' is total, so the byte-compiler can safely remove it if the
- ;; result is not used.
- `(car-safe
- ,(if (symbolp place)
- ;; So we can use `pop' in the bootstrap before `gv' can be used.
- (list 'prog1 place (list 'setq place (list 'cdr place)))
- (gv-letplace (getter setter) place
- (macroexp-let2 macroexp-copyable-p x getter
- `(prog1 ,x ,(funcall setter `(cdr ,x))))))))
-
-(defmacro when (cond &rest body)
- "If COND yields non-nil, do BODY, else return nil.
-When COND yields non-nil, eval BODY forms sequentially and return
-value of last one, or nil if there are none.
-
-\(fn COND BODY...)"
- (declare (indent 1) (debug t))
- (list 'if cond (cons 'progn body)))
-
-(defmacro unless (cond &rest body)
- "If COND yields nil, do BODY, else return nil.
-When COND yields nil, eval BODY forms sequentially and return
-value of last one, or nil if there are none.
-
-\(fn COND BODY...)"
- (declare (indent 1) (debug t))
- (cons 'if (cons cond (cons nil body))))
-
-(defmacro dolist (spec &rest body)
- "Loop over a list.
-Evaluate BODY with VAR bound to each car from LIST, in turn.
-Then evaluate RESULT to get return value, default nil.
-
-\(fn (VAR LIST [RESULT]) BODY...)"
- (declare (indent 1) (debug ((symbolp form &optional form) body)))
- ;; It would be cleaner to create an uninterned symbol,
- ;; but that uses a lot more space when many functions in many files
- ;; use dolist.
- ;; FIXME: This cost disappears in byte-compiled lexical-binding files.
- (let ((temp '--dolist-tail--))
- ;; This is not a reliable test, but it does not matter because both
- ;; semantics are acceptable, tho one is slightly faster with dynamic
- ;; scoping and the other is slightly faster (and has cleaner semantics)
- ;; with lexical scoping.
- (if lexical-binding
- `(let ((,temp ,(nth 1 spec)))
- (while ,temp
- (let ((,(car spec) (car ,temp)))
- ,@body
- (setq ,temp (cdr ,temp))))
- ,@(cdr (cdr spec)))
- `(let ((,temp ,(nth 1 spec))
- ,(car spec))
- (while ,temp
- (setq ,(car spec) (car ,temp))
- ,@body
- (setq ,temp (cdr ,temp)))
- ,@(if (cdr (cdr spec))
- `((setq ,(car spec) nil) ,@(cdr (cdr spec))))))))
-
-(defmacro dotimes (spec &rest body)
- "Loop a certain number of times.
-Evaluate BODY with VAR bound to successive integers running from 0,
-inclusive, to COUNT, exclusive. Then evaluate RESULT to get
-the return value (nil if RESULT is omitted).
-
-\(fn (VAR COUNT [RESULT]) BODY...)"
- (declare (indent 1) (debug dolist))
- ;; It would be cleaner to create an uninterned symbol,
- ;; but that uses a lot more space when many functions in many files
- ;; use dotimes.
- ;; FIXME: This cost disappears in byte-compiled lexical-binding files.
- (let ((temp '--dotimes-limit--)
- (start 0)
- (end (nth 1 spec)))
- ;; This is not a reliable test, but it does not matter because both
- ;; semantics are acceptable, tho one is slightly faster with dynamic
- ;; scoping and the other has cleaner semantics.
- (if lexical-binding
- (let ((counter '--dotimes-counter--))
- `(let ((,temp ,end)
- (,counter ,start))
- (while (< ,counter ,temp)
- (let ((,(car spec) ,counter))
- ,@body)
- (setq ,counter (1+ ,counter)))
- ,@(if (cddr spec)
- ;; FIXME: This let often leads to "unused var" warnings.
- `((let ((,(car spec) ,counter)) ,@(cddr spec))))))
- `(let ((,temp ,end)
- (,(car spec) ,start))
- (while (< ,(car spec) ,temp)
- ,@body
- (setq ,(car spec) (1+ ,(car spec))))
- ,@(cdr (cdr spec))))))
-
-(defmacro declare (&rest _specs)
- "Do not evaluate any arguments, and return nil.
-If a `declare' form appears as the first form in the body of a
-`defun' or `defmacro' form, SPECS specifies various additional
-information about the function or macro; these go into effect
-during the evaluation of the `defun' or `defmacro' form.
-
-The possible values of SPECS are specified by
-`defun-declarations-alist' and `macro-declarations-alist'.
-
-For more information, see info node `(elisp)Declare Form'."
- ;; FIXME: edebug spec should pay attention to defun-declarations-alist.
- nil)
-
-(defmacro ignore-errors (&rest body)
- "Execute BODY; if an error occurs, return nil.
-Otherwise, return result of last form in BODY.
-See also `with-demoted-errors' that does something similar
-without silencing all errors."
- (declare (debug t) (indent 0))
- `(condition-case nil (progn ,@body) (error nil)))
-
-;;;; Basic Lisp functions.
-
-(defun ignore (&rest _ignore)
- "Do nothing and return nil.
-This function accepts any number of arguments, but ignores them."
- (interactive)
- nil)
-
-;; Signal a compile-error if the first arg is missing.
-(defun error (&rest args)
- "Signal an error, making error message by passing all args to `format'.
-In Emacs, the convention is that error messages start with a capital
-letter but *do not* end with a period. Please follow this convention
-for the sake of consistency."
- (declare (advertised-calling-convention (string &rest args) "23.1"))
- (signal 'error (list (apply 'format args))))
-
-(defun user-error (format &rest args)
- "Signal a pilot error, making error message by passing all args to `format'.
-In Emacs, the convention is that error messages start with a capital
-letter but *do not* end with a period. Please follow this convention
-for the sake of consistency.
-This is just like `error' except that `user-error's are expected to be the
-result of an incorrect manipulation on the part of the user, rather than the
-result of an actual problem."
- (signal 'user-error (list (apply #'format format args))))
-
-(defun define-error (name message &optional parent)
- "Define NAME as a new error signal.
-MESSAGE is a string that will be output to the echo area if such an error
-is signaled without being caught by a `condition-case'.
-PARENT is either a signal or a list of signals from which it inherits.
-Defaults to `error'."
- (unless parent (setq parent 'error))
- (let ((conditions
- (if (consp parent)
- (apply #'append
- (mapcar (lambda (parent)
- (cons parent
- (or (get parent 'error-conditions)
- (error "Unknown signal `%s'" parent))))
- parent))
- (cons parent (get parent 'error-conditions)))))
- (put name 'error-conditions
- (delete-dups (copy-sequence (cons name conditions))))
- (when message (put name 'error-message message))))
-
-;; We put this here instead of in frame.el so that it's defined even on
-;; systems where frame.el isn't loaded.
-(defun frame-configuration-p (object)
- "Return non-nil if OBJECT seems to be a frame configuration.
-Any list whose car is `frame-configuration' is assumed to be a frame
-configuration."
- (and (consp object)
- (eq (car object) 'frame-configuration)))
-
-
-;;;; List functions.
-
-(defsubst caar (x)
- "Return the car of the car of X."
- (car (car x)))
-
-(defsubst cadr (x)
- "Return the car of the cdr of X."
- (car (cdr x)))
-
-(defsubst cdar (x)
- "Return the cdr of the car of X."
- (cdr (car x)))
-
-(defsubst cddr (x)
- "Return the cdr of the cdr of X."
- (cdr (cdr x)))
-
-(defun last (list &optional n)
- "Return the last link of LIST. Its car is the last element.
-If LIST is nil, return nil.
-If N is non-nil, return the Nth-to-last link of LIST.
-If N is bigger than the length of LIST, return LIST."
- (if n
- (and (>= n 0)
- (let ((m (safe-length list)))
- (if (< n m) (nthcdr (- m n) list) list)))
- (and list
- (nthcdr (1- (safe-length list)) list))))
-
-(defun butlast (list &optional n)
- "Return a copy of LIST with the last N elements removed.
-If N is omitted or nil, the last element is removed from the
-copy."
- (if (and n (<= n 0)) list
- (nbutlast (copy-sequence list) n)))
-
-(defun nbutlast (list &optional n)
- "Modifies LIST to remove the last N elements.
-If N is omitted or nil, remove the last element."
- (let ((m (length list)))
- (or n (setq n 1))
- (and (< n m)
- (progn
- (if (> n 0) (setcdr (nthcdr (- (1- m) n) list) nil))
- list))))
-
-(defun zerop (number)
- "Return t if NUMBER is zero."
- ;; Used to be in C, but it's pointless since (= 0 n) is faster anyway because
- ;; = has a byte-code.
- (declare (compiler-macro (lambda (_) `(= 0 ,number))))
- (= 0 number))
-
-(defun delete-dups (list)
- "Destructively remove `equal' duplicates from LIST.
-Store the result in LIST and return it. LIST must be a proper list.
-Of several `equal' occurrences of an element in LIST, the first
-one is kept."
- (let ((tail list))
- (while tail
- (setcdr tail (delete (car tail) (cdr tail)))
- (setq tail (cdr tail))))
- list)
-
-;; See http://lists.gnu.org/archive/html/emacs-devel/2013-05/msg00204.html
-(defun delete-consecutive-dups (list &optional circular)
- "Destructively remove `equal' consecutive duplicates from LIST.
-First and last elements are considered consecutive if CIRCULAR is
-non-nil."
- (let ((tail list) last)
- (while (consp tail)
- (if (equal (car tail) (cadr tail))
- (setcdr tail (cddr tail))
- (setq last (car tail)
- tail (cdr tail))))
- (if (and circular
- (cdr list)
- (equal last (car list)))
- (nbutlast list)
- list)))
-
-(defun number-sequence (from &optional to inc)
- "Return a sequence of numbers from FROM to TO (both inclusive) as a list.
-INC is the increment used between numbers in the sequence and defaults to 1.
-So, the Nth element of the list is (+ FROM (* N INC)) where N counts from
-zero. TO is only included if there is an N for which TO = FROM + N * INC.
-If TO is nil or numerically equal to FROM, return (FROM).
-If INC is positive and TO is less than FROM, or INC is negative
-and TO is larger than FROM, return nil.
-If INC is zero and TO is neither nil nor numerically equal to
-FROM, signal an error.
-
-This function is primarily designed for integer arguments.
-Nevertheless, FROM, TO and INC can be integer or float. However,
-floating point arithmetic is inexact. For instance, depending on
-the machine, it may quite well happen that
-\(number-sequence 0.4 0.6 0.2) returns the one element list (0.4),
-whereas (number-sequence 0.4 0.8 0.2) returns a list with three
-elements. Thus, if some of the arguments are floats and one wants
-to make sure that TO is included, one may have to explicitly write
-TO as (+ FROM (* N INC)) or use a variable whose value was
-computed with this exact expression. Alternatively, you can,
-of course, also replace TO with a slightly larger value
-\(or a slightly more negative value if INC is negative)."
- (if (or (not to) (= from to))
- (list from)
- (or inc (setq inc 1))
- (when (zerop inc) (error "The increment can not be zero"))
- (let (seq (n 0) (next from))
- (if (> inc 0)
- (while (<= next to)
- (setq seq (cons next seq)
- n (1+ n)
- next (+ from (* n inc))))
- (while (>= next to)
- (setq seq (cons next seq)
- n (1+ n)
- next (+ from (* n inc)))))
- (nreverse seq))))
-
-(defun copy-tree (tree &optional vecp)
- "Make a copy of TREE.
-If TREE is a cons cell, this recursively copies both its car and its cdr.
-Contrast to `copy-sequence', which copies only along the cdrs. With second
-argument VECP, this copies vectors as well as conses."
- (if (consp tree)
- (let (result)
- (while (consp tree)
- (let ((newcar (car tree)))
- (if (or (consp (car tree)) (and vecp (vectorp (car tree))))
- (setq newcar (copy-tree (car tree) vecp)))
- (push newcar result))
- (setq tree (cdr tree)))
- (nconc (nreverse result) tree))
- (if (and vecp (vectorp tree))
- (let ((i (length (setq tree (copy-sequence tree)))))
- (while (>= (setq i (1- i)) 0)
- (aset tree i (copy-tree (aref tree i) vecp)))
- tree)
- tree)))
-
-;;;; Various list-search functions.
-
-(defun assoc-default (key alist &optional test default)
- "Find object KEY in a pseudo-alist ALIST.
-ALIST is a list of conses or objects. Each element
- (or the element's car, if it is a cons) is compared with KEY by
- calling TEST, with two arguments: (i) the element or its car,
- and (ii) KEY.
-If that is non-nil, the element matches; then `assoc-default'
- returns the element's cdr, if it is a cons, or DEFAULT if the
- element is not a cons.
-
-If no element matches, the value is nil.
-If TEST is omitted or nil, `equal' is used."
- (let (found (tail alist) value)
- (while (and tail (not found))
- (let ((elt (car tail)))
- (when (funcall (or test 'equal) (if (consp elt) (car elt) elt) key)
- (setq found t value (if (consp elt) (cdr elt) default))))
- (setq tail (cdr tail)))
- value))
-
-(defun assoc-ignore-case (key alist)
- "Like `assoc', but ignores differences in case and text representation.
-KEY must be a string. Upper-case and lower-case letters are treated as equal.
-Unibyte strings are converted to multibyte for comparison."
- (declare (obsolete assoc-string "22.1"))
- (assoc-string key alist t))
-
-(defun assoc-ignore-representation (key alist)
- "Like `assoc', but ignores differences in text representation.
-KEY must be a string.
-Unibyte strings are converted to multibyte for comparison."
- (declare (obsolete assoc-string "22.1"))
- (assoc-string key alist nil))
-
-(defun member-ignore-case (elt list)
- "Like `member', but ignore differences in case and text representation.
-ELT must be a string. Upper-case and lower-case letters are treated as equal.
-Unibyte strings are converted to multibyte for comparison.
-Non-strings in LIST are ignored."
- (while (and list
- (not (and (stringp (car list))
- (eq t (compare-strings elt 0 nil (car list) 0 nil t)))))
- (setq list (cdr list)))
- list)
-
-(defun assq-delete-all (key alist)
- "Delete from ALIST all elements whose car is `eq' to KEY.
-Return the modified alist.
-Elements of ALIST that are not conses are ignored."
- (while (and (consp (car alist))
- (eq (car (car alist)) key))
- (setq alist (cdr alist)))
- (let ((tail alist) tail-cdr)
- (while (setq tail-cdr (cdr tail))
- (if (and (consp (car tail-cdr))
- (eq (car (car tail-cdr)) key))
- (setcdr tail (cdr tail-cdr))
- (setq tail tail-cdr))))
- alist)
-
-(defun rassq-delete-all (value alist)
- "Delete from ALIST all elements whose cdr is `eq' to VALUE.
-Return the modified alist.
-Elements of ALIST that are not conses are ignored."
- (while (and (consp (car alist))
- (eq (cdr (car alist)) value))
- (setq alist (cdr alist)))
- (let ((tail alist) tail-cdr)
- (while (setq tail-cdr (cdr tail))
- (if (and (consp (car tail-cdr))
- (eq (cdr (car tail-cdr)) value))
- (setcdr tail (cdr tail-cdr))
- (setq tail tail-cdr))))
- alist)
-
-(defun alist-get (key alist &optional default remove)
- "Get the value associated to KEY in ALIST.
-DEFAULT is the value to return if KEY is not found in ALIST.
-REMOVE, if non-nil, means that when setting this element, we should
-remove the entry if the new value is `eql' to DEFAULT."
- (ignore remove) ;;Silence byte-compiler.
- (let ((x (assq key alist)))
- (if x (cdr x) default)))
-
-(defun remove (elt seq)
- "Return a copy of SEQ with all occurrences of ELT removed.
-SEQ must be a list, vector, or string. The comparison is done with `equal'."
- (if (nlistp seq)
- ;; If SEQ isn't a list, there's no need to copy SEQ because
- ;; `delete' will return a new object.
- (delete elt seq)
- (delete elt (copy-sequence seq))))
-
-(defun remq (elt list)
- "Return LIST with all occurrences of ELT removed.
-The comparison is done with `eq'. Contrary to `delq', this does not use
-side-effects, and the argument LIST is not modified."
- (while (and (eq elt (car list)) (setq list (cdr list))))
- (if (memq elt list)
- (delq elt (copy-sequence list))
- list))
-
-;;;; Keymap support.
-
-(defun kbd (keys)
- "Convert KEYS to the internal Emacs key representation.
-KEYS should be a string constant in the format used for
-saving keyboard macros (see `edmacro-mode')."
- ;; Don't use a defalias, since the `pure' property is only true for
- ;; the calling convention of `kbd'.
- (read-kbd-macro keys))
-(put 'kbd 'pure t)
-
-(defun undefined ()
- "Beep to tell the user this binding is undefined."
- (interactive)
- (ding)
- (message "%s is undefined" (key-description (this-single-command-keys)))
- (setq defining-kbd-macro nil)
- (force-mode-line-update)
- ;; If this is a down-mouse event, don't reset prefix-arg;
- ;; pass it to the command run by the up event.
- (setq prefix-arg
- (when (memq 'down (event-modifiers last-command-event))
- current-prefix-arg)))
-
-;; Prevent the \{...} documentation construct
-;; from mentioning keys that run this command.
-(put 'undefined 'suppress-keymap t)
-
-(defun suppress-keymap (map &optional nodigits)
- "Make MAP override all normally self-inserting keys to be undefined.
-Normally, as an exception, digits and minus-sign are set to make prefix args,
-but optional second arg NODIGITS non-nil treats them like other chars."
- (define-key map [remap self-insert-command] 'undefined)
- (or nodigits
- (let (loop)
- (define-key map "-" 'negative-argument)
- ;; Make plain numbers do numeric args.
- (setq loop ?0)
- (while (<= loop ?9)
- (define-key map (char-to-string loop) 'digit-argument)
- (setq loop (1+ loop))))))
-
-(defun make-composed-keymap (maps &optional parent)
- "Construct a new keymap composed of MAPS and inheriting from PARENT.
-When looking up a key in the returned map, the key is looked in each
-keymap of MAPS in turn until a binding is found.
-If no binding is found in MAPS, the lookup continues in PARENT, if non-nil.
-As always with keymap inheritance, a nil binding in MAPS overrides
-any corresponding binding in PARENT, but it does not override corresponding
-bindings in other keymaps of MAPS.
-MAPS can be a list of keymaps or a single keymap.
-PARENT if non-nil should be a keymap."
- `(keymap
- ,@(if (keymapp maps) (list maps) maps)
- ,@parent))
-
-(defun define-key-after (keymap key definition &optional after)
- "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding.
-This is like `define-key' except that the binding for KEY is placed
-just after the binding for the event AFTER, instead of at the beginning
-of the map. Note that AFTER must be an event type (like KEY), NOT a command
-\(like DEFINITION).
-
-If AFTER is t or omitted, the new binding goes at the end of the keymap.
-AFTER should be a single event type--a symbol or a character, not a sequence.
-
-Bindings are always added before any inherited map.
-
-The order of bindings in a keymap only matters when it is used as
-a menu, so this function is not useful for non-menu keymaps."
- (unless after (setq after t))
- (or (keymapp keymap)
- (signal 'wrong-type-argument (list 'keymapp keymap)))
- (setq key
- (if (<= (length key) 1) (aref key 0)
- (setq keymap (lookup-key keymap
- (apply 'vector
- (butlast (mapcar 'identity key)))))
- (aref key (1- (length key)))))
- (let ((tail keymap) done inserted)
- (while (and (not done) tail)
- ;; Delete any earlier bindings for the same key.
- (if (eq (car-safe (car (cdr tail))) key)
- (setcdr tail (cdr (cdr tail))))
- ;; If we hit an included map, go down that one.
- (if (keymapp (car tail)) (setq tail (car tail)))
- ;; When we reach AFTER's binding, insert the new binding after.
- ;; If we reach an inherited keymap, insert just before that.
- ;; If we reach the end of this keymap, insert at the end.
- (if (or (and (eq (car-safe (car tail)) after)
- (not (eq after t)))
- (eq (car (cdr tail)) 'keymap)
- (null (cdr tail)))
- (progn
- ;; Stop the scan only if we find a parent keymap.
- ;; Keep going past the inserted element
- ;; so we can delete any duplications that come later.
- (if (eq (car (cdr tail)) 'keymap)
- (setq done t))
- ;; Don't insert more than once.
- (or inserted
- (setcdr tail (cons (cons key definition) (cdr tail))))
- (setq inserted t)))
- (setq tail (cdr tail)))))
-
-(defun map-keymap-sorted (function keymap)
- "Implement `map-keymap' with sorting.
-Don't call this function; it is for internal use only."
- (let (list)
- (map-keymap (lambda (a b) (push (cons a b) list))
- keymap)
- (setq list (sort list
- (lambda (a b)
- (setq a (car a) b (car b))
- (if (integerp a)
- (if (integerp b) (< a b)
- t)
- (if (integerp b) t
- ;; string< also accepts symbols.
- (string< a b))))))
- (dolist (p list)
- (funcall function (car p) (cdr p)))))
-
-(defun keymap--menu-item-binding (val)
- "Return the binding part of a menu-item."
- (cond
- ((not (consp val)) val) ;Not a menu-item.
- ((eq 'menu-item (car val))
- (let* ((binding (nth 2 val))
- (plist (nthcdr 3 val))
- (filter (plist-get plist :filter)))
- (if filter (funcall filter binding)
- binding)))
- ((and (consp (cdr val)) (stringp (cadr val)))
- (cddr val))
- ((stringp (car val))
- (cdr val))
- (t val))) ;Not a menu-item either.
-
-(defun keymap--menu-item-with-binding (item binding)
- "Build a menu-item like ITEM but with its binding changed to BINDING."
- (cond
- ((not (consp item)) binding) ;Not a menu-item.
- ((eq 'menu-item (car item))
- (setq item (copy-sequence item))
- (let ((tail (nthcdr 2 item)))
- (setcar tail binding)
- ;; Remove any potential filter.
- (if (plist-get (cdr tail) :filter)
- (setcdr tail (plist-put (cdr tail) :filter nil))))
- item)
- ((and (consp (cdr item)) (stringp (cadr item)))
- (cons (car item) (cons (cadr item) binding)))
- (t (cons (car item) binding))))
-
-(defun keymap--merge-bindings (val1 val2)
- "Merge bindings VAL1 and VAL2."
- (let ((map1 (keymap--menu-item-binding val1))
- (map2 (keymap--menu-item-binding val2)))
- (if (not (and (keymapp map1) (keymapp map2)))
- ;; There's nothing to merge: val1 takes precedence.
- val1
- (let ((map (list 'keymap map1 map2))
- (item (if (keymapp val1) (if (keymapp val2) nil val2) val1)))
- (keymap--menu-item-with-binding item map)))))
-
-(defun keymap-canonicalize (map)
- "Return a simpler equivalent keymap.
-This resolves inheritance and redefinitions. The returned keymap
-should behave identically to a copy of KEYMAP w.r.t `lookup-key'
-and use in active keymaps and menus.
-Subkeymaps may be modified but are not canonicalized."
- ;; FIXME: Problem with the difference between a nil binding
- ;; that hides a binding in an inherited map and a nil binding that's ignored
- ;; to let some further binding visible. Currently a nil binding hides all.
- ;; FIXME: we may want to carefully (re)order elements in case they're
- ;; menu-entries.
- (let ((bindings ())
- (ranges ())
- (prompt (keymap-prompt map)))
- (while (keymapp map)
- (setq map (map-keymap ;; -internal
- (lambda (key item)
- (if (consp key)
- ;; Treat char-ranges specially.
- (push (cons key item) ranges)
- (push (cons key item) bindings)))
- map)))
- ;; Create the new map.
- (setq map (funcall (if ranges 'make-keymap 'make-sparse-keymap) prompt))
- (dolist (binding ranges)
- ;; Treat char-ranges specially. FIXME: need to merge as well.
- (define-key map (vector (car binding)) (cdr binding)))
- ;; Process the bindings starting from the end.
- (dolist (binding (prog1 bindings (setq bindings ())))
- (let* ((key (car binding))
- (oldbind (assq key bindings)))
- (push (if (not oldbind)
- ;; The normal case: no duplicate bindings.
- binding
- ;; This is the second binding for this key.
- (setq bindings (delq oldbind bindings))
- (cons key (keymap--merge-bindings (cdr binding)
- (cdr oldbind))))
- bindings)))
- (nconc map bindings)))
-
-(put 'keyboard-translate-table 'char-table-extra-slots 0)
-
-(defun keyboard-translate (from to)
- "Translate character FROM to TO on the current terminal.
-This function creates a `keyboard-translate-table' if necessary
-and then modifies one entry in it."
- (or (char-table-p keyboard-translate-table)
- (setq keyboard-translate-table
- (make-char-table 'keyboard-translate-table nil)))
- (aset keyboard-translate-table from to))
-
-;;;; Key binding commands.
-
-(defun global-set-key (key command)
- "Give KEY a global binding as COMMAND.
-COMMAND is the command definition to use; usually it is
-a symbol naming an interactively-callable function.
-KEY is a key sequence; noninteractively, it is a string or vector
-of characters or event types, and non-ASCII characters with codes
-above 127 (such as ISO Latin-1) can be included if you use a vector.
-
-Note that if KEY has a local binding in the current buffer,
-that local binding will continue to shadow any global binding
-that you make with this function."
- (interactive "KSet key globally: \nCSet key %s to command: ")
- (or (vectorp key) (stringp key)
- (signal 'wrong-type-argument (list 'arrayp key)))
- (define-key (current-global-map) key command))
-
-(defun local-set-key (key command)
- "Give KEY a local binding as COMMAND.
-COMMAND is the command definition to use; usually it is
-a symbol naming an interactively-callable function.
-KEY is a key sequence; noninteractively, it is a string or vector
-of characters or event types, and non-ASCII characters with codes
-above 127 (such as ISO Latin-1) can be included if you use a vector.
-
-The binding goes in the current buffer's local map, which in most
-cases is shared with all other buffers in the same major mode."
- (interactive "KSet key locally: \nCSet key %s locally to command: ")
- (let ((map (current-local-map)))
- (or map
- (use-local-map (setq map (make-sparse-keymap))))
- (or (vectorp key) (stringp key)
- (signal 'wrong-type-argument (list 'arrayp key)))
- (define-key map key command)))
-
-(defun global-unset-key (key)
- "Remove global binding of KEY.
-KEY is a string or vector representing a sequence of keystrokes."
- (interactive "kUnset key globally: ")
- (global-set-key key nil))
-
-(defun local-unset-key (key)
- "Remove local binding of KEY.
-KEY is a string or vector representing a sequence of keystrokes."
- (interactive "kUnset key locally: ")
- (if (current-local-map)
- (local-set-key key nil))
- nil)
-
-;;;; substitute-key-definition and its subroutines.
-
-(defvar key-substitution-in-progress nil
- "Used internally by `substitute-key-definition'.")
-
-(defun substitute-key-definition (olddef newdef keymap &optional oldmap prefix)
- "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF.
-In other words, OLDDEF is replaced with NEWDEF where ever it appears.
-Alternatively, if optional fourth argument OLDMAP is specified, we redefine
-in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
-
-If you don't specify OLDMAP, you can usually get the same results
-in a cleaner way with command remapping, like this:
- (define-key KEYMAP [remap OLDDEF] NEWDEF)
-\n(fn OLDDEF NEWDEF KEYMAP &optional OLDMAP)"
- ;; Don't document PREFIX in the doc string because we don't want to
- ;; advertise it. It's meant for recursive calls only. Here's its
- ;; meaning
-
- ;; If optional argument PREFIX is specified, it should be a key
- ;; prefix, a string. Redefined bindings will then be bound to the
- ;; original key, with PREFIX added at the front.
- (or prefix (setq prefix ""))
- (let* ((scan (or oldmap keymap))
- (prefix1 (vconcat prefix [nil]))
- (key-substitution-in-progress
- (cons scan key-substitution-in-progress)))
- ;; Scan OLDMAP, finding each char or event-symbol that
- ;; has any definition, and act on it with hack-key.
- (map-keymap
- (lambda (char defn)
- (aset prefix1 (length prefix) char)
- (substitute-key-definition-key defn olddef newdef prefix1 keymap))
- scan)))
-
-(defun substitute-key-definition-key (defn olddef newdef prefix keymap)
- (let (inner-def skipped menu-item)
- ;; Find the actual command name within the binding.
- (if (eq (car-safe defn) 'menu-item)
- (setq menu-item defn defn (nth 2 defn))
- ;; Skip past menu-prompt.
- (while (stringp (car-safe defn))
- (push (pop defn) skipped))
- ;; Skip past cached key-equivalence data for menu items.
- (if (consp (car-safe defn))
- (setq defn (cdr defn))))
- (if (or (eq defn olddef)
- ;; Compare with equal if definition is a key sequence.
- ;; That is useful for operating on function-key-map.
- (and (or (stringp defn) (vectorp defn))
- (equal defn olddef)))
- (define-key keymap prefix
- (if menu-item
- (let ((copy (copy-sequence menu-item)))
- (setcar (nthcdr 2 copy) newdef)
- copy)
- (nconc (nreverse skipped) newdef)))
- ;; Look past a symbol that names a keymap.
- (setq inner-def
- (or (indirect-function defn t) defn))
- ;; For nested keymaps, we use `inner-def' rather than `defn' so as to
- ;; avoid autoloading a keymap. This is mostly done to preserve the
- ;; original non-autoloading behavior of pre-map-keymap times.
- (if (and (keymapp inner-def)
- ;; Avoid recursively scanning
- ;; where KEYMAP does not have a submap.
- (let ((elt (lookup-key keymap prefix)))
- (or (null elt) (natnump elt) (keymapp elt)))
- ;; Avoid recursively rescanning keymap being scanned.
- (not (memq inner-def key-substitution-in-progress)))
- ;; If this one isn't being scanned already, scan it now.
- (substitute-key-definition olddef newdef keymap inner-def prefix)))))
-
-
-;;;; The global keymap tree.
-
-;; global-map, esc-map, and ctl-x-map have their values set up in
-;; keymap.c; we just give them docstrings here.
-
-(defvar global-map nil
- "Default global keymap mapping Emacs keyboard input into commands.
-The value is a keymap which is usually (but not necessarily) Emacs's
-global map.")
-
-(defvar esc-map nil
- "Default keymap for ESC (meta) commands.
-The normal global definition of the character ESC indirects to this keymap.")
-
-(defvar ctl-x-map nil
- "Default keymap for C-x commands.
-The normal global definition of the character C-x indirects to this keymap.")
-
-(defvar ctl-x-4-map (make-sparse-keymap)
- "Keymap for subcommands of C-x 4.")
-(defalias 'ctl-x-4-prefix ctl-x-4-map)
-(define-key ctl-x-map "4" 'ctl-x-4-prefix)
-
-(defvar ctl-x-5-map (make-sparse-keymap)
- "Keymap for frame commands.")
-(defalias 'ctl-x-5-prefix ctl-x-5-map)
-(define-key ctl-x-map "5" 'ctl-x-5-prefix)
-
-
-;;;; Event manipulation functions.
-
-(defconst listify-key-sequence-1 (logior 128 ?\M-\C-@))
-
-(defun listify-key-sequence (key)
- "Convert a key sequence to a list of events."
- (if (vectorp key)
- (append key nil)
- (mapcar (function (lambda (c)
- (if (> c 127)
- (logxor c listify-key-sequence-1)
- c)))
- key)))
-
-(defun eventp (obj)
- "True if the argument is an event object."
- (when obj
- (or (integerp obj)
- (and (symbolp obj) obj (not (keywordp obj)))
- (and (consp obj) (symbolp (car obj))))))
-
-(defun event-modifiers (event)
- "Return a list of symbols representing the modifier keys in event EVENT.
-The elements of the list may include `meta', `control',
-`shift', `hyper', `super', `alt', `click', `double', `triple', `drag',
-and `down'.
-EVENT may be an event or an event type. If EVENT is a symbol
-that has never been used in an event that has been read as input
-in the current Emacs session, then this function may fail to include
-the `click' modifier."
- (let ((type event))
- (if (listp type)
- (setq type (car type)))
- (if (symbolp type)
- ;; Don't read event-symbol-elements directly since we're not
- ;; sure the symbol has already been parsed.
- (cdr (internal-event-symbol-parse-modifiers type))
- (let ((list nil)
- (char (logand type (lognot (logior ?\M-\^@ ?\C-\^@ ?\S-\^@
- ?\H-\^@ ?\s-\^@ ?\A-\^@)))))
- (if (not (zerop (logand type ?\M-\^@)))
- (push 'meta list))
- (if (or (not (zerop (logand type ?\C-\^@)))
- (< char 32))
- (push 'control list))
- (if (or (not (zerop (logand type ?\S-\^@)))
- (/= char (downcase char)))
- (push 'shift list))
- (or (zerop (logand type ?\H-\^@))
- (push 'hyper list))
- (or (zerop (logand type ?\s-\^@))
- (push 'super list))
- (or (zerop (logand type ?\A-\^@))
- (push 'alt list))
- list))))
-
-(defun event-basic-type (event)
- "Return the basic type of the given event (all modifiers removed).
-The value is a printing character (not upper case) or a symbol.
-EVENT may be an event or an event type. If EVENT is a symbol
-that has never been used in an event that has been read as input
-in the current Emacs session, then this function may return nil."
- (if (consp event)
- (setq event (car event)))
- (if (symbolp event)
- (car (get event 'event-symbol-elements))
- (let* ((base (logand event (1- ?\A-\^@)))
- (uncontrolled (if (< base 32) (logior base 64) base)))
- ;; There are some numbers that are invalid characters and
- ;; cause `downcase' to get an error.
- (condition-case ()
- (downcase uncontrolled)
- (error uncontrolled)))))
-
-(defsubst mouse-movement-p (object)
- "Return non-nil if OBJECT is a mouse movement event."
- (eq (car-safe object) 'mouse-movement))
-
-(defun mouse-event-p (object)
- "Return non-nil if OBJECT is a mouse click event."
- ;; is this really correct? maybe remove mouse-movement?
- (memq (event-basic-type object) '(mouse-1 mouse-2 mouse-3 mouse-movement)))
-
-(defun event-start (event)
- "Return the starting position of EVENT.
-EVENT should be a mouse click, drag, or key press event. If
-EVENT is nil, the value of `posn-at-point' is used instead.
-
-The following accessor functions are used to access the elements
-of the position:
-
-`posn-window': The window the event is in.
-`posn-area': A symbol identifying the area the event occurred in,
-or nil if the event occurred in the text area.
-`posn-point': The buffer position of the event.
-`posn-x-y': The pixel-based coordinates of the event.
-`posn-col-row': The estimated column and row corresponding to the
-position of the event.
-`posn-actual-col-row': The actual column and row corresponding to the
-position of the event.
-`posn-string': The string object of the event, which is either
-nil or (STRING . POSITION)'.
-`posn-image': The image object of the event, if any.
-`posn-object': The image or string object of the event, if any.
-`posn-timestamp': The time the event occurred, in milliseconds.
-
-For more information, see Info node `(elisp)Click Events'."
- (if (consp event) (nth 1 event)
- (or (posn-at-point)
- (list (selected-window) (point) '(0 . 0) 0))))
-
-(defun event-end (event)
- "Return the ending position of EVENT.
-EVENT should be a click, drag, or key press event.
-
-See `event-start' for a description of the value returned."
- (if (consp event) (nth (if (consp (nth 2 event)) 2 1) event)
- (or (posn-at-point)
- (list (selected-window) (point) '(0 . 0) 0))))
-
-(defsubst event-click-count (event)
- "Return the multi-click count of EVENT, a click or drag event.
-The return value is a positive integer."
- (if (and (consp event) (integerp (nth 2 event))) (nth 2 event) 1))
-
-;;;; Extracting fields of the positions in an event.
-
-(defun posnp (obj)
- "Return non-nil if OBJ appears to be a valid `posn' object specifying a window.
-If OBJ is a valid `posn' object, but specifies a frame rather
-than a window, return nil."
- ;; FIXME: Correct the behavior of this function so that all valid
- ;; `posn' objects are recognized, after updating other code that
- ;; depends on its present behavior.
- (and (windowp (car-safe obj))
- (atom (car-safe (setq obj (cdr obj)))) ;AREA-OR-POS.
- (integerp (car-safe (car-safe (setq obj (cdr obj))))) ;XOFFSET.
- (integerp (car-safe (cdr obj))))) ;TIMESTAMP.
-
-(defsubst posn-window (position)
- "Return the window in POSITION.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
- (nth 0 position))
-
-(defsubst posn-area (position)
- "Return the window area recorded in POSITION, or nil for the text area.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
- (let ((area (if (consp (nth 1 position))
- (car (nth 1 position))
- (nth 1 position))))
- (and (symbolp area) area)))
-
-(defun posn-point (position)
- "Return the buffer location in POSITION.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions.
-Returns nil if POSITION does not correspond to any buffer location (e.g.
-a click on a scroll bar)."
- (or (nth 5 position)
- (let ((pt (nth 1 position)))
- (or (car-safe pt)
- ;; Apparently this can also be `vertical-scroll-bar' (bug#13979).
- (if (integerp pt) pt)))))
-
-(defun posn-set-point (position)
- "Move point to POSITION.
-Select the corresponding window as well."
- (if (not (windowp (posn-window position)))
- (error "Position not in text area of window"))
- (select-window (posn-window position))
- (if (numberp (posn-point position))
- (goto-char (posn-point position))))
-
-(defsubst posn-x-y (position)
- "Return the x and y coordinates in POSITION.
-The return value has the form (X . Y), where X and Y are given in
-pixels. POSITION should be a list of the form returned by
-`event-start' and `event-end'."
- (nth 2 position))
-
-(declare-function scroll-bar-scale "scroll-bar" (num-denom whole))
-
-(defun posn-col-row (position)
- "Return the nominal column and row in POSITION, measured in characters.
-The column and row values are approximations calculated from the x
-and y coordinates in POSITION and the frame's default character width
-and default line height, including spacing.
-For a scroll-bar event, the result column is 0, and the row
-corresponds to the vertical position of the click in the scroll bar.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
- (let* ((pair (posn-x-y position))
- (frame-or-window (posn-window position))
- (frame (if (framep frame-or-window)
- frame-or-window
- (window-frame frame-or-window)))
- (window (when (windowp frame-or-window) frame-or-window))
- (area (posn-area position)))
- (cond
- ((null frame-or-window)
- '(0 . 0))
- ((eq area 'vertical-scroll-bar)
- (cons 0 (scroll-bar-scale pair (1- (window-height window)))))
- ((eq area 'horizontal-scroll-bar)
- (cons (scroll-bar-scale pair (window-width window)) 0))
- (t
- ;; FIXME: This should take line-spacing properties on
- ;; newlines into account.
- (let* ((spacing (when (display-graphic-p frame)
- (or (with-current-buffer
- (window-buffer (frame-selected-window frame))
- line-spacing)
- (frame-parameter frame 'line-spacing)))))
- (cond ((floatp spacing)
- (setq spacing (truncate (* spacing
- (frame-char-height frame)))))
- ((null spacing)
- (setq spacing 0)))
- (cons (/ (car pair) (frame-char-width frame))
- (/ (cdr pair) (+ (frame-char-height frame) spacing))))))))
-
-(defun posn-actual-col-row (position)
- "Return the window row number in POSITION and character number in that row.
-
-Return nil if POSITION does not contain the actual position; in that case
-\`posn-col-row' can be used to get approximate values.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions.
-
-This function does not account for the width on display, like the
-number of visual columns taken by a TAB or image. If you need
-the coordinates of POSITION in character units, you should use
-\`posn-col-row', not this function."
- (nth 6 position))
-
-(defsubst posn-timestamp (position)
- "Return the timestamp of POSITION.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
- (nth 3 position))
-
-(defun posn-string (position)
- "Return the string object of POSITION.
-Value is a cons (STRING . STRING-POS), or nil if not a string.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
- (let ((x (nth 4 position)))
- ;; Apparently this can also be `handle' or `below-handle' (bug#13979).
- (when (consp x) x)))
-
-(defsubst posn-image (position)
- "Return the image object of POSITION.
-Value is a list (image ...), or nil if not an image.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
- (nth 7 position))
-
-(defsubst posn-object (position)
- "Return the object (image or string) of POSITION.
-Value is a list (image ...) for an image object, a cons cell
-\(STRING . STRING-POS) for a string object, and nil for a buffer position.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
- (or (posn-image position) (posn-string position)))
-
-(defsubst posn-object-x-y (position)
- "Return the x and y coordinates relative to the object of POSITION.
-The return value has the form (DX . DY), where DX and DY are
-given in pixels. POSITION should be a list of the form returned
-by `event-start' and `event-end'."
- (nth 8 position))
-
-(defsubst posn-object-width-height (position)
- "Return the pixel width and height of the object of POSITION.
-The return value has the form (WIDTH . HEIGHT). POSITION should
-be a list of the form returned by `event-start' and `event-end'."
- (nth 9 position))
-
-
-;;;; Obsolescent names for functions.
-
-(define-obsolete-function-alias 'window-dot 'window-point "22.1")
-(define-obsolete-function-alias 'set-window-dot 'set-window-point "22.1")
-(define-obsolete-function-alias 'read-input 'read-string "22.1")
-(define-obsolete-function-alias 'show-buffer 'set-window-buffer "22.1")
-(define-obsolete-function-alias 'eval-current-buffer 'eval-buffer "22.1")
-(define-obsolete-function-alias 'string-to-int 'string-to-number "22.1")
-
-(make-obsolete 'forward-point "use (+ (point) N) instead." "23.1")
-(make-obsolete 'buffer-has-markers-at nil "24.3")
-
-(defun insert-string (&rest args)
- "Mocklisp-compatibility insert function.
-Like the function `insert' except that any argument that is a number
-is converted into a string by expressing it in decimal."
- (declare (obsolete insert "22.1"))
- (dolist (el args)
- (insert (if (integerp el) (number-to-string el) el))))
-
-(defun makehash (&optional test)
- (declare (obsolete make-hash-table "22.1"))
- (make-hash-table :test (or test 'eql)))
-
-(defun log10 (x)
- "Return (log X 10), the log base 10 of X."
- (declare (obsolete log "24.4"))
- (log x 10))
-
-;; These are used by VM and some old programs
-(defalias 'focus-frame 'ignore "")
-(make-obsolete 'focus-frame "it does nothing." "22.1")
-(defalias 'unfocus-frame 'ignore "")
-(make-obsolete 'unfocus-frame "it does nothing." "22.1")
-(make-obsolete 'make-variable-frame-local
- "explicitly check for a frame-parameter instead." "22.2")
-(set-advertised-calling-convention
- 'all-completions '(string collection &optional predicate) "23.1")
-(set-advertised-calling-convention 'unintern '(name obarray) "23.3")
-(set-advertised-calling-convention 'indirect-function '(object) "25.1")
-(set-advertised-calling-convention 'redirect-frame-focus '(frame focus-frame) "24.3")
-(set-advertised-calling-convention 'decode-char '(ch charset) "21.4")
-(set-advertised-calling-convention 'encode-char '(ch charset) "21.4")
-
-;;;; Obsolescence declarations for variables, and aliases.
-
-;; Special "default-FOO" variables which contain the default value of
-;; the "FOO" variable are nasty. Their implementation is brittle, and
-;; slows down several unrelated variable operations; furthermore, they
-;; can lead to really odd behavior if you decide to make them
-;; buffer-local.
-
-;; Not used at all in Emacs, last time I checked:
-(make-obsolete-variable 'default-mode-line-format 'mode-line-format "23.2")
-(make-obsolete-variable 'default-header-line-format 'header-line-format "23.2")
-(make-obsolete-variable 'default-line-spacing 'line-spacing "23.2")
-(make-obsolete-variable 'default-abbrev-mode 'abbrev-mode "23.2")
-(make-obsolete-variable 'default-ctl-arrow 'ctl-arrow "23.2")
-(make-obsolete-variable 'default-truncate-lines 'truncate-lines "23.2")
-(make-obsolete-variable 'default-left-margin 'left-margin "23.2")
-(make-obsolete-variable 'default-tab-width 'tab-width "23.2")
-(make-obsolete-variable 'default-case-fold-search 'case-fold-search "23.2")
-(make-obsolete-variable 'default-left-margin-width 'left-margin-width "23.2")
-(make-obsolete-variable 'default-right-margin-width 'right-margin-width "23.2")
-(make-obsolete-variable 'default-left-fringe-width 'left-fringe-width "23.2")
-(make-obsolete-variable 'default-right-fringe-width 'right-fringe-width "23.2")
-(make-obsolete-variable 'default-fringes-outside-margins 'fringes-outside-margins "23.2")
-(make-obsolete-variable 'default-scroll-bar-width 'scroll-bar-width "23.2")
-(make-obsolete-variable 'default-vertical-scroll-bar 'vertical-scroll-bar "23.2")
-(make-obsolete-variable 'default-indicate-empty-lines 'indicate-empty-lines "23.2")
-(make-obsolete-variable 'default-indicate-buffer-boundaries 'indicate-buffer-boundaries "23.2")
-(make-obsolete-variable 'default-fringe-indicator-alist 'fringe-indicator-alist "23.2")
-(make-obsolete-variable 'default-fringe-cursor-alist 'fringe-cursor-alist "23.2")
-(make-obsolete-variable 'default-scroll-up-aggressively 'scroll-up-aggressively "23.2")
-(make-obsolete-variable 'default-scroll-down-aggressively 'scroll-down-aggressively "23.2")
-(make-obsolete-variable 'default-fill-column 'fill-column "23.2")
-(make-obsolete-variable 'default-cursor-type 'cursor-type "23.2")
-(make-obsolete-variable 'default-cursor-in-non-selected-windows 'cursor-in-non-selected-windows "23.2")
-(make-obsolete-variable 'default-buffer-file-coding-system 'buffer-file-coding-system "23.2")
-(make-obsolete-variable 'default-major-mode 'major-mode "23.2")
-(make-obsolete-variable 'default-enable-multibyte-characters
- "use enable-multibyte-characters or set-buffer-multibyte instead" "23.2")
-
-(make-obsolete-variable 'define-key-rebound-commands nil "23.2")
-(make-obsolete-variable 'redisplay-end-trigger-functions 'jit-lock-register "23.1")
-(make-obsolete-variable 'deferred-action-list 'post-command-hook "24.1")
-(make-obsolete-variable 'deferred-action-function 'post-command-hook "24.1")
-(make-obsolete-variable 'redisplay-dont-pause nil "24.5")
-(make-obsolete 'window-redisplay-end-trigger nil "23.1")
-(make-obsolete 'set-window-redisplay-end-trigger nil "23.1")
-
-(make-obsolete 'process-filter-multibyte-p nil "23.1")
-(make-obsolete 'set-process-filter-multibyte nil "23.1")
-
-;; Lisp manual only updated in 22.1.
-(define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro
- "before 19.34")
-
-(define-obsolete-variable-alias 'x-lost-selection-hooks
- 'x-lost-selection-functions "22.1")
-(define-obsolete-variable-alias 'x-sent-selection-hooks
- 'x-sent-selection-functions "22.1")
-
-;; This was introduced in 21.4 for pre-unicode unification. That
-;; usage was rendered obsolete in 23.1 which uses Unicode internally.
-;; Other uses are possible, so this variable is not _really_ obsolete,
-;; but Stefan insists to mark it so.
-(make-obsolete-variable 'translation-table-for-input nil "23.1")
-
-(defvaralias 'messages-buffer-max-lines 'message-log-max)
-
-;;;; Alternate names for functions - these are not being phased out.
-
-(defalias 'send-string 'process-send-string)
-(defalias 'send-region 'process-send-region)
-(defalias 'string= 'string-equal)
-(defalias 'string< 'string-lessp)
-(defalias 'move-marker 'set-marker)
-(defalias 'rplaca 'setcar)
-(defalias 'rplacd 'setcdr)
-(defalias 'beep 'ding) ;preserve lingual purity
-(defalias 'indent-to-column 'indent-to)
-(defalias 'backward-delete-char 'delete-backward-char)
-(defalias 'search-forward-regexp (symbol-function 're-search-forward))
-(defalias 'search-backward-regexp (symbol-function 're-search-backward))
-(defalias 'int-to-string 'number-to-string)
-(defalias 'store-match-data 'set-match-data)
-(defalias 'chmod 'set-file-modes)
-(defalias 'mkdir 'make-directory)
-;; These are the XEmacs names:
-(defalias 'point-at-eol 'line-end-position)
-(defalias 'point-at-bol 'line-beginning-position)
-
-(defalias 'user-original-login-name 'user-login-name)
-
-
-;;;; Hook manipulation functions.
-
-(defun add-hook (hook function &optional append local)
- "Add to the value of HOOK the function FUNCTION.
-FUNCTION is not added if already present.
-FUNCTION is added (if necessary) at the beginning of the hook list
-unless the optional argument APPEND is non-nil, in which case
-FUNCTION is added at the end.
-
-The optional fourth argument, LOCAL, if non-nil, says to modify
-the hook's buffer-local value rather than its global value.
-This makes the hook buffer-local, and it makes t a member of the
-buffer-local value. That acts as a flag to run the hook
-functions of the global value as well as in the local value.
-
-HOOK should be a symbol, and FUNCTION may be any valid function. If
-HOOK is void, it is first set to nil. If HOOK's value is a single
-function, it is changed to a list of functions."
- (or (boundp hook) (set hook nil))
- (or (default-boundp hook) (set-default hook nil))
- (if local (unless (local-variable-if-set-p hook)
- (set (make-local-variable hook) (list t)))
- ;; Detect the case where make-local-variable was used on a hook
- ;; and do what we used to do.
- (unless (and (consp (symbol-value hook)) (memq t (symbol-value hook)))
- (setq local t)))
- (let ((hook-value (if local (symbol-value hook) (default-value hook))))
- ;; If the hook value is a single function, turn it into a list.
- (when (or (not (listp hook-value)) (functionp hook-value))
- (setq hook-value (list hook-value)))
- ;; Do the actual addition if necessary
- (unless (member function hook-value)
- (when (stringp function)
- (setq function (purecopy function)))
- (setq hook-value
- (if append
- (append hook-value (list function))
- (cons function hook-value))))
- ;; Set the actual variable
- (if local
- (progn
- ;; If HOOK isn't a permanent local,
- ;; but FUNCTION wants to survive a change of modes,
- ;; mark HOOK as partially permanent.
- (and (symbolp function)
- (get function 'permanent-local-hook)
- (not (get hook 'permanent-local))
- (put hook 'permanent-local 'permanent-local-hook))
- (set hook hook-value))
- (set-default hook hook-value))))
-
-(defun remove-hook (hook function &optional local)
- "Remove from the value of HOOK the function FUNCTION.
-HOOK should be a symbol, and FUNCTION may be any valid function. If
-FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the
-list of hooks to run in HOOK, then nothing is done. See `add-hook'.
-
-The optional third argument, LOCAL, if non-nil, says to modify
-the hook's buffer-local value rather than its default value."
- (or (boundp hook) (set hook nil))
- (or (default-boundp hook) (set-default hook nil))
- ;; Do nothing if LOCAL is t but this hook has no local binding.
- (unless (and local (not (local-variable-p hook)))
- ;; Detect the case where make-local-variable was used on a hook
- ;; and do what we used to do.
- (when (and (local-variable-p hook)
- (not (and (consp (symbol-value hook))
- (memq t (symbol-value hook)))))
- (setq local t))
- (let ((hook-value (if local (symbol-value hook) (default-value hook))))
- ;; Remove the function, for both the list and the non-list cases.
- (if (or (not (listp hook-value)) (eq (car hook-value) 'lambda))
- (if (equal hook-value function) (setq hook-value nil))
- (setq hook-value (delete function (copy-sequence hook-value))))
- ;; If the function is on the global hook, we need to shadow it locally
- ;;(when (and local (member function (default-value hook))
- ;; (not (member (cons 'not function) hook-value)))
- ;; (push (cons 'not function) hook-value))
- ;; Set the actual variable
- (if (not local)
- (set-default hook hook-value)
- (if (equal hook-value '(t))
- (kill-local-variable hook)
- (set hook hook-value))))))
-
-(defmacro letrec (binders &rest body)
- "Bind variables according to BINDERS then eval BODY.
-The value of the last form in BODY is returned.
-Each element of BINDERS is a list (SYMBOL VALUEFORM) which binds
-SYMBOL to the value of VALUEFORM.
-All symbols are bound before the VALUEFORMs are evalled."
- ;; Only useful in lexical-binding mode.
- ;; As a special-form, we could implement it more efficiently (and cleanly,
- ;; making the vars actually unbound during evaluation of the binders).
- (declare (debug let) (indent 1))
- `(let ,(mapcar #'car binders)
- ,@(mapcar (lambda (binder) `(setq ,@binder)) binders)
- ,@body))
-
-(defmacro with-wrapper-hook (hook args &rest body)
- "Run BODY, using wrapper functions from HOOK with additional ARGS.
-HOOK is an abnormal hook. Each hook function in HOOK \"wraps\"
-around the preceding ones, like a set of nested `around' advices.
-
-Each hook function should accept an argument list consisting of a
-function FUN, followed by the additional arguments in ARGS.
-
-The first hook function in HOOK is passed a FUN that, if it is called
-with arguments ARGS, performs BODY (i.e., the default operation).
-The FUN passed to each successive hook function is defined based
-on the preceding hook functions; if called with arguments ARGS,
-it does what the `with-wrapper-hook' call would do if the
-preceding hook functions were the only ones present in HOOK.
-
-Each hook function may call its FUN argument as many times as it wishes,
-including never. In that case, such a hook function acts to replace
-the default definition altogether, and any preceding hook functions.
-Of course, a subsequent hook function may do the same thing.
-
-Each hook function definition is used to construct the FUN passed
-to the next hook function, if any. The last (or \"outermost\")
-FUN is then called once."
- (declare (indent 2) (debug (form sexp body))
- (obsolete "use a <foo>-function variable modified by `add-function'."
- "24.4"))
- ;; We need those two gensyms because CL's lexical scoping is not available
- ;; for function arguments :-(
- (let ((funs (make-symbol "funs"))
- (global (make-symbol "global"))
- (argssym (make-symbol "args"))
- (runrestofhook (make-symbol "runrestofhook")))
- ;; Since the hook is a wrapper, the loop has to be done via
- ;; recursion: a given hook function will call its parameter in order to
- ;; continue looping.
- `(letrec ((,runrestofhook
- (lambda (,funs ,global ,argssym)
- ;; `funs' holds the functions left on the hook and `global'
- ;; holds the functions left on the global part of the hook
- ;; (in case the hook is local).
- (if (consp ,funs)
- (if (eq t (car ,funs))
- (funcall ,runrestofhook
- (append ,global (cdr ,funs)) nil ,argssym)
- (apply (car ,funs)
- (apply-partially
- (lambda (,funs ,global &rest ,argssym)
- (funcall ,runrestofhook ,funs ,global ,argssym))
- (cdr ,funs) ,global)
- ,argssym))
- ;; Once there are no more functions on the hook, run
- ;; the original body.
- (apply (lambda ,args ,@body) ,argssym)))))
- (funcall ,runrestofhook ,hook
- ;; The global part of the hook, if any.
- ,(if (symbolp hook)
- `(if (local-variable-p ',hook)
- (default-value ',hook)))
- (list ,@args)))))
-
-(defun add-to-list (list-var element &optional append compare-fn)
- "Add ELEMENT to the value of LIST-VAR if it isn't there yet.
-The test for presence of ELEMENT is done with `equal', or with
-COMPARE-FN if that's non-nil.
-If ELEMENT is added, it is added at the beginning of the list,
-unless the optional argument APPEND is non-nil, in which case
-ELEMENT is added at the end.
-
-The return value is the new value of LIST-VAR.
-
-This is handy to add some elements to configuration variables,
-but please do not abuse it in Elisp code, where you are usually
-better off using `push' or `cl-pushnew'.
-
-If you want to use `add-to-list' on a variable that is not
-defined until a certain package is loaded, you should put the
-call to `add-to-list' into a hook function that will be run only
-after loading the package. `eval-after-load' provides one way to
-do this. In some cases other hooks, such as major mode hooks,
-can do the job."
- (declare
- (compiler-macro
- (lambda (exp)
- ;; FIXME: Something like this could be used for `set' as well.
- (if (or (not (eq 'quote (car-safe list-var)))
- (special-variable-p (cadr list-var))
- (not (macroexp-const-p append)))
- exp
- (let* ((sym (cadr list-var))
- (append (eval append))
- (msg (format "`add-to-list' can't use lexical var `%s'; use `push' or `cl-pushnew'"
- sym))
- ;; Big ugly hack so we only output a warning during
- ;; byte-compilation, and so we can use
- ;; byte-compile-not-lexical-var-p to silence the warning
- ;; when a defvar has been seen but not yet executed.
- (warnfun (lambda ()
- ;; FIXME: We should also emit a warning for let-bound
- ;; variables with dynamic binding.
- (when (assq sym byte-compile--lexical-environment)
- (byte-compile-log-warning msg t :error))))
- (code
- (macroexp-let2 macroexp-copyable-p x element
- `(if ,(if compare-fn
- (progn
- (require 'cl-lib)
- `(cl-member ,x ,sym :test ,compare-fn))
- ;; For bootstrapping reasons, don't rely on
- ;; cl--compiler-macro-member for the base case.
- `(member ,x ,sym))
- ,sym
- ,(if append
- `(setq ,sym (append ,sym (list ,x)))
- `(push ,x ,sym))))))
- (if (not (macroexp--compiling-p))
- code
- `(progn
- (macroexp--funcall-if-compiled ',warnfun)
- ,code)))))))
- (if (cond
- ((null compare-fn)
- (member element (symbol-value list-var)))
- ((eq compare-fn 'eq)
- (memq element (symbol-value list-var)))
- ((eq compare-fn 'eql)
- (memql element (symbol-value list-var)))
- (t
- (let ((lst (symbol-value list-var)))
- (while (and lst
- (not (funcall compare-fn element (car lst))))
- (setq lst (cdr lst)))
- lst)))
- (symbol-value list-var)
- (set list-var
- (if append
- (append (symbol-value list-var) (list element))
- (cons element (symbol-value list-var))))))
-
-
-(defun add-to-ordered-list (list-var element &optional order)
- "Add ELEMENT to the value of LIST-VAR if it isn't there yet.
-The test for presence of ELEMENT is done with `eq'.
-
-The resulting list is reordered so that the elements are in the
-order given by each element's numeric list order. Elements
-without a numeric list order are placed at the end of the list.
-
-If the third optional argument ORDER is a number (integer or
-float), set the element's list order to the given value. If
-ORDER is nil or omitted, do not change the numeric order of
-ELEMENT. If ORDER has any other value, remove the numeric order
-of ELEMENT if it has one.
-
-The list order for each element is stored in LIST-VAR's
-`list-order' property.
-
-The return value is the new value of LIST-VAR."
- (let ((ordering (get list-var 'list-order)))
- (unless ordering
- (put list-var 'list-order
- (setq ordering (make-hash-table :weakness 'key :test 'eq))))
- (when order
- (puthash element (and (numberp order) order) ordering))
- (unless (memq element (symbol-value list-var))
- (set list-var (cons element (symbol-value list-var))))
- (set list-var (sort (symbol-value list-var)
- (lambda (a b)
- (let ((oa (gethash a ordering))
- (ob (gethash b ordering)))
- (if (and oa ob)
- (< oa ob)
- oa)))))))
-
-(defun add-to-history (history-var newelt &optional maxelt keep-all)
- "Add NEWELT to the history list stored in the variable HISTORY-VAR.
-Return the new history list.
-If MAXELT is non-nil, it specifies the maximum length of the history.
-Otherwise, the maximum history length is the value of the `history-length'
-property on symbol HISTORY-VAR, if set, or the value of the `history-length'
-variable.
-Remove duplicates of NEWELT if `history-delete-duplicates' is non-nil.
-If optional fourth arg KEEP-ALL is non-nil, add NEWELT to history even
-if it is empty or a duplicate."
- (unless maxelt
- (setq maxelt (or (get history-var 'history-length)
- history-length)))
- (let ((history (symbol-value history-var))
- tail)
- (when (and (listp history)
- (or keep-all
- (not (stringp newelt))
- (> (length newelt) 0))
- (or keep-all
- (not (equal (car history) newelt))))
- (if history-delete-duplicates
- (setq history (delete newelt history)))
- (setq history (cons newelt history))
- (when (integerp maxelt)
- (if (= 0 maxelt)
- (setq history nil)
- (setq tail (nthcdr (1- maxelt) history))
- (when (consp tail)
- (setcdr tail nil)))))
- (set history-var history)))
-
-
-;;;; Mode hooks.
-
-(defvar delay-mode-hooks nil
- "If non-nil, `run-mode-hooks' should delay running the hooks.")
-(defvar delayed-mode-hooks nil
- "List of delayed mode hooks waiting to be run.")
-(make-variable-buffer-local 'delayed-mode-hooks)
-(put 'delay-mode-hooks 'permanent-local t)
-
-(defvar change-major-mode-after-body-hook nil
- "Normal hook run in major mode functions, before the mode hooks.")
-
-(defvar after-change-major-mode-hook nil
- "Normal hook run at the very end of major mode functions.")
-
-(defun run-mode-hooks (&rest hooks)
- "Run mode hooks `delayed-mode-hooks' and HOOKS, or delay HOOKS.
-If the variable `delay-mode-hooks' is non-nil, does not run any hooks,
-just adds the HOOKS to the list `delayed-mode-hooks'.
-Otherwise, runs hooks in the sequence: `change-major-mode-after-body-hook',
-`delayed-mode-hooks' (in reverse order), HOOKS, and finally
-`after-change-major-mode-hook'. Major mode functions should use
-this instead of `run-hooks' when running their FOO-mode-hook."
- (if delay-mode-hooks
- ;; Delaying case.
- (dolist (hook hooks)
- (push hook delayed-mode-hooks))
- ;; Normal case, just run the hook as before plus any delayed hooks.
- (setq hooks (nconc (nreverse delayed-mode-hooks) hooks))
- (setq delayed-mode-hooks nil)
- (apply 'run-hooks (cons 'change-major-mode-after-body-hook hooks))
- (run-hooks 'after-change-major-mode-hook)))
-
-(defmacro delay-mode-hooks (&rest body)
- "Execute BODY, but delay any `run-mode-hooks'.
-These hooks will be executed by the first following call to
-`run-mode-hooks' that occurs outside any `delayed-mode-hooks' form.
-Only affects hooks run in the current buffer."
- (declare (debug t) (indent 0))
- `(progn
- (make-local-variable 'delay-mode-hooks)
- (let ((delay-mode-hooks t))
- ,@body)))
-
-;; PUBLIC: find if the current mode derives from another.
-
-(defun derived-mode-p (&rest modes)
- "Non-nil if the current major mode is derived from one of MODES.
-Uses the `derived-mode-parent' property of the symbol to trace backwards."
- (let ((parent major-mode))
- (while (and (not (memq parent modes))
- (setq parent (get parent 'derived-mode-parent))))
- parent))
-
-;;;; Minor modes.
-
-;; If a minor mode is not defined with define-minor-mode,
-;; add it here explicitly.
-;; isearch-mode is deliberately excluded, since you should
-;; not call it yourself.
-(defvar minor-mode-list '(auto-save-mode auto-fill-mode abbrev-mode
- overwrite-mode view-mode
- hs-minor-mode)
- "List of all minor mode functions.")
-
-(defun add-minor-mode (toggle name &optional keymap after toggle-fun)
- "Register a new minor mode.
-
-This is an XEmacs-compatibility function. Use `define-minor-mode' instead.
-
-TOGGLE is a symbol which is the name of a buffer-local variable that
-is toggled on or off to say whether the minor mode is active or not.
-
-NAME specifies what will appear in the mode line when the minor mode
-is active. NAME should be either a string starting with a space, or a
-symbol whose value is such a string.
-
-Optional KEYMAP is the keymap for the minor mode that will be added
-to `minor-mode-map-alist'.
-
-Optional AFTER specifies that TOGGLE should be added after AFTER
-in `minor-mode-alist'.
-
-Optional TOGGLE-FUN is an interactive function to toggle the mode.
-It defaults to (and should by convention be) TOGGLE.
-
-If TOGGLE has a non-nil `:included' property, an entry for the mode is
-included in the mode-line minor mode menu.
-If TOGGLE has a `:menu-tag', that is used for the menu item's label."
- (unless (memq toggle minor-mode-list)
- (push toggle minor-mode-list))
-
- (unless toggle-fun (setq toggle-fun toggle))
- (unless (eq toggle-fun toggle)
- (put toggle :minor-mode-function toggle-fun))
- ;; Add the name to the minor-mode-alist.
- (when name
- (let ((existing (assq toggle minor-mode-alist)))
- (if existing
- (setcdr existing (list name))
- (let ((tail minor-mode-alist) found)
- (while (and tail (not found))
- (if (eq after (caar tail))
- (setq found tail)
- (setq tail (cdr tail))))
- (if found
- (let ((rest (cdr found)))
- (setcdr found nil)
- (nconc found (list (list toggle name)) rest))
- (push (list toggle name) minor-mode-alist))))))
- ;; Add the toggle to the minor-modes menu if requested.
- (when (get toggle :included)
- (define-key mode-line-mode-menu
- (vector toggle)
- (list 'menu-item
- (concat
- (or (get toggle :menu-tag)
- (if (stringp name) name (symbol-name toggle)))
- (let ((mode-name (if (symbolp name) (symbol-value name))))
- (if (and (stringp mode-name) (string-match "[^ ]+" mode-name))
- (concat " (" (match-string 0 mode-name) ")"))))
- toggle-fun
- :button (cons :toggle toggle))))
-
- ;; Add the map to the minor-mode-map-alist.
- (when keymap
- (let ((existing (assq toggle minor-mode-map-alist)))
- (if existing
- (setcdr existing keymap)
- (let ((tail minor-mode-map-alist) found)
- (while (and tail (not found))
- (if (eq after (caar tail))
- (setq found tail)
- (setq tail (cdr tail))))
- (if found
- (let ((rest (cdr found)))
- (setcdr found nil)
- (nconc found (list (cons toggle keymap)) rest))
- (push (cons toggle keymap) minor-mode-map-alist)))))))
-
-;;;; Load history
-
-(defsubst autoloadp (object)
- "Non-nil if OBJECT is an autoload."
- (eq 'autoload (car-safe object)))
-
-;; (defun autoload-type (object)
-;; "Returns the type of OBJECT or `function' or `command' if the type is nil.
-;; OBJECT should be an autoload object."
-;; (when (autoloadp object)
-;; (let ((type (nth 3 object)))
-;; (cond ((null type) (if (nth 2 object) 'command 'function))
-;; ((eq 'keymap t) 'macro)
-;; (type)))))
-
-;; (defalias 'autoload-file #'cadr
-;; "Return the name of the file from which AUTOLOAD will be loaded.
-;; \n\(fn AUTOLOAD)")
-
-(defun symbol-file (symbol &optional type)
- "Return the name of the file that defined SYMBOL.
-The value is normally an absolute file name. It can also be nil,
-if the definition is not associated with any file. If SYMBOL
-specifies an autoloaded function, the value can be a relative
-file name without extension.
-
-If TYPE is nil, then any kind of definition is acceptable. If
-TYPE is `defun', `defvar', or `defface', that specifies function
-definition, variable definition, or face definition only."
- (if (and (or (null type) (eq type 'defun))
- (symbolp symbol)
- (autoloadp (symbol-function symbol)))
- (nth 1 (symbol-function symbol))
- (let ((files load-history)
- file)
- (while files
- (if (if type
- (if (eq type 'defvar)
- ;; Variables are present just as their names.
- (member symbol (cdr (car files)))
- ;; Other types are represented as (TYPE . NAME).
- (member (cons type symbol) (cdr (car files))))
- ;; We accept all types, so look for variable def
- ;; and then for any other kind.
- (or (member symbol (cdr (car files)))
- (rassq symbol (cdr (car files)))))
- (setq file (car (car files)) files nil))
- (setq files (cdr files)))
- file)))
-
-(defun locate-library (library &optional nosuffix path interactive-call)
- "Show the precise file name of Emacs library LIBRARY.
-LIBRARY should be a relative file name of the library, a string.
-It can omit the suffix (a.k.a. file-name extension) if NOSUFFIX is
-nil (which is the default, see below).
-This command searches the directories in `load-path' like `\\[load-library]'
-to find the file that `\\[load-library] RET LIBRARY RET' would load.
-Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes'
-to the specified name LIBRARY.
-
-If the optional third arg PATH is specified, that list of directories
-is used instead of `load-path'.
-
-When called from a program, the file name is normally returned as a
-string. When run interactively, the argument INTERACTIVE-CALL is t,
-and the file name is displayed in the echo area."
- (interactive (list (completing-read "Locate library: "
- (apply-partially
- 'locate-file-completion-table
- load-path (get-load-suffixes)))
- nil nil
- t))
- (let ((file (locate-file library
- (or path load-path)
- (append (unless nosuffix (get-load-suffixes))
- load-file-rep-suffixes))))
- (if interactive-call
- (if file
- (message "Library is file %s" (abbreviate-file-name file))
- (message "No library %s in search path" library)))
- file))
-
-
-;;;; Process stuff.
-
-(defun process-lines (program &rest args)
- "Execute PROGRAM with ARGS, returning its output as a list of lines.
-Signal an error if the program returns with a non-zero exit status."
- (with-temp-buffer
- (let ((status (apply 'call-process program nil (current-buffer) nil args)))
- (unless (eq status 0)
- (error "%s exited with status %s" program status))
- (goto-char (point-min))
- (let (lines)
- (while (not (eobp))
- (setq lines (cons (buffer-substring-no-properties
- (line-beginning-position)
- (line-end-position))
- lines))
- (forward-line 1))
- (nreverse lines)))))
-
-(defun process-live-p (process)
- "Returns non-nil if PROCESS is alive.
-A process is considered alive if its status is `run', `open',
-`listen', `connect' or `stop'. Value is nil if PROCESS is not a
-process."
- (and (processp process)
- (memq (process-status process)
- '(run open listen connect stop))))
-
-;; compatibility
-
-(make-obsolete
- 'process-kill-without-query
- "use `process-query-on-exit-flag' or `set-process-query-on-exit-flag'."
- "22.1")
-(defun process-kill-without-query (process &optional _flag)
- "Say no query needed if PROCESS is running when Emacs is exited.
-Optional second argument if non-nil says to require a query.
-Value is t if a query was formerly required."
- (let ((old (process-query-on-exit-flag process)))
- (set-process-query-on-exit-flag process nil)
- old))
-
-(defun process-kill-buffer-query-function ()
- "Ask before killing a buffer that has a running process."
- (let ((process (get-buffer-process (current-buffer))))
- (or (not process)
- (not (memq (process-status process) '(run stop open listen)))
- (not (process-query-on-exit-flag process))
- (yes-or-no-p
- (format "Buffer %S has a running process; kill it? "
- (buffer-name (current-buffer)))))))
-
-(add-hook 'kill-buffer-query-functions 'process-kill-buffer-query-function)
-
-;; process plist management
-
-(defun process-get (process propname)
- "Return the value of PROCESS' PROPNAME property.
-This is the last value stored with `(process-put PROCESS PROPNAME VALUE)'."
- (plist-get (process-plist process) propname))
-
-(defun process-put (process propname value)
- "Change PROCESS' PROPNAME property to VALUE.
-It can be retrieved with `(process-get PROCESS PROPNAME)'."
- (set-process-plist process
- (plist-put (process-plist process) propname value)))
-
-
-;;;; Input and display facilities.
-
-(defconst read-key-empty-map (make-sparse-keymap))
-
-(defvar read-key-delay 0.01) ;Fast enough for 100Hz repeat rate, hopefully.
-
-(defun read-key (&optional prompt)
- "Read a key from the keyboard.
-Contrary to `read-event' this will not return a raw event but instead will
-obey the input decoding and translations usually done by `read-key-sequence'.
-So escape sequences and keyboard encoding are taken into account.
-When there's an ambiguity because the key looks like the prefix of
-some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
- ;; This overriding-terminal-local-map binding also happens to
- ;; disable quail's input methods, so although read-key-sequence
- ;; always inherits the input method, in practice read-key does not
- ;; inherit the input method (at least not if it's based on quail).
- (let ((overriding-terminal-local-map nil)
- (overriding-local-map read-key-empty-map)
- (echo-keystrokes 0)
- (old-global-map (current-global-map))
- (timer (run-with-idle-timer
- ;; Wait long enough that Emacs has the time to receive and
- ;; process all the raw events associated with the single-key.
- ;; But don't wait too long, or the user may find the delay
- ;; annoying (or keep hitting more keys which may then get
- ;; lost or misinterpreted).
- ;; This is only relevant for keys which Emacs perceives as
- ;; "prefixes", such as C-x (because of the C-x 8 map in
- ;; key-translate-table and the C-x @ map in function-key-map)
- ;; or ESC (because of terminal escape sequences in
- ;; input-decode-map).
- read-key-delay t
- (lambda ()
- (let ((keys (this-command-keys-vector)))
- (unless (zerop (length keys))
- ;; `keys' is non-empty, so the user has hit at least
- ;; one key; there's no point waiting any longer, even
- ;; though read-key-sequence thinks we should wait
- ;; for more input to decide how to interpret the
- ;; current input.
- (throw 'read-key keys)))))))
- (unwind-protect
- (progn
- (use-global-map
- (let ((map (make-sparse-keymap)))
- ;; Don't hide the menu-bar and tool-bar entries.
- (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
- (define-key map [tool-bar]
- ;; This hack avoids evaluating the :filter (Bug#9922).
- (or (cdr (assq 'tool-bar global-map))
- (lookup-key global-map [tool-bar])))
- map))
- (let* ((keys
- (catch 'read-key (read-key-sequence-vector prompt nil t)))
- (key (aref keys 0)))
- (if (and (> (length keys) 1)
- (memq key '(mode-line header-line
- left-fringe right-fringe)))
- (aref keys 1)
- key)))
- (cancel-timer timer)
- (use-global-map old-global-map))))
-
-(defvar read-passwd-map
- ;; BEWARE: `defconst' would purecopy it, breaking the sharing with
- ;; minibuffer-local-map along the way!
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map minibuffer-local-map)
- (define-key map "\C-u" #'delete-minibuffer-contents) ;bug#12570
- map)
- "Keymap used while reading passwords.")
-
-(defun read-passwd (prompt &optional confirm default)
- "Read a password, prompting with PROMPT, and return it.
-If optional CONFIRM is non-nil, read the password twice to make sure.
-Optional DEFAULT is a default password to use instead of empty input.
-
-This function echoes `.' for each character that the user types.
-You could let-bind `read-hide-char' to another hiding character, though.
-
-Once the caller uses the password, it can erase the password
-by doing (clear-string STRING)."
- (if confirm
- (let (success)
- (while (not success)
- (let ((first (read-passwd prompt nil default))
- (second (read-passwd "Confirm password: " nil default)))
- (if (equal first second)
- (progn
- (and (arrayp second) (clear-string second))
- (setq success first))
- (and (arrayp first) (clear-string first))
- (and (arrayp second) (clear-string second))
- (message "Password not repeated accurately; please start over")
- (sit-for 1))))
- success)
- (let ((hide-chars-fun
- (lambda (beg end _len)
- (clear-this-command-keys)
- (setq beg (min end (max (minibuffer-prompt-end)
- beg)))
- (dotimes (i (- end beg))
- (put-text-property (+ i beg) (+ 1 i beg)
- 'display (string (or read-hide-char ?.))))))
- minibuf)
- (minibuffer-with-setup-hook
- (lambda ()
- (setq minibuf (current-buffer))
- ;; Turn off electricity.
- (setq-local post-self-insert-hook nil)
- (setq-local buffer-undo-list t)
- (setq-local select-active-regions nil)
- (use-local-map read-passwd-map)
- (setq-local inhibit-modification-hooks nil) ;bug#15501.
- (setq-local show-paren-mode nil) ;bug#16091.
- (add-hook 'after-change-functions hide-chars-fun nil 'local))
- (unwind-protect
- (let ((enable-recursive-minibuffers t)
- (read-hide-char (or read-hide-char ?.)))
- (read-string prompt nil t default)) ; t = "no history"
- (when (buffer-live-p minibuf)
- (with-current-buffer minibuf
- ;; Not sure why but it seems that there might be cases where the
- ;; minibuffer is not always properly reset later on, so undo
- ;; whatever we've done here (bug#11392).
- (remove-hook 'after-change-functions hide-chars-fun 'local)
- (kill-local-variable 'post-self-insert-hook)
- ;; And of course, don't keep the sensitive data around.
- (erase-buffer))))))))
-
-(defun read-number (prompt &optional default)
- "Read a numeric value in the minibuffer, prompting with PROMPT.
-DEFAULT specifies a default value to return if the user just types RET.
-The value of DEFAULT is inserted into PROMPT.
-This function is used by the `interactive' code letter `n'."
- (let ((n nil)
- (default1 (if (consp default) (car default) default)))
- (when default1
- (setq prompt
- (if (string-match "\\(\\):[ \t]*\\'" prompt)
- (replace-match (format " (default %s)" default1) t t prompt 1)
- (replace-regexp-in-string "[ \t]*\\'"
- (format " (default %s) " default1)
- prompt t t))))
- (while
- (progn
- (let ((str (read-from-minibuffer
- prompt nil nil nil nil
- (when default
- (if (consp default)
- (mapcar 'number-to-string (delq nil default))
- (number-to-string default))))))
- (condition-case nil
- (setq n (cond
- ((zerop (length str)) default1)
- ((stringp str) (read str))))
- (error nil)))
- (unless (numberp n)
- (message "Please enter a number.")
- (sit-for 1)
- t)))
- n))
-
-(defun read-char-choice (prompt chars &optional inhibit-keyboard-quit)
- "Read and return one of CHARS, prompting for PROMPT.
-Any input that is not one of CHARS is ignored.
-
-If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
-keyboard-quit events while waiting for a valid input."
- (unless (consp chars)
- (error "Called `read-char-choice' without valid char choices"))
- (let (char done show-help (helpbuf " *Char Help*"))
- (let ((cursor-in-echo-area t)
- (executing-kbd-macro executing-kbd-macro)
- (esc-flag nil))
- (save-window-excursion ; in case we call help-form-show
- (while (not done)
- (unless (get-text-property 0 'face prompt)
- (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
- (setq char (let ((inhibit-quit inhibit-keyboard-quit))
- (read-key prompt)))
- (and show-help (buffer-live-p (get-buffer helpbuf))
- (kill-buffer helpbuf))
- (cond
- ((not (numberp char)))
- ;; If caller has set help-form, that's enough.
- ;; They don't explicitly have to add help-char to chars.
- ((and help-form
- (eq char help-char)
- (setq show-help t)
- (help-form-show)))
- ((memq char chars)
- (setq done t))
- ((and executing-kbd-macro (= char -1))
- ;; read-event returns -1 if we are in a kbd macro and
- ;; there are no more events in the macro. Attempt to
- ;; get an event interactively.
- (setq executing-kbd-macro nil))
- ((not inhibit-keyboard-quit)
- (cond
- ((and (null esc-flag) (eq char ?\e))
- (setq esc-flag t))
- ((memq char '(?\C-g ?\e))
- (keyboard-quit))))))))
- ;; Display the question with the answer. But without cursor-in-echo-area.
- (message "%s%s" prompt (char-to-string char))
- char))
-
-(defun sit-for (seconds &optional nodisp obsolete)
- "Redisplay, then wait for SECONDS seconds. Stop when input is available.
-SECONDS may be a floating-point value.
-\(On operating systems that do not support waiting for fractions of a
-second, floating-point values are rounded down to the nearest integer.)
-
-If optional arg NODISP is t, don't redisplay, just wait for input.
-Redisplay does not happen if input is available before it starts.
-
-Value is t if waited the full time with no input arriving, and nil otherwise.
-
-An obsolete, but still supported form is
-\(sit-for SECONDS &optional MILLISECONDS NODISP)
-where the optional arg MILLISECONDS specifies an additional wait period,
-in milliseconds; this was useful when Emacs was built without
-floating point support."
- (declare (advertised-calling-convention (seconds &optional nodisp) "22.1"))
- ;; This used to be implemented in C until the following discussion:
- ;; http://lists.gnu.org/archive/html/emacs-devel/2006-07/msg00401.html
- ;; Then it was moved here using an implementation based on an idle timer,
- ;; which was then replaced by the use of read-event.
- (if (numberp nodisp)
- (setq seconds (+ seconds (* 1e-3 nodisp))
- nodisp obsolete)
- (if obsolete (setq nodisp obsolete)))
- (cond
- (noninteractive
- (sleep-for seconds)
- t)
- ((input-pending-p t)
- nil)
- ((<= seconds 0)
- (or nodisp (redisplay)))
- (t
- (or nodisp (redisplay))
- ;; FIXME: we should not read-event here at all, because it's much too
- ;; difficult to reliably "undo" a read-event by pushing it onto
- ;; unread-command-events.
- ;; For bug#14782, we need read-event to do the keyboard-coding-system
- ;; decoding (hence non-nil as second arg under POSIX ttys).
- ;; For bug#15614, we need read-event not to inherit-input-method.
- ;; So we temporarily suspend input-method-function.
- (let ((read (let ((input-method-function nil))
- (read-event nil t seconds))))
- (or (null read)
- (progn
- ;; https://lists.gnu.org/archive/html/emacs-devel/2006-10/msg00394.html
- ;; We want `read' appear in the next command's this-command-event
- ;; but not in the current one.
- ;; By pushing (cons t read), we indicate that `read' has not
- ;; yet been recorded in this-command-keys, so it will be recorded
- ;; next time it's read.
- ;; And indeed the `seconds' argument to read-event correctly
- ;; prevented recording this event in the current command's
- ;; this-command-keys.
- (push (cons t read) unread-command-events)
- nil))))))
-
-;; Behind display-popup-menus-p test.
-(declare-function x-popup-dialog "menu.c" (position contents &optional header))
-
-(defun y-or-n-p (prompt)
- "Ask user a \"y or n\" question. Return t if answer is \"y\".
-PROMPT is the string to display to ask the question. It should
-end in a space; `y-or-n-p' adds \"(y or n) \" to it.
-
-No confirmation of the answer is requested; a single character is
-enough. SPC also means yes, and DEL means no.
-
-To be precise, this function translates user input into responses
-by consulting the bindings in `query-replace-map'; see the
-documentation of that variable for more information. In this
-case, the useful bindings are `act', `skip', `recenter',
-`scroll-up', `scroll-down', and `quit'.
-An `act' response means yes, and a `skip' response means no.
-A `quit' response means to invoke `keyboard-quit'.
-If the user enters `recenter', `scroll-up', or `scroll-down'
-responses, perform the requested window recentering or scrolling
-and ask again.
-
-Under a windowing system a dialog box will be used if `last-nonmenu-event'
-is nil and `use-dialog-box' is non-nil."
- ;; ¡Beware! when I tried to edebug this code, Emacs got into a weird state
- ;; where all the keys were unbound (i.e. it somehow got triggered
- ;; within read-key, apparently). I had to kill it.
- (let ((answer 'recenter)
- (padded (lambda (prompt &optional dialog)
- (let ((l (length prompt)))
- (concat prompt
- (if (or (zerop l) (eq ?\s (aref prompt (1- l))))
- "" " ")
- (if dialog "" "(y or n) "))))))
- (cond
- (noninteractive
- (setq prompt (funcall padded prompt))
- (let ((temp-prompt prompt))
- (while (not (memq answer '(act skip)))
- (let ((str (read-string temp-prompt)))
- (cond ((member str '("y" "Y")) (setq answer 'act))
- ((member str '("n" "N")) (setq answer 'skip))
- (t (setq temp-prompt (concat "Please answer y or n. "
- prompt))))))))
- ((and (display-popup-menus-p)
- (listp last-nonmenu-event)
- use-dialog-box)
- (setq prompt (funcall padded prompt t)
- answer (x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip)))))
- (t
- (setq prompt (funcall padded prompt))
- (while
- (let* ((scroll-actions '(recenter scroll-up scroll-down
- scroll-other-window scroll-other-window-down))
- (key
- (let ((cursor-in-echo-area t))
- (when minibuffer-auto-raise
- (raise-frame (window-frame (minibuffer-window))))
- (read-key (propertize (if (memq answer scroll-actions)
- prompt
- (concat "Please answer y or n. "
- prompt))
- 'face 'minibuffer-prompt)))))
- (setq answer (lookup-key query-replace-map (vector key) t))
- (cond
- ((memq answer '(skip act)) nil)
- ((eq answer 'recenter)
- (recenter) t)
- ((eq answer 'scroll-up)
- (ignore-errors (scroll-up-command)) t)
- ((eq answer 'scroll-down)
- (ignore-errors (scroll-down-command)) t)
- ((eq answer 'scroll-other-window)
- (ignore-errors (scroll-other-window)) t)
- ((eq answer 'scroll-other-window-down)
- (ignore-errors (scroll-other-window-down)) t)
- ((or (memq answer '(exit-prefix quit)) (eq key ?\e))
- (signal 'quit nil) t)
- (t t)))
- (ding)
- (discard-input))))
- (let ((ret (eq answer 'act)))
- (unless noninteractive
- (message "%s%c" prompt (if ret ?y ?n)))
- ret)))
-
-
-;;; Atomic change groups.
-
-(defmacro atomic-change-group (&rest body)
- "Perform BODY as an atomic change group.
-This means that if BODY exits abnormally,
-all of its changes to the current buffer are undone.
-This works regardless of whether undo is enabled in the buffer.
-
-This mechanism is transparent to ordinary use of undo;
-if undo is enabled in the buffer and BODY succeeds, the
-user can undo the change normally."
- (declare (indent 0) (debug t))
- (let ((handle (make-symbol "--change-group-handle--"))
- (success (make-symbol "--change-group-success--")))
- `(let ((,handle (prepare-change-group))
- ;; Don't truncate any undo data in the middle of this.
- (undo-outer-limit nil)
- (undo-limit most-positive-fixnum)
- (undo-strong-limit most-positive-fixnum)
- (,success nil))
- (unwind-protect
- (progn
- ;; This is inside the unwind-protect because
- ;; it enables undo if that was disabled; we need
- ;; to make sure that it gets disabled again.
- (activate-change-group ,handle)
- ,@body
- (setq ,success t))
- ;; Either of these functions will disable undo
- ;; if it was disabled before.
- (if ,success
- (accept-change-group ,handle)
- (cancel-change-group ,handle))))))
-
-(defun prepare-change-group (&optional buffer)
- "Return a handle for the current buffer's state, for a change group.
-If you specify BUFFER, make a handle for BUFFER's state instead.
-
-Pass the handle to `activate-change-group' afterward to initiate
-the actual changes of the change group.
-
-To finish the change group, call either `accept-change-group' or
-`cancel-change-group' passing the same handle as argument. Call
-`accept-change-group' to accept the changes in the group as final;
-call `cancel-change-group' to undo them all. You should use
-`unwind-protect' to make sure the group is always finished. The call
-to `activate-change-group' should be inside the `unwind-protect'.
-Once you finish the group, don't use the handle again--don't try to
-finish the same group twice. For a simple example of correct use, see
-the source code of `atomic-change-group'.
-
-The handle records only the specified buffer. To make a multibuffer
-change group, call this function once for each buffer you want to
-cover, then use `nconc' to combine the returned values, like this:
-
- (nconc (prepare-change-group buffer-1)
- (prepare-change-group buffer-2))
-
-You can then activate that multibuffer change group with a single
-call to `activate-change-group' and finish it with a single call
-to `accept-change-group' or `cancel-change-group'."
-
- (if buffer
- (list (cons buffer (with-current-buffer buffer buffer-undo-list)))
- (list (cons (current-buffer) buffer-undo-list))))
-
-(defun activate-change-group (handle)
- "Activate a change group made with `prepare-change-group' (which see)."
- (dolist (elt handle)
- (with-current-buffer (car elt)
- (if (eq buffer-undo-list t)
- (setq buffer-undo-list nil)))))
-
-(defun accept-change-group (handle)
- "Finish a change group made with `prepare-change-group' (which see).
-This finishes the change group by accepting its changes as final."
- (dolist (elt handle)
- (with-current-buffer (car elt)
- (if (eq (cdr elt) t)
- (setq buffer-undo-list t)))))
-
-(defun cancel-change-group (handle)
- "Finish a change group made with `prepare-change-group' (which see).
-This finishes the change group by reverting all of its changes."
- (dolist (elt handle)
- (with-current-buffer (car elt)
- (setq elt (cdr elt))
- (save-restriction
- ;; Widen buffer temporarily so if the buffer was narrowed within
- ;; the body of `atomic-change-group' all changes can be undone.
- (widen)
- (let ((old-car
- (if (consp elt) (car elt)))
- (old-cdr
- (if (consp elt) (cdr elt))))
- ;; Temporarily truncate the undo log at ELT.
- (when (consp elt)
- (setcar elt nil) (setcdr elt nil))
- (unless (eq last-command 'undo) (undo-start))
- ;; Make sure there's no confusion.
- (when (and (consp elt) (not (eq elt (last pending-undo-list))))
- (error "Undoing to some unrelated state"))
- ;; Undo it all.
- (save-excursion
- (while (listp pending-undo-list) (undo-more 1)))
- ;; Reset the modified cons cell ELT to its original content.
- (when (consp elt)
- (setcar elt old-car)
- (setcdr elt old-cdr))
- ;; Revert the undo info to what it was when we grabbed the state.
- (setq buffer-undo-list elt))))))
-
-;;;; Display-related functions.
-
-;; For compatibility.
-(define-obsolete-function-alias 'redraw-modeline
- 'force-mode-line-update "24.3")
-
-(defun momentary-string-display (string pos &optional exit-char message)
- "Momentarily display STRING in the buffer at POS.
-Display remains until next event is input.
-If POS is a marker, only its position is used; its buffer is ignored.
-Optional third arg EXIT-CHAR can be a character, event or event
-description list. EXIT-CHAR defaults to SPC. If the input is
-EXIT-CHAR it is swallowed; otherwise it is then available as
-input (as a command if nothing else).
-Display MESSAGE (optional fourth arg) in the echo area.
-If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
- (or exit-char (setq exit-char ?\s))
- (let ((ol (make-overlay pos pos))
- (str (copy-sequence string)))
- (unwind-protect
- (progn
- (save-excursion
- (overlay-put ol 'after-string str)
- (goto-char pos)
- ;; To avoid trouble with out-of-bounds position
- (setq pos (point))
- ;; If the string end is off screen, recenter now.
- (if (<= (window-end nil t) pos)
- (recenter (/ (window-height) 2))))
- (message (or message "Type %s to continue editing.")
- (single-key-description exit-char))
- (let ((event (read-key)))
- ;; `exit-char' can be an event, or an event description list.
- (or (eq event exit-char)
- (eq event (event-convert-list exit-char))
- (setq unread-command-events
- (append (this-single-command-raw-keys))))))
- (delete-overlay ol))))
-
-
-;;;; Overlay operations
-
-(defun copy-overlay (o)
- "Return a copy of overlay O."
- (let ((o1 (if (overlay-buffer o)
- (make-overlay (overlay-start o) (overlay-end o)
- ;; FIXME: there's no easy way to find the
- ;; insertion-type of the two markers.
- (overlay-buffer o))
- (let ((o1 (make-overlay (point-min) (point-min))))
- (delete-overlay o1)
- o1)))
- (props (overlay-properties o)))
- (while props
- (overlay-put o1 (pop props) (pop props)))
- o1))
-
-(defun remove-overlays (&optional beg end name val)
- "Clear BEG and END of overlays whose property NAME has value VAL.
-Overlays might be moved and/or split.
-BEG and END default respectively to the beginning and end of buffer."
- ;; This speeds up the loops over overlays.
- (unless beg (setq beg (point-min)))
- (unless end (setq end (point-max)))
- (overlay-recenter end)
- (if (< end beg)
- (setq beg (prog1 end (setq end beg))))
- (save-excursion
- (dolist (o (overlays-in beg end))
- (when (eq (overlay-get o name) val)
- ;; Either push this overlay outside beg...end
- ;; or split it to exclude beg...end
- ;; or delete it entirely (if it is contained in beg...end).
- (if (< (overlay-start o) beg)
- (if (> (overlay-end o) end)
- (progn
- (move-overlay (copy-overlay o)
- (overlay-start o) beg)
- (move-overlay o end (overlay-end o)))
- (move-overlay o (overlay-start o) beg))
- (if (> (overlay-end o) end)
- (move-overlay o end (overlay-end o))
- (delete-overlay o)))))))
-
-;;;; Miscellanea.
-
-(defvar suspend-hook nil
- "Normal hook run by `suspend-emacs', before suspending.")
-
-(defvar suspend-resume-hook nil
- "Normal hook run by `suspend-emacs', after Emacs is continued.")
-
-(defvar temp-buffer-show-hook nil
- "Normal hook run by `with-output-to-temp-buffer' after displaying the buffer.
-When the hook runs, the temporary buffer is current, and the window it
-was displayed in is selected.")
-
-(defvar temp-buffer-setup-hook nil
- "Normal hook run by `with-output-to-temp-buffer' at the start.
-When the hook runs, the temporary buffer is current.
-This hook is normally set up with a function to put the buffer in Help
-mode.")
-
-(defconst user-emacs-directory
- (if (eq system-type 'ms-dos)
- ;; MS-DOS cannot have initial dot.
- "~/_emacs.d/"
- "~/.emacs.d/")
- "Directory beneath which additional per-user Emacs-specific files are placed.
-Various programs in Emacs store information in this directory.
-Note that this should end with a directory separator.
-See also `locate-user-emacs-file'.")
-
-;;;; Misc. useful functions.
-
-(defsubst buffer-narrowed-p ()
- "Return non-nil if the current buffer is narrowed."
- (/= (- (point-max) (point-min)) (buffer-size)))
-
-(defun find-tag-default-bounds ()
- "Determine the boundaries of the default tag, based on text at point.
-Return a cons cell with the beginning and end of the found tag.
-If there is no plausible default, return nil."
- (let (from to bound)
- (when (or (progn
- ;; Look at text around `point'.
- (save-excursion
- (skip-syntax-backward "w_") (setq from (point)))
- (save-excursion
- (skip-syntax-forward "w_") (setq to (point)))
- (> to from))
- ;; Look between `line-beginning-position' and `point'.
- (save-excursion
- (and (setq bound (line-beginning-position))
- (skip-syntax-backward "^w_" bound)
- (> (setq to (point)) bound)
- (skip-syntax-backward "w_")
- (setq from (point))))
- ;; Look between `point' and `line-end-position'.
- (save-excursion
- (and (setq bound (line-end-position))
- (skip-syntax-forward "^w_" bound)
- (< (setq from (point)) bound)
- (skip-syntax-forward "w_")
- (setq to (point)))))
- (cons from to))))
-
-(defun find-tag-default ()
- "Determine default tag to search for, based on text at point.
-If there is no plausible default, return nil."
- (let ((bounds (find-tag-default-bounds)))
- (when bounds
- (buffer-substring-no-properties (car bounds) (cdr bounds)))))
-
-(defun find-tag-default-as-regexp ()
- "Return regexp that matches the default tag at point.
-If there is no tag at point, return nil.
-
-When in a major mode that does not provide its own
-`find-tag-default-function', return a regexp that matches the
-symbol at point exactly."
- (let ((tag (funcall (or find-tag-default-function
- (get major-mode 'find-tag-default-function)
- 'find-tag-default))))
- (if tag (regexp-quote tag))))
-
-(defun find-tag-default-as-symbol-regexp ()
- "Return regexp that matches the default tag at point as symbol.
-If there is no tag at point, return nil.
-
-When in a major mode that does not provide its own
-`find-tag-default-function', return a regexp that matches the
-symbol at point exactly."
- (let ((tag-regexp (find-tag-default-as-regexp)))
- (if (and tag-regexp
- (eq (or find-tag-default-function
- (get major-mode 'find-tag-default-function)
- 'find-tag-default)
- 'find-tag-default))
- (format "\\_<%s\\_>" tag-regexp)
- tag-regexp)))
-
-(defun play-sound (sound)
- "SOUND is a list of the form `(sound KEYWORD VALUE...)'.
-The following keywords are recognized:
-
- :file FILE - read sound data from FILE. If FILE isn't an
-absolute file name, it is searched in `data-directory'.
-
- :data DATA - read sound data from string DATA.
-
-Exactly one of :file or :data must be present.
-
- :volume VOL - set volume to VOL. VOL must an integer in the
-range 0..100 or a float in the range 0..1.0. If not specified,
-don't change the volume setting of the sound device.
-
- :device DEVICE - play sound on DEVICE. If not specified,
-a system-dependent default device name is used.
-
-Note: :data and :device are currently not supported on Windows."
- (if (fboundp 'play-sound-internal)
- (play-sound-internal sound)
- (error "This Emacs binary lacks sound support")))
-
-(declare-function w32-shell-dos-semantics "w32-fns" nil)
-
-(defun shell-quote-argument (argument)
- "Quote ARGUMENT for passing as argument to an inferior shell."
- (cond
- ((eq system-type 'ms-dos)
- ;; Quote using double quotes, but escape any existing quotes in
- ;; the argument with backslashes.
- (let ((result "")
- (start 0)
- end)
- (if (or (null (string-match "[^\"]" argument))
- (< (match-end 0) (length argument)))
- (while (string-match "[\"]" argument start)
- (setq end (match-beginning 0)
- result (concat result (substring argument start end)
- "\\" (substring argument end (1+ end)))
- start (1+ end))))
- (concat "\"" result (substring argument start) "\"")))
-
- ((and (eq system-type 'windows-nt) (w32-shell-dos-semantics))
-
- ;; First, quote argument so that CommandLineToArgvW will
- ;; understand it. See
- ;; http://msdn.microsoft.com/en-us/library/17w5ykft%28v=vs.85%29.aspx
- ;; After we perform that level of quoting, escape shell
- ;; metacharacters so that cmd won't mangle our argument. If the
- ;; argument contains no double quote characters, we can just
- ;; surround it with double quotes. Otherwise, we need to prefix
- ;; each shell metacharacter with a caret.
-
- (setq argument
- ;; escape backslashes at end of string
- (replace-regexp-in-string
- "\\(\\\\*\\)$"
- "\\1\\1"
- ;; escape backslashes and quotes in string body
- (replace-regexp-in-string
- "\\(\\\\*\\)\""
- "\\1\\1\\\\\""
- argument)))
-
- (if (string-match "[%!\"]" argument)
- (concat
- "^\""
- (replace-regexp-in-string
- "\\([%!()\"<>&|^]\\)"
- "^\\1"
- argument)
- "^\"")
- (concat "\"" argument "\"")))
-
- (t
- (if (equal argument "")
- "''"
- ;; Quote everything except POSIX filename characters.
- ;; This should be safe enough even for really weird shells.
- (replace-regexp-in-string
- "\n" "'\n'"
- (replace-regexp-in-string "[^-0-9a-zA-Z_./\n]" "\\\\\\&" argument))))
- ))
-
-(defun string-or-null-p (object)
- "Return t if OBJECT is a string or nil.
-Otherwise, return nil."
- (or (stringp object) (null object)))
-
-(defun booleanp (object)
- "Return t if OBJECT is one of the two canonical boolean values: t or nil.
-Otherwise, return nil."
- (and (memq object '(nil t)) t))
-
-(defun special-form-p (object)
- "Non-nil if and only if OBJECT is a special form."
- (if (and (symbolp object) (fboundp object))
- (setq object (indirect-function object t)))
- (and (subrp object) (eq (cdr (subr-arity object)) 'unevalled)))
-
-(defun macrop (object)
- "Non-nil if and only if OBJECT is a macro."
- (let ((def (indirect-function object t)))
- (when (consp def)
- (or (eq 'macro (car def))
- (and (autoloadp def) (memq (nth 4 def) '(macro t)))))))
-
-(defun field-at-pos (pos)
- "Return the field at position POS, taking stickiness etc into account."
- (let ((raw-field (get-char-property (field-beginning pos) 'field)))
- (if (eq raw-field 'boundary)
- (get-char-property (1- (field-end pos)) 'field)
- raw-field)))
-
-(defun sha1 (object &optional start end binary)
- "Return the SHA1 (Secure Hash Algorithm) of an OBJECT.
-OBJECT is either a string or a buffer. Optional arguments START and
-END are character positions specifying which portion of OBJECT for
-computing the hash. If BINARY is non-nil, return a string in binary
-form."
- (secure-hash 'sha1 object start end binary))
-
-(defun function-get (f prop &optional autoload)
- "Return the value of property PROP of function F.
-If AUTOLOAD is non-nil and F is autoloaded, try to autoload it
-in the hope that it will set PROP. If AUTOLOAD is `macro', only do it
-if it's an autoloaded macro."
- (let ((val nil))
- (while (and (symbolp f)
- (null (setq val (get f prop)))
- (fboundp f))
- (let ((fundef (symbol-function f)))
- (if (and autoload (autoloadp fundef)
- (not (equal fundef
- (autoload-do-load fundef f
- (if (eq autoload 'macro)
- 'macro)))))
- nil ;Re-try `get' on the same `f'.
- (setq f fundef))))
- val))
-
-;;;; Support for yanking and text properties.
-;; Why here in subr.el rather than in simple.el? --Stef
-
-(defvar yank-handled-properties)
-(defvar yank-excluded-properties)
-
-(defun remove-yank-excluded-properties (start end)
- "Process text properties between START and END, inserted for a `yank'.
-Perform the handling specified by `yank-handled-properties', then
-remove properties specified by `yank-excluded-properties'."
- (let ((inhibit-read-only t))
- (dolist (handler yank-handled-properties)
- (let ((prop (car handler))
- (fun (cdr handler))
- (run-start start))
- (while (< run-start end)
- (let ((value (get-text-property run-start prop))
- (run-end (next-single-property-change
- run-start prop nil end)))
- (funcall fun value run-start run-end)
- (setq run-start run-end)))))
- (if (eq yank-excluded-properties t)
- (set-text-properties start end nil)
- (remove-list-of-text-properties start end yank-excluded-properties))))
-
-(defvar yank-undo-function)
-
-(defun insert-for-yank (string)
- "Call `insert-for-yank-1' repetitively for each `yank-handler' segment.
-
-See `insert-for-yank-1' for more details."
- (let (to)
- (while (setq to (next-single-property-change 0 'yank-handler string))
- (insert-for-yank-1 (substring string 0 to))
- (setq string (substring string to))))
- (insert-for-yank-1 string))
-
-(defun insert-for-yank-1 (string)
- "Insert STRING at point for the `yank' command.
-This function is like `insert', except it honors the variables
-`yank-handled-properties' and `yank-excluded-properties', and the
-`yank-handler' text property.
-
-Properties listed in `yank-handled-properties' are processed,
-then those listed in `yank-excluded-properties' are discarded.
-
-If STRING has a non-nil `yank-handler' property on its first
-character, the normal insert behavior is altered. The value of
-the `yank-handler' property must be a list of one to four
-elements, of the form (FUNCTION PARAM NOEXCLUDE UNDO).
-FUNCTION, if non-nil, should be a function of one argument, an
- object to insert; it is called instead of `insert'.
-PARAM, if present and non-nil, replaces STRING as the argument to
- FUNCTION or `insert'; e.g. if FUNCTION is `yank-rectangle', PARAM
- may be a list of strings to insert as a rectangle.
-If NOEXCLUDE is present and non-nil, the normal removal of
- `yank-excluded-properties' is not performed; instead FUNCTION is
- responsible for the removal. This may be necessary if FUNCTION
- adjusts point before or after inserting the object.
-UNDO, if present and non-nil, should be a function to be called
- by `yank-pop' to undo the insertion of the current object. It is
- given two arguments, the start and end of the region. FUNCTION
- may set `yank-undo-function' to override UNDO."
- (let* ((handler (and (stringp string)
- (get-text-property 0 'yank-handler string)))
- (param (or (nth 1 handler) string))
- (opoint (point))
- (inhibit-read-only inhibit-read-only)
- end)
-
- (setq yank-undo-function t)
- (if (nth 0 handler) ; FUNCTION
- (funcall (car handler) param)
- (insert param))
- (setq end (point))
-
- ;; Prevent read-only properties from interfering with the
- ;; following text property changes.
- (setq inhibit-read-only t)
-
- (unless (nth 2 handler) ; NOEXCLUDE
- (remove-yank-excluded-properties opoint end))
-
- ;; If last inserted char has properties, mark them as rear-nonsticky.
- (if (and (> end opoint)
- (text-properties-at (1- end)))
- (put-text-property (1- end) end 'rear-nonsticky t))
-
- (if (eq yank-undo-function t) ; not set by FUNCTION
- (setq yank-undo-function (nth 3 handler))) ; UNDO
- (if (nth 4 handler) ; COMMAND
- (setq this-command (nth 4 handler)))))
-
-(defun insert-buffer-substring-no-properties (buffer &optional start end)
- "Insert before point a substring of BUFFER, without text properties.
-BUFFER may be a buffer or a buffer name.
-Arguments START and END are character positions specifying the substring.
-They default to the values of (point-min) and (point-max) in BUFFER."
- (let ((opoint (point)))
- (insert-buffer-substring buffer start end)
- (let ((inhibit-read-only t))
- (set-text-properties opoint (point) nil))))
-
-(defun insert-buffer-substring-as-yank (buffer &optional start end)
- "Insert before point a part of BUFFER, stripping some text properties.
-BUFFER may be a buffer or a buffer name.
-Arguments START and END are character positions specifying the substring.
-They default to the values of (point-min) and (point-max) in BUFFER.
-Before insertion, process text properties according to
-`yank-handled-properties' and `yank-excluded-properties'."
- ;; Since the buffer text should not normally have yank-handler properties,
- ;; there is no need to handle them here.
- (let ((opoint (point)))
- (insert-buffer-substring buffer start end)
- (remove-yank-excluded-properties opoint (point))))
-
-(defun yank-handle-font-lock-face-property (face start end)
- "If `font-lock-defaults' is nil, apply FACE as a `face' property.
-START and END denote the start and end of the text to act on.
-Do nothing if FACE is nil."
- (and face
- (null font-lock-defaults)
- (put-text-property start end 'face face)))
-
-;; This removes `mouse-face' properties in *Help* buffer buttons:
-;; http://lists.gnu.org/archive/html/emacs-devel/2002-04/msg00648.html
-(defun yank-handle-category-property (category start end)
- "Apply property category CATEGORY's properties between START and END."
- (when category
- (let ((start2 start))
- (while (< start2 end)
- (let ((end2 (next-property-change start2 nil end))
- (original (text-properties-at start2)))
- (set-text-properties start2 end2 (symbol-plist category))
- (add-text-properties start2 end2 original)
- (setq start2 end2))))))
-
-
-;;;; Synchronous shell commands.
-
-(defun start-process-shell-command (name buffer &rest args)
- "Start a program in a subprocess. Return the process object for it.
-NAME is name for process. It is modified if necessary to make it unique.
-BUFFER is the buffer (or buffer name) to associate with the process.
- Process output goes at end of that buffer, unless you specify
- an output stream or filter function to handle the output.
- BUFFER may be also nil, meaning that this process is not associated
- with any buffer
-COMMAND is the shell command to run.
-
-An old calling convention accepted any number of arguments after COMMAND,
-which were just concatenated to COMMAND. This is still supported but strongly
-discouraged."
- (declare (advertised-calling-convention (name buffer command) "23.1"))
- ;; We used to use `exec' to replace the shell with the command,
- ;; but that failed to handle (...) and semicolon, etc.
- (start-process name buffer shell-file-name shell-command-switch
- (mapconcat 'identity args " ")))
-
-(defun start-file-process-shell-command (name buffer &rest args)
- "Start a program in a subprocess. Return the process object for it.
-Similar to `start-process-shell-command', but calls `start-file-process'."
- (declare (advertised-calling-convention (name buffer command) "23.1"))
- (start-file-process
- name buffer
- (if (file-remote-p default-directory) "/bin/sh" shell-file-name)
- (if (file-remote-p default-directory) "-c" shell-command-switch)
- (mapconcat 'identity args " ")))
-
-(defun call-process-shell-command (command &optional infile buffer display
- &rest args)
- "Execute the shell command COMMAND synchronously in separate process.
-The remaining arguments are optional.
-The program's input comes from file INFILE (nil means `/dev/null').
-Insert output in BUFFER before point; t means current buffer;
- nil for BUFFER means discard it; 0 means discard and don't wait.
-BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
-REAL-BUFFER says what to do with standard output, as above,
-while STDERR-FILE says what to do with standard error in the child.
-STDERR-FILE may be nil (discard standard error output),
-t (mix it with ordinary output), or a file name string.
-
-Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted.
-Wildcards and redirection are handled as usual in the shell.
-
-If BUFFER is 0, `call-process-shell-command' returns immediately with value nil.
-Otherwise it waits for COMMAND to terminate and returns a numeric exit
-status or a signal description string.
-If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.
-
-An old calling convention accepted any number of arguments after DISPLAY,
-which were just concatenated to COMMAND. This is still supported but strongly
-discouraged."
- (declare (advertised-calling-convention
- (command &optional infile buffer display) "24.5"))
- ;; We used to use `exec' to replace the shell with the command,
- ;; but that failed to handle (...) and semicolon, etc.
- (call-process shell-file-name
- infile buffer display
- shell-command-switch
- (mapconcat 'identity (cons command args) " ")))
-
-(defun process-file-shell-command (command &optional infile buffer display
- &rest args)
- "Process files synchronously in a separate process.
-Similar to `call-process-shell-command', but calls `process-file'."
- (declare (advertised-calling-convention
- (command &optional infile buffer display) "24.5"))
- (process-file
- (if (file-remote-p default-directory) "/bin/sh" shell-file-name)
- infile buffer display
- (if (file-remote-p default-directory) "-c" shell-command-switch)
- (mapconcat 'identity (cons command args) " ")))
-
-;;;; Lisp macros to do various things temporarily.
-
-(defmacro track-mouse (&rest body)
- "Evaluate BODY with mouse movement events enabled.
-Within a `track-mouse' form, mouse motion generates input events that
- you can read with `read-event'.
-Normally, mouse motion is ignored."
- (declare (debug t) (indent 0))
- `(internal--track-mouse (lambda () ,@body)))
-
-(defmacro with-current-buffer (buffer-or-name &rest body)
- "Execute the forms in BODY with BUFFER-OR-NAME temporarily current.
-BUFFER-OR-NAME must be a buffer or the name of an existing buffer.
-The value returned is the value of the last form in BODY. See
-also `with-temp-buffer'."
- (declare (indent 1) (debug t))
- `(save-current-buffer
- (set-buffer ,buffer-or-name)
- ,@body))
-
-(defun internal--before-with-selected-window (window)
- (let ((other-frame (window-frame window)))
- (list window (selected-window)
- ;; Selecting a window on another frame also changes that
- ;; frame's frame-selected-window. We must save&restore it.
- (unless (eq (selected-frame) other-frame)
- (frame-selected-window other-frame))
- ;; Also remember the top-frame if on ttys.
- (unless (eq (selected-frame) other-frame)
- (tty-top-frame other-frame)))))
-
-(defun internal--after-with-selected-window (state)
- ;; First reset frame-selected-window.
- (when (window-live-p (nth 2 state))
- ;; We don't use set-frame-selected-window because it does not
- ;; pass the `norecord' argument to Fselect_window.
- (select-window (nth 2 state) 'norecord)
- (and (frame-live-p (nth 3 state))
- (not (eq (tty-top-frame) (nth 3 state)))
- (select-frame (nth 3 state) 'norecord)))
- ;; Then reset the actual selected-window.
- (when (window-live-p (nth 1 state))
- (select-window (nth 1 state) 'norecord)))
-
-(defmacro with-selected-window (window &rest body)
- "Execute the forms in BODY with WINDOW as the selected window.
-The value returned is the value of the last form in BODY.
-
-This macro saves and restores the selected window, as well as the
-selected window of each frame. It does not change the order of
-recently selected windows. If the previously selected window of
-some frame is no longer live at the end of BODY, that frame's
-selected window is left alone. If the selected window is no
-longer live, then whatever window is selected at the end of BODY
-remains selected.
-
-This macro uses `save-current-buffer' to save and restore the
-current buffer, since otherwise its normal operation could
-potentially make a different buffer current. It does not alter
-the buffer list ordering."
- (declare (indent 1) (debug t))
- `(let ((save-selected-window--state
- (internal--before-with-selected-window ,window)))
- (save-current-buffer
- (unwind-protect
- (progn (select-window (car save-selected-window--state) 'norecord)
- ,@body)
- (internal--after-with-selected-window save-selected-window--state)))))
-
-(defmacro with-selected-frame (frame &rest body)
- "Execute the forms in BODY with FRAME as the selected frame.
-The value returned is the value of the last form in BODY.
-
-This macro saves and restores the selected frame, and changes the
-order of neither the recently selected windows nor the buffers in
-the buffer list."
- (declare (indent 1) (debug t))
- (let ((old-frame (make-symbol "old-frame"))
- (old-buffer (make-symbol "old-buffer")))
- `(let ((,old-frame (selected-frame))
- (,old-buffer (current-buffer)))
- (unwind-protect
- (progn (select-frame ,frame 'norecord)
- ,@body)
- (when (frame-live-p ,old-frame)
- (select-frame ,old-frame 'norecord))
- (when (buffer-live-p ,old-buffer)
- (set-buffer ,old-buffer))))))
-
-(defmacro save-window-excursion (&rest body)
- "Execute BODY, then restore previous window configuration.
-This macro saves the window configuration on the selected frame,
-executes BODY, then calls `set-window-configuration' to restore
-the saved window configuration. The return value is the last
-form in BODY. The window configuration is also restored if BODY
-exits nonlocally.
-
-BEWARE: Most uses of this macro introduce bugs.
-E.g. it should not be used to try and prevent some code from opening
-a new window, since that window may sometimes appear in another frame,
-in which case `save-window-excursion' cannot help."
- (declare (indent 0) (debug t))
- (let ((c (make-symbol "wconfig")))
- `(let ((,c (current-window-configuration)))
- (unwind-protect (progn ,@body)
- (set-window-configuration ,c)))))
-
-(defun internal-temp-output-buffer-show (buffer)
- "Internal function for `with-output-to-temp-buffer'."
- (with-current-buffer buffer
- (set-buffer-modified-p nil)
- (goto-char (point-min)))
-
- (if temp-buffer-show-function
- (funcall temp-buffer-show-function buffer)
- (with-current-buffer buffer
- (let* ((window
- (let ((window-combination-limit
- ;; When `window-combination-limit' equals
- ;; `temp-buffer' or `temp-buffer-resize' and
- ;; `temp-buffer-resize-mode' is enabled in this
- ;; buffer bind it to t so resizing steals space
- ;; preferably from the window that was split.
- (if (or (eq window-combination-limit 'temp-buffer)
- (and (eq window-combination-limit
- 'temp-buffer-resize)
- temp-buffer-resize-mode))
- t
- window-combination-limit)))
- (display-buffer buffer)))
- (frame (and window (window-frame window))))
- (when window
- (unless (eq frame (selected-frame))
- (make-frame-visible frame))
- (setq minibuffer-scroll-window window)
- (set-window-hscroll window 0)
- ;; Don't try this with NOFORCE non-nil!
- (set-window-start window (point-min) t)
- ;; This should not be necessary.
- (set-window-point window (point-min))
- ;; Run `temp-buffer-show-hook', with the chosen window selected.
- (with-selected-window window
- (run-hooks 'temp-buffer-show-hook))))))
- ;; Return nil.
- nil)
-
-;; Doc is very similar to with-temp-buffer-window.
-(defmacro with-output-to-temp-buffer (bufname &rest body)
- "Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer.
-
-This construct makes buffer BUFNAME empty before running BODY.
-It does not make the buffer current for BODY.
-Instead it binds `standard-output' to that buffer, so that output
-generated with `prin1' and similar functions in BODY goes into
-the buffer.
-
-At the end of BODY, this marks buffer BUFNAME unmodified and displays
-it in a window, but does not select it. The normal way to do this is
-by calling `display-buffer', then running `temp-buffer-show-hook'.
-However, if `temp-buffer-show-function' is non-nil, it calls that
-function instead (and does not run `temp-buffer-show-hook'). The
-function gets one argument, the buffer to display.
-
-The return value of `with-output-to-temp-buffer' is the value of the
-last form in BODY. If BODY does not finish normally, the buffer
-BUFNAME is not displayed.
-
-This runs the hook `temp-buffer-setup-hook' before BODY,
-with the buffer BUFNAME temporarily current. It runs the hook
-`temp-buffer-show-hook' after displaying buffer BUFNAME, with that
-buffer temporarily current, and the window that was used to display it
-temporarily selected. But it doesn't run `temp-buffer-show-hook'
-if it uses `temp-buffer-show-function'.
-
-By default, the setup hook puts the buffer into Help mode before running BODY.
-If BODY does not change the major mode, the show hook makes the buffer
-read-only, and scans it for function and variable names to make them into
-clickable cross-references.
-
-See the related form `with-temp-buffer-window'."
- (declare (debug t))
- (let ((old-dir (make-symbol "old-dir"))
- (buf (make-symbol "buf")))
- `(let* ((,old-dir default-directory)
- (,buf
- (with-current-buffer (get-buffer-create ,bufname)
- (prog1 (current-buffer)
- (kill-all-local-variables)
- ;; FIXME: delete_all_overlays
- (setq default-directory ,old-dir)
- (setq buffer-read-only nil)
- (setq buffer-file-name nil)
- (setq buffer-undo-list t)
- (let ((inhibit-read-only t)
- (inhibit-modification-hooks t))
- (erase-buffer)
- (run-hooks 'temp-buffer-setup-hook)))))
- (standard-output ,buf))
- (prog1 (progn ,@body)
- (internal-temp-output-buffer-show ,buf)))))
-
-(defmacro with-temp-file (file &rest body)
- "Create a new buffer, evaluate BODY there, and write the buffer to FILE.
-The value returned is the value of the last form in BODY.
-See also `with-temp-buffer'."
- (declare (indent 1) (debug t))
- (let ((temp-file (make-symbol "temp-file"))
- (temp-buffer (make-symbol "temp-buffer")))
- `(let ((,temp-file ,file)
- (,temp-buffer
- (get-buffer-create (generate-new-buffer-name " *temp file*"))))
- (unwind-protect
- (prog1
- (with-current-buffer ,temp-buffer
- ,@body)
- (with-current-buffer ,temp-buffer
- (write-region nil nil ,temp-file nil 0)))
- (and (buffer-name ,temp-buffer)
- (kill-buffer ,temp-buffer))))))
-
-(defmacro with-temp-message (message &rest body)
- "Display MESSAGE temporarily if non-nil while BODY is evaluated.
-The original message is restored to the echo area after BODY has finished.
-The value returned is the value of the last form in BODY.
-MESSAGE is written to the message log buffer if `message-log-max' is non-nil.
-If MESSAGE is nil, the echo area and message log buffer are unchanged.
-Use a MESSAGE of \"\" to temporarily clear the echo area."
- (declare (debug t) (indent 1))
- (let ((current-message (make-symbol "current-message"))
- (temp-message (make-symbol "with-temp-message")))
- `(let ((,temp-message ,message)
- (,current-message))
- (unwind-protect
- (progn
- (when ,temp-message
- (setq ,current-message (current-message))
- (message "%s" ,temp-message))
- ,@body)
- (and ,temp-message
- (if ,current-message
- (message "%s" ,current-message)
- (message nil)))))))
-
-(defmacro with-temp-buffer (&rest body)
- "Create a temporary buffer, and evaluate BODY there like `progn'.
-See also `with-temp-file' and `with-output-to-string'."
- (declare (indent 0) (debug t))
- (let ((temp-buffer (make-symbol "temp-buffer")))
- `(let ((,temp-buffer (generate-new-buffer " *temp*")))
- ;; FIXME: kill-buffer can change current-buffer in some odd cases.
- (with-current-buffer ,temp-buffer
- (unwind-protect
- (progn ,@body)
- (and (buffer-name ,temp-buffer)
- (kill-buffer ,temp-buffer)))))))
-
-(defmacro with-silent-modifications (&rest body)
- "Execute BODY, pretending it does not modify the buffer.
-If BODY performs real modifications to the buffer's text, other
-than cosmetic ones, undo data may become corrupted.
-
-This macro will run BODY normally, but doesn't count its buffer
-modifications as being buffer modifications. This affects things
-like `buffer-modified-p', checking whether the file is locked by
-someone else, running buffer modification hooks, and other things
-of that nature.
-
-Typically used around modifications of text-properties which do
-not really affect the buffer's content."
- (declare (debug t) (indent 0))
- (let ((modified (make-symbol "modified")))
- `(let* ((,modified (buffer-modified-p))
- (buffer-undo-list t)
- (inhibit-read-only t)
- (inhibit-modification-hooks t))
- (unwind-protect
- (progn
- ,@body)
- (unless ,modified
- (restore-buffer-modified-p nil))))))
-
-(defmacro with-output-to-string (&rest body)
- "Execute BODY, return the text it sent to `standard-output', as a string."
- (declare (indent 0) (debug t))
- `(let ((standard-output
- (get-buffer-create (generate-new-buffer-name " *string-output*"))))
- (unwind-protect
- (progn
- (let ((standard-output standard-output))
- ,@body)
- (with-current-buffer standard-output
- (buffer-string)))
- (kill-buffer standard-output))))
-
-(defmacro with-local-quit (&rest body)
- "Execute BODY, allowing quits to terminate BODY but not escape further.
-When a quit terminates BODY, `with-local-quit' returns nil but
-requests another quit. That quit will be processed as soon as quitting
-is allowed once again. (Immediately, if `inhibit-quit' is nil.)"
- (declare (debug t) (indent 0))
- `(condition-case nil
- (let ((inhibit-quit nil))
- ,@body)
- (quit (setq quit-flag t)
- ;; This call is to give a chance to handle quit-flag
- ;; in case inhibit-quit is nil.
- ;; Without this, it will not be handled until the next function
- ;; call, and that might allow it to exit thru a condition-case
- ;; that intends to handle the quit signal next time.
- (eval '(ignore nil)))))
-
-(defmacro while-no-input (&rest body)
- "Execute BODY only as long as there's no pending input.
-If input arrives, that ends the execution of BODY,
-and `while-no-input' returns t. Quitting makes it return nil.
-If BODY finishes, `while-no-input' returns whatever value BODY produced."
- (declare (debug t) (indent 0))
- (let ((catch-sym (make-symbol "input")))
- `(with-local-quit
- (catch ',catch-sym
- (let ((throw-on-input ',catch-sym))
- (or (input-pending-p)
- (progn ,@body)))))))
-
-(defmacro condition-case-unless-debug (var bodyform &rest handlers)
- "Like `condition-case' except that it does not prevent debugging.
-More specifically if `debug-on-error' is set then the debugger will be invoked
-even if this catches the signal."
- (declare (debug condition-case) (indent 2))
- `(condition-case ,var
- ,bodyform
- ,@(mapcar (lambda (handler)
- `((debug ,@(if (listp (car handler)) (car handler)
- (list (car handler))))
- ,@(cdr handler)))
- handlers)))
-
-(define-obsolete-function-alias 'condition-case-no-debug
- 'condition-case-unless-debug "24.1")
-
-(defmacro with-demoted-errors (format &rest body)
- "Run BODY and demote any errors to simple messages.
-FORMAT is a string passed to `message' to format any error message.
-It should contain a single %-sequence; e.g., \"Error: %S\".
-
-If `debug-on-error' is non-nil, run BODY without catching its errors.
-This is to be used around code which is not expected to signal an error
-but which should be robust in the unexpected case that an error is signaled.
-
-For backward compatibility, if FORMAT is not a constant string, it
-is assumed to be part of BODY, in which case the message format
-used is \"Error: %S\"."
- (declare (debug t) (indent 1))
- (let ((err (make-symbol "err"))
- (format (if (and (stringp format) body) format
- (prog1 "Error: %S"
- (if format (push format body))))))
- `(condition-case-unless-debug ,err
- ,(macroexp-progn body)
- (error (message ,format ,err) nil))))
-
-(defmacro combine-after-change-calls (&rest body)
- "Execute BODY, but don't call the after-change functions till the end.
-If BODY makes changes in the buffer, they are recorded
-and the functions on `after-change-functions' are called several times
-when BODY is finished.
-The return value is the value of the last form in BODY.
-
-If `before-change-functions' is non-nil, then calls to the after-change
-functions can't be deferred, so in that case this macro has no effect.
-
-Do not alter `after-change-functions' or `before-change-functions'
-in BODY."
- (declare (indent 0) (debug t))
- `(unwind-protect
- (let ((combine-after-change-calls t))
- . ,body)
- (combine-after-change-execute)))
-
-(defmacro with-case-table (table &rest body)
- "Execute the forms in BODY with TABLE as the current case table.
-The value returned is the value of the last form in BODY."
- (declare (indent 1) (debug t))
- (let ((old-case-table (make-symbol "table"))
- (old-buffer (make-symbol "buffer")))
- `(let ((,old-case-table (current-case-table))
- (,old-buffer (current-buffer)))
- (unwind-protect
- (progn (set-case-table ,table)
- ,@body)
- (with-current-buffer ,old-buffer
- (set-case-table ,old-case-table))))))
-
-(defmacro with-file-modes (modes &rest body)
- "Execute BODY with default file permissions temporarily set to MODES.
-MODES is as for `set-default-file-modes'."
- (declare (indent 1) (debug t))
- (let ((umask (make-symbol "umask")))
- `(let ((,umask (default-file-modes)))
- (unwind-protect
- (progn
- (set-default-file-modes ,modes)
- ,@body)
- (set-default-file-modes ,umask)))))
-
-
-;;; Matching and match data.
-
-(defvar save-match-data-internal)
-
-;; We use save-match-data-internal as the local variable because
-;; that works ok in practice (people should not use that variable elsewhere).
-;; We used to use an uninterned symbol; the compiler handles that properly
-;; now, but it generates slower code.
-(defmacro save-match-data (&rest body)
- "Execute the BODY forms, restoring the global value of the match data.
-The value returned is the value of the last form in BODY."
- ;; It is better not to use backquote here,
- ;; because that makes a bootstrapping problem
- ;; if you need to recompile all the Lisp files using interpreted code.
- (declare (indent 0) (debug t))
- (list 'let
- '((save-match-data-internal (match-data)))
- (list 'unwind-protect
- (cons 'progn body)
- ;; It is safe to free (evaporate) markers immediately here,
- ;; as Lisp programs should not copy from save-match-data-internal.
- '(set-match-data save-match-data-internal 'evaporate))))
-
-(defun match-string (num &optional string)
- "Return string of text matched by last search.
-NUM specifies which parenthesized expression in the last regexp.
- Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
-Zero means the entire text matched by the whole regexp or whole string.
-STRING should be given if the last search was by `string-match' on STRING.
-If STRING is nil, the current buffer should be the same buffer
-the search/match was performed in."
- (if (match-beginning num)
- (if string
- (substring string (match-beginning num) (match-end num))
- (buffer-substring (match-beginning num) (match-end num)))))
-
-(defun match-string-no-properties (num &optional string)
- "Return string of text matched by last search, without text properties.
-NUM specifies which parenthesized expression in the last regexp.
- Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
-Zero means the entire text matched by the whole regexp or whole string.
-STRING should be given if the last search was by `string-match' on STRING.
-If STRING is nil, the current buffer should be the same buffer
-the search/match was performed in."
- (if (match-beginning num)
- (if string
- (substring-no-properties string (match-beginning num)
- (match-end num))
- (buffer-substring-no-properties (match-beginning num)
- (match-end num)))))
-
-
-(defun match-substitute-replacement (replacement
- &optional fixedcase literal string subexp)
- "Return REPLACEMENT as it will be inserted by `replace-match'.
-In other words, all back-references in the form `\\&' and `\\N'
-are substituted with actual strings matched by the last search.
-Optional FIXEDCASE, LITERAL, STRING and SUBEXP have the same
-meaning as for `replace-match'."
- (let ((match (match-string 0 string)))
- (save-match-data
- (set-match-data (mapcar (lambda (x)
- (if (numberp x)
- (- x (match-beginning 0))
- x))
- (match-data t)))
- (replace-match replacement fixedcase literal match subexp))))
-
-
-(defun looking-back (regexp &optional limit greedy)
- "Return non-nil if text before point matches regular expression REGEXP.
-Like `looking-at' except matches before point, and is slower.
-LIMIT if non-nil speeds up the search by specifying a minimum
-starting position, to avoid checking matches that would start
-before LIMIT.
-
-If GREEDY is non-nil, extend the match backwards as far as
-possible, stopping when a single additional previous character
-cannot be part of a match for REGEXP. When the match is
-extended, its starting position is allowed to occur before
-LIMIT.
-
-As a general recommendation, try to avoid using `looking-back'
-wherever possible, since it is slow."
- (let ((start (point))
- (pos
- (save-excursion
- (and (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)
- (point)))))
- (if (and greedy pos)
- (save-restriction
- (narrow-to-region (point-min) start)
- (while (and (> pos (point-min))
- (save-excursion
- (goto-char pos)
- (backward-char 1)
- (looking-at (concat "\\(?:" regexp "\\)\\'"))))
- (setq pos (1- pos)))
- (save-excursion
- (goto-char pos)
- (looking-at (concat "\\(?:" regexp "\\)\\'")))))
- (not (null pos))))
-
-(defsubst looking-at-p (regexp)
- "\
-Same as `looking-at' except this function does not change the match data."
- (let ((inhibit-changing-match-data t))
- (looking-at regexp)))
-
-(defsubst string-match-p (regexp string &optional start)
- "\
-Same as `string-match' except this function does not change the match data."
- (let ((inhibit-changing-match-data t))
- (string-match regexp string start)))
-
-(defun subregexp-context-p (regexp pos &optional start)
- "Return non-nil if POS is in a normal subregexp context in REGEXP.
-A subregexp context is one where a sub-regexp can appear.
-A non-subregexp context is for example within brackets, or within a
-repetition bounds operator `\\=\\{...\\}', or right after a `\\'.
-If START is non-nil, it should be a position in REGEXP, smaller
-than POS, and known to be in a subregexp context."
- ;; Here's one possible implementation, with the great benefit that it
- ;; reuses the regexp-matcher's own parser, so it understands all the
- ;; details of the syntax. A disadvantage is that it needs to match the
- ;; error string.
- (condition-case err
- (progn
- (string-match (substring regexp (or start 0) pos) "")
- t)
- (invalid-regexp
- (not (member (cadr err) '("Unmatched [ or [^"
- "Unmatched \\{"
- "Trailing backslash")))))
- ;; An alternative implementation:
- ;; (defconst re-context-re
- ;; (let* ((harmless-ch "[^\\[]")
- ;; (harmless-esc "\\\\[^{]")
- ;; (class-harmless-ch "[^][]")
- ;; (class-lb-harmless "[^]:]")
- ;; (class-lb-colon-maybe-charclass ":\\([a-z]+:]\\)?")
- ;; (class-lb (concat "\\[\\(" class-lb-harmless
- ;; "\\|" class-lb-colon-maybe-charclass "\\)"))
- ;; (class
- ;; (concat "\\[^?]?"
- ;; "\\(" class-harmless-ch
- ;; "\\|" class-lb "\\)*"
- ;; "\\[?]")) ; special handling for bare [ at end of re
- ;; (braces "\\\\{[0-9,]+\\\\}"))
- ;; (concat "\\`\\(" harmless-ch "\\|" harmless-esc
- ;; "\\|" class "\\|" braces "\\)*\\'"))
- ;; "Matches any prefix that corresponds to a normal subregexp context.")
- ;; (string-match re-context-re (substring regexp (or start 0) pos))
- )
-
-;;;; split-string
-
-(defconst split-string-default-separators "[ \f\t\n\r\v]+"
- "The default value of separators for `split-string'.
-
-A regexp matching strings of whitespace. May be locale-dependent
-\(as yet unimplemented). Should not match non-breaking spaces.
-
-Warning: binding this to a different value and using it as default is
-likely to have undesired semantics.")
-
-;; The specification says that if both SEPARATORS and OMIT-NULLS are
-;; defaulted, OMIT-NULLS should be treated as t. Simplifying the logical
-;; expression leads to the equivalent implementation that if SEPARATORS
-;; is defaulted, OMIT-NULLS is treated as t.
-(defun split-string (string &optional separators omit-nulls trim)
- "Split STRING into substrings bounded by matches for SEPARATORS.
-
-The beginning and end of STRING, and each match for SEPARATORS, are
-splitting points. The substrings matching SEPARATORS are removed, and
-the substrings between the splitting points are collected as a list,
-which is returned.
-
-If SEPARATORS is non-nil, it should be a regular expression matching text
-which separates, but is not part of, the substrings. If nil it defaults to
-`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and
-OMIT-NULLS is forced to t.
-
-If OMIT-NULLS is t, zero-length substrings are omitted from the list (so
-that for the default value of SEPARATORS leading and trailing whitespace
-are effectively trimmed). If nil, all zero-length substrings are retained,
-which correctly parses CSV format, for example.
-
-If TRIM is non-nil, it should be a regular expression to match
-text to trim from the beginning and end of each substring. If trimming
-makes the substring empty, it is treated as null.
-
-If you want to trim whitespace from the substrings, the reliably correct
-way is using TRIM. Making SEPARATORS match that whitespace gives incorrect
-results when there is whitespace at the start or end of STRING. If you
-see such calls to `split-string', please fix them.
-
-Note that the effect of `(split-string STRING)' is the same as
-`(split-string STRING split-string-default-separators t)'. In the rare
-case that you wish to retain zero-length substrings when splitting on
-whitespace, use `(split-string STRING split-string-default-separators)'.
-
-Modifies the match data; use `save-match-data' if necessary."
- (let* ((keep-nulls (not (if separators omit-nulls t)))
- (rexp (or separators split-string-default-separators))
- (start 0)
- this-start this-end
- notfirst
- (list nil)
- (push-one
- ;; Push the substring in range THIS-START to THIS-END
- ;; onto LIST, trimming it and perhaps discarding it.
- (lambda ()
- (when trim
- ;; Discard the trim from start of this substring.
- (let ((tem (string-match trim string this-start)))
- (and (eq tem this-start)
- (setq this-start (match-end 0)))))
-
- (when (or keep-nulls (< this-start this-end))
- (let ((this (substring string this-start this-end)))
-
- ;; Discard the trim from end of this substring.
- (when trim
- (let ((tem (string-match (concat trim "\\'") this 0)))
- (and tem (< tem (length this))
- (setq this (substring this 0 tem)))))
-
- ;; Trimming could make it empty; check again.
- (when (or keep-nulls (> (length this) 0))
- (push this list)))))))
-
- (while (and (string-match rexp string
- (if (and notfirst
- (= start (match-beginning 0))
- (< start (length string)))
- (1+ start) start))
- (< start (length string)))
- (setq notfirst t)
- (setq this-start start this-end (match-beginning 0)
- start (match-end 0))
-
- (funcall push-one))
-
- ;; Handle the substring at the end of STRING.
- (setq this-start start this-end (length string))
- (funcall push-one)
-
- (nreverse list)))
-
-(defun combine-and-quote-strings (strings &optional separator)
- "Concatenate the STRINGS, adding the SEPARATOR (default \" \").
-This tries to quote the strings to avoid ambiguity such that
- (split-string-and-unquote (combine-and-quote-strings strs)) == strs
-Only some SEPARATORs will work properly."
- (let* ((sep (or separator " "))
- (re (concat "[\\\"]" "\\|" (regexp-quote sep))))
- (mapconcat
- (lambda (str)
- (if (string-match re str)
- (concat "\"" (replace-regexp-in-string "[\\\"]" "\\\\\\&" str) "\"")
- str))
- strings sep)))
-
-(defun split-string-and-unquote (string &optional separator)
- "Split the STRING into a list of strings.
-It understands Emacs Lisp quoting within STRING, such that
- (split-string-and-unquote (combine-and-quote-strings strs)) == strs
-The SEPARATOR regexp defaults to \"\\s-+\"."
- (let ((sep (or separator "\\s-+"))
- (i (string-match "\"" string)))
- (if (null i)
- (split-string string sep t) ; no quoting: easy
- (append (unless (eq i 0) (split-string (substring string 0 i) sep t))
- (let ((rfs (read-from-string string i)))
- (cons (car rfs)
- (split-string-and-unquote (substring string (cdr rfs))
- sep)))))))
-
-
-;;;; Replacement in strings.
-
-(defun subst-char-in-string (fromchar tochar string &optional inplace)
- "Replace FROMCHAR with TOCHAR in STRING each time it occurs.
-Unless optional argument INPLACE is non-nil, return a new string."
- (let ((i (length string))
- (newstr (if inplace string (copy-sequence string))))
- (while (> i 0)
- (setq i (1- i))
- (if (eq (aref newstr i) fromchar)
- (aset newstr i tochar)))
- newstr))
-
-(defun replace-regexp-in-string (regexp rep string &optional
- fixedcase literal subexp start)
- "Replace all matches for REGEXP with REP in STRING.
-
-Return a new string containing the replacements.
-
-Optional arguments FIXEDCASE, LITERAL and SUBEXP are like the
-arguments with the same names of function `replace-match'. If START
-is non-nil, start replacements at that index in STRING.
-
-REP is either a string used as the NEWTEXT arg of `replace-match' or a
-function. If it is a function, it is called with the actual text of each
-match, and its value is used as the replacement text. When REP is called,
-the match data are the result of matching REGEXP against a substring
-of STRING.
-
-To replace only the first match (if any), make REGEXP match up to \\'
-and replace a sub-expression, e.g.
- (replace-regexp-in-string \"\\\\(foo\\\\).*\\\\'\" \"bar\" \" foo foo\" nil nil 1)
- => \" bar foo\""
-
- ;; To avoid excessive consing from multiple matches in long strings,
- ;; don't just call `replace-match' continually. Walk down the
- ;; string looking for matches of REGEXP and building up a (reversed)
- ;; list MATCHES. This comprises segments of STRING which weren't
- ;; matched interspersed with replacements for segments that were.
- ;; [For a `large' number of replacements it's more efficient to
- ;; operate in a temporary buffer; we can't tell from the function's
- ;; args whether to choose the buffer-based implementation, though it
- ;; might be reasonable to do so for long enough STRING.]
- (let ((l (length string))
- (start (or start 0))
- matches str mb me)
- (save-match-data
- (while (and (< start l) (string-match regexp string start))
- (setq mb (match-beginning 0)
- me (match-end 0))
- ;; If we matched the empty string, make sure we advance by one char
- (when (= me mb) (setq me (min l (1+ mb))))
- ;; Generate a replacement for the matched substring.
- ;; Operate only on the substring to minimize string consing.
- ;; Set up match data for the substring for replacement;
- ;; presumably this is likely to be faster than munging the
- ;; match data directly in Lisp.
- (string-match regexp (setq str (substring string mb me)))
- (setq matches
- (cons (replace-match (if (stringp rep)
- rep
- (funcall rep (match-string 0 str)))
- fixedcase literal str subexp)
- (cons (substring string start mb) ; unmatched prefix
- matches)))
- (setq start me))
- ;; Reconstruct a string from the pieces.
- (setq matches (cons (substring string start l) matches)) ; leftover
- (apply #'concat (nreverse matches)))))
-
-(defun string-prefix-p (prefix string &optional ignore-case)
- "Return non-nil if PREFIX is a prefix of STRING.
-If IGNORE-CASE is non-nil, the comparison is done without paying attention
-to case differences."
- (let ((prefix-length (length prefix)))
- (if (> prefix-length (length string)) nil
- (eq t (compare-strings prefix 0 prefix-length string
- 0 prefix-length ignore-case)))))
-
-(defun string-suffix-p (suffix string &optional ignore-case)
- "Return non-nil if SUFFIX is a suffix of STRING.
-If IGNORE-CASE is non-nil, the comparison is done without paying
-attention to case differences."
- (let ((start-pos (- (length string) (length suffix))))
- (and (>= start-pos 0)
- (eq t (compare-strings suffix nil nil
- string start-pos nil ignore-case)))))
-
-(defun bidi-string-mark-left-to-right (str)
- "Return a string that can be safely inserted in left-to-right text.
-
-Normally, inserting a string with right-to-left (RTL) script into
-a buffer may cause some subsequent text to be displayed as part
-of the RTL segment (usually this affects punctuation characters).
-This function returns a string which displays as STR but forces
-subsequent text to be displayed as left-to-right.
-
-If STR contains any RTL character, this function returns a string
-consisting of STR followed by an invisible left-to-right mark
-\(LRM) character. Otherwise, it returns STR."
- (unless (stringp str)
- (signal 'wrong-type-argument (list 'stringp str)))
- (if (string-match "\\cR" str)
- (concat str (propertize (string ?\x200e) 'invisible t))
- str))
-
-;;;; Specifying things to do later.
-
-(defun load-history-regexp (file)
- "Form a regexp to find FILE in `load-history'.
-FILE, a string, is described in the function `eval-after-load'."
- (if (file-name-absolute-p file)
- (setq file (file-truename file)))
- (concat (if (file-name-absolute-p file) "\\`" "\\(\\`\\|/\\)")
- (regexp-quote file)
- (if (file-name-extension file)
- ""
- ;; Note: regexp-opt can't be used here, since we need to call
- ;; this before Emacs has been fully started. 2006-05-21
- (concat "\\(" (mapconcat 'regexp-quote load-suffixes "\\|") "\\)?"))
- "\\(" (mapconcat 'regexp-quote jka-compr-load-suffixes "\\|")
- "\\)?\\'"))
-
-(defun load-history-filename-element (file-regexp)
- "Get the first elt of `load-history' whose car matches FILE-REGEXP.
-Return nil if there isn't one."
- (let* ((loads load-history)
- (load-elt (and loads (car loads))))
- (save-match-data
- (while (and loads
- (or (null (car load-elt))
- (not (string-match file-regexp (car load-elt)))))
- (setq loads (cdr loads)
- load-elt (and loads (car loads)))))
- load-elt))
-
-(put 'eval-after-load 'lisp-indent-function 1)
-(defun eval-after-load (file form)
- "Arrange that if FILE is loaded, FORM will be run immediately afterwards.
-If FILE is already loaded, evaluate FORM right now.
-FORM can be an Elisp expression (in which case it's passed to `eval'),
-or a function (in which case it's passed to `funcall' with no argument).
-
-If a matching file is loaded again, FORM will be evaluated again.
-
-If FILE is a string, it may be either an absolute or a relative file
-name, and may have an extension (e.g. \".el\") or may lack one, and
-additionally may or may not have an extension denoting a compressed
-format (e.g. \".gz\").
-
-When FILE is absolute, this first converts it to a true name by chasing
-symbolic links. Only a file of this name (see next paragraph regarding
-extensions) will trigger the evaluation of FORM. When FILE is relative,
-a file whose absolute true name ends in FILE will trigger evaluation.
-
-When FILE lacks an extension, a file name with any extension will trigger
-evaluation. Otherwise, its extension must match FILE's. A further
-extension for a compressed format (e.g. \".gz\") on FILE will not affect
-this name matching.
-
-Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM
-is evaluated at the end of any file that `provide's this feature.
-If the feature is provided when evaluating code not associated with a
-file, FORM is evaluated immediately after the provide statement.
-
-Usually FILE is just a library name like \"font-lock\" or a feature name
-like 'font-lock.
-
-This function makes or adds to an entry on `after-load-alist'."
- (declare (compiler-macro
- (lambda (whole)
- (if (eq 'quote (car-safe form))
- ;; Quote with lambda so the compiler can look inside.
- `(eval-after-load ,file (lambda () ,(nth 1 form)))
- whole))))
- ;; Add this FORM into after-load-alist (regardless of whether we'll be
- ;; evaluating it now).
- (let* ((regexp-or-feature
- (if (stringp file)
- (setq file (purecopy (load-history-regexp file)))
- file))
- (elt (assoc regexp-or-feature after-load-alist))
- (func
- (if (functionp form) form
- ;; Try to use the "current" lexical/dynamic mode for `form'.
- (eval `(lambda () ,form) lexical-binding))))
- (unless elt
- (setq elt (list regexp-or-feature))
- (push elt after-load-alist))
- ;; Is there an already loaded file whose name (or `provide' name)
- ;; matches FILE?
- (prog1 (if (if (stringp file)
- (load-history-filename-element regexp-or-feature)
- (featurep file))
- (funcall func))
- (let ((delayed-func
- (if (not (symbolp regexp-or-feature)) func
- ;; For features, the after-load-alist elements get run when
- ;; `provide' is called rather than at the end of the file.
- ;; So add an indirection to make sure that `func' is really run
- ;; "after-load" in case the provide call happens early.
- (lambda ()
- (if (not load-file-name)
- ;; Not being provided from a file, run func right now.
- (funcall func)
- (let ((lfn load-file-name)
- ;; Don't use letrec, because equal (in
- ;; add/remove-hook) would get trapped in a cycle.
- (fun (make-symbol "eval-after-load-helper")))
- (fset fun (lambda (file)
- (when (equal file lfn)
- (remove-hook 'after-load-functions fun)
- (funcall func))))
- (add-hook 'after-load-functions fun 'append)))))))
- ;; Add FORM to the element unless it's already there.
- (unless (member delayed-func (cdr elt))
- (nconc elt (list delayed-func)))))))
-
-(defmacro with-eval-after-load (file &rest body)
- "Execute BODY after FILE is loaded.
-FILE is normally a feature name, but it can also be a file name,
-in case that file does not provide any feature."
- (declare (indent 1) (debug t))
- `(eval-after-load ,file (lambda () ,@body)))
-
-(defvar after-load-functions nil
- "Special hook run after loading a file.
-Each function there is called with a single argument, the absolute
-name of the file just loaded.")
-
-(defun do-after-load-evaluation (abs-file)
- "Evaluate all `eval-after-load' forms, if any, for ABS-FILE.
-ABS-FILE, a string, should be the absolute true name of a file just loaded.
-This function is called directly from the C code."
- ;; Run the relevant eval-after-load forms.
- (dolist (a-l-element after-load-alist)
- (when (and (stringp (car a-l-element))
- (string-match-p (car a-l-element) abs-file))
- ;; discard the file name regexp
- (mapc #'funcall (cdr a-l-element))))
- ;; Complain when the user uses obsolete files.
- (when (save-match-data
- (and (string-match "/obsolete/\\([^/]*\\)\\'" abs-file)
- (not (equal "loaddefs.el" (match-string 1 abs-file)))))
- ;; Maybe we should just use display-warning? This seems yucky...
- (let* ((file (file-name-nondirectory abs-file))
- (msg (format "Package %s is obsolete!"
- (substring file 0
- (string-match "\\.elc?\\>" file)))))
- ;; Cribbed from cl--compiling-file.
- (if (and (boundp 'byte-compile--outbuffer)
- (bufferp (symbol-value 'byte-compile--outbuffer))
- (equal (buffer-name (symbol-value 'byte-compile--outbuffer))
- " *Compiler Output*"))
- ;; Don't warn about obsolete files using other obsolete files.
- (unless (and (stringp byte-compile-current-file)
- (string-match-p "/obsolete/[^/]*\\'"
- (expand-file-name
- byte-compile-current-file
- byte-compile-root-dir)))
- (byte-compile-log-warning msg))
- (run-with-timer 0 nil
- (lambda (msg)
- (message "%s" msg))
- msg))))
-
- ;; Finally, run any other hook.
- (run-hook-with-args 'after-load-functions abs-file))
-
-(defun eval-next-after-load (file)
- "Read the following input sexp, and run it whenever FILE is loaded.
-This makes or adds to an entry on `after-load-alist'.
-FILE should be the name of a library, with no directory name."
- (declare (obsolete eval-after-load "23.2"))
- (eval-after-load file (read)))
-
-
-(defun display-delayed-warnings ()
- "Display delayed warnings from `delayed-warnings-list'.
-Used from `delayed-warnings-hook' (which see)."
- (dolist (warning (nreverse delayed-warnings-list))
- (apply 'display-warning warning))
- (setq delayed-warnings-list nil))
-
-(defun collapse-delayed-warnings ()
- "Remove duplicates from `delayed-warnings-list'.
-Collapse identical adjacent warnings into one (plus count).
-Used from `delayed-warnings-hook' (which see)."
- (let ((count 1)
- collapsed warning)
- (while delayed-warnings-list
- (setq warning (pop delayed-warnings-list))
- (if (equal warning (car delayed-warnings-list))
- (setq count (1+ count))
- (when (> count 1)
- (setcdr warning (cons (format "%s [%d times]" (cadr warning) count)
- (cddr warning)))
- (setq count 1))
- (push warning collapsed)))
- (setq delayed-warnings-list (nreverse collapsed))))
-
-;; At present this is only used for Emacs internals.
-;; Ref http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00085.html
-(defvar delayed-warnings-hook '(collapse-delayed-warnings
- display-delayed-warnings)
- "Normal hook run to process and display delayed warnings.
-By default, this hook contains functions to consolidate the
-warnings listed in `delayed-warnings-list', display them, and set
-`delayed-warnings-list' back to nil.")
-
-(defun delay-warning (type message &optional level buffer-name)
- "Display a delayed warning.
-Aside from going through `delayed-warnings-list', this is equivalent
-to `display-warning'."
- (push (list type message level buffer-name) delayed-warnings-list))
-
-
-;;;; invisibility specs
-
-(defun add-to-invisibility-spec (element)
- "Add ELEMENT to `buffer-invisibility-spec'.
-See documentation for `buffer-invisibility-spec' for the kind of elements
-that can be added."
- (if (eq buffer-invisibility-spec t)
- (setq buffer-invisibility-spec (list t)))
- (setq buffer-invisibility-spec
- (cons element buffer-invisibility-spec)))
-
-(defun remove-from-invisibility-spec (element)
- "Remove ELEMENT from `buffer-invisibility-spec'."
- (if (consp buffer-invisibility-spec)
- (setq buffer-invisibility-spec
- (delete element buffer-invisibility-spec))))
-
-;;;; Syntax tables.
-
-(defmacro with-syntax-table (table &rest body)
- "Evaluate BODY with syntax table of current buffer set to TABLE.
-The syntax table of the current buffer is saved, BODY is evaluated, and the
-saved table is restored, even in case of an abnormal exit.
-Value is what BODY returns."
- (declare (debug t) (indent 1))
- (let ((old-table (make-symbol "table"))
- (old-buffer (make-symbol "buffer")))
- `(let ((,old-table (syntax-table))
- (,old-buffer (current-buffer)))
- (unwind-protect
- (progn
- (set-syntax-table ,table)
- ,@body)
- (save-current-buffer
- (set-buffer ,old-buffer)
- (set-syntax-table ,old-table))))))
-
-(defun make-syntax-table (&optional oldtable)
- "Return a new syntax table.
-Create a syntax table which inherits from OLDTABLE (if non-nil) or
-from `standard-syntax-table' otherwise."
- (let ((table (make-char-table 'syntax-table nil)))
- (set-char-table-parent table (or oldtable (standard-syntax-table)))
- table))
-
-(defun syntax-after (pos)
- "Return the raw syntax descriptor for the char after POS.
-If POS is outside the buffer's accessible portion, return nil."
- (unless (or (< pos (point-min)) (>= pos (point-max)))
- (let ((st (if parse-sexp-lookup-properties
- (get-char-property pos 'syntax-table))))
- (if (consp st) st
- (aref (or st (syntax-table)) (char-after pos))))))
-
-(defun syntax-class (syntax)
- "Return the code for the syntax class described by SYNTAX.
-
-SYNTAX should be a raw syntax descriptor; the return value is a
-integer which encodes the corresponding syntax class. See Info
-node `(elisp)Syntax Table Internals' for a list of codes.
-
-If SYNTAX is nil, return nil."
- (and syntax (logand (car syntax) 65535)))
-
-;; Utility motion commands
-
-;; Whitespace
-
-(defun forward-whitespace (arg)
- "Move point to the end of the next sequence of whitespace chars.
-Each such sequence may be a single newline, or a sequence of
-consecutive space and/or tab characters.
-With prefix argument ARG, do it ARG times if positive, or move
-backwards ARG times if negative."
- (interactive "^p")
- (if (natnump arg)
- (re-search-forward "[ \t]+\\|\n" nil 'move arg)
- (while (< arg 0)
- (if (re-search-backward "[ \t]+\\|\n" nil 'move)
- (or (eq (char-after (match-beginning 0)) ?\n)
- (skip-chars-backward " \t")))
- (setq arg (1+ arg)))))
-
-;; Symbols
-
-(defun forward-symbol (arg)
- "Move point to the next position that is the end of a symbol.
-A symbol is any sequence of characters that are in either the
-word constituent or symbol constituent syntax class.
-With prefix argument ARG, do it ARG times if positive, or move
-backwards ARG times if negative."
- (interactive "^p")
- (if (natnump arg)
- (re-search-forward "\\(\\sw\\|\\s_\\)+" nil 'move arg)
- (while (< arg 0)
- (if (re-search-backward "\\(\\sw\\|\\s_\\)+" nil 'move)
- (skip-syntax-backward "w_"))
- (setq arg (1+ arg)))))
-
-;; Syntax blocks
-
-(defun forward-same-syntax (&optional arg)
- "Move point past all characters with the same syntax class.
-With prefix argument ARG, do it ARG times if positive, or move
-backwards ARG times if negative."
- (interactive "^p")
- (or arg (setq arg 1))
- (while (< arg 0)
- (skip-syntax-backward
- (char-to-string (char-syntax (char-before))))
- (setq arg (1+ arg)))
- (while (> arg 0)
- (skip-syntax-forward (char-to-string (char-syntax (char-after))))
- (setq arg (1- arg))))
-
-
-;;;; Text clones
-
-(defvar text-clone--maintaining nil)
-
-(defun text-clone--maintain (ol1 after beg end &optional _len)
- "Propagate the changes made under the overlay OL1 to the other clones.
-This is used on the `modification-hooks' property of text clones."
- (when (and after (not undo-in-progress)
- (not text-clone--maintaining)
- (overlay-start ol1))
- (let ((margin (if (overlay-get ol1 'text-clone-spreadp) 1 0)))
- (setq beg (max beg (+ (overlay-start ol1) margin)))
- (setq end (min end (- (overlay-end ol1) margin)))
- (when (<= beg end)
- (save-excursion
- (when (overlay-get ol1 'text-clone-syntax)
- ;; Check content of the clone's text.
- (let ((cbeg (+ (overlay-start ol1) margin))
- (cend (- (overlay-end ol1) margin)))
- (goto-char cbeg)
- (save-match-data
- (if (not (re-search-forward
- (overlay-get ol1 'text-clone-syntax) cend t))
- ;; Mark the overlay for deletion.
- (setq end cbeg)
- (when (< (match-end 0) cend)
- ;; Shrink the clone at its end.
- (setq end (min end (match-end 0)))
- (move-overlay ol1 (overlay-start ol1)
- (+ (match-end 0) margin)))
- (when (> (match-beginning 0) cbeg)
- ;; Shrink the clone at its beginning.
- (setq beg (max (match-beginning 0) beg))
- (move-overlay ol1 (- (match-beginning 0) margin)
- (overlay-end ol1)))))))
- ;; Now go ahead and update the clones.
- (let ((head (- beg (overlay-start ol1)))
- (tail (- (overlay-end ol1) end))
- (str (buffer-substring beg end))
- (nothing-left t)
- (text-clone--maintaining t))
- (dolist (ol2 (overlay-get ol1 'text-clones))
- (let ((oe (overlay-end ol2)))
- (unless (or (eq ol1 ol2) (null oe))
- (setq nothing-left nil)
- (let ((mod-beg (+ (overlay-start ol2) head)))
- ;;(overlay-put ol2 'modification-hooks nil)
- (goto-char (- (overlay-end ol2) tail))
- (unless (> mod-beg (point))
- (save-excursion (insert str))
- (delete-region mod-beg (point)))
- ;;(overlay-put ol2 'modification-hooks '(text-clone--maintain))
- ))))
- (if nothing-left (delete-overlay ol1))))))))
-
-(defun text-clone-create (start end &optional spreadp syntax)
- "Create a text clone of START...END at point.
-Text clones are chunks of text that are automatically kept identical:
-changes done to one of the clones will be immediately propagated to the other.
-
-The buffer's content at point is assumed to be already identical to
-the one between START and END.
-If SYNTAX is provided it's a regexp that describes the possible text of
-the clones; the clone will be shrunk or killed if necessary to ensure that
-its text matches the regexp.
-If SPREADP is non-nil it indicates that text inserted before/after the
-clone should be incorporated in the clone."
- ;; To deal with SPREADP we can either use an overlay with `nil t' along
- ;; with insert-(behind|in-front-of)-hooks or use a slightly larger overlay
- ;; (with a one-char margin at each end) with `t nil'.
- ;; We opted for a larger overlay because it behaves better in the case
- ;; where the clone is reduced to the empty string (we want the overlay to
- ;; stay when the clone's content is the empty string and we want to use
- ;; `evaporate' to make sure those overlays get deleted when needed).
- ;;
- (let* ((pt-end (+ (point) (- end start)))
- (start-margin (if (or (not spreadp) (bobp) (<= start (point-min)))
- 0 1))
- (end-margin (if (or (not spreadp)
- (>= pt-end (point-max))
- (>= start (point-max)))
- 0 1))
- ;; FIXME: Reuse overlays at point to extend dups!
- (ol1 (make-overlay (- start start-margin) (+ end end-margin) nil t))
- (ol2 (make-overlay (- (point) start-margin) (+ pt-end end-margin) nil t))
- (dups (list ol1 ol2)))
- (overlay-put ol1 'modification-hooks '(text-clone--maintain))
- (when spreadp (overlay-put ol1 'text-clone-spreadp t))
- (when syntax (overlay-put ol1 'text-clone-syntax syntax))
- ;;(overlay-put ol1 'face 'underline)
- (overlay-put ol1 'evaporate t)
- (overlay-put ol1 'text-clones dups)
- ;;
- (overlay-put ol2 'modification-hooks '(text-clone--maintain))
- (when spreadp (overlay-put ol2 'text-clone-spreadp t))
- (when syntax (overlay-put ol2 'text-clone-syntax syntax))
- ;;(overlay-put ol2 'face 'underline)
- (overlay-put ol2 'evaporate t)
- (overlay-put ol2 'text-clones dups)))
-
-;;;; Mail user agents.
-
-;; Here we include just enough for other packages to be able
-;; to define them.
-
-(defun define-mail-user-agent (symbol composefunc sendfunc
- &optional abortfunc hookvar)
- "Define a symbol to identify a mail-sending package for `mail-user-agent'.
-
-SYMBOL can be any Lisp symbol. Its function definition and/or
-value as a variable do not matter for this usage; we use only certain
-properties on its property list, to encode the rest of the arguments.
-
-COMPOSEFUNC is program callable function that composes an outgoing
-mail message buffer. This function should set up the basics of the
-buffer without requiring user interaction. It should populate the
-standard mail headers, leaving the `to:' and `subject:' headers blank
-by default.
-
-COMPOSEFUNC should accept several optional arguments--the same
-arguments that `compose-mail' takes. See that function's documentation.
-
-SENDFUNC is the command a user would run to send the message.
-
-Optional ABORTFUNC is the command a user would run to abort the
-message. For mail packages that don't have a separate abort function,
-this can be `kill-buffer' (the equivalent of omitting this argument).
-
-Optional HOOKVAR is a hook variable that gets run before the message
-is actually sent. Callers that use the `mail-user-agent' may
-install a hook function temporarily on this hook variable.
-If HOOKVAR is nil, `mail-send-hook' is used.
-
-The properties used on SYMBOL are `composefunc', `sendfunc',
-`abortfunc', and `hookvar'."
- (put symbol 'composefunc composefunc)
- (put symbol 'sendfunc sendfunc)
- (put symbol 'abortfunc (or abortfunc 'kill-buffer))
- (put symbol 'hookvar (or hookvar 'mail-send-hook)))
-
-(defvar called-interactively-p-functions nil
- "Special hook called to skip special frames in `called-interactively-p'.
-The functions are called with 3 arguments: (I FRAME1 FRAME2),
-where FRAME1 is a \"current frame\", FRAME2 is the next frame,
-I is the index of the frame after FRAME2. It should return nil
-if those frames don't seem special and otherwise, it should return
-the number of frames to skip (minus 1).")
-
-(defconst internal--funcall-interactively
- (symbol-function 'funcall-interactively))
-
-(defun called-interactively-p (&optional kind)
- "Return t if the containing function was called by `call-interactively'.
-If KIND is `interactive', then only return t if the call was made
-interactively by the user, i.e. not in `noninteractive' mode nor
-when `executing-kbd-macro'.
-If KIND is `any', on the other hand, it will return t for any kind of
-interactive call, including being called as the binding of a key or
-from a keyboard macro, even in `noninteractive' mode.
-
-This function is very brittle, it may fail to return the intended result when
-the code is debugged, advised, or instrumented in some form. Some macros and
-special forms (such as `condition-case') may also sometimes wrap their bodies
-in a `lambda', so any call to `called-interactively-p' from those bodies will
-indicate whether that lambda (rather than the surrounding function) was called
-interactively.
-
-Instead of using this function, it is cleaner and more reliable to give your
-function an extra optional argument whose `interactive' spec specifies
-non-nil unconditionally (\"p\" is a good way to do this), or via
-\(not (or executing-kbd-macro noninteractive)).
-
-The only known proper use of `interactive' for KIND is in deciding
-whether to display a helpful message, or how to display it. If you're
-thinking of using it for any other purpose, it is quite likely that
-you're making a mistake. Think: what do you want to do when the
-command is called from a keyboard macro?"
- (declare (advertised-calling-convention (kind) "23.1"))
- (when (not (and (eq kind 'interactive)
- (or executing-kbd-macro noninteractive)))
- (let* ((i 1) ;; 0 is the called-interactively-p frame.
- frame nextframe
- (get-next-frame
- (lambda ()
- (setq frame nextframe)
- (setq nextframe (backtrace-frame i 'called-interactively-p))
- ;; (message "Frame %d = %S" i nextframe)
- (setq i (1+ i)))))
- (funcall get-next-frame) ;; Get the first frame.
- (while
- ;; FIXME: The edebug and advice handling should be made modular and
- ;; provided directly by edebug.el and nadvice.el.
- (progn
- ;; frame =(backtrace-frame i-2)
- ;; nextframe=(backtrace-frame i-1)
- (funcall get-next-frame)
- ;; `pcase' would be a fairly good fit here, but it sometimes moves
- ;; branches within local functions, which then messes up the
- ;; `backtrace-frame' data we get,
- (or
- ;; Skip special forms (from non-compiled code).
- (and frame (null (car frame)))
- ;; Skip also `interactive-p' (because we don't want to know if
- ;; interactive-p was called interactively but if it's caller was)
- ;; and `byte-code' (idem; this appears in subexpressions of things
- ;; like condition-case, which are wrapped in a separate bytecode
- ;; chunk).
- ;; FIXME: For lexical-binding code, this is much worse,
- ;; because the frames look like "byte-code -> funcall -> #[...]",
- ;; which is not a reliable signature.
- (memq (nth 1 frame) '(interactive-p 'byte-code))
- ;; Skip package-specific stack-frames.
- (let ((skip (run-hook-with-args-until-success
- 'called-interactively-p-functions
- i frame nextframe)))
- (pcase skip
- (`nil nil)
- (`0 t)
- (_ (setq i (+ i skip -1)) (funcall get-next-frame)))))))
- ;; Now `frame' should be "the function from which we were called".
- (pcase (cons frame nextframe)
- ;; No subr calls `interactive-p', so we can rule that out.
- (`((,_ ,(pred (lambda (f) (subrp (indirect-function f)))) . ,_) . ,_) nil)
- ;; In case #<subr funcall-interactively> without going through the
- ;; `funcall-interactively' symbol (bug#3984).
- (`(,_ . (t ,(pred (lambda (f)
- (eq internal--funcall-interactively
- (indirect-function f))))
- . ,_))
- t)))))
-
-(defun interactive-p ()
- "Return t if the containing function was run directly by user input.
-This means that the function was called with `call-interactively'
-\(which includes being called as the binding of a key)
-and input is currently coming from the keyboard (not a keyboard macro),
-and Emacs is not running in batch mode (`noninteractive' is nil).
-
-The only known proper use of `interactive-p' is in deciding whether to
-display a helpful message, or how to display it. If you're thinking
-of using it for any other purpose, it is quite likely that you're
-making a mistake. Think: what do you want to do when the command is
-called from a keyboard macro or in batch mode?
-
-To test whether your function was called with `call-interactively',
-either (i) add an extra optional argument and give it an `interactive'
-spec that specifies non-nil unconditionally (such as \"p\"); or (ii)
-use `called-interactively-p'."
- (declare (obsolete called-interactively-p "23.2"))
- (called-interactively-p 'interactive))
-
-(defun internal-push-keymap (keymap symbol)
- (let ((map (symbol-value symbol)))
- (unless (memq keymap map)
- (unless (memq 'add-keymap-witness (symbol-value symbol))
- (setq map (make-composed-keymap nil (symbol-value symbol)))
- (push 'add-keymap-witness (cdr map))
- (set symbol map))
- (push keymap (cdr map)))))
-
-(defun internal-pop-keymap (keymap symbol)
- (let ((map (symbol-value symbol)))
- (when (memq keymap map)
- (setf (cdr map) (delq keymap (cdr map))))
- (let ((tail (cddr map)))
- (and (or (null tail) (keymapp tail))
- (eq 'add-keymap-witness (nth 1 map))
- (set symbol tail)))))
-
-(define-obsolete-function-alias
- 'set-temporary-overlay-map 'set-transient-map "24.4")
-
-(defun set-transient-map (map &optional keep-pred on-exit)
- "Set MAP as a temporary keymap taking precedence over other keymaps.
-Normally, MAP is used only once, to look up the very next key.
-However, if the optional argument KEEP-PRED is t, MAP stays
-active if a key from MAP is used. KEEP-PRED can also be a
-function of no arguments: it is called from `pre-command-hook' and
-if it returns non-nil, then MAP stays active.
-
-Optional arg ON-EXIT, if non-nil, specifies a function that is
-called, with no arguments, after MAP is deactivated.
-
-This uses `overriding-terminal-local-map' which takes precedence over all other
-keymaps. As usual, if no match for a key is found in MAP, the normal key
-lookup sequence then continues.
-
-This returns an \"exit function\", which can be called with no argument
-to deactivate this transient map, regardless of KEEP-PRED."
- (let* ((clearfun (make-symbol "clear-transient-map"))
- (exitfun
- (lambda ()
- (internal-pop-keymap map 'overriding-terminal-local-map)
- (remove-hook 'pre-command-hook clearfun)
- (when on-exit (funcall on-exit)))))
- ;; Don't use letrec, because equal (in add/remove-hook) would get trapped
- ;; in a cycle.
- (fset clearfun
- (lambda ()
- (with-demoted-errors "set-transient-map PCH: %S"
- (unless (cond
- ((null keep-pred) nil)
- ((not (eq map (cadr overriding-terminal-local-map)))
- ;; There's presumably some other transient-map in
- ;; effect. Wait for that one to terminate before we
- ;; remove ourselves.
- ;; For example, if isearch and C-u both use transient
- ;; maps, then the lifetime of the C-u should be nested
- ;; within isearch's, so the pre-command-hook of
- ;; isearch should be suspended during the C-u one so
- ;; we don't exit isearch just because we hit 1 after
- ;; C-u and that 1 exits isearch whereas it doesn't
- ;; exit C-u.
- t)
- ((eq t keep-pred)
- (eq this-command
- (lookup-key map (this-command-keys-vector))))
- (t (funcall keep-pred)))
- (funcall exitfun)))))
- (add-hook 'pre-command-hook clearfun)
- (internal-push-keymap map 'overriding-terminal-local-map)
- exitfun))
-
-;;;; Progress reporters.
-
-;; Progress reporter has the following structure:
-;;
-;; (NEXT-UPDATE-VALUE . [NEXT-UPDATE-TIME
-;; MIN-VALUE
-;; MAX-VALUE
-;; MESSAGE
-;; MIN-CHANGE
-;; MIN-TIME])
-;;
-;; This weirdness is for optimization reasons: we want
-;; `progress-reporter-update' to be as fast as possible, so
-;; `(car reporter)' is better than `(aref reporter 0)'.
-;;
-;; NEXT-UPDATE-TIME is a float. While `float-time' loses a couple
-;; digits of precision, it doesn't really matter here. On the other
-;; hand, it greatly simplifies the code.
-
-(defsubst progress-reporter-update (reporter &optional value)
- "Report progress of an operation in the echo area.
-REPORTER should be the result of a call to `make-progress-reporter'.
-
-If REPORTER is a numerical progress reporter---i.e. if it was
- made using non-nil MIN-VALUE and MAX-VALUE arguments to
- `make-progress-reporter'---then VALUE should be a number between
- MIN-VALUE and MAX-VALUE.
-
-If REPORTER is a non-numerical reporter, VALUE should be nil.
-
-This function is relatively inexpensive. If the change since
-last update is too small or insufficient time has passed, it does
-nothing."
- (when (or (not (numberp value)) ; For pulsing reporter
- (>= value (car reporter))) ; For numerical reporter
- (progress-reporter-do-update reporter value)))
-
-(defun make-progress-reporter (message &optional min-value max-value
- current-value min-change min-time)
- "Return progress reporter object for use with `progress-reporter-update'.
-
-MESSAGE is shown in the echo area, with a status indicator
-appended to the end. When you call `progress-reporter-done', the
-word \"done\" is printed after the MESSAGE. You can change the
-MESSAGE of an existing progress reporter by calling
-`progress-reporter-force-update'.
-
-MIN-VALUE and MAX-VALUE, if non-nil, are starting (0% complete)
-and final (100% complete) states of operation; the latter should
-be larger. In this case, the status message shows the percentage
-progress.
-
-If MIN-VALUE and/or MAX-VALUE is omitted or nil, the status
-message shows a \"spinning\", non-numeric indicator.
-
-Optional CURRENT-VALUE is the initial progress; the default is
-MIN-VALUE.
-Optional MIN-CHANGE is the minimal change in percents to report;
-the default is 1%.
-CURRENT-VALUE and MIN-CHANGE do not have any effect if MIN-VALUE
-and/or MAX-VALUE are nil.
-
-Optional MIN-TIME specifies the minimum interval time between
-echo area updates (default is 0.2 seconds.) If the function
-`float-time' is not present, time is not tracked at all. If the
-OS is not capable of measuring fractions of seconds, this
-parameter is effectively rounded up."
- (when (string-match "[[:alnum:]]\\'" message)
- (setq message (concat message "...")))
- (unless min-time
- (setq min-time 0.2))
- (let ((reporter
- ;; Force a call to `message' now
- (cons (or min-value 0)
- (vector (if (and (fboundp 'float-time)
- (>= min-time 0.02))
- (float-time) nil)
- min-value
- max-value
- message
- (if min-change (max (min min-change 50) 1) 1)
- min-time))))
- (progress-reporter-update reporter (or current-value min-value))
- reporter))
-
-(defun progress-reporter-force-update (reporter &optional value new-message)
- "Report progress of an operation in the echo area unconditionally.
-
-The first two arguments are the same as in `progress-reporter-update'.
-NEW-MESSAGE, if non-nil, sets a new message for the reporter."
- (let ((parameters (cdr reporter)))
- (when new-message
- (aset parameters 3 new-message))
- (when (aref parameters 0)
- (aset parameters 0 (float-time)))
- (progress-reporter-do-update reporter value)))
-
-(defvar progress-reporter--pulse-characters ["-" "\\" "|" "/"]
- "Characters to use for pulsing progress reporters.")
-
-(defun progress-reporter-do-update (reporter value)
- (let* ((parameters (cdr reporter))
- (update-time (aref parameters 0))
- (min-value (aref parameters 1))
- (max-value (aref parameters 2))
- (text (aref parameters 3))
- (enough-time-passed
- ;; See if enough time has passed since the last update.
- (or (not update-time)
- (when (>= (float-time) update-time)
- ;; Calculate time for the next update
- (aset parameters 0 (+ update-time (aref parameters 5)))))))
- (cond ((and min-value max-value)
- ;; Numerical indicator
- (let* ((one-percent (/ (- max-value min-value) 100.0))
- (percentage (if (= max-value min-value)
- 0
- (truncate (/ (- value min-value)
- one-percent)))))
- ;; Calculate NEXT-UPDATE-VALUE. If we are not printing
- ;; message because not enough time has passed, use 1
- ;; instead of MIN-CHANGE. This makes delays between echo
- ;; area updates closer to MIN-TIME.
- (setcar reporter
- (min (+ min-value (* (+ percentage
- (if enough-time-passed
- ;; MIN-CHANGE
- (aref parameters 4)
- 1))
- one-percent))
- max-value))
- (when (integerp value)
- (setcar reporter (ceiling (car reporter))))
- ;; Only print message if enough time has passed
- (when enough-time-passed
- (if (> percentage 0)
- (message "%s%d%%" text percentage)
- (message "%s" text)))))
- ;; Pulsing indicator
- (enough-time-passed
- (let ((index (mod (1+ (car reporter)) 4))
- (message-log-max nil))
- (setcar reporter index)
- (message "%s %s"
- text
- (aref progress-reporter--pulse-characters
- index)))))))
-
-(defun progress-reporter-done (reporter)
- "Print reporter's message followed by word \"done\" in echo area."
- (message "%sdone" (aref (cdr reporter) 3)))
-
-(defmacro dotimes-with-progress-reporter (spec message &rest body)
- "Loop a certain number of times and report progress in the echo area.
-Evaluate BODY with VAR bound to successive integers running from
-0, inclusive, to COUNT, exclusive. Then evaluate RESULT to get
-the return value (nil if RESULT is omitted).
-
-At each iteration MESSAGE followed by progress percentage is
-printed in the echo area. After the loop is finished, MESSAGE
-followed by word \"done\" is printed. This macro is a
-convenience wrapper around `make-progress-reporter' and friends.
-
-\(fn (VAR COUNT [RESULT]) MESSAGE BODY...)"
- (declare (indent 2) (debug ((symbolp form &optional form) form body)))
- (let ((temp (make-symbol "--dotimes-temp--"))
- (temp2 (make-symbol "--dotimes-temp2--"))
- (start 0)
- (end (nth 1 spec)))
- `(let ((,temp ,end)
- (,(car spec) ,start)
- (,temp2 (make-progress-reporter ,message ,start ,end)))
- (while (< ,(car spec) ,temp)
- ,@body
- (progress-reporter-update ,temp2
- (setq ,(car spec) (1+ ,(car spec)))))
- (progress-reporter-done ,temp2)
- nil ,@(cdr (cdr spec)))))
-
-
-;;;; Comparing version strings.
-
-(defconst version-separator "."
- "Specify the string used to separate the version elements.
-
-Usually the separator is \".\", but it can be any other string.")
-
-
-(defconst version-regexp-alist
- '(("^[-_+ ]?snapshot$" . -4)
- ;; treat "1.2.3-20050920" and "1.2-3" as snapshot releases
- ("^[-_+]$" . -4)
- ;; treat "1.2.3-CVS" as snapshot release
- ("^[-_+ ]?\\(cvs\\|git\\|bzr\\|svn\\|hg\\|darcs\\)$" . -4)
- ("^[-_+ ]?alpha$" . -3)
- ("^[-_+ ]?beta$" . -2)
- ("^[-_+ ]?\\(pre\\|rc\\)$" . -1))
- "Specify association between non-numeric version and its priority.
-
-This association is used to handle version string like \"1.0pre2\",
-\"0.9alpha1\", etc. It's used by `version-to-list' (which see) to convert the
-non-numeric part of a version string to an integer. For example:
-
- String Version Integer List Version
- \"0.9snapshot\" (0 9 -4)
- \"1.0-git\" (1 0 -4)
- \"1.0pre2\" (1 0 -1 2)
- \"1.0PRE2\" (1 0 -1 2)
- \"22.8beta3\" (22 8 -2 3)
- \"22.8 Beta3\" (22 8 -2 3)
- \"0.9alpha1\" (0 9 -3 1)
- \"0.9AlphA1\" (0 9 -3 1)
- \"0.9 alpha\" (0 9 -3)
-
-Each element has the following form:
-
- (REGEXP . PRIORITY)
-
-Where:
-
-REGEXP regexp used to match non-numeric part of a version string.
- It should begin with the `^' anchor and end with a `$' to
- prevent false hits. Letter-case is ignored while matching
- REGEXP.
-
-PRIORITY a negative integer specifying non-numeric priority of REGEXP.")
-
-
-(defun version-to-list (ver)
- "Convert version string VER into a list of integers.
-
-The version syntax is given by the following EBNF:
-
- VERSION ::= NUMBER ( SEPARATOR NUMBER )*.
-
- NUMBER ::= (0|1|2|3|4|5|6|7|8|9)+.
-
- SEPARATOR ::= `version-separator' (which see)
- | `version-regexp-alist' (which see).
-
-The NUMBER part is optional if SEPARATOR is a match for an element
-in `version-regexp-alist'.
-
-Examples of valid version syntax:
-
- 1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta
-
-Examples of invalid version syntax:
-
- 1.0prepre2 1.0..7.5 22.8X3 alpha3.2 .5
-
-Examples of version conversion:
-
- Version String Version as a List of Integers
- \"1.0.7.5\" (1 0 7 5)
- \"1.0pre2\" (1 0 -1 2)
- \"1.0PRE2\" (1 0 -1 2)
- \"22.8beta3\" (22 8 -2 3)
- \"22.8Beta3\" (22 8 -2 3)
- \"0.9alpha1\" (0 9 -3 1)
- \"0.9AlphA1\" (0 9 -3 1)
- \"0.9alpha\" (0 9 -3)
- \"0.9snapshot\" (0 9 -4)
- \"1.0-git\" (1 0 -4)
-
-See documentation for `version-separator' and `version-regexp-alist'."
- (or (and (stringp ver) (> (length ver) 0))
- (error "Invalid version string: '%s'" ver))
- ;; Change .x.y to 0.x.y
- (if (and (>= (length ver) (length version-separator))
- (string-equal (substring ver 0 (length version-separator))
- version-separator))
- (setq ver (concat "0" ver)))
- (save-match-data
- (let ((i 0)
- (case-fold-search t) ; ignore case in matching
- lst s al)
- (while (and (setq s (string-match "[0-9]+" ver i))
- (= s i))
- ;; handle numeric part
- (setq lst (cons (string-to-number (substring ver i (match-end 0)))
- lst)
- i (match-end 0))
- ;; handle non-numeric part
- (when (and (setq s (string-match "[^0-9]+" ver i))
- (= s i))
- (setq s (substring ver i (match-end 0))
- i (match-end 0))
- ;; handle alpha, beta, pre, etc. separator
- (unless (string= s version-separator)
- (setq al version-regexp-alist)
- (while (and al (not (string-match (caar al) s)))
- (setq al (cdr al)))
- (cond (al
- (push (cdar al) lst))
- ;; Convert 22.3a to 22.3.1, 22.3b to 22.3.2, etc.
- ((string-match "^[-_+ ]?\\([a-zA-Z]\\)$" s)
- (push (- (aref (downcase (match-string 1 s)) 0) ?a -1)
- lst))
- (t (error "Invalid version syntax: '%s'" ver))))))
- (if (null lst)
- (error "Invalid version syntax: '%s'" ver)
- (nreverse lst)))))
-
-
-(defun version-list-< (l1 l2)
- "Return t if L1, a list specification of a version, is lower than L2.
-
-Note that a version specified by the list (1) is equal to (1 0),
-\(1 0 0), (1 0 0 0), etc. That is, the trailing zeros are insignificant.
-Also, a version given by the list (1) is higher than (1 -1), which in
-turn is higher than (1 -2), which is higher than (1 -3)."
- (while (and l1 l2 (= (car l1) (car l2)))
- (setq l1 (cdr l1)
- l2 (cdr l2)))
- (cond
- ;; l1 not null and l2 not null
- ((and l1 l2) (< (car l1) (car l2)))
- ;; l1 null and l2 null ==> l1 length = l2 length
- ((and (null l1) (null l2)) nil)
- ;; l1 not null and l2 null ==> l1 length > l2 length
- (l1 (< (version-list-not-zero l1) 0))
- ;; l1 null and l2 not null ==> l2 length > l1 length
- (t (< 0 (version-list-not-zero l2)))))
-
-
-(defun version-list-= (l1 l2)
- "Return t if L1, a list specification of a version, is equal to L2.
-
-Note that a version specified by the list (1) is equal to (1 0),
-\(1 0 0), (1 0 0 0), etc. That is, the trailing zeros are insignificant.
-Also, a version given by the list (1) is higher than (1 -1), which in
-turn is higher than (1 -2), which is higher than (1 -3)."
- (while (and l1 l2 (= (car l1) (car l2)))
- (setq l1 (cdr l1)
- l2 (cdr l2)))
- (cond
- ;; l1 not null and l2 not null
- ((and l1 l2) nil)
- ;; l1 null and l2 null ==> l1 length = l2 length
- ((and (null l1) (null l2)))
- ;; l1 not null and l2 null ==> l1 length > l2 length
- (l1 (zerop (version-list-not-zero l1)))
- ;; l1 null and l2 not null ==> l2 length > l1 length
- (t (zerop (version-list-not-zero l2)))))
-
-
-(defun version-list-<= (l1 l2)
- "Return t if L1, a list specification of a version, is lower or equal to L2.
-
-Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0),
-etc. That is, the trailing zeroes are insignificant. Also, integer
-list (1) is greater than (1 -1) which is greater than (1 -2)
-which is greater than (1 -3)."
- (while (and l1 l2 (= (car l1) (car l2)))
- (setq l1 (cdr l1)
- l2 (cdr l2)))
- (cond
- ;; l1 not null and l2 not null
- ((and l1 l2) (< (car l1) (car l2)))
- ;; l1 null and l2 null ==> l1 length = l2 length
- ((and (null l1) (null l2)))
- ;; l1 not null and l2 null ==> l1 length > l2 length
- (l1 (<= (version-list-not-zero l1) 0))
- ;; l1 null and l2 not null ==> l2 length > l1 length
- (t (<= 0 (version-list-not-zero l2)))))
-
-(defun version-list-not-zero (lst)
- "Return the first non-zero element of LST, which is a list of integers.
-
-If all LST elements are zeros or LST is nil, return zero."
- (while (and lst (zerop (car lst)))
- (setq lst (cdr lst)))
- (if lst
- (car lst)
- ;; there is no element different of zero
- 0))
-
-
-(defun version< (v1 v2)
- "Return t if version V1 is lower (older) than V2.
-
-Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
-etc. That is, the trailing \".0\"s are insignificant. Also, version
-string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\",
-which is higher than \"1alpha\", which is higher than \"1snapshot\".
-Also, \"-GIT\", \"-CVS\" and \"-NNN\" are treated as snapshot versions."
- (version-list-< (version-to-list v1) (version-to-list v2)))
-
-(defun version<= (v1 v2)
- "Return t if version V1 is lower (older) than or equal to V2.
-
-Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
-etc. That is, the trailing \".0\"s are insignificant. Also, version
-string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\",
-which is higher than \"1alpha\", which is higher than \"1snapshot\".
-Also, \"-GIT\", \"-CVS\" and \"-NNN\" are treated as snapshot versions."
- (version-list-<= (version-to-list v1) (version-to-list v2)))
-
-(defun version= (v1 v2)
- "Return t if version V1 is equal to V2.
-
-Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
-etc. That is, the trailing \".0\"s are insignificant. Also, version
-string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\",
-which is higher than \"1alpha\", which is higher than \"1snapshot\".
-Also, \"-GIT\", \"-CVS\" and \"-NNN\" are treated as snapshot versions."
- (version-list-= (version-to-list v1) (version-to-list v2)))
-
-(defvar package--builtin-versions
- ;; Mostly populated by loaddefs.el via autoload-builtin-package-versions.
- (purecopy `((emacs . ,(version-to-list emacs-version))))
- "Alist giving the version of each versioned builtin package.
-I.e. each element of the list is of the form (NAME . VERSION) where
-NAME is the package name as a symbol, and VERSION is its version
-as a list.")
-
-(defun package--description-file (dir)
- (concat (let ((subdir (file-name-nondirectory
- (directory-file-name dir))))
- (if (string-match "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)" subdir)
- (match-string 1 subdir) subdir))
- "-pkg.el"))
-
-
-;;; Misc.
-(defconst menu-bar-separator '("--")
- "Separator for menus.")
-
-;; The following statement ought to be in print.c, but `provide' can't
-;; be used there.
-;; http://lists.gnu.org/archive/html/emacs-devel/2009-08/msg00236.html
-(when (hash-table-p (car (read-from-string
- (prin1-to-string (make-hash-table)))))
- (provide 'hashtable-print-readable))
-
-;; This is used in lisp/Makefile.in and in leim/Makefile.in to
-;; generate file names for autoloads, custom-deps, and finder-data.
-(defun unmsys--file-name (file)
- "Produce the canonical file name for FILE from its MSYS form.
-
-On systems other than MS-Windows, just returns FILE.
-On MS-Windows, converts /d/foo/bar form of file names
-passed by MSYS Make into d:/foo/bar that Emacs can grok.
-
-This function is called from lisp/Makefile and leim/Makefile."
- (when (and (eq system-type 'windows-nt)
- (string-match "\\`/[a-zA-Z]/" file))
- (setq file (concat (substring file 1 2) ":" (substring file 2))))
- file)
-
-
-;;; subr.el ends here
diff --git a/tests/examplefiles/swig_java.swg b/tests/examplefiles/swig_java.swg
deleted file mode 100644
index 6126a55e..00000000
--- a/tests/examplefiles/swig_java.swg
+++ /dev/null
@@ -1,1329 +0,0 @@
-/* -----------------------------------------------------------------------------
- * java.swg
- *
- * Java typemaps
- * ----------------------------------------------------------------------------- */
-
-%include <javahead.swg>
-
-/* The jni, jtype and jstype typemaps work together and so there should be one of each.
- * The jni typemap contains the JNI type used in the JNI (C/C++) code.
- * The jtype typemap contains the Java type used in the JNI intermediary class.
- * The jstype typemap contains the Java type used in the Java proxy classes, type wrapper classes and module class. */
-
-/* Fragments */
-%fragment("SWIG_PackData", "header") {
-/* Pack binary data into a string */
-SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) {
- static const char hex[17] = "0123456789abcdef";
- register const unsigned char *u = (unsigned char *) ptr;
- register const unsigned char *eu = u + sz;
- for (; u != eu; ++u) {
- register unsigned char uu = *u;
- *(c++) = hex[(uu & 0xf0) >> 4];
- *(c++) = hex[uu & 0xf];
- }
- return c;
-}
-}
-
-%fragment("SWIG_UnPackData", "header") {
-/* Unpack binary data from a string */
-SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
- register unsigned char *u = (unsigned char *) ptr;
- register const unsigned char *eu = u + sz;
- for (; u != eu; ++u) {
- register char d = *(c++);
- register unsigned char uu;
- if ((d >= '0') && (d <= '9'))
- uu = ((d - '0') << 4);
- else if ((d >= 'a') && (d <= 'f'))
- uu = ((d - ('a'-10)) << 4);
- else
- return (char *) 0;
- d = *(c++);
- if ((d >= '0') && (d <= '9'))
- uu |= (d - '0');
- else if ((d >= 'a') && (d <= 'f'))
- uu |= (d - ('a'-10));
- else
- return (char *) 0;
- *u = uu;
- }
- return c;
-}
-}
-
-/* Primitive types */
-%typemap(jni) bool, const bool & "jboolean"
-%typemap(jni) char, const char & "jchar"
-%typemap(jni) signed char, const signed char & "jbyte"
-%typemap(jni) unsigned char, const unsigned char & "jshort"
-%typemap(jni) short, const short & "jshort"
-%typemap(jni) unsigned short, const unsigned short & "jint"
-%typemap(jni) int, const int & "jint"
-%typemap(jni) unsigned int, const unsigned int & "jlong"
-%typemap(jni) long, const long & "jint"
-%typemap(jni) unsigned long, const unsigned long & "jlong"
-%typemap(jni) long long, const long long & "jlong"
-%typemap(jni) unsigned long long, const unsigned long long & "jobject"
-%typemap(jni) float, const float & "jfloat"
-%typemap(jni) double, const double & "jdouble"
-%typemap(jni) void "void"
-
-%typemap(jtype) bool, const bool & "boolean"
-%typemap(jtype) char, const char & "char"
-%typemap(jtype) signed char, const signed char & "byte"
-%typemap(jtype) unsigned char, const unsigned char & "short"
-%typemap(jtype) short, const short & "short"
-%typemap(jtype) unsigned short, const unsigned short & "int"
-%typemap(jtype) int, const int & "int"
-%typemap(jtype) unsigned int, const unsigned int & "long"
-%typemap(jtype) long, const long & "int"
-%typemap(jtype) unsigned long, const unsigned long & "long"
-%typemap(jtype) long long, const long long & "long"
-%typemap(jtype) unsigned long long, const unsigned long long & "java.math.BigInteger"
-%typemap(jtype) float, const float & "float"
-%typemap(jtype) double, const double & "double"
-%typemap(jtype) void "void"
-
-%typemap(jstype) bool, const bool & "boolean"
-%typemap(jstype) char, const char & "char"
-%typemap(jstype) signed char, const signed char & "byte"
-%typemap(jstype) unsigned char, const unsigned char & "short"
-%typemap(jstype) short, const short & "short"
-%typemap(jstype) unsigned short, const unsigned short & "int"
-%typemap(jstype) int, const int & "int"
-%typemap(jstype) unsigned int, const unsigned int & "long"
-%typemap(jstype) long, const long & "int"
-%typemap(jstype) unsigned long, const unsigned long & "long"
-%typemap(jstype) long long, const long long & "long"
-%typemap(jstype) unsigned long long, const unsigned long long & "java.math.BigInteger"
-%typemap(jstype) float, const float & "float"
-%typemap(jstype) double, const double & "double"
-%typemap(jstype) void "void"
-
-%typemap(jni) char *, char *&, char[ANY], char[] "jstring"
-%typemap(jtype) char *, char *&, char[ANY], char[] "String"
-%typemap(jstype) char *, char *&, char[ANY], char[] "String"
-
-/* JNI types */
-%typemap(jni) jboolean "jboolean"
-%typemap(jni) jchar "jchar"
-%typemap(jni) jbyte "jbyte"
-%typemap(jni) jshort "jshort"
-%typemap(jni) jint "jint"
-%typemap(jni) jlong "jlong"
-%typemap(jni) jfloat "jfloat"
-%typemap(jni) jdouble "jdouble"
-%typemap(jni) jstring "jstring"
-%typemap(jni) jobject "jobject"
-%typemap(jni) jbooleanArray "jbooleanArray"
-%typemap(jni) jcharArray "jcharArray"
-%typemap(jni) jbyteArray "jbyteArray"
-%typemap(jni) jshortArray "jshortArray"
-%typemap(jni) jintArray "jintArray"
-%typemap(jni) jlongArray "jlongArray"
-%typemap(jni) jfloatArray "jfloatArray"
-%typemap(jni) jdoubleArray "jdoubleArray"
-%typemap(jni) jobjectArray "jobjectArray"
-
-%typemap(jtype) jboolean "boolean"
-%typemap(jtype) jchar "char"
-%typemap(jtype) jbyte "byte"
-%typemap(jtype) jshort "short"
-%typemap(jtype) jint "int"
-%typemap(jtype) jlong "long"
-%typemap(jtype) jfloat "float"
-%typemap(jtype) jdouble "double"
-%typemap(jtype) jstring "String"
-%typemap(jtype) jobject "Object"
-%typemap(jtype) jbooleanArray "boolean[]"
-%typemap(jtype) jcharArray "char[]"
-%typemap(jtype) jbyteArray "byte[]"
-%typemap(jtype) jshortArray "short[]"
-%typemap(jtype) jintArray "int[]"
-%typemap(jtype) jlongArray "long[]"
-%typemap(jtype) jfloatArray "float[]"
-%typemap(jtype) jdoubleArray "double[]"
-%typemap(jtype) jobjectArray "Object[]"
-
-%typemap(jstype) jboolean "boolean"
-%typemap(jstype) jchar "char"
-%typemap(jstype) jbyte "byte"
-%typemap(jstype) jshort "short"
-%typemap(jstype) jint "int"
-%typemap(jstype) jlong "long"
-%typemap(jstype) jfloat "float"
-%typemap(jstype) jdouble "double"
-%typemap(jstype) jstring "String"
-%typemap(jstype) jobject "Object"
-%typemap(jstype) jbooleanArray "boolean[]"
-%typemap(jstype) jcharArray "char[]"
-%typemap(jstype) jbyteArray "byte[]"
-%typemap(jstype) jshortArray "short[]"
-%typemap(jstype) jintArray "int[]"
-%typemap(jstype) jlongArray "long[]"
-%typemap(jstype) jfloatArray "float[]"
-%typemap(jstype) jdoubleArray "double[]"
-%typemap(jstype) jobjectArray "Object[]"
-
-/* Non primitive types */
-%typemap(jni) SWIGTYPE "jlong"
-%typemap(jtype) SWIGTYPE "long"
-%typemap(jstype) SWIGTYPE "$&javaclassname"
-
-%typemap(jni) SWIGTYPE [] "jlong"
-%typemap(jtype) SWIGTYPE [] "long"
-%typemap(jstype) SWIGTYPE [] "$javaclassname"
-
-%typemap(jni) SWIGTYPE * "jlong"
-%typemap(jtype) SWIGTYPE * "long"
-%typemap(jstype) SWIGTYPE * "$javaclassname"
-
-%typemap(jni) SWIGTYPE & "jlong"
-%typemap(jtype) SWIGTYPE & "long"
-%typemap(jstype) SWIGTYPE & "$javaclassname"
-
-/* pointer to a class member */
-%typemap(jni) SWIGTYPE (CLASS::*) "jstring"
-%typemap(jtype) SWIGTYPE (CLASS::*) "String"
-%typemap(jstype) SWIGTYPE (CLASS::*) "$javaclassname"
-
-/* The following are the in, out, freearg, argout typemaps. These are the JNI code generating typemaps for converting from Java to C and visa versa. */
-
-/* primitive types */
-%typemap(in) bool
-%{ $1 = $input ? true : false; %}
-
-%typemap(directorout) bool
-%{ $result = $input ? true : false; %}
-
-%typemap(javadirectorin) bool "$jniinput"
-%typemap(javadirectorout) bool "$javacall"
-
-%typemap(in) char,
- signed char,
- unsigned char,
- short,
- unsigned short,
- int,
- unsigned int,
- long,
- unsigned long,
- long long,
- float,
- double
-%{ $1 = ($1_ltype)$input; %}
-
-%typemap(directorout) char,
- signed char,
- unsigned char,
- short,
- unsigned short,
- int,
- unsigned int,
- long,
- unsigned long,
- long long,
- float,
- double
-%{ $result = ($1_ltype)$input; %}
-
-%typemap(directorin, descriptor="Z") bool "$input = (jboolean) $1;"
-%typemap(directorin, descriptor="C") char "$input = (jint) $1;"
-%typemap(directorin, descriptor="B") signed char "$input = (jbyte) $1;"
-%typemap(directorin, descriptor="S") unsigned char "$input = (jshort) $1;"
-%typemap(directorin, descriptor="S") short "$input = (jshort) $1;"
-%typemap(directorin, descriptor="I") unsigned short "$input = (jint) $1;"
-%typemap(directorin, descriptor="I") int "$input = (jint) $1;"
-%typemap(directorin, descriptor="J") unsigned int "$input = (jlong) $1;"
-%typemap(directorin, descriptor="I") long "$input = (jint) $1;"
-%typemap(directorin, descriptor="J") unsigned long "$input = (jlong) $1;"
-%typemap(directorin, descriptor="J") long long "$input = (jlong) $1;"
-%typemap(directorin, descriptor="F") float "$input = (jfloat) $1;"
-%typemap(directorin, descriptor="D") double "$input = (jdouble) $1;"
-
-%typemap(javadirectorin) char,
- signed char,
- unsigned char,
- short,
- unsigned short,
- int,
- unsigned int,
- long,
- unsigned long,
- long long,
- float,
- double
- "$jniinput"
-
-%typemap(javadirectorout) char,
- signed char,
- unsigned char,
- short,
- unsigned short,
- int,
- unsigned int,
- long,
- unsigned long,
- long long,
- float,
- double
- "$javacall"
-
-%typemap(out) bool %{ $result = (jboolean)$1; %}
-%typemap(out) char %{ $result = (jchar)$1; %}
-%typemap(out) signed char %{ $result = (jbyte)$1; %}
-%typemap(out) unsigned char %{ $result = (jshort)$1; %}
-%typemap(out) short %{ $result = (jshort)$1; %}
-%typemap(out) unsigned short %{ $result = (jint)$1; %}
-%typemap(out) int %{ $result = (jint)$1; %}
-%typemap(out) unsigned int %{ $result = (jlong)$1; %}
-%typemap(out) long %{ $result = (jint)$1; %}
-%typemap(out) unsigned long %{ $result = (jlong)$1; %}
-%typemap(out) long long %{ $result = (jlong)$1; %}
-%typemap(out) float %{ $result = (jfloat)$1; %}
-%typemap(out) double %{ $result = (jdouble)$1; %}
-
-/* unsigned long long */
-/* Convert from BigInteger using the toByteArray member function */
-%typemap(in) unsigned long long {
- jclass clazz;
- jmethodID mid;
- jbyteArray ba;
- jbyte* bae;
- jsize sz;
- int i;
-
- if (!$input) {
- SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null");
- return $null;
- }
- clazz = JCALL1(GetObjectClass, jenv, $input);
- mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B");
- ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid);
- bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
- sz = JCALL1(GetArrayLength, jenv, ba);
- $1 = 0;
- for(i=0; i<sz; i++) {
- $1 = ($1 << 8) | ($1_type)(unsigned char)bae[i];
- }
- JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
-}
-
-%typemap(directorout) unsigned long long {
- jclass clazz;
- jmethodID mid;
- jbyteArray ba;
- jbyte* bae;
- jsize sz;
- int i;
-
- if (!$input) {
- SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null");
- return $null;
- }
- clazz = JCALL1(GetObjectClass, jenv, $input);
- mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B");
- ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid);
- bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
- sz = JCALL1(GetArrayLength, jenv, ba);
- $result = 0;
- for(i=0; i<sz; i++) {
- $result = ($result << 8) | ($1_type)(unsigned char)bae[i];
- }
- JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
-}
-
-
-/* Convert to BigInteger - byte array holds number in 2's complement big endian format */
-%typemap(out) unsigned long long {
- jbyteArray ba = JCALL1(NewByteArray, jenv, 9);
- jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
- jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger");
- jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "<init>", "([B)V");
- jobject bigint;
- int i;
-
- bae[0] = 0;
- for(i=1; i<9; i++ ) {
- bae[i] = (jbyte)($1>>8*(8-i));
- }
-
- JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
- bigint = JCALL3(NewObject, jenv, clazz, mid, ba);
- $result = bigint;
-}
-
-/* Convert to BigInteger (see out typemap) */
-%typemap(directorin, descriptor="Ljava/math/BigInteger;") unsigned long long, const unsigned long long & {
- jbyteArray ba = JCALL1(NewByteArray, jenv, 9);
- jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
- jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger");
- jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "<init>", "([B)V");
- jobject bigint;
- int swig_i;
-
- bae[0] = 0;
- for(swig_i=1; swig_i<9; swig_i++ ) {
- bae[swig_i] = (jbyte)($1>>8*(8-swig_i));
- }
-
- JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
- bigint = JCALL3(NewObject, jenv, clazz, mid, ba);
- $input = bigint;
-}
-
-%typemap(javadirectorin) unsigned long long "$jniinput"
-%typemap(javadirectorout) unsigned long long "$javacall"
-
-/* char * - treat as String */
-%typemap(in, noblock=1) char * {
- $1 = 0;
- if ($input) {
- $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
- if (!$1) return $null;
- }
-}
-
-%typemap(directorout, noblock=1, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * {
- $1 = 0;
- if ($input) {
- $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
- if (!$result) return $null;
- }
-}
-
-%typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char * {
- $input = 0;
- if ($1) {
- $input = JCALL1(NewStringUTF, jenv, (const char *)$1);
- if (!$input) return $null;
- }
-}
-
-%typemap(freearg, noblock=1) char * { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); }
-%typemap(out, noblock=1) char * { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); }
-%typemap(javadirectorin) char * "$jniinput"
-%typemap(javadirectorout) char * "$javacall"
-
-/* char *& - treat as String */
-%typemap(in, noblock=1) char *& ($*1_ltype temp = 0) {
- $1 = 0;
- if ($input) {
- temp = ($*1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
- if (!temp) return $null;
- }
- $1 = &temp;
-}
-%typemap(freearg, noblock=1) char *& { if ($1 && *$1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)*$1); }
-%typemap(out, noblock=1) char *& { if (*$1) $result = JCALL1(NewStringUTF, jenv, (const char *)*$1); }
-
-%typemap(out) void ""
-%typemap(javadirectorin) void "$jniinput"
-%typemap(javadirectorout) void "$javacall"
-%typemap(directorin, descriptor="V") void ""
-
-/* primitive types by reference */
-%typemap(in) const bool & ($*1_ltype temp)
-%{ temp = $input ? true : false;
- $1 = &temp; %}
-
-%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool &
-%{ static $*1_ltype temp;
- temp = $input ? true : false;
- $result = &temp; %}
-
-%typemap(javadirectorin) const bool & "$jniinput"
-%typemap(javadirectorout) const bool & "$javacall"
-
-%typemap(in) const char & ($*1_ltype temp),
- const signed char & ($*1_ltype temp),
- const unsigned char & ($*1_ltype temp),
- const short & ($*1_ltype temp),
- const unsigned short & ($*1_ltype temp),
- const int & ($*1_ltype temp),
- const unsigned int & ($*1_ltype temp),
- const long & ($*1_ltype temp),
- const unsigned long & ($*1_ltype temp),
- const long long & ($*1_ltype temp),
- const float & ($*1_ltype temp),
- const double & ($*1_ltype temp)
-%{ temp = ($*1_ltype)$input;
- $1 = &temp; %}
-
-%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &,
- const signed char &,
- const unsigned char &,
- const short &,
- const unsigned short &,
- const int &,
- const unsigned int &,
- const long &,
- const unsigned long &,
- const long long &,
- const float &,
- const double &
-%{ static $*1_ltype temp;
- temp = ($*1_ltype)$input;
- $result = &temp; %}
-
-%typemap(directorin, descriptor="Z") const bool & "$input = (jboolean)$1;"
-%typemap(directorin, descriptor="C") const char & "$input = (jchar)$1;"
-%typemap(directorin, descriptor="B") const signed char & "$input = (jbyte)$1;"
-%typemap(directorin, descriptor="S") const unsigned char & "$input = (jshort)$1;"
-%typemap(directorin, descriptor="S") const short & "$input = (jshort)$1;"
-%typemap(directorin, descriptor="I") const unsigned short & "$input = (jint)$1;"
-%typemap(directorin, descriptor="I") const int & "$input = (jint)$1;"
-%typemap(directorin, descriptor="J") const unsigned int & "$input = (jlong)$1;"
-%typemap(directorin, descriptor="I") const long & "$input = (jint)$1;"
-%typemap(directorin, descriptor="J") const unsigned long & "$input = (jlong)$1;"
-%typemap(directorin, descriptor="J") const long long & "$input = (jlong)$1;"
-%typemap(directorin, descriptor="F") const float & "$input = (jfloat)$1;"
-%typemap(directorin, descriptor="D") const double & "$input = (jdouble)$1;"
-
-%typemap(javadirectorin) const char & ($*1_ltype temp),
- const signed char & ($*1_ltype temp),
- const unsigned char & ($*1_ltype temp),
- const short & ($*1_ltype temp),
- const unsigned short & ($*1_ltype temp),
- const int & ($*1_ltype temp),
- const unsigned int & ($*1_ltype temp),
- const long & ($*1_ltype temp),
- const unsigned long & ($*1_ltype temp),
- const long long & ($*1_ltype temp),
- const float & ($*1_ltype temp),
- const double & ($*1_ltype temp)
- "$jniinput"
-
-%typemap(javadirectorout) const char & ($*1_ltype temp),
- const signed char & ($*1_ltype temp),
- const unsigned char & ($*1_ltype temp),
- const short & ($*1_ltype temp),
- const unsigned short & ($*1_ltype temp),
- const int & ($*1_ltype temp),
- const unsigned int & ($*1_ltype temp),
- const long & ($*1_ltype temp),
- const unsigned long & ($*1_ltype temp),
- const long long & ($*1_ltype temp),
- const float & ($*1_ltype temp),
- const double & ($*1_ltype temp)
- "$javacall"
-
-
-%typemap(out) const bool & %{ $result = (jboolean)*$1; %}
-%typemap(out) const char & %{ $result = (jchar)*$1; %}
-%typemap(out) const signed char & %{ $result = (jbyte)*$1; %}
-%typemap(out) const unsigned char & %{ $result = (jshort)*$1; %}
-%typemap(out) const short & %{ $result = (jshort)*$1; %}
-%typemap(out) const unsigned short & %{ $result = (jint)*$1; %}
-%typemap(out) const int & %{ $result = (jint)*$1; %}
-%typemap(out) const unsigned int & %{ $result = (jlong)*$1; %}
-%typemap(out) const long & %{ $result = (jint)*$1; %}
-%typemap(out) const unsigned long & %{ $result = (jlong)*$1; %}
-%typemap(out) const long long & %{ $result = (jlong)*$1; %}
-%typemap(out) const float & %{ $result = (jfloat)*$1; %}
-%typemap(out) const double & %{ $result = (jdouble)*$1; %}
-
-/* const unsigned long long & */
-/* Similar to unsigned long long */
-%typemap(in) const unsigned long long & ($*1_ltype temp) {
- jclass clazz;
- jmethodID mid;
- jbyteArray ba;
- jbyte* bae;
- jsize sz;
- int i;
-
- if (!$input) {
- SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null");
- return $null;
- }
- clazz = JCALL1(GetObjectClass, jenv, $input);
- mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B");
- ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid);
- bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
- sz = JCALL1(GetArrayLength, jenv, ba);
- $1 = &temp;
- temp = 0;
- for(i=0; i<sz; i++) {
- temp = (temp << 8) | ($*1_ltype)(unsigned char)bae[i];
- }
- JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
-}
-
-%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const unsigned long long & {
- static $*1_ltype temp;
- jclass clazz;
- jmethodID mid;
- jbyteArray ba;
- jbyte* bae;
- jsize sz;
- int i;
-
- if (!$input) {
- SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null");
- return $null;
- }
- clazz = JCALL1(GetObjectClass, jenv, $input);
- mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B");
- ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid);
- bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
- sz = JCALL1(GetArrayLength, jenv, ba);
- $result = &temp;
- temp = 0;
- for(i=0; i<sz; i++) {
- temp = (temp << 8) | ($*1_ltype)(unsigned char)bae[i];
- }
- JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
-}
-
-%typemap(out) const unsigned long long & {
- jbyteArray ba = JCALL1(NewByteArray, jenv, 9);
- jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
- jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger");
- jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "<init>", "([B)V");
- jobject bigint;
- int i;
-
- bae[0] = 0;
- for(i=1; i<9; i++ ) {
- bae[i] = (jbyte)(*$1>>8*(8-i));
- }
-
- JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
- bigint = JCALL3(NewObject, jenv, clazz, mid, ba);
- $result = bigint;
-}
-
-%typemap(javadirectorin) const unsigned long long & "$jniinput"
-%typemap(javadirectorout) const unsigned long long & "$javacall"
-
-/* Default handling. Object passed by value. Convert to a pointer */
-%typemap(in) SWIGTYPE ($&1_type argp)
-%{ argp = *($&1_ltype*)&$input;
- if (!argp) {
- SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type");
- return $null;
- }
- $1 = *argp; %}
-
-%typemap(directorout) SWIGTYPE ($&1_type argp)
-%{ argp = *($&1_ltype*)&$input;
- if (!argp) {
- SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type");
- return $null;
- }
- $result = *argp; %}
-
-%typemap(out) SWIGTYPE
-#ifdef __cplusplus
-%{ *($&1_ltype*)&$result = new $1_ltype((const $1_ltype &)$1); %}
-#else
-{
- $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype));
- memmove($1ptr, &$1, sizeof($1_type));
- *($&1_ltype*)&$result = $1ptr;
-}
-#endif
-
-%typemap(directorin,descriptor="L$packagepath/$&javaclassname;") SWIGTYPE
-%{ $input = 0;
- *(($&1_ltype*)&$input) = &$1; %}
-%typemap(javadirectorin) SWIGTYPE "new $&javaclassname($jniinput, false)"
-%typemap(javadirectorout) SWIGTYPE "$&javaclassname.getCPtr($javacall)"
-
-/* Generic pointers and references */
-%typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)&$input; %}
-%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) {
- const char *temp = 0;
- if ($input) {
- temp = JCALL2(GetStringUTFChars, jenv, $input, 0);
- if (!temp) return $null;
- }
- SWIG_UnpackData(temp, (void *)&$1, sizeof($1));
-}
-%typemap(in) SWIGTYPE & %{ $1 = *($&1_ltype)&$input;
- if (!$1) {
- SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null");
- return $null;
- } %}
-%typemap(out) SWIGTYPE *
-%{ *($&1_ltype)&$result = $1; %}
-%typemap(out, fragment="SWIG_PackData", noblock=1) SWIGTYPE (CLASS::*) {
- char buf[128];
- char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1));
- *data = '\0';
- $result = JCALL1(NewStringUTF, jenv, buf);
-}
-%typemap(out) SWIGTYPE &
-%{ *($&1_ltype)&$result = $1; %}
-
-%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *
-%{ $result = *($&1_ltype)&$input; %}
-%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*)
-%{ $result = *($&1_ltype)&$input; %}
-
-%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE *
-%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %}
-%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE (CLASS::*)
-%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %}
-
-%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE &
-%{ if (!$input) {
- SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type");
- return $null;
- }
- $result = *($&1_ltype)&$input; %}
-%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE &
-%{ *($&1_ltype)&$input = ($1_ltype) &$1; %}
-
-%typemap(javadirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($jniinput == 0) ? null : new $javaclassname($jniinput, false)"
-%typemap(javadirectorin) SWIGTYPE & "new $javaclassname($jniinput, false)"
-%typemap(javadirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE & "$javaclassname.getCPtr($javacall)"
-
-/* Default array handling */
-%typemap(in) SWIGTYPE [] %{ $1 = *($&1_ltype)&$input; %}
-%typemap(out) SWIGTYPE [] %{ *($&1_ltype)&$result = $1; %}
-%typemap(freearg) SWIGTYPE [ANY], SWIGTYPE [] ""
-
-/* char arrays - treat as String */
-%typemap(in, noblock=1) char[ANY], char[] {
- $1 = 0;
- if ($input) {
- $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
- if (!$1) return $null;
- }
-}
-
-%typemap(directorout, noblock=1) char[ANY], char[] {
- $1 = 0;
- if ($input) {
- $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
- if (!$result) return $null;
- }
-}
-
-%typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char[ANY], char[] {
- $input = 0;
- if ($1) {
- $input = JCALL1(NewStringUTF, jenv, (const char *)$1);
- if (!$input) return $null;
- }
-}
-
-%typemap(argout) char[ANY], char[] ""
-%typemap(freearg, noblock=1) char[ANY], char[] { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); }
-%typemap(out, noblock=1) char[ANY], char[] { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); }
-%typemap(javadirectorin) char[ANY], char[] "$jniinput"
-%typemap(javadirectorout) char[ANY], char[] "$javacall"
-
-/* JNI types */
-%typemap(in) jboolean,
- jchar,
- jbyte,
- jshort,
- jint,
- jlong,
- jfloat,
- jdouble,
- jstring,
- jobject,
- jbooleanArray,
- jcharArray,
- jbyteArray,
- jshortArray,
- jintArray,
- jlongArray,
- jfloatArray,
- jdoubleArray,
- jobjectArray
-%{ $1 = $input; %}
-
-%typemap(directorout) jboolean,
- jchar,
- jbyte,
- jshort,
- jint,
- jlong,
- jfloat,
- jdouble,
- jstring,
- jobject,
- jbooleanArray,
- jcharArray,
- jbyteArray,
- jshortArray,
- jintArray,
- jlongArray,
- jfloatArray,
- jdoubleArray,
- jobjectArray
-%{ $result = $input; %}
-
-%typemap(out) jboolean,
- jchar,
- jbyte,
- jshort,
- jint,
- jlong,
- jfloat,
- jdouble,
- jstring,
- jobject,
- jbooleanArray,
- jcharArray,
- jbyteArray,
- jshortArray,
- jintArray,
- jlongArray,
- jfloatArray,
- jdoubleArray,
- jobjectArray
-%{ $result = $1; %}
-
-%typemap(directorin,descriptor="Z") jboolean "$input = $1;"
-%typemap(directorin,descriptor="C") jchar "$input = $1;"
-%typemap(directorin,descriptor="B") jbyte "$input = $1;"
-%typemap(directorin,descriptor="S") jshort "$input = $1;"
-%typemap(directorin,descriptor="I") jint "$input = $1;"
-%typemap(directorin,descriptor="J") jlong "$input = $1;"
-%typemap(directorin,descriptor="F") jfloat "$input = $1;"
-%typemap(directorin,descriptor="D") jdouble "$input = $1;"
-%typemap(directorin,descriptor="Ljava/lang/String;") jstring "$input = $1;"
-%typemap(directorin,descriptor="Ljava/lang/Object;",nouse="1") jobject "$input = $1;"
-%typemap(directorin,descriptor="[Z") jbooleanArray "$input = $1;"
-%typemap(directorin,descriptor="[C") jcharArray "$input = $1;"
-%typemap(directorin,descriptor="[B") jbyteArray "$input = $1;"
-%typemap(directorin,descriptor="[S") jshortArray "$input = $1;"
-%typemap(directorin,descriptor="[I") jintArray "$input = $1;"
-%typemap(directorin,descriptor="[J") jlongArray "$input = $1;"
-%typemap(directorin,descriptor="[F") jfloatArray "$input = $1;"
-%typemap(directorin,descriptor="[D") jdoubleArray "$input = $1;"
-%typemap(directorin,descriptor="[Ljava/lang/Object;",nouse="1") jobjectArray "$input = $1;"
-
-%typemap(javadirectorin) jboolean,
- jchar,
- jbyte,
- jshort,
- jint,
- jlong,
- jfloat,
- jdouble,
- jstring,
- jobject,
- jbooleanArray,
- jcharArray,
- jbyteArray,
- jshortArray,
- jintArray,
- jlongArray,
- jfloatArray,
- jdoubleArray,
- jobjectArray
- "$jniinput"
-
-%typemap(javadirectorout) jboolean,
- jchar,
- jbyte,
- jshort,
- jint,
- jlong,
- jfloat,
- jdouble,
- jstring,
- jobject,
- jbooleanArray,
- jcharArray,
- jbyteArray,
- jshortArray,
- jintArray,
- jlongArray,
- jfloatArray,
- jdoubleArray,
- jobjectArray
- "$javacall"
-
-/* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions
- * that cannot be overloaded in Java as more than one C++ type maps to a single Java type */
-
-%typecheck(SWIG_TYPECHECK_BOOL) /* Java boolean */
- jboolean,
- bool,
- const bool &
- ""
-
-%typecheck(SWIG_TYPECHECK_CHAR) /* Java char */
- jchar,
- char,
- const char &
- ""
-
-%typecheck(SWIG_TYPECHECK_INT8) /* Java byte */
- jbyte,
- signed char,
- const signed char &
- ""
-
-%typecheck(SWIG_TYPECHECK_INT16) /* Java short */
- jshort,
- unsigned char,
- short,
- const unsigned char &,
- const short &
- ""
-
-%typecheck(SWIG_TYPECHECK_INT32) /* Java int */
- jint,
- unsigned short,
- int,
- long,
- const unsigned short &,
- const int &,
- const long &
- ""
-
-%typecheck(SWIG_TYPECHECK_INT64) /* Java long */
- jlong,
- unsigned int,
- unsigned long,
- long long,
- const unsigned int &,
- const unsigned long &,
- const long long &
- ""
-
-%typecheck(SWIG_TYPECHECK_INT128) /* Java BigInteger */
- unsigned long long,
- const unsigned long long &
- ""
-
-%typecheck(SWIG_TYPECHECK_FLOAT) /* Java float */
- jfloat,
- float,
- const float &
- ""
-
-%typecheck(SWIG_TYPECHECK_DOUBLE) /* Java double */
- jdouble,
- double,
- const double &
- ""
-
-%typecheck(SWIG_TYPECHECK_STRING) /* Java String */
- jstring,
- char *,
- char *&,
- char[ANY],
- char []
- ""
-
-%typecheck(SWIG_TYPECHECK_BOOL_ARRAY) /* Java boolean[] */
- jbooleanArray
- ""
-
-%typecheck(SWIG_TYPECHECK_CHAR_ARRAY) /* Java char[] */
- jcharArray
- ""
-
-%typecheck(SWIG_TYPECHECK_INT8_ARRAY) /* Java byte[] */
- jbyteArray
- ""
-
-%typecheck(SWIG_TYPECHECK_INT16_ARRAY) /* Java short[] */
- jshortArray
- ""
-
-%typecheck(SWIG_TYPECHECK_INT32_ARRAY) /* Java int[] */
- jintArray
- ""
-
-%typecheck(SWIG_TYPECHECK_INT64_ARRAY) /* Java long[] */
- jlongArray
- ""
-
-%typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) /* Java float[] */
- jfloatArray
- ""
-
-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) /* Java double[] */
- jdoubleArray
- ""
-
-%typecheck(SWIG_TYPECHECK_OBJECT_ARRAY) /* Java jobject[] */
- jobjectArray
- ""
-
-%typecheck(SWIG_TYPECHECK_POINTER) /* Default */
- SWIGTYPE,
- SWIGTYPE *,
- SWIGTYPE &,
- SWIGTYPE *const&,
- SWIGTYPE [],
- SWIGTYPE (CLASS::*)
- ""
-
-
-/* Exception handling */
-
-%typemap(throws) int,
- long,
- short,
- unsigned int,
- unsigned long,
- unsigned short
-%{ char error_msg[256];
- sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1);
- SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, error_msg);
- return $null; %}
-
-%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY]
-%{ (void)$1;
- SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown");
- return $null; %}
-
-%typemap(throws) char *
-%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1);
- return $null; %}
-
-
-/* Typemaps for code generation in proxy classes and Java type wrapper classes */
-
-/* The javain typemap is used for converting function parameter types from the type
- * used in the proxy, module or type wrapper class to the type used in the JNI class. */
-%typemap(javain) bool, const bool &,
- char, const char &,
- signed char, const signed char &,
- unsigned char, const unsigned char &,
- short, const short &,
- unsigned short, const unsigned short &,
- int, const int &,
- unsigned int, const unsigned int &,
- long, const long &,
- unsigned long, const unsigned long &,
- long long, const long long &,
- unsigned long long, const unsigned long long &,
- float, const float &,
- double, const double &
- "$javainput"
-%typemap(javain) char *, char *&, char[ANY], char[] "$javainput"
-%typemap(javain) jboolean,
- jchar,
- jbyte,
- jshort,
- jint,
- jlong,
- jfloat,
- jdouble,
- jstring,
- jobject,
- jbooleanArray,
- jcharArray,
- jbyteArray,
- jshortArray,
- jintArray,
- jlongArray,
- jfloatArray,
- jdoubleArray,
- jobjectArray
- "$javainput"
-%typemap(javain) SWIGTYPE "$&javaclassname.getCPtr($javainput)"
-%typemap(javain) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$javaclassname.getCPtr($javainput)"
-%typemap(javain) SWIGTYPE (CLASS::*) "$javaclassname.getCMemberPtr($javainput)"
-
-/* The javaout typemap is used for converting function return types from the return type
- * used in the JNI class to the type returned by the proxy, module or type wrapper class. */
-%typemap(javaout) bool, const bool &,
- char, const char &,
- signed char, const signed char &,
- unsigned char, const unsigned char &,
- short, const short &,
- unsigned short, const unsigned short &,
- int, const int &,
- unsigned int, const unsigned int &,
- long, const long &,
- unsigned long, const unsigned long &,
- long long, const long long &,
- unsigned long long, const unsigned long long &,
- float, const float &,
- double, const double & {
- return $jnicall;
- }
-%typemap(javaout) char *, char *&, char[ANY], char[] {
- return $jnicall;
- }
-%typemap(javaout) jboolean,
- jchar,
- jbyte,
- jshort,
- jint,
- jlong,
- jfloat,
- jdouble,
- jstring,
- jobject,
- jbooleanArray,
- jcharArray,
- jbyteArray,
- jshortArray,
- jintArray,
- jlongArray,
- jfloatArray,
- jdoubleArray,
- jobjectArray {
- return $jnicall;
- }
-%typemap(javaout) void {
- $jnicall;
- }
-%typemap(javaout) SWIGTYPE {
- return new $&javaclassname($jnicall, true);
- }
-%typemap(javaout) SWIGTYPE & {
- return new $javaclassname($jnicall, $owner);
- }
-%typemap(javaout) SWIGTYPE *, SWIGTYPE [] {
- long cPtr = $jnicall;
- return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner);
- }
-%typemap(javaout) SWIGTYPE (CLASS::*) {
- String cMemberPtr = $jnicall;
- return (cMemberPtr == null) ? null : new $javaclassname(cMemberPtr, $owner);
- }
-
-/* Pointer reference typemaps */
-%typemap(jni) SWIGTYPE *const& "jlong"
-%typemap(jtype) SWIGTYPE *const& "long"
-%typemap(jstype) SWIGTYPE *const& "$*javaclassname"
-%typemap(javain) SWIGTYPE *const& "$*javaclassname.getCPtr($javainput)"
-%typemap(javaout) SWIGTYPE *const& {
- long cPtr = $jnicall;
- return (cPtr == 0) ? null : new $*javaclassname(cPtr, $owner);
- }
-%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0)
-%{ temp = *($1_ltype)&$input;
- $1 = ($1_ltype)&temp; %}
-%typemap(out) SWIGTYPE *const&
-%{ *($1_ltype)&$result = *$1; %}
-
-/* Typemaps used for the generation of proxy and type wrapper class code */
-%typemap(javabase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
-%typemap(javaclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class"
-%typemap(javacode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
-%typemap(javaimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
-%typemap(javainterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
-
-/* javabody typemaps */
-
-%define SWIG_JAVABODY_METHODS(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE) %enddef // legacy name
-
-%define SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...)
-// Base proxy classes
-%typemap(javabody) TYPE %{
- private long swigCPtr;
- protected boolean swigCMemOwn;
-
- PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) {
- swigCMemOwn = cMemoryOwn;
- swigCPtr = cPtr;
- }
-
- CPTR_VISIBILITY static long getCPtr($javaclassname obj) {
- return (obj == null) ? 0 : obj.swigCPtr;
- }
-%}
-
-// Derived proxy classes
-%typemap(javabody_derived) TYPE %{
- private long swigCPtr;
-
- PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) {
- super($imclassname.$javaclazznameSWIGUpcast(cPtr), cMemoryOwn);
- swigCPtr = cPtr;
- }
-
- CPTR_VISIBILITY static long getCPtr($javaclassname obj) {
- return (obj == null) ? 0 : obj.swigCPtr;
- }
-%}
-%enddef
-
-%define SWIG_JAVABODY_TYPEWRAPPER(PTRCTOR_VISIBILITY, DEFAULTCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...)
-// Typewrapper classes
-%typemap(javabody) TYPE *, TYPE &, TYPE [] %{
- private long swigCPtr;
-
- PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean futureUse) {
- swigCPtr = cPtr;
- }
-
- DEFAULTCTOR_VISIBILITY $javaclassname() {
- swigCPtr = 0;
- }
-
- CPTR_VISIBILITY static long getCPtr($javaclassname obj) {
- return (obj == null) ? 0 : obj.swigCPtr;
- }
-%}
-
-%typemap(javabody) TYPE (CLASS::*) %{
- private String swigCMemberPtr;
-
- PTRCTOR_VISIBILITY $javaclassname(String cMemberPtr, boolean futureUse) {
- swigCMemberPtr = cMemberPtr;
- }
-
- DEFAULTCTOR_VISIBILITY $javaclassname() {
- swigCMemberPtr = null;
- }
-
- CPTR_VISIBILITY static String getCMemberPtr($javaclassname obj) {
- return obj.swigCMemberPtr;
- }
-%}
-%enddef
-
-/* Set the default javabody typemaps to use protected visibility.
- Use the macros to change to public if using multiple modules. */
-SWIG_JAVABODY_PROXY(protected, protected, SWIGTYPE)
-SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE)
-
-%typemap(javafinalize) SWIGTYPE %{
- protected void finalize() {
- delete();
- }
-%}
-
-/*
- * Java constructor typemaps:
- *
- * The javaconstruct typemap is inserted when a proxy class's constructor is generated.
- * This typemap allows control over what code is executed in the constructor as
- * well as specifying who owns the underlying C/C++ object. Normally, Java has
- * ownership and the underlying C/C++ object is deallocated when the Java object
- * is finalized (swigCMemOwn is true.) If swigCMemOwn is false, C/C++ is
- * ultimately responsible for deallocating the underlying object's memory.
- *
- * The SWIG_PROXY_CONSTRUCTOR macro defines the javaconstruct typemap for a proxy
- * class for a particular TYPENAME. OWNERSHIP is passed as the value of
- * swigCMemOwn to the pointer constructor method. WEAKREF determines which kind
- * of Java object reference will be used by the C++ director class (WeakGlobalRef
- * vs. GlobalRef.)
- *
- * The SWIG_DIRECTOR_OWNED macro sets the ownership of director-based proxy
- * classes and the weak reference flag to false, meaning that the underlying C++
- * object will be reclaimed by C++.
- */
-
-%define SWIG_PROXY_CONSTRUCTOR(OWNERSHIP, WEAKREF, TYPENAME...)
-%typemap(javaconstruct,directorconnect="\n $imclassname.$javaclazznamedirector_connect(this, swigCPtr, swigCMemOwn, WEAKREF);") TYPENAME {
- this($imcall, OWNERSHIP);$directorconnect
- }
-%enddef
-
-%define SWIG_DIRECTOR_OWNED(TYPENAME...)
-SWIG_PROXY_CONSTRUCTOR(true, false, TYPENAME)
-%enddef
-
-// Set the default for SWIGTYPE: Java owns the C/C++ object.
-SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE)
-
-%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE {
- if (swigCPtr != 0) {
- if (swigCMemOwn) {
- swigCMemOwn = false;
- $jnicall;
- }
- swigCPtr = 0;
- }
- }
-
-%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE {
- if (swigCPtr != 0) {
- if (swigCMemOwn) {
- swigCMemOwn = false;
- $jnicall;
- }
- swigCPtr = 0;
- }
- super.delete();
- }
-
-%typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{
- protected void $methodname() {
- swigCMemOwn = false;
- $jnicall;
- }
-%}
-
-%typemap(directorowner_release, methodname="swigReleaseOwnership") SWIGTYPE %{
- public void $methodname() {
- swigCMemOwn = false;
- $jnicall;
- }
-%}
-
-%typemap(directorowner_take, methodname="swigTakeOwnership") SWIGTYPE %{
- public void $methodname() {
- swigCMemOwn = true;
- $jnicall;
- }
-%}
-
-/* Java specific directives */
-#define %javaconst(flag) %feature("java:const","flag")
-#define %javaconstvalue(value) %feature("java:constvalue",value)
-#define %javaenum(wrapapproach) %feature("java:enum","wrapapproach")
-#define %javamethodmodifiers %feature("java:methodmodifiers")
-#define %javaexception(exceptionclasses) %feature("except",throws=exceptionclasses)
-#define %nojavaexception %feature("except","0",throws="")
-#define %clearjavaexception %feature("except","",throws="")
-
-%pragma(java) jniclassclassmodifiers="public class"
-%pragma(java) moduleclassmodifiers="public class"
-
-/* Some ANSI C typemaps */
-
-%apply unsigned long { size_t };
-%apply const unsigned long & { const size_t & };
-
-/* Array reference typemaps */
-%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) }
-
-/* const pointers */
-%apply SWIGTYPE * { SWIGTYPE *const }
-
-/* String & length */
-%typemap(jni) (char *STRING, size_t LENGTH) "jbyteArray"
-%typemap(jtype) (char *STRING, size_t LENGTH) "byte[]"
-%typemap(jstype) (char *STRING, size_t LENGTH) "byte[]"
-%typemap(javain) (char *STRING, size_t LENGTH) "$javainput"
-%typemap(freearg) (char *STRING, size_t LENGTH) ""
-%typemap(in) (char *STRING, size_t LENGTH) {
- if ($input) {
- $1 = (char *) JCALL2(GetByteArrayElements, jenv, $input, 0);
- $2 = (size_t) JCALL1(GetArrayLength, jenv, $input);
- } else {
- $1 = 0;
- $2 = 0;
- }
-}
-%typemap(argout) (char *STRING, size_t LENGTH) {
- if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
-}
-%typemap(directorin, descriptor="[B") (char *STRING, size_t LENGTH) {
- jbyteArray jb = (jenv)->NewByteArray($2);
- (jenv)->SetByteArrayRegion(jb, 0, $2, (jbyte *)$1);
- $input = jb;
-}
-%typemap(directorargout) (char *STRING, size_t LENGTH)
-%{(jenv)->GetByteArrayRegion($input, 0, $2, (jbyte *)$1); %}
-%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) }
-
-/* java keywords */
-%include <javakw.swg>
-
-// Default enum handling
-%include <enumtypesafe.swg>
-
diff --git a/tests/examplefiles/swig_std_vector.i b/tests/examplefiles/swig_std_vector.i
deleted file mode 100644
index baecf850..00000000
--- a/tests/examplefiles/swig_std_vector.i
+++ /dev/null
@@ -1,225 +0,0 @@
-//
-// std::vector
-//
-
-%include <std_container.i>
-
-// Vector
-
-%define %std_vector_methods(vector...)
- %std_sequence_methods(vector)
-
- void reserve(size_type n);
- size_type capacity() const;
-%enddef
-
-
-%define %std_vector_methods_val(vector...)
- %std_sequence_methods_val(vector)
-
- void reserve(size_type n);
- size_type capacity() const;
-%enddef
-
-
-// ------------------------------------------------------------------------
-// std::vector
-//
-// The aim of all that follows would be to integrate std::vector with
-// as much as possible, namely, to allow the user to pass and
-// be returned tuples or lists.
-// const declarations are used to guess the intent of the function being
-// exported; therefore, the following rationale is applied:
-//
-// -- f(std::vector<T>), f(const std::vector<T>&):
-// the parameter being read-only, either a sequence or a
-// previously wrapped std::vector<T> can be passed.
-// -- f(std::vector<T>&), f(std::vector<T>*):
-// the parameter may be modified; therefore, only a wrapped std::vector
-// can be passed.
-// -- std::vector<T> f(), const std::vector<T>& f():
-// the vector is returned by copy; therefore, a sequence of T:s
-// is returned which is most easily used in other functions
-// -- std::vector<T>& f(), std::vector<T>* f():
-// the vector is returned by reference; therefore, a wrapped std::vector
-// is returned
-// -- const std::vector<T>* f(), f(const std::vector<T>*):
-// for consistency, they expect and return a plain vector pointer.
-// ------------------------------------------------------------------------
-
-%{
-#include <vector>
-%}
-
-// exported classes
-
-
-namespace std {
-
- template<class _Tp, class _Alloc = allocator< _Tp > >
- class vector {
- public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef _Tp value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef _Tp& reference;
- typedef const _Tp& const_reference;
- typedef _Alloc allocator_type;
-
- %traits_swigtype(_Tp);
- %traits_enum(_Tp);
-
- %fragment(SWIG_Traits_frag(std::vector<_Tp, _Alloc >), "header",
- fragment=SWIG_Traits_frag(_Tp),
- fragment="StdVectorTraits") {
- namespace swig {
- template <> struct traits<std::vector<_Tp, _Alloc > > {
- typedef pointer_category category;
- static const char* type_name() {
- return "std::vector<" #_Tp "," #_Alloc " >";
- }
- };
- }
- }
-
- %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp, _Alloc >);
-
-#ifdef %swig_vector_methods
- // Add swig/language extra methods
- %swig_vector_methods(std::vector<_Tp, _Alloc >);
-#endif
-
- %std_vector_methods(vector);
- };
-
- // ***
- // This specialization should disappear or get simplified when
- // a 'const SWIGTYPE*&' can be defined
- // ***
- template<class _Tp, class _Alloc >
- class vector<_Tp*, _Alloc > {
- public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef _Tp* value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type reference;
- typedef value_type const_reference;
- typedef _Alloc allocator_type;
-
- %traits_swigtype(_Tp);
-
- %fragment(SWIG_Traits_frag(std::vector<_Tp*, _Alloc >), "header",
- fragment=SWIG_Traits_frag(_Tp),
- fragment="StdVectorTraits") {
- namespace swig {
- template <> struct traits<std::vector<_Tp*, _Alloc > > {
- typedef value_category category;
- static const char* type_name() {
- return "std::vector<" #_Tp " *," #_Alloc " >";
- }
- };
- }
- }
-
- %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp*, _Alloc >);
-
-#ifdef %swig_vector_methods_val
- // Add swig/language extra methods
- %swig_vector_methods_val(std::vector<_Tp*, _Alloc >);
-#endif
-
- %std_vector_methods_val(vector);
- };
-
- // ***
- // const pointer specialization
- // ***
- template<class _Tp, class _Alloc >
- class vector<_Tp const *, _Alloc > {
- public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef _Tp const * value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type reference;
- typedef value_type const_reference;
- typedef _Alloc allocator_type;
-
- %traits_swigtype(_Tp);
-
- %fragment(SWIG_Traits_frag(std::vector<_Tp const*, _Alloc >), "header",
- fragment=SWIG_Traits_frag(_Tp),
- fragment="StdVectorTraits") {
- namespace swig {
- template <> struct traits<std::vector<_Tp const*, _Alloc > > {
- typedef value_category category;
- static const char* type_name() {
- return "std::vector<" #_Tp " const*," #_Alloc " >";
- }
- };
- }
- }
-
- %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp const*, _Alloc >);
-
-#ifdef %swig_vector_methods_val
- // Add swig/language extra methods
- %swig_vector_methods_val(std::vector<_Tp const*, _Alloc >);
-#endif
-
- %std_vector_methods_val(vector);
- };
-
- // ***
- // bool specialization
- // ***
-
- template<class _Alloc >
- class vector<bool,_Alloc > {
- public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef bool value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type reference;
- typedef value_type const_reference;
- typedef _Alloc allocator_type;
-
- %traits_swigtype(bool);
-
- %fragment(SWIG_Traits_frag(std::vector<bool, _Alloc >), "header",
- fragment=SWIG_Traits_frag(bool),
- fragment="StdVectorTraits") {
- namespace swig {
- template <> struct traits<std::vector<bool, _Alloc > > {
- typedef value_category category;
- static const char* type_name() {
- return "std::vector<bool, _Alloc >";
- }
- };
- }
- }
-
- %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<bool, _Alloc >);
-
-
-#ifdef %swig_vector_methods_val
- // Add swig/language extra methods
- %swig_vector_methods_val(std::vector<bool, _Alloc >);
-#endif
-
- %std_vector_methods_val(vector);
-
-#if defined(SWIG_STD_MODERN_STL) && !defined(SWIG_STD_NOMODERN_STL)
- void flip();
-#endif
-
- };
-
-}
diff --git a/tests/examplefiles/tads3_example.t b/tests/examplefiles/tads3_example.t
deleted file mode 100644
index 41881c93..00000000
--- a/tests/examplefiles/tads3_example.t
+++ /dev/null
@@ -1,1248 +0,0 @@
-#charset "utf-8"
-
-#include <adv3.h>
-#include <en_us.h>
-
-extern function extern_function;
-extern method extern_method;
-extern function extern_function(a, b=a, c='<<a>>', d:, e:=1, f?, ...);
-extern method extern_method(a, b=a, c='<<a>>', d:, e:=1, f?, [g]);;
-extern class extern_class;
-extern object extern_object;
-intrinsic 't3vm' { };
-#ifndef PropDefAny
-intrinsic class Object 'root-object/030004' { };
-#endif
-object /**//**/ // /* \\
-#define Room Unthing
- template [lst];
-
-/*
- * Quotations from "Le Roman de la Rose" are transcribed from MS. Douce 195,
- * owned by Bodleian Library, University of Oxford
- * (http://image.ox.ac.uk/show?collection=bodleian&manuscript=msdouce195).
- */
-
-versionInfo: GameID
- IFID = '17d8efc3-07da-4dde-a837-ff7c4e386a77'
- name = 'Pygmentalion'
- byline = 'by David Corbett'
- htmlByline = 'by <a href="mailto:corbett.dav\100husky.neu.edu">David
- Corbett</a>'
- version = '1'
- authorEmail = 'David Corbett\040<corbett.dav\x40husky.neu.edu>'
- desc = 'You have fallen in love with a statue\x2e'
- htmlDesc = 'You have fallen in love with a statue\x2E'
-;
-
-/*
- * Pymalion fu ẽtailleꝛꝛes.
- * Poᷣtrayãs en fus ⁊ en peꝛꝛeˢ
- * En metaulx en os ⁊ en cyꝛes
- * Et en touteˢ aultres matires.
- * Quon peult a tel oeuure trouuer.
- * Poᷣ ſon grant engin eſpꝛouuer.
- * Car maiſtre en fu bien dire loz.
- * Ainſi com poᷣ acquerre loz
- * Se voult a poᷣtraire deduyꝛe
- * Si fiſt vng ymage diuuyꝛe
- * Et miſt au faire tel entente
- * Quel fu ſi plaiſãt et ſi gente
- * Quel ſembloit eſtre auſſi viue.
- * Com la plus belle riens q̇ viue
- * (MS. Douce 195, fol. 149r)
- */
-
-modify _init()
-{
- ({: local r, r = randomize, r})();
- replaced();
-}
-
-gameMain: GameMainDef
- initialPlayerChar: Actor {
- desc = "You look the same as usual, but you feel unusually
- sentimental. "
- location = entrance
- }
- showIntro
- {
- "The statue is undeniably a masterpiece: the most skillful carving you
- have ever done, and the most beautiful woman you have ever seen.
- Unfortunately, she is also an inanimate block, and now you can neither
- work nor rest for unrequitable love.\b
- Once again you stumble into your studio, hoping and praying to find
- your statue brought to life.\b
- <b><<versionInfo.name>></b>\r\n
- <<versionInfo.byline>>\b";
- }
-;
-
-enum token token, tokOp, token;
-
-modify cmdTokenizer
- rules_ = static
- [
- ['whitespace', new RexPattern('%s+'), nil, &tokCvtSkip, nil],
- ['punctuation', new RexPattern('[.,;:?!]'), tokPunct, nil, nil],
- ['spelled number',
- new RexPattern('<NoCase>(twenty|thirty|forty|fifty|sixty|'
- + 'seventy|eighty|ninety)-'
- + '(one|two|three|four|five|six|seven|eight|nine)'
- + '(?!<AlphaNum>)'),
- tokWord, &tokCvtSpelledNumber, nil],
- ['spelled operator', new RexPattern(
- '<NoCase>(plus|positive|minus|negat(iv)?e|not|inverse(%s+of)?|'
- + 'times|over|divided%s+by|mod(ulo)?|and|xor|or|[al]?sh[lr])'
- + '(?!<AlphaNum>)'),
- tokOp, &tokCvtSpelledOperator, nil],
- ['operator', R'[-!~+*/%&^|]|<<|>>>?', tokOp, nil, nil],
- ['word', new RexPattern('<Alpha|-|&><AlphaNum|-|&|squote>*'),
- tokWord, nil, nil],
- ['string ascii-quote', R"""<min>([`\'"])(.*)%1(?!<AlphaNum>)""",
- tokString, nil, nil],
- ['string back-quote', R"<min>`(.*)'(?!%w)", tokString, nil, nil],
- ['string curly single-quote', new RexPattern('<min>\u2018(.*)\u2019'),
- tokString, nil, nil],
- ['string curly double-quote', new RexPattern('<min>\u201C(.*)\u201D'),
- tokString, nil, nil],
- ['string unterminated', R'''([`\'"\u2018\u201C](.*)''', tokString,
- nil, nil],
- ['integer', new RexPattern('[0-9]+'), tokInt, nil, nil]
- ]
- replace tokCvtSpelledOperator(txt, typ, toks)
- {
- toks.append([rexReplace(R'%s+', txt.toLower(), '\\'), typ, txt]);
- }
-;
-
-/* Tokens */
-
-/*
- * Puiˢ li reueſt en maĩteˢ guiſes.
- * Robeˢ faicteˢ ꝑ grãˢ maiſtriſeˢ.
- * De biaulx dꝛaps de ſoye ⁊ de laĩe.
- * Deſcarlate de tiretaine
- * De vert de pers ⁊ de bꝛunecte
- * De couleᷣ freſche fine ⁊ necte
- * Ou moult a riches paneˢ miſes.
- * Herminees vaires et griſes
- * Puis les li roſte puis reſſaye.
- * Cõmant li ſiet robbe de ſaye
- * Sendaulx meloguins galebꝛunˢ.
- * Indes vermeilz iaunes ⁊ bꝛunˢ.
- * [...]
- * Aultre foiz luy repꝛẽd courage.
- * De tout oſter ⁊ mectre guindeˢ.
- * Iaunes vermeilles vers ⁊ indeˢ.
- * (MS. Douce 195, fol. 150r)
- */
-
-class Token: Achievement
-{
- points = 1;
- desc = "<<before_>><<desc_>><<after_>>";
- before = before = '', before_
- after = (after = '', after_)
-}
-
-Token template inherited 'before_' 'after_' 'desc_';
-
-#define DefineToken(name, before, after) name##Token: Token before after #@name
-
-DefineToken(builtin, '<font color=g&#x72;een>', '</font>');
-DefineToken(comment, '<i><font color=#408080>', '</font></i>');
-DefineToken(decorator, '<font color=#aa22ff>', '</font>');
-DefineToken(error, '<U><FONT COLOR=RED>', '</FONT></U>');
-DefineToken(escape, '<b><font color=#bb6622>', '</font></b>');
-DefineToken(float, '<u><font color=gray>', '</font></u>');
-DefineToken(keyword, '<b><font face=TADS-Sans color=green>', '</font></b>');
-DefineToken(label, '<font color=#A0A000>', '</font>');
-DefineToken(long, '<i><font color=gray>', '</font></i>');
-DefineToken(name, '<u>', '</u>');
-DefineToken(operator, '<b><font color=\"#AA22F&#x46;\">', '</font></b>');
-DefineToken(string, '<font color=\'#BA212&#49;\'>', '</font>');
-DefineToken(whitespace, '<font color="bgcolor"bgcolor=\'text\'>', '</font>');
-
-function highlightToken(tokenString)
-{
- local token = [
- 'built in' -> builtinToken,
- 'comment' -> commentToken,
- 'decorator' -> decoratorToken,
- 'error' -> errorToken,
- 'escape' -> escapeToken,
- 'float' -> floatToken,
- 'keyword' -> keywordToken,
- 'label' -> labelToken,
- 'long' -> longToken,
- 'name' -> nameToken,
- 'operator' -> operatorToken,
- 'string' -> stringToken,
- 'white space' -> whitespaceToken,
- * -> nil
- ][tokenString.toLower()];
- if (!token)
- return tokenString;
- token.awardPointsOnce();
- return '<<token.before>><<tokenString>><<token.after>>';
-}
-
-string /**//**/ // /* \\
-#define Room Unthing
- template <<highlight *>> highlightToken;
-
-/* Grammar for materials */
-
-dictionary property material;
-grammar adjWord(material): <material material>->adj_ : AdjPhraseWithVocab
- getVocabMatchList(resolver, results, extraFlags)
- {
- return getWordMatches(adj_, &material, resolver, extraFlags,
- VocabTruncated);
- }
- getAdjustedTokens()
- {
- return [adj_, &material];
- }
-;
-
-/* Rooms and objects */
-
-+ property location;
-
-entrance: Room 'Entrance'
- "You are in the entrance to your studio. This is where you carve great
- works of art, not that you have felt like making any lately. A door leads
- outside, and the studio itself is to the north and the east. "
- north = workbenchRoom
- northeast = sinkRoom
- east = altarRoom
- south = door
- out asExit(south)
-;
-
-+ door: LockableWithKey, Door 'door' 'door'
- "It is a simple wooden door. "
- material = 'wood' 'wooden'
- keyList = [key]
- cannotOpenLockedMsg = '{The dobj/He} {is} locked. You cannot
- <<highlight 'escape'>>! '
-;
-
-key: PresentLater, Key 'key' 'key' @altar
- "It is a <<unless clean>>grimy<<end>> bronze key. <<if clean>>On it is \
- etched the word <q><<keyword>></q>. "
- material = 'bronze'
- clean = nil
- keyword = (keyword = randomGreekWord(), targetprop)
- dobjFor(Clean) { verify { } action { askForIobj(CleanWith); } }
- dobjFor(CleanWith)
- {
- verify
- {
- if (clean)
- illogicalAlready('{The dobj/He} {is} already clean. ');
- }
- action
- {
- gDobj.clean = true;
- "{You/He} clean{s} {the dobj/him}, revealing an inscription. ";
- }
- }
- dobjFor(Read) { verify { nonObvious; } }
-;
-
-workbenchRoom: Room 'At the Workbench'
- "This workbench, in the northwest part of the studio, was where you would
- create works of art. Now you just come here to contemplate your
- creation&rsquo;s beauty and lament your hopeless situation.\b
- The statue stands on a plinth beside the workbench. "
- east = sinkRoom
- southeast = altarRoom
- south = entrance
- getDestName(actor, origin) { return 'the workbench'; }
-;
-
-+ workbench: Fixture, Surface
- 'workbench/bench/material/materials/tool/tools' 'workbench'
- "Normally, the workbench would be scattered with half-finished projects,
- but now your tools and materials lie abandoned. "
-;
-
-+ plinth: Fixture, Thing 'marble plinth/pedestal' 'plinth'
- "It&rsquo;s a smoothed block of marble about a cubit high. "
-;
-
-replace grammar predicate(Screw): ' ': object;
-replace grammar predicate(ScrewWith): ' ': object;
-+ + statue: Fixture, Surface
- '"creation\'s" beauty/carving/creation/galatea/statue/woman' 'statue'
- "This is a<<if nameToken.scoreCount>>n untitled<<end>> statue of a woman
- carved from <<if errorToken.scoreCount>>flawless <<end>>
- <<if whitespaceToken.scoreCount>>milk-white <<end>>ivory.
- <<if escapeToken.scoreCount || longToken.scoreCount>>Her
- <<if longToken.scoreCount>>long <<end>>hair is done up in a
- chignon<<if escapeToken.scoreCount>>, with a few strands falling down her
- neck<<end>><<if floatToken.scoreCount>>, and \v<<else>>.<<end>><<end>>
- <<if floatToken.scoreCount>>She radiates an aura of contrapposto grace.
- <<end>><<if keywordToken.scoreCount>>\bYou wonder what she
- <<if labelToken.scoreCount>>is going to<<else>>will<<end>> be like as a
- woman.
- <<if decoratorToken.scoreCount>>Maybe she&rsquo;ll be a painter and expand
- your business.<<end>>
- <<if operatorToken.scoreCount>>Maybe she&rsquo;ll have a head for figures
- and will put the accounts in order.<<end>>
- <<if builtinToken.scoreCount>>She&rsquo;ll love you, obviously, but beyond
- that you don&rsquo;t know.<<end>><<end>>
- <<if commentToken.scoreCount>>If only Aphrodite would bring her to life
- without this silly puzzle about tokens and mirrors!<<end>> "
- material = 'ivory'
- propertyset 'is*'
- {
- propertyset 'H*'
- {
- im = nil\
- er = true;
- }
- It = true
- }
- iobjFor(PutOn)
- {
- check
- {
- if (gDobj not /**//**/ // /* \\
-#define Room Unthing
- in (necklace, __objref(necklace, warn)))
- "How rude! You don&rsquo;t know what you were thinking. ";
- }
- }
- iobjFor(GiveTo) remapTo(PutOn, DirectObject, IndirectObject)
-;
-
-+++ necklace: Wearable
- 'pearl necklace/string pearls' '<<highlight 'string'>> of pearls'
- "This is a masterfully crafted pearl necklace. You hope the statue
- won&rsquo;t mind if you hold onto it for a while. "
- initDesc = "You gave the statue this pearl necklace yesterday. "
- isPlural = true
-;
-
-altarRoom: Room 'At the Altar'
- "Light from the window illuminates a crude altar. Until recently, this
- corner was your bedroom. The rest of the studio lies north and west. "
- north = sinkRoom
- northwest = workbenchRoom
- west = entrance
- getDestName(actor, origin) { return 'the altar'; }
-;
-
-+ window: Fixture 'window' 'window'
- "It&rsquo;s just a window above the altar. <<one of>>The space under the
- window is blank; as an interior <<highlight 'decorator'>>, you can&rsquo;t
- help but think the wall would benefit from a bas-relief, but &ndash;
- <i>sigh</i> &endash you are too lovelorn to wield the chisel. <<||>>The
- wall right below it is a boring <<highlight 'white space'>>. <<stopping>>"
-;
-
-+ altar: Fixture, Surface 'crude rough altar/banker/slab' 'altar'
- "A rough marble slab lies on a wooden banker. In your rush to construct an
- altar, you neglected the usual surface finish and friezes, but you pray at
- it anyway. You are sure the gods will understand. "
- material = 'marble' 'wood' 'wooden'
- bulkCapacity = 1
- dobjFor(PrayAt)
- {
- verify { }
- action()
- {
- /*
- * Biaulx dieux diſt il tout ce poez.
- * Sil voꝰ plaiſt ma requeſte oez
- * [...]
- * Et la belle q̇ mon cueᷣ emble
- * Qui ſi bien yuoyꝛe reſſemble.
- * Deuiengne ma loyal amye
- * De fẽme ait coꝛps ame et vie
- * (MS. Douce 195, fol. 151r)
- */
- local offering;
- foreach (offering in contents);
- if (!keywordToken.scoreCount)
- "<<one of>><q>O Aphrodite,</q> you say, <q>comforter of
- hopeless lovers, hear my prayer! May she to whom I have given
- my heart be given body, soul, and life. And a colorful
- personality. And&mdash</q>\b
- You are interrupted by a shimmering about the altar. As you
- watch, it takes the form of a callipygian goddess.\b
- <q>Mortal, I have heard your heart-felt and oft-repeated plea,
- and I will take pity on you,</q> says Aphrodite. <q>If you give
- me a token of your love as an offering, I will give you the
- <<highlight 'keyword'>> of life. Speak this word in the
- presence of a mirror, and I will grant your request.</q>\b
- She fades away, adding, <q>As for her colorful personality,
- just look around you.</q> <<or>><<stopping>>";
- else if (key.location)
- "<q>O Aphrodite,</q> you say, <q>what am I supposed to do
- again?</q>\bThe goddess reappears and reminds you to speak the
- keyword of life at a mirror. <<one of>><q>What&rsquo;s the
- keyword, then?</q> <q>Gods help those who help themselves.
- Figure it out yourself.</q><<or>><q>Why a mirror?</q> <q>I like
- mirrors.</q><<purely at random>> ";
- else if (offering == necklace)
- {
- "Aphrodite reappears. <q>A necklace! Perfect!</q> The necklace
- disappears in a bright flash. When your eyes readjust, you see
- a key lying in its place. ";
- necklace.moveInto(nil);
- key.makePresent();
- }
- else if (+offering)
- "Aphrodite reappears. She eyes <<offering.theNameObj>>
- skeptically. <q><<one of>>No <<highlight 'comment'>>.<<or>>You
- call <i>that</i> a token of love?<<or>>\^<<offering.aNameObj>>?
- Really?<<or>>Come on, mortal, it&rsquo;s not that
- difficult!<<then at random>></q> ";
- else
- "<q>I heard you the first time,</q> says Aphrodite. <q>Prove
- your devotion by offering a token of your love at the altar,
- or the deal&rsquo;s off.</q> ";
- }
- }
- iobjFor(GiveTo) remapTo(PutOn, DirectObject, IndirectObject)
-;
-
-aphrodite: Unthing
- '(love) aphrodite/cytherea/god/goddess/venus love' 'Aphrodite'
- '<<if gActor.canSee(altar)>>You can only pray to a god.
- <<else>>You need an altar to interact with a god. '
- location = (gPlayerChar)
- isProperName = true
- isHer = true
- iobjFor(GiveTo)
- {
- verify
- {
- illogical('She isn&rsquo;t here. You&rsquo;ll have to leave {the
- dobj/him} somewhere she can find it. ');
- }
- }
- dobjFor(PrayAt) maybeRemapTo(gActor.canSee(altar), PrayAt, altar)
-;
-
-sinkRoom: Room 'Washroom'
- "Sculpting marble is a dusty business. You use this sink to clean off after
- a hard day&rsquo;s work. Beside the sink is a small end table, and on the
- wall is a calculator. The rest of the studio is south and west. "
- south = altarRoom
- southwest = entrance
- west = workbenchRoom
-;
-
-property level, overflowing;
-export overflowing;
-export level 'waterLevel';
-+ sink: Fixture '(auto) (mop) auto-sink/autosink/bowl/drain/faucet/sink' 'sink'
- "This is a state-of-the-art mop sink with anti-miasmic coating and bronze
- backsplash. It is so modern, there are no handles or other obvious ways to
- turn it on.\b
- <<if overflowing>>It is overflowing.
- <<else unless level < 19500>>It is full to the brim with water.
- <<otherwise if level >= 15000>>It is full of water.
- <<otherwise unless level < 10000>>It is half full of water.
- <<else if level >= 2000>>There is some water in the sink.
- <<else if level > 0>>A small puddle has formed at the bottom of the sink.
- <<otherwise>>It is empty.
- <<if level <= -1.0e+2>>It looks like it hasn&rsquo;t been used in a
- <<highlight 'long'>> time. "
- level = not in ([lst]) { return argcount; }
- not = in()
- overflowing = nil
- current = self
- setLevel(level:)
- {
- targetobj.current.overflowing = level == nil;
- targetobj.current.level = min(level ?? 0, 20000);
- if (sink.overflowing || sink.level > 0e+1)
- sinkWater.makePresent();
- if (basin.overflowing || basin.level > 0e-1)
- basinWater.makePresent();
- }
- iobjFor(CleanWith) remapTo(CleanWith, DirectObject, sinkWater)
-;
-
-++ sinkWater: PresentLater, Fixture
- '(sink) water sink water' 'water' "<<sink.desc>>"
- disambigName = 'water in the sink'
- dobjFor(Drink)
- {
- verify { illogical('''{You're} not thirsty. '''); }
- }
- iobjFor(CleanWith)
- {
- preCond = []
- verify {
- if (!location)
- illogicalNow('There is no water in the sink. ');
- if (!sink.overflowing && sink.level < 1e2)
- illogicalNow('There is not enough water in the sink. ');
- }
- }
-;
-
-+ table: Fixture, Surface 'small end bracket/table' 'table'
- "<<first time>>Upon closer inspection, you see that \v<<only>>The table is
- bracketed to the wall. "
-;
-
-++ Readable '"operator\'s" manual' 'manual'
- "<center ><<highlight 'Operator'>>&rsquo;s Manual<\center>\b
- <bq>To control the auto-sink, use the calculator add-on to enter the
- desired volume of water. For example,\n
- \t\t<<aHref('calculate 69 * 105', 'CALCULATE 69 TIMES 105')>>\n
- to fill the basin with <<% ,d 0x69 * 0105>> kochliaria<!-- an ancient Greek
- unit, < 5 ml >.\b
- Warning: Do not use big numbers or divide by zero!<\\bq>\b"
- dobjFor(Read) asDobjFor(Examine)
-;
-
-+ calculator: Fixture, Thing 'button/buttons/calculator/screen' 'calculator'
- "The calculator is <<highlight 'built in'>>to the wall beside the sink. It
- has buttons for all the standard unary and binary operations.
- <<if(screen)>>The screen reads <<screen>>"
- screen = nil
- literalMatch = ''
-;
-
-method wrongContextMsg()
-{
- return '<font face="TADS-Typewriter"><<highlight '<<'ERROR'>>'>> {{can\'t
- use\ \"<<self.literalMatch>>\" in that context}}</font>. ';
-}
-
-portico: OutdoorRoom 'Portico'
- "Columns line the portico stretching east and west, and steps lead down to
- the south. The door leads back in, and beside the door is a basin. A
- <<highlight 'label'>> is affixed to the doorpost. "
- north = (__objref(error, error))
- in asExit(north)
- south: FakeConnector
- {
- "You begin moving away from the door, but then you remember the statue.
- The gods won&rsquo;t bring her to life if you give up this easily!
- <<setMethod(&isConnectorApparent, {origin, actor: nil})>>"
- }
- east asExit(south)
- west asExit(south)
- down asExit(south)
-;
-
-error: LockableWithKey, Door ->door 'door' 'door' @portico "<<door.desc>>"
- keyList = (otherSide.keyList)
-;
-
-+ Fixture 'column*columns' 'columns'
- "There are six <<one of>>short columns with simple capitals<<or>>slender
- columns with scrollwork in the capitals<<or>>tall columns with ornate
- capitals<<sticky random>>. Above the architrave is a frieze depicting some
- of your wares. <<first time>>The cornice overhangs the frieze a bit too
- much, you think; perhaps you should shorten it. You try to concentrate on
- the architecture of the portico, stoically ignoring what you cannot change,
- but it doesn&rsquo;t work. It never does. <<only>>"
- isPlural = true
-;
-
-+ Fixture, Readable 'label/doorpost' '<<highlight 'label'>>'
- "The <<highlight 'label'>> says <q>Pygmentalion</q><<first time>> (which is
- your <<highlight 'name'>>)<<only>>. "
- dobjFor(Read) asDobjFor(Examine)
-;
-
-+ basin: RestrictedContainer, Fixture
- '(bird) basin/bath/birdbath/fountain/mosaic/pool/tile/tiles' 'basin'
- "It is shallow but wide, and lined with tiles. It used to be a fountain,
- but it stopped working after they installed the new sink. Something to do
- with water pressure, no doubt. Now you just use it as a birdbath.\b
- <<if overflowing>>Water is spilling over the sides in a turbulent flow.
- <<else if level >= 19500>>It is full to the brim with water. You can see
- your reflection quite clearly. Gods, you look a mess.
- <<else if level >= 15000>>It is full of water. You can see your reflection.
- <<else if level >= 10000>>It is half full. From the right angle, you can
- make out a shadowy reflection of the columns, but nothing more.
- <<else if level >= 2000>>There is some water in it, but you can still make
- out the mosaic lining the basin.
- <<else if level > 0>>A small puddle has formed at the bottom of the basin.
- <<else>>It is empty.
- <<if level <= -1.0e+2>>It looks as if it has never been filled. "
- level = 0
- overflowing = nil
- isMirror = (level >= 15000)
- setLevel(level:)
- {
- delegated sink.setLevel(_: sourceTextOrder ? level: nil, level: level);
- }
- iobjFor(CleanWith) maybeRemapTo(basinWater.location, CleanWith,
- DirectObject, basinWater)
-;
-
-++ basinWater: PresentLater, Fixture '(basin) water basin water' 'water'
- "<<basin.desc>>"
- disambigName = 'water in the basin'
- dobjFor(Drink)
- {
- verify
- {
- illogical('Drinking from a birdbath might not be the best idea. ');
- }
- }
- iobjFor(CleanWith)
- {
- preCond = [touchObj]
- verify {
- illogical('Washing something in a birdbath is unlikely to get it
- clean. ');
- }
- }
-;
-
-++ feather: PresentLater, Thing
- '(bird) (dove) (pigeon) (turtle) (turtle-dove) (turtledove) feather'
- 'feather' "It&rsquo;s a turtle-dove feather: an auspicious omen! "
- initSpecialDesc = "<<one of>>A little brown bird is splashing around in the
- basin. When it notices you, it ruffles its feathers, one of which falls
- out, and flies out between the columns. <<or>>A feather is
- <<if basin.overflowing || basin.level > 0>><<highlight 'float'>>ing
- <<else>>lying <<end>> in the basin. <<stopping>>"
-;
-
-/* Water */
-
-trickling(water) multimethod
-{
- if (sink.overflowing)
- {
- dirs: for (local dir in Direction.allDirections)
- {
- if (dir.ofKind(RelativeDirection))
- continue;
- if (dir.ofKind(ShipboardDirection))
- continue dirs;
- if (water.eventualLocation.(dir.dirProp) == __objref(entrance))
- return 'trickling <<dir.name>>';
- }
- }
- return 'a stagnant puddle';
-}
-
-class Water:PresentLater,Fixture'(floor) (ground) water puddle water''water'
- "The water on the floor is <<trickling(self)>>. "
- disambigName = 'water on the floor'
- specialDesc = "The floor is covered with water. "
- dobjFor(Drink)
- {
- preCond = [touchObj]
- verify { }
- check { failCheck('{You\'re} not thirsty. '); }
- }
- iobjFor(CleanWith)
- {
- preCond = [touchObj]
- verify { illogical('The water on the ground is too dirty. '); }
- }
-;
-
-Water template +location | ~location "specialDesc"? inherited;
-Water +altarRoom;
-Water +sinkRoom { ;; };
-Water { +workbenchRoom };
-
-entranceWater: Water +entrance
- "<<if sink.overflowing>>At your feet, all the water from the sink flows
- into a <<%-o 02>>-dactyl slit in the baseboard. <<else>><<inherited>>"
- vocabWords = 'water baseboard/puddle/slit water'
-;
-trickling(entranceWater w)
-{
- return sink.overflowing ? 'trickling into the wall' : inherited<*>(w);
-}
-
-porticoWater: Water ~portico;
-trickling(porticoWater w)
-{
- return basin.overflowing ? 'trickling down the stairs' : inherited<*>(w);
-}
-
-/* Calculating */
-
-;;;class is: Exception { finalize { } };;; // InvalidSpecificationError
-
-DefineLiteralAction(Calculate)
- checkAction()
- {
- if (defined(calculator) && !gActor.canTouch(calculator))
- {
- { gActor.failCheck('{You/He} {can\'t} do that kind of math in
- {your} head. '); }
- }
- }
- execAction()
- {
- local op = function(...) { throw new is(); }, a, b;
- local opString = (literalMatch, literalMatch);
- if (numMatch)
- goto binary;
- switch (opString)
- {
- case '!':
- case 'not':
- opString = '!';
- op = {x : !toInteger('<<%_\u0030[1]5.3\170x>>', 16)};
- break;
- case '+':
- case 'plus':
- case 'positive':
- opString = '+';
- op = {self_ : self_};
- break;
- case '-':
- case 'minus':
- case 'negate':
- case 'negative':
- opString = '&#x2212;';
- op = {x : -x};
- break;
- case '~':
- case 'inverse':
- case 'inverse\\of':
- opString = '~';
- op = {x : ~x};
- break;
- }
- goto doCalculation;
- binary: binaryOp:
- switch (opString)
- {
- case '+':
- case 'plus':
- opString = '+';
- op = {a, b : +a+++b};
- break binaryOp;
- case '-':
- case 'minus':
- opString = '&#8722;';
- op = {a, b : -b-- - -a};
- break;
- case '*':
- case 'times':
- opString = '&times;';
- op = new function(a, b) { return a * b; };
- break;
- case '/':
- case 'over':
- case 'divided\\by':
- opString = '/';
- op = function(a, b) { return a / b; };
- break;
- case '%':
- case 'mod':
- case 'modulo':
- opString = 'mod';
- op = function(a, b, multimethod=b) { return a % multimethod; };
- break;
- case '\<<':
- case 'shl':
- case 'ashl':
- case 'lshl':
- opString = '&lt;&lt;';
- op = {a, b, c? : a << b};
- break;
- case '&':
- case 'and':
- opString = '&amp;';
- op = {a, b : local badness = a, local token = b, badness & token};
- break;
- case '^':
- case 'xor':
- opString = '^';
- op = {a, b, c? : a ^ b};
- break;
- case '|':
- case 'or':
- opString = '|';
- op = {a, b : a | b};
- break;
- case '>\>':
- case 'shr':
- case 'ashr':
- opString = '>>';
- op = {a, b : toInteger('<<(a >> b)>>')};
- break;
- case '>>>':
- case 'lshr':
- opString = '>>>';
- op = {a, b : b ? invokee(a >>> 1, --b) : a};
- break;
- }
- opString = ' <<opString>> ';
- doCalculation:
- "The calculator outputs ";
- try
- {
- a = numMatch ? numMatch.getval(colon : nil) : nil;
- b = numMatch2.getval();
- local result = toInteger(numMatch ? op(a, b) : op(b));
- calculator.setMethod(&screen, method()
- {
- return '<font face="TADS-Typewriter"><<a>><<opString>><<b>> =
- <<%d result>></font>. ';
- });
- local oldLevel = sink.level;
- sink.current.setLevel(level: result);
- "<<calculator.screen()>>
- <<if sink.current == basin>>The sink gurgles and the pipes rattle.
- <<else if sink.level == oldLevel>>The sink gurgles.
- <<else if sink.level <= 0 && oldLevel <= 0>>The pipes rattle for a
- moment.
- <<else if sink.level <= 0>>All the water drains from the sink.
- <<else if oldLevel <= 0>>The sink begins to fill with water.
- <<else if sink.level < oldLevel - 0xabc>>Some of the water drains
- from the sink.
- <<else if sink.level < oldLevel>>The water level drops slightly.
- <<else if oldLevel < sink.level - 0XABC>>Water splashes into the
- sink for a few seconds.
- <<else if oldLevel < sink.level>>Water dribbles from the faucet. ";
- }
- catch (is in)
- {
- calculator.literalMatch = literalMatch;
- calculator.setMethod(&screen, &wrongContextMsg);
- "<<calculator.screen()>>";
- }
- catch (RuntimeError e)
- {
- calculator.setMethod(&screen, new method
- {
- return '<font face=\"TADS-Typewriter\"><<highlight 'ERROR'>>
- {{<<e.exceptionMessage>>}}</font>.\b';
- });
- "<<calculator.screen()>>";
- switch (e.errno_)
- {
- case 2008: // division by zero
- "<<if sink.current == sink
- && (sink.level > 0 || sink.overflowing)>>The water in the
- sink is sucked down the drain.
- <<else if basin.level > 0 || basin.overflowing>>Water comes up
- from the drain and <<if basin.overflowing>>spills over
- the edges of<<else>>begins to fill<<end>> the sink.
- <<else>>The sink gurgles and the pipes rattle. ";
- sink.current = sink.current == sink ? basin : sink;
- local _tmp = sink.level;
- sink.level = basin.level;
- basin.level = _tmp;
- _tmp = sink.overflowing;
- sink.overflowing = basin.overflowing;
- basin.overflowing = _tmp;
- if (!sink.current.overflowing)
- break;
- // fall through
- case 2023: // numeric overflow
- if (!sink.current.overflowing)
- "<<if sink.current == sink>>High-pressure water streams
- from the faucet, filling the sink and spilling over the
- edge. Rivulets begin running down the slight gradient of
- the floor. <<else>>The pipes shake loudly. ";
- forEachInstance(Water, function(w) {
- if ((w.eventualLocation == portico) ==
- (sink.current == basin))
- w.makePresent();
- });
- sink.current.setLevel(level: nil);
- break;
- default:
- throw e;
- }
- }
- if (!gPlayerChar.hasSeen(feather))
- {
- feather.makePresentIf(basin.isMirror);
- feather.moved = nil;
- }
- }
-;
-
-VerbRule(Calculate)
- ('c' | 'calculate' | 'enter' | 'eval' | 'evaluate') (()|(singleNumber|))
- (tokOp->literalMatch | '!'->literalMatch) numberPhrase -> numMatch2
- : CalculateAction
- verbPhrase = 'calculate/calculating (what) (how) (what)'
-;
-
-/* Cleaning */
-
-modify VerbRule(Clean)
- [ /**//**/ // /* \\
-#define Room Unthing
- badness 500] ('clean' | 'wash') dobjList:
-;
-
-grammar predicate(CleanIn):
- ('clean' | 'wash') dobjList ('at' | 'in' | 'with') singleIobj
- : CleanWithAction
- verbPhrase = 'clean/cleaning (what) (in what)'
- askIobjResponseProd = inSingleNoun
- omitIobjInDobjQuery = true
-;
-
-/* Prayer */
-
-VerbRule(Pray)
- [badness 500] 'pray' singleDobj
- : PrayAtAction
- verbPhrase = 'pray/praying (at what)'
-;
-
-VerbRule(PrayAt)
- 'pray' ('at' | 'to') singleDobj
- : PrayAtAction
- verbPhrase = 'pray/praying (at what)'
- askDobjResponseProd = singleNoun
-;
-
-DefineTAction(PrayAt);
-modify Thing
- dobjFor(PrayAt)
- {
- verify
- {
- illogical('{You/He} {cannot} pray at {that dobj/him}. ');
- }
- }
-;
-
-/* Extended grammar for 'in' and 'out' */
-
-modify grammar directionName(in): 'in' | 'inside':
- dir = inDirection
-;
-modify /**//**/ // /* \\
-#define Room Unthing
- grammar directionName(out): 'out' | 'outside':
- dir = outDirection
-;
-
-/* Speech */
-
-DefineLiteralAction(Say)
- execAction
- {
- local literal = getLiteral().toLower();
- if (literal is in ('xyzzy', 'plugh'))
- tryImplicitActionMsg(&silentImplicitAction, Xyzzy);
- else if (literal != key.keyword)
- "Nothing happens. ";
- else if (literal not in ())
- {
- if (gActor.location == portico && basin.isMirror)
- {
- if (feather.location == basin)
- "The air above the basin shimmers, and the feather bobs on
- the rippling water. After a moment, the shimmering
- disappears.";
- else
- {
- /*
- * Venus q̇ la pꝛiere ouyt
- * [...]
- * A lymage ẽuoya loꝛs lame.
- * Si deuĩt ſi treſbelle dame.
- * Quoncq̄s en toute la contree.
- * Not len ſi belle encontree.
- * [...]
- * Doulx amys aĩs ſuy vꝛ̄e amye.
- * Pꝛeſte de voſtre compaignye.
- * Receuoir ⁊ mamoᷣ voꝰ offre.
- * Sil voꝰ plaiſt receuoir tel offre.
- * (MS. Douce 195, fol. 151v)
- */
- "The air above the basin shimmers for a moment. You hear
- the door opening behind you. Turning around, you see a
- woman who looks suspiciously like your statue, except not
- the color of marble.\b
- <q>Hello, world,</q> she says. <q>It&rsquo;s nice to be
- alive at last! Hello, dearest Pygmentalion.</q>\b
- Ah, what beauty! What mastery of syntax! Praise be to
- Aphrodite! ";
- finishGameMsg(ftVictory,
- [finishOptionUndo, finishOptionFullScore]);
- }
- }
- else
- "Nothing happens. <<if keywordToken.scoreCount>>Aphrodite said
- you would need a mirror. <<end>>";
- }
- }
-;
-
-VerbRule(Say)
- ('say' | 'shout') singleLiteral
- : SayAction
- verbPhrase = 'say/saying (what)'
-;
-
-VerbRule(SayTo)
- ('say' | 'shout') singleLiteral ('at' | 'to') singleIobj
- : SayAction
- verbPhrase = 'say/saying (what) (to what)'
-;
-
-/**/ #if /* Revere the basileus. */ 0 \
- // Expel the barbarian.
-;
- #ifndef __DEBUG
-;
- #define __DEBUG
-;
-# else
-;
-#if 1
-;
- #define DEBUG__
-;
-#endif
-;
- #endif
-;\\
-#endif
-/*
-#endif
-?*/
-//\\
-#endif
-'''
-#endif
-'\''''
-#endif
-\\'''
-"""
-#endif
-"\""""
-#endif
-\\"""
-'
-#endif
-\'
-#endif
-\\'
-"
-#endif
-\"
-#endif
-\\"
-'''<<'<<'
-#endif
-'>>'>>
-#endif
-'''
-"""<<'<<'
-#endif
-'>>'>>
-#endif
-"""
-'<<'<<'
-#endif
-'>>'>>
-#endif
-'
-"<<'<<'
-#endif
-'>>'>>
-#endif
-"//"
-\
- # endif
-;
-dictionary barbarianDict;
-transient xyzzy: object;
-DefineIAction(Xyzzy)
- execAction
- {
- "Only a barbarian could pronounce such a word. ";
- local oldSay = t3SetSay({str : nil});
- try
- {
- new transient Vector([
- '<<one of>><< cycling >>',
- '<<one of>><< at random>>',
- '<<one of>><<then purely at random>>',
- '<<one of>><<as decreasingly likely outcomes>>',
- '<<one of>><< shuffled>>',
- '<<one of>><< half shuffled>>',
- '<<one of>><<then shuffled>>',
- '<<one of>><<then half shuffled>>']);
- '''''<font x= color=red bgcolor='silver' face="TADS-Sans"
- size=\'+1\' x=\"x\">{can't}</font>\'''' '' '''';
- """""<font x= color=red bgcolor='silver' face="TADS-Sans"
- size=\'+1\' x=\"x\">{can't}</font>\"""" "" """";
- '<font x= color=red face="TADS-Sans" size=\'+1\'
- x=\"x\">{can\'t}</font>\'';
- "<font x= color=red bgcolor='silver' size=\'+1\'
- x=\"x\">{can\'t}</font>\"";
- '''''<font <<'color=red'>> bgcolor<<'='>>silver
- face=<<'"TADS-Sans"'>>>{ca<<'n\''>>t}</font>\'''' '' '''';
- """""<font <<'color=red'>> bgcolor<<'='>>silver
- face=<<'"TADS-Sans"'>>>{ca<<'n\''>>t}</font>\"""" "" """";
- '<font <<'color=red'>> bgcolor<<'='>>silver
- face=<<'"TADS-Sans"'>>>{ca<<'n\''>>t}</font>\'';
- "<font <<'color=red'>> bgcolor<<'='>>silver
- face=<<'"TADS-Sans"'>>>{ca<<'n\''>>t}</font>\"";
- '''<s a1={\.}a a2=a{\>} a3=a{\>}a b1='{\>}b' b2='b{\>}' b3='b{\>}b'
- c1="c{\>}" c2="{\>}c" c3="c{\>}c" d1=\'d{\>}\' d2=\'{\>}d\'
- d3=\'d{\>}d\' e1=\"e{\>}\" e2=\"{\>}e\" e3=\"e{\>}e\"></s>''';
- """<s a1={\.}a a2=a{\>} a3=a{\>}a b1='{\>}b' b2='b{\>}' b3='b{\>}b'
- c1="c{\>}" c2="{\>}c" c3="c{\>}c" d1=\'d{\>}\' d2=\'{\>}d\'
- d3=\'d{\>}d\' e1=\"e{\>}\" e2=\"{\>}e\" e3=\"e{\>}e\"></s>""";
- '<s a1={\.}a a2=a{\>} a3=a{\>}a c1="c{\>}" c2="{\>}c" c3="c{\>}c"
- d1=\'d{\>}\' d2=\'{\>}d\' d3=\'d{\>}d\' e1=\"e{\>}\" e2=\"{\>}e\"
- e3=\"e{\>}e\"></s>';
- "<s a1={\.}a a2=a{\>} a3=a{\>}a b1='{\>}b' b2='b{\>}' b3='b{\>}b'
- d1=\'d{\>}\' d2=\'{\>}d\' d3=\'d{\>}d\' e1=\"e{\>}\" e2=\"{\>}e\"
- e3=\"e{\>}e\"></s>";
- '''{a<<1>>b}'''; """{a<<1>>b}"""; '{a<<1>>b}'; "{a<<1>>b}";
- '''<s a<<'='>>'1' b<<'='>>"2" c<<'='>>\'3\' d<<'='>>\"4\"
- <<'e'>>=5 f=6' g=7">''';
- """<s a<<'='>>'1' b<<'='>>"2" c<<'='>>\'3\' d<<'='>>\"4\"
- <<'e'>>=5 f=6' g=7">""";
- '<s b<<'='>>"2" c<<'='>>\'3\' d<<'='>>\"4\" <<'e'>>=5 g=7">';
- "<s a<<'='>>'1' c<<'='>>\'3\' d<<'='>>\"4\" <<'e'>>=5 f=6'>";
- '''<s a=v\\ a=v\ v\><s a='{'}'\><s a="{"}"\>''';
- """<s a=v\\ a=v\ v\><s a='{'}'\><s a="{"}"\>""";
- '<s a=v\\ a=v\ v\><s a=\'{\'}\'\><s a="{"}"\>';
- "<s a=v\\ a=v\ v\><s a='{'}'\><s a=\"{\"}\"\>";
- '''<font color='purple>igram</font>'''; '''<t a={'''; '''}''';
- '''<font color="purple>igram</font>'''; '''<t a='{'''; '''}''';
- '''<font color=\'purple>igram</font>'''; '''<t a="{'''; '''}''';
- '''<font color=\"purple>igram</font>''';
- """<font color='purple>igram</font>"""; """<t a={"""; """}""";
- """<font color="purple>igram</font>"""; """<t a='{"""; """}""";
- """<font color=\'purple>igram</font>"""; """<t a=\"{"""; """}""";
- """<font color=\"purple>igram</font>""";
- '<font color="purple>igram</font>'; '<t a={'; '}';
- '<font color=\'purple>igram</font>'; '<t a=\'{'; '}';
- '<font color=\"purple>igram</font>'; '<t a="{'; '}';
- "<font color=\"purple>igram</font>"; "<t a={"; "}";
- "<font color='purple>igram</font>"; "<t a='{"; "}";
- "<font color=\'purple>igram</font>"; "<t a=\"{"; "}\"";
- '''<xmp a=v>&amp;\x26<b><\xmp></xmp a=v>''';
- """<xmp a=v>&amp;\x26<b><\xmp></xmp a=v>""";
- '<xmp a=v>&amp;\x26<b><\xmp></xmp a=v>';
- "<xmp a=v>&amp;\x26<b><\xmp></xmp a=v>";
- '''<xmp a=v>&amp;\x26<b><\xmp><\Xmp a=v>''';
- """<xmp a=v>&amp;\x26<b><\xmp><\Xmp a=v>""";
- '<xmp a=v>&amp;\x26<b><\xmp><\Xmp a=v>';
- "<xmp a=v>&amp;\x26<b><\xmp><\Xmp a=v>";
- '''<xmp a=v>&amp;\x26<b><\xmp><\\xmp a=v>''';
- """<xmp a=v>&amp;\x26<b><\xmp><\\xmp a=v>""";
- '<xmp a=v>&amp;\x26<b><\xmp><\\xmp a=v>';
- "<xmp a=v>&amp;\x26<b><\xmp><\\xmp a=v>";
- '''<xmp>'''; """<xmp>"""; '<xmp>'; "<xmp>";
- '''<listing a=v>&amp;\x26<b><listing><xmp></listing a=v>''';
- """<listing a=v>&amp;\x26<b><listing><xmp></listing a=v>""";
- '<listing a=v>&amp;\x26<b><listing><xmp></listing a=v>';
- "<listing a=v>&amp;\x26<b><listing><xmp></listing a=v>";
- '''<listing a=v>&amp;\x26<b><listing><xmp><\listing a=v>''';
- """<listing a=v>&amp;\x26<b><listing><xmp><\listing a=v>""";
- '<listing a=v>&amp;\x26<b><listing><xmp><\listing a=v>';
- "<listing a=v>&amp;\x26<b><listing><xmp><\listing a=v>";
- '''<listing a=v>&amp;\x26<b><listing><xmp><\\listing a=v>''';
- """<listing a=v>&amp;\x26<b><listing><xmp><\\listing a=v>""";
- '<listing a=v>&amp;\x26<b><listing><xmp><\\listing a=v>';
- "<listing a=v>&amp;\x26<b><listing><xmp><\\listing a=v>";
- '''<listing>'''; """<listing>"""; '<listing>'; "<listing>";
- }
- finally
- {
- t3SetSay(oldSay);
- }
- }
-;
-
-VerbRule(Xyzzy)
- "xyzzy" | "plugh" *
- : XyzzyAction
- verbPhrase = 'babble/talking like a barbarian'
-;
-
-randomGreekWord()
-{
- local vowels = ['a', 'e', 'e', 'i', 'o', 'y', 'o'];
- local consonants = ['p', 't', 'k', 'b', 'd', 'g', 's', 'm', 'n', 'l', 'r'];
- local clusters =
- ['pn', 'pl', 'pr', 'tm', 'tr', 'kn', 'kl', 'kr', 'bl', 'br'];
- local ends = consonants - ['b', 'd', 'g'];
- local word;
- local retries = 0;
- for (local r in 0 .. -1 step -1)
- {
- for ((r), local i = 0, local j = 2; i < j; ++i, --j)
- {
- for (local s = 0, local n in [90, 30, 10]; ; --s)
- retries -= s * n;
- }
- }
- retries *= 2;
- retries >>= 1;
- retries /= 2;
- retries <<= 1;
- retries >>>= 2;
- retries %= 16;
- retries &= ~1;
- retries |= 2;
- retries ^= retries ^ retries;
- do
- {
- word = rand('[ptkbdgsm]?');
- for (local i in 0 .. __TADS3)
- word += concat(rand(rand('', clusters, consonants)), rand('"h"?'),
- rand(vowels...), rand('','', 'i', 'u', rand(ends)));
- word += rand('"s"?');
- word = rexReplace(R'^[pk](?![tnlrhaeioy]|[tnlr]h?[^aeioy])', word, '');
- word = rexReplace(R'^b(?![dlrhaeioy]|[dlr]h?[^aeioy])', word, '');
- word = rexReplace(R'^g(?![nlrhaeioy]|[nlr]h?[^aeioy])', word, '');
- word = rexReplace(R'^t(?![mrhaeioy]|[mlr]h?[^aeioy])', word, '');
- word = rexReplace(R'^d(?![rhaeioy]|rh?[^aeioy])', word, '');
- word = rexReplace(R'^m(?![nhaeioy]|nh?[^aeioy])', word, '');
- word = rexReplace(R'^[^aeioy]h?(([^haeioy]h?){2})', word, '%1');
- word = rexReplace(R'[ptkbdgs]([ptkbdg][^haeioy])', word, '%1');
- word = rexReplace(R'([mnlr])h', word, 'h%1');
- word = rexReplace(R'(?<!(^|[ptk]))h', word, '');
- word = rexReplace(R'^h(?![aeioy])', word, '');
- word = rexReplace(R'h(?=.*h)', word, '');
- word = rexReplace(R'(?<=^|r)r', word, 'rh');
- word = rexReplace(R'([iy]+)[iu]', word, '%1');
- word = rexReplace(R'nl', word, 'll');
- word = rexReplace(R'n(?=[pbm])', word, 'm');
- word = rexReplace(R'(?<.)m(?=[tdn])', word, 'n');
- word = rexReplace(R'pb|bp', word, 'pp');
- word = rexReplace(R'td|dt', word, 'tt');
- word = rexReplace(R'kg|gk', word, 'kk');
- word = rexReplace(R'bs', word, 'ps');
- word = rexReplace(R'ds|sd', word, 'z');
- word = rexReplace(R'gs', word, 'ks');
- word = rexReplace(R'ts', word, 'ss');
- word = rexReplace(R'[^pkaeioyusnr]+(s?)$', word, '%1');
- word = rexReplace(R'[pk]+$', word, '');
- word = rexReplace(R'(.h?)%1{2,}', word, '%1%1');
- word = rexReplace(R'^(.h?)%1', word, '%1');
- word = rexReplace(R'(.h?)%1$', word, '%1');
- word = rexReplace(R'^y', word, 'hy');
- word = rexReplace(R'([ptk])([ptk])h', word, '%1h%2h');
- word = rexReplace(R'([ptk])h%1h', word, '%1%1h');
- word = rexReplace(R'ks', word, 'x');
- word = rexReplace(R'gg', word, 'kg');
- word = rexReplace(R'kh', word, 'ch');
- } while (retries-- && (word.length() < 4 || !rexSearch(
- new RexPattern('^(eu|hy|[pgm]n|bd|tm|rh)|(.h.|pp|kc|rr)h|ch([^aeioy])|'
- + '([^aeioy])y([^aeioy])$|(ps|x|o[ius])$'), word)));
- return word;
-}
diff --git a/tests/examplefiles/teraterm.ttl b/tests/examplefiles/teraterm.ttl
deleted file mode 100644
index f6a3648a..00000000
--- a/tests/examplefiles/teraterm.ttl
+++ /dev/null
@@ -1,34 +0,0 @@
-messagebox "text \\not escaped \nescaped n" "other\n\rthing"
-messagebox "goto label /* a string */ ; same string"
-a=10
-b= 'abc'#$41'def'
-c =#65 /* multiline comment * / * / *//*
-comment */ d = 10 ; inline comment /* still inline */
-e = d + 20 - (($a * 2) / 4) << 3 % (2 >> 1) + result
-
-
-:thing
-
-strcompare c "thing"
-if result = 1 then
- goto label_
-elseif result > -1 then
- goto 10
-elseif d > (1+2*3)/7 then
- messagebox "thing"
-else
- messagebox "done"
-endif
-
-if abc messagebox "thing1" "title"
-
-
-; Invalid syntax
-bad = "no closing double quote
-bad = 'no closing single quote
-garbage
-...
-...
-...
-
-endgarbage
diff --git a/tests/examplefiles/termcap b/tests/examplefiles/termcap
deleted file mode 100644
index e20adaba..00000000
--- a/tests/examplefiles/termcap
+++ /dev/null
@@ -1,1340 +0,0 @@
-######## This example from excerpt of <http://www.catb.org/esr/terminfo/>:
-#
-# Version 11.0.1
-# $Date: 2000/03/02 15:51:11 $
-# termcap syntax
-#
-
-######## ANSI, UNIX CONSOLE, AND SPECIAL TYPES
-#
-# This section describes terminal classes and brands that are still
-# quite common.
-#
-
-#### Specials
-#
-# Special "terminals". These are used to label tty lines when you don't
-# know what kind of terminal is on it. The characteristics of an unknown
-# terminal are the lowest common denominator - they look about like a ti 700.
-#
-
-dumb|80-column dumb tty:\
- :am:\
- :co#80:\
- :bl=^G:cr=^M:do=^J:sf=^J:
-unknown|unknown terminal type:\
- :gn:tc=dumb:
-lpr|printer|line printer:\
- :bs:hc:os:\
- :co#132:li#66:\
- :bl=^G:cr=^M:do=^J:ff=^L:le=^H:sf=^J:
-glasstty|classic glass tty interpreting ASCII control characters:\
- :am:bs:\
- :co#80:\
- :bl=^G:cl=^L:cr=^M:do=^J:kd=^J:kl=^H:le=^H:nw=^M^J:ta=^I:
-vanilla:\
- :bs:\
- :bl=^G:cr=^M:do=^J:sf=^J:
-
-#### ANSI.SYS/ISO 6429/ECMA-48 Capabilities
-#
-# See the end-of-file comment for more on these.
-#
-
-# ANSI capabilities are broken up into pieces, so that a terminal
-# implementing some ANSI subset can use many of them.
-ansi+local1:\
- :do=\E[B:le=\E[D:nd=\E[C:up=\E[A:
-ansi+local:\
- :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:tc=ansi+local1:
-ansi+tabs:\
- :bt=\E[Z:ct=\E[2g:st=\EH:ta=^I:
-ansi+inittabs:\
- :it#8:tc=ansi+tabs:
-ansi+erase:\
- :cd=\E[J:ce=\E[K:cl=\E[H\E[J:
-ansi+rca:\
- :ch=\E[%+^AG:cv=\E[%+^Ad:
-ansi+cup:\
- :cm=\E[%i%d;%dH:ho=\E[H:
-ansi+rep:\
- :..rp=%p1%c\E[%p2%{1}%-%db:
-ansi+idl1:\
- :al=\E[L:dl=\E[M:
-ansi+idl:\
- :AL=\E[%dL:DL=\E[%dM:tc=ansi+idl1:
-ansi+idc:\
- :IC=\E[%d@:dc=\E[P:ei=\E6:ic=\E[@:im=\E6:
-ansi+arrows:\
- :kb=^H:kd=\E[B:kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:
-ansi+sgr|ansi graphic renditions:\
- :mb=\E[5m:me=\E[0m:mk=\E[8m:mr=\E[7m:
-ansi+sgrso|ansi standout only:\
- :se=\E[m:so=\E[7m:
-ansi+sgrul|ansi underline only:\
- :ue=\E[m:us=\E[4m:
-ansi+sgrbold|ansi graphic renditions; assuming terminal has bold; not dim:\
- :md=\E[1m:\
- :..sa=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;m:tc=ansi+sgr:tc=ansi+sgrso:tc=ansi+sgrul:
-ansi+sgrdim|ansi graphic renditions; assuming terminal has dim; not bold:\
- :mh=\E[2m:\
- :..sa=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p5%t2;%;m:tc=ansi+sgr:tc=ansi+sgrso:tc=ansi+sgrul:
-ansi+pp|ansi printer port:\
- :pf=\E[4i:po=\E[5i:ps=\E[0i:
-ansi+csr|ansi scroll-region plus cursor save & restore:\
- :cs=\E[%i%d;%dr:rc=\E8:sc=\E7:
-
-# The IBM PC alternate character set. Plug this into any Intel console entry.
-# We use \E[11m for rmacs rather than \E[12m so the <acsc> string can use the
-# ROM graphics for control characters such as the diamond, up- and down-arrow.
-# This works with the System V, Linux, and BSDI consoles. It's a safe bet this
-# will work with any Intel console, they all seem to have inherited \E[11m
-# from the ANSI.SYS de-facto standard.
-klone+acs|alternate character set for ansi.sys displays:\
- :ac=+\020\054\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376:\
- :ae=\E[10m:as=\E[11m:
-
-# Highlight controls corresponding to the ANSI.SYS standard. Most
-# console drivers for Intel boxes obey these. Makes the same assumption
-# about \E[11m as klone+acs. True ANSI/ECMA-48 would have :se=\E[27m:,
-# :ue=\E[24m:, but this isn't a documented feature of ANSI.SYS.
-klone+sgr|attribute control for ansi.sys displays:\
- :S2=\E[11m:S3=\E[10m:mb=\E[5m:md=\E[1m:me=\E[0;10m:\
- :mk=\E[8m:mr=\E[7m:\
- :..sa=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m:\
- :se=\E[m:so=\E[7m:ue=\E[m:us=\E[4m:\
- :tc=klone+acs:
-
-# Highlight controls corresponding to the ANSI.SYS standard. *All*
-# console drivers for Intel boxes obey these. Does not assume \E[11m will
-# work; uses \E[12m instead, which is pretty bulletproof but loses you the ACS
-# diamond and arrow characters under curses.
-klone+sgr-dumb|attribute control for ansi.sys displays (no ESC [ 11 m):\
- :as=\E[12m:mb=\E[5m:md=\E[1m:me=\E[0;10m:mk=\E[8m:\
- :mr=\E[7m:\
- :..sa=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;12%;m:\
- :se=\E[m:so=\E[7m:ue=\E[m:us=\E[4m:\
- :tc=klone+acs:
-
-# KOI8-R (RFC1489) acs (alternate character set)
-# From: Qing Long <qinglong@Bolizm.ihep.su>, 24 Feb 1996.
-klone+koi8acs|alternate character set for ansi.sys displays with KOI8 charset:\
- :ac=+\020\054\021-\036.^_0\215`\004a\237f\234g\232h\222i\220j\205k\203l\202m\204n\212o\213p\216q\0r\217s\214t\206u\207v\210w\211x\201y\230z\231{\267|\274}L~\225:\
- :ae=\E[10m:as=\E[11m:
-
-# ANSI.SYS color control. The setab/setaf caps depend on the coincidence
-# between SVr4/XPG4's color numbers and ANSI.SYS attributes. Here are longer
-# but equivalent strings that don't rely on that coincidence:
-# setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-# setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-# The DOS 5 manual asserts that these sequences meet the ISO 6429 standard.
-# They match a subset of ECMA-48.
-klone+color|color control for ansi.sys and ISO6429-compatible displays:\
- :Co#8:NC#3:pa#64:\
- :AB=\E[4%p1%dm:AF=\E[3%p1%dm:op=\E[37;40m:
-
-# This is better than klone+color, it doesn't assume white-on-black as the
-# default color pair, but many `ANSI' terminals don't grok the <op> cap.
-ecma+color|color control for ECMA-48-compatible terminals:\
- :Co#8:NC#3:pa#64:\
- :AB=\E[4%p1%dm:AF=\E[3%p1%dm:op=\E[39;49m:
-
-# Attribute control for ECMA-48-compatible terminals
-ecma+sgr|attribute capabilities for true ECMA-48 terminals:\
- :se=\E[27m:ue=\E[24m:\
- :tc=klone+sgr:
-
-# For comparison, here are all the capabilities implied by the Intel
-# Binary Compatibility Standard (level 2) that fit within terminfo.
-# For more detail on this rather pathetic standard, see the comments
-# near the end of this file.
-ibcs2|Intel Binary Compatibility Standard prescriptions:\
- :AL=\E[%dL:DC=\E[%dP:DO=\E[%dB:IC=\E[%d@:LE=\E[%dD:\
- :RA=\E[?7l:RI=\E[%dC:S1=\E=%p1%dg:SA=\E[?7h:SF=\E[%dS:\
- :SR=\E[%dT:UP=\E[%dA:bt=\E[Z:ch=\E[%i%dG:cl=\Ec:\
- :cm=\E[%i%d;%dH:ct=\E[g:cv=\E[%i%dd:ec=\E[%dX:ei=:im=:\
- :rc=\E7:sc=\E7:st=\EH:
-
-#### ANSI/ECMA-48 terminals and terminal emulators
-#
-# See near the end of this file for details on ANSI conformance.
-# Don't mess with these entries! Lots of other entries depend on them!
-#
-# This section lists entries in a least-capable to most-capable order.
-# if you're in doubt about what `ANSI' matches yours, try them in that
-# order and back off from the first that breaks.
-
-# ansi-mr is for ANSI terminals with ONLY relative cursor addressing
-# and more than one page of memory. It uses local motions instead of
-# direct cursor addressing, and makes almost no assumptions. It does
-# assume auto margins, no padding and/or xon/xoff, and a 24x80 screen.
-ansi-mr|mem rel cup ansi:\
- :am:xo:\
- :co#80:li#24:tc=vanilla:tc=ansi+erase:tc=ansi+local1:
-
-# ansi-mini is a bare minimum ANSI terminal. This should work on anything, but
-# beware of screen size problems and memory relative cursor addressing.
-ansi-mini|minimum ansi standard terminal:\
- :am:xo:\
- :co#80:li#24:tc=vanilla:tc=ansi+cup:tc=ansi+erase:
-
-# ansi-mtabs adds relative addressing and minimal tab support
-ansi-mtabs|any ansi terminal with pessimistic assumptions:\
- :it#8:\
- :ta=^I:tc=ansi+local1:tc=ansi-mini:
-
-# ANSI X3.64 from emory!mlhhh (Hugh Hansard) via BRL
-#
-# The following is an entry for the full ANSI 3.64 (1977). It lacks
-# padding, but most terminals using the standard are "fast" enough
-# not to require any -- even at 9600 bps. If you encounter problems,
-# try including the padding specifications.
-#
-# Note: the :as: and :ae: specifications are not implemented here, for
-# the available termcap documentation does not make clear WHICH alternate
-# character set to specify. ANSI 3.64 seems to make allowances for several.
-# Please make the appropriate adjustments to fit your needs -- that is
-# if you will be using alternate character sets.
-#
-# There are very few terminals running the full ANSI 3.64 standard,
-# so I could only test this entry on one verified terminal (Visual 102).
-# I would appreciate the results on other terminals sent to me.
-#
-# Please report comments, changes, and problems to:
-#
-# U.S. MAIL: Hugh Hansard
-# Box: 22830
-# Emory University
-# Atlanta, GA. 30322.
-#
-# USENET {akgua,msdc,sb1,sb6,gatech}!emory!mlhhh.
-#
-# (Added vt100 :rc:,:sc: to quiet a tic warning --esr)
-ansi77|ansi 3.64 standard 1977 version:\
- :am:bs:mi:\
- :co#80:it#8:li#24:\
- :al=5*\E[L:bl=^G:cd=\E[J:ce=\E[K:cl=\E[;H\E[2J:\
- :cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:dc=\E[P:dl=5*\E[M:\
- :do=\E[B:ei=\E[4l:ho=\E[H:im=\E[4h:k1=\EOP:k2=\EOR:k4=\EOS:\
- :kb=^H:kd=\E[B:kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:\
- :nd=\E[C:nw=^M\ED:rc=\E8:sc=\E7:se=\E[m:sf=\ED:so=\E[7m:\
- :sr=\EM:ta=^I:ue=\E[m:up=\E[A:us=\E[4m:
-
-# Procomm and some other ANSI emulations don't recognize all of the ANSI-
-# standard capabilities. This entry deletes :UP:, :RI:, :DO:, :LE:, and
-# <vpa>/<hpa> capabilities, forcing curses to use repetitions of :up:,
-# :nd:, :do: and :le:. Also deleted :IC: and :ic:, as QModem up to
-# 5.03 doesn't recognize these. Finally, we delete :rp: and :sr:, which seem
-# to confuse many emulators. On the other hand, we can count on these programs
-# doing :ae:/:as:/:sa:. Older versions of this entry featured
-# <invis=\E[9m>, but <invis=\E[8m> now seems to be more common under
-# ANSI.SYS influence.
-# From: Eric S. Raymond <esr@snark.thyrsus.com> Oct 30 1995
-pcansi-m|pcansi-mono|ibm-pc terminal programs claiming to be ansi (mono mode):\
- :am:bs:mi:ms:\
- :co#80:it#8:li#24:\
- :al=\E[L:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[J:\
- :cm=\E[%i%d;%dH:cr=^M:ct=\E[2g:dc=\E[P:dl=\E[M:do=\E[B:\
- :ho=\E[H:kb=^H:kd=\E[B:kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:\
- :le=\E[D:nd=\E[C:sf=^J:st=\EH:ta=^I:up=\E[A:\
- :tc=klone+sgr-dumb:
-pcansi-25-m|pcansi25m|ibm-pc terminal programs with 25 lines (mono mode):\
- :li#25:tc=pcansi-m:
-pcansi-33-m|pcansi33m|ibm-pc terminal programs with 33 lines (mono mode):\
- :li#33:tc=pcansi-m:
-pcansi-43-m|ansi43m|ibm-pc terminal programs with 43 lines (mono mode):\
- :li#43:tc=pcansi-m:
-# The color versions. All PC emulators do color...
-pcansi|ibm-pc terminal programs claiming to be ansi:\
- :tc=klone+color:tc=pcansi-m:
-pcansi-25|pcansi25|ibm-pc terminal programs with 25 lines:\
- :li#25:tc=pcansi:
-pcansi-33|pcansi33|ibm-pc terminal programs with 33 lines:\
- :li#33:tc=pcansi:
-pcansi-43|pcansi43|ibm-pc terminal programs with 43 lines:\
- :li#43:tc=pcansi:
-
-# ansi-m -- full ANSI X3.64 with ANSI.SYS-compatible attributes, no color.
-# If you want pound signs rather than dollars, replace `B' with `A'
-# in the <s0ds>, <s1ds>, <s2ds>, and <s3ds> capabilities.
-# From: Eric S. Raymond <esr@snark.thyrsus.com> Nov 6 1995
-ansi-m|ansi-mono|ANSI X3.64-1979 terminal with ANSI.SYS compatible attributes:\
- :5i:\
- :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
- :LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\
- :cb=\E[1K:ch=\E[%i%dG:ct=\E[2g:cv=\E[%i%dd:ec=\E[%dX:ei=:\
- :im=:kB=\E[Z:kI=\E[L:kb=^H:kd=\E[B:kl=\E[D:kr=\E[C:ku=\E[A:\
- :nw=\r\E[S:pf=\E[4i:po=\E[5i:..rp=%p1%c\E[%p2%{1}%-%db:\
- :s0=\E(B:s1=\E)B:s2=\E*B:s3=\E+B:ta=\E[I:\
- :tc=pcansi-m:
-
-# ansi -- this terminfo expresses the largest subset of X3.64 that will fit in
-# standard terminfo. Assumes ANSI.SYS-compatible attributes and color.
-# From: Eric S. Raymond <esr@snark.thyrsus.com> Nov 6 1995
-ansi|ansi/pc-term compatible with color:\
- :u6=\E[%i%d;%dR:u7=\E[6n:..u8=\E[?%[;0123456789]c:\
- :u9=\E[c:\
- :tc=ecma+color:tc=klone+sgr:tc=ansi-m:
-
-# ansi-generic is a vanilla ANSI terminal. This is assumed to implement
-# all the normal ANSI stuff with no extensions. It assumes
-# insert/delete line/char is there, so it won't work with
-# vt100 clones. It assumes video attributes for bold, blink,
-# underline, and reverse, which won't matter much if the terminal
-# can't do some of those. Padding is assumed to be zero, which
-# shouldn't hurt since xon/xoff is assumed.
-ansi-generic|generic ansi standard terminal:\
- :am:xo:\
- :co#80:li#24:tc=vanilla:tc=ansi+csr:tc=ansi+cup:\
- :tc=ansi+rca:tc=ansi+erase:tc=ansi+tabs:tc=ansi+local:\
- :tc=ansi+idc:tc=ansi+idl:tc=ansi+rep:tc=ansi+sgrbold:\
- :tc=ansi+arrows:
-
-#### Linux consoles
-#
-
-# This entry is good for the 1.2.13 or later version of the Linux console.
-#
-# ***************************************************************************
-# * *
-# * WARNING: *
-# * Linuxes come with a default keyboard mapping kcbt=^I. This entry, in *
-# * response to user requests, assumes kcbt=\E[Z, the ANSI/ECMA reverse-tab *
-# * character. Here are the keymap replacement lines that will set this up: *
-# * *
-# keycode 15 = Tab Tab
-# alt keycode 15 = Meta_Tab
-# shift keycode 15 = F26
-# string F26 ="\033[Z"
-# * *
-# * This has to use a key slot which is unfortunate (any unused one will *
-# * do, F26 is the higher-numbered one). The change ought to be built *
-# * into the kernel tables. *
-# * *
-# ***************************************************************************
-#
-# The 1.3.x kernels add color-change capabilities; if yours doesn't have this
-# and it matters, turn off <ccc>. The %02x escape used to implement this is
-# not back-portable to SV curses and not supported in ncurses versions before
-# 1.9.9. All linux kernels since 1.2.13 (at least) set the screen size
-# themselves; this entry assumes that capability.
-#
-# This entry is good for the 1.2.13 or later version of the Linux console.
-#
-# ***************************************************************************
-# * *
-# * WARNING: *
-# * Linuxes come with a default keyboard mapping kcbt=^I. This entry, in *
-# * response to user requests, assumes kcbt=\E[Z, the ANSI/ECMA reverse-tab *
-# * character. Here are the keymap replacement lines that will set this up: *
-# * *
-# keycode 15 = Tab Tab
-# alt keycode 15 = Meta_Tab
-# shift keycode 15 = F26
-# string F26 ="\033[Z"
-# * *
-# * This has to use a key slot which is unfortunate (any unused one will *
-# * do, F26 is the higher-numbered one). The change ought to be built *
-# * into the kernel tables. *
-# * *
-# ***************************************************************************
-#
-# The 1.3.x kernels add color-change capabilities; if yours doesn't have this
-# and it matters, turn off <ccc>. The %02x escape used to implement this is
-# not back-portable to SV curses and not supported in ncurses versions before
-# 1.9.9. All linux kernels since 1.2.13 (at least) set the screen size
-# themselves; this entry assumes that capability.
-#
-# The 2.2.x kernels add a private mode that sets the cursor type; use that to
-# get a block cursor for cvvis.
-# reported by Frank Heckenbach <frank@g-n-u.de>.
-# (untranslatable capabilities removed to fit entry within 1023 bytes)
-# (sgr removed to fit entry within 1023 bytes)
-# (terminfo-only capabilities suppressed to fit entry within 1023 bytes)
-linux|linux console:\
- :am:eo:mi:ms:xn:xo:\
- :it#8:\
- :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:IC=\E[%d@:K2=\E[G:al=\E[L:\
- :bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
- :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:ec=\E[%dX:\
- :ei=\E[4l:ho=\E[H:ic=\E[@:im=\E[4h:k1=\E[[A:k2=\E[[B:\
- :k3=\E[[C:k4=\E[[D:k5=\E[[E:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
- :k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\
- :kd=\E[B:kh=\E[1~:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:mh=\E[2m:\
- :mr=\E[7m:nd=\E[C:nw=^M^J:rc=\E8:sc=\E7:se=\E[27m:sf=^J:\
- :sr=\EM:st=\EH:ta=^I:ue=\E[24m:up=\E[A:us=\E[4m:\
- :vb=200\E[?5h\E[?5l:ve=\E[?25h\E[?0c:vi=\E[?25l\E[?1c:\
- :vs=\E[?25h\E[?8c:\
- :tc=klone+sgr:tc=ecma+color:
-linux-m|Linux console no color:\
- :Co@:pa@:\
- :AB@:AF@:Sb@:Sf@:tc=linux:
-linux-c-nc|linux console 1.3.x hack for ncurses only:\
- :cc:\
- :..Ic=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x:\
- :oc=\E]R:\
- :tc=linux:
-# From: Dennis Henriksen <opus@osrl.dk>, 9 July 1996
-linux-c|linux console 1.3.6+ with private palette for each virtual console:\
- :cc:\
- :Co#8:pa#64:\
- :..Ic=\E]P%?%p1%{9}%>%t%p1%{10}%-%'a'%+%c%e%p1%d%;%p2%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p3%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p4%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;:\
- :oc=\E]R:\
- :tc=linux:
-
-# See the note on ICH/ICH1 VERSUS RMIR/SMIR near the end of file
-linux-nic|linux with ich/ich1 suppressed for non-curses programs:\
- :IC@:ei=:ic@:im=:\
- :tc=linux:
-
-# This assumes you have used setfont(8) to load one of the Linux koi8-r fonts.
-# acsc entry from Pavel Roskin" <pavel@absolute.spb.su>, 29 Sep 1997.
-linux-koi8|linux with koi8 alternate character set:\
- :ac=+\020\054\021-\030.^Y0\215`\004a\221f\234g\237h\220i\276j\205k\203l\202m\204n\212o~p\0q\0r\0s_t\206u\207v\211w\210x\201y\230z\231{\267|\274~\224:tc=linux:\
- :tc=klone+koi8acs:
-
-# Another entry for KOI8-r with Qing Long's acsc.
-# (which one better complies with the standard?)
-linux-koi8r|linux with koi8-r alternate character set:\
- :tc=linux:tc=klone+koi8acs:
-
-# Entry for the latin1 and latin2 fonts
-linux-lat|linux with latin1 or latin2 alternate character set:\
- :ac=+\020\054\021-\030.^Y0\333`\004a\013f\370g\361h\260i\316j\211k\214l\206m\203n\305o~p\304q\212r\304s_t\207u\215v\301w\302x\205y\363z\362{\343|\330}\234~\376:\
- :tc=linux:
-
-#### NetBSD consoles
-#
-# pcvt termcap database entries (corresponding to release 3.31)
-# Author's last edit-date: [Fri Sep 15 20:29:10 1995]
-#
-# (For the terminfo master file, I translated these into terminfo syntax.
-# Then I dropped all the pseudo-HP entries. we don't want and can't use
-# the :Xs: flag. Then I split :is: into a size-independent :i1: and a
-# size-dependent :is:. Finally, I added <rmam>/<smam> -- esr)
-
-# NOTE: :ic: has been taken out of this entry. for reference, it should
-# be <ich1=\E[@>. For discussion, see ICH/ICH1 VERSUS RMIR/SMIR below.
-# (esr: added :vi: and :ve: to resolve NetBSD Problem Report #4583)
-pcvtXX|pcvt vt200 emulator (DEC VT220):\
- :am:km:mi:ms:xn:\
- :it#8:vt#3:\
- :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
- :LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:SA=\E[?7h:SF=\E[%dS:\
- :SR=\E[%dT:UP=\E[%dA:\
- :ac=++\054\054--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz~~:\
- :ae=\E(B:al=\E[L:as=\E(0:bl=^G:cb=\E[1K:cd=\E[J:ce=\E[K:\
- :cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:\
- :ct=\E[3g:dc=\E[P:dl=\E[M:do=\E[B:ei=\E[4l:ho=\E[H:\
- :i1=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:im=\E[4h:\
- :k1=\E[17~:k2=\E[18~:k3=\E[19~:k4=\E[20~:k5=\E[21~:\
- :k6=\E[23~:k7=\E[24~:k8=\E[25~:kD=\E[3~:kH=\E[4~:kI=\E[2~:\
- :kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l\E>:kh=\E[1~:\
- :kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:\
- :md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:nw=\EE:\
- :r1=\Ec\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:rc=\E8:\
- :rf=/usr/share/tabset/vt100:sc=\E7:se=\E[27m:sf=\ED:\
- :so=\E[7m:sr=\EM:st=\EH:ta=^I:ue=\E[24m:up=\E[A:us=\E[4m:\
- :ve=\E[?25h:vi=\E[?25l:
-
-# NetBSD/FreeBSD vt220 terminal emulator console (pc keyboard & monitor)
-# termcap entries for pure VT220-Emulation and 25, 28, 35, 40, 43 and
-# 50 lines entries; 80 columns
-pcvt25|dec vt220 emulation with 25 lines:\
- :co#80:li#25:\
- :is=\E[1;25r\E[25;1H:tc=pcvtXX:
-pcvt28|dec vt220 emulation with 28 lines:\
- :co#80:li#28:\
- :is=\E[1;28r\E[28;1H:tc=pcvtXX:
-pcvt35|dec vt220 emulation with 35 lines:\
- :co#80:li#35:\
- :is=\E[1;35r\E[35;1H:tc=pcvtXX:
-pcvt40|dec vt220 emulation with 40 lines:\
- :co#80:li#40:\
- :is=\E[1;40r\E[40;1H:tc=pcvtXX:
-pcvt43|dec vt220 emulation with 43 lines:\
- :co#80:li#43:\
- :is=\E[1;43r\E[43;1H:tc=pcvtXX:
-pcvt50|dec vt220 emulation with 50 lines:\
- :co#80:li#50:\
- :is=\E[1;50r\E[50;1H:tc=pcvtXX:
-
-# NetBSD/FreeBSD vt220 terminal emulator console (pc keyboard & monitor)
-# termcap entries for pure VT220-Emulation and 25, 28, 35, 40, 43 and
-# 50 lines entries; 132 columns
-pcvt25w|dec vt220 emulation with 25 lines and 132 cols:\
- :co#132:li#25:\
- :is=\E[1;25r\E[25;1H:tc=pcvtXX:
-pcvt28w|dec vt220 emulation with 28 lines and 132 cols:\
- :co#132:li#28:\
- :is=\E[1;28r\E[28;1H:tc=pcvtXX:
-pcvt35w|dec vt220 emulation with 35 lines and 132 cols:\
- :co#132:li#35:\
- :is=\E[1;35r\E[35;1H:tc=pcvtXX:
-pcvt40w|dec vt220 emulation with 40 lines and 132 cols:\
- :co#132:li#40:\
- :is=\E[1;40r\E[40;1H:tc=pcvtXX:
-pcvt43w|dec vt220 emulation with 43 lines and 132 cols:\
- :co#132:li#43:\
- :is=\E[1;43r\E[43;1H:tc=pcvtXX:
-pcvt50w|dec vt220 emulation with 50 lines and 132 cols:\
- :co#132:li#50:\
- :is=\E[1;50r\E[50;1H:tc=pcvtXX:
-
-# Terminfo entries to enable the use of the ncurses library in colour on a
-# NetBSD-arm32 console (only tested on a RiscPC).
-# Created by Dave Millen <dmill@globalnet.co.uk> 22.07.98
-# modified codes for setf/setb to setaf/setab, then to klone+color, corrected
-# typo in invis - TD
-arm100|arm100-am|Arm(RiscPC) ncurses compatible (for 640x480):\
- :am:ms:ut:xn:xo:\
- :co#80:it#8:li#30:\
- :@8=\E[M:DO=\E[%dB:K1=\E[q:K2=\E[r:K3=\E[s:K4=\E[p:K5=\E[n:\
- :LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:SA=\E[?7h:UP=\E[%dA:\
- :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\
- :ae=^O:as=^N:bl=^G:cb=\E[1K:cd=\E[J:ce=\E[K:cl=\E[H\E[J:\
- :cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:ct=\E[3g:do=^J:\
- :eA=\E(B\E)0:ho=\E[H:k0=\E[y:k1=\E[P:k2=\E[Q:k3=\E[R:\
- :k4=\E[S:k5=\E[t:k6=\E[u:k7=\E[v:k8=\E[l:k9=\E[w:k;=\E[x:\
- :kb=^H:kd=\E[B:ke=\E[?1l\E>:kl=\E[D:kr=\E[C:ks=\E[?1h\E=:\
- :ku=\E[A:le=^H:mb=\E[5m:md=\E[1m:me=\E[m\017:mk=\E[8m:\
- :mr=\E[6m:nd=\E[C:r2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:\
- :rc=\E8:\
- :..sa=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;:\
- :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:ue=\E[m:\
- :up=\E[A:us=\E[4m:\
- :tc=ecma+sgr:tc=klone+color:
-arm100-w|arm100-wam|Arm(RiscPC) ncurses compatible (for 1024x768):\
- :co#132:li#50:tc=arm100:
-
-# NetBSD/x68k console vt200 emulator. This port runs on a 68K machine
-# manufactured by Sharp for the Japenese market.
-# From Minoura Makoto <minoura@netlaputa.or.jp>, 12 May 1996
-x68k|x68k-ite|NetBSD/x68k ITE:\
- :co#96:li#32:\
- :%1=\E[28~:kC=\E[9~:tc=vt220:
-
-# <tv@pobox.com>:
-# Entry for the DNARD OpenFirmware console, close to ANSI but not quite.
-#
-# (still unfinished, but good enough so far.)
-ofcons:\
- :bw:\
- :co#80:li#30:\
- :AL=\233%dL:DC=\233%dP:DL=\233%dM:DO=\233%dB:IC=\233%d@:\
- :LE=\233%dD:RI=\233%dC:UP=\233%dA:al=\233L:bl=^G:cd=\233J:\
- :ce=\233K:cl=^L:cm=\233%i%d;%dH:cr=^M:dc=\233P:dl=\233M:\
- :do=\233B:ei=:ic=\233@:im=:k1=\2330P:k2=\2330Q:k3=\2330W:\
- :k4=\2330x:k5=\2330t:k6=\2330u:k7=\2330q:k8=\2330r:\
- :k9=\2330p:k;=\2330M:kD=\233P:kN=\233/:kP=\233?:kb=^H:\
- :kd=\233B:kl=\233D:kr=\233C:ku=\233A:le=\233D:mb=\2337;2m:\
- :md=\2331m:me=\2330m:mh=\2332m:mk=\2338m:mr=\2337m:\
- :nd=\233C:nw=^M^J:se=\2330m:sf=^J:ta=^I:ue=\2330m:up=\233A:\
- :vb=^G:
-
-# NetBSD "wscons" emulator in vt220 mode
-# These are micro-minimal and probably need to be redone for real
-# after the manner of the pcvt entries.
-wsvt25|NetBSD wscons in 25 line DEC VT220 mode:\
- :co#80:li#25:tc=vt220:
-
-wsvt25m|NetBSD wscons in 25 line DEC VT220 mode with Meta:\
- :km:\
- :co#80:li#25:tc=vt220:
-
-# `rasterconsole' provided by 4.4BSD, NetBSD and OpenBSD on SPARC, and
-# DECstation/pmax.
-rcons|BSD rasterconsole:\
- :tc=sun-il:
-# Color version of above. Color currenly only provided by NetBSD.
-rcons-color|BSD rasterconsole with ANSI color:\
- :ut:\
- :Co#8:pa#64:\
- :AB=\E[4%dm:AF=\E[3%dm:op=\E[m:tc=rcons:
-
-#### FreeBSD console entries
-#
-# From: Andrey Chernov <ache@astral.msk.su> 29 Mar 1996
-# Andrey Chernov maintains the FreeBSD termcap distributions.
-#
-# Note: Users of FreeBSD 2.1.0 and older versions must either upgrade
-# or comment out the :cb: capability in the console entry.
-#
-# Alexander Lukyanov reports:
-# I have seen FreeBSD-2.1.5R... The old el1 bug changed, but it is still there.
-# Now el1 clears not only to the line beginning, but also a large chunk
-# of previous line. But there is another bug - ech does not work at all.
-#
-
-# for syscons
-# common entry without semigraphics
-# Bug: The <op> capability resets attributes.
-# Bug? The ech and el1 attributes appear to move the cursor in some cases; for
-# instance el1 does if the cursor is moved to the right margin first. Removed
-# by T.Dickey 97/5/3 (ech=\E[%p1%dX, el1=\E[1K)
-#
-# Setting colors turns off reverse; we cannot guarantee order, so use ncv.
-# Note that this disables standout with color.
-cons25w|ansiw|ansi80x25-raw|freebsd console (25-line raw mode):\
- :NP:am:bw:eo:ms:ut:\
- :Co#8:NC#21:co#80:it#8:li#25:pa#64:\
- :@7=\E[F:AB=\E[4%p1%dm:AF=\E[3%p1%dm:AL=\E[%dL:DC=\E[%dP:\
- :DL=\E[%dM:DO=\E[%dB:F1=\E[W:F2=\E[X:IC=\E[%d@:K2=\E[E:\
- :LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\
- :al=\E[L:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:ch=\E[%i%d`:\
- :cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:cv=\E[%i%dd:dc=\E[P:\
- :dl=\E[M:do=\E[B:ei=:ho=\E[H:ic=\E[@:im=:k1=\E[M:k2=\E[N:\
- :k3=\E[O:k4=\E[P:k5=\E[Q:k6=\E[R:k7=\E[S:k8=\E[T:k9=\E[U:\
- :k;=\E[V:kB=\E[Z:kD=\177:kI=\E[L:kN=\E[G:kP=\E[I:kb=^H:\
- :kd=\E[B:kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:mb=\E[5m:\
- :md=\E[1m:me=\E[m:mh=\E[30;1m:mr=\E[7m:nd=\E[C:nw=\E[E:\
- :op=\E[x:r1=\E[x\E[m\Ec:se=\E[m:sf=\E[S:so=\E[7m:sr=\E[T:\
- :ta=^I:up=\E[A:ve=\E[=0C:vs=\E[=1C:
-cons25|ansis|ansi80x25|freebsd console (25-line ansi mode):\
- :ac=-\030.^Y0\333`\004a\260f\370g\361h\261i\025j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263y\363z\362~\371:\
- :tc=cons25w:
-cons25-m|ansis-mono|ansi80x25-mono|freebsd console (25-line mono ansi mode):\
- :Co@:pa@:\
- :AB@:AF@:md@:mh@:op@:ue=\E[m:us=\E[4m:tc=cons25:
-cons30|ansi80x30|freebsd console (30-line ansi mode):\
- :li#30:tc=cons25:
-cons30-m|ansi80x30-mono|freebsd console (30-line mono ansi mode):\
- :li#30:tc=cons25-m:
-cons43|ansi80x43|freebsd console (43-line ansi mode):\
- :li#43:tc=cons25:
-cons43-m|ansi80x43-mono|freebsd console (43-line mono ansi mode):\
- :li#43:tc=cons25-m:
-cons50|ansil|ansi80x50|freebsd console (50-line ansi mode):\
- :li#50:tc=cons25:
-cons50-m|ansil-mono|ansi80x50-mono|freebsd console (50-line mono ansi mode):\
- :li#50:tc=cons25-m:
-cons60|ansi80x60|freebsd console (60-line ansi mode):\
- :li#60:tc=cons25:
-cons60-m|ansi80x60-mono|freebsd console (60-line mono ansi mode):\
- :li#60:tc=cons25-m:
-cons25r|pc3r|ibmpc3r|cons25-koi8-r|freebsd console w/koi8-r cyrillic:\
- :ac=-\030.^Y0\215`\004a\220f\234h\221i\025j\205k\203l\202m\204n\212q\0t\206u\207v\211w\210x\201y\230z\231~\225:\
- :tc=cons25w:
-cons25r-m|pc3r-m|ibmpc3r-mono|cons25-koi8r-m|freebsd console w/koi8-r cyrillic (mono):\
- :Co@:pa@:\
- :AB@:AF@:op@:ue=\E[m:us=\E[4m:tc=cons25r:
-cons50r|cons50-koi8r|freebsd console w/koi8-r cyrillic (50 lines):\
- :li#50:tc=cons25r:
-cons50r-m|cons50-koi8r-m|freebsd console w/koi8-r cyrillic (50-line mono):\
- :li#50:tc=cons25r-m:
-cons60r|cons60-koi8r|freebsd console w/koi8-r cyrillic (60 lines):\
- :li#60:tc=cons25r:
-cons60r-m|cons60-koi8r-m|freebsd console w/koi8-r cyrillic (60-line mono):\
- :li#60:tc=cons25r-m:
-# ISO 8859-1 FreeBSD console
-cons25l1|cons25-iso8859|freebsd console w/iso 8859-1 chars:\
- :ac=+\253\054\273-\030.\031`\201a\202f\207g\210i\247j\213k\214l\215m\216n\217o\220p\221q\222r\223s\224t\225u\226v\227w\230x\231y\232z\233~\237:\
- :tc=cons25w:
-cons25l1-m|cons25-iso-m|freebsd console w/iso 8859-1 chars (mono):\
- :Co@:pa@:\
- :AB@:AF@:md@:mh@:op@:ue=\E[m:us=\E[4m:tc=cons25l1:
-cons50l1|cons50-iso8859|freebsd console w/iso 8859-1 chars (50 lines):\
- :li#50:tc=cons25l1:
-cons50l1-m|cons50-iso-m|freebsd console w/iso 8859-1 chars (50-line mono):\
- :li#50:tc=cons25l1-m:
-cons60l1|cons60-iso|freebsd console w/iso 8859-1 chars (60 lines):\
- :li#60:tc=cons25l1:
-cons60l1-m|cons60-iso-m|freebsd console w/iso 8859-1 chars (60-line mono):\
- :li#60:tc=cons25l1-m:
-
-#### 386BSD and BSD/OS Consoles
-#
-
-# This was the original 386BSD console entry (I think).
-# Some places it's named oldpc3|oldibmpc3.
-# From: Alex R.N. Wetmore <aw2t@andrew.cmu.edu>
-origpc3|origibmpc3|IBM PC 386BSD Console:\
- :am:bw:eo:xo:\
- :co#80:li#25:\
- :ac=j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263:\
- :cd=\E[J:ce=\E[K:cl=\Ec:cm=\E[%i%2;%2H:do=\E[B:ho=\E[H:\
- :kd=\E[B:kh=\E[Y:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:md=\E[7m:\
- :me=\E[m\E[1;0x\E[2;7x:nd=\E[C:se=\E[1;0x\E[2;7x:\
- :sf=\E[S:so=\E[1;7x\E[2;0x:sr=\E[T:ue=\E[1;0x\E[2;7x:\
- :up=\E[A:us=\E[1;7x\E[2;0x:
-
-# description of BSD/386 console emulator in version 1.0 (supplied by BSDI)
-oldpc3|oldibmpc3|old IBM PC BSD/386 Console:\
- :km:\
- :li#25:\
- :al=\E[L:bl=^G:cr=^M:dl=\E[M:do=^J:kH=\E[F:kI=\E[L:kN=\E[G:\
- :kP=\E[I:kb=^H:kd=\E[B:kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:\
- :md=\E[=15F:me=\E[=R:mh=\E[=8F:nw=^M^J:sf=^J:ta=^I:
-
-# Description of BSD/OS console emulator in version 1.1, 2.0, 2.1
-# Note, the emulator supports many of the additional console features
-# listed in the iBCS2 (e.g. character-set selection) though not all
-# are described here. This entry really ought to be upgraded.
-# Also note, the console will also work with fewer lines after doing
-# "stty rows NN", e.g. to use 24 lines.
-# (Color support from Kevin Rosenberg <kevin@cyberport.com>, 2 May 1996)
-# Bug: The <op> capability resets attributes.
-bsdos-pc-nobold|BSD/OS PC console w/o bold:\
- :am:eo:km:xo:\
- :co#80:it#8:li#25:\
- :AL=\E[%dL:DL=\E[%dM:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:\
- :UP=\E[%dA:al=\E[L:bl=^G:cd=\E[J:ce=\E[K:cl=\Ec:\
- :cm=\E[%i%d;%dH:cr=^M:dl=\E[M:do=^J:ho=\E[H:kH=\E[F:\
- :kI=\E[L:kN=\E[G:kP=\E[I:kb=^H:kd=\E[B:kh=\E[H:kl=\E[D:\
- :kr=\E[C:ku=\E[A:le=^H:nd=\E[C:nw=^M^J:rc=\E8:\
- :..sa=\E[0;10%?%p1%t;7%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m%?%p5%t\E[=8F%;:\
- :sc=\E7:sf=^J:ta=^I:up=\E[A:\
- :tc=klone+sgr:tc=klone+color:
-bsdos-pc|IBM PC BSD/OS Console:\
- :..sa=\E[0;10%?%p1%t;7%;%?%p2%t;1%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m:tc=bsdos-pc-nobold:
-
-# Old names for BSD/OS PC console used in releases before 4.1.
-pc3|BSD/OS on the PC Console:\
- :tc=bsdos-pc-nobold:
-ibmpc3|pc3-bold|BSD/OS on the PC Console with bold instead of underline:\
- :tc=bsdos-pc:
-
-# BSD/OS on the SPARC
-bsdos-sparc|Sun SPARC BSD/OS Console:\
- :tc=sun:
-
-# BSD/OS on the PowerPC
-bsdos-ppc|PowerPC BSD/OS Console:\
- :tc=bsdos-pc:
-
-#### DEC VT100 and compatibles
-#
-# DEC terminals from the vt100 forward are collected here. Older DEC terminals
-# and micro consoles can be found in the `obsolete' section. More details on
-# the relationship between the VT100 and ANSI X3.64/ISO 6429/ECMA-48 may be
-# found near the end of this file.
-#
-# Except where noted, these entries are DEC's official terminfos.
-# Contact Bill Hedberg <hedberg@hannah.enet.dec.com> of Terminal Support
-# Engineering for more information. Updated terminfos and termcaps
-# are kept available at ftp://gatekeeper.dec.com/pub/DEC/termcaps.
-#
-# In October 1995 DEC sold its terminals business, including the VT and Dorio
-# line and trademark, to SunRiver Data Systems. SunRiver has since changed
-# its name to Boundless Technologies; see http://www.boundless.com.
-#
-
-# NOTE: Any VT100 emulation, whether in hardware or software, almost
-# certainly includes what DEC called the `Level 1 editing extension' codes;
-# only the very oldest VT100s lacked these and there probably aren't any of
-# those left alive. To capture these, use one of the VT102 entries.
-#
-# Note that the :xn: glitch in vt100 is not quite the same as on the Concept,
-# since the cursor is left in a different position while in the
-# weird state (concept at beginning of next line, vt100 at end
-# of this line) so all versions of vi before 3.7 don't handle
-# :xn: right on vt100. The correct way to handle :xn: is when
-# you output the char in column 80, immediately output CR LF
-# and then assume you are in column 1 of the next line. If :xn:
-# is on, am should be on too.
-#
-# I assume you have smooth scroll off or are at a slow enough baud
-# rate that it doesn't matter (1200? or less). Also this assumes
-# that you set auto-nl to "on", if you set it off use vt100-nam
-# below.
-#
-# The padding requirements listed here are guesses. It is strongly
-# recommended that xon/xoff be enabled, as this is assumed here.
-#
-# The vt100 uses <rs2> and <rf> rather than :is:/:ct:/:st: because the
-# tab settings are in non-volatile memory and don't need to be
-# reset upon login. Also setting the number of columns glitches
-# the screen annoyingly. You can type "reset" to get them set.
-#
-# The VT100 series terminals have cursor ("arrows") keys which can operate
-# in two different modes: Cursor Mode and Application Mode. Cursor Mode
-# is the reset state, and is assumed to be the normal state. Application
-# Mode is the "set" state. In Cursor Mode, the cursor keys transmit
-# "Esc [ {code}" sequences, conforming to ANSI standards. In Application
-# Mode, the cursor keys transmit "Esc O <code>" sequences. Application Mode
-# was provided primarily as an aid to the porting of VT52 applications. It is
-# assumed that the cursor keys are normally in Cursor Mode, and expected that
-# applications such as vi will always transmit the :ks: string. Therefore,
-# the definitions for the cursor keys are made to match what the terminal
-# transmits after the :ks: string is transmitted. If the :ks: string
-# is a null string or is not defined, then cursor keys are assumed to be in
-# "Cursor Mode", and the cursor keys definitions should match that assumption,
-# else the appication may fail. It is also expected that applications will
-# always transmit the :ke: string to the terminal before they exit.
-#
-# The VT100 series terminals have an auxilliary keypad, commonly referred to as
-# the "Numeric Keypad", because it is a cluster of numeric and function keys.
-# The Numeric Keypad which can operate in two different modes: Numeric Mode and
-# Application Mode. Numeric Mode is the reset state, and is assumed to be
-# the normal state. Application Mode is the "set" state. In Numeric Mode,
-# the numeric and punctuation keys transmit ASCII 7-bit characters, and the
-# Enter key transmits the same as the Return key (Note: the Return key
-# can be configured to send either LF (\015) or CR LF). In Application Mode,
-# all the keypad keys transmit "Esc O {code}" sequences. The PF1 - PF4 keys
-# always send the same "Esc O {code}" sequences. It is assumed that the keypad
-# is normally in Numeric Mode. If an application requires that the keypad be
-# in Application Mode then it is expected that the user, or the application,
-# will set the TERM environment variable to point to a terminfo entry which has
-# defined the :ks: string to include the codes that switch the keypad into
-# Application Mode, and the terminfo entry will also define function key
-# fields to match the Application Mode control codes. If the :ks: string
-# is a null string or is not defined, then the keypad is assumed to be in
-# Numeric Mode. If the :ks: string switches the keypad into Application
-# Mode, it is expected that the :ke: string will contain the control codes
-# necessary to reset the keypad to "Normal" mode, and it is also expected that
-# applications which transmit the :ks: string will also always transmit the
-# :ke: string to the terminal before they exit.
-#
-# Here's a diagram of the VT100 keypad keys with their bindings.
-# The top line is the name of the key (some DEC keyboards have the keys
-# labelled somewhat differently, like GOLD instead of PF1, but this is
-# the most "official" name). The second line is the escape sequence it
-# generates in Application Keypad mode (where "$" means the ESC
-# character). The third line contains two items, first the mapping of
-# the key in terminfo, and then in termcap.
-# _______________________________________
-# | PF1 | PF2 | PF3 | PF4 |
-# | $OP | $OQ | $OR | $OS |
-# |_kf1__k1_|_kf2__k2_|_kf3__k3_|_kf4__k4_|
-# | 7 8 9 - |
-# | $Ow | $Ox | $Oy | $Om |
-# |_kf9__k9_|_kf10_k;_|_kf0__k0_|_________|
-# | 4 | 5 | 6 | , |
-# | $Ot | $Ou | $Ov | $Ol |
-# |_kf5__k5_|_kf6__k6_|_kf7__k7_|_kf8__k8_|
-# | 1 | 2 | 3 | |
-# | $Oq | $Or | $Os | enter |
-# |_ka1__K1_|_kb2__K2_|_ka3__K3_| $OM |
-# | 0 | . | |
-# | $Op | $On | |
-# |___kc1_______K4____|_kc3__K5_|_kent_@8_|
-#
-# And here, for those of you with orphaned VT100s lacking documentation, is
-# a description of the soft switches invoked when you do `Set Up'.
-#
-# Scroll 0-Jump Shifted 3 0-#
-# | 1-Smooth | 1-British pound sign
-# | Autorepeat 0-Off | Wrap Around 0-Off
-# | | 1-On | | 1-On
-# | | Screen 0-Dark Bkg | | New Line 0-Off
-# | | | 1-Light Bkg | | | 1-On
-# | | | Cursor 0-Underline | | | Interlace 0-Off
-# | | | | 1-Block | | | | 1-On
-# | | | | | | | |
-# 1 1 0 1 1 1 1 1 0 1 0 0 0 0 1 0 <--Standard Settings
-# | | | | | | | |
-# | | | Auto XON/XOFF 0-Off | | | Power 0-60 Hz
-# | | | 1-On | | | 1-50 Hz
-# | | Ansi/VT52 0-VT52 | | Bits Per Char. 0-7 Bits
-# | | 1-ANSI | | 1-8 Bits
-# | Keyclick 0-Off | Parity 0-Off
-# | 1-On | 1-On
-# Margin Bell 0-Off Parity Sense 0-Odd
-# 1-On 1-Even
-#
-# The following SET-UP modes are assumed for normal operation:
-# ANSI_MODE AUTO_XON/XOFF_ON NEWLINE_OFF 80_COLUMNS
-# WRAP_AROUND_ON JUMP_SCROLL_OFF
-# Other SET-UP modes may be set for operator convenience or communication
-# requirements; I recommend
-# AUTOREPEAT_ON BLOCK_CURSOR MARGIN_BELL_OFF SHIFTED_3_#
-# Unless you have a graphics add-on such as Digital Engineering's VT640
-# (and even then, whenever it can be arranged!) you should set
-# INTERLACE_OFF
-#
-# (vt100: I added <rmam>/<smam> based on the init string, also :bs:. -- esr)
-vt100|vt100-am|dec vt100 (w/advanced video):\
- :am:bs:ms:xn:xo:\
- :co#80:it#8:li#24:vt#3:\
- :@8=\EOM:DO=\E[%dB:K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:K5=\EOn:\
- :LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:SA=\E[?7h:UP=\E[%dA:\
- :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\
- :ae=^O:as=^N:bl=^G:cb=\E[1K:cd=\E[J:ce=\E[K:cl=\E[H\E[J:\
- :cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:ct=\E[3g:do=^J:\
- :eA=\E(B\E)0:ho=\E[H:k0=\EOy:k1=\EOP:k2=\EOQ:k3=\EOR:\
- :k4=\EOS:k5=\EOt:k6=\EOu:k7=\EOv:k8=\EOl:k9=\EOw:k;=\EOx:\
- :kb=^H:kd=\EOB:ke=\E[?1l\E>:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
- :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[m\017:mr=\E[7m:\
- :nd=\E[C:r2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:rc=\E8:\
- :..sa=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;:\
- :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:ue=\E[m:\
- :up=\E[A:us=\E[4m:
-vt100nam|vt100-nam|vt100 no automargins:\
- :am@:xn@:tc=vt100-am:
-vt100-vb|dec vt100 (w/advanced video) & no beep:\
- :bl@:vb=\E[?5h\E[?5l:tc=vt100:
-
-# Ordinary vt100 in 132 column ("wide") mode.
-vt100-w|vt100-w-am|dec vt100 132 cols (w/advanced video):\
- :co#132:li#24:\
- :r2=\E>\E[?3h\E[?4l\E[?5l\E[?8h:tc=vt100-am:
-vt100-w-nam|vt100-nam-w|dec vt100 132 cols (w/advanced video no automargin):\
- :co#132:li#14:vt@:\
- :r2=\E>\E[?3h\E[?4l\E[?5l\E[?8h:tc=vt100-nam:
-
-# vt100 with no advanced video.
-vt100-nav|vt100 without advanced video option:\
- :sg#1:\
- :mb@:md@:me@:mr@:sa@:se=\E[m:so=\E[7m:ue@:us@:tc=vt100:
-vt100-nav-w|vt100-w-nav|dec vt100 132 cols 14 lines (no advanced video option):\
- :co#132:li#14:tc=vt100-nav:
-
-# vt100 with one of the 24 lines used as a status line.
-# We put the status line on the top.
-vt100-s|vt100-s-top|vt100-top-s|vt100 for use with top sysline:\
- :es:hs:\
- :li#23:\
- :cl=\E[2;1H\E[J:cm=\E[%i%+^A;%dH:cs=\E[%i%i%d;%dr:\
- :ds=\E7\E[1;24r\E8:fs=\E8:ho=\E[2;1H:is=\E7\E[2;24r\E8:\
- :ts=\E7\E[1;%p1%dH\E[1K:\
- :tc=vt100-am:
-
-# Status line at bottom.
-# Clearing the screen will clobber status line.
-vt100-s-bot|vt100-bot-s|vt100 for use with bottom sysline:\
- :es:hs:\
- :li#23:\
- :ds=\E7\E[1;24r\E8:fs=\E8:is=\E[1;23r\E[23;1H:\
- :ts=\E7\E[24;%p1%dH\E[1K:\
- :tc=vt100-am:
-
-# Most of the `vt100' emulators out there actually emulate a vt102
-# This entry (or vt102-nsgr) is probably the right thing to use for
-# these.
-vt102|dec vt102:\
- :mi:\
- :al=\E[L:dc=\E[P:dl=\E[M:ei=\E[4l:im=\E[4h:tc=vt100:
-vt102-w|dec vt102 in wide mode:\
- :co#132:\
- :r3=\E[?3h:tc=vt102:
-
-# Many brain-dead PC comm programs that pretend to be `vt100-compatible'
-# fail to interpret the ^O and ^N escapes properly. Symptom: the :me:
-# string in the canonical vt100 entry above leaves the screen littered
-# with little snowflake or star characters (IBM PC ROM character \017 = ^O)
-# after highlight turnoffs. This entry should fix that, and even leave
-# ACS support working, at the cost of making multiple-highlight changes
-# slightly more expensive.
-# From: Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995
-vt102-nsgr|vt102 no sgr (use if you see snowflakes after highlight changes):\
- :me=\E[m:sa@:\
- :tc=vt102:
-
-# VT125 Graphics CRT. Clear screen also erases graphics
-vt125|vt125 graphics terminal:\
- :cl=\E[H\E[2J\EPpS(E)\E\:tc=vt100:
-
-# This isn't a DEC entry, it came from University of Wisconsin.
-# (vt131: I added <rmam>/<smam> based on the init string, also :bs: -- esr)
-vt131|dec vt131:\
- :am:bs:xn:\
- :co#80:it#8:li#24:vt#3:\
- :RA=\E[?7h:SA=\E[?7h:bl=^G:cd=50\E[J:ce=3\E[K:\
- :cl=50\E[;H\E[2J:cm=5\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:\
- :do=^J:ho=\E[H:is=\E[1;24r\E[24;1H:k1=\EOP:k2=\EOQ:\
- :k3=\EOR:k4=\EOS:kb=^H:kd=\EOB:ke=\E[?1l\E>:kl=\EOD:\
- :kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:mb=2\E[5m:md=2\E[1m:\
- :me=2\E[m:mr=2\E[7m:nd=2\E[C:nw=^M^J:\
- :r1=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:rc=\E8:sc=\E7:\
- :se=2\E[m:so=2\E[7m:sr=5\EM:ta=^I:ue=2\E[m:up=2\E[A:\
- :us=2\E[4m:
-
-# vt132 - like vt100 but slower and has ins/del line and such.
-# I'm told that :im:/:ei: are backwards in the terminal from the
-# manual and from the ANSI standard, this describes the actual
-# terminal. I've never actually used a vt132 myself, so this
-# is untested.
-#
-vt132|DEC vt132:\
- :xn:\
- :al=\E[L:dc=\E[P:dl=\E[M:ei=\E[4h:im=\E[4l:ip=:sf=\n:tc=vt100:
-
-# This vt220 description maps F5--F9 to the second block of function keys
-# at the top of the keyboard. The "DO" key is used as F10 to avoid conflict
-# with the key marked (ESC) on the vt220. See vt220d for an alternate mapping.
-# PF1--PF4 are used as F1--F4.
-#
-vt220-old|vt200-old|DEC VT220 in vt100 emulation mode:\
- :am:bs:mi:pt:xn:xo:\
- :co#80:li#24:vt#3:\
- :@7=\E[4~:RA=\E[?7l:SA=\E[?7h:\
- :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\
- :ae=\E(B:al=\E[L:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:\
- :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:\
- :dc=\E[P:dl=\E[M:do=\E[B:ei=\E[4l:ho=\E[H:\
- :if=/usr/share/tabset/vt100:im=\E[4h:\
- :is=\E[1;24r\E[24;1H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
- :k5=\E[17~:k6=\E[18~:k7=\E[19~:k8=\E[20~:k9=\E[21~:\
- :k;=\E[29~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:\
- :kd=\E[B:kh=\E[1~:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:mb=\E[5m:\
- :md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:nl=^J:\
- :r2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:rc=\E8:\
- :rf=/usr/share/tabset/vt100:\
- :..sa=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;:\
- :sc=\E7:se=\E[27m:sf=20\ED:so=\E[7m:sr=14\EM:ta=^I:\
- :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
-
-# A much better description of the VT200/220; used to be vt220-8
-# (untranslatable capabilities removed to fit entry within 1023 bytes)
-# (sgr removed to fit entry within 1023 bytes)
-# (terminfo-only capabilities suppressed to fit entry within 1023 bytes)
-vt220|vt200|dec vt220:\
- :am:bs:mi:ms:xn:xo:\
- :co#80:it#8:li#24:vt#3:\
- :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
- :LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:as=^N:bl=^G:\
- :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
- :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:ec=\E[%dX:\
- :ei=\E[4l:ho=\E[H:if=/usr/share/tabset/vt100:im=\E[4h:\
- :is=\E[?7h\E[>\E[?1h\E F\E[?4l:k1=\EOP:k2=\EOQ:k3=\EOR:\
- :k4=\EOS:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:kI=\E[2~:\
- :kN=\E[6~:kP=\E[5~:kb=^H:kd=\E[B:kh=\E[H:kl=\E[D:kr=\E[C:\
- :ku=\E[A:le=^H:mb=\E[5m:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:\
- :nw=\EE:rc=\E8:sc=\E7:se=\E[27m:sf=\ED:so=\E[7m:sr=\EM:\
- :st=\EH:ta=^I:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:
-vt220-w|vt200-w|DEC vt220 in wide mode:\
- :co#132:\
- :r3=\E[?3h:tc=vt220:
-# (untranslatable capabilities removed to fit entry within 1023 bytes)
-# (sgr removed to fit entry within 1023 bytes)
-# (terminfo-only capabilities suppressed to fit entry within 1023 bytes)
-vt220-8bit|vt220-8|vt200-8bit|vt200-8|dec vt220/200 in 8-bit mode:\
- :am:bs:mi:ms:xn:xo:\
- :co#80:it#8:li#24:vt#3:\
- :AL=\233%dL:DC=\233%dP:DL=\233%dM:DO=\233%dB:IC=\233%d@:\
- :LE=\233%dD:RI=\233%dC:UP=\233%dA:ae=^O:al=\233L:as=^N:\
- :bl=^G:cd=\233J:ce=\233K:cl=\233H\233J:cm=\233%i%d;%dH:\
- :cr=^M:cs=\233%i%d;%dr:ct=\2333g:dc=\233P:dl=\233M:do=^J:\
- :ec=\233%dX:ei=\2334l:ho=\233H:\
- :if=/usr/share/tabset/vt100:im=\2334h:\
- :is=\233?7h\233>\233?1h\E F\233?4l:k1=\EOP:k2=\EOQ:\
- :k3=\EOR:k4=\EOS:k6=\23317~:k7=\23318~:k8=\23319~:\
- :k9=\23320~:kI=\2332~:kN=\2336~:kP=\2335~:kb=^H:kd=\233B:\
- :kh=\233H:kl=\233D:kr=\233C:ku=\233A:le=^H:mb=\2335m:\
- :md=\2331m:me=\233m:mr=\2337m:nd=\233C:nw=\EE:rc=\E8:\
- :sc=\E7:se=\23327m:sf=\ED:so=\2337m:sr=\EM:st=\EH:ta=^I:\
- :ue=\23324m:up=\233A:us=\2334m:vb=\233?5h\233?5l:
-
-#
-# vt220d:
-# This vt220 description regards F6--F10 as the second block of function keys
-# at the top of the keyboard. This mapping follows the description given
-# in the VT220 Programmer Reference Manual and agrees with the labeling
-# on some terminals that emulate the vt220. There is no support for an F5.
-# See vt220 for an alternate mapping.
-#
-vt220d|DEC VT220 in vt100 mode with DEC function key labeling:\
- :F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:F5=\E[28~:\
- :F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:k5@:\
- :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:\
- :tc=vt220-old:
-
-vt220-nam|v200-nam|VT220 in vt100 mode with no auto margins:\
- :am@:\
- :r2=\E>\E[?3l\E[?4l\E[?5l\E[?7l\E[?8h:tc=vt220:
-
-# vt220 termcap written Tue Oct 25 20:41:10 1988 by Alex Latzko
-# (not an official DEC entry!)
-# The problem with real vt220 terminals is they don't send escapes when in
-# in vt220 mode. This can be gotten around two ways. 1> don't send
-# escapes or 2> put the vt220 into vt100 mode and use all the nifty
-# features of vt100 advanced video which it then has.
-#
-# This entry takes the view of putting a vt220 into vt100 mode so
-# you can use the escape key in emacs and everything else which needs it.
-#
-# You probably don't want to use this on a VMS machine since VMS will think
-# it has a vt220 and will get fouled up coming out of emacs
-#
-# From: Alexander Latzko <latzko@marsenius.rutgers.edu>, 30 Dec 1996
-# (Added vt100 :rc:,:sc: to quiet a tic warning -- esr)
-vt200-js|vt220-js|dec vt200 series with jump scroll:\
- :am:\
- :co#80:\
- :al=\E[L:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:\
- :cr=^M:cs=\E[%i%d;%dr:dc=\E[P:dl=\E[M:dm=:do=^J:ed=:\
- :ei=\E[4l:ho=\E[H:im=\E[4h:\
- :is=\E[61"p\E[H\E[?3l\E[?4l\E[?1l\E[?5l\E[?6l\E[?7h\E[?8h\E[?25h\E>\E[m:\
- :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:kb=^H:kd=\EOB:\
- :ke=\E[?1l\E>:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:\
- :nw=^M\ED:r1=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:rc=\E8:\
- :rf=/usr/lib/tabset/vt100:sc=\E7:se=5\E[27m:sf=\ED:\
- :so=5\E[7m:sr=\EM:ta=^I:ue=\E[24m:up=\E[A:us=\E[4m:
-
-
-# This was DEC's vt320. Use the purpose-built one below instead
-#vt320|DEC VT320 in vt100 emulation mode,
-# use=vt220,
-
-#
-# Use v320n for SCO's LYRIX. Otherwise, use Adam Thompson's vt320-nam.
-#
-vt320nam|v320n|DEC VT320 in vt100 emul. mode with NO AUTO WRAP mode:\
- :am@:\
- :r2=\E>\E[?3l\E[?4l\E[?5l\E[?7l\E[?8h:tc=vt220:
-
-# These entries are not DEC's official ones, they were purpose-built for the
-# VT320. Here are the designer's notes:
-# <kel> is end on a PC kbd. Actually 'select' on a VT. Mapped to
-# 'Erase to End of Field'... since nothing seems to use 'end' anyways...
-# khome is Home on a PC kbd. Actually 'FIND' on a VT.
-# Things that use <knxt> usually use tab anyways... and things that don't use
-# tab usually use <knxt> instead...
-# kprv is same as tab - Backtab is useless...
-# I left out :sa: because of its RIDICULOUS complexity,
-# and the resulting fact that it causes the termcap translation of the entry
-# to SMASH the 1k-barrier...
-# From: Adam Thompson <athompso@pangea.ca> Sept 10 1995
-# (vt320: uncommented :fs:, comnmmented out <kslt> to avoid a conflict --esr)
-# (untranslatable capabilities removed to fit entry within 1023 bytes)
-# (sgr removed to fit entry within 1023 bytes)
-# (terminfo-only capabilities suppressed to fit entry within 1023 bytes)
-vt320|vt300|dec vt320 7 bit terminal:\
- :am:es:hs:mi:ms:xn:\
- :co#80:li#24:ws#80:\
- :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
- :K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\
- :RI=\E[%dC:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:bl=^G:cd=\E[J:\
- :ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:\
- :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:ec=\E[%dX:\
- :ei=\E[4l:fs=\E[0$}:ho=\E[H:im=\E[4h:\
- :is=\E>\E[?3l\E[?4l\E[5?l\E[?7h\E[?8h\E[1;24r\E[24;1H:\
- :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k6=\E[17~:k7=\E[18~:\
- :k8=\E[19~:k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:\
- :kb=\177:kd=\EOB:ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:\
- :ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[m:\
- :mr=\E[7m:nd=\E[C:nw=\EE:rc=\E8:sc=\E7:se=\E[m:sf=\ED:\
- :so=\E[7m:sr=\EM:st=\EH:ta=^I:ts=\E[1$}\E[H\E[K:ue=\E[m:\
- :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
-vt320-nam|vt300-nam|dec vt320 7 bit terminal with no am to make SAS happy:\
- :am@:\
- :is=\E>\E[?3l\E[?4l\E[5?l\E[?7l\E[?8h\E[1;24r\E[24;1H:\
- :r2=\E>\E[?3l\E[?4l\E[5?l\E[?7l\E[?8h\E[1;24r\E[24;1H:\
- :tc=vt320:
-# We have to init 132-col mode, not 80-col mode.
-vt320-w|vt300-w|dec vt320 wide 7 bit terminal:\
- :co#132:ws#132:\
- :is=\E>\E[?3h\E[?4l\E[5?l\E[?7h\E[?8h\E[1;24r\E[24;1H:\
- :r2=\E>\E[?3h\E[?4l\E[5?l\E[?7h\E[?8h\E[1;24r\E[24;1H:\
- :tc=vt320:
-vt320-w-nam|vt300-w-nam|dec vt320 wide 7 bit terminal with no am:\
- :am@:\
- :is=\E>\E[?3h\E[?4l\E[5?l\E[?7l\E[?8h\E[1;24r\E[24;1H:\
- :r2=\E>\E[?3h\E[?4l\E[5?l\E[?7l\E[?8h\E[1;24r\E[24;1H:\
- :tc=vt320-w:
-
-# VT330 and VT340 -- These are ReGIS and SIXEL graphics terminals
-# which are pretty much a superset of the VT320. They have the
-# host writable status line, yet another different DRCS matrix size,
-# and such, but they add the DEC Technical character set, Multiple text
-# pages, selectable length pages, and the like. The difference between
-# the vt330 and vt340 is that the latter has only 2 planes and a monochrome
-# monitor, the former has 4 planes and a color monitor. These terminals
-# support VT131 and ANSI block mode, but as with much of these things,
-# termcap/terminfo doesn't deal with these features.
-#
-# Note that this entry is are set up in what was the standard way for GNU
-# Emacs v18 terminal modes to deal with the cursor keys in that the arrow
-# keys were switched into application mode at the same time the numeric pad
-# is switched into application mode. This changes the definitions of the
-# arrow keys. Emacs v19 is smarter and mines its keys directly out of
-# your termcap or terminfo entry,
-#
-# From: Daniel Glasser <dag@persoft.persoft.com>, 13 Oct 1993
-# (vt340: string capability "sb=\E[M" corrected to "sr";
-# also, added <rmam>/<smam> based on the init string -- esr)
-vt340|dec-vt340|vt330|dec-vt330|dec vt340 graphics terminal with 24 line page:\
- :am:es:hs:mi:ms:xn:xo:\
- :co#80:it#8:li#24:vt#3:\
- :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
- :LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:SA=\E[?7h:UP=\E[%dA:\
- :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\
- :ae=^O:al=\E[L:as=^N:cd=\E[J:ce=\E[K:cl=\E[H\E[J:\
- :cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:\
- :dl=\E[M:do=^J:ds=\E[2$~\r\E[1$}\E[K\E[$}:ei=\E[4l:\
- :fs=\E[$}:ho=\E[H:im=\E[4h:\
- :is=\E<\E F\E>\E[?1h\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;24r\E[24;1H:\
- :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k6=\E[17~:k7=\E[18~:\
- :k8=\E[19~:k9=\E[20~:kb=^H:kd=\EOB:ke=\E[?1l\E>:kl=\EOD:\
- :kr=\EOC:ks=\E[?1h\E=:ku=\EOA:l1=pf1:l2=pf2:l3=pf3:l4=pf4:\
- :le=^H:mb=\E[5m:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:nw=^M\ED:\
- :r1=\E[?3l:rc=\E8:rf=/usr/share/tabset/vt300:sc=\E7:\
- :se=\E[27m:sf=\ED:so=\E[7m:sr=\EM:st=\EH:ta=^I:\
- :ts=\E[2$~\E[1$}\E[1;%dH:ue=\E[24m:up=\E[A:us=\E[4m:\
- :vb=200\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:vs=\E[?25h:
-
-# DEC doesn't supply a vt400 description, so we add Daniel Glasser's
-# (originally written with vt420 as its primary name, and usable for it).
-#
-# VT400/420 -- This terminal is a superset of the vt320. It adds the multiple
-# text pages and long text pages with selectable length of the vt340, along
-# with left and right margins, rectangular area text copy, fill, and erase
-# operations, selected region character attribute change operations,
-# page memory and rectangle checksums, insert/delete column, reception
-# macros, and other features too numerous to remember right now. TERMCAP
-# can only take advantage of a few of these added features.
-#
-# Note that this entry is are set up in what was the standard way for GNU
-# Emacs v18 terminal modes to deal with the cursor keys in that the arrow
-# keys were switched into application mode at the same time the numeric pad
-# is switched into application mode. This changes the definitions of the
-# arrow keys. Emacs v19 is smarter and mines its keys directly out of
-# your termcap entry,
-#
-# From: Daniel Glasser <dag@persoft.persoft.com>, 13 Oct 1993
-# (vt400: string capability ":sb=\E[M:" corrected to ":sr=\E[M:";
-# also, added <rmam>/<smam> based on the init string -- esr)
-# (untranslatable capabilities removed to fit entry within 1023 bytes)
-# (sgr removed to fit entry within 1023 bytes)
-# (terminfo-only capabilities suppressed to fit entry within 1023 bytes)
-vt400|vt400-24|dec-vt400|dec vt400 24x80 column autowrap:\
- :am:es:hs:mi:ms:xn:xo:\
- :co#80:it#8:li#24:vt#3:\
- :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
- :LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:as=^N:\
- :cd=10\E[J:ce=4\E[K:cl=10\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
- :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:\
- :ds=\E[2$~\r\E[1$}\E[K\E[$}:ei=\E[4l:fs=\E[$}:ho=\E[H:\
- :ic=\E[@:im=\E[4h:\
- :is=\E<\E F\E>\E[?1h\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;24r\E[24;1H:\
- :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k6=\E[17~:k7=\E[18~:\
- :k8=\E[19~:k9=\E[20~:kb=^H:kd=\EOB:ke=\E[?1l\E>:kl=\EOD:\
- :kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:\
- :me=\E[m:mr=\E[7m:nd=\E[C:nw=^M\ED:rc=\E8:sc=\E7:se=\E[27m:\
- :sf=\ED:so=\E[7m:sr=\EM:st=\EH:ta=^I:\
- :ts=\E[2$~\E[1$}\E[1;%dH:ue=\E[24m:up=\E[A:us=\E[4m:\
- :vb=200\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:vs=\E[?25h:
-
-# (vt420: I removed :k0:, it collided with <kf10>. I also restored
-# a missing :sc: -- esr)
-vt420|DEC VT420:\
- :am:mi:xn:xo:\
- :co#80:li#24:vt#3:\
- :*6=\E[4~:@0=\E[1~:RA=\E[?7l:\
- :S5=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:\
- :SA=\E[?7h:\
- :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\
- :ae=\E(B:al=\E[L:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:\
- :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:\
- :dc=\E[P:dl=\E[M:do=\E[B:ei=\E[4l:ho=\E[H:\
- :i2=\E[?67h\E[64;1"p:if=/usr/share/tabset/vt300:\
- :im=\E[4h:is=\E[1;24r\E[24;1H:k1=\EOP:k2=\EOQ:k3=\EOR:\
- :k4=\EOS:k5=\E[17~:k6=\E[18~:k7=\E[19~:k8=\E[20~:\
- :k9=\E[21~:k;=\E[29~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:\
- :kb=^H:kd=\E[B:ke=\E>:kl=\E[D:kr=\E[C:ks=\E=:ku=\E[A:le=^H:\
- :mb=\E[5m:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:\
- :r3=\E[?67h\E[64;1"p:rc=\E8:rf=/usr/share/tabset/vt300:\
- :..sa=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;:\
- :sc=\E7:se=\E[m:sf=\ED:so=\E[7m:sr=\EM:ta=^I:ue=\E[m:\
- :up=\E[A:us=\E[4m:
-
-#
-# DEC VT220 and up support DECUDK (user-defined keys). DECUDK (i.e., pfx)
-# takes two parameters, the key and the string. Translating the key is
-# straightforward (keys 1-5 are not defined on real terminals, though some
-# emulators define these):
-#
-# if (key < 16) then value = key;
-# else if (key < 21) then value = key + 1;
-# else if (key < 25) then value = key + 2;
-# else if (key < 27) then value = key + 3;
-# else if (key < 30) then value = key + 4;
-# else value = key + 5;
-#
-# The string must be the hexadecimal equivalent, e.g., "5052494E" for "PRINT".
-# There's no provision in terminfo for emitting a string in this format, so the
-# application has to know it.
-#
-vt420pc|DEC VT420 w/PC keyboard:\
- :@7=\E[4~:F1=\E[23~:F2=\E[24~:F3=\E[11;2~:F4=\E[12;2~:\
- :F5=\E[13;2~:F6=\E[14;2~:F7=\E[15;2~:F8=\E[17;2~:\
- :F9=\E[18;2~:FA=\E[19;2~:FB=\E[20;2~:FC=\E[21;2~:\
- :FD=\E[23;2~:FE=\E[24;2~:FF=\E[23~:FG=\E[24~:FH=\E[25~:\
- :FI=\E[26~:FJ=\E[28~:FK=\E[29~:FL=\E[31~:FM=\E[32~:\
- :FN=\E[33~:FO=\E[34~:FP=\E[35~:FQ=\E[36~:FR=\E[23;2~:\
- :FS=\E[24;2~:FT=\E[25;2~:FU=\E[26;2~:FV=\E[28;2~:\
- :FW=\E[29;2~:FX=\E[31;2~:FY=\E[32;2~:FZ=\E[33;2~:\
- :Fa=\E[34;2~:Fb=\E[35;2~:Fc=\E[36;2~:\
- :S6=USR_TERM\072vt420pcdos\072:k1=\E[11~:k2=\E[12~:\
- :k3=\E[13~:k4=\E[14~:k5=\E[15~:k6=\E[17~:k7=\E[18~:\
- :k8=\E[19~:k9=\E[20~:k;=\E[21~:kD=\177:kh=\E[H:\
- :..px=\EP1;1|%?%{16}%p1%>%t%{0}%e%{21}%p1%>%t%{1}%e%{25}%p1%>%t%{2}%e%{27}%p1%>%t%{3}%e%{30}%p1%>%t%{4}%e%{5}%;%p1%+%d/%p2%s\E\:tc=vt420:
-
-vt420pcdos|DEC VT420 w/PC for DOS Merge:\
- :li#25:\
- :S1=%?%p2%{19}%=%t\E\023\021%e%p2%{32}%<%t\E%p2%c%e%p2%{127}%=%t\E\177%e%p2%c%;:\
- :S4=\E[?1;2r\E[34h:\
- :S5=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:S6@:\
- :me=\E[m:sa@:\
- :tc=vt420pc:
-
-vt420f|DEC VT420 with VT kbd; VT400 mode; F1-F5 used as Fkeys:\
- :F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:F5=\E[28~:\
- :F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\
- :k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\
- :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:\
- :kD=\177:kh=\E[H:l1=\EOP:l2=\EOQ:l3=\EOR:l4=\EOS:\
- :tc=vt420:
-
-vt510|DEC VT510:\
- :tc=vt420:
-vt510pc|DEC VT510 w/PC keyboard:\
- :tc=vt420pc:
-vt510pcdos|DEC VT510 w/PC for DOS Merge:\
- :tc=vt420pcdos:
-
-# VT520/VT525
-#
-# The VT520 is a monochrome text terminal capable of managing up to
-# four independent sessions in the terminal. It has multiple ANSI
-# emulations (VT520, VT420, VT320, VT220, VT100, VT PCTerm, SCO Console)
-# and ASCII emulations (WY160/60, PCTerm, 50/50+, 150/120, TVI 950,
-# 925 910+, ADDS A2). This terminfo data is for the ANSI emulations only.
-#
-# Terminal Set-Up is entered by pressing [F3], [Caps Lock]/[F3] or
-# [Alt]/[Print Screen] depending upon which keyboard and which
-# terminal mode is being used. If Set-Up has been disabled or
-# assigned to an unknown key, Set-Up may be entered by pressing
-# [F3] as the first key after power up, regardless of keyboard type.
-# (vt520: I added <rmam>/<smam> based on the init string, also :sc: -- esr)
-# (untranslatable capabilities removed to fit entry within 1023 bytes)
-vt520|DEC VT520:\
- :am:mi:xn:xo:\
- :co#80:li#24:vt#3:\
- :*6=\E[4~:@0=\E[1~:RA=\E[?7l:\
- :S5=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:\
- :SA=\E[?7h:\
- :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\
- :ae=\E(B:al=\E[L:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:\
- :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:\
- :dc=\E[P:dl=\E[M:do=\E[B:ei=\E[4l:ho=\E[H:\
- :i2=\E[?67h\E[64;1"p:if=/usr/share/tabset/vt300:\
- :im=\E[4h:is=\E[1;24r\E[24;1H:k0=\E[29~:k1=\EOP:k2=\EOQ:\
- :k3=\EOR:k4=\EOS:k5=\E[17~:k6=\E[18~:k7=\E[19~:k8=\E[20~:\
- :k9=\E[21~:k;=\E[29~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:\
- :kb=^H:kd=\E[B:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:mb=\E[5m:\
- :md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:r3=\E[?67h\E[64;1"p:\
- :rc=\E8:rf=/usr/share/tabset/vt300:sc=\E7:se=\E[m:sf=\ED:\
- :so=\E[7m:sr=\EM:ta=^I:ue=\E[m:up=\E[A:us=\E[4m:
-
-# (vt525: I added <rmam>/<smam> based on the init string;
-# removed :se:=\E[m, :ue:=\E[m, added :sc: -- esr)
-# (untranslatable capabilities removed to fit entry within 1023 bytes)
-vt525|DEC VT525:\
- :am:mi:xn:xo:\
- :co#80:li#24:vt#3:\
- :*6=\E[4~:@0=\E[1~:RA=\E[?7l:\
- :S5=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:\
- :SA=\E[?7h:\
- :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\
- :ae=\E(B:al=\E[L:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:\
- :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:\
- :dc=\E[P:dl=\E[M:do=\E[B:ei=\E[4l:ho=\E[H:\
- :i2=\E[?67h\E[64;1"p:if=/usr/share/tabset/vt300:\
- :im=\E[4h:is=\E[1;24r\E[24;1H:k0=\E[29~:k1=\EOP:k2=\EOQ:\
- :k3=\EOR:k4=\EOS:k5=\E[17~:k6=\E[18~:k7=\E[19~:k8=\E[20~:\
- :k9=\E[21~:k;=\E[29~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:\
- :kb=^H:kd=\E[B:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:mb=\E[5m:\
- :md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:r3=\E[?67h\E[64;1"p:\
- :rc=\E8:rf=/usr/share/tabset/vt300:sc=\E7:se=\E[m:sf=\ED:\
- :so=\E[7m:sr=\EM:ta=^I:ue=\E[m:up=\E[A:us=\E[4m:
diff --git a/tests/examplefiles/terminfo b/tests/examplefiles/terminfo
deleted file mode 100644
index 2b68d035..00000000
--- a/tests/examplefiles/terminfo
+++ /dev/null
@@ -1,1445 +0,0 @@
-######## This example from excerpt of <http://www.catb.org/esr/terminfo/>:
-#
-# Version 11.0.1
-# $Date: 2000/03/02 15:51:11 $
-# terminfo syntax
-#
-
-######## ANSI, UNIX CONSOLE, AND SPECIAL TYPES
-#
-# This section describes terminal classes and brands that are still
-# quite common.
-#
-
-#### Specials
-#
-# Special "terminals". These are used to label tty lines when you don't
-# know what kind of terminal is on it. The characteristics of an unknown
-# terminal are the lowest common denominator - they look about like a ti 700.
-#
-
-dumb|80-column dumb tty,
- am,
- cols#80,
- bel=^G, cr=^M, cud1=^J, ind=^J,
-unknown|unknown terminal type,
- gn, use=dumb,
-lpr|printer|line printer,
- hc, os,
- cols#132, lines#66,
- bel=^G, cr=^M, cub1=^H, cud1=^J, ff=^L, ind=^J,
-glasstty|classic glass tty interpreting ASCII control characters,
- am,
- cols#80,
- bel=^G, clear=^L, cr=^M, cub1=^H, cud1=^J, ht=^I, kcub1=^H,
- kcud1=^J, nel=^M^J,
-vanilla,
- bel=^G, cr=^M, cud1=^J, ind=^J,
-
-#### ANSI.SYS/ISO 6429/ECMA-48 Capabilities
-#
-# See the end-of-file comment for more on these.
-#
-
-# ANSI capabilities are broken up into pieces, so that a terminal
-# implementing some ANSI subset can use many of them.
-ansi+local1,
- cub1=\E[D, cud1=\E[B, cuf1=\E[C, cuu1=\E[A,
-ansi+local,
- cub=\E[%p1%dD, cud=\E[%p1%dB, cuf=\E[%p1%dC,
- cuu=\E[%p1%dA,
- use=ansi+local1,
-ansi+tabs,
- cbt=\E[Z, ht=^I, hts=\EH, tbc=\E[2g,
-ansi+inittabs,
- it#8, use=ansi+tabs,
-ansi+erase,
- clear=\E[H\E[J, ed=\E[J, el=\E[K,
-ansi+rca,
- hpa=\E[%p1%{1}%+%dG, vpa=\E[%p1%{1}%+%dd,
-ansi+cup,
- cup=\E[%i%p1%d;%p2%dH, home=\E[H,
-ansi+rep,
- rep=%p1%c\E[%p2%{1}%-%db,
-ansi+idl1,
- dl1=\E[M, il1=\E[L,
-ansi+idl,
- dl=\E[%p1%dM, il=\E[%p1%dL, use=ansi+idl1,
-ansi+idc,
- dch1=\E[P, ich=\E[%p1%d@, ich1=\E[@, rmir=\E6, smir=\E6,
-ansi+arrows,
- kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
- khome=\E[H,
-ansi+sgr|ansi graphic renditions,
- blink=\E[5m, invis=\E[8m, rev=\E[7m, sgr0=\E[0m,
-ansi+sgrso|ansi standout only,
- rmso=\E[m, smso=\E[7m,
-ansi+sgrul|ansi underline only,
- rmul=\E[m, smul=\E[4m,
-ansi+sgrbold|ansi graphic renditions; assuming terminal has bold; not dim,
- bold=\E[1m,
- sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;m, use=ansi+sgr, use=ansi+sgrso, use=ansi+sgrul,
-ansi+sgrdim|ansi graphic renditions; assuming terminal has dim; not bold,
- dim=\E[2m,
- sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p5%t2;%;m, use=ansi+sgr, use=ansi+sgrso, use=ansi+sgrul,
-ansi+pp|ansi printer port,
- mc0=\E[0i, mc4=\E[4i, mc5=\E[5i,
-ansi+csr|ansi scroll-region plus cursor save & restore,
- csr=\E[%i%p1%d;%p2%dr, rc=\E8, sc=\E7,
-
-# The IBM PC alternate character set. Plug this into any Intel console entry.
-# We use \E[11m for rmacs rather than \E[12m so the <acsc> string can use the
-# ROM graphics for control characters such as the diamond, up- and down-arrow.
-# This works with the System V, Linux, and BSDI consoles. It's a safe bet this
-# will work with any Intel console, they all seem to have inherited \E[11m
-# from the ANSI.SYS de-facto standard.
-klone+acs|alternate character set for ansi.sys displays,
- acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
- rmacs=\E[10m, smacs=\E[11m,
-
-# Highlight controls corresponding to the ANSI.SYS standard. Most
-# console drivers for Intel boxes obey these. Makes the same assumption
-# about \E[11m as klone+acs. True ANSI/ECMA-48 would have <rmso=\E[27m>,
-# <rmul=\E[24m>, but this isn't a documented feature of ANSI.SYS.
-klone+sgr|attribute control for ansi.sys displays,
- blink=\E[5m, bold=\E[1m, invis=\E[8m, rev=\E[7m,
- rmpch=\E[10m, rmso=\E[m, rmul=\E[m,
- sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m,
- sgr0=\E[0;10m, smpch=\E[11m, smso=\E[7m, smul=\E[4m,
- use=klone+acs,
-
-# Highlight controls corresponding to the ANSI.SYS standard. *All*
-# console drivers for Intel boxes obey these. Does not assume \E[11m will
-# work; uses \E[12m instead, which is pretty bulletproof but loses you the ACS
-# diamond and arrow characters under curses.
-klone+sgr-dumb|attribute control for ansi.sys displays (no ESC [ 11 m),
- blink=\E[5m, bold=\E[1m, invis=\E[8m, rev=\E[7m, rmso=\E[m,
- rmul=\E[m,
- sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;12%;m,
- sgr0=\E[0;10m, smacs=\E[12m, smso=\E[7m, smul=\E[4m,
- use=klone+acs,
-
-# KOI8-R (RFC1489) acs (alternate character set)
-# From: Qing Long <qinglong@Bolizm.ihep.su>, 24 Feb 1996.
-klone+koi8acs|alternate character set for ansi.sys displays with KOI8 charset,
- acsc=+\020\,\021-\036.^_0\215`\004a\237f\234g\232h\222i\220j\205k\203l\202m\204n\212o\213p\216q\0r\217s\214t\206u\207v\210w\211x\201y\230z\231{\267|\274}L~\225,
- rmacs=\E[10m, smacs=\E[11m,
-
-# ANSI.SYS color control. The setab/setaf caps depend on the coincidence
-# between SVr4/XPG4's color numbers and ANSI.SYS attributes. Here are longer
-# but equivalent strings that don't rely on that coincidence:
-# setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-# setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-# The DOS 5 manual asserts that these sequences meet the ISO 6429 standard.
-# They match a subset of ECMA-48.
-klone+color|color control for ansi.sys and ISO6429-compatible displays,
- colors#8, ncv#3, pairs#64,
- op=\E[37;40m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
-
-# This is better than klone+color, it doesn't assume white-on-black as the
-# default color pair, but many `ANSI' terminals don't grok the <op> cap.
-ecma+color|color control for ECMA-48-compatible terminals,
- colors#8, ncv#3, pairs#64,
- op=\E[39;49m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
-
-# Attribute control for ECMA-48-compatible terminals
-ecma+sgr|attribute capabilities for true ECMA-48 terminals,
- rmso=\E[27m, rmul=\E[24m,
- use=klone+sgr,
-
-# For comparison, here are all the capabilities implied by the Intel
-# Binary Compatibility Standard (level 2) that fit within terminfo.
-# For more detail on this rather pathetic standard, see the comments
-# near the end of this file.
-ibcs2|Intel Binary Compatibility Standard prescriptions,
- cbt=\E[Z, clear=\Ec, cub=\E[%p1%dD, cud=\E[%p1%dB,
- cuf=\E[%p1%dC, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA,
- dch=\E[%p1%dP, dispc=\E=%p1%dg, ech=\E[%p1%dX,
- hpa=\E[%i%p1%dG, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL,
- indn=\E[%p1%dS, rc=\E7, rin=\E[%p1%dT, rmam=\E[?7l, sc=\E7,
- smam=\E[?7h, tbc=\E[g, vpa=\E[%i%p1%dd,
-
-#### ANSI/ECMA-48 terminals and terminal emulators
-#
-# See near the end of this file for details on ANSI conformance.
-# Don't mess with these entries! Lots of other entries depend on them!
-#
-# This section lists entries in a least-capable to most-capable order.
-# if you're in doubt about what `ANSI' matches yours, try them in that
-# order and back off from the first that breaks.
-
-# ansi-mr is for ANSI terminals with ONLY relative cursor addressing
-# and more than one page of memory. It uses local motions instead of
-# direct cursor addressing, and makes almost no assumptions. It does
-# assume auto margins, no padding and/or xon/xoff, and a 24x80 screen.
-ansi-mr|mem rel cup ansi,
- am, xon,
- cols#80, lines#24, use=vanilla, use=ansi+erase,
- use=ansi+local1,
-
-# ansi-mini is a bare minimum ANSI terminal. This should work on anything, but
-# beware of screen size problems and memory relative cursor addressing.
-ansi-mini|minimum ansi standard terminal,
- am, xon,
- cols#80, lines#24, use=vanilla, use=ansi+cup,
- use=ansi+erase,
-
-# ansi-mtabs adds relative addressing and minimal tab support
-ansi-mtabs|any ansi terminal with pessimistic assumptions,
- it#8,
- ht=^I, use=ansi+local1, use=ansi-mini,
-
-# ANSI X3.64 from emory!mlhhh (Hugh Hansard) via BRL
-#
-# The following is an entry for the full ANSI 3.64 (1977). It lacks
-# padding, but most terminals using the standard are "fast" enough
-# not to require any -- even at 9600 bps. If you encounter problems,
-# try including the padding specifications.
-#
-# Note: the :as: and :ae: specifications are not implemented here, for
-# the available termcap documentation does not make clear WHICH alternate
-# character set to specify. ANSI 3.64 seems to make allowances for several.
-# Please make the appropriate adjustments to fit your needs -- that is
-# if you will be using alternate character sets.
-#
-# There are very few terminals running the full ANSI 3.64 standard,
-# so I could only test this entry on one verified terminal (Visual 102).
-# I would appreciate the results on other terminals sent to me.
-#
-# Please report comments, changes, and problems to:
-#
-# U.S. MAIL: Hugh Hansard
-# Box: 22830
-# Emory University
-# Atlanta, GA. 30322.
-#
-# USENET {akgua,msdc,sb1,sb6,gatech}!emory!mlhhh.
-#
-# (Added vt100 <rc>,<sc> to quiet a tic warning --esr)
-ansi77|ansi 3.64 standard 1977 version,
- am, mir,
- cols#80, it#8, lines#24,
- bel=^G, clear=\E[;H\E[2J, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub1=^H, cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
- cuu1=\E[A, dch1=\E[P, dl1=\E[M$<5*/>, ed=\E[J, el=\E[K,
- home=\E[H, ht=^I, il1=\E[L$<5*/>, ind=\ED, kbs=^H,
- kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kf1=\EOP,
- kf2=\EOR, kf4=\EOS, khome=\E[H, nel=^M\ED, rc=\E8, ri=\EM,
- rmir=\E[4l, rmso=\E[m, rmul=\E[m, sc=\E7, smir=\E[4h,
- smso=\E[7m, smul=\E[4m,
-
-# Procomm and some other ANSI emulations don't recognize all of the ANSI-
-# standard capabilities. This entry deletes <cuu>, <cuf>, <cud>, <cub>, and
-# <vpa>/<hpa> capabilities, forcing curses to use repetitions of <cuu1>,
-# <cuf1>, <cud1> and <cub1>. Also deleted <ich> and <ich1>, as QModem up to
-# 5.03 doesn't recognize these. Finally, we delete <rep> and <ri>, which seem
-# to confuse many emulators. On the other hand, we can count on these programs
-# doing <rmacs>/<smacs>/<sgr>. Older versions of this entry featured
-# <invis=\E[9m>, but <invis=\E[8m> now seems to be more common under
-# ANSI.SYS influence.
-# From: Eric S. Raymond <esr@snark.thyrsus.com> Oct 30 1995
-pcansi-m|pcansi-mono|ibm-pc terminal programs claiming to be ansi (mono mode),
- am, mir, msgr,
- cols#80, it#8, lines#24,
- bel=^G, cbt=\E[Z, clear=\E[H\E[J, cr=^M, cub1=\E[D,
- cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A,
- dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I,
- hts=\EH, il1=\E[L, ind=^J, kbs=^H, kcub1=\E[D, kcud1=\E[B,
- kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, tbc=\E[2g,
- use=klone+sgr-dumb,
-pcansi-25-m|pcansi25m|ibm-pc terminal programs with 25 lines (mono mode),
- lines#25, use=pcansi-m,
-pcansi-33-m|pcansi33m|ibm-pc terminal programs with 33 lines (mono mode),
- lines#33, use=pcansi-m,
-pcansi-43-m|ansi43m|ibm-pc terminal programs with 43 lines (mono mode),
- lines#43, use=pcansi-m,
-# The color versions. All PC emulators do color...
-pcansi|ibm-pc terminal programs claiming to be ansi,
- use=klone+color, use=pcansi-m,
-pcansi-25|pcansi25|ibm-pc terminal programs with 25 lines,
- lines#25, use=pcansi,
-pcansi-33|pcansi33|ibm-pc terminal programs with 33 lines,
- lines#33, use=pcansi,
-pcansi-43|pcansi43|ibm-pc terminal programs with 43 lines,
- lines#43, use=pcansi,
-
-# ansi-m -- full ANSI X3.64 with ANSI.SYS-compatible attributes, no color.
-# If you want pound signs rather than dollars, replace `B' with `A'
-# in the <s0ds>, <s1ds>, <s2ds>, and <s3ds> capabilities.
-# From: Eric S. Raymond <esr@snark.thyrsus.com> Nov 6 1995
-ansi-m|ansi-mono|ANSI X3.64-1979 terminal with ANSI.SYS compatible attributes,
- mc5i,
- cub=\E[%p1%dD, cud=\E[%p1%dB, cuf=\E[%p1%dC,
- cuu=\E[%p1%dA, dch=\E[%p1%dP, dl=\E[%p1%dM,
- ech=\E[%p1%dX, el1=\E[1K, hpa=\E[%i%p1%dG, ht=\E[I,
- ich=\E[%p1%d@, il=\E[%p1%dL, indn=\E[%p1%dS, kbs=^H,
- kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
- kich1=\E[L, mc4=\E[4i, mc5=\E[5i, nel=\r\E[S,
- rep=%p1%c\E[%p2%{1}%-%db, rin=\E[%p1%dT, s0ds=\E(B,
- s1ds=\E)B, s2ds=\E*B, s3ds=\E+B, tbc=\E[2g,
- vpa=\E[%i%p1%dd, use=pcansi-m,
-
-# ansi -- this terminfo expresses the largest subset of X3.64 that will fit in
-# standard terminfo. Assumes ANSI.SYS-compatible attributes and color.
-# From: Eric S. Raymond <esr@snark.thyrsus.com> Nov 6 1995
-ansi|ansi/pc-term compatible with color,
- u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?%[;0123456789]c,
- u9=\E[c,
- use=ecma+color, use=klone+sgr, use=ansi-m,
-
-# ansi-generic is a vanilla ANSI terminal. This is assumed to implement
-# all the normal ANSI stuff with no extensions. It assumes
-# insert/delete line/char is there, so it won't work with
-# vt100 clones. It assumes video attributes for bold, blink,
-# underline, and reverse, which won't matter much if the terminal
-# can't do some of those. Padding is assumed to be zero, which
-# shouldn't hurt since xon/xoff is assumed.
-ansi-generic|generic ansi standard terminal,
- am, xon,
- cols#80, lines#24, use=vanilla, use=ansi+csr, use=ansi+cup,
- use=ansi+rca, use=ansi+erase, use=ansi+tabs,
- use=ansi+local, use=ansi+idc, use=ansi+idl, use=ansi+rep,
- use=ansi+sgrbold, use=ansi+arrows,
-
-#### Linux consoles
-#
-
-# This entry is good for the 1.2.13 or later version of the Linux console.
-#
-# ***************************************************************************
-# * *
-# * WARNING: *
-# * Linuxes come with a default keyboard mapping kcbt=^I. This entry, in *
-# * response to user requests, assumes kcbt=\E[Z, the ANSI/ECMA reverse-tab *
-# * character. Here are the keymap replacement lines that will set this up: *
-# * *
-# keycode 15 = Tab Tab
-# alt keycode 15 = Meta_Tab
-# shift keycode 15 = F26
-# string F26 ="\033[Z"
-# * *
-# * This has to use a key slot which is unfortunate (any unused one will *
-# * do, F26 is the higher-numbered one). The change ought to be built *
-# * into the kernel tables. *
-# * *
-# ***************************************************************************
-#
-# The 1.3.x kernels add color-change capabilities; if yours doesn't have this
-# and it matters, turn off <ccc>. The %02x escape used to implement this is
-# not back-portable to SV curses and not supported in ncurses versions before
-# 1.9.9. All linux kernels since 1.2.13 (at least) set the screen size
-# themselves; this entry assumes that capability.
-#
-# This entry is good for the 1.2.13 or later version of the Linux console.
-#
-# ***************************************************************************
-# * *
-# * WARNING: *
-# * Linuxes come with a default keyboard mapping kcbt=^I. This entry, in *
-# * response to user requests, assumes kcbt=\E[Z, the ANSI/ECMA reverse-tab *
-# * character. Here are the keymap replacement lines that will set this up: *
-# * *
-# keycode 15 = Tab Tab
-# alt keycode 15 = Meta_Tab
-# shift keycode 15 = F26
-# string F26 ="\033[Z"
-# * *
-# * This has to use a key slot which is unfortunate (any unused one will *
-# * do, F26 is the higher-numbered one). The change ought to be built *
-# * into the kernel tables. *
-# * *
-# ***************************************************************************
-#
-# The 1.3.x kernels add color-change capabilities; if yours doesn't have this
-# and it matters, turn off <ccc>. The %02x escape used to implement this is
-# not back-portable to SV curses and not supported in ncurses versions before
-# 1.9.9. All linux kernels since 1.2.13 (at least) set the screen size
-# themselves; this entry assumes that capability.
-#
-# The 2.2.x kernels add a private mode that sets the cursor type; use that to
-# get a block cursor for cvvis.
-# reported by Frank Heckenbach <frank@g-n-u.de>.
-linux|linux console,
- am, bce, eo, mir, msgr, xenl, xon,
- it#8, ncv#2,
- acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
- bel=^G, civis=\E[?25l\E[?1c, clear=\E[H\E[J,
- cnorm=\E[?25h\E[?0c, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
- cuu1=\E[A, cvvis=\E[?25h\E[?8c, dch=\E[%p1%dP, dch1=\E[P,
- dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J,
- el=\E[K, el1=\E[1K, flash=\E[?5h\E[?5l$<200/>, home=\E[H,
- hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@,
- il=\E[%p1%dL, il1=\E[L, ind=^J, kb2=\E[G, kbs=\177,
- kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
- kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~,
- kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
- kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
- kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D,
- kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
- khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z,
- nel=^M^J, rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, rmso=\E[27m,
- rmul=\E[24m, rs1=\Ec\E]R, sc=\E7,
- sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m,
- smir=\E[4h, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR,
- u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd,
- use=klone+sgr, use=ecma+color,
-linux-m|Linux console no color,
- colors@, pairs@,
- setab@, setaf@, setb@, setf@, use=linux,
-linux-c-nc|linux console 1.3.x hack for ncurses only,
- ccc,
- initc=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x,
- oc=\E]R,
- use=linux,
-# From: Dennis Henriksen <opus@osrl.dk>, 9 July 1996
-linux-c|linux console 1.3.6+ with private palette for each virtual console,
- ccc,
- colors#8, pairs#64,
- initc=\E]P%?%p1%{9}%>%t%p1%{10}%-%'a'%+%c%e%p1%d%;%p2%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p3%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p4%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;,
- oc=\E]R,
- use=linux,
-
-# See the note on ICH/ICH1 VERSUS RMIR/SMIR near the end of file
-linux-nic|linux with ich/ich1 suppressed for non-curses programs,
- ich@, ich1@,
- use=linux,
-
-# This assumes you have used setfont(8) to load one of the Linux koi8-r fonts.
-# acsc entry from Pavel Roskin" <pavel@absolute.spb.su>, 29 Sep 1997.
-linux-koi8|linux with koi8 alternate character set,
- acsc=+\020\,\021-\030.^Y0\215`\004a\221f\234g\237h\220i\276j\205k\203l\202m\204n\212o~p\0q\0r\0s_t\206u\207v\211w\210x\201y\230z\231{\267|\274~\224,
- use=linux, use=klone+koi8acs,
-
-# Another entry for KOI8-r with Qing Long's acsc.
-# (which one better complies with the standard?)
-linux-koi8r|linux with koi8-r alternate character set,
- use=linux, use=klone+koi8acs,
-
-# Entry for the latin1 and latin2 fonts
-linux-lat|linux with latin1 or latin2 alternate character set,
- acsc=+\020\,\021-\030.^Y0\333`\004a\013f\370g\361h\260i\316j\211k\214l\206m\203n\305o~p\304q\212r\304s_t\207u\215v\301w\302x\205y\363z\362{\343|\330}\234~\376,
- use=linux,
-
-#### NetBSD consoles
-#
-# pcvt termcap database entries (corresponding to release 3.31)
-# Author's last edit-date: [Fri Sep 15 20:29:10 1995]
-#
-# (For the terminfo master file, I translated these into terminfo syntax.
-# Then I dropped all the pseudo-HP entries. we don't want and can't use
-# the :Xs: flag. Then I split :is: into a size-independent <is1> and a
-# size-dependent <is2>. Finally, I added <rmam>/<smam> -- esr)
-
-# NOTE: <ich1> has been taken out of this entry. for reference, it should
-# be <ich1=\E[@>. For discussion, see ICH/ICH1 VERSUS RMIR/SMIR below.
-# (esr: added <civis> and <cnorm> to resolve NetBSD Problem Report #4583)
-pcvtXX|pcvt vt200 emulator (DEC VT220),
- am, km, mir, msgr, xenl,
- it#8, vt#3,
- acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz~~,
- bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
- clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
- csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
- cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
- dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
- el=\E[K, el1=\E[1K, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@,
- il=\E[%p1%dL, il1=\E[L, ind=\ED, indn=\E[%p1%dS,
- is1=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, kbs=\177,
- kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
- kdch1=\E[3~, kf1=\E[17~, kf2=\E[18~, kf3=\E[19~,
- kf4=\E[20~, kf5=\E[21~, kf6=\E[23~, kf7=\E[24~, kf8=\E[25~,
- khome=\E[1~, kich1=\E[2~, kll=\E[4~, knp=\E[6~, kpp=\E[5~,
- nel=\EE, rc=\E8, rev=\E[7m, rf=/usr/share/tabset/vt100,
- ri=\EM, rin=\E[%p1%dT, rmacs=\E(B, rmam=\E[?7l, rmir=\E[4l,
- rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m,
- rs1=\Ec\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
- sgr0=\E[m, smacs=\E(0, smam=\E[?7h, smir=\E[4h,
- smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
-
-# NetBSD/FreeBSD vt220 terminal emulator console (pc keyboard & monitor)
-# termcap entries for pure VT220-Emulation and 25, 28, 35, 40, 43 and
-# 50 lines entries; 80 columns
-pcvt25|dec vt220 emulation with 25 lines,
- cols#80, lines#25,
- is2=\E[1;25r\E[25;1H, use=pcvtXX,
-pcvt28|dec vt220 emulation with 28 lines,
- cols#80, lines#28,
- is2=\E[1;28r\E[28;1H, use=pcvtXX,
-pcvt35|dec vt220 emulation with 35 lines,
- cols#80, lines#35,
- is2=\E[1;35r\E[35;1H, use=pcvtXX,
-pcvt40|dec vt220 emulation with 40 lines,
- cols#80, lines#40,
- is2=\E[1;40r\E[40;1H, use=pcvtXX,
-pcvt43|dec vt220 emulation with 43 lines,
- cols#80, lines#43,
- is2=\E[1;43r\E[43;1H, use=pcvtXX,
-pcvt50|dec vt220 emulation with 50 lines,
- cols#80, lines#50,
- is2=\E[1;50r\E[50;1H, use=pcvtXX,
-
-# NetBSD/FreeBSD vt220 terminal emulator console (pc keyboard & monitor)
-# termcap entries for pure VT220-Emulation and 25, 28, 35, 40, 43 and
-# 50 lines entries; 132 columns
-pcvt25w|dec vt220 emulation with 25 lines and 132 cols,
- cols#132, lines#25,
- is2=\E[1;25r\E[25;1H, use=pcvtXX,
-pcvt28w|dec vt220 emulation with 28 lines and 132 cols,
- cols#132, lines#28,
- is2=\E[1;28r\E[28;1H, use=pcvtXX,
-pcvt35w|dec vt220 emulation with 35 lines and 132 cols,
- cols#132, lines#35,
- is2=\E[1;35r\E[35;1H, use=pcvtXX,
-pcvt40w|dec vt220 emulation with 40 lines and 132 cols,
- cols#132, lines#40,
- is2=\E[1;40r\E[40;1H, use=pcvtXX,
-pcvt43w|dec vt220 emulation with 43 lines and 132 cols,
- cols#132, lines#43,
- is2=\E[1;43r\E[43;1H, use=pcvtXX,
-pcvt50w|dec vt220 emulation with 50 lines and 132 cols,
- cols#132, lines#50,
- is2=\E[1;50r\E[50;1H, use=pcvtXX,
-
-# Terminfo entries to enable the use of the ncurses library in colour on a
-# NetBSD-arm32 console (only tested on a RiscPC).
-# Created by Dave Millen <dmill@globalnet.co.uk> 22.07.98
-# modified codes for setf/setb to setaf/setab, then to klone+color, corrected
-# typo in invis - TD
-arm100|arm100-am|Arm(RiscPC) ncurses compatible (for 640x480),
- am, bce, msgr, xenl, xon,
- cols#80, it#8, lines#30,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\E[5m$<2>, bold=\E[1m$<2>,
- clear=\E[H\E[J$<50>, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J,
- cuf=\E[%p1%dC, cuf1=\E[C$<2>,
- cup=\E[%i%p1%d;%p2%dH$<5>, cuu=\E[%p1%dA,
- cuu1=\E[A$<2>, ed=\E[J$<50>, el=\E[K$<3>, el1=\E[1K$<3>,
- enacs=\E(B\E)0, home=\E[H, ht=^I, hts=\EH, ind=^J,
- invis=\E[8m$<2>, ka1=\E[q, ka3=\E[s, kb2=\E[r, kbs=^H,
- kc1=\E[p, kc3=\E[n, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
- kcuu1=\E[A, kent=\E[M, kf0=\E[y, kf1=\E[P, kf10=\E[x,
- kf2=\E[Q, kf3=\E[R, kf4=\E[S, kf5=\E[t, kf6=\E[u, kf7=\E[v,
- kf8=\E[l, kf9=\E[w, rc=\E8, rev=\E[6m$<2>, ri=\EM$<5>,
- rmacs=^O, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m$<2>,
- rmul=\E[m$<2>, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h,
- sc=\E7,
- sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
- sgr0=\E[m\017$<2>, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=,
- smso=\E[7m$<2>, smul=\E[4m$<2>, tbc=\E[3g,
- use=ecma+sgr, use=klone+color,
-arm100-w|arm100-wam|Arm(RiscPC) ncurses compatible (for 1024x768),
- cols#132, lines#50, use=arm100,
-
-# NetBSD/x68k console vt200 emulator. This port runs on a 68K machine
-# manufactured by Sharp for the Japenese market.
-# From Minoura Makoto <minoura@netlaputa.or.jp>, 12 May 1996
-x68k|x68k-ite|NetBSD/x68k ITE,
- cols#96, lines#32,
- kclr=\E[9~, khlp=\E[28~, use=vt220,
-
-# <tv@pobox.com>:
-# Entry for the DNARD OpenFirmware console, close to ANSI but not quite.
-#
-# (still unfinished, but good enough so far.)
-ofcons,
- bw,
- cols#80, lines#30,
- bel=^G, blink=\2337;2m, bold=\2331m, clear=^L, cr=^M,
- cub=\233%p1%dD, cub1=\233D, cud=\233%p1%dB, cud1=\233B,
- cuf=\233%p1%dC, cuf1=\233C, cup=\233%i%p1%d;%p2%dH,
- cuu=\233%p1%dA, cuu1=\233A, dch=\233%p1%dP, dch1=\233P,
- dim=\2332m, dl=\233%p1%dM, dl1=\233M, ed=\233J, el=\233K,
- flash=^G, ht=^I, ich=\233%p1%d@, ich1=\233@, il=\233%p1%dL,
- il1=\233L, ind=^J, invis=\2338m, kbs=^H, kcub1=\233D,
- kcud1=\233B, kcuf1=\233C, kcuu1=\233A, kdch1=\233P,
- kf1=\2330P, kf10=\2330M, kf2=\2330Q, kf3=\2330W,
- kf4=\2330x, kf5=\2330t, kf6=\2330u, kf7=\2330q, kf8=\2330r,
- kf9=\2330p, knp=\233/, kpp=\233?, nel=^M^J, rev=\2337m,
- rmso=\2330m, rmul=\2330m, sgr0=\2330m,
-
-# NetBSD "wscons" emulator in vt220 mode
-# These are micro-minimal and probably need to be redone for real
-# after the manner of the pcvt entries.
-wsvt25|NetBSD wscons in 25 line DEC VT220 mode,
- cols#80, lines#25, use=vt220,
-
-wsvt25m|NetBSD wscons in 25 line DEC VT220 mode with Meta,
- km,
- cols#80, lines#25, use=vt220,
-
-# `rasterconsole' provided by 4.4BSD, NetBSD and OpenBSD on SPARC, and
-# DECstation/pmax.
-rcons|BSD rasterconsole,
- use=sun-il,
-# Color version of above. Color currenly only provided by NetBSD.
-rcons-color|BSD rasterconsole with ANSI color,
- bce,
- colors#8, pairs#64,
- op=\E[m, setab=\E[4%dm, setaf=\E[3%dm, use=rcons,
-
-#### FreeBSD console entries
-#
-# From: Andrey Chernov <ache@astral.msk.su> 29 Mar 1996
-# Andrey Chernov maintains the FreeBSD termcap distributions.
-#
-# Note: Users of FreeBSD 2.1.0 and older versions must either upgrade
-# or comment out the :cb: capability in the console entry.
-#
-# Alexander Lukyanov reports:
-# I have seen FreeBSD-2.1.5R... The old el1 bug changed, but it is still there.
-# Now el1 clears not only to the line beginning, but also a large chunk
-# of previous line. But there is another bug - ech does not work at all.
-#
-
-# for syscons
-# common entry without semigraphics
-# Bug: The <op> capability resets attributes.
-# Bug? The ech and el1 attributes appear to move the cursor in some cases; for
-# instance el1 does if the cursor is moved to the right margin first. Removed
-# by T.Dickey 97/5/3 (ech=\E[%p1%dX, el1=\E[1K)
-#
-# Setting colors turns off reverse; we cannot guarantee order, so use ncv.
-# Note that this disables standout with color.
-cons25w|ansiw|ansi80x25-raw|freebsd console (25-line raw mode),
- am, bce, bw, eo, msgr, npc,
- colors#8, cols#80, it#8, lines#25, ncv#21, pairs#64,
- bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J,
- cnorm=\E[=0C, cr=^M, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB,
- cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
- cvvis=\E[=1C, dch=\E[%p1%dP, dch1=\E[P, dim=\E[30;1m,
- dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H,
- hpa=\E[%i%p1%d`, ht=^I, ich=\E[%p1%d@, ich1=\E[@,
- il=\E[%p1%dL, il1=\E[L, ind=\E[S, indn=\E[%p1%dS, kb2=\E[E,
- kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
- kcuu1=\E[A, kdch1=\177, kend=\E[F, kf1=\E[M, kf10=\E[V,
- kf11=\E[W, kf12=\E[X, kf2=\E[N, kf3=\E[O, kf4=\E[P, kf5=\E[Q,
- kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H,
- kich1=\E[L, knp=\E[G, kpp=\E[I, nel=\E[E, op=\E[x, rev=\E[7m,
- ri=\E[T, rin=\E[%p1%dT, rmso=\E[m, rs1=\E[x\E[m\Ec,
- setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[m,
- smso=\E[7m, vpa=\E[%i%p1%dd,
-cons25|ansis|ansi80x25|freebsd console (25-line ansi mode),
- acsc=-\030.^Y0\333`\004a\260f\370g\361h\261i\025j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263y\363z\362~\371,
- use=cons25w,
-cons25-m|ansis-mono|ansi80x25-mono|freebsd console (25-line mono ansi mode),
- colors@, pairs@,
- bold@, dim@, op@, rmul=\E[m, setab@, setaf@, smul=\E[4m, use=cons25,
-cons30|ansi80x30|freebsd console (30-line ansi mode),
- lines#30, use=cons25,
-cons30-m|ansi80x30-mono|freebsd console (30-line mono ansi mode),
- lines#30, use=cons25-m,
-cons43|ansi80x43|freebsd console (43-line ansi mode),
- lines#43, use=cons25,
-cons43-m|ansi80x43-mono|freebsd console (43-line mono ansi mode),
- lines#43, use=cons25-m,
-cons50|ansil|ansi80x50|freebsd console (50-line ansi mode),
- lines#50, use=cons25,
-cons50-m|ansil-mono|ansi80x50-mono|freebsd console (50-line mono ansi mode),
- lines#50, use=cons25-m,
-cons60|ansi80x60|freebsd console (60-line ansi mode),
- lines#60, use=cons25,
-cons60-m|ansi80x60-mono|freebsd console (60-line mono ansi mode),
- lines#60, use=cons25-m,
-cons25r|pc3r|ibmpc3r|cons25-koi8-r|freebsd console w/koi8-r cyrillic,
- acsc=-\030.^Y0\215`\004a\220f\234h\221i\025j\205k\203l\202m\204n\212q\0t\206u\207v\211w\210x\201y\230z\231~\225,
- use=cons25w,
-cons25r-m|pc3r-m|ibmpc3r-mono|cons25-koi8r-m|freebsd console w/koi8-r cyrillic (mono),
- colors@, pairs@,
- op@, rmul=\E[m, setab@, setaf@, smul=\E[4m, use=cons25r,
-cons50r|cons50-koi8r|freebsd console w/koi8-r cyrillic (50 lines),
- lines#50, use=cons25r,
-cons50r-m|cons50-koi8r-m|freebsd console w/koi8-r cyrillic (50-line mono),
- lines#50, use=cons25r-m,
-cons60r|cons60-koi8r|freebsd console w/koi8-r cyrillic (60 lines),
- lines#60, use=cons25r,
-cons60r-m|cons60-koi8r-m|freebsd console w/koi8-r cyrillic (60-line mono),
- lines#60, use=cons25r-m,
-# ISO 8859-1 FreeBSD console
-cons25l1|cons25-iso8859|freebsd console w/iso 8859-1 chars,
- acsc=+\253\,\273-\030.\031`\201a\202f\207g\210i\247j\213k\214l\215m\216n\217o\220p\221q\222r\223s\224t\225u\226v\227w\230x\231y\232z\233~\237,
- use=cons25w,
-cons25l1-m|cons25-iso-m|freebsd console w/iso 8859-1 chars (mono),
- colors@, pairs@,
- bold@, dim@, op@, rmul=\E[m, setab@, setaf@, smul=\E[4m, use=cons25l1,
-cons50l1|cons50-iso8859|freebsd console w/iso 8859-1 chars (50 lines),
- lines#50, use=cons25l1,
-cons50l1-m|cons50-iso-m|freebsd console w/iso 8859-1 chars (50-line mono),
- lines#50, use=cons25l1-m,
-cons60l1|cons60-iso|freebsd console w/iso 8859-1 chars (60 lines),
- lines#60, use=cons25l1,
-cons60l1-m|cons60-iso-m|freebsd console w/iso 8859-1 chars (60-line mono),
- lines#60, use=cons25l1-m,
-
-#### 386BSD and BSD/OS Consoles
-#
-
-# This was the original 386BSD console entry (I think).
-# Some places it's named oldpc3|oldibmpc3.
-# From: Alex R.N. Wetmore <aw2t@andrew.cmu.edu>
-origpc3|origibmpc3|IBM PC 386BSD Console,
- am, bw, eo, xon,
- cols#80, lines#25,
- acsc=j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263,
- bold=\E[7m, clear=\Ec, cub1=^H, cud1=\E[B, cuf1=\E[C,
- cup=\E[%i%p1%2d;%p2%2dH, cuu1=\E[A, ed=\E[J, el=\E[K,
- home=\E[H, ind=\E[S, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
- kcuu1=\E[A, khome=\E[Y, ri=\E[T, rmso=\E[1;0x\E[2;7x,
- rmul=\E[1;0x\E[2;7x, sgr0=\E[m\E[1;0x\E[2;7x,
- smso=\E[1;7x\E[2;0x, smul=\E[1;7x\E[2;0x,
-
-# description of BSD/386 console emulator in version 1.0 (supplied by BSDI)
-oldpc3|oldibmpc3|old IBM PC BSD/386 Console,
- km,
- lines#25,
- bel=^G, bold=\E[=15F, cr=^M, cud1=^J, dim=\E[=8F, dl1=\E[M,
- ht=^I, il1=\E[L, ind=^J, kbs=^H, kcub1=\E[D, kcud1=\E[B,
- kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, kich1=\E[L, kll=\E[F,
- knp=\E[G, kpp=\E[I, nel=^M^J, sgr0=\E[=R,
-
-# Description of BSD/OS console emulator in version 1.1, 2.0, 2.1
-# Note, the emulator supports many of the additional console features
-# listed in the iBCS2 (e.g. character-set selection) though not all
-# are described here. This entry really ought to be upgraded.
-# Also note, the console will also work with fewer lines after doing
-# "stty rows NN", e.g. to use 24 lines.
-# (Color support from Kevin Rosenberg <kevin@cyberport.com>, 2 May 1996)
-# Bug: The <op> capability resets attributes.
-bsdos-pc-nobold|BSD/OS PC console w/o bold,
- am, eo, km, xon,
- cols#80, it#8, lines#25,
- bel=^G, clear=\Ec, cr=^M, cub=\E[%p1%dD, cub1=^H,
- cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
- dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I,
- il=\E[%p1%dL, il1=\E[L, ind=^J, kbs=^H, kcub1=\E[D,
- kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, kich1=\E[L,
- kll=\E[F, knp=\E[G, kpp=\E[I, nel=^M^J, rc=\E8, sc=\E7,
- sgr=\E[0;10%?%p1%t;7%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m%?%p5%t\E[=8F%;,
- use=klone+sgr, use=klone+color,
-bsdos-pc|IBM PC BSD/OS Console,
- sgr=\E[0;10%?%p1%t;7%;%?%p2%t;1%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, use=bsdos-pc-nobold,
-
-# Old names for BSD/OS PC console used in releases before 4.1.
-pc3|BSD/OS on the PC Console,
- use=bsdos-pc-nobold,
-ibmpc3|pc3-bold|BSD/OS on the PC Console with bold instead of underline,
- use=bsdos-pc,
-
-# BSD/OS on the SPARC
-bsdos-sparc|Sun SPARC BSD/OS Console,
- use=sun,
-
-# BSD/OS on the PowerPC
-bsdos-ppc|PowerPC BSD/OS Console,
- use=bsdos-pc,
-
-#### DEC VT100 and compatibles
-#
-# DEC terminals from the vt100 forward are collected here. Older DEC terminals
-# and micro consoles can be found in the `obsolete' section. More details on
-# the relationship between the VT100 and ANSI X3.64/ISO 6429/ECMA-48 may be
-# found near the end of this file.
-#
-# Except where noted, these entries are DEC's official terminfos.
-# Contact Bill Hedberg <hedberg@hannah.enet.dec.com> of Terminal Support
-# Engineering for more information. Updated terminfos and termcaps
-# are kept available at ftp://gatekeeper.dec.com/pub/DEC/termcaps.
-#
-# In October 1995 DEC sold its terminals business, including the VT and Dorio
-# line and trademark, to SunRiver Data Systems. SunRiver has since changed
-# its name to Boundless Technologies; see http://www.boundless.com.
-#
-
-# NOTE: Any VT100 emulation, whether in hardware or software, almost
-# certainly includes what DEC called the `Level 1 editing extension' codes;
-# only the very oldest VT100s lacked these and there probably aren't any of
-# those left alive. To capture these, use one of the VT102 entries.
-#
-# Note that the <xenl> glitch in vt100 is not quite the same as on the Concept,
-# since the cursor is left in a different position while in the
-# weird state (concept at beginning of next line, vt100 at end
-# of this line) so all versions of vi before 3.7 don't handle
-# <xenl> right on vt100. The correct way to handle <xenl> is when
-# you output the char in column 80, immediately output CR LF
-# and then assume you are in column 1 of the next line. If <xenl>
-# is on, am should be on too.
-#
-# I assume you have smooth scroll off or are at a slow enough baud
-# rate that it doesn't matter (1200? or less). Also this assumes
-# that you set auto-nl to "on", if you set it off use vt100-nam
-# below.
-#
-# The padding requirements listed here are guesses. It is strongly
-# recommended that xon/xoff be enabled, as this is assumed here.
-#
-# The vt100 uses <rs2> and <rf> rather than <is2>/<tbc>/<hts> because the
-# tab settings are in non-volatile memory and don't need to be
-# reset upon login. Also setting the number of columns glitches
-# the screen annoyingly. You can type "reset" to get them set.
-#
-# The VT100 series terminals have cursor ("arrows") keys which can operate
-# in two different modes: Cursor Mode and Application Mode. Cursor Mode
-# is the reset state, and is assumed to be the normal state. Application
-# Mode is the "set" state. In Cursor Mode, the cursor keys transmit
-# "Esc [ {code}" sequences, conforming to ANSI standards. In Application
-# Mode, the cursor keys transmit "Esc O <code>" sequences. Application Mode
-# was provided primarily as an aid to the porting of VT52 applications. It is
-# assumed that the cursor keys are normally in Cursor Mode, and expected that
-# applications such as vi will always transmit the <smkx> string. Therefore,
-# the definitions for the cursor keys are made to match what the terminal
-# transmits after the <smkx> string is transmitted. If the <smkx> string
-# is a null string or is not defined, then cursor keys are assumed to be in
-# "Cursor Mode", and the cursor keys definitions should match that assumption,
-# else the appication may fail. It is also expected that applications will
-# always transmit the <rmkx> string to the terminal before they exit.
-#
-# The VT100 series terminals have an auxilliary keypad, commonly referred to as
-# the "Numeric Keypad", because it is a cluster of numeric and function keys.
-# The Numeric Keypad which can operate in two different modes: Numeric Mode and
-# Application Mode. Numeric Mode is the reset state, and is assumed to be
-# the normal state. Application Mode is the "set" state. In Numeric Mode,
-# the numeric and punctuation keys transmit ASCII 7-bit characters, and the
-# Enter key transmits the same as the Return key (Note: the Return key
-# can be configured to send either LF (\015) or CR LF). In Application Mode,
-# all the keypad keys transmit "Esc O {code}" sequences. The PF1 - PF4 keys
-# always send the same "Esc O {code}" sequences. It is assumed that the keypad
-# is normally in Numeric Mode. If an application requires that the keypad be
-# in Application Mode then it is expected that the user, or the application,
-# will set the TERM environment variable to point to a terminfo entry which has
-# defined the <smkx> string to include the codes that switch the keypad into
-# Application Mode, and the terminfo entry will also define function key
-# fields to match the Application Mode control codes. If the <smkx> string
-# is a null string or is not defined, then the keypad is assumed to be in
-# Numeric Mode. If the <smkx> string switches the keypad into Application
-# Mode, it is expected that the <rmkx> string will contain the control codes
-# necessary to reset the keypad to "Normal" mode, and it is also expected that
-# applications which transmit the <smkx> string will also always transmit the
-# <rmkx> string to the terminal before they exit.
-#
-# Here's a diagram of the VT100 keypad keys with their bindings.
-# The top line is the name of the key (some DEC keyboards have the keys
-# labelled somewhat differently, like GOLD instead of PF1, but this is
-# the most "official" name). The second line is the escape sequence it
-# generates in Application Keypad mode (where "$" means the ESC
-# character). The third line contains two items, first the mapping of
-# the key in terminfo, and then in termcap.
-# _______________________________________
-# | PF1 | PF2 | PF3 | PF4 |
-# | $OP | $OQ | $OR | $OS |
-# |_kf1__k1_|_kf2__k2_|_kf3__k3_|_kf4__k4_|
-# | 7 8 9 - |
-# | $Ow | $Ox | $Oy | $Om |
-# |_kf9__k9_|_kf10_k;_|_kf0__k0_|_________|
-# | 4 | 5 | 6 | , |
-# | $Ot | $Ou | $Ov | $Ol |
-# |_kf5__k5_|_kf6__k6_|_kf7__k7_|_kf8__k8_|
-# | 1 | 2 | 3 | |
-# | $Oq | $Or | $Os | enter |
-# |_ka1__K1_|_kb2__K2_|_ka3__K3_| $OM |
-# | 0 | . | |
-# | $Op | $On | |
-# |___kc1_______K4____|_kc3__K5_|_kent_@8_|
-#
-# And here, for those of you with orphaned VT100s lacking documentation, is
-# a description of the soft switches invoked when you do `Set Up'.
-#
-# Scroll 0-Jump Shifted 3 0-#
-# | 1-Smooth | 1-British pound sign
-# | Autorepeat 0-Off | Wrap Around 0-Off
-# | | 1-On | | 1-On
-# | | Screen 0-Dark Bkg | | New Line 0-Off
-# | | | 1-Light Bkg | | | 1-On
-# | | | Cursor 0-Underline | | | Interlace 0-Off
-# | | | | 1-Block | | | | 1-On
-# | | | | | | | |
-# 1 1 0 1 1 1 1 1 0 1 0 0 0 0 1 0 <--Standard Settings
-# | | | | | | | |
-# | | | Auto XON/XOFF 0-Off | | | Power 0-60 Hz
-# | | | 1-On | | | 1-50 Hz
-# | | Ansi/VT52 0-VT52 | | Bits Per Char. 0-7 Bits
-# | | 1-ANSI | | 1-8 Bits
-# | Keyclick 0-Off | Parity 0-Off
-# | 1-On | 1-On
-# Margin Bell 0-Off Parity Sense 0-Odd
-# 1-On 1-Even
-#
-# The following SET-UP modes are assumed for normal operation:
-# ANSI_MODE AUTO_XON/XOFF_ON NEWLINE_OFF 80_COLUMNS
-# WRAP_AROUND_ON JUMP_SCROLL_OFF
-# Other SET-UP modes may be set for operator convenience or communication
-# requirements; I recommend
-# AUTOREPEAT_ON BLOCK_CURSOR MARGIN_BELL_OFF SHIFTED_3_#
-# Unless you have a graphics add-on such as Digital Engineering's VT640
-# (and even then, whenever it can be arranged!) you should set
-# INTERLACE_OFF
-#
-# (vt100: I added <rmam>/<smam> based on the init string, also <OTbs>. -- esr)
-vt100|vt100-am|dec vt100 (w/advanced video),
- am, msgr, xenl, xon,
- cols#80, it#8, lines#24, vt#3,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\E[5m$<2>, bold=\E[1m$<2>,
- clear=\E[H\E[J$<50>, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J,
- cuf=\E[%p1%dC, cuf1=\E[C$<2>,
- cup=\E[%i%p1%d;%p2%dH$<5>, cuu=\E[%p1%dA,
- cuu1=\E[A$<2>, ed=\E[J$<50>, el=\E[K$<3>, el1=\E[1K$<3>,
- enacs=\E(B\E)0, home=\E[H, ht=^I, hts=\EH, ind=^J, ka1=\EOq,
- ka3=\EOs, kb2=\EOr, kbs=^H, kc1=\EOp, kc3=\EOn, kcub1=\EOD,
- kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kent=\EOM, kf0=\EOy,
- kf1=\EOP, kf10=\EOx, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOt,
- kf6=\EOu, kf7=\EOv, kf8=\EOl, kf9=\EOw, rc=\E8,
- rev=\E[7m$<2>, ri=\EM$<5>, rmacs=^O, rmam=\E[?7l,
- rmkx=\E[?1l\E>, rmso=\E[m$<2>, rmul=\E[m$<2>,
- rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
- sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
- sgr0=\E[m\017$<2>, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=,
- smso=\E[7m$<2>, smul=\E[4m$<2>, tbc=\E[3g,
-vt100nam|vt100-nam|vt100 no automargins,
- am@, xenl@, use=vt100-am,
-vt100-vb|dec vt100 (w/advanced video) & no beep,
- bel@, flash=\E[?5h\E[?5l, use=vt100,
-
-# Ordinary vt100 in 132 column ("wide") mode.
-vt100-w|vt100-w-am|dec vt100 132 cols (w/advanced video),
- cols#132, lines#24,
- rs2=\E>\E[?3h\E[?4l\E[?5l\E[?8h, use=vt100-am,
-vt100-w-nam|vt100-nam-w|dec vt100 132 cols (w/advanced video no automargin),
- cols#132, lines#14, vt@,
- rs2=\E>\E[?3h\E[?4l\E[?5l\E[?8h, use=vt100-nam,
-
-# vt100 with no advanced video.
-vt100-nav|vt100 without advanced video option,
- xmc#1,
- blink@, bold@, rev@, rmso=\E[m, rmul@, sgr@, sgr0@, smso=\E[7m,
- smul@,
- use=vt100,
-vt100-nav-w|vt100-w-nav|dec vt100 132 cols 14 lines (no advanced video option),
- cols#132, lines#14, use=vt100-nav,
-
-# vt100 with one of the 24 lines used as a status line.
-# We put the status line on the top.
-vt100-s|vt100-s-top|vt100-top-s|vt100 for use with top sysline,
- eslok, hs,
- lines#23,
- clear=\E[2;1H\E[J$<50>, csr=\E[%i%i%p1%d;%p2%dr,
- cup=\E[%i%p1%{1}%+%d;%p2%dH$<5>, dsl=\E7\E[1;24r\E8,
- fsl=\E8, home=\E[2;1H, is2=\E7\E[2;24r\E8,
- tsl=\E7\E[1;%p1%dH\E[1K, use=vt100-am,
-
-# Status line at bottom.
-# Clearing the screen will clobber status line.
-vt100-s-bot|vt100-bot-s|vt100 for use with bottom sysline,
- eslok, hs,
- lines#23,
- dsl=\E7\E[1;24r\E8, fsl=\E8, is2=\E[1;23r\E[23;1H,
- tsl=\E7\E[24;%p1%dH\E[1K,
- use=vt100-am,
-
-# Most of the `vt100' emulators out there actually emulate a vt102
-# This entry (or vt102-nsgr) is probably the right thing to use for
-# these.
-vt102|dec vt102,
- mir,
- dch1=\E[P, dl1=\E[M, il1=\E[L, rmir=\E[4l, smir=\E[4h, use=vt100,
-vt102-w|dec vt102 in wide mode,
- cols#132,
- rs3=\E[?3h, use=vt102,
-
-# Many brain-dead PC comm programs that pretend to be `vt100-compatible'
-# fail to interpret the ^O and ^N escapes properly. Symptom: the <sgr0>
-# string in the canonical vt100 entry above leaves the screen littered
-# with little snowflake or star characters (IBM PC ROM character \017 = ^O)
-# after highlight turnoffs. This entry should fix that, and even leave
-# ACS support working, at the cost of making multiple-highlight changes
-# slightly more expensive.
-# From: Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995
-vt102-nsgr|vt102 no sgr (use if you see snowflakes after highlight changes),
- sgr@, sgr0=\E[m,
- use=vt102,
-
-# VT125 Graphics CRT. Clear screen also erases graphics
-vt125|vt125 graphics terminal,
- clear=\E[H\E[2J\EPpS(E)\E\\$<50>, use=vt100,
-
-# This isn't a DEC entry, it came from University of Wisconsin.
-# (vt131: I added <rmam>/<smam> based on the init string, also <OTbs> -- esr)
-vt131|dec vt131,
- am, xenl,
- cols#80, it#8, lines#24, vt#3,
- bel=^G, blink=\E[5m$<2/>, bold=\E[1m$<2/>,
- clear=\E[;H\E[2J$<50/>, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub1=^H, cud1=^J, cuf1=\E[C$<2/>,
- cup=\E[%i%p1%d;%p2%dH$<5/>, cuu1=\E[A$<2/>,
- ed=\E[J$<50/>, el=\E[K$<3/>, home=\E[H, ht=^I,
- is2=\E[1;24r\E[24;1H, kbs=^H, kcub1=\EOD, kcud1=\EOB,
- kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP, kf2=\EOQ, kf3=\EOR,
- kf4=\EOS, nel=^M^J, rc=\E8, rev=\E[7m$<2/>, ri=\EM$<5/>,
- rmam=\E[?7h, rmkx=\E[?1l\E>, rmso=\E[m$<2/>,
- rmul=\E[m$<2/>,
- rs1=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
- sgr0=\E[m$<2/>, smam=\E[?7h, smkx=\E[?1h\E=,
- smso=\E[7m$<2/>, smul=\E[4m$<2/>,
-
-# vt132 - like vt100 but slower and has ins/del line and such.
-# I'm told that <smir>/<rmir> are backwards in the terminal from the
-# manual and from the ANSI standard, this describes the actual
-# terminal. I've never actually used a vt132 myself, so this
-# is untested.
-#
-vt132|DEC vt132,
- xenl,
- dch1=\E[P$<7>, dl1=\E[M$<99>, il1=\E[L$<99>, ind=\n$<30>,
- ip=$<7>, rmir=\E[4h, smir=\E[4l,
- use=vt100,
-
-# This vt220 description maps F5--F9 to the second block of function keys
-# at the top of the keyboard. The "DO" key is used as F10 to avoid conflict
-# with the key marked (ESC) on the vt220. See vt220d for an alternate mapping.
-# PF1--PF4 are used as F1--F4.
-#
-vt220-old|vt200-old|DEC VT220 in vt100 emulation mode,
- am, mir, xenl, xon,
- cols#80, lines#24, vt#3,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\E[5m$<2>, bold=\E[1m$<2>, civis=\E[?25l,
- clear=\E[H\E[2J$<50>, cnorm=\E[?25h, cr=^M,
- csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=\E[B, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH$<10>, cuu1=\E[A, dch1=\E[P,
- dl1=\E[M, ed=\E[J$<50>, el=\E[K$<3>, home=\E[H, ht=^I,
- if=/usr/share/tabset/vt100, il1=\E[L, ind=\ED$<20/>,
- is2=\E[1;24r\E[24;1H, kbs=^H, kcub1=\E[D, kcud1=\E[B,
- kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\EOP,
- kf10=\E[29~, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\E[17~,
- kf6=\E[18~, kf7=\E[19~, kf8=\E[20~, kf9=\E[21~,
- khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, rc=\E8,
- rev=\E[7m$<2>, rf=/usr/share/tabset/vt100,
- ri=\EM$<14/>, rmacs=\E(B$<4>, rmam=\E[?7l, rmir=\E[4l,
- rmso=\E[27m, rmul=\E[24m,
- rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;,
- sgr0=\E[m$<2>, smacs=\E(0$<2>, smam=\E[?7h, smir=\E[4h,
- smso=\E[7m, smul=\E[4m,
-
-# A much better description of the VT200/220; used to be vt220-8
-vt220|vt200|dec vt220,
- am, mc5i, mir, msgr, xenl, xon,
- cols#80, it#8, lines#24, vt#3,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=^M,
- csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
- cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
- dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M,
- ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E)0,
- flash=\E[?5h$<200/>\E[?5l, home=\E[H, ht=^I, hts=\EH,
- ich=\E[%p1%d@, if=/usr/share/tabset/vt100,
- il=\E[%p1%dL, il1=\E[L, ind=\ED,
- is2=\E[?7h\E[>\E[?1h\E F\E[?4l, kbs=^H, kcub1=\E[D,
- kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kf1=\EOP, kf10=\E[21~,
- kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
- kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\EOQ,
- kf20=\E[34~, kf3=\EOR, kf4=\EOS, kf6=\E[17~, kf7=\E[18~,
- kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, khlp=\E[28~,
- khome=\E[H, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, krdo=\E[29~,
- kslt=\E[4~, lf1=pf1, lf2=pf2, lf3=pf3, lf4=pf4, mc0=\E[i,
- mc4=\E[4i, mc5=\E[5i, nel=\EE, rc=\E8, rev=\E[7m, ri=\EM,
- rmacs=^O, rmam=\E[?7l, rmir=\E[4l, rmso=\E[27m,
- rmul=\E[24m, rs1=\E[?3l, sc=\E7, sgr0=\E[m, smacs=^N,
- smam=\E[?7h, smir=\E[4h, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
-vt220-w|vt200-w|DEC vt220 in wide mode,
- cols#132,
- rs3=\E[?3h, use=vt220,
-vt220-8bit|vt220-8|vt200-8bit|vt200-8|dec vt220/200 in 8-bit mode,
- am, mc5i, mir, msgr, xenl, xon,
- cols#80, it#8, lines#24, vt#3,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\2335m, bold=\2331m, clear=\233H\233J, cr=^M,
- csr=\233%i%p1%d;%p2%dr, cub=\233%p1%dD, cub1=^H,
- cud=\233%p1%dB, cud1=^J, cuf=\233%p1%dC, cuf1=\233C,
- cup=\233%i%p1%d;%p2%dH, cuu=\233%p1%dA, cuu1=\233A,
- dch=\233%p1%dP, dch1=\233P, dl=\233%p1%dM, dl1=\233M,
- ech=\233%p1%dX, ed=\233J, el=\233K, el1=\2331K, enacs=\E)0,
- flash=\233?5h$<200/>\233?5l, home=\233H, ht=^I, hts=\EH,
- ich=\233%p1%d@, if=/usr/share/tabset/vt100,
- il=\233%p1%dL, il1=\233L, ind=\ED,
- is2=\233?7h\233>\233?1h\E F\233?4l, kbs=^H,
- kcub1=\233D, kcud1=\233B, kcuf1=\233C, kcuu1=\233A,
- kf1=\EOP, kf10=\23321~, kf11=\23323~, kf12=\23324~,
- kf13=\23325~, kf14=\23326~, kf17=\23331~, kf18=\23332~,
- kf19=\23333~, kf2=\EOQ, kf20=\23334~, kf3=\EOR, kf4=\EOS,
- kf6=\23317~, kf7=\23318~, kf8=\23319~, kf9=\23320~,
- kfnd=\2331~, khlp=\23328~, khome=\233H, kich1=\2332~,
- knp=\2336~, kpp=\2335~, krdo=\23329~, kslt=\2334~, lf1=pf1,
- lf2=pf2, lf3=pf3, lf4=pf4, mc0=\233i, mc4=\2334i, mc5=\2335i,
- nel=\EE, rc=\E8, rev=\2337m, ri=\EM, rmacs=^O, rmam=\233?7l,
- rmir=\2334l, rmso=\23327m, rmul=\23324m, rs1=\233?3l,
- sc=\E7, sgr0=\233m, smacs=^N, smam=\233?7h, smir=\2334h,
- smso=\2337m, smul=\2334m, tbc=\2333g,
-
-#
-# vt220d:
-# This vt220 description regards F6--F10 as the second block of function keys
-# at the top of the keyboard. This mapping follows the description given
-# in the VT220 Programmer Reference Manual and agrees with the labeling
-# on some terminals that emulate the vt220. There is no support for an F5.
-# See vt220 for an alternate mapping.
-#
-vt220d|DEC VT220 in vt100 mode with DEC function key labeling,
- kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~,
- kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~,
- kf18=\E[32~, kf19=\E[33~, kf20=\E[34~, kf5@, kf6=\E[17~,
- kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
- use=vt220-old,
-
-vt220-nam|v200-nam|VT220 in vt100 mode with no auto margins,
- am@,
- rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7l\E[?8h, use=vt220,
-
-# vt220 termcap written Tue Oct 25 20:41:10 1988 by Alex Latzko
-# (not an official DEC entry!)
-# The problem with real vt220 terminals is they don't send escapes when in
-# in vt220 mode. This can be gotten around two ways. 1> don't send
-# escapes or 2> put the vt220 into vt100 mode and use all the nifty
-# features of vt100 advanced video which it then has.
-#
-# This entry takes the view of putting a vt220 into vt100 mode so
-# you can use the escape key in emacs and everything else which needs it.
-#
-# You probably don't want to use this on a VMS machine since VMS will think
-# it has a vt220 and will get fouled up coming out of emacs
-#
-# From: Alexander Latzko <latzko@marsenius.rutgers.edu>, 30 Dec 1996
-# (Added vt100 <rc>,<sc> to quiet a tic warning -- esr)
-vt200-js|vt220-js|dec vt200 series with jump scroll,
- am,
- cols#80,
- bel=^G, clear=\E[H\E[J, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub1=^H, cud1=^J, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A,
- dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I,
- il1=\E[L, ind=\ED,
- is2=\E[61"p\E[H\E[?3l\E[?4l\E[?1l\E[?5l\E[?6l\E[?7h\E[?8h\E[?25h\E>\E[m,
- kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
- kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, nel=^M\ED, rc=\E8,
- rf=/usr/lib/tabset/vt100, ri=\EM, rmdc=, rmir=\E[4l,
- rmkx=\E[?1l\E>, rmso=\E[27m$<5/>, rmul=\E[24m,
- rs1=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, smdc=,
- smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m$<5/>, smul=\E[4m,
-
-
-# This was DEC's vt320. Use the purpose-built one below instead
-#vt320|DEC VT320 in vt100 emulation mode,
-# use=vt220,
-
-#
-# Use v320n for SCO's LYRIX. Otherwise, use Adam Thompson's vt320-nam.
-#
-vt320nam|v320n|DEC VT320 in vt100 emul. mode with NO AUTO WRAP mode,
- am@,
- rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7l\E[?8h, use=vt220,
-
-# These entries are not DEC's official ones, they were purpose-built for the
-# VT320. Here are the designer's notes:
-# <kel> is end on a PC kbd. Actually 'select' on a VT. Mapped to
-# 'Erase to End of Field'... since nothing seems to use 'end' anyways...
-# khome is Home on a PC kbd. Actually 'FIND' on a VT.
-# Things that use <knxt> usually use tab anyways... and things that don't use
-# tab usually use <knxt> instead...
-# kprv is same as tab - Backtab is useless...
-# I left out <sgr> because of its RIDICULOUS complexity,
-# and the resulting fact that it causes the termcap translation of the entry
-# to SMASH the 1k-barrier...
-# From: Adam Thompson <athompso@pangea.ca> Sept 10 1995
-# (vt320: uncommented <fsl>, comnmmented out <kslt> to avoid a conflict --esr)
-vt320|vt300|dec vt320 7 bit terminal,
- am, eslok, hs, mir, msgr, xenl,
- cols#80, lines#24, wsl#80,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
- clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M,
- csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
- cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
- dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M,
- ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, fsl=\E[0$},
- home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL,
- il1=\E[L, ind=\ED,
- is2=\E>\E[?3l\E[?4l\E[5?l\E[?7h\E[?8h\E[1;24r\E[24;1H,
- ka1=\EOw, ka3=\EOy, kb2=\EOu, kbs=\177, kc1=\EOq, kc3=\EOs,
- kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
- kdch1=\E[3~, kel=\E[4~, kent=\EOM, kf1=\EOP, kf10=\E[21~,
- kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
- kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
- kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
- kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
- khome=\E[1~, kich1=\E[2~, knp=\E[6~, knxt=^I, kpp=\E[5~,
- kprv=\E[Z, mc0=\E[i, mc4=\E[?4i, mc5=\E[?5i, nel=\EE, rc=\E8,
- rev=\E[7m, rf=/usr/share/tabset/vt300, ri=\EM,
- rmacs=\E(B, rmam=\E[?7l, rmir=\E[4l, rmkx=\E[?1l\E>,
- rmso=\E[m, rmul=\E[m,
- rs2=\E>\E[?3l\E[?4l\E[5?l\E[?7h\E[?8h\E[1;24r\E[24;1H,
- sc=\E7, sgr0=\E[m, smacs=\E(0, smam=\E[?7h, smir=\E[4h,
- smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
- tsl=\E[1$}\E[H\E[K,
-vt320-nam|vt300-nam|dec vt320 7 bit terminal with no am to make SAS happy,
- am@,
- is2=\E>\E[?3l\E[?4l\E[5?l\E[?7l\E[?8h\E[1;24r\E[24;1H,
- rs2=\E>\E[?3l\E[?4l\E[5?l\E[?7l\E[?8h\E[1;24r\E[24;1H,
- use=vt320,
-# We have to init 132-col mode, not 80-col mode.
-vt320-w|vt300-w|dec vt320 wide 7 bit terminal,
- cols#132, wsl#132,
- is2=\E>\E[?3h\E[?4l\E[5?l\E[?7h\E[?8h\E[1;24r\E[24;1H,
- rs2=\E>\E[?3h\E[?4l\E[5?l\E[?7h\E[?8h\E[1;24r\E[24;1H,
- use=vt320,
-vt320-w-nam|vt300-w-nam|dec vt320 wide 7 bit terminal with no am,
- am@,
- is2=\E>\E[?3h\E[?4l\E[5?l\E[?7l\E[?8h\E[1;24r\E[24;1H,
- rs2=\E>\E[?3h\E[?4l\E[5?l\E[?7l\E[?8h\E[1;24r\E[24;1H,
- use=vt320-w,
-
-# VT330 and VT340 -- These are ReGIS and SIXEL graphics terminals
-# which are pretty much a superset of the VT320. They have the
-# host writable status line, yet another different DRCS matrix size,
-# and such, but they add the DEC Technical character set, Multiple text
-# pages, selectable length pages, and the like. The difference between
-# the vt330 and vt340 is that the latter has only 2 planes and a monochrome
-# monitor, the former has 4 planes and a color monitor. These terminals
-# support VT131 and ANSI block mode, but as with much of these things,
-# termcap/terminfo doesn't deal with these features.
-#
-# Note that this entry is are set up in what was the standard way for GNU
-# Emacs v18 terminal modes to deal with the cursor keys in that the arrow
-# keys were switched into application mode at the same time the numeric pad
-# is switched into application mode. This changes the definitions of the
-# arrow keys. Emacs v19 is smarter and mines its keys directly out of
-# your termcap or terminfo entry,
-#
-# From: Daniel Glasser <dag@persoft.persoft.com>, 13 Oct 1993
-# (vt340: string capability "sb=\E[M" corrected to "sr";
-# also, added <rmam>/<smam> based on the init string -- esr)
-vt340|dec-vt340|vt330|dec-vt330|dec vt340 graphics terminal with 24 line page,
- am, eslok, hs, mir, msgr, xenl, xon,
- cols#80, it#8, lines#24, vt#3,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- blink=\E[5m, bold=\E[1m, civis=\E[?25l, clear=\E[H\E[J,
- cnorm=\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J,
- cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
- cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[?25h, dch=\E[%p1%dP,
- dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M,
- dsl=\E[2$~\r\E[1$}\E[K\E[$}, ed=\E[J, el=\E[K,
- flash=\E[?5h\E[?5l$<200/>, fsl=\E[$}, home=\E[H, ht=^I,
- hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=\ED,
- is2=\E<\E F\E>\E[?1h\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;24r\E[24;1H,
- kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
- kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf6=\E[17~,
- kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, lf1=pf1, lf2=pf2,
- lf3=pf3, lf4=pf4, nel=^M\ED, rc=\E8, rev=\E[7m,
- rf=/usr/share/tabset/vt300, ri=\EM, rmacs=^O,
- rmam=\E[?7l, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[27m,
- rmul=\E[24m, rs1=\E[?3l, sc=\E7, sgr0=\E[m, smacs=^N,
- smam=\E[?7h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m,
- smul=\E[4m, tbc=\E[3g, tsl=\E[2$~\E[1$}\E[1;%dH,
-
-# DEC doesn't supply a vt400 description, so we add Daniel Glasser's
-# (originally written with vt420 as its primary name, and usable for it).
-#
-# VT400/420 -- This terminal is a superset of the vt320. It adds the multiple
-# text pages and long text pages with selectable length of the vt340, along
-# with left and right margins, rectangular area text copy, fill, and erase
-# operations, selected region character attribute change operations,
-# page memory and rectangle checksums, insert/delete column, reception
-# macros, and other features too numerous to remember right now. TERMCAP
-# can only take advantage of a few of these added features.
-#
-# Note that this entry is are set up in what was the standard way for GNU
-# Emacs v18 terminal modes to deal with the cursor keys in that the arrow
-# keys were switched into application mode at the same time the numeric pad
-# is switched into application mode. This changes the definitions of the
-# arrow keys. Emacs v19 is smarter and mines its keys directly out of
-# your termcap entry,
-#
-# From: Daniel Glasser <dag@persoft.persoft.com>, 13 Oct 1993
-# (vt400: string capability ":sb=\E[M:" corrected to ":sr=\E[M:";
-# also, added <rmam>/<smam> based on the init string -- esr)
-vt400|vt400-24|dec-vt400|dec vt400 24x80 column autowrap,
- am, eslok, hs, mir, msgr, xenl, xon,
- cols#80, it#8, lines#24, vt#3,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- blink=\E[5m, bold=\E[1m, civis=\E[?25l,
- clear=\E[H\E[J$<10/>, cnorm=\E[?25h, cr=^M,
- csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
- cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
- cvvis=\E[?25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,
- dl1=\E[M, dsl=\E[2$~\r\E[1$}\E[K\E[$}, ed=\E[J$<10/>,
- el=\E[K$<4/>, flash=\E[?5h\E[?5l$<200/>, fsl=\E[$},
- home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@,
- il=\E[%p1%dL, il1=\E[L, ind=\ED,
- is2=\E<\E F\E>\E[?1h\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;24r\E[24;1H,
- kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
- kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf6=\E[17~,
- kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, lf1=pf1, lf2=pf2,
- lf3=pf3, lf4=pf4, nel=^M\ED, rc=\E8, rev=\E[7m,
- rf=/usr/share/tabset/vt300, ri=\EM, rmacs=^O,
- rmam=\E[?7l, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[27m,
- rmul=\E[24m, rs1=\E<\E[?3l\E[!p\E[?7h, sc=\E7, sgr0=\E[m,
- smacs=^N, smam=\E[?7h, smir=\E[4h, smkx=\E[?1h\E=,
- smso=\E[7m, smul=\E[4m, tbc=\E[3g,
- tsl=\E[2$~\E[1$}\E[1;%dH,
-
-# (vt420: I removed <kf0>, it collided with <kf10>. I also restored
-# a missing <sc> -- esr)
-vt420|DEC VT420,
- am, mir, xenl, xon,
- cols#80, lines#24, vt#3,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\E[5m$<2>, bold=\E[1m$<2>,
- clear=\E[H\E[2J$<50>, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub1=^H, cud1=\E[B, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH$<10>, cuu1=\E[A, dch1=\E[P,
- dl1=\E[M, ed=\E[J$<50>, el=\E[K$<3>, home=\E[H, ht=^I,
- if=/usr/share/tabset/vt300, il1=\E[L, ind=\ED,
- is2=\E[1;24r\E[24;1H, is3=\E[?67h\E[64;1"p, kbs=^H,
- kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
- kdch1=\E[3~, kf1=\EOP, kf10=\E[29~, kf2=\EOQ, kf3=\EOR,
- kf4=\EOS, kf5=\E[17~, kf6=\E[18~, kf7=\E[19~, kf8=\E[20~,
- kf9=\E[21~, kfnd=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~,
- kslt=\E[4~, rc=\E8, rev=\E[7m$<2>,
- rf=/usr/share/tabset/vt300, ri=\EM, rmacs=\E(B$<4>,
- rmam=\E[?7l, rmir=\E[4l, rmkx=\E>,
- rmsc=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h,
- rmso=\E[m, rmul=\E[m, rs3=\E[?67h\E[64;1"p, sc=\E7,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;,
- sgr0=\E[m$<2>, smacs=\E(0$<2>, smam=\E[?7h, smir=\E[4h,
- smkx=\E=, smso=\E[7m, smul=\E[4m,
-
-#
-# DEC VT220 and up support DECUDK (user-defined keys). DECUDK (i.e., pfx)
-# takes two parameters, the key and the string. Translating the key is
-# straightforward (keys 1-5 are not defined on real terminals, though some
-# emulators define these):
-#
-# if (key < 16) then value = key;
-# else if (key < 21) then value = key + 1;
-# else if (key < 25) then value = key + 2;
-# else if (key < 27) then value = key + 3;
-# else if (key < 30) then value = key + 4;
-# else value = key + 5;
-#
-# The string must be the hexadecimal equivalent, e.g., "5052494E" for "PRINT".
-# There's no provision in terminfo for emitting a string in this format, so the
-# application has to know it.
-#
-vt420pc|DEC VT420 w/PC keyboard,
- kdch1=\177, kend=\E[4~, kf1=\E[11~, kf10=\E[21~,
- kf11=\E[23~, kf12=\E[24~, kf13=\E[11;2~, kf14=\E[12;2~,
- kf15=\E[13;2~, kf16=\E[14;2~, kf17=\E[15;2~,
- kf18=\E[17;2~, kf19=\E[18;2~, kf2=\E[12~, kf20=\E[19;2~,
- kf21=\E[20;2~, kf22=\E[21;2~, kf23=\E[23;2~,
- kf24=\E[24;2~, kf25=\E[23~, kf26=\E[24~, kf27=\E[25~,
- kf28=\E[26~, kf29=\E[28~, kf3=\E[13~, kf30=\E[29~,
- kf31=\E[31~, kf32=\E[32~, kf33=\E[33~, kf34=\E[34~,
- kf35=\E[35~, kf36=\E[36~, kf37=\E[23;2~, kf38=\E[24;2~,
- kf39=\E[25;2~, kf4=\E[14~, kf40=\E[26;2~, kf41=\E[28;2~,
- kf42=\E[29;2~, kf43=\E[31;2~, kf44=\E[32;2~,
- kf45=\E[33;2~, kf46=\E[34;2~, kf47=\E[35;2~,
- kf48=\E[36;2~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~,
- kf8=\E[19~, kf9=\E[20~, khome=\E[H,
- pctrm=USR_TERM\:vt420pcdos\:,
- pfx=\EP1;1|%?%{16}%p1%>%t%{0}%e%{21}%p1%>%t%{1}%e%{25}%p1%>%t%{2}%e%{27}%p1%>%t%{3}%e%{30}%p1%>%t%{4}%e%{5}%;%p1%+%d/%p2%s\E\\, use=vt420,
-
-vt420pcdos|DEC VT420 w/PC for DOS Merge,
- lines#25,
- dispc=%?%p2%{19}%=%t\E\023\021%e%p2%{32}%<%t\E%p2%c%e%p2%{127}%=%t\E\177%e%p2%c%;,
- pctrm@,
- rmsc=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sgr@,
- sgr0=\E[m, smsc=\E[?1;2r\E[34h,
- use=vt420pc,
-
-vt420f|DEC VT420 with VT kbd; VT400 mode; F1-F5 used as Fkeys,
- kdch1=\177, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~,
- kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~,
- kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~,
- kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~,
- kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
- khome=\E[H, lf1=\EOP, lf2=\EOQ, lf3=\EOR, lf4=\EOS,
- use=vt420,
-
-vt510|DEC VT510,
- use=vt420,
-vt510pc|DEC VT510 w/PC keyboard,
- use=vt420pc,
-vt510pcdos|DEC VT510 w/PC for DOS Merge,
- use=vt420pcdos,
-
-# VT520/VT525
-#
-# The VT520 is a monochrome text terminal capable of managing up to
-# four independent sessions in the terminal. It has multiple ANSI
-# emulations (VT520, VT420, VT320, VT220, VT100, VT PCTerm, SCO Console)
-# and ASCII emulations (WY160/60, PCTerm, 50/50+, 150/120, TVI 950,
-# 925 910+, ADDS A2). This terminfo data is for the ANSI emulations only.
-#
-# Terminal Set-Up is entered by pressing [F3], [Caps Lock]/[F3] or
-# [Alt]/[Print Screen] depending upon which keyboard and which
-# terminal mode is being used. If Set-Up has been disabled or
-# assigned to an unknown key, Set-Up may be entered by pressing
-# [F3] as the first key after power up, regardless of keyboard type.
-# (vt520: I added <rmam>/<smam> based on the init string, also <sc> -- esr)
-vt520|DEC VT520,
- am, mir, xenl, xon,
- cols#80, lines#24, vt#3,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\E[5m$<2>, bold=\E[1m$<2>,
- clear=\E[H\E[2J$<50>, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub1=^H, cud1=\E[B, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH$<10>, cuu1=\E[A, dch1=\E[P,
- dl1=\E[M, ed=\E[J$<50>, el=\E[K$<3>, home=\E[H, ht=^I,
- if=/usr/share/tabset/vt300, il1=\E[L, ind=\ED,
- is2=\E[1;24r\E[24;1H, is3=\E[?67h\E[64;1"p, kbs=^H,
- kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
- kdch1=\E[3~, kf0=\E[29~, kf1=\EOP, kf10=\E[29~, kf2=\EOQ,
- kf3=\EOR, kf4=\EOS, kf5=\E[17~, kf6=\E[18~, kf7=\E[19~,
- kf8=\E[20~, kf9=\E[21~, kfnd=\E[1~, kich1=\E[2~, knp=\E[6~,
- kpp=\E[5~, kslt=\E[4~,
- pfx=\EP1;1|%?%{16}%p1%>%t%{0}%e%{21}%p1%>%t%{1}%e%{25}%p1%>%t%{2}%e%{27}%p1%>%t%{3}%e%{30}%p1%>%t%{4}%e%{5}%;%p1%+%d/%p2%s\E\\,
- rc=\E8, rev=\E[7m$<2>, rf=/usr/share/tabset/vt300,
- ri=\EM, rmacs=\E(B$<4>, rmam=\E[?7l, rmir=\E[4l,
- rmsc=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h,
- rmso=\E[m, rmul=\E[m, rs3=\E[?67h\E[64;1"p, sc=\E7,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;,
- sgr0=\E[m$<2>, smacs=\E(0$<2>, smam=\E[?7h, smir=\E[4h,
- smso=\E[7m, smul=\E[4m,
-
-# (vt525: I added <rmam>/<smam> based on the init string;
-# removed <rmso>=\E[m, <rmul>=\E[m, added <sc> -- esr)
-vt525|DEC VT525,
- am, mir, xenl, xon,
- cols#80, lines#24, vt#3,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\E[5m$<2>, bold=\E[1m$<2>,
- clear=\E[H\E[2J$<50>, cr=^M, csr=\E[%i%p1%d;%p2%dr,
- cub1=^H, cud1=\E[B, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH$<10>, cuu1=\E[A, dch1=\E[P,
- dl1=\E[M, ed=\E[J$<50>, el=\E[K$<3>, home=\E[H, ht=^I,
- if=/usr/share/tabset/vt300, il1=\E[L, ind=\ED,
- is2=\E[1;24r\E[24;1H, is3=\E[?67h\E[64;1"p, kbs=^H,
- kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
- kdch1=\E[3~, kf0=\E[29~, kf1=\EOP, kf10=\E[29~, kf2=\EOQ,
- kf3=\EOR, kf4=\EOS, kf5=\E[17~, kf6=\E[18~, kf7=\E[19~,
- kf8=\E[20~, kf9=\E[21~, kfnd=\E[1~, kich1=\E[2~, knp=\E[6~,
- kpp=\E[5~, kslt=\E[4~,
- pfx=\EP1;1|%?%{16}%p1%>%t%{0}%e%{21}%p1%>%t%{1}%e%{25}%p1%>%t%{2}%e%{27}%p1%>%t%{3}%e%{30}%p1%>%t%{4}%e%{5}%;%p1%+%d/%p2%s\E\\,
- rc=\E8, rev=\E[7m$<2>, rf=/usr/share/tabset/vt300,
- ri=\EM, rmacs=\E(B$<4>, rmam=\E[?7l, rmir=\E[4l,
- rmsc=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h,
- rmso=\E[m, rmul=\E[m, rs3=\E[?67h\E[64;1"p, sc=\E7,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;,
- sgr0=\E[m$<2>, smacs=\E(0$<2>, smam=\E[?7h, smir=\E[4h,
- smso=\E[7m, smul=\E[4m,
diff --git a/tests/examplefiles/test-3.0.xq b/tests/examplefiles/test-3.0.xq
deleted file mode 100644
index 8dd9b311..00000000
--- a/tests/examplefiles/test-3.0.xq
+++ /dev/null
@@ -1,185 +0,0 @@
-xquery version "3.0";
-
-declare namespace other = "http://other";
-
-declare variable $local:straight-var1 := 'one';
-
-declare %private variable $local:private-var := 'secret';
-declare %public variable $local:public-var := 'not-secret';
-declare %other:annotation('param1', "param2") variable $local:some-var := 'anything';
-
-declare variable $local:straight-var2 := 'two';
-
-
-(: Simple Map Operator example :)
-declare function local:word-count($elms as element()*) as xs:integer {
- sum($elms ! count(tokenize(., '\s+')))
-};
-
-declare function local:add($a, $b) {
- $a + $b
-};
-
-declare function local:dispatch($node as node()) as item()* {
- typeswitch($node)
- case text() return $node
- case comment() return $node
- case element(bill) return local:bill($node)
- case element(btitle) return local:btitle($node)
- case element(section-id) return local:section-id($node)
- case element(bill-text) return local:bill-text($node)
- case element(strike) return local:strike($node)
- default return local:passthru($node)
-};
-
-(: `switch` expression example :)
-declare function local:noise($animal) {
- let $duck := "Duck",
- $quack := "Quack"
- return
- switch ($animal)
- case "Cow" return "Moo"
- case 'Cat' return 'Meow'
- case $duck return $quack
- default return "What's that odd noise?"
-};
-
-(: `group by` expression with binding example :)
-declare function local:a-to-z() {
- let $data as element()* := (
- <item>Apples</item>,
- <item>Bananas</item>,
- <item>Apricots</item>,
- <item>Pears</item>,
- <item>Brambles</item>
- ) return
- <GroupedItems>{
- for $item in $data
- group by $key := upper-case(substring($item, 1, 1))
- order by $key
- return
- <Group key="{$key}">{$item}</Group>
- }</GroupedItems>
-};
-
-(: `group by` expression example :)
-declare function local:plays-by-character() {
- let $plays := (
- document {
- <play>
- <title>Hamlet</title>
- <characters>
- <character>Hamlet</character>
- <character>Claudius</character>
- <character>Polonius</character>
- <character>Rosencrantz</character>
- <character>Guildenstern</character>
- <character>Francisco</character>
- <character>Reynaldo</character>
- </characters>
- </play>
- },
- document {
- <play>
- <title>Rosenkrantz and Guildenstern are Dead</title>
- <characters>
- <character>Alfred</character>
- <character>Rosencrantz</character>
- <character>Guildenstern</character>
- <character>Hamlet</character>
- <character>Claudius</character>
- </characters>
- </play>
- }
- ) return
-
- for $play in $plays/play
- let $title := $play/title
- for $character in $play/characters/character
- group by $character
- return
- <character name="{$character}">
- {
- $title ! <play>{ . }</play>
- }
- </character>
-};
-
-declare
- %other:a
- %private
- %other:b('1')
- %other:c("1", "2", "3", "4")
-function local:very-annotated() {
- let $thing := "thing"
- return
- $thing
-};
-
-declare %public function local:slightly-annotated() {
- let $nothing := ()
- return
- $nothing
-};
-
-declare function local:ordered() {
- for $hit in doc("/db/doc-with-indexes.xml")//tei:p[other:query(., $search-expression)]
- let $score as xs:float := other:score($hit)
- order by $score descending
- return (
- <p>Score: {$score}:</p>,
- other:summarize($hit, <config width="40"/>)
- )
-};
-
-declare function local:concat-expr($postfix) {
-
- let $concatenated := other:uri() || "/" || $postfix
- return
- $concatenated
-};
-
-declare function local:human-units($bytes) {
- let $unit := if($bytes > math:pow(1024, 3)) then
- (math:pow(1024, 3), "GB")
- else if($bytes > math:pow(1024, 2)) then
- (math:pow(1024, 2), "MB")
- else
- (1024, "KB")
- return
- format-number($bytes div $unit[1], ".00") || " " || $unit[2]
-};
-
-declare function local:merge-simple($a as xs:string+, $b as xs:string+) as xs:string+ {
- ($a, $b)
-};
-
-(: higher order function example 1 :)
-declare function local:apply($func, $value) {
- $func($value)
-};
-
-(: higher order function example 2 :)
-declare function local:apply-all($func, $list) {
- $list ! $func(.)
-};
-
-(: higher order function example 3 :)
-declare function local:apply-all-long($func as function(xs:string) as xs:string, $list) {
- $list ! $func(.)
-};
-
-(: higher order function example 4 :)
-declare function local:merge($func as function(xs:string+, xs:string+) as xs:string+, $a as xs:string+, $b as xs:string+) as xs:string+ {
- $func($a, $b)
-};
-
-let $to-upper := upper-case#1
-let $to-upper-long as function(xs:string) as xs:string := upper-case#1
-return
- <case>
- {
- local:apply-all($to-upper, ("Hello", "world!")) ! <upper>{.}</upper>,
- local:apply-all-long(lower-case#1, ("Hello", "world!")) ! <lower>{.}</lower>
- }
- </case>
diff --git a/tests/examplefiles/test-exist-update.xq b/tests/examplefiles/test-exist-update.xq
deleted file mode 100644
index 073cc22b..00000000
--- a/tests/examplefiles/test-exist-update.xq
+++ /dev/null
@@ -1,75 +0,0 @@
-xquery version "3.0";
-
-declare function local:add-log-message($message as xs:string) as empty-sequence()?
-{
- let $logfile-collection := "/db/apps/exist101/log"
- let $logfile-name := "exist101-log.xml"
- let $logfile-full := concat($logfile-collection, '/', $logfile-name)
- let $logfile-created :=
- if(doc-available($logfile-full))then
- $logfile-full
- else
- xmldb:store($logfile-collection, $logfile-name, <eXist101-Log/>)
- return
- update insert
- <LogEntry timestamp="{current-dateTime()}">{$message}</LogEntry>
- into doc($logfile-full)/*
-};
-
-declare function local:insert-attributes() {
- let $elm as element() := doc('/db/Path/To/Some/Document.xml')/*
- return (
- update insert <NEW/> into $elm,
- update insert attribute x { 'y' } into $elm/*[last()],
- update insert attribute a { 'b' } into $elm/*[last()]
- )
-};
-
-declare function local:insert-elem() {
- let $elm as element() := doc('/db/Path/To/Some/Document.xml')/*
- return
- update insert <NEW x="y" a="b"/> into $elm
-};
-
-declare function local:insert-elem2() {
- let $elm as element() := doc('/db/Path/To/Some/Document.xml')/*
- let $new-element as element() := <NEW x="y" a="b"/>
- return
- update insert $new-element into $elm
-};
-
-declare function local:insert-single() {
- update insert <LogEntry>Something happened...</LogEntry> into doc('/db/logs/mainlog.xml')/*
-};
-
-
-declare function local:trim-insert() {
- let $document := doc('/db/logs/mainlog.xml')
- let $newentry := <LogEntry>Something happened...</LogEntry>
- return
- update delete $document/*/LogEntry[position() ge 10],
- if(exists($document/*/LogEntry[1]))then
- update insert $newentry preceding $document/*/LogEntry[1]
- else
- update insert $newentry into $document/*
-};
-
-
-declare function local:attempt-document-node-insert() {
-
- (: This is invalid: :)
- let $document as document-node() := <Root><a/></Root>
- return
- update insert <b/> into $document/*
-};
-
-declare function local:attempt-attr-update-with-node() {
- update replace doc('/db/test/test.xml')/*/@name with
- <a>aaa<b>bbb</b></a>
-};
-
-
-(# exist:batch-transaction #) {
- update delete $document/*/LogEntry[position() ge 10],
- update insert $newentry preceding $document/*/LogEntry[1]
-} \ No newline at end of file
diff --git a/tests/examplefiles/test.R b/tests/examplefiles/test.R
deleted file mode 100644
index 1dd8f64b..00000000
--- a/tests/examplefiles/test.R
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/usr/bin/env Rscript
-### Example R script for syntax highlighting
-
-# This is also a comment
-
-## Valid names
-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV0123456789._a <- NULL
-.foo_ <- NULL
-._foo <- NULL
-
-## Invalid names
-0abc <- NULL
-.0abc <- NULL
-abc+cde <- NULL
-
-## Reserved Words
-NA
-NA_integer_
-NA_real_
-NA_character_
-NA_complex_
-NULL
-NaN
-Inf
-## Not reserved
-NULLa <- NULL
-NULL1 <- NULL
-NULL. <- NULL
-NA_foo_ <- NULL
-
-## Numbers
-12345678901
-123456.78901
-123e3
-123E3
-6.02e23
-1.6e-35
-1.E12
-.1234
-## integers
-123L
-1.23L
-## imaginary numbers
-123i
--123i
-123e4i
-123e-4i
-## Hex numbers
-0xabcdefABCDEF01234
-0xabcp123
-0xabcP123
-## Not hex
-0xg
-
-## Special operators %xyz%
-## %xyz%
-1 %% 2
-diag(2) %*% diag(2)
-1 %/% 2
-1 %in% 1:10
-diag(2) %o% diag(2)
-diag(2) %x% diag(2)
-`%foo bar%` <- function(x, y) x + y
-1 %foo bar% 2
-
-## Control Structures (3.2) and Function
-## if, else
-if (TRUE) print("foo") else print("bar")
-## For, in
-for(i in 1:5) {
- print(i)
-}
-## While, break
-i <- 1
-while (TRUE) {
- i <- i + 1
- if (i > 3) break
-}
-## Repeat
-repeat {1+1}
-## Switch
-x <- 3
-switch(x, 2+2, mean(1:10), rnorm(5))
-## Function, dot-dot-dot, return, sum
-foo <- function(...) {
- return(sum(...))
-}
-# Not keywords
-functiona <- 2 + 2
-function. <- 2 + 2
-function1 <- 2 + 2
-
-
-## Grouping Tokens 10.3.7
-## Parentheses
-1 + (2 + 3)
-## brackets
-foo <- function(a) {
- a + 1
-}
-
-## Indexing 10.3.8
-## []
-bar <- 1:10
-bar[3]
-## [[]]
-foo <- list(a=1, b=2, c=3)
-foo[["a"]]
-## $
-foo$a
-foo$"a"
-
-## Operators
-2 - 2
-2 + 2
-2 ~ 2
-! TRUE
-?"help"
-1:2
-2 * 2
-2 / 2
-2^2
-2 < 2
-2 > 2
-2 == 2
-2 >= 2
-2 <= 2
-2 != 2
-TRUE & FALSE
-TRUE && FALSE
-TRUE | FALSE
-TRUE || FALSE
-foo <- 2 + 2
-foo = 2 + 2
-2 + 2 -> foo
-foo <<- 2 + 2
-2 + 2 ->> foo
-base:::sum
-base::sum
-
-## Strings
-foo <- "hello, world!"
-foo <- 'hello, world!'
-foo <- "Hello, 'world!"
-foo <- 'Hello, "world!'
-foo <- 'Hello, \'world!\''
-foo <- "Hello, \"world!\""
-foo <- "Hello,
-world!"
-foo <- 'Hello,
-world!'
-
-## Backtick strings
-`foo123 +!"bar'baz` <- 2 + 2
-
-## Builtin funcitons
-file.create()
-gamma()
-grep()
-paste()
-rbind()
-rownames()
-R.Version()
-R.version.string()
-sample()
-sapply()
-save.image()
-seq()
-setwd()
-sin()
-
-## Data structures
-servo <- matrix(1:25, nrow = 5)
-numeric()
-vector(servo)
-data.frame()
-list1 <- list(time = 1:40)
-# multidimensional array
-array(c(c(c(2,300,4),c(8,9,0)),c(c(5,60,0),c(66,7,847))), dim=c(3,2,2))
-
-## Namespace
-library(ggplot2)
-require(plyr)
-attach(cars)
-source("test.R")
diff --git a/tests/examplefiles/test.adb b/tests/examplefiles/test.adb
deleted file mode 100644
index b79f3a5b..00000000
--- a/tests/examplefiles/test.adb
+++ /dev/null
@@ -1,211 +0,0 @@
--- Model IED Simulator
--- COL Gene Ressler, 1 December 2007
-with Ada.Text_IO;
-
-with Ada.Characters.Latin_1;
-use Ada.Characters.Latin_1;
-
-with Ada.Strings.Fixed;
-use Ada.Strings.Fixed;
-
-with Ada.Strings;
-with Ada.Strings.Bounded;
-
-with Binary_Search;
-
-with Ada.Containers.Generic_Array_Sort;
-
-package body Scanner is
-
- Constant_123 : constant Character := Character'Val (16#00#);
- MAX_KEYWORD_LENGTH_C : constant Natural := 24;
-
- New_Constant : constant New_Type
- := 2;
-
- KEYWORDS_C : constant Keyword_Array_T :=
- (To_BS("description"),
- To_BS("with"));
-
- procedure Blah;
-
- procedure blah is
- begin
-
- Declaration:
- declare
- Joe : Type_Type := Random;
- begin
- Do_Something;
- end Declaration;
- Loop_ID:
- loop
- Loop_Do;
- exit when 1=2;
- end loop Loop_ID;
- if True or else False then
- Do_This();
- elsif not False and then True then
- Do_That;
- else
- Panic;
- end if;
- end blah;
-
- function "*" (Left, Right : in Integer) return Integer is
- begin
- <<Goto_Label>>
- goto Goto_Label;
- return Left + Right;
- end "*";
-
- function Function_Specification
- (Param_1 : in Blah;
- Param2, param3 : in access Blah_Type := 0)
- return It_Type;
-
- package Rename_Check renames Ada.Text_IO;
-
- type New_Float is delta 0.001 digits 12;
-
- package Package_Inst is new Ada.Strings.Bounded.Generic_Bounded_Length
- (Max => MAX_KEYWORD_LENGTH_C);
-
- type Array_Decl12 is array (Positive range <>) of SB.Bounded_String;
- type Array_Decl3 is array (New_Type range Thing_1 .. Thing_2) of SB.Bounded_String;
-
- type Boring_Type is
- (Start,
- End_Error);
-
- subtype Sub_Type_check is Character range '0' .. '9';
-
- Initialized_Array : constant Transistion_Array_T :=
- (Start =>
- (Letter_Lower | Letter_Upper => Saw_Alpha,
- ' ' | HT | CR | LF => Start,
- others => Begin_Error),
-
- End_Error => (others => Start)
-
- );
-
- type Recorder is record
- Advance : Boolean;
- Return_Token : Token_T;
- end record;
-
- for Recorder use 8;
-
- type Null_Record is null record;
-
- type Discriminated_Record (Size : Natural) is
- record
- A : String (1 .. Size);
- end record;
-
- pragma Unchecked_Union (Union);
- pragma Convention (C, Union);
-
- type Person is tagged
- record
- Name : String (1 .. 10);
- Gender : Gender_Type;
- end record;
-
- type Programmer is new Person with
- record
- Skilled_In : Language_List;
- Favorite_Langauge : Python_Type;
- end record;
-
- type Programmer is new Person
- and Printable
- with
- record
- Skilled_In : Language_List;
- Blah : aliased Integer;
- end record;
-
- ---------------------
- -- Scan_Next_Token --
- ---------------------
-
- task Cyclic_Buffer_Task_Type is
- entry Insert (An_Item : in Item);
- entry Remove (An_Item : out Item);
- end Cyclic_Buffer_Task_Type;
-
- task body Cyclic_Buffer_Task_Type is
- Q_Size : constant := 100;
- subtype Q_Range is Positive range 1 .. Q_Size;
- Length : Natural range 0 .. Q_Size := 0;
- Head, Tail : Q_Range := 1;
- Data : array (Q_Range) of Item;
- begin
- loop
- select
- when Length < Q_Size =>
- accept Insert (An_Item : in Item) do
- Data(Tail) := An_Item;
- end Insert;
- Tail := Tail mod Q_Size + 1;
- Length := Length + 1;
- or
- when Length > 0 =>
- accept Remove (An_Item : out Item) do
- An_Item := Data(Head);
- end Remove;
- Head := Head mod Q_Size + 1;
- Length := Length - 1;
- end select;
- end loop;
- end Cyclic_Buffer_Task_Type;
-
-
-
- procedure Scan_Next_Token
- (S : in String;
- Start_Index : out Positive;
- End_Index : in out Natural; -- Tricky comment
- Line_Number : in out Positive;
- Token : out Token_T);
-
- procedure Scan_Next_Token
- (S : in String;
- Start_Index : out Positive;
- End_Index : in out Natural; -- Another comment
- Line_Number : in out Positive;
- Token : out Token_T)
- is
- begin
- Scanner_Loop:
- loop
- if New_State = End_Error then
- exit Scanner_Loop;
- end if;
-
- if State = Start and New_State /= Start then
- Start_Index := Peek_Index;
- end if;
- end loop Scanner_Loop;
- end Scan_Next_Token;
-
- procedure Advance is
- begin
- Peek_Index := Peek_Index + 1;
- end Advance;
-
-
- -- Eliminate the leading space that Ada puts in front of positive
- -- integer images.
- function Image(N : in Integer) return String is
- S : String := Integer'Image(N);
- begin
- if S(1) = ' ' then
- return S(2 .. S'Last);
- end if;
- return S;
- end Image;
-
-end Scanner;
diff --git a/tests/examplefiles/test.adls b/tests/examplefiles/test.adls
deleted file mode 100644
index 1cdb2daf..00000000
--- a/tests/examplefiles/test.adls
+++ /dev/null
@@ -1,313 +0,0 @@
---
--- Example of an openEHR Archetype, written in the Archetype Definition Language (ADL)
--- Definition available here: http://www.openehr.org/releases/trunk/architecture/am/adl2.pdf
--- Author: derived from the openEHR-EHR-EVALUATION.adverse_reaction.v1 archetype at http://www.openEHR.org/ckm
---
-
-archetype (adl_version=2.0.5; rm_release=1.0.2; generated)
- openEHR-EHR-EVALUATION.adverse_reaction.v1.0.0
-
-language
- original_language = <[ISO_639-1::en]>
-
-description
- lifecycle_state = <"unmanaged">
- original_author = <
- ["name"] = <"Heather Leslie">
- ["organisation"] = <"Ocean Informatics">
- ["email"] = <"heather.leslie@oceaninformatics.com">
- ["date"] = <"2010-11-08">
- >
- copyright = <"© openEHR Foundation">
- details = <
- ["en"] = <
- language = <[ISO_639-1::en]>
- purpose = <"To record information about any harmful...">
- use = <"Use to record all information about the presence ...">
- keywords = <"reaction", "allergy", "allergic", "adverse">
- misuse = <"Not to be used for recording the absence (or ...">
- >
- >
- other_contributors = <"Jane Doe, Australia">
- other_details = <
- ["references"] = <"Adverse Reaction, draft archetype, ...">
- ["MD5-CAM-1.0.1"] = <"260699D2EFDE4F7C7BC3C6C501A51A61">
- >
-
-definition
- EVALUATION[id1] matches { -- Adverse Reaction
- data matches {
- ITEM_TREE[id2] matches {
- items cardinality matches {1..*; unordered} matches {
- ELEMENT[id3] matches { -- Substance/Agent
- value matches {
- DV_TEXT[id51]
- }
- }
- ELEMENT[id5] occurrences matches {0..1} matches { -- Absolute Contraindication?
- value matches {
- DV_BOOLEAN[id52] matches {
- value matches {True}
- }
- }
- }
- ELEMENT[id50] occurrences matches {0..1} matches { -- Future Use
- value matches {
- DV_TEXT[id53]
- }
- }
- ELEMENT[id7] occurrences matches {0..1} matches { -- Overall Comment
- value matches {
- DV_TEXT[id54]
- }
- }
- CLUSTER[id10] matches { -- Reaction Event
- items matches {
- ELEMENT[id11] occurrences matches {0..1} matches { -- Specific Substance/Agent
- value matches {
- DV_TEXT[id55]
- }
- }
- ELEMENT[id12] matches { -- Manifestation
- value matches {
- DV_TEXT[id56]
- }
- }
- ELEMENT[id17] occurrences matches {0..1} matches { -- Reaction Type
- value matches {
- DV_TEXT[id57]
- }
- }
- ELEMENT[id22] occurrences matches {0..1} matches { -- Certainty
- value matches {
- DV_CODED_TEXT[id58] matches {
- defining_code matches {[ac1]} -- Certainty (synthesised)
- }
- }
- }
- ELEMENT[id13] occurrences matches {0..1} matches { -- Reaction Description
- value matches {
- DV_TEXT[id59]
- }
- }
- ELEMENT[id28] occurrences matches {0..1} matches { -- Onset of Reaction
- value matches {
- DV_DATE_TIME[id60]
- }
- }
- ELEMENT[id29] occurrences matches {0..1} matches { -- Duration of Reaction
- value matches {
- DV_DURATION[id61]
- }
- }
- allow_archetype CLUSTER[id30] matches { -- Additional Reaction Detail
- include
- archetype_id/value matches {/openEHR-EHR-CLUSTER\.anatomical_location(-a-zA-Z0-9_]+)*\.v1/}
- }
- ELEMENT[id19] occurrences matches {0..1} matches { -- Exposure Description
- value matches {
- DV_TEXT[id62]
- }
- }
- ELEMENT[id21] occurrences matches {0..1} matches { -- Earliest Exposure
- value matches {
- DV_DATE_TIME[id63]
- }
- }
- ELEMENT[id26] occurrences matches {0..1} matches { -- Duration of Exposure
- value matches {
- DV_DURATION[id64]
- }
- }
- allow_archetype CLUSTER[id20] matches { -- Additional Exposure Detail
- include
- archetype_id/value matches {/openEHR-EHR-CLUSTER\.amount(-a-zA-Z0-9_]+)*\.v1|openEHR-EHR-CLUSTER\.medication_admin(-a-zA-Z0-9_]+)*\.v1|openEHR-EHR-CLUSTER\.timing(-a-zA-Z0-9_]+)*\.v1/}
- }
- ELEMENT[id41] occurrences matches {0..1} matches { -- Clinical Management Description
- value matches {
- DV_TEXT[id65]
- }
- }
- ELEMENT[id32] matches { -- Multimedia
- value matches {
- DV_MULTIMEDIA[id66] matches {
- media_type
- }
- }
- }
- allow_archetype CLUSTER[id42] matches { -- Reporting Details
- include
- archetype_id/value matches {/.*/}
- }
- ELEMENT[id33] occurrences matches {0..1} matches { -- Reaction Comment
- value matches {
- DV_TEXT[id67]
- }
- }
- }
- }
- }
- }
- }
- protocol matches {
- ITEM_TREE[id43] matches {
- items matches {
- ELEMENT[id45] occurrences matches {0..1} matches { -- Reaction Reported?
- value matches {
- DV_BOOLEAN[id68] matches {
- value matches {True, False}
- }
- }
- }
- ELEMENT[id49] occurrences matches {0..1} matches { -- Report Comment
- value matches {
- DV_TEXT[id69]
- }
- }
- ELEMENT[id46] matches { -- Adverse Reaction Report
- value matches {
- DV_URI[id70]
- }
- }
- ELEMENT[id48] occurrences matches {0..1} matches { -- Supporting Clinical Record Information
- value matches {
- DV_EHR_URI[id71]
- }
- }
- }
- }
- }
- }
-
-terminology
- term_definitions = <
- ["en"] = <
- ["id1"] = <
- text = <"Adverse Reaction">
- description = <"A harmful or undesirable, unexpected effect associated with exposure to any substance or agent, including food, plants, animals, venom from animal stings, or a medication at therapeutic or sub-therapeutic doses.">
- >
- ["id3"] = <
- text = <"Substance/Agent">
- description = <"Identification of a substance, agent, or a class of substance, that is considered to be responsible for the Adverse Reaction.">
- >
- ["id5"] = <
- text = <"Absolute Contraindication?">
- description = <"Is administration of this Substance/Agent absolutely contraindicated in this individual?">
- >
- ["id7"] = <
- text = <"Overall Comment">
- description = <"Additional narrative about the Adverse Reaction as a whole, not captured in other fields.">
- >
- ["id10"] = <
- text = <"Reaction Event">
- description = <"Details about each Adverse Reaction Event.">
- >
- ["id11"] = <
- text = <"Specific Substance/Agent">
- description = <"Specific identification of the actual Substance/Agent considered to be responsible for the Adverse Reaction event.">
- >
- ["id12"] = <
- text = <"Manifestation">
- description = <"Clinical manifestation of the Adverse Reaction expressed as a single word, phrase or brief description, e.g. nausea or rash.">
- >
- ["id13"] = <
- text = <"Reaction Description">
- description = <"Narrative description of the Adverse Reaction.">
- >
- ["id17"] = <
- text = <"Reaction Type">
- description = <"The type of Adverse Reaction as determined by the clinician.">
- >
- ["id19"] = <
- text = <"Exposure Description">
- description = <"Description about exposure to the Substance/Agent.">
- >
- ["id20"] = <
- text = <"Additional Exposure Detail">
- description = <"Additional detail about exposure/s for this Adverse Reaction event, including structured medication amount/frequency/route information.">
- >
- ["id21"] = <
- text = <"Earliest Exposure">
- description = <"Record of the date and/or time of the earliest or initial exposure to the Substance/Agent.">
- >
- ["id22"] = <
- text = <"Certainty">
- description = <"Degree of certainty, as assessed by a clinician, that the specific Substance/Agent was the cause of the Adverse Reaction.">
- >
- ["at23"] = <
- text = <"Suspected">
- description = <"Possibly the causative agent.">
- >
- ["at24"] = <
- text = <"Probable">
- description = <"Likely to be the causative agent, but not confirmed by testing or rechallenge.">
- >
- ["at25"] = <
- text = <"Confirmed">
- description = <"Confirmed as the causative agent, by testing or rechallenge.">
- >
- ["id26"] = <
- text = <"Duration of Exposure">
- description = <"The amount of time of exposure to the Substance/Agent.">
- >
- ["id28"] = <
- text = <"Onset of Reaction">
- description = <"Record of the date and/or time of the onset of the Adverse Reaction.">
- >
- ["id29"] = <
- text = <"Duration of Reaction">
- description = <"The amount of time that the Adverse Reaction was present.">
- >
- ["id30"] = <
- text = <"Additional Reaction Detail">
- description = <"Additional detail about the Adverse Reaction, including anatomical location.">
- >
- ["id32"] = <
- text = <"Multimedia">
- description = <"Inclusion of any multimedia file to support the recording of the Adverse Reaction event.">
- >
- ["id33"] = <
- text = <"Reaction Comment">
- description = <"Additional narrative about the Adverse Reaction event not captured in other fields.">
- >
- ["id41"] = <
- text = <"Clinical Management Description">
- description = <"Narrative description of the clinical management provided.">
- >
- ["id42"] = <
- text = <"Reporting Details">
- description = <"Further details required for reporting to regulatory bodies.">
- >
- ["id45"] = <
- text = <"Reaction Reported?">
- description = <"Was the Adverse Reaction reported to a regulatory body?">
- >
- ["id46"] = <
- text = <"Adverse Reaction Report">
- description = <"Link to an Adverse Reaction Report sent to a regulatory body.">
- >
- ["id48"] = <
- text = <"Supporting Clinical Record Information">
- description = <"Link to further information about the presentation and findings that exist elsewhere in the health record, including allergy test reports.">
- >
- ["id49"] = <
- text = <"Report Comment">
- description = <"Additional narrative about the Adverse Reaction Report, including the reason for non-reporting, if required.">
- >
- ["id50"] = <
- text = <"Future Use">
- description = <"Narrative description of clinician instructions or advice related to future exposure to, or administration of, the Substance/Agent.">
- >
- ["ac1"] = <
- text = <"Certainty (synthesised)">
- description = <"Degree of certainty, as assessed by a clinician, that the specific Substance/Agent was the cause of the Adverse Reaction. (synthesised)">
- >
- >
- >
- value_sets = <
- ["ac1"] = <
- id = <"ac1">
- members = <"at23", "at24", "at25">
- >
- >
-
diff --git a/tests/examplefiles/test.agda b/tests/examplefiles/test.agda
deleted file mode 100644
index f6cea91c..00000000
--- a/tests/examplefiles/test.agda
+++ /dev/null
@@ -1,109 +0,0 @@
--- An Agda example file
-
-module test where
-
-open import Coinduction
-open import Data.Bool
-open import {- pointless comment between import and module name -} Data.Char
-open import Data.Nat
-open import Data.Nat.Properties
-open import Data.String
-open import Data.List hiding ([_])
-open import Data.Vec hiding ([_])
-open import Relation.Nullary.Core
-open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong; trans; inspect; [_])
- renaming (setoid to setiod)
-
-open SemiringSolver
-
-{- this is a {- nested -} comment -}
-
-postulate pierce : {A B : Set} → ((A → B) → A) → A
-
-instance
- someBool : Bool
- someBool = true
-
--- Factorial
-_! : ℕ → ℕ
-0 ! = 1
-(suc n) ! = (suc n) * n !
-
--- The binomial coefficient
-_choose_ : ℕ → ℕ → ℕ
-_ choose 0 = 1
-0 choose _ = 0
-(suc n) choose (suc m) = (n choose m) + (n choose (suc m)) -- Pascal's rule
-
-choose-too-many : ∀ n m → n ≤ m → n choose (suc m) ≡ 0
-choose-too-many .0 m z≤n = refl
-choose-too-many (suc n) (suc m) (s≤s le) with n choose (suc m) | choose-too-many n m le | n choose (suc (suc m)) | choose-too-many n (suc m) (≤-step le)
-... | .0 | refl | .0 | refl = refl
-
-_++'_ : ∀ {a n m} {A : Set a} → Vec A n → Vec A m → Vec A (m + n)
-_++'_ {_} {n} {m} v₁ v₂ rewrite solve 2 (λ a b → b :+ a := a :+ b) refl n m = v₁ Data.Vec.++ v₂
-
-++'-test : (1 ∷ 2 ∷ 3 ∷ []) ++' (4 ∷ 5 ∷ []) ≡ (1 ∷ 2 ∷ 3 ∷ 4 ∷ 5 ∷ [])
-++'-test = refl
-
-data Coℕ : Set where
- co0 : Coℕ
- cosuc : ∞ Coℕ → Coℕ
-
-nanana : Coℕ
-nanana = let two = ♯ cosuc (♯ (cosuc (♯ co0))) in cosuc two
-
-abstract
- data VacuumCleaner : Set where
- Roomba : VacuumCleaner
-
-pointlessLemmaAboutBoolFunctions : (f : Bool → Bool) → f (f (f true)) ≡ f true
-pointlessLemmaAboutBoolFunctions f with f true | inspect f true
-... | true | [ eq₁ ] = trans (cong f eq₁) eq₁
-... | false | [ eq₁ ] with f false | inspect f false
-... | true | _ = eq₁
-... | false | [ eq₂ ] = eq₂
-
-mutual
- isEven : ℕ → Bool
- isEven 0 = true
- isEven (suc n) = not (isOdd n)
-
- isOdd : ℕ → Bool
- isOdd 0 = false
- isOdd (suc n) = not (isEven n)
-
-foo : String
-foo = "Hello World!"
-
-nl : Char
-nl = '\n'
-
-private
- intersperseString : Char → List String → String
- intersperseString c [] = ""
- intersperseString c (x ∷ xs) = Data.List.foldl (λ a b → a Data.String.++ Data.String.fromList (c ∷ []) Data.String.++ b) x xs
-
-baz : String
-baz = intersperseString nl (Data.List.replicate 5 foo)
-
-postulate
- Float : Set
-
-{-# BUILTIN FLOAT Float #-}
-
-pi : Float
-pi = 3.141593
-
--- Astronomical unit
-au : Float
-au = 1.496e11 -- m
-
-plusFloat : Float → Float → Float
-plusFloat a b = {! !}
-
-record Subset (A : Set) (P : A → Set) : Set where
- constructor _#_
- field
- elem : A
- .proof : P elem
diff --git a/tests/examplefiles/test.apl b/tests/examplefiles/test.apl
deleted file mode 100644
index 26ecf971..00000000
--- a/tests/examplefiles/test.apl
+++ /dev/null
@@ -1,26 +0,0 @@
-∇ R←M COMBIN N;D;E;F;G;P
- ⍝ Returns a matrix of every possible
- ⍝ combination of M elements from the
- ⍝ vector ⍳N. That is, returns a
- ⍝ matrix with M!N rows and N columns.
- ⍝
- E←(⍳P←N-R←M-1)-⎕IO
- D←R+⍳P
- R←(P,1)⍴D
- P←P⍴1
- L1:→(⎕IO>1↑D←D-1)⍴0
- P←+\P
- G←+\¯1↓0,F←⌽P
- E←F/E-G
- R←(F/D),R[E+⍳⍴E;]
- E←G
- →L1
-∇
-
-∇ R←M QUICKEXP N
- ⍝ Matrix exponentiation
- B ← ⌊ 1 + 2 ⍟ N
- V ← (B ⍴ 2) ⊤ N
- L ← ⊂ M
- R ← ⊃ +.× / V / L ⊣ { L ← (⊂ A +.× A ← ↑L) , L }¨ ⍳ B-1
-∇
diff --git a/tests/examplefiles/test.asy b/tests/examplefiles/test.asy
deleted file mode 100644
index cfcc3d0e..00000000
--- a/tests/examplefiles/test.asy
+++ /dev/null
@@ -1,131 +0,0 @@
-// example file for roundedpath() in roundedpath.asy
-// written by stefan knorr
-
-
-// import needed packages
-import roundedpath;
-
-// function definition
-picture CreateKOOS(real Scale, string legend) // draw labeled coordinate system as picture
-{
- picture ReturnPic;
- real S = 1.2*Scale;
- draw(ReturnPic, ((-S,0)--(S,0)), bar = EndArrow); // x axis
- draw(ReturnPic, ((0,-S)--(0,S)), bar = EndArrow); // y axis
- label(ReturnPic, "$\varepsilon$", (S,0), SW); // x axis label
- label(ReturnPic, "$\sigma$", (0,S), SW); // y axis label
- label(ReturnPic, legend, (0.7S, -S), NW); // add label 'legend'
- return ReturnPic; // return picture
-}
-
-
-// some global definitions
-real S = 13mm; // universal scale factor for the whole file
-real grad = 0.25; // gradient for lines
-real radius = 0.04; // radius for the rounded path'
-real lw = 2; // linewidth
-pair A = (-1, -1); // start point for graphs
-pair E = ( 1, 1); // end point for graphs
-path graph; // local graph
-pen ActPen; // actual pen for each drawing
-picture T[]; // vector of all four diagrams
-real inc = 2.8; // increment-offset for combining pictures
-
-//////////////////////////////////////// 1st diagram
-T[1] = CreateKOOS(S, "$T_1$"); // initialise T[1] as empty diagram with label $T_1$
-graph = A; // # pointwise definition of current path 'graph'
-graph = graph -- (A.x + grad*1.6, A.y + 1.6); // #
-graph = graph -- (E.x - grad*0.4, E.y - 0.4); // #
-graph = graph -- E; // #
-
-graph = roundedpath(graph, radius, S); // round edges of 'graph' using roundedpath() in roundedpath.asy
-ActPen = rgb(0,0,0.6) + linewidth(lw); // define pen for drawing in 1st diagram
-draw(T[1], graph, ActPen); // draw 'graph' with 'ActPen' into 'T[1]' (1st hysteresis branch)
-draw(T[1], rotate(180,(0,0))*graph, ActPen); // draw rotated 'graph' (2nd hysteresis branch)
-
-graph = (0,0) -- (grad*0.6, 0.6) -- ( (grad*0.6, 0.6) + (0.1, 0) ); // define branch from origin to hysteresis
-graph = roundedpath(graph, radius, S); // round this path
-draw(T[1], graph, ActPen); // draw this path into 'T[1]'
-
-
-//////////////////////////////////////// 2nd diagram
-T[2] = CreateKOOS(S, "$T_2$"); // initialise T[2] as empty diagram with label $T_2$
-graph = A; // # pointwise definition of current path 'graph'
-graph = graph -- (A.x + grad*1.3, A.y + 1.3); // #
-graph = graph -- (E.x - grad*0.7 , E.y - 0.7); // #
-graph = graph -- E; // #
-
-graph = roundedpath(graph, radius, S); // round edges of 'graph' using roundedpath() in roundedpath.asy
-ActPen = rgb(0.2,0,0.4) + linewidth(lw); // define pen for drawing in 2nd diagram
-draw(T[2], graph, ActPen); // draw 'graph' with 'ActPen' into 'T[2]' (1st hysteresis branch)
-draw(T[2], rotate(180,(0,0))*graph, ActPen); // draw rotated 'graph' (2nd hysteresis branch)
-
-graph = (0,0) -- (grad*0.3, 0.3) -- ( (grad*0.3, 0.3) + (0.1, 0) ); // define branch from origin to hysteresis
-graph = roundedpath(graph, radius, S); // round this path
-draw(T[2], graph, ActPen); // draw this path into 'T[2]'
-
-
-//////////////////////////////////////// 3rd diagram
-T[3] = CreateKOOS(S, "$T_3$"); // initialise T[3] as empty diagram with label $T_3$
-graph = A; // # pointwise definition of current path 'graph'
-graph = graph -- (A.x + grad*0.7, A.y + 0.7); // #
-graph = graph -- ( - grad*0.3 , - 0.3); // #
-graph = graph -- (0,0); // #
-graph = graph -- (grad*0.6, 0.6); // #
-graph = graph -- (E.x - grad*0.4, E.y - 0.4); // #
-graph = graph -- E; // #
-
-graph = roundedpath(graph, radius, S); // round edges of 'graph' using roundedpath() in roundedpath.asy
-ActPen = rgb(0.6,0,0.2) + linewidth(lw); // define pen for drawing in 3rd diagram
-draw(T[3], graph, ActPen); // draw 'graph' with 'ActPen' into 'T[3]' (1st hysteresis branch)
-draw(T[3], rotate(180,(0,0))*graph, ActPen); // draw rotated 'graph' (2nd hysteresis branch)
-
-
-//////////////////////////////////////// 4th diagram
-T[4] = CreateKOOS(S, "$T_4$"); // initialise T[4] as empty diagram with label $T_4$
-graph = A; // # pointwise definition of current path 'graph'
-graph = graph -- (A.x + grad*0.4, A.y + 0.4); // #
-graph = graph -- ( - grad*0.6 , - 0.6); // #
-graph = graph -- (0,0); // #
-graph = graph -- (grad*0.9, 0.9); // #
-graph = graph -- (E.x - grad*0.1, E.y - 0.1); // #
-graph = graph -- E; // #
-
-graph = roundedpath(graph, radius, S); // round edges of 'graph' using roundedpath() in roundedpath.asy
-ActPen = rgb(0.6,0,0) + linewidth(lw); // define pen for drawing in 4th diagram
-draw(T[4], graph, ActPen); // draw 'graph' with 'ActPen' into 'T[4]' (1st hysteresis branch)
-draw(T[4], rotate(180,(0,0))*graph, ActPen); // draw rotated 'graph' (3nd hysteresis branch)
-
-
-// add some labels and black dots to the first two pictures
-pair SWW = (-0.8, -0.6);
-label(T[1], "$\sigma_f$", (0, 0.6S), NE); // sigma_f
-draw(T[1], (0, 0.6S), linewidth(3) + black);
-label(T[2], "$\sigma_f$", (0, 0.3S), NE); // sigma_f
-draw(T[2], (0, 0.3S), linewidth(3) + black);
-label(T[1], "$\varepsilon_p$", (0.7S, 0), SWW); // epsilon_p
-draw(T[1], (0.75S, 0), linewidth(3) + black);
-label(T[2], "$\varepsilon_p$", (0.7S, 0), SWW); // epsilon_p
-draw(T[2], (0.75S, 0), linewidth(3) + black);
-
-
-// add all pictures T[1...4] to the current one
-add(T[1],(0,0));
-add(T[2],(1*inc*S,0));
-add(T[3],(2*inc*S,0));
-add(T[4],(3*inc*S,0));
-
-
-// draw line of constant \sigma and all intersection points with the graphs in T[1...4]
-ActPen = linewidth(1) + dashed + gray(0.5); // pen definition
-draw((-S, 0.45*S)--((3*inc+1)*S, 0.45*S), ActPen); // draw backgoundline
-label("$\sigma_s$", (-S, 0.45S), W); // label 'sigma_s'
-
-path mark = scale(2)*unitcircle; // define mark-symbol to be used for intersections
-ActPen = linewidth(1) + gray(0.5); // define pen for intersection mark
-draw(shift(( 1 - grad*0.55 + 0*inc)*S, 0.45*S)*mark, ActPen); // # draw all intersections
-draw(shift((-1 + grad*1.45 + 0*inc)*S, 0.45*S)*mark, ActPen); // #
-draw(shift(( 1 - grad*0.55 + 1*inc)*S, 0.45*S)*mark, ActPen); // #
-draw(shift(( 1 - grad*0.55 + 2*inc)*S, 0.45*S)*mark, ActPen); // #
-draw(shift(( grad*0.45 + 2*inc)*S, 0.45*S)*mark, ActPen); // #
-draw(shift(( grad*0.45 + 3*inc)*S, 0.45*S)*mark, ActPen); // #
diff --git a/tests/examplefiles/test.awk b/tests/examplefiles/test.awk
deleted file mode 100644
index 9f0e3ec9..00000000
--- a/tests/examplefiles/test.awk
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/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.bb b/tests/examplefiles/test.bb
deleted file mode 100644
index 026ef22a..00000000
--- a/tests/examplefiles/test.bb
+++ /dev/null
@@ -1,95 +0,0 @@
-
-;foobar!
-
-;Include "blurg/blurg.bb"
-
-Const ca = $10000000 ; Hex
-Const cb = %10101010 ; Binary
-Global ga$ = "blargh"
-Local a = 124, b$ = "abcdef"
-
-Function name_123#(zorp$, ll = False, blah#, waffles% = 100)
- Return 235.7804 ; comment
-End Function
-Function TestString$()
-End Function
-
-Function hub(blah$, abc = Pi)
-End Function
-Function Blar%()
- Local aa %, ab # ,ac #, ad# ,ae$,af% ; Intentional mangling
- Local ba#, bb.TBlarf , bc%,bd#,be. TFooBar,ff = True
-End Function
-
-abc()
-
-Function abc()
- Print "abc" ; I cannot find a way to parse these as function calls without messing something up
- Print ; Anyhow, they're generally not used in this way
- Goto Eww_Goto
- .Eww_Goto
-End Function
-
-Type TBlarf
-End Type
-
-Type TFooBar
-End Type
-
-Local myinst.MyClass = New MyClass
-TestMethod(myinst)
-
-Type MyClass
-
- Field m_foo.MyClass
- Field m_bar.MyClass
-
-; abc
-; def
-End Type
-
-Function TestMethod(self.MyClass) ; foobar
- self\m_foo = self
- self\m_bar = Object.MyClass(Handle self\m_foo)
- Yell self\m_foo\m_bar\m_foo\m_bar
-End Function
-
-Function Yell(self.MyClass)
- Print("huzzah!")
-End Function
-
-Function Wakka$(foo$)
- Return foo + "bar"
-End Function
-
-
-Print("blah " + "blah " + "blah.")
-
-Local i : For i = 0 To 10 Step 1
- Print("Index: " + i)
-Next
-Local array$[5]
-array[0] = "foo": array[1] = "bar":array[2] = "11":array[3] = "22":array[4] = "33"
-For i = 0 To 4
- Local value$ = array[i]
- Print("Value: " + value)
-Next
-
-Local foobar = Not (1 Or (2 And (4 Shl 5 Shr 6)) Sar 7) Mod (8+2)
-Local az = 1234567890
-az = az + 1
-az = az - 2
-az = az* 3
-az = az/ 4
-az = az And 5
-az = az Or 6
-az= ~ 7
-az = az Shl 8
-az= az Shr 9
-az = az Sar 10
-az = az Mod 11
-az = ((10-5+2/4*2)>(((8^2)) < 2)) And 12 Or 2
-
-
-;~IDEal Editor Parameters:
-;~C#Blitz3D \ No newline at end of file
diff --git a/tests/examplefiles/test.bib b/tests/examplefiles/test.bib
deleted file mode 100644
index 87e558d8..00000000
--- a/tests/examplefiles/test.bib
+++ /dev/null
@@ -1,77 +0,0 @@
-This is an example BibTeX file.
-This text is a comment.
-
-@preamble{"%%% example BibTeX file"}
-
-@Preamble{"\newcommand{\noopsort}[1]{} "
- "\newcommand{\noopsort}[1]{} "}
-
-@String{SCI = "Science"}
-
-@STRING{JFernandez = "Fernandez, Julio M."}
-@StRiNg{HGaub = "Gaub, Hermann E."}
-@string{MGautel = "Gautel, Mathias"}
-@String{FOesterhelt = "Oesterhelt, Filipp"}
-@String{MRief = "Rief, Matthias"}
-
-@Article{rief97b,
- author = MRief #" and "# MGautel #" and "# FOesterhelt
- #" and "# JFernandez #" and "# HGaub,
- title = "Reversible Unfolding of Individual Titin
- Immunoglobulin Domains by {AFM}",
- journal = SCI,
- volume = 276,
- number = 5315,
- pages = "1109--1112",
- year = 1997,
- doi = "10.1126/science.276.5315.1109",
- URL = "http://www.sciencemag.org/cgi/content/abstract/276/5315/1109",
- eprint = "http://www.sciencemag.org/cgi/reprint/276/5315/1109.pdf",
-}
-
-
-Parens can be used instead of braces:
-
-@ARTICLE(ruckenstein-diffusion,
- author = "Liu, Hongquin and Ruckenstein, Eli",
- language = "english",
- title = "Predicting the Diffusion Coefficient in Supercritical Fluids",
- journal = "Ind. Eng. Chem. Res.",
- volume = "36",
- year = "1997",
- pages = "888-895"
-)
-
-@book{
- viktorov-methods,
- author = "Викторов, Михаил Маркович",
- publisher = "Л.: <<Химия>>",
- title = "Методы вычисления физико-химических величин и прикладные расчёты",
- language = "russian",
- year = "1977",
- isbn = "000-0000000000",
-}
-
-@comment{jackson-commented-out,
- author = "Jackson, P\'eter",
- publisher = "Some Publisher",
- language = "english",
- title = "Some Title",
- series = "Some series",
- booktitle = "Commented Out",
- number = "3",
- edition = "Second",
- year = "1933",
- pages = "44--59"
-}
-
-@booklet{test-booklet,
- author = "de Last, Jr., First Middle",
- language = "english",
- title = "Just a booklet",
- year = 2006,
- month = jan,
- address = "Moscow",
- howpublished = "Published by Foo"
-}
-
diff --git a/tests/examplefiles/test.bmx b/tests/examplefiles/test.bmx
deleted file mode 100644
index 17b9adae..00000000
--- a/tests/examplefiles/test.bmx
+++ /dev/null
@@ -1,145 +0,0 @@
-
-Rem
-foobar
-EndRem
-
-Rem
- foobar!
-End Rem
-
-Rem
-End Rem
-
-SuperStrict
-
-Framework brl.blitz
-Import brl.standardio
-
-'Import "blah.bmx"
-'Import "blah/blah.bmx"
-'Include "blurg/blurg.bmx"
-
-Const ca:Long = $10000000 ' Hex
-Const cb:Int = %10101010 ' Binary
-Global ga:String = "blargh"
-Local a:Int = 124, b$ = "abcdef"
-?Not Debug
-Print(_name123(ga, a, 100.2))
-?
-
-Function _name123 : Float (zorp:String, ll:Int = False, blah#, waffles% = 100)
- Return 235.7804 ' Single-line comment
-End Function
-Function TestString:String()
-End Function
-Function TestByte:Byte()
-End Function
-
-Function hub(blah:String, ..
- abc:Int = Pi)
-End Function
-Function Blar%()
- Local aa !, ab @ ,ac @@, ad# ,ae$,af% ' Intentional mangling
- Local ba:Double, bb :Byte, bc: Short,bd:Float,be: String,ff:Int = True
-End Function
-
-?Win32
-abc()
-?Linux
-abc()
-?
-
-Function abc()
- Print "abc" ' I cannot find a way to parse these as function calls without messing something up
- Print ' Anyhow, they're generally not used in this way
- Goto Eww_Goto
- #Eww_Goto
-End Function
-
-Type TBlarf Abstract
-End Type
-
-Type TFooBar
-End Type
-
-New MyClass.TestMethod()
-New(MyClass).TestMethod()
-Local myinst:MyClass = New MyClass
-myinst.TestMethod()
-
-Type MyClass Extends TFooBar
-
- Field m_foo:MyClass
- Field m_bar:MyClass
-
- Rem
- abc
- def
- End Rem
- Method New()
- Rem
- abcdef
- endrem
- End Method
-
- Method TestMethod() ' foobar
- m_foo = Self
- m_bar = MyClass(m_foo)
- m_foo.m_bar.m_foo.m_bar.Yell()
- End Method
-
- Method Yell()
- Print("huzzah!")
- End Method
-
- Function Wakka$(foo:String)
- Return foo + "bar"
- End Function
-
-End Type
-
-Extern "c"
- Function vesper!(a:Int) = "vesper@4"
- Function bubbles@@(a%)
-End Extern
-
-Print("blah " + ..
- "blah " + ..
- "blah.")
-
-Try
- Throw("blar!")
-Catch exception:String
- Print("Caught: " + exception)
-End Try
-
-For Local i:Int = 0 To 10 Step 1
- Print("Index: " + i)
-Next
-Local array:String[] = ["foo", "bar", "11", "22", "33"]
-For Local value:String = EachIn array
- Print("Value: " + value)
-Next
-
-Local foobar:Int = Not (1 Or (2 And (4 Shl 5 Shr 6)) Sar 7) Mod (8+2)
-Local az:Int = 1234567890
-az : + 1
-az: - 2
-az :* 3
-az:/ 4
-az:& 5
-az:| 6
-az: ~ 7
-az : Shl 8
-az: Shr 9
-az :Sar 10
-az:Mod 11
-az = ((10-5+2/4*2)>(((8^2)) < 2)) & 12|2
-
-Function flub(fah Ptr, eah:Int Ptr, blu@@ Ptr)
-End Function
-Function Foob:Int Ptr(blar:Byte Ptr, Saffon@Ptr, blaus#Ptr)
-End Function
-Function zauus@Ptr()
-End Function
-
diff --git a/tests/examplefiles/test.boo b/tests/examplefiles/test.boo
deleted file mode 100644
index d6107aa7..00000000
--- a/tests/examplefiles/test.boo
+++ /dev/null
@@ -1,39 +0,0 @@
-import System
-import Boo.Lang.Interpreter from Boo.Lang.Interpreter
-
-class ObjectInterpreter(AbstractInterpreter):
-
- _context as object
-
- [getter(Value)]
- _value as object
-
- def constructor(context):
- _context = context
- self.RememberLastValue = true
-
- override def Lookup(name as string):
- property = _context.GetType().GetProperty(name)
- return property.PropertyType if property is not null
-
- override def GetValue(name as string):
- return _context.GetType().GetProperty(name).GetValue(
- _context, null)
-
- override def SetLastValue(value):
- _value = value
-
- override def SetValue(name as string, value):
- raise InvalidOperationException()
-
- override def Declare(name as string, type as Type):
- raise InvalidOperationException()
-
-class Person:
- [property(FirstName)]
- _fname as string = ""
-
-p = Person(FirstName: "Homer")
-i = ObjectInterpreter(p)
-i.Eval('"Hello, ${FirstName.ToUpper()}!"')
-print i.Value
diff --git a/tests/examplefiles/test.bpl b/tests/examplefiles/test.bpl
deleted file mode 100644
index add25e1a..00000000
--- a/tests/examplefiles/test.bpl
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Test Boogie rendering
-*/
-
-const N: int;
-axiom 0 <= N;
-
-procedure foo() {
- break;
-}
-// array to sort as global array, because partition & quicksort have to
-var a: [int] int;
-var original: [int] int;
-var perm: [int] int;
-
-// Is array a of length N sorted?
-function is_sorted(a: [int] int, l: int, r: int): bool
-{
- (forall j, k: int :: l <= j && j < k && k <= r ==> a[j] <= a[k])
-}
-
-// is range a[l:r] unchanged?
-function is_unchanged(a: [int] int, b: [int] int, l: int, r: int): bool {
- (forall i: int :: l <= i && i <= r ==> a[i] == b[i])
-}
-
-function is_permutation(a: [int] int, original: [int] int, perm: [int] int, N: int): bool
-{
- (forall k: int :: 0 <= k && k < N ==> 0 <= perm[k] && perm[k] < N) &&
- (forall k, j: int :: 0 <= k && k < j && j < N ==> perm[k] != perm[j]) &&
- (forall k: int :: 0 <= k && k < N ==> a[k] == original[perm[k]])
-}
-
-function count(a: [int] int, x: int, N: int) returns (int)
-{ if N == 0 then 0 else if a[N-1] == x then count(a, x, N - 1) + 1 else count(a, x, N-1) }
-
-
-/*
-function count(a: [int] int, x: int, N: int) returns (int)
-{ if N == 0 then 0 else if a[N-1] == x then count(a, x, N - 1) + 1 else count(a, x, N-1) }
-
-function is_permutation(a: [int] int, b: [int] int, l: int, r: int): bool {
- (forall i: int :: l <= i && i <= r ==> count(a, a[i], r+1) == count(b, a[i], r+1))
-}
-*/
-
-procedure partition(l: int, r: int, N: int) returns (p: int)
- modifies a, perm;
- requires N > 0;
- requires l >= 0 && l < r && r < N;
- requires ((r+1) < N) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] <= a[r+1]);
- requires ((l-1) >= 0) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] > a[l-1]);
-
- /* a is a permutation of the original array original */
- requires is_permutation(a, original, perm, N);
-
- ensures (forall k: int :: (k >= l && k <= p ) ==> a[k] <= a[p]);
- ensures (forall k: int :: (k > p && k <= r ) ==> a[k] > a[p]);
- ensures p >= l && p <= r;
- ensures is_unchanged(a, old(a), 0, l-1);
- ensures is_unchanged(a, old(a), r+1, N);
- ensures ((r+1) < N) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] <= a[r+1]);
- ensures ((l-1) >= 0) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] > a[l-1]);
-
- /* a is a permutation of the original array original */
- ensures is_permutation(a, original, perm, N);
-{
- var i: int;
- var sv: int;
- var pivot: int;
- var tmp: int;
-
- i := l;
- sv := l;
- pivot := a[r];
-
- while (i < r)
- invariant i <= r && i >= l;
- invariant sv <= i && sv >= l;
- invariant pivot == a[r];
- invariant (forall k: int :: (k >= l && k < sv) ==> a[k] <= old(a[r]));
- invariant (forall k: int :: (k >= sv && k < i) ==> a[k] > old(a[r]));
-
- /* a is a permutation of the original array original */
- invariant is_permutation(a, original, perm, N);
-
- invariant is_unchanged(a, old(a), 0, l-1);
- invariant is_unchanged(a, old(a), r+1, N);
- invariant ((r+1) < N) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] <= a[r+1]);
- invariant ((l-1) >= 0) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] > a[l-1]);
- {
- if ( a[i] <= pivot) {
- tmp := a[i]; a[i] := a[sv]; a[sv] := tmp;
- tmp := perm[i]; perm[i] := perm[sv]; perm[sv] := tmp;
- sv := sv +1;
- }
- i := i + 1;
- }
-
- //swap
- tmp := a[i]; a[i] := a[sv]; a[sv] := tmp;
- tmp := perm[i]; perm[i] := perm[sv]; perm[sv] := tmp;
-
- p := sv;
-}
-
-
-procedure quicksort(l: int, r: int, N: int)
- modifies a, perm;
-
- requires N > 0;
- requires l >= 0 && l < r && r < N;
- requires ((r+1) < N) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] <= a[r+1]);
- requires ((l-1) >= 0) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] > a[l-1]);
-
- /* a is a permutation of the original array original */
- requires is_permutation(a, original, perm, N);
-
- ensures ((r+1) < N) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] <= a[r+1]);
- ensures ((l-1) >= 0) ==> (forall k: int :: (k >= l && k <= r) ==> a[k] > a[l-1]);
-
- ensures is_unchanged(a, old(a), 0, l-1);
- ensures is_unchanged(a, old(a), r+1, N);
- ensures is_sorted(a, l, r);
-
- /* a is a permutation of the original array original */
- ensures is_permutation(a, original, perm, N);
-{
- var p: int;
-
- call p := partition(l, r, N);
-
- if ((p-1) > l) {
- call quicksort(l, p-1, N);
- }
-
- if ((p+1) < r) {
- call quicksort(p+1, r, N);
- }
-}
diff --git a/tests/examplefiles/test.bro b/tests/examplefiles/test.bro
deleted file mode 100644
index 9a1b42de..00000000
--- a/tests/examplefiles/test.bro
+++ /dev/null
@@ -1,250 +0,0 @@
-@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) };
- }
diff --git a/tests/examplefiles/test.cadl b/tests/examplefiles/test.cadl
deleted file mode 100644
index 5c3f4881..00000000
--- a/tests/examplefiles/test.cadl
+++ /dev/null
@@ -1,32 +0,0 @@
- --
- -- Example fragment of an openEHR Archetype, written in cADL, a subsyntax of the Archetype Definition Language (ADL)
- -- definition available here: http://www.openehr.org/releases/trunk/architecture/am/adl2.pdf
- -- Author: Thomas Beale
- --
-
- EVALUATION[id1] matches { -- Adverse Reaction
- data matches {
- ITEM_TREE[id2] matches {
- items cardinality matches {1..*; unordered} matches {
- ELEMENT[id3] matches { -- Substance/Agent
- value matches {
- DV_TEXT[id51]
- }
- }
- ELEMENT[id50] occurrences matches {0..1} matches { -- Future Use
- value matches {
- DV_TEXT[id53]
- }
- }
- CLUSTER[id10] matches { -- Reaction Event
- items matches {
- allow_archetype CLUSTER[id30] matches { -- Additional Reaction Detail
- include
- archetype_id/value matches {/openEHR-EHR-CLUSTER\.anatomical_location(-a-zA-Z0-9_]+)*\.v1/}
- }
- }
- }
- }
- }
- }
- }
diff --git a/tests/examplefiles/test.cr b/tests/examplefiles/test.cr
deleted file mode 100644
index 028ff6f3..00000000
--- a/tests/examplefiles/test.cr
+++ /dev/null
@@ -1,2871 +0,0 @@
-# Examples taken from http://crystal-lang.org/docs/
-# Copyright 2012-2016 Manas Technology Solutions.
-
-
-require "http/server"
-
-server = HTTP::Server.new(8080) do |context|
- context.response.content_type = "text/plain"
- context.response.print "Hello world! The time is #{Time.now}"
-end
-
-puts "Listening on http://0.0.0.0:8080"
-server.listen
-
-
-module HTTP
- class RequestHandler
- end
-end
-
-alias NumericValue = Float32 | Float64 | Int32 | Int64
-
-enum Time::DayOfWeek
-end
-
-
-$global_greeting = "Hello world"
-
-class Greeting
- @@default_greeting = "Hello world"
-
- def initialize(@custom_greeting = nil)
- end
-
- def print_greeting
- greeting = @custom_greeting || @@default_greeting
- puts greeting
- end
-end
-
-
-LUCKY_NUMBERS = [3, 7, 11]
-DOCUMENTATION_URL = "http://crystal-lang.org/docs"
-
-
-module Scorecard
- class Parser
- def parse(score_text)
- begin
- score_text.scan(SCORE_PATTERN) do |match|
- handle_match(match)
- end
- rescue err : ParseError
- # handle error ...
- end
- end
- end
-end
-
-
-module Money
- CURRENCIES = {
- "EUR" => 1.0,
- "ARS" => 10.55,
- "USD" => 1.12,
- "JPY" => 134.15,
- }
-
- class Amount
- getter :currency, :value
-
- def initialize(@currency, @value)
- end
- end
-
- class CurrencyConversion
- def initialize(@amount, @target_currency)
- end
-
- def amount
- # implement conversion ...
- end
- end
-end
-
-
-i = 0
-while i < 10
- proc = ->(x : Int32) do
- spawn do
- puts(x)
- end
- end
- proc.call(i)
- i += 1
-end
-
-Fiber.yield
-
-
-# A buffered channel of capacity 2
-channel = Channel(Int32).new(2)
-
-spawn do
- channel.send(1)
- channel.send(2)
- channel.send(3)
-end
-
-3.times do |i|
- puts channel.receive
-end
-
-
-class MyDictionary(K, V)
-end
-
-
-MyBox.new(1) #:: MyBox(Int32)
-MyBox.new("hello") #:: MyBox(String)
-
-
-module Moo(T)
- def t
- T
- end
-end
-
-class Foo(U)
- include Moo(U)
-
- def initialize(@value : U)
- end
-end
-
-foo = Foo.new(1)
-foo.t # Int32
-
-
-class Parent(T)
-end
-
-class Int32Child < Parent(Int32)
-end
-
-class GenericChild(T) < Parent(T)
-end
-
-
-class Person
-end
-
-
-a = 1
-ptr = pointerof(a)
-ptr[100_000] = 2 # undefined behaviour, probably a segmentation fault
-
-
-alias Int32OrString = Int32 | String
-
-
-alias Int32OrNil = Int32?
-
-
-alias Int32OrNil_ = Int32 | ::Nil
-
-
-alias Int32Ptr = Int32*
-
-
-alias Int32Ptr_ = Pointer(Int32)
-
-
-alias Int32_8 = Int32[8]
-
-
-alias Int32_8_ = StaticArray(Int32, 8)
-
-
-alias Int32StringTuple = {Int32, String}
-
-
-alias Int32StringTuple_ = Tuple(Int32, String)
-
-
-alias Int32ToString = Int32 -> String
-
-
-alias Int32ToString_ = Proc(Int32, String)
-
-
-alias ProcThatReturnsInt32 = -> Int32
-
-
-alias Int32AndCharToString = Int32, Char -> String
-
-
-alias ComplexProc = (Int32 -> Int32) -> String
-
-
-def foo(x : Int32)
- "instance"
-end
-
-def foo(x : Int32.class)
- "class"
-end
-
-foo 1 # "instance"
-foo Int32 # "class"
-
-
-class Parent
-end
-
-class Child1 < Parent
-end
-
-class Child2 < Parent
-end
-
-ary = [] of Parent.class
-ary << Child1
-ary << Child2
-
-
-# Same as not specifying a restriction, not very useful
-def foo(x : _)
-end
-
-# A bit more useful: any two arguments Proc that returns an Int32:
-def foo(x : _, _ -> Int32)
-end
-
-
-#alias SameAsInt32 = typeof(2)
-#alias Int32OrString_ = typeof(1, "a")
-
-
-class Person
- def initialize(name)
- @name = name
- @age = 0
- end
-
- def name
- @name
- end
-
- def age
- @age
- end
-end
-
-
-john = Person.new "John"
-peter = Person.new "Peter"
-
-john.name #=> "John"
-john.age #=> 0
-
-peter.name #=> "Peter"
-
-
-class Person
- def self.new(name)
- instance = Person.allocate
- instance.initialize(name)
- instance
- end
- end
-
-
-if a.is_a?(String)
- # here a is a String
-end
-
-if b.is_a?(Number)
- # here b is a Number
-end
-
-
-a = some_condition ? 1 : "hello"
-# a : Int32 | String
-
-if a.is_a?(Number)
- # a : Int32
-else
- # a : String
-end
-
-
-if a.is_a?(String) && b.is_a?(Number)
- # here a is a String and b is a Number
-end
-
-
-a.+(b)
-
-
-struct Vector2
- getter x, y
-
- def initialize(@x, @y)
- end
-
- def +(other)
- Vector2.new(x + other.x, y + other.y)
- end
-end
-
-v1 = Vector2.new(1, 2)
-v2 = Vector2.new(3, 4)
-v1 + v2 #=> Vector2(@x=4, @y=6)
-
-
-
-
-struct Vector2
- def -
- Vector2.new(-x, -y)
- end
-end
-
-v1 = Vector2.new(1, 2)
--v1 #=> Vector2(@x=-1, @y=-2)
-
-
-
-
-
-class MyArray
- def [](index)
- # ...
- end
-
- def [](index1, index2, index3)
- # ...
- end
-
- def []=(index, value)
- # ...
- end
-end
-
-array = MyArray.new
-
-array[1] # invokes the first method
-array[1, 2, 3] # invokes the second method
-array[1] = 2 # invokes the third method
-
-array.[](1) # invokes the first method
-array.[](1, 2, 3) # invokes the second method
-array.[]=(1, 2) # invokes the third method
-
-
-raise "OH NO!"
-raise Exception.new("Some error")
-
-
-class MyException < Exception
-end
-
-
-begin
- raise MyException.new("OH NO!")
-rescue ex : MyException
- puts "Rescued MyException: #{ex.message}"
-end
-
-
-begin
- # ...
-rescue ex : MyException | MyOtherException
- # only MyException or MyOtherException
-rescue
- # any other kind of exception
-ensure
- puts "Cleanup..."
-end
-
-
-def some_method
- something_dangerous
-rescue
- # execute if an exception is raised
-end
-
-
-array = [1, 2, 3]
-array[4] # raises because of IndexError
-array[4]? # returns nil because of index out of bounds
-
-
-def some_proc(&block : Int32 -> Int32)
- block
-end
-
-x = 0
-proc = ->(i : Int32) { x += i }
-proc = some_proc(&proc)
-proc.call(1) #=> 1
-proc.call(10) #=> 11
-x #=> 11
-
-
-def add(x, y)
- x + y
-end
-
-adder = ->add(Int32, Int32)
-adder.call(1, 2) #=> 3
-
-
-module Curses
- class Window
- end
-end
-
-Curses::Window.new
-
-
-module ItemsSize
- def size
- items.size
- end
-end
-
-class Items
- include ItemsSize
-
- def items
- [1, 2, 3]
- end
-end
-
-items = Items.new
-items.size #=> 3
-
-
-module Base64
- extend self
-
- def encode64(string)
- # ...
- end
-
- def decode64(string)
- # ...
- end
-end
-
-Base64.encode64 "hello" #=> "aGVsbG8="
-
-
-if some_condition
- a = 1
-else
- a = "hello"
-end
-
-a_as_int = a as Int32
-a_as_int.abs # works, compiler knows that a_as_int is Int32
-
-
-ptr = Pointer(Int32).malloc(1)
-ptr as Int8* #:: Pointer(Int8)
-
-
-array = [1, 2, 3]
-
-# object_id returns the address of an object in memory,
-# so we create a pointer with that address
-ptr = Pointer(Void).new(array.object_id)
-
-# Now we cast that pointer to the same type, and
-# we should get the same value
-array2 = ptr as Array(Int32)
-array2.same?(array) #=> true
-
-
-a = 1
-b = a as Int32 | Float64
-b #:: Int32 | Float64
-
-
-ary = [1, 2, 3]
-
-# We want to create an array 1, 2, 3 of Int32 | Float64
-ary2 = ary.map { |x| x as Int32 | Float64 }
-
-ary2 #:: Array(Int32 | Float64)
-ary2 << 1.5 # OK
-
-
-class Person
- def initialize(@name)
- end
-
- def name
- @name
- end
-end
-
-a = [] of Person
-x = a.map { |f| f.name } # Error: can't infer block return type
-
-
-a = [] of Person
-x = a.map { |f| f.name as String } # OK
-
-
-Person.new "John"
-
-a = [] of Person
-x = a.map { |f| f.name } # OK
-
-
-loop do
- do_something
- break if some_condition
-end
-
-
-class Point
- def initialize(@x, @y)
- end
-end
-
-Point.new 1, 2
-
-# 2 x Int32 = 2 x 4 = 8
-instance_sizeof(Point) #=> 12
-
-
-a = 1
-while a < 5
- a += 1
- if a == 3
- next
- end
- puts a
-end
-# The above prints the numbers 2, 4 and 5
-
-
-lib C
- # In C: double cos(double x)
- fun cos(value : Float64) : Float64
-
- fun getch : Int32
-
- fun srand(seed : UInt32)
-
- fun exit(status : Int32) : NoReturn
-
- fun printf(format : UInt8*, ...) : Int32
-end
-
-C.cos(1.5) #=> 0.0707372
-C.srand(1_u32)
-
-a = 1
-b = 2
-C.printf "%d + %d = %d\n", a, b, a + b
-
-
-lib LibSDL
- fun init = SDL_Init(flags : UInt32) : Int32
-end
-
-lib LLVMIntrinsics
- fun ceil_f32 = "llvm.ceil.f32"(value : Float32) : Float32
-end
-
-lib MyLib
- fun my_fun(some_size : LibC::SizeT)
-end
-
-@[Link("pcre")]
-lib LibPCRE
-end
-
-
-lib C
- ifdef x86_64
- alias SizeT = UInt64
- else
- alias SizeT = UInt32
- end
-
- fun memcmp(p1 : Void*, p2 : Void*, size : C::SizeT) : Int32
-end
-
-
-lib X
- enum SomeEnum
- Ten = 10
- Twenty = 10 * 2
- ThirtyTwo = 1 << 5
- end
-end
-
-
-lib X
- enum SomeEnum
- A = 1_u32
- end
-end
-
-
-X::SomeEnum::Zero #=> 0_i8
-X::SomeEnum::Two #=> 2_i8
-
-
-lib X
- fun callback(f : Int32 -> Int32)
-end
-
-
-f = ->(x : Int32) { x + 1 }
-X.callback(f)
-
-
-X.callback ->(x) { x + 1 }
-
-
-X.callback nil
-
-
-lib LibFoo
- fun store_callback(callback : ->)
- fun execute_callback
-end
-
-LibFoo.store_callback ->{ raise "OH NO!" }
-LibFoo.execute_callback
-
-
-lib LibFoo
- fun store_callback(callback : ->)
-
- @[Raises]
- fun execute_callback
-end
-
-
-@[Link("pcre")]
-lib PCRE
- INFO_CAPTURECOUNT = 2
-end
-
-PCRE::INFO_CAPTURECOUNT #=> 2
-
-
-lib U
- # In C:
- #
- # union IntOrFloat {
- # int some_int;
- # double some_float;
- # };
- union IntOrFloat
- some_int : Int32
- some_float : Float64
- end
-end
-
-
-value = U::IntOrFloat.new
-
-
-value = uninitialized U::IntOrFlaot
-value.some_int #=> some garbage value
-
-
-value = U::IntOrFloat.new
-value.some_int = 1
-value.some_int #=> 1
-value.some_float #=> 4.94066e-324
-
-
-def change_it(value)
- value.some_int = 1
-end
-
-value = U::IntOrFloat.new
-change_it value
-value.some_int #=> 0
-
-
-lib C
- # In C:
- #
- # struct TimeZone {
- # int minutes_west;
- # int dst_time;
- # };
- struct TimeZone
- minutes_west : Int32
- dst_time : Int32
- end
-end
-
-
-lib C
- # This is a forward declaration
- struct Node
- end
-
- struct Node
- node : Node*
- end
-end
-
-
-tz = C::TimeZone.new
-
-
-tz = uninitialized C::TimeZone
-tz.minutes_west #=> some garbage value
-
-
-tz = C::TimeZone.new
-tz.minutes_west = 1
-tz.minutes_west #=> 1
-
-
-tz = C::TimeZone.new minutes_west: 1, dst_time: 2
-tz.minutes_west #=> 1
-tz.dst_time #=> 2
-
-
-def change_it(tz)
- tz.minutes_west = 1
-end
-
-tz = C::TimeZone.new
-change_it tz
-tz.minutes_west #=> 0
-
-
-lib C
- $errno : Int32
-end
-
-
-C.errno #=> some value
-C.errno = 0
-C.errno #=> 0
-
-
-lib C
- @[ThreadLocal]
- $errno : Int32
-end
-
-
-lib C
- fun waitpid(pid : Int32, status_ptr : Int32*, options : Int32) : Int32
-end
-
-
-status_ptr = uninitialized Int32
-
-C.waitpid(pid, pointerof(status_ptr), options)
-
-
-C.waitpid(pid, out status_ptr, options)
-
-
-lib X
- type CInt = Int32
-end
-
-
-ifdef x86_64
- # some specific code for 64 bits platforms
-else
- # some specific code for non-64 bits platforms
-end
-
-
-ifdef linux && x86_64
- # some specific code for linux 64 bits
-end
-
-
-lib C
- ifdef linux
- struct SomeStruct
- some_field : Int32
- end
- else
- struct SomeStruct
- some_field : Int64
- end
- end
-end
-
-
-# Assigns to a local variable
-local = 1
-
-# Assigns to a global variable
-$global = 4
-
-class Testing
- # Assigns to an instance variable
- @instance = 2
-
- # Assigns to a class variable
- @@class = 3
-end
-
-
-local += 1 # same as: local = local + 1
-
-# The above is valid with these operators:
-# +, -, *, /, %, |, &, ^, **, <<, >>
-
-local ||= 1 # same as: local || (local = 1)
-local &&= 1 # same as: local && (local = 1)
-
-
-# A setter
-person.name=("John")
-
-# The above can be written as:
-person.name = "John"
-
-# An indexed assignment
-objects.[]=(2, 3)
-
-# The above can be written as:
-objects[2] = 3
-
-# Not assignment-related, but also syntax sugar:
-objects.[](2, 3)
-
-# The above can be written as:
-objects[2, 3]
-
-
-person.age += 1 # same as: person.age = person.age + 1
-
-person.name ||= "John" # same as: person.name || (person.name = "John")
-person.name &&= "John" # same as: person.name && (person.name = "John")
-
-objects[1] += 2 # same as: objects[1] = objects[1] + 2
-
-objects[1] ||= 2 # same as: objects[1]? || (objects[1] = 2)
-objects[1] &&= 2 # same as: objects[1]? && (objects[1] = 2)
-
-
-alias PInt32 = Pointer(Int32)
-
-ptr = PInt32.malloc(1) # : Pointer(Int32)
-
-
-alias RecArray = Array(Int32) | Array(RecArray)
-
-ary = [] of RecArray
-ary.push [1, 2, 3]
-ary.push ary
-ary #=> [[1, 2, 3], [...]]
-
-
-module Json
- alias Type = Nil |
- Bool |
- Int64 |
- Float64 |
- String |
- Array(Type) |
- Hash(String, Type)
-end
-
-
-a = 1
-if a > 0
- a = 10
-end
-a #=> 10
-
-b = 1
-if b > 2
- b = 10
-else
- b = 20
-end
-b #=> 20
-
-
-if some_condition
- do_something
-elsif some_other_condition
- do_something_else
-else
- do_that
-end
-
-
-a = 1
-if some_condition
- a = "hello"
-else
- a = true
-end
-# a : String | Bool
-
-b = 1
-if some_condition
- b = "hello"
-end
-# b : Int32 | String
-
-if some_condition
- c = 1
-else
- c = "hello"
-end
-# c : Int32 | String
-
-if some_condition
- d = 1
-end
-# d : Int32 | Nil
-
-
-a = 1
-if some_condition
- a = "hello"
- # a : String
- a.size
-end
-# a : String | Int32
-
-
-if some_condition
- e = 1
-else
- e = "hello"
- # e : String
- return
-end
-# e : Int32
-
-
-enum Color : UInt8
- Red # 0
- Green # 1
- Blue = 5 # overwritten to 5
- Yellow # 6 (5 + 1)
-
- def red?
- self == Color::Red
- end
-end
-
-Color::Red.value #:: UInt8
-
-
-@[Flags]
-enum IOMode
- Read # 1
- Write # 2
- Async # 4
-end
-
-
-IOMode::None.value #=> 0
-IOMode::All.value #=> 7
-
-
-puts(Color::Red) # prints "Red"
-puts(IOMode::Write | IOMode::Async) # prints "Write, Async"
-
-
-puts Color.new(1) #=> prints "Green"
-
-
-puts Color.new(10) #=> prints "10"
-
-
-Color::Red.red? #=> true
-Color::Blue.red? #=> false
-
-
-def paint(color : Color)
- case color
- when Color::Red
- # ...
- else
- # Unusual, but still can happen
- raise "unknown color: #{color}"
- end
-end
-
-paint Color::Red
-
-
-def paint(color : Symbol)
- case color
- when :red
- # ...
- else
- raise "unknown color: #{color}"
- end
-end
-
-paint :red
-
-
-name = "Crystal"
-age = 1
-
-
-flower = "Tulip"
-# At this point 'flower' is a String
-
-flower = 1
-# At this point 'flower' is an Int32
-
-
-class Foo
- def finalize
- # Invoked when Foo is garbage-collected
- puts "Bye bye from #{self}!"
- end
-end
-
-# Prints "Bye bye ...!" for ever
-loop do
- Foo.new
-end
-
-
-# Defines a method in the program
-def add(x, y)
- x + y
-end
-
-# Invokes the add method in the program
-add(1, 2) #=> 3
-
-
-def even?(num)
- if num % 2 == 0
- return true
- end
-
- return false
-end
-
-
-def add(x, y)
- x + y
-end
-
-class Foo
- def bar
- # invokes the program's add method
- add(1, 2)
-
- # invokes Foo's baz method
- baz(1, 2)
- end
-
- def baz(x, y)
- x * y
- end
-end
-
-
-def baz(x, y)
- x + y
-end
-
-class Foo
- def bar
- baz(4, 2) #=> 2
- ::baz(4, 2) #=> 6
- end
-
- def baz(x, y)
- x - y
- end
-end
-
-
-x = 1
-
-def add(y)
- x + y # error: undefined local variable or method 'x'
-end
-
-add(2)
-
-
-add 1, 2 # same as add(1, 2)
-
-
-class Counter
- @@instances = 0
-
- def initialize
- @@instances += 1
- end
-
- def self.instances
- @@instances
- end
-end
-
-Counter.instances #=> 0
-Counter.new
-Counter.new
-Counter.new
-Counter.instances #=> 3
-
-
-class Counter
- def self.increment
- @@instances += 1
- end
-end
-
-Counter.increment # Error: undefined method '+' for Nil
-
-
-class Parent
- @@counter = 0
-end
-
-class Child < Parent
- def self.counter
- @@counter
- end
-end
-
-Child.counter #=> nil
-
-
-unless some_condition
- then_expression
-else
- else_expression
-end
-
-# Can also be written as a suffix
-close_door unless door_closed?
-
-
-a = 1
-b = typeof(a) #=> Int32
-
-
-typeof(1, "a", 'a') #=> (Int32 | String | Char)
-
-
-hash = {} of Int32 => String
-another_hash = typeof(hash).new #:: Hash(Int32, String)
-
-
-class Array
- def self.elem_type(typ)
- if typ.is_a?(Array)
- elem_type(typ.first)
- else
- typ
- end
- end
-end
-
-nest = [1, ["b", [:c, ['d']]]]
-flat = Array(typeof(Array.elem_type(nest))).new
-typeof(nest) #=> Array(Int32 | Array(String | Array(Symbol | Array(Char))))
-typeof(flat) #=> Array(String | Int32 | Symbol | Char)
-
-
-a = 2 if some_condition
-
-
-x = 0
-proc = ->{ x += 1; x }
-proc.call #=> 1
-proc.call #=> 2
-x #=> 2
-
-
-def counter
- x = 0
- ->{ x += 1; x }
-end
-
-proc = counter
-proc.call #=> 1
-proc.call #=> 2
-
-
-def foo
- yield
-end
-
-x = 1
-foo do
- x = "hello"
-end
-x # : Int32 | String
-
-
-x = 1
-foo do
- x = "hello"
-end
-x # : Int32 | String
-
-x = 'a'
-x # : Char
-
-
-def capture(&block)
- block
-end
-
-x = 1
-capture { x = "hello" }
-
-x = 'a'
-x # : Int32 | String | Char
-
-
-def capture(&block)
- block
-end
-
-x = 1
-->{ x = "hello" }
-
-x = 'a'
-x # : Int32 | String | Char
-
-
-abstract class Animal
- # Makes this animal talk
- abstract def talk
-end
-
-class Dog < Animal
- def talk
- "Woof!"
- end
-end
-
-class Cat < Animal
- def talk
- "Miau"
- end
-end
-
-class Person
- getter pet
-
- def initialize(@name, @pet)
- end
-end
-
-john = Person.new "John", Dog.new
-peter = Person.new "Peter", Cat.new
-
-
-john.pet.talk #=> "Woof!"
-
-
-a = 1 > 2 ? 3 : 4
-
-# The above is the same as:
-a = if 1 > 2
- 3
- else
- 4
- end
-
-
-def some_method : String
- "hello"
-end
-
-
-PI = 3.14
-
-module Earth
- RADIUS = 6_371_000
-end
-
-PI #=> 3.14
-Earth::RADIUS #=> 6_371_000
-
-
-TEN = begin
- a = 0
- while a < 10
- a += 1
- end
- a
-end
-
-TEN #=> 10
-
-
-class Person
- getter name
-
- def initialize(@name)
- @age = 0
- end
-end
-
-john = Person.new "John"
-john.name #=> "John"
-john.name.size #=> 4
-
-
-one = Person.new 1
-one.name #=> 1
-one.name + 2 #=> 3
-
-
-john = Person.new "John"
-one = Person.new 1
-
-
-john = Person.new "John"
-one = Person.new 1
-
-# Error: undefined method 'size' for Int32
-john.name.size
-
-# Error: no overload matches 'String#+' with types Int32
-john.name + 3
-
-
-john = Person.new "John"
-john.name.size
-one = Person.new 1
-
-
-class Person
- getter name
-
- def initialize(@name)
- @age = 0
- end
-
- def address
- @address
- end
-
- def address=(@address)
- end
-end
-
-john = Person.new "John"
-john.address = "Argentina"
-
-
-# Error: undefined method 'size' for Nil
-john.address.size
-
-
-class Person
- @age = 0
-
- def initialize(@name)
- end
-end
-
-
-class Person
- @age : Int32
-
- def initialize(@name)
- @age = 0
- end
-end
-
-
-a = if 2 > 1
- 3
- else
- 4
- end
-a #=> 3
-
-
-if 1 > 2
-else
- 3
-end
-
-
-def twice(&block)
- yield
- yield
-end
-
-
-twice() do
- puts "Hello!"
-end
-
-twice do
- puts "Hello!"
-end
-
-twice { puts "Hello!" }
-
-
-def twice
- yield 1
- yield 2
-end
-
-twice do |i|
- puts "Got #{i}"
-end
-
-
-twice { |i| puts "Got #{i}" }
-
-
-def many
- yield 1, 2, 3
-end
-
-many do |x, y, z|
- puts x + y + z
-end
-
-# Output: 6
-
-
-def many
- yield 1, 2, 3
-end
-
-many do |x, y|
- puts x + y
-end
-
-# Output: 3
-
-
-def twice
- yield
- yield
-end
-
-twice do |i|
- puts i.inspect
-end
-
-
-def some
- yield 1, 'a'
- yield true, "hello"
- yield 2
-end
-
-some do |first, second|
- # first is Int32 | Bool
- # second is Char | String | Nil
-end
-
-
-method do |argument|
- argument.some_method
-end
-
-
-method(&.some_method)
-
-
-method &.some_method(arg1, arg2)
-
-
-method &.+(2)
-method &.[index]
-
-
-def twice
- v1 = yield 1
- puts v1
-
- v2 = yield 2
- puts v2
-end
-
-twice do |i|
- i + 1
-end
-
-
-ary = [1, 2, 3]
-ary.map { |x| x + 1 } #=> [2, 3, 4]
-ary.select { |x| x % 2 == 1 } #=> [1, 3]
-
-
-def transform(value)
- yield value
-end
-
-transform(1) { |x| x + 1 } #=> 2
-
-
-def thrice
- puts "Before 1"
- yield 1
- puts "Before 2"
- yield 2
- puts "Before 3"
- yield 3
- puts "After 3"
-end
-
-thrice do |i|
- if i == 2
- break
- end
-end
-
-
-def twice
- yield 1
- yield 2
-end
-
-twice { |i| i + 1 } #=> 3
-twice { |i| break "hello" } #=> "hello"
-
-
-value = twice do |i|
- if i == 1
- break "hello"
- end
- i + 1
-end
-value #:: Int32 | String
-
-
-values = twice { break 1, 2 }
-values #=> {1, 2}
-
-
-value = twice { break }
-value #=> nil
-
-
-def twice
- yield 1
- yield 2
-end
-
-twice do |i|
- if i == 1
- puts "Skipping 1"
- next
- end
-
- puts "Got #{i}"
-end
-
-
-
-def twice
- v1 = yield 1
- puts v1
-
- v2 = yield 2
- puts v2
-end
-
-twice do |i|
- if i == 1
- next 10
- end
-
- i + 1
-end
-
-# Output
-# 10
-# 3
-
-
-class Foo
- def one
- 1
- end
-
- def yield_with_self
- with self yield
- end
-
- def yield_normally
- yield
- end
-end
-
-def one
- "one"
-end
-
-Foo.new.yield_with_self { one } # => 1
-Foo.new.yield_normally { one } # => "one"
-
-
-def twice
- yield 1
- yield 2
-end
-
-twice do |i|
- puts "Got: #{i}"
-end
-
-
-i = 1
-puts "Got: #{i}"
-i = 2
-puts "Got: #{i}"
-
-
-3.times do |i|
- puts i
-end
-
-
-struct Int
- def times
- i = 0
- while i < self
- yield i
- i += 1
- end
- end
-end
-
-
-i = 0
-while i < 3
- puts i
- i += 1
-end
-
-
-class Person
- def initialize(@name)
- end
-
- def greet
- puts "Hi, I'm #{@name}"
- end
-end
-
-class Employee < Person
-end
-
-employee = Employee.new "John"
-employee.greet # "Hi, I'm John"
-
-
-class Person
- def initialize(@name)
- end
-end
-
-class Employee < Person
- def initialize(@name, @company_name)
- end
-end
-
-Employee.new "John", "Acme" # OK
-Employee.new "Peter" # Error: wrong number of arguments
- # for 'Employee:Class#new' (1 for 2)
-
-
-class Person
- def greet(msg)
- puts "Hi, #{msg}"
- end
-end
-
-class Employee < Person
- def greet(msg)
- puts "Hello, #{msg}"
- end
-end
-
-p = Person.new
-p.greet "everyone" # "Hi, everyone"
-
-e = Employee.new
-e.greet "everyone" # "Hello, everyone"
-
-
-class Person
- def greet(msg)
- puts "Hi, #{msg}"
- end
-end
-
-class Employee < Person
- def greet(msg : Int32)
- puts "Hi, this is a number: #{msg}"
- end
-end
-
-e = Employee.new
-e.greet "everyone" # "Hi, everyone"
-
-e.greet 1 # "Hi, this is a number: 1"
-
-
-class Person
- def greet(msg)
- puts "Hello, "#{msg}"
- end
-end
-
-class Employee < Person
- def greet(msg)
- super # Same as: super(msg)
- super("another message")
- end
-end
-
-
-def int_to_int(&block : Int32 -> Int32)
- block
-end
-
-proc = int_to_int { |x| x + 1 }
-proc.call(1) #=> 2
-
-
-class Model
- def on_save(&block)
- @on_save_callback = block
- end
-
- def save
- if callback = @on_save_callback
- callback.call
- end
- end
-end
-
-model = Model.new
-model.on_save { puts "Saved!" }
-model.save # prints "Saved!"
-
-
-def some_proc(&block : Int32 ->)
- block
-end
-
-proc = some_proc { |x| x + 1 }
-proc.call(1) # void
-
-
-def some_proc(&block : Int32 -> _)
- block
-end
-
-proc = some_proc { |x| x + 1 }
-proc.call(1) # 2
-
-proc = some_proc { |x| x.to_s }
-proc.call(1) # "1"
-
-
-macro update_x
- x = 1
-end
-
-x = 0
-update_x
-x #=> 1
-
-
-macro dont_update_x
- %x = 1
- puts %x
-end
-
-x = 0
-dont_update_x # outputs 1
-x #=> 0
-
-
-macro fresh_vars_sample(*names)
- # First declare vars
- {% for name, index in names %}
- print "Declaring: ", "%name{index}", '\n'
- %name{index} = {{index}}
- {% end %}
-
- # Then print them
- {% for name, index in names %}
- print "%name{index}: ", %name{index}, '\n'
- {% end %}
-end
-
-fresh_vars_sample a, b, c
-
-# Sample output:
-# Declaring: __temp_255
-# Declaring: __temp_256
-# Declaring: __temp_257
-# __temp_255: 0
-# __temp_256: 1
-# __temp_257: 2
-
-
-class Object
- macro def instance_vars_names : Array(String)
- {{ @type.instance_vars.map &.name.stringify }}
- end
-end
-
-class Person
- def initialize(@name, @age)
- end
-end
-
-person = Person.new "John", 30
-person.instance_vars_names #=> ["name", "age"]
-
-
-class Object
- macro def has_instance_var?(name) : Bool
- # We cannot access name inside the macro expansion here,
- # instead we need to use the macro language to construct an array
- # and do the inclusion check at runtime.
- {{ @type.instance_vars.map &.name.stringify }}.includes? name
- end
-end
-
-person = Person.new "John", 30
-person.has_instance_var?("name") #=> true
-person.has_instance_var?("birthday") #=> false
-
-
-class Parent
- macro inherited
- def {{@type.name.downcase.id}}
- 1
- end
- end
-end
-
-class Child < Parent
-end
-
-Child.new.child #=> 1
-
-
-macro method_missing(name, args, block)
- print "Got ", {{name.id.stringify}}, " with ", {{args.size}}, " arguments", '\n'
-end
-
-foo # Prints: Got foo with 0 arguments
-bar 'a', 'b' # Prints: Got bar with 2 arguments
-
-
-sizeof(Int32) #=> 4
-sizeof(Int64) #=> 8
-
-
-# On a 64 bits machine
-sizeof(Pointer(Int32)) #=> 8
-sizeof(String) #=> 8
-
-
-a = 1
-sizeof(typeof(a)) #=> 4
-
-
-class Foo
- macro emphasize(value)
- "***#{ {{value}} }***"
- end
-
- def yield_with_self
- with self yield
- end
-end
-
-Foo.new.yield_with_self { emphasize(10) } #=> "***10***"
-
-
-# This generates:
-#
-# def :foo
-# 1
-# end
-define_method :foo, 1
-
-
-macro define_method(name, content)
- def {{name.id}}
- {{content}}
- end
-end
-
-# This correctly generates:
-#
-# def foo
-# 1
-# end
-define_method :foo, 1
-
-
-macro define_method(name, content)
- def {{name}}
- {% if content == 1 %}
- "one"
- {% else %}
- {{content}}
- {% end %}
- end
-end
-
-define_method foo, 1
-define_method bar, 2
-
-foo #=> one
-bar #=> 2
-
-
-{% if env("TEST") %}
- puts "We are in test mode"
-{% end %}
-
-
-macro define_dummy_methods(names)
- {% for name, index in names %}
- def {{name.id}}
- {{index}}
- end
- {% end %}
-end
-
-define_dummy_methods [foo, bar, baz]
-
-foo #=> 0
-bar #=> 1
-baz #=> 2
-
-
-macro define_dummy_methods(hash)
- {% for key, value in hash %}
- def {{key.id}}
- {{value}}
- end
- {% end %}
-end
-define_dummy_methods({foo: 10, bar: 20})
-foo #=> 10
-bar #=> 20
-
-
-{% for name, index in ["foo", "bar", "baz"] %}
- def {{name.id}}
- {{index}}
- end
-{% end %}
-
-foo #=> 0
-bar #=> 1
-baz #=> 2
-
-
-macro define_dummy_methods(*names)
- {% for name, index in names %}
- def {{name.id}}
- {{index}}
- end
- {% end %}
-end
-
-define_dummy_methods foo, bar, baz
-
-foo #=> 0
-bar #=> 1
-baz #=> 2
-
-
-macro println(*values)
- print {{*values}}, '\n'
-end
-
-println 1, 2, 3 # outputs 123\n
-
-
-VALUES = [1, 2, 3]
-
-{% for value in VALUES %}
- puts {{value}}
-{% end %}
-
-
-until some_condition
- do_this
-end
-
-# The above is the same as:
-while !some_condition
- do_this
-end
-
-
-a = some_condition ? nil : 3
-# a is Int32 or Nil
-
-if a
- # Since the only way to get here is if a is truthy,
- # a can't be nil. So here a is Int32.
- a.abs
-end
-
-
-if a = some_expression
- # here a is not nil
-end
-
-
-if a && b
- # here both a and b are guaranteed not to be Nil
-end
-
-
-if @a
- # here @a can be nil
-end
-
-
-# First option: assign it to a variable
-if a = @a
- # here a can't be nil
-end
-
-# Second option: use `Object#try` found in the standard library
-@a.try do |a|
- # here a can't be nil
-end
-
-
-if method # first call to a method that can return Int32 or Nil
- # here we know that the first call did not return Nil
- method # second call can still return Int32 or Nil
-end
-
-
-class Person
- def become_older(by = 1)
- @age += by
- end
-end
-
-john = Person.new "John"
-john.age #=> 0
-
-john.become_older
-john.age #=> 1
-
-john.become_older 2
-john.age #=> 3
-
-
-john.become_older by: 5
-
-
-def some_method(x, y = 1, z = 2, w = 3)
- # do something...
-end
-
-some_method 10 # x = 10, y = 1, z = 2, w = 3
-some_method 10, z: 10 # x = 10, y = 1, z = 10, w = 3
-some_method 10, w: 1, y: 2, z: 3 # x = 10, y = 2, z = 3, w = 1
-
-
-case exp
-when value1, value2
- do_something
-when value3
- do_something_else
-else
- do_another_thing
-end
-
-
-case var
-when String
- # var : String
- do_something
-when Int32
- # var : Int32
- do_something_else
-else
- # here var is neither a String nor an Int32
- do_another_thing
-end
-
-
-case num
-when .even?
- do_something
-when .odd?
- do_something_else
-end
-
-
-case
-when cond1, cond2
- do_something
-when cond3
- do_something_else
-end
-
-
-a = 1
-a.responds_to?(:abs) #=> true
-a.responds_to?(:size) #=> false
-
-
-foo_or_bar = /foo|bar/
-heeello = /h(e+)llo/
-integer = /\d+/
-
-
-r = /foo/imx
-
-
-slash = /\//
-
-
-r = %r(regex with slash: /)
-
-
-"hello world"
-
-
-"\"" # double quote
-"\\" # backslash
-"\e" # escape
-"\f" # form feed
-"\n" # newline
-"\r" # carriage return
-"\t" # tab
-"\v" # vertical tab
-
-
-"\101" # == "A"
-"\123" # == "S"
-"\12" # == "\n"
-"\1" # string with one character with code point 1
-
-
-"\u0041" # == "A"
-
-
-"\u{41}" # == "A"
-"\u{1F52E}" # == "🔮"
-
-
-"hello
- world" # same as "hello\n world"
-
-
-"hello " \
-"world, " \
-"no newlines" # same as "hello world, no newlines"
-
-
-"hello \
- world, \
- no newlines" # same as "hello world, no newlines"
-
-
-# Supports double quotes and nested parenthesis
-%(hello ("world")) # same as "hello (\"world\")"
-
-# Supports double quotes and nested brackets
-%[hello ["world"]] # same as "hello [\"world\"]"
-
-# Supports double quotes and nested curlies
-%{hello {"world"}} # same as "hello {\"world\"}"
-
-# Supports double quotes and nested angles
-%<hello <"world">> # same as "hello <\"world\">"
-
-
-<<-XML
-<parent>
- <child />
-</parent>
-XML
-
-
-# Same as "Hello\n world"
-<<-STRING
- Hello
- world
- STRING
-
-# Same as " Hello\n world"
-<<-STRING
- Hello
- world
- STRING
-
-
-a = 1
-b = 2
-"sum = #{a + b}" # "sum = 3"
-
-
-1.0 # Float64
-1.0_f32 # Float32
-1_f32 # Float32
-
-1e10 # Float64
-1.5e10 # Float64
-1.5e-7 # Float64
-
-+1.3 # Float64
--0.5 # Float64
-
-
-1_000_000.111_111 # better than 1000000.111111
-
-
-'a'
-'z'
-'0'
-'_'
-'あ'
-
-
-'\'' # single quote
-'\\' # backslash
-'\e' # escape
-'\f' # form feed
-'\n' # newline
-'\r' # carriage return
-'\t' # tab
-'\v' # vertical tab
-
-
-'\101' # == 'A'
-'\123' # == 'S'
-'\12' # == '\n'
-'\1' # code point 1
-
-
-'\u0041' # == 'A'
-
-
-'\u{41}' # == 'A'
-'\u{1F52E}' # == '🔮'
-
-
-{1 => 2, 3 => 4} # Hash(Int32, Int32)
-{1 => 2, 'a' => 3} # Hash(Int32 | Char, Int32)
-
-
-{} of Int32 => Int32 # same as Hash(Int32, Int32).new
-
-
-{key1: 'a', key2: 'b'} # Hash(Symbol, Char)
-
-
-{"key1": 'a', "key2": 'b'} # Hash(String, Char)
-
-
-MyType{"foo": "bar"}
-
-
-tmp = MyType.new
-tmp["foo"] = "bar"
-tmp
-
-
-tmp = MyType(typeof("foo"), typeof("bar")).new
-tmp["foo"] = "bar"
-tmp
-
-
-MyType(String, String) {"foo": "bar"}
-
-
-:hello
-:good_bye
-
-# With spaces and symbols
-:"symbol with spaces"
-
-# Ending with question and exclamation marks
-:question?
-:exclamation!
-
-# For the operators
-:+
-:-
-:*
-:/
-:==
-:<
-:<=
-:>
-:>=
-:!
-:!=
-:=~
-:!~
-:&
-:|
-:^
-:~
-:**
-:>>
-:<<
-:%
-:[]
-:[]?
-:[]=
-:<=>
-:===
-
-
-x..y # an inclusive range, in mathematics: [x, y]
-x...y # an exclusive range, in mathematics: [x, y)
-
-
-# A proc without arguments
-->{ 1 } # Proc(Int32)
-
-# A proc with one argument
-->(x : Int32) { x.to_s } # Proc(Int32, String)
-
-# A proc with two arguments:
-->(x : Int32, y : Int32) { x + y } # Proc(Int32, Int32, Int32)
-
-
-Proc(Int32, String).new { |x| x.to_s } # Proc(Int32, String)
-
-
-proc = ->(x : Int32, y : Int32) { x + y }
-proc.call(1, 2) #=> 3
-
-
-def one
- 1
-end
-
-proc = ->one
-proc.call #=> 1
-
-
-def plus_one(x)
- x + 1
-end
-
-proc = ->plus_one(Int32)
-proc.call(41) #=> 42
-
-
-str = "hello"
-proc = ->str.count(Char)
-proc.call('e') #=> 1
-proc.call('l') #=> 2
-
-
-tuple = {1, "hello", 'x'} # Tuple(Int32, String, Char)
-tuple[0] #=> 1 (Int32)
-tuple[1] #=> "hello" (String)
-tuple[2] #=> 'x' (Char)
-
-
-[1, 2, 3] # Array(Int32)
-[1, "hello", 'x'] # Array(Int32 | String | Char)
-
-
-[] of Int32 # same as Array(Int32).new
-
-
-%w(one two three) # ["one", "two", "three"]
-
-
-%i(one two three) # [:one, :two, :three]
-
-
-MyType{1, 2, 3}
-
-
-tmp = MyType.new
-tmp << 1
-tmp << 2
-tmp << 3
-tmp
-
-
-tmp = MyType(typeof(1, 2, 3)).new
-tmp << 1
-tmp << 2
-tmp << 3
-tmp
-
-
-MyType(Int32 | String) {1, 2, "foo"}
-
-
-nil
-
-
-1 # Int32
-
-1_i8 # Int8
-1_i16 # Int16
-1_i32 # Int32
-1_i64 # Int64
-
-1_u8 # UInt8
-1_u16 # UInt16
-1_u32 # UInt32
-1_u64 # UInt64
-
-+10 # Int32
--20 # Int32
-
-2147483648 # Int64
-9223372036854775808 # UInt64
-
-
-1_000_000 # better than 1000000
-
-
-0b1101 # == 13
-
-
-0o123 # == 83
-
-
-0xFE012D # == 16646445
-0xfe012d # == 16646445
-
-
-true # A Bool that is true
-false # A Bool that is false
-
-
-a = 1
-
-ptr = pointerof(a)
-ptr.value = 2
-
-a #=> 2
-
-
-class Point
- def initialize(@x, @y)
- end
-
- def x
- @x
- end
-
- def x_ptr
- pointerof(@x)
- end
-end
-
-point = Point.new 1, 2
-
-ptr = point.x_ptr
-ptr.value = 10
-
-point.x #=> 10
-
-
-def add(x : Number, y : Number)
- x + y
-end
-
-# Ok
-add 1, 2 # Ok
-
-# Error: no overload matches 'add' with types Bool, Bool
-add true, false
-
-
-def add(x, y)
- x + y
-end
-
-add true, false
-
-
-# A class that has a + method but isn't a Number
-class Six
- def +(other)
- 6 + other
- end
-end
-
-# add method without type restrictions
-def add(x, y)
- x + y
-end
-
-# OK
-add Six.new, 10
-
-# add method with type restrictions
-def restricted_add(x : Number, y : Number)
- x + y
-end
-
-# Error: no overload matches 'restricted_add' with types Six, Int32
-restricted_add Six.new, 10
-
-
-class Person
- def ==(other : self)
- other.name == name
- end
-
- def ==(other)
- false
- end
-end
-
-john = Person.new "John"
-another_john = Person.new "John"
-peter = Person.new "Peter"
-
-john == another_john #=> true
-john == peter #=> false (names differ)
-john == 1 #=> false (because 1 is not a Person)
-
-
-class Person
- def self.compare(p1 : self, p2 : self)
- p1.name == p2.name
- end
-end
-
-john = Person.new "John"
-peter = Person.new "Peter"
-
-Person.compare(john, peter) # OK
-
-
-def foo(x : Int32)
-end
-
-foo 1 # OK
-foo "hello" # Error
-
-
-def foo(x : Int32.class)
-end
-
-foo Int32 # OK
-foo String # Error
-
-
-def foo(x : Int32.class)
- puts "Got Int32"
-end
-
-def foo(x : String.class)
- puts "Got String"
-end
-
-foo Int32 # prints "Got Int32"
-foo String # prints "Got String"
-
-
-def foo(*args : Int32)
-end
-
-def foo(*args : String)
-end
-
-foo 1, 2, 3 # OK, invokes first overload
-foo "a", "b", "c" # OK, invokes second overload
-foo 1, 2, "hello" # Error
-foo() # Error
-
-
-def foo
- # This is the empty-tuple case
-end
-
-
-def foo(x : T)
- T
-end
-
-foo(1) #=> Int32
-foo("hello") #=> String
-
-
-def foo(x : Array(T))
- T
-end
-
-foo([1, 2]) #=> Int32
-foo([1, "a"]) #=> (Int32 | String)
-
-
-def foo(x : T.class)
- Array(T)
-end
-
-foo(Int32) #=> Array(Int32)
-foo(String) #=> Array(String)
-
-
-class Person
- # Increases age by one
- def become_older
- @age += 1
- end
-
- # Increases age by the given number of years
- def become_older(years : Int32)
- @age += years
- end
-
- # Increases age by the given number of years, as a String
- def become_older(years : String)
- @age += years.to_i
- end
-
- # Yields the current age of this person and increases
- # its age by the value returned by the block
- def become_older
- @age += yield @age
- end
-end
-
-person = Person.new "John"
-
-person.become_older
-person.age #=> 1
-
-person.become_older 5
-person.age #=> 6
-
-person.become_older "12"
-person.age #=> 18
-
-person.become_older do |current_age|
- current_age < 20 ? 10 : 30
-end
-person.age #=> 28
-
-
-a = 1
-a.is_a?(Int32) #=> true
-a.is_a?(String) #=> false
-a.is_a?(Number) #=> true
-a.is_a?(Int32 | String) #=> true
-
-
-# One for each thread
-@[ThreadLocal]
-$values = [] of Int32
-
-
-@[AlwaysInline]
-def foo
- 1
-end
-
-
-@[NoInline]
-def foo
- 1
-end
-
-
-lib LibFoo
- @[CallConvention("X86_StdCall")]
- fun foo : Int32
-end
-
-
-def sum(*elements)
- total = 0
- elements.each do |value|
- total += value
- end
- total
-end
-
-# elements is Tuple(Int32, Int32, Int32, Float64)
-sum 1, 2, 3, 4.5
-
-
-if a.responds_to?(:abs)
- # here a's type will be reduced to those responding to the 'abs' method
-end
-
-
-a = some_condition ? 1 : "hello"
-# a : Int32 | String
-
-if a.responds_to?(:abs)
- # here a will be Int32, since Int32#abs exists but String#abs doesn't
-else
- # here a will be String
-end
-
-
-if (a = @a).responds_to?(:abs)
- # here a is guaranteed to respond to `abs`
-end
-
-
-def capture(&block)
- block
-end
-
-def invoke(&block)
- block.call
-end
-
-proc = capture { puts "Hello" }
-invoke(&proc) # prints "Hello"
-
-
-
-
-def capture(&block)
- block
-end
-
-def twice
- yield
- yield
-end
-
-proc = capture { puts "Hello" }
-twice &proc
-
-
-twice &->{ puts "Hello" }
-
-
-def say_hello
- puts "Hello"
-end
-
-twice &->say_hello
-
-
-def foo
- yield 1
-end
-
-def wrap_foo
- puts "Before foo"
- foo do |x|
- yield x
- end
- puts "After foo"
-end
-
-wrap_foo do |i|
- puts i
-end
-
-
-def foo
- yield 1
-end
-
-def wrap_foo(&block : Int32 -> _)
- puts "Before foo"
- foo(&block)
- puts "After foo"
-end
-
-wrap_foo do |i|
- puts i
-end
-
-
-foo_forward do |i|
- break # error
-end
-
-
-a = 2
-while (a += 1) < 20
- if a == 10
- # goes to 'puts a'
- break
- end
-end
-puts a #=> 10
-
-
-class Person
- private def say(message)
- puts message
- end
-
- def say_hello
- say "hello" # OK, no receiver
- self.say "hello" # Error, self is a receiver
-
- other = Person.new "Other"
- other.say "hello" # Error, other is a receiver
- end
-end
-
-
-class Employee < Person
- def say_bye
- say "bye" # OK
- end
-end
-
-
-module Namespace
- class Foo
- protected def foo
- puts "Hello"
- end
- end
-
- class Bar
- def bar
- # Works, because Foo and Bar are under Namespace
- Foo.new.foo
- end
- end
-end
-
-Namespace::Bar.new.bar
-
-
-class Person
- protected def self.say(message)
- puts message
- end
-
- def say_hello
- Person.say "hello"
- end
-end
-
-
-buffer = uninitialized UInt8[256]
diff --git a/tests/examplefiles/test.cs b/tests/examplefiles/test.cs
deleted file mode 100644
index faab7e42..00000000
--- a/tests/examplefiles/test.cs
+++ /dev/null
@@ -1,374 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-// //
-// MIT X11 license, Copyright (c) 2005-2006 by: //
-// //
-// Authors: //
-// Michael Dominic K. <michaldominik@gmail.com> //
-// //
-// Permission is hereby granted, free of charge, to any person obtaining a //
-// copy of this software and associated documentation files (the "Software"), //
-// to deal in the Software without restriction, including without limitation //
-// the rights to use, copy, modify, merge, publish, distribute, sublicense, //
-// and/or sell copies of the Software, and to permit persons to whom the //
-// Software is furnished to do so, subject to the following conditions: //
-// //
-// The above copyright notice and this permission notice shall be included //
-// in all copies or substantial portions of the Software. //
-// //
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS //
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF //
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN //
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, //
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR //
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE //
-// USE OR OTHER DEALINGS IN THE SOFTWARE. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-namespace Diva.Core {
-
- using System;
- using Widgets;
- using System.Xml;
- using Util;
- using System.Collections.Generic;
- using System.Collections;
- using Basics;
-
- public class OpenerTask : Task, IBoilProvider {
-
- // Private structs ////////////////////////////////////////////
-
- struct ObjectInfo {
-
- public ObjectContainer Container;
- public int[] Depends;
- public string SystemType;
- public int RefId;
-
- /* CONSTRUCTOR */
- public ObjectInfo (ObjectContainer container)
- {
- Container = container;
- Depends = container.Depends.ToArray ();
- SystemType = container.SystemType;
- RefId = container.RefId;
- }
-
- public override string ToString ()
- {
- return String.Format ("Type: {0} Deps count: {1} Id: {2}",
- SystemType, Depends.Length, RefId);
- }
-
- public bool IsUnBoilable (IBoilProvider provider)
- {
- if (Depends.Length == 0)
- return true;
-
- foreach (int id in Depends)
- if (! (provider.Contains (id)))
- return false;
-
- return true;
- }
-
- }
-
- // Enums //////////////////////////////////////////////////////
-
- enum OpenerTaskStep { Init, Header, ProjectInfoRead, ObjectListRead,
- ObjectListParse, ObjectListUnBoil, FindRoots,
- Finished };
-
- // Fields /////////////////////////////////////////////////////
-
- string fileName; // Filename we're reading
- XmlDocument xmlDocument; // Our document
- //XmlNode projectInfoNode; // <projectinfo> node
- IEnumerator objectsEnumerator; // Enumerator
- List <ObjectInfo> objectsList; // Objects list
- ObjectListContainer objectListContainer;
- OpenerTaskStep currentStep; // Our current step
-
- Dictionary <int, object> idToObject; // Id -> object
- Dictionary <object, int> objectToId; // Object -> Id
-
- string projectName = String.Empty;
- string projectDirectory = String.Empty;
- TagList projectTagList;
- StuffList projectStuffList;
- TrackList projectTrackList;
- ClipList projectClipList;
- MediaItemList projectMediaItemList;
- Commander projectCommander;
- Gdv.Pipeline projectPipeline;
- Gdv.ProjectFormat projectFormat;
-
- // Properties /////////////////////////////////////////////////
-
- public string ProjectName {
- get { return projectName; }
- }
-
- public string ProjectDirectory {
- get { return projectDirectory; }
- }
-
- public TagList ProjectTagList {
- get { return projectTagList; }
- }
-
- public StuffList ProjectStuffList {
- get { return projectStuffList; }
- }
-
- public TrackList ProjectTrackList {
- get { return projectTrackList; }
- }
-
- public ClipList ProjectClipList {
- get { return projectClipList; }
- }
-
- public MediaItemList ProjectMediaItemList {
- get { return projectMediaItemList; }
- }
-
- public Commander ProjectCommander {
- get { return projectCommander; }
- }
-
- public Gdv.Pipeline ProjectPipeline {
- get { return projectPipeline; }
- }
-
- public Gdv.ProjectFormat ProjectFormat {
- get { return projectFormat; }
- }
-
- // Public methods /////////////////////////////////////////////
-
- /* CONSTRUCTOR */
- 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 ()
- {
- objectToId = new Dictionary <object, int> ();
- idToObject = new Dictionary <int, object> ();
-
- xmlDocument = null;
- //projectInfoNode = null;
-
- currentStep = OpenerTaskStep.Init;
-
- base.Reset ();
- }
-
- public int GetIdForObject (object o)
- {
- return objectToId [o];
- }
-
- public object GetObjectForId (int id)
- {
- return idToObject [id];
- }
-
- public bool Contains (int id)
- {
- return idToObject.ContainsKey (id);
- }
-
- // Private methods ////////////////////////////////////////////
-
- protected override TaskStatus ExecuteStep (int s)
- {
- bool cont = true;
-
- // Main
- switch (currentStep) {
-
- case OpenerTaskStep.Init:
- objectsList = new List <ObjectInfo> ();
- xmlDocument = new XmlDocument ();
- xmlDocument.Load (fileName);
- currentStep = OpenerTaskStep.Header;
- break;
-
- case OpenerTaskStep.Header:
- //ReadHeader ();
- currentStep = OpenerTaskStep.ProjectInfoRead;
- break;
-
- case OpenerTaskStep.ProjectInfoRead:
- foreach (XmlNode node in xmlDocument.DocumentElement.ChildNodes)
- if (node.Name == "projectinfo")
- ResolveProjectInfoNode (node);
-
- // FIXME: Fail if not found/not resolved
- currentStep = OpenerTaskStep.ObjectListRead;
- break;
-
- case OpenerTaskStep.ObjectListRead:
- foreach (XmlNode node in xmlDocument.DocumentElement.ChildNodes)
- if (node.Name == "objectlist")
- objectListContainer = (ObjectListContainer)
- DataFactory.MakeDataElement (node as XmlElement);
-
- if (objectListContainer == null)
- throw new Exception ("ObjectListContainer not found!");
-
- currentStep = OpenerTaskStep.ObjectListParse;
- break;
-
- case OpenerTaskStep.ObjectListParse:
- bool flush = EnumerateSomeObjects ();
- if (flush)
- currentStep = OpenerTaskStep.ObjectListUnBoil;
- break;
-
- case OpenerTaskStep.ObjectListUnBoil:
- bool done = UnBoilSomeObjects ();
- if (done)
- currentStep = OpenerTaskStep.FindRoots;
- break;
-
-
- case OpenerTaskStep.FindRoots:
- projectTrackList = (TrackList) FindRoot ("tracklist");
- projectTagList = (TagList) FindRoot ("taglist");
- projectStuffList = (StuffList) FindRoot ("stufflist");
- projectClipList = (ClipList) FindRoot ("cliplist");
- projectMediaItemList = (MediaItemList) FindRoot ("mediaitemlist");
- projectPipeline = (Gdv.Pipeline) FindRoot ("pipeline");
- projectCommander = (Commander) FindRoot ("commander");
- projectFormat = (Gdv.ProjectFormat) FindRoot ("projectformat");
-
- currentStep = OpenerTaskStep.Finished;
- break;
-
- case OpenerTaskStep.Finished:
- cont = false;
- break;
-
- default:
- break;
- }
-
- // Post
- if (cont)
- return TaskStatus.Running;
- else
- return TaskStatus.Done;
- }
-
- /*
- void ReadHeader ()
- {
- // FIXME: Read all the attributes from the <divaproject> element
- }*/
-
- void ResolveProjectInfoNode (XmlNode node)
- {
- foreach (XmlNode childNode in node) {
-
- switch (childNode.Name) {
-
- case "name":
- projectName = childNode.FirstChild.Value;
- break;
-
- case "directory":
- projectDirectory = childNode.FirstChild.Value;
- break;
-
- // FIXME: Duration etc.
- }
- }
- }
-
- bool EnumerateSomeObjects ()
- {
- if (objectsEnumerator == null)
- objectsEnumerator = objectListContainer.FindAllObjects ().GetEnumerator ();
-
- for (int i = 0; i < 10; i++) {
- if (objectsEnumerator.MoveNext () == false)
- return true;
-
- ObjectContainer container = (ObjectContainer)
- objectsEnumerator.Current;
-
- ObjectInfo newInfo = new ObjectInfo (container);
- objectsList.Add (newInfo);
- }
-
- return false;
- }
-
- ObjectInfo GetNextCandidate ()
- {
- foreach (ObjectInfo objInfo in objectsList)
- if (objInfo.IsUnBoilable (this))
- return objInfo;
-
- throw new Exception ("FIXME: No more unboilable objects found. Recursive?");
- }
-
- bool UnBoilSomeObjects ()
- {
- for (int i = 0; i < 5; i++) {
- // All unboiled
- if (objectsList.Count == 0)
- return true;
-
- ObjectInfo objInfo = GetNextCandidate ();
-
- object o = BoilFactory.UnBoil (objInfo.Container, this);
- objectsList.Remove (objInfo);
-
- // Add
- idToObject [objInfo.RefId] = o;
- objectToId [o] = objInfo.RefId;
-
- }
-
- return false;
- }
-
- object FindRoot (string rootString)
- {
- ObjectContainer container = objectListContainer.FindObjectContainer (rootString);
- return idToObject [container.RefId];
- }
-
- }
-
-}
diff --git a/tests/examplefiles/test.csd b/tests/examplefiles/test.csd
deleted file mode 100644
index 6512d99e..00000000
--- a/tests/examplefiles/test.csd
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * comment
- */
-; comment
-// comment
-/
-<CsoundSynthesizer>
-<CsInstruments>
-0dbfs = 1
-prints "hello, world\n"
-</CsInstruments>
-<CsScore>
-i 1 0 0
-</CsScore>
-<html>
-<!DOCTYPE html>
-</html>
-</CsoundSynthesizer>
diff --git a/tests/examplefiles/test.css b/tests/examplefiles/test.css
deleted file mode 100644
index 3f9ffb20..00000000
--- a/tests/examplefiles/test.css
+++ /dev/null
@@ -1,54 +0,0 @@
-body {
- font-size: 12pt;
- background: #fff url(temp.png) top left no-repeat;
-}
-
-* html body {
- font-size: 14pt;
-}
-
-#nav .new {
- display: block;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- -ms-border-radius: 5px;
- -o-border-radius: 5px;
- border-radius: 5px;
-}
-
-ul#nav li.new {
- font-weight: bold;
-}
-
-:link {
- color: #f00;
-}
-
-:link:hover {
- color: #0f0;
-}
-
-@media screen {
- body {
- background: #ccc;
- }
-}
-
-@namespace "http://www.w3.org/1999/xhtml";
-
-@import url("mystyle.css");
-
-@charset "ISO-8859-1";
-
-@font-face { font-family: "Example Font"; src: url("http://www.example.com/fonts/example"); }
-
-@media screen { body { font-size: 16px } } @media print { body { font-size: 12pt } }
-
-
-@page { body { margin: 1in 1.5in; } }
-
-@page linke-seite:left { body { margin:20mm; margin-right:25mm; } }
-
-@-moz-document url-prefix(http://pygments.org) { a {font-style: normal !important;} }
-
-
diff --git a/tests/examplefiles/test.cu b/tests/examplefiles/test.cu
deleted file mode 100644
index 19f66802..00000000
--- a/tests/examplefiles/test.cu
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <stdio.h>
-
-// __device__ function
-__device__ void func()
-{
- short* array0 = (short*)array;
- float* array1 = (float*)&array0[127];
-}
-
-/* __global__ function */
-__global__ static void reduction(const float* __restrict__ input, float *output, clock_t *timer)
-{
- // __shared__ float shared[2 * blockDim.x];
- extern __shared__ float shared[];
-
- const int tid = threadIdx.x;
- const int bid = blockIdx.x;
-
- if (threadIdx.x == 0) {
- __threadfence();
- }
-
- // Perform reduction to find minimum.
- for (int d = blockDim.x; d > 0; d /= 2)
- {
- __syncthreads();
- }
-}
-
-int main(int argc, char **argv)
-{
- dim3 dimBlock(8, 8, 1);
-
- timedReduction<<<dimBlock, 256, 256, 0>>>(dinput, doutput, dtimer);
- cudaDeviceReset();
-}
diff --git a/tests/examplefiles/test.cyp b/tests/examplefiles/test.cyp
deleted file mode 100644
index 37465a4d..00000000
--- a/tests/examplefiles/test.cyp
+++ /dev/null
@@ -1,123 +0,0 @@
-//test comment
-START a = node(*)
-MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
-RETURN a.name, m.title, d.name;
-
-START a = node(*)
-MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
-WITH d,m,count(a) as Actors
-WHERE Actors > 4
-RETURN d.name as Director,m.title as Movie, Actors ORDER BY Actors;
-
-START a=node(*)
-MATCH p=(a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
-return p;
-
-START a = node(*)
-MATCH p1=(a)-[:ACTED_IN]->(m), p2=d-[:DIRECTED]->(m)
-WHERE m.title="The Matrix"
-RETURN p1, p2;
-
-START a = node(*)
-MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
-WHERE a=d
-RETURN a.name;
-
-START a = node(*)
-MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
-WHERE a=d
-RETURN a.name;
-
-START a=node(*)
-MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
-RETURN a.name, d.name, count(*) as Movies,collect(m.title) as Titles
-ORDER BY (Movies) DESC
-LIMIT 5;
-
-START keanu=node:node_auto_index(name="Keanu Reeves")
-RETURN keanu;
-
-START keanu=node:node_auto_index(name="Keanu Reeves")
-MATCH (keanu)-[:ACTED_IN]->(movie)
-RETURN movie.title;
-
-START keanu=node:node_auto_index(name="Keanu Reeves")
-MATCH (keanu)-[r:ACTED_IN]->(movie)
-WHERE "Neo" in r.roles
-RETURN DISTINCT movie.title;
-
-START keanu=node:node_auto_index(name="Keanu Reeves")
-MATCH (keanu)-[:ACTED_IN]->()<-[:DIRECTED]-(director)
-RETURN director.name;
-
-START keanu=node:node_auto_index(name="Keanu Reeves")
-MATCH (keanu)-[:ACTED_IN]->(movie)<-[:ACTED_IN]-(n)
-WHERE n.born < keanu.born
-RETURN DISTINCT n.name, keanu.born ,n.born;
-
-START keanu=node:node_auto_index(name="Keanu Reeves"),
- hugo=node:node_auto_index(name="Hugo Weaving")
-MATCH (keanu)-[:ACTED_IN]->(movie)
-WHERE NOT((hugo)-[:ACTED_IN]->(movie))
-RETURN DISTINCT movie.title;
-
-START a = node(*)
-MATCH (a)-[:ACTED_IN]->(m)
-WITH a,count(m) as Movies
-RETURN a.name as Actor, Movies ORDER BY Movies;
-
-START keanu=node:node_auto_index(name="Keanu Reeves"),actor
-MATCH past=(keanu)-[:ACTED_IN]->()<-[:ACTED_IN]-(),
- actors=(actor)-[:ACTED_IN]->()
-WHERE hasnt=actors NOT IN past
-RETURN hasnt;
-
-START keanu=node:node_auto_index(name="Keanu Reeves")
-MATCH (keanu)-[:ACTED_IN]->()<-[:ACTED_IN]-(c),
- (c)-[:ACTED_IN]->()<-[:ACTED_IN]-(coc)
-WHERE NOT((keanu)-[:ACTED_IN]->()<-[:ACTED_IN]-(coc))
-AND coc > keanu
-RETURN coc.name, count(coc)
-ORDER BY count(coc) DESC
-LIMIT 3;
-
-START kevin=node:node_auto_index(name="Kevin Bacon"),
- movie=node:node_auto_index(name="Mystic River")
-MATCH (kevin)-[:ACTED_IN]->(movie)
-RETURN DISTINCT movie.title;
-
-CREATE (n
- {
- title:"Mystic River",
- released:1993,
- tagline:"We bury our sins here, Dave. We wash them clean."
- }
- ) RETURN n;
-
-
-START movie=node:node_auto_index(title="Mystic River")
-SET movie.released = 2003
-RETURN movie;
-
-start emil=node:node_auto_index(name="Emil Eifrem") MATCH emil-[r]->(n) DELETE r, emil;
-
-START a=node(*)
-MATCH (a)-[:ACTED_IN]->()<-[:ACTED_IN]-(b)
-CREATE UNIQUE (a)-[:KNOWS]->(b);
-
-START keanu=node:node_auto_index(name="Keanu Reeves")
-MATCH (keanu)-[:KNOWS*2]->(fof)
-WHERE keanu <> fof
-RETURN distinct fof.name;
-
-START charlize=node:node_auto_index(name="Charlize Theron"),
- bacon=node:node_auto_index(name="Kevin Bacon")
-MATCH p=shortestPath((charlize)-[:KNOWS*]->(bacon))
-RETURN extract(n in nodes(p) | n.name)[1];
-
-START actors=node:
-
-MATCH (alice)-[:`REALLY LIKES`]->(bob)
-MATCH (alice)-[:`REALLY ``LIKES```]->(bob)
-myFancyIdentifier.`(weird property name)`
-"string\t\n\b\f\\\''\""
diff --git a/tests/examplefiles/test.d b/tests/examplefiles/test.d
deleted file mode 100644
index 02fe8f73..00000000
--- a/tests/examplefiles/test.d
+++ /dev/null
@@ -1,135 +0,0 @@
-// Created by Lionello Lunesu and placed in the public domain.
-// This file has been modified from its original version.
-// It has been formatted to fit your screen.
-module phoneno; // optional
-import std.stdio; // writefln
-import std.ctype; // isdigit
-import std.stream; // BufferedFile
-
-// Just for readability (imagine char[][][char[]])
-alias char[] string;
-alias string[] stringarray;
-
-/// Strips non-digit characters from the string (COW)
-string stripNonDigit( in string line )
-{
- string ret;
- foreach(uint i, c; line) {
- // Error: std.ctype.isdigit at C:\dmd\src\phobos\std\ctype.d(37)
- // conflicts with std.stream.isdigit at C:\dmd\src\phobos\std\stream.d(2924)
- if (!std.ctype.isdigit(c)) {
- if (!ret)
- ret = line[0..i];
- }
- else if (ret)
- ret ~= c;
- }
- return ret?ret:line;
-}
-
-unittest {
- assert( stripNonDigit("asdf") == "" );
- assert( stripNonDigit("\'13-=2 4kop") == "1324" );
-}
-
-/// Converts a word into a number, ignoring all non alpha characters
-string wordToNum( in string word )
-{
-// translation table for the task at hand
-const char[256] TRANSLATE =
- " " // 0
- " 0123456789 " // 32
- " 57630499617851881234762239 " // 64
- " 57630499617851881234762239 "
- " "
- " "
- " "
- " ";
- string ret;
- foreach(c; cast(ubyte[])word)
- if (TRANSLATE[c] != ' ')
- ret ~= TRANSLATE[c];
- return ret;
-}
-
-unittest {
- // Test wordToNum using the table from the task description.
- assert( "01112223334455666777888999" ==
- wordToNum("E | J N Q | R W X | D S Y | F T | A M | C I V | B K U | L O P | G H Z"));
- assert( "01112223334455666777888999" ==
- wordToNum("e | j n q | r w x | d s y | f t | a m | c i v | b k u | l o p | g h z"));
- assert( "0123456789" ==
- wordToNum("0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9"));
-}
-
-void main( string[] args )
-{
- // This associative array maps a number to an array of words.
- stringarray[string] num2words;
-
- foreach(string word; new BufferedFile("dictionary.txt" ) )
- num2words[ wordToNum(word) ] ~= word.dup; // must dup
-
- /// Finds all alternatives for the given number
- /// (should have been stripped from non-digit characters)
- stringarray _FindWords( string numbers, bool digitok )
- in {
- assert(numbers.length > 0);
- }
- out(result) {
- foreach (a; result)
- assert( wordToNum(a) == numbers );
- }
- body {
- stringarray ret;
- bool foundword = false;
- for (uint t=1; t<=numbers.length; ++t) {
- auto alternatives = numbers[0..t] in num2words;
- if (!alternatives)
- continue;
- foundword = true;
- if (numbers.length > t) {
- // Combine all current alternatives with all alternatives
- // of the rest (next piece can start with a digit)
- foreach (a2; _FindWords( numbers[t..$], true ) )
- foreach(a1; *alternatives)
- ret ~= a1 ~ " " ~ a2;
- }
- else
- ret ~= *alternatives; // append these alternatives
- }
- // Try to keep 1 digit, only if we're allowed and no other
- // alternatives were found
- // Testing "ret.length" makes more sense than testing "foundword",
- // but the other implementations seem to do just this.
- if (digitok && !foundword) { //ret.length == 0
- if(numbers.length > 1) {
- // Combine 1 digit with all altenatives from the rest
- // (next piece can not start with a digit)
- foreach (a; _FindWords( numbers[1..$], false ) )
- ret ~= numbers[0..1] ~ " " ~ a;
- }
- else
- ret ~= numbers[0..1]; // just append this digit
- }
- return ret;
- }
-
- /// (This function was inlined in the original program)
- /// Finds all alternatives for the given phone number
- /// Returns: array of strings
- stringarray FindWords( string phone_number )
- {
- if (!phone_number.length)
- return null;
- // Strip the non-digit characters from the phone number, and
- // pass it to the recursive function (leading digit is allowed)
- return _FindWords( stripNonDigit(phone_number), true );
- }
-
- // Read the phone numbers
- foreach(string phone; new BufferedFile("input.txt" ) )
- foreach(alternative; FindWords( phone ) )
- writefln(phone, ": ", alternative );
-}
-
diff --git a/tests/examplefiles/test.dart b/tests/examplefiles/test.dart
deleted file mode 100644
index aa1fb0ed..00000000
--- a/tests/examplefiles/test.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-// 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
deleted file mode 100644
index 639b411a..00000000
--- a/tests/examplefiles/test.dtd
+++ /dev/null
@@ -1,89 +0,0 @@
-<!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.ebnf b/tests/examplefiles/test.ebnf
deleted file mode 100644
index a96171b0..00000000
--- a/tests/examplefiles/test.ebnf
+++ /dev/null
@@ -1,31 +0,0 @@
-letter = "A" | "B" | "C" | "D" | "E" | "F" | "G"
- | "H" | "I" | "J" | "K" | "L" | "M" | "N"
- | "O" | "P" | "Q" | "R" | "S" | "T" | "U"
- | "V" | "W" | "X" | "Y" | "Z" ;
-digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
-symbol = "[" | "]" | "{" | "}" | "(" | ")" | "<" | ">"
- | "'" | '"' | "=" | "|" | "." | "," | ";" ;
-character = letter | digit | symbol | " " ;
-
-identifier = letter , { letter | digit | " " } ;
-terminal = "'" , character , { character } , "'"
- | '"' , character , { character } , '"' ;
-
-special = "?" , any , "?" ;
-
-comment = (* this is a comment "" *) "(*" , any-symbol , "*)" ;
-any-symbol = ? any visible character ? ; (* ? ... ? *)
-
-lhs = identifier ;
-rhs = identifier
- | terminal
- | comment , rhs
- | rhs , comment
- | "[" , rhs , "]"
- | "{" , rhs , "}"
- | "(" , rhs , ")"
- | rhs , "|" , rhs
- | rhs , "," , rhs ;
-
-rule = lhs , "=" , rhs , ";" | comment ;
-grammar = { rule } ;
diff --git a/tests/examplefiles/test.ec b/tests/examplefiles/test.ec
deleted file mode 100644
index 37868b52..00000000
--- a/tests/examplefiles/test.ec
+++ /dev/null
@@ -1,605 +0,0 @@
-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.eh b/tests/examplefiles/test.eh
deleted file mode 100644
index 1ed173fb..00000000
--- a/tests/examplefiles/test.eh
+++ /dev/null
@@ -1,315 +0,0 @@
-/* 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.erl b/tests/examplefiles/test.erl
deleted file mode 100644
index d4ab4825..00000000
--- a/tests/examplefiles/test.erl
+++ /dev/null
@@ -1,181 +0,0 @@
--module(test).
--export([listen/1,
- handle_client/1,
- maintain_clients/1,
- start/1,
- stop/0,
- controller/1]).
-
--author("jerith").
-
--define(TCP_OPTIONS,[list, {packet, 0}, {active, false}, {reuseaddr, true}]).
-
--record(player, {name=none, socket, mode}).
-
-%% To allow incoming connections, we need to listen on a TCP port.
-%% This is also the entry point for our server as a whole, so it
-%% starts the client_manager process and gives it a name so the rest
-%% of the code can get to it easily.
-
-listen(Port) ->
- {ok, LSocket} = gen_tcp:listen(Port, ?TCP_OPTIONS),
- register(client_manager, spawn(?MODULE, maintain_clients, [[]])),
- do_accept(LSocket).
-
-%% Accepting a connection gives us a connection socket with the
-%% newly-connected client on the other end. Since we want to accept
-%% more than one client, we spawn a new process for each and then wait
-%% for another connection on our listening socket.
-
-do_accept(LSocket) ->
- case gen_tcp:accept(LSocket) of
- {ok, Socket} ->
- spawn(?MODULE, handle_client, [Socket]),
- client_manager ! {connect, Socket};
- {error, Reason} ->
- io:format("Socket accept error: ~s~n", [Reason])
- end,
- do_accept(LSocket).
-
-%% All the client-socket process needs to do is wait for data and
-%% forward it to the client_manager process which decides what to do
-%% with it. If the client disconnects, we let client_manager know and
-%% then quietly go away.
-
-handle_client(Socket) ->
- case gen_tcp:recv(Socket, 0) of
- {ok, Data} ->
- client_manager ! {data, Socket, Data},
- handle_client(Socket);
- {error, closed} ->
- client_manager ! {disconnect, Socket}
- end.
-
-%% This is the main loop of the client_manager process. It maintains
-%% the list of "players" and calls the handler for client input.
-
-maintain_clients(Players) ->
- io:format("Players:~n", []),
- lists:foreach(fun(P) -> io:format(">>> ~w~n", [P]) end, Players),
- receive
- {connect, Socket} ->
- Player = #player{socket=Socket, mode=connect},
- send_prompt(Player),
- io:format("client connected: ~w~n", [Player]),
- NewPlayers = [Player | Players];
- {disconnect, Socket} ->
- Player = find_player(Socket, Players),
- io:format("client disconnected: ~w~n", [Player]),
- NewPlayers = lists:delete(Player, Players);
- {data, Socket, Data} ->
- Player = find_player(Socket, Players),
- NewPlayers = parse_data(Player, Players, Data),
- NewPlayer = find_player(Socket, NewPlayers),
- send_prompt(NewPlayer)
- end,
- maintain_clients(NewPlayers).
-
-%% find_player is a utility function to get a player record associated
-%% with a particular socket out of the player list.
-
-find_player(Socket, Players) ->
- {value, Player} = lists:keysearch(Socket, #player.socket, Players),
- Player.
-
-%% delete_player returns the player list without the given player. It
-%% deletes the player from the list based on the socket rather than
-%% the whole record because the list might hold a different version.
-
-delete_player(Player, Players) ->
- lists:keydelete(Player#player.socket, #player.socket, Players).
-
-%% Sends an appropriate prompt to the player. Currently the only
-%% prompt we send is the initial "Name: " when the player connects.
-
-send_prompt(Player) ->
- case Player#player.mode of
- connect ->
- gen_tcp:send(Player#player.socket, "Name: ");
- active ->
- ok
- end.
-
-%% Sends the given data to all players in active mode.
-
-send_to_active(Prefix, Players, Data) ->
- ActivePlayers = lists:filter(fun(P) -> P#player.mode == active end,
- Players),
- lists:foreach(fun(P) -> gen_tcp:send(P#player.socket, Prefix ++ Data) end,
- ActivePlayers),
- ok.
-
-%% We don't really do much parsing, but that will probably change as
-%% more features are added. Currently this handles naming the player
-%% when he first connects and treats everything else as a message to
-%% send.
-
-parse_data(Player, Players, Data) ->
- case Player#player.mode of
- active ->
- send_to_active(Player#player.name ++ ": ",
- delete_player(Player, Players), Data),
- Players;
- connect ->
- UPlayer = Player#player{name=bogostrip(Data), mode=active},
- [UPlayer | delete_player(Player, Players)]
- end.
-
-%% Utility methods to clean up the name before we apply it. Called
-%% bogostrip rather than strip because it returns the first continuous
-%% block of non-matching characters rather stripping matching
-%% characters off the front and back.
-
-bogostrip(String) ->
- bogostrip(String, "\r\n\t ").
-
-bogostrip(String, Chars) ->
- LStripped = string:substr(String, string:span(String, Chars)+1),
- string:substr(LStripped, 1, string:cspan(LStripped, Chars)).
-
-%% Here we have some extra code to test other bits of pygments' Erlang
-%% lexer.
-
-get_timestamp() ->
- {{Year,Month,Day},{Hour,Min,Sec}} = erlang:universaltime(),
- lists:flatten(io_lib:format(
- "~4.10.0B-~2.10.0B-~2.10.0BT~2.10.0B:~2.10.0B:~2.10.0BZ",
- [Year, Month, Day, Hour, Min, Sec])).
-
-a_binary() ->
- << 100:16/integer, 16#7f >>.
-
-a_list_comprehension() ->
- [X*2 || X <- [1,2,3]].
-
-a_map() ->
- M0 = #{ a => 1, b => 2 },
- M1 = M0#{ b := 200 }.
-
-escape_sequences() ->
- [ "\b\d\e\f\n\r\s\t\v\'\"\\"
- , "\1\12\123" % octal
- , "\x01" % short hex
- , "\x{fff}" % long hex
- , "\^a\^A" % control characters
- ].
-
-map(Fun, [H|T]) ->
- [Fun(H) | map(Fun, T)];
-
-map(Fun, []) ->
- [].
-
-%% pmap, just because it's cool.
-
-pmap(F, L) ->
- Parent = self(),
- [receive {Pid, Result} ->
- Result
- end || Pid <- [spawn(fun() ->
- Parent ! {self(), F(X)}
- end) || X <- L]].
diff --git a/tests/examplefiles/test.escript b/tests/examplefiles/test.escript
deleted file mode 100644
index 3fafb803..00000000
--- a/tests/examplefiles/test.escript
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env escript
-
-main(_Args) ->
- ok.
diff --git a/tests/examplefiles/test.evoque b/tests/examplefiles/test.evoque
deleted file mode 100644
index 5a98d3bb..00000000
--- a/tests/examplefiles/test.evoque
+++ /dev/null
@@ -1,33 +0,0 @@
-$overlay{name=site_base}
-
-$begin{table_row}
- $for{ col in row }
- <td>${col}</td>\
- $else
- <td class="empty" colspan="7">empty row</td>
- $rof
-$end{table_row}
-
-<table>
- $for{ i, row in enumerate(rows) }
- <tr$if{i%2} class="odd"$fi> #[ "odd" rows get a special style ]#
- $evoque{#table_row}
- $evoque{
- #table_row
- }
- $evoque{'#table_row'}
- $evoque{ '#table_row', collection=None, quoting="str"}
- $evoque{name="#table_row"}
- $evoque{name=var_table_row}
- $evoque{%#table_row%}
- $evoque{% #table_row %}
- </tr>
- $rof
-</table>
-
-$evoque{disclaimer, collection="legals"}
-$evoque{ disclaimer , collection="legals", abc=123}
-$evoque{% disclaimer, collection="legals"%}
-
-$test{% site_base="site.html",
- rows=[("a", "b", 3.0, {"one":1}, "<escape-me/>", "i", "j")] %}
diff --git a/tests/examplefiles/test.fan b/tests/examplefiles/test.fan
deleted file mode 100755
index 00e80b60..00000000
--- a/tests/examplefiles/test.fan
+++ /dev/null
@@ -1,818 +0,0 @@
-//
-// 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.flx b/tests/examplefiles/test.flx
deleted file mode 100644
index 4c8a667b..00000000
--- a/tests/examplefiles/test.flx
+++ /dev/null
@@ -1,57 +0,0 @@
-type tiny = "%i8";
-type int = "%i32";
-typedef bool = 2;
-fun add : int*int -> int = "%add";
-fun sub : int*int -> int = "%sub";
-fun eq : int*int -> bool = "%eq";
-fun lnot : bool -> bool = "%lnot";
-proc exit : int = "exit";
-
-// comment 1
-/*
- /*
- foo bar
- */
-asdas
-*/
-
-noinline fun foo (x:int) = {
- val y = 6;
- return x + y;
-}
-
-noinline proc fake_exit (x:int) {
- exit x;
- return;
-}
-
-noinline fun bar (x:int) = {
- var y = 10;
- noinline proc baz () {
- y = 20;
- return;
- }
- baz ();
- return x + y;
-}
-
-noinline fun x (a:int, b:int, c:tiny) = {
- val x1 = a;
- val x2 = b;
- val x3 = c;
- noinline fun y (d:int, e:int, f:tiny) = {
- val y1 = x1;
- val y2 = x2;
- val y3 = f;
- noinline fun z (g:int, h:int, i:tiny) = {
- val z1 = x1;
- val z2 = x2;
- val z3 = i;
- return z1;
- }
- return z (y1,y2,y3);
- }
- return y (x1,x2,x3);
-}
-
-fake_exit $ (foo 2) + (bar 3) + (x (1,2,3t));
diff --git a/tests/examplefiles/test.gdc b/tests/examplefiles/test.gdc
deleted file mode 100644
index c7e36b81..00000000
--- a/tests/examplefiles/test.gdc
+++ /dev/null
@@ -1,13 +0,0 @@
-# Execute the date dimension MAQL script
-ExecuteMaql(maqlFile="examples/quotes/quote_date.maql");
-
-# load the stock quotes data file
-# the data file config has been generated
-LoadCsv(csvDataFile="examples/quotes/quotes.csv",
- header="true",
- configFile="examples/quotes/quotes.config.xml");
-
-# transfer the stock quotes data
-TransferLastSnapshot();
-
-LoadGoogleAnalytics(configFile="examples/ga/ga.config.xml",username="example@gmail.com",password="******",profileId="ga:7468896",dimensions="ga:date|ga:browser|ga:browserVersion|ga:country|ga:isMobile",metrics="ga:bounces|ga:newVisits|ga:pageViews|ga:visits",startDate="2008-01-01",endDate="2010-06-15");
diff --git a/tests/examplefiles/test.gradle b/tests/examplefiles/test.gradle
deleted file mode 100644
index 0bc834c1..00000000
--- a/tests/examplefiles/test.gradle
+++ /dev/null
@@ -1,20 +0,0 @@
-apply plugin: 'java'
-
-repositories {
- mavenCentral()
-}
-
-dependencies {
- testCompile 'junit:junit:4.12'
-}
-
-task sayHello << {
- def x = SomeClass.worldString
- println "Hello ${x}"
-}
-
-private class SomeClass {
- public static String getWorldString() {
- return "world"
- }
-}
diff --git a/tests/examplefiles/test.groovy b/tests/examplefiles/test.groovy
deleted file mode 100644
index 903863d2..00000000
--- a/tests/examplefiles/test.groovy
+++ /dev/null
@@ -1,97 +0,0 @@
-// 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.hsail b/tests/examplefiles/test.hsail
deleted file mode 100644
index f9c25091..00000000
--- a/tests/examplefiles/test.hsail
+++ /dev/null
@@ -1,62 +0,0 @@
-module &__llvm_hsail_module:1:0:$full:$large:$near;
-
-prog kernel &mmul2d(
- kernarg_u64 %__arg_p0,
- kernarg_u64 %__arg_p1,
- kernarg_u64 %__arg_p2,
- kernarg_u64 %__arg_p3)
-{
- pragma "AMD RTI", "ARGSTART:mmul2d";
- pragma "AMD RTI", "version:3:1:104";
- pragma "AMD RTI", "device:generic";
- pragma "AMD RTI", "uniqueid:1025";
- pragma "AMD RTI", "function:1:0";
- pragma "AMD RTI", "memory:64bitABI";
- pragma "AMD RTI", "privateid:1";
- pragma "AMD RTI", "ARGEND:mmul2d";
- // BB#0: // %top
- mov_f64 $d1, 0.0E+0;
- gridsize_u32 $s0, 0;
- workitemabsid_u32 $s1, 1;
- workitemabsid_u32 $s2, 0;
- cvt_u64_u32 $d0, $s2;
- cvt_u64_u32 $d3, $s1;
- cvt_u64_u32 $d4, $s0;
- ld_kernarg_align(8)_width(all)_u64 $d2, [%__arg_p2];
- ld_kernarg_align(8)_width(all)_u64 $d6, [%__arg_p1];
- ld_kernarg_align(8)_width(all)_u64 $d5, [%__arg_p3];
- ld_kernarg_align(8)_width(all)_u64 $d7, [%__arg_p0];
- cmp_lt_b1_s64 $c0, $d5, 1;
- cbr_b1 $c0, @BB0_3;
- // BB#1: // %L.preheader
- mul_u64 $d1, $d5, $d3;
- shl_u64 $d1, $d1, 3;
- shl_u64 $d8, $d0, 3;
- add_u64 $d8, $d7, $d8;
- add_u64 $d6, $d6, $d1;
- shl_u64 $d7, $d4, 3;
- mov_f64 $d1, 0D0000000000000000;
-
-@BB0_2:
- // %L
- add_u64 $d9, $d8, $d7;
- ld_global_f64 $d8, [$d8];
- ld_global_f64 $d10, [$d6];
- mul_f64 $d8, $d8, $d10;
- add_f64 $d1, $d1, $d8;
- add_u64 $d6, $d6, 8;
- add_u64 $d5, $d5, 18446744073709551615;
- cmp_ne_b1_s64 $c0, $d5, 0;
- mov_b64 $d8, $d9;
- cbr_b1 $c0, @BB0_2;
-
-@BB0_3:
- // %L.7
- mul_u64 $d3, $d3, $d4;
- add_u64 $d0, $d3, $d0;
- shl_u64 $d0, $d0, 3;
- add_u64 $d0, $d2, $d0;
- st_global_f64 $d1, [$d0];
- ret;
-};
-
diff --git a/tests/examplefiles/test.html b/tests/examplefiles/test.html
deleted file mode 100644
index b22f0c61..00000000
--- a/tests/examplefiles/test.html
+++ /dev/null
@@ -1,339 +0,0 @@
-<html>
-<head>
-<script>
- function initCodeBlock(id); {
- var el = document.getElementById(id);
- }
-</script>
-<style>
-.syntax { border: 1px solid #d0d0d0; background-color: #f0f0f0;
- margin-left: 10px; margin-right: 10px; }
-
-.syntaxheader { margin-top: 15px; margin-bottom: 0px;
- text-align: right; font-size: 11px;
- border-bottom: 0; padding: 3px; }
-
-.linenos { float: left; display: block; }
-.linenos pre { padding-right: 7px; padding-left: 7px;
- color: #666; }
-
-pre.syntax { padding: 5px; margin-top: 0px; }
-
-.syntax .cm { color: #60a0b0; font-style: italic; } /* comments */
-.syntax .cm-proc { color: #007020; font-style: normal; } /* preproc */
-.syntax .kw { color: #007020; font-weight: bold; } /* keywords */
-.syntax .kw-pseudo { font-weight: normal; } /* pseudo keywords */
-.syntax .op { color: #666666; } /* operators */
-.syntax .op-word { color: #007020; font-weight: bold; } /* word operators */
-.syntax .bn { color: #007020; } /* builtins */
-.syntax .fun { color: #06287e; } /* func name */
-.syntax .cls { color: #0e84b5; font-weight: bold; } /* class names */
-.syntax .exc { color: #007020; } /* exceptions */
-.syntax .var { color: #bb60d5; } /* variables */
-.syntax .const { color: #60add5; } /* constants */
-.syntax .entity { color: #d55537; font-weight: bold; } /* entities */
-.syntax .attr { color: #4070a0; } /* attributes */
-.syntax .tag { color: #062873; font-weight: bold; } /* tag names */
-.syntax .deco { color: #555555; font-weight: bold; } /* decorators */
-.syntax .st { color: #4070a0; } /* strings */
-.syntax .st-int { color: #70a0d0; font-style: italic; } /* interpolated str */
-.syntax .st-esc { color: #4070a0; font-weight: bold; } /* escaped str */
-.syntax .st-re { color: #235388; } /* regular expr */
-.syntax .st-sym { color: #517918; } /* symbols */
-.syntax .st-oth { color: #c65d09; } /* other strings */
-.syntax .nb { color: #40a070; } /* numbers */
-
-.syntax .gen-hd { font-weight: bold; color: blue; } /* headings */
-.syntax .gen-sh { font-weight: bold; color: purple; } /* subheadings */
-.syntax .gen-del { color: red; } /* deleted text */
-.syntax .gen-ins { color: green; } /* inserted text */
-.syntax .gen-em { font-style: italic; } /* emphasized text */
-.syntax .gen-sr { font-weight: bold; } /* strong emph. text */
-
-.syntax .err { border: 1px solid red; } /* parser errors */
-</style>
-</head>
-<body>
-<pre id="code-block" class="syntax"><span class="cm"># -*- coding: utf-8 -*-</span>
-<span class="st st-db">&quot;&quot;&quot;</span><span class="st">
- pocoo.pkg.core.acl
- ~~~~~~~~~~~~~~~~~~
-
- Pocoo ACL System.
-
-</span><span class="st st-db">&quot;&quot;&quot;</span>
-
-<span class="kw">from </span><span class="cls">pocoo.db</span><span class="kw"> import</span> <span class="name">meta</span>
-
-<span class="kw">from </span><span class="cls">pocoo.pkg.core.forum</span><span class="kw"> import</span> <span class="name">Site</span>, <span class="name">Forum</span>, <span class="name">Thread</span>
-<span class="kw">from </span><span class="cls">pocoo.pkg.core.user</span><span class="kw"> import</span> <span class="name">User</span>, <span class="name">Group</span>
-
-<span class="kw">from </span><span class="cls">pocoo.pkg.core.db</span><span class="kw"> import</span> <span class="name">users</span>, <span class="name">groups</span>, <span class="name">group_members</span>, <span class="name">privileges</span>, \
- <span class="name">forums</span>, <span class="name">posts</span>, <span class="name">acl_mapping</span>, <span class="name">acl_subjects</span>, <span class="name">acl_objects</span>
-
-
-<span class="kw">class </span><span class="cls">AclManager</span>(<span class="bn">object</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">
- Manager object to manage ALCs.
- </span><span class="st st-db">&quot;&quot;&quot;</span>
- <span class="name">STRONG_NO</span> <span class="op">=</span> <span class="op">-</span><span class="nb nb-int">1</span>
-
- <span class="name">WEAK_NO</span> <span class="op">=</span> <span class="nb nb-int">0</span>
- <span class="name">WEAK_YES</span> <span class="op">=</span> <span class="nb nb-int">1</span>
- <span class="name">STRONG_YES</span> <span class="op">=</span> <span class="nb nb-int">2</span>
-
- <span class="kw">def </span><span class="fun">__init__</span>(<span class="bn bn-pseudo">self</span>, <span class="name">ctx</span>, <span class="name">subject</span>):
- <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span> <span class="op">=</span> <span class="name">ctx</span>
-
- <span class="bn bn-pseudo">self</span>.<span class="name">subject</span> <span class="op">=</span> <span class="name">subject</span>
- <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="name">subject</span>, <span class="name">User</span>):
- <span class="bn bn-pseudo">self</span>.<span class="name">_type</span> <span class="op">=</span> <span class="st st-sg">&#39;</span><span class="st">user</span><span class="st st-sg">&#39;</span>
-
- <span class="kw">elif</span> <span class="bn">isinstance</span>(<span class="name">subject</span>, <span class="name">Group</span>):
- <span class="bn bn-pseudo">self</span>.<span class="name">_type</span> <span class="op">=</span> <span class="st st-sg">&#39;</span><span class="st">group</span><span class="st st-sg">&#39;</span>
-
- <span class="kw">else</span>:
- <span class="kw">raise</span> <span class="exc">ValueError</span>(<span class="st st-sg">&#39;</span><span class="st">neither user or group specified</span><span class="st st-sg">&#39;</span>)
-
- <span class="kw">def </span><span class="fun">allow</span>(<span class="bn bn-pseudo">self</span>, <span class="name">privilege</span>, <span class="name">obj</span>, <span class="name">force</span><span class="op">=</span><span class="bn bn-pseudo">False</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">Allows the subject privilege on obj.</span><span class="st st-db">&quot;&quot;&quot;</span>
-
- <span class="kw">return</span> <span class="bn bn-pseudo">self</span>.<span class="name">_set</span>(<span class="name">privilege</span>, <span class="name">obj</span>, <span class="nb nb-int">1</span> <span class="op">+</span> <span class="bn">bool</span>(<span class="name">force</span>))
-
- <span class="kw">def </span><span class="fun">default</span>(<span class="bn bn-pseudo">self</span>, <span class="name">privilege</span>, <span class="name">obj</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">Sets the state for privilege on obj back to weak yes.</span><span class="st st-db">&quot;&quot;&quot;</span>
-
- <span class="kw">return</span> <span class="bn bn-pseudo">self</span>.<span class="name">_set</span>(<span class="name">privilege</span>, <span class="name">obj</span>, <span class="nb nb-int">0</span>)
-
- <span class="kw">def </span><span class="fun">deny</span>(<span class="bn bn-pseudo">self</span>, <span class="name">privilege</span>, <span class="name">obj</span>, <span class="name">force</span><span class="op">=</span><span class="bn bn-pseudo">False</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">Denies the subject privilege on obj.</span><span class="st st-db">&quot;&quot;&quot;</span>
-
- <span class="kw">return</span> <span class="bn bn-pseudo">self</span>.<span class="name">_set</span>(<span class="name">privilege</span>, <span class="name">obj</span>, <span class="op">-</span><span class="nb nb-int">1</span> <span class="op">-</span> <span class="bn">bool</span>(<span class="name">force</span>))
-
- <span class="kw">def </span><span class="fun">can_access</span>(<span class="bn bn-pseudo">self</span>, <span class="name">privilege</span>, <span class="name">obj</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">Checks if the current subject with the required privilege
- somehow. Either directly or when the subject is a user and
- one of its groups can access it.</span><span class="st st-db">&quot;&quot;&quot;</span>
-
- <span class="cm">#XXX: maybe this could be one big query instead of 4</span>
- <span class="cm">#XXX: this currently does not work correctly, therefore return True</span>
- <span class="kw">return</span> <span class="bn bn-pseudo">True</span>
-
- <span class="kw">if</span> <span class="op op-word">not</span> <span class="bn">isinstance</span>(<span class="name">obj</span>, (<span class="name">Forum</span>, <span class="name">Thread</span>, <span class="name">Site</span>.<span class="name">__class__</span>)):
- <span class="kw">raise</span> <span class="exc">TypeError</span>(<span class="st st-sg">&#39;</span><span class="st">obj must be a forum, thread or site</span><span class="st st-sg">&#39;</span>)
- <span class="name">privilege</span> <span class="op">=</span> <span class="name">privilege</span>.<span class="name">upper</span>()
- <span class="name">s</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">_get_subject_join</span>().<span class="name">alias</span>(<span class="st st-sg">&#39;</span><span class="st">s</span><span class="st st-sg">&#39;</span>).<span class="name">c</span>
-
- <span class="kw">def </span><span class="fun">do_check</span>(<span class="name">obj</span>, <span class="name">tendency</span>):
- <span class="name">db</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">engine</span>
-
- <span class="name">o</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">_get_object_join</span>(<span class="name">obj</span>).<span class="name">alias</span>(<span class="st st-sg">&#39;</span><span class="st">o</span><span class="st st-sg">&#39;</span>).<span class="name">c</span>
-
- <span class="cm"># self check</span>
- <span class="name">r</span> <span class="op">=</span> <span class="name">db</span>.<span class="name">execute</span>(<span class="name">meta</span>.<span class="name">select</span>([<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">state</span>],
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">priv_id</span> <span class="op">==</span> <span class="name">privileges</span>.<span class="name">c</span>.<span class="name">priv_id</span>) <span class="op">&amp;</span>
-
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">subject_id</span> <span class="op">==</span> <span class="name">s</span>.<span class="name">subject_id</span>) <span class="op">&amp;</span>
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">object_id</span> <span class="op">==</span> <span class="name">o</span>.<span class="name">object_id</span>) <span class="op">&amp;</span>
-
- (<span class="name">privileges</span>.<span class="name">c</span>.<span class="name">name</span> <span class="op">==</span> <span class="name">privilege</span>)
- ))
- <span class="name">row</span> <span class="op">=</span> <span class="name">r</span>.<span class="name">fetchone</span>()
- <span class="kw">if</span> <span class="name">row</span> <span class="op op-word">is</span> <span class="op op-word">not</span> <span class="bn bn-pseudo">None</span>:
- <span class="kw">if</span> <span class="name">row</span>[<span class="st st-sg">&#39;</span><span class="st">state</span><span class="st st-sg">&#39;</span>] <span class="op op-word">in</span> (<span class="bn bn-pseudo">self</span>.<span class="name">STRONG_NO</span>, <span class="bn bn-pseudo">self</span>.<span class="name">STRONG_YES</span>):
- <span class="kw">return</span> <span class="name">row</span>[<span class="st st-sg">&#39;</span><span class="st">state</span><span class="st st-sg">&#39;</span>] <span class="op">==</span> <span class="bn bn-pseudo">self</span>.<span class="name">STRONG_YES</span>
-
- <span class="name">tendency</span> <span class="op">=</span> <span class="name">row</span>[<span class="st st-sg">&#39;</span><span class="st">state</span><span class="st st-sg">&#39;</span>]
-
- <span class="cm"># if the controlled subject is a user check all groups</span>
- <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="bn bn-pseudo">self</span>.<span class="name">subject</span>, <span class="name">User</span>):
- <span class="name">r</span> <span class="op">=</span> <span class="name">db</span>.<span class="name">execute</span>(<span class="name">meta</span>.<span class="name">select</span>([<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">state</span>],
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">object_id</span> <span class="op">==</span> <span class="name">o</span>.<span class="name">object_id</span>) <span class="op">&amp;</span>
-
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">subject_id</span> <span class="op">==</span> <span class="name">groups</span>.<span class="name">c</span>.<span class="name">subject_id</span>) <span class="op">&amp;</span>
-
- (<span class="name">groups</span>.<span class="name">c</span>.<span class="name">group_id</span> <span class="op">==</span> <span class="name">group_members</span>.<span class="name">c</span>.<span class="name">group_id</span>) <span class="op">&amp;</span>
-
- (<span class="name">group_members</span>.<span class="name">c</span>.<span class="name">user_id</span> <span class="op">==</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">user_id</span>)
- ))
- <span class="kw">while</span> <span class="bn bn-pseudo">True</span>:
- <span class="name">row</span> <span class="op">=</span> <span class="name">r</span>.<span class="name">fetchone</span>()
- <span class="kw">if</span> <span class="name">row</span> <span class="op op-word">is</span> <span class="bn bn-pseudo">None</span>:
- <span class="kw">break</span>
-
- <span class="name">state</span> <span class="op">=</span> <span class="name">row</span>[<span class="nb nb-int">0</span>]
- <span class="kw">if</span> <span class="name">state</span> <span class="op op-word">in</span> (<span class="bn bn-pseudo">self</span>.<span class="name">STRONG_YES</span>, <span class="bn bn-pseudo">self</span>.<span class="name">STRONG_NO</span>):
- <span class="kw">return</span> <span class="name">state</span> <span class="op">==</span> <span class="bn bn-pseudo">self</span>.<span class="name">STRONG_YES</span>
-
- <span class="kw">if</span> <span class="name">tendency</span> <span class="op op-word">is</span> <span class="bn bn-pseudo">None</span>:
- <span class="name">tendency</span> <span class="op">=</span> <span class="name">state</span>
- <span class="kw">elif</span> <span class="name">tendency</span> <span class="op">==</span> <span class="bn bn-pseudo">self</span>.<span class="name">WEAK_NO</span> <span class="op op-word">and</span> <span class="name">state</span> <span class="op">==</span> <span class="bn bn-pseudo">self</span>.<span class="name">WEAK_YES</span>:
- <span class="name">tendency</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">WEAK_YES</span>
-
- <span class="cm"># check related objects</span>
- <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="name">obj</span>, <span class="name">Thread</span>):
- <span class="kw">return</span> <span class="name">do_check</span>(<span class="name">obj</span>.<span class="name">forum</span>, <span class="name">tendency</span>)
- <span class="kw">elif</span> <span class="bn">isinstance</span>(<span class="name">obj</span>, <span class="name">Forum</span>):
- <span class="kw">return</span> <span class="name">do_check</span>(<span class="name">Site</span>, <span class="name">tendency</span>)
- <span class="kw">else</span>:
- <span class="kw">return</span> <span class="name">tendency</span>
-
- <span class="kw">return</span> <span class="name">do_check</span>(<span class="name">obj</span>, <span class="bn bn-pseudo">None</span>) <span class="op op-word">in</span> (<span class="bn bn-pseudo">self</span>.<span class="name">WEAK_YES</span>, <span class="bn bn-pseudo">self</span>.<span class="name">STRONG_YES</span>)
-
- <span class="kw">def </span><span class="fun">_set</span>(<span class="bn bn-pseudo">self</span>, <span class="name">privilege</span>, <span class="name">obj</span>, <span class="name">state</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">Helper functions for settings privileges.</span><span class="st st-db">&quot;&quot;&quot;</span>
-
- <span class="name">privilege</span> <span class="op">=</span> <span class="name">privilege</span>.<span class="name">upper</span>()
- <span class="kw">if</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">subject_id</span> <span class="op op-word">is</span> <span class="bn bn-pseudo">None</span>:
- <span class="bn bn-pseudo">self</span>.<span class="name">_bootstrap</span>()
- <span class="kw">if</span> <span class="name">obj</span>.<span class="name">object_id</span> <span class="op op-word">is</span> <span class="bn bn-pseudo">None</span>:
- <span class="bn bn-pseudo">self</span>.<span class="name">_bootstrap_object</span>(<span class="name">obj</span>)
- <span class="cm"># special state &quot;0&quot; which means delete</span>
-
- <span class="kw">if</span> <span class="op op-word">not</span> <span class="name">state</span>:
- <span class="name">p</span> <span class="op">=</span> <span class="name">meta</span>.<span class="name">select</span>([<span class="name">privileges</span>.<span class="name">c</span>.<span class="name">priv_id</span>], <span class="name">privileges</span>.<span class="name">c</span>.<span class="name">name</span> <span class="op">==</span> <span class="name">privilege</span>)
- <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">engine</span>.<span class="name">execute</span>(<span class="name">acl_mapping</span>.<span class="name">delete</span>(
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">priv_id</span> <span class="op">==</span> <span class="name">p</span>.<span class="name">c</span>.<span class="name">priv_id</span>) <span class="op">&amp;</span>
-
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">subject_id</span> <span class="op">==</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">subject_id</span>) <span class="op">&amp;</span>
-
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">object_id</span> <span class="op">==</span> <span class="name">obj</span>.<span class="name">object_id</span>)
- ))
- <span class="kw">return</span>
- <span class="cm"># touch privilege and check existing mapping</span>
-
- <span class="name">priv_id</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">_fetch_privilege</span>(<span class="name">privilege</span>)
- <span class="name">r</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">engine</span>.<span class="name">execute</span>(<span class="name">meta</span>.<span class="name">select</span>([<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">state</span>],
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">priv_id</span> <span class="op">==</span> <span class="name">priv_id</span>) <span class="op">&amp;</span>
-
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">subject_id</span> <span class="op">==</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">subject_id</span>) <span class="op">&amp;</span>
-
- (<span class="name">acl_mapping</span>.<span class="name">c</span>.<span class="name">object_id</span> <span class="op">==</span> <span class="name">obj</span>.<span class="name">object_id</span>)
- ))
- <span class="name">row</span> <span class="op">=</span> <span class="name">r</span>.<span class="name">fetchone</span>()
- <span class="kw">if</span> <span class="name">row</span> <span class="op op-word">is</span> <span class="op op-word">not</span> <span class="bn bn-pseudo">None</span>:
- <span class="cm"># this rule exists already</span>
-
- <span class="kw">if</span> <span class="name">row</span>[<span class="st st-sg">&#39;</span><span class="st">state</span><span class="st st-sg">&#39;</span>] <span class="op">==</span> <span class="name">state</span>:
- <span class="kw">return</span>
- <span class="cm"># goddamn, same rule - different state, delete old first</span>
- <span class="bn bn-pseudo">self</span>.<span class="name">_set</span>(<span class="name">privilege</span>, <span class="name">obj</span>, <span class="nb nb-int">0</span>)
- <span class="cm"># insert new rule</span>
-
- <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">engine</span>.<span class="name">execute</span>(<span class="name">acl_mapping</span>.<span class="name">insert</span>(),
- <span class="name">priv_id</span> <span class="op">=</span> <span class="name">priv_id</span>,
- <span class="name">subject_id</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">subject_id</span>,
- <span class="name">object_id</span> <span class="op">=</span> <span class="name">obj</span>.<span class="name">object_id</span>,
- <span class="name">state</span> <span class="op">=</span> <span class="name">state</span>
-
- )
-
- <span class="kw">def </span><span class="fun">_bootstrap</span>(<span class="bn bn-pseudo">self</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">This method is automatically called when subject_id is
- None and an subject_id is required.</span><span class="st st-db">&quot;&quot;&quot;</span>
- <span class="name">r</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">engine</span>.<span class="name">execute</span>(<span class="name">acl_subjects</span>.<span class="name">insert</span>(),
- <span class="name">subject_type</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">_type</span>
-
- )
- <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">subject_id</span> <span class="op">=</span> <span class="name">r</span>.<span class="name">last_inserted_ids</span>()[<span class="nb nb-int">0</span>]
- <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">save</span>()
-
- <span class="kw">def </span><span class="fun">_bootstrap_object</span>(<span class="bn bn-pseudo">self</span>, <span class="name">obj</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">Like _bootstrap but works for objects.</span><span class="st st-db">&quot;&quot;&quot;</span>
-
- <span class="name">objtype</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">_get_object_type</span>(<span class="name">obj</span>)
- <span class="name">r</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">engine</span>.<span class="name">execute</span>(<span class="name">acl_objects</span>.<span class="name">insert</span>(),
- <span class="name">object_type</span> <span class="op">=</span> <span class="name">objtype</span>
-
- )
- <span class="name">obj</span>.<span class="name">object_id</span> <span class="op">=</span> <span class="name">r</span>.<span class="name">last_inserted_ids</span>()[<span class="nb nb-int">0</span>]
- <span class="name">obj</span>.<span class="name">save</span>()
-
- <span class="kw">def </span><span class="fun">_get_object_type</span>(<span class="bn bn-pseudo">self</span>, <span class="name">obj</span>):
- <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="name">obj</span>, <span class="name">Forum</span>):
- <span class="kw">return</span> <span class="st st-sg">&#39;</span><span class="st">forum</span><span class="st st-sg">&#39;</span>
-
- <span class="kw">elif</span> <span class="bn">isinstance</span>(<span class="name">obj</span>, <span class="name">Thread</span>):
- <span class="kw">return</span> <span class="st st-sg">&#39;</span><span class="st">thread</span><span class="st st-sg">&#39;</span>
- <span class="kw">elif</span> <span class="name">obj</span> <span class="op op-word">is</span> <span class="name">Site</span>:
- <span class="kw">return</span> <span class="st st-sg">&#39;</span><span class="st">site</span><span class="st st-sg">&#39;</span>
-
- <span class="kw">raise</span> <span class="exc">TypeError</span>(<span class="st st-sg">&#39;</span><span class="st">obj isn</span><span class="st st-esc">\&#39;</span><span class="st">t a forum or thread</span><span class="st st-sg">&#39;</span>)
-
- <span class="kw">def </span><span class="fun">_get_object_join</span>(<span class="bn bn-pseudo">self</span>, <span class="name">obj</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">Returns a subjoin for the object id.</span><span class="st st-db">&quot;&quot;&quot;</span>
-
- <span class="name">t</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">_get_object_type</span>(<span class="name">obj</span>)
- <span class="kw">if</span> <span class="name">t</span> <span class="op">==</span> <span class="st st-sg">&#39;</span><span class="st">forum</span><span class="st st-sg">&#39;</span>:
- <span class="kw">return</span> <span class="name">meta</span>.<span class="name">select</span>([<span class="name">forums</span>.<span class="name">c</span>.<span class="name">object_id</span>],
- <span class="name">forums</span>.<span class="name">c</span>.<span class="name">forum_id</span> <span class="op">==</span> <span class="name">obj</span>.<span class="name">forum_id</span>
-
- )
- <span class="kw">elif</span> <span class="name">t</span> <span class="op">==</span> <span class="st st-sg">&#39;</span><span class="st">thread</span><span class="st st-sg">&#39;</span>:
- <span class="kw">return</span> <span class="name">meta</span>.<span class="name">select</span>([<span class="name">posts</span>.<span class="name">c</span>.<span class="name">object_id</span>],
- <span class="name">posts</span>.<span class="name">c</span>.<span class="name">post_id</span> <span class="op">==</span> <span class="name">obj</span>.<span class="name">post_id</span>
-
- )
- <span class="kw">else</span>:
- <span class="cm"># XXX: it works ^^</span>
- <span class="cm"># i really want something like meta.select(&#39;0 as group_id&#39;)</span>
- <span class="kw">class </span><span class="cls">Fake</span>(<span class="bn">object</span>):
- <span class="kw">def </span><span class="fun">alias</span>(<span class="bn bn-pseudo">self</span>, <span class="name">n</span>):
- <span class="kw">class </span><span class="cls">_C</span>(<span class="bn">object</span>):
- <span class="kw">class </span><span class="cls">c</span>(<span class="bn">object</span>):
- <span class="name">object_id</span> <span class="op">=</span> <span class="nb nb-int">0</span>
-
- <span class="kw">return</span> <span class="name">_C</span>
- <span class="kw">return</span> <span class="name">Fake</span>()
-
- <span class="kw">def </span><span class="fun">_get_subject_join</span>(<span class="bn bn-pseudo">self</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">Returns a subjoin for the subject id.</span><span class="st st-db">&quot;&quot;&quot;</span>
-
- <span class="kw">if</span> <span class="bn bn-pseudo">self</span>.<span class="name">_type</span> <span class="op">==</span> <span class="st st-sg">&#39;</span><span class="st">user</span><span class="st st-sg">&#39;</span>:
- <span class="kw">return</span> <span class="name">meta</span>.<span class="name">select</span>([<span class="name">users</span>.<span class="name">c</span>.<span class="name">subject_id</span>],
- <span class="name">users</span>.<span class="name">c</span>.<span class="name">user_id</span> <span class="op">==</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">user_id</span>
-
- )
- <span class="kw">return</span> <span class="name">meta</span>.<span class="name">select</span>([<span class="name">groups</span>.<span class="name">c</span>.<span class="name">subject_id</span>],
- <span class="name">groups</span>.<span class="name">c</span>.<span class="name">group_id</span> <span class="op">==</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">group_id</span>
-
- )
-
- <span class="kw">def </span><span class="fun">_fetch_privilege</span>(<span class="bn bn-pseudo">self</span>, <span class="name">name</span>):
- <span class="st st-db">&quot;&quot;&quot;</span><span class="st">Returns the priv_id for the given privilege. If it
- doesn</span><span class="st st-esc">\&#39;</span><span class="st">t exist by now the system will create a new
- privilege.</span><span class="st st-db">&quot;&quot;&quot;</span>
- <span class="name">r</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">engine</span>.<span class="name">execute</span>(<span class="name">meta</span>.<span class="name">select</span>([<span class="name">privileges</span>.<span class="name">c</span>.<span class="name">priv_id</span>],
- <span class="name">privileges</span>.<span class="name">c</span>.<span class="name">name</span> <span class="op">==</span> <span class="name">name</span>
-
- ))
- <span class="name">row</span> <span class="op">=</span> <span class="name">r</span>.<span class="name">fetchone</span>()
- <span class="kw">if</span> <span class="name">row</span> <span class="op op-word">is</span> <span class="op op-word">not</span> <span class="bn bn-pseudo">None</span>:
- <span class="kw">return</span> <span class="name">row</span>[<span class="nb nb-int">0</span>]
- <span class="name">r</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">engine</span>.<span class="name">execute</span>(<span class="name">privileges</span>.<span class="name">insert</span>(),
- <span class="name">name</span> <span class="op">=</span> <span class="name">name</span>
-
- )
- <span class="kw">return</span> <span class="name">r</span>.<span class="name">last_inserted_ids</span>()[<span class="nb nb-int">0</span>]
-
- <span class="kw">def </span><span class="fun">__repr__</span>(<span class="bn bn-pseudo">self</span>):
- <span class="kw">if</span> <span class="bn bn-pseudo">self</span>.<span class="name">_type</span> <span class="op">==</span> <span class="st st-sg">&#39;</span><span class="st">user</span><span class="st st-sg">&#39;</span>:
- <span class="name">id_</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">user_id</span>
-
- <span class="kw">else</span>:
- <span class="name">id_</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">group_id</span>
- <span class="kw">if</span> <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">subject_id</span> <span class="op op-word">is</span> <span class="bn bn-pseudo">None</span>:
- <span class="kw">return</span> <span class="st st-sg">&#39;</span><span class="st">&lt;</span><span class="st st-int">%s</span><span class="st"> </span><span class="st st-int">%s</span><span class="st">:</span><span class="st st-int">%d</span><span class="st"> inactive&gt;</span><span class="st st-sg">&#39;</span> <span class="op">%</span> (
- <span class="bn bn-pseudo">self</span>.<span class="name">__class__</span>.<span class="name">__name__</span>,
- <span class="bn bn-pseudo">self</span>.<span class="name">_type</span>,
- <span class="name">id_</span>
-
- )
- <span class="kw">return</span> <span class="st st-sg">&#39;</span><span class="st">&lt;</span><span class="st st-int">%s</span><span class="st"> </span><span class="st st-int">%s</span><span class="st">:</span><span class="st st-int">%d</span><span class="st"> active as </span><span class="st st-int">%d</span><span class="st">&gt;</span><span class="st st-sg">&#39;</span> <span class="op">%</span> (
- <span class="bn bn-pseudo">self</span>.<span class="name">__class__</span>.<span class="name">__name__</span>,
- <span class="bn bn-pseudo">self</span>.<span class="name">_type</span>,
- <span class="name">id_</span>,
- <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">subject_id</span>
-
- )
-
diff --git a/tests/examplefiles/test.idr b/tests/examplefiles/test.idr
deleted file mode 100644
index fd008d31..00000000
--- a/tests/examplefiles/test.idr
+++ /dev/null
@@ -1,101 +0,0 @@
-module Main
-
-data Ty = TyInt | TyBool | TyFun Ty Ty
-
-interpTy : Ty -> Type
-interpTy TyInt = Int
-interpTy TyBool = Bool
-interpTy (TyFun s t) = interpTy s -> interpTy t
-
-using (G : Vect n Ty)
-
- data Env : Vect n Ty -> Type where
- Nil : Env Nil
- (::) : interpTy a -> Env G -> Env (a :: G)
-
- data HasType : (i : Fin n) -> Vect n Ty -> Ty -> Type where
- stop : HasType fZ (t :: G) t
- pop : HasType k G t -> HasType (fS k) (u :: G) t
-
- lookup : HasType i G t -> Env G -> interpTy t
- lookup stop (x :: xs) = x
- lookup (pop k) (x :: xs) = lookup k xs
-
- data Expr : Vect n Ty -> Ty -> Type where
- Var : HasType i G t -> Expr G t
- Val : (x : Int) -> Expr G TyInt
- Lam : Expr (a :: G) t -> Expr G (TyFun a t)
- App : Expr G (TyFun a t) -> Expr G a -> Expr G t
- Op : (interpTy a -> interpTy b -> interpTy c) -> Expr G a -> Expr G b ->
- Expr G c
- If : Expr G TyBool -> Expr G a -> Expr G a -> Expr G a
- Bind : Expr G a -> (interpTy a -> Expr G b) -> Expr G b
-
- dsl expr
- lambda = Lam
- variable = Var
- index_first = stop
- index_next = pop
-
- (<$>) : |(f : Expr G (TyFun a t)) -> Expr G a -> Expr G t
- (<$>) = \f, a => App f a
-
- pure : Expr G a -> Expr G a
- pure = id
-
- syntax IF [x] THEN [t] ELSE [e] = If x t e
-
- (==) : Expr G TyInt -> Expr G TyInt -> Expr G TyBool
- (==) = Op (==)
-
- (<) : Expr G TyInt -> Expr G TyInt -> Expr G TyBool
- (<) = Op (<)
-
- instance Num (Expr G TyInt) where
- (+) x y = Op (+) x y
- (-) x y = Op (-) x y
- (*) x y = Op (*) x y
-
- abs x = IF (x < 0) THEN (-x) ELSE x
-
- fromInteger = Val . fromInteger
-
- ||| Evaluates an expression in the given context.
- interp : Env G -> {static} Expr G t -> interpTy t
- interp env (Var i) = lookup i env
- interp env (Val x) = x
- interp env (Lam sc) = \x => interp (x :: env) sc
- interp env (App f s) = (interp env f) (interp env s)
- interp env (Op op x y) = op (interp env x) (interp env y)
- interp env (If x t e) = if (interp env x) then (interp env t) else (interp env e)
- interp env (Bind v f) = interp env (f (interp env v))
-
- eId : Expr G (TyFun TyInt TyInt)
- eId = expr (\x => x)
-
- eTEST : Expr G (TyFun TyInt (TyFun TyInt TyInt))
- eTEST = expr (\x, y => y)
-
- eAdd : Expr G (TyFun TyInt (TyFun TyInt TyInt))
- eAdd = expr (\x, y => Op (+) x y)
-
- eDouble : Expr G (TyFun TyInt TyInt)
- eDouble = expr (\x => App (App eAdd x) (Var stop))
-
- eFac : Expr G (TyFun TyInt TyInt)
- eFac = expr (\x => IF x == 0 THEN 1 ELSE [| eFac (x - 1) |] * x)
-
-testFac : Int
-testFac = interp [] eFac 4
-
---testFacTooBig : Int
---testFacTooBig = interp [] eFac 100000
-
- {-testFacTooBig2 : Int
-testFacTooBig2 = interp [] eFac 1000
--}
-
-main : IO ()
-main = print testFac
-
-
diff --git a/tests/examplefiles/test.ini b/tests/examplefiles/test.ini
deleted file mode 100644
index a447803d..00000000
--- a/tests/examplefiles/test.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-[section]
-
-foo = bar
-continued = foo
- baz
-conttwo =
- foo
-; comment
-# comment
-
diff --git a/tests/examplefiles/test.java b/tests/examplefiles/test.java
deleted file mode 100644
index 64c08531..00000000
--- a/tests/examplefiles/test.java
+++ /dev/null
@@ -1,653 +0,0 @@
-/*
- * Created on 13-Mar-2004
- * Created by James Yeh
- * Copyright (C) 2004, 2005, 2006 Aelitis, All Rights Reserved.
- *
- * 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
- * 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 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.
- *
- * AELITIS, SAS au capital de 46,603.30 euros
- * 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
- *
- */
-
-package org.gudy.azureus2.platform.macosx;
-
-import org.gudy.azureus2.core3.logging.*;
-import org.gudy.azureus2.core3.util.AEMonitor;
-import org.gudy.azureus2.core3.util.Debug;
-import org.gudy.azureus2.core3.util.SystemProperties;
-import org.gudy.azureus2.platform.PlatformManager;
-import org.gudy.azureus2.platform.PlatformManagerCapabilities;
-import org.gudy.azureus2.platform.PlatformManagerListener;
-import org.gudy.azureus2.platform.macosx.access.jnilib.OSXAccess;
-
-import org.gudy.azureus2.plugins.platform.PlatformManagerException;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.text.MessageFormat;
-import java.util.HashSet;
-
-
-/**
- * Performs platform-specific operations with Mac OS X
- *
- * @author James Yeh
- * @version 1.0 Initial Version
- * @see PlatformManager
- */
-public class PlatformManagerImpl implements PlatformManager
-{
- private static final LogIDs LOGID = LogIDs.CORE;
-
- protected static PlatformManagerImpl singleton;
- protected static AEMonitor class_mon = new AEMonitor("PlatformManager");
-
- private static final String USERDATA_PATH = new File(System.getProperty("user.home") + "/Library/Application Support/").getPath();
-
- //T: PlatformManagerCapabilities
- private final HashSet capabilitySet = new HashSet();
-
- /**
- * Gets the platform manager singleton, which was already initialized
- */
- public static PlatformManagerImpl getSingleton()
- {
- return singleton;
- }
-
- /**
- * Tries to enable cocoa-java access and instantiates the singleton
- */
- static
- {
- initializeSingleton();
- }
-
- /**
- * Instantiates the singleton
- */
- private static void initializeSingleton()
- {
- try
- {
- class_mon.enter();
- singleton = new PlatformManagerImpl();
- }
- catch (Throwable e)
- {
- Logger.log(new LogEvent(LOGID, "Failed to initialize platform manager"
- + " for Mac OS X", e));
- }
- finally
- {
- class_mon.exit();
- }
- }
-
- /**
- * Creates a new PlatformManager and initializes its capabilities
- */
- public PlatformManagerImpl()
- {
- capabilitySet.add(PlatformManagerCapabilities.RecoverableFileDelete);
- capabilitySet.add(PlatformManagerCapabilities.ShowFileInBrowser);
- capabilitySet.add(PlatformManagerCapabilities.ShowPathInCommandLine);
- capabilitySet.add(PlatformManagerCapabilities.CreateCommandLineProcess);
- capabilitySet.add(PlatformManagerCapabilities.GetUserDataDirectory);
- capabilitySet.add(PlatformManagerCapabilities.UseNativeScripting);
- capabilitySet.add(PlatformManagerCapabilities.PlaySystemAlert);
-
- if (OSXAccess.isLoaded()) {
- capabilitySet.add(PlatformManagerCapabilities.GetVersion);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public int getPlatformType()
- {
- return PT_MACOSX;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getVersion() throws PlatformManagerException
- {
- if (!OSXAccess.isLoaded()) {
- throw new PlatformManagerException("Unsupported capability called on platform manager");
- }
-
- return OSXAccess.getVersion();
- }
-
- /**
- * {@inheritDoc}
- * @see org.gudy.azureus2.core3.util.SystemProperties#getUserPath()
- */
- public String getUserDataDirectory() throws PlatformManagerException
- {
- return USERDATA_PATH;
- }
-
- public File
- getLocation(
- long location_id )
-
- throws PlatformManagerException
- {
- if ( location_id == LOC_USER_DATA ){
-
- return( new File( USERDATA_PATH ));
- }
-
- return( null );
- }
- /**
- * Not implemented; returns True
- */
- public boolean isApplicationRegistered() throws PlatformManagerException
- {
- return true;
- }
-
-
- public String
- getApplicationCommandLine()
- throws PlatformManagerException
- {
- try{
- String bundle_path = System.getProperty("user.dir") +SystemProperties.SEP+ SystemProperties.getApplicationName() + ".app";
-
- File osx_app_bundle = new File( bundle_path ).getAbsoluteFile();
-
- if( !osx_app_bundle.exists() ) {
- String msg = "OSX app bundle not found: [" +osx_app_bundle.toString()+ "]";
- System.out.println( msg );
- if (Logger.isEnabled())
- Logger.log(new LogEvent(LOGID, msg));
- throw new PlatformManagerException( msg );
- }
-
- return "open -a \"" +osx_app_bundle.toString()+ "\"";
- //return osx_app_bundle.toString() +"/Contents/MacOS/JavaApplicationStub";
-
- }
- catch( Throwable t ){
- t.printStackTrace();
- return null;
- }
- }
-
-
- public boolean
- isAdditionalFileTypeRegistered(
- String name, // e.g. "BitTorrent"
- String type ) // e.g. ".torrent"
-
- throws PlatformManagerException
- {
- throw new PlatformManagerException("Unsupported capability called on platform manager");
- }
-
- public void
- unregisterAdditionalFileType(
- String name, // e.g. "BitTorrent"
- String type ) // e.g. ".torrent"
-
- throws PlatformManagerException
- {
- throw new PlatformManagerException("Unsupported capability called on platform manager");
- }
-
- public void
- registerAdditionalFileType(
- String name, // e.g. "BitTorrent"
- String description, // e.g. "BitTorrent File"
- String type, // e.g. ".torrent"
- String content_type ) // e.g. "application/x-bittorrent"
-
- throws PlatformManagerException
- {
- throw new PlatformManagerException("Unsupported capability called on platform manager");
- }
-
- /**
- * Not implemented; does nothing
- */
- public void registerApplication() throws PlatformManagerException
- {
- // handled by LaunchServices and/0r user interaction
- }
-
- /**
- * {@inheritDoc}
- */
- public void createProcess(String cmd, boolean inheritsHandles) throws PlatformManagerException
- {
- try
- {
- performRuntimeExec(cmd.split(" "));
- }
- catch (Throwable e)
- {
- throw new PlatformManagerException("Failed to create process", e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void performRecoverableFileDelete(String path) throws PlatformManagerException
- {
- File file = new File(path);
- if(!file.exists())
- {
- if (Logger.isEnabled())
- Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Cannot find "
- + file.getName()));
- return;
- }
-
- boolean useOSA = !NativeInvocationBridge.sharedInstance().isEnabled() || !NativeInvocationBridge.sharedInstance().performRecoverableFileDelete(file);
-
- if(useOSA)
- {
- try
- {
- StringBuffer sb = new StringBuffer();
- sb.append("tell application \"");
- sb.append("Finder");
- sb.append("\" to move (posix file \"");
- sb.append(path);
- sb.append("\" as alias) to the trash");
-
- performOSAScript(sb);
- }
- catch (Throwable e)
- {
- throw new PlatformManagerException("Failed to move file", e);
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean hasCapability(PlatformManagerCapabilities capability)
- {
- return capabilitySet.contains(capability);
- }
-
- /**
- * {@inheritDoc}
- */
- public void dispose()
- {
- NativeInvocationBridge.sharedInstance().dispose();
- }
-
- /**
- * {@inheritDoc}
- */
- public void setTCPTOSEnabled(boolean enabled) throws PlatformManagerException
- {
- throw new PlatformManagerException("Unsupported capability called on platform manager");
- }
-
- public void
- copyFilePermissions(
- String from_file_name,
- String to_file_name )
-
- throws PlatformManagerException
- {
- throw new PlatformManagerException("Unsupported capability called on platform manager");
- }
-
- /**
- * {@inheritDoc}
- */
- public void showFile(String path) throws PlatformManagerException
- {
- File file = new File(path);
- if(!file.exists())
- {
- if (Logger.isEnabled())
- Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Cannot find "
- + file.getName()));
- throw new PlatformManagerException("File not found");
- }
-
- showInFinder(file);
- }
-
- // Public utility methods not shared across the interface
-
- /**
- * Plays the system alert (the jingle is specified by the user in System Preferences)
- */
- public void playSystemAlert()
- {
- try
- {
- performRuntimeExec(new String[]{"beep"});
- }
- catch (IOException e)
- {
- if (Logger.isEnabled())
- Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING,
- "Cannot play system alert"));
- Logger.log(new LogEvent(LOGID, "", e));
- }
- }
-
- /**
- * <p>Shows the given file or directory in Finder</p>
- * @param path Absolute path to the file or directory
- */
- public void showInFinder(File path)
- {
- boolean useOSA = !NativeInvocationBridge.sharedInstance().isEnabled() || !NativeInvocationBridge.sharedInstance().showInFinder(path);
-
- if(useOSA)
- {
- StringBuffer sb = new StringBuffer();
- sb.append("tell application \"");
- sb.append(getFileBrowserName());
- sb.append("\" to reveal (posix file \"");
- sb.append(path);
- sb.append("\" as alias)");
-
- try
- {
- performOSAScript(sb);
- }
- catch (IOException e)
- {
- Logger.log(new LogAlert(LogAlert.UNREPEATABLE, LogAlert.AT_ERROR, e
- .getMessage()));
- }
- }
- }
-
- /**
- * <p>Shows the given file or directory in Terminal by executing cd /absolute/path/to</p>
- * @param path Absolute path to the file or directory
- */
- public void showInTerminal(String path)
- {
- showInTerminal(new File(path));
- }
-
- /**
- * <p>Shows the given file or directory in Terminal by executing cd /absolute/path/to</p>
- * @param path Absolute path to the file or directory
- */
- public void showInTerminal(File path)
- {
- if (path.isFile())
- {
- path = path.getParentFile();
- }
-
- if (path != null && path.isDirectory())
- {
- StringBuffer sb = new StringBuffer();
- sb.append("tell application \"");
- sb.append("Terminal");
- sb.append("\" to do script \"cd ");
- sb.append(path.getAbsolutePath().replaceAll(" ", "\\ "));
- sb.append("\"");
-
- try
- {
- performOSAScript(sb);
- }
- catch (IOException e)
- {
- Logger.log(new LogAlert(LogAlert.UNREPEATABLE, LogAlert.AT_ERROR, e
- .getMessage()));
- }
- }
- else
- {
- if (Logger.isEnabled())
- Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Cannot find "
- + path.getName()));
- }
- }
-
- // Internal utility methods
-
- /**
- * Compiles a new AppleScript instance and runs it
- * @param cmd AppleScript command to execute; do not surround command with extra quotation marks
- * @return Output of the script
- * @throws IOException If the script failed to execute
- */
- protected static String performOSAScript(CharSequence cmd) throws IOException
- {
- return performOSAScript(new CharSequence[]{cmd});
- }
-
- /**
- * Compiles a new AppleScript instance and runs it
- * @param cmds AppleScript Sequence of commands to execute; do not surround command with extra quotation marks
- * @return Output of the script
- * @throws IOException If the script failed to execute
- */
- protected static String performOSAScript(CharSequence[] cmds) throws IOException
- {
- long start = System.currentTimeMillis();
- Debug.outNoStack("Executing OSAScript: ");
- for (int i = 0; i < cmds.length; i++)
- {
- Debug.outNoStack("\t" + cmds[i]);
- }
-
- String[] cmdargs = new String[2 * cmds.length + 1];
- cmdargs[0] = "osascript";
- for (int i = 0; i < cmds.length; i++)
- {
- cmdargs[i * 2 + 1] = "-e";
- cmdargs[i * 2 + 2] = String.valueOf(cmds[i]);
- }
-
- Process osaProcess = performRuntimeExec(cmdargs);
- BufferedReader reader = new BufferedReader(new InputStreamReader(osaProcess.getInputStream()));
- String line = reader.readLine();
- reader.close();
- Debug.outNoStack("OSAScript Output: " + line);
-
- reader = new BufferedReader(new InputStreamReader(osaProcess.getErrorStream()));
- String errorMsg = reader.readLine();
- reader.close();
-
- Debug.outNoStack("OSAScript Error (if any): " + errorMsg);
-
- Debug.outNoStack(MessageFormat.format("OSAScript execution ended ({0}ms)", new Object[]{String.valueOf(System.currentTimeMillis() - start)}));
-
- if (errorMsg != null)
- {
- throw new IOException(errorMsg);
- }
-
- return line;
- }
-
- /**
- * Compiles a new AppleScript instance and runs it
- * @param script AppleScript file (.scpt) to execute
- * @return Output of the script
- * @throws IOException If the script failed to execute
- */
- protected static String performOSAScript(File script) throws IOException
- {
- long start = System.currentTimeMillis();
- Debug.outNoStack("Executing OSAScript from file: " + script.getPath());
-
- Process osaProcess = performRuntimeExec(new String[]{"osascript", script.getPath()});
- BufferedReader reader = new BufferedReader(new InputStreamReader(osaProcess.getInputStream()));
- String line = reader.readLine();
- reader.close();
- Debug.outNoStack("OSAScript Output: " + line);
-
- reader = new BufferedReader(new InputStreamReader(osaProcess.getErrorStream()));
- String errorMsg = reader.readLine();
- reader.close();
-
- Debug.outNoStack("OSAScript Error (if any): " + errorMsg);
-
- Debug.outNoStack(MessageFormat.format("OSAScript execution ended ({0}ms)", new Object[]{String.valueOf(System.currentTimeMillis() - start)}));
-
- if (errorMsg != null)
- {
- throw new IOException(errorMsg);
- }
-
- return line;
- }
-
- /**
- * Compiles a new AppleScript instance to the specified location
- * @param cmd Command to compile; do not surround command with extra quotation marks
- * @param destination Destination location of the AppleScript file
- * @return True if compiled successfully
- */
- protected static boolean compileOSAScript(CharSequence cmd, File destination)
- {
- return compileOSAScript(new CharSequence[]{cmd}, destination);
- }
-
- /**
- * Compiles a new AppleScript instance to the specified location
- * @param cmds Sequence of commands to compile; do not surround command with extra quotation marks
- * @param destination Destination location of the AppleScript file
- * @return True if compiled successfully
- */
- protected static boolean compileOSAScript(CharSequence[] cmds, File destination)
- {
- long start = System.currentTimeMillis();
- Debug.outNoStack("Compiling OSAScript: " + destination.getPath());
- for (int i = 0; i < cmds.length; i++)
- {
- Debug.outNoStack("\t" + cmds[i]);
- }
-
- String[] cmdargs = new String[2 * cmds.length + 3];
- cmdargs[0] = "osacompile";
- for (int i = 0; i < cmds.length; i++)
- {
- cmdargs[i * 2 + 1] = "-e";
- cmdargs[i * 2 + 2] = String.valueOf(cmds[i]);
- }
-
- cmdargs[cmdargs.length - 2] = "-o";
- cmdargs[cmdargs.length - 1] = destination.getPath();
-
- String errorMsg;
- try
- {
- Process osaProcess = performRuntimeExec(cmdargs);
-
- BufferedReader reader = new BufferedReader(new InputStreamReader(osaProcess.getErrorStream()));
- errorMsg = reader.readLine();
- reader.close();
- }
- catch (IOException e)
- {
- Debug.outNoStack("OSACompile Execution Failed: " + e.getMessage());
- Debug.printStackTrace(e);
- return false;
- }
-
- Debug.outNoStack("OSACompile Error (if any): " + errorMsg);
-
- Debug.outNoStack(MessageFormat.format("OSACompile execution ended ({0}ms)", new Object[]{String.valueOf(System.currentTimeMillis() - start)}));
-
- return (errorMsg == null);
- }
-
- /**
- * @see Runtime#exec(String[])
- */
- protected static Process performRuntimeExec(String[] cmdargs) throws IOException
- {
- try
- {
- return Runtime.getRuntime().exec(cmdargs);
- }
- catch (IOException e)
- {
- Logger.log(new LogAlert(LogAlert.UNREPEATABLE, e.getMessage(), e));
- throw e;
- }
- }
-
- /**
- * <p>Gets the preferred file browser name</p>
- * <p>Currently supported browsers are Path Finder and Finder. If Path Finder is currently running
- * (not just installed), then "Path Finder is returned; else, "Finder" is returned.</p>
- * @return "Path Finder" if it is currently running; else "Finder"
- */
- private static String getFileBrowserName()
- {
- try
- {
- // slowwwwwwww
- if ("true".equalsIgnoreCase(performOSAScript("tell application \"System Events\" to exists process \"Path Finder\"")))
- {
- Debug.outNoStack("Path Finder is running");
-
- return "Path Finder";
- }
- else
- {
- return "Finder";
- }
- }
- catch (IOException e)
- {
- Debug.printStackTrace(e);
- Logger.log(new LogEvent(LOGID, e.getMessage(), e));
-
- return "Finder";
- }
- }
-
- public boolean
- testNativeAvailability(
- String name )
-
- throws PlatformManagerException
- {
- throw new PlatformManagerException("Unsupported capability called on platform manager");
- }
-
- public void
- addListener(
- PlatformManagerListener listener )
- {
- }
-
- public void
- removeListener(
- PlatformManagerListener listener )
- {
- }
-}
diff --git a/tests/examplefiles/test.jsp b/tests/examplefiles/test.jsp
deleted file mode 100644
index 1c6664da..00000000
--- a/tests/examplefiles/test.jsp
+++ /dev/null
@@ -1,24 +0,0 @@
-<!-- This page was loaded on <%= (new java.util.Date()).toLocaleString() %> -->
-<%= var x = 1;
-%>
-<%! int i = 0; %>
-<%! int a, b, c; %>
-<%! Circle a = new Circle(2.0); %>
-
-<%
- String name = null;
- if (request.getParameter("name") == null) {
-%>
-<%@ include file="error.html" %>
-<%
- } else {
- foo.setName(request.getParameter("name"));
- if (foo.getName().equalsIgnoreCase("integra"))
- name = "acura";
- if (name.equalsIgnoreCase( "acura" )) {
-%>
-
-<jsp:useBean id="calendar" scope="page" class="employee.Calendar" />
-<h2>
-Calendar of <jsp:getProperty name="calendar" property="username" />
-</h2>
diff --git a/tests/examplefiles/test.lean b/tests/examplefiles/test.lean
deleted file mode 100644
index a7b7e261..00000000
--- a/tests/examplefiles/test.lean
+++ /dev/null
@@ -1,217 +0,0 @@
-/-
-Theorems/Exercises from "Logical Investigations, with the Nuprl Proof Assistant"
-by Robert L. Constable and Anne Trostle
-http://www.nuprl.org/MathLibrary/LogicalInvestigations/
--/
-import logic
-
--- 2. The Minimal Implicational Calculus
-theorem thm1 {A B : Prop} : A → B → A :=
-assume Ha Hb, Ha
-
-theorem thm2 {A B C : Prop} : (A → B) → (A → B → C) → (A → C) :=
-assume Hab Habc Ha,
- Habc Ha (Hab Ha)
-
-theorem thm3 {A B C : Prop} : (A → B) → (B → C) → (A → C) :=
-assume Hab Hbc Ha,
- Hbc (Hab Ha)
-
--- 3. False Propositions and Negation
-theorem thm4 {P Q : Prop} : ¬P → P → Q :=
-assume Hnp Hp,
- absurd Hp Hnp
-
-theorem thm5 {P : Prop} : P → ¬¬P :=
-assume (Hp : P) (HnP : ¬P),
- absurd Hp HnP
-
-theorem thm6 {P Q : Prop} : (P → Q) → (¬Q → ¬P) :=
-assume (Hpq : P → Q) (Hnq : ¬Q) (Hp : P),
- have Hq : Q, from Hpq Hp,
- show false, from absurd Hq Hnq
-
-theorem thm7 {P Q : Prop} : (P → ¬P) → (P → Q) :=
-assume Hpnp Hp,
- absurd Hp (Hpnp Hp)
-
-theorem thm8 {P Q : Prop} : ¬(P → Q) → (P → ¬Q) :=
-assume (Hn : ¬(P → Q)) (Hp : P) (Hq : Q),
- -- Rermak we don't even need the hypothesis Hp
- have H : P → Q, from assume H', Hq,
- absurd H Hn
-
--- 4. Conjunction and Disjunction
-theorem thm9 {P : Prop} : (P ∨ ¬P) → (¬¬P → P) :=
-assume (em : P ∨ ¬P) (Hnn : ¬¬P),
- or_elim em
- (assume Hp, Hp)
- (assume Hn, absurd Hn Hnn)
-
-theorem thm10 {P : Prop} : ¬¬(P ∨ ¬P) :=
-assume Hnem : ¬(P ∨ ¬P),
- have Hnp : ¬P, from
- assume Hp : P,
- have Hem : P ∨ ¬P, from or_inl Hp,
- absurd Hem Hnem,
- have Hem : P ∨ ¬P, from or_inr Hnp,
- absurd Hem Hnem
-
-theorem thm11 {P Q : Prop} : ¬P ∨ ¬Q → ¬(P ∧ Q) :=
-assume (H : ¬P ∨ ¬Q) (Hn : P ∧ Q),
- or_elim H
- (assume Hnp : ¬P, absurd (and_elim_left Hn) Hnp)
- (assume Hnq : ¬Q, absurd (and_elim_right Hn) Hnq)
-
-theorem thm12 {P Q : Prop} : ¬(P ∨ Q) → ¬P ∧ ¬Q :=
-assume H : ¬(P ∨ Q),
- have Hnp : ¬P, from assume Hp : P, absurd (or_inl Hp) H,
- have Hnq : ¬Q, from assume Hq : Q, absurd (or_inr Hq) H,
- and_intro Hnp Hnq
-
-theorem thm13 {P Q : Prop} : ¬P ∧ ¬Q → ¬(P ∨ Q) :=
-assume (H : ¬P ∧ ¬Q) (Hn : P ∨ Q),
- or_elim Hn
- (assume Hp : P, absurd Hp (and_elim_left H))
- (assume Hq : Q, absurd Hq (and_elim_right H))
-
-theorem thm14 {P Q : Prop} : ¬P ∨ Q → P → Q :=
-assume (Hor : ¬P ∨ Q) (Hp : P),
- or_elim Hor
- (assume Hnp : ¬P, absurd Hp Hnp)
- (assume Hq : Q, Hq)
-
-theorem thm15 {P Q : Prop} : (P → Q) → ¬¬(¬P ∨ Q) :=
-assume (Hpq : P → Q) (Hn : ¬(¬P ∨ Q)),
- have H1 : ¬¬P ∧ ¬Q, from thm12 Hn,
- have Hnp : ¬P, from mt Hpq (and_elim_right H1),
- absurd Hnp (and_elim_left H1)
-
-theorem thm16 {P Q : Prop} : (P → Q) ∧ ((P ∨ ¬P) ∨ (Q ∨ ¬Q)) → ¬P ∨ Q :=
-assume H : (P → Q) ∧ ((P ∨ ¬P) ∨ (Q ∨ ¬Q)),
- have Hpq : P → Q, from and_elim_left H,
- or_elim (and_elim_right H)
- (assume Hem1 : P ∨ ¬P, or_elim Hem1
- (assume Hp : P, or_inr (Hpq Hp))
- (assume Hnp : ¬P, or_inl Hnp))
- (assume Hem2 : Q ∨ ¬Q, or_elim Hem2
- (assume Hq : Q, or_inr Hq)
- (assume Hnq : ¬Q, or_inl (mt Hpq Hnq)))
-
--- 5. First-Order Logic: All and Exists
-section
-parameters {T : Type} {C : Prop} {P : T → Prop}
-theorem thm17a : (C → ∀x, P x) → (∀x, C → P x) :=
-assume H : C → ∀x, P x,
- take x : T, assume Hc : C,
- H Hc x
-
-theorem thm17b : (∀x, C → P x) → (C → ∀x, P x) :=
-assume (H : ∀x, C → P x) (Hc : C),
- take x : T,
- H x Hc
-
-theorem thm18a : ((∃x, P x) → C) → (∀x, P x → C) :=
-assume H : (∃x, P x) → C,
- take x, assume Hp : P x,
- have Hex : ∃x, P x, from exists_intro x Hp,
- H Hex
-
-theorem thm18b : (∀x, P x → C) → (∃x, P x) → C :=
-assume (H1 : ∀x, P x → C) (H2 : ∃x, P x),
- obtain (w : T) (Hw : P w), from H2,
- H1 w Hw
-
-theorem thm19a : (C ∨ ¬C) → (∃x : T, true) → (C → (∃x, P x)) → (∃x, C → P x) :=
-assume (Hem : C ∨ ¬C) (Hin : ∃x : T, true) (H1 : C → ∃x, P x),
- or_elim Hem
- (assume Hc : C,
- obtain (w : T) (Hw : P w), from H1 Hc,
- have Hr : C → P w, from assume Hc, Hw,
- exists_intro w Hr)
- (assume Hnc : ¬C,
- obtain (w : T) (Hw : true), from Hin,
- have Hr : C → P w, from assume Hc, absurd Hc Hnc,
- exists_intro w Hr)
-
-theorem thm19b : (∃x, C → P x) → C → (∃x, P x) :=
-assume (H : ∃x, C → P x) (Hc : C),
- obtain (w : T) (Hw : C → P w), from H,
- exists_intro w (Hw Hc)
-
-theorem thm20a : (C ∨ ¬C) → (∃x : T, true) → ((¬∀x, P x) → ∃x, ¬P x) → ((∀x, P x) → C) → (∃x, P x → C) :=
-assume Hem Hin Hnf H,
- or_elim Hem
- (assume Hc : C,
- obtain (w : T) (Hw : true), from Hin,
- exists_intro w (assume H : P w, Hc))
- (assume Hnc : ¬C,
- have H1 : ¬(∀x, P x), from mt H Hnc,
- have H2 : ∃x, ¬P x, from Hnf H1,
- obtain (w : T) (Hw : ¬P w), from H2,
- exists_intro w (assume H : P w, absurd H Hw))
-
-theorem thm20b : (∃x, P x → C) → (∀ x, P x) → C :=
-assume Hex Hall,
- obtain (w : T) (Hw : P w → C), from Hex,
- Hw (Hall w)
-
-theorem thm21a : (∃x : T, true) → ((∃x, P x) ∨ C) → (∃x, P x ∨ C) :=
-assume Hin H,
- or_elim H
- (assume Hex : ∃x, P x,
- obtain (w : T) (Hw : P w), from Hex,
- exists_intro w (or_inl Hw))
- (assume Hc : C,
- obtain (w : T) (Hw : true), from Hin,
- exists_intro w (or_inr Hc))
-
-theorem thm21b : (∃x, P x ∨ C) → ((∃x, P x) ∨ C) :=
-assume H,
- obtain (w : T) (Hw : P w ∨ C), from H,
- or_elim Hw
- (assume H : P w, or_inl (exists_intro w H))
- (assume Hc : C, or_inr Hc)
-
-theorem thm22a : (∀x, P x) ∨ C → ∀x, P x ∨ C :=
-assume H, take x,
- or_elim H
- (assume Hl, or_inl (Hl x))
- (assume Hr, or_inr Hr)
-
-theorem thm22b : (C ∨ ¬C) → (∀x, P x ∨ C) → ((∀x, P x) ∨ C) :=
-assume Hem H1,
- or_elim Hem
- (assume Hc : C, or_inr Hc)
- (assume Hnc : ¬C,
- have Hx : ∀x, P x, from
- take x,
- have H1 : P x ∨ C, from H1 x,
- resolve_left H1 Hnc,
- or_inl Hx)
-
-theorem thm23a : (∃x, P x) ∧ C → (∃x, P x ∧ C) :=
-assume H,
- have Hex : ∃x, P x, from and_elim_left H,
- have Hc : C, from and_elim_right H,
- obtain (w : T) (Hw : P w), from Hex,
- exists_intro w (and_intro Hw Hc)
-
-theorem thm23b : (∃x, P x ∧ C) → (∃x, P x) ∧ C :=
-assume H,
- obtain (w : T) (Hw : P w ∧ C), from H,
- have Hex : ∃x, P x, from exists_intro w (and_elim_left Hw),
- and_intro Hex (and_elim_right Hw)
-
-theorem thm24a : (∀x, P x) ∧ C → (∀x, P x ∧ C) :=
-assume H, take x,
- and_intro (and_elim_left H x) (and_elim_right H)
-
-theorem thm24b : (∃x : T, true) → (∀x, P x ∧ C) → (∀x, P x) ∧ C :=
-assume Hin H,
- obtain (w : T) (Hw : true), from Hin,
- have Hc : C, from and_elim_right (H w),
- have Hx : ∀x, P x, from take x, and_elim_left (H x),
- and_intro Hx Hc
-
-end -- of section
diff --git a/tests/examplefiles/test.maql b/tests/examplefiles/test.maql
deleted file mode 100644
index a44935fd..00000000
--- a/tests/examplefiles/test.maql
+++ /dev/null
@@ -1,45 +0,0 @@
-# MAQL script
-CREATE DATASET {dataset.quotes} VISUAL(TITLE "St\\tock Qu\totes Data");
-
-# A comment
-CREATE DATASET {dataset.quotes} VISUAL(TITLE "Stock Qu\"otes Data");
-
-CREATE DATASET {dataset.quotes} VISUAL(TITLE "Stock Quotes Data");
-
-ALTER DATASET {dataset.quotes} ADD {attribute.sector};
-
-ALTER DATASET {dataset.quotes} DROP {attribute.symbol};
-
-ALTER DATASET {dataset.quotes} VISUAL(TITLE "Internal Quotes Data");
-
-CREATE ATTRIBUTE {attr.quotes.symbol}
- VISUAL(TITLE "Symbol", FOLDER {folder.quotes.attr})
- AS {d_quotes_symbol.nm_symbol};
-
-ALTER ATTRIBUTE {attr.quotes.symbol}
- ADD LABELS {attr.quotes.company} VISUAL(TITLE "Company")
- AS {d_quotes_symbol.nm_company};
-
-CREATE FACT {fact.quotes.open_price}
- VISUAL( TITLE "Open Price", FOLDER {folder.quotes.fact}) AS {f_quotes.f_open_price};
-
-ALTER FACT {fact.quotes.open_price} ADD {f_quotes2.f_open_price};
-
-CREATE FOLDER {folder.quotes.attr}
- VISUAL ( TITLE "Stock Quotes Data",
- DESCRIPTION "Stock quotes data obtained from John Doe etc." )
- TYPE ATTRIBUTE;
-
-ALTER DATATYPE {d_quotes_symbol.nm_symbol} VARCHAR(4),
- {d_quotes_symbol.nm_symbol} VARCHAR(80),
- {f_quotes.f_open_price} DECIMAL(10,2);
-
-INCLUDE TEMPLATE "URN:GOODDATA:DATE" MODIFY (IDENTIFIER "my-date", TITLE "quote")
-
-ALTER ATTRIBUTE {attr.quotes.symbol} ADD KEYS {d_quotes_symbol.nm_symbol} PRIMARY;
-
-ALTER ATTRIBUTE {attr.quotes.symbol} DROP KEYS {d_quotes_symbol.nm_symbol};
-
-ALTER FACT {fact.quotes.open_price} ADD {f_quotes2.f_open_price};
-
-# Another comment
diff --git a/tests/examplefiles/test.mask b/tests/examplefiles/test.mask
deleted file mode 100644
index 39134d74..00000000
--- a/tests/examplefiles/test.mask
+++ /dev/null
@@ -1,41 +0,0 @@
-
-// comment
-h4.class-1#id.class-2.other checked='true' disabled name = x param > 'Enter ..'
-input placeholder=Password type=password >
- :dualbind x-signal='dom:create' value=user.passord;
-% each='flowers' >
- div style='
- position: absolute;
- display: inline-block;
- background: url("image.png") center center no-repeat;
- ';
-#skippedDiv.other {
- img src='~[url]';
- div style="text-align:center;" {
- '~[: $obj.foo("username", name) + 2]'
- "~[Localize: stringId]"
- }
-
- p > """
-
- Hello "world"
- """
-
- p > '
- Hello "world"
- '
-
- p > "Hello 'world'"
-
- :customComponent x-value='tt';
- /* footer > '(c) 2014' */
-}
-
-.skippedDiv >
- span >
- #skipped >
- table >
- td >
- tr > ';)'
-
-br; \ No newline at end of file
diff --git a/tests/examplefiles/test.mod b/tests/examplefiles/test.mod
deleted file mode 100644
index ba972e30..00000000
--- a/tests/examplefiles/test.mod
+++ /dev/null
@@ -1,374 +0,0 @@
-(* LIFO Storage Library
- *
- * @file LIFO.mod
- * LIFO implementation
- *
- * Universal Dynamic Stack
- *
- * Author: Benjamin Kowarsch
- *
- * Copyright (C) 2009 Benjamin Kowarsch. All rights reserved.
- *
- * License:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met
- *
- * 1) NO FEES may be charged for the provision of the software. The software
- * may NOT be published on websites that contain advertising, unless
- * specific prior written permission has been obtained.
- *
- * 2) Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 3) Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and other materials provided with the distribution.
- *
- * 4) Neither the author's name nor the names of any contributors may be used
- * to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * 5) Where this list of conditions or the following disclaimer, in part or
- * as a whole is overruled or nullified by applicable law, no permission
- * is granted to use the software.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- *)
-
-
-IMPLEMENTATION (* OF *) MODULE LIFO;
-
-FROM SYSTEM IMPORT ADDRESS, ADR, TSIZE;
-FROM Storage IMPORT ALLOCATE, DEALLOCATE;
-
-
-(* ---------------------------------------------------------------------------
-// Private type : ListEntry
-// ---------------------------------------------------------------------------
-*)
-TYPE ListPtr = POINTER TO ListEntry;
-
-TYPE ListEntry = RECORD
- value : DataPtr;
- next : ListPtr
-END; (* ListEntry *)
-
-
-(* ---------------------------------------------------------------------------
-// Opaque type : LIFO.Stack
-// ---------------------------------------------------------------------------
-// CAUTION: Modula-2 does not support the use of variable length array fields
-// in records. VLAs can only be implemented using pointer arithmetic which
-// means there is no type checking and no boundary checking on the array.
-// It also means that array notation cannot be used on the array which makes
-// the code difficult to read and maintain. As a result, Modula-2 is less
-// safe and less readable than C when it comes to using VLAs. Great care must
-// be taken to make sure that the code accessing VLA fields is safe. Boundary
-// checks must be inserted manually. Size checks must be inserted manually to
-// compensate for the absence of type checks. *)
-
-TYPE Stack = POINTER TO StackDescriptor;
-
-TYPE StackDescriptor = RECORD
- overflow : ListPtr;
- entryCount : StackSize;
- arraySize : StackSize;
- array : ADDRESS (* ARRAY OF DataPtr *)
-END; (* StackDescriptor *)
-
-
-(* ---------------------------------------------------------------------------
-// function: LIFO.new( initial_size, status )
-// ---------------------------------------------------------------------------
-//
-// Creates and returns a new LIFO stack object with an initial capacity of
-// <initialSize>. If zero is passed in for <initialSize>, then the stack
-// will be created with an initial capacity of LIFO.defaultStackSize. The
-// function fails if a value greater than LIFO.maximumStackSize is passed
-// in for <initialSize> or if memory could not be allocated.
-//
-// The initial capacity of a stack is the number of entries that can be stored
-// in the stack without enlargement.
-//
-// The status of the operation is passed back in <status>. *)
-
-PROCEDURE new ( initialSize : StackSize; VAR status : Status ) : Stack;
-
-VAR
- newStack : Stack;
-
-BEGIN
-
- (* zero size means default *)
- IF initialSize = 0 THEN
- initialSize := defaultStackSize;
- END; (* IF *)
-
- (* bail out if initial size is too high *)
- IF initialSize > maximumStackSize THEN
- status := invalidSize;
- RETURN NIL;
- END; (* IF *)
-
- (* allocate new stack object *)
- ALLOCATE(newStack, TSIZE(Stack) + TSIZE(DataPtr) * (initialSize - 1));
-
- (* bail out if allocation failed *)
- IF newStack = NIL THEN
- status := allocationFailed;
- RETURN NIL;
- END; (* IF *)
-
- (* initialise meta data *)
- newStack^.arraySize := initialSize;
- newStack^.entryCount := 0;
- newStack^.overflow := NIL;
-
- (* pass status and new stack to caller *)
- status := success;
- RETURN newStack
-
-END new;
-
-
-(* ---------------------------------------------------------------------------
-// function: LIFO.push( stack, value, status )
-// ---------------------------------------------------------------------------
-//
-// Adds a new entry <value> to the top of stack <stack>. The new entry is
-// added by reference, no data is copied. However, no entry is added if the
-// the stack is full, that is when the number of entries stored in the stack
-// has reached LIFO.maximumStackSize. The function fails if NIL is passed in
-// for <stack> or <value>, or if memory could not be allocated.
-//
-// New entries are allocated dynamically if the number of entries exceeds the
-// initial capacity of the stack.
-//
-// The status of the operation is passed back in <status>. *)
-
-PROCEDURE push ( VAR stack : Stack; value : DataPtr; VAR status : Status );
-VAR
- newEntry : ListPtr;
- valuePtr : POINTER TO DataPtr;
-
-BEGIN
-
- (* bail out if stack is NIL *)
- IF stack = NIL THEN
- status := invalidStack;
- RETURN;
- END; (* IF *)
-
- (* bail out if value is NIL *)
- IF value = NIL THEN
- status := invalidData;
- RETURN;
- END; (* IF *)
-
- (* bail out if stack is full *)
- IF stack^.entryCount >= maximumStackSize THEN
- status := stackFull;
- RETURN;
- END; (* IF *)
-
- (* check if index falls within array segment *)
- IF stack^.entryCount < stack^.arraySize THEN
-
- (* store value in array segment *)
-
- (* stack^.array^[stack^.entryCount] := value; *)
- valuePtr := ADR(stack^.array) + TSIZE(DataPtr) * stack^.entryCount;
- valuePtr^ := value;
-
- ELSE (* index falls within overflow segment *)
-
- (* allocate new entry slot *)
- NEW(newEntry);
-
- (* bail out if allocation failed *)
- IF newEntry = NIL THEN
- status := allocationFailed;
- RETURN;
- END; (* IF *)
-
- (* initialise new entry *)
- newEntry^.value := value;
-
- (* link new entry into overflow list *)
- newEntry^.next := stack^.overflow;
- stack^.overflow := newEntry;
-
- END; (* IF *)
-
- (* update entry counter *)
- INC(stack^.entryCount);
-
- (* pass status to caller *)
- status := success;
- RETURN
-
-END push;
-
-
-(* ---------------------------------------------------------------------------
-// function: LIFO.pop( stack, status )
-// ---------------------------------------------------------------------------
-//
-// Removes the top most value from stack <stack> and returns it. If the stack
-// is empty, that is when the number of entries stored in the stack has
-// reached zero, then NIL is returned.
-//
-// Entries which were allocated dynamically (above the initial capacity) are
-// deallocated when their values are popped.
-//
-// The status of the operation is passed back in <status>. *)
-
-PROCEDURE pop ( VAR stack : Stack; VAR status : Status ) : DataPtr;
-
-VAR
- thisValue : DataPtr;
- thisEntry : ListPtr;
- valuePtr : POINTER TO DataPtr;
-
-BEGIN
-
- (* bail out if stack is NIL *)
- IF stack = NIL THEN
- status := invalidStack;
- RETURN NIL;
- END; (* IF *)
-
- (* bail out if stack is empty *)
- IF stack^.entryCount = 0 THEN
- status := stackEmpty;
- RETURN NIL;
- END; (* IF *)
-
- DEC(stack^.entryCount);
-
- (* check if index falls within array segment *)
- IF stack^.entryCount < stack^.arraySize THEN
-
- (* obtain value at index entryCount in array segment *)
-
- (* thisValue := stack^.array^[stack^.entryCount]; *)
- valuePtr := ADR(stack^.array) + TSIZE(DataPtr) * stack^.entryCount;
- thisValue := valuePtr^;
-
- ELSE (* index falls within overflow segment *)
-
- (* obtain value of first entry in overflow list *)
- thisValue := stack^.overflow^.value;
-
- (* isolate first entry in overflow list *)
- thisEntry := stack^.overflow;
- stack^.overflow := stack^.overflow^.next;
-
- (* remove the entry from overflow list *)
- DISPOSE(thisEntry);
-
- END; (* IF *)
-
- (* return value and status to caller *)
- status := success;
- RETURN thisValue
-
-END pop;
-
-
-(* ---------------------------------------------------------------------------
-// function: LIFO.stackSize( stack )
-// ---------------------------------------------------------------------------
-//
-// Returns the current capacity of <stack>. The current capacity is the total
-// number of allocated entries. Returns zero if NIL is passed in for <stack>.
-*)
-PROCEDURE stackSize( VAR stack : Stack ) : StackSize;
-
-BEGIN
-
- (* bail out if stack is NIL *)
- IF stack = NIL THEN
- RETURN 0;
- END; (* IF *)
-
- IF stack^.entryCount < stack^.arraySize THEN
- RETURN stack^.arraySize;
- ELSE
- RETURN stack^.entryCount;
- END; (* IF *)
-
-END stackSize;
-
-
-(* ---------------------------------------------------------------------------
-// function: LIFO.stackEntries( stack )
-// ---------------------------------------------------------------------------
-//
-// Returns the number of entries stored in stack <stack>, returns zero if
-// NIL is passed in for <stack>. *)
-
-PROCEDURE stackEntries( VAR stack : Stack ) : StackSize;
-
-BEGIN
-
- (* bail out if stack is NIL *)
- IF stack = NIL THEN
- RETURN 0;
- END; (* IF *)
-
- RETURN stack^.entryCount
-
-END stackEntries;
-
-
-(* ---------------------------------------------------------------------------
-// function: LIFO.dispose( stack )
-// ---------------------------------------------------------------------------
-//
-// Disposes of LIFO stack object <stack>. Returns NIL. *)
-
-PROCEDURE dispose ( VAR stack : Stack ) : Stack;
-
-VAR
- thisEntry : ListPtr;
-
-BEGIN
-
- (* bail out if stack is NIL *)
- IF stack = NIL THEN
- RETURN NIL;
- END; (* IF *)
-
- (* deallocate any entries in stack's overflow list *)
- WHILE stack^.overflow # NIL DO
-
- (* isolate first entry in overflow list *)
- thisEntry := stack^.overflow;
- stack^.overflow := stack^.overflow^.next;
-
- (* deallocate the entry *)
- DISPOSE(thisEntry);
-
- END; (* WHILE *)
-
- (* deallocate stack object and pass NIL to caller *)
- DEALLOCATE(stack, TSIZE(Stack) + TSIZE(DataPtr) * (stack^.arraySize - 1));
- RETURN NIL
-
-END dispose;
-
-
-END LIFO.
diff --git a/tests/examplefiles/test.moo b/tests/examplefiles/test.moo
deleted file mode 100644
index dec71ba8..00000000
--- a/tests/examplefiles/test.moo
+++ /dev/null
@@ -1,51 +0,0 @@
-you_lose_msg = "Either that person does not exist, or has a different password.";
-if (!(caller in {#0, this}))
- return E_PERM;
- "...caller isn't :do_login_command...";
-elseif (args && (args[1] == "test"))
- return this:test(@listdelete(args, 1));
-elseif (!(length(args) in {1, 2}))
- notify(player, tostr("Usage: ", verb, " <existing-player-name> <password>"));
-elseif (!valid(candidate = this:_match_player(name = strsub(args[1], " ", "_"))))
- if (name == "guest")
- "must be no guests";
- this:notify_lines(this:registration_text("guest"));
- else
- notify(player, you_lose_msg);
- endif
- "...unknown player...";
-elseif (is_clear_property(candidate, "password") || ((typeof(candidate.password) == STR) && ((length(candidate.password) < 2) || (crypt({@args, ""}[2], candidate.password) != candidate.password))))
- notify(player, you_lose_msg);
- "...bad password...";
- server_log(tostr("FAILED CONNECT: ", args[1], " (", candidate, ") on ", connection_name(player), ($string_utils:connection_hostname(connection_name(player)) in candidate.all_connect_places) ? "" | "******"));
-elseif (((candidate.name == "guest") && this.sitematch_guests) && valid(foreigner = $country_db:get_guest()))
- notify(player, tostr("Okay,... Logging you in as `", foreigner:name(), "'"));
- this:record_connection(foreigner);
- return foreigner;
-elseif ((parent(candidate) == $guest) && (!valid(candidate = candidate:defer())))
- if (candidate == #-3)
- notify(player, "Sorry, guest characters are not allowed from your site right now.");
- elseif (candidate == #-2)
- this:notify_lines(this:registration_text("blacklisted", "Sorry, guest characters are not allowed from your site."));
- elseif (candidate == #-4)
- this:notify_lines(this:registration_text("guest"));
- else
- notify(player, "Sorry, all of our guest characters are in use right now.");
- endif
-else
- if ((!(name in candidate.aliases)) && (name != tostr(candidate)))
- notify(player, tostr("Okay,... ", name, " is in use. Logging you in as `", candidate:name(), "'"));
- endif
- if (this:is_newted(candidate))
- notify(player, "");
- notify(player, this:newt_message_for(candidate));
- notify(player, "");
- else
- this:record_connection(candidate);
- if (verb[1] == "s")
- candidate.use_do_command = 0;
- endif
- return candidate;
- endif
-endif
-return 0; \ No newline at end of file
diff --git a/tests/examplefiles/test.mt b/tests/examplefiles/test.mt
deleted file mode 100644
index 008dc88e..00000000
--- a/tests/examplefiles/test.mt
+++ /dev/null
@@ -1,7 +0,0 @@
-exports (main)
-
-def main(=> currentProcess) :Int as DeepFrozen:
- traceln(`Current process: $currentProcess`)
- "A \r \n \x00 \u1234"
- '\u1234'
- return 0
diff --git a/tests/examplefiles/test.myt b/tests/examplefiles/test.myt
deleted file mode 100644
index 1668f7a6..00000000
--- a/tests/examplefiles/test.myt
+++ /dev/null
@@ -1,166 +0,0 @@
-<%doc>formatting.myt - Provides section formatting elements, syntax-highlighted code blocks, and other special filters.</%doc>
-
-<%global>
- import string, re
- import highlight
-</%global>
-
-<%method section>
-<%doc>Main section formatting element.</%doc>
-<%args>
- toc
- path
- description=None
- onepage=False
-</%args>
-<%init>
- item = toc.get_by_path(path)
- if item is None:
- raise "path: " + path
-</%init>
-
-<A name="<% item.path %>"></a>
-
-<div class="subsection" style="margin-left:<% repr(item.depth * 10) %>px;">
-
-<%python>
- content = m.content()
- re2 = re.compile(r"'''PYESC(.+?)PYESC'''", re.S)
- content = re2.sub(lambda m: m.group(1), content)
-</%python>
-
-% if item.depth > 1:
-<h3><% description or item.description %></h3>
-%
-
- <div class="sectiontext">
- <% content %>
- </div>
-
-% if onepage or item.depth > 1:
-% if (item.next and item.next.depth >= item.depth):
- <a href="#<% item.get_page_root().path %>" class="toclink">back to section top</a>
-%
-% else:
- <a href="#<% item.get_page_root().path %>" class="toclink">back to section top</a>
- <& nav.myt:pagenav, item=item, onepage=onepage &>
-%
-</div>
-
-</%method>
-
-
-<%method formatplain>
- <%filter>
- import re
- f = re.sub(r'\n[\s\t]*\n[\s\t]*', '</p>\n<p>', f)
- f = "<p>" + f + "</p>"
- return f
- </%filter>
-<% m.content() | h%>
-</%method>
-
-
-
-
-<%method codeline trim="both">
-<span class="codeline"><% m.content() %></span>
-</%method>
-
-<%method code autoflush=False>
-<%args>
- title = None
- syntaxtype = 'python'
- html_escape = False
- use_sliders = False
-</%args>
-
-<%init>
- def fix_indent(f):
- f =string.expandtabs(f, 4)
- g = ''
- lines = string.split(f, "\n")
- whitespace = None
- for line in lines:
- if whitespace is None:
- match = re.match(r"^([ ]*).+", line)
- if match is not None:
- whitespace = match.group(1)
-
- if whitespace is not None:
- line = re.sub(r"^%s" % whitespace, "", line)
-
- if whitespace is not None or re.search(r"\w", line) is not None:
- g += (line + "\n")
-
-
- return g.rstrip()
-
- p = re.compile(r'<pre>(.*?)</pre>', re.S)
- def hlight(match):
- return "<pre>" + highlight.highlight(fix_indent(match.group(1)), html_escape = html_escape, syntaxtype = syntaxtype) + "</pre>"
- content = p.sub(hlight, "<pre>" + m.content() + "</pre>")
-</%init>
-<div class="<% use_sliders and "sliding_code" or "code" %>">
-% if title is not None:
- <div class="codetitle"><% title %></div>
-%
-<% content %></div>
-</%method>
-
-
-
-
-<%method popboxlink trim="both">
- <%args>
- name=None
- show='show'
- hide='hide'
- </%args>
- <%init>
- if name is None:
- name = m.attributes.setdefault('popbox_name', 0)
- name += 1
- m.attributes['popbox_name'] = name
- name = "popbox_" + repr(name)
- </%init>
-javascript:togglePopbox('<% name %>', '<% show %>', '<% hide %>')
-</%method>
-
-<%method popbox trim="both">
-<%args>
- name = None
- class_ = None
-</%args>
-<%init>
- if name is None:
- name = 'popbox_' + repr(m.attributes['popbox_name'])
-</%init>
-<div id="<% name %>_div" class="<% class_ %>" style="display:none;"><% m.content().strip() %></div>
-</%method>
-
-<%method poplink trim="both">
- <%args>
- link='sql'
- </%args>
- <%init>
- href = m.scomp('SELF:popboxlink')
- </%init>
- '''PYESC<& nav.myt:link, href=href, text=link, class_="codepoplink" &>PYESC'''
-</%method>
-
-<%method codepopper trim="both">
- <%init>
- c = m.content()
- c = re.sub(r'\n', '<br/>\n', c.strip())
- </%init>
- </pre><&|SELF:popbox, class_="codepop" &><% c %></&><pre>
-</%method>
-
-<%method poppedcode trim="both">
- <%init>
- c = m.content()
- c = re.sub(r'\n', '<br/>\n', c.strip())
- </%init>
- </pre><div class="codepop"><% c %></div><pre>
-</%method>
diff --git a/tests/examplefiles/test.ncl b/tests/examplefiles/test.ncl
deleted file mode 100644
index f20f8159..00000000
--- a/tests/examplefiles/test.ncl
+++ /dev/null
@@ -1,20 +0,0 @@
-load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
-load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
-load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
-begin
- int_num = 1
- float_num = 0.1
- str = "A void map"
- array = (/1, 2, 3, 4, 5/)
-
-
- wks = gsn_open_wks("X11", "test_for_pygments")
-
- res = True
- res@mpMinLonF = 90.
- res@mpMaxLonF = 180.
- res@mpMinLatF = 0.
- res@mpMaxLatF = 90.
-
- plot = gsn_csm_map_ce(wks, res)
-end \ No newline at end of file
diff --git a/tests/examplefiles/test.nim b/tests/examplefiles/test.nim
deleted file mode 100644
index 20610bb6..00000000
--- a/tests/examplefiles/test.nim
+++ /dev/null
@@ -1,93 +0,0 @@
-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.odin b/tests/examplefiles/test.odin
deleted file mode 100644
index 05b01d22..00000000
--- a/tests/examplefiles/test.odin
+++ /dev/null
@@ -1,43 +0,0 @@
---
--- Example of a fragment of an openEHR Archetype, written in the Object Data Instance Notation (ODIN)
--- Definition available here: https://github.com/openEHR/odin
--- Author: Thomas Beale
---
-
- original_author = <
- ["name"] = <"Dr J Joyce">
- ["organisation"] = <"NT Health Service">
- ["date"] = <2003-08-03>
- >
- term_bindings = <
- ["umls"] = <
- ["id1"] = <http://umls.nlm.edu/id/C124305> -- apgar result
- ["id2"] = <http://umls.nlm.edu/id/0000000> -- 1-minute event
- >
- >
- lifecycle_state = <"initial">
- resource_package_uri = <"http://www.aihw.org.au/data_sets/diabetic_archetypes.html">
-
- details = <
- ["en"] = <
- language = <[iso_639-1::en]>
- purpose = <"archetype for diabetic patient review">
- use = <"used for all hospital or clinic-based diabetic reviews,
- including first time. Optional sections are removed according to the particular review"
- >
- misuse = <"not appropriate for pre-diagnosis use">
- original_resource_uri = <"http://www.healthdata.org.au/data_sets/diabetic_review_data_set_1.html">
- >
- ["de"] = <
- language = <[iso_639-1::de]>
- purpose = <"Archetyp für die Untersuchung von Patienten mit Diabetes">
- use = <"wird benutzt für alle Diabetes-Untersuchungen im
- Krankenhaus, inklusive der ersten Vorstellung. Optionale
- Abschnitte werden in Abhängigkeit von der speziellen
- Vorstellung entfernt."
- >
- misuse = <"nicht geeignet für Benutzung vor Diagnosestellung">
- original_resource_uri = <"http://www.healthdata.org.au/data_sets/diabetic_review_data_set_1.html">
- >
- >
-
diff --git a/tests/examplefiles/test.opa b/tests/examplefiles/test.opa
deleted file mode 100644
index ec287ac5..00000000
--- a/tests/examplefiles/test.opa
+++ /dev/null
@@ -1,10 +0,0 @@
-function sample_page() {
- <header>
- <h3>HTML in Opa</h3>
- </header>
- <article>
- <div class=container>
- <p>Learning by examples.</p>
- </div>
- </article>
-}
diff --git a/tests/examplefiles/test.orc b/tests/examplefiles/test.orc
deleted file mode 100644
index d113303e..00000000
--- a/tests/examplefiles/test.orc
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * comment
- */
-; comment
-// comment
-
-instr/**/1,/**/N_a_M_e_,/**/+Name/**///
- iDuration = p3
- outc:a(aSignal)
-endin
-
-opcode/**/aUDO,/**/i[],/**/aik//
- aUDO
-endop
-
-123 0123456789
-0xabcdef0123456789 0XABCDEF
-1e2 3e+4 5e-6 7E8 9E+0 1E-2 3. 4.56 .789
-
-"characters$MACRO."
-"\\\a\b\n\r\t\012\345\67\""
-
-{{
-characters$MACRO.
-}}
-{{\\\a\b\n\r\t\"\012\345\67}}
-
-+ - ~ ¬ ! * / ^ % << >> < > <= >= == != & # | && || ? : += -= *= /=
-
-0dbfs A4 kr ksmps nchnls nchnls_i sr
-
-do else elseif endif enduntil fi if ithen kthen od then until while
-return rireturn
-
-aLabel:
- label2:
-
-goto aLabel
-reinit aLabel
-cggoto 1==0, aLabel
-timout 0, 0, aLabel
-loop_ge 0, 0, 0, aLabel
-
-prints "%! %% %n%N %r%R %t%T \\a\\A \\b\\B \\n\\N \\r\\R \\t\\T"
-prints Soutput
-
-readscore {{
-i 1 0 0
-}}
-pyrun {{
-# Python
-}}
-lua_exec {{
--- Lua
-}}
-
-#include/**/"file.udo"
-#include/**/|file.udo|
-
-#ifdef MACRO
-#else
-#ifndef MACRO
-#endif
-#undef MACRO
-
-# define MACRO#macro_body#
-#define/**/
-MACRO/**/
-#\#macro
-body\##
-
-#define MACRO(ARG1#ARG2) #macro_body#
-#define/**/
-MACRO(ARG1'ARG2'ARG3)/**/
-#\#macro
-body\##
-
-$MACRO $MACRO.
-$MACRO(x)
-@0
-@@ 1
diff --git a/tests/examplefiles/test.p6 b/tests/examplefiles/test.p6
deleted file mode 100644
index 3d12b56c..00000000
--- a/tests/examplefiles/test.p6
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/usr/bin/env perl6
-
-use v6;
-
-my $string = 'I look like a # comment!';
-
-if $string eq 'foo' {
- say 'hello';
-}
-
-regex http-verb {
- 'GET'
- | 'POST'
- | 'PUT'
- | 'DELETE'
- | 'TRACE'
- | 'OPTIONS'
- | 'HEAD'
-}
-
-# a sample comment
-
-say 'Hello from Perl 6!'
-
-
-#`{
-multi-line comment!
-}
-
-say 'here';
-
-#`(
-multi-line comment!
-)
-
-say 'here';
-
-#`{{{
-I'm a special comment!
-}}}
-
-say 'there';
-
-#`{{
-I'm { even } specialer!
-}}
-
-say 'there';
-
-#`{{
-does {{nesting}} work?
-}}
-
-#`«<
-trying mixed delimiters
-
-my $string = qq<Hooray, arbitrary delimiter!>;
-my $string = qq«Hooray, arbitrary delimiter!»;
-my $string = q <now with whitespace!>;
-my $string = qq<<more strings>>;
-
-my %hash := Hash.new;
-
-=begin pod
-
-Here's some POD! Wooo
-
-=end pod
-
-=for Testing
- This is POD (see? role isn't highlighted)
-
-say('this is not!');
-
-=table
- Of role things
-
-say('not in your table');
-#= A single line declarator "block" (with a keyword like role)
-#| Another single line declarator "block" (with a keyword like role)
-#={
- A declarator block (with a keyword like role)
- }
-#|{
- Another declarator block (with a keyword like role)
- }
-#= { A single line declarator "block" with a brace (with a keyword like role)
-#=«
- More declarator blocks! (with a keyword like role)
- »
-#|«
- More declarator blocks! (with a keyword like role)
- »
-
-say 'Moar code!';
-
-my $don't = 16;
-
-sub don't($x) {
- !$x
-}
-
-say don't 'foo';
-
-my %hash = (
- :foo(1),
-);
-
-say %hash<foo>;
-say %hash<<foo>>;
-say %hash«foo»;
-
-say %*hash<foo>;
-say %*hash<<foo>>;
-say %*hash«foo»;
-
-say $<todo>;
-say $<todo>;
-
-for (@A Z @B) -> $a, $b {
- say $a + $b;
-}
-
-Q:PIR {
- .loadlib "somelib"
-}
-
-my $longstring = q/
- lots
- of
- text
-/;
-
-my $heredoc = q:to/END_SQL/;
-SELECT * FROM Users
-WHERE first_name = 'Rob'
-END_SQL
-my $hello;
-
-# Fun with regexen
-
-if 'food' ~~ /foo/ {
- say 'match!'
-}
-
-my $re = /foo/;
-my $re2 = m/ foo /;
-my $re3 = m:i/ FOO /;
-
-call-a-sub(/ foo /);
-call-a-sub(/ foo \/ bar /);
-
-my $re4 = rx/something | something-else/;
-my $result = ms/regexy stuff/;
-my $sub0 = s/regexy stuff/more stuff/;
-my $sub = ss/regexy stuff/more stuff/;
-my $trans = tr/regexy stuff/more stuff/;
-
-my @values = <a b c d>;
-call-sub(<a b c d>);
-call-sub <a b c d>;
-
-my $result = $a < $b;
-
-for <a b c d> -> $letter {
- say $letter;
-}
-
-sub test-sub {
- say @_;
- say $!;
- say $/;
- say $0;
- say $1;
- say @*ARGS;
- say $*ARGFILES;
- say &?BLOCK;
- say ::?CLASS;
- say $?CLASS;
- say @=COMMENT;
- say %?CONFIG;
- say $*CWD;
- say $=data;
- say %?DEEPMAGIC;
- say $?DISTRO;
- say $*DISTRO;
- say $*EGID;
- say %*ENV;
- say $*ERR;
- say $*EUID;
- say $*EXECUTABLE_NAME;
- say $?FILE;
- say $?GRAMMAR;
- say $*GID;
- say $*IN;
- say @*INC;
- say %?LANG;
- say $*LANG;
- say $?LINE;
- say %*META-ARGS;
- say $?MODULE;
- say %*OPTS;
- say %*OPT;
- say $?KERNEL;
- say $*KERNEL;
- say $*OUT;
- say $?PACKAGE;
- say $?PERL;
- say $*PERL;
- say $*PID;
- say %=pod;
- say $*PROGRAM_NAME;
- say %*PROTOCOLS;
- say ::?ROLE;
- say $?ROLE;
- say &?ROUTINE;
- say $?SCOPE;
- say $*TZ;
- say $*UID;
- say $?USAGE;
- say $?VM;
- say $?XVM;
-}
-
-say <a b c>;
-
-my $perl5_re = m:P5/ fo{2} /;
-my $re5 = rx«something | something-else»;
-
-my $M := %*COMPILING<%?OPTIONS><M>;
-
-say $M;
-
-sub regex-name { ... }
-my $pair = role-name => 'foo';
-$pair = rolesque => 'foo';
-
-my sub something(Str:D $value) { ... }
-
-my $s = q«<
-some
-string
-stuff
-»;
-
-my $regex = m«< some chars »;
-# after
-
-say $/<foo><bar>;
-
-roleq;
diff --git a/tests/examplefiles/test.pan b/tests/examplefiles/test.pan
deleted file mode 100644
index 56c8bd62..00000000
--- a/tests/examplefiles/test.pan
+++ /dev/null
@@ -1,54 +0,0 @@
-object template pantest;
-
-# Very simple pan test file
-"/long/decimal" = 123;
-"/long/octal" = 0755;
-"/long/hexadecimal" = 0xFF;
-
-"/double/simple" = 0.01;
-"/double/pi" = 3.14159;
-"/double/exponent" = 1e-8;
-"/double/scientific" = 1.3E10;
-
-"/string/single" = 'Faster, but escapes like \t, \n and \x3d don''t work, but '' should work.';
-"/string/double" = "Slower, but escapes like \t, \n and \x3d do work";
-
-variable TEST = 2;
-
-"/x2" = to_string(TEST);
-"/x2" ?= 'Default value';
-
-"/x3" = 1 + 2 + value("/long/decimal");
-
-"/x4" = undef;
-
-"/x5" = null;
-
-variable e ?= error("Test error message");
-
-# include gmond config for services-monitoring
-include { 'site/ganglia/gmond/services-monitoring' };
-
-"/software/packages"=pkg_repl("httpd","2.2.3-43.sl5.3",PKG_ARCH_DEFAULT);
-"/software/packages"=pkg_repl("php");
-
-# Example function
-function show_things_view_for_stuff = {
- thing = ARGV[0];
- foreach( i; mything; STUFF ) {
- if ( thing == mything ) {
- return( true );
- } else {
- return SELF;
- };
- };
- false;
-};
-
-variable HERE = <<EOF;
-; This example demonstrates an in-line heredoc style config file
-[main]
-awesome = true
-EOF
-
-variable small = false;#This should be highlighted normally again.
diff --git a/tests/examplefiles/test.pas b/tests/examplefiles/test.pas
deleted file mode 100644
index 2724bbfd..00000000
--- a/tests/examplefiles/test.pas
+++ /dev/null
@@ -1,743 +0,0 @@
-//
-// Sourcecode from http://www.delphi-library.de/topic_47880.html
-//
-uses Windows, Messages;
-
-const
- FFM_INIT = WM_USER + 1976;
- FFM_ONFILEFOUND = WM_USER + 1974; // wParam: not used, lParam: Filename
- FFM_ONDIRFOUND = WM_USER + 1975; // wParam: NumFolder, lParam: Directory
-var
- CntFolders : Cardinal = 0;
- NumFolder : Cardinal = 0;
-
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// FindAllFilesInit
-//
-//
-procedure FindAllFilesInit; external;
-label foo;
-begin
- CntFolders := 0;
- NumFolder := 0;
-foo:
- Blub;
- goto foo;
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// CountFolders
-//
-//
-procedure CountFolders(Handle: THandle; RootFolder: string; Recurse: Boolean = True);
-var
- hFindFile : THandle;
- wfd : TWin32FindData;
-begin
- SendMessage(Handle, FFM_INIT, 0, 0);
- if RootFolder[length(RootFolder)] <> '\' then
- RootFolder := RootFolder + '\';
- ZeroMemory(@wfd, sizeof(wfd));
- wfd.dwFileAttributes := FILE_ATTRIBUTE_NORMAL;
- if Recurse then
- begin
- hFindFile := FindFirstFile(pointer(RootFolder + '*.*'), wfd);
- if hFindFile <> 0 then
- try
- repeat
- if wfd.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
- begin
- if (string(wfd.cFileName) <> '.') and (string(wfd.cFileName) <> '..') then
- begin
- CountFolders(Handle, RootFolder + wfd.cFileName, Recurse);
- end;
- end;
- until FindNextFile(hFindFile, wfd) = False;
- Inc(CntFolders);
- finally
- Windows.FindClose(hFindFile);
- end;
- end;
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// FindAllFiles
-//
-procedure FindAllFiles(Handle: THandle; RootFolder: string; Mask: string; Recurse: Boolean = True);
-var
- hFindFile : THandle;
- wfd : TWin32FindData;
-begin
- if RootFolder[length(RootFolder)] <> '\' then
- RootFolder := RootFolder + '\';
- ZeroMemory(@wfd, sizeof(wfd));
- wfd.dwFileAttributes := FILE_ATTRIBUTE_NORMAL;
- if Recurse then
- begin
- hFindFile := FindFirstFile(pointer(RootFolder + '*.*'), wfd);
- if hFindFile <> 0 then
- try
- repeat
- if wfd.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
- begin
- if (string(wfd.cFileName) <> '.') and (string(wfd.cFileName) <> '..') then
- begin
- FindAllFiles(Handle, RootFolder + wfd.cFileName, Mask, Recurse);
- end;
- end;
- until FindNextFile(hFindFile, wfd) = False;
- Inc(NumFolder);
- SendMessage(Handle, FFM_ONDIRFOUND, NumFolder, lParam(string(RootFolder)));
- finally
- Windows.FindClose(hFindFile);
- end;
- end;
- hFindFile := FindFirstFile(pointer(RootFolder + Mask), wfd);
- if hFindFile <> INVALID_HANDLE_VALUE then
- try
- repeat
- if (wfd.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY <> FILE_ATTRIBUTE_DIRECTORY) then
- begin
- SendMessage(Handle, FFM_ONFILEFOUND, 0, lParam(string(RootFolder + wfd.cFileName)));
- end;
- until FindNextFile(hFindFile, wfd) = False;
- finally
- Windows.FindClose(hFindFile);
- end;
-end;
-
-
-property test: boolean read ftest write ftest;
-procedure test: boolean read ftest write ftest;
-
-//
-// This sourcecode is part of omorphia
-//
-
-Function IsValidHandle(Const Handle: THandle): Boolean; {$IFDEF OMORPHIA_FEATURES_USEASM} Assembler;
-Asm
- TEST EAX, EAX
- JZ @@Finish
- NOT EAX
- TEST EAX, EAX
- SETNZ AL
-
- {$IFDEF WINDOWS}
- JZ @@Finish
-
- //Save the handle against modifications or loss
- PUSH EAX
-
- //reserve some space for a later duplicate
- PUSH EAX
-
- //Check if we are working on NT-Platform
- CALL IsWindowsNTSystem
- TEST EAX, EAX
- JZ @@NoNTSystem
-
- PUSH DWORD PTR [ESP]
- LEA EAX, DWORD PTR [ESP+$04]
- PUSH EAX
- CALL GetHandleInformation
- TEST EAX, EAX
- JNZ @@Finish2
-
-@@NoNTSystem:
- //Result := DuplicateHandle(GetCurrentProcess, Handle, GetCurrentProcess,
- // @Duplicate, 0, False, DUPLICATE_SAME_ACCESS);
- PUSH DUPLICATE_SAME_ACCESS
- PUSH $00000000
- PUSH $00000000
- LEA EAX, DWORD PTR [ESP+$0C]
- PUSH EAX
- CALL GetCurrentProcess
- PUSH EAX
- PUSH DWORD PTR [ESP+$18]
- PUSH EAX
- CALL DuplicateHandle
-
- TEST EAX, EAX
- JZ @@Finish2
-
- // Result := CloseHandle(Duplicate);
- PUSH DWORD PTR [ESP]
- CALL CloseHandle
-
-@@Finish2:
- POP EDX
- POP EDX
-
- PUSH EAX
- PUSH $00000000
- CALL SetLastError
- POP EAX
- {$ENDIF}
-
-@@Finish:
-End;
-{$ELSE}
-Var
- Duplicate: THandle;
- Flags: DWORD;
-Begin
- If IsWinNT Then
- Result := GetHandleInformation(Handle, Flags)
- Else
- Result := False;
- If Not Result Then
- Begin
- // DuplicateHandle is used as an additional check for those object types not
- // supported by GetHandleInformation (e.g. according to the documentation,
- // GetHandleInformation doesn't support window stations and desktop although
- // tests show that it does). GetHandleInformation is tried first because its
- // much faster. Additionally GetHandleInformation is only supported on NT...
- Result := DuplicateHandle(GetCurrentProcess, Handle, GetCurrentProcess,
- @Duplicate, 0, False, DUPLICATE_SAME_ACCESS);
- If Result Then
- Result := CloseHandle(Duplicate);
- End;
-End;
-{$ENDIF}
-
-
-
-
-{*******************************************************}
-{ }
-{ Delphi Supplemental Components }
-{ ZLIB Data Compression Interface Unit }
-{ }
-{ Copyright (c) 1997 Borland International }
-{ }
-{*******************************************************}
-
-{ Modified for zlib 1.1.3 by Davide Moretti <dave@rimini.com }
-
-unit zlib;
-
-interface
-
-uses Sysutils, Classes;
-
-type
- TAlloc = function (AppData: Pointer; Items, Size: Integer): Pointer;
- TFree = procedure (AppData, Block: Pointer);
-
- // Internal structure. Ignore.
- TZStreamRec = packed record
- next_in: PChar; // next input byte
- avail_in: Integer; // number of bytes available at next_in
- total_in: Integer; // total nb of input bytes read so far
-
- next_out: PChar; // next output byte should be put here
- avail_out: Integer; // remaining free space at next_out
- total_out: Integer; // total nb of bytes output so far
-
- msg: PChar; // last error message, NULL if no error
- internal: Pointer; // not visible by applications
-
- zalloc: TAlloc; // used to allocate the internal state
- zfree: TFree; // used to free the internal state
- AppData: Pointer; // private data object passed to zalloc and zfree
-
- data_type: Integer; // best guess about the data type: ascii or binary
- adler: Integer; // adler32 value of the uncompressed data
- reserved: Integer; // reserved for future use
- end;
-
- // Abstract ancestor class
- TCustomZlibStream = class(TStream)
- private
- FStrm: TStream;
- FStrmPos: Integer;
- FOnProgress: TNotifyEvent;
- FZRec: TZStreamRec;
- FBuffer: array [Word] of Char;
- protected
- procedure Progress(Sender: TObject); dynamic;
- property OnProgress: TNotifyEvent read FOnProgress write FOnProgress;
- constructor Create(Strm: TStream);
- end;
-
-{ TCompressionStream compresses data on the fly as data is written to it, and
- stores the compressed data to another stream.
-
- TCompressionStream is write-only and strictly sequential. Reading from the
- stream will raise an exception. Using Seek to move the stream pointer
- will raise an exception.
-
- Output data is cached internally, written to the output stream only when
- the internal output buffer is full. All pending output data is flushed
- when the stream is destroyed.
-
- The Position property returns the number of uncompressed bytes of
- data that have been written to the stream so far.
-
- CompressionRate returns the on-the-fly percentage by which the original
- data has been compressed: (1 - (CompressedBytes / UncompressedBytes)) * 100
- If raw data size = 100 and compressed data size = 25, the CompressionRate
- is 75%
-
- The OnProgress event is called each time the output buffer is filled and
- written to the output stream. This is useful for updating a progress
- indicator when you are writing a large chunk of data to the compression
- stream in a single call.}
-
-
- TCompressionLevel = (clNone, clFastest, clDefault, clMax);
-
- TCompressionStream = class(TCustomZlibStream)
- private
- function GetCompressionRate: Single;
- public
- constructor Create(CompressionLevel: TCompressionLevel; Dest: TStream);
- destructor Destroy; override;
- function Read(var Buffer; Count: Longint): Longint; override;
- function Write(const Buffer; Count: Longint): Longint; override;
- function Seek(Offset: Longint; Origin: Word): Longint; override;
- property CompressionRate: Single read GetCompressionRate;
- property OnProgress;
- end;
-
-{ TDecompressionStream decompresses data on the fly as data is read from it.
-
- Compressed data comes from a separate source stream. TDecompressionStream
- is read-only and unidirectional; you can seek forward in the stream, but not
- backwards. The special case of setting the stream position to zero is
- allowed. Seeking forward decompresses data until the requested position in
- the uncompressed data has been reached. Seeking backwards, seeking relative
- to the end of the stream, requesting the size of the stream, and writing to
- the stream will raise an exception.
-
- The Position property returns the number of bytes of uncompressed data that
- have been read from the stream so far.
-
- The OnProgress event is called each time the internal input buffer of
- compressed data is exhausted and the next block is read from the input stream.
- This is useful for updating a progress indicator when you are reading a
- large chunk of data from the decompression stream in a single call.}
-
- TDecompressionStream = class(TCustomZlibStream)
- public
- constructor Create(Source: TStream);
- destructor Destroy; override;
- function Read(var Buffer; Count: Longint): Longint; override;
- function Write(const Buffer; Count: Longint): Longint; override;
- function Seek(Offset: Longint; Origin: Word): Longint; override;
- property OnProgress;
- end;
-
-
-
-{ CompressBuf compresses data, buffer to buffer, in one call.
- In: InBuf = ptr to compressed data
- InBytes = number of bytes in InBuf
- Out: OutBuf = ptr to newly allocated buffer containing decompressed data
- OutBytes = number of bytes in OutBuf }
-procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
- out OutBuf: Pointer; out OutBytes: Integer);
-
-
-{ DecompressBuf decompresses data, buffer to buffer, in one call.
- In: InBuf = ptr to compressed data
- InBytes = number of bytes in InBuf
- OutEstimate = zero, or est. size of the decompressed data
- Out: OutBuf = ptr to newly allocated buffer containing decompressed data
- OutBytes = number of bytes in OutBuf }
-procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
- OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
-
-const
- zlib_version = '1.1.3';
-
-type
- EZlibError = class(Exception);
- ECompressionError = class(EZlibError);
- EDecompressionError = class(EZlibError);
-
-function adler32(adler: Integer; buf: PChar; len: Integer): Integer;
-
-implementation
-
-const
- Z_NO_FLUSH = 0;
- Z_PARTIAL_FLUSH = 1;
- Z_SYNC_FLUSH = 2;
- Z_FULL_FLUSH = 3;
- Z_FINISH = 4;
-
- Z_OK = 0;
- Z_STREAM_END = 1;
- Z_NEED_DICT = 2;
- Z_ERRNO = (-1);
- Z_STREAM_ERROR = (-2);
- Z_DATA_ERROR = (-3);
- Z_MEM_ERROR = (-4);
- Z_BUF_ERROR = (-5);
- Z_VERSION_ERROR = (-6);
-
- Z_NO_COMPRESSION = 0;
- Z_BEST_SPEED = 1;
- Z_BEST_COMPRESSION = 9;
- Z_DEFAULT_COMPRESSION = (-1);
-
- Z_FILTERED = 1;
- Z_HUFFMAN_ONLY = 2;
- Z_DEFAULT_STRATEGY = 0;
-
- Z_BINARY = 0;
- Z_ASCII = 1;
- Z_UNKNOWN = 2;
-
- Z_DEFLATED = 8;
-
- _z_errmsg: array[0..9] of PChar = (
- 'need dictionary', // Z_NEED_DICT (2)
- 'stream end', // Z_STREAM_END (1)
- '', // Z_OK (0)
- 'file error', // Z_ERRNO (-1)
- 'stream error', // Z_STREAM_ERROR (-2)
- 'data error', // Z_DATA_ERROR (-3)
- 'insufficient memory', // Z_MEM_ERROR (-4)
- 'buffer error', // Z_BUF_ERROR (-5)
- 'incompatible version', // Z_VERSION_ERROR (-6)
- ''
- );
-
-{$L deflate.obj}
-{$L inflate.obj}
-{$L inftrees.obj}
-{$L trees.obj}
-{$L adler32.obj}
-{$L infblock.obj}
-{$L infcodes.obj}
-{$L infutil.obj}
-{$L inffast.obj}
-
-procedure _tr_init; external;
-procedure _tr_tally; external;
-procedure _tr_flush_block; external;
-procedure _tr_align; external;
-procedure _tr_stored_block; external;
-function adler32; external;
-procedure inflate_blocks_new; external;
-procedure inflate_blocks; external;
-procedure inflate_blocks_reset; external;
-procedure inflate_blocks_free; external;
-procedure inflate_set_dictionary; external;
-procedure inflate_trees_bits; external;
-procedure inflate_trees_dynamic; external;
-procedure inflate_trees_fixed; external;
-procedure inflate_codes_new; external;
-procedure inflate_codes; external;
-procedure inflate_codes_free; external;
-procedure _inflate_mask; external;
-procedure inflate_flush; external;
-procedure inflate_fast; external;
-
-procedure _memset(P: Pointer; B: Byte; count: Integer);cdecl;
-begin
- FillChar(P^, count, B);
-end;
-
-procedure _memcpy(dest, source: Pointer; count: Integer);cdecl;
-begin
- Move(source^, dest^, count);
-end;
-
-
-
-// deflate compresses data
-function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar;
- recsize: Integer): Integer; external;
-function deflate(var strm: TZStreamRec; flush: Integer): Integer; external;
-function deflateEnd(var strm: TZStreamRec): Integer; external;
-
-// inflate decompresses data
-function inflateInit_(var strm: TZStreamRec; version: PChar;
- recsize: Integer): Integer; external;
-function inflate(var strm: TZStreamRec; flush: Integer): Integer; external;
-function inflateEnd(var strm: TZStreamRec): Integer; external;
-function inflateReset(var strm: TZStreamRec): Integer; external;
-
-
-function zcalloc(AppData: Pointer; Items, Size: Integer): Pointer;
-begin
- GetMem(Result, Items*Size);
-end;
-
-procedure zcfree(AppData, Block: Pointer);
-begin
- FreeMem(Block);
-end;
-
-function zlibCheck(code: Integer): Integer;
-begin
- Result := code;
- if code < 0 then
- raise EZlibError.Create('error'); //!!
-end;
-
-function CCheck(code: Integer): Integer;
-begin
- Result := code;
- if code < 0 then
- raise ECompressionError.Create('error'); //!!
-end;
-
-function DCheck(code: Integer): Integer;
-begin
- Result := code;
- if code < 0 then
- raise EDecompressionError.Create('error'); //!!
-end;
-
-procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
- out OutBuf: Pointer; out OutBytes: Integer);
-var
- strm: TZStreamRec;
- P: Pointer;
-begin
- FillChar(strm, sizeof(strm), 0);
- OutBytes := ((InBytes + (InBytes div 10) + 12) + 255) and not 255;
- GetMem(OutBuf, OutBytes);
- try
- strm.next_in := InBuf;
- strm.avail_in := InBytes;
- strm.next_out := OutBuf;
- strm.avail_out := OutBytes;
- CCheck(deflateInit_(strm, Z_BEST_COMPRESSION, zlib_version, sizeof(strm)));
- try
- while CCheck(deflate(strm, Z_FINISH)) <> Z_STREAM_END do
- begin
- P := OutBuf;
- Inc(OutBytes, 256);
- ReallocMem(OutBuf, OutBytes);
- strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
- strm.avail_out := 256;
- end;
- finally
- CCheck(deflateEnd(strm));
- end;
- ReallocMem(OutBuf, strm.total_out);
- OutBytes := strm.total_out;
- except
- FreeMem(OutBuf);
- raise
- end;
-end;
-
-
-procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
- OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
-var
- strm: TZStreamRec;
- P: Pointer;
- BufInc: Integer;
-begin
- FillChar(strm, sizeof(strm), 0);
- BufInc := (InBytes + 255) and not 255;
- if OutEstimate = 0 then
- OutBytes := BufInc
- else
- OutBytes := OutEstimate;
- GetMem(OutBuf, OutBytes);
- try
- strm.next_in := InBuf;
- strm.avail_in := InBytes;
- strm.next_out := OutBuf;
- strm.avail_out := OutBytes;
- DCheck(inflateInit_(strm, zlib_version, sizeof(strm)));
- try
- while DCheck(inflate(strm, Z_FINISH)) <> Z_STREAM_END do
- begin
- P := OutBuf;
- Inc(OutBytes, BufInc);
- ReallocMem(OutBuf, OutBytes);
- strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
- strm.avail_out := BufInc;
- end;
- finally
- DCheck(inflateEnd(strm));
- end;
- ReallocMem(OutBuf, strm.total_out);
- OutBytes := strm.total_out;
- except
- FreeMem(OutBuf);
- raise
- end;
-end;
-
-
-// TCustomZlibStream
-
-constructor TCustomZLibStream.Create(Strm: TStream);
-begin
- inherited Create;
- FStrm := Strm;
- FStrmPos := Strm.Position;
-end;
-
-procedure TCustomZLibStream.Progress(Sender: TObject);
-begin
- if Assigned(FOnProgress) then FOnProgress(Sender);
-end;
-
-
-// TCompressionStream
-
-constructor TCompressionStream.Create(CompressionLevel: TCompressionLevel;
- Dest: TStream);
-const
- Levels: array [TCompressionLevel] of ShortInt =
- (Z_NO_COMPRESSION, Z_BEST_SPEED, Z_DEFAULT_COMPRESSION, Z_BEST_COMPRESSION);
-begin
- inherited Create(Dest);
- FZRec.next_out := FBuffer;
- FZRec.avail_out := sizeof(FBuffer);
- CCheck(deflateInit_(FZRec, Levels[CompressionLevel], zlib_version, sizeof(FZRec)));
-end;
-
-destructor TCompressionStream.Destroy;
-begin
- FZRec.next_in := nil;
- FZRec.avail_in := 0;
- try
- if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
- while (CCheck(deflate(FZRec, Z_FINISH)) <> Z_STREAM_END)
- and (FZRec.avail_out = 0) do
- begin
- FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
- FZRec.next_out := FBuffer;
- FZRec.avail_out := sizeof(FBuffer);
- end;
- if FZRec.avail_out < sizeof(FBuffer) then
- FStrm.WriteBuffer(FBuffer, sizeof(FBuffer) - FZRec.avail_out);
- finally
- deflateEnd(FZRec);
- end;
- inherited Destroy;
-end;
-
-function TCompressionStream.Read(var Buffer; Count: Longint): Longint;
-begin
- raise ECompressionError.Create('Invalid stream operation');
-end;
-
-function TCompressionStream.Write(const Buffer; Count: Longint): Longint;
-begin
- FZRec.next_in := @Buffer;
- FZRec.avail_in := Count;
- if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
- while (FZRec.avail_in > 0) do
- begin
- CCheck(deflate(FZRec, 0));
- if FZRec.avail_out = 0 then
- begin
- FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
- FZRec.next_out := FBuffer;
- FZRec.avail_out := sizeof(FBuffer);
- FStrmPos := FStrm.Position;
- Progress(Self);
- end;
- end;
- Result := Count;
-end;
-
-function TCompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
-begin
- if (Offset = 0) and (Origin = soFromCurrent) then
- Result := FZRec.total_in
- else
- raise ECompressionError.Create('Invalid stream operation');
-end;
-
-function TCompressionStream.GetCompressionRate: Single;
-begin
- if FZRec.total_in = 0 then
- Result := 0
- else
- Result := (1.0 - (FZRec.total_out / FZRec.total_in)) * 100.0;
-end;
-
-
-// TDecompressionStream
-
-constructor TDecompressionStream.Create(Source: TStream);
-begin
- inherited Create(Source);
- FZRec.next_in := FBuffer;
- FZRec.avail_in := 0;
- DCheck(inflateInit_(FZRec, zlib_version, sizeof(FZRec)));
-end;
-
-destructor TDecompressionStream.Destroy;
-begin
- inflateEnd(FZRec);
- inherited Destroy;
-end;
-
-function TDecompressionStream.Read(var Buffer; Count: Longint): Longint;
-begin
- FZRec.next_out := @Buffer;
- FZRec.avail_out := Count;
- if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
- while (FZRec.avail_out > 0) do
- begin
- if FZRec.avail_in = 0 then
- begin
- FZRec.avail_in := FStrm.Read(FBuffer, sizeof(FBuffer));
- if FZRec.avail_in = 0 then
- begin
- Result := Count - FZRec.avail_out;
- Exit;
- end;
- FZRec.next_in := FBuffer;
- FStrmPos := FStrm.Position;
- Progress(Self);
- end;
- DCheck(inflate(FZRec, 0));
- end;
- Result := Count;
-end;
-
-function TDecompressionStream.Write(const Buffer; Count: Longint): Longint;
-begin
- raise EDecompressionError.Create('Invalid stream operation');
-end;
-
-function TDecompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
-var
- I: Integer;
- Buf: array [0..4095] of Char;
-begin
- if (Offset = 0) and (Origin = soFromBeginning) then
- begin
- DCheck(inflateReset(FZRec));
- FZRec.next_in := FBuffer;
- FZRec.avail_in := 0;
- FStrm.Position := 0;
- FStrmPos := 0;
- end
- else if ( (Offset >= 0) and (Origin = soFromCurrent)) or
- ( ((Offset - FZRec.total_out) > 0) and (Origin = soFromBeginning)) then
- begin
- if Origin = soFromBeginning then Dec(Offset, FZRec.total_out);
- if Offset > 0 then
- begin
- for I := 1 to Offset div sizeof(Buf) do
- ReadBuffer(Buf, sizeof(Buf));
- ReadBuffer(Buf, Offset mod sizeof(Buf));
- end;
- end
- else
- raise EDecompressionError.Create('Invalid stream operation');
- Result := FZRec.total_out;
-end;
-
-end.
diff --git a/tests/examplefiles/test.php b/tests/examplefiles/test.php
deleted file mode 100644
index e8efdc6a..00000000
--- a/tests/examplefiles/test.php
+++ /dev/null
@@ -1,544 +0,0 @@
-<?php
-
-$disapproval_ಠ_ಠ_of_php = 'unicode var';
-
-$test = function($a) { $lambda = 1; }
-
-/**
- * Zip class file
- *
- * @package fnord.bb
- * @subpackage archive
- */
-
-// Unlock?
-if(!defined('UNLOCK') || !UNLOCK)
- die();
-
-// Load the parent archive class
-require_once(ROOT_PATH.'/classes/archive.class.php');
-
-class Zip\Zippಠ_ಠ_ {
-
-}
-
-/**
- * Zip class
- *
- * @author Manni <manni@fnord.name>
- * @copyright Copyright (c) 2006, Manni
- * @version 1.0
- * @link http://www.pkware.com/business_and_developers/developer/popups/appnote.txt
- * @link http://mannithedark.is-a-geek.net/
- * @since 1.0
- * @package fnord.bb
- * @subpackage archive
- */
-class Zip extends Archive {
- /**
- * Outputs the zip file
- *
- * This function creates the zip file with the dirs and files given.
- * If the optional parameter $file is given, the zip file is will be
- * saved at that location. Otherwise the function returns the zip file's content.
- *
- * @access public
- *
- * @link http://www.pkware.com/business_and_developers/developer/popups/appnote.txt
- * @param string $filename The path where the zip file will be saved
- *
- * @return bool|string Returns either true if the fil is sucessfully created or the content of the zip file
- */
- function out($filename = false) {
- // Empty output
- $file_data = array(); // Data of the file part
- $cd_data = array(); // Data of the central directory
-
- // Sort dirs and files by path length
- uksort($this->dirs, 'sort_by_length');
- uksort($this->files, 'sort_by_length');
-
- // Handle dirs
- foreach($this->dirs as $dir) {
- $dir .= '/';
- // File part
-
- // Reset dir data
- $dir_data = '';
-
- // Local file header
- $dir_data .= "\x50\x4b\x03\x04"; // Local file header signature
- $dir_data .= pack("v", 10); // Version needed to extract
- $dir_data .= pack("v", 0); // General purpose bit flag
- $dir_data .= pack("v", 0); // Compression method
- $dir_data .= pack("v", 0); // Last mod file time
- $dir_data .= pack("v", 0); // Last mod file date
- $dir_data .= pack("V", 0); // crc-32
- $dir_data .= pack("V", 0); // Compressed size
- $dir_data .= pack("V", 0); // Uncompressed size
- $dir_data .= pack("v", strlen($dir)); // File name length
- $dir_data .= pack("v", 0); // Extra field length
-
- $dir_data .= $dir; // File name
- $dir_data .= ''; // Extra field (is empty)
-
- // File data
- $dir_data .= ''; // Dirs have no file data
-
- // Data descriptor
- $dir_data .= pack("V", 0); // crc-32
- $dir_data .= pack("V", 0); // Compressed size
- $dir_data .= pack("V", 0); // Uncompressed size
-
- // Save current offset
- $offset = strlen(implode('', $file_data));
-
- // Append dir data to the file part
- $file_data[] = $dir_data;
-
- // Central directory
-
- // Reset dir data
- $dir_data = '';
-
- // File header
- $dir_data .= "\x50\x4b\x01\x02"; // Local file header signature
- $dir_data .= pack("v", 0); // Version made by
- $dir_data .= pack("v", 10); // Version needed to extract
- $dir_data .= pack("v", 0); // General purpose bit flag
- $dir_data .= pack("v", 0); // Compression method
- $dir_data .= pack("v", 0); // Last mod file time
- $dir_data .= pack("v", 0); // Last mod file date
- $dir_data .= pack("V", 0); // crc-32
- $dir_data .= pack("V", 0); // Compressed size
- $dir_data .= pack("V", 0); // Uncompressed size
- $dir_data .= pack("v", strlen($dir)); // File name length
- $dir_data .= pack("v", 0); // Extra field length
- $dir_data .= pack("v", 0); // File comment length
- $dir_data .= pack("v", 0); // Disk number start
- $dir_data .= pack("v", 0); // Internal file attributes
- $dir_data .= pack("V", 16); // External file attributes
- $dir_data .= pack("V", $offset); // Relative offset of local header
-
- $dir_data .= $dir; // File name
- $dir_data .= ''; // Extra field (is empty)
- $dir_data .= ''; // File comment (is empty)
-
- /*
- // Data descriptor
- $dir_data .= pack("V", 0); // crc-32
- $dir_data .= pack("V", 0); // Compressed size
- $dir_data .= pack("V", 0); // Uncompressed size
- */
-
- // Append dir data to the central directory data
- $cd_data[] = $dir_data;
- }
-
- // Handle files
- foreach($this->files as $name => $file) {
- // Get values
- $content = $file[0];
-
- // File part
-
- // Reset file data
- $fd = '';
-
- // Detect possible compressions
- // Use deflate
- if(function_exists('gzdeflate')) {
- $method = 8;
-
- // Compress file content
- $compressed_data = gzdeflate($content);
-
- // Use bzip2
- } elseif(function_exists('bzcompress')) {
- $method = 12;
-
- // Compress file content
- $compressed_data = bzcompress($content);
-
- // No compression
- } else {
- $method = 0;
-
- // Do not compress the content :P
- $compressed_data = $content;
- }
-
- // Local file header
- $fd .= "\x50\x4b\x03\x04"; // Local file header signature
- $fd .= pack("v", 20); // Version needed to extract
- $fd .= pack("v", 0); // General purpose bit flag
- $fd .= pack("v", $method); // Compression method
- $fd .= pack("v", 0); // Last mod file time
- $fd .= pack("v", 0); // Last mod file date
- $fd .= pack("V", crc32($content)); // crc-32
- $fd .= pack("V", strlen($compressed_data)); // Compressed size
- $fd .= pack("V", strlen($content)); // Uncompressed size
- $fd .= pack("v", strlen($name)); // File name length
- $fd .= pack("v", 0); // Extra field length
-
- $fd .= $name; // File name
- $fd .= ''; // Extra field (is empty)
-
- // File data
- $fd .= $compressed_data;
-
- // Data descriptor
- $fd .= pack("V", crc32($content)); // crc-32
- $fd .= pack("V", strlen($compressed_data)); // Compressed size
- $fd .= pack("V", strlen($content)); // Uncompressed size
-
- // Save current offset
- $offset = strlen(implode('', $file_data));
-
- // Append file data to the file part
- $file_data[] = $fd;
-
- // Central directory
-
- // Reset file data
- $fd = '';
-
- // File header
- $fd .= "\x50\x4b\x01\x02"; // Local file header signature
- $fd .= pack("v", 0); // Version made by
- $fd .= pack("v", 20); // Version needed to extract
- $fd .= pack("v", 0); // General purpose bit flag
- $fd .= pack("v", $method); // Compression method
- $fd .= pack("v", 0); // Last mod file time
- $fd .= pack("v", 0); // Last mod file date
- $fd .= pack("V", crc32($content)); // crc-32
- $fd .= pack("V", strlen($compressed_data)); // Compressed size
- $fd .= pack("V", strlen($content)); // Uncompressed size
- $fd .= pack("v", strlen($name)); // File name length
- $fd .= pack("v", 0); // Extra field length
- $fd .= pack("v", 0); // File comment length
- $fd .= pack("v", 0); // Disk number start
- $fd .= pack("v", 0); // Internal file attributes
- $fd .= pack("V", 32); // External file attributes
- $fd .= pack("V", $offset); // Relative offset of local header
-
- $fd .= $name; // File name
- $fd .= ''; // Extra field (is empty)
- $fd .= ''; // File comment (is empty)
-
- /*
- // Data descriptor
- $fd .= pack("V", crc32($content)); // crc-32
- $fd .= pack("V", strlen($compressed_data)); // Compressed size
- $fd .= pack("V", strlen($content)); // Uncompressed size
- */
-
- // Append file data to the central directory data
- $cd_data[] = $fd;
- }
-
- // Digital signature
- $digital_signature = '';
- $digital_signature .= "\x50\x4b\x05\x05"; // Header signature
- $digital_signature .= pack("v", 0); // Size of data
- $digital_signature .= ''; // Signature data (is empty)
-
- $tmp_file_data = implode('', $file_data); // File data
- $tmp_cd_data = implode('', $cd_data). // Central directory
- $digital_signature; // Digital signature
-
- // End of central directory
- $eof_cd = '';
- $eof_cd .= "\x50\x4b\x05\x06"; // End of central dir signature
- $eof_cd .= pack("v", 0); // Number of this disk
- $eof_cd .= pack("v", 0); // Number of the disk with the start of the central directory
- $eof_cd .= pack("v", count($cd_data)); // Total number of entries in the central directory on this disk
- $eof_cd .= pack("v", count($cd_data)); // Total number of entries in the central directory
- $eof_cd .= pack("V", strlen($tmp_cd_data)); // Size of the central directory
- $eof_cd .= pack("V", strlen($tmp_file_data)); // Offset of start of central directory with respect to the starting disk number
- $eof_cd .= pack("v", 0); // .ZIP file comment length
- $eof_cd .= ''; // .ZIP file comment (is empty)
-
- // Content of the zip file
- $data = $tmp_file_data.
- // $extra_data_record.
- $tmp_cd_data.
- $eof_cd;
-
- // Return content?
- if(!$filename)
- return $data;
-
- // Write to file
- return file_put_contents($filename, $data);
- }
-
- /**
- * Load a zip file
- *
- * This function loads the files and dirs from a zip file from the harddrive.
- *
- * @access public
- *
- * @param string $file The path to the zip file
- * @param bool $reset Reset the files and dirs before adding the zip file's content?
- *
- * @return bool Returns true if the file was loaded sucessfully
- */
- function load_file($file, $reset = true) {
- // Check whether the file exists
- if(!file_exists($file))
- return false;
-
- // Load the files content
- $content = @file_get_contents($file);
-
- // Return false if the file cannot be opened
- if(!$content)
- return false;
-
- // Read the zip
- return $this->load_string($content, $reset);
- }
-
- /**
- * Load a zip string
- *
- * This function loads the files and dirs from a string
- *
- * @access public
- *
- * @param string $string The string the zip is generated from
- * @param bool $reset Reset the files and dirs before adding the zip file's content?
- *
- * @return bool Returns true if the string was loaded sucessfully
- */
- function load_string($string, $reset = true) {
- // Reset the zip?
- if($reset) {
- $this->dirs = array();
- $this->files = array();
- }
-
- // Get the starting position of the end of central directory record
- $start = strpos($string, "\x50\x4b\x05\x06");
-
- // Error
- if($start === false)
- die('Could not find the end of central directory record');
-
- // Get the ecdr
- $eof_cd = substr($string, $start+4, 18);
-
- // Unpack the ecdr infos
- $eof_cd = unpack('vdisc1/'.
- 'vdisc2/'.
- 'ventries1/'.
- 'ventries2/'.
- 'Vsize/'.
- 'Voffset/'.
- 'vcomment_lenght', $eof_cd);
-
- // Do not allow multi disc zips
- if($eof_cd['disc1'] != 0)
- die('multi disk stuff is not yet implemented :/');
-
- // Save the interesting values
- $cd_entries = $eof_cd['entries1'];
- $cd_size = $eof_cd['size'];
- $cd_offset = $eof_cd['offset'];
-
- // Get the central directory record
- $cdr = substr($string, $cd_offset, $cd_size);
-
- // Reset the position and the list of the entries
- $pos = 0;
- $entries = array();
-
- // Handle cdr
- while($pos < strlen($cdr)) {
- // Check header signature
- // Digital signature
- if(substr($cdr, $pos, 4) == "\x50\x4b\x05\x05") {
- // Get digital signature size
- $tmp_info = unpack('vsize', substr($cdr, $pos + 4, 2));
-
- // Read out the digital signature
- $digital_sig = substr($header, $pos + 6, $tmp_info['size']);
-
- break;
- }
-
- // Get file header
- $header = substr($cdr, $pos, 46);
-
- // Unpack the header information
- $header_info = @unpack('Vheader/'.
- 'vversion_made_by/'.
- 'vversion_needed/'.
- 'vgeneral_purpose/'.
- 'vcompression_method/'.
- 'vlast_mod_time/'.
- 'vlast_mod_date/'.
- 'Vcrc32/'.
- 'Vcompressed_size/'.
- 'Vuncompressed_size/'.
- 'vname_length/'.
- 'vextra_length/'.
- 'vcomment_length/'.
- 'vdisk_number/'.
- 'vinternal_attributes/'.
- 'Vexternal_attributes/'.
- 'Voffset',
- $header);
-
- // Valid header?
- if($header_info['header'] != 33639248)
- return false;
-
- // New position
- $pos += 46;
-
- // Read out the file name
- $header_info['name'] = substr($cdr, $pos, $header_info['name_length']);
-
- // New position
- $pos += $header_info['name_length'];
-
- // Read out the extra stuff
- $header_info['extra'] = substr($cdr, $pos, $header_info['extra_length']);
-
- // New position
- $pos += $header_info['extra_length'];
-
- // Read out the comment
- $header_info['comment'] = substr($cdr, $pos, $header_info['comment_length']);
-
- // New position
- $pos += $header_info['comment_length'];
-
- // Append this file/dir to the entry list
- $entries[] = $header_info;
- }
-
- // Check whether all entries where read sucessfully
- if(count($entries) != $cd_entries)
- return false;
-
- // Handle files/dirs
- foreach($entries as $entry) {
- // Is a dir?
- if($entry['external_attributes'] & 16) {
- $this->add_dir($entry['name']);
- continue;
- }
-
- // Get local file header
- $header = substr($string, $entry['offset'], 30);
-
- // Unpack the header information
- $header_info = @unpack('Vheader/'.
- 'vversion_needed/'.
- 'vgeneral_purpose/'.
- 'vcompression_method/'.
- 'vlast_mod_time/'.
- 'vlast_mod_date/'.
- 'Vcrc32/'.
- 'Vcompressed_size/'.
- 'Vuncompressed_size/'.
- 'vname_length/'.
- 'vextra_length',
- $header);
-
- // Valid header?
- if($header_info['header'] != 67324752)
- return false;
-
- // Get content start position
- $start = $entry['offset'] + 30 + $header_info['name_length'] + $header_info['extra_length'];
-
- // Get the compressed data
- $data = substr($string, $start, $header_info['compressed_size']);
-
- // Detect compression type
- switch($header_info['compression_method']) {
- // No compression
- case 0:
- // Ne decompression needed
- $content = $data;
- break;
-
- // Gzip
- case 8:
- if(!function_exists('gzinflate'))
- return false;
-
- // Uncompress data
- $content = gzinflate($data);
- break;
-
- // Bzip2
- case 12:
- if(!function_exists('bzdecompress'))
- return false;
-
- // Decompress data
- $content = bzdecompress($data);
- break;
-
- // Compression not supported -> error
- default:
- return false;
- }
-
- // Try to add file
- if(!$this->add_file($entry['name'], $content))
- return false;
- }
-
- return true;
- }
-}
-
-function &byref() {
- $x = array();
- return $x;
-}
-
-// Test highlighting of magic methods and variables
-class MagicClass {
- public $magic_str;
- public $ordinary_str;
-
- public function __construct($some_var) {
- $this->magic_str = __FILE__;
- $this->ordinary_str = $some_var;
- }
-
- public function __toString() {
- return $this->magic_str;
- }
-
- public function nonMagic() {
- return $this->ordinary_str;
- }
-}
-
-$magic = new MagicClass(__DIR__);
-__toString();
-$magic->nonMagic();
-$magic->__toString();
-
- echo <<<EOF
-
- Test the heredocs...
-
- EOF;
-
-echo <<<"some_delimiter"
-more heredoc testing
-continues on this line
-some_delimiter;
-
-?>
-
diff --git a/tests/examplefiles/test.pig b/tests/examplefiles/test.pig
deleted file mode 100644
index f67b0268..00000000
--- a/tests/examplefiles/test.pig
+++ /dev/null
@@ -1,148 +0,0 @@
-/**
- * This script is an example recommender (using made up data) showing how you might modify item-item links
- * by defining similar relations between items in a dataset and customizing the change in weighting.
- * This example creates metadata by using the genre field as the metadata_field. The items with
- * the same genre have it's weight cut in half in order to boost the signals of movies that do not have the same genre.
- * This technique requires a customization of the standard GetItemItemRecommendations macro
- */
-import 'recommenders.pig';
-
-
-
-%default INPUT_PATH_PURCHASES '../data/retail/purchases.json'
-%default INPUT_PATH_WISHLIST '../data/retail/wishlists.json'
-%default INPUT_PATH_INVENTORY '../data/retail/inventory.json'
-%default OUTPUT_PATH '../data/retail/out/modify_item_item'
-
-
-/******** Custom GetItemItemRecommnedations *********/
-define recsys__GetItemItemRecommendations_ModifyCustom(user_item_signals, metadata) returns item_item_recs {
-
- -- Convert user_item_signals to an item_item_graph
- ii_links_raw, item_weights = recsys__BuildItemItemGraph(
- $user_item_signals,
- $LOGISTIC_PARAM,
- $MIN_LINK_WEIGHT,
- $MAX_LINKS_PER_USER
- );
- -- NOTE this function is added in order to combine metadata with item-item links
- -- See macro for more detailed explination
- ii_links_metadata = recsys__AddMetadataToItemItemLinks(
- ii_links_raw,
- $metadata
- );
-
- /********* Custom Code starts here ********/
-
- --The code here should adjust the weights based on an item-item link and the equality of metadata.
- -- In this case, if the metadata is the same, the weight is reduced. Otherwise the weight is left alone.
- ii_links_adjusted = foreach ii_links_metadata generate item_A, item_B,
- -- the amount of weight adjusted is dependant on the domain of data and what is expected
- -- It is always best to adjust the weight by multiplying it by a factor rather than addition with a constant
- (metadata_B == metadata_A ? (weight * 0.5): weight) as weight;
-
-
- /******** Custom Code stops here *********/
-
- -- remove negative numbers just incase
- ii_links_adjusted_filt = foreach ii_links_adjusted generate item_A, item_B,
- (weight <= 0 ? 0: weight) as weight;
- -- Adjust the weights of the graph to improve recommendations.
- ii_links = recsys__AdjustItemItemGraphWeight(
- ii_links_adjusted_filt,
- item_weights,
- $BAYESIAN_PRIOR
- );
-
- -- Use the item-item graph to create item-item recommendations.
- $item_item_recs = recsys__BuildItemItemRecommendationsFromGraph(
- ii_links,
- $NUM_RECS_PER_ITEM,
- $NUM_RECS_PER_ITEM
- );
-};
-
-
-/******* Load Data **********/
-
---Get purchase signals
-purchase_input = load '$INPUT_PATH_PURCHASES' using org.apache.pig.piggybank.storage.JsonLoader(
- 'row_id: int,
- movie_id: chararray,
- movie_name: chararray,
- user_id: chararray,
- purchase_price: int');
-
---Get wishlist signals
-wishlist_input = load '$INPUT_PATH_WISHLIST' using org.apache.pig.piggybank.storage.JsonLoader(
- 'row_id: int,
- movie_id: chararray,
- movie_name: chararray,
- user_id: chararray');
-
-
-/******* Convert Data to Signals **********/
-
--- Start with choosing 1 as max weight for a signal.
-purchase_signals = foreach purchase_input generate
- user_id as user,
- movie_name as item,
- 1.0 as weight;
-
-
--- Start with choosing 0.5 as weight for wishlist items because that is a weaker signal than
--- purchasing an item.
-wishlist_signals = foreach wishlist_input generate
- user_id as user,
- movie_name as item,
- 0.5 as weight;
-
-user_signals = union purchase_signals, wishlist_signals;
-
-
-/******** Changes for Modifying item-item links ******/
-inventory_input = load '$INPUT_PATH_INVENTORY' using org.apache.pig.piggybank.storage.JsonLoader(
- 'movie_title: chararray,
- genres: bag{tuple(content:chararray)}');
-
-
-metadata = foreach inventory_input generate
- FLATTEN(genres) as metadata_field,
- movie_title as item;
--- requires the macro to be written seperately
- --NOTE this macro is defined within this file for clarity
-item_item_recs = recsys__GetItemItemRecommendations_ModifyCustom(user_signals, metadata);
-/******* No more changes ********/
-
-
-user_item_recs = recsys__GetUserItemRecommendations(user_signals, item_item_recs);
-
---Completely unrelated code stuck in the middle
-data = LOAD 's3n://my-s3-bucket/path/to/responses'
- USING org.apache.pig.piggybank.storage.JsonLoader();
-responses = FOREACH data GENERATE object#'response' AS response: map[];
-out = FOREACH responses
- GENERATE response#'id' AS id: int, response#'thread' AS thread: chararray,
- response#'comments' AS comments: {t: (comment: chararray)};
-STORE out INTO 's3n://path/to/output' USING PigStorage('|');
-
-
-/******* Store recommendations **********/
-
--- If your output folder exists already, hadoop will refuse to write data to it.
-
-rmf $OUTPUT_PATH/item_item_recs;
-rmf $OUTPUT_PATH/user_item_recs;
-
-store item_item_recs into '$OUTPUT_PATH/item_item_recs' using PigStorage();
-store user_item_recs into '$OUTPUT_PATH/user_item_recs' using PigStorage();
-
--- STORE the item_item_recs into dynamo
-STORE item_item_recs
- INTO '$OUTPUT_PATH/unused-ii-table-data'
-USING com.mortardata.pig.storage.DynamoDBStorage('$II_TABLE', '$AWS_ACCESS_KEY_ID', '$AWS_SECRET_ACCESS_KEY');
-
--- STORE the user_item_recs into dynamo
-STORE user_item_recs
- INTO '$OUTPUT_PATH/unused-ui-table-data'
-USING com.mortardata.pig.storage.DynamoDBStorage('$UI_TABLE', '$AWS_ACCESS_KEY_ID', '$AWS_SECRET_ACCESS_KEY');
diff --git a/tests/examplefiles/test.plot b/tests/examplefiles/test.plot
deleted file mode 100644
index cef0f908..00000000
--- a/tests/examplefiles/test.plot
+++ /dev/null
@@ -1,333 +0,0 @@
-#
-# $Id: prob2.dem,v 1.9 2006/06/14 03:24:09 sfeam Exp $
-#
-# Demo Statistical Approximations version 1.1
-#
-# Copyright (c) 1991, Jos van der Woude, jvdwoude@hut.nl
-
-# History:
-# -- --- 1991 Jos van der Woude: 1st version
-# 06 Jun 2006 Dan Sebald: Added plot methods for better visual effect.
-
-print ""
-print ""
-print ""
-print ""
-print ""
-print ""
-print " Statistical Approximations, version 1.1"
-print ""
-print " Copyright (c) 1991, 1992, Jos van de Woude, jvdwoude@hut.nl"
-print ""
-print ""
-print ""
-print ""
-print ""
-print ""
-print ""
-print ""
-print ""
-print ""
-print ""
-print " NOTE: contains 10 plots and consequently takes some time to run"
-print " Press Ctrl-C to exit right now"
-print ""
-pause -1 " Press Return to start demo ..."
-
-load "stat.inc"
-rnd(x) = floor(x+0.5)
-r_xmin = -1
-r_sigma = 4.0
-
-# Binomial PDF using normal approximation
-n = 25; p = 0.15
-mu = n * p
-sigma = sqrt(n * p * (1.0 - p))
-xmin = floor(mu - r_sigma * sigma)
-xmin = xmin < r_xmin ? r_xmin : xmin
-xmax = ceil(mu + r_sigma * sigma)
-ymax = 1.1 * binom(floor((n+1)*p), n, p) #mode of binomial PDF used
-set key box
-unset zeroaxis
-set xrange [xmin - 1 : xmax + 1]
-set yrange [0 : ymax]
-set xlabel "k, x ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%2.0f"
-set format y "%3.2f"
-set sample 200
-set title "binomial PDF using normal approximation"
-set arrow from mu, 0 to mu, normal(mu, mu, sigma) nohead
-set arrow from mu, normal(mu + sigma, mu, sigma) \
- to mu + sigma, normal(mu + sigma, mu, sigma) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, normal(mu + sigma, mu, sigma)
-plot binom(rnd(x), n, p) with histeps, normal(x, mu, sigma)
-pause -1 "Hit return to continue"
-unset arrow
-unset label
-
-# Binomial PDF using poisson approximation
-n = 50; p = 0.1
-mu = n * p
-sigma = sqrt(mu)
-xmin = floor(mu - r_sigma * sigma)
-xmin = xmin < r_xmin ? r_xmin : xmin
-xmax = ceil(mu + r_sigma * sigma)
-ymax = 1.1 * binom(floor((n+1)*p), n, p) #mode of binomial PDF used
-set key box
-unset zeroaxis
-set xrange [xmin - 1 : xmax + 1]
-set yrange [0 : ymax]
-set xlabel "k ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%2.0f"
-set format y "%3.2f"
-set sample (xmax - xmin + 3)
-set title "binomial PDF using poisson approximation"
-set arrow from mu, 0 to mu, normal(mu, mu, sigma) nohead
-set arrow from mu, normal(mu + sigma, mu, sigma) \
- to mu + sigma, normal(mu + sigma, mu, sigma) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, normal(mu + sigma, mu, sigma)
-plot binom(x, n, p) with histeps, poisson(x, mu) with histeps
-pause -1 "Hit return to continue"
-unset arrow
-unset label
-
-# Geometric PDF using gamma approximation
-p = 0.3
-mu = (1.0 - p) / p
-sigma = sqrt(mu / p)
-lambda = p
-rho = 1.0 - p
-xmin = floor(mu - r_sigma * sigma)
-xmin = xmin < r_xmin ? r_xmin : xmin
-xmax = ceil(mu + r_sigma * sigma)
-ymax = 1.1 * p
-set key box
-unset zeroaxis
-set xrange [xmin - 1 : xmax + 1]
-set yrange [0 : ymax]
-set xlabel "k, x ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%2.0f"
-set format y "%3.2f"
-set sample 200
-set title "geometric PDF using gamma approximation"
-set arrow from mu, 0 to mu, gmm(mu, rho, lambda) nohead
-set arrow from mu, gmm(mu + sigma, rho, lambda) \
- to mu + sigma, gmm(mu + sigma, rho, lambda) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, gmm(mu + sigma, rho, lambda)
-plot geometric(rnd(x),p) with histeps, gmm(x, rho, lambda)
-pause -1 "Hit return to continue"
-unset arrow
-unset label
-
-# Geometric PDF using normal approximation
-p = 0.3
-mu = (1.0 - p) / p
-sigma = sqrt(mu / p)
-xmin = floor(mu - r_sigma * sigma)
-xmin = xmin < r_xmin ? r_xmin : xmin
-xmax = ceil(mu + r_sigma * sigma)
-ymax = 1.1 * p
-set key box
-unset zeroaxis
-set xrange [xmin - 1 : xmax + 1]
-set yrange [0 : ymax]
-set xlabel "k, x ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%2.0f"
-set format y "%3.2f"
-set sample 200
-set title "geometric PDF using normal approximation"
-set arrow from mu, 0 to mu, normal(mu, mu, sigma) nohead
-set arrow from mu, normal(mu + sigma, mu, sigma) \
- to mu + sigma, normal(mu + sigma, mu, sigma) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, normal(mu + sigma, mu, sigma)
-plot geometric(rnd(x),p) with histeps, normal(x, mu, sigma)
-pause -1 "Hit return to continue"
-unset arrow
-unset label
-
-# Hypergeometric PDF using binomial approximation
-nn = 75; mm = 25; n = 10
-p = real(mm) / nn
-mu = n * p
-sigma = sqrt(real(nn - n) / (nn - 1.0) * n * p * (1.0 - p))
-xmin = floor(mu - r_sigma * sigma)
-xmin = xmin < r_xmin ? r_xmin : xmin
-xmax = ceil(mu + r_sigma * sigma)
-ymax = 1.1 * hypgeo(floor(mu), nn, mm, n) #mode of binom PDF used
-set key box
-unset zeroaxis
-set xrange [xmin - 1 : xmax + 1]
-set yrange [0 : ymax]
-set xlabel "k ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%2.0f"
-set format y "%3.2f"
-set sample (xmax - xmin + 3)
-set title "hypergeometric PDF using binomial approximation"
-set arrow from mu, 0 to mu, binom(floor(mu), n, p) nohead
-set arrow from mu, binom(floor(mu + sigma), n, p) \
- to mu + sigma, binom(floor(mu + sigma), n, p) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, binom(floor(mu + sigma), n, p)
-plot hypgeo(x, nn, mm, n) with histeps, binom(x, n, p) with histeps
-pause -1 "Hit return to continue"
-unset arrow
-unset label
-
-# Hypergeometric PDF using normal approximation
-nn = 75; mm = 25; n = 10
-p = real(mm) / nn
-mu = n * p
-sigma = sqrt(real(nn - n) / (nn - 1.0) * n * p * (1.0 - p))
-xmin = floor(mu - r_sigma * sigma)
-xmin = xmin < r_xmin ? r_xmin : xmin
-xmax = ceil(mu + r_sigma * sigma)
-ymax = 1.1 * hypgeo(floor(mu), nn, mm, n) #mode of binom PDF used
-set key box
-unset zeroaxis
-set xrange [xmin - 1 : xmax + 1]
-set yrange [0 : ymax]
-set xlabel "k, x ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%2.0f"
-set format y "%3.2f"
-set sample 200
-set title "hypergeometric PDF using normal approximation"
-set arrow from mu, 0 to mu, normal(mu, mu, sigma) nohead
-set arrow from mu, normal(mu + sigma, mu, sigma) \
- to mu + sigma, normal(mu + sigma, mu, sigma) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, normal(mu + sigma, mu, sigma)
-plot hypgeo(rnd(x), nn, mm, n) with histeps, normal(x, mu, sigma)
-pause -1 "Hit return to continue"
-unset arrow
-unset label
-
-# Negative binomial PDF using gamma approximation
-r = 8; p = 0.6
-mu = r * (1.0 - p) / p
-sigma = sqrt(mu / p)
-lambda = p
-rho = r * (1.0 - p)
-xmin = floor(mu - r_sigma * sigma)
-xmin = xmin < r_xmin ? r_xmin : xmin
-xmax = ceil(mu + r_sigma * sigma)
-ymax = 1.1 * gmm((rho - 1) / lambda, rho, lambda) #mode of gamma PDF used
-set key box
-unset zeroaxis
-set xrange [xmin - 1 : xmax + 1]
-set yrange [0 : ymax]
-set xlabel "k, x ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%2.0f"
-set format y "%3.2f"
-set sample 200
-set title "negative binomial PDF using gamma approximation"
-set arrow from mu, 0 to mu, gmm(mu, rho, lambda) nohead
-set arrow from mu, gmm(mu + sigma, rho, lambda) \
- to mu + sigma, gmm(mu + sigma, rho, lambda) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, gmm(mu + sigma, rho, lambda)
-plot negbin(rnd(x), r, p) with histeps, gmm(x, rho, lambda)
-pause -1 "Hit return to continue"
-unset arrow
-unset label
-
-# Negative binomial PDF using normal approximation
-r = 8; p = 0.4
-mu = r * (1.0 - p) / p
-sigma = sqrt(mu / p)
-xmin = floor(mu - r_sigma * sigma)
-xmin = xmin < r_xmin ? r_xmin : xmin
-xmax = ceil(mu + r_sigma * sigma)
-ymax = 1.1 * negbin(floor((r-1)*(1-p)/p), r, p) #mode of gamma PDF used
-set key box
-unset zeroaxis
-set xrange [xmin - 1 : xmax + 1]
-set yrange [0 : ymax]
-set xlabel "k, x ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%2.0f"
-set format y "%3.2f"
-set sample 200
-set title "negative binomial PDF using normal approximation"
-set arrow from mu, 0 to mu, normal(mu, mu, sigma) nohead
-set arrow from mu, normal(mu + sigma, mu, sigma) \
- to mu + sigma, normal(mu + sigma, mu, sigma) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, normal(mu + sigma, mu, sigma)
-plot negbin(rnd(x), r, p) with histeps, normal(x, mu, sigma)
-pause -1 "Hit return to continue"
-unset arrow
-unset label
-
-# Normal PDF using logistic approximation
-mu = 1.0; sigma = 1.5
-a = mu
-lambda = pi / (sqrt(3.0) * sigma)
-xmin = mu - r_sigma * sigma
-xmax = mu + r_sigma * sigma
-ymax = 1.1 * logistic(mu, a, lambda) #mode of logistic PDF used
-set key box
-unset zeroaxis
-set xrange [xmin: xmax]
-set yrange [0 : ymax]
-set xlabel "x ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%.1f"
-set format y "%.2f"
-set sample 200
-set title "normal PDF using logistic approximation"
-set arrow from mu,0 to mu, normal(mu, mu, sigma) nohead
-set arrow from mu, normal(mu + sigma, mu, sigma) \
- to mu + sigma, normal(mu + sigma, mu, sigma) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, normal(mu + sigma, mu, sigma)
-plot logistic(x, a, lambda), normal(x, mu, sigma)
-pause -1 "Hit return to continue"
-unset arrow
-unset label
-
-# Poisson PDF using normal approximation
-mu = 5.0
-sigma = sqrt(mu)
-xmin = floor(mu - r_sigma * sigma)
-xmin = xmin < r_xmin ? r_xmin : xmin
-xmax = ceil(mu + r_sigma * sigma)
-ymax = 1.1 * poisson(mu, mu) #mode of poisson PDF used
-set key box
-unset zeroaxis
-set xrange [xmin - 1 : xmax + 1]
-set yrange [0 : ymax]
-set xlabel "k, x ->"
-set ylabel "probability density ->"
-set ytics 0, ymax / 10.0, ymax
-set format x "%2.0f"
-set format y "%3.2f"
-set sample 200
-set title "poisson PDF using normal approximation"
-set arrow from mu, 0 to mu, normal(mu, mu, sigma) nohead
-set arrow from mu, normal(mu + sigma, mu, sigma) \
- to mu + sigma, normal(mu + sigma, mu, sigma) nohead
-set label "mu" at mu + 0.5, ymax / 10
-set label "sigma" at mu + 0.5 + sigma, normal(mu + sigma, mu, sigma)
-plot poisson(rnd(x), mu) with histeps, normal(x, mu, sigma)
-pause -1 "Hit return to continue"
-reset
diff --git a/tests/examplefiles/test.ps1 b/tests/examplefiles/test.ps1
deleted file mode 100644
index 385fb6f4..00000000
--- a/tests/examplefiles/test.ps1
+++ /dev/null
@@ -1,108 +0,0 @@
-<#
-.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.psl b/tests/examplefiles/test.psl
deleted file mode 100644
index 3ac99498..00000000
--- a/tests/examplefiles/test.psl
+++ /dev/null
@@ -1,182 +0,0 @@
-// This is a comment
-
-// 1. Basics
-
-// Functions
-func Add(X : Univ_Integer; Y : Univ_Integer) -> Univ_Integer is
- return X + Y;
-end func Add;
-// End of line semi-colons are optional
-// +, +=, -, -=, *, *=, /, /=
-// all do what you'd expect (/ is integer division)
-
-// If you find Univ_Integer to be too verbose you can import Short_Names
-// which defines aliases like Int for Univ_Integer and String for Univ_String
-import PSL::Short_Names::*, *
-
-func Greetings() is
- const S : String := "Hello, World!"
- Println(S)
-end func Greetings
-// All declarations are 'const', 'var', or 'ref'
-// Assignment is :=, equality checks are ==, and != is not equals
-
-func Boolean_Examples(B : Bool) is
- const And := B and #true // Parallel execution of operands
- const And_Then := B and then #true // Short-Circuit
- const Or := B or #false // Parallel execution of operands
- const Or_Else := B or else #false // Short-Cirtuit
- const Xor := B xor #true
- var Result : Bool := #true;
- Result and= #false;
- Result or= #true;
- Result xor= #false;
-end func Boolean_Examples
-// Booleans are a special type of enumeration
-// All enumerations are preceded by a sharp '#'
-
-func Fib(N : Int) {N >= 0} -> Int is
- if N <= 1 then
- return N
- else
- // Left and right side of '+' are computed in Parallel here
- return Fib(N - 1) + Fib(N - 2)
- end if
-end func Fib
-// '{N >= 0}' is a precondition to this function
-// Preconditions are built in to the language and checked by the compiler
-
-// ParaSail does not have mutable global variables
-// Instead, use 'var' parameters
-func Increment_All(var Nums : Vector<Int>) is
- for each Elem of Nums concurrent loop
- Elem += 1
- end loop
-end func Increment_All
-// The 'concurrent' keyword in the loop header tells the compiler that
-// iterations of the loop can happen in any order.
-// It will choose the most optimal number of threads to use.
-// Other options are 'forward' and 'reverse'.
-
-func Sum_Of_Squares(N : Int) -> Int is
- // The type of Sum is inferred
- var Sum := 0
- for I in 1 .. N forward loop
- Sum += I ** 2 // ** is exponentiation
- end loop
-end func Sum_Of_Squares
-
-func Sum_Of(N : Int; Map : func (Int) -> Int) -> Int is
- return (for I in 1 .. N => <0> + Map(I))
-end func Sum_Of
-// It has functional aspects as well
-// Here, we're taking an (Int) -> Int function as a parameter
-// and using the inherently parallel map-reduce.
-// Initial value is enclosed with angle brackets
-
-func main(Args : Basic_Array<String>) is
- Greetings() // Hello World
- Println(Fib(5)) // 5
- // Container Comprehension
- var Vec : Vector<Int> := [for I in 0 .. 10 {I mod 2 == 0} => I ** 2]
- // Vec = [0, 4, 16, 36, 64, 100]
- Increment_All(Vec)
- // Vec = [1, 5, 17, 37, 65, 101]
- // '|' is an overloaded operator.
- // It's usually used for concatenation or adding to a container
- Println("First: " | Vec[1] | ", Last: " | Vec[Length(Vec)]);
- // Vectors are 1 indexed, 0 indexed ZVectors are also available
-
- Println(Sum_Of_Squares(3))
-
- // Sum of fibs!
- Println(Sum_Of(10, Fib))
-end func main
-
-// Preceding a type with 'optional' allows it to take the value 'null'
-func Divide(A, B, C : Real) -> optional Real is
- // Real is the floating point type
- const Epsilon := 1.0e-6;
- if B in -Epsilon .. Epsilon then
- return null
- elsif C in -Epsilon .. Epsilon then
- return null
- else
- return A / B + A / C
- end if
-end func Divide
-
-// 2. Modules
-// Modules are composed of an interface and a class
-// ParaSail has object orientation features
-
-// modules can be defined as 'concurrent'
-// which allows 'locked' and 'queued' parameters
-concurrent interface Locked_Box<Content_Type is Assignable<>> is
- // Create a box with the given content
- func Create(C : optional Content_Type) -> Locked_Box;
-
- // Put something into the box
- func Put(locked var B : Locked_Box; C : Content_Type);
-
- // Get a copy of current content
- func Content(locked B : Locked_Box) -> optional Content_Type;
-
- // Remove current content, leaving it null
- func Remove(locked var B : Locked_Box) -> optional Content_Type;
-
- // Wait until content is non-null, then return it, leaving it null.
- func Get(queued var B : Locked_Box) -> Content_Type;
-end interface Locked_Box;
-
-concurrent class Locked_Box is
- var Content : optional Content_Type;
-exports
- func Create(C : optional Content_Type) -> Locked_Box is
- return (Content => C);
- end func Create;
-
- func Put(locked var B : Locked_Box; C : Content_Type) is
- B.Content := C;
- end func Put;
-
- func Content(locked B : Locked_Box) -> optional Content_Type is
- return B.Content;
- end func Content;
-
- func Remove(locked var B : Locked_Box) -> Result : optional Content_Type is
- // '<==' is the move operator
- // It moves the right operand into the left operand,
- // leaving the right null.
- Result <== B.Content;
- end func Remove;
-
- func Get(queued var B : Locked_Box) -> Result : Content_Type is
- queued until B.Content not null then
- Result <== B.Content;
- end func Get;
-end class Locked_Box;
-
-func Use_Box(Seed : Univ_Integer) is
- var U_Box : Locked_Box<Univ_Integer> := Create(null);
- // The type of 'Ran' can be left out because
- // it is inferred from the return type of Random::Start
- var Ran := Random::Start(Seed);
-
- Println("Starting 100 pico-threads trying to put something in the box");
- Println(" or take something out.");
- for I in 1..100 concurrent loop
- if I < 30 then
- Println("Getting out " | Get(U_Box));
- else
- Println("Putting in " | I);
- U_Box.Put(I);
-
- // The first parameter can be moved to the front with a dot
- // X.Foo(Y) is equivalent to Foo(X, Y)
- end if;
- end loop;
-
- Println("And the winner is: " | Remove(U_Box));
- Println("And the box is now " | Content(U_Box));
-end func Use_Box;
diff --git a/tests/examplefiles/test.pwn b/tests/examplefiles/test.pwn
deleted file mode 100644
index d6468617..00000000
--- a/tests/examplefiles/test.pwn
+++ /dev/null
@@ -1,253 +0,0 @@
-#include <core>
-
-// Single line comment
-/* Multi line
- comment */
-
-/// documentation
-/**
-
- documentation multi line
-
-**/
-
-public OnGameModeInit() {
- printf("Hello, World!");
-}
-
-enum info {
- Float:ex;
- exa,
- exam[5],
-}
-new arr[5][info];
-
-stock Float:test_func()
-{
- new a = 5, Float:b = 10.3;
- if (a == b) {
-
- } else {
-
- }
-
- for (new i = 0; i < 10; i++) {
- continue;
- }
-
- do {
- a--;
- } while (a > 0);
-
- while (a < 5) {
- a++;
- break;
- }
-
- switch (a) {
- case 0: {
- }
- case 0..4: {
- }
- case 5, 6: {
- }
- }
-
- static x;
- new xx = a > 5 ? 5 : 0;
- new array[sizeof arr] = {0};
- tagof a;
- state a;
- goto label;
- new byte[2 char];
- byte{0} = 'a';
-
- return (float(a) + b);
-}
-
-
-// float.inc
-/* Float arithmetic
- *
- * (c) Copyright 1999, Artran, Inc.
- * Written by Greg Garner (gmg@artran.com)
- * Modified in March 2001 to include user defined
- * operators for the floating point functions.
- *
- * This file is provided as is (no warranties).
- */
-#if defined _Float_included
- #endinput
-#endif
-#define _Float_included
-#pragma library Float
-
-/* Different methods of rounding */
-enum floatround_method {
- floatround_round,
- floatround_floor,
- floatround_ceil,
- floatround_tozero,
- floatround_unbiased
-}
-enum anglemode {
- radian,
- degrees,
- grades
-}
-
-/**************************************************/
-/* Convert an integer into a floating point value */
-native Float:float(value);
-
-/**************************************************/
-/* Convert a string into a floating point value */
-native Float:floatstr(const string[]);
-
-/**************************************************/
-/* Multiple two floats together */
-native Float:floatmul(Float:oper1, Float:oper2);
-
-/**************************************************/
-/* Divide the dividend float by the divisor float */
-native Float:floatdiv(Float:dividend, Float:divisor);
-
-/**************************************************/
-/* Add two floats together */
-native Float:floatadd(Float:oper1, Float:oper2);
-
-/**************************************************/
-/* Subtract oper2 float from oper1 float */
-native Float:floatsub(Float:oper1, Float:oper2);
-
-/**************************************************/
-/* Return the fractional part of a float */
-native Float:floatfract(Float:value);
-
-/**************************************************/
-/* Round a float into a integer value */
-native floatround(Float:value, floatround_method:method=floatround_round);
-
-/**************************************************/
-/* Compare two integers. If the two elements are equal, return 0.
- If the first argument is greater than the second argument, return 1,
- If the first argument is less than the second argument, return -1. */
-native floatcmp(Float:oper1, Float:oper2);
-
-/**************************************************/
-/* Return the square root of the input value, same as floatpower(value, 0.5) */
-native Float:floatsqroot(Float:value);
-
-/**************************************************/
-/* Return the value raised to the power of the exponent */
-native Float:floatpower(Float:value, Float:exponent);
-
-/**************************************************/
-/* Return the logarithm */
-native Float:floatlog(Float:value, Float:base=10.0);
-
-/**************************************************/
-/* Return the sine, cosine or tangent. The input angle may be in radian,
- degrees or grades. */
-native Float:floatsin(Float:value, anglemode:mode=radian);
-native Float:floatcos(Float:value, anglemode:mode=radian);
-native Float:floattan(Float:value, anglemode:mode=radian);
-
-/**************************************************/
-/* Return the absolute value */
-native Float:floatabs(Float:value);
-
-
-/**************************************************/
-#pragma rational Float
-
-/* user defined operators */
-native Float:operator*(Float:oper1, Float:oper2) = floatmul;
-native Float:operator/(Float:oper1, Float:oper2) = floatdiv;
-native Float:operator+(Float:oper1, Float:oper2) = floatadd;
-native Float:operator-(Float:oper1, Float:oper2) = floatsub;
-native Float:operator=(oper) = float;
-
-stock Float:operator++(Float:oper)
- return oper+1.0;
-
-stock Float:operator--(Float:oper)
- return oper-1.0;
-
-stock Float:operator-(Float:oper)
- return oper^Float:cellmin; /* IEEE values are sign/magnitude */
-
-stock Float:operator*(Float:oper1, oper2)
- return floatmul(oper1, float(oper2)); /* "*" is commutative */
-
-stock Float:operator/(Float:oper1, oper2)
- return floatdiv(oper1, float(oper2));
-
-stock Float:operator/(oper1, Float:oper2)
- return floatdiv(float(oper1), oper2);
-
-stock Float:operator+(Float:oper1, oper2)
- return floatadd(oper1, float(oper2)); /* "+" is commutative */
-
-stock Float:operator-(Float:oper1, oper2)
- return floatsub(oper1, float(oper2));
-
-stock Float:operator-(oper1, Float:oper2)
- return floatsub(float(oper1), oper2);
-
-stock bool:operator==(Float:oper1, Float:oper2)
- return floatcmp(oper1, oper2) == 0;
-
-stock bool:operator==(Float:oper1, oper2)
- return floatcmp(oper1, float(oper2)) == 0; /* "==" is commutative */
-
-stock bool:operator!=(Float:oper1, Float:oper2)
- return floatcmp(oper1, oper2) != 0;
-
-stock bool:operator!=(Float:oper1, oper2)
- return floatcmp(oper1, float(oper2)) != 0; /* "!=" is commutative */
-
-stock bool:operator>(Float:oper1, Float:oper2)
- return floatcmp(oper1, oper2) > 0;
-
-stock bool:operator>(Float:oper1, oper2)
- return floatcmp(oper1, float(oper2)) > 0;
-
-stock bool:operator>(oper1, Float:oper2)
- return floatcmp(float(oper1), oper2) > 0;
-
-stock bool:operator>=(Float:oper1, Float:oper2)
- return floatcmp(oper1, oper2) >= 0;
-
-stock bool:operator>=(Float:oper1, oper2)
- return floatcmp(oper1, float(oper2)) >= 0;
-
-stock bool:operator>=(oper1, Float:oper2)
- return floatcmp(float(oper1), oper2) >= 0;
-
-stock bool:operator<(Float:oper1, Float:oper2)
- return floatcmp(oper1, oper2) < 0;
-
-stock bool:operator<(Float:oper1, oper2)
- return floatcmp(oper1, float(oper2)) < 0;
-
-stock bool:operator<(oper1, Float:oper2)
- return floatcmp(float(oper1), oper2) < 0;
-
-stock bool:operator<=(Float:oper1, Float:oper2)
- return floatcmp(oper1, oper2) <= 0;
-
-stock bool:operator<=(Float:oper1, oper2)
- return floatcmp(oper1, float(oper2)) <= 0;
-
-stock bool:operator<=(oper1, Float:oper2)
- return floatcmp(float(oper1), oper2) <= 0;
-
-stock bool:operator!(Float:oper)
- return (_:oper & cellmax) == 0;
-
-/* forbidden operations */
-forward operator%(Float:oper1, Float:oper2);
-forward operator%(Float:oper1, oper2);
-forward operator%(oper1, Float:oper2);
-
diff --git a/tests/examplefiles/test.pypylog b/tests/examplefiles/test.pypylog
deleted file mode 100644
index 1a6aa5ed..00000000
--- a/tests/examplefiles/test.pypylog
+++ /dev/null
@@ -1,1000 +0,0 @@
-[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>)
diff --git a/tests/examplefiles/test.r3 b/tests/examplefiles/test.r3
deleted file mode 100644
index 707102db..00000000
--- a/tests/examplefiles/test.r3
+++ /dev/null
@@ -1,114 +0,0 @@
-preface.... everything what is before header is not evaluated
-so this should not be colorized:
-1 + 2
-
-REBOL [] ;<- this is minimal header, everything behind it must be colorized
-
-;## String tests ##
-print "Hello ^"World" ;<- with escaped char
-multiline-string: {
- bla bla "bla" {bla}
-}
-char-a: #"a"
-escaped-a: #"^(61)"
-new-line: #"^/"
-
-;## Binaries ##
-print decompress 64#{eJzLSM3JyQcABiwCFQUAAAA=}
-;2#{0000 00000} ;<- this one is invalid!
-2#{}
-#{FF00}
-
-;##Date + time ##
-1-Feb-2009
-1-Feb-2009/2:24:46+1:0
-1:0 1:1:1 -0:1.1
-
-;## Tuple ##
-red: 255.0.0
-red-with-alpha: 255.0.0.100
-
-;## url!, file! and email! ##
-aaa@bbb.cz
-http://
-dns://
-tcp://127.0.0.1
-%/c/rebol/
-%"c:\Program Files\"
-%/c/Program%20Files/
-to-rebol-file "c:\Program Files\"
-suffix? %bla.swf
-
-;## Money ##
-$1
--$1.2
-USA$100
-
-;## Tag! ##
-<a>
-<a href="a()">
-
-;## Pair! ##
-10x200
-
-;## Issue! ##
-type? #ff0000 ;== issue!
-
-;## some numbers ##
-to integer! (1 + (x / 4.5) * 1E-4)
-
-;## some spec comments
-1 + 1
-comment "aa"
-2 + 2
-comment {aa}
-3 + 3
-comment {a^{}
-4 + 4
-comment {{}}
-5 + 5
-comment {
- foo: 6
-}
-6 + 6
-comment [foo: 6]
-7 + 7
-comment [foo: "[" ]
-8 + 8
-comment [foo: {^{} ]
-9 + 9
-comment [foo: {boo} ]
-10 + 10
-comment 5-May-2014/11:17:34+2:00
-5-May-2014/11:17:34+2:00 11 + 11
-
-;## other tests ##
----: 1
-x/(1 + n)/y
-b/:1
-
-;## and...
-REBOL [
- purpose: {
- reads css file and creates html from it
- so one can see how the styles looks like
- }
-]
-style: %default
-out: rejoin [{
-<html>
-<head>
- <title>Pygments style: } style {.css</title>
- <link rel="stylesheet" href="} style {.css">
-</head>
-<body>
-<div class="syntax"><pre>
-}]
-css: read/lines join style %.css
-foreach line css [
- parse line [".syntax ." copy c to " " thru "/*" copy t to "*/" to end (
- append out rejoin ["<span class=" c ">" t "</span>^/"])
- ]
-]
-write join style %.html join out "</pre></div></body></html>"
-halt
diff --git a/tests/examplefiles/test.rb b/tests/examplefiles/test.rb
deleted file mode 100644
index 8ac102e6..00000000
--- a/tests/examplefiles/test.rb
+++ /dev/null
@@ -1,177 +0,0 @@
-a.each{|el|anz[el]=anz[el]?anz[el]+1:1}
-while x<10000
-#a bis f dienen dazu die Nachbarschaft festzulegen. Man stelle sich die #Zahl von 1 bis 64 im Binärcode vor 1 bedeutet an 0 aus
- b=(p[x]%32)/16<1 ? 0 : 1
-
- (x-102>=0? n[x-102].to_i : 0)*a+(x-101>=0?n[x-101].to_i : 0)*e+n[x-100].to_i+(x-99>=0? n[x-99].to_i : 0)*f+(x-98>=0? n[x-98].to_i : 0)*a+
- n[x+199].to_i*b+n[x+200].to_i*d+n[x+201].to_i*b
-
-#und die Ausgabe folgt
-g=%w{}
-x=0
-
-#leere regex
-test //, 123
-
-while x<100
- puts"#{g[x]}"
- x+=1
-end
-
-puts""
-sleep(10)
-
-1E1E1
-puts 30.send(:/, 5) # prints 6
-
-# fun with class attributes
-class Foo
- def self.blub x
- if not x.nil?
- self.new
- end
- end
- def another_way_to_get_class
- self.class
- end
-end
-
-# ruby 1.9 "call operator"
-a = Proc.new { 42 }
-a.()
-
-"instance variables can be #@included, #@@class_variables\n and #$globals as well."
-`instance variables can be #@included, #@@class_variables\n and #$globals as well.`
-'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-/instance variables can be #@included, #@@class_variables\n and #$globals as well./mousenix
-:"instance variables can be #@included, #@@class_variables\n and #$globals as well."
-:'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-%'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-%q'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-%Q'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-%w'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-%W'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-%s'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-%r'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-%x'instance variables can be #@included, #@@class_variables\n and #$globals as well.'
-
-#%W[ but #@0illegal_values look strange.]
-
-%s#ruby allows strange#{constructs}
-%s#ruby allows strange#$constructs
-%s#ruby allows strange#@@constructs
-
-##################################################################
-# HEREDOCS
-foo(<<-A, <<-B)
-this is the text of a
-A
-and this is the text of b
-B
-
-a = <<"EOF"
-This is a multiline #$here document
-terminated by EOF on a line by itself
-EOF
-
-a = <<'EOF'
-This is a multiline #$here document
-terminated by EOF on a line by itself
-EOF
-
-b=(p[x] %32)/16<1 ? 0 : 1
-
-<<""
-#{test}
-#@bla
-#die suppe!!!
-\xfffff
-
-
-super <<-EOE % [
- foo
-EOE
-
-<<X
-X
-X
-
-%s(uninter\)pre\ted) # comment here
-%q(uninter\)pre\ted) # comment here
-%Q(inter\)pre\ted) # comment here
-:"inter\)pre\ted" # comment here
-:'uninter\'pre\ted' # comment here
-
-%q[haha! [nesting [rocks] ! ] ] # commeht here
-
-
-##################################################################
-class NP
-def initialize a=@p=[], b=@b=[]; end
-def +@;@b<<1;b2c end;def-@;@b<<0;b2c end
-def b2c;if @b.size==8;c=0;@b.each{|b|c<<=1;c|=b};send(
- 'lave'.reverse,(@p.join))if c==0;@p<< c.chr;@b=[] end
- self end end ; begin _ = NP.new end
-
-
-# Regexes
-/
-this is a
-mutliline
-regex
-/
-
-this /is a
-multiline regex too/
-
-also /4
-is one/
-
-this(/
-too
-/)
-
-# this not
-2 /4
-asfsadf/
-
-
-#from: http://coderay.rubychan.de/rays/show/383
-class Object
- alias :xeq :`
- def `(cmd, p2)
- self.method(cmd.to_sym).call(p2)
- end
-end
-p [1,2,3].`('concat', [4,5,6]) # => [1, 2, 3, 4, 5, 6]
-p [1,2,3].`(:concat, [4,5,6]) # => [1, 2, 3, 4, 5, 6]
-p "Hurra! ".`(:*, 3) # => "Hurra! Hurra! Hurra! "
-p "Hurra! ".`('*', 3) # => "Hurra! Hurra! Hurra! "
-# Leider geht nicht die Wunschform
-# [1,2,3] `concat` [4,5,6]
-
-class Object
- @@infixops = []
- alias :xeq :`
- def addinfix(operator)
- @@infixops << operator
- end
- def `(expression)
- @@infixops.each{|op|break if expression.match(/^(.*?) (#{op}) (.*)$/)}
- raise "unknown infix operator in expression: #{expression}" if $2 == nil
- eval($1).method($2.to_sym).call(eval($3))
- end
-end
-addinfix("concat")
-p `[1,2,3] concat [4,5,6]` # => [1, 2, 3, 4, 5, 6]
-
-
-# HEREDOC FUN!!!!!!!1111
-foo(<<A, <<-B, <<C)
-this is the text of a
- A!!!!
-A
-and this is text of B!!!!!!111
- B
-and here some C
-C
diff --git a/tests/examplefiles/test.rhtml b/tests/examplefiles/test.rhtml
deleted file mode 100644
index d1f61576..00000000
--- a/tests/examplefiles/test.rhtml
+++ /dev/null
@@ -1,43 +0,0 @@
-<table>
- <% rows.each do |row| %>
- <tr class="<%= row.cls %>">
- <td><a href="<%= item.href %>"><%= item.title %></a></td>
- <td><%= item.description %></td>
- </tr>
- <% end %>
-</table>
-
-
-<h1>Pages</h1>
-
-<table id="site-map" class="index" cellpadding="0" cellspacing="0" border="0">
- <thead>
- <tr>
- <th class="page">Page</th>
- <th class="status">Status</th>
- <th class="modify" colspan="2">Modify</th>
- </tr>
- </thead>
- <tbody>
-<% if @homepage -%>
-<%= render_node @homepage -%>
-<% else -%>
- <tr>
- <td colspan="4" class="note">No Pages</td>
- </tr>
-<% end -%>
- </tbody>
-</table>
-<script type="text/javascript">
-// <![CDATA[
- new SiteMap('site-map');
-// ]]>
-</script>
-<form action="<%= clear_cache_url %>" method="post">
- <p>
-<% unless @homepage -%>
- <%= link_to image_tag('new-homepage', :alt => 'New Homepage'), homepage_new_url %>
-<% end -%>
- <%= image_submit_tag 'clear-page-cache' %>
- </p>
-</form>
diff --git a/tests/examplefiles/test.rsl b/tests/examplefiles/test.rsl
deleted file mode 100644
index d6c9fc9a..00000000
--- a/tests/examplefiles/test.rsl
+++ /dev/null
@@ -1,111 +0,0 @@
-scheme COMPILER =
-class
- type
- Prog == mk_Prog(stmt : Stmt),
-
- Stmt ==
- mk_Asgn(ide : Identifier, expr : Expr) |
- mk_If(cond : Expr, s1 : Stmt, s2 : Stmt) |
- mk_Seq(head : Stmt, last : Stmt),
-
- Expr ==
- mk_Const(const : Int) |
- mk_Plus(fst : Expr, snd : Expr) |
- mk_Id(ide : Identifier),
- Identifier = Text
-
-type /* storage for program variables */
- `Sigma = Identifier -m-> Int
-
-value
- m : Prog -> `Sigma -> `Sigma
- m(p)(`sigma) is m(stmt(p))(`sigma),
-
- m : Stmt -> `Sigma -> `Sigma
- m(s)(`sigma) is
- case s of
- mk_Asgn(i, e) -> `sigma !! [i +> m(e)(`sigma)],
- mk_Seq(s1, s2) -> m(s2)(m(s1)(`sigma)),
- mk_If(c, s1, s2) ->
- if m(c)(`sigma) ~= 0 then m(s1)(`sigma) else m(s2)(`sigma) end
- end,
-
- m : Expr -> `Sigma -> Int
- m(e)(`sigma) is
- case e of
- mk_Const(n) -> n,
- mk_Plus(e1, e2) -> m(e1)(`sigma) + m(e2)(`sigma),
- mk_Id(id) -> if id isin dom `sigma then `sigma(id) else 0 end
- end
-
-type
- MProg = Inst-list,
- Inst ==
- mk_Push(ide1 : Identifier) |
- mk_Pop(Unit) |
- mk_Add(Unit) |
- mk_Cnst(val : Int) |
- mk_Store(ide2 : Identifier) |
- mk_Jumpfalse(off1 : Int) |
- mk_Jump(off2 : Int)
-
-
-/* An interpreter for SMALL instructions */
-
-type Stack = Int-list
-value
- I : MProg >< Int >< Stack -> (`Sigma ->`Sigma)
- I(mp, pc, s)(`sigma) is
- if pc <= 0 \/ pc > len mp then `sigma else
- case mp(pc) of
- mk_Push(x) -> if x isin dom `sigma
- then I(mp, pc + 1, <.`sigma(x).> ^ s)(`sigma)
- else I(mp, pc + 1, <.0.> ^ s)(`sigma) end,
- mk_Pop(()) -> if len s = 0 then `sigma
- else I(mp, pc + 1, tl s)(`sigma) end,
- mk_Cnst(n) -> I(mp, pc + 1, <.n.> ^ s)(`sigma),
- mk_Add(()) -> if len s < 2 then `sigma
- else I(mp, pc + 1,<.s(1) + s(2).> ^ tl tl s)(`sigma) end,
- mk_Store(x) -> if len s = 0 then `sigma
- else I(mp, pc + 1, s)(`sigma !! [x +> s(1)]) end,
- mk_Jumpfalse(n) -> if len s = 0 then `sigma
- elsif hd s ~= 0 then I(mp, pc + 1, s)(`sigma)
- else I(mp, pc + n, s)(`sigma) end,
- mk_Jump(n) -> I(mp, pc + n, s)(`sigma)
- end
- end
-
-value
- comp_Prog : Prog -> MProg
- comp_Prog(p) is comp_Stmt(stmt(p)),
-
- comp_Stmt : Stmt -> MProg
- comp_Stmt(s) is
- case s of
- mk_Asgn(id, e) -> comp_Expr(e) ^ <. mk_Store(id), mk_Pop() .>,
- mk_Seq(s1, s2) -> comp_Stmt(s1) ^ comp_Stmt(s2),
- mk_If(e, s1, s2) ->
- let
- ce = comp_Expr(e),
- cs1 = comp_Stmt(s1), cs2 = comp_Stmt(s2)
- in
- ce ^
- <. mk_Jumpfalse(len cs1 + 3) .> ^
- <. mk_Pop() .> ^
- cs1 ^
- <. mk_Jump(len cs2 + 2) .> ^
- <. mk_Pop() .> ^
- cs2
- end
- end,
-
- comp_Expr : Expr -> MProg
- comp_Expr(e) is
- case e of
- mk_Const(n) -> <. mk_Cnst(n) .>,
- mk_Plus(e1, e2) ->
- comp_Expr(e1) ^ comp_Expr(e2) ^ <. mk_Add() .>,
- mk_Id(id) -> <. mk_Push(id) .>
- end
-
-end
diff --git a/tests/examplefiles/test.scaml b/tests/examplefiles/test.scaml
deleted file mode 100644
index 8872a83d..00000000
--- a/tests/examplefiles/test.scaml
+++ /dev/null
@@ -1,8 +0,0 @@
--@ import val city:String = "Tampa"
-- val name:String = "Hiram"
-%html
- %body
- %p Hello #{name} from #{city}
- %ul
- - for ( i <- 1 to 10 )
- %li Item #{i} \ No newline at end of file
diff --git a/tests/examplefiles/test.sco b/tests/examplefiles/test.sco
deleted file mode 100644
index d997c1b3..00000000
--- a/tests/examplefiles/test.sco
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * comment
- */
-; comment
-// comment
-a b C d e f i q s t v x y
-z
-np0 nP1 Np2 NP3
-m/**/label;
-n label
-123 0123456789
-0xabcdef0123456789 0XABCDEF
-1e2 3e+4 5e-6 7E8 9E+0 1E-2 3. 4.56 .789
-"characters$MACRO."
-{ 1 I
- { 2 J
- { 3 K
- $I $J $K
- }
- }
-}
-#include "score.sco"
diff --git a/tests/examplefiles/test.shen b/tests/examplefiles/test.shen
deleted file mode 100644
index 7a254334..00000000
--- a/tests/examplefiles/test.shen
+++ /dev/null
@@ -1,137 +0,0 @@
-(package pygments-test [some symbols]
-
-\* multiline
- comment
-*\
-
-\\ With vars as functions
-
-(define super
- [Value Succ End] Action Combine Zero ->
- (if (End Value)
- Zero
- (Combine (Action Value)
- (super [(Succ Value) Succ End]
- Action Combine Zero))))
-
-(define for
- Stream Action -> (super Stream Action (function do) 0))
-
-(define filter
- Stream Condition ->
- (super Stream
- (/. Val (if (Condition Val) [Val] []))
- (function append)
- []))
-
-(for [0 (+ 1) (= 10)] (function print))
-
-(filter [0 (+ 1) (= 100)]
- (/. X (integer? (/ X 3))))
-
-
-\\ Typed functions
-
-(define typed-map
- { (A --> B) --> (list A) --> (list B) }
- F X -> (typed-map-h F X []))
-
-(define typed-map-h
- { (A --> B) --> (list A) --> (list B) \\ comment
- --> (list B) }
- _ [] X -> (reverse X)
- F [X | Y] Z -> (typed-map-h F Y [(F X) | Z]))
-
-(define append-string
- { string --> string \* comment *\ --> string }
- S1 S2 -> (cn S1 S2))
-
-(let X 1
- Y 2
- (+ (type X number) (type Y number)))
-
-\\ Yacc
-
-(defcc <st_input>
- <lrb> <st_input1> <rrb> <st_input2>
- := (package-macro (macroexpand <st_input1>) <st_input2>);
- <lcurly> <st_input> := [{ | <st_input>];
- <rcurly> <st_input> := [} | <st_input>];
- <bar> <st_input> := [bar! | <st_input>];
- <semicolon> <st_input> := [; | <st_input>];
- <colon> <equal> <st_input> := [:= | <st_input>];
- <colon> <minus> <st_input> := [:- | <st_input>];
- <colon> <st_input> := [: | <st_input>];
- <comma> <st_input> := [(intern ",") | <st_input>];
- <e> := [];)
-
-(defcc <lsb>
- 91 := skip;)
-
-\\ Pattern matching
-
-(define matches
- 1 X 3 -> X
- X Y Z -> Y where (and (= X 1) (= Z 3))
- true false _ -> true
- (@p a X c) (@s X "abc") (@v 1 2 3 <>) -> true
- [X | Rest] [] [a b c] -> true
- [(@p a b)] [[[1] 2] X] "string" -> true
- _ _ _ -> false)
-
-
-\\ Prolog
-
-(defprolog th*
- X A Hyps <-- (show [X : A] Hyps) (when false);
- X A _ <-- (fwhen (typedf? X)) (bind F (sigf X)) (call [F A]);
- (mode [F] -) A Hyp <-- (th* F [--> A] Hyp);
- (mode [cons X Y] -) [list A] Hyp <-- (th* X A Hyp) (th* Y [list A] Hyp);
- (mode [@s X Y] -) string Hyp <-- (th* X string Hyp) (th* Y string Hyp);
- (mode [lambda X Y] -) [A --> B] Hyp <-- !
- (bind X&& (placeholder))
- (bind Z (ebr X&& X Y))
- (th* Z B [[X&& : A] | Hyp]);
- (mode [type X A] -) B Hyp <-- ! (unify A B) (th* X A Hyp);)
-
-\\ Macros
-
-(defmacro log-macro
- [log N] -> [log N 10])
-
-\\ Sequent calculus
-
-(datatype rank
-
- if (element? X [ace 2 3 4 5 6 7 8 9 10 jack queen king])
- ________
- X : rank;)
-
-(datatype suit
-
- if (element? Suit [spades hearts diamonds clubs])
- _________
- Suit : suit;)
-
-(datatype card
-
- Rank : rank; Suit : suit;
- _________________
- [Rank Suit] : card;
-
- Rank : rank, Suit : suit >> P;
- _____________________
- [Rank Suit] : card >> P;)
-
-(datatype card
-
- Rank : rank; Suit : suit;
- ==================
- [Rank Suit] : card;)
-
-\\ String interpolation and escape sequences
-
-"abc~A ~S~R ~% blah
- c#30;c#31;blah"
-
-)
diff --git a/tests/examplefiles/test.sil b/tests/examplefiles/test.sil
deleted file mode 100644
index 3bcee835..00000000
--- a/tests/examplefiles/test.sil
+++ /dev/null
@@ -1,206 +0,0 @@
-domain Option__Node {
- unique function Option__Node__Some(): Option__Node
- unique function Option__Node__None(): Option__Node
-
- function variantOfOptionNode(self: Ref): Option__Node
-
- function isOptionNode(self: Ref): Bool
-
- axiom ax_variantOfOptionNodeChoices {
- forall x: Ref :: { variantOfOptionNode(x) }
- (variantOfOptionNode(x) == Option__Node__Some() || variantOfOptionNode(x) == Option__Node__None())
- }
-
- axiom ax_isCounterState {
- forall x: Ref :: { variantOfOptionNode(x) }
- isOptionNode(x) == (variantOfOptionNode(x) == Option__Node__Some() ||
- variantOfOptionNode(x) == Option__Node__None())
- }
-}
-
-predicate validOption(this: Ref) {
- isOptionNode(this) &&
- variantOfOptionNode(this) == Option__Node__Some() ==> (
- acc(this.Option__Node__Some__1, write) &&
- acc(validNode(this.Option__Node__Some__1))
- )
-}
-
-field Option__Node__Some__1: Ref
-
-field Node__v: Int
-field Node__next: Ref
-
-predicate validNode(this: Ref) {
- acc(this.Node__v) &&
- acc(this.Node__next) &&
- acc(validOption(this.Node__next))
-}
-
-
-function length(this: Ref): Int
- requires acc(validNode(this), write)
- ensures result >= 1
-{
- (unfolding acc(validNode(this), write) in
- unfolding acc(validOption(this.Node__next)) in
- (variantOfOptionNode(this.Node__next) == Option__Node__None()) ?
- 1 : 1 + length(this.Node__next.Option__Node__Some__1)
- )
-}
-
-function itemAt(this: Ref, i: Int): Int
- requires acc(validNode(this), write)
- requires 0 <= i && i < length(this)
-{
- unfolding acc(validNode(this), write) in unfolding acc(validOption(this.Node__next)) in (
- (i == 0) ?
- this.Node__v:
- (variantOfOptionNode(this.Node__next) == Option__Node__Some()) ?
- itemAt(this.Node__next.Option__Node__Some__1, i-1) : this.Node__v
- )
-}
-
-function sum(this$1: Ref): Int
- requires acc(validNode(this$1), write)
-{
- (unfolding acc(validNode(this$1), write) in unfolding acc(validOption(this$1.Node__next)) in
- (variantOfOptionNode(this$1.Node__next) == Option__Node__None()) ? this$1.Node__v : this$1.Node__v + sum(this$1.Node__next.Option__Node__Some__1))
-}
-
-method append(this: Ref, val: Int)
- requires acc(validNode(this), write)
- ensures acc(validNode(this), write) /* POST1 */
- ensures length(this) == (old(length(this)) + 1) /* POST2 */
- ensures (forall i: Int :: (0 <= i && i < old(length(this))) ==> (itemAt(this, i) == old(itemAt(this, i)))) /* POST3 */
- ensures itemAt(this, length(this) - 1) == val /* POST4 */
- ensures true ==> true
-{
- var tmp_node: Ref
- var tmp_option: Ref
-
- unfold acc(validNode(this), write)
- unfold acc(validOption(this.Node__next), write)
-
- if (variantOfOptionNode(this.Node__next) == Option__Node__None()) {
- tmp_node := new(Node__next, Node__v)
- tmp_node.Node__next := null
- tmp_node.Node__v := val
-
- assume variantOfOptionNode(tmp_node.Node__next) == Option__Node__None()
- fold acc(validOption(tmp_node.Node__next))
- fold acc(validNode(tmp_node), write)
-
- tmp_option := new(Option__Node__Some__1)
- tmp_option.Option__Node__Some__1 := tmp_node
- assume variantOfOptionNode(tmp_option) == Option__Node__Some()
- fold acc(validOption(tmp_option))
-
- this.Node__next := tmp_option
-
-
- unfold validOption(tmp_option)
- assert length(tmp_node) == 1 /* TODO: Required by Silicon, POST2 fails otherwise */
- assert itemAt(tmp_node, 0) == val /* TODO: Required by Silicon, POST4 fails otherwise */
- fold validOption(tmp_option)
- } else {
- append(this.Node__next.Option__Node__Some__1, val)
- fold acc(validOption(this.Node__next), write)
- }
-
- fold acc(validNode(this), write)
-}
-
-method prepend(tail: Ref, val: Int) returns (res: Ref)
- requires acc(validNode(tail))
- ensures acc(validNode(res))
- //ensures acc(validNode(tail))
- ensures length(res) == old(length(tail)) + 1
-
- ensures (forall i: Int :: (1 <= i && i < length(res)) ==> (itemAt(res, i) == old(itemAt(tail, i-1)))) /* POST3 */
- ensures itemAt(res, 0) == val
-{
- var tmp_option: Ref
-
- res := new(Node__v, Node__next)
- res.Node__v := val
-
- tmp_option := new(Option__Node__Some__1)
- tmp_option.Option__Node__Some__1 := tail
- assume variantOfOptionNode(tmp_option) == Option__Node__Some()
-
- res.Node__next := tmp_option
-
- assert acc(validNode(tail))
- fold acc(validOption(res.Node__next))
- fold acc(validNode(res))
-}
-
-method length_iter(list: Ref) returns (len: Int)
- requires acc(validNode(list), write)
- ensures old(length(list)) == len
- // TODO we have to preserve this property
- // ensures acc(validNode(list))
-{
- var curr: Ref := list
- var tmp: Ref := list
-
- len := 1
-
- unfold acc(validNode(curr))
- unfold acc(validOption(curr.Node__next))
- while(variantOfOptionNode(curr.Node__next) == Option__Node__Some())
- invariant acc(curr.Node__v)
- invariant acc(curr.Node__next)
- invariant (variantOfOptionNode(curr.Node__next) == Option__Node__Some() ==> (
- acc(curr.Node__next.Option__Node__Some__1, write) &&
- acc(validNode(curr.Node__next.Option__Node__Some__1))
- ))
- invariant (variantOfOptionNode(curr.Node__next) == Option__Node__Some() ==> len + length(curr.Node__next.Option__Node__Some__1) == old(length(list)))
- invariant (variantOfOptionNode(curr.Node__next) == Option__Node__None() ==> len == old(length(list)))
- {
- assert acc(validNode(curr.Node__next.Option__Node__Some__1))
- len := len + 1
- tmp := curr
- curr := curr.Node__next.Option__Node__Some__1
- unfold acc(validNode(curr))
- unfold acc(validOption(curr.Node__next))
- }
-}
-
-method t1()
-{
- var l: Ref
-
- l := new(Node__v, Node__next)
- l.Node__next := null
- l.Node__v := 1
- assume variantOfOptionNode(l.Node__next) == Option__Node__None()
-
- fold validOption(l.Node__next)
- fold validNode(l)
-
- assert length(l) == 1
- assert itemAt(l, 0) == 1
-
- append(l, 7)
- assert itemAt(l, 1) == 7
- assert itemAt(l, 0) == 1
- assert length(l) == 2
-
- l := prepend(l, 10)
- assert itemAt(l, 2) == 7
- assert itemAt(l, 1) == 1
- assert itemAt(l, 0) == 10
- assert length(l) == 3
-
- //assert sum(l) == 18
-}
-
-method t2(l: Ref) returns (res: Ref)
- requires acc(validNode(l), write)
- ensures acc(validNode(res), write)
- ensures length(res) > old(length(l))
-{
- res := prepend(l, 10)
-}
diff --git a/tests/examplefiles/test.ssp b/tests/examplefiles/test.ssp
deleted file mode 100644
index 96d26d55..00000000
--- a/tests/examplefiles/test.ssp
+++ /dev/null
@@ -1,12 +0,0 @@
-<%@ val someName: String = "someDefaultValue" %>
-<% import com.acme.MySnippets._ %>
-<html>
-<body>
-<h1>Hello ${someName}%</h1>
-
-<ul>
-<%= for (person <- people) { %>
- <li>${person.name}</li>
-<% } %>
-</ul>
-
diff --git a/tests/examplefiles/test.swift b/tests/examplefiles/test.swift
deleted file mode 100644
index 8ef19763..00000000
--- a/tests/examplefiles/test.swift
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// test.swift
-// from https://github.com/fullstackio/FlappySwift
-//
-// Created by Nate Murray on 6/2/14.
-// Copyright (c) 2014 Fullstack.io. All rights reserved.
-//
-
-import UIKit
-import SpriteKit
-
-extension SKNode {
- class func unarchiveFromFile(file : NSString) -> SKNode? {
-
- let path = NSBundle.mainBundle().pathForResource(file, ofType: "sks")
-
- var sceneData = NSData.dataWithContentsOfFile(path, options: .DataReadingMappedIfSafe, error: nil)
- var archiver = NSKeyedUnarchiver(forReadingWithData: sceneData)
-
- archiver.setClass(self.classForKeyedUnarchiver(), forClassName: "SKScene")
- let scene = archiver.decodeObjectForKey(NSKeyedArchiveRootObjectKey) as GameScene
- archiver.finishDecoding()
- return scene
- }
-}
-
-class GameViewController: UIViewController {
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- if let scene = GameScene.unarchiveFromFile("GameScene") as? GameScene {
- // Configure the view.
- let skView = self.view as SKView
- skView.showsFPS = true
- skView.showsNodeCount = true
-
- /* Sprite Kit applies additional optimizations to improve rendering performance */
- skView.ignoresSiblingOrder = true
-
- /* Set the scale mode to scale to fit the window */
- scene.scaleMode = .AspectFill
-
- skView.presentScene(scene)
- }
- }
-
- override func shouldAutorotate() -> Bool {
- return true
- }
-
- override func supportedInterfaceOrientations() -> Int {
- if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
- return Int(UIInterfaceOrientationMask.AllButUpsideDown.toRaw())
- } else {
- return Int(UIInterfaceOrientationMask.All.toRaw())
- }
- }
-
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Release any cached data, images, etc that aren't in use.
- }
-
-}
diff --git a/tests/examplefiles/test.tcsh b/tests/examplefiles/test.tcsh
deleted file mode 100644
index e215ed04..00000000
--- a/tests/examplefiles/test.tcsh
+++ /dev/null
@@ -1,830 +0,0 @@
-#
-# $Id: complete.tcsh,v 1.2 1998/05/11 10:40:54 luisgh Exp $
-# example file using the new completion code
-#
-
-# Debian GNU/Linux
-# file: /usr/share/doc/examples/tcsh/complete.tcsh
-#
-# This file may be read from user's .cshrc file by decompressing it into
-# the home directory as ~/.complete and then adding the line
-# "source ${HOME}/.complete" and maybe defining some of
-# the shell variables described below.
-#
-# Debian enhancements by Vadim Vygonets <vadik@cs.huji.ac.il>:
-#
-# Added two Debian-specific completions: dpkg and dpkg-deb (who wrote
-# them?). To turn it off, define no_debian_complete before loading
-# this file.
-#
-# Added some new completions. To turn them off, define
-# no_new_complete before loading this file.
-#
-# Changed completions of several commands. The ones are evaluated if
-# the following shell variables are defined:
-#
-# traditional_cp_mv_complete
-# for traditional completion of cp and mv commands
-# traditional_zcat_complete
-# for traditional completion of zcat command
-# traditional_nm_complete
-# for traditional completion of nm command
-# traditilnal_tex_complete
-# for traditional completion of tex command
-# traditional_find_complete
-# for traditional completion of find command
-# traditional_configure_complete
-# for traditional completion of ./configure command
-# foolproof_rm_complete or traditional_rm_complete
-# for traditional completion of rm command
-# traditional_complete
-# all of the above
-
-if ($?traditional_complete) then
- set traditional_cp_mv_complete
- set traditional_zcat_complete
- set traditional_nm_complete
- set traditilnal_tex_complete
- set traditional_find_complete
- set traditional_configure_complete
- set foolproof_rm_complete
-endif
-
-if ($?traditional_rm_complete) then
- set foolproof_rm_complete
-endif
-
-onintr -
-if (! $?prompt) goto end
-
-if ($?tcsh) then
- if ($tcsh != 1) then
- set rev=$tcsh:r
- set rel=$rev:e
- set pat=$tcsh:e
- set rev=$rev:r
- endif
- if ($rev > 5 && $rel > 1) then
- set complete=1
- endif
- unset rev rel pat
-endif
-
-if ($?complete) then
- set noglob
- set hosts
- foreach f ($HOME/.hosts /usr/local/etc/csh.hosts $HOME/.rhosts /etc/hosts.equiv)
- if ( -r $f ) then
- set hosts=($hosts `cut -d " " -f 1 $f | grep -v +`)
- endif
- end
- if ( -r $HOME/.netrc ) then
- set f=`awk '/machine/ { print $2 }' < $HOME/.netrc` >& /dev/null
- set hosts=($hosts $f)
- endif
- unset f
- if ( ! $?hosts ) then
- set hosts=(hyperion.ee.cornell.edu phaeton.ee.cornell.edu \
- guillemin.ee.cornell.edu vangogh.cs.berkeley.edu \
- ftp.uu.net prep.ai.mit.edu export.lcs.mit.edu \
- labrea.stanford.edu sumex-aim.stanford.edu \
- tut.cis.ohio-state.edu)
- endif
-
- complete ywho n/*/\$hosts/ # argument from list in $hosts
- complete rsh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
- complete xrsh p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
- complete rlogin p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/
- complete telnet p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
-
- complete cd p/1/d/ # Directories only
- complete chdir p/1/d/
- complete pushd p/1/d/
- complete popd p/1/d/
- complete pu p/1/d/
- complete po p/1/d/
- complete complete p/1/X/ # Completions only
- complete uncomplete n/*/X/
- complete exec p/1/c/ # Commands only
- complete trace p/1/c/
- complete strace p/1/c/
- complete which n/*/c/
- complete where n/*/c/
- complete skill p/1/c/
- complete dde p/1/c/
- complete adb c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
- complete sdb p/1/c/
- complete dbx c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
- complete xdb p/1/c/
- complete gdb n/-d/d/ n/*/c/
- complete ups p/1/c/
- complete set 'c/*=/f/' 'p/1/s/=' 'n/=/f/'
- complete unset n/*/s/
- complete alias p/1/a/ # only aliases are valid
- complete unalias n/*/a/
- complete xdvi n/*/f:*.dvi/ # Only files that match *.dvi
- complete dvips n/*/f:*.dvi/
-if ($?traditilnal_tex_complete) then
- complete tex n/*/f:*.tex/ # Only files that match *.tex
-else
- complete tex n/*/f:*.{tex,texi}/ # Files that match *.tex and *.texi
-endif
- complete latex n/*/f:*.{tex,ltx}/
- complete su c/--/"(login fast preserve-environment command shell \
- help version)"/ c/-/"(f l m p c s -)"/ \
- n/{-c,--command}/c/ \
- n@{-s,--shell}@'`cat /etc/shells`'@ n/*/u/
- complete cc c/-[IL]/d/ \
- c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
- c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
- complete acc c/-[IL]/d/ \
- c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
- c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
- complete gcc c/-[IL]/d/ \
- c/-f/"(caller-saves cse-follow-jumps delayed-branch \
- elide-constructors expensive-optimizations \
- float-store force-addr force-mem inline \
- inline-functions keep-inline-functions \
- memoize-lookups no-default-inline \
- no-defer-pop no-function-cse omit-frame-pointer \
- rerun-cse-after-loop schedule-insns \
- schedule-insns2 strength-reduce \
- thread-jumps unroll-all-loops \
- unroll-loops syntax-only all-virtual \
- cond-mismatch dollars-in-identifiers \
- enum-int-equiv no-asm no-builtin \
- no-strict-prototype signed-bitfields \
- signed-char this-is-variable unsigned-bitfields \
- unsigned-char writable-strings call-saved-reg \
- call-used-reg fixed-reg no-common \
- no-gnu-binutils nonnull-objects \
- pcc-struct-return pic PIC shared-data \
- short-enums short-double volatile)"/ \
- c/-W/"(all aggregate-return cast-align cast-qual \
- comment conversion enum-clash error format \
- id-clash-len implicit missing-prototypes \
- no-parentheses pointer-arith return-type shadow \
- strict-prototypes switch uninitialized unused \
- write-strings)"/ \
- c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \
- short c68000 c68020 soft-float g gnu unix fpu \
- no-epilogue)"/ \
- c/-d/"(D M N)"/ \
- c/-/"(f W vspec v vpath ansi traditional \
- traditional-cpp trigraphs pedantic x o l c g L \
- I D U O O2 C E H B b V M MD MM i dynamic \
- nodtdlib static nostdinc undef)"/ \
- c/-l/f:*.a/ \
- n/*/f:*.{c,C,cc,o,a,s,i}/
- complete g++ n/*/f:*.{C,cc,o,s,i}/
- complete CC n/*/f:*.{C,cc,o,s,i}/
-if ($?foolproof_rm_complete) then
- complete rm c/--/"(directory force interactive verbose \
- recursive help version)"/ c/-/"(d f i v r R -)"/ \
- n/*/f:^*.{c,cc,C,h,in}/ # Protect precious files
-else
- complete rm c/--/"(directory force interactive verbose \
- recursive help version)"/ c/-/"(d f i v r R -)"/
-endif
- complete vi n/*/f:^*.[oa]/
- complete bindkey N/-a/b/ N/-c/c/ n/-[ascr]/'x:<key-sequence>'/ \
- n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/\
- n/-k/"(left right up down)"/ p/2-/b/ \
- p/1/'x:<key-sequence or option>'/
-
-if ($?traditional_find_complete) then
- complete find n/-fstype/"(nfs 4.2)"/ n/-name/f/ \
- n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \
- n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \
- c/-/"(fstype name perm prune type user nouser \
- group nogroup size inum atime mtime ctime exec \
- ok print ls cpio ncpio newer xdev depth \
- daystart follow maxdepth mindepth noleaf version \
- anewer cnewer amin cmin mmin true false uid gid \
- ilname iname ipath iregex links lname empty path \
- regex used xtype fprint fprint0 fprintf \
- print0 printf not a and o or)"/ \
- n/*/d/
-else
- complete find n/-fstype/"(ufs nfs tmp mfs minix ext2 msdos umsdos vfat proc iso9660 4.2 4.3 local)"/ \
- n/-name/f/ \
- n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \
- n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \
- c/-/"(fstype name perm prune type user nouser \
- group nogroup size inum atime mtime ctime exec \
- ok print ls cpio ncpio newer xdev depth \
- daystart follow maxdepth mindepth noleaf version \
- anewer cnewer amin cmin mmin true false uid gid \
- ilname iname ipath iregex links lname empty path \
- regex used xtype fprint fprint0 fprintf \
- print0 printf not a and o or)"/ \
- n/*/d/
-endif
- complete -%* c/%/j/ # fill in the jobs builtin
- complete {fg,bg,stop} c/%/j/ p/1/"(%)"//
-
- complete limit c/-/"(h)"/ n/*/l/
- complete unlimit c/-/"(h)"/ n/*/l/
-
- complete -co* p/0/"(compress)"/ # make compress completion
- # not ambiguous
-if ($?traditional_zcat_complete) then
- complete zcat n/*/f:*.Z/
-else
- complete zcat c/--/"(force help license quiet version)"/ \
- c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
-endif
-if ($?traditional_nm_complete) then
- complete nm n/*/f:^*.{h,C,c,cc}/
-else
-complete nm 'c/--radix=/x:<radix: _o_ctal _d_ecimal he_x_adecimal>/' \
- 'c/--target=/x:<bfdname>/' \
- 'c/--format=/(bsd sysv posix)/n/' \
- 'c/--/(debugsyms extern-only demangle dynamic print-armap \
- print-file-name numeric-sort no-sort reverse-sort \
- size-sort undefined-only portability target= radix= \
- format= defined-only\ line-numbers no-demangle version \
- help)//' \
- 'n/*/f:^*.{h,c,cc,s,S}/'
-endif
-
- complete finger c/*@/\$hosts/ n/*/u/@
- complete ping p/1/\$hosts/
- complete traceroute p/1/\$hosts/
-
- complete {talk,ntalk,phone} p/1/'`users | tr " " "\012" | uniq`'/ \
- n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
-
- complete ftp c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/
-
- # this one is simple...
- #complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/:
- # From Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de>
- # This one will rsh to the file to fetch the list of files!
- complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@' 'n/*/$hosts/:'
-
- complete dd c/--/"(help version)"/ c/[io]f=/f/ \
- c/conv=*,/"(ascii ebcdic ibm block unblock \
- lcase ucase swab noerror sync)"/,\
- c/conv=/"(ascii ebcdic ibm block unblock \
- lcase ucase swab noerror sync)"/,\
- c/*=/x:'<number>'/ \
- n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
-
- complete nslookup p/1/x:'<host>'/ p/2/\$hosts/
-
- complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \
- p/2/f:*.a/ p/*/f:*.o/
-
- complete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \
- c@+@F:$HOME/Mail/@
-
- # these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
- complete {rexec,rxexec,rxterm,rmterm} \
- 'p/1/$hosts/' 'c/-/(l L E)/' 'n/-l/u/' 'n/-L/f/' \
- 'n/-E/e/' 'n/*/c/'
- complete kill 'c/-/S/' 'c/%/j/' \
- 'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/'
-
- # these from Marc Horowitz <marc@cam.ov.com>
- complete attach 'n/-mountpoint/d/' 'n/-m/d/' 'n/-type/(afs nfs rvd ufs)/' \
- 'n/-t/(afs nfs rvd ufs)/' 'n/-user/u/' 'n/-U/u/' \
- 'c/-/(verbose quiet force printpath lookup debug map \
- nomap remap zephyr nozephyr readonly write \
- mountpoint noexplicit explicit type mountoptions \
- nosetuid setuid override skipfsck lock user host)/' \
- 'n/-e/f/' 'n/*/()/'
- complete hesinfo 'p/1/u/' \
- 'p/2/(passwd group uid grplist pcap pobox cluster \
- filsys sloc service)/'
-
- # these from E. Jay Berkenbilt <ejb@ERA.COM>
-if ($?traditional_configure_complete) then
- complete ./configure 'c/--*=/f/' 'c/--{cache-file,prefix,srcdir}/(=)//' \
- 'c/--/(cache-file verbose prefix srcdir)//'
-else
-complete ./configure \
- 'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:<directory e.g. /usr/local>'@ \
- 'c/--cachefile=*/x:<filename>/' \
- 'c/--{enable,disable,with}-*/x:<feature>//' \
- 'c/--*=/x:<directory>/' \
- 'c/--/(prefix= exec-prefix= bindir= sbindir= \
- libexecdir= datadir= sysconfdir= \
- sharedstatedir= localstatedir= infodir= \
- mandir= srcdir= x-includes= x-libraries= \
- enable- disable- with- )//' \
- 'c/--(help no-create quiet silent version \
- verbose)/'
-endif
- complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \
- dfaxhigh dfaxlow laserjet ljet4 sparc pbm \
- pbmraw pgm pgmraw ppm ppmraw bit)/' \
- 'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \
- 'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/'
- complete perl 'n/-S/c/'
- complete printenv 'n/*/e/'
- complete sccs p/1/"(admin cdc check clean comb deledit delget \
- delta diffs edit enter fix get help info \
- print prs prt rmdel sccsdiff tell unedit \
- unget val what)"/
- complete setenv 'p/1/e/' 'c/*:/f/'
-
- # these and method of setting hosts from Kimmo Suominen <kim@tac.nyc.ny.us>
- if ( -f $HOME/.mh_profile && -x "`which folders`" ) then
-
- if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`"
- if ( ! $?MHA ) setenv MHA "`ali | sed -e '/^ /d' -e 's/:.*//'`"
-
- set folders = ( $FOLDERS )
- set mha = ( $MHA )
-
- complete ali \
- 'c/-/(alias nolist list nonormalize normalize nouser user help)/' \
- 'n,-alias,f,'
-
- complete anno \
- 'c/-/(component noinplace inplace nodate date text help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete burst \
- 'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete comp \
- 'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \
- 'c,+,$folders,' \
- 'n,-whatnowproc,c,' \
- 'n,-file,f,'\
- 'n,-form,f,'\
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete dist \
- 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \
- 'c,+,$folders,' \
- 'n,-whatnowproc,c,' \
- 'n,-form,f,'\
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete folder \
- 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete folders \
- 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete forw \
- 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \
- 'c,+,$folders,' \
- 'n,-whatnowproc,c,' \
- 'n,-filter,f,'\
- 'n,-form,f,'\
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete inc \
- 'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \
- 'c,+,$folders,' \
- 'n,-audit,f,'\
- 'n,-form,f,'
-
- complete mark \
- 'c/-/(add delete list sequence nopublic public nozero zero help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete mhmail \
- 'c/-/(body cc from subject help)/' \
- 'n,-cc,$mha,' \
- 'n,-from,$mha,' \
- 'n/*/$mha/'
-
- complete mhpath \
- 'c/-/(help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete msgchk \
- 'c/-/(nodate date nonotify notify help)/'
-
- complete msh \
- 'c/-/(prompt noscan scan notopcur topcur help)/'
-
- complete next \
- 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
- 'c,+,$folders,' \
- 'n,-moreproc,c,' \
- 'n,-showproc,c,' \
- 'n,-form,f,'
-
- complete packf \
- 'c/-/(file help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete pick \
- 'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete prev \
- 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
- 'c,+,$folders,' \
- 'n,-moreproc,c,' \
- 'n,-showproc,c,' \
- 'n,-form,f,'
-
- complete prompter \
- 'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/'
-
- complete refile \
- 'c/-/(draft nolink link nopreserve preserve src file help)/' \
- 'c,+,$folders,' \
- 'n,-file,f,'\
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete rmf \
- 'c/-/(nointeractive interactive help)/' \
- 'c,+,$folders,'
-
- complete rmm \
- 'c/-/(help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete scan \
- 'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \
- 'c,+,$folders,' \
- 'n,-form,f,'\
- 'n,-file,f,'\
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete send \
- 'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \
- 'n,-alias,f,'\
- 'n,-filter,f,'
-
- complete show \
- 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
- 'c,+,$folders,' \
- 'n,-moreproc,c,' \
- 'n,-showproc,c,' \
- 'n,-form,f,'\
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete sortm \
- 'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete vmh \
- 'c/-/(prompt vmhproc novmhproc help)/' \
- 'n,-vmhproc,c,'
-
- complete whatnow \
- 'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/'
-
- complete whom \
- 'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \
- 'n,-alias,f,'
-
- complete plum \
- 'c/-/()/' \
- 'c,+,$folders,' \
- 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
-
- complete mail \
- 'c/-/()/' \
- 'n/*/$mha/'
-
- endif
-
- # these from Tom Warzeka <waz@quahog.nl.nuwc.navy.mil>
- # you may need to set the following variables for your host
- set _elispdir = /usr/lib/emacs/19.34/lisp # GNU Emacs lisp directory
- set _maildir = /var/spool/mail # Post Office: /var/spool/mail or /usr/mail
- set _ypdir = /var/yp # directory where NIS (YP) maps are kept
- set _domain = "`dnsdomainname`"
-
- # this one works but is slow and doesn't descend into subdirectories
- # complete cd C@[./\$~]*@d@ \
- # p@1@'`\ls -1F . $cdpath | grep /\$ | sort -u`'@ n@*@n@
-
- if ( -r /etc/shells ) then
- complete setenv p@1@e@ n@DISPLAY@\$hosts@: n@SHELL@'`cat /etc/shells`'@
- else
- complete setenv p@1@e@ n@DISPLAY@\$hosts@:
- endif
- complete unsetenv n/*/e/
-
- if (-r $HOME/.mailrc) then
- complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
- c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:'<subject>'/ \
- n@-u@T:$_maildir@ n/-f/f/ \
- n@*@'`sed -n s/alias//p $HOME/.mailrc | tr -s " " " " | cut -f 2`'@
- else
- complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
- c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:'<subject>'/ \
- n@-u@T:$_maildir@ n/-f/f/ n/*/u/
- endif
-
- complete man n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
- n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
- n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
- n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
- n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \
- n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \
- n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \
- n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \
- n@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \
- n@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \
- n@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \
- n@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \
-n@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
-n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
- c/-/"(- f k P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-P/d/ \
- N@-P@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
-
- complete ps c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
- n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
- complete compress c/-/"(c f v b)"/ n/-b/x:'<max_bits>'/ n/*/f:^*.Z/
- complete uncompress c/-/"(c f v)"/ n/*/f:*.Z/
-
- complete xhost c/[+-]/\$hosts/ n/*/\$hosts/
-
- # these conform to the latest GNU versions available at press time ...
-
- complete emacs c/-/"(batch d f funcall i insert kill l load \
- no-init-file nw q t u user)"/ c/+/x:'<line_number>'/ \
- n/-d/x:'<display>'/ n/-f/x:'<lisp_function>'/ n/-i/f/ \
- n@-l@F:$_elispdir@ n/-t/x:'<terminal>'/ \
- n/-u/u/ n/*/f:^*[\#~]/
-
- complete gzcat c/--/"(force help license quiet version)"/ \
- c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
- complete gzip c/--/"(stdout to-stdout decompress uncompress \
- force help list license no-name quiet recurse \
- suffix test verbose version fast best)"/ \
- c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\
- n/{-S,--suffix}/x:'<file_name_suffix>'/ \
- n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
- N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
- n/*/f:^*.{gz,Z,z,zip,taz,tgz}/
- complete {gunzip,ungzip} c/--/"(stdout to-stdout force help list license \
- no-name quiet recurse suffix test verbose version)"/ \
- c/-/"(c f h l L n q r S t v V -)"/ \
- n/{-S,--suffix}/x:'<file_name_suffix>'/ \
- n/*/f:*.{gz,Z,z,zip,taz,tgz}/
- complete zgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
- c/-/"(A b B c C e f h i l n s v V w x)"/ \
- p/1/x:'<limited_regular_expression>'/ \
- n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
- complete zegrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
- c/-/"(A b B c C e f h i l n s v V w x)"/ \
- p/1/x:'<full_regular_expression>'/ \
- n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
- complete zfgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
- c/-/"(A b B c C e f h i l n s v V w x)"/ \
- p/1/x:'<fixed_string>'/ \
- n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
-
- complete znew c/-/"(f t v 9 P K)"/ n/*/f:*.Z/
- complete zmore n/*/f:*.{gz,Z,z,zip}/
- complete zfile n/*/f:*.{gz,Z,z,zip,taz,tgz}/
- complete ztouch n/*/f:*.{gz,Z,z,zip,taz,tgz}/
- complete zforce n/*/f:^*.{gz,tgz}/
-
- complete grep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
- c/-/"(A b B c C e f h i l n s v V w x)"/ \
- p/1/x:'<limited_regular_expression>'/ \
- n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
- complete egrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
- c/-/"(A b B c C e f h i l n s v V w x)"/ \
- p/1/x:'<full_regular_expression>'/ \
- n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
- complete fgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
- c/-/"(A b B c C e f h i l n s v V w x)"/ \
- p/1/x:'<fixed_string>'/ \
- n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
-
- complete users c/--/"(help version)"/ p/1/x:'<accounting_file>'/
- complete who c/--/"(heading mesg idle count help message version \
- writable)"/ c/-/"(H T w i u m q s -)"/ \
- p/1/x:'<accounting_file>'/ n/am/"(i)"/ n/are/"(you)"/
-
- complete chown c/--/"(changes silent quiet verbose recursive help \
- version)"/ c/-/"(c f v R -)"/ C@[./\$~]@f@ c/*[.:]/g/ \
- n/-/u/. p/1/u/. n/*/f/
- complete chgrp c/--/"(changes silent quiet verbose recursive help \
- version)"/ c/-/"(c f v R -)"/ n/-/g/ p/1/g/ n/*/f/
-
- complete cat c/--/"(number-nonblank number squeeze-blank show-all \
- show-nonprinting show-ends show-tabs help version)"/ \
- c/-/"(b e n s t u v A E T -)"/ n/*/f/
-if ($?traditional_cp_mv_complete) then
- complete mv c/--/"(backup force interactive update verbose suffix \
- version-control help version)"/ \
- c/-/"(b f i u v S V -)"/ \
- n/{-S,--suffix}/x:'<suffix>'/ \
- n/{-V,--version-control}/"(t numbered nil existing \
- never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
- complete cp c/--/"(archive backup no-dereference force interactive \
- link preserve symbolic-link update verbose parents \
- one-file-system recursive suffix version-control help \
- version)"/ c/-/"(a b d f i l p r s u v x P R S V -)"/ \
- n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
- n/{-V,--version-control}/"(t numbered nil existing \
- never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
-else
- complete mv c/--/"(backup force interactive update verbose suffix \
- version-control help version)"/ \
- c/-/"(b f i u v S V -)"/ \
- n/{-S,--suffix}/x:'<suffix>'/ \
- n/{-V,--version-control}/"(t numbered nil existing \
- never simple)"/ n/-/f/ N/-/d/ n/*/f/
- complete cp c/--/"(archive backup no-dereference force interactive \
- link preserve symbolic-link update verbose parents \
- one-file-system recursive suffix version-control help \
- version)"/ c/-/"(a b d f i l p r s u v x P R S V -)"/ \
- n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
- n/{-V,--version-control}/"(t numbered nil existing \
- never simple)"/ n/-/f/ N/-/d/ n/*/f/
-endif
- complete ln c/--/"(backup directory force interactive symbolic \
- verbose suffix version-control help version)"/ \
- c/-/"(b d F f i s v S V -)"/ \
- n/{-S,--suffix}/x:'<suffix>'/ \
- n/{-V,--version-control}/"(t numbered nil existing \
- never simple)"/ n/-/f/ N/-/x:'<link_name>'/ \
- p/1/f/ p/2/x:'<link_name>'/
- complete touch c/--/"(date file help time version)"/ \
- c/-/"(a c d f m r t -)"/ \
- n/{-d,--date}/x:'<date_string>'/ \
- c/--time/"(access atime mtime modify use)"/ \
- n/{-r,--file}/f/ n/-t/x:'<time_stamp>'/ n/*/f/
- complete mkdir c/--/"(parents help version mode)"/ c/-/"(p m -)"/ \
- n/{-m,--mode}/x:'<mode>'/ n/*/d/
- complete rmdir c/--/"(parents help version)"/ c/-/"(p -)"/ n/*/d/
-
- complete tar c/-[Acru]*/"(b B C f F g G h i l L M N o P \
- R S T v V w W X z Z)"/ \
- c/-[dtx]*/"( B C f F g G i k K m M O p P \
- R s S T v w x X z Z)"/ \
- p/1/"(A c d r t u x -A -c -d -r -t -u -x \
- --catenate --concatenate --create --diff --compare \
- --delete --append --list --update --extract --get)"/ \
- c/--/"(catenate concatenate create diff compare \
- delete append list update extract get atime-preserve \
- block-size read-full-blocks directory checkpoint file \
- force-local info-script new-volume-script incremental \
- listed-incremental dereference ignore-zeros \
- ignore-failed-read keep-old-files starting-file \
- one-file-system tape-length modification-time \
- multi-volume after-date newer old-archive portability \
- to-stdout same-permissions preserve-permissions \
- absolute-paths preserve record-number remove-files \
- same-order preserve-order same-owner sparse \
- files-from null totals verbose label version \
- interactive confirmation verify exclude exclude-from \
- compress uncompress gzip ungzip use-compress-program \
- block-compress)"/ \
- c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \
- T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
- n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
- n/{-[Adrtux]*f,--file}/f:*.tar/ \
- N/{-x*f,--file}/'`tar -tf $:-1`'/ \
- n/--use-compress-program/c/ \
- n/{-b,--block-size}/x:'<block_size>'/ \
- n/{-V,--label}/x:'<volume_label>'/ \
- n/{-N,--{after-date,newer}}/x:'<date>'/ \
- n/{-L,--tape-length}/x:'<tape_length_in_kB>'/ \
- n/{-C,--directory}/d/ \
- N/{-C,--directory}/'`\ls $:-1`'/ \
- n/-[0-7]/"(l m h)"/
-
- # BSD 4.3 filesystems
- complete mount c/-/"(a h v t r)"/ n/-h/\$hosts/ n/-t/"(4.2 nfs)"/ \
- n@*@'`cut -d " " -f 2 /etc/fstab`'@
- complete umount c/-/"(a h v t)"/ n/-h/\$hosts/ n/-t/"(4.2 nfs)"/ \
- n/*/'`mount | cut -d " " -f 3`'/
- # BSD 4.2 filesystems
- #complete mount c/-/"(a h v t r)"/ n/-h/\$hosts/ n/-t/"(ufs nfs)"/ \
- # n@*@'`cut -d ":" -f 2 /etc/fstab`'@
- #complete umount c/-/"(a h v t)"/ n/-h/\$hosts/ n/-t/"(ufs nfs)"/ \
- # n/*/'`mount | cut -d " " -f 3`'/
-
- # these deal with NIS (formerly YP); if it's not running you don't need 'em
- complete domainname p@1@D:$_ypdir@" " n@*@n@
- complete ypcat c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
- N@-d@\`\\ls\ -1\ $_ypdir/\$:-1\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
- n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
- complete ypmatch c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
- N@-d@x:'<key ...>'@ n@-@x:'<key ...>'@ p@1@x:'<key ...>'@ \
- n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
- complete ypwhich c@-@"(d m t x V1 V2)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
- n@-m@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
- N@-m@n@ n@*@\$hosts@
-
- # there's no need to clutter the user's shell with these
- unset _elispdir _maildir _ypdir _domain
-
- complete make \
- 'n/-f/f/' \
- 'c/*=/f/' \
- 'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^ #].*:/s/:.*//p"`@'
-
- if ( -f /etc/printcap ) then
- set printers=(`sed -n -e "/^[^ #].*:/s/:.*//p" /etc/printcap`)
-
- complete lpr 'c/-P/$printers/'
- complete lpq 'c/-P/$printers/'
- complete lprm 'c/-P/$printers/'
- complete lpquota 'p/1/(-Qprlogger)/' 'c/-P/$printers/'
- complete dvips 'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/'
- endif
-
-# New
-if (! $?no_new_complete) then
- uncomplete vi
- complete {vi,vim,gvim,nvi,elvis} n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/
- complete {ispell,spell,spellword} 'n@-d@`ls /usr/lib/ispell/*.aff | sed -e "s/\.aff//" `@' 'n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/'
- complete mutt 'n/-[ai]/f/' 'n/-c/u/' c@=@F:$HOME/Mail/@ \
- 'n/-s/x:\<subject\>/' 'n/[^-]/u/'
- complete elm 'n/-[Ai]/f/' 'c@=@F:$HOME/Mail/@' 'n/-s/x:\<subject\>/'
- complete ncftp 'n@*@`sed -e '1,2d' $HOME/.ncftp/bookmarks | cut -f 1,2 -d "," | tr "," "\012" | sort | uniq ` '@
- complete bibtex 'n@*@`ls *.aux | sed -e "s/\.aux//"`'@
- complete dvi2tty n/*/f:*.dvi/ # Only files that match *.dvi
- complete {xpdf,acroread} 'n/*/f:*.pdf/'
- complete {gv,ghostview} 'n/*/f:*.{ps,eps,epsi}/'
- complete enscript \
- 'c/--/(columns= pages= header= no-header truncate-lines \
- line-numbers setpagedevice= escapes font= \
- header-font= fancy-header no-job-header \
- highlight-bars indent= filter= borders page-prefeed \
- no-page-prefeed lineprinter lines-per-page= mail \
- media= copies= newline= output= missing-characters \
- printer= quiet silent landscape portrait \
- baselineskip= statusdict= title= tabsize= underlay= \
- verbose version encoding pass-through download-font= \
- filter-stdin= help highlight-bar-gray= list-media \
- list-options non-printable-format= page-label-format= \
- printer-options= ul-angle= ul-font= ul-gray= \
- ul-position= ul-style= \
- )/'
-endif # ! $?no_new_complete
-
-# Debian specific
-if (! $?no_debian_complete) then
-complete dpkg 'c/--{admindir,instdir,root}=/d/' \
- 'c/--debug=/n/' \
- 'c/--{admindir,debug,instdir,root}/(=)//' \
- 'c/--/(admindir= debug= instdir= root= \
- assert-support-predepends assert-working-epoch \
- audit auto-deconfigure clear-avail \
- compare-versions configure contents control \
- extract force-bad-path field \
- force-configure-any force-conflicts \
- force-depends force-depends-version force-help \
- force-hold force-non-root \
- force-overwrite-diverted \
- force-remove-essential force-remove-reinstreq \
- forget-old-unavail fsys-tarfile get-selections \
- help ignore-depends info install largemem \
- license list listfiles merge-avail no-act \
- pending predep-package print-architecture \
- print-gnu-build-architecture \
- print-installation-architecture print-avail \
- purge record-avail recursive refuse-downgrade \
- remove search set-selections selected-only \
- skip-same-version smallmem status unpack \
- update-avail version vextract \
- )//' \
- 'n/*/f:*.deb'/
-complete dpkg-deb 'c/--{build}=/d/' \
- 'c/--/"( build contents info field control extract \
- vextract fsys-tarfile help version \
- license )"' \
- 'n/*/f:*.deb/'
-endif # ! $?no_debian_complete
-
- unset noglob
- unset complete
- unset traditional_complete
- unset traditional_cp_mv_complete
- unset traditional_zcat_complete
- unset traditional_nm_complete
- unset traditilnal_tex_complete
- unset traditional_find_complete
- unset traditional_configure_complete
- unset traditional_rm_complete
- unset foolproof_rm_complete
- unset no_new_complete
- unset no_debian_complete
-endif
-
-end:
- onintr
-
diff --git a/tests/examplefiles/test.vb b/tests/examplefiles/test.vb
deleted file mode 100644
index e7252e90..00000000
--- a/tests/examplefiles/test.vb
+++ /dev/null
@@ -1,407 +0,0 @@
-' Copyright (c) 2008 Silken Web - Free BSD License
-' All rights reserved.
-'
-' Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-' * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer
-' * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-' * Neither the name of Silken Web nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-'
-' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-' BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-' GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-' LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-' DAMAGE.
-
-Imports System.Net.Mail
-Imports SilkenWeb.Entities
-Imports System.Text.RegularExpressions
-Imports System.Reflection
-Imports SilkenWeb.Validation
-Imports System.Globalization
-Imports SilkenWeb.Reflection
-
-Namespace SilkenWeb
-
- ''' <summary>
- ''' Represents an Email and what you can do with it.
- ''' </summary>
- ''' <remarks>
- ''' Keith Jackson
- ''' 11/04/2008
- '''
- ''' This class is intended to be inherrited for providing all manner of system generated emails, each represented by it's own class.
- ''' </remarks>
- Public MustInherit Class EmailBase : Implements IValidatable, IDisposable
-
-#Region " Constants "
-
- Public Const LenientRegexPattern As String = "\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
- Public Const StrictRegexPattern As String = "^(([^<>()[\]\\.,;:\s@\""]+(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$"
- Public Const InvalidEmailAddressError As String = "The Email address provided was invalid"
- Public Const InvalidEmailAddressErrorWithAddress As String = "The Email address, {0}, provided was invalid"
- Public Const NullEmailAddressError As String = "The Email address was not provided"
-
-#End Region
-
-#Region " Fields "
-
- Private disposedValue As Boolean
-
- Private _message As MailMessage = New MailMessage()
- Private _mailClient As SmtpClient
-
- Private _useStrictValidation As Boolean
-
-#End Region
-
-#Region " Construction "
-
- ''' <summary>
- ''' Instantiates a new Email of the derived type.
- ''' </summary>
- ''' <param name="sender">The email address of the sender of the message.</param>
- ''' <param name="recipients">The email addresses of the recipients of the message.</param>
- ''' <param name="subject">The subject of the message.</param>
- ''' <param name="body">The body of the message.</param>
- Protected Sub New(ByVal sender As String, ByVal subject As String, ByVal body As String, ByVal ParamArray recipients As String())
- _message.From = New MailAddress(sender)
- For i As Integer = 0 To recipients.Length - 1
- _message.To.Add(recipients(i))
- Next
- _message.Subject = subject
- _message.Body = body
- End Sub
-
-#End Region
-
-#Region " Properties "
-
- ''' <summary>
- ''' Gets the Attachments for the message.
- ''' </summary>
- Protected Overridable ReadOnly Property Attachments() As AttachmentCollection
- Get
- Return _message.Attachments
- End Get
- End Property
-
- ''' <summary>
- ''' The email addresses of the BCC recipients of the message.
- ''' </summary>
- Public Property BccRecipients() As String()
- Get
- Return _message.Bcc.ToAddressStringArray()
- End Get
- Set(ByVal value As String())
- _message.Bcc.Clear()
- _message.Bcc.Add(value.ToDelimitedString())
- End Set
- End Property
-
- ''' <summary>
- ''' The body of the message.
- ''' </summary>
- Protected Overridable Property Body() As String
- Get
- Return _message.Body
- End Get
- Set(ByVal value As String)
- _message.Body = value
- End Set
- End Property
-
- ''' <summary>
- ''' The email addresses of the CC recipients of the message.
- ''' </summary>
- Public Property CCRecipients() As String()
- Get
- Return _message.CC.ToAddressStringArray()
- End Get
- Set(ByVal value As String())
- _message.CC.Clear()
- _message.CC.Add(value.ToDelimitedString())
- End Set
- End Property
-
- ''' <summary>
- ''' Gets or Sets a flag to indicate if the body of the message is HTML.
- ''' </summary>
- Public Property IsBodyHtml() As Boolean
- Get
- Return _message.IsBodyHtml
- End Get
- Set(ByVal value As Boolean)
- _message.IsBodyHtml = value
- End Set
- End Property
-
- ''' <summary>
- ''' Gets the Mail message wrapped by the EmailBase class.
- ''' </summary>
- Protected ReadOnly Property Message() As MailMessage
- Get
- Return _message
- End Get
- End Property
-
- ''' <summary>
- ''' Gets or Sets the Priority of the message.
- ''' </summary>
- Public Property Priority() As MailPriority
- Get
- Return _message.Priority
- End Get
- Set(ByVal value As MailPriority)
- _message.Priority = value
- End Set
- End Property
-
- ''' <summary>
- ''' The email addresses of the recipients of the message.
- ''' </summary>
- Public Property Recipients() As String()
- Get
- Return _message.To.ToAddressStringArray()
- End Get
- Set(ByVal value As String())
- _message.To.Clear()
- _message.To.Add(value.ToDelimitedString())
- End Set
- End Property
-
- ''' <summary>
- ''' The reply email address of the sender of the message.
- ''' </summary>
- Public Property ReplyTo() As String
- Get
- If _message.ReplyTo Is Nothing Then
- Return String.Empty
- Else
- Return _message.ReplyTo.Address
- End If
- End Get
- Set(ByVal value As String)
- If _message.ReplyTo Is Nothing Then
- _message.ReplyTo = New MailAddress(value)
- Else
- _message.ReplyTo = New MailAddress(value, _message.ReplyTo.DisplayName)
- End If
- End Set
- End Property
-
- ''' <summary>
- ''' The reply display name of the sender of the message.
- ''' </summary>
- Public Property ReplyToDisplayName() As String
- Get
- If _message.ReplyTo Is Nothing Then
- Return String.Empty
- Else
- Return _message.ReplyTo.DisplayName
- End If
- End Get
- Set(ByVal value As String)
- If _message.ReplyTo Is Nothing Then
- _message.ReplyTo = New MailAddress(_message.From.Address, value)
- Else
- _message.ReplyTo = New MailAddress(_message.ReplyTo.Address, value)
- End If
- End Set
- End Property
-
- ''' <summary>
- ''' The email address of the sender of the message.
- ''' </summary>
- Public Overridable Property Sender() As String
- Get
- Return _message.From.Address
- End Get
- Protected Set(ByVal value As String)
- _message.From = New MailAddress(value, _message.From.DisplayName)
- End Set
- End Property
-
- ''' <summary>
- ''' The display name of the sender of the message.
- ''' </summary>
- Public Overridable Property SenderDisplayName() As String
- Get
- Return _message.From.DisplayName
- End Get
- Protected Set(ByVal value As String)
- _message.From = New MailAddress(_message.From.Address, value)
- End Set
- End Property
-
- ''' <summary>
- ''' The subject of the message.
- ''' </summary>
- Public Overridable Property Subject() As String
- Get
- Return _message.Subject
- End Get
- Protected Set(ByVal value As String)
- _message.Subject = value
- End Set
- End Property
-
-#End Region
-
-#Region " Methods "
-
-#Region " Send Methods "
-
- ''' <summary>
- ''' Sends this email
- ''' </summary>
- ''' <param name="mailServer">The SMTP server to use to send the email.</param>
- Public Sub Send(ByVal mailServer As String)
- _mailClient = New SmtpClient(mailServer)
- _mailClient.Send(_message)
- End Sub
-
- ''' <summary>
- ''' Sends this email asynchronously.
- ''' </summary>
- ''' <param name="mailServer">The SMTP server to use to send the email.</param>
- ''' <param name="userToken">A user defined token passed to the recieving method on completion of the asynchronous task.</param>
- Public Sub SendAsync(ByVal mailServer As String, ByVal userToken As Object)
- _mailClient = New SmtpClient(mailServer)
- _mailClient.SendAsync(_message, userToken)
- End Sub
-
- ''' <summary>
- ''' Cancels an attempt to send this email asynchronously.
- ''' </summary>
- Public Sub SendAsyncCancel()
- _mailClient.SendAsyncCancel()
- End Sub
-
-#End Region
-
-#End Region
-
-#Region " IValidatable Implementation "
-
- ''' <summary>
- ''' gets and Sets a flag to indicate whether to use strict validation.
- ''' </summary>
- Public Property UseStrictValidation() As Boolean
- Get
- Return _useStrictValidation
- End Get
- Set(ByVal value As Boolean)
- _useStrictValidation = value
- End Set
- End Property
-
- ''' <summary>
- ''' Validates this email.
- ''' </summary>
- ''' <returns>A ValidationResponse, containing a flag to indicate if validation was passed and a collection of Property Names and validation errors.</returns>
- Public Function Validate() As ValidationResponse Implements IValidatable.Validate
-
- Dim retVal As New ValidationResponse()
- Dim mailRegEx As String = If(_useStrictValidation, StrictRegexPattern, LenientRegexPattern)
-
- ValidateAddress("Sender", retVal, mailRegEx, True)
- ValidateAddresses("Recipients", retVal, mailRegEx, True)
- ValidateAddresses("CcRecipients", retVal, mailRegEx)
- ValidateAddresses("BccRecipients", retVal, mailRegEx)
- ValidateAddress("ReplyTo", retVal, mailRegEx)
-
- Return retVal
-
- End Function
-
- ''' <summary>
- ''' Validates a single Email Address property.
- ''' </summary>
- ''' <param name="propertyName">The name of the property to validate.</param>
- ''' <param name="retVal">The validation response object.</param>
- ''' <param name="mailRegEx">The regular expression pattern to use for validation.</param>
- Private Overloads Sub ValidateAddress(ByVal propertyName As String, ByRef retVal As ValidationResponse, ByVal mailRegEx As String)
- ValidateAddress(propertyName, retVal, mailRegEx, False)
- End Sub
-
- ''' <summary>
- ''' Validates a single Email Address property.
- ''' </summary>
- ''' <param name="propertyName">The name of the property to validate.</param>
- ''' <param name="retVal">The validation response object.</param>
- ''' <param name="mailRegEx">The regular expression pattern to use for validation.</param>
- ''' <param name="required">Indicates if the address is required; False if not specified.</param>
- Private Overloads Sub ValidateAddress(ByVal propertyName As String, ByRef retVal As ValidationResponse, ByVal mailRegEx As String, ByVal required As Boolean)
-
- Dim emailAddress As String = ReflectionHelper.Properties.GetProperty(Of String)(Me, propertyName)
-
- If emailAddress Is Nothing OrElse emailAddress.Length = 0 Then
- If required Then retVal.Add(New KeyValuePair(Of String, String)(propertyName, NullEmailAddressError))
- Else
- If (Not Regex.IsMatch(emailAddress, mailRegEx)) Then
- retVal.Add(New KeyValuePair(Of String, String)(propertyName, InvalidEmailAddressError))
- End If
- End If
-
- End Sub
-
- ''' <summary>
- ''' Validates a string array of Email Address property.
- ''' </summary>
- ''' <param name="propertyName">The name of the property to validate.</param>
- ''' <param name="retVal">The validation response object.</param>
- ''' <param name="mailRegEx">The regular expression pattern to use for validation.</param>
- Private Overloads Sub ValidateAddresses(ByVal propertyName As String, ByRef retVal As ValidationResponse, ByVal mailRegEx As String)
- ValidateAddresses(propertyName, retVal, mailRegEx, False)
- End Sub
-
- ''' <summary>
- ''' Validates a string array of Email Address property.
- ''' </summary>
- ''' <param name="propertyName">The name of the property to validate.</param>
- ''' <param name="retVal">The validation response object.</param>
- ''' <param name="mailRegEx">The regular expression pattern to use for validation.</param>
- ''' <param name="required">Indicates if the address is required; False if not specified.</param>
- Private Overloads Sub ValidateAddresses(ByVal propertyName As String, ByRef retVal As ValidationResponse, ByVal mailRegEx As String, ByVal required As Boolean)
-
- Dim emailAddresses() As String = ReflectionHelper.Properties.GetProperty(Of String())(Me, propertyName)
-
- If emailAddresses Is Nothing OrElse emailAddresses.Length = 0 Then
- If required Then retVal.Add(New KeyValuePair(Of String, String)(propertyName, String.Format(CultureInfo.CurrentCulture, NullEmailAddressError)))
- Else
- For i As Integer = 0 To emailAddresses.Length - 1
- If (Not Regex.IsMatch(emailAddresses(i), mailRegEx)) Then
- retVal.Add(New KeyValuePair(Of String, String)(propertyName, String.Format(CultureInfo.CurrentCulture, InvalidEmailAddressErrorWithAddress, emailAddresses(i))))
- End If
- Next
- End If
-
- End Sub
-
-#End Region
-
-#Region " IDisposable Implementation "
-
- Protected Overridable Sub Dispose(ByVal disposing As Boolean)
- If Not Me.disposedValue Then
- If disposing Then
- _message.Dispose()
- End If
- _mailClient = Nothing
- _message = Nothing
- End If
- Me.disposedValue = True
- End Sub
-
- Public Sub Dispose() Implements IDisposable.Dispose
- ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
- Dispose(True)
- GC.SuppressFinalize(Me)
- End Sub
-
-#End Region
-
- End Class
-
-End Namespace
diff --git a/tests/examplefiles/test.vhdl b/tests/examplefiles/test.vhdl
deleted file mode 100644
index 426f2375..00000000
--- a/tests/examplefiles/test.vhdl
+++ /dev/null
@@ -1,161 +0,0 @@
-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
diff --git a/tests/examplefiles/test.xqy b/tests/examplefiles/test.xqy
deleted file mode 100644
index c626ea96..00000000
--- a/tests/examplefiles/test.xqy
+++ /dev/null
@@ -1,138 +0,0 @@
-(: made up functions, etc just to test xquery parsing (: even embedded comments
-on multiple :)
-lines
-:)
-xquery version "1.0";
-
-module namespace xqueryexample "http://example.com/namespace";
-import module namespace importedns = "http://example.com/ns/imported" at "no/such/file.xqy";
-
-declare namespace sess = "com.example.session";
-
-declare variable $amazing := "awesome";
-declare variable $SESSIONS as element(sess:session)* := c:sessions();
-
-declare option sess:clear "false";
-
-define function whatsit($param as xs:string) as xs:string {
- let $var1 := 1
- let $var2 := 2
- return (1 + 2 div ($var1 + $var2))
-
- let $let := <x>"test"</x>
- return (: some whitespace :) element element {
- attribute attribute { 1 },
- element test { 'a' },
- attribute foo { "bar" },
- fn:doc()[ foo/@bar eq $let ],
- //x/with/another/*/*:version/xpath/@attr }
-};
-
-let $bride := "Bride"
-let $test := validate lax { <some>html</some> }
-let $test := validate strict { <some>html</some> }
-let $test := validate { <some>html</some> }
-let $test := $var1/*:Article (: comment here :) [fn:not()]
-let $test := $var1/@*:name/fn:string()
-
-let $noop := ordered { $test }
-let $noop := unordered { $test }
-
-let $noop :=
- for $version at $i in $versions/version
- let $row := if($i mod 2 eq 0) then "even" else "odd"
- order by $version descending
- return
-
-return
-<html xmlns="http://www.w3.org/1999/xhtml">
-{
- <outer>
- <movie>
- <title>The Princess { fn:capitalize($bride) }</title>
- </movie>
- <form action="" method="post" id="session-form" call="callsomething()">
- <input type="hidden" name="{$d:DEBUG-FIELD}" value="{$d:DEBUG}"/>
- {
- (: placeholder for local sessions :)
- element div {
- attribute id { "sessions-local" },
- attribute class { "hidden" },
- element h1 { "Local Sessions" },
- element p {
- 'These sessions use storage provided by your browser.',
- 'You can also ',
- element a {
- attribute href { 'session-import-local.xqy' },
- 'import' },
- ' sessions from local XML files.'
- }
- }
- }
- {
- for $i in $sessions
- let $id := c:session-id($i)
- let $uri := c:session-uri($i)
- (: we only care about the lock that expires last :)
- let $conflicting := c:conflicting-locks($uri, 1)
- let $name as xs:string := ($i/sess:name, "(unnamed)")[1]
- return element tr {
- element td { $name },
- element td { string($i/sec:user) },
- element td { data($i/sess:created) },
- element td { data($i/sess:last-modified) },
- element td {
- if (empty($conflicting)) then () else
- text {
- "by", $conflicting/lock:owner,
- "until", adjust-dateTime-to-timezone(
- x:epoch-seconds-to-dateTime(
- $conflicting/lock:timestamp + $conflicting/lock:timeout
- )
- )
- },
- (: only show resume button if there are no conflicting locks :)
- element input {
- attribute type { "button" },
- attribute title {
- data($i/sess:query-buffers/sess:query[1]) },
- attribute onclick {
- concat("list.resumeSession('", $id, "')") },
- attribute value {
- "Resume", (' ', $id)[ $d:DEBUG ] }
- }[ not($conflicting) ],
- $x:NBSP,
- (: clone button :)
- element input {
- attribute type { "button" },
- attribute title { "clone this session" },
- attribute onclick {
- concat("list.cloneSession('", $id, "', this)") },
- attribute value { "Clone", (' ', $id)[ $d:DEBUG ] }
- },
- $x:NBSP,
- (: export button :)
- element input {
- attribute type { "button" },
- attribute title { "export this session" },
- attribute onclick {
- concat("list.exportServerSession('", $id, "', this)") },
- attribute value { "Export", (' ', $id)[ $d:DEBUG ] }
- },
- $x:NBSP,
- (: only show delete button if there are no conflicting locks :)
- element input {
- attribute type { "button" },
- attribute title { "permanently delete this session" },
- attribute onclick {
- concat("list.deleteSession('", $id, "', this)") },
- attribute value { "Delete", (' ', $id)[ $d:DEBUG ] }
- }[ not($conflicting) ]
- }
- }
- }
- </form>
- </outer>
-}
- <tr><td><!-- some commented things-->&nbsp;</td></tr>
-</html>
diff --git a/tests/examplefiles/test.xsl b/tests/examplefiles/test.xsl
deleted file mode 100644
index 590bb043..00000000
--- a/tests/examplefiles/test.xsl
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml"/>
- <xsl:template match="/">
- <customers>
- <xsl:apply-templates select="customers/customer[@Country='Germany']"/>
- </customers>
- </xsl:template>
- <xsl:template match="customers">
- <xsl:apply-templates/>
-
- </xsl:template>
- <xsl:template match="customer">
- <customer>
- <xsl:attribute name="CompanyName"><xsl:value-of select="@CompanyName"/></xsl:attribute>
- <xsl:attribute name="CustomerID"><xsl:value-of select="@CustomerID"/></xsl:attribute>
- <xsl:attribute name="Country"><xsl:value-of select="@Country"/></xsl:attribute>
- </customer>
- <xsl:apply-templates/>
- </xsl:template>
-
-</xsl:stylesheet>
-
diff --git a/tests/examplefiles/test.zep b/tests/examplefiles/test.zep
deleted file mode 100644
index 4724d4c4..00000000
--- a/tests/examplefiles/test.zep
+++ /dev/null
@@ -1,33 +0,0 @@
-namespace Test;
-
-use Test\Foo;
-
-class Bar
-{
- protected a;
- private b;
- public c {set, get};
-
- public function __construct(string str, boolean bool)
- {
- let this->c = str;
- this->setC(bool);
- let this->b = [];
- }
-
- public function sayHello(string name)
- {
- echo "Hello " . name;
- }
-
- protected function loops()
- {
- for a in b {
- echo a;
- }
- loop {
- return "boo!";
- }
- }
-
-} \ No newline at end of file
diff --git a/tests/examplefiles/test2.odin b/tests/examplefiles/test2.odin
deleted file mode 100644
index 2a6b4517..00000000
--- a/tests/examplefiles/test2.odin
+++ /dev/null
@@ -1,30 +0,0 @@
-school_schedule = <
- lesson_times = <08:30:00, 09:30:00, 10:30:00, ...>
-
- locations = <
- [1] = <"under the big plane tree">
- [2] = <"under the north arch">
- [3] = <"in a garden">
- >
-
- subjects = <
- ["philosophy:plato"] = < -- note construction of key
- name = <"philosophy">
- teacher = <"plato">
- topics = <"meta-physics", "natural science">
- weighting = <76%>
- >
- ["philosophy:kant"] = <
- name = <"philosophy">
- teacher = <"kant">
- topics = <"meaning and reason", "meta-physics", "ethics">
- weighting = <80%>
- >
- ["art"] = <
- name = <"art">
- teacher = <"goya">
- topics = <"technique", "portraiture", "satire">
- weighting = <78%>
- >
- >
->
diff --git a/tests/examplefiles/test2.pypylog b/tests/examplefiles/test2.pypylog
deleted file mode 100644
index 543e21dd..00000000
--- a/tests/examplefiles/test2.pypylog
+++ /dev/null
@@ -1,120 +0,0 @@
-[2f1dd6c3b8b7] {jit-log-opt-loop
-# Loop 0 (<Function object at 0xb720e550> ds1dr4 dsdr3 ds1dr4) : loop with 115 ops
-[p0, p1]
-+33: label(p0, p1, descr=TargetToken(-1223434224))
-debug_merge_point(0, 0, '<Function object at 0xb710b120> ds1dr4 dsdr3 ds1dr4')
-+33: guard_nonnull_class(p1, 138371488, descr=<Guard2>) [p1, p0]
-+54: p3 = getfield_gc_pure(p1, descr=<FieldP pyhaskell.interpreter.haskell.Substitution.inst_rhs 8>)
-+57: guard_value(p3, ConstPtr(ptr4), descr=<Guard3>) [p1, p0, p3]
-+69: p5 = getfield_gc_pure(p1, descr=<FieldP pyhaskell.interpreter.haskell.Substitution.inst_subst 12>)
-+72: p7 = getarrayitem_gc(p5, 0, descr=<ArrayP 4>)
-+75: guard_class(p7, 138371552, descr=<Guard4>) [p0, p5, p7]
-+88: p9 = getfield_gc(p7, descr=<FieldP pyhaskell.interpreter.haskell.Thunk.inst_application 8>)
-+91: guard_nonnull_class(p9, 138373024, descr=<Guard5>) [p0, p5, p7, p9]
-+109: p12 = getarrayitem_gc(p5, 1, descr=<ArrayP 4>)
-+112: guard_class(p12, 138371552, descr=<Guard6>) [p0, p5, p12, p7]
-+125: p14 = getfield_gc(p12, descr=<FieldP pyhaskell.interpreter.haskell.Thunk.inst_application 8>)
-+128: guard_nonnull_class(p14, 138373024, descr=<Guard7>) [p0, p5, p12, p14, p7]
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, 'None')
-+146: p16 = getfield_gc_pure(p9, descr=<FieldP pyhaskell.interpreter.haskell.Application.inst_function 8>)
-+149: guard_value(p16, ConstPtr(ptr17), descr=<Guard8>) [p16, p9, p0, p12, p7]
-+161: p18 = getfield_gc_pure(p9, descr=<FieldP pyhaskell.interpreter.haskell.Application3.inst_arg0 12>)
-+164: guard_class(p18, 138371648, descr=<Guard9>) [p18, p9, p0, p12, p7]
-+177: p20 = getfield_gc_pure(p9, descr=<FieldP pyhaskell.interpreter.haskell.Application3.inst_arg1 16>)
-+180: guard_class(p20, 138371648, descr=<Guard10>) [p20, p9, p18, p0, p12, p7]
-+193: p22 = getfield_gc_pure(p9, descr=<FieldP pyhaskell.interpreter.haskell.Application3.inst_arg2 20>)
-+196: guard_class(p22, 138371936, descr=<Guard11>) [p22, p9, p20, p18, p0, p12, p7]
-debug_merge_point(0, 0, 'None')
-+209: p24 = getfield_gc_pure(p22, descr=<FieldP pyhaskell.interpreter.haskell.Application.inst_function 8>)
-+215: guard_value(p24, ConstPtr(ptr25), descr=<Guard12>) [p24, p22, p9, None, None, p0, p12, p7]
-+227: p27 = getfield_gc_pure(p22, descr=<FieldP pyhaskell.interpreter.haskell.Application1.inst_arg0 12>)
-+230: guard_class(p27, 138371648, descr=<Guard13>) [p22, p27, p9, None, None, p0, p12, p7]
-debug_merge_point(0, 0, '_')
-debug_merge_point(0, 0, 'None')
-+243: p30 = getfield_gc(ConstPtr(ptr29), descr=<FieldP pyhaskell.interpreter.module.CoreMod.inst_qvars 24>)
-+249: i34 = call(ConstClass(ll_dict_lookup_trampoline__v64___simple_call__function_ll), p30, ConstPtr(ptr32), 360200661, descr=<Calli 4 rri EF=4>)
-+281: guard_no_exception(, descr=<Guard14>) [p27, p20, p18, i34, p30, None, None, None, p0, p12, p7]
-+294: i36 = int_and(i34, -2147483648)
-+302: i37 = int_is_true(i36)
-guard_false(i37, descr=<Guard15>) [p27, p20, p18, i34, p30, None, None, None, p0, p12, p7]
-+311: p38 = getfield_gc(p30, descr=<FieldP dicttable.entries 12>)
-+314: p39 = getinteriorfield_gc(p38, i34, descr=<InteriorFieldDescr <FieldP dictentry.value 4>>)
-+318: i40 = instance_ptr_eq(p18, p39)
-guard_true(i40, descr=<Guard16>) [p27, p20, None, None, None, p0, p12, p7]
-debug_merge_point(0, 0, 'None')
-+327: i41 = getfield_gc_pure(p20, descr=<FieldS pyhaskell.interpreter.primtype.Int.inst_value 8>)
-+330: i42 = getfield_gc_pure(p27, descr=<FieldS pyhaskell.interpreter.primtype.Int.inst_value 8>)
-+333: i43 = int_sub(i41, i42)
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, 'None')
-+335: i45 = int_eq(0, i43)
-guard_false(i45, descr=<Guard17>) [p0, i43, None, None, None, None, p12, p7]
-p47 = new_with_vtable(138371648)
-+393: setfield_gc(p47, i43, descr=<FieldS pyhaskell.interpreter.primtype.Int.inst_value 8>)
-setfield_gc(p7, p47, descr=<FieldP pyhaskell.interpreter.haskell.Thunk.inst_application 8>)
-+414: p48 = getfield_gc(p12, descr=<FieldP pyhaskell.interpreter.haskell.Thunk.inst_application 8>)
-+420: guard_nonnull_class(p48, 138371648, descr=<Guard18>) [p0, p48, p12, p47, p7]
-debug_merge_point(0, 0, '<PrimFunction object at 0x83f3f6c> 1 <Function object at 0xb710b3b0> 1 <Function object at 0xb710b3c0> <PrimFunction object at 0x83f3f3c> 1 dsdr3 <Function object at 0xb710b210> 1')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, '_')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, '<Function object at 0xb710b3d0> dsdr3 dsdr3')
-debug_merge_point(0, 0, '<Function object at 0xb710b120> ds1dr4 dsdr3 ds1dr4')
-+438: label(p0, p48, p30, p38, descr=TargetToken(-1223434176))
-debug_merge_point(0, 0, '<Function object at 0xb710b120> ds1dr4 dsdr3 ds1dr4')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, '_')
-debug_merge_point(0, 0, 'None')
-+438: i50 = call(ConstClass(ll_dict_lookup_trampoline__v64___simple_call__function_ll), p30, ConstPtr(ptr32), 360200661, descr=<Calli 4 rri EF=4>)
-+464: guard_no_exception(, descr=<Guard19>) [p48, i50, p30, p0]
-+477: i51 = int_and(i50, -2147483648)
-+485: i52 = int_is_true(i51)
-guard_false(i52, descr=<Guard20>) [p48, i50, p30, p0]
-+494: p53 = getinteriorfield_gc(p38, i50, descr=<InteriorFieldDescr <FieldP dictentry.value 4>>)
-+501: i55 = instance_ptr_eq(ConstPtr(ptr54), p53)
-guard_true(i55, descr=<Guard21>) [p48, p0]
-debug_merge_point(0, 0, 'None')
-+513: i56 = getfield_gc_pure(p48, descr=<FieldS pyhaskell.interpreter.primtype.Int.inst_value 8>)
-+516: i58 = int_sub(i56, 1)
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, 'None')
-+519: i59 = int_eq(0, i58)
-guard_false(i59, descr=<Guard22>) [i58, p48, p0]
-debug_merge_point(0, 0, '<PrimFunction object at 0x83f3f6c> 1 <Function object at 0xb710b3b0> 1 <Function object at 0xb710b3c0> <PrimFunction object at 0x83f3f3c> 1 dsdr3 <Function object at 0xb710b210> 1')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, '_')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, 'None')
-debug_merge_point(0, 0, '<Function object at 0xb710b3d0> dsdr3 dsdr3')
-debug_merge_point(0, 0, '<Function object at 0xb710b120> ds1dr4 dsdr3 ds1dr4')
-p61 = new_with_vtable(138371700)
-p63 = new_with_vtable(138373024)
-p65 = new_with_vtable(138371936)
-+606: setfield_gc(p63, ConstPtr(ptr66), descr=<FieldP pyhaskell.interpreter.haskell.Application.inst_function 8>)
-p68 = new_with_vtable(138373024)
-+632: setfield_gc(p65, ConstPtr(ptr69), descr=<FieldP pyhaskell.interpreter.haskell.Application.inst_function 8>)
-p71 = new_with_vtable(138371936)
-+658: setfield_gc(p68, ConstPtr(ptr17), descr=<FieldP pyhaskell.interpreter.haskell.Application.inst_function 8>)
-+665: setfield_gc(p71, ConstPtr(ptr72), descr=<FieldP pyhaskell.interpreter.haskell.Application1.inst_arg0 12>)
-+672: setfield_gc(p68, p71, descr=<FieldP pyhaskell.interpreter.haskell.Application3.inst_arg2 20>)
-+675: setfield_gc(p68, p48, descr=<FieldP pyhaskell.interpreter.haskell.Application3.inst_arg1 16>)
-+678: setfield_gc(p68, ConstPtr(ptr54), descr=<FieldP pyhaskell.interpreter.haskell.Application3.inst_arg0 12>)
-p73 = new_with_vtable(138371648)
-+701: setfield_gc(p61, p0, descr=<FieldP pyhaskell.interpreter.haskell.StackElement.inst_next 8>)
-+716: setfield_gc(p61, 2, descr=<FieldS pyhaskell.interpreter.haskell.CopyStackElement.inst_index 16>)
-+723: setfield_gc(p71, ConstPtr(ptr25), descr=<FieldP pyhaskell.interpreter.haskell.Application.inst_function 8>)
-+730: setfield_gc(p65, p68, descr=<FieldP pyhaskell.interpreter.haskell.Application1.inst_arg0 12>)
-+733: setfield_gc(p63, p65, descr=<FieldP pyhaskell.interpreter.haskell.Application3.inst_arg2 20>)
-+736: setfield_gc(p63, ConstPtr(ptr75), descr=<FieldP pyhaskell.interpreter.haskell.Application3.inst_arg1 16>)
-+743: setfield_gc(p63, ConstPtr(ptr54), descr=<FieldP pyhaskell.interpreter.haskell.Application3.inst_arg0 12>)
-+750: setfield_gc(p61, p63, descr=<FieldP pyhaskell.interpreter.haskell.CopyStackElement.inst_application 12>)
-+753: setfield_gc(p73, i58, descr=<FieldS pyhaskell.interpreter.primtype.Int.inst_value 8>)
-+762: jump(p61, p73, p30, p38, descr=TargetToken(-1223434176))
-+775: --end of the loop--
-[2f1dd6da3b99] jit-log-opt-loop}
diff --git a/tests/examplefiles/test_basic.adls b/tests/examplefiles/test_basic.adls
deleted file mode 100644
index df5aa743..00000000
--- a/tests/examplefiles/test_basic.adls
+++ /dev/null
@@ -1,28 +0,0 @@
---
--- Example of an openEHR Archetype, written in the Archetype Definition Language (ADL)
--- Definition available here: http://www.openehr.org/releases/trunk/architecture/am/adl2.pdf
--- Author: derived from the openEHR-EHR-EVALUATION.adverse_reaction.v1 archetype at http://www.openEHR.org/ckm
---
-
-archetype (adl_version=2.0.5; rm_release=1.0.2; generated)
- openEHR-EHR-EVALUATION.adverse_reaction.v1.0.0
-
-language
- original_language = <[ISO_639-1::en]>
-
-description
- lifecycle_state = <"unmanaged">
-
-definition
- EVALUATION[id1]
-
-terminology
- term_definitions = <
- ["en"] = <
- ["id1"] = <
- text = <"Adverse Reaction">
- description = <"xxx">
- >
- >
- >
-
diff --git a/tests/examplefiles/truncated.pytb b/tests/examplefiles/truncated.pytb
deleted file mode 100644
index ad5b6d49..00000000
--- a/tests/examplefiles/truncated.pytb
+++ /dev/null
@@ -1,15 +0,0 @@
- File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 314, in dispatch_request
- dispatcher.dispatch(req)
- File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 186, in dispatch
- req.session = Session(self.env, req)
- File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 52, in __init__
- self.promote_session(sid)
- File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 125, in promote_session
- "AND authenticated=0", (sid,))
- File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 47, in execute
- return self.cursor.execute(sql_escape_percent(sql), args)
- File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 44, in execute
- args or [])
- File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 36, in _rollback_on_error
- return function(self, *args, **kwargs)
-OperationalError: database is locked
diff --git a/tests/examplefiles/tsql_example.sql b/tests/examplefiles/tsql_example.sql
deleted file mode 100644
index cbd76091..00000000
--- a/tests/examplefiles/tsql_example.sql
+++ /dev/null
@@ -1,72 +0,0 @@
--- Example Transact-SQL file.
-
--- Single line comment
-/* A comment
- * spawning two lines. */
- /* An indented comment
- * spawning multiple
- * lines. */
-/* A /* nested */ comment. */
-
-select
- left(emp.firstname, 1) + '.' + [emp.surname] as "Name",
- dep.name as [Department]
-into
- #temp_employee
-from
- employee as emp
- inner join department as dep on
- dep.ident_code = emp.department_id
-where
- emp.date_of_birth >= '1990-01-01';
-go
-
-declare @TextToFind nvarchar(100) = N'some
-text across
-multiple lines';
-
-set @TextToFind varchar(32) = 'hello' + ' world';
-set @TextTiFind += '!';
-
-declare @Count int = 17 * (3 - 5);
-
-delete from
- [server].[database].[schema].[table]
-where
- [Text] = @TextToFind and author Not LIKE '%some%';
-
-goto overthere;
-overthere:
-
-select
- 123 as "int 1",
- +123 as "int 2",
- -123 as "int 3",
- 0x20 as "hex int",
- 123.45 as "float 1",
- -1.23e45 as "float 2"
- +1.23E+45 as "float 3",
- -1.23e-45 as "float 4",
- 1. as "float 5",
- .1 as "float 6",
- 1.e2 as "float 7",
- .1e2 as "float 8";
-
-Select @@Error, $PARTITion.RangePF1(10);
-
-select top 3 Ähnliches from Müll;
-
--- Example transaction
-BEGIN TRAN
-
-BEGIN TRY
- INSERT INTO #temp_employe(Name, Department) VALUES ('L. Miller', 'Sales')
- iNsErT inTO #temp_employe(Name, Department) VaLuEs ('M. Webster', 'Helpdesk')
- COMMIT TRAN
-END TRY
-BEGIN CATCH
- print 'cannot perform transaction; rolling back';
- ROLLBACK TRAN
-END CATCH
-
--- Comment at end without newline. \ No newline at end of file
diff --git a/tests/examplefiles/twig_test b/tests/examplefiles/twig_test
deleted file mode 100644
index 0932fe90..00000000
--- a/tests/examplefiles/twig_test
+++ /dev/null
@@ -1,4612 +0,0 @@
-From the Twig test suite, https://github.com/fabpot/Twig, available under BSD license.
-
---TEST--
-Exception for an unclosed tag
---TEMPLATE--
-{% block foo %}
- {% if foo %}
-
-
-
-
- {% for i in fo %}
-
-
-
- {% endfor %}
-
-
-
-{% endblock %}
---EXCEPTION--
-Twig_Error_Syntax: Unexpected tag name "endblock" (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16
---TEST--
-Exception for an undefined trait
---TEMPLATE--
-{% use 'foo' with foobar as bar %}
---TEMPLATE(foo)--
-{% block bar %}
-{% endblock %}
---EXCEPTION--
-Twig_Error_Runtime: Block "foobar" is not defined in trait "foo" in "index.twig".
---TEST--
-Twig supports method calls
---TEMPLATE--
-{{ items.foo }}
-{{ items['foo'] }}
-{{ items[foo] }}
-{{ items[items[foo]] }}
---DATA--
-return array('foo' => 'bar', 'items' => array('foo' => 'bar', 'bar' => 'foo'))
---EXPECT--
-bar
-bar
-foo
-bar
---TEST--
-Twig supports array notation
---TEMPLATE--
-{# empty array #}
-{{ []|join(',') }}
-
-{{ [1, 2]|join(',') }}
-{{ ['foo', "bar"]|join(',') }}
-{{ {0: 1, 'foo': 'bar'}|join(',') }}
-{{ {0: 1, 'foo': 'bar'}|keys|join(',') }}
-
-{{ {0: 1, foo: 'bar'}|join(',') }}
-{{ {0: 1, foo: 'bar'}|keys|join(',') }}
-
-{# nested arrays #}
-{% set a = [1, 2, [1, 2], {'foo': {'foo': 'bar'}}] %}
-{{ a[2]|join(',') }}
-{{ a[3]["foo"]|join(',') }}
-
-{# works even if [] is used inside the array #}
-{{ [foo[bar]]|join(',') }}
-
-{# elements can be any expression #}
-{{ ['foo'|upper, bar|upper, bar == foo]|join(',') }}
-
-{# arrays can have a trailing , like in PHP #}
-{{
- [
- 1,
- 2,
- ]|join(',')
-}}
-
-{# keys can be any expression #}
-{% set a = 1 %}
-{% set b = "foo" %}
-{% set ary = { (a): 'a', (b): 'b', 'c': 'c', (a ~ b): 'd' } %}
-{{ ary|keys|join(',') }}
-{{ ary|join(',') }}
---DATA--
-return array('bar' => 'bar', 'foo' => array('bar' => 'bar'))
---EXPECT--
-1,2
-foo,bar
-1,bar
-0,foo
-
-1,bar
-0,foo
-
-1,2
-bar
-
-bar
-
-FOO,BAR,
-
-1,2
-
-1,foo,c,1foo
-a,b,c,d
---TEST--
-Twig supports binary operations (+, -, *, /, ~, %, and, or)
---TEMPLATE--
-{{ 1 + 1 }}
-{{ 2 - 1 }}
-{{ 2 * 2 }}
-{{ 2 / 2 }}
-{{ 3 % 2 }}
-{{ 1 and 1 }}
-{{ 1 and 0 }}
-{{ 0 and 1 }}
-{{ 0 and 0 }}
-{{ 1 or 1 }}
-{{ 1 or 0 }}
-{{ 0 or 1 }}
-{{ 0 or 0 }}
-{{ 0 or 1 and 0 }}
-{{ 1 or 0 and 1 }}
-{{ "foo" ~ "bar" }}
-{{ foo ~ "bar" }}
-{{ "foo" ~ bar }}
-{{ foo ~ bar }}
-{{ 20 // 7 }}
---DATA--
-return array('foo' => 'bar', 'bar' => 'foo')
---EXPECT--
-2
-1
-4
-1
-1
-1
-
-
-
-1
-1
-1
-
-
-1
-foobar
-barbar
-foofoo
-barfoo
-2
---TEST--
-Twig supports bitwise operations
---TEMPLATE--
-{{ 1 b-and 5 }}
-{{ 1 b-or 5 }}
-{{ 1 b-xor 5 }}
-{{ (1 and 0 b-or 0) is same as(1 and (0 b-or 0)) ? 'ok' : 'ko' }}
---DATA--
-return array()
---EXPECT--
-1
-5
-4
-ok
---TEST--
-Twig supports comparison operators (==, !=, <, >, >=, <=)
---TEMPLATE--
-{{ 1 > 2 }}/{{ 1 > 1 }}/{{ 1 >= 2 }}/{{ 1 >= 1 }}
-{{ 1 < 2 }}/{{ 1 < 1 }}/{{ 1 <= 2 }}/{{ 1 <= 1 }}
-{{ 1 == 1 }}/{{ 1 == 2 }}
-{{ 1 != 1 }}/{{ 1 != 2 }}
---DATA--
-return array()
---EXPECT--
-///1
-1//1/1
-1/
-/1
---TEST--
-Twig supports the "divisible by" operator
---TEMPLATE--
-{{ 8 is divisible by(2) ? 'OK' }}
-{{ 8 is not divisible by(3) ? 'OK' }}
-{{ 8 is divisible by (2) ? 'OK' }}
-{{ 8 is not
- divisible
- by
- (3) ? 'OK' }}
---DATA--
-return array()
---EXPECT--
-OK
-OK
-OK
-OK
---TEST--
-Twig supports the .. operator
---TEMPLATE--
-{% for i in 0..10 %}{{ i }} {% endfor %}
-
-{% for letter in 'a'..'z' %}{{ letter }} {% endfor %}
-
-{% for letter in 'a'|upper..'z'|upper %}{{ letter }} {% endfor %}
-
-{% for i in foo[0]..foo[1] %}{{ i }} {% endfor %}
-
-{% for i in 0 + 1 .. 10 - 1 %}{{ i }} {% endfor %}
---DATA--
-return array('foo' => array(1, 10))
---EXPECT--
-0 1 2 3 4 5 6 7 8 9 10
-a b c d e f g h i j k l m n o p q r s t u v w x y z
-A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
-1 2 3 4 5 6 7 8 9 10
-1 2 3 4 5 6 7 8 9
---TEST--
-Twig supports the "ends with" operator
---TEMPLATE--
-{{ 'foo' ends with 'o' ? 'OK' : 'KO' }}
-{{ not ('foo' ends with 'f') ? 'OK' : 'KO' }}
-{{ not ('foo' ends with 'foowaytoolong') ? 'OK' : 'KO' }}
-{{ 'foo' ends with '' ? 'OK' : 'KO' }}
-{{ '1' ends with true ? 'OK' : 'KO' }}
-{{ 1 ends with true ? 'OK' : 'KO' }}
-{{ 0 ends with false ? 'OK' : 'KO' }}
-{{ '' ends with false ? 'OK' : 'KO' }}
-{{ false ends with false ? 'OK' : 'KO' }}
-{{ false ends with '' ? 'OK' : 'KO' }}
---DATA--
-return array()
---EXPECT--
-OK
-OK
-OK
-OK
-KO
-KO
-KO
-KO
-KO
-KO
---TEST--
-Twig supports grouping of expressions
---TEMPLATE--
-{{ (2 + 2) / 2 }}
---DATA--
-return array()
---EXPECT--
-2
---TEST--
-Twig supports literals
---TEMPLATE--
-1 {{ true }}
-2 {{ TRUE }}
-3 {{ false }}
-4 {{ FALSE }}
-5 {{ none }}
-6 {{ NONE }}
-7 {{ null }}
-8 {{ NULL }}
---DATA--
-return array()
---EXPECT--
-1 1
-2 1
-3
-4
-5
-6
-7
-8
---TEST--
-Twig supports __call() for attributes
---TEMPLATE--
-{{ foo.foo }}
-{{ foo.bar }}
---EXPECT--
-foo_from_call
-bar_from_getbar
---TEST--
-Twig supports the "matches" operator
---TEMPLATE--
-{{ 'foo' matches '/o/' ? 'OK' : 'KO' }}
-{{ 'foo' matches '/^fo/' ? 'OK' : 'KO' }}
-{{ 'foo' matches '/O/i' ? 'OK' : 'KO' }}
---DATA--
-return array()
---EXPECT--
-OK
-OK
-OK
---TEST--
-Twig supports method calls
---TEMPLATE--
-{{ items.foo.foo }}
-{{ items.foo.getFoo() }}
-{{ items.foo.bar }}
-{{ items.foo['bar'] }}
-{{ items.foo.bar('a', 43) }}
-{{ items.foo.bar(foo) }}
-{{ items.foo.self.foo() }}
-{{ items.foo.is }}
-{{ items.foo.in }}
-{{ items.foo.not }}
---DATA--
-return array('foo' => 'bar', 'items' => array('foo' => new TwigTestFoo(), 'bar' => 'foo'))
---CONFIG--
-return array('strict_variables' => false)
---EXPECT--
-foo
-foo
-bar
-
-bar_a-43
-bar_bar
-foo
-is
-in
-not
---TEST--
-Twig allows to use named operators as variable names
---TEMPLATE--
-{% for match in matches %}
- {{- match }}
-{% endfor %}
-{{ in }}
-{{ is }}
---DATA--
-return array('matches' => array(1, 2, 3), 'in' => 'in', 'is' => 'is')
---EXPECT--
-1
-2
-3
-in
-is
---TEST--
-Twig parses postfix expressions
---TEMPLATE--
-{% import _self as macros %}
-
-{% macro foo() %}foo{% endmacro %}
-
-{{ 'a' }}
-{{ 'a'|upper }}
-{{ ('a')|upper }}
-{{ -1|upper }}
-{{ macros.foo() }}
-{{ (macros).foo() }}
---DATA--
-return array();
---EXPECT--
-a
-A
-A
--1
-foo
-foo
---TEST--
-Twig supports the "same as" operator
---TEMPLATE--
-{{ 1 is same as(1) ? 'OK' }}
-{{ 1 is not same as(true) ? 'OK' }}
-{{ 1 is same as(1) ? 'OK' }}
-{{ 1 is not same as(true) ? 'OK' }}
-{{ 1 is same as (1) ? 'OK' }}
-{{ 1 is not
- same
- as
- (true) ? 'OK' }}
---DATA--
-return array()
---EXPECT--
-OK
-OK
-OK
-OK
-OK
-OK
---TEST--
-Twig supports the "starts with" operator
---TEMPLATE--
-{{ 'foo' starts with 'f' ? 'OK' : 'KO' }}
-{{ not ('foo' starts with 'oo') ? 'OK' : 'KO' }}
-{{ not ('foo' starts with 'foowaytoolong') ? 'OK' : 'KO' }}
-{{ 'foo' starts with 'f' ? 'OK' : 'KO' }}
-{{ 'foo' starts
-with 'f' ? 'OK' : 'KO' }}
-{{ 'foo' starts with '' ? 'OK' : 'KO' }}
-{{ '1' starts with true ? 'OK' : 'KO' }}
-{{ '' starts with false ? 'OK' : 'KO' }}
-{{ 'a' starts with false ? 'OK' : 'KO' }}
-{{ false starts with '' ? 'OK' : 'KO' }}
---DATA--
-return array()
---EXPECT--
-OK
-OK
-OK
-OK
-OK
-OK
-KO
-KO
-KO
-KO
---TEST--
-Twig supports string interpolation
---TEMPLATE--
-{# "foo #{"foo #{bar} baz"} baz" #}
-{# "foo #{bar}#{bar} baz" #}
---DATA--
-return array('bar' => 'BAR');
---EXPECT--
-foo foo BAR baz baz
-foo BARBAR baz
---TEST--
-Twig supports the ternary operator
---TEMPLATE--
-{{ 1 ? 'YES' }}
-{{ 0 ? 'YES' }}
---DATA--
-return array()
---EXPECT--
-YES
-
---TEST--
-Twig supports the ternary operator
---TEMPLATE--
-{{ 'YES' ?: 'NO' }}
-{{ 0 ?: 'NO' }}
---DATA--
-return array()
---EXPECT--
-YES
-NO
---TEST--
-Twig supports the ternary operator
---TEMPLATE--
-{{ 1 ? 'YES' : 'NO' }}
-{{ 0 ? 'YES' : 'NO' }}
-{{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }}
-{{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }}
-{{ 1 == 1 ? 'foo<br />':'' }}
-{{ foo ~ (bar ? ('-' ~ bar) : '') }}
---DATA--
-return array('foo' => 'foo', 'bar' => 'bar')
---EXPECT--
-YES
-NO
-YES1
-NO1
-foo<br />
-foo-bar
---TEST--
-Twig does not allow to use two-word named operators as variable names
---TEMPLATE--
-{{ starts with }}
---DATA--
-return array()
---EXCEPTION--
-Twig_Error_Syntax: Unexpected token "operator" of value "starts with" in "index.twig" at line 2
---TEST--
-Twig unary operators precedence
---TEMPLATE--
-{{ -1 - 1 }}
-{{ -1 - -1 }}
-{{ -1 * -1 }}
-{{ 4 / -1 * 5 }}
---DATA--
-return array()
---EXPECT--
--2
-0
-1
--20
---TEST--
-Twig supports unary operators (not, -, +)
---TEMPLATE--
-{{ not 1 }}/{{ not 0 }}
-{{ +1 + 1 }}/{{ -1 - 1 }}
-{{ not (false or true) }}
---DATA--
-return array()
---EXPECT--
-/1
-2/-2
-
---TEST--
-"abs" filter
---TEMPLATE--
-{{ (-5.5)|abs }}
-{{ (-5)|abs }}
-{{ (-0)|abs }}
-{{ 0|abs }}
-{{ 5|abs }}
-{{ 5.5|abs }}
-{{ number1|abs }}
-{{ number2|abs }}
-{{ number3|abs }}
-{{ number4|abs }}
-{{ number5|abs }}
-{{ number6|abs }}
---DATA--
-return array('number1' => -5.5, 'number2' => -5, 'number3' => -0, 'number4' => 0, 'number5' => 5, 'number6' => 5.5)
---EXPECT--
-5.5
-5
-0
-0
-5
-5.5
-5.5
-5
-0
-0
-5
-5.5
---TEST--
-"batch" filter
---TEMPLATE--
-{% for row in items|batch(3.1) %}
- <div class=row>
- {% for column in row %}
- <div class=item>{{ column }}</div>
- {% endfor %}
- </div>
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'))
---EXPECT--
-<div class=row>
- <div class=item>a</div>
- <div class=item>b</div>
- <div class=item>c</div>
- <div class=item>d</div>
- </div>
- <div class=row>
- <div class=item>e</div>
- <div class=item>f</div>
- <div class=item>g</div>
- <div class=item>h</div>
- </div>
- <div class=row>
- <div class=item>i</div>
- <div class=item>j</div>
- </div>
---TEST--
-"batch" filter
---TEMPLATE--
-{% for row in items|batch(3) %}
- <div class=row>
- {% for column in row %}
- <div class=item>{{ column }}</div>
- {% endfor %}
- </div>
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'))
---EXPECT--
-<div class=row>
- <div class=item>a</div>
- <div class=item>b</div>
- <div class=item>c</div>
- </div>
- <div class=row>
- <div class=item>d</div>
- <div class=item>e</div>
- <div class=item>f</div>
- </div>
- <div class=row>
- <div class=item>g</div>
- <div class=item>h</div>
- <div class=item>i</div>
- </div>
- <div class=row>
- <div class=item>j</div>
- </div>
---TEST--
-"batch" filter
---TEMPLATE--
-<table>
-{% for row in items|batch(3, '') %}
- <tr>
- {% for column in row %}
- <td>{{ column }}</td>
- {% endfor %}
- </tr>
-{% endfor %}
-</table>
---DATA--
-return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'))
---EXPECT--
-<table>
- <tr>
- <td>a</td>
- <td>b</td>
- <td>c</td>
- </tr>
- <tr>
- <td>d</td>
- <td>e</td>
- <td>f</td>
- </tr>
- <tr>
- <td>g</td>
- <td>h</td>
- <td>i</td>
- </tr>
- <tr>
- <td>j</td>
- <td></td>
- <td></td>
- </tr>
-</table>
---TEST--
-"batch" filter
---TEMPLATE--
-{% for row in items|batch(3, 'fill') %}
- <div class=row>
- {% for column in row %}
- <div class=item>{{ column }}</div>
- {% endfor %}
- </div>
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l'))
---EXPECT--
-<div class=row>
- <div class=item>a</div>
- <div class=item>b</div>
- <div class=item>c</div>
- </div>
- <div class=row>
- <div class=item>d</div>
- <div class=item>e</div>
- <div class=item>f</div>
- </div>
- <div class=row>
- <div class=item>g</div>
- <div class=item>h</div>
- <div class=item>i</div>
- </div>
- <div class=row>
- <div class=item>j</div>
- <div class=item>k</div>
- <div class=item>l</div>
- </div>
---TEST--
-"batch" filter
---TEMPLATE--
-<table>
-{% for row in items|batch(3, 'fill') %}
- <tr>
- {% for column in row %}
- <td>{{ column }}</td>
- {% endfor %}
- </tr>
-{% endfor %}
-</table>
---DATA--
-return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'))
---EXPECT--
-<table>
- <tr>
- <td>a</td>
- <td>b</td>
- <td>c</td>
- </tr>
- <tr>
- <td>d</td>
- <td>e</td>
- <td>f</td>
- </tr>
- <tr>
- <td>g</td>
- <td>h</td>
- <td>i</td>
- </tr>
- <tr>
- <td>j</td>
- <td>fill</td>
- <td>fill</td>
- </tr>
-</table>
---TEST--
-"convert_encoding" filter
---CONDITION--
-function_exists('iconv') || function_exists('mb_convert_encoding')
---TEMPLATE--
-{{ "愛していますか?"|convert_encoding('ISO-2022-JP', 'UTF-8')|convert_encoding('UTF-8', 'ISO-2022-JP') }}
---DATA--
-return array()
---EXPECT--
-愛していますか?
---TEST--
-"date" filter (interval support as of PHP 5.3)
---CONDITION--
-version_compare(phpversion(), '5.3.0', '>=')
---TEMPLATE--
-{{ date2|date }}
-{{ date2|date('%d days') }}
---DATA--
-date_default_timezone_set('UTC');
-$twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours');
-return array(
- 'date2' => new DateInterval('P2D'),
-)
---EXPECT--
-2 days 0 hours
-2 days
---TEST--
-"date" filter
---TEMPLATE--
-{{ date1|date }}
-{{ date1|date('d/m/Y') }}
---DATA--
-date_default_timezone_set('UTC');
-$twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours');
-return array(
- 'date1' => mktime(13, 45, 0, 10, 4, 2010),
-)
---EXPECT--
-2010-10-04
-04/10/2010
---TEST--
-"date" filter
---CONDITION--
-version_compare(phpversion(), '5.5.0', '>=')
---TEMPLATE--
-{{ date1|date }}
-{{ date1|date('d/m/Y') }}
-{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }}
-{{ date1|date('d/m/Y H:i:s', timezone1) }}
-{{ date1|date('d/m/Y H:i:s') }}
-
-{{ date2|date('d/m/Y H:i:s P', 'Europe/Paris') }}
-{{ date2|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }}
-{{ date2|date('d/m/Y H:i:s P', false) }}
-{{ date2|date('e', 'Europe/Paris') }}
-{{ date2|date('e', false) }}
---DATA--
-date_default_timezone_set('Europe/Paris');
-return array(
- 'date1' => new DateTimeImmutable('2010-10-04 13:45'),
- 'date2' => new DateTimeImmutable('2010-10-04 13:45', new DateTimeZone('America/New_York')),
- 'timezone1' => new DateTimeZone('America/New_York'),
-)
---EXPECT--
-October 4, 2010 13:45
-04/10/2010
-04/10/2010 19:45:00
-04/10/2010 07:45:00
-04/10/2010 13:45:00
-
-04/10/2010 19:45:00 +02:00
-05/10/2010 01:45:00 +08:00
-04/10/2010 13:45:00 -04:00
-Europe/Paris
-America/New_York
---TEST--
-"date" filter (interval support as of PHP 5.3)
---CONDITION--
-version_compare(phpversion(), '5.3.0', '>=')
---TEMPLATE--
-{{ date1|date }}
-{{ date1|date('%d days %h hours') }}
-{{ date1|date('%d days %h hours', timezone1) }}
---DATA--
-date_default_timezone_set('UTC');
-return array(
- 'date1' => new DateInterval('P2D'),
- // This should have no effect on DateInterval formatting
- 'timezone1' => new DateTimeZone('America/New_York'),
-)
---EXPECT--
-2 days
-2 days 0 hours
-2 days 0 hours
---TEST--
-"date_modify" filter
---TEMPLATE--
-{{ date1|date_modify('-1day')|date('Y-m-d H:i:s') }}
-{{ date2|date_modify('-1day')|date('Y-m-d H:i:s') }}
---DATA--
-date_default_timezone_set('UTC');
-return array(
- 'date1' => '2010-10-04 13:45',
- 'date2' => new DateTime('2010-10-04 13:45'),
-)
---EXPECT--
-2010-10-03 13:45:00
-2010-10-03 13:45:00
---TEST--
-"date" filter
---TEMPLATE--
-{{ date|date(format='d/m/Y H:i:s P', timezone='America/Chicago') }}
-{{ date|date(timezone='America/Chicago', format='d/m/Y H:i:s P') }}
-{{ date|date('d/m/Y H:i:s P', timezone='America/Chicago') }}
---DATA--
-date_default_timezone_set('UTC');
-return array('date' => mktime(13, 45, 0, 10, 4, 2010))
---EXPECT--
-04/10/2010 08:45:00 -05:00
-04/10/2010 08:45:00 -05:00
-04/10/2010 08:45:00 -05:00
---TEST--
-"date" filter
---TEMPLATE--
-{{ date1|date }}
-{{ date1|date('d/m/Y') }}
-{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }}
-{{ date1|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }}
-{{ date1|date('d/m/Y H:i:s P', 'America/Chicago') }}
-{{ date1|date('e') }}
-{{ date1|date('d/m/Y H:i:s') }}
-
-{{ date2|date }}
-{{ date2|date('d/m/Y') }}
-{{ date2|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }}
-{{ date2|date('d/m/Y H:i:s', timezone1) }}
-{{ date2|date('d/m/Y H:i:s') }}
-
-{{ date3|date }}
-{{ date3|date('d/m/Y') }}
-
-{{ date4|date }}
-{{ date4|date('d/m/Y') }}
-
-{{ date5|date }}
-{{ date5|date('d/m/Y') }}
-
-{{ date6|date('d/m/Y H:i:s P', 'Europe/Paris') }}
-{{ date6|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }}
-{{ date6|date('d/m/Y H:i:s P', false) }}
-{{ date6|date('e', 'Europe/Paris') }}
-{{ date6|date('e', false) }}
-
-{{ date7|date }}
---DATA--
-date_default_timezone_set('Europe/Paris');
-return array(
- 'date1' => mktime(13, 45, 0, 10, 4, 2010),
- 'date2' => new DateTime('2010-10-04 13:45'),
- 'date3' => '2010-10-04 13:45',
- 'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT
- 'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(),
- 'date6' => new DateTime('2010-10-04 13:45', new DateTimeZone('America/New_York')),
- 'date7' => '2010-01-28T15:00:00+05:00',
- 'timezone1' => new DateTimeZone('America/New_York'),
-)
---EXPECT--
-October 4, 2010 13:45
-04/10/2010
-04/10/2010 19:45:00
-04/10/2010 19:45:00 +08:00
-04/10/2010 06:45:00 -05:00
-Europe/Paris
-04/10/2010 13:45:00
-
-October 4, 2010 13:45
-04/10/2010
-04/10/2010 19:45:00
-04/10/2010 07:45:00
-04/10/2010 13:45:00
-
-October 4, 2010 13:45
-04/10/2010
-
-October 4, 2010 15:45
-04/10/2010
-
-January 2, 1964 04:04
-02/01/1964
-
-04/10/2010 19:45:00 +02:00
-05/10/2010 01:45:00 +08:00
-04/10/2010 13:45:00 -04:00
-Europe/Paris
-America/New_York
-
-January 28, 2010 11:00
---TEST--
-"default" filter
---TEMPLATE--
-Variable:
-{{ definedVar |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ nullVar |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }}
-Array access:
-{{ nested.definedVar |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ nested['definedVar'] |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ nested.zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ nested.emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ nested.nullVar |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ nested.undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ nested['undefinedVar'] |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ undefinedVar.foo |default('default') is same as('default') ? 'ok' : 'ko' }}
-Plain values:
-{{ 'defined' |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ 0 |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ '' |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ null |default('default') is same as('default') ? 'ok' : 'ko' }}
-Precedence:
-{{ 'o' ~ nullVar |default('k') }}
-{{ 'o' ~ nested.nullVar |default('k') }}
-Object methods:
-{{ object.foo |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ object.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ object.getFoo() |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ object.getFoo('a') |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ object.undefinedMethod() |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ object.undefinedMethod('a') |default('default') is same as('default') ? 'ok' : 'ko' }}
-Deep nested:
-{{ nested.undefinedVar.foo.bar |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ nested.definedArray.0 |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ nested['definedArray'][0] |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ object.self.foo |default('default') is same as('default') ? 'ko' : 'ok' }}
-{{ object.self.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }}
-{{ object.undefinedMethod.self |default('default') is same as('default') ? 'ok' : 'ko' }}
---DATA--
-return array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'emptyVar' => '',
- 'nullVar' => null,
- 'nested' => array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'emptyVar' => '',
- 'nullVar' => null,
- 'definedArray' => array(0),
- ),
- 'object' => new TwigTestFoo(),
-)
---CONFIG--
-return array('strict_variables' => false)
---EXPECT--
-Variable:
-ok
-ok
-ok
-ok
-ok
-Array access:
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-Plain values:
-ok
-ok
-ok
-ok
-Precedence:
-ok
-ok
-Object methods:
-ok
-ok
-ok
-ok
-ok
-ok
-Deep nested:
-ok
-ok
-ok
-ok
-ok
-ok
---DATA--
-return array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'emptyVar' => '',
- 'nullVar' => null,
- 'nested' => array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'emptyVar' => '',
- 'nullVar' => null,
- 'definedArray' => array(0),
- ),
- 'object' => new TwigTestFoo(),
-)
---CONFIG--
-return array('strict_variables' => true)
---EXPECT--
-Variable:
-ok
-ok
-ok
-ok
-ok
-Array access:
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-Plain values:
-ok
-ok
-ok
-ok
-Precedence:
-ok
-ok
-Object methods:
-ok
-ok
-ok
-ok
-ok
-ok
-Deep nested:
-ok
-ok
-ok
-ok
-ok
-ok
---TEST--
-dynamic filter
---TEMPLATE--
-{{ 'bar'|foo_path }}
-{{ 'bar'|a_foo_b_bar }}
---DATA--
-return array()
---EXPECT--
-foo/bar
-a/b/bar
---TEST--
-"escape" filter does not escape with the html strategy when using the html_attr strategy
---TEMPLATE--
-{{ '<br />'|escape('html_attr') }}
---DATA--
-return array()
---EXPECT--
-&lt;br&#x20;&#x2F;&gt;
---TEST--
-"escape" filter
---TEMPLATE--
-{{ "愛していますか? <br />"|e }}
---DATA--
-return array()
---EXPECT--
-愛していますか? &lt;br /&gt;
---TEST--
-"escape" filter
---TEMPLATE--
-{{ "foo <br />"|e }}
---DATA--
-return array()
---EXPECT--
-foo &lt;br /&gt;
---TEST--
-"first" filter
---TEMPLATE--
-{{ [1, 2, 3, 4]|first }}
-{{ {a: 1, b: 2, c: 3, d: 4}|first }}
-{{ '1234'|first }}
-{{ arr|first }}
-{{ 'Ä€é'|first }}
-{{ ''|first }}
---DATA--
-return array('arr' => new ArrayObject(array(1, 2, 3, 4)))
---EXPECT--
-1
-1
-1
-1
---TEST--
-"escape" filter
---TEMPLATE--
-{% set foo %}
- foo<br />
-{% endset %}
-
-{{ foo|e('html') -}}
-{{ foo|e('js') }}
-{% autoescape true %}
- {{ foo }}
-{% endautoescape %}
---DATA--
-return array()
---EXPECT--
- foo&lt;br /&gt;
-\x20\x20\x20\x20foo\x3Cbr\x20\x2F\x3E\x0A
- foo<br />
---TEST--
-"format" filter
---TEMPLATE--
-{{ string|format(foo, 3) }}
---DATA--
-return array('string' => '%s/%d', 'foo' => 'bar')
---EXPECT--
-bar/3
---TEST--
-"join" filter
---TEMPLATE--
-{{ ["foo", "bar"]|join(', ') }}
-{{ foo|join(', ') }}
-{{ bar|join(', ') }}
---DATA--
-return array('foo' => new TwigTestFoo(), 'bar' => new ArrayObject(array(3, 4)))
---EXPECT--
-foo, bar
-1, 2
-3, 4
---TEST--
-"json_encode" filter
---TEMPLATE--
-{{ "foo"|json_encode|raw }}
-{{ foo|json_encode|raw }}
-{{ [foo, "foo"]|json_encode|raw }}
---DATA--
-return array('foo' => new Twig_Markup('foo', 'UTF-8'))
---EXPECT--
-"foo"
-"foo"
-["foo","foo"]
---TEST--
-"last" filter
---TEMPLATE--
-{{ [1, 2, 3, 4]|last }}
-{{ {a: 1, b: 2, c: 3, d: 4}|last }}
-{{ '1234'|last }}
-{{ arr|last }}
-{{ 'Ä€é'|last }}
-{{ ''|last }}
---DATA--
-return array('arr' => new ArrayObject(array(1, 2, 3, 4)))
---EXPECT--
-4
-4
-4
-4
---TEST--
-"length" filter
---TEMPLATE--
-{{ array|length }}
-{{ string|length }}
-{{ number|length }}
-{{ markup|length }}
---DATA--
-return array('array' => array(1, 4), 'string' => 'foo', 'number' => 1000, 'markup' => new Twig_Markup('foo', 'UTF-8'))
---EXPECT--
-2
-3
-4
-3
---TEST--
-"length" filter
---CONDITION--
-function_exists('mb_get_info')
---TEMPLATE--
-{{ string|length }}
-{{ markup|length }}
---DATA--
-return array('string' => 'été', 'markup' => new Twig_Markup('foo', 'UTF-8'))
---EXPECT--
-3
-3
---TEST--
-"merge" filter
---TEMPLATE--
-{{ items|merge({'bar': 'foo'})|join }}
-{{ items|merge({'bar': 'foo'})|keys|join }}
-{{ {'bar': 'foo'}|merge(items)|join }}
-{{ {'bar': 'foo'}|merge(items)|keys|join }}
-{{ numerics|merge([4, 5, 6])|join }}
---DATA--
-return array('items' => array('foo' => 'bar'), 'numerics' => array(1, 2, 3))
---EXPECT--
-barfoo
-foobar
-foobar
-barfoo
-123456
---TEST--
-"nl2br" filter
---TEMPLATE--
-{{ "I like Twig.\nYou will like it too.\n\nEverybody like it!"|nl2br }}
-{{ text|nl2br }}
---DATA--
-return array('text' => "If you have some <strong>HTML</strong>\nit will be escaped.")
---EXPECT--
-I like Twig.<br />
-You will like it too.<br />
-<br />
-Everybody like it!
-If you have some &lt;strong&gt;HTML&lt;/strong&gt;<br />
-it will be escaped.
---TEST--
-"number_format" filter with defaults.
---TEMPLATE--
-{{ 20|number_format }}
-{{ 20.25|number_format }}
-{{ 20.25|number_format(1) }}
-{{ 20.25|number_format(2, ',') }}
-{{ 1020.25|number_format }}
-{{ 1020.25|number_format(2, ',') }}
-{{ 1020.25|number_format(2, ',', '.') }}
---DATA--
-$twig->getExtension('core')->setNumberFormat(2, '!', '=');
-return array();
---EXPECT--
-20!00
-20!25
-20!3
-20,25
-1=020!25
-1=020,25
-1.020,25
---TEST--
-"number_format" filter
---TEMPLATE--
-{{ 20|number_format }}
-{{ 20.25|number_format }}
-{{ 20.25|number_format(2) }}
-{{ 20.25|number_format(2, ',') }}
-{{ 1020.25|number_format(2, ',') }}
-{{ 1020.25|number_format(2, ',', '.') }}
---DATA--
-return array();
---EXPECT--
-20
-20
-20.25
-20,25
-1,020,25
-1.020,25
---TEST--
-"replace" filter
---TEMPLATE--
-{{ "I like %this% and %that%."|replace({'%this%': "foo", '%that%': "bar"}) }}
---DATA--
-return array()
---EXPECT--
-I like foo and bar.
---TEST--
-"reverse" filter
---TEMPLATE--
-{{ [1, 2, 3, 4]|reverse|join('') }}
-{{ '1234évènement'|reverse }}
-{{ arr|reverse|join('') }}
-{{ {'a': 'c', 'b': 'a'}|reverse()|join(',') }}
-{{ {'a': 'c', 'b': 'a'}|reverse(preserveKeys=true)|join(glue=',') }}
-{{ {'a': 'c', 'b': 'a'}|reverse(preserve_keys=true)|join(glue=',') }}
---DATA--
-return array('arr' => new ArrayObject(array(1, 2, 3, 4)))
---EXPECT--
-4321
-tnemenèvé4321
-4321
-a,c
-a,c
-a,c
---TEST--
-"round" filter
---TEMPLATE--
-{{ 2.7|round }}
-{{ 2.1|round }}
-{{ 2.1234|round(3, 'floor') }}
-{{ 2.1|round(0, 'ceil') }}
-
-{{ 21.3|round(-1)}}
-{{ 21.3|round(-1, 'ceil')}}
-{{ 21.3|round(-1, 'floor')}}
---DATA--
-return array()
---EXPECT--
-3
-2
-2.123
-3
-
-20
-30
-20
---TEST--
-"slice" filter
---TEMPLATE--
-{{ [1, 2, 3, 4][1:2]|join('') }}
-{{ {a: 1, b: 2, c: 3, d: 4}[1:2]|join('') }}
-{{ [1, 2, 3, 4][start:length]|join('') }}
-{{ [1, 2, 3, 4]|slice(1, 2)|join('') }}
-{{ [1, 2, 3, 4]|slice(1, 2)|keys|join('') }}
-{{ [1, 2, 3, 4]|slice(1, 2, true)|keys|join('') }}
-{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|join('') }}
-{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|keys|join('') }}
-{{ '1234'|slice(1, 2) }}
-{{ '1234'[1:2] }}
-{{ arr|slice(1, 2)|join('') }}
-{{ arr[1:2]|join('') }}
-
-{{ [1, 2, 3, 4]|slice(1)|join('') }}
-{{ [1, 2, 3, 4][1:]|join('') }}
-{{ '1234'|slice(1) }}
-{{ '1234'[1:] }}
-{{ '1234'[:1] }}
---DATA--
-return array('start' => 1, 'length' => 2, 'arr' => new ArrayObject(array(1, 2, 3, 4)))
---EXPECT--
-23
-23
-23
-23
-01
-12
-23
-bc
-23
-23
-23
-23
-
-234
-234
-234
-234
-1
---TEST--
-"sort" filter
---TEMPLATE--
-{{ array1|sort|join }}
-{{ array2|sort|join }}
---DATA--
-return array('array1' => array(4, 1), 'array2' => array('foo', 'bar'))
---EXPECT--
-14
-barfoo
---TEST--
-"split" filter
---TEMPLATE--
-{{ "one,two,three,four,five"|split(',')|join('-') }}
-{{ foo|split(',')|join('-') }}
-{{ foo|split(',', 3)|join('-') }}
-{{ baz|split('')|join('-') }}
-{{ baz|split('', 2)|join('-') }}
-{{ foo|split(',', -2)|join('-') }}
---DATA--
-return array('foo' => "one,two,three,four,five", 'baz' => '12345',)
---EXPECT--
-one-two-three-four-five
-one-two-three-four-five
-one-two-three,four,five
-1-2-3-4-5
-12-34-5
-one-two-three--TEST--
-"trim" filter
---TEMPLATE--
-{{ " I like Twig. "|trim }}
-{{ text|trim }}
-{{ " foo/"|trim("/") }}
---DATA--
-return array('text' => " If you have some <strong>HTML</strong> it will be escaped. ")
---EXPECT--
-I like Twig.
-If you have some &lt;strong&gt;HTML&lt;/strong&gt; it will be escaped.
- foo
---TEST--
-"url_encode" filter for PHP < 5.4 and HHVM
---CONDITION--
-defined('PHP_QUERY_RFC3986')
---TEMPLATE--
-{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }}
-{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }}
-{{ {}|url_encode|default("default") }}
-{{ 'spéßi%le%c0d@dspa ce'|url_encode }}
---DATA--
-return array()
---EXPECT--
-foo=bar&amp;number=3&amp;sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&amp;spa%20ce=
-foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce=
-default
-sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce
---TEST--
-"url_encode" filter
---CONDITION--
-defined('PHP_QUERY_RFC3986')
---TEMPLATE--
-{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }}
-{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }}
-{{ {}|url_encode|default("default") }}
-{{ 'spéßi%le%c0d@dspa ce'|url_encode }}
---DATA--
-return array()
---EXPECT--
-foo=bar&amp;number=3&amp;sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&amp;spa%20ce=
-foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce=
-default
-sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce
---TEST--
-"attribute" function
---TEMPLATE--
-{{ attribute(obj, method) }}
-{{ attribute(array, item) }}
-{{ attribute(obj, "bar", ["a", "b"]) }}
-{{ attribute(obj, "bar", arguments) }}
-{{ attribute(obj, method) is defined ? 'ok' : 'ko' }}
-{{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }}
---DATA--
-return array('obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => array('foo' => 'bar'), 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => array('a', 'b'))
---EXPECT--
-foo
-bar
-bar_a-b
-bar_a-b
-ok
-ko
---TEST--
-"block" function
---TEMPLATE--
-{% extends 'base.twig' %}
-{% block bar %}BAR{% endblock %}
---TEMPLATE(base.twig)--
-{% block foo %}{{ block('bar') }}{% endblock %}
-{% block bar %}BAR_BASE{% endblock %}
---DATA--
-return array()
---EXPECT--
-BARBAR
---TEST--
-"constant" function
---TEMPLATE--
-{{ constant('DATE_W3C') == expect ? 'true' : 'false' }}
-{{ constant('ARRAY_AS_PROPS', object) }}
---DATA--
-return array('expect' => DATE_W3C, 'object' => new ArrayObject(array('hi')));
---EXPECT--
-true
-2
---TEST--
-"cycle" function
---TEMPLATE--
-{% for i in 0..6 %}
-{{ cycle(array1, i) }}-{{ cycle(array2, i) }}
-{% endfor %}
---DATA--
-return array('array1' => array('odd', 'even'), 'array2' => array('apple', 'orange', 'citrus'))
---EXPECT--
-odd-apple
-even-orange
-odd-citrus
-even-apple
-odd-orange
-even-citrus
-odd-apple
---TEST--
-"date" function
---TEMPLATE--
-{{ date(date, "America/New_York")|date('d/m/Y H:i:s P', false) }}
-{{ date(timezone="America/New_York", date=date)|date('d/m/Y H:i:s P', false) }}
---DATA--
-date_default_timezone_set('UTC');
-return array('date' => mktime(13, 45, 0, 10, 4, 2010))
---EXPECT--
-04/10/2010 09:45:00 -04:00
-04/10/2010 09:45:00 -04:00
---TEST--
-"date" function
---TEMPLATE--
-{{ date() == date('now') ? 'OK' : 'KO' }}
-{{ date(date1) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
-{{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
-{{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
-{{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
-{{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }}
---DATA--
-date_default_timezone_set('UTC');
-return array(
- 'date1' => mktime(13, 45, 0, 10, 4, 2010),
- 'date2' => new DateTime('2010-10-04 13:45'),
- 'date3' => '2010-10-04 13:45',
- 'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT
- 'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(),
-)
---EXPECT--
-OK
-OK
-OK
-OK
-OK
-OK
---TEST--
-"dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded
---CONDITION--
-!extension_loaded('xdebug') || (($r = new ReflectionExtension('xdebug')) && version_compare($r->getVersion(), '2.2-dev', '<'))
---TEMPLATE--
-{{ dump() }}
---DATA--
-return array('foo' => 'foo', 'bar' => 'bar')
---CONFIG--
-return array('debug' => true, 'autoescape' => false);
---TEST--
-"dump" function
---CONDITION--
-!extension_loaded('xdebug')
---TEMPLATE--
-{{ dump('foo') }}
-{{ dump('foo', 'bar') }}
---DATA--
-return array('foo' => 'foo', 'bar' => 'bar')
---CONFIG--
-return array('debug' => true, 'autoescape' => false);
---EXPECT--
-string(3) "foo"
-
-string(3) "foo"
-string(3) "bar"
---TEST--
-dynamic function
---TEMPLATE--
-{{ foo_path('bar') }}
-{{ a_foo_b_bar('bar') }}
---DATA--
-return array()
---EXPECT--
-foo/bar
-a/b/bar
---TEST--
-"include" function
---TEMPLATE--
-{% set tmp = include("foo.twig") %}
-
-FOO{{ tmp }}BAR
---TEMPLATE(foo.twig)--
-FOOBAR
---DATA--
-return array()
---EXPECT--
-FOO
-FOOBARBAR
---TEST--
-"include" function is safe for auto-escaping
---TEMPLATE--
-{{ include("foo.twig") }}
---TEMPLATE(foo.twig)--
-<p>Test</p>
---DATA--
-return array()
---EXPECT--
-<p>Test</p>
---TEST--
-"include" function
---TEMPLATE--
-FOO
-{{ include("foo.twig") }}
-
-BAR
---TEMPLATE(foo.twig)--
-FOOBAR
---DATA--
-return array()
---EXPECT--
-FOO
-
-FOOBAR
-
-BAR
---TEST--
-"include" function allows expressions for the template to include
---TEMPLATE--
-FOO
-{{ include(foo) }}
-
-BAR
---TEMPLATE(foo.twig)--
-FOOBAR
---DATA--
-return array('foo' => 'foo.twig')
---EXPECT--
-FOO
-
-FOOBAR
-
-BAR
---TEST--
-"include" function
---TEMPLATE--
-{{ include(["foo.twig", "bar.twig"], ignore_missing = true) }}
-{{ include("foo.twig", ignore_missing = true) }}
-{{ include("foo.twig", ignore_missing = true, variables = {}) }}
-{{ include("foo.twig", ignore_missing = true, variables = {}, with_context = true) }}
---DATA--
-return array()
---EXPECT--
---TEST--
-"include" function
---TEMPLATE--
-{% extends "base.twig" %}
-
-{% block content %}
- {{ parent() }}
-{% endblock %}
---TEMPLATE(base.twig)--
-{% block content %}
- {{ include("foo.twig") }}
-{% endblock %}
---DATA--
-return array();
---EXCEPTION--
-Twig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3.
---TEST--
-"include" function
---TEMPLATE--
-{{ include("foo.twig") }}
---DATA--
-return array();
---EXCEPTION--
-Twig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2.
---TEST--
-"include" tag sandboxed
---TEMPLATE--
-{{ include("foo.twig", sandboxed = true) }}
---TEMPLATE(foo.twig)--
-{{ foo|e }}
---DATA--
-return array()
---EXCEPTION--
-Twig_Sandbox_SecurityError: Filter "e" is not allowed in "index.twig" at line 2.
---TEST--
-"include" function accepts Twig_Template instance
---TEMPLATE--
-{{ include(foo) }} FOO
---TEMPLATE(foo.twig)--
-BAR
---DATA--
-return array('foo' => $twig->loadTemplate('foo.twig'))
---EXPECT--
-BAR FOO
---TEST--
-"include" function
---TEMPLATE--
-{{ include(["foo.twig", "bar.twig"]) }}
-{{- include(["bar.twig", "foo.twig"]) }}
---TEMPLATE(foo.twig)--
-foo
---DATA--
-return array()
---EXPECT--
-foo
-foo
---TEST--
-"include" function accept variables and with_context
---TEMPLATE--
-{{ include("foo.twig") }}
-{{- include("foo.twig", with_context = false) }}
-{{- include("foo.twig", {'foo1': 'bar'}) }}
-{{- include("foo.twig", {'foo1': 'bar'}, with_context = false) }}
---TEMPLATE(foo.twig)--
-{% for k, v in _context %}{{ k }},{% endfor %}
---DATA--
-return array('foo' => 'bar')
---EXPECT--
-foo,global,_parent,
-global,_parent,
-foo,global,foo1,_parent,
-foo1,global,_parent,
---TEST--
-"include" function accept variables
---TEMPLATE--
-{{ include("foo.twig", {'foo': 'bar'}) }}
-{{- include("foo.twig", vars) }}
---TEMPLATE(foo.twig)--
-{{ foo }}
---DATA--
-return array('vars' => array('foo' => 'bar'))
---EXPECT--
-bar
-bar
---TEST--
-"max" function
---TEMPLATE--
-{{ max([2, 1, 3, 5, 4]) }}
-{{ max(2, 1, 3, 5, 4) }}
-{{ max({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }}
---DATA--
-return array()
---EXPECT--
-5
-5
-two
---TEST--
-"min" function
---TEMPLATE--
-{{ min(2, 1, 3, 5, 4) }}
-{{ min([2, 1, 3, 5, 4]) }}
-{{ min({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }}
---DATA--
-return array()
---EXPECT--
-1
-1
-five
---TEST--
-"range" function
---TEMPLATE--
-{{ range(low=0+1, high=10+0, step=2)|join(',') }}
---DATA--
-return array()
---EXPECT--
-1,3,5,7,9
---TEST--
-"block" function recursively called in a parent template
---TEMPLATE--
-{% extends "ordered_menu.twig" %}
-{% block label %}"{{ parent() }}"{% endblock %}
-{% block list %}{% set class = 'b' %}{{ parent() }}{% endblock %}
---TEMPLATE(ordered_menu.twig)--
-{% extends "menu.twig" %}
-{% block list %}{% set class = class|default('a') %}<ol class="{{ class }}">{{ block('children') }}</ol>{% endblock %}
---TEMPLATE(menu.twig)--
-{% extends "base.twig" %}
-{% block list %}<ul>{{ block('children') }}</ul>{% endblock %}
-{% block children %}{% set currentItem = item %}{% for item in currentItem %}{{ block('item') }}{% endfor %}{% set item = currentItem %}{% endblock %}
-{% block item %}<li>{% if item is not iterable %}{{ block('label') }}{% else %}{{ block('list') }}{% endif %}</li>{% endblock %}
-{% block label %}{{ item }}{{ block('unknown') }}{% endblock %}
---TEMPLATE(base.twig)--
-{{ block('list') }}
---DATA--
-return array('item' => array('1', '2', array('3.1', array('3.2.1', '3.2.2'), '3.4')))
---EXPECT--
-<ol class="b"><li>"1"</li><li>"2"</li><li><ol class="b"><li>"3.1"</li><li><ol class="b"><li>"3.2.1"</li><li>"3.2.2"</li></ol></li><li>"3.4"</li></ol></li></ol>
---TEST--
-"source" function
---TEMPLATE--
-FOO
-{{ source("foo.twig") }}
-
-BAR
---TEMPLATE(foo.twig)--
-{{ foo }}<br />
---DATA--
-return array()
---EXPECT--
-FOO
-
-{{ foo }}<br />
-
-BAR
---TEST--
-"template_from_string" function
---TEMPLATE--
-{% include template_from_string(template) %}
-
-{% include template_from_string("Hello {{ name }}") %}
-{% include template_from_string('{% extends "parent.twig" %}{% block content %}Hello {{ name }}{% endblock %}') %}
---TEMPLATE(parent.twig)--
-{% block content %}{% endblock %}
---DATA--
-return array('name' => 'Fabien', 'template' => "Hello {{ name }}")
---EXPECT--
-Hello Fabien
-Hello Fabien
-Hello Fabien
---TEST--
-macro
---TEMPLATE--
-{% from _self import test %}
-
-{% macro test(a, b = 'bar') -%}
-{{ a }}{{ b }}
-{%- endmacro %}
-
-{{ test('foo') }}
-{{ test('bar', 'foo') }}
---DATA--
-return array();
---EXPECT--
-foobar
-barfoo
---TEST--
-macro
---TEMPLATE--
-{% import _self as macros %}
-
-{% macro foo(data) %}
- {{ data }}
-{% endmacro %}
-
-{% macro bar() %}
- <br />
-{% endmacro %}
-
-{{ macros.foo(macros.bar()) }}
---DATA--
-return array();
---EXPECT--
-<br />
---TEST--
-macro
---TEMPLATE--
-{% from _self import test %}
-
-{% macro test(this) -%}
- {{ this }}
-{%- endmacro %}
-
-{{ test(this) }}
---DATA--
-return array('this' => 'foo');
---EXPECT--
-foo
---TEST--
-macro
---TEMPLATE--
-{% import _self as test %}
-{% from _self import test %}
-
-{% macro test(a, b) -%}
- {{ a|default('a') }}<br />
- {{- b|default('b') }}<br />
-{%- endmacro %}
-
-{{ test.test() }}
-{{ test() }}
-{{ test.test(1, "c") }}
-{{ test(1, "c") }}
---DATA--
-return array();
---EXPECT--
-a<br />b<br />
-a<br />b<br />
-1<br />c<br />
-1<br />c<br />
---TEST--
-macro with a filter
---TEMPLATE--
-{% import _self as test %}
-
-{% macro test() %}
- {% filter escape %}foo<br />{% endfilter %}
-{% endmacro %}
-
-{{ test.test() }}
---DATA--
-return array();
---EXPECT--
-foo&lt;br /&gt;
---TEST--
-Twig outputs 0 nodes correctly
---TEMPLATE--
-{{ foo }}0{{ foo }}
---DATA--
-return array('foo' => 'foo')
---EXPECT--
-foo0foo
---TEST--
-error in twig extension
---TEMPLATE--
-{{ object.region is not null ? object.regionChoices[object.region] }}
---EXPECT--
-house.region.s
---TEST--
-Twig is able to deal with SimpleXMLElement instances as variables
---CONDITION--
-version_compare(phpversion(), '5.3.0', '>=')
---TEMPLATE--
-Hello '{{ images.image.0.group }}'!
-{{ images.image.0.group.attributes.myattr }}
-{{ images.children().image.count() }}
-{% for image in images %}
- - {{ image.group }}
-{% endfor %}
---DATA--
-return array('images' => new SimpleXMLElement('<images><image><group myattr="example">foo</group></image><image><group>bar</group></image></images>'))
---EXPECT--
-Hello 'foo'!
-example
-2
- - foo
- - bar
---TEST--
-Twig does not confuse strings with integers in getAttribute()
---TEMPLATE--
-{{ hash['2e2'] }}
---DATA--
-return array('hash' => array('2e2' => 'works'))
---EXPECT--
-works
---TEST--
-"autoescape" tag applies escaping on its children
---TEMPLATE--
-{% autoescape %}
-{{ var }}<br />
-{% endautoescape %}
-{% autoescape 'html' %}
-{{ var }}<br />
-{% endautoescape %}
-{% autoescape false %}
-{{ var }}<br />
-{% endautoescape %}
-{% autoescape true %}
-{{ var }}<br />
-{% endautoescape %}
-{% autoescape false %}
-{{ var }}<br />
-{% endautoescape %}
---DATA--
-return array('var' => '<br />')
---EXPECT--
-&lt;br /&gt;<br />
-&lt;br /&gt;<br />
-<br /><br />
-&lt;br /&gt;<br />
-<br /><br />
---TEST--
-"autoescape" tag applies escaping on embedded blocks
---TEMPLATE--
-{% autoescape 'html' %}
- {% block foo %}
- {{ var }}
- {% endblock %}
-{% endautoescape %}
---DATA--
-return array('var' => '<br />')
---EXPECT--
-&lt;br /&gt;
---TEST--
-"autoescape" tag does not double-escape
---TEMPLATE--
-{% autoescape 'html' %}
-{{ var|escape }}
-{% endautoescape %}
---DATA--
-return array('var' => '<br />')
---EXPECT--
-&lt;br /&gt;
---TEST--
-"autoescape" tag applies escaping after calling functions
---TEMPLATE--
-
-autoescape false
-{% autoescape false %}
-
-safe_br
-{{ safe_br() }}
-
-unsafe_br
-{{ unsafe_br() }}
-
-{% endautoescape %}
-
-autoescape 'html'
-{% autoescape 'html' %}
-
-safe_br
-{{ safe_br() }}
-
-unsafe_br
-{{ unsafe_br() }}
-
-unsafe_br()|raw
-{{ (unsafe_br())|raw }}
-
-safe_br()|escape
-{{ (safe_br())|escape }}
-
-safe_br()|raw
-{{ (safe_br())|raw }}
-
-unsafe_br()|escape
-{{ (unsafe_br())|escape }}
-
-{% endautoescape %}
-
-autoescape js
-{% autoescape 'js' %}
-
-safe_br
-{{ safe_br() }}
-
-{% endautoescape %}
---DATA--
-return array()
---EXPECT--
-
-autoescape false
-
-safe_br
-<br />
-
-unsafe_br
-<br />
-
-
-autoescape 'html'
-
-safe_br
-<br />
-
-unsafe_br
-&lt;br /&gt;
-
-unsafe_br()|raw
-<br />
-
-safe_br()|escape
-&lt;br /&gt;
-
-safe_br()|raw
-<br />
-
-unsafe_br()|escape
-&lt;br /&gt;
-
-
-autoescape js
-
-safe_br
-\x3Cbr\x20\x2F\x3E
---TEST--
-"autoescape" tag does not apply escaping on literals
---TEMPLATE--
-{% autoescape 'html' %}
-
-1. Simple literal
-{{ "<br />" }}
-
-2. Conditional expression with only literals
-{{ true ? "<br />" : "<br>" }}
-
-3. Conditional expression with a variable
-{{ true ? "<br />" : someVar }}
-
-4. Nested conditionals with only literals
-{{ true ? (true ? "<br />" : "<br>") : "\n" }}
-
-5. Nested conditionals with a variable
-{{ true ? (true ? "<br />" : someVar) : "\n" }}
-
-6. Nested conditionals with a variable marked safe
-{{ true ? (true ? "<br />" : someVar|raw) : "\n" }}
-
-{% endautoescape %}
---DATA--
-return array()
---EXPECT--
-
-1. Simple literal
-<br />
-
-2. Conditional expression with only literals
-<br />
-
-3. Conditional expression with a variable
-&lt;br /&gt;
-
-4. Nested conditionals with only literals
-<br />
-
-5. Nested conditionals with a variable
-&lt;br /&gt;
-
-6. Nested conditionals with a variable marked safe
-<br />
---TEST--
-"autoescape" tags can be nested at will
---TEMPLATE--
-{{ var }}
-{% autoescape 'html' %}
- {{ var }}
- {% autoescape false %}
- {{ var }}
- {% autoescape 'html' %}
- {{ var }}
- {% endautoescape %}
- {{ var }}
- {% endautoescape %}
- {{ var }}
-{% endautoescape %}
-{{ var }}
---DATA--
-return array('var' => '<br />')
---EXPECT--
-&lt;br /&gt;
- &lt;br /&gt;
- <br />
- &lt;br /&gt;
- <br />
- &lt;br /&gt;
-&lt;br /&gt;
---TEST--
-"autoescape" tag applies escaping to object method calls
---TEMPLATE--
-{% autoescape 'html' %}
-{{ user.name }}
-{{ user.name|lower }}
-{{ user }}
-{% endautoescape %}
---EXPECT--
-Fabien&lt;br /&gt;
-fabien&lt;br /&gt;
-Fabien&lt;br /&gt;
---TEST--
-"autoescape" tag does not escape when raw is used as a filter
---TEMPLATE--
-{% autoescape 'html' %}
-{{ var|raw }}
-{% endautoescape %}
---DATA--
-return array('var' => '<br />')
---EXPECT--
-<br />
---TEST--
-"autoescape" tag accepts an escaping strategy
---TEMPLATE--
-{% autoescape true js %}{{ var }}{% endautoescape %}
-
-{% autoescape true html %}{{ var }}{% endautoescape %}
-
-{% autoescape 'js' %}{{ var }}{% endautoescape %}
-
-{% autoescape 'html' %}{{ var }}{% endautoescape %}
---DATA--
-return array('var' => '<br />"')
---EXPECT--
-\x3Cbr\x20\x2F\x3E\x22
-&lt;br /&gt;&quot;
-\x3Cbr\x20\x2F\x3E\x22
-&lt;br /&gt;&quot;
---TEST--
-escape types
---TEMPLATE--
-
-1. autoescape 'html' |escape('js')
-
-{% autoescape 'html' %}
-<a onclick="alert(&quot;{{ msg|escape('js') }}&quot;)"></a>
-{% endautoescape %}
-
-2. autoescape 'html' |escape('js')
-
-{% autoescape 'html' %}
-<a onclick="alert(&quot;{{ msg|escape('js') }}&quot;)"></a>
-{% endautoescape %}
-
-3. autoescape 'js' |escape('js')
-
-{% autoescape 'js' %}
-<a onclick="alert(&quot;{{ msg|escape('js') }}&quot;)"></a>
-{% endautoescape %}
-
-4. no escape
-
-{% autoescape false %}
-<a onclick="alert(&quot;{{ msg }}&quot;)"></a>
-{% endautoescape %}
-
-5. |escape('js')|escape('html')
-
-{% autoescape false %}
-<a onclick="alert(&quot;{{ msg|escape('js')|escape('html') }}&quot;)"></a>
-{% endautoescape %}
-
-6. autoescape 'html' |escape('js')|escape('html')
-
-{% autoescape 'html' %}
-<a onclick="alert(&quot;{{ msg|escape('js')|escape('html') }}&quot;)"></a>
-{% endautoescape %}
-
---DATA--
-return array('msg' => "<>\n'\"")
---EXPECT--
-
-1. autoescape 'html' |escape('js')
-
-<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
-
-2. autoescape 'html' |escape('js')
-
-<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
-
-3. autoescape 'js' |escape('js')
-
-<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
-
-4. no escape
-
-<a onclick="alert(&quot;<>
-'"&quot;)"></a>
-
-5. |escape('js')|escape('html')
-
-<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
-
-6. autoescape 'html' |escape('js')|escape('html')
-
-<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
-
---TEST--
-"autoescape" tag do not applies escaping on filter arguments
---TEMPLATE--
-{% autoescape 'html' %}
-{{ var|nl2br("<br />") }}
-{{ var|nl2br("<br />"|escape) }}
-{{ var|nl2br(sep) }}
-{{ var|nl2br(sep|raw) }}
-{{ var|nl2br(sep|escape) }}
-{% endautoescape %}
---DATA--
-return array('var' => "<Fabien>\nTwig", 'sep' => '<br />')
---EXPECT--
-&lt;Fabien&gt;<br />
-Twig
-&lt;Fabien&gt;&lt;br /&gt;
-Twig
-&lt;Fabien&gt;<br />
-Twig
-&lt;Fabien&gt;<br />
-Twig
-&lt;Fabien&gt;&lt;br /&gt;
-Twig
---TEST--
-"autoescape" tag applies escaping after calling filters
---TEMPLATE--
-{% autoescape 'html' %}
-
-(escape_and_nl2br is an escaper filter)
-
-1. Don't escape escaper filter output
-( var is escaped by |escape_and_nl2br, line-breaks are added,
- the output is not escaped )
-{{ var|escape_and_nl2br }}
-
-2. Don't escape escaper filter output
-( var is escaped by |escape_and_nl2br, line-breaks are added,
- the output is not escaped, |raw is redundant )
-{{ var|escape_and_nl2br|raw }}
-
-3. Explicit escape
-( var is escaped by |escape_and_nl2br, line-breaks are added,
- the output is explicitly escaped by |escape )
-{{ var|escape_and_nl2br|escape }}
-
-4. Escape non-escaper filter output
-( var is upper-cased by |upper,
- the output is auto-escaped )
-{{ var|upper }}
-
-5. Escape if last filter is not an escaper
-( var is escaped by |escape_and_nl2br, line-breaks are added,
- the output is upper-cased by |upper,
- the output is auto-escaped as |upper is not an escaper )
-{{ var|escape_and_nl2br|upper }}
-
-6. Don't escape escaper filter output
-( var is upper cased by upper,
- the output is escaped by |escape_and_nl2br, line-breaks are added,
- the output is not escaped as |escape_and_nl2br is an escaper )
-{{ var|upper|escape_and_nl2br }}
-
-7. Escape if last filter is not an escaper
-( the output of |format is "<b>" ~ var ~ "</b>",
- the output is auto-escaped )
-{{ "<b>%s</b>"|format(var) }}
-
-8. Escape if last filter is not an escaper
-( the output of |format is "<b>" ~ var ~ "</b>",
- |raw is redundant,
- the output is auto-escaped )
-{{ "<b>%s</b>"|raw|format(var) }}
-
-9. Don't escape escaper filter output
-( the output of |format is "<b>" ~ var ~ "</b>",
- the output is not escaped due to |raw filter at the end )
-{{ "<b>%s</b>"|format(var)|raw }}
-
-10. Don't escape escaper filter output
-( the output of |format is "<b>" ~ var ~ "</b>",
- the output is not escaped due to |raw filter at the end,
- the |raw filter on var is redundant )
-{{ "<b>%s</b>"|format(var|raw)|raw }}
-
-{% endautoescape %}
---DATA--
-return array('var' => "<Fabien>\nTwig")
---EXPECT--
-
-(escape_and_nl2br is an escaper filter)
-
-1. Don't escape escaper filter output
-( var is escaped by |escape_and_nl2br, line-breaks are added,
- the output is not escaped )
-&lt;Fabien&gt;<br />
-Twig
-
-2. Don't escape escaper filter output
-( var is escaped by |escape_and_nl2br, line-breaks are added,
- the output is not escaped, |raw is redundant )
-&lt;Fabien&gt;<br />
-Twig
-
-3. Explicit escape
-( var is escaped by |escape_and_nl2br, line-breaks are added,
- the output is explicitly escaped by |escape )
-&amp;lt;Fabien&amp;gt;&lt;br /&gt;
-Twig
-
-4. Escape non-escaper filter output
-( var is upper-cased by |upper,
- the output is auto-escaped )
-&lt;FABIEN&gt;
-TWIG
-
-5. Escape if last filter is not an escaper
-( var is escaped by |escape_and_nl2br, line-breaks are added,
- the output is upper-cased by |upper,
- the output is auto-escaped as |upper is not an escaper )
-&amp;LT;FABIEN&amp;GT;&lt;BR /&gt;
-TWIG
-
-6. Don't escape escaper filter output
-( var is upper cased by upper,
- the output is escaped by |escape_and_nl2br, line-breaks are added,
- the output is not escaped as |escape_and_nl2br is an escaper )
-&lt;FABIEN&gt;<br />
-TWIG
-
-7. Escape if last filter is not an escaper
-( the output of |format is "<b>" ~ var ~ "</b>",
- the output is auto-escaped )
-&lt;b&gt;&lt;Fabien&gt;
-Twig&lt;/b&gt;
-
-8. Escape if last filter is not an escaper
-( the output of |format is "<b>" ~ var ~ "</b>",
- |raw is redundant,
- the output is auto-escaped )
-&lt;b&gt;&lt;Fabien&gt;
-Twig&lt;/b&gt;
-
-9. Don't escape escaper filter output
-( the output of |format is "<b>" ~ var ~ "</b>",
- the output is not escaped due to |raw filter at the end )
-<b><Fabien>
-Twig</b>
-
-10. Don't escape escaper filter output
-( the output of |format is "<b>" ~ var ~ "</b>",
- the output is not escaped due to |raw filter at the end,
- the |raw filter on var is redundant )
-<b><Fabien>
-Twig</b>
---TEST--
-"autoescape" tag applies escaping after calling filters, and before calling pre_escape filters
---TEMPLATE--
-{% autoescape 'html' %}
-
-(nl2br is pre_escaped for "html" and declared safe for "html")
-
-1. Pre-escape and don't post-escape
-( var|escape|nl2br )
-{{ var|nl2br }}
-
-2. Don't double-pre-escape
-( var|escape|nl2br )
-{{ var|escape|nl2br }}
-
-3. Don't escape safe values
-( var|raw|nl2br )
-{{ var|raw|nl2br }}
-
-4. Don't escape safe values
-( var|escape|nl2br|nl2br )
-{{ var|nl2br|nl2br }}
-
-5. Re-escape values that are escaped for an other contexts
-( var|escape_something|escape|nl2br )
-{{ var|escape_something|nl2br }}
-
-6. Still escape when using filters not declared safe
-( var|escape|nl2br|upper|escape )
-{{ var|nl2br|upper }}
-
-{% endautoescape %}
---DATA--
-return array('var' => "<Fabien>\nTwig")
---EXPECT--
-
-(nl2br is pre_escaped for "html" and declared safe for "html")
-
-1. Pre-escape and don't post-escape
-( var|escape|nl2br )
-&lt;Fabien&gt;<br />
-Twig
-
-2. Don't double-pre-escape
-( var|escape|nl2br )
-&lt;Fabien&gt;<br />
-Twig
-
-3. Don't escape safe values
-( var|raw|nl2br )
-<Fabien><br />
-Twig
-
-4. Don't escape safe values
-( var|escape|nl2br|nl2br )
-&lt;Fabien&gt;<br /><br />
-Twig
-
-5. Re-escape values that are escaped for an other contexts
-( var|escape_something|escape|nl2br )
-&lt;FABIEN&gt;<br />
-TWIG
-
-6. Still escape when using filters not declared safe
-( var|escape|nl2br|upper|escape )
-&amp;LT;FABIEN&amp;GT;&lt;BR /&gt;
-TWIG
-
---TEST--
-"autoescape" tag handles filters preserving the safety
---TEMPLATE--
-{% autoescape 'html' %}
-
-(preserves_safety is preserving safety for "html")
-
-1. Unsafe values are still unsafe
-( var|preserves_safety|escape )
-{{ var|preserves_safety }}
-
-2. Safe values are still safe
-( var|escape|preserves_safety )
-{{ var|escape|preserves_safety }}
-
-3. Re-escape values that are escaped for an other contexts
-( var|escape_something|preserves_safety|escape )
-{{ var|escape_something|preserves_safety }}
-
-4. Still escape when using filters not declared safe
-( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape )
-{{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }}
-
-{% endautoescape %}
---DATA--
-return array('var' => "<Fabien>\nTwig")
---EXPECT--
-
-(preserves_safety is preserving safety for "html")
-
-1. Unsafe values are still unsafe
-( var|preserves_safety|escape )
-&lt;FABIEN&gt;
-TWIG
-
-2. Safe values are still safe
-( var|escape|preserves_safety )
-&LT;FABIEN&GT;
-TWIG
-
-3. Re-escape values that are escaped for an other contexts
-( var|escape_something|preserves_safety|escape )
-&lt;FABIEN&gt;
-TWIG
-
-4. Still escape when using filters not declared safe
-( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape )
-&amp;LT;FABPOT&amp;GT;
-TWIG
-
---TEST--
-"block" tag
---TEMPLATE--
-{% block title1 %}FOO{% endblock %}
-{% block title2 foo|lower %}
---TEMPLATE(foo.twig)--
-{% block content %}{% endblock %}
---DATA--
-return array('foo' => 'bar')
---EXPECT--
-FOObar
---TEST--
-"block" tag
---TEMPLATE--
-{% block content %}
- {% block content %}
- {% endblock %}
-{% endblock %}
---DATA--
-return array()
---EXCEPTION--
-Twig_Error_Syntax: The block 'content' has already been defined line 2 in "index.twig" at line 3
---TEST--
-"§" special chars in a block name
---TEMPLATE--
-{% block § %}
-{% endblock § %}
---DATA--
-return array()
---EXPECT--
---TEST--
-"embed" tag
---TEMPLATE--
-FOO
-{% embed "foo.twig" %}
- {% block c1 %}
- {{ parent() }}
- block1extended
- {% endblock %}
-{% endembed %}
-
-BAR
---TEMPLATE(foo.twig)--
-A
-{% block c1 %}
- block1
-{% endblock %}
-B
-{% block c2 %}
- block2
-{% endblock %}
-C
---DATA--
-return array()
---EXPECT--
-FOO
-
-A
- block1
-
- block1extended
- B
- block2
-C
-BAR
---TEST--
-"embed" tag
---TEMPLATE(index.twig)--
-FOO
-{% embed "foo.twig" %}
- {% block c1 %}
- {{ nothing }}
- {% endblock %}
-{% endembed %}
-BAR
---TEMPLATE(foo.twig)--
-{% block c1 %}{% endblock %}
---DATA--
-return array()
---EXCEPTION--
-Twig_Error_Runtime: Variable "nothing" does not exist in "index.twig" at line 5
---TEST--
-"embed" tag
---TEMPLATE--
-FOO
-{% embed "foo.twig" %}
- {% block c1 %}
- {{ parent() }}
- block1extended
- {% endblock %}
-{% endembed %}
-
-{% embed "foo.twig" %}
- {% block c1 %}
- {{ parent() }}
- block1extended
- {% endblock %}
-{% endembed %}
-
-BAR
---TEMPLATE(foo.twig)--
-A
-{% block c1 %}
- block1
-{% endblock %}
-B
-{% block c2 %}
- block2
-{% endblock %}
-C
---DATA--
-return array()
---EXPECT--
-FOO
-
-A
- block1
-
- block1extended
- B
- block2
-C
-
-A
- block1
-
- block1extended
- B
- block2
-C
-BAR
---TEST--
-"embed" tag
---TEMPLATE--
-{% embed "foo.twig" %}
- {% block c1 %}
- {{ parent() }}
- {% embed "foo.twig" %}
- {% block c1 %}
- {{ parent() }}
- block1extended
- {% endblock %}
- {% endembed %}
-
- {% endblock %}
-{% endembed %}
---TEMPLATE(foo.twig)--
-A
-{% block c1 %}
- block1
-{% endblock %}
-B
-{% block c2 %}
- block2
-{% endblock %}
-C
---DATA--
-return array()
---EXPECT--
-A
- block1
-
-
-A
- block1
-
- block1extended
- B
- block2
-C
- B
- block2
-C
---TEST--
-"embed" tag
---TEMPLATE--
-{% extends "base.twig" %}
-
-{% block c1 %}
- {{ parent() }}
- blockc1baseextended
-{% endblock %}
-
-{% block c2 %}
- {{ parent() }}
-
- {% embed "foo.twig" %}
- {% block c1 %}
- {{ parent() }}
- block1extended
- {% endblock %}
- {% endembed %}
-{% endblock %}
---TEMPLATE(base.twig)--
-A
-{% block c1 %}
- blockc1base
-{% endblock %}
-{% block c2 %}
- blockc2base
-{% endblock %}
-B
---TEMPLATE(foo.twig)--
-A
-{% block c1 %}
- block1
-{% endblock %}
-B
-{% block c2 %}
- block2
-{% endblock %}
-C
---DATA--
-return array()
---EXPECT--
-A
- blockc1base
-
- blockc1baseextended
- blockc2base
-
-
-
-A
- block1
-
- block1extended
- B
- block2
-CB--TEST--
-"filter" tag applies a filter on its children
---TEMPLATE--
-{% filter upper %}
-Some text with a {{ var }}
-{% endfilter %}
---DATA--
-return array('var' => 'var')
---EXPECT--
-SOME TEXT WITH A VAR
---TEST--
-"filter" tag applies a filter on its children
---TEMPLATE--
-{% filter json_encode|raw %}test{% endfilter %}
---DATA--
-return array()
---EXPECT--
-"test"
---TEST--
-"filter" tags accept multiple chained filters
---TEMPLATE--
-{% filter lower|title %}
- {{ var }}
-{% endfilter %}
---DATA--
-return array('var' => 'VAR')
---EXPECT--
- Var
---TEST--
-"filter" tags can be nested at will
---TEMPLATE--
-{% filter lower|title %}
- {{ var }}
- {% filter upper %}
- {{ var }}
- {% endfilter %}
- {{ var }}
-{% endfilter %}
---DATA--
-return array('var' => 'var')
---EXPECT--
- Var
- Var
- Var
---TEST--
-"filter" tag applies the filter on "for" tags
---TEMPLATE--
-{% filter upper %}
-{% for item in items %}
-{{ item }}
-{% endfor %}
-{% endfilter %}
---DATA--
-return array('items' => array('a', 'b'))
---EXPECT--
-A
-B
---TEST--
-"filter" tag applies the filter on "if" tags
---TEMPLATE--
-{% filter upper %}
-{% if items %}
-{{ items|join(', ') }}
-{% endif %}
-
-{% if items.3 is defined %}
-FOO
-{% else %}
-{{ items.1 }}
-{% endif %}
-
-{% if items.3 is defined %}
-FOO
-{% elseif items.1 %}
-{{ items.0 }}
-{% endif %}
-
-{% endfilter %}
---DATA--
-return array('items' => array('a', 'b'))
---EXPECT--
-A, B
-
-B
-
-A
---TEST--
-"for" tag takes a condition
---TEMPLATE--
-{% for i in 1..5 if i is odd -%}
- {{ loop.index }}.{{ i }}{{ foo.bar }}
-{% endfor %}
---DATA--
-return array('foo' => array('bar' => 'X'))
---CONFIG--
-return array('strict_variables' => false)
---EXPECT--
-1.1X
-2.3X
-3.5X
---TEST--
-"for" tag keeps the context safe
---TEMPLATE--
-{% for item in items %}
- {% for item in items %}
- * {{ item }}
- {% endfor %}
- * {{ item }}
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b'))
---EXPECT--
- * a
- * b
- * a
- * a
- * b
- * b
---TEST--
-"for" tag can use an "else" clause
---TEMPLATE--
-{% for item in items %}
- * {{ item }}
-{% else %}
- no item
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b'))
---EXPECT--
- * a
- * b
---DATA--
-return array('items' => array())
---EXPECT--
- no item
---DATA--
-return array()
---CONFIG--
-return array('strict_variables' => false)
---EXPECT--
- no item
---TEST--
-"for" tag does not reset inner variables
---TEMPLATE--
-{% for i in 1..2 %}
- {% for j in 0..2 %}
- {{k}}{% set k = k+1 %} {{ loop.parent.loop.index }}
- {% endfor %}
-{% endfor %}
---DATA--
-return array('k' => 0)
---EXPECT--
- 0 1
- 1 1
- 2 1
- 3 2
- 4 2
- 5 2
---TEST--
-"for" tag can iterate over keys and values
---TEMPLATE--
-{% for key, item in items %}
- * {{ key }}/{{ item }}
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b'))
---EXPECT--
- * 0/a
- * 1/b
---TEST--
-"for" tag can iterate over keys
---TEMPLATE--
-{% for key in items|keys %}
- * {{ key }}
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b'))
---EXPECT--
- * 0
- * 1
---TEST--
-"for" tag adds a loop variable to the context locally
---TEMPLATE--
-{% for item in items %}
-{% endfor %}
-{% if loop is not defined %}WORKS{% endif %}
---DATA--
-return array('items' => array())
---EXPECT--
-WORKS
---TEST--
-"for" tag adds a loop variable to the context
---TEMPLATE--
-{% for item in items %}
- * {{ loop.index }}/{{ loop.index0 }}
- * {{ loop.revindex }}/{{ loop.revindex0 }}
- * {{ loop.first }}/{{ loop.last }}/{{ loop.length }}
-
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b'))
---EXPECT--
- * 1/0
- * 2/1
- * 1//2
-
- * 2/1
- * 1/0
- * /1/2
---TEST--
-"for" tag
---TEMPLATE--
-{% for i, item in items if loop.last > 0 %}
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b'))
---EXCEPTION--
-Twig_Error_Syntax: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2
---TEST--
-"for" tag
---TEMPLATE--
-{% for i, item in items if i > 0 %}
- {{ loop.last }}
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b'))
---EXCEPTION--
-Twig_Error_Syntax: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3
---TEST--
-"for" tag can use an "else" clause
---TEMPLATE--
-{% for item in items %}
- {% for item in items1 %}
- * {{ item }}
- {% else %}
- no {{ item }}
- {% endfor %}
-{% else %}
- no item1
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b'), 'items1' => array())
---EXPECT--
-no a
- no b
---TEST--
-"for" tag iterates over iterable and countable objects
---TEMPLATE--
-{% for item in items %}
- * {{ item }}
- * {{ loop.index }}/{{ loop.index0 }}
- * {{ loop.revindex }}/{{ loop.revindex0 }}
- * {{ loop.first }}/{{ loop.last }}/{{ loop.length }}
-
-{% endfor %}
-
-{% for key, value in items %}
- * {{ key }}/{{ value }}
-{% endfor %}
-
-{% for key in items|keys %}
- * {{ key }}
-{% endfor %}
---DATA--
-class ItemsIteratorCountable implements Iterator, Countable
-{
- protected $values = array('foo' => 'bar', 'bar' => 'foo');
- public function current() { return current($this->values); }
- public function key() { return key($this->values); }
- public function next() { return next($this->values); }
- public function rewind() { return reset($this->values); }
- public function valid() { return false !== current($this->values); }
- public function count() { return count($this->values); }
-}
-return array('items' => new ItemsIteratorCountable())
---EXPECT--
- * bar
- * 1/0
- * 2/1
- * 1//2
-
- * foo
- * 2/1
- * 1/0
- * /1/2
-
-
- * foo/bar
- * bar/foo
-
- * foo
- * bar
---TEST--
-"for" tag iterates over iterable objects
---TEMPLATE--
-{% for item in items %}
- * {{ item }}
- * {{ loop.index }}/{{ loop.index0 }}
- * {{ loop.first }}
-
-{% endfor %}
-
-{% for key, value in items %}
- * {{ key }}/{{ value }}
-{% endfor %}
-
-{% for key in items|keys %}
- * {{ key }}
-{% endfor %}
---DATA--
-class ItemsIterator implements Iterator
-{
- protected $values = array('foo' => 'bar', 'bar' => 'foo');
- public function current() { return current($this->values); }
- public function key() { return key($this->values); }
- public function next() { return next($this->values); }
- public function rewind() { return reset($this->values); }
- public function valid() { return false !== current($this->values); }
-}
-return array('items' => new ItemsIterator())
---EXPECT--
- * bar
- * 1/0
- * 1
-
- * foo
- * 2/1
- *
-
-
- * foo/bar
- * bar/foo
-
- * foo
- * bar
---TEST--
-"for" tags can be nested
---TEMPLATE--
-{% for key, item in items %}
-* {{ key }} ({{ loop.length }}):
-{% for value in item %}
- * {{ value }} ({{ loop.length }})
-{% endfor %}
-{% endfor %}
---DATA--
-return array('items' => array('a' => array('a1', 'a2', 'a3'), 'b' => array('b1')))
---EXPECT--
-* a (2):
- * a1 (3)
- * a2 (3)
- * a3 (3)
-* b (2):
- * b1 (1)
---TEST--
-"for" tag iterates over item values
---TEMPLATE--
-{% for item in items %}
- * {{ item }}
-{% endfor %}
---DATA--
-return array('items' => array('a', 'b'))
---EXPECT--
- * a
- * b
---TEST--
-global variables
---TEMPLATE--
-{% include "included.twig" %}
-{% from "included.twig" import foobar %}
-{{ foobar() }}
---TEMPLATE(included.twig)--
-{% macro foobar() %}
-called foobar
-{% endmacro %}
---DATA--
-return array();
---EXPECT--
-called foobar
---TEST--
-"if" creates a condition
---TEMPLATE--
-{% if a is defined %}
- {{ a }}
-{% elseif b is defined %}
- {{ b }}
-{% else %}
- NOTHING
-{% endif %}
---DATA--
-return array('a' => 'a')
---EXPECT--
- a
---DATA--
-return array('b' => 'b')
---EXPECT--
- b
---DATA--
-return array()
---EXPECT--
- NOTHING
---TEST--
-"if" takes an expression as a test
---TEMPLATE--
-{% if a < 2 %}
- A1
-{% elseif a > 10 %}
- A2
-{% else %}
- A3
-{% endif %}
---DATA--
-return array('a' => 1)
---EXPECT--
- A1
---DATA--
-return array('a' => 12)
---EXPECT--
- A2
---DATA--
-return array('a' => 7)
---EXPECT--
- A3
---TEST--
-"include" tag
---TEMPLATE--
-FOO
-{% include "foo.twig" %}
-
-BAR
---TEMPLATE(foo.twig)--
-FOOBAR
---DATA--
-return array()
---EXPECT--
-FOO
-
-FOOBAR
-BAR
---TEST--
-"include" tag allows expressions for the template to include
---TEMPLATE--
-FOO
-{% include foo %}
-
-BAR
---TEMPLATE(foo.twig)--
-FOOBAR
---DATA--
-return array('foo' => 'foo.twig')
---EXPECT--
-FOO
-
-FOOBAR
-BAR
---TEST--
-"include" tag
---TEMPLATE--
-{% include ["foo.twig", "bar.twig"] ignore missing %}
-{% include "foo.twig" ignore missing %}
-{% include "foo.twig" ignore missing with {} %}
-{% include "foo.twig" ignore missing with {} only %}
---DATA--
-return array()
---EXPECT--
---TEST--
-"include" tag
---TEMPLATE--
-{% extends "base.twig" %}
-
-{% block content %}
- {{ parent() }}
-{% endblock %}
---TEMPLATE(base.twig)--
-{% block content %}
- {% include "foo.twig" %}
-{% endblock %}
---DATA--
-return array();
---EXCEPTION--
-Twig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3.
---TEST--
-"include" tag
---TEMPLATE--
-{% include "foo.twig" %}
---DATA--
-return array();
---EXCEPTION--
-Twig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2.
---TEST--
-"include" tag accept variables and only
---TEMPLATE--
-{% include "foo.twig" %}
-{% include "foo.twig" only %}
-{% include "foo.twig" with {'foo1': 'bar'} %}
-{% include "foo.twig" with {'foo1': 'bar'} only %}
---TEMPLATE(foo.twig)--
-{% for k, v in _context %}{{ k }},{% endfor %}
---DATA--
-return array('foo' => 'bar')
---EXPECT--
-foo,global,_parent,
-global,_parent,
-foo,global,foo1,_parent,
-foo1,global,_parent,
---TEST--
-"include" tag accepts Twig_Template instance
---TEMPLATE--
-{% include foo %} FOO
---TEMPLATE(foo.twig)--
-BAR
---DATA--
-return array('foo' => $twig->loadTemplate('foo.twig'))
---EXPECT--
-BAR FOO
---TEST--
-"include" tag
---TEMPLATE--
-{% include ["foo.twig", "bar.twig"] %}
-{% include ["bar.twig", "foo.twig"] %}
---TEMPLATE(foo.twig)--
-foo
---DATA--
-return array()
---EXPECT--
-foo
-foo
---TEST--
-"include" tag accept variables
---TEMPLATE--
-{% include "foo.twig" with {'foo': 'bar'} %}
-{% include "foo.twig" with vars %}
---TEMPLATE(foo.twig)--
-{{ foo }}
---DATA--
-return array('vars' => array('foo' => 'bar'))
---EXPECT--
-bar
-bar
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends "foo.twig" %}
-
-{% block content %}
-FOO
-{% endblock %}
---TEMPLATE(foo.twig)--
-{% block content %}{% endblock %}
---DATA--
-return array()
---EXPECT--
-FOO
---TEST--
-block_expr2
---TEMPLATE--
-{% extends "base2.twig" %}
-
-{% block element -%}
- Element:
- {{- parent() -}}
-{% endblock %}
---TEMPLATE(base2.twig)--
-{% extends "base.twig" %}
---TEMPLATE(base.twig)--
-{% spaceless %}
-{% block element -%}
- <div>
- {%- if item.children is defined %}
- {%- for item in item.children %}
- {{- block('element') -}}
- {% endfor %}
- {%- endif -%}
- </div>
-{%- endblock %}
-{% endspaceless %}
---DATA--
-return array(
- 'item' => array(
- 'children' => array(
- null,
- null,
- )
- )
-)
---EXPECT--
-Element:<div>Element:<div></div>Element:<div></div></div>
---TEST--
-block_expr
---TEMPLATE--
-{% extends "base.twig" %}
-
-{% block element -%}
- Element:
- {{- parent() -}}
-{% endblock %}
---TEMPLATE(base.twig)--
-{% spaceless %}
-{% block element -%}
- <div>
- {%- if item.children is defined %}
- {%- for item in item.children %}
- {{- block('element') -}}
- {% endfor %}
- {%- endif -%}
- </div>
-{%- endblock %}
-{% endspaceless %}
---DATA--
-return array(
- 'item' => array(
- 'children' => array(
- null,
- null,
- )
- )
-)
---EXPECT--
-Element:<div>Element:<div></div>Element:<div></div></div>
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends standalone ? foo : 'bar.twig' %}
-
-{% block content %}{{ parent() }}FOO{% endblock %}
---TEMPLATE(foo.twig)--
-{% block content %}FOO{% endblock %}
---TEMPLATE(bar.twig)--
-{% block content %}BAR{% endblock %}
---DATA--
-return array('foo' => 'foo.twig', 'standalone' => true)
---EXPECT--
-FOOFOO
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends foo %}
-
-{% block content %}
-FOO
-{% endblock %}
---TEMPLATE(foo.twig)--
-{% block content %}{% endblock %}
---DATA--
-return array('foo' => 'foo.twig')
---EXPECT--
-FOO
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends "foo.twig" %}
---TEMPLATE(foo.twig)--
-{% block content %}FOO{% endblock %}
---DATA--
-return array()
---EXPECT--
-FOO
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends ["foo.twig", "bar.twig"] %}
---TEMPLATE(bar.twig)--
-{% block content %}
-foo
-{% endblock %}
---DATA--
-return array()
---EXPECT--
-foo
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends "layout.twig" %}{% block content %}{{ parent() }}index {% endblock %}
---TEMPLATE(layout.twig)--
-{% extends "base.twig" %}{% block content %}{{ parent() }}layout {% endblock %}
---TEMPLATE(base.twig)--
-{% block content %}base {% endblock %}
---DATA--
-return array()
---EXPECT--
-base layout index
---TEST--
-"block" tag
---TEMPLATE--
-{% block content %}
- CONTENT
- {%- block subcontent -%}
- SUBCONTENT
- {%- endblock -%}
- ENDCONTENT
-{% endblock %}
---TEMPLATE(foo.twig)--
---DATA--
-return array()
---EXPECT--
-CONTENTSUBCONTENTENDCONTENT
---TEST--
-"block" tag
---TEMPLATE--
-{% extends "foo.twig" %}
-
-{% block content %}
- {% block subcontent %}
- {% block subsubcontent %}
- SUBSUBCONTENT
- {% endblock %}
- {% endblock %}
-{% endblock %}
---TEMPLATE(foo.twig)--
-{% block content %}
- {% block subcontent %}
- SUBCONTENT
- {% endblock %}
-{% endblock %}
---DATA--
-return array()
---EXPECT--
-SUBSUBCONTENT
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends "layout.twig" %}
-{% block inside %}INSIDE{% endblock inside %}
---TEMPLATE(layout.twig)--
-{% extends "base.twig" %}
-{% block body %}
- {% block inside '' %}
-{% endblock body %}
---TEMPLATE(base.twig)--
-{% block body '' %}
---DATA--
-return array()
---EXPECT--
-INSIDE
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends foo ? 'foo.twig' : 'bar.twig' %}
---TEMPLATE(foo.twig)--
-FOO
---TEMPLATE(bar.twig)--
-BAR
---DATA--
-return array('foo' => true)
---EXPECT--
-FOO
---DATA--
-return array('foo' => false)
---EXPECT--
-BAR
---TEST--
-"extends" tag
---TEMPLATE--
-{% block content %}
- {% extends "foo.twig" %}
-{% endblock %}
---EXCEPTION--
-Twig_Error_Syntax: Cannot extend from a block in "index.twig" at line 3
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends "base.twig" %}
-{% block content %}{% include "included.twig" %}{% endblock %}
-
-{% block footer %}Footer{% endblock %}
---TEMPLATE(included.twig)--
-{% extends "base.twig" %}
-{% block content %}Included Content{% endblock %}
---TEMPLATE(base.twig)--
-{% block content %}Default Content{% endblock %}
-
-{% block footer %}Default Footer{% endblock %}
---DATA--
-return array()
---EXPECT--
-Included Content
-Default Footer
-Footer
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends "foo.twig" %}
-
-{% block content %}
- {% block inside %}
- INSIDE OVERRIDDEN
- {% endblock %}
-
- BEFORE
- {{ parent() }}
- AFTER
-{% endblock %}
---TEMPLATE(foo.twig)--
-{% block content %}
- BAR
-{% endblock %}
---DATA--
-return array()
---EXPECT--
-
-INSIDE OVERRIDDEN
-
- BEFORE
- BAR
-
- AFTER
---TEST--
-"extends" tag
---TEMPLATE--
-{% extends "foo.twig" %}
-
-{% block content %}{{ parent() }}FOO{{ parent() }}{% endblock %}
---TEMPLATE(foo.twig)--
-{% block content %}BAR{% endblock %}
---DATA--
-return array()
---EXPECT--
-BARFOOBAR
---TEST--
-"parent" tag
---TEMPLATE--
-{% use 'foo.twig' %}
-
-{% block content %}
- {{ parent() }}
-{% endblock %}
---TEMPLATE(foo.twig)--
-{% block content %}BAR{% endblock %}
---DATA--
-return array()
---EXPECT--
-BAR
---TEST--
-"parent" tag
---TEMPLATE--
-{% block content %}
- {{ parent() }}
-{% endblock %}
---EXCEPTION--
-Twig_Error_Syntax: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3
---TEST--
-"extends" tag accepts Twig_Template instance
---TEMPLATE--
-{% extends foo %}
-
-{% block content %}
-{{ parent() }}FOO
-{% endblock %}
---TEMPLATE(foo.twig)--
-{% block content %}BAR{% endblock %}
---DATA--
-return array('foo' => $twig->loadTemplate('foo.twig'))
---EXPECT--
-BARFOO
---TEST--
-"parent" function
---TEMPLATE--
-{% extends "parent.twig" %}
-
-{% use "use1.twig" %}
-{% use "use2.twig" %}
-
-{% block content_parent %}
- {{ parent() }}
-{% endblock %}
-
-{% block content_use1 %}
- {{ parent() }}
-{% endblock %}
-
-{% block content_use2 %}
- {{ parent() }}
-{% endblock %}
-
-{% block content %}
- {{ block('content_use1_only') }}
- {{ block('content_use2_only') }}
-{% endblock %}
---TEMPLATE(parent.twig)--
-{% block content_parent 'content_parent' %}
-{% block content_use1 'content_parent' %}
-{% block content_use2 'content_parent' %}
-{% block content '' %}
---TEMPLATE(use1.twig)--
-{% block content_use1 'content_use1' %}
-{% block content_use2 'content_use1' %}
-{% block content_use1_only 'content_use1_only' %}
---TEMPLATE(use2.twig)--
-{% block content_use2 'content_use2' %}
-{% block content_use2_only 'content_use2_only' %}
---DATA--
-return array()
---EXPECT--
- content_parent
- content_use1
- content_use2
- content_use1_only
- content_use2_only
---TEST--
-"macro" tag
---TEMPLATE--
-{% import _self as macros %}
-
-{{ macros.input('username') }}
-{{ macros.input('password', null, 'password', 1) }}
-
-{% macro input(name, value, type, size) %}
- <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}">
-{% endmacro %}
---DATA--
-return array()
---EXPECT--
- <input type="text" name="username" value="" size="20">
-
- <input type="password" name="password" value="" size="1">
---TEST--
-"macro" tag supports name for endmacro
---TEMPLATE--
-{% import _self as macros %}
-
-{{ macros.foo() }}
-{{ macros.bar() }}
-
-{% macro foo() %}foo{% endmacro %}
-{% macro bar() %}bar{% endmacro bar %}
---DATA--
-return array()
---EXPECT--
-foo
-bar
-
---TEST--
-"macro" tag
---TEMPLATE--
-{% import 'forms.twig' as forms %}
-
-{{ forms.input('username') }}
-{{ forms.input('password', null, 'password', 1) }}
---TEMPLATE(forms.twig)--
-{% macro input(name, value, type, size) %}
- <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}">
-{% endmacro %}
---DATA--
-return array()
---EXPECT--
- <input type="text" name="username" value="" size="20">
-
- <input type="password" name="password" value="" size="1">
---TEST--
-"macro" tag
---TEMPLATE--
-{% from 'forms.twig' import foo %}
-{% from 'forms.twig' import foo as foobar, bar %}
-
-{{ foo('foo') }}
-{{ foobar('foo') }}
-{{ bar('foo') }}
---TEMPLATE(forms.twig)--
-{% macro foo(name) %}foo{{ name }}{% endmacro %}
-{% macro bar(name) %}bar{{ name }}{% endmacro %}
---DATA--
-return array()
---EXPECT--
-foofoo
-foofoo
-barfoo
---TEST--
-"macro" tag
---TEMPLATE--
-{% from 'forms.twig' import foo %}
-
-{{ foo('foo') }}
-{{ foo() }}
---TEMPLATE(forms.twig)--
-{% macro foo(name) %}{{ name|default('foo') }}{{ global }}{% endmacro %}
---DATA--
-return array()
---EXPECT--
-fooglobal
-fooglobal
---TEST--
-"macro" tag
---TEMPLATE--
-{% import _self as forms %}
-
-{{ forms.input('username') }}
-{{ forms.input('password', null, 'password', 1) }}
-
-{% macro input(name, value, type, size) %}
- <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}">
-{% endmacro %}
---DATA--
-return array()
---EXPECT--
- <input type="text" name="username" value="" size="20">
-
- <input type="password" name="password" value="" size="1">
---TEST--
-"raw" tag
---TEMPLATE--
-{% raw %}
-{{ foo }}
-{% endraw %}
---DATA--
-return array()
---EXPECT--
-{{ foo }}
---TEST--
-"raw" tag
---TEMPLATE--
-{% raw %}
-{{ foo }}
-{% endverbatim %}
---DATA--
-return array()
---EXCEPTION--
-Twig_Error_Syntax: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2
---TEST--
-"raw" tag
---TEMPLATE--
-1***
-
-{%- raw %}
- {{ 'bla' }}
-{% endraw %}
-
-1***
-2***
-
-{%- raw -%}
- {{ 'bla' }}
-{% endraw %}
-
-2***
-3***
-
-{%- raw -%}
- {{ 'bla' }}
-{% endraw -%}
-
-3***
-4***
-
-{%- raw -%}
- {{ 'bla' }}
-{%- endraw %}
-
-4***
-5***
-
-{%- raw -%}
- {{ 'bla' }}
-{%- endraw -%}
-
-5***
---DATA--
-return array()
---EXPECT--
-1***
- {{ 'bla' }}
-
-
-1***
-2***{{ 'bla' }}
-
-
-2***
-3***{{ 'bla' }}
-3***
-4***{{ 'bla' }}
-
-4***
-5***{{ 'bla' }}5***
---TEST--
-sandbox tag
---TEMPLATE--
-{%- sandbox %}
- {%- include "foo.twig" %}
- a
-{%- endsandbox %}
---TEMPLATE(foo.twig)--
-foo
---EXCEPTION--
-Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4
---TEST--
-sandbox tag
---TEMPLATE--
-{%- sandbox %}
- {%- include "foo.twig" %}
-
- {% if 1 %}
- {%- include "foo.twig" %}
- {% endif %}
-{%- endsandbox %}
---TEMPLATE(foo.twig)--
-foo
---EXCEPTION--
-Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5
---TEST--
-sandbox tag
---TEMPLATE--
-{%- sandbox %}
- {%- include "foo.twig" %}
-{%- endsandbox %}
-
-{%- sandbox %}
- {%- include "foo.twig" %}
- {%- include "foo.twig" %}
-{%- endsandbox %}
-
-{%- sandbox %}{% include "foo.twig" %}{% endsandbox %}
---TEMPLATE(foo.twig)--
-foo
---DATA--
-return array()
---EXPECT--
-foo
-foo
-foo
-foo
---TEST--
-"set" tag
---TEMPLATE--
-{% set foo = 'foo' %}
-{% set bar = 'foo<br />' %}
-
-{{ foo }}
-{{ bar }}
-
-{% set foo, bar = 'foo', 'bar' %}
-
-{{ foo }}{{ bar }}
---DATA--
-return array()
---EXPECT--
-foo
-foo&lt;br /&gt;
-
-
-foobar
---TEST--
-"set" tag block empty capture
---TEMPLATE--
-{% set foo %}{% endset %}
-
-{% if foo %}FAIL{% endif %}
---DATA--
-return array()
---EXPECT--
---TEST--
-"set" tag block capture
---TEMPLATE--
-{% set foo %}f<br />o<br />o{% endset %}
-
-{{ foo }}
---DATA--
-return array()
---EXPECT--
-f<br />o<br />o
---TEST--
-"set" tag
---TEMPLATE--
-{% set foo, bar = 'foo' ~ 'bar', 'bar' ~ 'foo' %}
-
-{{ foo }}
-{{ bar }}
---DATA--
-return array()
---EXPECT--
-foobar
-barfoo
---TEST--
-"spaceless" tag removes whites between HTML tags
---TEMPLATE--
-{% spaceless %}
-
- <div> <div> foo </div> </div>
-
-{% endspaceless %}
---DATA--
-return array()
---EXPECT--
-<div><div> foo </div></div>
---TEST--
-"§" custom tag
---TEMPLATE--
-{% § %}
---DATA--
-return array()
---EXPECT--
---TEST--
-Whitespace trimming on tags.
---TEMPLATE--
-{{ 5 * '{#-'|length }}
-{{ '{{-'|length * 5 + '{%-'|length }}
-
-Trim on control tag:
-{% for i in range(1, 9) -%}
- {{ i }}
-{%- endfor %}
-
-
-Trim on output tag:
-{% for i in range(1, 9) %}
- {{- i -}}
-{% endfor %}
-
-
-Trim comments:
-
-{#- Invisible -#}
-
-After the comment.
-
-Trim leading space:
-{% if leading %}
-
- {{- leading }}
-{% endif %}
-
-{%- if leading %}
- {{- leading }}
-
-{%- endif %}
-
-
-Trim trailing space:
-{% if trailing -%}
- {{ trailing -}}
-
-{% endif -%}
-
-Combined:
-
-{%- if both -%}
-<ul>
- <li> {{- both -}} </li>
-</ul>
-
-{%- endif -%}
-
-end
---DATA--
-return array('leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both')
---EXPECT--
-15
-18
-
-Trim on control tag:
-123456789
-
-Trim on output tag:
-123456789
-
-Trim comments:After the comment.
-
-Trim leading space:
-leading space
-leading space
-
-Trim trailing space:
-trailing spaceCombined:<ul>
- <li>both</li>
-</ul>end
---TEST--
-"use" tag
---TEMPLATE--
-{% use "blocks.twig" with content as foo %}
-
-{{ block('foo') }}
---TEMPLATE(blocks.twig)--
-{% block content 'foo' %}
---DATA--
-return array()
---EXPECT--
-foo
---TEST--
-"use" tag
---TEMPLATE--
-{% use "blocks.twig" %}
-
-{{ block('content') }}
---TEMPLATE(blocks.twig)--
-{% block content 'foo' %}
---DATA--
-return array()
---EXPECT--
-foo
---TEST--
-"use" tag
---TEMPLATE--
-{% use "foo.twig" %}
---TEMPLATE(foo.twig)--
-{% use "bar.twig" %}
---TEMPLATE(bar.twig)--
---DATA--
-return array()
---EXPECT--
---TEST--
-"use" tag
---TEMPLATE--
-{% use "foo.twig" %}
-
-{{ block('content') }}
-{{ block('foo') }}
-{{ block('bar') }}
---TEMPLATE(foo.twig)--
-{% use "bar.twig" %}
-
-{% block content 'foo' %}
-{% block foo 'foo' %}
---TEMPLATE(bar.twig)--
-{% block content 'bar' %}
-{% block bar 'bar' %}
---DATA--
-return array()
---EXPECT--
-foo
-foo
-bar
---TEST--
-"use" tag
---TEMPLATE--
-{% use "ancestor.twig" %}
-{% use "parent.twig" %}
-
-{{ block('container') }}
---TEMPLATE(parent.twig)--
-{% block sub_container %}
- <div class="overriden_sub_container">overriden sub_container</div>
-{% endblock %}
---TEMPLATE(ancestor.twig)--
-{% block container %}
- <div class="container">{{ block('sub_container') }}</div>
-{% endblock %}
-
-{% block sub_container %}
- <div class="sub_container">sub_container</div>
-{% endblock %}
---DATA--
-return array()
---EXPECT--
-<div class="container"> <div class="overriden_sub_container">overriden sub_container</div>
-</div>
---TEST--
-"use" tag
---TEMPLATE--
-{% use "parent.twig" %}
-
-{{ block('container') }}
---TEMPLATE(parent.twig)--
-{% use "ancestor.twig" %}
-
-{% block sub_container %}
- <div class="overriden_sub_container">overriden sub_container</div>
-{% endblock %}
---TEMPLATE(ancestor.twig)--
-{% block container %}
- <div class="container">{{ block('sub_container') }}</div>
-{% endblock %}
-
-{% block sub_container %}
- <div class="sub_container">sub_container</div>
-{% endblock %}
---DATA--
-return array()
---EXPECT--
-<div class="container"> <div class="overriden_sub_container">overriden sub_container</div>
-</div>
---TEST--
-"use" tag
---TEMPLATE--
-{% use "foo.twig" with content as foo_content %}
-{% use "bar.twig" %}
-
-{{ block('content') }}
-{{ block('foo') }}
-{{ block('bar') }}
-{{ block('foo_content') }}
---TEMPLATE(foo.twig)--
-{% block content 'foo' %}
-{% block foo 'foo' %}
---TEMPLATE(bar.twig)--
-{% block content 'bar' %}
-{% block bar 'bar' %}
---DATA--
-return array()
---EXPECT--
-bar
-foo
-bar
-foo
---TEST--
-"use" tag
---TEMPLATE--
-{% use "foo.twig" %}
-{% use "bar.twig" %}
-
-{{ block('content') }}
-{{ block('foo') }}
-{{ block('bar') }}
---TEMPLATE(foo.twig)--
-{% block content 'foo' %}
-{% block foo 'foo' %}
---TEMPLATE(bar.twig)--
-{% block content 'bar' %}
-{% block bar 'bar' %}
---DATA--
-return array()
---EXPECT--
-bar
-foo
-bar
---TEST--
-"use" tag
---TEMPLATE--
-{% use 'file2.html.twig'%}
-{% block foobar %}
- {{- parent() -}}
- Content of block (second override)
-{% endblock foobar %}
---TEMPLATE(file2.html.twig)--
-{% use 'file1.html.twig' %}
-{% block foobar %}
- {{- parent() -}}
- Content of block (first override)
-{% endblock foobar %}
---TEMPLATE(file1.html.twig)--
-{% block foobar -%}
- Content of block
-{% endblock foobar %}
---DATA--
-return array()
---EXPECT--
-Content of block
-Content of block (first override)
-Content of block (second override)
---TEST--
-"use" tag
---TEMPLATE--
-{% use 'file2.html.twig' %}
-{% use 'file1.html.twig' with foo %}
-{% block foo %}
- {{- parent() -}}
- Content of foo (second override)
-{% endblock foo %}
-{% block bar %}
- {{- parent() -}}
- Content of bar (second override)
-{% endblock bar %}
---TEMPLATE(file2.html.twig)--
-{% use 'file1.html.twig' %}
-{% block foo %}
- {{- parent() -}}
- Content of foo (first override)
-{% endblock foo %}
-{% block bar %}
- {{- parent() -}}
- Content of bar (first override)
-{% endblock bar %}
---TEMPLATE(file1.html.twig)--
-{% block foo -%}
- Content of foo
-{% endblock foo %}
-{% block bar -%}
- Content of bar
-{% endblock bar %}
---DATA--
-return array()
---EXPECT--
-Content of foo
-Content of foo (first override)
-Content of foo (second override)
-Content of bar
-Content of bar (second override)
---TEST--
-"use" tag
---TEMPLATE--
-{% use 'file2.html.twig' with foobar as base_base_foobar %}
-{% block foobar %}
- {{- block('base_base_foobar') -}}
- Content of block (second override)
-{% endblock foobar %}
---TEMPLATE(file2.html.twig)--
-{% use 'file1.html.twig' with foobar as base_foobar %}
-{% block foobar %}
- {{- block('base_foobar') -}}
- Content of block (first override)
-{% endblock foobar %}
---TEMPLATE(file1.html.twig)--
-{% block foobar -%}
- Content of block
-{% endblock foobar %}
---DATA--
-return array()
---EXPECT--
-Content of block
-Content of block (first override)
-Content of block (second override)
---TEST--
-"verbatim" tag
---TEMPLATE--
-{% verbatim %}
-{{ foo }}
-{% endverbatim %}
---DATA--
-return array()
---EXPECT--
-{{ foo }}
---TEST--
-"verbatim" tag
---TEMPLATE--
-{% verbatim %}
-{{ foo }}
-{% endraw %}
---DATA--
-return array()
---EXCEPTION--
-Twig_Error_Syntax: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2
---TEST--
-"verbatim" tag
---TEMPLATE--
-1***
-
-{%- verbatim %}
- {{ 'bla' }}
-{% endverbatim %}
-
-1***
-2***
-
-{%- verbatim -%}
- {{ 'bla' }}
-{% endverbatim %}
-
-2***
-3***
-
-{%- verbatim -%}
- {{ 'bla' }}
-{% endverbatim -%}
-
-3***
-4***
-
-{%- verbatim -%}
- {{ 'bla' }}
-{%- endverbatim %}
-
-4***
-5***
-
-{%- verbatim -%}
- {{ 'bla' }}
-{%- endverbatim -%}
-
-5***
---DATA--
-return array()
---EXPECT--
-1***
- {{ 'bla' }}
-
-
-1***
-2***{{ 'bla' }}
-
-
-2***
-3***{{ 'bla' }}
-3***
-4***{{ 'bla' }}
-
-4***
-5***{{ 'bla' }}5***
---TEST--
-array index test
---TEMPLATE--
-{% for key, value in days %}
-{{ key }}
-{% endfor %}
---DATA--
-return array('days' => array(
- 1 => array('money' => 9),
- 2 => array('money' => 21),
- 3 => array('money' => 38),
- 4 => array('money' => 6),
- 18 => array('money' => 6),
- 19 => array('money' => 3),
- 31 => array('money' => 11),
-));
---EXPECT--
-1
-2
-3
-4
-18
-19
-31
---TEST--
-"const" test
---TEMPLATE--
-{{ 8 is constant('E_NOTICE') ? 'ok' : 'no' }}
-{{ 'bar' is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }}
-{{ value is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }}
-{{ 2 is constant('ARRAY_AS_PROPS', object) ? 'ok' : 'no' }}
---DATA--
-return array('value' => 'bar', 'object' => new ArrayObject(array('hi')));
---EXPECT--
-ok
-ok
-ok
-ok--TEST--
-"defined" test
---TEMPLATE--
-{{ definedVar is defined ? 'ok' : 'ko' }}
-{{ definedVar is not defined ? 'ko' : 'ok' }}
-{{ undefinedVar is defined ? 'ko' : 'ok' }}
-{{ undefinedVar is not defined ? 'ok' : 'ko' }}
-{{ zeroVar is defined ? 'ok' : 'ko' }}
-{{ nullVar is defined ? 'ok' : 'ko' }}
-{{ nested.definedVar is defined ? 'ok' : 'ko' }}
-{{ nested['definedVar'] is defined ? 'ok' : 'ko' }}
-{{ nested.definedVar is not defined ? 'ko' : 'ok' }}
-{{ nested.undefinedVar is defined ? 'ko' : 'ok' }}
-{{ nested['undefinedVar'] is defined ? 'ko' : 'ok' }}
-{{ nested.undefinedVar is not defined ? 'ok' : 'ko' }}
-{{ nested.zeroVar is defined ? 'ok' : 'ko' }}
-{{ nested.nullVar is defined ? 'ok' : 'ko' }}
-{{ nested.definedArray.0 is defined ? 'ok' : 'ko' }}
-{{ nested['definedArray'][0] is defined ? 'ok' : 'ko' }}
-{{ object.foo is defined ? 'ok' : 'ko' }}
-{{ object.undefinedMethod is defined ? 'ko' : 'ok' }}
-{{ object.getFoo() is defined ? 'ok' : 'ko' }}
-{{ object.getFoo('a') is defined ? 'ok' : 'ko' }}
-{{ object.undefinedMethod() is defined ? 'ko' : 'ok' }}
-{{ object.undefinedMethod('a') is defined ? 'ko' : 'ok' }}
-{{ object.self.foo is defined ? 'ok' : 'ko' }}
-{{ object.self.undefinedMethod is defined ? 'ko' : 'ok' }}
-{{ object.undefinedMethod.self is defined ? 'ko' : 'ok' }}
---DATA--
-return array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'nullVar' => null,
- 'nested' => array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'nullVar' => null,
- 'definedArray' => array(0),
- ),
- 'object' => new TwigTestFoo(),
-);
---EXPECT--
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
---DATA--
-return array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'nullVar' => null,
- 'nested' => array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'nullVar' => null,
- 'definedArray' => array(0),
- ),
- 'object' => new TwigTestFoo(),
-);
---CONFIG--
-return array('strict_variables' => false)
---EXPECT--
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
-ok
---TEST--
-"empty" test
---TEMPLATE--
-{{ foo is empty ? 'ok' : 'ko' }}
-{{ bar is empty ? 'ok' : 'ko' }}
-{{ foobar is empty ? 'ok' : 'ko' }}
-{{ array is empty ? 'ok' : 'ko' }}
-{{ zero is empty ? 'ok' : 'ko' }}
-{{ string is empty ? 'ok' : 'ko' }}
-{{ countable_empty is empty ? 'ok' : 'ko' }}
-{{ countable_not_empty is empty ? 'ok' : 'ko' }}
-{{ markup_empty is empty ? 'ok' : 'ko' }}
-{{ markup_not_empty is empty ? 'ok' : 'ko' }}
---DATA--
-
-class CountableStub implements Countable
-{
- private $items;
-
- public function __construct(array $items)
- {
- $this->items = $items;
- }
-
- public function count()
- {
- return count($this->items);
- }
-}
-return array(
- 'foo' => '', 'bar' => null, 'foobar' => false, 'array' => array(), 'zero' => 0, 'string' => '0',
- 'countable_empty' => new CountableStub(array()), 'countable_not_empty' => new CountableStub(array(1, 2)),
- 'markup_empty' => new Twig_Markup('', 'UTF-8'), 'markup_not_empty' => new Twig_Markup('test', 'UTF-8'),
-);
---EXPECT--
-ok
-ok
-ok
-ok
-ko
-ko
-ok
-ko
-ok
-ko
---TEST--
-"even" test
---TEMPLATE--
-{{ 1 is even ? 'ko' : 'ok' }}
-{{ 2 is even ? 'ok' : 'ko' }}
-{{ 1 is not even ? 'ok' : 'ko' }}
-{{ 2 is not even ? 'ko' : 'ok' }}
---DATA--
-return array()
---EXPECT--
-ok
-ok
-ok
-ok
---TEST--
-Twig supports the in operator
---TEMPLATE--
-{% if bar in foo %}
-TRUE
-{% endif %}
-{% if not (bar in foo) %}
-{% else %}
-TRUE
-{% endif %}
-{% if bar not in foo %}
-{% else %}
-TRUE
-{% endif %}
-{% if 'a' in bar %}
-TRUE
-{% endif %}
-{% if 'c' not in bar %}
-TRUE
-{% endif %}
-{% if '' not in bar %}
-TRUE
-{% endif %}
-{% if '' in '' %}
-TRUE
-{% endif %}
-{% if '0' not in '' %}
-TRUE
-{% endif %}
-{% if 'a' not in '0' %}
-TRUE
-{% endif %}
-{% if '0' in '0' %}
-TRUE
-{% endif %}
-{{ false in [0, 1] ? 'TRUE' : 'FALSE' }}
-{{ true in [0, 1] ? 'TRUE' : 'FALSE' }}
-{{ '0' in [0, 1] ? 'TRUE' : 'FALSE' }}
-{{ '' in [0, 1] ? 'TRUE' : 'FALSE' }}
-{{ 0 in ['', 1] ? 'TRUE' : 'FALSE' }}
-{{ '' in 'foo' ? 'TRUE' : 'FALSE' }}
-{{ 0 in 'foo' ? 'TRUE' : 'FALSE' }}
-{{ false in 'foo' ? 'TRUE' : 'FALSE' }}
-{{ true in '100' ? 'TRUE' : 'FALSE' }}
-{{ [] in 'Array' ? 'TRUE' : 'FALSE' }}
-{{ [] in [true, false] ? 'TRUE' : 'FALSE' }}
-{{ [] in [true, ''] ? 'TRUE' : 'FALSE' }}
-{{ [] in [true, []] ? 'TRUE' : 'FALSE' }}
-{{ dir_object in 'foo'~dir_name ? 'TRUE' : 'FALSE' }}
-{{ 5 in 125 ? 'TRUE' : 'FALSE' }}
---DATA--
-return array('bar' => 'bar', 'foo' => array('bar' => 'bar'), 'dir_name' => dirname(__FILE__), 'dir_object' => new SplFileInfo(dirname(__FILE__)))
---EXPECT--
-TRUE
-TRUE
-TRUE
-TRUE
-TRUE
-TRUE
-TRUE
-TRUE
-TRUE
-FALSE
-FALSE
-FALSE
-FALSE
-FALSE
-TRUE
-FALSE
-FALSE
-FALSE
-FALSE
-FALSE
-FALSE
-TRUE
-FALSE
-FALSE
---TEST--
-Twig supports the in operator when using objects
---TEMPLATE--
-{% if object in object_list %}
-TRUE
-{% endif %}
---DATA--
-$foo = new TwigTestFoo();
-$foo1 = new TwigTestFoo();
-
-$foo->position = $foo1;
-$foo1->position = $foo;
-
-return array(
- 'object' => $foo,
- 'object_list' => array($foo1, $foo),
-);
---EXPECT--
-TRUE
---TEST--
-"iterable" test
---TEMPLATE--
-{{ foo is iterable ? 'ok' : 'ko' }}
-{{ traversable is iterable ? 'ok' : 'ko' }}
-{{ obj is iterable ? 'ok' : 'ko' }}
-{{ val is iterable ? 'ok' : 'ko' }}
---DATA--
-return array(
- 'foo' => array(),
- 'traversable' => new ArrayIterator(array()),
- 'obj' => new stdClass(),
- 'val' => 'test',
-);
---EXPECT--
-ok
-ok
-ko
-ko--TEST--
-"odd" test
---TEMPLATE--
-{{ 1 is odd ? 'ok' : 'ko' }}
-{{ 2 is odd ? 'ko' : 'ok' }}
---DATA--
-return array()
---EXPECT--
-ok
-ok
diff --git a/tests/examplefiles/type.lisp b/tests/examplefiles/type.lisp
deleted file mode 100644
index c02c29df..00000000
--- a/tests/examplefiles/type.lisp
+++ /dev/null
@@ -1,1218 +0,0 @@
-;;;; TYPEP und Verwandtes
-;;;; Michael Stoll, 21. 10. 1988
-;;;; Bruno Haible, 10.6.1989
-;;;; Sam Steingold 2000-2005
-
-;;; Datenstrukturen für TYPEP:
-;;; - Ein Type-Specifier-Symbol hat auf seiner Propertyliste unter dem
-;;; Indikator SYS::TYPE-SYMBOL eine Funktion von einem Argument, die
-;;; testet, ob ein Objekt vom richtigen Typ ist.
-;;; - Ein Symbol, das eine Type-Specifier-Liste beginnen kann, hat auf seiner
-;;; Propertyliste unter dem Indikator SYS::TYPE-LIST eine Funktion von
-;;; einem Argument für das zu testende Objekt und zusätzlichen Argumenten
-;;; für die Listenelemente.
-;;; - Ein Symbol, das als Typmacro definiert wurde, hat auf seiner Property-
-;;; liste unter dem Indikator SYSTEM::DEFTYPE-EXPANDER den zugehörigen
-;;; Expander: eine Funktion, die den zu expandierenden Type-Specifier (eine
-;;; mindestens einelementige Liste) als Argument bekommt.
-
-(in-package "EXT")
-(export '(type-expand))
-(in-package "SYSTEM")
-
-; vorläufig, solange bis clos.lisp geladen wird:
-(eval-when (eval)
- (predefun clos::built-in-class-p (object) (declare (ignore object)) nil))
-(unless (fboundp 'clos::class-name)
- (defun clos::class-name (c) (declare (ignore c)) nil)
-)
-
-(defun typespec-error (fun type)
- (error-of-type 'error
- (TEXT "~S: invalid type specification ~S")
- fun type
-) )
-
-;; ============================================================================
-
-;; return the CLOS class named by TYPESPEC or NIL
-(defun clos-class (typespec)
- (let ((cc (get typespec 'CLOS::CLOSCLASS)))
- (when (and cc (clos::defined-class-p cc) (eq (clos:class-name cc) typespec))
- cc)))
-
-;;; TYPEP, CLTL S. 72, S. 42-51
-(defun typep (x y &optional env &aux f) ; x = Objekt, y = Typ
- (declare (ignore env))
- (setq y (expand-deftype y))
- (cond
- ((symbolp y)
- (cond ((setq f (get y 'TYPE-SYMBOL)) (funcall f x))
- ((setq f (get y 'TYPE-LIST)) (funcall f x))
- ((setq f (get y 'DEFSTRUCT-DESCRIPTION)) (ds-typep x y f))
- ((setq f (clos-class y))
- ; It's not worth handling structure classes specially here.
- (clos::typep-class x f))
- (t (typespec-error 'typep y))
- ) )
- ((and (consp y) (symbolp (first y)))
- (cond
- ((and (eq (first y) 'SATISFIES) (eql (length y) 2))
- (unless (symbolp (second y))
- (error-of-type 'error
- (TEXT "~S: argument to SATISFIES must be a symbol: ~S")
- 'typep (second y)
- ) )
- (if (funcall (symbol-function (second y)) x) t nil)
- )
- ((eq (first y) 'MEMBER)
- (if (member x (rest y)) t nil)
- )
- ((and (eq (first y) 'EQL) (eql (length y) 2))
- (eql x (second y))
- )
- ((and (eq (first y) 'NOT) (eql (length y) 2))
- (not (typep x (second y)))
- )
- ((eq (first y) 'AND)
- (dolist (type (rest y) t)
- (unless (typep x type) (return nil))
- ) )
- ((eq (first y) 'OR)
- (dolist (type (rest y) nil)
- (when (typep x type) (return t))
- ) )
- ((setq f (get (first y) 'TYPE-LIST)) (apply f x (rest y)))
- (t (typespec-error 'typep y))
- ) )
- ((clos::defined-class-p y) (clos::typep-class x y))
- ((clos::eql-specializer-p y) (eql x (clos::eql-specializer-singleton y)))
- ((encodingp y) (charset-typep x y))
- (t (typespec-error 'typep y))
-) )
-
-;; ----------------------------------------------------------------------------
-
-;; UPGRADED-ARRAY-ELEMENT-TYPE is a lattice homomorphism, see
-;; ANSI CL 15.1.2.1.
-(defun upgraded-array-element-type (type &optional environment)
- (declare (ignore environment))
- ;; see array.d
- (case type
- ((BIT) 'BIT)
- ((CHARACTER) 'CHARACTER)
- ((T) 'T)
- ((NIL) 'NIL)
- (t (if (subtypep type 'NIL)
- 'NIL
- (multiple-value-bind (low high) (sys::subtype-integer type)
- ; Es gilt (or (null low) (subtypep type `(INTEGER ,low ,high)))
- (if (and (integerp low) (not (minusp low)) (integerp high))
- (let ((l (integer-length high)))
- ; Es gilt (subtypep type `(UNSIGNED-BYTE ,l))
- (cond ((<= l 1) 'BIT)
- ((<= l 2) '(UNSIGNED-BYTE 2))
- ((<= l 4) '(UNSIGNED-BYTE 4))
- ((<= l 8) '(UNSIGNED-BYTE 8))
- ((<= l 16) '(UNSIGNED-BYTE 16))
- ((<= l 32) '(UNSIGNED-BYTE 32))
- (t 'T)))
- (if (subtypep type 'CHARACTER)
- 'CHARACTER
- 'T)))))))
-
-;; ----------------------------------------------------------------------------
-
-;; UPGRADED-COMPLEX-PART-TYPE is a lattice homomorphism, see
-;; HyperSpec/Body/fun_complex.html and HyperSpec/Body/syscla_complex.html,
-;; and an idempotent. Therefore
-;; (subtypep (upgraded-complex-part-type T1) (upgraded-complex-part-type T2))
-;; is equivalent to
-;; (subtypep T1 (upgraded-complex-part-type T2))
-;; (Proof: Let U T be an abbreviation for (upgraded-complex-part-type T).
-;; If U T1 <= U T2, then T1 <= U T1 <= U T2.
-;; If T1 <= U T2, then by homomorphism U T1 <= U U T2 = U T2.)
-;;
-;; For _any_ CL implementation, you could define
-;; (defun upgraded-complex-part-type (type) 'REAL)
-;; Likewise for _any_ CL implementation, you could define
-;; (defun upgraded-complex-part-type (type) type)
-;; or - again for _any_ CL implementation:
-;; (defun upgraded-complex-part-type (type)
-;; (cond ((subtypep type 'NIL) 'NIL)
-;; ((subtypep type 'SHORT-FLOAT) 'SHORT-FLOAT)
-;; ((subtypep type 'SINGLE-FLOAT) 'SINGLE-FLOAT)
-;; ((subtypep type 'DOUBLE-FLOAT) 'DOUBLE-FLOAT)
-;; ((subtypep type 'LONG-FLOAT) 'LONG-FLOAT)
-;; ((subtypep type 'RATIONAL) 'RATIONAL)
-;; ((subtypep type 'REAL) 'REAL)
-;; (t (error ...))))
-;; The reason is that a complex number is immutable: no setters for the
-;; realpart and imagpart exist.
-;;
-;; We choose the second implementation because it allows the most precise
-;; type inference.
-(defun upgraded-complex-part-type (type &optional environment)
- (declare (ignore environment))
- (if (subtypep type 'REAL)
- type
- (error-of-type 'error
- (TEXT "~S: type ~S is not a subtype of ~S")
- 'upgraded-complex-part-type type 'real)))
-
-;; ----------------------------------------------------------------------------
-
-;; Macros for defining the various built-in "atomic type specifier"s and
-;; "compound type specifier"s. The following macros add information for both
-;; the TYPEP function above and the c-TYPEP in the compiler.
-
-; Alist symbol -> funname, used by the compiler.
-(defparameter c-typep-alist1 '())
-; Alist symbol -> lambdabody, used by the compiler.
-(defparameter c-typep-alist2 '())
-; Alist symbol -> expander function, used by the compiler.
-(defparameter c-typep-alist3 '())
-
-; (def-atomic-type symbol function-name)
-; defines an atomic type. The function-name designates a function taking one
-; argument and returning a generalized boolean value. It can be either a
-; symbol or a lambda expression.
-(defmacro def-atomic-type (symbol funname)
- (let ((lambdap (and (consp funname) (eq (car funname) 'LAMBDA))))
- `(PROGN
- (SETF (GET ',symbol 'TYPE-SYMBOL)
- ,(if lambdap
- `(FUNCTION ,(concat-pnames "TYPE-SYMBOL-" symbol) ,funname)
- `(FUNCTION ,funname)
- )
- )
- ,(if lambdap
- `(SETQ C-TYPEP-ALIST2
- (NCONC C-TYPEP-ALIST2 (LIST (CONS ',symbol ',(cdr funname))))
- )
- `(SETQ C-TYPEP-ALIST1
- (NCONC C-TYPEP-ALIST1 (LIST (CONS ',symbol ',funname)))
- )
- )
- ',symbol
- )
-) )
-
-; (def-compound-type symbol lambda-list (x) check-form typep-form c-typep-form)
-; defines a compound type. The lambda-list is of the form (&optional ...)
-; where the arguments come from the CDR of the type specifier.
-; For typep-form, x is an object.
-; For c-typep-form, x is a multiply evaluatable form (actually a gensym).
-; check-form is a form performing error checking, may call `error'.
-; typep-form should return a generalized boolean value.
-; c-typep-form should produce a form returning a generalized boolean value.
-(defmacro def-compound-type (symbol lambdalist (var) check-form typep-form c-typep-form)
- `(PROGN
- (SETF (GET ',symbol 'TYPE-LIST)
- (FUNCTION ,(concat-pnames "TYPE-LIST-" symbol)
- (LAMBDA (,var ,@lambdalist)
- ,@(if check-form
- `((MACROLET ((ERROR (&REST ERROR-ARGS)
- (LIST* 'ERROR-OF-TYPE ''ERROR ERROR-ARGS)
- ))
- ,check-form
- ))
- )
- ,typep-form
- ) ) )
- (SETQ C-TYPEP-ALIST3
- (NCONC C-TYPEP-ALIST3
- (LIST (CONS ',symbol
- #'(LAMBDA (,var ,@lambdalist &REST ILLEGAL-ARGS)
- (DECLARE (IGNORE ILLEGAL-ARGS))
- ,@(if check-form
- `((MACROLET ((ERROR (&REST ERROR-ARGS)
- (LIST 'PROGN
- (LIST* 'C-WARN ERROR-ARGS)
- '(THROW 'C-TYPEP NIL)
- )) )
- ,check-form
- ))
- )
- ,c-typep-form
- )
- ) ) ) )
- ',symbol
- )
-)
-
-; CLtL1 p. 43
-(def-atomic-type ARRAY arrayp)
-(def-atomic-type ATOM atom)
-(def-atomic-type BASE-CHAR
- #+BASE-CHAR=CHARACTER
- characterp
- #-BASE-CHAR=CHARACTER
- (lambda (x) (and (characterp x) (base-char-p x)))
-)
-(def-atomic-type BASE-STRING
- (lambda (x)
- (and (stringp x)
- (eq (array-element-type x)
- #+BASE-CHAR=CHARACTER 'CHARACTER #-BASE-CHAR=CHARACTER 'BASE-CHAR
-) ) ) )
-(def-atomic-type BIGNUM
- (lambda (x) (and (integerp x) (not (fixnump x))))
-)
-(def-atomic-type BIT
- (lambda (x) (or (eql x 0) (eql x 1)))
-)
-(def-atomic-type BIT-VECTOR bit-vector-p)
-(def-atomic-type BOOLEAN
- (lambda (x) (or (eq x 'nil) (eq x 't)))
-)
-(def-atomic-type CHARACTER characterp)
-(def-atomic-type COMPILED-FUNCTION compiled-function-p)
-(def-atomic-type COMPLEX complexp)
-(def-atomic-type CONS consp)
-(def-atomic-type DOUBLE-FLOAT double-float-p)
-(def-atomic-type ENCODING encodingp)
-(def-atomic-type EXTENDED-CHAR
- #+BASE-CHAR=CHARACTER
- (lambda (x) (declare (ignore x)) nil)
- #-BASE-CHAR=CHARACTER
- (lambda (x) (and (characterp x) (not (base-char-p x))))
-)
-(def-atomic-type FIXNUM fixnump)
-(def-atomic-type FLOAT floatp)
-(def-atomic-type FUNCTION functionp)
-(def-atomic-type HASH-TABLE hash-table-p)
-(def-atomic-type INTEGER integerp)
-(def-atomic-type KEYWORD keywordp)
-(def-atomic-type LIST listp)
-#+LOGICAL-PATHNAMES
-(def-atomic-type LOGICAL-PATHNAME logical-pathname-p)
-(def-atomic-type LONG-FLOAT long-float-p)
-(def-atomic-type NIL
- (lambda (x) (declare (ignore x)) nil)
-)
-(def-atomic-type NULL null)
-(def-atomic-type NUMBER numberp)
-(def-atomic-type PACKAGE packagep)
-(def-atomic-type PATHNAME pathnamep)
-(def-atomic-type RANDOM-STATE random-state-p)
-(def-atomic-type RATIO
- (lambda (x) (and (rationalp x) (not (integerp x))))
-)
-(def-atomic-type RATIONAL rationalp)
-(def-atomic-type READTABLE readtablep)
-(def-atomic-type REAL realp)
-(def-atomic-type SEQUENCE sequencep)
-(def-atomic-type SHORT-FLOAT short-float-p)
-(def-atomic-type SIMPLE-ARRAY simple-array-p)
-(def-atomic-type SIMPLE-BASE-STRING
- (lambda (x)
- (and (simple-string-p x)
- (eq (array-element-type x)
- #+BASE-CHAR=CHARACTER 'CHARACTER #-BASE-CHAR=CHARACTER 'BASE-CHAR
-) ) ) )
-(def-atomic-type SIMPLE-BIT-VECTOR simple-bit-vector-p)
-(def-atomic-type SIMPLE-STRING simple-string-p)
-(def-atomic-type SIMPLE-VECTOR simple-vector-p)
-(def-atomic-type SINGLE-FLOAT single-float-p)
-(defun %standard-char-p (x) (and (characterp x) (standard-char-p x))) ; ABI
-(def-atomic-type STANDARD-CHAR %standard-char-p)
-(def-atomic-type CLOS:STANDARD-OBJECT clos::std-instance-p)
-(def-atomic-type STREAM streamp)
-(def-atomic-type FILE-STREAM file-stream-p)
-(def-atomic-type SYNONYM-STREAM synonym-stream-p)
-(def-atomic-type BROADCAST-STREAM broadcast-stream-p)
-(def-atomic-type CONCATENATED-STREAM concatenated-stream-p)
-(def-atomic-type TWO-WAY-STREAM two-way-stream-p)
-(def-atomic-type ECHO-STREAM echo-stream-p)
-(def-atomic-type STRING-STREAM string-stream-p)
-(def-atomic-type STRING stringp)
-(def-atomic-type STRING-CHAR characterp)
-(def-atomic-type CLOS:STRUCTURE-OBJECT clos::structure-object-p)
-(def-atomic-type SYMBOL symbolp)
-(def-atomic-type T (lambda (x) (declare (ignore x)) t))
-;; foreign1.lisp is loaded after this file,
-;; so these symbols are not external yet
-#+ffi
-(def-atomic-type ffi::foreign-function
- (lambda (x) (eq 'ffi::foreign-function (type-of x))))
-#+ffi
-(def-atomic-type ffi::foreign-variable
- (lambda (x) (eq 'ffi::foreign-variable (type-of x))))
-#+ffi
-(def-atomic-type ffi::foreign-address
- (lambda (x) (eq 'ffi::foreign-address (type-of x))))
-;; see lispbibl.d (#define FOREIGN) and predtype.d (TYPE-OF):
-#+(or unix ffi affi win32)
-(def-atomic-type foreign-pointer
- (lambda (x) (eq 'foreign-pointer (type-of x))))
-(def-atomic-type VECTOR vectorp)
-(def-atomic-type PLIST
- (lambda (x) (multiple-value-bind (length tail) (list-length-dotted x)
- (and (null tail) (evenp length)))))
-
-(defmacro ensure-dim (type dim)
- ;; make sure DIM is a valid dimension
- `(unless (or (eq ,dim '*) (typep ,dim `(INTEGER 0 (,ARRAY-DIMENSION-LIMIT))))
- (error (TEXT "~S: dimension ~S is invalid") ',type ,dim)))
-
-(defmacro ensure-rank (type rank)
- ;; make sure RANK is a valid rank
- `(unless (typep ,rank `(INTEGER 0 (,ARRAY-RANK-LIMIT)))
- (error (TEXT "~S: rank ~S is invalid") ',type ,rank)))
-
-; CLtL1 p. 46-50
-(defun c-typep-array (tester el-type dims x)
- `(AND (,tester ,x)
- ,@(if (eq el-type '*)
- '()
- `((EQUAL (ARRAY-ELEMENT-TYPE ,x) ',(upgraded-array-element-type el-type)))
- )
- ,@(if (eq dims '*)
- '()
- (if (numberp dims)
- `((EQL ,dims (ARRAY-RANK ,x)))
- `((EQL ,(length dims) (ARRAY-RANK ,x))
- ,@(let ((i 0))
- (mapcap #'(lambda (dim)
- (prog1
- (if (eq dim '*)
- '()
- `((EQL ',dim (ARRAY-DIMENSION ,x ,i)))
- )
- (incf i)
- ) )
- dims
- ) )
- )
- ) )
- )
-)
-(defun c-typep-vector (tester size x)
- `(AND (,tester ,x)
- ,@(if (eq size '*)
- '()
- `((EQL ',size (ARRAY-DIMENSION ,x 0)))
- )
- )
-)
-(defun typep-number-test (x low high test type)
- (and (funcall test x)
- (cond ((eq low '*))
- ((funcall test low) (<= low x))
- ((and (consp low) (null (rest low)) (funcall test (first low)))
- (< (first low) x)
- )
- (t (error-of-type 'error
- #1=(TEXT "~S: argument to ~S must be *, ~S or a list of ~S: ~S")
- 'typep type type type low
- ) ) )
- (cond ((eq high '*))
- ((funcall test high) (>= high x))
- ((and (consp high) (null (rest high)) (funcall test (first high)))
- (> (first high) x)
- )
- (t (error-of-type 'error
- #1# 'typep type type type high
-) ) ) ) )
-(defun c-typep-number (caller tester low high x)
- `(AND (,tester ,x)
- ,@(cond ((eq low '*) '())
- ((funcall tester low) `((<= ,low ,x)))
- ((and (consp low) (null (rest low)) (funcall tester (first low)))
- `((< ,(first low) ,x))
- )
- (t (c-warn #1=(TEXT "~S: argument to ~S must be *, ~S or a list of ~S: ~S")
- 'typep caller caller caller low
- )
- (throw 'c-TYPEP nil)
- ) )
- ,@(cond ((eq high '*) '())
- ((funcall tester high) `((>= ,high ,x)))
- ((and (consp high) (null (rest high)) (funcall tester (first high)))
- `((> ,(first high) ,x))
- )
- (t (c-warn #1# 'typep caller caller caller high)
- (throw 'c-TYPEP nil)
- ) )
- )
-)
-(def-compound-type ARRAY (&optional (el-type '*) (dims '*)) (x)
- (unless (eq dims '*)
- (if (numberp dims)
- (ensure-rank ARRAY dims)
- (dolist (dim dims) (ensure-dim ARRAY dim))))
- (and (arrayp x)
- (or (eq el-type '*)
- (equal (array-element-type x) (upgraded-array-element-type el-type))
- )
- (or (eq dims '*)
- (if (numberp dims)
- (eql dims (array-rank x))
- (and (eql (length dims) (array-rank x))
- (every #'(lambda (a b) (or (eq a '*) (eql a b)))
- dims (array-dimensions x)
- ) ) ) ) )
- (c-typep-array 'ARRAYP el-type dims x)
-)
-(def-compound-type SIMPLE-ARRAY (&optional (el-type '*) (dims '*)) (x)
- (unless (eq dims '*)
- (if (numberp dims)
- (ensure-rank SIMPLE-ARRAY dims)
- (dolist (dim dims) (ensure-dim SIMPLE-ARRAY dim))))
- (and (simple-array-p x)
- (or (eq el-type '*)
- (equal (array-element-type x) (upgraded-array-element-type el-type))
- )
- (or (eq dims '*)
- (if (numberp dims)
- (eql dims (array-rank x))
- (and (eql (length dims) (array-rank x))
- (every #'(lambda (a b) (or (eq a '*) (eql a b)))
- dims (array-dimensions x)
- ) ) ) ) )
- (c-typep-array 'SIMPLE-ARRAY-P el-type dims x)
-)
-(def-compound-type VECTOR (&optional (el-type '*) (size '*)) (x)
- (ensure-dim VECTOR size)
- (and (vectorp x)
- (or (eq el-type '*)
- (equal (array-element-type x) (upgraded-array-element-type el-type))
- )
- (or (eq size '*) (eql (array-dimension x 0) size))
- )
- `(AND (VECTORP ,x)
- ,@(if (eq el-type '*)
- '()
- `((EQUAL (ARRAY-ELEMENT-TYPE ,x) ',(upgraded-array-element-type el-type)))
- )
- ,@(if (eq size '*)
- '()
- `((EQL (ARRAY-DIMENSION ,x 0) ',size))
- )
- )
-)
-(def-compound-type SIMPLE-VECTOR (&optional (size '*)) (x)
- (ensure-dim SIMLPE-VECTOR size)
- (and (simple-vector-p x)
- (or (eq size '*) (eql size (array-dimension x 0)))
- )
- (c-typep-vector 'SIMPLE-VECTOR-P size x)
-)
-(def-compound-type COMPLEX (&optional (rtype '*) (itype rtype)) (x)
- nil
- (and (complexp x)
- (or (eq rtype '*)
- (typep (realpart x) (upgraded-complex-part-type rtype)))
- (or (eq itype '*)
- (typep (imagpart x) (upgraded-complex-part-type itype))))
- `(AND (COMPLEXP ,x)
- ,@(if (eq rtype '*)
- '()
- `((TYPEP (REALPART ,x) ',(upgraded-complex-part-type rtype))))
- ,@(if (eq itype '*)
- '()
- `((TYPEP (IMAGPART ,x) ',(upgraded-complex-part-type itype))))))
-(def-compound-type INTEGER (&optional (low '*) (high '*)) (x)
- nil
- (typep-number-test x low high #'integerp 'INTEGER)
- (c-typep-number 'INTEGER 'INTEGERP low high x)
-)
-(def-compound-type MOD (n) (x)
- (unless (integerp n)
- (error (TEXT "~S: argument to MOD must be an integer: ~S")
- 'typep n
- ) )
- (and (integerp x) (<= 0 x) (< x n))
- `(AND (INTEGERP ,x) (NOT (MINUSP ,x)) (< ,x ,n))
-)
-(def-compound-type SIGNED-BYTE (&optional (n '*)) (x)
- (unless (or (eq n '*) (integerp n))
- (error (TEXT "~S: argument to SIGNED-BYTE must be an integer or * : ~S")
- 'typep n
- ) )
- (and (integerp x) (or (eq n '*) (< (integer-length x) n)))
- `(AND (INTEGERP ,x)
- ,@(if (eq n '*) '() `((< (INTEGER-LENGTH ,x) ,n)))
- )
-)
-(def-compound-type UNSIGNED-BYTE (&optional (n '*)) (x)
- (unless (or (eq n '*) (integerp n))
- (error (TEXT "~S: argument to UNSIGNED-BYTE must be an integer or * : ~S")
- 'typep n
- ) )
- (and (integerp x)
- (not (minusp x))
- (or (eq n '*) (<= (integer-length x) n))
- )
- `(AND (INTEGERP ,x) (NOT (MINUSP ,x))
- ,@(if (eq n '*) '() `((<= (INTEGER-LENGTH ,x) ,n)))
- )
-)
-(def-compound-type REAL (&optional (low '*) (high '*)) (x)
- nil
- (typep-number-test x low high #'realp 'REAL)
- (c-typep-number 'REAL 'REALP low high x)
-)
-(def-compound-type RATIONAL (&optional (low '*) (high '*)) (x)
- nil
- (typep-number-test x low high #'rationalp 'RATIONAL)
- (c-typep-number 'RATIONAL 'RATIONALP low high x)
-)
-(def-compound-type FLOAT (&optional (low '*) (high '*)) (x)
- nil
- (typep-number-test x low high #'floatp 'FLOAT)
- (c-typep-number 'FLOAT 'FLOATP low high x)
-)
-(def-compound-type SHORT-FLOAT (&optional (low '*) (high '*)) (x)
- nil
- (typep-number-test x low high #'short-float-p 'SHORT-FLOAT)
- (c-typep-number 'SHORT-FLOAT 'SHORT-FLOAT-P low high x)
-)
-(def-compound-type SINGLE-FLOAT (&optional (low '*) (high '*)) (x)
- nil
- (typep-number-test x low high #'single-float-p 'SINGLE-FLOAT)
- (c-typep-number 'SINGLE-FLOAT 'SINGLE-FLOAT-P low high x)
-)
-(def-compound-type DOUBLE-FLOAT (&optional (low '*) (high '*)) (x)
- nil
- (typep-number-test x low high #'double-float-p 'DOUBLE-FLOAT)
- (c-typep-number 'DOUBLE-FLOAT 'DOUBLE-FLOAT-P low high x)
-)
-(def-compound-type LONG-FLOAT (&optional (low '*) (high '*)) (x)
- nil
- (typep-number-test x low high #'long-float-p 'LONG-FLOAT)
- (c-typep-number 'LONG-FLOAT 'LONG-FLOAT-P low high x)
-)
-(def-compound-type STRING (&optional (size '*)) (x)
- (ensure-dim STRING size)
- (and (stringp x)
- (or (eq size '*) (eql size (array-dimension x 0)))
- )
- (c-typep-vector 'STRINGP size x)
-)
-(def-compound-type SIMPLE-STRING (&optional (size '*)) (x)
- (ensure-dim SIMPLE-STRING size)
- (and (simple-string-p x)
- (or (eq size '*) (eql size (array-dimension x 0)))
- )
- (c-typep-vector 'SIMPLE-STRING-P size x)
-)
-(def-compound-type BASE-STRING (&optional (size '*)) (x)
- (ensure-dim BASE-STRING size)
- (and (stringp x)
- (or (eq size '*) (eql size (array-dimension x 0)))
- )
- (c-typep-vector 'STRINGP size x)
-)
-(def-compound-type SIMPLE-BASE-STRING (&optional (size '*)) (x)
- (ensure-dim SIMPLE-BASE-STRING size)
- (and (simple-string-p x)
- (or (eq size '*) (eql size (array-dimension x 0)))
- )
- (c-typep-vector 'SIMPLE-STRING-P size x)
-)
-(def-compound-type BIT-VECTOR (&optional (size '*)) (x)
- (ensure-dim BIT-VECTOR size)
- (and (bit-vector-p x)
- (or (eq size '*) (eql size (array-dimension x 0)))
- )
- (c-typep-vector 'BIT-VECTOR-P size x)
-)
-(def-compound-type SIMPLE-BIT-VECTOR (&optional (size '*)) (x)
- (ensure-dim SIMPLE-BIT-VECTOR size)
- (and (simple-bit-vector-p x)
- (or (eq size '*) (eql size (array-dimension x 0)))
- )
- (c-typep-vector 'SIMPLE-BIT-VECTOR-P size x)
-)
-(def-compound-type CONS (&optional (car-type '*) (cdr-type '*)) (x)
- nil
- (and (consp x)
- (or (eq car-type '*) (typep (car x) car-type))
- (or (eq cdr-type '*) (typep (cdr x) cdr-type))
- )
- `(AND (CONSP ,x)
- ,@(if (eq car-type '*) '() `((TYPEP (CAR ,x) ',car-type)))
- ,@(if (eq cdr-type '*) '() `((TYPEP (CDR ,x) ',cdr-type)))
- )
-)
-
-(fmakunbound 'def-compound-type)
-
-;; ----------------------------------------------------------------------------
-
-; Typtest ohne Gefahr einer Fehlermeldung. Für SIGNAL und HANDLER-BIND.
-(defun safe-typep (x y &optional env)
- (let ((*error-handler*
- #'(lambda (&rest error-args)
- (declare (ignore error-args))
- (return-from safe-typep (values nil nil))
- )) )
- (values (typep x y env) t)
-) )
-
-; Umwandlung eines "type for declaration" in einen "type for discrimination".
-(defun type-for-discrimination (y &optional (notp nil) &aux f)
- (cond ((symbolp y)
- (cond ((get y 'TYPE-SYMBOL) y)
- ((get y 'TYPE-LIST) y)
- ((setq f (get y 'DEFTYPE-EXPANDER))
- (let* ((z (funcall f (list y)))
- (zx (type-for-discrimination z notp)))
- (if (eql zx z) y zx)
- ))
- (t y)
- ) )
- ((and (consp y) (symbolp (first y)))
- (case (first y)
- ((SATISFIES MEMBER EQL) y)
- (NOT
- (let* ((z (second y))
- (zx (type-for-discrimination z (not notp))))
- (if (eql zx z) y `(NOT ,zx))
- ))
- ((AND OR COMPLEX VALUES)
- (let* ((z (rest y))
- (zx (mapcar #'(lambda (x) (type-for-discrimination x notp)) z)))
- (if (every #'eql z zx) y (cons (first y) zx))
- ))
- (FUNCTION
- ;; (FUNCTION arg-types res-type) is somewhere between
- ;; NIL and FUNCTION, but undecidable.
- (if notp 'NIL 'FUNCTION)
- )
- (t (cond ((get (first y) 'TYPE-LIST) y)
- ((setq f (get (first y) 'DEFTYPE-EXPANDER))
- (let* ((z (funcall f y))
- (zx (type-for-discrimination z notp)))
- (if (eql zx z) y zx)
- ))
- (t y)
- ) ) ) )
- (t y)
-) )
-
-; Testet eine Liste von Werten auf Erfüllen eines Type-Specifiers. Für THE.
-(defun %the (values type) ; ABI
- (macrolet ((near-typep (objform typform)
- ;; near-typep ist wie typep, nur dass das Objekt auch ein
- ;; Read-Label sein darf. Das tritt z.B. auf bei
- ;; (read-from-string "#1=#S(FOO :X #1#)")
- ;; im Konstruktor MAKE-FOO. Die Implementation ist aber
- ;; nicht gezwungen, bei fehlerhaftem THE zwingend einen
- ;; Fehler zu melden, darum ist ein lascherer Typcheck hier
- ;; erlaubt.
- (let ((g (gensym)))
- `(let ((,g ,objform))
- (or (typep ,g ,typform) (eq (type-of ,g) 'READ-LABEL))))))
- (if (and (consp type) (eq (car type) 'VALUES))
- ;; The VALUES type specifier is ill-defined in ANSI CL.
- ;;
- ;; There are two possibilities to define a VALUES type specifier in a
- ;; sane way:
- ;; - (EXACT-VALUES type1 ... [&optional ...]) describes the exact shape
- ;; of the values list, as received by MULTIPLE-VALUE-LIST.
- ;; For example, (EXACT-VALUES SYMBOL) is matched by (values 'a) but not
- ;; by (values 'a 'b) or (values).
- ;; - (ASSIGNABLE-VALUES type1 ... [&optional ...]) describes the values
- ;; as received by a set of variables through MULTIPLE-VALUE-BIND or
- ;; MULTIPLE-VALUE-SETQ. For example, (ASSIGNABLE-VALUES SYMBOL) is
- ;; defined by whether
- ;; (MULTIPLE-VALUE-BIND (var1) values (DECLARE (TYPE SYMBOL var1)) ...)
- ;; is valid or not; therefore (ASSIGNABLE-VALUES SYMBOL) is matched by
- ;; (values 'a) and (values 'a 'b) and (values).
- ;; Note that &OPTIONAL is actually redundant here:
- ;; (ASSIGNABLE-VALUES type1 ... &optional otype1 ...)
- ;; is equivalent to
- ;; (ASSIGNABLE-VALUES type1 ... (OR NULL otype1) ...)
- ;; HyperSpec/Body/typspe_values.html indicates that VALUES means
- ;; EXACT-VALUES; however, HyperSpec/Body/speope_the.html indicates that
- ;; VALUES means ASSIGNABLE-VALUES.
- ;;
- ;; SBCL interprets the VALUES type specifier to mean EXACT-VALUES when
- ;; it contains &OPTIONAL or &REST, but ASSIGNABLE-VALUES when it has
- ;; only a tuple of type specifiers. This is utter nonsense, in particular
- ;; because it makes (VALUES type1 ... typek &OPTIONAL)
- ;; different from (VALUES type1 ... typek).
- ;;
- ;; Here we use the ASSIGNABLE-VALUES interpretation.
- ;; In SUBTYPEP we just punt and don't assume any interpretation.
- (let ((vals values) (types (cdr type)))
- ;; required:
- (loop
- (when (or (atom types) (atom vals)) (return-from %the t))
- (when (memq (car types) lambda-list-keywords) (return))
- (unless (near-typep (pop vals) (pop types))
- (return-from %the nil)))
- ;; &optional:
- (when (and (consp types) (eq (car types) '&optional))
- (setq types (cdr types))
- (loop
- (when (or (atom types) (atom vals)) (return-from %the t))
- (when (memq (car types) lambda-list-keywords) (return))
- (unless (near-typep (pop vals) (pop types))
- (return-from %the nil))))
- ;; &rest &key:
- (case (car types)
- (&rest
- (setq types (cdr types))
- (when (atom types) (typespec-error 'the type))
- (unless (near-typep (pop vals) (pop types))
- (return-from %the nil)))
- (&key)
- (t (typespec-error 'the type)))
- (if (eq (car types) '&key)
- (progn
- (setq types (cdr types))
- (when (oddp (length vals)) (return-from %the nil))
- (let ((keywords nil))
- (loop
- (when (or (atom types) (atom vals)) (return-from %the t))
- (when (memq (car types) lambda-list-keywords) (return))
- (let ((item (pop types)))
- (unless (and (listp item) (eql (length item) 2)
- (symbolp (first item)))
- (typespec-error 'the type))
- (let ((kw (symbol-to-keyword (first item))))
- (unless (near-typep (getf vals kw) (second item))
- (return-from %the nil))
- (push kw keywords))))
- (if (and (consp types) (eq (car types) '&allow-other-keys))
- (setq types (cdr types))
- (unless (getf vals ':allow-other-keys)
- (do ((L vals (cddr L)))
- ((atom L))
- (unless (memq (car L) keywords)
- (return-from %the nil)))))))
- (when (consp types) (typespec-error 'the type)))
- t)
- (near-typep (if (consp values) (car values) nil) type))))
-
-;;; ===========================================================================
-
-;; SUBTYPEP
-(load "subtypep")
-
-
-;; Returns the number of bytes that are needed to represent #\Null in a
-;; given encoding.
-(defun encoding-zeroes (encoding)
- #+UNICODE
- ;; this should use min_bytes_per_char for cache, not the hash table
- (let ((name (ext:encoding-charset encoding))
- (table #.(make-hash-table :key-type '(or string symbol) :value-type 'fixnum
- :test 'stablehash-equal :warn-if-needs-rehash-after-gc t
- :initial-contents '(("UTF-7" . 1))))
- (tester #.(make-string 2 :initial-element (code-char 0))))
- (or (gethash name table)
- (setf (gethash name table)
- (- (length (ext:convert-string-to-bytes tester encoding))
- (length (ext:convert-string-to-bytes tester encoding
- :end 1))))))
- #-UNICODE 1)
-
-;; Determines two values low,high such that
-;; (subtypep type `(INTEGER ,low ,high))
-;; holds and low is as large as possible and high is as small as possible.
-;; low = * means -infinity, high = * means infinity.
-;; When (subtypep type 'INTEGER) is false, the values NIL,NIL are returned.
-;; We need this function only for MAKE-ARRAY, UPGRADED-ARRAY-ELEMENT-TYPE and
-;; OPEN and can therefore w.l.o.g. replace
-;; type with `(OR ,type (MEMBER 0))
-#| ;; The original implementation calls canonicalize-type and then applies
- ;; a particular SUBTYPE variant:
- (defun subtype-integer (type)
- (macrolet ((yes () '(return-from subtype-integer (values low high)))
- (no () '(return-from subtype-integer nil))
- (unknown () '(return-from subtype-integer nil)))
- (setq type (canonicalize-type type))
- (if (consp type)
- (case (first type)
- (MEMBER ; (MEMBER &rest objects)
- ;; All elements must be of type INTEGER.
- (let ((low 0) (high 0)) ; wlog!
- (dolist (x (rest type) (yes))
- (unless (typep x 'INTEGER) (return (no)))
- (setq low (min low x) high (max high x)))))
- (OR ; (OR type*)
- ;; Every type must be subtype of INTEGER.
- (let ((low 0) (high 0)) ; wlog!
- (dolist (type1 (rest type) (yes))
- (multiple-value-bind (low1 high1) (subtype-integer type1)
- (unless low1 (return (no)))
- (setq low (if (or (eq low '*) (eq low1 '*)) '* (min low low1))
- high (if (or (eq high '*) (eq high1 '*))
- '* (max high high1)))))))
- (AND ; (AND type*)
- ;; If one of the types is subtype of INTEGER, then yes,
- ;; otherwise unknown.
- (let ((low nil) (high nil))
- (dolist (type1 (rest type))
- (multiple-value-bind (low1 high1) (subtype-integer type1)
- (when low1
- (if low
- (setq low (if (eq low '*) low1 (if (eq low1 '*) low (max low low1)))
- high (if (eq high '*) high1 (if (eq high1 '*) high (min high high1))))
- (setq low low1 high high1)))))
- (if low
- (progn
- (when (and (numberp low) (numberp high) (not (<= low high)))
- (setq low 0 high 0) ; type equivalent to NIL)
- (yes))
- (unknown)))))
- (setq type (list type)))
- (if (eq (first type) 'INTEGER)
- (let ((low (if (rest type) (second type) '*))
- (high (if (cddr type) (third type) '*)))
- (when (consp low)
- (setq low (first low))
- (when (numberp low) (incf low)))
- (when (consp high)
- (setq high (first high))
- (when (numberp high) (decf high)))
- (when (and (numberp low) (numberp high) (not (<= low high))) ; type leer?
- (setq low 0 high 0))
- (yes))
- (if (and (eq (first type) 'INTERVALS) (eq (second type) 'INTEGER))
- (let ((low (third type))
- (high (car (last type))))
- (when (consp low)
- (setq low (first low))
- (when (numberp low) (incf low)))
- (when (consp high)
- (setq high (first high))
- (when (numberp high) (decf high)))
- (yes))
- (unknown)))))
-|# ;; This implementation inlines the (tail-recursive) canonicalize-type
- ;; function. Its advantage is that it doesn't cons as much.
- ;; (For example, (subtype-integer '(UNSIGNED-BYTE 8)) doesn't cons.)
-(defun subtype-integer (type)
- (macrolet ((yes () '(return-from subtype-integer (values low high)))
- (no () '(return-from subtype-integer nil))
- (unknown () '(return-from subtype-integer nil)))
- (setq type (expand-deftype type))
- (cond ((symbolp type)
- (case type
- (BIT (let ((low 0) (high 1)) (yes)))
- (FIXNUM
- (let ((low '#,most-negative-fixnum)
- (high '#,most-positive-fixnum))
- (yes)))
- ((INTEGER BIGNUM SIGNED-BYTE)
- (let ((low '*) (high '*)) (yes)))
- (UNSIGNED-BYTE
- (let ((low 0) (high '*)) (yes)))
- ((NIL)
- (let ((low 0) (high 0)) (yes))) ; wlog!
- (t (no))))
- ((and (consp type) (symbolp (first type)))
- (unless (and (list-length type) (null (cdr (last type))))
- (typespec-error 'subtypep type))
- (case (first type)
- (MEMBER ; (MEMBER &rest objects)
- ;; All elements must be of type INTEGER.
- (let ((low 0) (high 0)) ; wlog!
- (dolist (x (rest type) (yes))
- (unless (typep x 'INTEGER) (return (no)))
- (setq low (min low x) high (max high x)))))
- (EQL ; (EQL object)
- (let ((x (second type)))
- (if (typep x 'INTEGER)
- (let ((low (min 0 x)) (high (max 0 x))) (yes))
- (no))))
- (OR ; (OR type*)
- ;; Every type must be subtype of INTEGER.
- (let ((low 0) (high 0)) ; wlog!
- (dolist (type1 (rest type) (yes))
- (multiple-value-bind (low1 high1) (subtype-integer type1)
- (unless low1 (return (no)))
- (setq low (if (or (eq low '*) (eq low1 '*))
- '* (min low low1))
- high (if (or (eq high '*) (eq high1 '*))
- '* (max high high1)))))))
- (AND ; (AND type*)
- ;; If one of the types is subtype of INTEGER, then yes,
- ;; otherwise unknown.
- (let ((low nil) (high nil))
- (dolist (type1 (rest type))
- (multiple-value-bind (low1 high1) (subtype-integer type1)
- (when low1
- (if low
- (setq low (if (eq low '*) low1
- (if (eq low1 '*) low
- (max low low1)))
- high (if (eq high '*) high1
- (if (eq high1 '*) high
- (min high high1))))
- (setq low low1
- high high1)))))
- (if low
- (progn
- (when (and (numberp low) (numberp high)
- (not (<= low high)))
- (setq low 0 high 0)) ; type equivalent to NIL
- (yes))
- (unknown))))
- (INTEGER
- (let ((low (if (rest type) (second type) '*))
- (high (if (cddr type) (third type) '*)))
- (when (consp low)
- (setq low (first low))
- (when (numberp low) (incf low)))
- (when (consp high)
- (setq high (first high))
- (when (numberp high) (decf high)))
- (when (and (numberp low) (numberp high) (not (<= low high)))
- (setq low 0 high 0)) ; type equivalent to NIL
- (yes)))
- (INTERVALS
- (if (eq (second type) 'INTEGER)
- (let ((low (third type))
- (high (car (last type))))
- (when (consp low)
- (setq low (first low))
- (when (numberp low) (incf low)))
- (when (consp high)
- (setq high (first high))
- (when (numberp high) (decf high)))
- (yes))
- (unknown)))
- (MOD ; (MOD n)
- (let ((n (second type)))
- (unless (and (integerp n) (>= n 0))
- (typespec-error 'subtypep type))
- (if (eql n 0)
- (no)
- (let ((low 0) (high (1- n)))
- (yes)))))
- (SIGNED-BYTE ; (SIGNED-BYTE &optional s)
- (let ((s (if (cdr type) (second type) '*)))
- (if (eq s '*)
- (let ((low '*) (high '*)) (yes))
- (progn
- (unless (and (integerp s) (plusp s))
- (typespec-error 'subtypep type))
- (let ((n (ash 1 (1- s)))) ; (ash 1 *) == (expt 2 *)
- (let ((low (- n)) (high (1- n)))
- (yes)))))))
- (UNSIGNED-BYTE ; (UNSIGNED-BYTE &optional s)
- (let ((s (if (cdr type) (second type) '*)))
- (if (eq s '*)
- (let ((low 0) (high '*)) (yes))
- (progn
- (unless (and (integerp s) (>= s 0))
- (typespec-error 'subtypep type))
- (let ((n (ash 1 s))) ; (ash 1 *) == (expt 2 *)
- (let ((low 0) (high (1- n)))
- (yes)))))))
- (t (no))))
- ((clos::defined-class-p type)
- (if (and (clos::built-in-class-p type)
- (eq (get (clos:class-name type) 'CLOS::CLOSCLASS) type))
- (return-from subtype-integer
- (subtype-integer (clos:class-name type)))
- (no)))
- ((clos::eql-specializer-p type)
- (let ((x (clos::eql-specializer-singleton type)))
- (if (typep x 'INTEGER)
- (let ((low (min 0 x)) (high (max 0 x))) (yes))
- (no))))
- ((encodingp type) (no))
- (t (typespec-error 'subtypep type)))))
-
-#| TODO: Fix subtype-integer such that this works.
-Henry Baker:
- (defun type-null (x)
- (values (and (eq 'bit (upgraded-array-element-type `(or bit ,x)))
- (not (typep 0 x))
- (not (typep 1 x)))
- t))
- (type-null '(and symbol number))
- (type-null '(and integer symbol))
- (type-null '(and integer character))
-|#
-
-;; Determines a sequence kind (an atom, as defined in defseq.lisp: one of
-;; LIST - stands for LIST
-;; VECTOR - stands for (VECTOR T)
-;; STRING - stands for (VECTOR CHARACTER)
-;; 1, 2, 4, 8, 16, 32 - stands for (VECTOR (UNSIGNED-BYTE n))
-;; 0 - stands for (VECTOR NIL))
-;; that indicates the sequence type meant by the given type. Other possible
-;; return values are
-;; SEQUENCE - denoting a type whose intersection with (OR LIST VECTOR) is not
-;; subtype of LIST or VECTOR, or
-;; NIL - indicating a type whose intersection with (OR LIST VECTOR) is empty.
-;; When the type is (OR (VECTOR eltype1) ... (VECTOR eltypeN)), the chosen
-;; element type is the smallest element type that contains all of eltype1 ...
-;; eltypeN.
-;;
-;; User-defined sequence types are not supported here.
-;;
-;; This implementation inlines the (tail-recursive) canonicalize-type
-;; function. Its advantage is that it doesn't cons as much. Also it employs
-;; some heuristics and does not have the full power of SUBTYPEP.
-(defun subtype-sequence (type)
- (setq type (expand-deftype type))
- (cond ((symbolp type)
- (case type
- ((LIST CONS NULL) 'LIST)
- ((NIL) 'NIL)
- ((BIT-VECTOR SIMPLE-BIT-VECTOR) '1)
- ((STRING SIMPLE-STRING BASE-STRING SIMPLE-BASE-STRING) 'STRING)
- ((VECTOR SIMPLE-VECTOR ARRAY SIMPLE-ARRAY) 'VECTOR)
- ((SEQUENCE) 'SEQUENCE)
- (t 'NIL)))
- ((and (consp type) (symbolp (first type)))
- (unless (and (list-length type) (null (cdr (last type))))
- (typespec-error 'subtypep type))
- (case (first type)
- (MEMBER ; (MEMBER &rest objects)
- (let ((kind 'NIL))
- (dolist (x (rest type))
- (setq kind (sequence-type-union kind (type-of-sequence x))))
- kind))
- (EQL ; (EQL object)
- (unless (eql (length type) 2)
- (typespec-error 'subtypep type))
- (type-of-sequence (second type)))
- (OR ; (OR type*)
- (let ((kind 'NIL))
- (dolist (x (rest type))
- (setq kind (sequence-type-union kind (subtype-sequence x))))
- kind))
- (AND ; (AND type*)
- (let ((kind 'SEQUENCE))
- (dolist (x (rest type))
- (setq kind (sequence-type-intersection kind (subtype-sequence x))))
- kind))
- ((SIMPLE-BIT-VECTOR BIT-VECTOR) ; (SIMPLE-BIT-VECTOR &optional size)
- (when (cddr type)
- (typespec-error 'subtypep type))
- '1)
- ((SIMPLE-STRING STRING SIMPLE-BASE-STRING BASE-STRING) ; (SIMPLE-STRING &optional size)
- (when (cddr type)
- (typespec-error 'subtypep type))
- 'STRING)
- (SIMPLE-VECTOR ; (SIMPLE-VECTOR &optional size)
- (when (cddr type)
- (typespec-error 'subtypep type))
- 'VECTOR)
- ((VECTOR ARRAY SIMPLE-ARRAY) ; (VECTOR &optional el-type size), (ARRAY &optional el-type dimensions)
- (when (cdddr type)
- (typespec-error 'subtypep type))
- (let ((el-type (if (cdr type) (second type) '*)))
- (if (eq el-type '*)
- 'VECTOR
- (let ((eltype (upgraded-array-element-type el-type)))
- (cond ((eq eltype 'T) 'VECTOR)
- ((eq eltype 'CHARACTER) 'STRING)
- ((eq eltype 'BIT) '1)
- ((and (consp eltype) (eq (first eltype) 'UNSIGNED-BYTE)) (second eltype))
- ((eq eltype 'NIL) '0)
- (t (error (TEXT "~S is not up-to-date with ~S for element type ~S")
- 'subtypep-sequence 'upgraded-array-element-type eltype)))))))
- ((CONS) ; (CONS &optional cartype cdrtype)
- (when (cdddr type)
- (typespec-error 'subtypep type))
- 'LIST)
- (t 'NIL)))
- ((clos::defined-class-p type)
- (if (and (clos::built-in-class-p type)
- (eq (get (clos:class-name type) 'CLOS::CLOSCLASS) type))
- (subtype-sequence (clos:class-name type))
- 'NIL))
- ((clos::eql-specializer-p type)
- (type-of-sequence (clos::eql-specializer-singleton type)))
- (t 'NIL)))
-(defun type-of-sequence (x)
- (cond ((listp x) 'LIST)
- ((vectorp x)
- (let ((eltype (array-element-type x)))
- (cond ((eq eltype 'T) 'VECTOR)
- ((eq eltype 'CHARACTER) 'STRING)
- ((eq eltype 'BIT) '1)
- ((and (consp eltype) (eq (first eltype) 'UNSIGNED-BYTE)) (second eltype))
- ((eq eltype 'NIL) '0)
- (t (error (TEXT "~S is not up-to-date with ~S for element type ~S")
- 'type-of-sequence 'array-element-type eltype)))))
- (t 'NIL)))
-(defun sequence-type-union (t1 t2)
- (cond ; Simple general rules.
- ((eql t1 t2) t1)
- ((eq t1 'NIL) t2)
- ((eq t2 'NIL) t1)
- ; Now the union of two different types.
- ((or (eq t1 'SEQUENCE) (eq t2 'SEQUENCE)) 'SEQUENCE)
- ((or (eq t1 'LIST) (eq t2 'LIST))
- ; union of LIST and a vector type
- 'SEQUENCE)
- ((or (eq t1 'VECTOR) (eq t2 'VECTOR)) 'VECTOR)
- ((eql t1 0) t2)
- ((eql t2 0) t1)
- ((or (eq t1 'STRING) (eq t2 'STRING))
- ; union of STRING and an integer-vector type
- 'VECTOR)
- (t (max t1 t2))))
-(defun sequence-type-intersection (t1 t2)
- (cond ; Simple general rules.
- ((eql t1 t2) t1)
- ((or (eq t1 'NIL) (eq t2 'NIL)) 'NIL)
- ; Now the intersection of two different types.
- ((eq t1 'SEQUENCE) t2)
- ((eq t2 'SEQUENCE) t1)
- ((or (eq t1 'LIST) (eq t2 'LIST))
- ; intersection of LIST and a vector type
- 'NIL)
- ((eq t1 'VECTOR) t2)
- ((eq t2 'VECTOR) t1)
- ((or (eql t1 0) (eql t2 0)) '0)
- ((or (eq t1 'STRING) (eq t2 'STRING))
- ; intersection of STRING and an integer-vector type
- '0)
- (t (min t1 t2))))
-
-;; ============================================================================
-
-(defun type-expand (typespec &optional once-p)
- (multiple-value-bind (expanded user-defined-p)
- (expand-deftype typespec once-p)
- (if user-defined-p (values expanded user-defined-p)
- (cond ((symbolp typespec)
- (cond ((or (get typespec 'TYPE-SYMBOL) (get typespec 'TYPE-LIST))
- (values typespec nil))
- ((or (get typespec 'DEFSTRUCT-DESCRIPTION)
- (clos-class typespec))
- (values typespec nil))
- (t (typespec-error 'type-expand typespec))))
- ((and (consp typespec) (symbolp (first typespec)))
- (case (first typespec)
- ((SATISFIES MEMBER EQL NOT AND OR) (values typespec nil))
- (t (cond ((get (first typespec) 'TYPE-LIST)
- (values typespec nil))
- (t (typespec-error 'type-expand typespec))))))
- ((clos::defined-class-p typespec) (values typespec nil))
- (t (typespec-error 'type-expand typespec))))))
-
-;; ============================================================================
-
-(unless (clos::funcallable-instance-p #'clos::class-name)
- (fmakunbound 'clos::class-name))
-
-
-(keywordp :junk)
- T
-
-(keywordp ::junk)
- T
-
-(symbol-name ::junk)
- "JUNK"
-
-(symbol-name :#junk)
- "#JUNK"
-
-(symbol-name :#.junk)
- "#.JUNK"
diff --git a/tests/examplefiles/typescript_example b/tests/examplefiles/typescript_example
deleted file mode 100644
index 760e2543..00000000
--- a/tests/examplefiles/typescript_example
+++ /dev/null
@@ -1,39 +0,0 @@
-class Animal {
- constructor(public name) { }
- move(meters) {
- alert(this.name + " moved " + meters + "m.");
- }
-}
-
-class Snake extends Animal {
- constructor(name) { super(name); }
- move() {
- alert("Slithering...");
- super.move(5);
- }
-}
-
-class Horse extends Animal {
- constructor(name) { super(name); }
- move() {
- alert("Galloping...");
- super.move(45);
- }
-}
-
-@View({
- templateUrl: "app/components/LoginForm.html",
- directives: [FORM_DIRECTIVES, NgIf]
-})
-@Component({
- selector: "login-form"
-})
-class LoginForm {
-
-}
-
-var sam = new Snake("Sammy the Python")
-var tom: Animal = new Horse("Tommy the Palomino")
-
-sam.move()
-tom.move(34)
diff --git a/tests/examplefiles/typoscript_example b/tests/examplefiles/typoscript_example
deleted file mode 100644
index e2fccf5d..00000000
--- a/tests/examplefiles/typoscript_example
+++ /dev/null
@@ -1,1930 +0,0 @@
-# ***************************************************************************
-# Notice: "styles." (and "temp.") objects are UNSET after template parsing!
-# Use "lib." for persisting storage of objects.
-# ***************************************************************************
-
-<INCLUDE_TYPOSCRIPT: source="FILE: EXT:www_tue_nl/Configuration/TypoScript/Setup/Root.ts">
-
-page.80 = RECORDS
-page.80 {
- source = 1
- tables = tt_address
- conf.tt_address = COA
- conf.tt_address {
- 20 = TEXT
- 20.field = email
- 20.typolink.parameter.field = email
- }
-}
-
- /*
-page.200 = PHP_SCRIPT_EXT
-page.200 {
- 1 = TMENU
- 1.wrap = <div style="width:200px; border: 1px solid;">|</div>
- 1.expAll = 1
- 1.submenuObjSuffixes = a |*| |*| b
- 1.NO.allWrap = <b>|</b><br/>
-
- 2 = TMENU
- 2.NO.allWrap = <div style="background:red;">|</div>
-
- 2a = TMENU
- 2a.NO.allWrap = <div style="background:yellow;">|</div>
-*
- 2b = TMENU
- 2b.NO.allWrap = <div style="background:green;">|</div>
-}
-*/
-
- # Add the CSS and JS files
-page {
- includeCSS { # comment at the end of a line
- file99 = fileadmin/your-fancybox.css
- }
- includeJSFooter {
- fancybox = fileadmin/your-fancybox.js
- }
-}
-
- # Change the default rendering of images to match lightbox requirements
-tt_content.image.20.1.imageLinkWrap {
- JSwindow = 0
- test = MyExtension\Path\To\Class
-
- directImageLink = 1
- linkParams.ATagParams {
- dataWrap = class= "lightbox" rel="fancybox{field:uid}"
- }
-}
-
-tt_content.image.20.1.imageLinkWrap >
-tt_content.image.20.1.imageLinkWrap = 1
-tt_content.image.20.1.imageLinkWrap {
- enable = 1
- typolink {
- # directly link to the recent image
- parameter.cObject = IMG_RESOURCE
- parameter.cObject.file.import.data = TSFE:lastImageInfo|origFile
- parameter.cObject.file.maxW = {$styles.content.imgtext.maxW}
- parameter.override.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
- title.field = imagecaption // title
- title.split.token.char = 10
- title.if.isTrue.field = imagecaption // header
- title.split.token.char = 10
- title.split.returnKey.data = register : IMAGE_NUM_CURRENT
- parameter.cObject = IMG_RESOURCE
- parameter.cObject.file.import.data = TSFE:lastImageInfo|origFile
- ATagParams = target="_blank"
- }
-}
-
-10 = IMAGE
-10 {
- # point to the image
- file = fileadmin/demo/lorem_ipsum/images/a4.jpg
- # make it rather small
- file.width = 80
- # add a link to tx_cms_showpic.php that shows the original image
- imageLinkWrap = 1
- imageLinkWrap {
- enable = 1
- # JSwindow = 1
- }
-}
-
-# Clear out any constants in this reserved room!
-styles.content >
-
-# get content
-styles.content.get = CONTENT
-styles.content.get {
- table = tt_content
- select.orderBy = sorting
- select.where = colPos=0
- select.languageField = sys_language_uid
-}
-
-# get content, left
-styles.content.getLeft < styles.content.get
-styles.content.getLeft.select.where = colPos=1
-
-# get content, right
-styles.content.getRight < styles.content.get
-styles.content.getRight.select.where = colPos=2
-
-# get content, margin
-styles.content.getBorder < styles.content.get
-styles.content.getBorder.select.where = colPos=3
-
-# get news
-styles.content.getNews < styles.content.get
-styles.content.getNews.select.pidInList = {$styles.content.getNews.newsPid}
-
-# Edit page object:
-styles.content.editPanelPage = COA
-styles.content.editPanelPage {
- 10 = EDITPANEL
- 10 {
- allow = toolbar,move,hide
- label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.page
- label.wrap = |&nbsp;<b>%s</b>
- }
-}
-
-
-
-
-
-
-
-
-
-
-
-# *********************************************************************
-# "lib." objects are preserved from unsetting after template parsing
-# *********************************************************************
-
-# Creates persistent ParseFunc setup for non-HTML content. This is recommended to use (as a reference!)
-lib.parseFunc {
- makelinks = 1
- makelinks.http.keep = {$styles.content.links.keep}
- makelinks.http.extTarget = {$styles.content.links.extTarget}
- makelinks.mailto.keep = path
- tags {
- link = TEXT
- link {
- current = 1
- typolink.parameter.data = parameters : allParams
- typolink.extTarget = {$styles.content.links.extTarget}
- typolink.target = {$styles.content.links.target}
- parseFunc.constants =1
- }
- }
- allowTags = {$styles.content.links.allowTags}
- denyTags = *
- sword = <span class="csc-sword">|</span>
- constants = 1
-
- nonTypoTagStdWrap.HTMLparser = 1
- nonTypoTagStdWrap.HTMLparser {
- keepNonMatchedTags = 1
- htmlSpecialChars = 2
- }
-}
-
-# good old parsefunc in "styles.content.parseFunc" is created for backwards compatibility. Don't use it, just ignore.
-styles.content.parseFunc < lib.parseFunc
-
-# Creates persistent ParseFunc setup for RTE content (which is mainly HTML) based on the "ts_css" transformation.
-lib.parseFunc_RTE < lib.parseFunc
-lib.parseFunc_RTE {
- // makelinks >
- # Processing <table> and <blockquote> blocks separately
- externalBlocks = table, blockquote, dd, dl, ol, ul, div
- externalBlocks {
- # The blockquote content is passed into parseFunc again...
- blockquote.stripNL=1
- blockquote.callRecursive=1
- blockquote.callRecursive.tagStdWrap.HTMLparser = 1
- blockquote.callRecursive.tagStdWrap.HTMLparser.tags.blockquote.overrideAttribs = style="margin-bottom:0;margin-top:0;"
-
- ol.stripNL=1
- ol.stdWrap.parseFunc = < lib.parseFunc
-
- ul.stripNL=1
- ul.stdWrap.parseFunc = < lib.parseFunc
-
- table.stripNL=1
- table.stdWrap.HTMLparser = 1
- table.stdWrap.HTMLparser.tags.table.fixAttrib.class {
- default = contenttable
- always = 1
- list = contenttable
- }
- table.stdWrap.HTMLparser.keepNonMatchedTags = 1
- table.HTMLtableCells=1
- table.HTMLtableCells {
- default.callRecursive=1
- addChr10BetweenParagraphs=1
- }
- div.stripNL = 1
- div.callRecursive = 1
-
- # Definition list processing
- dl < .div
- dd < .div
- }
- nonTypoTagStdWrap.encapsLines {
- encapsTagList = p,pre,h1,h2,h3,h4,h5,h6,hr,dt
- remapTag.DIV = P
- nonWrappedTag = P
- innerStdWrap_all.ifBlank = &nbsp;
- addAttributes.P.class = bodytext
- addAttributes.P.class.setOnly=blank
- }
- nonTypoTagStdWrap.HTMLparser = 1
- nonTypoTagStdWrap.HTMLparser {
- keepNonMatchedTags = 1
- htmlSpecialChars = 2
- }
-}
-
-
-# Content header:
-lib.stdheader = COA
-lib.stdheader {
-
- # Create align style-attribute for <Hx> tags
- 2 = LOAD_REGISTER
- 2.headerStyle.field = header_position
- 2.headerStyle.required = 1
- 2.headerStyle.noTrimWrap = | style="text-align:|;"|
-
- # Create class="csc-firstHeader" attribute for <Hx> tags
- 3 = LOAD_REGISTER
- 3.headerClass = csc-firstHeader
- 3.headerClass.if.value=1
- 3.headerClass.if.equals.data = cObj:parentRecordNumber
- 3.headerClass.noTrimWrap = | class="|"|
-
- # Date format:
- 5 = TEXT
- 5.field = date
- 5.if.isTrue.field = date
- 5.strftime = %x
- 5.wrap = <p class="csc-header-date">|</p>
- 5.prefixComment = 2 | Header date:
-
- # This CASE cObject renders the header content:
- # currentValue is set to the header data, possibly wrapped in link-tags.
- 10 = CASE
- 10.setCurrent {
- field = header
- htmlSpecialChars = 1
- typolink.parameter.field = header_link
- }
- 10.key.field = header_layout
- 10.key.ifEmpty = {$content.defaultHeaderType}
- 10.key.ifEmpty.override.data = register: defaultHeaderType
-
- 10.1 = TEXT
- 10.1.current = 1
- 10.1.dataWrap = <h1{register:headerStyle}{register:headerClass}>|</h1>
-
- 10.2 < .10.1
- 10.2.dataWrap = <h2{register:headerStyle}{register:headerClass}>|</h2>
-
- 10.3 < .10.1
- 10.3.dataWrap = <h3{register:headerStyle}{register:headerClass}>|</h3>
-
- 10.4 < .10.1
- 10.4.dataWrap = <h4{register:headerStyle}{register:headerClass}>|</h4>
-
- 10.5 < .10.1
- 10.5.dataWrap = <h5{register:headerStyle}{register:headerClass}>|</h5>
-
- # Pops the used registers off the stack:
- 98 = RESTORE_REGISTER
- 99 = RESTORE_REGISTER
-
- # Post-processing:
- stdWrap.fieldRequired = header
- stdWrap.if {
- equals.field = header_layout
- value = 100
- negate = 1
- }
-
- stdWrap.editIcons = tt_content : header, [header_layout | header_position], [header_link|date]
- stdWrap.editIcons.beforeLastTag = 1
- stdWrap.editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.header
-
- stdWrap.dataWrap = <div class="csc-header csc-header-n{cObj:parentRecordNumber}">|</div>
- stdWrap.prefixComment = 2 | Header:
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#******************************************************
-# Including library for processing of some elements:
-#******************************************************
-includeLibs.tx_cssstyledcontent_pi1 = EXT:css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
-
-
-#**********************************
-# tt_content is started
-#**********************************
-tt_content >
-tt_content = CASE
-tt_content.key.field = CType
-tt_content.stdWrap {
- innerWrap.cObject = CASE
- innerWrap.cObject {
- key.field = section_frame
-
- default = COA
- default {
- 10 = TEXT
- 10 {
- value = <div id="c{field:uid}"
- override.cObject = TEXT
- override.cObject {
- value = <div
- if.value = div
- if.equals.field = CType
- }
- insertData = 1
- }
-
- 15 = TEXT
- 15 {
- value = csc-default
- noTrimWrap = | class="|" |
- required = 1
- }
-
- 20 = COA
- 20 {
- 10 = COA
- 10 {
- 10 = TEXT
- 10 {
- value = {$content.spaceBefore}
- wrap = |+
- if.isTrue = {$content.spaceBefore}
- }
-
- 20 = TEXT
- 20 {
- field = spaceBefore
- }
-
- stdWrap {
- prioriCalc = intval
- wrap = margin-top:|px;
- required = 1
- ifEmpty.value =
- }
- }
-
- 20 = COA
- 20 {
- 10 = TEXT
- 10 {
- value = {$content.spaceAfter}
- wrap = |+
- if.isTrue = {$content.spaceAfter}
- }
-
- 20 = TEXT
- 20 {
- field = spaceAfter
- }
-
- stdWrap {
- prioriCalc = intval
- wrap = margin-bottom:|px;
- required = 1
- ifEmpty.value =
- }
- }
-
- stdWrap.noTrimWrap = | style="|" |
- stdWrap.required = 1
- }
- 30 = TEXT
- 30.value = >|</div>
- }
-
- 1 =< tt_content.stdWrap.innerWrap.cObject.default
- 1.15.value = csc-frame csc-frame-invisible
-
- 5 =< tt_content.stdWrap.innerWrap.cObject.default
- 5.15.value = csc-frame csc-frame-rulerBefore
-
- 6 =< tt_content.stdWrap.innerWrap.cObject.default
- 6.15.value = csc-frame csc-frame-rulerAfter
-
- 10 =< tt_content.stdWrap.innerWrap.cObject.default
- 10.15.value = csc-frame csc-frame-indent
-
- 11 =< tt_content.stdWrap.innerWrap.cObject.default
- 11.15.value = csc-frame csc-frame-indent3366
-
- 12 =< tt_content.stdWrap.innerWrap.cObject.default
- 12.15.value = csc-frame csc-frame-indent6633
-
- 20 =< tt_content.stdWrap.innerWrap.cObject.default
- 20.15.value = csc-frame csc-frame-frame1
-
- 21 =< tt_content.stdWrap.innerWrap.cObject.default
- 21.15.value = csc-frame csc-frame-frame2
-
- 66 = COA
- 66 {
- 10 = TEXT
- 10 {
- value = <a id="c{field:uid}"></a>
- insertData = 1
- }
-
- 20 = COA
- 20 {
- 10 = TEXT
- 10 {
- value = {$content.spaceBefore}
- wrap = |+
- if.isTrue = {$content.spaceBefore}
- }
-
- 20 = TEXT
- 20 {
- field = spaceBefore
- }
-
- stdWrap {
- prioriCalc = intval
- wrap = margin-top:|px;
- required = 1
- ifEmpty.value =
- wrap2 = <div style="|"></div>
- }
- }
-
- 30 = TEXT
- 30 {
- value = |
- }
-
- 40 < .20
- 40 {
- 10 {
- value = {$content.spaceAfter}
- if.isTrue = {$content.spaceAfter}
- }
- 20.field = spaceAfter
- stdWrap.wrap = margin-bottom:|px;
- }
- }
-
- }
-
- innerWrap2 = | <p class="csc-linkToTop"><a href="#">{LLL:EXT:css_styled_content/pi1/locallang.xml:label.toTop}</a></p>
- innerWrap2.insertData = 1
- innerWrap2.fieldRequired = linkToTop
-
- prepend = TEXT
- prepend.dataWrap = <a id="c{field:_LOCALIZED_UID}"></a>
- prepend.if.isTrue.field = _LOCALIZED_UID
-
- editPanel = 1
- editPanel {
- allow = move,new,edit,hide,delete
- line = 5
- label = %s
- onlyCurrentPid = 1
- previewBorder = 4
- edit.displayRecord = 1
- }
-
- prefixComment = 1 | CONTENT ELEMENT, uid:{field:uid}/{field:CType}
-}
-
-
-
-# *****************
-# CType: header
-# *****************
-# See Object path "lib.stdheader"
-tt_content.header = COA
-tt_content.header {
- 10 = < lib.stdheader
-
- 20 = TEXT
- 20 {
- field = subheader
- required = 1
-
- dataWrap = <p class="csc-subheader csc-subheader-{field:layout}">|</p>
- htmlSpecialChars = 1
-
- editIcons = tt_content:subheader,layout
- editIcons.beforeLastTag = 1
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.subheader
-
- prefixComment = 2 | Subheader:
- }
-}
-
-
-
-# *****************
-# CType: text
-# *****************
-tt_content.text = COA
-tt_content.text {
- 10 = < lib.stdheader
-
- 20 = TEXT
- 20 {
- field = bodytext
- required = 1
-
- parseFunc = < lib.parseFunc_RTE
-
- editIcons = tt_content:bodytext, rte_enabled
- editIcons.beforeLastTag = 1
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.bodytext
-
- prefixComment = 2 | Text:
- }
-}
-
-
-
-# *****************
-# CType: image
-# *****************
-# (also used for rendering 'textpic' type):
-tt_content.image = COA
-tt_content.image.10 = < lib.stdheader
-tt_content.image.20 = USER
-tt_content.image.20 {
- userFunc = tx_cssstyledcontent_pi1->render_textpic
-
- # Image source
- imgList.field = image
- imgPath = uploads/pics/
-
- # Single image rendering
- imgObjNum = 1
- 1 {
- file.import.current = 1
- file.width.field = imagewidth
- imageLinkWrap = 1
- imageLinkWrap {
- bodyTag = <body style="margin:0; background:#fff;">
- wrap = <a href="javascript:close();"> | </a>
- width = {$styles.content.imgtext.linkWrap.width}
- height = {$styles.content.imgtext.linkWrap.height}
- effects = {$styles.content.imgtext.linkWrap.effects}
-
- JSwindow = 1
- JSwindow.newWindow = {$styles.content.imgtext.linkWrap.newWindow}
- JSwindow.if.isFalse = {$styles.content.imgtext.linkWrap.lightboxEnabled}
-
- directImageLink = {$styles.content.imgtext.linkWrap.lightboxEnabled}
-
- enable.field = image_zoom
- enable.ifEmpty.typolink.parameter.field = image_link
- enable.ifEmpty.typolink.parameter.listNum.splitChar = 10
- enable.ifEmpty.typolink.parameter.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
- enable.ifEmpty.typolink.returnLast = url
-
- typolink.parameter.field = image_link
- typolink.parameter.listNum.splitChar = 10
- typolink.parameter.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
- typolink.target = {$styles.content.links.target}
- typolink.extTarget = {$styles.content.links.extTarget}
-
- linkParams.ATagParams.dataWrap = class="{$styles.content.imgtext.linkWrap.lightboxCssClass}" rel="{$styles.content.imgtext.linkWrap.lightboxRelAttribute}"
- }
-
- altText = TEXT
- altText {
- field = altText
- stripHtml = 1
- split.token.char = 10
- split.token.if.isTrue = {$styles.content.imgtext.imageTextSplit}
- split.returnKey.data = register : IMAGE_NUM_CURRENT
- }
-
- titleText < .altText
- titleText.field = titleText
-
- longdescURL < .altText
- longdescURL.field = longdescURL
-
- emptyTitleHandling = {$styles.content.imgtext.emptyTitleHandling}
- titleInLink = {$styles.content.imgtext.titleInLink}
- titleInLinkAndImg = {$styles.content.imgtext.titleInLinkAndImg}
- }
-
- textPos.field = imageorient
- maxW = {$styles.content.imgtext.maxW}
- maxW.override.data = register:maxImageWidth
- maxWInText = {$styles.content.imgtext.maxWInText}
- maxWInText.override.data = register:maxImageWidthInText
-
- equalH.field = imageheight
-
- image_compression.field = image_compression
- image_effects.field = image_effects
-
- noRows.field = image_noRows
-
- cols.field = imagecols
- border.field = imageborder
-
- caption {
- 1 = TEXT
- 1 {
- field = imagecaption
- required = 1
- parseFunc =< lib.parseFunc
- br = 1
- split.token.char = 10
- split.token.if.isPositive = {$styles.content.imgtext.imageTextSplit} + {$styles.content.imgtext.captionSplit}
- split.returnKey.data = register : IMAGE_NUM_CURRENT
- }
- }
- # captionSplit is deprecated, use imageTextSplit instead
- captionSplit = {$styles.content.imgtext.captionSplit}
- captionAlign.field = imagecaption_position
- # caption/alttext/title/longdescURL splitting
- imageTextSplit = {$styles.content.imgtext.imageTextSplit}
-
- borderCol = {$styles.content.imgtext.borderColor}
- borderThick = {$styles.content.imgtext.borderThick}
- borderClass = {$styles.content.imgtext.borderClass}
- colSpace = {$styles.content.imgtext.colSpace}
- rowSpace = {$styles.content.imgtext.rowSpace}
- textMargin = {$styles.content.imgtext.textMargin}
-
- borderSpace = {$styles.content.imgtext.borderSpace}
- separateRows = {$styles.content.imgtext.separateRows}
- addClasses =
- addClassesImage =
- addClassesImage.ifEmpty = csc-textpic-firstcol csc-textpic-lastcol
- addClassesImage.override = csc-textpic-firstcol |*| |*| csc-textpic-lastcol
- addClassesImage.override.if {
- isGreaterThan.field = imagecols
- value = 1
- }
-
- #
- imageStdWrap.dataWrap = <div class="csc-textpic-imagewrap" style="width:{register:totalwidth}px;"> | </div>
- imageStdWrapNoWidth.wrap = <div class="csc-textpic-imagewrap"> | </div>
-
- # if noRows is set, wrap around each column:
- imageColumnStdWrap.dataWrap = <div class="csc-textpic-imagecolumn" style="width:{register:columnwidth}px;"> | </div>
-
- layout = CASE
- layout {
- key.field = imageorient
- # above-center
- default = TEXT
- default.value = <div class="csc-textpic csc-textpic-center csc-textpic-above###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div>
- # above-right
- 1 = TEXT
- 1.value = <div class="csc-textpic csc-textpic-right csc-textpic-above###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div>
- # above-left
- 2 = TEXT
- 2.value = <div class="csc-textpic csc-textpic-left csc-textpic-above###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div>
- # below-center
- 8 = TEXT
- 8.value = <div class="csc-textpic csc-textpic-center csc-textpic-below###CLASSES###">###TEXT######IMAGES###</div><div class="csc-textpic-clear"><!-- --></div>
- # below-right
- 9 = TEXT
- 9.value = <div class="csc-textpic csc-textpic-right csc-textpic-below###CLASSES###">###TEXT######IMAGES###</div><div class="csc-textpic-clear"><!-- --></div>
- # below-left
- 10 = TEXT
- 10.value = <div class="csc-textpic csc-textpic-left csc-textpic-below###CLASSES###">###TEXT######IMAGES###</div><div class="csc-textpic-clear"><!-- --></div>
- # intext-right
- 17 = TEXT
- 17.value = <div class="csc-textpic csc-textpic-intext-right###CLASSES###">###IMAGES######TEXT###</div>
- 17.override = <div class="csc-textpic csc-textpic-intext-right###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div>
- 17.override.if.isTrue = {$styles.content.imgtext.addIntextClearer}
- # intext-left
- 18 = TEXT
- 18.value = <div class="csc-textpic csc-textpic-intext-left###CLASSES###">###IMAGES######TEXT###</div>
- 18.override = <div class="csc-textpic csc-textpic-intext-left###CLASSES###">###IMAGES######TEXT###</div><div class="csc-textpic-clear"><!-- --></div>
- 18.override.if.isTrue = {$styles.content.imgtext.addIntextClearer}
- # intext-right-nowrap
- 25 = TEXT
- 25.value = <div class="csc-textpic csc-textpic-intext-right-nowrap###CLASSES###">###IMAGES###<div style="margin-right:{register:rowWidthPlusTextMargin}px;">###TEXT###</div></div><div class="csc-textpic-clear"><!-- --></div>
- 25.insertData = 1
- # intext-left-nowrap
- 26 = TEXT
- 26.value = <div class="csc-textpic csc-textpic-intext-left-nowrap###CLASSES###">###IMAGES###<div style="margin-left:{register:rowWidthPlusTextMargin}px;">###TEXT###</div></div><div class="csc-textpic-clear"><!-- --></div>
- 26.insertData = 1
- }
-
- rendering {
- dl {
- # Choose another rendering for special edge cases
- fallbackRendering = COA
- fallbackRendering {
- # Just one image without a caption => don't need the dl-overhead, use the "simple" rendering
- 10 = TEXT
- 10 {
- if {
- isFalse.field = imagecaption
- value = 1
- equals.data = register:imageCount
- }
- value = simple
- }
-
- # Multiple images and one global caption => "ul"
- 20 = TEXT
- 20 {
- if {
- value = 1
- isGreaterThan.data = register:imageCount
- isTrue.if.isTrue.data = register:renderGlobalCaption
- isTrue.field = imagecaption
- }
- value = ul
- }
-
- # Multiple images and no caption at all => "ul"
- 30 = TEXT
- 30 {
- if {
- value = 1
- isGreaterThan.data = register:imageCount
- isFalse.field = imagecaption
- }
- value = ul
- }
- }
- imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow" style="width:{register:rowwidth}px;"> | </div>
- imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last" style="width:{register:rowwidth}px;"> | </div>
- noRowsStdWrap.wrap =
- oneImageStdWrap.dataWrap = <dl class="csc-textpic-image###CLASSES###" style="width:{register:imagespace}px;"> | </dl>
- imgTagStdWrap.wrap = <dt> | </dt>
- editIconsStdWrap.wrap = <dd> | </dd>
- caption {
- required = 1
- wrap = <dd class="csc-textpic-caption"> | </dd>
- }
- }
- ul {
- # Just one image without a caption => don't need the ul-overhead, use the "simple" rendering
- fallbackRendering < tt_content.image.20.rendering.dl.fallbackRendering.10
- imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow" style="width:{register:rowwidth}px;"><ul> | </ul></div>
- imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last" style="width:{register:rowwidth}px;"><ul> | </ul></div>
- noRowsStdWrap.wrap = <ul> | </ul>
- oneImageStdWrap.dataWrap = <li class="csc-textpic-image###CLASSES###" style="width:{register:imagespace}px;"> | </li>
- imgTagStdWrap.wrap =
- editIconsStdWrap.wrap = <div> | </div>
- caption.wrap = <div class="csc-textpic-caption"> | </div>
- }
- div {
- # Just one image without a caption => don't need the div-overhead, use the "simple" rendering
- fallbackRendering < tt_content.image.20.rendering.dl.fallbackRendering.10
- imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow" style="width:{register:rowwidth}px;"> | </div>
- imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last" style="width:{register:rowwidth}px;"> | </div>
- noRowsStdWrap.wrap =
- oneImageStdWrap.dataWrap = <div class="csc-textpic-image###CLASSES###" style="width:{register:imagespace}px;"> | </div>
- imgTagStdWrap.wrap = <div> | </div>
- editIconsStdWrap.wrap = <div> | </div>
- caption.wrap = <div class="csc-textpic-caption"> | </div>
- }
- simple {
- imageRowStdWrap.dataWrap = |
- imageLastRowStdWrap.dataWrap = |
- noRowsStdWrap.wrap =
- oneImageStdWrap.dataWrap = |
- imgTagStdWrap.wrap = |
- editIconsStdWrap.wrap = |
- caption.wrap = <div class="csc-textpic-caption"> | </div>
- imageStdWrap.dataWrap = <div class="csc-textpic-imagewrap csc-textpic-single-image" style="width:{register:totalwidth}px;"> | </div>
- imageStdWrapNoWidth.wrap = <div class="csc-textpic-imagewrap csc-textpic-single-image"> | </div>
- }
- }
- renderMethod = dl
-
- editIcons = tt_content : image [imageorient|imagewidth|imageheight], [imagecols|image_noRows|imageborder],[image_link|image_zoom],[image_compression|image_effects|image_frames],imagecaption[imagecaption_position]
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.images
-
- caption.editIcons = tt_content : imagecaption[imagecaption_position]
- caption.editIcons.beforeLastTag=1
- caption.editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.caption
-
- stdWrap.prefixComment = 2 | Image block:
-}
-
-# *****************
-# CType: textpic
-# *****************
-tt_content.textpic = COA
-tt_content.textpic {
- 10 = COA
- 10.if.value = 25
- 10.if.isLessThan.field = imageorient
- 10.10 = < lib.stdheader
-
- 20 = < tt_content.image.20
- 20 {
- text.10 = COA
- text.10 {
- if.value = 24
- if.isGreaterThan.field = imageorient
- 10 = < lib.stdheader
- 10.stdWrap.dataWrap = <div class="csc-textpicHeader csc-textpicHeader-{field:imageorient}">|</div>
- }
- text.20 = < tt_content.text.20
- text.wrap = <div class="csc-textpic-text"> | </div>
- }
-}
-
-
-
-# *****************
-# CType: bullet
-# *****************
-tt_content.bullets = COA
-tt_content.bullets {
- 10 = < lib.stdheader
-
- 20 = TEXT
- 20 {
- field = bodytext
- trim = 1
- split{
- token.char = 10
- cObjNum = |*|1|| 2|*|
- 1.current = 1
- 1.parseFunc =< lib.parseFunc
- 1.wrap = <li class="odd">|</li>
-
- 2.current = 1
- 2.parseFunc =< lib.parseFunc
- 2.wrap = <li class="even">|</li>
- }
- dataWrap = <ul class="csc-bulletlist csc-bulletlist-{field:layout}">|</ul>
- editIcons = tt_content: bodytext, [layout]
- editIcons.beforeLastTag = 1
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.php:eIcon.bullets
-
- prefixComment = 2 | Bullet list:
- }
-}
-
-
-
-# *****************
-# CType: table
-# *****************
-# Rendered by a PHP function specifically written to handle CE tables. See css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
-tt_content.table = COA
-tt_content.table {
- 10 = < lib.stdheader
-
- 20 = USER
- 20.userFunc = tx_cssstyledcontent_pi1->render_table
- 20.field = bodytext
-
- 20.color {
- default =
- 1 = #EDEBF1
- 2 = #F5FFAA
- }
- 20.tableParams_0 {
- border =
- cellpadding =
- cellspacing =
- }
- 20.tableParams_1 {
- border =
- cellpadding =
- cellspacing =
- }
- 20.tableParams_2 {
- border =
- cellpadding =
- cellspacing =
- }
- 20.tableParams_3 {
- border =
- cellpadding =
- cellspacing =
- }
- 20.innerStdWrap.wrap = |
- 20.innerStdWrap.parseFunc = < lib.parseFunc
-
- 20.stdWrap {
- editIcons = tt_content: cols, bodytext, [layout], [table_bgColor|table_border|table_cellspacing|table_cellpadding]
- editIcons.beforeLastTag = 1
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.table
-
- prefixComment = 2 | Table:
- }
-}
-
-
-# *****************
-# CType: uploads
-# *****************
-# Rendered by a PHP function specifically written to handle CE filelists. See css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
-tt_content.uploads = COA
-tt_content.uploads {
- 10 = < lib.stdheader
-
- 20 = USER
- 20.userFunc = tx_cssstyledcontent_pi1->render_uploads
- 20.field = media
- 20.filePath.field = select_key
-
- 20 {
- # Rendering for each file (e.g. rows of the table) as a cObject
- itemRendering = COA
- itemRendering {
- wrap = <tr class="tr-odd tr-first">|</tr> |*| <tr class="tr-even">|</tr> || <tr class="tr-odd">|</tr> |*|
-
- 10 = TEXT
- 10.data = register:linkedIcon
- 10.wrap = <td class="csc-uploads-icon">|</td>
- 10.if.isPositive.field = layout
-
- 20 = COA
- 20.wrap = <td class="csc-uploads-fileName">|</td>
- 20.1 = TEXT
- 20.1 {
- data = register:linkedLabel
- wrap = <p>|</p>
- }
- 20.2 = TEXT
- 20.2 {
- data = register:description
- wrap = <p class="csc-uploads-description">|</p>
- required = 1
- htmlSpecialChars = 1
- }
-
- 30 = TEXT
- 30.if.isTrue.field = filelink_size
- 30.data = register:fileSize
- 30.wrap = <td class="csc-uploads-fileSize">|</td>
- 30.bytes = 1
- 30.bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
- }
- useSpacesInLinkText = 0
- stripFileExtensionFromLinkText = 0
- }
-
- 20.color {
- default =
- 1 = #EDEBF1
- 2 = #F5FFAA
- }
- 20.tableParams_0 {
- border =
- cellpadding =
- cellspacing =
- }
- 20.tableParams_1 {
- border =
- cellpadding =
- cellspacing =
- }
- 20.tableParams_2 {
- border =
- cellpadding =
- cellspacing =
- }
- 20.tableParams_3 {
- border =
- cellpadding =
- cellspacing =
- }
-
- 20.linkProc {
- target = _blank
- jumpurl = {$styles.content.uploads.jumpurl}
- jumpurl.secure = {$styles.content.uploads.jumpurl_secure}
- jumpurl.secure.mimeTypes = {$styles.content.uploads.jumpurl_secure_mimeTypes}
- removePrependedNumbers = 1
-
- iconCObject = IMAGE
- iconCObject.file.import.data = register : ICON_REL_PATH
- iconCObject.file.width = 150
- }
-
- 20.filesize {
- bytes = 1
- bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
- }
-
- 20.stdWrap {
- editIcons = tt_content: media, layout [table_bgColor|table_border|table_cellspacing|table_cellpadding], filelink_size, imagecaption
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.filelist
-
- prefixComment = 2 | File list:
- }
-}
-
-
-# ******************
-# CType: multimedia
-# ******************
-tt_content.multimedia = COA
-tt_content.multimedia {
- 10 = < lib.stdheader
-
- 20 = MULTIMEDIA
- 20.file.field = multimedia
- 20.file.wrap = uploads/media/
- 20.file.listNum = 0
- 20.params.field = bodytext
-
- 20.stdWrap {
- editIcons = tt_content: multimedia, bodytext
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia
-
- prefixComment = 2 | Multimedia element:
- }
-}
-
-# *****************
-# CType: swfobject
-# *****************
-tt_content.swfobject = COA
-tt_content.swfobject {
- 10 = < lib.stdheader
-
- 20 = SWFOBJECT
- 20 {
- file =
- width =
- height =
-
- flexParams.field = pi_flexform
-
- alternativeContent.field = bodytext
-
- layout = ###SWFOBJECT###
-
- video {
- player = {$styles.content.media.videoPlayer}
-
- defaultWidth = {$styles.content.media.defaultVideoWidth}
- defaultHeight = {$styles.content.media.defaultVideoHeight}
-
- default {
- params.quality = high
- params.menu = false
- params.allowScriptAccess = sameDomain
- params.allowFullScreen = true
- }
- mapping {
-
- }
- }
-
- audio {
- player = {$styles.content.media.audioPlayer}
-
- defaultWidth = {$styles.content.media.defaultAudioWidth}
- defaultHeight = {$styles.content.media.defaultAudioHeight}
-
- default {
- params.quality = high
- params.allowScriptAccess = sameDomain
- params.menu = false
- }
- mapping {
- flashvars.file = soundFile
- }
- }
-
- }
- 20.stdWrap {
- editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia
-
- prefixComment = 2 | SWFobject element:
- }
-}
-
-# *****************
-# CType: qtobject
-# *****************
-tt_content.qtobject = COA
-tt_content.qtobject {
- 10 = < lib.stdheader
-
- 20 = QTOBJECT
- 20 {
- file =
- width =
- height =
-
- flexParams.field = pi_flexform
-
- alternativeContent.field = bodytext
-
- layout = ###QTOBJECT###
-
- video {
- player = {$styles.content.media.videoPlayer}
-
- defaultWidth = {$styles.content.media.defaultVideoWidth}
- defaultHeight = {$styles.content.media.defaultVideoHeight}
-
- default {
- params.quality = high
- params.menu = false
- params.allowScriptAccess = sameDomain
- params.allowFullScreen = true
- }
- mapping {
-
- }
- }
-
- audio {
- player = {$styles.content.media.audioPlayer}
-
- defaultWidth = {$styles.content.media.defaultAudioWidth}
- defaultHeight = {$styles.content.media.defaultAudioHeight}
-
- default {
- params.quality = high
- params.allowScriptAccess = sameDomain
- params.menu = false
- }
- mapping {
- flashvars.file = soundFile
- }
- }
- }
- 20.stdWrap {
- editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia
-
- prefixComment = 2 | QTobject element:
- }
-}
-
-# *****************
-# CType: media
-# *****************
-tt_content.media = COA
-tt_content.media {
- 10 = < lib.stdheader
-
- 20 = MEDIA
- 20 {
-
- flexParams.field = pi_flexform
- alternativeContent < tt_content.text.20
- alternativeContent.field = bodytext
-
- type = video
- renderType = auto
- allowEmptyUrl = 0
- forcePlayer = 1
-
- fileExtHandler {
- default = MEDIA
- avi = MEDIA
- asf = MEDIA
- class = MEDIA
- wmv = MEDIA
- mp3 = SWF
- mp4 = SWF
- m4v = SWF
- swa = SWF
- flv = SWF
- swf = SWF
- mov = QT
- m4v = QT
- m4a = QT
- }
-
- mimeConf.swfobject < tt_content.swfobject.20
- mimeConf.qtobject < tt_content.qtobject.20
-
- }
- 20.stdWrap {
- editIcons = tt_content: pi_flexform, bodytext
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia
-
- prefixComment = 2 | Media element:
- }
-}
-
-# ******************
-# CType: mailform
-# ******************
-tt_content.mailform = COA
-tt_content.mailform.10 = < lib.stdheader
-tt_content.mailform.20 = FORM
-tt_content.mailform.20 {
- accessibility = 1
- noWrapAttr=1
- formName = mailform
- dontMd5FieldNames = 1
- layout = <div class="csc-mailform-field">###LABEL### ###FIELD###</div>
- labelWrap.wrap = |
- commentWrap.wrap = |
- radioWrap.wrap = |<br />
- radioWrap.accessibilityWrap = <fieldset###RADIO_FIELD_ID###><legend>###RADIO_GROUP_LABEL###</legend>|</fieldset>
- REQ = 1
- REQ.labelWrap.wrap = |
- COMMENT.layout = <div class="csc-mailform-label">###LABEL###</div>
- RADIO.layout = <div class="csc-mailform-field">###LABEL### <span class="csc-mailform-radio">###FIELD###</span></div>
- LABEL.layout = <div class="csc-mailform-field">###LABEL### <span class="csc-mailform-label">###FIELD###</span></div>
- target = {$styles.content.mailform.target}
- goodMess = {$styles.content.mailform.goodMess}
- badMess = {$styles.content.mailform.badMess}
- redirect.field = pages
- redirect.listNum = 0
- recipient.field = subheader
- data.field = bodytext
- locationData = 1
- hiddenFields.stdWrap.wrap = <div style="display:none;">|</div>
-
- params.radio = class="csc-mailform-radio"
- params.check = class="csc-mailform-check"
- params.submit = class="csc-mailform-submit"
-
- stdWrap.wrap = <fieldset class="csc-mailform"> | </fieldset>
- stdWrap {
- editIcons = tt_content: bodytext, pages, subheader
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.form
-
- prefixComment = 2 | Mail form inserted:
- }
-}
-
-
-# ******************
-# CType: search
-# ******************
-tt_content.search = COA
-tt_content.search.10 = < lib.stdheader
-# Result:
-tt_content.search.20 = SEARCHRESULT
-tt_content.search.20 {
- allowedCols = pages.title-subtitle-keywords-description : tt_content.header-bodytext-imagecaption : tt_address.name-title-address-email-company-city-country : tt_links.title-note-note2-url : tt_board.subject-message-author-email : tt_calender.title-note : tt_products.title-note-itemnumber
- languageField.tt_content = sys_language_uid
- renderObj = COA
- renderObj {
-
- 10 = TEXT
- 10.field = pages_title
- 10.htmlSpecialChars = 1
- 10.typolink {
- parameter.field = uid
- target = {$styles.content.searchresult.resultTarget}
- additionalParams.data = register:SWORD_PARAMS
- additionalParams.required = 1
- additionalParams.wrap = &no_cache=1
- }
- 10.htmlSpecialChars = 1
- 10.wrap = <h3 class="csc-searchResultHeader">|</h3>
-
- 20 = COA
- 20 {
- 10 = TEXT
- 10.field = tt_content_bodytext
- 10.stripHtml = 1
- 10.htmlSpecialChars = 1
- }
- 20.stdWrap.crop = 200 | ...
- 20.stdWrap.wrap = <p class="csc-searchResult">|</p>
- }
-
- layout = COA
- layout {
- wrap = <table border="0" cellspacing="0" cellpadding="2" class="csc-searchResultInfo"><tr> | </tr></table> ###RESULT###
-
- 10 = TEXT
- 10.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.resultRange
- 10.wrap = <td class="csc-searchResultRange"><p>|</p></td>
-
- 20 = TEXT
- 20.value = ###PREV###&nbsp;&nbsp;&nbsp;###NEXT###
- 20.wrap = <td class="csc-searchResultPrevNext"><p>|</p></td>
- }
-
- noResultObj = COA
- noResultObj {
- 10 = TEXT
- 10.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.emptySearch
- 10.wrap = <h3 class="csc-noSearchResultMsg">|</h3>
- }
-
- next = TEXT
- next.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchResultNext
-
- prev = TEXT
- prev.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchResultPrev
-
- target = {$styles.content.searchresult.target}
- range = 20
-
- stdWrap.prefixComment = 2 | Search result:
-}
-
-# Form:
-tt_content.search.30 < tt_content.mailform.20
-tt_content.search.30 {
- goodMess = {$styles.content.searchform.goodMess}
- redirect >
- recipient >
- data >
- dataArray {
- 10.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchWord
- 10.type = sword=input
- 20.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchIn
- 20.type = scols=select
- 20.valueArray {
- 10.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.headersKeywords
- 10.value = pages.title-subtitle-keywords-description:tt_content.header
- 20.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.pageContent
- 20.value = tt_content.header-bodytext-imagecaption
- }
- 30.type = stype=hidden
- 30.value = L0
- 40.type = submit=submit
- 40.value.data = LLL:EXT:css_styled_content/pi1/locallang.xml:search.searchButton
- }
- type.field = pages
- type.listNum = 0
- locationData = HTTP_POST_VARS
- no_cache = 1
-
- stdWrap.wrap = <table border="0" cellspacing="1" cellpadding="1" class="csc-searchform"> | </table>
- stdWrap {
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.search
-
- prefixComment = 2 | Search form inserted:
- }
-}
-
-
-# ******************
-# CType: login
-# ******************
-tt_content.login < tt_content.mailform
-tt_content.login.10 = < lib.stdheader
-tt_content.login.20 {
- goodMess = {$styles.content.loginform.goodMess}
- redirect >
- recipient >
- data >
- dataArray {
- 10.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.username
- 10.type = *user=input
- 20.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.password
- 20.type = *pass=password
- 30.type = logintype=hidden
- 30.value = login
- 40.type = submit=submit
- 40.value.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.login
- }
- type.field = pages
- type.listNum = 0
- target = {$styles.content.loginform.target}
- locationData = 0
- hiddenFields.pid = TEXT
- hiddenFields.pid {
- value = {$styles.content.loginform.pid}
- override.field = pages
- override.listNum = 1
- }
-
- stdWrap.wrap = <div class="csc-loginform"> | </div>
- stdWrap {
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.login
-
- prefixComment = 2 | Login/Logout form:
- }
-}
-[loginUser = *]
-tt_content.login.20 {
- dataArray >
- dataArray {
- 10.label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.username
- 10.label.wrap = |&nbsp;<!--###USERNAME###-->
- 30.type = logintype=hidden
- 30.value = logout
- 40.type = submit=submit
- 40.value.data = LLL:EXT:css_styled_content/pi1/locallang.xml:login.logout
- }
-}
-[global]
-
-
-# ******************
-# CType: splash
-# ******************
-# Deprecated element.
-# Still here for backwards compliance with plugins using the "text box" type.
-tt_content.splash = CASE
-tt_content.splash.key.field = splash_layout
-tt_content.splash.stdWrap {
- prefixComment = 2 | Textbox inserted (Deprecated)
-}
-tt_content.splash.default = COA
-tt_content.splash.default {
- 20 = CTABLE
- 20 {
- c.1 = < tt_content.text
- lm.1 = IMAGE
- lm.1.file {
- import = uploads/pics/
- import.field = image
- import.listNum = 0
- maxW.field = imagewidth
- maxW.ifEmpty = 200
- }
- cMargins = 30,0,0,0
- }
-}
-tt_content.splash.1 < tt_content.splash.default
-tt_content.splash.1.20.lm.1.file >
-tt_content.splash.1.20.lm.1.file = GIFBUILDER
-tt_content.splash.1.20.lm.1.file {
- XY = [10.w]+10,[10.h]+10
- backColor = {$content.splash.bgCol}
- backColor.override.data = register:pageColor
- format = jpg
- 5 = BOX
- 5.dimensions = 3,3,[10.w],[10.h]
- 5.color = #333333
- 7 = EFFECT
- 7.value = blur=99|blur=99|blur=99|blur=99|blur=99|blur=99|blur=99
- 10 = IMAGE
- 10.file {
- import = uploads/pics/
- import.field = image
- import.listNum = 0
- maxW.field = imagewidth
- maxW.ifEmpty = 200
- }
-}
-// The image frames are not available unless TypoScript code from styles.content.imgFrames.x is provided manually:
-tt_content.splash.2 < tt_content.splash.default
-#tt_content.splash.2.20.lm.1.file.m < styles.content.imgFrames.1
-tt_content.splash.3 < tt_content.splash.default
-#tt_content.splash.3.20.lm.1.file.m < styles.content.imgFrames.2
-
-// From plugin.postit1, if included:
-tt_content.splash.20 = < plugin.postit1
-
-
-
-# ****************
-# CType: menu
-# ****************
-tt_content.menu = COA
-tt_content.menu {
- 10 = < lib.stdheader
-
- 20 = CASE
- 20 {
- key.field = menu_type
-
- # "Menu of these pages"
- default = HMENU
- default {
- special = list
- special.value.field = pages
- wrap = <ul class="csc-menu csc-menu-def">|</ul>
- 1 = TMENU
- 1 {
- target = {$PAGE_TARGET}
- NO {
- stdWrap.htmlSpecialChars = 1
- wrapItemAndSub = <li>|</li>
- ATagTitle.field = description // title
- }
- noBlur = 1
- }
- }
-
- # "Menu of subpages to these pages"
- 1 < .default
- 1 {
- special = directory
- wrap = <ul class="csc-menu csc-menu-1">|</ul>
- }
-
- # "Sitemap - liststyle"
- 2 = HMENU
- 2 {
- wrap = <div class="csc-sitemap">|</div>
- 1 = TMENU
- 1 {
- target = {$PAGE_TARGET}
- noBlur = 1
- expAll = 1
- wrap = <ul>|</ul>
- NO {
- stdWrap.htmlSpecialChars = 1
- wrapItemAndSub = <li>|</li>
- ATagTitle.field = description // title
- }
- }
- 2 < .1
- 3 < .1
- 4 < .1
- 5 < .1
- 6 < .1
- 7 < .1
- }
-
- # "Section index (pagecontent w/Index checked - liststyle)"
- 3 < styles.content.get
- 3 {
- wrap = <ul class="csc-menu csc-menu-3">|</ul>
- select.andWhere = sectionIndex!=0
- select.pidInList.override.field = pages
- renderObj = TEXT
- renderObj {
- fieldRequired = header
- trim = 1
- field = header
- htmlSpecialChars = 1
- noBlur = 1
- wrap = <li class="csc-section">|</li>
- typolink.parameter.field = pid
- typolink.section.field = uid
- }
- }
-
- # "Menu of subpages to these pages (with abstract)"
- 4 < .1
- 4 {
- wrap = <dl class="csc-menu csc-menu-4">|</dl>
- 1.NO {
- wrapItemAndSub >
- linkWrap = <dt>|</dt>
- after {
- data = field : abstract // field : description // field : subtitle
- required = 1
- htmlSpecialChars = 1
- wrap = <dd>|</dd>
- }
- ATagTitle.field = description // title
- }
- }
-
- # "Recently updated pages"
- 5 < .default
- 5 {
- wrap = <ul class="csc-menu csc-menu-5">|</ul>
- special = updated
- special {
- maxAge = 3600*24*7
- excludeNoSearchPages = 1
- }
- }
-
- # "Related pages (based on keywords)"
- 6 < .default
- 6 {
- wrap = <ul class="csc-menu csc-menu-6">|</ul>
- special = keywords
- special {
- excludeNoSearchPages = 1
- }
- }
-
- # "Menu of subpages to these pages + sections - liststyle"
- 7 < .1
- 7 {
- wrap = <ul class="csc-menu csc-menu-7">|</ul>
- 1.expAll = 1
- 2 < .1
- 2 {
- sectionIndex = 1
- sectionIndex.type = header
- wrap = <ul>|</ul>
- NO.wrapItemAndSub = <li class="csc-section">|</li>
- }
- }
- }
-
- 20.stdWrap {
- editIcons = tt_content: menu_type, pages
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.menuSitemap
-
- prefixComment = 2 | Menu/Sitemap element:
- }
-}
-
-
-
-# ****************
-# CType: shortcut
-# ****************
-# Should be a complete copy from the old static template "content (default)"
-tt_content.shortcut = COA
-tt_content.shortcut {
- 20 = CASE
- 20.key.field = layout
- 20.0= RECORDS
- 20.0 {
- source.field = records
- tables = {$content.shortcut.tables}
- # THESE are OLD plugins. Modern plugins registers themselves automatically!
- conf.tt_content = < tt_content
- conf.tt_address = < tt_address
- conf.tt_links = < tt_links
- conf.tt_guest = < tt_guest
- conf.tt_board = < tt_board
- conf.tt_calender = < tt_calender
- conf.tt_rating < tt_rating
- conf.tt_products = < tt_products
- conf.tt_news = < tt_news
- conf.tt_poll = < plugin.tt_poll
- }
- 20.1= RECORDS
- 20.1 {
- source.field = records
- tables = {$content.shortcut.tables}
- conf.tt_poll = < plugin.tt_poll
- conf.tt_poll.code = RESULT,SUBMITTEDVOTE
- }
-
- 20.stdWrap {
- editIcons = tt_content: records
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.recordList
-
- prefixComment = 2 | Inclusion of other records (by reference):
- }
-}
-
-
-# ****************
-# CType: list
-# ****************
-# Should be a complete copy from the old static template "content (default)" (except "lib.stdheader")
-tt_content.list = COA
-tt_content.list {
- 10 = < lib.stdheader
-
- 20 = CASE
- 20.key.field = list_type
- 20 {
- # LIST element references (NOT copy of objects!)
- # THESE are OLD plugins. Modern plugins registers themselves automatically!
- 3 = CASE
- 3.key.field = layout
- 3.0 = < plugin.tt_guest
-
- 4 = CASE
- 4.key.field = layout
- 4.0 = < plugin.tt_board_list
- 4.1 = < plugin.tt_board_tree
-
- 2 = CASE
- 2.key.field = layout
- 2.0 = < plugin.tt_board_tree
-
- 5 = CASE
- 5.key.field = layout
- 5.0 = < plugin.tt_products
-
- 7 = CASE
- 7.key.field = layout
- 7.0 = < plugin.tt_calender
-
- 8 = CASE
- 8.key.field = layout
- 8.0 = < plugin.tt_rating
-
- 9 = CASE
- 9.key.field = layout
- 9.0 = < plugin.tt_news
-
- 11 = CASE
- 11.key.field = layout
- 11.0 = < plugin.tipafriend
-
- 20 = CASE
- 20.key.field = layout
- 20.0 = < plugin.feadmin.fe_users
-
- 21 = CASE
- 21.key.field = layout
- 21.0 = < plugin.feadmin.dmailsubscription
- }
-
- 20.stdWrap {
- editIcons = tt_content: list_type, layout, select_key, pages [recursive]
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.plugin
-
- prefixComment = 2 | Plugin inserted:
- }
-}
-
-
-# ****************
-# CType: script
-# ****************
-# OBSOLETE! Please make extensions instead. The "script" content element was meant for these custom purposes in the past. Today extensions will do the job better.
-tt_content.script = TEXT
-tt_content.script {
- value =
-
- prefixComment = 2 | Script element (Deprecated)
-}
-
-
-# ****************
-# CType: div
-# ****************
-tt_content.div = TEXT
-tt_content.div {
- value = <hr />
- wrap = <div class="divider">|</div>
- prefixComment = 2 | Div element
-}
-
-
-# ****************
-# CType: html
-# ****************
-# This truely IS a content object, launched from inside the PHP class of course.
-# Should be a complete copy from the old static template "content (default)"
-tt_content.html = TEXT
-tt_content.html {
- field = bodytext
-
- editIcons = tt_content: pages
- editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.html
-
- prefixComment = 2 | Raw HTML content:
-}
-
-
-# ****************
-# Default error msg:
-# ****************
-tt_content.default = TEXT
-tt_content.default {
- field = CType
- wrap = <p style="background-color: yellow;"><b>ERROR:</b> Content Element type "|" has no rendering definition!</p>
-
- prefixComment = 2 | Unknown element message:
-}
-
-# *********************************************************************
-# ACCESSIBILTY MODE
-# *********************************************************************
-
-
-
-
-
-
-
-plugin.tx_cssstyledcontent._CSS_DEFAULT_STYLE (
- /* Captions */
- DIV.csc-textpic-caption-c .csc-textpic-caption { text-align: center; }
- DIV.csc-textpic-caption-r .csc-textpic-caption { text-align: right; }
- DIV.csc-textpic-caption-l .csc-textpic-caption { text-align: left; }
-
- /* Needed for noRows setting */
- DIV.csc-textpic DIV.csc-textpic-imagecolumn { float: left; display: inline; }
-
- /* Border just around the image */
- {$styles.content.imgtext.borderSelector} {
- border: {$styles.content.imgtext.borderThick}px solid {$styles.content.imgtext.borderColor};
- padding: {$styles.content.imgtext.borderSpace}px {$styles.content.imgtext.borderSpace}px;
- }
-
- DIV.csc-textpic-imagewrap { padding: 0; }
-
- DIV.csc-textpic IMG { border: none; }
-
- /* DIV: This will place the images side by side */
- DIV.csc-textpic DIV.csc-textpic-imagewrap DIV.csc-textpic-image { float: left; }
-
- /* UL: This will place the images side by side */
- DIV.csc-textpic DIV.csc-textpic-imagewrap UL { list-style: none; margin: 0; padding: 0; }
- DIV.csc-textpic DIV.csc-textpic-imagewrap UL LI { float: left; margin: 0; padding: 0; }
-
- /* DL: This will place the images side by side */
- DIV.csc-textpic DIV.csc-textpic-imagewrap DL.csc-textpic-image { float: left; }
- DIV.csc-textpic DIV.csc-textpic-imagewrap DL.csc-textpic-image DT { float: none; }
- DIV.csc-textpic DIV.csc-textpic-imagewrap DL.csc-textpic-image DD { float: none; }
- DIV.csc-textpic DIV.csc-textpic-imagewrap DL.csc-textpic-image DD IMG { border: none; } /* FE-Editing Icons */
- DL.csc-textpic-image { margin: 0; }
- DL.csc-textpic-image DT { margin: 0; display: inline; }
- DL.csc-textpic-image DD { margin: 0; }
-
- /* Clearer */
- DIV.csc-textpic-clear { clear: both; }
-
- /* Margins around images: */
-
- /* Pictures on left, add margin on right */
- DIV.csc-textpic-left DIV.csc-textpic-imagewrap .csc-textpic-image,
- DIV.csc-textpic-intext-left-nowrap DIV.csc-textpic-imagewrap .csc-textpic-image,
- DIV.csc-textpic-intext-left DIV.csc-textpic-imagewrap .csc-textpic-image {
- display: inline; /* IE fix for double-margin bug */
- margin-right: {$styles.content.imgtext.colSpace}px;
- }
-
- /* Pictures on right, add margin on left */
- DIV.csc-textpic-right DIV.csc-textpic-imagewrap .csc-textpic-image,
- DIV.csc-textpic-intext-right-nowrap DIV.csc-textpic-imagewrap .csc-textpic-image,
- DIV.csc-textpic-intext-right DIV.csc-textpic-imagewrap .csc-textpic-image {
- display: inline; /* IE fix for double-margin bug */
- margin-left: {$styles.content.imgtext.colSpace}px;
- }
-
- /* Pictures centered, add margin on left */
- DIV.csc-textpic-center DIV.csc-textpic-imagewrap .csc-textpic-image {
- display: inline; /* IE fix for double-margin bug */
- margin-left: {$styles.content.imgtext.colSpace}px;
- }
- DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-image .csc-textpic-caption { margin: 0; }
- DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-image IMG { margin: 0; vertical-align:bottom; }
-
- /* Space below each image (also in-between rows) */
- DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-image { margin-bottom: {$styles.content.imgtext.rowSpace}px; }
- DIV.csc-textpic-equalheight DIV.csc-textpic-imagerow { margin-bottom: {$styles.content.imgtext.rowSpace}px; display: block; }
- DIV.csc-textpic DIV.csc-textpic-imagerow { clear: both; }
- DIV.csc-textpic DIV.csc-textpic-single-image IMG { margin-bottom: {$styles.content.imgtext.rowSpace}px; }
-
- /* IE7 hack for margin between image rows */
- *+html DIV.csc-textpic DIV.csc-textpic-imagerow .csc-textpic-image { margin-bottom: 0; }
- *+html DIV.csc-textpic DIV.csc-textpic-imagerow { margin-bottom: {$styles.content.imgtext.rowSpace}px; }
-
- /* No margins around the whole image-block */
- DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-firstcol { margin-left: 0px !important; }
- DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-lastcol { margin-right: 0px !important; }
-
- /* Add margin from image-block to text (in case of "Text w/ images") */
- DIV.csc-textpic-intext-left DIV.csc-textpic-imagewrap,
- DIV.csc-textpic-intext-left-nowrap DIV.csc-textpic-imagewrap {
- margin-right: {$styles.content.imgtext.textMargin}px !important;
- }
- DIV.csc-textpic-intext-right DIV.csc-textpic-imagewrap,
- DIV.csc-textpic-intext-right-nowrap DIV.csc-textpic-imagewrap {
- margin-left: {$styles.content.imgtext.textMargin}px !important;
- }
-
- /* Positioning of images: */
-
- /* Above */
- DIV.csc-textpic-above DIV.csc-textpic-text { clear: both; }
-
- /* Center (above or below) */
- DIV.csc-textpic-center { text-align: center; /* IE-hack */ }
- DIV.csc-textpic-center DIV.csc-textpic-imagewrap { margin: 0 auto; }
- DIV.csc-textpic-center DIV.csc-textpic-imagewrap .csc-textpic-image { text-align: left; /* Remove IE-hack */ }
- DIV.csc-textpic-center DIV.csc-textpic-text { text-align: left; /* Remove IE-hack */ }
-
- /* Right (above or below) */
- DIV.csc-textpic-right DIV.csc-textpic-imagewrap { float: right; }
- DIV.csc-textpic-right DIV.csc-textpic-text { clear: right; }
-
- /* Left (above or below) */
- DIV.csc-textpic-left DIV.csc-textpic-imagewrap { float: left; }
- DIV.csc-textpic-left DIV.csc-textpic-text { clear: left; }
-
- /* Left (in text) */
- DIV.csc-textpic-intext-left DIV.csc-textpic-imagewrap { float: left; }
-
- /* Right (in text) */
- DIV.csc-textpic-intext-right DIV.csc-textpic-imagewrap { float: right; }
-
- /* Right (in text, no wrap around) */
- DIV.csc-textpic-intext-right-nowrap DIV.csc-textpic-imagewrap { float: right; clear: both; }
- /* Hide from IE5-mac. Only IE-win sees this. \*/
- * html DIV.csc-textpic-intext-right-nowrap .csc-textpic-text { height: 1%; }
- /* End hide from IE5/mac */
-
- /* Left (in text, no wrap around) */
- DIV.csc-textpic-intext-left-nowrap DIV.csc-textpic-imagewrap { float: left; clear: both; }
- /* Hide from IE5-mac. Only IE-win sees this. \*/
- * html DIV.csc-textpic-intext-left-nowrap .csc-textpic-text,
- * html .csc-textpic-intext-left ol,
- * html .csc-textpic-intext-left ul { height: 1%; }
- /* End hide from IE5/mac */
-
- DIV.csc-textpic DIV.csc-textpic-imagerow-last { margin-bottom: 0; }
-
- /* Browser fixes: */
-
- /* Fix for unordered and ordered list with image "In text, left" */
- .csc-textpic-intext-left ol, .csc-textpic-intext-left ul {padding-left: 40px; overflow: auto; }
-)
-
-# TYPO3 SVN ID: $Id$
-
diff --git a/tests/examplefiles/underscore.coffee b/tests/examplefiles/underscore.coffee
deleted file mode 100644
index a34a1ce8..00000000
--- a/tests/examplefiles/underscore.coffee
+++ /dev/null
@@ -1,603 +0,0 @@
-
- # Underscore.coffee
- # (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
- # Underscore is freely distributable under the terms of the MIT license.
- # Portions of Underscore are inspired by or borrowed from Prototype.js,
- # Oliver Steele's Functional, and John Resig's Micro-Templating.
- # For all details and documentation:
- # http://documentcloud.github.com/underscore/
-
-
- # ------------------------- Baseline setup ---------------------------------
-
- # Establish the root object, "window" in the browser, or "global" on the server.
- root: this
-
-
- # Save the previous value of the "_" variable.
- previousUnderscore: root._
-
-
- # If Underscore is called as a function, it returns a wrapped object that
- # can be used OO-style. This wrapper holds altered versions of all the
- # underscore functions. Wrapped objects may be chained.
- wrapper: (obj) ->
- this._wrapped: obj
- this
-
-
- # Establish the object that gets thrown to break out of a loop iteration.
- breaker: if typeof(StopIteration) is 'undefined' then '__break__' else StopIteration
-
-
- # Create a safe reference to the Underscore object forreference below.
- _: root._: (obj) -> new wrapper(obj)
-
-
- # Export the Underscore object for CommonJS.
- if typeof(exports) != 'undefined' then exports._: _
-
-
- # Create quick reference variables for speed access to core prototypes.
- slice: Array::slice
- unshift: Array::unshift
- toString: Object::toString
- hasOwnProperty: Object::hasOwnProperty
- propertyIsEnumerable: Object::propertyIsEnumerable
-
-
- # Current version.
- _.VERSION: '0.5.7'
-
-
- # ------------------------ Collection Functions: ---------------------------
-
- # The cornerstone, an each implementation.
- # Handles objects implementing forEach, arrays, and raw objects.
- _.each: (obj, iterator, context) ->
- index: 0
- try
- return obj.forEach(iterator, context) if obj.forEach
- if _.isArray(obj) or _.isArguments(obj)
- return iterator.call(context, obj[i], i, obj) for i in [0...obj.length]
- iterator.call(context, val, key, obj) for key, val of obj
- catch e
- throw e if e isnt breaker
- obj
-
-
- # Return the results of applying the iterator to each element. Use JavaScript
- # 1.6's version of map, if possible.
- _.map: (obj, iterator, context) ->
- return obj.map(iterator, context) if (obj and _.isFunction(obj.map))
- results: []
- _.each obj, (value, index, list) ->
- results.push(iterator.call(context, value, index, list))
- results
-
-
- # Reduce builds up a single result from a list of values. Also known as
- # inject, or foldl. Uses JavaScript 1.8's version of reduce, if possible.
- _.reduce: (obj, memo, iterator, context) ->
- return obj.reduce(_.bind(iterator, context), memo) if (obj and _.isFunction(obj.reduce))
- _.each obj, (value, index, list) ->
- memo: iterator.call(context, memo, value, index, list)
- memo
-
-
- # The right-associative version of reduce, also known as foldr. Uses
- # JavaScript 1.8's version of reduceRight, if available.
- _.reduceRight: (obj, memo, iterator, context) ->
- return obj.reduceRight(_.bind(iterator, context), memo) if (obj and _.isFunction(obj.reduceRight))
- _.each _.clone(_.toArray(obj)).reverse(), (value, index) ->
- memo: iterator.call(context, memo, value, index, obj)
- memo
-
-
- # Return the first value which passes a truth test.
- _.detect: (obj, iterator, context) ->
- result: null
- _.each obj, (value, index, list) ->
- if iterator.call(context, value, index, list)
- result: value
- _.breakLoop()
- result
-
-
- # Return all the elements that pass a truth test. Use JavaScript 1.6's
- # filter(), if it exists.
- _.select: (obj, iterator, context) ->
- if obj and _.isFunction(obj.filter) then return obj.filter(iterator, context)
- results: []
- _.each obj, (value, index, list) ->
- results.push(value) if iterator.call(context, value, index, list)
- results
-
-
- # Return all the elements for which a truth test fails.
- _.reject: (obj, iterator, context) ->
- results: []
- _.each obj, (value, index, list) ->
- results.push(value) if not iterator.call(context, value, index, list)
- results
-
-
- # Determine whether all of the elements match a truth test. Delegate to
- # JavaScript 1.6's every(), if it is present.
- _.all: (obj, iterator, context) ->
- iterator ||= _.identity
- return obj.every(iterator, context) if obj and _.isFunction(obj.every)
- result: true
- _.each obj, (value, index, list) ->
- _.breakLoop() unless (result: result and iterator.call(context, value, index, list))
- result
-
-
- # Determine if at least one element in the object matches a truth test. Use
- # JavaScript 1.6's some(), if it exists.
- _.any: (obj, iterator, context) ->
- iterator ||= _.identity
- return obj.some(iterator, context) if obj and _.isFunction(obj.some)
- result: false
- _.each obj, (value, index, list) ->
- _.breakLoop() if (result: iterator.call(context, value, index, list))
- result
-
-
- # Determine if a given value is included in the array or object,
- # based on '==='.
- _.include: (obj, target) ->
- return _.indexOf(obj, target) isnt -1 if _.isArray(obj)
- for key, val of obj
- return true if val is target
- false
-
-
- # Invoke a method with arguments on every item in a collection.
- _.invoke: (obj, method) ->
- args: _.rest(arguments, 2)
- (if method then val[method] else val).apply(val, args) for val in obj
-
-
- # Convenience version of a common use case of map: fetching a property.
- _.pluck: (obj, key) ->
- _.map(obj, ((val) -> val[key]))
-
-
- # Return the maximum item or (item-based computation).
- _.max: (obj, iterator, context) ->
- return Math.max.apply(Math, obj) if not iterator and _.isArray(obj)
- result: {computed: -Infinity}
- _.each obj, (value, index, list) ->
- computed: if iterator then iterator.call(context, value, index, list) else value
- computed >= result.computed and (result: {value: value, computed: computed})
- result.value
-
-
- # Return the minimum element (or element-based computation).
- _.min: (obj, iterator, context) ->
- return Math.min.apply(Math, obj) if not iterator and _.isArray(obj)
- result: {computed: Infinity}
- _.each obj, (value, index, list) ->
- computed: if iterator then iterator.call(context, value, index, list) else value
- computed < result.computed and (result: {value: value, computed: computed})
- result.value
-
-
- # Sort the object's values by a criteria produced by an iterator.
- _.sortBy: (obj, iterator, context) ->
- _.pluck(((_.map obj, (value, index, list) ->
- {value: value, criteria: iterator.call(context, value, index, list)}
- ).sort((left, right) ->
- a: left.criteria; b: right.criteria
- if a < b then -1 else if a > b then 1 else 0
- )), 'value')
-
-
- # Use a comparator function to figure out at what index an object should
- # be inserted so as to maintain order. Uses binary search.
- _.sortedIndex: (array, obj, iterator) ->
- iterator ||= _.identity
- low: 0; high: array.length
- while low < high
- mid: (low + high) >> 1
- if iterator(array[mid]) < iterator(obj) then low: mid + 1 else high: mid
- low
-
-
- # Convert anything iterable into a real, live array.
- _.toArray: (iterable) ->
- return [] if (!iterable)
- return iterable.toArray() if (iterable.toArray)
- return iterable if (_.isArray(iterable))
- return slice.call(iterable) if (_.isArguments(iterable))
- _.values(iterable)
-
-
- # Return the number of elements in an object.
- _.size: (obj) -> _.toArray(obj).length
-
-
- # -------------------------- Array Functions: ------------------------------
-
- # Get the first element of an array. Passing "n" will return the first N
- # values in the array. Aliased as "head". The "guard" check allows it to work
- # with _.map.
- _.first: (array, n, guard) ->
- if n and not guard then slice.call(array, 0, n) else array[0]
-
-
- # Returns everything but the first entry of the array. Aliased as "tail".
- # Especially useful on the arguments object. Passing an "index" will return
- # the rest of the values in the array from that index onward. The "guard"
- # check allows it to work with _.map.
- _.rest: (array, index, guard) ->
- slice.call(array, if _.isUndefined(index) or guard then 1 else index)
-
-
- # Get the last element of an array.
- _.last: (array) -> array[array.length - 1]
-
-
- # Trim out all falsy values from an array.
- _.compact: (array) -> array[i] for i in [0...array.length] when array[i]
-
-
- # Return a completely flattened version of an array.
- _.flatten: (array) ->
- _.reduce array, [], (memo, value) ->
- return memo.concat(_.flatten(value)) if _.isArray(value)
- memo.push(value)
- memo
-
-
- # Return a version of the array that does not contain the specified value(s).
- _.without: (array) ->
- values: _.rest(arguments)
- val for val in _.toArray(array) when not _.include(values, val)
-
-
- # Produce a duplicate-free version of the array. If the array has already
- # been sorted, you have the option of using a faster algorithm.
- _.uniq: (array, isSorted) ->
- memo: []
- for el, i in _.toArray(array)
- memo.push(el) if i is 0 || (if isSorted is true then _.last(memo) isnt el else not _.include(memo, el))
- memo
-
-
- # Produce an array that contains every item shared between all the
- # passed-in arrays.
- _.intersect: (array) ->
- rest: _.rest(arguments)
- _.select _.uniq(array), (item) ->
- _.all rest, (other) ->
- _.indexOf(other, item) >= 0
-
-
- # Zip together multiple lists into a single array -- elements that share
- # an index go together.
- _.zip: ->
- length: _.max(_.pluck(arguments, 'length'))
- results: new Array(length)
- for i in [0...length]
- results[i]: _.pluck(arguments, String(i))
- results
-
-
- # If the browser doesn't supply us with indexOf (I'm looking at you, MSIE),
- # we need this function. Return the position of the first occurence of an
- # item in an array, or -1 if the item is not included in the array.
- _.indexOf: (array, item) ->
- return array.indexOf(item) if array.indexOf
- i: 0; l: array.length
- while l - i
- if array[i] is item then return i else i++
- -1
-
-
- # Provide JavaScript 1.6's lastIndexOf, delegating to the native function,
- # if possible.
- _.lastIndexOf: (array, item) ->
- return array.lastIndexOf(item) if array.lastIndexOf
- i: array.length
- while i
- if array[i] is item then return i else i--
- -1
-
-
- # Generate an integer Array containing an arithmetic progression. A port of
- # the native Python range() function. See:
- # http://docs.python.org/library/functions.html#range
- _.range: (start, stop, step) ->
- a: arguments
- solo: a.length <= 1
- i: start: if solo then 0 else a[0];
- stop: if solo then a[0] else a[1];
- step: a[2] or 1
- len: Math.ceil((stop - start) / step)
- return [] if len <= 0
- range: new Array(len)
- idx: 0
- while true
- return range if (if step > 0 then i - stop else stop - i) >= 0
- range[idx]: i
- idx++
- i+= step
-
-
- # ----------------------- Function Functions: -----------------------------
-
- # Create a function bound to a given object (assigning 'this', and arguments,
- # optionally). Binding with arguments is also known as 'curry'.
- _.bind: (func, obj) ->
- args: _.rest(arguments, 2)
- -> func.apply(obj or root, args.concat(arguments))
-
-
- # Bind all of an object's methods to that object. Useful for ensuring that
- # all callbacks defined on an object belong to it.
- _.bindAll: (obj) ->
- funcs: if arguments.length > 1 then _.rest(arguments) else _.functions(obj)
- _.each(funcs, (f) -> obj[f]: _.bind(obj[f], obj))
- obj
-
-
- # Delays a function for the given number of milliseconds, and then calls
- # it with the arguments supplied.
- _.delay: (func, wait) ->
- args: _.rest(arguments, 2)
- setTimeout((-> func.apply(func, args)), wait)
-
-
- # Defers a function, scheduling it to run after the current call stack has
- # cleared.
- _.defer: (func) ->
- _.delay.apply(_, [func, 1].concat(_.rest(arguments)))
-
-
- # Returns the first function passed as an argument to the second,
- # allowing you to adjust arguments, run code before and after, and
- # conditionally execute the original function.
- _.wrap: (func, wrapper) ->
- -> wrapper.apply(wrapper, [func].concat(arguments))
-
-
- # Returns a function that is the composition of a list of functions, each
- # consuming the return value of the function that follows.
- _.compose: ->
- funcs: arguments
- ->
- args: arguments
- for i in [(funcs.length - 1)..0]
- args: [funcs[i].apply(this, args)]
- args[0]
-
-
- # ------------------------- Object Functions: ----------------------------
-
- # Retrieve the names of an object's properties.
- _.keys: (obj) ->
- return _.range(0, obj.length) if _.isArray(obj)
- key for key, val of obj
-
-
- # Retrieve the values of an object's properties.
- _.values: (obj) ->
- _.map(obj, _.identity)
-
-
- # Return a sorted list of the function names available in Underscore.
- _.functions: (obj) ->
- _.select(_.keys(obj), (key) -> _.isFunction(obj[key])).sort()
-
-
- # Extend a given object with all of the properties in a source object.
- _.extend: (destination, source) ->
- for key, val of source
- destination[key]: val
- destination
-
-
- # Create a (shallow-cloned) duplicate of an object.
- _.clone: (obj) ->
- return obj.slice(0) if _.isArray(obj)
- _.extend({}, obj)
-
-
- # Invokes interceptor with the obj, and then returns obj.
- # The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
- _.tap: (obj, interceptor) ->
- interceptor(obj)
- obj
-
-
- # Perform a deep comparison to check if two objects are equal.
- _.isEqual: (a, b) ->
- # Check object identity.
- return true if a is b
- # Different types?
- atype: typeof(a); btype: typeof(b)
- return false if atype isnt btype
- # Basic equality test (watch out for coercions).
- return true if `a == b`
- # One is falsy and the other truthy.
- return false if (!a and b) or (a and !b)
- # One of them implements an isEqual()?
- return a.isEqual(b) if a.isEqual
- # Check dates' integer values.
- return a.getTime() is b.getTime() if _.isDate(a) and _.isDate(b)
- # Both are NaN?
- return true if _.isNaN(a) and _.isNaN(b)
- # Compare regular expressions.
- if _.isRegExp(a) and _.isRegExp(b)
- return a.source is b.source and
- a.global is b.global and
- a.ignoreCase is b.ignoreCase and
- a.multiline is b.multiline
- # If a is not an object by this point, we can't handle it.
- return false if atype isnt 'object'
- # Check for different array lengths before comparing contents.
- return false if a.length and (a.length isnt b.length)
- # Nothing else worked, deep compare the contents.
- aKeys: _.keys(a); bKeys: _.keys(b)
- # Different object sizes?
- return false if aKeys.length isnt bKeys.length
- # Recursive comparison of contents.
- # for (var key in a) if (!_.isEqual(a[key], b[key])) return false;
- return true
-
-
- # Is a given array or object empty?
- _.isEmpty: (obj) -> _.keys(obj).length is 0
-
-
- # Is a given value a DOM element?
- _.isElement: (obj) -> obj and obj.nodeType is 1
-
-
- # Is a given value an array?
- _.isArray: (obj) -> !!(obj and obj.concat and obj.unshift)
-
-
- # Is a given variable an arguments object?
- _.isArguments: (obj) -> obj and _.isNumber(obj.length) and not obj.concat and
- not obj.substr and not obj.apply and not propertyIsEnumerable.call(obj, 'length')
-
-
- # Is the given value a function?
- _.isFunction: (obj) -> !!(obj and obj.constructor and obj.call and obj.apply)
-
-
- # Is the given value a string?
- _.isString: (obj) -> !!(obj is '' or (obj and obj.charCodeAt and obj.substr))
-
-
- # Is a given value a number?
- _.isNumber: (obj) -> (obj is +obj) or toString.call(obj) is '[object Number]'
-
-
- # Is a given value a Date?
- _.isDate: (obj) -> !!(obj and obj.getTimezoneOffset and obj.setUTCFullYear)
-
-
- # Is the given value a regular expression?
- _.isRegExp: (obj) -> !!(obj and obj.exec and (obj.ignoreCase or obj.ignoreCase is false))
-
-
- # Is the given value NaN -- this one is interesting. NaN != NaN, and
- # isNaN(undefined) == true, so we make sure it's a number first.
- _.isNaN: (obj) -> _.isNumber(obj) and window.isNaN(obj)
-
-
- # Is a given value equal to null?
- _.isNull: (obj) -> obj is null
-
-
- # Is a given variable undefined?
- _.isUndefined: (obj) -> typeof obj is 'undefined'
-
-
- # -------------------------- Utility Functions: --------------------------
-
- # Run Underscore.js in noConflict mode, returning the '_' variable to its
- # previous owner. Returns a reference to the Underscore object.
- _.noConflict: ->
- root._: previousUnderscore
- this
-
-
- # Keep the identity function around for default iterators.
- _.identity: (value) -> value
-
-
- # Break out of the middle of an iteration.
- _.breakLoop: -> throw breaker
-
-
- # Generate a unique integer id (unique within the entire client session).
- # Useful for temporary DOM ids.
- idCounter: 0
- _.uniqueId: (prefix) ->
- (prefix or '') + idCounter++
-
-
- # By default, Underscore uses ERB-style template delimiters, change the
- # following template settings to use alternative delimiters.
- _.templateSettings: {
- start: '<%'
- end: '%>'
- interpolate: /<%=(.+?)%>/g
- }
-
-
- # JavaScript templating a-la ERB, pilfered from John Resig's
- # "Secrets of the JavaScript Ninja", page 83.
- # Single-quotea fix from Rick Strahl's version.
- _.template: (str, data) ->
- c: _.templateSettings
- fn: new Function 'obj',
- 'var p=[],print=function(){p.push.apply(p,arguments);};' +
- 'with(obj){p.push(\'' +
- str.replace(/[\r\t\n]/g, " ")
- .replace(new RegExp("'(?=[^"+c.end[0]+"]*"+c.end+")","g"),"\t")
- .split("'").join("\\'")
- .split("\t").join("'")
- .replace(c.interpolate, "',$1,'")
- .split(c.start).join("');")
- .split(c.end).join("p.push('") +
- "');}return p.join('');"
- if data then fn(data) else fn
-
-
- # ------------------------------- Aliases ----------------------------------
-
- _.forEach: _.each
- _.foldl: _.inject: _.reduce
- _.foldr: _.reduceRight
- _.filter: _.select
- _.every: _.all
- _.some: _.any
- _.head: _.first
- _.tail: _.rest
- _.methods: _.functions
-
-
- # /*------------------------ Setup the OOP Wrapper: --------------------------*/
-
- # Helper function to continue chaining intermediate results.
- result: (obj, chain) ->
- if chain then _(obj).chain() else obj
-
-
- # Add all of the Underscore functions to the wrapper object.
- _.each _.functions(_), (name) ->
- method: _[name]
- wrapper.prototype[name]: ->
- unshift.call(arguments, this._wrapped)
- result(method.apply(_, arguments), this._chain)
-
-
- # Add all mutator Array functions to the wrapper.
- _.each ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], (name) ->
- method: Array.prototype[name]
- wrapper.prototype[name]: ->
- method.apply(this._wrapped, arguments)
- result(this._wrapped, this._chain)
-
-
- # Add all accessor Array functions to the wrapper.
- _.each ['concat', 'join', 'slice'], (name) ->
- method: Array.prototype[name]
- wrapper.prototype[name]: ->
- result(method.apply(this._wrapped, arguments), this._chain)
-
-
- # Start chaining a wrapped Underscore object.
- wrapper::chain: ->
- this._chain: true
- this
-
-
- # Extracts the result from a wrapped and chained object.
- wrapper::value: -> this._wrapped
diff --git a/tests/examplefiles/unicode.applescript b/tests/examplefiles/unicode.applescript
deleted file mode 100644
index 8cc6c6fb..00000000
--- a/tests/examplefiles/unicode.applescript
+++ /dev/null
@@ -1,5 +0,0 @@
-set jp to "日本語"
-
-set ru to "Русский"
-
-jp & " and " & ru -- returns "日本語 and Русский"
diff --git a/tests/examplefiles/unicode.go b/tests/examplefiles/unicode.go
deleted file mode 100644
index d4bef4d1..00000000
--- a/tests/examplefiles/unicode.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package main
-
-import "fmt"
-
-func main() {
- 世界 := "Hello, world!"
- さようなら := "Goodbye, world!"
- fmt.Println(世界)
- fmt.Println(さようなら)
-}
diff --git a/tests/examplefiles/unicode.js b/tests/examplefiles/unicode.js
deleted file mode 100644
index 8f553f6f..00000000
--- a/tests/examplefiles/unicode.js
+++ /dev/null
@@ -1,6 +0,0 @@
-var école;
-var sinθ;
-var เมือง;
-var a\u1234b;
-
-var nbsp;
diff --git a/tests/examplefiles/unicodedoc.py b/tests/examplefiles/unicodedoc.py
deleted file mode 100644
index 9d3db0c8..00000000
--- a/tests/examplefiles/unicodedoc.py
+++ /dev/null
@@ -1,11 +0,0 @@
-def foo():
- ur"""unicode-raw"""
-
-def bar():
- u"""unicode"""
-
-def baz():
- r'raw'
-
-def zap():
- """docstring"""
diff --git a/tests/examplefiles/unix-io.lid b/tests/examplefiles/unix-io.lid
deleted file mode 100644
index 617fcaa4..00000000
--- a/tests/examplefiles/unix-io.lid
+++ /dev/null
@@ -1,37 +0,0 @@
-Library: io
-Synopsis: A portable IO library
-Author: Gail Zacharias
-Files: library
- streams/defs
- streams/stream
- streams/sequence-stream
- streams/native-buffer
- streams/buffer
- streams/typed-stream
- streams/external-stream
- streams/buffered-stream
- streams/convenience
- streams/wrapper-stream
- streams/cleanup-streams
- streams/native-speed
- streams/async-writes
- streams/file-stream
- streams/multi-buffered-streams
- pprint
- print
- print-double-integer-kludge
- format
- buffered-format
- format-condition
- unix-file-accessor
- unix-standard-io
- unix-interface
- format-out
-C-Source-Files: unix-portability.c
-Major-Version: 2
-Minor-Version: 1
-Target-Type: dll
-Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
- All rights reserved.
-License: See License.txt in this distribution for details.
-Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
diff --git a/tests/examplefiles/varnish.vcl b/tests/examplefiles/varnish.vcl
deleted file mode 100644
index 6258c313..00000000
--- a/tests/examplefiles/varnish.vcl
+++ /dev/null
@@ -1,187 +0,0 @@
-# This is the VCL configuration Varnish will automatically append to your VCL
-# file during compilation/loading. See the vcl(7) man page for details on syntax
-# and semantics.
-# New users is recommended to use the example.vcl file as a starting point.
-
-vcl 4.0;
-
-backend foo { .host = "192.168.1.1"; }
-
-probe blatti { .url = "foo"; }
-probe fooy {
- .url = "beh";
-
-}
-
-acl foo {
- "192.168.1.1";
- "192.168.0.0"/24;
- ! "192.168.0.1";
-}
-
-include "foo.vcl";
-
-import std;
-
-sub vcl_init {
- new b = director.foo();
-}
-
-sub vcl_recv {
- ban(req.url ~ "foo");
- rollback();
-}
-sub vcl_recv {
- if (req.method == "PRI") {
- /* We do not support SPDY or HTTP/2.0 */
- return (synth(405));
- }
- if (req.method != "GET" &&
- req.method != "HEAD" &&
- req.method != "PUT" &&
- req.method != "POST" &&
- req.method != "TRACE" &&
- req.method != "OPTIONS" &&
- req.method != "DELETE") {
- /* Non-RFC2616 or CONNECT which is weird. */
- return (pipe);
- }
-
- if (req.method != "GET" && req.method != "HEAD") {
- /* We only deal with GET and HEAD by default */
- return (pass);
- }
- if (req.http.Authorization || req.http.Cookie) {
- /* Not cacheable by default */
- return (pass);
- }
- return (hash);
-}
-
-sub vcl_pipe {
- # By default Connection: close is set on all piped requests, to stop
- # connection reuse from sending future requests directly to the
- # (potentially) wrong backend. If you do want this to happen, you can undo
- # it here.
- # unset bereq.http.connection;
- return (pipe);
-}
-
-sub vcl_pass {
- return (fetch);
-}
-
-sub vcl_hash {
- hash_data(req.url);
- if (req.http.host) {
- hash_data(req.http.host);
- } else {
- hash_data(server.ip);
- }
- return (lookup);
-}
-
-sub vcl_purge {
- return (synth(200, "Purged"));
-}
-
-sub vcl_hit {
- if (obj.ttl >= 0s) {
- // A pure unadultered hit, deliver it
- return (deliver);
- }
- if (obj.ttl + obj.grace > 0s) {
- // Object is in grace, deliver it
- // Automatically triggers a background fetch
- return (deliver);
- }
- // fetch & deliver once we get the result
- return (miss);
-}
-
-sub vcl_miss {
- return (fetch);
-}
-
-sub vcl_deliver {
- set resp.http.x-storage = storage.s0.free;
- return (deliver);
-}
-
-/*
- * We can come here "invisibly" with the following errors: 413, 417 & 503
- */
-sub vcl_synth {
- set resp.http.Content-Type = "text/html; charset=utf-8";
- set resp.http.Retry-After = "5";
- synthetic( {"<!DOCTYPE html>
-<html>
- <head>
- <title>"} + resp.status + " " + resp.reason + {"</title>
- </head>
- <body>
- <h1>Error "} + resp.status + " " + resp.reason + {"</h1>
- <p>"} + resp.reason + {"</p>
- <h3>Guru Meditation:</h3>
- <p>XID: "} + req.xid + {"</p>
- <hr>
- <p>Varnish cache server</p>
- </body>
-</html>
-"} );
- return (deliver);
-}
-
-#######################################################################
-# Backend Fetch
-
-sub vcl_backend_fetch {
- return (fetch);
-}
-
-sub vcl_backend_response {
- if (beresp.ttl <= 0s ||
- beresp.http.Set-Cookie ||
- beresp.http.Surrogate-control ~ "no-store" ||
- (!beresp.http.Surrogate-Control &&
- beresp.http.Cache-Control ~ "no-cache|no-store|private") ||
- beresp.http.Vary == "*") {
- /*
- * Mark as "Hit-For-Pass" for the next 2 minutes
- */
- set beresp.ttl = 120s;
- set beresp.uncacheable = true;
- }
- return (deliver);
-}
-
-sub vcl_backend_error {
- set beresp.http.Content-Type = "text/html; charset=utf-8";
- set beresp.http.Retry-After = "5";
- synthetic( {"<!DOCTYPE html>
-<html>
- <head>
- <title>"} + beresp.status + " " + beresp.reason + {"</title>
- </head>
- <body>
- <h1>Error "} + beresp.status + " " + beresp.reason + {"</h1>
- <p>"} + beresp.reason + {"</p>
- <h3>Guru Meditation:</h3>
- <p>XID: "} + bereq.xid + {"</p>
- <hr>
- <p>Varnish cache server</p>
- </body>
-</html>
-"} );
- return (deliver);
-}
-
-#######################################################################
-# Housekeeping
-
-sub vcl_init {
-}
-
-sub vcl_fini {
- return (ok);
-}
diff --git a/tests/examplefiles/vbnet_test.bas b/tests/examplefiles/vbnet_test.bas
deleted file mode 100644
index af5f2574..00000000
--- a/tests/examplefiles/vbnet_test.bas
+++ /dev/null
@@ -1,29 +0,0 @@
-Public Class Form1
- Inherits System.Windows.Forms.Form
-
- Private t As New System.Timers.Timer(2000)
-
- Private Sub Form1_Load(ByVal sender As Object, _
- ByVal e As System.EventArgs) Handles MyBase.Load
-
- AddHandler t.Elapsed, AddressOf TimerFired
- End Sub
-
- Private Sub btnStart_Click(ByVal sender As System.Object, _
- ByVal e As System.EventArgs) Handles btnStart.Click
-
- t.Enabled = True
- End Sub
-
- Private Sub btnStop_Click(ByVal sender As System.Object, _
- ByVal e As System.EventArgs) Handles btnStop.Click
-
- t.Enabled = False
- End Sub
-
- Public Sub TimerFired(ByVal sender As Object, _
- ByVal e As System.Timers.ElapsedEventArgs)
-
- Label1.Text = "Signal Time = " & e.SignalTime.ToString
- End Sub
-End Class
diff --git a/tests/examplefiles/vctreestatus_hg b/tests/examplefiles/vctreestatus_hg
deleted file mode 100644
index 193ed803..00000000
--- a/tests/examplefiles/vctreestatus_hg
+++ /dev/null
@@ -1,4 +0,0 @@
-M LICENSE
-M setup.py
-! setup.cfg
-? vctreestatus_hg
diff --git a/tests/examplefiles/vimrc b/tests/examplefiles/vimrc
deleted file mode 100644
index d2f9cd1b..00000000
--- a/tests/examplefiles/vimrc
+++ /dev/null
@@ -1,21 +0,0 @@
-" A comment
-
-:py print "py"
-::pyt print 'pyt'
- pyth print '''pyth'''
- : pytho print "pytho"
-python print """python"""
-
- : : python<<E OF
-print """my script"""
-
-def MyFunc(str):
- """ My Function """
- print str
-E OF
-
-let py = 42
-echo py
-
-let foo = 42
-echo foo
diff --git a/tests/examplefiles/vpath.mk b/tests/examplefiles/vpath.mk
deleted file mode 100644
index a7f18fc3..00000000
--- a/tests/examplefiles/vpath.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-vpath %.c src
-vpath %.h header
-EXEC=hello
-SRC= hello.c main.c
-OBJ= $(SRC:.c=.o)
-
-all: $(EXEC)
-
-hello: $(OBJ)
- $(CC) -o $@ $^ $(LDFLAGS)
-
-main.o: hello.h
-
-%.o: %.c
- $(CC) -I header -o $@ \
- -c $< $(CFLAGS)
diff --git a/tests/examplefiles/wdiff_example1.wdiff b/tests/examplefiles/wdiff_example1.wdiff
deleted file mode 100644
index ca760812..00000000
--- a/tests/examplefiles/wdiff_example1.wdiff
+++ /dev/null
@@ -1,731 +0,0 @@
-.. -*- mode: rst -*-
-
-{+.. highlight:: python+}
-
-====================
-Write your own lexer
-====================
-
-If a lexer for your favorite language is missing in the Pygments package, you
-can easily write your own and extend Pygments.
-
-All you need can be found inside the :mod:`pygments.lexer` module. As you can
-read in the :doc:`API documentation <api>`, a lexer is a class that is
-initialized with some keyword arguments (the lexer options) and that provides a
-:meth:`.get_tokens_unprocessed()` method which is given a string or unicode
-object with the data to [-parse.-] {+lex.+}
-
-The :meth:`.get_tokens_unprocessed()` method must return an iterator or iterable
-containing tuples in the form ``(index, token, value)``. Normally you don't
-need to do this since there are [-numerous-] base lexers {+that do most of the work and that+}
-you can subclass.
-
-
-RegexLexer
-==========
-
-[-A very powerful (but quite easy to use)-]
-
-{+The+} lexer {+base class used by almost all of Pygments' lexers+} is the
-:class:`RegexLexer`. This
-[-lexer base-] class allows you to define lexing rules in terms of
-*regular expressions* for different *states*.
-
-States are groups of regular expressions that are matched against the input
-string at the *current position*. If one of these expressions matches, a
-corresponding action is performed [-(normally-] {+(such as+} yielding a token with a specific
-[-type),-]
-{+type, or changing state),+} the current position is set to where the last match
-ended and the matching process continues with the first regex of the current
-state.
-
-Lexer states are kept [-in-] {+on+} a [-state-] stack: each time a new state is entered, the new
-state is pushed onto the stack. The most basic lexers (like the `DiffLexer`)
-just need one state.
-
-Each state is defined as a list of tuples in the form (`regex`, `action`,
-`new_state`) where the last item is optional. In the most basic form, `action`
-is a token type (like `Name.Builtin`). That means: When `regex` matches, emit a
-token with the match text and type `tokentype` and push `new_state` on the state
-stack. If the new state is ``'#pop'``, the topmost state is popped from the
-stack instead. [-(To-] {+To+} pop more than one state, use ``'#pop:2'`` and so [-on.)-] {+on.+}
-``'#push'`` is a synonym for pushing the current state on the stack.
-
-The following example shows the `DiffLexer` from the builtin lexers. Note that
-it contains some additional attributes `name`, `aliases` and `filenames` which
-aren't required for a lexer. They are used by the builtin lexer lookup
-functions.
-
-[-.. sourcecode:: python-] {+::+}
-
- from pygments.lexer import RegexLexer
- from pygments.token import *
-
- class DiffLexer(RegexLexer):
- name = 'Diff'
- aliases = ['diff']
- filenames = ['*.diff']
-
- tokens = {
- 'root': [
- (r' .*\n', Text),
- (r'\+.*\n', Generic.Inserted),
- (r'-.*\n', Generic.Deleted),
- (r'@.*\n', Generic.Subheading),
- (r'Index.*\n', Generic.Heading),
- (r'=.*\n', Generic.Heading),
- (r'.*\n', Text),
- ]
- }
-
-As you can see this lexer only uses one state. When the lexer starts scanning
-the text, it first checks if the current character is a space. If this is true
-it scans everything until newline and returns the [-parsed-] data as {+a+} `Text` [-token.-] {+token (which
-is the "no special highlighting" token).+}
-
-If this rule doesn't match, it checks if the current char is a plus sign. And
-so on.
-
-If no rule matches at the current position, the current char is emitted as an
-`Error` token that indicates a [-parsing-] {+lexing+} error, and the position is increased by
-[-1.-]
-{+one.+}
-
-
-Adding and testing a new lexer
-==============================
-
-To make [-pygments-] {+Pygments+} aware of your new lexer, you have to perform the following
-steps:
-
-First, change to the current directory containing the [-pygments-] {+Pygments+} source code:
-
-.. [-sourcecode::-] {+code-block::+} console
-
- $ cd .../pygments-main
-
-{+Select a matching module under ``pygments/lexers``, or create a new module for
-your lexer class.+}
-
-Next, make sure the lexer is known from outside of the module. All modules in
-the ``pygments.lexers`` specify ``__all__``. For example, [-``other.py`` sets:
-
-.. sourcecode:: python-] {+``esoteric.py`` sets::+}
-
- __all__ = ['BrainfuckLexer', 'BefungeLexer', ...]
-
-Simply add the name of your lexer class to this list.
-
-Finally the lexer can be made [-publically-] {+publicly+} known by rebuilding the lexer mapping:
-
-.. [-sourcecode::-] {+code-block::+} console
-
- $ make mapfiles
-
-To test the new lexer, store an example file with the proper extension in
-``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
-``tests/examplefiles/example.diff`` containing a sample diff output.
-
-Now you can use pygmentize to render your example to HTML:
-
-.. [-sourcecode::-] {+code-block::+} console
-
- $ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
-
-Note that this [-explicitely-] {+explicitly+} calls the ``pygmentize`` in the current directory
-by preceding it with ``./``. This ensures your modifications are used.
-Otherwise a possibly already installed, unmodified version without your new
-lexer would have been called from the system search path (``$PATH``).
-
-To view the result, open ``/tmp/example.html`` in your browser.
-
-Once the example renders as expected, you should run the complete test suite:
-
-.. [-sourcecode::-] {+code-block::+} console
-
- $ make test
-
-{+It also tests that your lexer fulfills the lexer API and certain invariants,
-such as that the concatenation of all token text is the same as the input text.+}
-
-
-Regex Flags
-===========
-
-You can either define regex flags {+locally+} in the regex (``r'(?x)foo bar'``) or
-{+globally+} by adding a `flags` attribute to your lexer class. If no attribute is
-defined, it defaults to `re.MULTILINE`. For more [-informations-] {+information+} about regular
-expression flags see the {+page about+} `regular expressions`_ [-help page-] in the [-python-] {+Python+}
-documentation.
-
-.. _regular expressions: [-http://docs.python.org/lib/re-syntax.html-] {+http://docs.python.org/library/re.html#regular-expression-syntax+}
-
-
-Scanning multiple tokens at once
-================================
-
-{+So far, the `action` element in the rule tuple of regex, action and state has
-been a single token type. Now we look at the first of several other possible
-values.+}
-
-Here is a more complex lexer that highlights INI files. INI files consist of
-sections, comments and [-key-] {+``key+} = [-value pairs:
-
-.. sourcecode:: python-] {+value`` pairs::+}
-
- from pygments.lexer import RegexLexer, bygroups
- from pygments.token import *
-
- class IniLexer(RegexLexer):
- name = 'INI'
- aliases = ['ini', 'cfg']
- filenames = ['*.ini', '*.cfg']
-
- tokens = {
- 'root': [
- (r'\s+', Text),
- (r';.*?$', Comment),
- (r'\[.*?\]$', Keyword),
- (r'(.*?)(\s*)(=)(\s*)(.*?)$',
- bygroups(Name.Attribute, Text, Operator, Text, String))
- ]
- }
-
-The lexer first looks for whitespace, comments and section names. [-And later-] {+Later+} it
-looks for a line that looks like a key, value pair, separated by an ``'='``
-sign, and optional whitespace.
-
-The `bygroups` helper [-makes sure that-] {+yields+} each {+capturing+} group [-is yielded-] {+in the regex+} with a different
-token type. First the `Name.Attribute` token, then a `Text` token for the
-optional whitespace, after that a `Operator` token for the equals sign. Then a
-`Text` token for the whitespace again. The rest of the line is returned as
-`String`.
-
-Note that for this to work, every part of the match must be inside a capturing
-group (a ``(...)``), and there must not be any nested capturing groups. If you
-nevertheless need a group, use a non-capturing group defined using this syntax:
-[-``r'(?:some|words|here)'``-]
-{+``(?:some|words|here)``+} (note the ``?:`` after the beginning parenthesis).
-
-If you find yourself needing a capturing group inside the regex which shouldn't
-be part of the output but is used in the regular expressions for backreferencing
-(eg: ``r'(<(foo|bar)>)(.*?)(</\2>)'``), you can pass `None` to the bygroups
-function and [-it will skip-] that group will be skipped in the output.
-
-
-Changing states
-===============
-
-Many lexers need multiple states to work as expected. For example, some
-languages allow multiline comments to be nested. Since this is a recursive
-pattern it's impossible to lex just using regular expressions.
-
-Here is [-the solution:
-
-.. sourcecode:: python-] {+a lexer that recognizes C++ style comments (multi-line with ``/* */``
-and single-line with ``//`` until end of line)::+}
-
- from pygments.lexer import RegexLexer
- from pygments.token import *
-
- class [-ExampleLexer(RegexLexer):-] {+CppCommentLexer(RegexLexer):+}
- name = 'Example Lexer with states'
-
- tokens = {
- 'root': [
- (r'[^/]+', Text),
- (r'/\*', Comment.Multiline, 'comment'),
- (r'//.*?$', Comment.Singleline),
- (r'/', Text)
- ],
- 'comment': [
- (r'[^*/]', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
- (r'\*/', Comment.Multiline, '#pop'),
- (r'[*/]', Comment.Multiline)
- ]
- }
-
-This lexer starts lexing in the ``'root'`` state. It tries to match as much as
-possible until it finds a slash (``'/'``). If the next character after the slash
-is [-a star-] {+an asterisk+} (``'*'``) the `RegexLexer` sends those two characters to the
-output stream marked as `Comment.Multiline` and continues [-parsing-] {+lexing+} with the rules
-defined in the ``'comment'`` state.
-
-If there wasn't [-a star-] {+an asterisk+} after the slash, the `RegexLexer` checks if it's a
-[-singleline-]
-{+Singleline+} comment [-(eg:-] {+(i.e.+} followed by a second slash). If this also wasn't the
-case it must be a single [-slash-] {+slash, which is not a comment starter+} (the separate
-regex for a single slash must also be given, else the slash would be marked as
-an error token).
-
-Inside the ``'comment'`` state, we do the same thing again. Scan until the
-lexer finds a star or slash. If it's the opening of a multiline comment, push
-the ``'comment'`` state on the stack and continue scanning, again in the
-``'comment'`` state. Else, check if it's the end of the multiline comment. If
-yes, pop one state from the stack.
-
-Note: If you pop from an empty stack you'll get an `IndexError`. (There is an
-easy way to prevent this from happening: don't ``'#pop'`` in the root state).
-
-If the `RegexLexer` encounters a newline that is flagged as an error token, the
-stack is emptied and the lexer continues scanning in the ``'root'`` state. This
-[-helps-]
-{+can help+} producing error-tolerant highlighting for erroneous input, e.g. when a
-single-line string is not closed.
-
-
-Advanced state tricks
-=====================
-
-There are a few more things you can do with states:
-
-- You can push multiple states onto the stack if you give a tuple instead of a
- simple string as the third item in a rule tuple. For example, if you want to
- match a comment containing a directive, something [-like::-] {+like:
-
- .. code-block:: text+}
-
- /* <processing directive> rest of comment */
-
- you can use this [-rule:
-
- .. sourcecode:: python-] {+rule::+}
-
- tokens = {
- 'root': [
- (r'/\* <', Comment, ('comment', 'directive')),
- ...
- ],
- 'directive': [
- (r'[^>]*', Comment.Directive),
- (r'>', Comment, '#pop'),
- ],
- 'comment': [
- (r'[^*]+', Comment),
- (r'\*/', Comment, '#pop'),
- (r'\*', Comment),
- ]
- }
-
- When this encounters the above sample, first ``'comment'`` and ``'directive'``
- are pushed onto the stack, then the lexer continues in the directive state
- until it finds the closing ``>``, then it continues in the comment state until
- the closing ``*/``. Then, both states are popped from the stack again and
- lexing continues in the root state.
-
- .. versionadded:: 0.9
- The tuple can contain the special ``'#push'`` and ``'#pop'`` (but not
- ``'#pop:n'``) directives.
-
-
-- You can include the rules of a state in the definition of another. This is
- done by using `include` from [-`pygments.lexer`:
-
- .. sourcecode:: python-] {+`pygments.lexer`::+}
-
- from pygments.lexer import RegexLexer, bygroups, include
- from pygments.token import *
-
- class ExampleLexer(RegexLexer):
- tokens = {
- 'comments': [
- (r'/\*.*?\*/', Comment),
- (r'//.*?\n', Comment),
- ],
- 'root': [
- include('comments'),
- (r'(function )(\w+)( {)',
- bygroups(Keyword, Name, Keyword), 'function'),
- (r'.', Text),
- ],
- 'function': [
- (r'[^}/]+', Text),
- include('comments'),
- (r'/', Text),
- [-(r'}',-]
- {+(r'\}',+} Keyword, '#pop'),
- ]
- }
-
- This is a hypothetical lexer for a language that consist of functions and
- comments. Because comments can occur at toplevel and in functions, we need
- rules for comments in both states. As you can see, the `include` helper saves
- repeating rules that occur more than once (in this example, the state
- ``'comment'`` will never be entered by the lexer, as it's only there to be
- included in ``'root'`` and ``'function'``).
-
-- Sometimes, you may want to "combine" a state from existing ones. This is
- possible with the [-`combine`-] {+`combined`+} helper from `pygments.lexer`.
-
- If you, instead of a new state, write ``combined('state1', 'state2')`` as the
- third item of a rule tuple, a new anonymous state will be formed from state1
- and state2 and if the rule matches, the lexer will enter this state.
-
- This is not used very often, but can be helpful in some cases, such as the
- `PythonLexer`'s string literal processing.
-
-- If you want your lexer to start lexing in a different state you can modify the
- stack by [-overloading-] {+overriding+} the `get_tokens_unprocessed()` [-method:
-
- .. sourcecode:: python-] {+method::+}
-
- from pygments.lexer import RegexLexer
-
- class [-MyLexer(RegexLexer):-] {+ExampleLexer(RegexLexer):+}
- tokens = {...}
-
- def get_tokens_unprocessed(self, [-text):
- stack = ['root', 'otherstate']-] {+text, stack=('root', 'otherstate')):+}
- for item in RegexLexer.get_tokens_unprocessed(text, stack):
- yield item
-
- Some lexers like the `PhpLexer` use this to make the leading ``<?php``
- preprocessor comments optional. Note that you can crash the lexer easily by
- putting values into the stack that don't exist in the token map. Also
- removing ``'root'`` from the stack can result in strange errors!
-
-- [-An-] {+In some lexers, a state should be popped if anything is encountered that isn't
- matched by a rule in the state. You could use an+} empty regex at the end of [-a-]
- {+the+} state list, [-combined with ``'#pop'``, can
- act as-] {+but Pygments provides+} a [-return point-] {+more obvious way of spelling that:
- ``default('#pop')`` is equivalent to ``('', Text, '#pop')``.
-
- .. versionadded:: 2.0
-
-
-Subclassing lexers derived+} from {+RegexLexer
-==========================================
-
-.. versionadded:: 1.6
-
-Sometimes multiple languages are very similar, but should still be lexed by
-different lexer classes.
-
-When subclassing+} a {+lexer derived from RegexLexer, the ``tokens`` dictionaries
-defined in the parent and child class are merged. For example::
-
- from pygments.lexer import RegexLexer, inherit
- from pygments.token import *
-
- class BaseLexer(RegexLexer):
- tokens = {
- 'root': [
- ('[a-z]+', Name),
- (r'/\*', Comment, 'comment'),
- ('"', String, 'string'),
- ('\s+', Text),
- ],
- 'string': [
- ('[^"]+', String),
- ('"', String, '#pop'),
- ],
- 'comment': [
- ...
- ],
- }
-
- class DerivedLexer(BaseLexer):
- tokens = {
- 'root': [
- ('[0-9]+', Number),
- inherit,
- ],
- 'string': [
- (r'[^"\\]+', String),
- (r'\\.', String.Escape),
- ('"', String, '#pop'),
- ],
- }
-
-The `BaseLexer` defines two states, lexing names and strings. The
-`DerivedLexer` defines its own tokens dictionary, which extends the definitions
-of the base lexer:
-
-* The "root"+} state {+has an additional rule and then the special object `inherit`,
- which tells Pygments to insert the token definitions of the parent class at+}
- that [-doesn't have a clear end marker.-] {+point.
-
-* The "string" state is replaced entirely, since there is not `inherit` rule.
-
-* The "comment" state is inherited entirely.+}
-
-
-Using multiple lexers
-=====================
-
-Using multiple lexers for the same input can be tricky. One of the easiest
-combination techniques is shown here: You can replace the [-token type-] {+action+} entry in a rule
-tuple [-(the second item)-] with a lexer class. The matched text will then be lexed with that lexer,
-and the resulting tokens will be yielded.
-
-For example, look at this stripped-down HTML [-lexer:
-
-.. sourcecode:: python-] {+lexer::+}
-
- from pygments.lexer import RegexLexer, bygroups, using
- from pygments.token import *
- from [-pygments.lexers.web-] {+pygments.lexers.javascript+} import JavascriptLexer
-
- class HtmlLexer(RegexLexer):
- name = 'HTML'
- aliases = ['html']
- filenames = ['*.html', '*.htm']
-
- flags = re.IGNORECASE | re.DOTALL
- tokens = {
- 'root': [
- ('[^<&]+', Text),
- ('&.*?;', Name.Entity),
- (r'<\s*script\s*', Name.Tag, ('script-content', 'tag')),
- (r'<\s*[a-zA-Z0-9:]+', Name.Tag, 'tag'),
- (r'<\s*/\s*[a-zA-Z0-9:]+\s*>', Name.Tag),
- ],
- 'script-content': [
- (r'(.+?)(<\s*/\s*script\s*>)',
- bygroups(using(JavascriptLexer), Name.Tag),
- '#pop'),
- ]
- }
-
-Here the content of a ``<script>`` tag is passed to a newly created instance of
-a `JavascriptLexer` and not processed by the `HtmlLexer`. This is done using
-the `using` helper that takes the other lexer class as its parameter.
-
-Note the combination of `bygroups` and `using`. This makes sure that the
-content up to the ``</script>`` end tag is processed by the `JavascriptLexer`,
-while the end tag is yielded as a normal token with the `Name.Tag` type.
-
-[-As an additional goodie, if the lexer class is replaced by `this` (imported from
-`pygments.lexer`), the "other" lexer will be the current one (because you cannot
-refer to the current class within the code that runs at class definition time).-]
-
-Also note the ``(r'<\s*script\s*', Name.Tag, ('script-content', 'tag'))`` rule.
-Here, two states are pushed onto the state stack, ``'script-content'`` and
-``'tag'``. That means that first ``'tag'`` is processed, which will [-parse-] {+lex+}
-attributes and the closing ``>``, then the ``'tag'`` state is popped and the
-next state on top of the stack will be ``'script-content'``.
-
-{+Since you cannot refer to the class currently being defined, use `this`
-(imported from `pygments.lexer`) to refer to the current lexer class, i.e.
-``using(this)``. This construct may seem unnecessary, but this is often the
-most obvious way of lexing arbitrary syntax between fixed delimiters without
-introducing deeply nested states.+}
-
-The `using()` helper has a special keyword argument, `state`, which works as
-follows: if given, the lexer to use initially is not in the ``"root"`` state,
-but in the state given by this argument. This [-*only* works-] {+does not work+} with [-a `RegexLexer`.-] {+advanced
-`RegexLexer` subclasses such as `ExtendedRegexLexer` (see below).+}
-
-Any other keywords arguments passed to `using()` are added to the keyword
-arguments used to create the lexer.
-
-
-Delegating Lexer
-================
-
-Another approach for nested lexers is the `DelegatingLexer` which is for example
-used for the template engine lexers. It takes two lexers as arguments on
-initialisation: a `root_lexer` and a `language_lexer`.
-
-The input is processed as follows: First, the whole text is lexed with the
-`language_lexer`. All tokens yielded with [-a-] {+the special+} type of ``Other`` are
-then concatenated and given to the `root_lexer`. The language tokens of the
-`language_lexer` are then inserted into the `root_lexer`'s token stream at the
-appropriate positions.
-
-[-.. sourcecode:: python-] {+::+}
-
- from pygments.lexer import DelegatingLexer
- from pygments.lexers.web import HtmlLexer, PhpLexer
-
- class HtmlPhpLexer(DelegatingLexer):
- def __init__(self, **options):
- super(HtmlPhpLexer, self).__init__(HtmlLexer, PhpLexer, **options)
-
-This procedure ensures that e.g. HTML with template tags in it is highlighted
-correctly even if the template tags are put into HTML tags or attributes.
-
-If you want to change the needle token ``Other`` to something else, you can give
-the lexer another token type as the third [-parameter:
-
-.. sourcecode:: python-] {+parameter::+}
-
- DelegatingLexer.__init__(MyLexer, OtherLexer, Text, **options)
-
-
-Callbacks
-=========
-
-Sometimes the grammar of a language is so complex that a lexer would be unable
-to [-parse-] {+process+} it just by using regular expressions and stacks.
-
-For this, the `RegexLexer` allows callbacks to be given in rule tuples, instead
-of token types (`bygroups` and `using` are nothing else but preimplemented
-callbacks). The callback must be a function taking two arguments:
-
-* the lexer itself
-* the match object for the last matched rule
-
-The callback must then return an iterable of (or simply yield) ``(index,
-tokentype, value)`` tuples, which are then just passed through by
-`get_tokens_unprocessed()`. The ``index`` here is the position of the token in
-the input string, ``tokentype`` is the normal token type (like `Name.Builtin`),
-and ``value`` the associated part of the input string.
-
-You can see an example [-here:
-
-.. sourcecode:: python-] {+here::+}
-
- from pygments.lexer import RegexLexer
- from pygments.token import Generic
-
- class HypotheticLexer(RegexLexer):
-
- def headline_callback(lexer, match):
- equal_signs = match.group(1)
- text = match.group(2)
- yield match.start(), Generic.Headline, equal_signs + text + equal_signs
-
- tokens = {
- 'root': [
- (r'(=+)(.*?)(\1)', headline_callback)
- ]
- }
-
-If the regex for the `headline_callback` matches, the function is called with
-the match object. Note that after the callback is done, processing continues
-normally, that is, after the end of the previous match. The callback has no
-possibility to influence the position.
-
-There are not really any simple examples for lexer callbacks, but you can see
-them in action e.g. in the [-`compiled.py`_ source code-] {+`SMLLexer` class+} in [-the `CLexer` and
-`JavaLexer` classes.-] {+`ml.py`_.+}
-
-.. [-_compiled.py: http://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/compiled.py-] {+_ml.py: http://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/ml.py+}
-
-
-The ExtendedRegexLexer class
-============================
-
-The `RegexLexer`, even with callbacks, unfortunately isn't powerful enough for
-the funky syntax rules of [-some-] languages [-that will go unnamed,-] such as Ruby.
-
-But fear not; even then you don't have to abandon the regular expression
-[-approach. For-]
-{+approach:+} Pygments has a subclass of `RegexLexer`, the `ExtendedRegexLexer`.
-All features known from RegexLexers are available here too, and the tokens are
-specified in exactly the same way, *except* for one detail:
-
-The `get_tokens_unprocessed()` method holds its internal state data not as local
-variables, but in an instance of the `pygments.lexer.LexerContext` class, and
-that instance is passed to callbacks as a third argument. This means that you
-can modify the lexer state in callbacks.
-
-The `LexerContext` class has the following members:
-
-* `text` -- the input text
-* `pos` -- the current starting position that is used for matching regexes
-* `stack` -- a list containing the state stack
-* `end` -- the maximum position to which regexes are matched, this defaults to
- the length of `text`
-
-Additionally, the `get_tokens_unprocessed()` method can be given a
-`LexerContext` instead of a string and will then process this context instead of
-creating a new one for the string argument.
-
-Note that because you can set the current position to anything in the callback,
-it won't be automatically be set by the caller after the callback is finished.
-For example, this is how the hypothetical lexer above would be written with the
-[-`ExtendedRegexLexer`:
-
-.. sourcecode:: python-]
-{+`ExtendedRegexLexer`::+}
-
- from pygments.lexer import ExtendedRegexLexer
- from pygments.token import Generic
-
- class ExHypotheticLexer(ExtendedRegexLexer):
-
- def headline_callback(lexer, match, ctx):
- equal_signs = match.group(1)
- text = match.group(2)
- yield match.start(), Generic.Headline, equal_signs + text + equal_signs
- ctx.pos = match.end()
-
- tokens = {
- 'root': [
- (r'(=+)(.*?)(\1)', headline_callback)
- ]
- }
-
-This might sound confusing (and it can really be). But it is needed, and for an
-example look at the Ruby lexer in [-`agile.py`_.-] {+`ruby.py`_.+}
-
-.. [-_agile.py: https://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/agile.py
-
-
-Filtering-] {+_ruby.py: https://bitbucket.org/birkenfeld/pygments-main/src/tip/pygments/lexers/ruby.py
-
-
-Handling Lists of Keywords
-==========================
-
-For a relatively short list (hundreds) you can construct an optimized regular
-expression directly using ``words()`` (longer lists, see next section). This
-function handles a few things for you automatically, including escaping
-metacharacters and Python's first-match rather than longest-match in
-alternations. Feel free to put the lists themselves in
-``pygments/lexers/_$lang_builtins.py`` (see examples there), and generated by
-code if possible.
-
-An example of using ``words()`` is something like::
-
- from pygments.lexer import RegexLexer, words, Name
-
- class MyLexer(RegexLexer):
-
- tokens = {
- 'root': [
- (words(('else', 'elseif'), suffix=r'\b'), Name.Builtin),
- (r'\w+', Name),
- ],
- }
-
-As you can see, you can add ``prefix`` and ``suffix`` parts to the constructed
-regex.
-
-
-Modifying+} Token Streams
-=======================
-
-Some languages ship a lot of builtin functions (for example PHP). The total
-amount of those functions differs from system to system because not everybody
-has every extension installed. In the case of PHP there are over 3000 builtin
-functions. That's an [-incredible-] {+incredibly+} huge amount of functions, much more than you
-[-can-]
-{+want to+} put into a regular expression.
-
-But because only `Name` tokens can be function names [-it's-] {+this is+} solvable by
-overriding the ``get_tokens_unprocessed()`` method. The following lexer
-subclasses the `PythonLexer` so that it highlights some additional names as
-pseudo [-keywords:
-
-.. sourcecode:: python-] {+keywords::+}
-
- from [-pygments.lexers.agile-] {+pygments.lexers.python+} import PythonLexer
- from pygments.token import Name, Keyword
-
- class MyPythonLexer(PythonLexer):
- EXTRA_KEYWORDS = [-['foo',-] {+set(('foo',+} 'bar', 'foobar', 'barfoo', 'spam', [-'eggs']-] {+'eggs'))+}
-
- def get_tokens_unprocessed(self, text):
- for index, token, value in PythonLexer.get_tokens_unprocessed(self, text):
- if token is Name and value in self.EXTRA_KEYWORDS:
- yield index, Keyword.Pseudo, value
- else:
- yield index, token, value
-
-The `PhpLexer` and `LuaLexer` use this method to resolve builtin functions.
-
-[-.. note:: Do not confuse this with the :doc:`filter <filters>` system.-]
diff --git a/tests/examplefiles/wdiff_example3.wdiff b/tests/examplefiles/wdiff_example3.wdiff
deleted file mode 100644
index 0bbd6d65..00000000
--- a/tests/examplefiles/wdiff_example3.wdiff
+++ /dev/null
@@ -1,10 +0,0 @@
-This example is unbalanced open-close.
-We can't treat these easily.
-
-{+ added? -]
-[- deleted? +}
-
-suddenly closed -]
-suddenly closed +}
-
-{+ added? [- deleted?
diff --git a/tests/examplefiles/webkit-transition.css b/tests/examplefiles/webkit-transition.css
deleted file mode 100644
index a20b7112..00000000
--- a/tests/examplefiles/webkit-transition.css
+++ /dev/null
@@ -1,3 +0,0 @@
-p {
- -webkit-transition: opacity 1s linear;
-}
diff --git a/tests/examplefiles/while.pov b/tests/examplefiles/while.pov
deleted file mode 100644
index fb182454..00000000
--- a/tests/examplefiles/while.pov
+++ /dev/null
@@ -1,13 +0,0 @@
-#declare Index1 = 0;
-#while(Index1 <= 9)
-
- #declare Index2 = 0;
- #while(Index2 <= 19)
-
- sphere { <Index1, Index2, 0>, .5 }
-
- #declare Index2 = Index2 + 1;
- #end
-
- #declare Index1 = Index1 + 1;
-#end
diff --git a/tests/examplefiles/wiki.factor b/tests/examplefiles/wiki.factor
deleted file mode 100644
index d046e91c..00000000
--- a/tests/examplefiles/wiki.factor
+++ /dev/null
@@ -1,384 +0,0 @@
-! Copyright (C) 2008 Slava Pestov
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel hashtables calendar random assocs
-namespaces make splitting sequences sorting math.order present
-io.files io.directories io.encodings.ascii
-syndication farkup
-html.components html.forms
-http.server
-http.server.dispatchers
-furnace.actions
-furnace.utilities
-furnace.redirection
-furnace.auth
-furnace.auth.login
-furnace.boilerplate
-furnace.syndication
-validators
-db.types db.tuples lcs urls ;
-IN: webapps.wiki
-
-: wiki-url ( rest path -- url )
- [ "$wiki/" % % "/" % present % ] "" make
- <url> swap >>path ;
-
-: view-url ( title -- url ) "view" wiki-url ;
-
-: edit-url ( title -- url ) "edit" wiki-url ;
-
-: revisions-url ( title -- url ) "revisions" wiki-url ;
-
-: revision-url ( id -- url ) "revision" wiki-url ;
-
-: user-edits-url ( author -- url ) "user-edits" wiki-url ;
-
-TUPLE: wiki < dispatcher ;
-
-SYMBOL: can-delete-wiki-articles?
-
-can-delete-wiki-articles? define-capability
-
-TUPLE: article title revision ;
-
-article "ARTICLES" {
- { "title" "TITLE" { VARCHAR 256 } +not-null+ +user-assigned-id+ }
- { "revision" "REVISION" INTEGER +not-null+ } ! revision id
-} define-persistent
-
-: <article> ( title -- article ) article new swap >>title ;
-
-TUPLE: revision id title author date content description ;
-
-revision "REVISIONS" {
- { "id" "ID" INTEGER +db-assigned-id+ }
- { "title" "TITLE" { VARCHAR 256 } +not-null+ } ! article id
- { "author" "AUTHOR" { VARCHAR 256 } +not-null+ } ! uid
- { "date" "DATE" TIMESTAMP +not-null+ }
- { "content" "CONTENT" TEXT +not-null+ }
- { "description" "DESCRIPTION" TEXT }
-} define-persistent
-
-M: revision feed-entry-title
- [ title>> ] [ drop " by " ] [ author>> ] tri 3append ;
-
-M: revision feed-entry-date date>> ;
-
-M: revision feed-entry-url id>> revision-url ;
-
-: reverse-chronological-order ( seq -- sorted )
- [ date>> ] inv-sort-with ;
-
-: <revision> ( id -- revision )
- revision new swap >>id ;
-
-: validate-title ( -- )
- { { "title" [ v-one-line ] } } validate-params ;
-
-: validate-author ( -- )
- { { "author" [ v-username ] } } validate-params ;
-
-: <article-boilerplate> ( responder -- responder' )
- <boilerplate>
- { wiki "page-common" } >>template ;
-
-: <main-article-action> ( -- action )
- <action>
- [ "Front Page" view-url <redirect> ] >>display ;
-
-: latest-revision ( title -- revision/f )
- <article> select-tuple
- dup [ revision>> <revision> select-tuple ] when ;
-
-: <view-article-action> ( -- action )
- <action>
-
- "title" >>rest
-
- [ validate-title ] >>init
-
- [
- "title" value dup latest-revision [
- from-object
- { wiki "view" } <chloe-content>
- ] [
- edit-url <redirect>
- ] ?if
- ] >>display
-
- <article-boilerplate> ;
-
-: <view-revision-action> ( -- action )
- <page-action>
-
- "id" >>rest
-
- [
- validate-integer-id
- "id" value <revision>
- select-tuple from-object
- ] >>init
-
- { wiki "view" } >>template
-
- <article-boilerplate> ;
-
-: <random-article-action> ( -- action )
- <action>
- [
- article new select-tuples random
- [ title>> ] [ "Front Page" ] if*
- view-url <redirect>
- ] >>display ;
-
-: amend-article ( revision article -- )
- swap id>> >>revision update-tuple ;
-
-: add-article ( revision -- )
- [ title>> ] [ id>> ] bi article boa insert-tuple ;
-
-: add-revision ( revision -- )
- [ insert-tuple ]
- [
- dup title>> <article> select-tuple
- [ amend-article ] [ add-article ] if*
- ]
- bi ;
-
-: <edit-article-action> ( -- action )
- <page-action>
-
- "title" >>rest
-
- [
- validate-title
-
- "title" value <article> select-tuple
- [ revision>> <revision> select-tuple ]
- [ f <revision> "title" value >>title ]
- if*
-
- [ title>> "title" set-value ]
- [ content>> "content" set-value ]
- bi
- ] >>init
-
- { wiki "edit" } >>template
-
- <article-boilerplate> ;
-
-: <submit-article-action> ( -- action )
- <action>
- [
- validate-title
-
- {
- { "content" [ v-required ] }
- { "description" [ [ v-one-line ] v-optional ] }
- } validate-params
-
- f <revision>
- "title" value >>title
- now >>date
- username >>author
- "content" value >>content
- "description" value >>description
- [ add-revision ] [ title>> view-url <redirect> ] bi
- ] >>submit
-
- <protected>
- "edit wiki articles" >>description ;
-
-: <revisions-boilerplate> ( responder -- responder )
- <boilerplate>
- { wiki "revisions-common" } >>template ;
-
-: list-revisions ( -- seq )
- f <revision> "title" value >>title select-tuples
- reverse-chronological-order ;
-
-: <list-revisions-action> ( -- action )
- <page-action>
-
- "title" >>rest
-
- [
- validate-title
- list-revisions "revisions" set-value
- ] >>init
-
- { wiki "revisions" } >>template
-
- <revisions-boilerplate>
- <article-boilerplate> ;
-
-: <list-revisions-feed-action> ( -- action )
- <feed-action>
-
- "title" >>rest
-
- [ validate-title ] >>init
-
- [ "Revisions of " "title" value append ] >>title
-
- [ "title" value revisions-url ] >>url
-
- [ list-revisions ] >>entries ;
-
-: rollback-description ( description -- description' )
- [ "Rollback of '" "'" surround ] [ "Rollback" ] if* ;
-
-: <rollback-action> ( -- action )
- <action>
-
- [ validate-integer-id ] >>validate
-
- [
- "id" value <revision> select-tuple
- f >>id
- now >>date
- username >>author
- [ rollback-description ] change-description
- [ add-revision ]
- [ title>> revisions-url <redirect> ] bi
- ] >>submit
-
- <protected>
- "rollback wiki articles" >>description ;
-
-: list-changes ( -- seq )
- f <revision> select-tuples
- reverse-chronological-order ;
-
-: <list-changes-action> ( -- action )
- <page-action>
- [ list-changes "revisions" set-value ] >>init
- { wiki "changes" } >>template
-
- <revisions-boilerplate> ;
-
-: <list-changes-feed-action> ( -- action )
- <feed-action>
- [ URL" $wiki/changes" ] >>url
- [ "All changes" ] >>title
- [ list-changes ] >>entries ;
-
-: <delete-action> ( -- action )
- <action>
-
- [ validate-title ] >>validate
-
- [
- "title" value <article> delete-tuples
- f <revision> "title" value >>title delete-tuples
- URL" $wiki" <redirect>
- ] >>submit
-
- <protected>
- "delete wiki articles" >>description
- { can-delete-wiki-articles? } >>capabilities ;
-
-: <diff-action> ( -- action )
- <page-action>
-
- [
- {
- { "old-id" [ v-integer ] }
- { "new-id" [ v-integer ] }
- } validate-params
-
- "old-id" "new-id"
- [ value <revision> select-tuple ] bi@
- [
- over title>> "title" set-value
- [ "old" [ from-object ] nest-form ]
- [ "new" [ from-object ] nest-form ]
- bi*
- ]
- [ [ content>> string-lines ] bi@ diff "diff" set-value ]
- 2bi
- ] >>init
-
- { wiki "diff" } >>template
-
- <article-boilerplate> ;
-
-: <list-articles-action> ( -- action )
- <page-action>
-
- [
- f <article> select-tuples
- [ title>> ] sort-with
- "articles" set-value
- ] >>init
-
- { wiki "articles" } >>template ;
-
-: list-user-edits ( -- seq )
- f <revision> "author" value >>author select-tuples
- reverse-chronological-order ;
-
-: <user-edits-action> ( -- action )
- <page-action>
-
- "author" >>rest
-
- [
- validate-author
- list-user-edits "revisions" set-value
- ] >>init
-
- { wiki "user-edits" } >>template
-
- <revisions-boilerplate> ;
-
-: <user-edits-feed-action> ( -- action )
- <feed-action>
- "author" >>rest
- [ validate-author ] >>init
- [ "Edits by " "author" value append ] >>title
- [ "author" value user-edits-url ] >>url
- [ list-user-edits ] >>entries ;
-
-: init-sidebars ( -- )
- "Contents" latest-revision [ "contents" [ from-object ] nest-form ] when*
- "Footer" latest-revision [ "footer" [ from-object ] nest-form ] when* ;
-
-: init-relative-link-prefix ( -- )
- URL" $wiki/view/" adjust-url present relative-link-prefix set ;
-
-: <wiki> ( -- dispatcher )
- wiki new-dispatcher
- <main-article-action> "" add-responder
- <view-article-action> "view" add-responder
- <view-revision-action> "revision" add-responder
- <random-article-action> "random" add-responder
- <list-revisions-action> "revisions" add-responder
- <list-revisions-feed-action> "revisions.atom" add-responder
- <diff-action> "diff" add-responder
- <edit-article-action> "edit" add-responder
- <submit-article-action> "submit" add-responder
- <rollback-action> "rollback" add-responder
- <user-edits-action> "user-edits" add-responder
- <list-articles-action> "articles" add-responder
- <list-changes-action> "changes" add-responder
- <user-edits-feed-action> "user-edits.atom" add-responder
- <list-changes-feed-action> "changes.atom" add-responder
- <delete-action> "delete" add-responder
- <boilerplate>
- [ init-sidebars init-relative-link-prefix ] >>init
- { wiki "wiki-common" } >>template ;
-
-: init-wiki ( -- )
- "resource:extra/webapps/wiki/initial-content" [
- [
- dup ".txt" ?tail [
- swap ascii file-contents
- f <revision>
- swap >>content
- swap >>title
- "slava" >>author
- now >>date
- add-revision
- ] [ 2drop ] if
- ] each
- ] with-directory-files ; \ No newline at end of file
diff --git a/tests/examplefiles/xml_example b/tests/examplefiles/xml_example
deleted file mode 100644
index e657e564..00000000
--- a/tests/examplefiles/xml_example
+++ /dev/null
@@ -1,1897 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Ada" version="1.04" kateversion="2.1" section="Sources" extensions="*.adb;*.ads;*.ada;*.a" mimetype="text/x-adasrc">
- <highlighting>
- <list name="keywords">
- <item> abort </item>
- <item> abs </item>
- <item> abstract </item>
- <item> accept </item>
- <item> access </item>
- <item> aliased </item>
- <item> all </item>
- <item> and </item>
- <item> array </item>
- <item> at </item>
- <item> begin </item>
- <item> body </item>
- <item> constant </item>
- <item> declare </item>
- <item> delay </item>
- <item> delta </item>
- <item> digits </item>
- <item> do </item>
- <item> else </item>
- <item> elsif </item>
- <item> end </item>
- <item> entry </item>
- <item> exception </item>
- <item> exit </item>
- <item> for </item>
- <item> function </item>
- <item> generic </item>
- <item> goto </item>
- <item> in </item>
- <item> is </item>
- <item> limited </item>
- <item> mod </item>
- <item> new </item>
- <item> not </item>
- <item> null </item>
- <item> of </item>
- <item> or </item>
- <item> others </item>
- <item> out </item>
- <item> package </item>
- <item> pragma </item>
- <item> private </item>
- <item> procedure </item>
- <item> protected </item>
- <item> raise </item>
- <item> range </item>
- <item> rem </item>
- <item> record </item>
- <item> renames </item>
- <item> requeue </item>
- <item> return </item>
- <item> reverse </item>
- <item> separate </item>
- <item> subtype </item>
- <item> tagged </item>
- <item> task </item>
- <item> terminate </item>
- <item> then </item>
- <item> type </item>
- <item> until </item>
- <item> use </item>
- <item> when </item>
- <item> while </item>
- <item> with </item>
- <item> xor </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Default">
- <RegExpr attribute="Keyword" context="#stay" String="^\s*if " insensitive="TRUE" beginRegion="Region1"/>
- <StringDetect attribute="Keyword" context="#stay" String="end if" insensitive="TRUE" endRegion="Region1"/>
- <RegExpr attribute="Keyword" context="#stay" String="^\s*case " insensitive="TRUE" beginRegion="Region2"/>
- <StringDetect attribute="Keyword" context="#stay" String="end case" insensitive="TRUE" endRegion="Region2"/>
- <RegExpr attribute="Keyword" context="#stay" String="\sloop\s+" insensitive="TRUE" beginRegion="Region3"/>
- <RegExpr attribute="Keyword" context="#stay" String="\sloop$" insensitive="TRUE" beginRegion="Region3"/>
- <StringDetect attribute="Keyword" context="#stay" String="end loop;" insensitive="TRUE" endRegion="Region3"/>
- <RegExpr attribute="Keyword" context="#stay" String="\sselect\s+" insensitive="TRUE" beginRegion="Region4"/>
- <RegExpr attribute="Keyword" context="#stay" String="\sselect$" insensitive="TRUE" beginRegion="Region4"/>
- <StringDetect attribute="Keyword" context="#stay" String="end select;" insensitive="TRUE" endRegion="Region4"/>
- <keyword attribute="Keyword" context="#stay" String="keywords"/>
- <Float attribute="Float" context="#stay"/>
- <Int attribute="Decimal" context="#stay"/>
- <RegExpr attribute="Char" context="#stay" String="'.'"/>
- <DetectChar attribute="String" context="String" char="&quot;"/>
- <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>
- </context>
- <context attribute="String" lineEndContext="#pop" name="String">
- <DetectChar attribute="String" context="#pop" char="&quot;"/>
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal" />
- <itemData name="Keyword" defStyleNum="dsKeyword" />
- <itemData name="Decimal" defStyleNum="dsDecVal" />
- <itemData name="Base-N" defStyleNum="dsBaseN" />
- <itemData name="Float" defStyleNum="dsFloat" />
- <itemData name="Char" defStyleNum="dsChar" />
- <itemData name="String" defStyleNum="dsString" />
- <itemData name="Comment" defStyleNum="dsComment" />
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="--" />
- </comments>
- <keywords casesensitive="0" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Asm6502" version="1.03" kateversion="2.1" section="Sources" extensions="*.asm" mimetype="text/x-asm6502">
- <highlighting>
- <list name = "opcodes6502">
-
-
- </list>
-
-
-
-
-
- <contexts>
- <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">
-
-
- <RegExpr String= "#define.*$" attribute = "Preprocessor" context="#stay"/>
- <RegExpr String= "#include .*$" attribute = "Preprocessor" context="#stay"/>
- <RegExpr String= ";.*$" attribute = "Comment" context="#stay"/>
- <RegExpr String= "\.byte" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.byt" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.word" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.asc" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.dsb" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.fopt" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.text" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.data" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.bss" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.zero" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\.align" attribute = "Data Type" context="#stay"/>
- <RegExpr String= "\$[A-Za-z0-9]*" attribute = "Hex" context="#stay"/>
- <RegExpr String= ",x$" attribute = "Keyword" context="#stay" insensitive="TRUE"/>
- <RegExpr String= ",y$" attribute = "Keyword" context="#stay" insensitive="TRUE"/>
- <RegExpr String= "#" attribute = "Keyword" context="#stay" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="TAX" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="ADC" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="AND" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="ASL" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BCC" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BCS" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BEQ" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BIT" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BMI" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BNE" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BPL" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BRK" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BVC" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="BVS" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="CLC" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="CLD" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="CLI" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="CLV" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="CMP" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="CPX" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="CPY" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="DEC" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="DEX" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="DEY" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="EOR" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="INC" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="INX" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="INY" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="JMP" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="JSR" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="LDA" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="LDX" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="LDY" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="LSR" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="NOP" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="ORA" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="PHA" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="PHP" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="PLA" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="PLP" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="ROL" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="ROR" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="RTI" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="RTS" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="SBC" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="SEC" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="SED" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="SEI" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="STA" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="STX" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="STY" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="TAY" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="TSX" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="TXA" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="TXS" insensitive="TRUE"/>
- <StringDetect attribute="Keyword" context="#stay" String="TYA" insensitive="TRUE"/>
-
- <keyword String = "opcodes6502" attribute = "Keyword" context = "#stay" />
- <RegExpr String= "\*=" attribute = "Decimal" context="#stay"/>
- <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>
- <AnyChar String = "-+&lt;&gt;=;" attribute = "Operator" context = "#stay"/>
- <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
-
-
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
- </context>
- </contexts>
-
- <itemDatas>
- <itemData name = "Normal Text" defStyleNum = "dsNormal"/>
- <itemData name = "Keyword" defStyleNum = "dsKeyword"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Data Type" defStyleNum="dsDataType"/>
- <itemData name="Hex" defStyleNum="dsBaseN"/>
- <itemData name = "String" defStyleNum = "dsString"/>
- <itemData name = "Comment" defStyleNum = "dsComment"/>
- <itemData name = "Substitution" defStyleNum = "dsOthers"/>
- <itemData name="Preprocessor" defStyleNum="dsOthers"/>
- <itemData name = "Parameter" defStyleNum = "dsOthers"/>
- <itemData name = "Operator" defStyleNum = "dsOthers"/>
- <itemData name = "Command" defStyleNum = "dsNormal"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start=";"/>
- <comment name="multiLine" start="/*" end="*/"/>
- </comments>
- <keywords casesensitive="1"/>
- </general>
-</language>
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="AWK" version="0.1" kateversion="2.1" section="Scripts" extensions="*.awk" mimetype="text/x-awk">
- <highlighting>
- <list name="keywords">
- <item>BEGIN</item>
- <item>END</item>
- <item>if</item>
- <item>else</item>
- <item>while</item>
- <item>do</item>
- <item>for</item>
- <item>in</item>
- <item>continue</item>
- <item>break</item>
- <item>print</item>
- <item>printf</item>
- <item>getline</item>
- <item>function</item>
- <item>return</item>
- <item>next</item>
- <item>exit</item>
- </list>
- <list name="builtins">
- <item>ARGC</item>
- <item>ARGV</item>
- <item>CONVFMT</item>
- <item>ENVIRON</item>
- <item>FILENAME</item>
- <item>FNR</item>
- <item>FS</item>
- <item>NF</item>
- <item>NR</item>
- <item>OFMT</item>
- <item>OFS</item>
- <item>ORS</item>
- <item>RS</item>
- <item>RSTART</item>
- <item>RLENGTH</item>
- <item>SUBSEP</item>
- </list>
- <list name="functions">
- <item>gsub</item>
- <item>index</item>
- <item>length</item>
- <item>match</item>
- <item>split</item>
- <item>sprintf</item>
- <item>sub</item>
- <item>substr</item>
- <item>tolower</item>
- <item>toupper</item>
- <item>atan2</item>
- <item>cos</item>
- <item>exp</item>
- <item>int</item>
- <item>log</item>
- <item>rand</item>
- <item>sin</item>
- <item>sqrt</item>
- <item>srand</item>
- <item>close</item>
- <item>fflush</item>
- <item>system</item>
- </list>
- <contexts>
- <context name="Base" attribute="Normal" lineEndContext="#stay">
- <keyword String="keywords" attribute="Keyword" context="#stay"/>
- <keyword String="builtins" attribute="Builtin" context="#stay"/>
- <keyword String="functions" attribute="Function" context="#stay"/>
- <Int attribute="Decimal" context="#stay"/>
- <Float attribute="Float" context="#stay"/>
- <RegExpr String="\$[A-Za-z0-9_]+" attribute="Field" context="#stay"/>
- <DetectChar char="&quot;" attribute="String" context="String"/>
- <DetectChar char="/" attribute="Pattern" context="Pattern"/>
- <RegExpr String="#.*$" attribute="Comment" context="#stay"/>
- </context>
- <context name="String" attribute="String" lineEndContext="#stay">
- <DetectChar char="&quot;" attribute="String" context="#pop"/>
- <HlCStringChar attribute="String" context="#stay"/>
- </context>
- <context name="Pattern" attribute="Pattern" lineEndContext="#stay">
- <DetectChar char="/" attribute="Pattern" context="#pop"/>
- <RegExpr String="\\." attribute="Pattern" context="#stay"/>
- </context>
- <context name="Field" attribute="Field" lineEndContext="#stay">
- <RegExpr String="\$[A-Za-z0-9_]+" attribute="Field" context="#pop"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Builtin" defStyleNum="dsDataType"/>
- <itemData name="Function" defStyleNum="dsKeyword"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Pattern" defStyleNum="dsString"/>
- <itemData name="Field" defStyleNum="dsOthers"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="#"/>
- </comments>
- <keywords casesensitive="1" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Bash" version="1.08" kateversion="2.2" section="Scripts" extensions="*.sh" mimetype="application/x-shellscript">
- <highlighting>
- <list name = "keywords">
- <item> break </item>
- <item> case </item>
- <item> else </item>
- <item> esac </item>
- <item> exit </item>
- <item> export </item>
- <item> for </item>
- <item> function </item>
- <item> in </item>
- <item> return </item>
- <item> select </item>
- <item> then </item>
- <item> until </item>
- <item> while </item>
- <item> . </item>
- <item> done </item>
- <item> do </item>
- <item> elif </item>
- <item> fi </item>
- <item> if </item>
-
- </list>
- <list name = "commands">
- <item> cp </item>
- <item> date </item>
- <item> echo </item>
- <item> eval </item>
- <item> dcop </item>
- <item> dcopstart </item>
- <item> dcopfind </item>
- </list>
- <contexts>
- <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">
- <RegExpr attribute="Keyword" context="#stay" String="\bdone\b" insensitive="TRUE" endRegion="dodone1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\bdo\b" insensitive="TRUE" beginRegion="dodone1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\belif\b" insensitive="TRUE" beginRegion="iffi1" endRegion="iffi1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\bif\b" insensitive="TRUE" beginRegion="iffi1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\bfi\b" insensitive="TRUE" endRegion="iffi1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\bcase\b" insensitive="TRUE" beginRegion="case1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\besac\b" insensitive="TRUE" endRegion="case1"/>
- <RegExpr attribute="Keyword" context="#stay" String="^[^()]+\)" insensitive="TRUE" beginRegion="subcase1"/>
- <StringDetect attribute="Keyword" context="#stay" String=";;" insensitive="TRUE" endRegion="subcase1"/>
- <DetectChar attribute="Keyword" context="#stay" char="{" beginRegion="func1"/>
- <DetectChar attribute="Keyword" context="#stay" char="}" endRegion="func1"/>
-
- <keyword String = "keywords" attribute = "Keyword" context = "#stay"/>
- <keyword String = "commands" attribute = "Command" context = "#stay"/>
- <Int attribute = "Decimal" context = "#stay"/>
- <RegExpr String = "\$[A-Za-z0-9_?{}!]+" attribute = "Parameter" context = "#stay"/>
- <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>
- <AnyChar String = "|&lt;&gt;=;" attribute = "Operator" context = "#stay"/>
- <DetectChar char="'" attribute = "String" context = "Single Quote"/>
- <DetectChar char="`" attribute = "Substitution" context = "Substitution"/>
- <Detect2Chars attribute = "Normal Text" context = "#stay" char = "\" char1 = "#"/>
- <RegExpr String= "#.*$" attribute = "Comment" context="#stay"/>
-
- </context>
- <context name = "String" attribute = "String" lineEndContext="#stay">
- <StringDetect String = "\\" attribute = "String" context = "#stay"/>
- <StringDetect String = "\&quot;" attribute = "String" context = "#stay"/>
- <DetectChar char = "&quot;" attribute = "String" context = "#pop"/>
- </context>
- <context name = "Single Quote" attribute = "String" lineEndContext="#stay">
- <StringDetect String = "\\" attribute = "String" context = "#stay"/>
- <StringDetect String = "\'" attribute = "String" context = "#stay"/>
- <DetectChar char = "'" attribute = "String" context = "#pop"/>
- </context>
- <context name = "Substitution" attribute = "Substitution" lineEndContext="#stay">
- <StringDetect String = "\\" attribute = "String" context = "#stay"/>
- <StringDetect String = "\`" attribute = "String" context = "#stay"/>
- <DetectChar char = "`" attribute = "Substitution" context = "#pop"/>
- </context>
- <context name = "Parameter" attribute = "Parameter" lineEndContext="#stay">
- <RegExpr String = "\$[A-Za-z0-9_?]+" attribute = "Parameter" context="#pop"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name = "Normal Text" defStyleNum = "dsNormal"/>
- <itemData name = "Keyword" defStyleNum = "dsKeyword"/>
- <itemData name = "Decimal" defStyleNum = "dsDecVal"/>
- <itemData name = "Float" defStyleNum = "dsFloat"/>
- <itemData name = "Char" defStyleNum = "dsChar"/>
- <itemData name = "String" defStyleNum = "dsString"/>
- <itemData name = "Comment" defStyleNum = "dsComment"/>
- <itemData name = "Substitution" defStyleNum = "dsOthers"/>
- <itemData name = "Parameter" defStyleNum = "dsOthers"/>
- <itemData name = "Operator" defStyleNum = "dsOthers"/>
- <itemData name = "Command" defStyleNum = "dsNormal"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="#"/>
- </comments>
- <keywords casesensitive="1"/>
- </general>
-</language>
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language>
-<language name="BibTeX" version="0.1" extensions="*.bib" section="Markup" mimetype="text/x-bib" casesensitive="1">
- <highlighting>
- <contexts>
- <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
- <DetectChar char="@" attribute="Bib Item" context="Bib Item" />
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- </context>
-
- <context name="Bib Item" attribute="Bib Item" lineEndContext="#stay">
- <DetectChar char="{" attribute="Normal Text" context="Ref Key" />
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- </context>
-
- <context name="Ref Key" attribute="Ref Key" lineEndContext="#stay">
- <DetectChar char="," attribute="Normal Text" context="Keyword" />
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- </context>
-
- <context name="Keyword" attribute="Keyword" lineEndContext="#stay">
- <RegExpr String="\\." attribute="Keyword" context="#stay"/>
- <DetectChar char="@" attribute="Bib Item" context="Bib Item"/>
- <DetectChar char="=" attribute="Normal Text" context="#stay"/>
- <DetectChar char="," attribute="Normal Text" context="#stay"/>
- <DetectChar char='"' attribute="Value" context="Value"/>
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- </context>
-
- <context name="Value" attribute="Value" lineEndContext="#stay">
- <Detect2Chars char="\" char1='"' attribute="Value" context="#stay"/>
- <DetectChar char='"' attribute="Value" context="Keyword"/>
- </context>
-
- <context name="Comment" attribute="5" lineEndContext="#pop">
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Bib Item" defStyleNum="dsNormal" color="#0000ff" selColor="#ffff00" bold="1" italic="0"/>
- <itemData name="Keyword" defStyleNum="dsNormal" color="#000000" selColor="#dddddd" bold="0" italic="0"/>
- <itemData name="Value" defStyleNum="dsNormal" color="#aa5500" selColor="#22aaff" bold="0" italic="0"/>
- <itemData name="Ref Key" defStyleNum="dsNormal" color="#007700" selColor="#00aa00" bold="1" italic="0"/>
- <itemData name="Comment" defStyleNum="dsNormal" color="#aaaaaa" selColor="#222222" bold="0" italic="0"/>
- </itemDatas>
- </highlighting><general>
- <comments>
- <comment name="singleLine" start="%" />
- </comments>
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="C" version="1.09" kateversion="2.1" section="Sources" extensions="*.c;*.C;*.h" mimetype="text/x-csrc;text/x-c++src;text/x-chdr" priority="5">
- <highlighting>
- <list name="keywords">
- <item> break </item>
- <item> case </item>
- <item> continue </item>
- <item> default </item>
- <item> do </item>
- <item> else </item>
- <item> enum </item>
- <item> extern </item>
- <item> for </item>
- <item> goto </item>
- <item> if </item>
- <item> inline </item>
- <item> return </item>
- <item> sizeof </item>
- <item> struct </item>
- <item> switch </item>
- <item> typedef </item>
- <item> union </item>
- <item> while </item>
- </list>
- <list name="types">
- <item> auto </item>
- <item> char </item>
- <item> const </item>
- <item> double </item>
- <item> float </item>
- <item> int </item>
- <item> long </item>
- <item> register </item>
- <item> restrict </item>
- <item> short </item>
- <item> signed </item>
- <item> static </item>
- <item> unsigned </item>
- <item> void </item>
- <item> volatile </item>
- <item> _Imaginary </item>
- <item> _Complex </item>
- <item> _Bool </item>
- </list>
- <list name="attention">
- <item> FIXME </item>
- <item> TODO </item>
- <item> ### </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <keyword attribute="Keyword" context="#stay" String="keywords"/>
- <keyword attribute="Data Type" context="#stay" String="types"/>
- <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
- <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
- <Float attribute="Float" context="#stay">
- <AnyChar String="fF" attribute="Float" context="#stay"/>
- </Float>
- <HlCOct attribute="Octal" context="#stay"/>
- <HlCHex attribute="Hex" context="#stay"/>
- <Int attribute="Decimal" context="#stay" >
- <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
- </Int>
- <HlCChar attribute="Char" context="#stay"/>
- <DetectChar attribute="String" context="String" char="&quot;"/>
- <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
- <StringDetect attribute="Preprocessor" context="Outscoped" String="#if 0" insensitive="FALSE"/>
- <DetectChar attribute="Preprocessor" context="Preprocessor" char="#"/>
- <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*[(])" />
- <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
- <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
- </context>
- <context attribute="String" lineEndContext="#pop" name="String">
- <LineContinue attribute="String" context="#stay"/>
- <HlCStringChar attribute="String Char" context="#stay"/>
- <DetectChar attribute="String" context="#pop" char="&quot;"/>
- </context>
- <context attribute="Normal Text" lineEndContext="#pop" name="Member">
- <RegExpr attribute="Function" context="#pop" String="\b[_\w][_\w\d]*(?=[\s]*)" />
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
- <keyword attribute="Decimal" context="#stay" String="attention" />
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
- <keyword attribute="Decimal" context="#stay" String="attention" />
- </context>
- <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
- <LineContinue attribute="Preprocessor" context="#stay"/>
- <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>
- <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>
- <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
- <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
- <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2"/>
- </context>
- <context attribute="Preprocessor" lineEndContext="#pop" name="Define">
- <LineContinue attribute="Preprocessor" context="#stay"/>
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />
- </context>
- <context attribute="Normal Text" lineEndContext="#pop" name="Some Context"/>
- <context attribute="Normal Text" lineEndContext="#pop" name="Some Context2"/>
- <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
- <keyword attribute="Decimal" context="#stay" String="attention" />
- <RegExpr attribute="Comment" context="Outscoped intern" String="^#if" />
- <RegExpr attribute="Preprocessor" context="#pop" String="#endif" />
- <RegExpr attribute="Preprocessor" context="#pop" String="#else" />
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
- <RegExpr attribute="Comment" context="Outscoped intern" String="#if" />
- <RegExpr attribute="Comment" context="#pop" String="#endif" />
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Function" defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Data Type" defStyleNum="dsDataType"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Octal" defStyleNum="dsBaseN"/>
- <itemData name="Hex" defStyleNum="dsBaseN"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Char" defStyleNum="dsChar"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="String Char" defStyleNum="dsChar"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Symbol" defStyleNum="dsNormal"/>
- <itemData name="Preprocessor" defStyleNum="dsOthers"/>
- <itemData name="Prep. Lib" defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="//" />
- <comment name="multiLine" start="/*" end="*/" />
- </comments>
- <keywords casesensitive="1" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="ChangeLog" version="1.01" kateversion="2.1" section="Other" extensions="ChangeLog" mimetype="">
- <highlighting>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <RegExpr attribute="Keyword" context="#stay" String="^\d\d\d\d\s*-\s*\d\d\s*-\s*\d\d.*$"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Identifier" defStyleNum="dsOthers"/>
- <itemData name="Types" defStyleNum="dsDataType"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- </itemDatas>
- </highlighting>
- <general>
- <keywords casesensitive="1" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Cisco" version="1.09" kateversion="2.2" section="Scripts"
- extensions="*.cis" mimetype="text/cisco"
- author="Raphaël GRAPINET" license="LGPL">
- <highlighting>
- <list name = "commands">
- <item> aaa </item>
- <item> access-list </item>
- <item> address </item>
- <item> alias </item>
- <item> arp </item>
- <item> async-bootp </item>
- <item> banner </item>
- <item> boot </item>
- <item> bridge </item>
- <item> buffers </item>
- <item> busy-message </item>
- <item> call-history-mib </item>
- <item> cdp </item>
- <item> chat-script </item>
- <item> class-map </item>
- <item> clock </item>
- <item> cns </item>
- <item> config-register </item>
- <item> controller </item>
- <item> crypto </item>
- <item> default </item>
- <item> default-value </item>
- <item> dialer </item>
- <item> dialer-list </item>
- <item> dnsix-dmdp </item>
- <item> dnsix-nat </item>
- <item> downward-compatible-config </item>
- <item> enable </item>
- <item> end </item>
- <item> exception </item>
- <item> exit </item>
- <item> file </item>
- <item> frame-relay </item>
- <item> help </item>
- <item> hostname </item>
- <item> interface </item>
- <item> ip </item>
- <item> isdn </item>
- <item> isdn-mib </item>
- <item> kerberos </item>
- <item> key </item>
- <item> line </item>
- <item> logging </item>
- <item> login-string </item>
- <item> map-class </item>
- <item> map-list </item>
- <item> memory-size </item>
- <item> menu </item>
- <item> modemcap </item>
- <item> multilink </item>
- <item> netbios </item>
- <item> no </item>
- <item> ntp </item>
- <item> partition </item>
- <item> policy-map </item>
- <item> priority-list </item>
- <item> privilege </item>
- <item> process-max-time </item>
- <item> prompt </item>
- <item> queue-list </item>
- <item> resume-string </item>
- <item> rlogin </item>
- <item> rmon </item>
- <item> route-map </item>
- <item> router </item>
- <item> rtr </item>
- <item> scheduler </item>
- <item> service </item>
- <item> snmp-server </item>
- <item> sntp </item>
- <item> stackmaker </item>
- <item> state-machine </item>
- <item> subscriber-policy </item>
- <item> tacacs-server </item>
- <item> template </item>
- <item> terminal-queue </item>
- <item> tftp-server </item>
- <item> time-range </item>
- <item> username </item>
- <item> virtual-profile </item>
- <item> virtual-template </item>
- <item> vpdn </item>
- <item> vpdn-group </item>
- <item> x25 </item>
- <item> x29 </item>
- </list>
- <list name = "parameters">
- <item> accounting </item>
- <item> accounting-list </item>
- <item> accounting-threshold </item>
- <item> accounting-transits </item>
- <item> address-pool </item>
- <item> as-path </item>
- <item> audit </item>
- <item> auth-proxy </item>
- <item> authentication </item>
- <item> authorization </item>
- <item> bgp-community </item>
- <item> bootp </item>
- <item> cef </item>
- <item> classless </item>
- <item> community-list </item>
- <item> default-gateway </item>
- <item> default-network </item>
- <item> dhcp </item>
- <item> dhcp-server </item>
- <item> domain-list </item>
- <item> domain-lookup </item>
- <item> domain-name </item>
- <item> dvmrp </item>
- <item> exec-callback </item>
- <item> extcommunity-list </item>
- <item> finger </item>
- <item> flow-aggregation </item>
- <item> flow-cache </item>
- <item> flow-export </item>
- <item> forward-protocol </item>
- <item> ftp </item>
- <item> gratuitous-arps </item>
- <item> host </item>
- <item> host-routing </item>
- <item> hp-host </item>
- <item> http </item>
- <item> icmp </item>
- <item> inspect </item>
- <item> local </item>
- <item> mrm </item>
- <item> mroute </item>
- <item> msdp </item>
- <item> multicast </item>
- <item> multicast-routing </item>
- <item> name-server </item>
- <item> nat </item>
- <item> new-model </item>
- <item> ospf </item>
- <item> password </item>
- <item> password-encryption </item>
- <item> pgm </item>
- <item> pim </item>
- <item> port-map </item>
- <item> prefix-list </item>
- <item> radius </item>
- <item> rcmd </item>
- <item> reflexive-list </item>
- <item> route </item>
- <item> routing </item>
- <item> rsvp </item>
- <item> rtcp </item>
- <item> sap </item>
- <item> sdr </item>
- <item> security </item>
- <item> source-route </item>
- <item> subnet-zero </item>
- <item> tacacs </item>
- <item> tcp </item>
- <item> tcp-small-servers </item>
- <item> telnet </item>
- <item> tftp </item>
- <item> timestamps </item>
- <item> udp-small-servers </item>
- <item> vrf </item>
- <item> wccp </item>
- </list>
- <list name = "options">
- <item> accounting </item>
- <item> accounting-list </item>
- <item> accounting-threshold </item>
- <item> accounting-transits </item>
- <item> address-pool </item>
- <item> as-path </item>
- <item> audit </item>
- <item> auth-proxy </item>
- <item> authentication </item>
- <item> authorization </item>
- <item> bgp-community </item>
- <item> bootp </item>
- <item> cef </item>
- <item> classless </item>
- <item> community-list </item>
- <item> default-gateway </item>
- <item> default-network </item>
- <item> dhcp </item>
- <item> dhcp-server </item>
- <item> domain-list </item>
- <item> domain-lookup </item>
- <item> domain-name </item>
- <item> dvmrp </item>
- <item> exec-callback </item>
- <item> extcommunity-list </item>
- <item> finger </item>
- <item> flow-aggregation </item>
- <item> flow-cache </item>
- <item> flow-export </item>
- <item> forward-protocol </item>
- <item> ftp </item>
- <item> gratuitous-arps </item>
- <item> host </item>
- <item> host-routing </item>
- <item> hp-host </item>
- <item> http </item>
- <item> icmp </item>
- <item> inspect </item>
- <item> local </item>
- <item> mrm </item>
- <item> mroute </item>
- <item> msdp </item>
- <item> multicast </item>
- <item> multicast-routing </item>
- <item> name-server </item>
- <item> nat </item>
- <item> new-model </item>
- <item> ospf </item>
- <item> password </item>
- <item> password-encryption </item>
- <item> pgm </item>
- <item> pim </item>
- <item> port-map </item>
- <item> prefix-list </item>
- <item> radius </item>
- <item> rcmd </item>
- <item> reflexive-list </item>
- <item> route </item>
- <item> routing </item>
- <item> rsvp </item>
- <item> rtcp </item>
- <item> sap </item>
- <item> sdr </item>
- <item> security </item>
- <item> source-route </item>
- <item> subnet-zero </item>
- <item> tacacs </item>
- <item> tcp </item>
- <item> tcp-small-servers </item>
- <item> telnet </item>
- <item> tftp </item>
- <item> timestamps </item>
- <item> udp-small-servers </item>
- <item> vrf </item>
- <item> wccp </item>
- </list>
- <contexts>
- <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">
- <RegExpr attribute="Keyword" context="#stay" String="\bdone\b" insensitive="TRUE" endRegion="dodone1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\bdo\b" insensitive="TRUE" beginRegion="dodone1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\belif\b" insensitive="TRUE" beginRegion="iffi1" endRegion="iffi1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\bif\b" insensitive="TRUE" beginRegion="iffi1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\bfi\b" insensitive="TRUE" endRegion="iffi1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\bcase\b" insensitive="TRUE" beginRegion="case1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\besac\b" insensitive="TRUE" endRegion="case1"/>
- <RegExpr attribute="Keyword" context="#stay" String="^[^()]+\)" insensitive="TRUE" beginRegion="subcase1"/>
- <StringDetect attribute="Keyword" context="#stay" String=";;" insensitive="TRUE" endRegion="subcase1"/>
- <DetectChar attribute="Keyword" context="#stay" char="{" beginRegion="func1"/>
- <DetectChar attribute="Keyword" context="#stay" char="}" endRegion="func1"/>
-
- <keyword String = "commands" attribute = "Command" context = "#stay"/>
- <keyword String = "parameters" attribute = "Parameter" context = "#stay"/>
- <keyword String = "options" attribute = "Keyword" context = "#stay"/>
- <Int attribute = "Decimal" context = "#stay"/>
- <RegExpr String = "\$[A-Za-z0-9_?{}!]+" attribute = "Parameter" context = "#stay"/>
- <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>
- <AnyChar String = "|&lt;&gt;=;" attribute = "Operator" context = "#stay"/>
- <DetectChar char="'" attribute = "String" context = "Single Quote"/>
- <DetectChar char="`" attribute = "Substitution" context = "Substitution"/>
- <Detect2Chars attribute = "Normal Text" context = "#stay" char = "\" char1 = "#"/>
- <RegExpr String= "#.*$" attribute = "Comment" context="#stay"/>
-
- </context>
- <context name = "String" attribute = "String" lineEndContext="#stay">
- <StringDetect String = "\\" attribute = "String" context = "#stay"/>
- <StringDetect String = "\&quot;" attribute = "String" context = "#stay"/>
- <DetectChar char = "&quot;" attribute = "String" context = "#pop"/>
- </context>
- <context name = "Single Quote" attribute = "String" lineEndContext="#stay">
- <StringDetect String = "\\" attribute = "String" context = "#stay"/>
- <StringDetect String = "\'" attribute = "String" context = "#stay"/>
- <DetectChar char = "'" attribute = "String" context = "#pop"/>
- </context>
- <context name = "Substitution" attribute = "Substitution" lineEndContext="#stay">
- <StringDetect String = "\\" attribute = "String" context = "#stay"/>
- <StringDetect String = "\`" attribute = "String" context = "#stay"/>
- <DetectChar char = "`" attribute = "Substitution" context = "#pop"/>
- </context>
- <context name = "Parameter" attribute = "Parameter" lineEndContext="#stay">
- <RegExpr String = "\$[A-Za-z0-9_?]+" attribute = "Parameter" context="#pop"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name = "Normal Text" defStyleNum = "dsNormal"/>
- <itemData name = "Keyword" defStyleNum = "dsKeyword"/>
- <itemData name = "Decimal" defStyleNum = "dsDecVal"/>
- <itemData name = "Float" defStyleNum = "dsFloat"/>
- <itemData name = "Char" defStyleNum = "dsChar"/>
- <itemData name = "String" defStyleNum = "dsString"/>
- <itemData name = "Comment" defStyleNum = "dsComment"/>
- <itemData name = "Substitution" defStyleNum = "dsOthers"/>
- <itemData name = "Parameter" defStyleNum = "dsOthers"/>
- <itemData name = "Operator" defStyleNum = "dsOthers"/>
- <itemData name = "Command" defStyleNum = "dsNormal"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="!"/>
- </comments>
- <keywords casesensitive="0"/>
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="ColdFusion" version="1.03" kateversion="2.1" section="Markup" extensions="*.cfm;*.cfc;*.cfml;*.dbm" mimetype="text/x-coldfusion">
-
- <highlighting>
-
- <list name="Script Keywords">
-
- <item> if </item>
- <item> else </item>
- <item> for </item>
- <item> in </item>
- <item> while </item>
- <item> do </item>
- <item> continue </item>
- <item> break </item>
- <item> with </item>
- <item> try </item>
- <item> catch </item>
- <item> switch </item>
- <item> case </item>
- <item> new </item>
- <item> var </item>
- <item> function </item>
- <item> return </item>
- <item> this </item>
- <item> delete </item>
- <item> true </item>
- <item> false </item>
- <item> void </item>
- <item> throw </item>
- <item> typeof </item>
- <item> const </item>
- <item> default </item>
-
- </list>
-
- <list name="Script Objects">
-
- <item> Anchor </item>
- <item> Applet </item>
- <item> Area </item>
- <item> Array </item>
- <item> Boolean </item>
- <item> Button </item>
- <item> Checkbox </item>
- <item> Date </item>
- <item> Document </item>
- <item> Event </item>
- <item> FileUpload </item>
- <item> Form </item>
- <item> Frame </item>
- <item> Function </item>
- <item> Hidden </item>
- <item> History </item>
- <item> Image </item>
- <item> Layer </item>
- <item> Linke </item>
- <item> Location </item>
- <item> Math </item>
- <item> Navigator </item>
- <item> Number </item>
- <item> Object </item>
- <item> Option </item>
- <item> Password </item>
- <item> Radio </item>
- <item> RegExp </item>
- <item> Reset </item>
- <item> Screen </item>
- <item> Select </item>
- <item> String </item>
- <item> Submit </item>
- <item> Text </item>
- <item> Textarea </item>
- <item> Window </item>
-
- </list>
-
- <list name="Script Methods">
-
- <item> abs </item>
- <item> acos </item>
- <item> alert </item>
- <item> anchor </item>
- <item> apply </item>
- <item> asin </item>
- <item> atan </item>
- <item> atan2 </item>
- <item> back </item>
- <item> blur </item>
- <item> call </item>
- <item> captureEvents </item>
- <item> ceil </item>
- <item> charAt </item>
- <item> charCodeAt </item>
- <item> clearInterval </item>
- <item> clearTimeout </item>
- <item> click </item>
- <item> close </item>
- <item> compile </item>
- <item> concat </item>
- <item> confirm </item>
- <item> cos </item>
- <item> disableExternalCapture </item>
- <item> enableExternalCapture </item>
- <item> eval </item>
- <item> exec </item>
- <item> exp </item>
- <item> find </item>
- <item> floor </item>
- <item> focus </item>
- <item> forward </item>
- <item> fromCharCode </item>
- <item> getDate </item>
- <item> getDay </item>
- <item> getFullYear </item>
- <item> getHours </item>
- <item> getMilliseconds </item>
- <item> getMinutes </item>
- <item> getMonth </item>
- <item> getSeconds </item>
- <item> getSelection </item>
- <item> getTime </item>
- <item> getTimezoneOffset </item>
- <item> getUTCDate </item>
- <item> getUTCDay </item>
- <item> getUTCFullYear </item>
- <item> getUTCHours </item>
- <item> getUTCMilliseconds </item>
- <item> getUTCMinutes </item>
- <item> getUTCMonth </item>
- <item> getUTCSeconds </item>
- <item> go </item>
- <item> handleEvent </item>
- <item> home </item>
- <item> indexOf </item>
- <item> javaEnabled </item>
- <item> join </item>
- <item> lastIndexOf </item>
- <item> link </item>
- <item> load </item>
- <item> log </item>
- <item> match </item>
- <item> max </item>
- <item> min </item>
- <item> moveAbove </item>
- <item> moveBelow </item>
- <item> moveBy </item>
- <item> moveTo </item>
- <item> moveToAbsolute </item>
- <item> open </item>
- <item> parse </item>
- <item> plugins.refresh </item>
- <item> pop </item>
- <item> pow </item>
- <item> preference </item>
- <item> print </item>
- <item> prompt </item>
- <item> push </item>
- <item> random </item>
- <item> releaseEvents </item>
- <item> reload </item>
- <item> replace </item>
- <item> reset </item>
- <item> resizeBy </item>
- <item> resizeTo </item>
- <item> reverse </item>
- <item> round </item>
- <item> routeEvent </item>
- <item> scrollBy </item>
- <item> scrollTo </item>
- <item> search </item>
- <item> select </item>
- <item> setDate </item>
- <item> setFullYear </item>
- <item> setHours </item>
- <item> setInterval </item>
- <item> setMilliseconds </item>
- <item> setMinutes </item>
- <item> setMonth </item>
- <item> setSeconds </item>
- <item> setTime </item>
- <item> setTimeout </item>
- <item> setUTCDate </item>
- <item> setUTCFullYear </item>
- <item> setUTCHours </item>
- <item> setUTCMilliseconds </item>
- <item> setUTCMinutes </item>
- <item> setUTCMonth </item>
- <item> setUTCSeconds </item>
- <item> shift </item>
- <item> sin </item>
- <item> slice </item>
- <item> sort </item>
- <item> splice </item>
- <item> split </item>
- <item> sqrt </item>
- <item> stop </item>
- <item> String formatting </item>
- <item> submit </item>
- <item> substr </item>
- <item> substring </item>
- <item> taintEnabled </item>
- <item> tan </item>
- <item> test </item>
- <item> toLocaleString </item>
- <item> toLowerCase </item>
- <item> toSource </item>
- <item> toString </item>
- <item> toUpperCase </item>
- <item> toUTCString </item>
- <item> unshift </item>
- <item> unwatch </item>
- <item> UTC </item>
- <item> valueOf </item>
- <item> watch </item>
- <item> write </item>
- <item> writeln </item>
-
- </list>
-
- <list name="CFSCRIPT Keywords">
-
- <item> break </item>
- <item> case </item>
- <item> catch </item>
- <item> continue </item>
- <item> default </item>
- <item> do </item>
- <item> else </item>
- <item> for </item>
- <item> function </item>
- <item> if </item>
- <item> in </item>
- <item> return </item>
- <item> switch </item>
- <item> try </item>
- <item> var </item>
- <item> while </item>
-
- </list>
-
- <list name="CFSCRIPT Functions">
-
- <item> Abs </item>
- <item> ACos </item>
- <item> ArrayAppend </item>
- <item> ArrayAvg </item>
- <item> ArrayClear </item>
- <item> ArrayDeleteAt </item>
- <item> ArrayInsertAt </item>
- <item> ArrayIsEmpty </item>
- <item> ArrayLen </item>
- <item> ArrayMax </item>
- <item> ArrayMin </item>
- <item> ArrayNew </item>
- <item> ArrayPrepend </item>
- <item> ArrayResize </item>
- <item> ArraySet </item>
- <item> ArraySort </item>
- <item> ArraySum </item>
- <item> ArraySwap </item>
- <item> ArrayToList </item>
- <item> Asc </item>
- <item> ASin </item>
- <item> Atn </item>
- <item> BitAnd </item>
- <item> BitMaskClear </item>
- <item> BitMaskRead </item>
- <item> BitMaskSet </item>
- <item> BitNot </item>
- <item> BitOr </item>
- <item> BitSHLN </item>
- <item> BitSHRN </item>
- <item> BitXor </item>
- <item> Ceiling </item>
- <item> Chr </item>
- <item> CJustify </item>
- <item> Compare </item>
- <item> CompareNoCase </item>
- <item> Cos </item>
- <item> CreateDate </item>
- <item> CreateDateTime </item>
- <item> CreateObject </item>
- <item> CreateODBCDate </item>
- <item> CreateODBCDateTime </item>
- <item> CreateODBCTime </item>
- <item> CreateTime </item>
- <item> CreateTimeSpan </item>
- <item> CreateUUID </item>
- <item> DateAdd </item>
- <item> DateCompare </item>
- <item> DateConvert </item>
- <item> DateDiff </item>
- <item> DateFormat </item>
- <item> DatePart </item>
- <item> Day </item>
- <item> DayOfWeek </item>
- <item> DayOfWeekAsString </item>
- <item> DayOfYear </item>
- <item> DaysInMonth </item>
- <item> DaysInYear </item>
- <item> DE </item>
- <item> DecimalFormat </item>
- <item> DecrementValue </item>
- <item> Decrypt </item>
- <item> DeleteClientVariable </item>
- <item> DirectoryExists </item>
- <item> DollarFormat </item>
- <item> Duplicate </item>
- <item> Encrypt </item>
- <item> Evaluate </item>
- <item> Exp </item>
- <item> ExpandPath </item>
- <item> FileExists </item>
- <item> Find </item>
- <item> FindNoCase </item>
- <item> FindOneOf </item>
- <item> FirstDayOfMonth </item>
- <item> Fix </item>
- <item> FormatBaseN </item>
- <item> GetAuthUser </item>
- <item> GetBaseTagData </item>
- <item> GetBaseTagList </item>
- <item> GetBaseTemplatePath </item>
- <item> GetClientVariablesList </item>
- <item> GetCurrentTemplatePath </item>
- <item> GetDirectoryFromPath </item>
- <item> GetException </item>
- <item> GetFileFromPath </item>
- <item> GetFunctionList </item>
- <item> GetHttpRequestData </item>
- <item> GetHttpTimeString </item>
- <item> GetK2ServerDocCount </item>
- <item> GetK2ServerDocCountLimit </item>
- <item> GetLocale </item>
- <item> GetMetaData </item>
- <item> GetMetricData </item>
- <item> GetPageContext </item>
- <item> GetProfileSections </item>
- <item> GetProfileString </item>
- <item> GetServiceSettings </item>
- <item> GetTempDirectory </item>
- <item> GetTempFile </item>
- <item> GetTemplatePath </item>
- <item> GetTickCount </item>
- <item> GetTimeZoneInfo </item>
- <item> GetToken </item>
- <item> Hash </item>
- <item> Hour </item>
- <item> HTMLCodeFormat </item>
- <item> HTMLEditFormat </item>
- <item> IIf </item>
- <item> IncrementValue </item>
- <item> InputBaseN </item>
- <item> Insert </item>
- <item> Int </item>
- <item> IsArray </item>
- <item> IsBinary </item>
- <item> IsBoolean </item>
- <item> IsCustomFunction </item>
- <item> IsDate </item>
- <item> IsDebugMode </item>
- <item> IsDefined </item>
- <item> IsK2ServerABroker </item>
- <item> IsK2ServerDocCountExceeded </item>
- <item> IsK2ServerOnline </item>
- <item> IsLeapYear </item>
- <item> IsNumeric </item>
- <item> IsNumericDate </item>
- <item> IsObject </item>
- <item> IsQuery </item>
- <item> IsSimpleValue </item>
- <item> IsStruct </item>
- <item> IsUserInRole </item>
- <item> IsWDDX </item>
- <item> IsXmlDoc </item>
- <item> IsXmlElement </item>
- <item> IsXmlRoot </item>
- <item> JavaCast </item>
- <item> JSStringFormat </item>
- <item> LCase </item>
- <item> Left </item>
- <item> Len </item>
- <item> ListAppend </item>
- <item> ListChangeDelims </item>
- <item> ListContains </item>
- <item> ListContainsNoCase </item>
- <item> ListDeleteAt </item>
- <item> ListFind </item>
- <item> ListFindNoCase </item>
- <item> ListFirst </item>
- <item> ListGetAt </item>
- <item> ListInsertAt </item>
- <item> ListLast </item>
- <item> ListLen </item>
- <item> ListPrepend </item>
- <item> ListQualify </item>
- <item> ListRest </item>
- <item> ListSetAt </item>
- <item> ListSort </item>
- <item> ListToArray </item>
- <item> ListValueCount </item>
- <item> ListValueCountNoCase </item>
- <item> LJustify </item>
- <item> Log </item>
- <item> Log10 </item>
- <item> LSCurrencyFormat </item>
- <item> LSDateFormat </item>
- <item> LSEuroCurrencyFormat </item>
- <item> LSIsCurrency </item>
- <item> LSIsDate </item>
- <item> LSIsNumeric </item>
- <item> LSNumberFormat </item>
- <item> LSParseCurrency </item>
- <item> LSParseDateTime </item>
- <item> LSParseEuroCurrency </item>
- <item> LSParseNumber </item>
- <item> LSTimeFormat </item>
- <item> LTrim </item>
- <item> Max </item>
- <item> Mid </item>
- <item> Min </item>
- <item> Minute </item>
- <item> Month </item>
- <item> MonthAsString </item>
- <item> Now </item>
- <item> NumberFormat </item>
- <item> ParagraphFormat </item>
- <item> ParameterExists </item>
- <item> ParseDateTime </item>
- <item> Pi </item>
- <item> PreserveSingleQuotes </item>
- <item> Quarter </item>
- <item> QueryAddColumn </item>
- <item> QueryAddRow </item>
- <item> QueryNew </item>
- <item> QuerySetCell </item>
- <item> QuotedValueList </item>
- <item> Rand </item>
- <item> Randomize </item>
- <item> RandRange </item>
- <item> REFind </item>
- <item> REFindNoCase </item>
- <item> RemoveChars </item>
- <item> RepeatString </item>
- <item> Replace </item>
- <item> ReplaceList </item>
- <item> ReplaceNoCase </item>
- <item> REReplace </item>
- <item> REReplaceNoCase </item>
- <item> Reverse </item>
- <item> Right </item>
- <item> RJustify </item>
- <item> Round </item>
- <item> RTrim </item>
- <item> Second </item>
- <item> SetEncoding </item>
- <item> SetLocale </item>
- <item> SetProfileString </item>
- <item> SetVariable </item>
- <item> Sgn </item>
- <item> Sin </item>
- <item> SpanExcluding </item>
- <item> SpanIncluding </item>
- <item> Sqr </item>
- <item> StripCR </item>
- <item> StructAppend </item>
- <item> StructClear </item>
- <item> StructCopy </item>
- <item> StructCount </item>
- <item> StructDelete </item>
- <item> StructFind </item>
- <item> StructFindKey </item>
- <item> StructFindValue </item>
- <item> StructGet </item>
- <item> StructInsert </item>
- <item> StructIsEmpty </item>
- <item> StructKeyArray </item>
- <item> StructKeyExists </item>
- <item> StructKeyList </item>
- <item> StructNew </item>
- <item> StructSort </item>
- <item> StructUpdate </item>
- <item> Tan </item>
- <item> TimeFormat </item>
- <item> ToBase64 </item>
- <item> ToBinary </item>
- <item> ToString </item>
- <item> Trim </item>
- <item> UCase </item>
- <item> URLDecode </item>
- <item> URLEncodedFormat </item>
- <item> URLSessionFormat </item>
- <item> Val </item>
- <item> ValueList </item>
- <item> Week </item>
- <item> WriteOutput </item>
- <item> XmlChildPos </item>
- <item> XmlElemNew </item>
- <item> XmlFormat </item>
- <item> XmlNew </item>
- <item> XmlParse </item>
- <item> XmlSearch </item>
- <item> XmlTransform </item>
- <item> Year </item>
- <item> YesNoFormat </item>
-
- </list>
-
- <contexts>
-
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
- <StringDetect attribute="CF Comment" context="ctxCF Comment" String="&lt;!---" />
- <StringDetect attribute="HTML Comment" context="ctxHTML Comment" String="&lt;!--" />
- <RegExpr attribute="Script Tags" context="ctxCFSCRIPT Tag" String="&lt;[cC][fF][sS][cC][rR][iI][pP][tT]" />
- <RegExpr attribute="Script Tags" context="ctxSCRIPT Tag" String="&lt;[sS][cC][rR][iI][pP][tT]" />
- <RegExpr attribute="Style Tags" context="ctxSTYLE Tag" String="&lt;[sS][tT][yY][lL][eE]" />
- <DetectChar attribute="HTML Entities" context="ctxHTML Entities" char="&amp;" />
- <RegExpr attribute="Custom Tags" context="ctxCustom Tag" String="&lt;\/?[cC][fF]_" />
- <RegExpr attribute="CFX Tags" context="ctxCFX Tag" String="&lt;\/?[cC][fF][xX]_" />
- <RegExpr attribute="CF Tags" context="ctxCF Tag" String="&lt;\/?[cC][fF]" />
- <RegExpr attribute="Table Tags" context="ctxTable Tag" String="&lt;\/?([tT][aAhHbBfFrRdD])|([cC][aA][pP][tT])" />
- <RegExpr attribute="Anchor Tags" context="ctxAnchor Tag" String="&lt;\/?[aA] " />
- <RegExpr attribute="Image Tags" context="ctxImage Tag" String="&lt;\/?[iI][mM][gG] " />
- <RegExpr attribute="Tags" context="ctxTag" String="&lt;!?\/?[a-zA-Z0-9_]+" />
- </context>
-
-
-
- <context name="ctxCFSCRIPT Tag" attribute="Script Tags" lineEndContext="#stay">
- <DetectChar attribute="Script Tags" context="ctxCFSCRIPT Block" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
- <context name="ctxSCRIPT Tag" attribute="Script Tags" lineEndContext="#stay">
- <DetectChar attribute="Script Tags" context="ctxSCRIPT Block" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
- <context name="ctxSTYLE Tag" attribute="Style Tags" lineEndContext="#stay">
- <DetectChar attribute="Style Tags" context="ctxSTYLE Block" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
-
-
- <context name="ctxTag" attribute="Tags" lineEndContext="#stay">
- <DetectChar attribute="Tags" context="#pop" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
- <context name="ctxTable Tag" attribute="Table Tags" lineEndContext="#stay">
- <DetectChar attribute="Table Tags" context="#pop" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
- <context name="ctxAnchor Tag" attribute="Anchor Tags" lineEndContext="#stay">
- <DetectChar attribute="Anchor Tags" context="#pop" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
- <context name="ctxImage Tag" attribute="Image Tags" lineEndContext="#stay">
- <DetectChar attribute="Image Tags" context="#pop" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
- <context name="ctxCF Tag" attribute="CF Tags" lineEndContext="#stay">
- <DetectChar attribute="CF Tags" context="#pop" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
- <context name="ctxCustom Tag" attribute="Custom Tags" lineEndContext="#stay">
- <DetectChar attribute="Custom Tags" context="#pop" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
- <context name="ctxCFX Tag" attribute="CFX Tags" lineEndContext="#stay">
- <DetectChar attribute="CFX Tags" context="#pop" char="&gt;" />
- <DetectChar attribute="Normal Text" context="#stay" char="=" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
-
-
- <context name="ctxHTML Comment" attribute="HTML Comment" lineEndContext="#stay">
- <StringDetect attribute="CF Comment" context="ctxCF Comment" String="&lt;!---" />
- <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
- </context>
-
- <context name="ctxCF Comment" attribute="CF Comment" lineEndContext="#stay">
- <StringDetect attribute="CF Comment" context="#pop" String="---&gt;" />
- </context>
-
- <context name="ctxC Style Comment" attribute="Script Comment" lineEndContext="#stay">
- <Detect2Chars attribute="Script Comment" context="#pop" char="*" char1="/" />
- </context>
-
- <context name="ctxOne Line Comment" attribute="Script Comment" lineEndContext="#pop" />
-
- <context name="ctxHTML Entities" attribute="HTML Entities" lineEndContext="#pop">
- <DetectChar attribute="HTML Entities" context="#pop" char=";" />
- </context>
-
-
-
- <context name="ctxCFSCRIPT Block" attribute="Normal Text" lineEndContext="#stay">
- <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />
- <Detect2Chars attribute="Script Comment" context="ctxOne Line Comment" char="/" char1="/" />
- <RegExpr attribute="Script Strings" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Script Strings" context="#stay" String="'[^']*'" />
- <Int attribute="Script Numbers" context="#stay" />
- <Float attribute="Script Numbers" context="#stay" />
- <AnyChar attribute="Script Operators" context="#stay" String="[()[\]=+-*/]+" />
- <AnyChar attribute="Brackets" context="#stay" String="{}" />
-
- <keyword attribute="Script Keywords" context="#stay" String="CFSCRIPT Keywords" />
- <keyword attribute="Script Functions" context="#stay" String="CFSCRIPT Functions" />
- <RegExpr attribute="Script Tags" context="#pop#pop" String="&lt;/[cC][fF][sS][cC][rR][iI][pP][tT]&gt;" />
- </context>
-
-
-
- <context name="ctxSCRIPT Block" attribute="Normal Text" lineEndContext="#stay">
- <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />
- <Detect2Chars attribute="Script Comment" context="ctxOne Line Comment" char="/" char1="/" />
- <RegExpr attribute="Script Strings" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Script Strings" context="#stay" String="'[^']*'" />
- <Int attribute="Script Numbers" context="#stay" />
- <Float attribute="Script Numbers" context="#stay" />
- <AnyChar attribute="Script Operators" context="#stay" String="[()[\]=+-*/]+" />
- <AnyChar attribute="Brackets" context="#stay" String="{}" />
-
- <keyword attribute="Script Keywords" context="#stay" String="Script Keywords" />
- <keyword attribute="Script Objects" context="#stay" String="Script Objects" />
- <keyword attribute="Script Functions" context="#stay" String="Script Methods" />
- <RegExpr attribute="Script Tags" context="#pop#pop" String="&lt;/[sS][cC][rR][iI][pP][tT]&gt;" />
- </context>
-
-
-
- <context name="ctxSTYLE Block" attribute="Style Selectors" lineEndContext="#stay">
- <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />
- <DetectChar attribute="Brackets" context="ctxStyle Properties" char="{" />
- <RegExpr attribute="Style Tags" context="#pop#pop" String="&lt;/[sS][tT][yY][lL][eE]&gt;" />
- </context>
-
- <context name="ctxStyle Properties" attribute="Style Properties" lineEndContext="#stay">
- <DetectChar attribute="Brackets" context="#pop" char="}" />
- <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />
- <DetectChar attribute="Normal Text" context="ctxStyle Values" char=":" />
- </context>
-
- <context name="ctxStyle Values" attribute="Style Values" lineEndContext="#pop">
- <DetectChar attribute="Normal Text" context="#pop" char=";" />
- <DetectChar attribute="Normal Text" context="#stay" char="," />
- <Int attribute="Numbers" context="#stay" />
- <Float attribute="Numbers" context="#stay" />
- <RegExpr attribute="Numbers" context="#stay" String="#([0-9a-fA-F]{3})|([0-9a-fA-F]{6})" />
- <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
- <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
- </context>
-
- </contexts>
-
- <itemDatas>
-
- <itemData name="Normal Text" defStyleNum="dsNormal" color="#000000" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Tags" defStyleNum="dsNormal" color="#000080" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Table Tags" defStyleNum="dsNormal" color="#008080" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Script Tags" defStyleNum="dsNormal" color="#800000" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Image Tags" defStyleNum="dsNormal" color="#800080" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Style Tags" defStyleNum="dsNormal" color="#800080" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Anchor Tags" defStyleNum="dsNormal" color="#008000" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Attribute Values" defStyleNum="dsNormal" color="#0000ff" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="HTML Comment" defStyleNum="dsComment" color="#008000" selColor="#999999" bold="0" italic="0" />
- <itemData name="CF Comment" defStyleNum="dsComment" color="#ff9900" selColor="#999999" bold="0" italic="0" />
- <itemData name="Script Comment" defStyleNum="dsComment" color="#ff9900" selColor="#999999" bold="0" italic="0" />
- <itemData name="CF Tags" defStyleNum="dsNormal" color="#800000" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Custom Tags" defStyleNum="dsNormal" color="#cc6666" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="CFX Tags" defStyleNum="dsNormal" color="#008000" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Numbers" defStyleNum="dsNormal" color="#0000ff" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="HTML Entities" defStyleNum="dsNormal" color="#000000" selColor="#ffffff" bold="1" italic="0" />
- <itemData name="Style Selectors" defStyleNum="dsNormal" color="#ff00ff" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Style Properties" defStyleNum="dsNormal" color="#000080" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Style Values" defStyleNum="dsNormal" color="#ff0000" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Brackets" defStyleNum="dsNormal" color="#000080" selColor="#ffffff" bold="1" italic="0" />
- <itemData name="Script Numbers" defStyleNum="dsNormal" color="#ff00ff" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Script Strings" defStyleNum="dsNormal" color="#008080" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Script Operators" defStyleNum="dsNormal" color="#0000ff" selColor="#ffffff" bold="0" italic="0" />
- <itemData name="Script Keywords" defStyleNum="dsNormal" color="#0000cc" selColor="#ffffff" bold="1" italic="0" />
- <itemData name="Script Functions" defStyleNum="dsNormal" color="#000080" selColor="#ffffff" bold="1" italic="0" />
- <itemData name="Script Objects" defStyleNum="dsNormal" color="#0000cc" selColor="#ffffff" bold="1" italic="0" />
-
- </itemDatas>
-
- </highlighting>
-
- <general>
-
- <comments>
-
- <comment name="multiLine" start="&lt;!--" end="--&gt;" />
- <comment name="multiLine" start="/*" end="*/" />
- <comment name="singleLine" start="//" />
-
- </comments>
-
- <keywords casesensitive="0" weakDeliminator="-" />
-
- </general>
-
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<!-- Author: Werner Braun <wb@o3-software.de> -->
-<!-- 29.05.2003 wb mailed to the kate-team (cullmann) -->
-<!-- 23.05.2003 wb added *.bro File-Type for GPCP Browser output-->
-<!-- 09.05.2003 wb nested comments allowed (maximum two level nesting) -->
-<!-- 07.04.2003 wb IN Problem solved -->
-<!-- 06.05.2003 wb NEW without ( -->
-<!-- 22.04.2003 wb Minor bugfixes -->
-<!-- 19.04.2003 wb Some more Enhancements -->
-<!-- 18.04.2003 wb Enhancenment for Maior / Minor Comments and Full / ReadOnly Exports, Folds for Procedures, Records, Comments -->
-<!-- 17.04.2003 wb Enhancements for Relation and Operators -->
-<language name="Component-Pascal" version="1.05" kateversion="2.1" section="Sources"
- extensions="*.cp;*.bro" mimetype="text/x-component-pascal"
- author="Werner Braun (wb@o3-software.de)" license="">
- <highlighting>
- <list name="keywords">
- <item> BEGIN </item>
- <item> BY </item>
- <item> CASE </item>
- <item> CLOSE </item>
- <item> CONST </item>
- <item> DO </item>
- <item> ELSE </item>
- <item> ELSIF </item>
- <item> END </item>
- <item> FOR </item>
- <item> IF </item>
- <item> IMPORT </item>
- <item> LOOP </item>
- <item> MODULE </item>
- <item> NEW </item>
- <item> OF </item>
- <item> OUT </item>
- <item> PROCEDURE </item>
- <item> REPEAT </item>
- <item> THEN </item>
- <item> TO </item>
- <item> TYPE </item>
- <item> UNTIL </item>
- <item> VAR </item>
- <item> WHILE </item>
- <item> WITH </item>
- </list>
- <list name="exits">
- <item> ASSERT </item>
- <item> EXIT </item>
- <item> HALT </item>
- <item> RETURN </item>
- </list>
- <list name="types">
- <item> ANYPTR </item>
- <item> ANYREC </item>
- <item> ARRAY </item>
- <item> BOOLEAN </item>
- <item> SHORTCHAR </item>
- <item> CHAR </item>
- <item> BYTE </item>
- <item> SHORTINT </item>
- <item> INTEGER </item>
- <item> LONGINT </item>
- <item> POINTER </item>
- <item> RECORD </item>
- <item> SHORTREAL </item>
- <item> REAL </item>
- <item> SET </item>
- </list>
- <list name="attributes">
- <item> ABSTRACT </item>
- <item> EMPTY </item>
- <item> EXTENSIBLE </item>
- <item> LIMITED </item>
- </list>
- <list name="builtins">
- <item> ABS </item>
- <item> ASH </item>
- <item> BITS </item>
- <item> CAP </item>
- <item> CHR </item>
- <item> DEC </item>
- <item> ENTIER </item>
- <item> EXCL </item>
- <item> INC </item>
- <item> INCL </item>
- <item> LEN </item>
- <item> LONG </item>
- <item> MAX </item>
- <item> MIN </item>
- <item> ODD </item>
- <item> ORD </item>
- <item> SHORT </item>
- <item> SIZE </item>
- </list>
- <list name="specials">
- <item> FALSE </item>
- <item> INF </item>
- <item> NIL </item>
- <item> TRUE </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <StringDetect attribute="CommentMaior" context="Comment1" String="(**" beginRegion="Comment"/>
- <Detect2Chars attribute="CommentMinor" context="Comment2" char="(" char1="*" beginRegion="Comment"/>
- <DetectChar attribute="String" context="String1" char="&quot;" />
- <DetectChar attribute="String" context="String2" char="'" />
- <RegExpr attribute="Keyword" context="#stay" String="PROCEDURE\s" beginRegion="Proc"/>
- <RegExpr attribute="Normal Text" context="#stay" String="ABSTRACT;|EMPTY;|END\s*[A-Za-z][A-Za-z0-9_]*\;" endRegion="Proc"/>
- <RegExpr attribute="Type" context="#stay" String="RECORD" beginRegion="Rec"/>
- <RegExpr attribute="Keyword" context="#stay" String="END" endRegion="Rec"/>
- <StringDetect attribute="MemAlloc" context="#stay" String="NEW"/>
- <keyword attribute="Keyword" context="#stay" String="keywords"/>
- <keyword attribute="Exit" context="#stay" String="exits"/>
- <keyword attribute="Type" context="#stay" String="types"/>
- <keyword attribute="Attribute" context="#stay" String="attributes"/>
- <keyword attribute="Builtin" context="#stay" String="builtins"/>
- <keyword attribute="SpecialValues" context="#stay" String="specials"/>
- <RegExpr attribute="Integer" context="#stay" String="\s[\+|\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))"/>
- <Float attribute="Float" context="#stay"/>
- <RegExpr attribute="Char" context="#stay" String="\s[0-9][0-9A-F]*X"/>
- <RegExpr attribute="ExportFull" context="#stay" String="[A-Za-z][A-Za-z0-9_]*\*"/>
- <RegExpr attribute="ExportReadOnly" context="#stay" String="[A-Za-z][A-Za-z0-9_]*\-"/>
- <RegExpr attribute="Relation" context="#stay" String="\s(=|#|&lt;|&lt;=|&gt;|&gt;=|IN\s|IS)"/>
- <RegExpr attribute="Operator" context="#stay" String="\s(\+|\-|OR|\*|/|DIV|MOD|\&amp;)"/>
- </context>
- <context attribute="CommentMaior" lineEndContext="#stay" name="Comment1">
- <Detect2Chars attribute="CommentMaior" context="#pop" char="*" char1=")" endRegion="Comment"/>
- <Detect2Chars attribute="CommentMinor" context="CommentN" char="(" char1="*"/>
- </context>
- <context attribute="CommentMinor" lineEndContext="#stay" name="Comment2">
- <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")" endRegion="Comment"/>
- <Detect2Chars attribute="CommentMinor" context="CommentN" char="(" char1="*"/>
- </context>
- <context attribute="CommentMinor" lineEndContext="#stay" name="CommentN">
- <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")"/>
- <Detect2Chars attribute="CommentMinor" context="CommentN2" char="(" char1="*"/>
- </context>
- <context attribute="CommentMinor" lineEndContext="#stay" name="CommentN2">
- <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")"/>
- </context>
- <context attribute="String" lineEndContext="#stay" name="String1">
- <DetectChar attribute="String" context="#pop" char="&quot;"/>
- </context>
- <context attribute="String" lineEndContext="#stay" name="String2">
- <DetectChar attribute="String" context="#pop" char="'"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal" />
- <itemData name="CommentMaior" defStyleNum="dsComment" />
- <itemData name="CommentMinor" defStyleNum="dsComment" />
- <itemData name="String" defStyleNum="dsString" />
- <itemData name="Keyword" defStyleNum="dsKeyword" />
- <itemData name="MemAlloc" defStyleNum="dsKeyword" />
- <itemData name="Exit" defStyleNum="dsKeyword"/>
- <itemData name="Type" defStyleNum="dsDataType"/>
- <itemData name="Attribute" defStyleNum="dsOthers"/>
- <itemData name="Builtin" defStyleNum="dsNormal"/>
- <itemData name="Integer" defStyleNum="dsBaseN"/>
- <itemData name="Float" defStyleNum="dsFloat" />
- <itemData name="Char" defStyleNum="dsChar" />
- <itemData name="SpecialValues" defStyleNum="dsDecVal"/>
- <itemData name="ExportFull" defStyleNum="dsOthers"/>
- <itemData name="ExportReadOnly" defStyleNum="dsOthers"/>
- <itemData name="Relation" defStyleNum="dsNormal"/>
- <itemData name="Operator" defStyleNum="dsNormal"/>
- </itemDatas>
- </highlighting>
- <general>
- <keywords casesensitive="1" />
- <comments>
- <comment name="multiLine" start="(*" end="*)" />
- </comments>
- </general>
-</language>
-
diff --git a/tests/examplefiles/xorg.conf b/tests/examplefiles/xorg.conf
deleted file mode 100644
index e1f7164b..00000000
--- a/tests/examplefiles/xorg.conf
+++ /dev/null
@@ -1,48 +0,0 @@
-Section "Files"
- ModulePath "/usr/lib64/opengl/nvidia/extensions"
- ModulePath "/usr/lib64/xorg/modules"
-EndSection
-
-Section "ServerLayout"
- Identifier "XFree86 Configured"
- Screen "Screen"
-EndSection
-
-Section "ServerFlags"
- Option "AutoAddDevices" "false"
-EndSection
-
-Section "Screen"
- Identifier "Screen"
- Device "Card0"
- DefaultDepth 24
- SubSection "Display"
- Depth 24
- EndSubSection
- Option "UseEDIDDpi" "False"
- Option "DPI" "96 x 96"
-EndSection
-
-Section "Device"
- Identifier "Card0"
- Driver "nvidia"
- VendorName "NVIDIA Corporation" # inline comment
- #Option "RenderAccel" "true"
-
- #Option "NvAgp" "3"
- #Option "AllowGLXWithComposite" "true"
- #Option "AddARGBGLXVisuals" "true"
- #Option "XAANoOffscreenPixmaps" "true"
- #Option "DRI" "true"
-
- #Option "UseEvents" "false"
- #Option "TripleBuffer" "1"
- #Option "DamageEvents" "1"
- ##Option "BackingStore" "1"
- #Option "PixmapCacheSize" "70000"
- #Option "OnDemandVBlankInterrupts" "true"
-EndSection
-
-Section "Extensions"
-# Option "Composite" "Disabled"
-EndSection
diff --git a/tests/examplefiles/yahalom.cpsa b/tests/examplefiles/yahalom.cpsa
deleted file mode 100644
index 3bc918d4..00000000
--- a/tests/examplefiles/yahalom.cpsa
+++ /dev/null
@@ -1,34 +0,0 @@
-(herald "Yahalom Protocol with Forwarding Removed")
-
-(defprotocol yahalom basic
- (defrole init
- (vars (a b c name) (n-a n-b text) (k skey))
- (trace (send (cat a n-a))
- (recv (enc b k n-a n-b (ltk a c)))
- (send (enc n-b k))))
- (defrole resp
- (vars (b a c name) (n-a n-b text) (k skey))
- (trace (recv (cat a n-a))
- (send (cat b (enc a n-a n-b (ltk b c))))
- (recv (enc a k (ltk b c)))
- (recv (enc n-b k))))
- (defrole serv
- (vars (c a b name) (n-a n-b text) (k skey))
- (trace (recv (cat b (enc a n-a n-b (ltk b c))))
- (send (enc b k n-a n-b (ltk a c)))
- (send (enc a k (ltk b c))))
- (uniq-orig k)))
-
-(defskeleton yahalom
- (vars (a b c name) (n-b text))
- (defstrand resp 4 (a a) (b b) (c c) (n-b n-b))
- (non-orig (ltk b c) (ltk a c))
- (uniq-orig n-b))
-
-;;; Ensure encryption key remains secret.
-(defskeleton yahalom
- (vars (a b c name) (n-b text) (k skey))
- (defstrand resp 4 (a a) (b b) (c c) (n-b n-b) (k k))
- (deflistener k)
- (non-orig (ltk b c) (ltk a c))
- (uniq-orig n-b))
diff --git a/tests/examplefiles/zmlrpc.f90 b/tests/examplefiles/zmlrpc.f90
deleted file mode 100644
index 441497b3..00000000
--- a/tests/examplefiles/zmlrpc.f90
+++ /dev/null
@@ -1,798 +0,0 @@
-!!$
-!!$
-!!$ MD2P4
-!!$ Multilevel Domain Decomposition Parallel Preconditioner Package for PSBLAS
-!!$ for
-!!$ Parallel Sparse BLAS v2.0
-!!$ (C) Copyright 2006 Salvatore Filippone University of Rome Tor Vergata
-!!$ Alfredo Buttari University of Rome Tor Vergata
-!!$ Daniela Di Serafino II University of Naples
-!!$ Pasqua D'Ambra ICAR-CNR
-!!$
-!!$ Redistribution and use in source and binary forms, with or without
-!!$ modification, are permitted provided that the following conditions
-!!$ are met:
-!!$ 1. Redistributions of source code must retain the above copyright
-!!$ notice, this list of conditions and the following disclaimer.
-!!$ 2. Redistributions in binary form must reproduce the above copyright
-!!$ notice, this list of conditions, and the following disclaimer in the
-!!$ documentation and/or other materials provided with the distribution.
-!!$ 3. The name of the MD2P4 group or the names of its contributors may
-!!$ not be used to endorse or promote products derived from this
-!!$ software without specific written permission.
-!!$
-!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MD2P4 GROUP OR ITS CONTRIBUTORS
-!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-!!$ POSSIBILITY OF SUCH DAMAGE.
-!!$
-!!$
-subroutine psb_zmlprc_aply(alpha,baseprecv,x,beta,y,desc_data,trans,work,info)
- !
- ! Compute Y <- beta*Y + alpha*K^-1 X
- ! where K is a multilevel preconditioner stored in baseprecv
- !
- ! cfr.: Smith, Biorstad & Gropp
- ! Domain Decomposition
- ! Cambridge Univ. Press
- !
- ! To each level I there corresponds a matrix A(I) and a preconditioner K(I)
- !
- ! A notational difference: in the DD reference above the preconditioner for
- ! a given level K(I) is written out as a sum over the subdomains
- !
- ! SUM_k(R_k^T A_k R_k)
- !
- ! whereas in this code the sum is implicit in the parallelization,
- ! i.e. each process takes care of one subdomain, and for each level we have
- ! as many subdomains as there are processes (except for the coarsest level where
- ! we might have a replicated index space). Thus the sum apparently disappears
- ! from our code, but only apparently, because it is implicit in the call
- ! to psb_baseprc_aply.
- !
- ! A bit of description of the baseprecv(:) data structure:
- ! 1. Number of levels = NLEV = size(baseprecv(:))
- ! 2. baseprecv(ilev)%av(:) sparse matrices needed for the current level.
- ! Includes:
- ! 2.1.: baseprecv(ilev)%av(l_pr_) L factor of ILU preconditioners
- ! 2.2.: baseprecv(ilev)%av(u_pr_) U factor of ILU preconditioners
- ! 2.3.: baseprecv(ilev)%av(ap_nd_) Off-diagonal part of A for Jacobi sweeps
- ! 2.4.: baseprecv(ilev)%av(ac_) Aggregated matrix of level ILEV
- ! 2.5.: baseprecv(ilev)%av(sm_pr_t_) Smoother prolongator transpose; maps vectors
- ! (ilev-1) ---> (ilev)
- ! 2.6.: baseprecv(ilev)%av(sm_pr_) Smoother prolongator; maps vectors
- ! (ilev) ---> (ilev-1)
- ! Shouldn't we keep just one of them and handle transpose in the sparse BLAS? maybe
- !
- ! 3. baseprecv(ilev)%desc_data comm descriptor for level ILEV
- ! 4. baseprecv(ilev)%base_a Pointer (really a pointer!) to the base matrix
- ! of the current level, i.e.: if ILEV=1 then A
- ! else the aggregated matrix av(ac_); so we have
- ! a unified treatment of residuals. Need this to
- ! avoid passing explicitly matrix A to the
- ! outer prec. routine
- ! 5. baseprecv(ilev)%mlia The aggregation map from (ilev-1)-->(ilev)
- ! if no smoother, it is used instead of sm_pr_
- ! 6. baseprecv(ilev)%nlaggr Number of aggregates on the various procs.
- !
-
- use psb_serial_mod
- use psb_descriptor_type
- use psb_prec_type
- use psb_psblas_mod
- use psb_penv_mod
- use psb_const_mod
- use psb_error_mod
- use psb_penv_mod
- implicit none
-
- type(psb_desc_type),intent(in) :: desc_data
- type(psb_zbaseprc_type), intent(in) :: baseprecv(:)
- complex(kind(1.d0)),intent(in) :: alpha,beta
- complex(kind(1.d0)),intent(inout) :: x(:), y(:)
- character :: trans
- complex(kind(1.d0)),target :: work(:)
- integer, intent(out) :: info
-
-
- ! Local variables
- integer :: n_row,n_col
- complex(kind(1.d0)), allocatable :: tx(:),ty(:),t2l(:),w2l(:),&
- & x2l(:),b2l(:),tz(:),tty(:)
- character ::diagl, diagu
- integer :: ictxt,np,me,i, isz, nrg,nr2l,err_act, iptype, int_err(5)
- real(kind(1.d0)) :: omega
- real(kind(1.d0)) :: t1, t2, t3, t4, t5, t6, t7, mpi_wtime
- logical, parameter :: debug=.false., debugprt=.false.
- integer :: ismth, nlev, ilev
- external mpi_wtime
- character(len=20) :: name, ch_err
-
- type psb_mlprec_wrk_type
- complex(kind(1.d0)), pointer :: tx(:)=>null(),ty(:)=>null(),&
- & x2l(:)=>null(),y2l(:)=>null(),&
- & b2l(:)=>null(),tty(:)=>null()
- end type psb_mlprec_wrk_type
- type(psb_mlprec_wrk_type), pointer :: mlprec_wrk(:)
-
- interface psb_baseprc_aply
- subroutine psb_zbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info)
- use psb_descriptor_type
- use psb_prec_type
- type(psb_desc_type),intent(in) :: desc_data
- type(psb_zbaseprc_type), intent(in) :: prec
- complex(kind(1.d0)),intent(inout) :: x(:), y(:)
- complex(kind(1.d0)),intent(in) :: alpha,beta
- character(len=1) :: trans
- complex(kind(1.d0)),target :: work(:)
- integer, intent(out) :: info
- end subroutine psb_zbaseprc_aply
- end interface
-
- name='psb_mlprc_aply'
- info = 0
- call psb_erractionsave(err_act)
-
-
- ictxt=desc_data%matrix_data(psb_ctxt_)
- call psb_info(ictxt, me, np)
-
- nlev = size(baseprecv)
- allocate(mlprec_wrk(nlev),stat=info)
- if (info /= 0) then
- call psb_errpush(4010,name,a_err='Allocate')
- goto 9999
- end if
-
-
- select case(baseprecv(2)%iprcparm(ml_type_))
-
- case(no_ml_)
- ! Should not really get here.
- call psb_errpush(4010,name,a_err='no_ml_ in mlprc_aply?')
- goto 9999
-
-
- case(add_ml_prec_)
-
-
- !
- ! Additive is very simple.
- ! 1. X(1) = Xext
- ! 2. DO ILEV=2,NLEV
- ! X(ILEV) = AV(PR_SM_T_)*X(ILEV-1)
- ! 3. Y(ILEV) = (K(ILEV)**(-1))*X(ILEV)
- ! 4. DO ILEV=NLEV-1,1,-1
- ! Y(ILEV) = AV(PR_SM_)*Y(ILEV+1)
- ! 5. Yext = beta*Yext + Y(1)
- !
- ! Note: level numbering reversed wrt ref. DD, i.e.
- ! 1..NLEV <=> (j) <-> 0
-
-
- call psb_baseprc_aply(alpha,baseprecv(1),x,beta,y,&
- & baseprecv(1)%base_desc,trans,work,info)
- if(info /=0) goto 9999
- allocate(mlprec_wrk(1)%x2l(size(x)),mlprec_wrk(1)%y2l(size(y)))
- mlprec_wrk(1)%x2l(:) = x(:)
-
-
- do ilev = 2, nlev
- n_row = baseprecv(ilev-1)%base_desc%matrix_data(psb_n_row_)
- n_col = baseprecv(ilev-1)%desc_data%matrix_data(psb_n_col_)
- nr2l = baseprecv(ilev)%desc_data%matrix_data(psb_n_col_)
- nrg = baseprecv(ilev)%desc_data%matrix_data(psb_n_row_)
- allocate(mlprec_wrk(ilev)%x2l(nr2l),mlprec_wrk(ilev)%y2l(nr2l),&
- & mlprec_wrk(ilev)%tx(max(n_row,n_col)),&
- & mlprec_wrk(ilev)%ty(max(n_row,n_col)), stat=info)
- if (info /= 0) then
- call psb_errpush(4010,name,a_err='Allocate')
- goto 9999
- end if
-
- mlprec_wrk(ilev)%x2l(:) = zzero
- mlprec_wrk(ilev)%y2l(:) = zzero
- mlprec_wrk(ilev)%tx(1:n_row) = mlprec_wrk(ilev-1)%x2l(1:n_row)
- mlprec_wrk(ilev)%tx(n_row+1:max(n_row,n_col)) = zzero
- mlprec_wrk(ilev)%ty(:) = zzero
-
- ismth=baseprecv(ilev)%iprcparm(smth_kind_)
-
- if (ismth /= no_smth_) then
- !
- ! Smoothed aggregation
- !
-
-
- if (baseprecv(ilev)%iprcparm(glb_smth_) >0) then
- call psb_halo(mlprec_wrk(ilev-1)%x2l,baseprecv(ilev-1)%base_desc,&
- & info,work=work)
- if(info /=0) goto 9999
- else
- mlprec_wrk(ilev-1)%x2l(n_row+1:max(n_row,n_col)) = zzero
- end if
-
- call psb_csmm(zone,baseprecv(ilev)%av(sm_pr_t_),mlprec_wrk(ilev-1)%x2l,&
- & zzero,mlprec_wrk(ilev)%x2l,info)
- if(info /=0) goto 9999
-
- else
- !
- ! Raw aggregation, may take shortcut
- !
- do i=1,n_row
- mlprec_wrk(ilev)%x2l(baseprecv(ilev)%mlia(i)) = &
- & mlprec_wrk(ilev)%x2l(baseprecv(ilev)%mlia(i)) + &
- & mlprec_wrk(ilev-1)%x2l(i)
- end do
-
- end if
-
- if (baseprecv(ilev)%iprcparm(coarse_mat_)==mat_repl_) Then
- call psb_sum(ictxt,mlprec_wrk(ilev)%x2l(1:nrg))
- else if (baseprecv(ilev)%iprcparm(coarse_mat_) /= mat_distr_) Then
- write(0,*) 'Unknown value for baseprecv(2)%iprcparm(coarse_mat_) ',&
- & baseprecv(ilev)%iprcparm(coarse_mat_)
- endif
-
- call psb_baseprc_aply(zone,baseprecv(ilev),&
- & mlprec_wrk(ilev)%x2l,zzero,mlprec_wrk(ilev)%y2l,&
- & baseprecv(ilev)%desc_data, 'N',work,info)
-
- enddo
-
- do ilev =nlev,2,-1
-
- ismth=baseprecv(ilev)%iprcparm(smth_kind_)
- n_row = baseprecv(ilev-1)%base_desc%matrix_data(psb_n_row_)
- n_col = baseprecv(ilev-1)%desc_data%matrix_data(psb_n_col_)
- nr2l = baseprecv(ilev)%desc_data%matrix_data(psb_n_col_)
- nrg = baseprecv(ilev)%desc_data%matrix_data(psb_n_row_)
-
- if (ismth /= no_smth_) then
-
- call psb_csmm(zone,baseprecv(ilev)%av(sm_pr_),mlprec_wrk(ilev)%y2l,&
- & zone,mlprec_wrk(ilev-1)%y2l,info)
- if(info /=0) goto 9999
-
- else
-
- do i=1, n_row
- mlprec_wrk(ilev-1)%y2l(i) = mlprec_wrk(ilev-1)%y2l(i) + &
- & mlprec_wrk(ilev)%y2l(baseprecv(ilev)%mlia(i))
- enddo
-
- end if
- end do
-
- call psb_geaxpby(alpha,mlprec_wrk(1)%y2l,zone,y,baseprecv(1)%base_desc,info)
- if(info /=0) goto 9999
-
-
- case(mult_ml_prec_)
-
- !
- ! Multiplicative multilevel
- ! Pre/post smoothing versions.
- !
-
- select case(baseprecv(2)%iprcparm(smth_pos_))
-
- case(post_smooth_)
-
-
- !
- ! Post smoothing.
- ! 1. X(1) = Xext
- ! 2. DO ILEV=2, NLEV :: X(ILEV) = AV(PR_SM_T_,ILEV)*X(ILEV-1)
- ! 3. Y(NLEV) = (K(NLEV)**(-1))*X(NLEV)
- ! 4. DO ILEV=NLEV-1,1,-1
- ! Y(ILEV) = AV(PR_SM_,ILEV+1)*Y(ILEV+1)
- ! Y(ILEV) = Y(ILEV) + (K(ILEV)**(-1))*(X(ILEV)-A(ILEV)*Y(ILEV))
- !
- ! 5. Yext = beta*Yext + Y(1)
- !
- ! Note: level numbering reversed wrt ref. DD, i.e.
- ! 1..NLEV <=> (j) <-> 0
- !
- ! Also: post smoothing is not spelled out in detail in DD.
- !
- !
-
-
- n_col = desc_data%matrix_data(psb_n_col_)
- nr2l = baseprecv(1)%desc_data%matrix_data(psb_n_col_)
-
- allocate(mlprec_wrk(1)%x2l(nr2l),mlprec_wrk(1)%y2l(nr2l), &
- & mlprec_wrk(1)%tx(nr2l), stat=info)
- mlprec_wrk(1)%x2l(:) = zzero
- mlprec_wrk(1)%y2l(:) = zzero
- mlprec_wrk(1)%tx(:) = zzero
-
- call psb_geaxpby(zone,x,zzero,mlprec_wrk(1)%tx,&
- & baseprecv(1)%base_desc,info)
- call psb_geaxpby(zone,x,zzero,mlprec_wrk(1)%x2l,&
- & baseprecv(1)%base_desc,info)
-
- do ilev=2, nlev
- n_row = baseprecv(ilev-1)%base_desc%matrix_data(psb_n_row_)
- n_col = baseprecv(ilev-1)%desc_data%matrix_data(psb_n_col_)
- nr2l = baseprecv(ilev)%desc_data%matrix_data(psb_n_col_)
- nrg = baseprecv(ilev)%desc_data%matrix_data(psb_n_row_)
- ismth = baseprecv(ilev)%iprcparm(smth_kind_)
-
- allocate(mlprec_wrk(ilev)%tx(nr2l),mlprec_wrk(ilev)%y2l(nr2l),&
- & mlprec_wrk(ilev)%x2l(nr2l), stat=info)
-
- if (info /= 0) then
- call psb_errpush(4010,name,a_err='Allocate')
- goto 9999
- end if
-
- mlprec_wrk(ilev)%x2l(:) = zzero
- mlprec_wrk(ilev)%y2l(:) = zzero
- mlprec_wrk(ilev)%tx(:) = zzero
- if (ismth /= no_smth_) then
- !
- ! Smoothed aggregation
- !
- if (baseprecv(ilev)%iprcparm(glb_smth_) >0) then
- call psb_halo(mlprec_wrk(ilev-1)%x2l,&
- & baseprecv(ilev-1)%base_desc,info,work=work)
- if(info /=0) goto 9999
- else
- mlprec_wrk(ilev-1)%x2l(n_row+1:max(n_row,n_col)) = zzero
- end if
-
- call psb_csmm(zone,baseprecv(ilev)%av(sm_pr_t_),mlprec_wrk(ilev-1)%x2l, &
- & zzero,mlprec_wrk(ilev)%x2l,info)
- if(info /=0) goto 9999
-
- else
- !
- ! Raw aggregation, may take shortcut
- !
- do i=1,n_row
- mlprec_wrk(ilev)%x2l(baseprecv(ilev)%mlia(i)) = &
- & mlprec_wrk(ilev)%x2l(baseprecv(ilev)%mlia(i)) + &
- & mlprec_wrk(ilev-1)%x2l(i)
- end do
- end if
-
- if (baseprecv(ilev)%iprcparm(coarse_mat_)==mat_repl_) Then
- call psb_sum(ictxt,mlprec_wrk(ilev)%x2l(1:nrg))
- else if (baseprecv(ilev)%iprcparm(coarse_mat_) /= mat_distr_) Then
- write(0,*) 'Unknown value for baseprecv(2)%iprcparm(coarse_mat_) ',&
- & baseprecv(ilev)%iprcparm(coarse_mat_)
- endif
- call psb_geaxpby(zone,mlprec_wrk(ilev)%x2l,zzero,mlprec_wrk(ilev)%tx,&
- & baseprecv(ilev)%base_desc,info)
- if(info /=0) goto 9999
-
- enddo
-
-
- call psb_baseprc_aply(zone,baseprecv(nlev),mlprec_wrk(nlev)%x2l, &
- & zzero, mlprec_wrk(nlev)%y2l,baseprecv(nlev)%desc_data,'N',work,info)
-
- if(info /=0) goto 9999
-
-
- do ilev=nlev-1, 1, -1
- ismth = baseprecv(ilev+1)%iprcparm(smth_kind_)
- if (ismth /= no_smth_) then
- if (ismth == smth_omg_) &
- & call psb_halo(mlprec_wrk(ilev+1)%y2l,baseprecv(ilev+1)%desc_data,&
- & info,work=work)
- call psb_csmm(zone,baseprecv(ilev+1)%av(sm_pr_),mlprec_wrk(ilev+1)%y2l,&
- & zzero,mlprec_wrk(ilev)%y2l,info)
- if(info /=0) goto 9999
-
- else
- n_row = baseprecv(ilev)%base_desc%matrix_data(psb_n_row_)
- mlprec_wrk(ilev)%y2l(:) = zzero
- do i=1, n_row
- mlprec_wrk(ilev)%y2l(i) = mlprec_wrk(ilev)%y2l(i) + &
- & mlprec_wrk(ilev+1)%y2l(baseprecv(ilev+1)%mlia(i))
- enddo
-
- end if
-
- call psb_spmm(-zone,baseprecv(ilev)%base_a,mlprec_wrk(ilev)%y2l,&
- & zone,mlprec_wrk(ilev)%tx,baseprecv(ilev)%base_desc,info,work=work)
-
- if(info /=0) goto 9999
-
- call psb_baseprc_aply(zone,baseprecv(ilev),mlprec_wrk(ilev)%tx,&
- & zone,mlprec_wrk(ilev)%y2l,baseprecv(ilev)%base_desc, trans, work,info)
-
- if(info /=0) goto 9999
-
- enddo
-
- call psb_geaxpby(alpha,mlprec_wrk(1)%y2l,beta,y,baseprecv(1)%base_desc,info)
-
- if(info /=0) goto 9999
-
-
- case(pre_smooth_)
-
-
- !
- ! Pre smoothing.
- ! 1. X(1) = Xext
- ! 2. Y(1) = (K(1)**(-1))*X(1)
- ! 3. TX(1) = X(1) - A(1)*Y(1)
- ! 4. DO ILEV=2, NLEV
- ! X(ILEV) = AV(PR_SM_T_,ILEV)*TX(ILEV-1)
- ! Y(ILEV) = (K(ILEV)**(-1))*X(ILEV)
- ! TX(ILEV) = (X(ILEV)-A(ILEV)*Y(ILEV))
- ! 5. DO ILEV=NLEV-1,1,-1
- ! Y(ILEV) = Y(ILEV) + AV(PR_SM_,ILEV+1)*Y(ILEV+1)
- ! 6. Yext = beta*Yext + Y(1)
- !
- ! Note: level numbering reversed wrt ref. DD, i.e.
- ! 1..NLEV <=> (j) <-> 0
- !
- !
-
- n_col = desc_data%matrix_data(psb_n_col_)
- nr2l = baseprecv(1)%desc_data%matrix_data(psb_n_col_)
-
- allocate(mlprec_wrk(1)%x2l(nr2l),mlprec_wrk(1)%y2l(nr2l), &
- & mlprec_wrk(1)%tx(nr2l), stat=info)
- if (info /= 0) then
- call psb_errpush(4010,name,a_err='Allocate')
- goto 9999
- end if
-
- mlprec_wrk(1)%y2l(:) = zzero
-
-
- mlprec_wrk(1)%x2l(:) = x
-
- call psb_baseprc_aply(zone,baseprecv(1),mlprec_wrk(1)%x2l,&
- & zzero,mlprec_wrk(1)%y2l,&
- & baseprecv(1)%base_desc,&
- & trans,work,info)
-
- if(info /=0) goto 9999
-
- mlprec_wrk(1)%tx = mlprec_wrk(1)%x2l
-
- call psb_spmm(-zone,baseprecv(1)%base_a,mlprec_wrk(1)%y2l,&
- & zone,mlprec_wrk(1)%tx,baseprecv(1)%base_desc,info,work=work)
- if(info /=0) goto 9999
-
- do ilev = 2, nlev
- n_row = baseprecv(ilev-1)%base_desc%matrix_data(psb_n_row_)
- n_col = baseprecv(ilev-1)%desc_data%matrix_data(psb_n_col_)
- nr2l = baseprecv(ilev)%desc_data%matrix_data(psb_n_col_)
- nrg = baseprecv(ilev)%desc_data%matrix_data(psb_n_row_)
- ismth = baseprecv(ilev)%iprcparm(smth_kind_)
- allocate(mlprec_wrk(ilev)%tx(nr2l),mlprec_wrk(ilev)%y2l(nr2l),&
- & mlprec_wrk(ilev)%x2l(nr2l), stat=info)
-
-
- if (info /= 0) then
- call psb_errpush(4010,name,a_err='Allocate')
- goto 9999
- end if
-
- mlprec_wrk(ilev)%x2l(:) = zzero
- mlprec_wrk(ilev)%y2l(:) = zzero
- mlprec_wrk(ilev)%tx(:) = zzero
-
-
- if (ismth /= no_smth_) then
- !
- !Smoothed Aggregation
- !
- if (baseprecv(ilev)%iprcparm(glb_smth_) >0) then
-
- call psb_halo(mlprec_wrk(ilev-1)%tx,baseprecv(ilev-1)%base_desc,&
- & info,work=work)
- if(info /=0) goto 9999
- else
- mlprec_wrk(ilev-1)%tx(n_row+1:max(n_row,n_col)) = zzero
- end if
-
- call psb_csmm(zone,baseprecv(ilev)%av(sm_pr_t_),mlprec_wrk(ilev-1)%tx,zzero,&
- & mlprec_wrk(ilev)%x2l,info)
- if(info /=0) goto 9999
-
- else
- !
- ! Raw aggregation, may take shortcuts
- !
- mlprec_wrk(ilev)%x2l = zzero
- do i=1,n_row
- mlprec_wrk(ilev)%x2l(baseprecv(ilev)%mlia(i)) = &
- & mlprec_wrk(ilev)%x2l(baseprecv(ilev)%mlia(i)) + &
- & mlprec_wrk(ilev-1)%tx(i)
- end do
- end if
-
- if (baseprecv(ilev)%iprcparm(coarse_mat_)==mat_repl_) then
- call psb_sum(ictxt,mlprec_wrk(ilev)%x2l(1:nrg))
- else if (baseprecv(ilev)%iprcparm(coarse_mat_) /= mat_distr_) then
- write(0,*) 'Unknown value for baseprecv(2)%iprcparm(coarse_mat_) ',&
- & baseprecv(ilev)%iprcparm(coarse_mat_)
- endif
-
-
- call psb_baseprc_aply(zone,baseprecv(ilev),mlprec_wrk(ilev)%x2l,&
- & zzero,mlprec_wrk(ilev)%y2l,baseprecv(ilev)%desc_data, 'N',work,info)
-
- if(info /=0) goto 9999
-
- if(ilev < nlev) then
- mlprec_wrk(ilev)%tx = mlprec_wrk(ilev)%x2l
- call psb_spmm(-zone,baseprecv(ilev)%base_a,mlprec_wrk(ilev)%y2l,&
- & zone,mlprec_wrk(ilev)%tx,baseprecv(ilev)%base_desc,info,work=work)
- if(info /=0) goto 9999
- endif
-
- enddo
-
- do ilev = nlev-1, 1, -1
-
- ismth=baseprecv(ilev+1)%iprcparm(smth_kind_)
-
- if (ismth /= no_smth_) then
-
- if (ismth == smth_omg_) &
- & call psb_halo(mlprec_wrk(ilev+1)%y2l,&
- & baseprecv(ilev+1)%desc_data,info,work=work)
- call psb_csmm(zone,baseprecv(ilev+1)%av(sm_pr_),mlprec_wrk(ilev+1)%y2l,&
- & zone,mlprec_wrk(ilev)%y2l,info)
-
- if(info /=0) goto 9999
-
- else
-
- n_row = baseprecv(ilev+1)%base_desc%matrix_data(psb_n_row_)
- do i=1, n_row
- mlprec_wrk(ilev)%y2l(i) = mlprec_wrk(ilev)%y2l(i) + &
- & mlprec_wrk(ilev+1)%y2l(baseprecv(ilev+1)%mlia(i))
- enddo
-
- end if
-
- enddo
-
- call psb_geaxpby(alpha,mlprec_wrk(1)%y2l,beta,y,&
- & baseprecv(1)%base_desc,info)
-
- if(info /=0) goto 9999
-
-
-
- case(smooth_both_)
-
- !
- ! Symmetrized smoothing.
- ! 1. X(1) = Xext
- ! 2. Y(1) = (K(1)**(-1))*X(1)
- ! 3. TX(1) = X(1) - A(1)*Y(1)
- ! 4. DO ILEV=2, NLEV
- ! X(ILEV) = AV(PR_SM_T_,ILEV)*TX(ILEV-1)
- ! Y(ILEV) = (K(ILEV)**(-1))*X(ILEV)
- ! TX(ILEV) = (X(ILEV)-A(ILEV)*Y(ILEV))
- ! 5. DO ILEV=NLEV-1,1,-1
- ! Y(ILEV) = Y(ILEV) + AV(PR_SM_,ILEV+1)*Y(ILEV+1)
- ! Y(ILEV) = Y(ILEV) + (K(ILEV)**(-1))*(X(ILEV)-A(ILEV)*Y(ILEV))
- ! 6. Yext = beta*Yext + Y(1)
- !
- ! Note: level numbering reversed wrt ref. DD, i.e.
- ! 1..NLEV <=> (j) <-> 0
- !
- !
- n_col = desc_data%matrix_data(psb_n_col_)
- nr2l = baseprecv(1)%desc_data%matrix_data(psb_n_col_)
-
- allocate(mlprec_wrk(1)%x2l(nr2l),mlprec_wrk(1)%y2l(nr2l), &
- & mlprec_wrk(1)%ty(nr2l), mlprec_wrk(1)%tx(nr2l), stat=info)
-
- mlprec_wrk(1)%x2l(:) = zzero
- mlprec_wrk(1)%y2l(:) = zzero
- mlprec_wrk(1)%tx(:) = zzero
- mlprec_wrk(1)%ty(:) = zzero
-
-
- if (info /= 0) then
- call psb_errpush(4010,name,a_err='Allocate')
- goto 9999
- end if
-
- call psb_geaxpby(zone,x,zzero,mlprec_wrk(1)%x2l,&
- & baseprecv(1)%base_desc,info)
- call psb_geaxpby(zone,x,zzero,mlprec_wrk(1)%tx,&
- & baseprecv(1)%base_desc,info)
-
- call psb_baseprc_aply(zone,baseprecv(1),mlprec_wrk(1)%x2l,&
- & zzero,mlprec_wrk(1)%y2l,&
- & baseprecv(1)%base_desc,&
- & trans,work,info)
-
- if(info /=0) goto 9999
-
- mlprec_wrk(1)%ty = mlprec_wrk(1)%x2l
-
- call psb_spmm(-zone,baseprecv(1)%base_a,mlprec_wrk(1)%y2l,&
- & zone,mlprec_wrk(1)%ty,baseprecv(1)%base_desc,info,work=work)
- if(info /=0) goto 9999
-
- do ilev = 2, nlev
- n_row = baseprecv(ilev-1)%base_desc%matrix_data(psb_n_row_)
- n_col = baseprecv(ilev-1)%desc_data%matrix_data(psb_n_col_)
- nr2l = baseprecv(ilev)%desc_data%matrix_data(psb_n_col_)
- nrg = baseprecv(ilev)%desc_data%matrix_data(psb_n_row_)
- ismth=baseprecv(ilev)%iprcparm(smth_kind_)
- allocate(mlprec_wrk(ilev)%ty(nr2l),mlprec_wrk(ilev)%y2l(nr2l),&
- & mlprec_wrk(ilev)%x2l(nr2l), stat=info)
-
- mlprec_wrk(ilev)%x2l(:) = zzero
- mlprec_wrk(ilev)%y2l(:) = zzero
- mlprec_wrk(ilev)%tx(:) = zzero
- mlprec_wrk(ilev)%ty(:) = zzero
-
-
- if (info /= 0) then
- call psb_errpush(4010,name,a_err='Allocate')
- goto 9999
- end if
-
-
- if (ismth /= no_smth_) then
- !
- !Smoothed Aggregation
- !
- if (baseprecv(ilev)%iprcparm(glb_smth_) >0) then
-
- call psb_halo(mlprec_wrk(ilev-1)%ty,baseprecv(ilev-1)%base_desc,&
- & info,work=work)
- if(info /=0) goto 9999
- else
- mlprec_wrk(ilev-1)%ty(n_row+1:max(n_row,n_col)) = zzero
- end if
-
- call psb_csmm(zone,baseprecv(ilev)%av(sm_pr_t_),mlprec_wrk(ilev-1)%ty,zzero,&
- & mlprec_wrk(ilev)%x2l,info)
- if(info /=0) goto 9999
-
- else
- !
- ! Raw aggregation, may take shortcuts
- !
- mlprec_wrk(ilev)%x2l = zzero
- do i=1,n_row
- mlprec_wrk(ilev)%x2l(baseprecv(ilev)%mlia(i)) = &
- & mlprec_wrk(ilev)%x2l(baseprecv(ilev)%mlia(i)) + &
- & mlprec_wrk(ilev-1)%ty(i)
- end do
- end if
-
- if (baseprecv(ilev)%iprcparm(coarse_mat_)==mat_repl_) then
- call psb_sum(ictxt,mlprec_wrk(ilev)%x2l(1:nrg))
- else if (baseprecv(ilev)%iprcparm(coarse_mat_) /= mat_distr_) then
- write(0,*) 'Unknown value for baseprecv(2)%iprcparm(coarse_mat_) ',&
- & baseprecv(ilev)%iprcparm(coarse_mat_)
- endif
-
- call psb_geaxpby(zone,mlprec_wrk(ilev)%x2l,zzero,mlprec_wrk(ilev)%tx,&
- & baseprecv(ilev)%base_desc,info)
- if(info /=0) goto 9999
-
- call psb_baseprc_aply(zone,baseprecv(ilev),mlprec_wrk(ilev)%x2l,&
- & zzero,mlprec_wrk(ilev)%y2l,baseprecv(ilev)%desc_data, 'N',work,info)
-
- if(info /=0) goto 9999
-
- if(ilev < nlev) then
- mlprec_wrk(ilev)%ty = mlprec_wrk(ilev)%x2l
- call psb_spmm(-zone,baseprecv(ilev)%base_a,mlprec_wrk(ilev)%y2l,&
- & zone,mlprec_wrk(ilev)%ty,baseprecv(ilev)%base_desc,info,work=work)
- if(info /=0) goto 9999
- endif
-
- enddo
-
-
- do ilev=nlev-1, 1, -1
-
- ismth=baseprecv(ilev+1)%iprcparm(smth_kind_)
- if (ismth /= no_smth_) then
- if (ismth == smth_omg_) &
- & call psb_halo(mlprec_wrk(ilev+1)%y2l,baseprecv(ilev+1)%desc_data,&
- & info,work=work)
- call psb_csmm(zone,baseprecv(ilev+1)%av(sm_pr_),mlprec_wrk(ilev+1)%y2l,&
- & zone,mlprec_wrk(ilev)%y2l,info)
- if(info /=0) goto 9999
-
- else
- n_row = baseprecv(ilev)%base_desc%matrix_data(psb_n_row_)
- do i=1, n_row
- mlprec_wrk(ilev)%y2l(i) = mlprec_wrk(ilev)%y2l(i) + &
- & mlprec_wrk(ilev+1)%y2l(baseprecv(ilev+1)%mlia(i))
- enddo
-
- end if
-
- call psb_spmm(-zone,baseprecv(ilev)%base_a,mlprec_wrk(ilev)%y2l,&
- & zone,mlprec_wrk(ilev)%tx,baseprecv(ilev)%base_desc,info,work=work)
-
- if(info /=0) goto 9999
-
- call psb_baseprc_aply(zone,baseprecv(ilev),mlprec_wrk(ilev)%tx,&
- & zone,mlprec_wrk(ilev)%y2l,baseprecv(ilev)%base_desc, trans, work,info)
-
- if(info /=0) goto 9999
-
- enddo
-
- call psb_geaxpby(alpha,mlprec_wrk(1)%y2l,beta,y,&
- & baseprecv(1)%base_desc,info)
-
- if(info /=0) goto 9999
-
-
- case default
-
- call psb_errpush(4013,name,a_err='wrong smooth_pos',&
- & i_Err=(/baseprecv(2)%iprcparm(smth_pos_),0,0,0,0/))
- goto 9999
-
- end select
-
- case default
- call psb_errpush(4013,name,a_err='wrong mltype',&
- & i_Err=(/baseprecv(2)%iprcparm(ml_type_),0,0,0,0/))
- goto 9999
-
- end select
-
-
- call mlprec_wrk_free(mlprec_wrk)
- deallocate(mlprec_wrk)
-
- call psb_erractionrestore(err_act)
- return
-
-9999 continue
- call psb_errpush(info,name)
- call psb_erractionrestore(err_act)
- if (err_act.eq.act_abort) then
- call psb_error()
- return
- end if
- return
-
-contains
- subroutine mlprec_wrk_free(wrk)
- type(psb_mlprec_wrk_type) :: wrk(:)
- ! This will not be needed when we have allocatables, as
- ! it is sufficient to deallocate the container, and
- ! the compiler is supposed to recursively deallocate the
- ! various components.
- integer i
-
- do i=1, size(wrk)
- if (associated(wrk(i)%tx)) deallocate(wrk(i)%tx)
- if (associated(wrk(i)%ty)) deallocate(wrk(i)%ty)
- if (associated(wrk(i)%x2l)) deallocate(wrk(i)%x2l)
- if (associated(wrk(i)%y2l)) deallocate(wrk(i)%y2l)
- if (associated(wrk(i)%b2l)) deallocate(wrk(i)%b2l)
- if (associated(wrk(i)%tty)) deallocate(wrk(i)%tty)
- end do
- end subroutine mlprec_wrk_free
-
-end subroutine psb_zmlprc_aply
-
diff --git a/tests/run.py b/tests/run.py
deleted file mode 100644
index edebc7a1..00000000
--- a/tests/run.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments unit tests
- ~~~~~~~~~~~~~~~~~~
-
- Usage::
-
- python run.py [testfile ...]
-
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import os
-import sys
-import warnings
-
-# only find tests in this directory
-if os.path.dirname(__file__):
- os.chdir(os.path.dirname(__file__))
-
-# make FutureWarnings (coming from Regex syntax most likely) and
-# DeprecationWarnings due to non-raw strings an error
-warnings.filterwarnings("error", module=r"pygments\..*",
- category=FutureWarning)
-warnings.filterwarnings("error", module=r".*pygments.*",
- category=DeprecationWarning)
-
-
-try:
- import nose
-except ImportError:
- print('nose is required to run the Pygments test suite')
- sys.exit(1)
-
-# make sure the current source is first on sys.path
-sys.path.insert(0, '..')
-
-if '--with-coverage' not in sys.argv:
- # if running with coverage, pygments should not be imported before coverage
- # is started, otherwise it will count already executed lines as uncovered
- try:
- import pygments
- except ImportError as err:
- print('Cannot find Pygments to test: %s' % err)
- sys.exit(1)
- else:
- print('Pygments %s test suite running (Python %s)...' %
- (pygments.__version__, sys.version.split()[0]),
- file=sys.stderr)
-else:
- print('Pygments test suite running (Python %s)...' % sys.version.split()[0],
- file=sys.stderr)
-
-nose.main()
diff --git a/tests/string_asserts.py b/tests/string_asserts.py
deleted file mode 100644
index a02c52bb..00000000
--- a/tests/string_asserts.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments string assert utility
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-class StringTests(object):
-
- def assertStartsWith(self, haystack, needle, msg=None):
- if msg is None:
- msg = "'{0}' does not start with '{1}'".format(haystack, needle)
- if not haystack.startswith(needle):
- raise(AssertionError(msg))
-
- def assertEndsWith(self, haystack, needle, msg=None):
- if msg is None:
- msg = "'{0}' does not end with '{1}'".format(haystack, needle)
- if not haystack.endswith(needle):
- raise(AssertionError(msg))
diff --git a/tests/support.py b/tests/support.py
deleted file mode 100644
index c66ac663..00000000
--- a/tests/support.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# coding: utf-8
-"""
-Support for Pygments tests
-"""
-
-import os
-
-from nose import SkipTest
-
-
-def location(mod_name):
- """
- Return the file and directory that the code for *mod_name* is in.
- """
- source = mod_name.endswith("pyc") and mod_name[:-1] or mod_name
- source = os.path.abspath(source)
- return source, os.path.dirname(source)
diff --git a/tests/support/empty.py b/tests/support/empty.py
deleted file mode 100644
index 40a96afc..00000000
--- a/tests/support/empty.py
+++ /dev/null
@@ -1 +0,0 @@
-# -*- coding: utf-8 -*-
diff --git a/tests/support/html_formatter.py b/tests/support/html_formatter.py
deleted file mode 100644
index 169cd4af..00000000
--- a/tests/support/html_formatter.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- coding: utf-8 -*-
-from pygments.formatters import HtmlFormatter
-
-
-class HtmlFormatterWrapper(HtmlFormatter):
- name = 'HtmlWrapper'
diff --git a/tests/support/python_lexer.py b/tests/support/python_lexer.py
deleted file mode 100644
index 565ee674..00000000
--- a/tests/support/python_lexer.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*- coding: utf-8 -*-
-# pygments.lexers.python (as CustomLexer) for test_cmdline.py
-
-from pygments.lexers import PythonLexer
-
-
-class CustomLexer(PythonLexer):
- name = 'PythonLexerWrapper'
-
-
-class LexerWrapper(CustomLexer):
- name = 'PythonLexerWrapperWrapper'
diff --git a/tests/support/tags b/tests/support/tags
deleted file mode 100644
index 193779f6..00000000
--- a/tests/support/tags
+++ /dev/null
@@ -1,36 +0,0 @@
-!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
-!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
-!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
-!_TAG_PROGRAM_NAME Exuberant Ctags //
-!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
-!_TAG_PROGRAM_VERSION 5.8 //
-HtmlFormatter test_html_formatter.py 19;" i
-HtmlFormatterTest test_html_formatter.py 34;" c
-NullFormatter test_html_formatter.py 19;" i
-PythonLexer test_html_formatter.py 18;" i
-StringIO test_html_formatter.py 13;" i
-dirname test_html_formatter.py 16;" i
-escape_html test_html_formatter.py 20;" i
-fp test_html_formatter.py 27;" v
-inspect test_html_formatter.py 15;" i
-isfile test_html_formatter.py 16;" i
-join test_html_formatter.py 16;" i
-os test_html_formatter.py 10;" i
-re test_html_formatter.py 11;" i
-subprocess test_html_formatter.py 125;" i
-support test_html_formatter.py 23;" i
-tempfile test_html_formatter.py 14;" i
-test_all_options test_html_formatter.py 72;" m class:HtmlFormatterTest
-test_correct_output test_html_formatter.py 35;" m class:HtmlFormatterTest
-test_ctags test_html_formatter.py 165;" m class:HtmlFormatterTest
-test_external_css test_html_formatter.py 48;" m class:HtmlFormatterTest
-test_get_style_defs test_html_formatter.py 141;" m class:HtmlFormatterTest
-test_lineanchors test_html_formatter.py 98;" m class:HtmlFormatterTest
-test_lineanchors_with_startnum test_html_formatter.py 106;" m class:HtmlFormatterTest
-test_linenos test_html_formatter.py 82;" m class:HtmlFormatterTest
-test_linenos_with_startnum test_html_formatter.py 90;" m class:HtmlFormatterTest
-test_unicode_options test_html_formatter.py 155;" m class:HtmlFormatterTest
-test_valid_output test_html_formatter.py 114;" m class:HtmlFormatterTest
-tokensource test_html_formatter.py 29;" v
-uni_open test_html_formatter.py 21;" i
-unittest test_html_formatter.py 12;" i
diff --git a/tests/test_asm.py b/tests/test_asm.py
deleted file mode 100644
index 30a008a1..00000000
--- a/tests/test_asm.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic ColdfusionHtmlLexer Test
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-import os
-
-from pygments.token import Token
-from pygments.lexers import NasmLexer
-
-
-class NasmLexerTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = NasmLexer()
-
- def testCPUID(self):
- # CPU is a valid directive, and we don't want to parse this as
- # cpu id, but as a single token. See bug #1517
- fragment = 'cpuid'
- expected = [
- (Token.Name.Function, u'cpuid'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_basic.py b/tests/test_basic.py
deleted file mode 100644
index 03d10cd2..00000000
--- a/tests/test_basic.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments Basic lexers tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-import unittest
-
-from pygments.lexers.basic import VBScriptLexer
-from pygments.token import Error, Name, Number, Punctuation, String, Whitespace
-
-
-class VBScriptLexerTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = VBScriptLexer()
-
- def _assert_are_tokens_of_type(self, examples, expected_token_type):
- for test_number, example in enumerate(examples.split(), 1):
- token_count = 0
- for token_type, token_value in self.lexer.get_tokens(example):
- if token_type != Whitespace:
- token_count += 1
- self.assertEqual(
- token_type, expected_token_type,
- 'token_type #%d for %s is be %s but must be %s' %
- (test_number, token_value, token_type, expected_token_type))
- self.assertEqual(
- token_count, 1,
- '%s must yield exactly 1 token instead of %d' %
- (example, token_count))
-
- def _assert_tokens_match(self, text, expected_tokens_without_trailing_newline):
- actual_tokens = tuple(self.lexer.get_tokens(text))
- if (len(actual_tokens) >= 1) and (actual_tokens[-1] == (Whitespace, '\n')):
- actual_tokens = tuple(actual_tokens[:-1])
- self.assertEqual(
- expected_tokens_without_trailing_newline, actual_tokens,
- 'text must yield expected tokens: %s' % text)
-
- def test_can_lex_float(self):
- self._assert_are_tokens_of_type(
- '1. 1.e1 .1 1.2 1.2e3 1.2e+3 1.2e-3 1e2', Number.Float)
- self._assert_tokens_match(
- '1e2.1e2',
- ((Number.Float, '1e2'), (Number.Float, '.1e2'))
- )
-
- def test_can_reject_almost_float(self):
- self._assert_tokens_match(
- '.e1',
- ((Punctuation, '.'), (Name, 'e1')))
-
- def test_can_lex_integer(self):
- self._assert_are_tokens_of_type(
- '1 23 456', Number.Integer)
-
- def test_can_lex_names(self):
- self._assert_are_tokens_of_type(
- u'thingy thingy123 _thingy _123', Name)
-
- def test_can_recover_after_unterminated_string(self):
- self._assert_tokens_match(
- '"x\nx',
- ((String.Double, '"'), (String.Double, 'x'), (Error, '\n'), (Name, 'x'))
- )
-
- def test_can_recover_from_invalid_character(self):
- self._assert_tokens_match(
- 'a;bc\nd',
- ((Name, 'a'), (Error, ';bc\n'), (Name, 'd'))
- )
diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py
deleted file mode 100644
index b1b69267..00000000
--- a/tests/test_basic_api.py
+++ /dev/null
@@ -1,334 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments basic API tests
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import random
-import unittest
-
-from pygments import lexers, formatters, lex, format
-from pygments.token import _TokenType, Text
-from pygments.lexer import RegexLexer
-from pygments.formatters.img import FontNotFound
-from pygments.util import text_type, StringIO, BytesIO, xrange, ClassNotFound
-
-import support
-
-TESTFILE, TESTDIR = support.location(__file__)
-
-test_content = [chr(i) for i in xrange(33, 128)] * 5
-random.shuffle(test_content)
-test_content = ''.join(test_content) + '\n'
-
-
-def test_lexer_instantiate_all():
- # instantiate every lexer, to see if the token type defs are correct
- def verify(name):
- getattr(lexers, name)
- for x in lexers.LEXERS:
- yield verify, x
-
-
-def test_lexer_classes():
- # test that every lexer class has the correct public API
- def verify(cls):
- assert type(cls.name) is str
- for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
- assert hasattr(cls, attr)
- assert type(getattr(cls, attr)) is list, \
- "%s: %s attribute wrong" % (cls, attr)
- result = cls.analyse_text("abc")
- assert isinstance(result, float) and 0.0 <= result <= 1.0
- result = cls.analyse_text(".abc")
- assert isinstance(result, float) and 0.0 <= result <= 1.0
-
- assert all(al.lower() == al for al in cls.aliases)
-
- inst = cls(opt1="val1", opt2="val2")
- if issubclass(cls, RegexLexer):
- if not hasattr(cls, '_tokens'):
- # if there's no "_tokens", the lexer has to be one with
- # multiple tokendef variants
- assert cls.token_variants
- for variant in cls.tokens:
- assert 'root' in cls.tokens[variant]
- else:
- assert 'root' in cls._tokens, \
- '%s has no root state' % cls
-
- if cls.name in ['XQuery', 'Opa']: # XXX temporary
- return
-
- try:
- tokens = list(inst.get_tokens(test_content))
- except KeyboardInterrupt:
- raise KeyboardInterrupt(
- 'interrupted %s.get_tokens(): test_content=%r' %
- (cls.__name__, test_content))
- txt = ""
- for token in tokens:
- assert isinstance(token, tuple)
- assert isinstance(token[0], _TokenType)
- assert isinstance(token[1], text_type)
- txt += token[1]
- assert txt == test_content, "%s lexer roundtrip failed: %r != %r" % \
- (cls.name, test_content, txt)
-
- for lexer in lexers._iter_lexerclasses(plugins=False):
- yield verify, lexer
-
-
-def test_lexer_options():
- # test that the basic options work
- def ensure(tokens, output):
- concatenated = ''.join(token[1] for token in tokens)
- assert concatenated == output, \
- '%s: %r != %r' % (lexer, concatenated, output)
-
- def verify(cls):
- inst = cls(stripnl=False)
- ensure(inst.get_tokens('a\nb'), 'a\nb\n')
- ensure(inst.get_tokens('\n\n\n'), '\n\n\n')
- inst = cls(stripall=True)
- ensure(inst.get_tokens(' \n b\n\n\n'), 'b\n')
- # some lexers require full lines in input
- if ('ConsoleLexer' not in cls.__name__ and
- 'SessionLexer' not in cls.__name__ and
- not cls.__name__.startswith('Literate') and
- cls.__name__ not in ('ErlangShellLexer', 'RobotFrameworkLexer')):
- inst = cls(ensurenl=False)
- ensure(inst.get_tokens('a\nb'), 'a\nb')
- inst = cls(ensurenl=False, stripall=True)
- ensure(inst.get_tokens('a\nb\n\n'), 'a\nb')
-
- for lexer in lexers._iter_lexerclasses(plugins=False):
- if lexer.__name__ == 'RawTokenLexer':
- # this one is special
- continue
- yield verify, lexer
-
-
-def test_get_lexers():
- # test that the lexers functions work
- def verify(func, args):
- x = func(opt='val', *args)
- assert isinstance(x, lexers.PythonLexer)
- assert x.options["opt"] == "val"
-
- for func, args in [(lexers.get_lexer_by_name, ("python",)),
- (lexers.get_lexer_for_filename, ("test.py",)),
- (lexers.get_lexer_for_mimetype, ("text/x-python",)),
- (lexers.guess_lexer, ("#!/usr/bin/python -O\nprint",)),
- (lexers.guess_lexer_for_filename, ("a.py", "<%= @foo %>"))
- ]:
- yield verify, func, args
-
- for cls, (_, lname, aliases, _, mimetypes) in lexers.LEXERS.items():
- 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__
-
- try:
- lexers.get_lexer_by_name(None)
- except ClassNotFound:
- pass
- else:
- raise Exception
-
-
-def test_formatter_public_api():
- # test that every formatter class has the correct public API
- ts = list(lexers.PythonLexer().get_tokens("def f(): pass"))
- string_out = StringIO()
- bytes_out = BytesIO()
-
- def verify(formatter):
- info = formatters.FORMATTERS[formatter.__name__]
- assert len(info) == 5
- assert info[1], "missing formatter name"
- assert info[2], "missing formatter aliases"
- assert info[4], "missing formatter docstring"
-
- try:
- inst = formatter(opt1="val1")
- except (ImportError, FontNotFound) as e:
- raise support.SkipTest(e)
-
- try:
- inst.get_style_defs()
- except NotImplementedError:
- # may be raised by formatters for which it doesn't make sense
- pass
-
- if formatter.unicodeoutput:
- inst.format(ts, string_out)
- else:
- inst.format(ts, bytes_out)
-
- for name in formatters.FORMATTERS:
- formatter = getattr(formatters, name)
- yield verify, formatter
-
-
-def test_formatter_encodings():
- from pygments.formatters import HtmlFormatter
-
- # unicode output
- fmt = HtmlFormatter()
- tokens = [(Text, u"ä")]
- out = format(tokens, fmt)
- assert type(out) is text_type
- assert u"ä" in out
-
- # encoding option
- fmt = HtmlFormatter(encoding="latin1")
- tokens = [(Text, u"ä")]
- assert u"ä".encode("latin1") in format(tokens, fmt)
-
- # encoding and outencoding option
- fmt = HtmlFormatter(encoding="latin1", outencoding="utf8")
- tokens = [(Text, u"ä")]
- assert u"ä".encode("utf8") in format(tokens, fmt)
-
-
-def test_formatter_unicode_handling():
- # test that the formatter supports encoding and Unicode
- tokens = list(lexers.PythonLexer(encoding='utf-8').
- get_tokens("def f(): 'ä'"))
-
- def verify(formatter):
- try:
- inst = formatter(encoding=None)
- except (ImportError, FontNotFound) as e:
- # some dependency or font not installed
- raise support.SkipTest(e)
-
- if formatter.name != 'Raw tokens':
- out = format(tokens, inst)
- if formatter.unicodeoutput:
- assert type(out) is text_type, '%s: %r' % (formatter, out)
-
- inst = formatter(encoding='utf-8')
- out = format(tokens, inst)
- assert type(out) is bytes, '%s: %r' % (formatter, out)
- # Cannot test for encoding, since formatters may have to escape
- # non-ASCII characters.
- else:
- inst = formatter()
- out = format(tokens, inst)
- assert type(out) is bytes, '%s: %r' % (formatter, out)
-
- for formatter, info in formatters.FORMATTERS.items():
- # this tests the automatic importing as well
- fmter = getattr(formatters, formatter)
- yield verify, fmter
-
-
-def test_get_formatters():
- # test that the formatters functions work
- x = formatters.get_formatter_by_name("html", opt="val")
- assert isinstance(x, formatters.HtmlFormatter)
- assert x.options["opt"] == "val"
-
- x = formatters.get_formatter_for_filename("a.html", opt="val")
- assert isinstance(x, formatters.HtmlFormatter)
- assert x.options["opt"] == "val"
-
-
-def test_styles():
- # minimal style test
- from pygments.formatters import HtmlFormatter
- HtmlFormatter(style="pastie")
-
-
-def test_bare_class_handler():
- from pygments.formatters import HtmlFormatter
- from pygments.lexers import PythonLexer
- try:
- lex('test\n', PythonLexer)
- except TypeError as e:
- assert 'lex() argument must be a lexer instance' in str(e)
- else:
- assert False, 'nothing raised'
- try:
- format([], HtmlFormatter)
- except TypeError as e:
- assert 'format() argument must be a formatter instance' in str(e)
- else:
- assert False, 'nothing raised'
-
-
-class FiltersTest(unittest.TestCase):
-
- def test_basic(self):
- filters_args = [
- ('whitespace', {'spaces': True, 'tabs': True, 'newlines': True}),
- ('whitespace', {'wstokentype': False, 'spaces': True}),
- ('highlight', {'names': ['isinstance', 'lexers', 'x']}),
- ('codetagify', {'codetags': 'API'}),
- ('keywordcase', {'case': 'capitalize'}),
- ('raiseonerror', {}),
- ('gobble', {'n': 4}),
- ('tokenmerge', {}),
- ]
- for x, args in filters_args:
- lx = lexers.PythonLexer()
- lx.add_filter(x, **args)
- with open(TESTFILE, 'rb') as fp:
- text = fp.read().decode('utf-8')
- tokens = list(lx.get_tokens(text))
- self.assertTrue(all(isinstance(t[1], text_type)
- for t in tokens),
- '%s filter did not return Unicode' % x)
- roundtext = ''.join([t[1] for t in tokens])
- if x not in ('whitespace', 'keywordcase', 'gobble'):
- # these filters change the text
- self.assertEqual(roundtext, text,
- "lexer roundtrip with %s filter failed" % x)
-
- def test_raiseonerror(self):
- lx = lexers.PythonLexer()
- lx.add_filter('raiseonerror', excclass=RuntimeError)
- self.assertRaises(RuntimeError, list, lx.get_tokens('$'))
-
- def test_whitespace(self):
- lx = lexers.PythonLexer()
- lx.add_filter('whitespace', spaces='%')
- with open(TESTFILE, 'rb') as fp:
- text = fp.read().decode('utf-8')
- lxtext = ''.join([t[1] for t in list(lx.get_tokens(text))])
- self.assertFalse(' ' in lxtext)
-
- def test_keywordcase(self):
- lx = lexers.PythonLexer()
- lx.add_filter('keywordcase', case='capitalize')
- with open(TESTFILE, 'rb') as fp:
- text = fp.read().decode('utf-8')
- lxtext = ''.join([t[1] for t in list(lx.get_tokens(text))])
- self.assertTrue('Def' in lxtext and 'Class' in lxtext)
-
- def test_codetag(self):
- lx = lexers.PythonLexer()
- lx.add_filter('codetagify')
- text = u'# BUG: text'
- tokens = list(lx.get_tokens(text))
- self.assertEqual('# ', tokens[0][1])
- self.assertEqual('BUG', tokens[1][1])
-
- def test_codetag_boundary(self):
- # ticket #368
- lx = lexers.PythonLexer()
- lx.add_filter('codetagify')
- text = u'# DEBUG: text'
- tokens = list(lx.get_tokens(text))
- self.assertEqual('# DEBUG: text', tokens[0][1])
diff --git a/tests/test_bibtex.py b/tests/test_bibtex.py
deleted file mode 100644
index 2f1c395a..00000000
--- a/tests/test_bibtex.py
+++ /dev/null
@@ -1,236 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- BibTeX Test
- ~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import textwrap
-import unittest
-
-from pygments.lexers import BibTeXLexer, BSTLexer
-from pygments.token import Token
-
-
-class BibTeXTest(unittest.TestCase):
- def setUp(self):
- self.lexer = BibTeXLexer()
-
- def testPreamble(self):
- data = u'@PREAMBLE{"% some LaTeX code here"}'
- tokens = [
- (Token.Name.Class, u'@PREAMBLE'),
- (Token.Punctuation, u'{'),
- (Token.String, u'"'),
- (Token.String, u'% some LaTeX code here'),
- (Token.String, u'"'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(list(self.lexer.get_tokens(data)), tokens)
-
- def testString(self):
- data = u'@STRING(SCI = "Science")'
- tokens = [
- (Token.Name.Class, u'@STRING'),
- (Token.Punctuation, u'('),
- (Token.Name.Attribute, u'SCI'),
- (Token.Text, u' '),
- (Token.Punctuation, u'='),
- (Token.Text, u' '),
- (Token.String, u'"'),
- (Token.String, u'Science'),
- (Token.String, u'"'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(list(self.lexer.get_tokens(data)), tokens)
-
- def testEntry(self):
- data = u"""
- This is a comment.
-
- @ARTICLE{ruckenstein-diffusion,
- author = "Liu, Hongquin" # and # "Ruckenstein, Eli",
- year = 1997,
- month = JAN,
- pages = "888-895"
- }
- """
-
- tokens = [
- (Token.Comment, u'This is a comment.'),
- (Token.Text, u'\n\n'),
- (Token.Name.Class, u'@ARTICLE'),
- (Token.Punctuation, u'{'),
- (Token.Name.Label, u'ruckenstein-diffusion'),
- (Token.Punctuation, u','),
- (Token.Text, u'\n '),
- (Token.Name.Attribute, u'author'),
- (Token.Text, u' '),
- (Token.Punctuation, u'='),
- (Token.Text, u' '),
- (Token.String, u'"'),
- (Token.String, u'Liu, Hongquin'),
- (Token.String, u'"'),
- (Token.Text, u' '),
- (Token.Punctuation, u'#'),
- (Token.Text, u' '),
- (Token.Name.Variable, u'and'),
- (Token.Text, u' '),
- (Token.Punctuation, u'#'),
- (Token.Text, u' '),
- (Token.String, u'"'),
- (Token.String, u'Ruckenstein, Eli'),
- (Token.String, u'"'),
- (Token.Punctuation, u','),
- (Token.Text, u'\n '),
- (Token.Name.Attribute, u'year'),
- (Token.Text, u' '),
- (Token.Punctuation, u'='),
- (Token.Text, u' '),
- (Token.Number, u'1997'),
- (Token.Punctuation, u','),
- (Token.Text, u'\n '),
- (Token.Name.Attribute, u'month'),
- (Token.Text, u' '),
- (Token.Punctuation, u'='),
- (Token.Text, u' '),
- (Token.Name.Variable, u'JAN'),
- (Token.Punctuation, u','),
- (Token.Text, u'\n '),
- (Token.Name.Attribute, u'pages'),
- (Token.Text, u' '),
- (Token.Punctuation, u'='),
- (Token.Text, u' '),
- (Token.String, u'"'),
- (Token.String, u'888-895'),
- (Token.String, u'"'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(list(self.lexer.get_tokens(textwrap.dedent(data))), tokens)
-
- def testComment(self):
- data = '@COMMENT{test}'
- tokens = [
- (Token.Comment, u'@COMMENT'),
- (Token.Comment, u'{test}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(list(self.lexer.get_tokens(data)), tokens)
-
- def testMissingBody(self):
- data = '@ARTICLE xxx'
- tokens = [
- (Token.Name.Class, u'@ARTICLE'),
- (Token.Text, u' '),
- (Token.Error, u'x'),
- (Token.Error, u'x'),
- (Token.Error, u'x'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(list(self.lexer.get_tokens(data)), tokens)
-
- def testMismatchedBrace(self):
- data = '@PREAMBLE(""}'
- tokens = [
- (Token.Name.Class, u'@PREAMBLE'),
- (Token.Punctuation, u'('),
- (Token.String, u'"'),
- (Token.String, u'"'),
- (Token.Error, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(list(self.lexer.get_tokens(data)), tokens)
-
-
-class BSTTest(unittest.TestCase):
- def setUp(self):
- self.lexer = BSTLexer()
-
- def testBasicBST(self):
- data = """
- % BibTeX standard bibliography style `plain'
-
- INTEGERS { output.state before.all }
-
- FUNCTION {sort.format.title}
- { 't :=
- "A " #2
- "An " #3
- "The " #4 t chop.word
- chop.word
- chop.word
- sortify
- #1 global.max$ substring$
- }
-
- ITERATE {call.type$}
- """
- tokens = [
- (Token.Comment.SingleLine, "% BibTeX standard bibliography style `plain'"),
- (Token.Text, u'\n\n'),
- (Token.Keyword, u'INTEGERS'),
- (Token.Text, u' '),
- (Token.Punctuation, u'{'),
- (Token.Text, u' '),
- (Token.Name.Variable, u'output.state'),
- (Token.Text, u' '),
- (Token.Name.Variable, u'before.all'),
- (Token.Text, u' '),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n\n'),
- (Token.Keyword, u'FUNCTION'),
- (Token.Text, u' '),
- (Token.Punctuation, u'{'),
- (Token.Name.Variable, u'sort.format.title'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'{'),
- (Token.Text, u' '),
- (Token.Name.Function, u"'t"),
- (Token.Text, u' '),
- (Token.Name.Variable, u':='),
- (Token.Text, u'\n'),
- (Token.Literal.String, u'"A "'),
- (Token.Text, u' '),
- (Token.Literal.Number, u'#2'),
- (Token.Text, u'\n '),
- (Token.Literal.String, u'"An "'),
- (Token.Text, u' '),
- (Token.Literal.Number, u'#3'),
- (Token.Text, u'\n '),
- (Token.Literal.String, u'"The "'),
- (Token.Text, u' '),
- (Token.Literal.Number, u'#4'),
- (Token.Text, u' '),
- (Token.Name.Variable, u't'),
- (Token.Text, u' '),
- (Token.Name.Variable, u'chop.word'),
- (Token.Text, u'\n '),
- (Token.Name.Variable, u'chop.word'),
- (Token.Text, u'\n'),
- (Token.Name.Variable, u'chop.word'),
- (Token.Text, u'\n'),
- (Token.Name.Variable, u'sortify'),
- (Token.Text, u'\n'),
- (Token.Literal.Number, u'#1'),
- (Token.Text, u' '),
- (Token.Name.Builtin, u'global.max$'),
- (Token.Text, u' '),
- (Token.Name.Builtin, u'substring$'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n\n'),
- (Token.Keyword, u'ITERATE'),
- (Token.Text, u' '),
- (Token.Punctuation, u'{'),
- (Token.Name.Builtin, u'call.type$'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(list(self.lexer.get_tokens(textwrap.dedent(data))), tokens)
diff --git a/tests/test_cfm.py b/tests/test_cfm.py
deleted file mode 100644
index e7147a6c..00000000
--- a/tests/test_cfm.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic ColdfusionHtmlLexer Test
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-import os
-
-from pygments.token import Token
-from pygments.lexers import ColdfusionHtmlLexer
-
-
-class ColdfusionHtmlLexerTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = ColdfusionHtmlLexer()
-
- def testBasicComment(self):
- fragment = u'<!--- cfcomment --->'
- expected = [
- (Token.Text, u''),
- (Token.Comment.Multiline, u'<!---'),
- (Token.Comment.Multiline, u' cfcomment '),
- (Token.Comment.Multiline, u'--->'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
-
- def testNestedComment(self):
- fragment = u'<!--- nested <!--- cfcomment ---> --->'
- expected = [
- (Token.Text, u''),
- (Token.Comment.Multiline, u'<!---'),
- (Token.Comment.Multiline, u' nested '),
- (Token.Comment.Multiline, u'<!---'),
- (Token.Comment.Multiline, u' cfcomment '),
- (Token.Comment.Multiline, u'--->'),
- (Token.Comment.Multiline, u' '),
- (Token.Comment.Multiline, u'--->'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_clexer.py b/tests/test_clexer.py
deleted file mode 100644
index 64b765ef..00000000
--- a/tests/test_clexer.py
+++ /dev/null
@@ -1,259 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic CLexer Test
- ~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-import os
-import textwrap
-
-from pygments.token import Text, Number, Token
-from pygments.lexers import CLexer
-
-
-class CLexerTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = CLexer()
-
- def testNumbers(self):
- code = '42 23.42 23. .42 023 0xdeadbeef 23e+42 42e-23'
- wanted = []
- for item in zip([Number.Integer, Number.Float, Number.Float,
- Number.Float, Number.Oct, Number.Hex,
- Number.Float, Number.Float], code.split()):
- wanted.append(item)
- wanted.append((Text, ' '))
- wanted = wanted[:-1] + [(Text, '\n')]
- self.assertEqual(list(self.lexer.get_tokens(code)), wanted)
-
- def testSwitch(self):
- fragment = u'''\
- int main()
- {
- switch (0)
- {
- case 0:
- default:
- ;
- }
- }
- '''
- tokens = [
- (Token.Keyword.Type, u'int'),
- (Token.Text, u' '),
- (Token.Name.Function, u'main'),
- (Token.Punctuation, u'('),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'{'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'switch'),
- (Token.Text, u' '),
- (Token.Punctuation, u'('),
- (Token.Literal.Number.Integer, u'0'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Punctuation, u'{'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'case'),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'0'),
- (Token.Operator, u':'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'default'),
- (Token.Operator, u':'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(textwrap.dedent(fragment))))
-
- def testSwitchSpaceBeforeColon(self):
- fragment = u'''\
- int main()
- {
- switch (0)
- {
- case 0 :
- default :
- ;
- }
- }
- '''
- tokens = [
- (Token.Keyword.Type, u'int'),
- (Token.Text, u' '),
- (Token.Name.Function, u'main'),
- (Token.Punctuation, u'('),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'{'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'switch'),
- (Token.Text, u' '),
- (Token.Punctuation, u'('),
- (Token.Literal.Number.Integer, u'0'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Punctuation, u'{'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'case'),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'0'),
- (Token.Text, u' '),
- (Token.Operator, u':'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'default'),
- (Token.Text, u' '),
- (Token.Operator, u':'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(textwrap.dedent(fragment))))
-
- def testLabel(self):
- fragment = u'''\
- int main()
- {
- foo:
- goto foo;
- }
- '''
- tokens = [
- (Token.Keyword.Type, u'int'),
- (Token.Text, u' '),
- (Token.Name.Function, u'main'),
- (Token.Punctuation, u'('),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'{'),
- (Token.Text, u'\n'),
- (Token.Name.Label, u'foo'),
- (Token.Punctuation, u':'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'goto'),
- (Token.Text, u' '),
- (Token.Name, u'foo'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(textwrap.dedent(fragment))))
-
- def testLabelSpaceBeforeColon(self):
- fragment = u'''\
- int main()
- {
- foo :
- goto foo;
- }
- '''
- tokens = [
- (Token.Keyword.Type, u'int'),
- (Token.Text, u' '),
- (Token.Name.Function, u'main'),
- (Token.Punctuation, u'('),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'{'),
- (Token.Text, u'\n'),
- (Token.Name.Label, u'foo'),
- (Token.Text, u' '),
- (Token.Punctuation, u':'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'goto'),
- (Token.Text, u' '),
- (Token.Name, u'foo'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(textwrap.dedent(fragment))))
-
- def testLabelFollowedByStatement(self):
- fragment = u'''\
- int main()
- {
- foo:return 0;
- goto foo;
- }
- '''
- tokens = [
- (Token.Keyword.Type, u'int'),
- (Token.Text, u' '),
- (Token.Name.Function, u'main'),
- (Token.Punctuation, u'('),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'{'),
- (Token.Text, u'\n'),
- (Token.Name.Label, u'foo'),
- (Token.Punctuation, u':'),
- (Token.Keyword, u'return'),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'0'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'goto'),
- (Token.Text, u' '),
- (Token.Name, u'foo'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(textwrap.dedent(fragment))))
-
- def testPreprocFile(self):
- fragment = u'#include <foo>\n'
- tokens = [
- (Token.Comment.Preproc, u'#'),
- (Token.Comment.Preproc, u'include'),
- (Token.Text, u' '),
- (Token.Comment.PreprocFile, u'<foo>'),
- (Token.Comment.Preproc, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testPreprocFile2(self):
- fragment = u'#include "foo.h"\n'
- tokens = [
- (Token.Comment.Preproc, u'#'),
- (Token.Comment.Preproc, u'include'),
- (Token.Text, u' '),
- (Token.Comment.PreprocFile, u'"foo.h"'),
- (Token.Comment.Preproc, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
deleted file mode 100644
index 169d690d..00000000
--- a/tests/test_cmdline.py
+++ /dev/null
@@ -1,313 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Command line test
- ~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import io
-import os
-import re
-import sys
-import tempfile
-import unittest
-
-import support
-from pygments import cmdline, highlight
-from pygments.util import BytesIO, StringIO
-
-
-TESTFILE, TESTDIR = support.location(__file__)
-TESTCODE = '''\
-def func(args):
- pass
-'''
-
-
-def _decode_output(text):
- try:
- return text.decode('utf-8')
- except UnicodeEncodeError: # implicit encode on Python 2 with data loss
- return text
-
-
-def run_cmdline(*args, **kwds):
- saved_stdin = sys.stdin
- saved_stdout = sys.stdout
- saved_stderr = sys.stderr
- if sys.version_info > (3,):
- stdin_buffer = BytesIO()
- stdout_buffer = BytesIO()
- stderr_buffer = BytesIO()
- new_stdin = sys.stdin = io.TextIOWrapper(stdin_buffer, 'utf-8')
- new_stdout = sys.stdout = io.TextIOWrapper(stdout_buffer, 'utf-8')
- new_stderr = sys.stderr = io.TextIOWrapper(stderr_buffer, 'utf-8')
- else:
- stdin_buffer = new_stdin = sys.stdin = StringIO()
- stdout_buffer = new_stdout = sys.stdout = StringIO()
- stderr_buffer = new_stderr = sys.stderr = StringIO()
- new_stdin.write(kwds.get('stdin', ''))
- new_stdin.seek(0, 0)
- try:
- ret = cmdline.main(['pygmentize'] + list(args))
- finally:
- sys.stdin = saved_stdin
- sys.stdout = saved_stdout
- sys.stderr = saved_stderr
- new_stdout.flush()
- new_stderr.flush()
- out, err = stdout_buffer.getvalue(), \
- stderr_buffer.getvalue()
- return (ret, _decode_output(out), _decode_output(err))
-
-
-class CmdLineTest(unittest.TestCase):
-
- def check_success(self, *cmdline, **kwds):
- code, out, err = run_cmdline(*cmdline, **kwds)
- self.assertEqual(code, 0)
- self.assertEqual(err, '')
- return out
-
- def check_failure(self, *cmdline, **kwds):
- expected_code = kwds.pop('code', 1)
- code, out, err = run_cmdline(*cmdline, **kwds)
- self.assertEqual(code, expected_code)
- self.assertEqual(out, '')
- return err
-
- def test_normal(self):
- # test that cmdline gives the same output as library api
- from pygments.lexers import PythonLexer
- from pygments.formatters import HtmlFormatter
- filename = TESTFILE
- with open(filename, 'rb') as fp:
- code = fp.read()
-
- output = highlight(code, PythonLexer(), HtmlFormatter())
-
- o = self.check_success('-lpython', '-fhtml', filename)
- self.assertEqual(o, output)
-
- def test_stdin(self):
- o = self.check_success('-lpython', '-fhtml', stdin=TESTCODE)
- o = re.sub('<[^>]*>', '', o)
- # rstrip is necessary since HTML inserts a \n after the last </div>
- self.assertEqual(o.rstrip(), TESTCODE.rstrip())
-
- # guess if no lexer given
- o = self.check_success('-fhtml', stdin=TESTCODE)
- o = re.sub('<[^>]*>', '', o)
- # rstrip is necessary since HTML inserts a \n after the last </div>
- self.assertEqual(o.rstrip(), TESTCODE.rstrip())
-
- def test_outfile(self):
- # test that output file works with and without encoding
- fd, name = tempfile.mkstemp()
- os.close(fd)
- for opts in [['-fhtml', '-o', name, TESTFILE],
- ['-flatex', '-o', name, TESTFILE],
- ['-fhtml', '-o', name, '-O', 'encoding=utf-8', TESTFILE]]:
- try:
- self.check_success(*opts)
- finally:
- os.unlink(name)
-
- def test_load_from_file(self):
- lexer_file = os.path.join(TESTDIR, 'support', 'python_lexer.py')
- formatter_file = os.path.join(TESTDIR, 'support', 'html_formatter.py')
-
- # By default, use CustomLexer
- o = self.check_success('-l', lexer_file, '-f', 'html',
- '-x', stdin=TESTCODE)
- o = re.sub('<[^>]*>', '', o)
- # rstrip is necessary since HTML inserts a \n after the last </div>
- self.assertEqual(o.rstrip(), TESTCODE.rstrip())
-
- # If user specifies a name, use it
- o = self.check_success('-f', 'html', '-x', '-l',
- lexer_file + ':LexerWrapper', stdin=TESTCODE)
- o = re.sub('<[^>]*>', '', o)
- # rstrip is necessary since HTML inserts a \n after the last </div>
- self.assertEqual(o.rstrip(), TESTCODE.rstrip())
-
- # Should also work for formatters
- o = self.check_success('-lpython', '-f',
- formatter_file + ':HtmlFormatterWrapper',
- '-x', stdin=TESTCODE)
- o = re.sub('<[^>]*>', '', o)
- # rstrip is necessary since HTML inserts a \n after the last </div>
- self.assertEqual(o.rstrip(), TESTCODE.rstrip())
-
- def test_stream_opt(self):
- o = self.check_success('-lpython', '-s', '-fterminal', stdin=TESTCODE)
- o = re.sub(r'\x1b\[.*?m', '', o)
- self.assertEqual(o.replace('\r\n', '\n'), TESTCODE)
-
- def test_h_opt(self):
- o = self.check_success('-h')
- self.assertTrue('Usage:' in o)
-
- def test_L_opt(self):
- o = self.check_success('-L')
- self.assertTrue('Lexers' in o and 'Formatters' in o and
- 'Filters' in o and 'Styles' in o)
- o = self.check_success('-L', 'lexer')
- self.assertTrue('Lexers' in o and 'Formatters' not in o)
- self.check_success('-L', 'lexers')
-
- def test_O_opt(self):
- filename = TESTFILE
- o = self.check_success('-Ofull=1,linenos=true,foo=bar',
- '-fhtml', filename)
- self.assertTrue('<html' in o)
- self.assertTrue('class="linenos"' in o)
-
- # "foobar" is invalid for a bool option
- e = self.check_failure('-Ostripnl=foobar', TESTFILE)
- self.assertTrue('Error: Invalid value' in e)
- e = self.check_failure('-Ostripnl=foobar', '-lpy')
- self.assertTrue('Error: Invalid value' in e)
-
- def test_P_opt(self):
- filename = TESTFILE
- o = self.check_success('-Pfull', '-Ptitle=foo, bar=baz=,',
- '-fhtml', filename)
- self.assertTrue('<title>foo, bar=baz=,</title>' in o)
-
- def test_F_opt(self):
- filename = TESTFILE
- o = self.check_success('-Fhighlight:tokentype=Name.Blubb,'
- 'names=TESTFILE filename',
- '-fhtml', filename)
- self.assertTrue('<span class="n n-Blubb' in o)
-
- def test_H_opt(self):
- o = self.check_success('-H', 'formatter', 'html')
- self.assertTrue('HTML' in o)
- o = self.check_success('-H', 'lexer', 'python')
- self.assertTrue('Python' in o)
- o = self.check_success('-H', 'filter', 'raiseonerror')
- self.assertTrue('raiseonerror', o)
- e = self.check_failure('-H', 'lexer', 'foobar')
- self.assertTrue('not found' in e)
-
- def test_S_opt(self):
- o = self.check_success('-S', 'default', '-f', 'html', '-O', 'linenos=1')
- lines = o.splitlines()
- for line in lines:
- # every line is for a token class
- parts = line.split()
- self.assertTrue(parts[0].startswith('.'))
- self.assertTrue(parts[1] == '{')
- if parts[0] != '.hll':
- self.assertTrue(parts[-4] == '}')
- self.assertTrue(parts[-3] == '/*')
- self.assertTrue(parts[-1] == '*/')
- self.check_failure('-S', 'default', '-f', 'foobar')
-
- def test_N_opt(self):
- o = self.check_success('-N', 'test.py')
- self.assertEqual('python', o.strip())
- o = self.check_success('-N', 'test.unknown')
- self.assertEqual('text', o.strip())
-
- def test_invalid_opts(self):
- for opts in [
- ('-X',),
- ('-L', '-lpy'),
- ('-L', '-fhtml'),
- ('-L', '-Ox'),
- ('-S', 'default', '-l', 'py', '-f', 'html'),
- ('-S', 'default'),
- ('-a', 'arg'),
- ('-H',),
- (TESTFILE, TESTFILE),
- ('-H', 'formatter'),
- ('-H', 'foo', 'bar'),
- ('-s',),
- ('-s', TESTFILE),
- ]:
- self.check_failure(*opts, code=2)
-
- def test_errors(self):
- # input file not found
- e = self.check_failure('-lpython', 'nonexistent.py')
- self.assertTrue('Error: cannot read infile' in e)
- self.assertTrue('nonexistent.py' in e)
-
- # lexer not found
- e = self.check_failure('-lfooo', TESTFILE)
- self.assertTrue('Error: no lexer for alias' in e)
-
- # cannot load .py file without load_from_file flag
- e = self.check_failure('-l', 'nonexistent.py', TESTFILE)
- self.assertTrue('Error: no lexer for alias' in e)
-
- # lexer file is missing/unreadable
- e = self.check_failure('-l', 'nonexistent.py',
- '-x', TESTFILE)
- self.assertTrue('Error: cannot read' in e)
-
- # lexer file is malformed
- e = self.check_failure('-l', 'support/empty.py',
- '-x', TESTFILE)
- self.assertTrue('Error: no valid CustomLexer class found' in e)
-
- # formatter not found
- e = self.check_failure('-lpython', '-ffoo', TESTFILE)
- self.assertTrue('Error: no formatter found for name' in e)
-
- # formatter for outfile not found
- e = self.check_failure('-ofoo.foo', TESTFILE)
- self.assertTrue('Error: no formatter found for file name' in e)
-
- # cannot load .py file without load_from_file flag
- e = self.check_failure('-f', 'nonexistent.py', TESTFILE)
- self.assertTrue('Error: no formatter found for name' in e)
-
- # formatter file is missing/unreadable
- e = self.check_failure('-f', 'nonexistent.py',
- '-x', TESTFILE)
- self.assertTrue('Error: cannot read' in e)
-
- # formatter file is malformed
- e = self.check_failure('-f', 'support/empty.py',
- '-x', TESTFILE)
- self.assertTrue('Error: no valid CustomFormatter class found' in e)
-
- # output file not writable
- e = self.check_failure('-o', os.path.join('nonexistent', 'dir', 'out.html'),
- '-lpython', TESTFILE)
- self.assertTrue('Error: cannot open outfile' in e)
- self.assertTrue('out.html' in e)
-
- # unknown filter
- e = self.check_failure('-F', 'foo', TESTFILE)
- self.assertTrue('Error: filter \'foo\' not found' in e)
-
- def test_exception(self):
- cmdline.highlight = None # override callable to provoke TypeError
- try:
- # unexpected exception while highlighting
- e = self.check_failure('-lpython', TESTFILE)
- self.assertTrue('*** Error while highlighting:' in e)
- self.assertTrue('TypeError' in e)
-
- # same with -v: should reraise the exception
- try:
- self.check_failure('-lpython', '-v', TESTFILE)
- except Exception:
- pass
- else:
- self.fail('exception not reraised')
- finally:
- cmdline.highlight = highlight
-
- def test_parse_opts(self):
- self.assertEqual(cmdline._parse_options([' ', 'keyonly,key = value ']),
- {'keyonly': True, 'key': 'value'})
diff --git a/tests/test_cpp.py b/tests/test_cpp.py
deleted file mode 100644
index ef59965c..00000000
--- a/tests/test_cpp.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- CPP Tests
- ~~~~~~~~~
-
- :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexers import CppLexer
-from pygments.token import Token
-
-
-class CppTest(unittest.TestCase):
- def setUp(self):
- self.lexer = CppLexer()
-
- def testGoodComment(self):
- fragment = u'/* foo */\n'
- tokens = [
- (Token.Comment.Multiline, u'/* foo */'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testOpenComment(self):
- fragment = u'/* foo\n'
- tokens = [
- (Token.Comment.Multiline, u'/* foo\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_crystal.py b/tests/test_crystal.py
deleted file mode 100644
index 9a1588f2..00000000
--- a/tests/test_crystal.py
+++ /dev/null
@@ -1,308 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic CrystalLexer Test
- ~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import unicode_literals
-import unittest
-
-from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
-from pygments.lexers import CrystalLexer
-
-
-class CrystalTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = CrystalLexer()
- self.maxDiff = None
-
- def testRangeSyntax1(self):
- fragment = '1...3\n'
- tokens = [
- (Number.Integer, '1'),
- (Operator, '...'),
- (Number.Integer, '3'),
- (Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testRangeSyntax2(self):
- fragment = '1 .. 3\n'
- tokens = [
- (Number.Integer, '1'),
- (Text, ' '),
- (Operator, '..'),
- (Text, ' '),
- (Number.Integer, '3'),
- (Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testInterpolationNestedCurly(self):
- fragment = (
- '"A#{ (3..5).group_by { |x| x/2}.map '
- 'do |k,v| "#{k}" end.join }" + "Z"\n')
- tokens = [
- (String.Double, '"'),
- (String.Double, 'A'),
- (String.Interpol, '#{'),
- (Text, ' '),
- (Punctuation, '('),
- (Number.Integer, '3'),
- (Operator, '..'),
- (Number.Integer, '5'),
- (Punctuation, ')'),
- (Operator, '.'),
- (Name, 'group_by'),
- (Text, ' '),
- (String.Interpol, '{'),
- (Text, ' '),
- (Operator, '|'),
- (Name, 'x'),
- (Operator, '|'),
- (Text, ' '),
- (Name, 'x'),
- (Operator, '/'),
- (Number.Integer, '2'),
- (String.Interpol, '}'),
- (Operator, '.'),
- (Name, 'map'),
- (Text, ' '),
- (Keyword, 'do'),
- (Text, ' '),
- (Operator, '|'),
- (Name, 'k'),
- (Punctuation, ','),
- (Name, 'v'),
- (Operator, '|'),
- (Text, ' '),
- (String.Double, '"'),
- (String.Interpol, '#{'),
- (Name, 'k'),
- (String.Interpol, '}'),
- (String.Double, '"'),
- (Text, ' '),
- (Keyword, 'end'),
- (Operator, '.'),
- (Name, 'join'),
- (Text, ' '),
- (String.Interpol, '}'),
- (String.Double, '"'),
- (Text, ' '),
- (Operator, '+'),
- (Text, ' '),
- (String.Double, '"'),
- (String.Double, 'Z'),
- (String.Double, '"'),
- (Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testOperatorMethods(self):
- fragment = '([] of Int32).[]?(5)\n'
- tokens = [
- (Punctuation, '('),
- (Operator, '['),
- (Operator, ']'),
- (Text, ' '),
- (Keyword, 'of'),
- (Text, ' '),
- (Name.Builtin, 'Int32'),
- (Punctuation, ')'),
- (Operator, '.'),
- (Name.Operator, '[]?'),
- (Punctuation, '('),
- (Number.Integer, '5'),
- (Punctuation, ')'),
- (Text, '\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testArrayAccess(self):
- fragment = '[5][5]?\n'
- tokens = [
- (Operator, '['),
- (Number.Integer, '5'),
- (Operator, ']'),
- (Operator, '['),
- (Number.Integer, '5'),
- (Operator, ']?'),
- (Text, '\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testNumbers(self):
- for kind, testset in [
- (Number.Integer, '0 1 1_000_000 1u8 11231231231121312i64'),
- (Number.Float, '0.0 1.0_f32 1_f32 0f64 1e+4 1e111 1_234.567_890'),
- (Number.Bin, '0b1001_0110 0b0u8'),
- (Number.Oct, '0o17 0o7_i32'),
- (Number.Hex, '0xdeadBEEF'),
- ]:
- for fragment in testset.split():
- self.assertEqual([(kind, fragment), (Text, '\n')],
- list(self.lexer.get_tokens(fragment + '\n')))
-
- for fragment in '01 0b2 0x129g2 0o12358'.split():
- self.assertEqual(next(self.lexer.get_tokens(fragment + '\n'))[0],
- Error)
-
- def testChars(self):
- for fragment in ["'a'", "'я'", "'\\u{1234}'", "'\n'"]:
- self.assertEqual([(String.Char, fragment), (Text, '\n')],
- list(self.lexer.get_tokens(fragment + '\n')))
- self.assertEqual(next(self.lexer.get_tokens("'abc'"))[0], Error)
-
- def testMacro(self):
- fragment = (
- 'def<=>(other : self) : Int\n'
- '{%for field in %w(first_name middle_name last_name)%}\n'
- 'cmp={{field.id}}<=>other.{{field.id}}\n'
- 'return cmp if cmp!=0\n'
- '{%end%}\n'
- '0\n'
- 'end\n')
- tokens = [
- (Keyword, 'def'),
- (Name.Function, '<=>'),
- (Punctuation, '('),
- (Name, 'other'),
- (Text, ' '),
- (Punctuation, ':'),
- (Text, ' '),
- (Keyword.Pseudo, 'self'),
- (Punctuation, ')'),
- (Text, ' '),
- (Punctuation, ':'),
- (Text, ' '),
- (Name.Builtin, 'Int'),
- (Text, '\n'),
- (String.Interpol, '{%'),
- (Keyword, 'for'),
- (Text, ' '),
- (Name, 'field'),
- (Text, ' '),
- (Keyword, 'in'),
- (Text, ' '),
- (String.Other, '%w('),
- (String.Other, 'first_name middle_name last_name'),
- (String.Other, ')'),
- (String.Interpol, '%}'),
- (Text, '\n'),
- (Name, 'cmp'),
- (Operator, '='),
- (String.Interpol, '{{'),
- (Name, 'field'),
- (Operator, '.'),
- (Name, 'id'),
- (String.Interpol, '}}'),
- (Operator, '<=>'),
- (Name, 'other'),
- (Operator, '.'),
- (String.Interpol, '{{'),
- (Name, 'field'),
- (Operator, '.'),
- (Name, 'id'),
- (String.Interpol, '}}'),
- (Text, '\n'),
- (Keyword, 'return'),
- (Text, ' '),
- (Name, 'cmp'),
- (Text, ' '),
- (Keyword, 'if'),
- (Text, ' '),
- (Name, 'cmp'),
- (Operator, '!='),
- (Number.Integer, '0'),
- (Text, '\n'),
- (String.Interpol, '{%'),
- (Keyword, 'end'),
- (String.Interpol, '%}'),
- (Text, '\n'),
- (Number.Integer, '0'),
- (Text, '\n'),
- (Keyword, 'end'),
- (Text, '\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testLib(self):
- fragment = (
- '@[Link("some")]\nlib LibSome\n'
- '@[CallConvention("X86_StdCall")]\nfun foo="some.foo"(thing : Void*) : LibC::Int\n'
- 'end\n')
- tokens = [
- (Operator, '@['),
- (Name.Decorator, 'Link'),
- (Punctuation, '('),
- (String.Double, '"'),
- (String.Double, 'some'),
- (String.Double, '"'),
- (Punctuation, ')'),
- (Operator, ']'),
- (Text, '\n'),
- (Keyword, 'lib'),
- (Text, ' '),
- (Name.Namespace, 'LibSome'),
- (Text, '\n'),
- (Operator, '@['),
- (Name.Decorator, 'CallConvention'),
- (Punctuation, '('),
- (String.Double, '"'),
- (String.Double, 'X86_StdCall'),
- (String.Double, '"'),
- (Punctuation, ')'),
- (Operator, ']'),
- (Text, '\n'),
- (Keyword, 'fun'),
- (Text, ' '),
- (Name.Function, 'foo'),
- (Operator, '='),
- (String.Double, '"'),
- (String.Double, 'some.foo'),
- (String.Double, '"'),
- (Punctuation, '('),
- (Name, 'thing'),
- (Text, ' '),
- (Punctuation, ':'),
- (Text, ' '),
- (Name.Builtin, 'Void'),
- (Operator, '*'),
- (Punctuation, ')'),
- (Text, ' '),
- (Punctuation, ':'),
- (Text, ' '),
- (Name, 'LibC'),
- (Operator, '::'),
- (Name.Builtin, 'Int'),
- (Text, '\n'),
- (Keyword, 'end'),
- (Text, '\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testEscapedBracestring(self):
- fragment = 'str.gsub(%r{\\\\\\\\}, "/")\n'
- tokens = [
- (Name, 'str'),
- (Operator, '.'),
- (Name, 'gsub'),
- (Punctuation, '('),
- (String.Regex, '%r{'),
- (String.Regex, '\\\\'),
- (String.Regex, '\\\\'),
- (String.Regex, '}'),
- (Punctuation, ','),
- (Text, ' '),
- (String.Double, '"'),
- (String.Double, '/'),
- (String.Double, '"'),
- (Punctuation, ')'),
- (Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_csound.py b/tests/test_csound.py
deleted file mode 100644
index 8a253916..00000000
--- a/tests/test_csound.py
+++ /dev/null
@@ -1,491 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Csound lexer tests
- ~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-from textwrap import dedent
-
-from pygments.token import Comment, Error, Keyword, Name, Number, Operator, Punctuation, \
- String, Text
-from pygments.lexers import CsoundOrchestraLexer
-
-
-class CsoundOrchestraTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = CsoundOrchestraLexer()
- self.maxDiff = None
-
- def testComments(self):
- fragment = dedent('''\
- /*
- * comment
- */
- ; comment
- // comment
- ''')
- tokens = [
- (Comment.Multiline, u'/*\n * comment\n */'),
- (Text, u'\n'),
- (Comment.Single, u'; comment'),
- (Text, u'\n'),
- (Comment.Single, u'// comment'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testInstrumentBlocks(self):
- fragment = dedent('''\
- instr/**/1,/**/N_a_M_e_,/**/+Name/**///
- iDuration = p3
- outc:a(aSignal)
- endin
- ''')
- tokens = [
- (Keyword.Declaration, u'instr'),
- (Comment.Multiline, u'/**/'),
- (Name.Function, u'1'),
- (Punctuation, u','),
- (Comment.Multiline, u'/**/'),
- (Name.Function, u'N_a_M_e_'),
- (Punctuation, u','),
- (Comment.Multiline, u'/**/'),
- (Punctuation, u'+'),
- (Name.Function, u'Name'),
- (Comment.Multiline, u'/**/'),
- (Comment.Single, u'//'),
- (Text, u'\n'),
- (Text, u' '),
- (Keyword.Type, u'i'),
- (Name, u'Duration'),
- (Text, u' '),
- (Operator, u'='),
- (Text, u' '),
- (Name.Variable.Instance, u'p3'),
- (Text, u'\n'),
- (Text, u' '),
- (Name.Builtin, u'outc'),
- (Punctuation, u':'),
- (Keyword.Type, u'a'),
- (Punctuation, u'('),
- (Keyword.Type, u'a'),
- (Name, u'Signal'),
- (Punctuation, u')'),
- (Text, u'\n'),
- (Keyword.Declaration, u'endin'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testUserDefinedOpcodes(self):
- fragment = dedent('''\
- opcode/**/aUDO,/**/i[],/**/aik//
- aUDO
- endop
- ''')
- tokens = [
- (Keyword.Declaration, u'opcode'),
- (Comment.Multiline, u'/**/'),
- (Name.Function, u'aUDO'),
- (Punctuation, u','),
- (Comment.Multiline, u'/**/'),
- (Keyword.Type, u'i[]'),
- (Punctuation, u','),
- (Comment.Multiline, u'/**/'),
- (Keyword.Type, u'aik'),
- (Comment.Single, u'//'),
- (Text, u'\n'),
- (Text, u' '),
- (Name.Function, u'aUDO'),
- (Text, u'\n'),
- (Keyword.Declaration, u'endop'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testNumbers(self):
- fragment = '123 0123456789'
- tokens = [
- (Number.Integer, u'123'),
- (Text, u' '),
- (Number.Integer, u'0123456789'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
- fragment = '0xabcdef0123456789 0XABCDEF'
- tokens = [
- (Keyword.Type, u'0x'),
- (Number.Hex, u'abcdef0123456789'),
- (Text, u' '),
- (Keyword.Type, u'0X'),
- (Number.Hex, u'ABCDEF'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
- fragments = ['1e2', '3e+4', '5e-6', '7E8', '9E+0', '1E-2', '3.', '4.56', '.789']
- for fragment in fragments:
- tokens = [
- (Number.Float, fragment),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testQuotedStrings(self):
- fragment = '"characters$MACRO."'
- tokens = [
- (String, u'"'),
- (String, u'characters'),
- (Comment.Preproc, u'$MACRO.'),
- (String, u'"'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testBracedStrings(self):
- fragment = dedent('''\
- {{
- characters$MACRO.
- }}
- ''')
- tokens = [
- (String, u'{{'),
- (String, u'\ncharacters$MACRO.\n'),
- (String, u'}}'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testEscapeSequences(self):
- for character in ['\\', 'a', 'b', 'n', 'r', 't', '"', '012', '345', '67']:
- escapedCharacter = '\\' + character
- fragment = '"' + escapedCharacter + '"'
- tokens = [
- (String, u'"'),
- (String.Escape, escapedCharacter),
- (String, u'"'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
- fragment = '{{' + escapedCharacter + '}}'
- tokens = [
- (String, u'{{'),
- (String.Escape, escapedCharacter),
- (String, u'}}'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testOperators(self):
- fragments = ['+', '-', '~', u'¬', '!', '*', '/', '^', '%', '<<', '>>', '<', '>',
- '<=', '>=', '==', '!=', '&', '#', '|', '&&', '||', '?', ':', '+=',
- '-=', '*=', '/=']
- for fragment in fragments:
- tokens = [
- (Operator, fragment),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testGlobalValueIdentifiers(self):
- for fragment in ['0dbfs', 'A4', 'kr', 'ksmps', 'nchnls', 'nchnls_i', 'sr']:
- tokens = [
- (Name.Variable.Global, fragment),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testKeywords(self):
- fragments = ['do', 'else', 'elseif', 'endif', 'enduntil', 'fi', 'if', 'ithen',
- 'kthen', 'od', 'then', 'until', 'while']
- for fragment in fragments:
- tokens = [
- (Keyword, fragment),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
- for fragment in ['return', 'rireturn']:
- tokens = [
- (Keyword.Pseudo, fragment),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testLabels(self):
- fragment = dedent('''\
- aLabel:
- label2:
- ''')
- tokens = [
- (Name.Label, u'aLabel'),
- (Punctuation, u':'),
- (Text, u'\n'),
- (Text, u' '),
- (Name.Label, u'label2'),
- (Punctuation, u':'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testPrintksAndPrintsEscapeSequences(self):
- escapedCharacters = ['%!', '%%', '%n', '%N', '%r', '%R', '%t', '%T', '\\\\a',
- '\\\\A', '\\\\b', '\\\\B', '\\\\n', '\\\\N', '\\\\r',
- '\\\\R', '\\\\t', '\\\\T']
- for opcode in ['printks', 'prints']:
- for escapedCharacter in escapedCharacters:
- fragment = opcode + ' "' + escapedCharacter + '"'
- tokens = [
- (Name.Builtin, opcode),
- (Text, u' '),
- (String, u'"'),
- (String.Escape, escapedCharacter),
- (String, u'"'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testGotoStatements(self):
- for keyword in ['goto', 'igoto', 'kgoto']:
- fragment = keyword + ' aLabel'
- tokens = [
- (Keyword, keyword),
- (Text, u' '),
- (Name.Label, u'aLabel'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
- for opcode in ['reinit', 'rigoto', 'tigoto']:
- fragment = opcode + ' aLabel'
- tokens = [
- (Keyword.Pseudo, opcode),
- (Text, u' '),
- (Name.Label, u'aLabel'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
- for opcode in ['cggoto', 'cigoto', 'cingoto', 'ckgoto', 'cngoto', 'cnkgoto']:
- fragment = opcode + ' 1==0, aLabel'
- tokens = [
- (Keyword.Pseudo, opcode),
- (Text, u' '),
- (Number.Integer, u'1'),
- (Operator, u'=='),
- (Number.Integer, u'0'),
- (Punctuation, u','),
- (Text, u' '),
- (Name.Label, u'aLabel'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
- fragment = 'timout 0, 0, aLabel'
- tokens = [
- (Keyword.Pseudo, 'timout'),
- (Text, u' '),
- (Number.Integer, u'0'),
- (Punctuation, u','),
- (Text, u' '),
- (Number.Integer, u'0'),
- (Punctuation, u','),
- (Text, u' '),
- (Name.Label, u'aLabel'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
- for opcode in ['loop_ge', 'loop_gt', 'loop_le', 'loop_lt']:
- fragment = opcode + ' 0, 0, 0, aLabel'
- tokens = [
- (Keyword.Pseudo, opcode),
- (Text, u' '),
- (Number.Integer, u'0'),
- (Punctuation, u','),
- (Text, u' '),
- (Number.Integer, u'0'),
- (Punctuation, u','),
- (Text, u' '),
- (Number.Integer, u'0'),
- (Punctuation, u','),
- (Text, u' '),
- (Name.Label, u'aLabel'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testIncludeDirectives(self):
- for character in ['"', '|']:
- fragment = '#include/**/' + character + 'file.udo' + character
- tokens = [
- (Comment.Preproc, u'#include'),
- (Comment.Multiline, u'/**/'),
- (String, character + u'file.udo' + character),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testObjectLikeMacroDefinitions(self):
- fragment = dedent('''\
- # \tdefine MACRO#macro_body#
- #define/**/
- MACRO/**/
- #\\#macro
- body\\##
- ''')
- tokens = [
- (Comment.Preproc, u'# \tdefine'),
- (Text, u' '),
- (Comment.Preproc, u'MACRO'),
- (Punctuation, u'#'),
- (Comment.Preproc, u'macro_body'),
- (Punctuation, u'#'),
- (Text, u'\n'),
- (Comment.Preproc, u'#define'),
- (Comment.Multiline, u'/**/'),
- (Text, u'\n'),
- (Comment.Preproc, u'MACRO'),
- (Comment.Multiline, u'/**/'),
- (Text, u'\n'),
- (Punctuation, u'#'),
- (Comment.Preproc, u'\\#'),
- (Comment.Preproc, u'macro\nbody'),
- (Comment.Preproc, u'\\#'),
- (Punctuation, u'#'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testFunctionLikeMacroDefinitions(self):
- fragment = dedent('''\
- #define MACRO(ARG1#ARG2) #macro_body#
- #define/**/
- MACRO(ARG1'ARG2' ARG3)/**/
- #\\#macro
- body\\##
- ''')
- tokens = [
- (Comment.Preproc, u'#define'),
- (Text, u' '),
- (Comment.Preproc, u'MACRO'),
- (Punctuation, u'('),
- (Comment.Preproc, u'ARG1'),
- (Punctuation, u'#'),
- (Comment.Preproc, u'ARG2'),
- (Punctuation, u')'),
- (Text, u' '),
- (Punctuation, u'#'),
- (Comment.Preproc, u'macro_body'),
- (Punctuation, u'#'),
- (Text, u'\n'),
- (Comment.Preproc, u'#define'),
- (Comment.Multiline, u'/**/'),
- (Text, u'\n'),
- (Comment.Preproc, u'MACRO'),
- (Punctuation, u'('),
- (Comment.Preproc, u'ARG1'),
- (Punctuation, u"'"),
- (Comment.Preproc, u'ARG2'),
- (Punctuation, u"'"),
- (Text, u' '),
- (Comment.Preproc, u'ARG3'),
- (Punctuation, u')'),
- (Comment.Multiline, u'/**/'),
- (Text, u'\n'),
- (Punctuation, u'#'),
- (Comment.Preproc, u'\\#'),
- (Comment.Preproc, u'macro\nbody'),
- (Comment.Preproc, u'\\#'),
- (Punctuation, u'#'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testMacroPreprocessorDirectives(self):
- for directive in ['#ifdef', '#ifndef', '#undef']:
- fragment = directive + ' MACRO'
- tokens = [
- (Comment.Preproc, directive),
- (Text, u' '),
- (Comment.Preproc, u'MACRO'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testOtherPreprocessorDirectives(self):
- fragment = dedent('''\
- #else
- #end
- #endif
- ###
- @ \t12345
- @@ \t67890
- ''')
- tokens = [
- (Comment.Preproc, u'#else'),
- (Text, u'\n'),
- (Comment.Preproc, u'#end'),
- (Text, u'\n'),
- (Comment.Preproc, u'#endif'),
- (Text, u'\n'),
- (Comment.Preproc, u'###'),
- (Text, u'\n'),
- (Comment.Preproc, u'@ \t12345'),
- (Text, u'\n'),
- (Comment.Preproc, u'@@ \t67890'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testFunctionLikeMacros(self):
- fragment = "$MACRO.(((x#y\\)))' \"(#'x)\\)x\\))\"# {{x\\))x)\\)(#'}});"
- tokens = [
- (Comment.Preproc, u'$MACRO.'),
- (Punctuation, u'('),
- (Comment.Preproc, u'('),
- (Comment.Preproc, u'('),
- (Comment.Preproc, u'x#y\\)'),
- (Comment.Preproc, u')'),
- (Comment.Preproc, u')'),
- (Punctuation, u"'"),
- (Comment.Preproc, u' '),
- (String, u'"'),
- (Error, u'('),
- (Error, u'#'),
- (Error, u"'"),
- (String, u'x'),
- (Error, u')'),
- (Comment.Preproc, u'\\)'),
- (String, u'x'),
- (Comment.Preproc, u'\\)'),
- (Error, u')'),
- (String, u'"'),
- (Punctuation, u'#'),
- (Comment.Preproc, u' '),
- (String, u'{{'),
- (String, u'x'),
- (Comment.Preproc, u'\\)'),
- (Error, u')'),
- (String, u'x'),
- (Error, u')'),
- (Comment.Preproc, u'\\)'),
- (Error, u'('),
- (Error, u'#'),
- (Error, u"'"),
- (String, u'}}'),
- (Punctuation, u')'),
- (Comment.Single, u';'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testName(self):
- fragment = 'kG:V'
- tokens = [
- (Keyword.Type, 'k'),
- (Name, 'G'),
- (Punctuation, ':'),
- (Name, 'V'),
- (Text, '\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_data.py b/tests/test_data.py
deleted file mode 100644
index 20e74be0..00000000
--- a/tests/test_data.py
+++ /dev/null
@@ -1,117 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Data Tests
- ~~~~~~~~~~
-
- :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexers import JsonLexer, JsonBareObjectLexer, YamlLexer
-from pygments.token import Token
-
-
-class JsonTest(unittest.TestCase):
- def setUp(self):
- self.lexer = JsonLexer()
-
- def testBasic(self):
- fragment = u'{"foo": "bar", "foo2": [1, 2, 3]}\n'
- tokens = [
- (Token.Punctuation, u'{'),
- (Token.Name.Tag, u'"foo"'),
- (Token.Punctuation, u':'),
- (Token.Text, u' '),
- (Token.Literal.String.Double, u'"bar"'),
- (Token.Punctuation, u','),
- (Token.Text, u' '),
- (Token.Name.Tag, u'"foo2"'),
- (Token.Punctuation, u':'),
- (Token.Text, u' '),
- (Token.Punctuation, u'['),
- (Token.Literal.Number.Integer, u'1'),
- (Token.Punctuation, u','),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'2'),
- (Token.Punctuation, u','),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'3'),
- (Token.Punctuation, u']'),
- (Token.Punctuation, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
-class JsonBareObjectTest(unittest.TestCase):
- def setUp(self):
- self.lexer = JsonBareObjectLexer()
-
- def testBasic(self):
- # This is the same as testBasic for JsonLexer above, except the
- # enclosing curly braces are removed.
- fragment = u'"foo": "bar", "foo2": [1, 2, 3]\n'
- tokens = [
- (Token.Name.Tag, u'"foo"'),
- (Token.Punctuation, u':'),
- (Token.Text, u' '),
- (Token.Literal.String.Double, u'"bar"'),
- (Token.Punctuation, u','),
- (Token.Text, u' '),
- (Token.Name.Tag, u'"foo2"'),
- (Token.Punctuation, u':'),
- (Token.Text, u' '),
- (Token.Punctuation, u'['),
- (Token.Literal.Number.Integer, u'1'),
- (Token.Punctuation, u','),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'2'),
- (Token.Punctuation, u','),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'3'),
- (Token.Punctuation, u']'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testClosingCurly(self):
- # This can be an Error token, but should not be a can't-pop-from-stack
- # exception.
- fragment = '}"a"\n'
- tokens = [
- (Token.Error, '}'),
- (Token.Name.Tag, '"a"'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testClosingCurlyInValue(self):
- fragment = '"": ""}\n'
- tokens = [
- (Token.Name.Tag, '""'),
- (Token.Punctuation, ':'),
- (Token.Text, ' '),
- (Token.Literal.String.Double, '""'),
- (Token.Error, '}'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
-class YamlTest(unittest.TestCase):
- def setUp(self):
- self.lexer = YamlLexer()
-
- def testColonInComment(self):
- # Bug #1528: This previously parsed 'token # innocent' as a tag
- fragment = u'here: token # innocent: comment\n'
- tokens = [
- (Token.Name.Tag, u'here'),
- (Token.Punctuation, u':'),
- (Token.Text, u' '),
- (Token.Literal.Scalar.Plain, u'token'),
- (Token.Text, u' '),
- (Token.Comment.Single, u'# innocent: comment'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_examplefiles.py b/tests/test_examplefiles.py
deleted file mode 100644
index e208403b..00000000
--- a/tests/test_examplefiles.py
+++ /dev/null
@@ -1,138 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments tests with example files
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import os
-import pprint
-import difflib
-import pickle
-
-from pygments.lexers import get_lexer_for_filename, get_lexer_by_name
-from pygments.token import Error
-from pygments.util import ClassNotFound
-
-import support
-
-STORE_OUTPUT = False
-
-STATS = {}
-
-TESTDIR = os.path.dirname(__file__)
-
-# Jython generates a StackOverflowError for repetitions of the form (a|b)+,
-# which are commonly used in string patterns, when matching more than about 1000
-# chars. These tests do not complete. See http://bugs.jython.org/issue1965
-BAD_FILES_FOR_JYTHON = ('Object.st', 'all.nit', 'genclass.clj',
- 'ragel-cpp_rlscan')
-
-def test_example_files():
- global STATS
- STATS = {}
- outdir = os.path.join(TESTDIR, 'examplefiles', 'output')
- if STORE_OUTPUT and not os.path.isdir(outdir):
- os.makedirs(outdir)
- for fn in os.listdir(os.path.join(TESTDIR, 'examplefiles')):
- if fn.startswith('.') or fn.endswith('#'):
- continue
-
- absfn = os.path.join(TESTDIR, 'examplefiles', fn)
- if not os.path.isfile(absfn):
- continue
-
- extension = os.getenv('TEST_EXT')
- if extension and not absfn.endswith(extension):
- continue
-
- print(absfn)
- with open(absfn, 'rb') as f:
- code = f.read()
- try:
- code = code.decode('utf-8')
- except UnicodeError:
- code = code.decode('latin1')
-
- lx = None
- if '_' in fn:
- try:
- lx = get_lexer_by_name(fn.split('_')[0])
- except ClassNotFound:
- pass
- if lx is None:
- try:
- lx = get_lexer_for_filename(absfn, code=code)
- except ClassNotFound:
- raise AssertionError('file %r has no registered extension, '
- 'nor is of the form <lexer>_filename '
- 'for overriding, thus no lexer found.'
- % fn)
- yield check_lexer, lx, fn
-
- N = 7
- stats = list(STATS.items())
- stats.sort(key=lambda x: x[1][1])
- print('\nExample files that took longest absolute time:')
- for fn, t in stats[-N:]:
- print('%-30s %6d chars %8.2f ms %7.3f ms/char' % ((fn,) + t))
- print()
- stats.sort(key=lambda x: x[1][2])
- print('\nExample files that took longest relative time:')
- for fn, t in stats[-N:]:
- print('%-30s %6d chars %8.2f ms %7.3f ms/char' % ((fn,) + t))
-
-
-def check_lexer(lx, fn):
- if os.name == 'java' and fn in BAD_FILES_FOR_JYTHON:
- raise support.SkipTest('%s is a known bad file on Jython' % fn)
- absfn = os.path.join(TESTDIR, 'examplefiles', fn)
- with open(absfn, 'rb') as fp:
- text = fp.read()
- text = text.replace(b'\r\n', b'\n')
- text = text.strip(b'\n') + b'\n'
- try:
- text = text.decode('utf-8')
- if text.startswith(u'\ufeff'):
- text = text[len(u'\ufeff'):]
- except UnicodeError:
- text = text.decode('latin1')
- ntext = []
- tokens = []
- import time
- t1 = time.time()
- for type, val in lx.get_tokens(text):
- ntext.append(val)
- 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))
- t2 = time.time()
- STATS[os.path.basename(absfn)] = (len(text),
- 1000 * (t2 - t1), 1000 * (t2 - t1) / len(text))
- 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
- if STORE_OUTPUT:
- # no previous output -- store it
- outfn = os.path.join(TESTDIR, 'examplefiles', 'output', fn)
- if not os.path.isfile(outfn):
- with open(outfn, 'wb') as fp:
- pickle.dump(tokens, fp)
- return
- # otherwise load it and compare
- with open(outfn, 'rb') as fp:
- stored_tokens = pickle.load(fp)
- if stored_tokens != tokens:
- f1 = pprint.pformat(stored_tokens)
- f2 = pprint.pformat(tokens)
- print('\n'.join(difflib.unified_diff(f1.splitlines(),
- f2.splitlines())))
- assert False, absfn
diff --git a/tests/test_ezhil.py b/tests/test_ezhil.py
deleted file mode 100644
index 15cc13b1..00000000
--- a/tests/test_ezhil.py
+++ /dev/null
@@ -1,183 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic EzhilLexer Test
- ~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2015 Muthiah Annamalai <ezhillang@gmail.com>
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.token import Operator, Number, Text, Token
-from pygments.lexers import EzhilLexer
-
-
-class EzhilTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = EzhilLexer()
- self.maxDiff = None
-
- def testSum(self):
- fragment = u'1+3\n'
- tokens = [
- (Number.Integer, u'1'),
- (Operator, u'+'),
- (Number.Integer, u'3'),
- (Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testGCDExpr(self):
- fragment = u'1^3+(5-5)*gcd(a,b)\n'
- tokens = [
- (Token.Number.Integer,u'1'),
- (Token.Operator,u'^'),
- (Token.Literal.Number.Integer, u'3'),
- (Token.Operator, u'+'),
- (Token.Punctuation, u'('),
- (Token.Literal.Number.Integer, u'5'),
- (Token.Operator, u'-'),
- (Token.Literal.Number.Integer, u'5'),
- (Token.Punctuation, u')'),
- (Token.Operator, u'*'),
- (Token.Name, u'gcd'),
- (Token.Punctuation, u'('),
- (Token.Name, u'a'),
- (Token.Operator, u','),
- (Token.Name, u'b'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testIfStatement(self):
- fragment = u"""@( 0 > 3 ) ஆனால்
- பதிப்பி "wont print"
-முடி"""
- tokens = [
- (Token.Operator, u'@'),
- (Token.Punctuation, u'('),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer,u'0'),
- (Token.Text, u' '),
- (Token.Operator,u'>'),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'3'),
- (Token.Text, u' '),
- (Token.Punctuation, u')'),
- (Token.Text, u' '),
- (Token.Keyword, u'ஆனால்'),
- (Token.Text, u'\n'),
- (Token.Text, u'\t'),
- (Token.Keyword, u'பதிப்பி'),
- (Token.Text, u' '),
- (Token.Literal.String, u'"wont print"'),
- (Token.Text, u'\t'),
- (Token.Text, u'\n'),
- (Token.Keyword, u'முடி'),
- (Token.Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testFunction(self):
- fragment = u"""# (C) முத்தையா அண்ணாமலை 2013, 2015
-நிரல்பாகம் gcd ( x, y )
- மு = max(x,y)
- q = min(x,y)
-
- @( q == 0 ) ஆனால்
- பின்கொடு மு
- முடி
- பின்கொடு gcd( மு - q , q )
-முடி\n"""
- tokens = [
- (Token.Comment.Single,
- u'# (C) \u0bae\u0bc1\u0ba4\u0bcd\u0ba4\u0bc8\u0baf\u0bbe \u0b85'
- u'\u0ba3\u0bcd\u0ba3\u0bbe\u0bae\u0bb2\u0bc8 2013, 2015\n'),
- (Token.Keyword,u'நிரல்பாகம்'),
- (Token.Text, u' '),
- (Token.Name, u'gcd'),
- (Token.Text, u' '),
- (Token.Punctuation, u'('),
- (Token.Text, u' '),
- (Token.Name, u'x'),
- (Token.Operator, u','),
- (Token.Text, u' '),
- (Token.Name, u'y'),
- (Token.Text, u' '),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Name, u'\u0bae\u0bc1'),
- (Token.Text, u' '),
- (Token.Operator, u'='),
- (Token.Text, u' '),
- (Token.Name.Builtin, u'max'),
- (Token.Punctuation, u'('),
- (Token.Name, u'x'),
- (Token.Operator, u','),
- (Token.Name, u'y'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Name, u'q'),
- (Token.Text, u' '),
- (Token.Operator, u'='),
- (Token.Text, u' '),
- (Token.Name.Builtin, u'min'),
- (Token.Punctuation, u'('),
- (Token.Name, u'x'),
- (Token.Operator, u','),
- (Token.Name, u'y'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Operator, u'@'),
- (Token.Punctuation, u'('),
- (Token.Text, u' '),
- (Token.Name, u'q'),
- (Token.Text, u' '),
- (Token.Operator, u'=='),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'0'),
- (Token.Text, u' '),
- (Token.Punctuation, u')'),
- (Token.Text, u' '),
- (Token.Keyword, u'ஆனால்'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'பின்கொடு'),
- (Token.Text, u' '),
- (Token.Name, u'\u0bae\u0bc1'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'முடி'),
- (Token.Text, u'\n'),
- (Token.Text, u' '),
- (Token.Keyword, u'\u0baa\u0bbf\u0ba9\u0bcd\u0b95\u0bca\u0b9f\u0bc1'),
- (Token.Text, u' '),
- (Token.Name, u'gcd'),
- (Token.Punctuation, u'('),
- (Token.Text, u' '),
- (Token.Name, u'\u0bae\u0bc1'),
- (Token.Text, u' '),
- (Token.Operator, u'-'),
- (Token.Text, u' '),
- (Token.Name, u'q'),
- (Token.Text, u' '),
- (Token.Operator, u','),
- (Token.Text, u' '),
- (Token.Name, u'q'),
- (Token.Text, u' '),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- (Token.Keyword, u'முடி'), #u'\u0bae\u0bc1\u0b9f\u0bbf'),
- (Token.Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/tests/test_html_formatter.py b/tests/test_html_formatter.py
deleted file mode 100644
index 37efd6f0..00000000
--- a/tests/test_html_formatter.py
+++ /dev/null
@@ -1,200 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments HTML formatter tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import io
-import os
-import re
-import unittest
-import tempfile
-from os.path import join, dirname, isfile
-
-from pygments.util import StringIO
-from pygments.lexers import PythonLexer
-from pygments.formatters import HtmlFormatter, NullFormatter
-from pygments.formatters.html import escape_html
-
-import support
-
-TESTFILE, TESTDIR = support.location(__file__)
-
-with io.open(TESTFILE, encoding='utf-8') as fp:
- tokensource = list(PythonLexer().get_tokens(fp.read()))
-
-
-class HtmlFormatterTest(unittest.TestCase):
- def test_correct_output(self):
- hfmt = HtmlFormatter(nowrap=True)
- houtfile = StringIO()
- hfmt.format(tokensource, houtfile)
-
- nfmt = NullFormatter()
- noutfile = StringIO()
- nfmt.format(tokensource, noutfile)
-
- stripped_html = re.sub('<.*?>', '', houtfile.getvalue())
- escaped_text = escape_html(noutfile.getvalue())
- self.assertEqual(stripped_html, escaped_text)
-
- def test_external_css(self):
- # test correct behavior
- # CSS should be in /tmp directory
- fmt1 = HtmlFormatter(full=True, cssfile='fmt1.css', outencoding='utf-8')
- # CSS should be in TESTDIR (TESTDIR is absolute)
- fmt2 = HtmlFormatter(full=True, cssfile=join(TESTDIR, 'fmt2.css'),
- outencoding='utf-8')
- tfile = tempfile.NamedTemporaryFile(suffix='.html')
- fmt1.format(tokensource, tfile)
- try:
- fmt2.format(tokensource, tfile)
- self.assertTrue(isfile(join(TESTDIR, 'fmt2.css')))
- except IOError:
- # test directory not writable
- pass
- tfile.close()
-
- self.assertTrue(isfile(join(dirname(tfile.name), 'fmt1.css')))
- os.unlink(join(dirname(tfile.name), 'fmt1.css'))
- try:
- os.unlink(join(TESTDIR, 'fmt2.css'))
- except OSError:
- pass
-
- def test_all_options(self):
- def check(optdict):
- outfile = StringIO()
- fmt = HtmlFormatter(**optdict)
- fmt.format(tokensource, outfile)
-
- for optdict in [
- dict(nowrap=True),
- dict(linenos=True, full=True),
- dict(linenos=True, linespans='L'),
- dict(hl_lines=[1, 5, 10, 'xxx']),
- dict(hl_lines=[1, 5, 10], noclasses=True),
- ]:
- check(optdict)
-
- for linenos in [False, 'table', 'inline']:
- for noclasses in [False, True]:
- for linenospecial in [0, 5]:
- for anchorlinenos in [False, True]:
- optdict = dict(
- linenos=linenos,
- noclasses=noclasses,
- linenospecial=linenospecial,
- anchorlinenos=anchorlinenos,
- )
- check(optdict)
-
- def test_linenos(self):
- optdict = dict(linenos=True)
- outfile = StringIO()
- fmt = HtmlFormatter(**optdict)
- fmt.format(tokensource, outfile)
- html = outfile.getvalue()
- self.assertTrue(re.search(r"<pre>\s+1\s+2\s+3", html))
-
- def test_linenos_with_startnum(self):
- optdict = dict(linenos=True, linenostart=5)
- outfile = StringIO()
- fmt = HtmlFormatter(**optdict)
- fmt.format(tokensource, outfile)
- html = outfile.getvalue()
- self.assertTrue(re.search(r"<pre>\s+5\s+6\s+7", html))
-
- def test_lineanchors(self):
- optdict = dict(lineanchors="foo")
- outfile = StringIO()
- fmt = HtmlFormatter(**optdict)
- fmt.format(tokensource, outfile)
- html = outfile.getvalue()
- self.assertTrue(re.search("<pre><span></span><a name=\"foo-1\">", html))
-
- def test_lineanchors_with_startnum(self):
- optdict = dict(lineanchors="foo", linenostart=5)
- outfile = StringIO()
- fmt = HtmlFormatter(**optdict)
- fmt.format(tokensource, outfile)
- html = outfile.getvalue()
- self.assertTrue(re.search("<pre><span></span><a name=\"foo-5\">", html))
-
- def test_valid_output(self):
- # test all available wrappers
- fmt = HtmlFormatter(full=True, linenos=True, noclasses=True,
- outencoding='utf-8')
-
- handle, pathname = tempfile.mkstemp('.html')
- with os.fdopen(handle, 'w+b') as tfile:
- fmt.format(tokensource, tfile)
- catname = os.path.join(TESTDIR, 'dtds', 'HTML4.soc')
- try:
- import subprocess
- po = subprocess.Popen(['nsgmls', '-s', '-c', catname, pathname],
- stdout=subprocess.PIPE)
- ret = po.wait()
- output = po.stdout.read()
- po.stdout.close()
- except OSError:
- # nsgmls not available
- pass
- else:
- if ret:
- print(output)
- self.assertFalse(ret, 'nsgmls run reported errors')
-
- os.unlink(pathname)
-
- def test_get_style_defs(self):
- fmt = HtmlFormatter()
- sd = fmt.get_style_defs()
- self.assertTrue(sd.startswith('.'))
-
- fmt = HtmlFormatter(cssclass='foo')
- sd = fmt.get_style_defs()
- self.assertTrue(sd.startswith('.foo'))
- sd = fmt.get_style_defs('.bar')
- self.assertTrue(sd.startswith('.bar'))
- sd = fmt.get_style_defs(['.bar', '.baz'])
- fl = sd.splitlines()[0]
- self.assertTrue('.bar' in fl and '.baz' in fl)
-
- def test_unicode_options(self):
- fmt = HtmlFormatter(title=u'Föö',
- cssclass=u'bär',
- cssstyles=u'div:before { content: \'bäz\' }',
- encoding='utf-8')
- handle, pathname = tempfile.mkstemp('.html')
- with os.fdopen(handle, 'w+b') as tfile:
- fmt.format(tokensource, tfile)
-
- def test_ctags(self):
- try:
- import ctags
- except ImportError:
- # we can't check without the ctags module, but at least check the exception
- self.assertRaises(RuntimeError, HtmlFormatter, tagsfile='support/tags')
- else:
- # this tagfile says that test_ctags() is on line 165, even if it isn't
- # anymore in the actual source
- fmt = HtmlFormatter(tagsfile='support/tags', lineanchors='L',
- tagurlformat='%(fname)s%(fext)s')
- outfile = StringIO()
- fmt.format(tokensource, outfile)
- self.assertTrue('<a href="test_html_formatter.py#L-165">test_ctags</a>'
- in outfile.getvalue())
-
- def test_filename(self):
- optdict = dict(filename="test.py")
- outfile = StringIO()
- fmt = HtmlFormatter(**optdict)
- fmt.format(tokensource, outfile)
- html = outfile.getvalue()
- self.assertTrue(re.search("<span class=\"filename\">test.py</span><pre>", html))
diff --git a/tests/test_inherit.py b/tests/test_inherit.py
deleted file mode 100644
index 38acf328..00000000
--- a/tests/test_inherit.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Tests for inheritance in RegexLexer
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexer import RegexLexer, inherit
-from pygments.token import Text
-
-
-class InheritTest(unittest.TestCase):
- def test_single_inheritance_position(self):
- t = Two()
- pats = [x[0].__self__.pattern for x in t._tokens['root']]
- self.assertEqual(['x', 'a', 'b', 'y'], pats)
- def test_multi_inheritance_beginning(self):
- t = Beginning()
- pats = [x[0].__self__.pattern for x in t._tokens['root']]
- self.assertEqual(['x', 'a', 'b', 'y', 'm'], pats)
- def test_multi_inheritance_end(self):
- t = End()
- pats = [x[0].__self__.pattern for x in t._tokens['root']]
- self.assertEqual(['m', 'x', 'a', 'b', 'y'], pats)
-
- def test_multi_inheritance_position(self):
- t = Three()
- pats = [x[0].__self__.pattern for x in t._tokens['root']]
- self.assertEqual(['i', 'x', 'a', 'b', 'y', 'j'], pats)
-
- def test_single_inheritance_with_skip(self):
- t = Skipped()
- pats = [x[0].__self__.pattern for x in t._tokens['root']]
- self.assertEqual(['x', 'a', 'b', 'y'], pats)
-
-
-class One(RegexLexer):
- tokens = {
- 'root': [
- ('a', Text),
- ('b', Text),
- ],
- }
-
-class Two(One):
- tokens = {
- 'root': [
- ('x', Text),
- inherit,
- ('y', Text),
- ],
- }
-
-class Three(Two):
- tokens = {
- 'root': [
- ('i', Text),
- inherit,
- ('j', Text),
- ],
- }
-
-class Beginning(Two):
- tokens = {
- 'root': [
- inherit,
- ('m', Text),
- ],
- }
-
-class End(Two):
- tokens = {
- 'root': [
- ('m', Text),
- inherit,
- ],
- }
-
-class Empty(One):
- tokens = {}
-
-class Skipped(Empty):
- tokens = {
- 'root': [
- ('x', Text),
- inherit,
- ('y', Text),
- ],
- }
-
diff --git a/tests/test_irc_formatter.py b/tests/test_irc_formatter.py
deleted file mode 100644
index 18bcd58b..00000000
--- a/tests/test_irc_formatter.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments IRC formatter tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import re
-import unittest
-
-from pygments.util import StringIO
-from pygments.lexers import PythonLexer
-from pygments.formatters import IRCFormatter
-
-import support
-
-tokensource = list(PythonLexer().get_tokens("lambda x: 123"))
-
-class IRCFormatterTest(unittest.TestCase):
- def test_correct_output(self):
- hfmt = IRCFormatter()
- houtfile = StringIO()
- hfmt.format(tokensource, houtfile)
-
- self.assertEqual(u'\x0302lambda\x03 x: \x0302123\x03\n', houtfile.getvalue())
-
diff --git a/tests/test_java.py b/tests/test_java.py
deleted file mode 100644
index 5f520853..00000000
--- a/tests/test_java.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic JavaLexer Test
- ~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.token import Text, Name, Operator, Keyword, Number
-from pygments.lexers import JavaLexer
-
-
-class JavaTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = JavaLexer()
- self.maxDiff = None
-
- def testEnhancedFor(self):
- fragment = u'label:\nfor(String var2: var1) {}\n'
- tokens = [
- (Name.Label, u'label:'),
- (Text, u'\n'),
- (Keyword, u'for'),
- (Operator, u'('),
- (Name, u'String'),
- (Text, u' '),
- (Name, u'var2'),
- (Operator, u':'),
- (Text, u' '),
- (Name, u'var1'),
- (Operator, u')'),
- (Text, u' '),
- (Operator, u'{'),
- (Operator, u'}'),
- (Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testNumericLiterals(self):
- fragment = '0 5L 9__542_72l 0xbEEf 0X9_A 0_35 01 0b0___101_0'
- fragment += ' 0. .7_17F 3e-1_3d 1f 6_01.9e+3 0x.1Fp3 0XEP8D\n'
- tokens = [
- (Number.Integer, '0'),
- (Text, ' '),
- (Number.Integer, '5L'),
- (Text, ' '),
- (Number.Integer, '9__542_72l'),
- (Text, ' '),
- (Number.Hex, '0xbEEf'),
- (Text, ' '),
- (Number.Hex, '0X9_A'),
- (Text, ' '),
- (Number.Oct, '0_35'),
- (Text, ' '),
- (Number.Oct, '01'),
- (Text, ' '),
- (Number.Bin, '0b0___101_0'),
- (Text, ' '),
- (Number.Float, '0.'),
- (Text, ' '),
- (Number.Float, '.7_17F'),
- (Text, ' '),
- (Number.Float, '3e-1_3d'),
- (Text, ' '),
- (Number.Float, '1f'),
- (Text, ' '),
- (Number.Float, '6_01.9e+3'),
- (Text, ' '),
- (Number.Float, '0x.1Fp3'),
- (Text, ' '),
- (Number.Float, '0XEP8D'),
- (Text, '\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_javascript.py b/tests/test_javascript.py
deleted file mode 100644
index a2dfb7e1..00000000
--- a/tests/test_javascript.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Javascript tests
- ~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexers import CoffeeScriptLexer
-from pygments.token import Token
-
-COFFEE_SLASH_GOLDEN = [
- # input_str, slashes_are_regex_here
- (r'/\\/', True),
- (r'/\\/i', True),
- (r'/\//', True),
- (r'/(\s)/', True),
- ('/a{2,8}/', True),
- ('/b*c?d+/', True),
- ('/(capture-match)/', True),
- ('/(?:do-not-capture-match)/', True),
- ('/this|or|that/', True),
- ('/[char-set]/', True),
- ('/[^neg-char_st]/', True),
- ('/^.*$/', True),
- (r'/\n(\f)\0\1\d\b\cm\u1234/', True),
- (r'/^.?([^/\\\n\w]*)a\1+$/.something(or_other) # something more complex', True),
- ("foo = (str) ->\n /'|\"/.test str", True),
- ('a = a / b / c', False),
- ('a = a/b/c', False),
- ('a = a/b/ c', False),
- ('a = a /b/c', False),
- ('a = 1 + /d/.test(a)', True),
-]
-
-def test_coffee_slashes():
- for input_str, slashes_are_regex_here in COFFEE_SLASH_GOLDEN:
- yield coffee_runner, input_str, slashes_are_regex_here
-
-def coffee_runner(input_str, slashes_are_regex_here):
- lex = CoffeeScriptLexer()
- output = list(lex.get_tokens(input_str))
- print(output)
- for t, s in output:
- if '/' in s:
- is_regex = t is Token.String.Regex
- assert is_regex == slashes_are_regex_here, (t, s)
-
-class CoffeeTest(unittest.TestCase):
- def setUp(self):
- self.lexer = CoffeeScriptLexer()
-
- def testMixedSlashes(self):
- fragment = u'a?/foo/:1/2;\n'
- tokens = [
- (Token.Name.Other, u'a'),
- (Token.Operator, u'?'),
- (Token.Literal.String.Regex, u'/foo/'),
- (Token.Operator, u':'),
- (Token.Literal.Number.Integer, u'1'),
- (Token.Operator, u'/'),
- (Token.Literal.Number.Integer, u'2'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testBewareInfiniteLoop(self):
- # This demonstrates the case that "This isn't really guarding" comment
- # refers to.
- fragment = '/a/x;\n'
- tokens = [
- (Token.Text, ''),
- (Token.Operator, '/'),
- (Token.Name.Other, 'a'),
- (Token.Operator, '/'),
- (Token.Name.Other, 'x'),
- (Token.Punctuation, ';'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_julia.py b/tests/test_julia.py
deleted file mode 100644
index eda04b1c..00000000
--- a/tests/test_julia.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Julia Tests
- ~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexers import JuliaLexer
-from pygments.token import Token
-
-
-class JuliaTests(unittest.TestCase):
- def setUp(self):
- self.lexer = JuliaLexer()
-
- def test_unicode(self):
- """
- Test that unicode character, √, in an expression is recognized
- """
- fragment = u's = \u221a((1/n) * sum(count .^ 2) - mu .^2)\n'
- tokens = [
- (Token.Name, u's'),
- (Token.Text, u' '),
- (Token.Operator, u'='),
- (Token.Text, u' '),
- (Token.Operator, u'\u221a'),
- (Token.Punctuation, u'('),
- (Token.Punctuation, u'('),
- (Token.Literal.Number.Integer, u'1'),
- (Token.Operator, u'/'),
- (Token.Name, u'n'),
- (Token.Punctuation, u')'),
- (Token.Text, u' '),
- (Token.Operator, u'*'),
- (Token.Text, u' '),
- (Token.Name, u'sum'),
- (Token.Punctuation, u'('),
- (Token.Name, u'count'),
- (Token.Text, u' '),
- (Token.Operator, u'.^'),
- (Token.Text, u' '),
- (Token.Literal.Number.Integer, u'2'),
- (Token.Punctuation, u')'),
- (Token.Text, u' '),
- (Token.Operator, u'-'),
- (Token.Text, u' '),
- (Token.Name, u'mu'),
- (Token.Text, u' '),
- (Token.Operator, u'.^'),
- (Token.Literal.Number.Integer, u'2'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_kotlin.py b/tests/test_kotlin.py
deleted file mode 100644
index 417d0d9f..00000000
--- a/tests/test_kotlin.py
+++ /dev/null
@@ -1,131 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic JavaLexer Test
- ~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.token import Text, Name, Operator, Keyword, Number, Punctuation, String
-from pygments.lexers import KotlinLexer
-
-class KotlinTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = KotlinLexer()
- self.maxDiff = None
-
- def testCanCopeWithBackTickNamesInFunctions(self):
- fragment = u'fun `wo bble`'
- tokens = [
- (Keyword, u'fun'),
- (Text, u' '),
- (Name.Function, u'`wo bble`'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testCanCopeWithCommasAndDashesInBackTickNames(self):
- fragment = u'fun `wo,-bble`'
- tokens = [
- (Keyword, u'fun'),
- (Text, u' '),
- (Name.Function, u'`wo,-bble`'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testCanCopeWithDestructuring(self):
- fragment = u'val (a, b) = '
- tokens = [
- (Keyword, u'val'),
- (Text, u' '),
- (Punctuation, u'('),
- (Name.Property, u'a'),
- (Punctuation, u','),
- (Text, u' '),
- (Name.Property, u'b'),
- (Punctuation, u')'),
- (Text, u' '),
- (Punctuation, u'='),
- (Text, u' '),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testCanCopeGenericsInDestructuring(self):
- fragment = u'val (a: List<Something>, b: Set<Wobble>) ='
- tokens = [
- (Keyword, u'val'),
- (Text, u' '),
- (Punctuation, u'('),
- (Name.Property, u'a'),
- (Punctuation, u':'),
- (Text, u' '),
- (Name.Property, u'List'),
- (Punctuation, u'<'),
- (Name, u'Something'),
- (Punctuation, u'>'),
- (Punctuation, u','),
- (Text, u' '),
- (Name.Property, u'b'),
- (Punctuation, u':'),
- (Text, u' '),
- (Name.Property, u'Set'),
- (Punctuation, u'<'),
- (Name, u'Wobble'),
- (Punctuation, u'>'),
- (Punctuation, u')'),
- (Text, u' '),
- (Punctuation, u'='),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testCanCopeWithGenerics(self):
- fragment = u'inline fun <reified T : ContractState> VaultService.queryBy(): Vault.Page<T> {'
- tokens = [
- (Keyword, u'inline fun'),
- (Text, u' '),
- (Punctuation, u'<'),
- (Keyword, u'reified'),
- (Text, u' '),
- (Name, u'T'),
- (Text, u' '),
- (Punctuation, u':'),
- (Text, u' '),
- (Name, u'ContractState'),
- (Punctuation, u'>'),
- (Text, u' '),
- (Name.Class, u'VaultService'),
- (Punctuation, u'.'),
- (Name.Function, u'queryBy'),
- (Punctuation, u'('),
- (Punctuation, u')'),
- (Punctuation, u':'),
- (Text, u' '),
- (Name, u'Vault'),
- (Punctuation, u'.'),
- (Name, u'Page'),
- (Punctuation, u'<'),
- (Name, u'T'),
- (Punctuation, u'>'),
- (Text, u' '),
- (Punctuation, u'{'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testShouldCopeWithMultilineComments(self):
- fragment = u'"""\nthis\nis\na\ncomment"""'
- tokens = [
- (String, u'"""\nthis\nis\na\ncomment"""'),
- (Text, u'\n')
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/tests/test_latex_formatter.py b/tests/test_latex_formatter.py
deleted file mode 100644
index aa4ac3bb..00000000
--- a/tests/test_latex_formatter.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments LaTeX formatter tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import os
-import unittest
-import tempfile
-
-from pygments.formatters import LatexFormatter
-from pygments.lexers import PythonLexer
-
-import support
-
-TESTFILE, TESTDIR = support.location(__file__)
-
-
-class LatexFormatterTest(unittest.TestCase):
-
- def test_valid_output(self):
- with open(TESTFILE) as fp:
- tokensource = list(PythonLexer().get_tokens(fp.read()))
- fmt = LatexFormatter(full=True, encoding='latin1')
-
- handle, pathname = tempfile.mkstemp('.tex')
- # place all output files in /tmp too
- old_wd = os.getcwd()
- os.chdir(os.path.dirname(pathname))
- tfile = os.fdopen(handle, 'wb')
- fmt.format(tokensource, tfile)
- tfile.close()
- try:
- import subprocess
- po = subprocess.Popen(['latex', '-interaction=nonstopmode',
- pathname], stdout=subprocess.PIPE)
- ret = po.wait()
- output = po.stdout.read()
- po.stdout.close()
- except OSError as e:
- # latex not available
- raise support.SkipTest(e)
- else:
- if ret:
- print(output)
- self.assertFalse(ret, 'latex run reported errors')
-
- os.unlink(pathname)
- os.chdir(old_wd)
diff --git a/tests/test_lexers_other.py b/tests/test_lexers_other.py
deleted file mode 100644
index 8d53c542..00000000
--- a/tests/test_lexers_other.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Tests for other lexers
- ~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-import glob
-import os
-import unittest
-
-from pygments.lexers import guess_lexer
-from pygments.lexers.scripting import EasytrieveLexer, JclLexer, RexxLexer
-
-
-def _exampleFilePath(filename):
- return os.path.join(os.path.dirname(__file__), 'examplefiles', filename)
-
-
-class AnalyseTextTest(unittest.TestCase):
- def _testCanRecognizeAndGuessExampleFiles(self, lexer):
- assert lexer is not None
-
- for pattern in lexer.filenames:
- exampleFilesPattern = _exampleFilePath(pattern)
- for exampleFilePath in glob.glob(exampleFilesPattern):
- with open(exampleFilePath, 'rb') as fp:
- text = fp.read().decode('utf-8')
- probability = lexer.analyse_text(text)
- self.assertTrue(probability > 0,
- '%s must recognize %r' % (
- lexer.name, exampleFilePath))
- guessedLexer = guess_lexer(text)
- self.assertEqual(guessedLexer.name, lexer.name)
-
- def testCanRecognizeAndGuessExampleFiles(self):
- LEXERS_TO_TEST = [
- EasytrieveLexer,
- JclLexer,
- RexxLexer,
- ]
- for lexerToTest in LEXERS_TO_TEST:
- self._testCanRecognizeAndGuessExampleFiles(lexerToTest)
-
-
-class EasyTrieveLexerTest(unittest.TestCase):
- def testCanGuessFromText(self):
- self.assertTrue(EasytrieveLexer.analyse_text('MACRO'))
- self.assertTrue(EasytrieveLexer.analyse_text('\nMACRO'))
- self.assertTrue(EasytrieveLexer.analyse_text(' \nMACRO'))
- self.assertTrue(EasytrieveLexer.analyse_text(' \n MACRO'))
- self.assertTrue(EasytrieveLexer.analyse_text('*\nMACRO'))
- self.assertTrue(EasytrieveLexer.analyse_text(
- '*\n *\n\n \n*\n MACRO'))
-
-
-class RexxLexerTest(unittest.TestCase):
- def testCanGuessFromText(self):
- self.assertAlmostEqual(0.01, RexxLexer.analyse_text('/* */'))
- self.assertAlmostEqual(1.0,
- RexxLexer.analyse_text('''/* Rexx */
- say "hello world"'''))
- val = RexxLexer.analyse_text('/* */\n'
- 'hello:pRoceduRe\n'
- ' say "hello world"')
- self.assertTrue(val > 0.5, val)
- val = RexxLexer.analyse_text('''/* */
- if 1 > 0 then do
- say "ok"
- end
- else do
- say "huh?"
- end''')
- self.assertTrue(val > 0.2, val)
- val = RexxLexer.analyse_text('''/* */
- greeting = "hello world!"
- parse value greeting "hello" name "!"
- say name''')
- self.assertTrue(val > 0.2, val)
diff --git a/tests/test_markdown_lexer.py b/tests/test_markdown_lexer.py
deleted file mode 100644
index c143586a..00000000
--- a/tests/test_markdown_lexer.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments regex lexer tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-import unittest
-
-from pygments.lexers.markup import MarkdownLexer
-
-
-class SameTextTests(unittest.TestCase):
-
- lexer = MarkdownLexer()
-
- def assert_same_text(self, text):
- """Show that lexed markdown does not remove any content. """
- tokens = list(self.lexer.get_tokens_unprocessed(text))
- output = ''.join(t[2] for t in tokens)
- self.assertEqual(text, output)
-
- def test_code_fence(self):
- self.assert_same_text(r'```\nfoo\n```\n')
-
- def test_code_fence_gsm(self):
- self.assert_same_text(r'```markdown\nfoo\n```\n')
-
- def test_code_fence_gsm_with_no_lexer(self):
- self.assert_same_text(r'```invalid-lexer\nfoo\n```\n')
diff --git a/tests/test_modeline.py b/tests/test_modeline.py
deleted file mode 100644
index 6e1f16a4..00000000
--- a/tests/test_modeline.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Tests for the vim modeline feature
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-from pygments import modeline
-
-
-def test_lexer_classes():
- def verify(buf):
- assert modeline.get_filetype_from_buffer(buf) == 'python'
-
- for buf in [
- 'vi: ft=python' + '\n' * 8,
- 'vi: ft=python' + '\n' * 8,
- '\n\n\n\nvi=8: syntax=python' + '\n' * 8,
- '\n' * 8 + 'ex: filetype=python',
- '\n' * 8 + 'vim: some,other,syn=python\n\n\n\n'
- ]:
- yield verify, buf
diff --git a/tests/test_objectiveclexer.py b/tests/test_objectiveclexer.py
deleted file mode 100644
index 3db6a9e0..00000000
--- a/tests/test_objectiveclexer.py
+++ /dev/null
@@ -1,92 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic CLexer Test
- ~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-import os
-
-from pygments.token import Token
-from pygments.lexers import ObjectiveCLexer
-
-
-class ObjectiveCLexerTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = ObjectiveCLexer()
-
- def testLiteralNumberInt(self):
- fragment = u'@(1);\n'
- expected = [
- (Token.Literal, u'@('),
- (Token.Literal.Number.Integer, u'1'),
- (Token.Literal, u')'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
-
- def testLiteralNumberExpression(self):
- fragment = u'@(1+2);\n'
- expected = [
- (Token.Literal, u'@('),
- (Token.Literal.Number.Integer, u'1'),
- (Token.Operator, u'+'),
- (Token.Literal.Number.Integer, u'2'),
- (Token.Literal, u')'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
-
- def testLiteralNumberNestedExpression(self):
- fragment = u'@(1+(2+3));\n'
- expected = [
- (Token.Literal, u'@('),
- (Token.Literal.Number.Integer, u'1'),
- (Token.Operator, u'+'),
- (Token.Punctuation, u'('),
- (Token.Literal.Number.Integer, u'2'),
- (Token.Operator, u'+'),
- (Token.Literal.Number.Integer, u'3'),
- (Token.Punctuation, u')'),
- (Token.Literal, u')'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
-
- def testLiteralNumberBool(self):
- fragment = u'@NO;\n'
- expected = [
- (Token.Literal.Number, u'@NO'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
-
- def testLiteralNumberBoolExpression(self):
- fragment = u'@(YES);\n'
- expected = [
- (Token.Literal, u'@('),
- (Token.Name.Builtin, u'YES'),
- (Token.Literal, u')'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
-
- def testModuleImport(self):
- fragment = u'@import ModuleA;\n'
- expected = [
- (Token.Keyword, u'@import'),
- (Token.Text, u' '),
- (Token.Name, u'ModuleA'),
- (Token.Punctuation, u';'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_perllexer.py b/tests/test_perllexer.py
deleted file mode 100644
index 30f9eca8..00000000
--- a/tests/test_perllexer.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments regex lexer tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import time
-import unittest
-
-from pygments.token import Keyword, Name, String, Text
-from pygments.lexers.perl 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)
-
- ### Namespaces/modules
-
- def test_package_statement(self):
- self.assert_tokens(['package', ' ', 'Foo'], [Keyword, Text, Name.Namespace])
- self.assert_tokens(['package', ' ', 'Foo::Bar'], [Keyword, Text, Name.Namespace])
-
- def test_use_statement(self):
- self.assert_tokens(['use', ' ', 'Foo'], [Keyword, Text, Name.Namespace])
- self.assert_tokens(['use', ' ', 'Foo::Bar'], [Keyword, Text, Name.Namespace])
-
- def test_no_statement(self):
- self.assert_tokens(['no', ' ', 'Foo'], [Keyword, Text, Name.Namespace])
- self.assert_tokens(['no', ' ', 'Foo::Bar'], [Keyword, Text, Name.Namespace])
-
- def test_require_statement(self):
- self.assert_tokens(['require', ' ', 'Foo'], [Keyword, Text, Name.Namespace])
- self.assert_tokens(['require', ' ', 'Foo::Bar'], [Keyword, Text, Name.Namespace])
- self.assert_tokens(['require', ' ', '"Foo/Bar.pm"'], [Keyword, Text, String])
-
diff --git a/tests/test_php.py b/tests/test_php.py
deleted file mode 100644
index bb047b91..00000000
--- a/tests/test_php.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- PHP Tests
- ~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexers import PhpLexer
-from pygments.token import Token
-
-
-class PhpTest(unittest.TestCase):
- def setUp(self):
- self.lexer = PhpLexer()
-
- def testStringEscapingRun(self):
- fragment = '<?php $x="{\\""; ?>\n'
- tokens = [
- (Token.Comment.Preproc, '<?php'),
- (Token.Text, ' '),
- (Token.Name.Variable, '$x'),
- (Token.Operator, '='),
- (Token.Literal.String.Double, '"'),
- (Token.Literal.String.Double, '{'),
- (Token.Literal.String.Escape, '\\"'),
- (Token.Literal.String.Double, '"'),
- (Token.Punctuation, ';'),
- (Token.Text, ' '),
- (Token.Comment.Preproc, '?>'),
- (Token.Other, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_praat.py b/tests/test_praat.py
deleted file mode 100644
index 9bf3ce76..00000000
--- a/tests/test_praat.py
+++ /dev/null
@@ -1,130 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Praat lexer tests
- ~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.token import Token
-from pygments.lexers import PraatLexer
-
-class PraatTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = PraatLexer()
- self.maxDiff = None
-
- def testNumericAssignment(self):
- fragment = u'var = -15e4\n'
- tokens = [
- (Token.Text, u'var'),
- (Token.Text, u' '),
- (Token.Operator, u'='),
- (Token.Text, u' '),
- (Token.Operator, u'-'),
- (Token.Literal.Number, u'15e4'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testStringAssignment(self):
- fragment = u'var$ = "foo"\n'
- tokens = [
- (Token.Text, u'var$'),
- (Token.Text, u' '),
- (Token.Operator, u'='),
- (Token.Text, u' '),
- (Token.Literal.String, u'"'),
- (Token.Literal.String, u'foo'),
- (Token.Literal.String, u'"'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testStringEscapedQuotes(self):
- fragment = u'"it said ""foo"""\n'
- tokens = [
- (Token.Literal.String, u'"'),
- (Token.Literal.String, u'it said '),
- (Token.Literal.String, u'"'),
- (Token.Literal.String, u'"'),
- (Token.Literal.String, u'foo'),
- (Token.Literal.String, u'"'),
- (Token.Literal.String, u'"'),
- (Token.Literal.String, u'"'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testFunctionCall(self):
- fragment = u'selected("Sound", i+(a*b))\n'
- tokens = [
- (Token.Name.Function, u'selected'),
- (Token.Punctuation, u'('),
- (Token.Literal.String, u'"'),
- (Token.Literal.String, u'Sound'),
- (Token.Literal.String, u'"'),
- (Token.Punctuation, u','),
- (Token.Text, u' '),
- (Token.Text, u'i'),
- (Token.Operator, u'+'),
- (Token.Text, u'('),
- (Token.Text, u'a'),
- (Token.Operator, u'*'),
- (Token.Text, u'b'),
- (Token.Text, u')'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testBrokenUnquotedString(self):
- fragment = u'printline string\n... \'interpolated\' string\n'
- tokens = [
- (Token.Keyword, u'printline'),
- (Token.Text, u' '),
- (Token.Literal.String, u'string'),
- (Token.Text, u'\n'),
- (Token.Punctuation, u'...'),
- (Token.Text, u' '),
- (Token.Literal.String.Interpol, u"'"),
- (Token.Literal.String.Interpol, u'interpolated'),
- (Token.Literal.String.Interpol, u"'"),
- (Token.Text, u' '),
- (Token.Literal.String, u'string'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testInlinIf(self):
- fragment = u'var = if true == 1 then -1 else 0 fi'
- tokens = [
- (Token.Text, u'var'),
- (Token.Text, u' '),
- (Token.Operator, u'='),
- (Token.Text, u' '),
- (Token.Keyword, u'if'),
- (Token.Text, u' '),
- (Token.Text, u'true'),
- (Token.Text, u' '),
- (Token.Operator, u'=='),
- (Token.Text, u' '),
- (Token.Literal.Number, u'1'),
- (Token.Text, u' '),
- (Token.Keyword, u'then'),
- (Token.Text, u' '),
- (Token.Operator, u'-'),
- (Token.Literal.Number, u'1'),
- (Token.Text, u' '),
- (Token.Keyword, u'else'),
- (Token.Text, u' '),
- (Token.Literal.Number, u'0'),
- (Token.Text, u' '),
- (Token.Keyword, u'fi'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_properties.py b/tests/test_properties.py
deleted file mode 100644
index aaa8ce29..00000000
--- a/tests/test_properties.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Properties Tests
- ~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexers.configs import PropertiesLexer
-from pygments.token import Token
-
-
-class PropertiesTest(unittest.TestCase):
- def setUp(self):
- self.lexer = PropertiesLexer()
-
- def test_comments(self):
- """
- Assures lines lead by either # or ! are recognized as a comment
- """
- fragment = '! a comment\n# also a comment\n'
- tokens = [
- (Token.Comment, '! a comment'),
- (Token.Text, '\n'),
- (Token.Comment, '# also a comment'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def test_leading_whitespace_comments(self):
- fragment = ' # comment\n'
- tokens = [
- (Token.Text, ' '),
- (Token.Comment, '# comment'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def test_escaped_space_in_key(self):
- fragment = 'key = value\n'
- tokens = [
- (Token.Name.Attribute, 'key'),
- (Token.Text, ' '),
- (Token.Operator, '='),
- (Token.Text, ' '),
- (Token.Literal.String, 'value'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def test_escaped_space_in_value(self):
- fragment = 'key = doubleword\\ value\n'
- tokens = [
- (Token.Name.Attribute, 'key'),
- (Token.Text, ' '),
- (Token.Operator, '='),
- (Token.Text, ' '),
- (Token.Literal.String, 'doubleword\\ value'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def test_space_delimited_kv_pair(self):
- fragment = 'key value\n'
- tokens = [
- (Token.Name.Attribute, 'key'),
- (Token.Text, ' '),
- (Token.Literal.String, 'value\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def test_just_key(self):
- fragment = 'justkey\n'
- tokens = [
- (Token.Name.Attribute, 'justkey'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def test_just_key_with_space(self):
- fragment = 'just\\ key\n'
- tokens = [
- (Token.Name.Attribute, 'just\\ key'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_python.py b/tests/test_python.py
deleted file mode 100644
index b9c6c49b..00000000
--- a/tests/test_python.py
+++ /dev/null
@@ -1,133 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Python Tests
- ~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexers import PythonLexer, Python3Lexer
-from pygments.token import Token
-
-
-class PythonTest(unittest.TestCase):
- def setUp(self):
- self.lexer = PythonLexer()
-
- def test_cls_builtin(self):
- """
- Tests that a cls token gets interpreted as a Token.Name.Builtin.Pseudo
-
- """
- fragment = 'class TestClass():\n @classmethod\n def hello(cls):\n pass\n'
- tokens = [
- (Token.Keyword, 'class'),
- (Token.Text, ' '),
- (Token.Name.Class, 'TestClass'),
- (Token.Punctuation, '('),
- (Token.Punctuation, ')'),
- (Token.Punctuation, ':'),
- (Token.Text, '\n'),
- (Token.Text, ' '),
- (Token.Name.Decorator, '@classmethod'),
- (Token.Text, '\n'),
- (Token.Text, ' '),
- (Token.Keyword, 'def'),
- (Token.Text, ' '),
- (Token.Name.Function, 'hello'),
- (Token.Punctuation, '('),
- (Token.Name.Builtin.Pseudo, 'cls'),
- (Token.Punctuation, ')'),
- (Token.Punctuation, ':'),
- (Token.Text, '\n'),
- (Token.Text, ' '),
- (Token.Keyword, 'pass'),
- (Token.Text, '\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
-
-class Python3Test(unittest.TestCase):
- def setUp(self):
- self.lexer = Python3Lexer()
-
- def testNeedsName(self):
- """
- Tests that '@' is recognized as an Operator
- """
- fragment = u'S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r)\n'
- tokens = [
- (Token.Name, u'S'),
- (Token.Text, u' '),
- (Token.Operator, u'='),
- (Token.Text, u' '),
- (Token.Punctuation, u'('),
- (Token.Name, u'H'),
- (Token.Text, u' '),
- (Token.Operator, u'@'),
- (Token.Text, u' '),
- (Token.Name, u'beta'),
- (Token.Text, u' '),
- (Token.Operator, u'-'),
- (Token.Text, u' '),
- (Token.Name, u'r'),
- (Token.Punctuation, u')'),
- (Token.Operator, u'.'),
- (Token.Name, u'T'),
- (Token.Text, u' '),
- (Token.Operator, u'@'),
- (Token.Text, u' '),
- (Token.Name, u'inv'),
- (Token.Punctuation, u'('),
- (Token.Name, u'H'),
- (Token.Text, u' '),
- (Token.Operator, u'@'),
- (Token.Text, u' '),
- (Token.Name, u'V'),
- (Token.Text, u' '),
- (Token.Operator, u'@'),
- (Token.Text, u' '),
- (Token.Name, u'H'),
- (Token.Operator, u'.'),
- (Token.Name, u'T'),
- (Token.Punctuation, u')'),
- (Token.Text, u' '),
- (Token.Operator, u'@'),
- (Token.Text, u' '),
- (Token.Punctuation, u'('),
- (Token.Name, u'H'),
- (Token.Text, u' '),
- (Token.Operator, u'@'),
- (Token.Text, u' '),
- (Token.Name, u'beta'),
- (Token.Text, u' '),
- (Token.Operator, u'-'),
- (Token.Text, u' '),
- (Token.Name, u'r'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def test_pep_515(self):
- """
- Tests that the lexer can parse numeric literals with underscores
- """
- fragments = (
- (Token.Literal.Number.Integer, u'1_000_000'),
- (Token.Literal.Number.Float, u'1_000.000_001'),
- (Token.Literal.Number.Float, u'1_000e1_000j'),
- (Token.Literal.Number.Hex, u'0xCAFE_F00D'),
- (Token.Literal.Number.Bin, u'0b_0011_1111_0100_1110'),
- (Token.Literal.Number.Oct, u'0o_777_123'),
- )
-
- for token, fragment in fragments:
- tokens = [
- (token, fragment),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_qbasiclexer.py b/tests/test_qbasiclexer.py
deleted file mode 100644
index f40b8b63..00000000
--- a/tests/test_qbasiclexer.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Tests for QBasic
- ~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import glob
-import os
-import unittest
-
-from pygments.token import Token
-from pygments.lexers.basic import QBasicLexer
-
-
-class QBasicTest(unittest.TestCase):
- def setUp(self):
- self.lexer = QBasicLexer()
- self.maxDiff = None
-
- def testKeywordsWithDollar(self):
- fragment = u'DIM x\nx = RIGHT$("abc", 1)\n'
- expected = [
- (Token.Keyword.Declaration, u'DIM'),
- (Token.Text.Whitespace, u' '),
- (Token.Name.Variable.Global, u'x'),
- (Token.Text, u'\n'),
- (Token.Name.Variable.Global, u'x'),
- (Token.Text.Whitespace, u' '),
- (Token.Operator, u'='),
- (Token.Text.Whitespace, u' '),
- (Token.Keyword.Reserved, u'RIGHT$'),
- (Token.Punctuation, u'('),
- (Token.Literal.String.Double, u'"abc"'),
- (Token.Punctuation, u','),
- (Token.Text.Whitespace, u' '),
- (Token.Literal.Number.Integer.Long, u'1'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(expected, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_r.py b/tests/test_r.py
deleted file mode 100644
index 70148e53..00000000
--- a/tests/test_r.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- R Tests
- ~~~~~~~~~
-
- :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexers import SLexer
-from pygments.token import Token, Name, Punctuation
-
-
-class RTest(unittest.TestCase):
- def setUp(self):
- self.lexer = SLexer()
-
- def testCall(self):
- fragment = u'f(1, a)\n'
- tokens = [
- (Name.Function, u'f'),
- (Punctuation, u'('),
- (Token.Literal.Number, u'1'),
- (Punctuation, u','),
- (Token.Text, u' '),
- (Token.Name, u'a'),
- (Punctuation, u')'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testName1(self):
- fragment = u'._a_2.c'
- tokens = [
- (Name, u'._a_2.c'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testName2(self):
- # Invalid names are valid if backticks are used
- fragment = u'`.1 blah`'
- tokens = [
- (Name, u'`.1 blah`'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testName3(self):
- # Internal backticks can be escaped
- fragment = u'`.1 \\` blah`'
- tokens = [
- (Name, u'`.1 \\` blah`'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testCustomOperator(self):
- fragment = u'7 % and % 8'
- tokens = [
- (Token.Literal.Number, u'7'),
- (Token.Text, u' '),
- (Token.Operator, u'% and %'),
- (Token.Text, u' '),
- (Token.Literal.Number, u'8'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_regexlexer.py b/tests/test_regexlexer.py
deleted file mode 100644
index adc05a93..00000000
--- a/tests/test_regexlexer.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments regex lexer tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.token import Text
-from pygments.lexer import RegexLexer
-from pygments.lexer import default
-
-
-class TestLexer(RegexLexer):
- """Test tuple state transitions including #pop."""
- tokens = {
- 'root': [
- ('a', Text.Root, 'rag'),
- ('e', Text.Root),
- ('#', Text.Root, '#pop'),
- ('@', Text.Root, ('#pop', '#pop')),
- default(('beer', 'beer'))
- ],
- 'beer': [
- ('d', Text.Beer, ('#pop', '#pop')),
- ],
- 'rag': [
- ('b', Text.Rag, '#push'),
- ('c', Text.Rag, ('#pop', 'beer')),
- ],
- }
-
-
-class TupleTransTest(unittest.TestCase):
- def test(self):
- lx = TestLexer()
- toks = list(lx.get_tokens_unprocessed('abcde'))
- self.assertEqual(toks, [
- (0, Text.Root, 'a'), (1, Text.Rag, 'b'), (2, Text.Rag, 'c'),
- (3, Text.Beer, 'd'), (4, Text.Root, 'e')])
-
- def test_multiline(self):
- lx = TestLexer()
- toks = list(lx.get_tokens_unprocessed('a\ne'))
- self.assertEqual(toks, [
- (0, Text.Root, 'a'), (1, Text, u'\n'), (2, Text.Root, 'e')])
-
- def test_default(self):
- lx = TestLexer()
- toks = list(lx.get_tokens_unprocessed('d'))
- self.assertEqual(toks, [(0, Text.Beer, 'd')])
-
-
-class PopEmptyTest(unittest.TestCase):
- def test_regular(self):
- lx = TestLexer()
- toks = list(lx.get_tokens_unprocessed('#e'))
- self.assertEqual(toks, [(0, Text.Root, '#'), (1, Text.Root, 'e')])
-
- def test_tuple(self):
- lx = TestLexer()
- toks = list(lx.get_tokens_unprocessed('@e'))
- self.assertEqual(toks, [(0, Text.Root, '@'), (1, Text.Root, 'e')])
diff --git a/tests/test_regexopt.py b/tests/test_regexopt.py
deleted file mode 100644
index 9c44f498..00000000
--- a/tests/test_regexopt.py
+++ /dev/null
@@ -1,110 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Tests for pygments.regexopt
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-import random
-import unittest
-import itertools
-
-from pygments.regexopt import regex_opt
-
-ALPHABET = ['a', 'b', 'c', 'd', 'e']
-
-try:
- from itertools import combinations_with_replacement
- N_TRIES = 15
-except ImportError:
- # Python 2.6
- def combinations_with_replacement(iterable, r):
- pool = tuple(iterable)
- n = len(pool)
- for indices in itertools.product(range(n), repeat=r):
- if sorted(indices) == list(indices):
- yield tuple(pool[i] for i in indices)
- N_TRIES = 9
-
-
-class RegexOptTestCase(unittest.TestCase):
-
- def generate_keywordlist(self, length):
- return [''.join(p) for p in
- combinations_with_replacement(ALPHABET, length)]
-
- def test_randomly(self):
- # generate a list of all possible keywords of a certain length using
- # a restricted alphabet, then choose some to match and make sure only
- # those do
- for n in range(3, N_TRIES):
- kwlist = self.generate_keywordlist(n)
- to_match = random.sample(kwlist,
- random.randint(1, len(kwlist) - 1))
- no_match = set(kwlist) - set(to_match)
- rex = re.compile(regex_opt(to_match))
- self.assertEqual(rex.groups, 1)
- for w in to_match:
- self.assertTrue(rex.match(w))
- for w in no_match:
- self.assertFalse(rex.match(w))
-
- def test_prefix(self):
- opt = regex_opt(('a', 'b'), prefix=r':{1,2}')
- print(opt)
- rex = re.compile(opt)
- self.assertFalse(rex.match('a'))
- self.assertTrue(rex.match('::a'))
- self.assertFalse(rex.match(':::')) # fullmatch
-
- def test_suffix(self):
- opt = regex_opt(('a', 'b'), suffix=r':{1,2}')
- print(opt)
- rex = re.compile(opt)
- self.assertFalse(rex.match('a'))
- self.assertTrue(rex.match('a::'))
- self.assertFalse(rex.match(':::')) # fullmatch
-
- def test_suffix_opt(self):
- # test that detected suffixes remain sorted.
- opt = regex_opt(('afoo', 'abfoo'))
- print(opt)
- rex = re.compile(opt)
- m = rex.match('abfoo')
- self.assertEqual(5, m.end())
-
- def test_different_length_grouping(self):
- opt = regex_opt(('a', 'xyz'))
- print(opt)
- rex = re.compile(opt)
- self.assertTrue(rex.match('a'))
- self.assertTrue(rex.match('xyz'))
- self.assertFalse(rex.match('b'))
- self.assertEqual(1, rex.groups)
-
- def test_same_length_grouping(self):
- opt = regex_opt(('a', 'b'))
- print(opt)
- rex = re.compile(opt)
- self.assertTrue(rex.match('a'))
- self.assertTrue(rex.match('b'))
- self.assertFalse(rex.match('x'))
-
- self.assertEqual(1, rex.groups)
- groups = rex.match('a').groups()
- self.assertEqual(('a',), groups)
-
- def test_same_length_suffix_grouping(self):
- opt = regex_opt(('a', 'b'), suffix='(m)')
- print(opt)
- rex = re.compile(opt)
- self.assertTrue(rex.match('am'))
- self.assertTrue(rex.match('bm'))
- self.assertFalse(rex.match('xm'))
- self.assertFalse(rex.match('ax'))
- self.assertEqual(2, rex.groups)
- groups = rex.match('am').groups()
- self.assertEqual(('a', 'm'), groups)
diff --git a/tests/test_rtf_formatter.py b/tests/test_rtf_formatter.py
deleted file mode 100644
index 80ce01f5..00000000
--- a/tests/test_rtf_formatter.py
+++ /dev/null
@@ -1,109 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments RTF formatter tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-from string_asserts import StringTests
-
-from pygments.util import StringIO
-from pygments.formatters import RtfFormatter
-from pygments.lexers.special import TextLexer
-
-class RtfFormatterTest(StringTests, unittest.TestCase):
- foot = (r'\par' '\n' r'}')
-
- def _escape(self, string):
- return(string.replace("\n", r"\n"))
-
- def _build_message(self, *args, **kwargs):
- string = kwargs.get('string', None)
- t = self._escape(kwargs.get('t', ''))
- expected = self._escape(kwargs.get('expected', ''))
- result = self._escape(kwargs.get('result', ''))
-
- if string is None:
- string = (u"The expected output of '{t}'\n"
- u"\t\tShould be '{expected}'\n"
- u"\t\tActually outputs '{result}'\n"
- u"\t(WARNING: Partial Output of Result!)")
-
- end = -(len(self._escape(self.foot)))
- start = end-len(expected)
-
- return string.format(t=t,
- result = result[start:end],
- expected = expected)
-
- def format_rtf(self, t):
- tokensource = list(TextLexer().get_tokens(t))
- fmt = RtfFormatter()
- buf = StringIO()
- fmt.format(tokensource, buf)
- result = buf.getvalue()
- buf.close()
- return result
-
- def test_rtf_header(self):
- t = u''
- result = self.format_rtf(t)
- expected = r'{\rtf1\ansi\uc0'
- msg = (u"RTF documents are expected to start with '{expected}'\n"
- u"\t\tStarts intead with '{result}'\n"
- u"\t(WARNING: Partial Output of Result!)".format(
- expected = expected,
- result = result[:len(expected)]))
- self.assertStartsWith(result, expected, msg)
-
- def test_rtf_footer(self):
- t = u''
- result = self.format_rtf(t)
- expected = self.foot
- msg = (u"RTF documents are expected to end with '{expected}'\n"
- u"\t\tEnds intead with '{result}'\n"
- u"\t(WARNING: Partial Output of Result!)".format(
- expected = self._escape(expected),
- result = self._escape(result[-len(expected):])))
- self.assertEndsWith(result, expected, msg)
-
- def test_ascii_characters(self):
- t = u'a b c d ~'
- result = self.format_rtf(t)
- expected = (r'a b c d ~')
- if not result.endswith(self.foot):
- return(unittest.skip('RTF Footer incorrect'))
- msg = self._build_message(t=t, result=result, expected=expected)
- self.assertEndsWith(result, expected+self.foot, msg)
-
- def test_escape_characters(self):
- t = u'\\ {{'
- result = self.format_rtf(t)
- expected = (r'\\ \{\{')
- if not result.endswith(self.foot):
- return(unittest.skip('RTF Footer incorrect'))
- msg = self._build_message(t=t, result=result, expected=expected)
- self.assertEndsWith(result, expected+self.foot, msg)
-
- def test_single_characters(self):
- t = u'â € ¤ каждой'
- result = self.format_rtf(t)
- expected = (r'{\u226} {\u8364} {\u164} '
- r'{\u1082}{\u1072}{\u1078}{\u1076}{\u1086}{\u1081}')
- if not result.endswith(self.foot):
- return(unittest.skip('RTF Footer incorrect'))
- msg = self._build_message(t=t, result=result, expected=expected)
- self.assertEndsWith(result, expected+self.foot, msg)
-
- def test_double_characters(self):
- t = u'က 힣 ↕ ↕︎ 鼖'
- result = self.format_rtf(t)
- expected = (r'{\u4096} {\u55203} {\u8597} '
- r'{\u8597}{\u65038} {\u55422}{\u56859}')
- if not result.endswith(self.foot):
- return(unittest.skip('RTF Footer incorrect'))
- msg = self._build_message(t=t, result=result, expected=expected)
- self.assertEndsWith(result, expected+self.foot, msg)
diff --git a/tests/test_ruby.py b/tests/test_ruby.py
deleted file mode 100644
index 45a77469..00000000
--- a/tests/test_ruby.py
+++ /dev/null
@@ -1,145 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic RubyLexer Test
- ~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.token import Operator, Number, Text, Token
-from pygments.lexers import RubyLexer
-
-
-class RubyTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = RubyLexer()
- self.maxDiff = None
-
- def testRangeSyntax1(self):
- fragment = u'1..3\n'
- tokens = [
- (Number.Integer, u'1'),
- (Operator, u'..'),
- (Number.Integer, u'3'),
- (Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testRangeSyntax2(self):
- fragment = u'1...3\n'
- tokens = [
- (Number.Integer, u'1'),
- (Operator, u'...'),
- (Number.Integer, u'3'),
- (Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testRangeSyntax3(self):
- fragment = u'1 .. 3\n'
- tokens = [
- (Number.Integer, u'1'),
- (Text, u' '),
- (Operator, u'..'),
- (Text, u' '),
- (Number.Integer, u'3'),
- (Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testInterpolationNestedCurly(self):
- fragment = (
- u'"A#{ (3..5).group_by { |x| x/2}.map '
- u'do |k,v| "#{k}" end.join }" + "Z"\n')
-
- tokens = [
- (Token.Literal.String.Double, u'"'),
- (Token.Literal.String.Double, u'A'),
- (Token.Literal.String.Interpol, u'#{'),
- (Token.Text, u' '),
- (Token.Punctuation, u'('),
- (Token.Literal.Number.Integer, u'3'),
- (Token.Operator, u'..'),
- (Token.Literal.Number.Integer, u'5'),
- (Token.Punctuation, u')'),
- (Token.Operator, u'.'),
- (Token.Name, u'group_by'),
- (Token.Text, u' '),
- (Token.Literal.String.Interpol, u'{'),
- (Token.Text, u' '),
- (Token.Operator, u'|'),
- (Token.Name, u'x'),
- (Token.Operator, u'|'),
- (Token.Text, u' '),
- (Token.Name, u'x'),
- (Token.Operator, u'/'),
- (Token.Literal.Number.Integer, u'2'),
- (Token.Literal.String.Interpol, u'}'),
- (Token.Operator, u'.'),
- (Token.Name, u'map'),
- (Token.Text, u' '),
- (Token.Keyword, u'do'),
- (Token.Text, u' '),
- (Token.Operator, u'|'),
- (Token.Name, u'k'),
- (Token.Punctuation, u','),
- (Token.Name, u'v'),
- (Token.Operator, u'|'),
- (Token.Text, u' '),
- (Token.Literal.String.Double, u'"'),
- (Token.Literal.String.Interpol, u'#{'),
- (Token.Name, u'k'),
- (Token.Literal.String.Interpol, u'}'),
- (Token.Literal.String.Double, u'"'),
- (Token.Text, u' '),
- (Token.Keyword, u'end'),
- (Token.Operator, u'.'),
- (Token.Name, u'join'),
- (Token.Text, u' '),
- (Token.Literal.String.Interpol, u'}'),
- (Token.Literal.String.Double, u'"'),
- (Token.Text, u' '),
- (Token.Operator, u'+'),
- (Token.Text, u' '),
- (Token.Literal.String.Double, u'"'),
- (Token.Literal.String.Double, u'Z'),
- (Token.Literal.String.Double, u'"'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testOperatorMethods(self):
- fragment = u'x.==4\n'
- tokens = [
- (Token.Name, u'x'),
- (Token.Operator, u'.'),
- (Token.Name.Operator, u'=='),
- (Token.Literal.Number.Integer, u'4'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testEscapedBracestring(self):
- fragment = u'str.gsub(%r{\\\\\\\\}, "/")\n'
- tokens = [
- (Token.Name, u'str'),
- (Token.Operator, u'.'),
- (Token.Name, u'gsub'),
- (Token.Punctuation, u'('),
- (Token.Literal.String.Regex, u'%r{'),
- (Token.Literal.String.Regex, u'\\\\'),
- (Token.Literal.String.Regex, u'\\\\'),
- (Token.Literal.String.Regex, u'}'),
- (Token.Punctuation, u','),
- (Token.Text, u' '),
- (Token.Literal.String.Double, u'"'),
- (Token.Literal.String.Double, u'/'),
- (Token.Literal.String.Double, u'"'),
- (Token.Punctuation, u')'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_shell.py b/tests/test_shell.py
deleted file mode 100644
index 6b24eb43..00000000
--- a/tests/test_shell.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic Shell Tests
- ~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.token import Token
-from pygments.lexers import BashLexer, BashSessionLexer, MSDOSSessionLexer
-
-
-class BashTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = BashLexer()
- self.maxDiff = None
-
- def testCurlyNoEscapeAndQuotes(self):
- fragment = u'echo "${a//["b"]/}"\n'
- tokens = [
- (Token.Name.Builtin, u'echo'),
- (Token.Text, u' '),
- (Token.Literal.String.Double, u'"'),
- (Token.String.Interpol, u'${'),
- (Token.Name.Variable, u'a'),
- (Token.Punctuation, u'//['),
- (Token.Literal.String.Double, u'"b"'),
- (Token.Punctuation, u']/'),
- (Token.String.Interpol, u'}'),
- (Token.Literal.String.Double, u'"'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testCurlyWithEscape(self):
- fragment = u'echo ${a//[\\"]/}\n'
- tokens = [
- (Token.Name.Builtin, u'echo'),
- (Token.Text, u' '),
- (Token.String.Interpol, u'${'),
- (Token.Name.Variable, u'a'),
- (Token.Punctuation, u'//['),
- (Token.Literal.String.Escape, u'\\"'),
- (Token.Punctuation, u']/'),
- (Token.String.Interpol, u'}'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testParsedSingle(self):
- fragment = u"a=$'abc\\''\n"
- tokens = [
- (Token.Name.Variable, u'a'),
- (Token.Operator, u'='),
- (Token.Literal.String.Single, u"$'abc\\''"),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testShortVariableNames(self):
- fragment = u'x="$"\ny="$_"\nz="$abc"\n'
- tokens = [
- # single lone $
- (Token.Name.Variable, u'x'),
- (Token.Operator, u'='),
- (Token.Literal.String.Double, u'"'),
- (Token.Text, u'$'),
- (Token.Literal.String.Double, u'"'),
- (Token.Text, u'\n'),
- # single letter shell var
- (Token.Name.Variable, u'y'),
- (Token.Operator, u'='),
- (Token.Literal.String.Double, u'"'),
- (Token.Name.Variable, u'$_'),
- (Token.Literal.String.Double, u'"'),
- (Token.Text, u'\n'),
- # multi-letter user var
- (Token.Name.Variable, u'z'),
- (Token.Operator, u'='),
- (Token.Literal.String.Double, u'"'),
- (Token.Name.Variable, u'$abc'),
- (Token.Literal.String.Double, u'"'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testArrayNums(self):
- fragment = u'a=(1 2 3)\n'
- tokens = [
- (Token.Name.Variable, u'a'),
- (Token.Operator, u'='),
- (Token.Operator, u'('),
- (Token.Literal.Number, u'1'),
- (Token.Text, u' '),
- (Token.Literal.Number, u'2'),
- (Token.Text, u' '),
- (Token.Literal.Number, u'3'),
- (Token.Operator, u')'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
- def testEndOfLineNums(self):
- fragment = u'a=1\nb=2 # comment\n'
- tokens = [
- (Token.Name.Variable, u'a'),
- (Token.Operator, u'='),
- (Token.Literal.Number, u'1'),
- (Token.Text, u'\n'),
- (Token.Name.Variable, u'b'),
- (Token.Operator, u'='),
- (Token.Literal.Number, u'2'),
- (Token.Text, u' '),
- (Token.Comment.Single, u'# comment\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
-class BashSessionTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = BashSessionLexer()
- self.maxDiff = None
-
- def testNeedsName(self):
- fragment = u'$ echo \\\nhi\nhi\n'
- tokens = [
- (Token.Text, u''),
- (Token.Generic.Prompt, u'$'),
- (Token.Text, u' '),
- (Token.Name.Builtin, u'echo'),
- (Token.Text, u' '),
- (Token.Literal.String.Escape, u'\\\n'),
- (Token.Text, u'hi'),
- (Token.Text, u'\n'),
- (Token.Generic.Output, u'hi\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
-class MSDOSSessionTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = MSDOSSessionLexer()
-
- def testGtOnlyPrompt(self):
- fragment = u'> py\nhi\n'
- tokens = [
- (Token.Text, u''),
- (Token.Generic.Prompt, u'>'),
- (Token.Text, u' '),
- (Token.Text, u'py'),
- (Token.Text, u''),
- (Token.Text, u'\n'),
- (Token.Generic.Output, u'hi\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tests/test_smarty.py b/tests/test_smarty.py
deleted file mode 100644
index fb15f7f4..00000000
--- a/tests/test_smarty.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic SmartyLexer Test
- ~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.token import Operator, Number, Text, Token
-from pygments.lexers import SmartyLexer
-
-
-class SmartyTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = SmartyLexer()
-
- def testNestedCurly(self):
- fragment = u'{templateFunction param={anotherFunction} param2=$something}\n'
- tokens = [
- (Token.Comment.Preproc, u'{'),
- (Token.Name.Function, u'templateFunction'),
- (Token.Text, u' '),
- (Token.Name.Attribute, u'param'),
- (Token.Operator, u'='),
- (Token.Comment.Preproc, u'{'),
- (Token.Name.Attribute, u'anotherFunction'),
- (Token.Comment.Preproc, u'}'),
- (Token.Text, u' '),
- (Token.Name.Attribute, u'param2'),
- (Token.Operator, u'='),
- (Token.Name.Variable, u'$something'),
- (Token.Comment.Preproc, u'}'),
- (Token.Other, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
-
diff --git a/tests/test_sql.py b/tests/test_sql.py
deleted file mode 100644
index 6be34006..00000000
--- a/tests/test_sql.py
+++ /dev/null
@@ -1,118 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments SQL lexers tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-import unittest
-
-from pygments.lexers.sql import name_between_bracket_re, \
- name_between_backtick_re, tsql_go_re, tsql_declare_re, \
- tsql_variable_re, MySqlLexer, SqlLexer, TransactSqlLexer
-
-from pygments.token import Comment, Name, Number, Punctuation, Whitespace
-
-
-class TransactSqlLexerTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = TransactSqlLexer()
-
- def _assertAreTokensOfType(self, examples, expected_token_type):
- for test_number, example in enumerate(examples.split(), 1):
- token_count = 0
- for token_type, token_value in self.lexer.get_tokens(example):
- if token_type != Whitespace:
- token_count += 1
- self.assertEqual(
- token_type, expected_token_type,
- 'token_type #%d for %s is be %s but must be %s' %
- (test_number, token_value, token_type, expected_token_type))
- self.assertEqual(
- token_count, 1,
- '%s must yield exactly 1 token instead of %d' %
- (example, token_count))
-
- def _assertTokensMatch(self, text, expected_tokens_without_trailing_newline):
- actual_tokens = tuple(self.lexer.get_tokens(text))
- if (len(actual_tokens) >= 1) and (actual_tokens[-1] == (Whitespace, '\n')):
- actual_tokens = tuple(actual_tokens[:-1])
- self.assertEqual(
- expected_tokens_without_trailing_newline, actual_tokens,
- 'text must yield expected tokens: %s' % text)
-
- def test_can_lex_float(self):
- self._assertAreTokensOfType(
- '1. 1.e1 .1 1.2 1.2e3 1.2e+3 1.2e-3 1e2', Number.Float)
- self._assertTokensMatch(
- '1e2.1e2',
- ((Number.Float, '1e2'), (Number.Float, '.1e2'))
- )
-
- def test_can_reject_almost_float(self):
- self._assertTokensMatch(
- '.e1',
- ((Punctuation, '.'), (Name, 'e1')))
-
- def test_can_lex_integer(self):
- self._assertAreTokensOfType(
- '1 23 456', Number.Integer)
-
- def test_can_lex_names(self):
- self._assertAreTokensOfType(
- u'thingy thingy123 _thingy _ _123 Ähnliches Müll #temp1 ##temp2', Name)
-
- def test_can_lex_comments(self):
- self._assertTokensMatch('--\n', ((Comment.Single, '--\n'),))
- self._assertTokensMatch('/**/', (
- (Comment.Multiline, '/*'), (Comment.Multiline, '*/')
- ))
- self._assertTokensMatch('/*/**/*/', (
- (Comment.Multiline, '/*'),
- (Comment.Multiline, '/*'),
- (Comment.Multiline, '*/'),
- (Comment.Multiline, '*/'),
- ))
-
-
-class SqlAnalyzeTextTest(unittest.TestCase):
- def test_can_match_analyze_text_res(self):
- self.assertEqual(['`a`', '`bc`'],
- name_between_backtick_re.findall('select `a`, `bc` from some'))
- self.assertEqual(['[a]', '[bc]'],
- name_between_bracket_re.findall('select [a], [bc] from some'))
- self.assertTrue(tsql_declare_re.search('--\nDeClaRe @some int;'))
- self.assertTrue(tsql_go_re.search('select 1\ngo\n--'))
- self.assertTrue(tsql_variable_re.search(
- 'create procedure dbo.usp_x @a int, @b int'))
-
- def test_can_analyze_text(self):
- mysql_lexer = MySqlLexer()
- sql_lexer = SqlLexer()
- tsql_lexer = TransactSqlLexer()
- code_to_expected_lexer_map = {
- 'select `a`, `bc` from some': mysql_lexer,
- 'select a, bc from some': sql_lexer,
- 'select [a], [bc] from some': tsql_lexer,
- '-- `a`, `bc`\nselect [a], [bc] from some': tsql_lexer,
- '-- `a`, `bc`\nselect [a], [bc] from some; go': tsql_lexer,
- }
- sql_lexers = set(code_to_expected_lexer_map.values())
- for code, expected_lexer in code_to_expected_lexer_map.items():
- ratings_and_lexers = list((lexer.analyse_text(code), lexer.name) for lexer in sql_lexers)
- best_rating, best_lexer_name = sorted(ratings_and_lexers, reverse=True)[0]
- expected_rating = expected_lexer.analyse_text(code)
- message = (
- 'lexer must be %s (rating %.2f) instead of '
- '%s (rating %.2f) for analyse_text() on code:\n%s') % (
- expected_lexer.name,
- expected_rating,
- best_lexer_name,
- best_rating,
- code
- )
- self.assertEqual(
- expected_lexer.name, best_lexer_name, message
- )
diff --git a/tests/test_string_asserts.py b/tests/test_string_asserts.py
deleted file mode 100644
index 737ba200..00000000
--- a/tests/test_string_asserts.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments string assert utility tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-from string_asserts import StringTests
-
-class TestStringTests(StringTests, unittest.TestCase):
-
- def test_startswith_correct(self):
- self.assertStartsWith("AAA", "A")
-
- # @unittest.expectedFailure not supported by nose
- def test_startswith_incorrect(self):
- self.assertRaises(AssertionError, self.assertStartsWith, "AAA", "B")
-
- # @unittest.expectedFailure not supported by nose
- def test_startswith_short(self):
- self.assertRaises(AssertionError, self.assertStartsWith, "A", "AA")
-
- def test_endswith_correct(self):
- self.assertEndsWith("AAA", "A")
-
- # @unittest.expectedFailure not supported by nose
- def test_endswith_incorrect(self):
- self.assertRaises(AssertionError, self.assertEndsWith, "AAA", "B")
-
- # @unittest.expectedFailure not supported by nose
- def test_endswith_short(self):
- self.assertRaises(AssertionError, self.assertEndsWith, "A", "AA")
diff --git a/tests/test_terminal_formatter.py b/tests/test_terminal_formatter.py
deleted file mode 100644
index e5a13431..00000000
--- a/tests/test_terminal_formatter.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments terminal formatter tests
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from __future__ import print_function
-
-import unittest
-import re
-
-from pygments.util import StringIO
-from pygments.lexers.sql import PlPgsqlLexer
-from pygments.formatters import TerminalFormatter, Terminal256Formatter, \
- HtmlFormatter, LatexFormatter
-
-from pygments.style import Style
-from pygments.token import Token
-from pygments.lexers import Python3Lexer
-from pygments import highlight
-
-DEMO_TEXT = '''\
--- comment
-select
-* from bar;
-'''
-DEMO_LEXER = PlPgsqlLexer
-DEMO_TOKENS = list(DEMO_LEXER().get_tokens(DEMO_TEXT))
-
-ANSI_RE = re.compile(r'\x1b[\w\W]*?m')
-
-
-def strip_ansi(x):
- return ANSI_RE.sub('', x)
-
-
-class TerminalFormatterTest(unittest.TestCase):
- def test_reasonable_output(self):
- out = StringIO()
- TerminalFormatter().format(DEMO_TOKENS, out)
- plain = strip_ansi(out.getvalue())
- self.assertEqual(DEMO_TEXT.count('\n'), plain.count('\n'))
- print(repr(plain))
-
- for a, b in zip(DEMO_TEXT.splitlines(), plain.splitlines()):
- self.assertEqual(a, b)
-
- def test_reasonable_output_lineno(self):
- out = StringIO()
- TerminalFormatter(linenos=True).format(DEMO_TOKENS, out)
- plain = strip_ansi(out.getvalue())
- self.assertEqual(DEMO_TEXT.count('\n') + 1, plain.count('\n'))
- print(repr(plain))
-
- for a, b in zip(DEMO_TEXT.splitlines(), plain.splitlines()):
- self.assertTrue(a in b)
-
-
-class MyStyle(Style):
- styles = {
- Token.Comment: 'ansibrightblack',
- Token.String: 'ansibrightblue bg:ansired',
- Token.Number: 'ansibrightgreen bg:ansigreen',
- Token.Number.Hex: 'ansigreen bg:ansibrightred',
- }
-
-
-class Terminal256FormatterTest(unittest.TestCase):
- code = '''
-# this should be a comment
-print("Hello World")
-async def function(a,b,c, *d, **kwarg:Bool)->Bool:
- pass
- return 123, 0xb3e3
-
-'''
-
- def test_style_html(self):
- style = HtmlFormatter(style=MyStyle).get_style_defs()
- self.assertTrue('#555555' in style,
- "ansigray for comment not html css style")
-
- def test_others_work(self):
- """check other formatters don't crash"""
- highlight(self.code, Python3Lexer(), LatexFormatter(style=MyStyle))
- highlight(self.code, Python3Lexer(), HtmlFormatter(style=MyStyle))
-
- def test_256esc_seq(self):
- """
- test that a few escape sequences are actually used when using ansi<> color codes
- """
- def termtest(x):
- return highlight(x, Python3Lexer(),
- Terminal256Formatter(style=MyStyle))
-
- self.assertTrue('32;101' in termtest('0x123'))
- self.assertTrue('92;42' in termtest('123'))
- self.assertTrue('90' in termtest('#comment'))
- self.assertTrue('94;41' in termtest('"String"'))
diff --git a/tests/test_textfmts.py b/tests/test_textfmts.py
deleted file mode 100644
index 8a1b8eda..00000000
--- a/tests/test_textfmts.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Basic Tests for textfmts
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.token import Operator, Number, Text, Token
-from pygments.lexers.textfmts import HttpLexer
-
-
-class RubyTest(unittest.TestCase):
-
- def setUp(self):
- self.lexer = HttpLexer()
- self.maxDiff = None
-
- def testApplicationXml(self):
- fragment = u'GET / HTTP/1.0\nContent-Type: application/xml\n\n<foo>\n'
- tokens = [
- (Token.Name.Tag, u'<foo'),
- (Token.Name.Tag, u'>'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(
- tokens, list(self.lexer.get_tokens(fragment))[-len(tokens):])
-
- def testApplicationCalendarXml(self):
- fragment = u'GET / HTTP/1.0\nContent-Type: application/calendar+xml\n\n<foo>\n'
- tokens = [
- (Token.Name.Tag, u'<foo'),
- (Token.Name.Tag, u'>'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(
- tokens, list(self.lexer.get_tokens(fragment))[-len(tokens):])
-
diff --git a/tests/test_token.py b/tests/test_token.py
deleted file mode 100644
index fdbcabd1..00000000
--- a/tests/test_token.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Test suite for the token module
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import copy
-import unittest
-
-from pygments import token
-
-
-class TokenTest(unittest.TestCase):
-
- def test_tokentype(self):
- e = self.assertEqual
-
- t = token.String
-
- e(t.split(), [token.Token, token.Literal, token.String])
-
- e(t.__class__, token._TokenType)
-
- def test_functions(self):
- self.assertTrue(token.is_token_subtype(token.String, token.String))
- self.assertTrue(token.is_token_subtype(token.String, token.Literal))
- self.assertFalse(token.is_token_subtype(token.Literal, token.String))
-
- self.assertTrue(token.string_to_tokentype(token.String) is token.String)
- self.assertTrue(token.string_to_tokentype('') is token.Token)
- self.assertTrue(token.string_to_tokentype('String') is token.String)
-
- def test_sanity_check(self):
- stp = token.STANDARD_TYPES.copy()
- stp[token.Token] = '---' # Token and Text do conflict, that is okay
- t = {}
- for k, v in stp.items():
- t.setdefault(v, []).append(k)
- if len(t) == len(stp):
- return # Okay
-
- for k, v in t.items():
- if len(v) > 1:
- self.fail("%r has more than one key: %r" % (k, v))
-
- def test_copying(self):
- # Token instances are supposed to be singletons, so copying or even
- # deepcopying should return themselves
- t = token.String
- self.assertIs(t, copy.copy(t))
- self.assertIs(t, copy.deepcopy(t))
diff --git a/tests/test_unistring.py b/tests/test_unistring.py
deleted file mode 100644
index 82d74ed6..00000000
--- a/tests/test_unistring.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Test suite for the unistring module
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-import unittest
-import random
-
-from pygments import unistring as uni
-from pygments.util import unichr
-
-
-class UnistringTest(unittest.TestCase):
- def test_cats_exist_and_compilable(self):
- for cat in uni.cats:
- s = getattr(uni, cat)
- if s == '': # Probably Cs on Jython
- continue
- print("%s %r" % (cat, s))
- re.compile('[%s]' % s)
-
- def _cats_that_match(self, c):
- matching_cats = []
- for cat in uni.cats:
- s = getattr(uni, cat)
- if s == '': # Probably Cs on Jython
- continue
- if re.compile('[%s]' % s).match(c):
- matching_cats.append(cat)
- return matching_cats
-
- def test_spot_check_types(self):
- # Each char should match one, and precisely one, category
- random.seed(0)
- for i in range(1000):
- o = random.randint(0, 65535)
- c = unichr(o)
- if o > 0xd800 and o <= 0xdfff and not uni.Cs:
- continue # Bah, Jython.
- print(hex(o))
- cats = self._cats_that_match(c)
- self.assertEqual(len(cats), 1,
- "%d (%s): %s" % (o, c, cats))
diff --git a/tests/test_using_api.py b/tests/test_using_api.py
deleted file mode 100644
index 2ab70d09..00000000
--- a/tests/test_using_api.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Pygments tests for using()
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexer import using, bygroups, this, RegexLexer
-from pygments.token import String, Text, Keyword
-
-class TestLexer(RegexLexer):
- tokens = {
- 'root': [
- (r'#.*',
- using(this, state='invalid')),
- (r'(")(.+?)(")',
- bygroups(String, using(this, state='string'), String)),
- (r'[^"]+', Text),
- ],
- 'string': [
- (r'.+', Keyword),
- ],
- }
-
-
-class UsingStateTest(unittest.TestCase):
- def test_basic(self):
- expected = [(Text, 'a'), (String, '"'), (Keyword, 'bcd'),
- (String, '"'), (Text, 'e\n')]
- t = list(TestLexer().get_tokens('a"bcd"e'))
- self.assertEqual(t, expected)
-
- def test_error(self):
- def gen():
- return list(TestLexer().get_tokens('#a'))
- self.assertRaises(KeyError, gen)
diff --git a/tests/test_util.py b/tests/test_util.py
deleted file mode 100644
index 646a403b..00000000
--- a/tests/test_util.py
+++ /dev/null
@@ -1,213 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Test suite for the util module
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-import unittest
-
-from pygments import util, console
-
-
-class FakeLexer(object):
- def analyse(text):
- return text
- analyse = util.make_analysator(analyse)
-
-
-class UtilTest(unittest.TestCase):
-
- def test_getoptions(self):
- raises = self.assertRaises
- equals = self.assertEqual
-
- equals(util.get_bool_opt({}, 'a', True), True)
- equals(util.get_bool_opt({}, 'a', 1), True)
- equals(util.get_bool_opt({}, 'a', 'true'), True)
- equals(util.get_bool_opt({}, 'a', 'no'), False)
- raises(util.OptionError, util.get_bool_opt, {}, 'a', [])
- raises(util.OptionError, util.get_bool_opt, {}, 'a', 'foo')
-
- equals(util.get_int_opt({}, 'a', 1), 1)
- raises(util.OptionError, util.get_int_opt, {}, 'a', [])
- raises(util.OptionError, util.get_int_opt, {}, 'a', 'bar')
-
- equals(util.get_list_opt({}, 'a', [1]), [1])
- equals(util.get_list_opt({}, 'a', '1 2'), ['1', '2'])
- raises(util.OptionError, util.get_list_opt, {}, 'a', 1)
-
- equals(util.get_choice_opt({}, 'a', ['foo', 'bar'], 'bar'), 'bar')
- equals(util.get_choice_opt({}, 'a', ['foo', 'bar'], 'Bar', True), 'bar')
- raises(util.OptionError, util.get_choice_opt, {}, 'a',
- ['foo', 'bar'], 'baz')
-
- def test_docstring_headline(self):
- def f1():
- """
- docstring headline
-
- other text
- """
- def f2():
- """
- docstring
- headline
-
- other text
- """
- def f3():
- pass
-
- self.assertEqual(util.docstring_headline(f1), 'docstring headline')
- self.assertEqual(util.docstring_headline(f2), 'docstring headline')
- self.assertEqual(util.docstring_headline(f3), '')
-
- 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.assertEqual(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.assertEqual(FakeLexer.analyse(True), 1.0)
- self.assertEqual(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):
- raise RuntimeError('something bad happened')
- analyse = util.make_analysator(analyse)
- self.assertEqual(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.assertEqual(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.assertEqual(FakeLexer.analyse('xxx'), 0.0)
-
- def test_shebang_matches(self):
- self.assertTrue(util.shebang_matches('#!/usr/bin/env python\n', r'python(2\.\d)?'))
- self.assertTrue(util.shebang_matches('#!/usr/bin/python2.4', r'python(2\.\d)?'))
- self.assertTrue(util.shebang_matches('#!/usr/bin/startsomethingwith python',
- r'python(2\.\d)?'))
- self.assertTrue(util.shebang_matches('#!C:\\Python2.4\\Python.exe',
- r'python(2\.\d)?'))
-
- self.assertFalse(util.shebang_matches('#!/usr/bin/python-ruby',
- r'python(2\.\d)?'))
- self.assertFalse(util.shebang_matches('#!/usr/bin/python/ruby',
- r'python(2\.\d)?'))
- self.assertFalse(util.shebang_matches('#!', r'python'))
-
- def test_doctype_matches(self):
- self.assertTrue(util.doctype_matches(
- '<!DOCTYPE html> <html>', 'html.*'))
- self.assertFalse(util.doctype_matches(
- '<?xml ?> <DOCTYPE html PUBLIC "a"> <html>', 'html.*'))
- self.assertTrue(util.html_doctype_matches(
- '<?xml ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">'))
-
- def test_xml(self):
- self.assertTrue(util.looks_like_xml(
- '<?xml ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">'))
- self.assertTrue(util.looks_like_xml('<html xmlns>abc</html>'))
- self.assertFalse(util.looks_like_xml('<html>'))
-
- def test_unirange(self):
- first_non_bmp = u'\U00010000'
- r = re.compile(util.unirange(0x10000, 0x20000))
- m = r.match(first_non_bmp)
- self.assertTrue(m)
- self.assertEqual(m.end(), len(first_non_bmp))
- self.assertFalse(r.match(u'\uffff'))
- self.assertFalse(r.match(u'xxx'))
- # Tests that end is inclusive
- r = re.compile(util.unirange(0x10000, 0x10000) + '+')
- # Tests that the plus works for the entire unicode point, if narrow
- # build
- m = r.match(first_non_bmp * 2)
- self.assertTrue(m)
- self.assertEqual(m.end(), len(first_non_bmp) * 2)
-
- def test_format_lines(self):
- lst = ['cat', 'dog']
- output = util.format_lines('var', lst)
- d = {}
- exec(output, d)
- self.assertTrue(isinstance(d['var'], tuple))
- self.assertEqual(('cat', 'dog'), d['var'])
-
- def test_duplicates_removed_seq_types(self):
- # tuple
- x = util.duplicates_removed(('a', 'a', 'b'))
- self.assertEqual(['a', 'b'], x)
- # list
- x = util.duplicates_removed(['a', 'a', 'b'])
- self.assertEqual(['a', 'b'], x)
- # iterator
- x = util.duplicates_removed(iter(('a', 'a', 'b')))
- self.assertEqual(['a', 'b'], x)
-
- def test_duplicates_removed_nonconsecutive(self):
- # keeps first
- x = util.duplicates_removed(('a', 'b', 'a'))
- self.assertEqual(['a', 'b'], x)
-
- def test_guess_decode(self):
- # UTF-8 should be decoded as UTF-8
- s = util.guess_decode(u'\xff'.encode('utf-8'))
- self.assertEqual(s, (u'\xff', 'utf-8'))
-
- # otherwise, it could be latin1 or the locale encoding...
- import locale
- s = util.guess_decode(b'\xff')
- self.assertTrue(s[1] in ('latin1', locale.getpreferredencoding()))
-
- def test_guess_decode_from_terminal(self):
- class Term:
- encoding = 'utf-7'
-
- s = util.guess_decode_from_terminal(u'\xff'.encode('utf-7'), Term)
- self.assertEqual(s, (u'\xff', 'utf-7'))
-
- s = util.guess_decode_from_terminal(u'\xff'.encode('utf-8'), Term)
- self.assertEqual(s, (u'\xff', 'utf-8'))
-
- def test_add_metaclass(self):
- class Meta(type):
- pass
-
- @util.add_metaclass(Meta)
- class Cls:
- pass
-
- self.assertEqual(type(Cls), Meta)
-
-
-class ConsoleTest(unittest.TestCase):
-
- def test_ansiformat(self):
- f = console.ansiformat
- c = console.codes
- all_attrs = f('+*_blue_*+', 'text')
- self.assertTrue(c['blue'] in all_attrs and c['blink'] in all_attrs
- and c['bold'] in all_attrs and c['underline'] in all_attrs
- and c['reset'] in all_attrs)
- self.assertRaises(KeyError, f, '*mauve*', 'text')
-
- def test_functions(self):
- self.assertEqual(console.reset_color(), console.codes['reset'])
- self.assertEqual(console.colorize('blue', 'text'),
- console.codes['blue'] + 'text' + console.codes['reset'])
diff --git a/tests/test_whiley.py b/tests/test_whiley.py
deleted file mode 100644
index f447ffec..00000000
--- a/tests/test_whiley.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Whiley Test
- ~~~~~~~~~~~
-
- :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import unittest
-
-from pygments.lexers import WhileyLexer
-from pygments.token import Token
-
-
-class WhileyTest(unittest.TestCase):
- def setUp(self):
- self.lexer = WhileyLexer()
-
- def testWhileyOperator(self):
- fragment = u'123 \u2200 x\n'
- tokens = [
- (Token.Literal.Number.Integer, u'123'),
- (Token.Text, u' '),
- (Token.Operator, u'\u2200'),
- (Token.Text, u' '),
- (Token.Name, u'x'),
- (Token.Text, u'\n'),
- ]
- self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
diff --git a/tox.ini b/tox.ini
deleted file mode 100644
index 2c63c292..00000000
--- a/tox.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[tox]
-envlist = py27, py35, py36, py37
-[testenv]
-deps =
- nose
- coverage
-commands = python -d tests/run.py {posargs}