pygments.rb 0.6.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +11 -0
- data/README.md +6 -6
- data/Rakefile +2 -1
- data/cache-lexers.rb +1 -1
- data/circle.yml +7 -0
- data/lib/pygments/lexer.rb +3 -3
- data/lib/pygments/popen.rb +67 -30
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -1
- data/test/test_pygments.rb +16 -16
- data/vendor/pygments-main/AUTHORS +54 -8
- data/vendor/pygments-main/CHANGES +247 -25
- data/vendor/pygments-main/LICENSE +1 -1
- data/vendor/pygments-main/Makefile +15 -6
- data/vendor/pygments-main/README.rst +39 -0
- data/vendor/pygments-main/REVISION +1 -1
- data/vendor/pygments-main/TODO +0 -3
- data/vendor/pygments-main/doc/_themes/pygments14/layout.html +1 -1
- data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +1 -1
- data/vendor/pygments-main/doc/conf.py +3 -11
- data/vendor/pygments-main/doc/docs/api.rst +15 -0
- data/vendor/pygments-main/doc/docs/cmdline.rst +6 -2
- data/vendor/pygments-main/doc/docs/filterdevelopment.rst +4 -3
- data/vendor/pygments-main/doc/docs/integrate.rst +11 -15
- data/vendor/pygments-main/doc/docs/java.rst +7 -7
- data/vendor/pygments-main/doc/docs/lexerdevelopment.rst +258 -171
- data/vendor/pygments-main/doc/docs/lexers.rst +2 -2
- data/vendor/pygments-main/doc/docs/styles.rst +58 -0
- data/vendor/pygments-main/doc/docs/tokens.rst +22 -2
- data/vendor/pygments-main/doc/docs/unicode.rst +15 -7
- data/vendor/pygments-main/doc/faq.rst +17 -21
- data/vendor/pygments-main/doc/index.rst +12 -11
- data/vendor/pygments-main/doc/languages.rst +10 -7
- data/vendor/pygments-main/external/autopygmentize +9 -6
- data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +70 -52
- data/vendor/pygments-main/external/markdown-processor.py +1 -1
- data/vendor/pygments-main/external/moin-parser.py +1 -1
- data/vendor/pygments-main/external/rst-directive.py +1 -1
- data/vendor/pygments-main/pygmentize +2 -1
- data/vendor/pygments-main/pygments/__init__.py +14 -15
- data/vendor/pygments-main/pygments/cmdline.py +188 -113
- data/vendor/pygments-main/pygments/console.py +13 -13
- data/vendor/pygments-main/pygments/filter.py +7 -7
- data/vendor/pygments-main/pygments/filters/__init__.py +24 -32
- data/vendor/pygments-main/pygments/formatter.py +5 -5
- data/vendor/pygments-main/pygments/formatters/__init__.py +92 -44
- data/vendor/pygments-main/pygments/formatters/_mapping.py +51 -69
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +63 -51
- data/vendor/pygments-main/pygments/formatters/img.py +25 -22
- data/vendor/pygments-main/pygments/formatters/irc.py +182 -0
- data/vendor/pygments-main/pygments/formatters/latex.py +34 -22
- data/vendor/pygments-main/pygments/formatters/other.py +5 -7
- data/vendor/pygments-main/pygments/formatters/rtf.py +28 -31
- data/vendor/pygments-main/pygments/formatters/svg.py +1 -2
- data/vendor/pygments-main/pygments/formatters/terminal.py +29 -45
- data/vendor/pygments-main/pygments/formatters/terminal256.py +118 -31
- data/vendor/pygments-main/pygments/lexer.py +120 -34
- data/vendor/pygments-main/pygments/lexers/__init__.py +85 -53
- data/vendor/pygments-main/pygments/lexers/{_asybuiltins.py → _asy_builtins.py} +7 -7
- data/vendor/pygments-main/pygments/lexers/{_clbuiltins.py → _cl_builtins.py} +17 -17
- data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +72 -0
- data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1346 -0
- data/vendor/pygments-main/pygments/lexers/{_lassobuiltins.py → _lasso_builtins.py} +4699 -4561
- data/vendor/pygments-main/pygments/lexers/{_luabuiltins.py → _lua_builtins.py} +91 -51
- data/vendor/pygments-main/pygments/lexers/_mapping.py +342 -242
- data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1172 -0
- data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +2547 -0
- data/vendor/pygments-main/pygments/lexers/{_phpbuiltins.py → _php_builtins.py} +350 -353
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +600 -212
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3084 -30
- data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +1163 -0
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +91 -13
- data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +419 -0
- data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1004 -0
- data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1939 -0
- data/vendor/pygments-main/pygments/lexers/actionscript.py +240 -0
- data/vendor/pygments-main/pygments/lexers/agile.py +14 -2542
- data/vendor/pygments-main/pygments/lexers/algebra.py +221 -0
- data/vendor/pygments-main/pygments/lexers/ambient.py +76 -0
- data/vendor/pygments-main/pygments/lexers/ampl.py +87 -0
- data/vendor/pygments-main/pygments/lexers/apl.py +101 -0
- data/vendor/pygments-main/pygments/lexers/archetype.py +318 -0
- data/vendor/pygments-main/pygments/lexers/asm.py +276 -81
- data/vendor/pygments-main/pygments/lexers/automation.py +374 -0
- data/vendor/pygments-main/pygments/lexers/basic.py +500 -0
- data/vendor/pygments-main/pygments/lexers/bibtex.py +156 -0
- data/vendor/pygments-main/pygments/lexers/business.py +594 -0
- data/vendor/pygments-main/pygments/lexers/c_cpp.py +252 -0
- data/vendor/pygments-main/pygments/lexers/c_like.py +541 -0
- data/vendor/pygments-main/pygments/lexers/capnproto.py +79 -0
- data/vendor/pygments-main/pygments/lexers/chapel.py +101 -0
- data/vendor/pygments-main/pygments/lexers/clean.py +288 -0
- data/vendor/pygments-main/pygments/lexers/compiled.py +24 -5182
- data/vendor/pygments-main/pygments/lexers/configs.py +833 -0
- data/vendor/pygments-main/pygments/lexers/console.py +114 -0
- data/vendor/pygments-main/pygments/lexers/crystal.py +384 -0
- data/vendor/pygments-main/pygments/lexers/csound.py +366 -0
- data/vendor/pygments-main/pygments/lexers/css.py +689 -0
- data/vendor/pygments-main/pygments/lexers/d.py +251 -0
- data/vendor/pygments-main/pygments/lexers/dalvik.py +6 -6
- data/vendor/pygments-main/pygments/lexers/data.py +555 -0
- data/vendor/pygments-main/pygments/lexers/diff.py +165 -0
- data/vendor/pygments-main/pygments/lexers/dotnet.py +96 -88
- data/vendor/pygments-main/pygments/lexers/dsls.py +878 -0
- data/vendor/pygments-main/pygments/lexers/dylan.py +289 -0
- data/vendor/pygments-main/pygments/lexers/ecl.py +125 -0
- data/vendor/pygments-main/pygments/lexers/eiffel.py +65 -0
- data/vendor/pygments-main/pygments/lexers/elm.py +121 -0
- data/vendor/pygments-main/pygments/lexers/erlang.py +533 -0
- data/vendor/pygments-main/pygments/lexers/esoteric.py +275 -0
- data/vendor/pygments-main/pygments/lexers/ezhil.py +68 -0
- data/vendor/pygments-main/pygments/lexers/factor.py +344 -0
- data/vendor/pygments-main/pygments/lexers/fantom.py +250 -0
- data/vendor/pygments-main/pygments/lexers/felix.py +273 -0
- data/vendor/pygments-main/pygments/lexers/forth.py +177 -0
- data/vendor/pygments-main/pygments/lexers/fortran.py +205 -0
- data/vendor/pygments-main/pygments/lexers/foxpro.py +1 -1
- data/vendor/pygments-main/pygments/lexers/functional.py +11 -3661
- data/vendor/pygments-main/pygments/lexers/go.py +101 -0
- data/vendor/pygments-main/pygments/lexers/grammar_notation.py +213 -0
- data/vendor/pygments-main/pygments/lexers/graph.py +7 -8
- data/vendor/pygments-main/pygments/lexers/graphics.py +553 -0
- data/vendor/pygments-main/pygments/lexers/haskell.py +840 -0
- data/vendor/pygments-main/pygments/lexers/haxe.py +936 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +172 -145
- data/vendor/pygments-main/pygments/lexers/hexdump.py +97 -0
- data/vendor/pygments-main/pygments/lexers/html.py +602 -0
- data/vendor/pygments-main/pygments/lexers/idl.py +270 -0
- data/vendor/pygments-main/pygments/lexers/igor.py +288 -0
- data/vendor/pygments-main/pygments/lexers/inferno.py +3 -3
- data/vendor/pygments-main/pygments/lexers/installers.py +322 -0
- data/vendor/pygments-main/pygments/lexers/int_fiction.py +1343 -0
- data/vendor/pygments-main/pygments/lexers/iolang.py +63 -0
- data/vendor/pygments-main/pygments/lexers/j.py +146 -0
- data/vendor/pygments-main/pygments/lexers/javascript.py +1506 -0
- data/vendor/pygments-main/pygments/lexers/julia.py +333 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +232 -186
- data/vendor/pygments-main/pygments/lexers/lisp.py +2621 -0
- data/vendor/pygments-main/pygments/lexers/make.py +202 -0
- data/vendor/pygments-main/pygments/lexers/markup.py +595 -0
- data/vendor/pygments-main/pygments/lexers/math.py +11 -2276
- data/vendor/pygments-main/pygments/lexers/matlab.py +663 -0
- data/vendor/pygments-main/pygments/lexers/ml.py +769 -0
- data/vendor/pygments-main/pygments/lexers/modeling.py +358 -0
- data/vendor/pygments-main/pygments/lexers/modula2.py +1561 -0
- data/vendor/pygments-main/pygments/lexers/monte.py +203 -0
- data/vendor/pygments-main/pygments/lexers/ncl.py +1053 -0
- data/vendor/pygments-main/pygments/lexers/nimrod.py +159 -0
- data/vendor/pygments-main/pygments/lexers/nit.py +64 -0
- data/vendor/pygments-main/pygments/lexers/nix.py +136 -0
- data/vendor/pygments-main/pygments/lexers/oberon.py +105 -0
- data/vendor/pygments-main/pygments/lexers/objective.py +504 -0
- data/vendor/pygments-main/pygments/lexers/ooc.py +85 -0
- data/vendor/pygments-main/pygments/lexers/other.py +30 -4481
- data/vendor/pygments-main/pygments/lexers/parasail.py +79 -0
- data/vendor/pygments-main/pygments/lexers/parsers.py +171 -114
- data/vendor/pygments-main/pygments/lexers/pascal.py +644 -0
- data/vendor/pygments-main/pygments/lexers/pawn.py +199 -0
- data/vendor/pygments-main/pygments/lexers/perl.py +616 -0
- data/vendor/pygments-main/pygments/lexers/php.py +267 -0
- data/vendor/pygments-main/pygments/lexers/praat.py +294 -0
- data/vendor/pygments-main/pygments/lexers/prolog.py +306 -0
- data/vendor/pygments-main/pygments/lexers/python.py +938 -0
- data/vendor/pygments-main/pygments/lexers/qvt.py +152 -0
- data/vendor/pygments-main/pygments/lexers/r.py +453 -0
- data/vendor/pygments-main/pygments/lexers/rdf.py +195 -24
- data/vendor/pygments-main/pygments/lexers/rebol.py +431 -0
- data/vendor/pygments-main/pygments/lexers/resource.py +85 -0
- data/vendor/pygments-main/pygments/lexers/rnc.py +67 -0
- data/vendor/pygments-main/pygments/lexers/roboconf.py +82 -0
- data/vendor/pygments-main/pygments/lexers/{_robotframeworklexer.py → robotframework.py} +20 -18
- data/vendor/pygments-main/pygments/lexers/ruby.py +519 -0
- data/vendor/pygments-main/pygments/lexers/rust.py +209 -0
- data/vendor/pygments-main/pygments/lexers/sas.py +228 -0
- data/vendor/pygments-main/pygments/lexers/scripting.py +1222 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +478 -115
- data/vendor/pygments-main/pygments/lexers/smalltalk.py +195 -0
- data/vendor/pygments-main/pygments/lexers/smv.py +75 -0
- data/vendor/pygments-main/pygments/lexers/snobol.py +83 -0
- data/vendor/pygments-main/pygments/lexers/special.py +6 -2
- data/vendor/pygments-main/pygments/lexers/sql.py +209 -120
- data/vendor/pygments-main/pygments/lexers/stata.py +106 -0
- data/vendor/pygments-main/pygments/lexers/supercollider.py +90 -0
- data/vendor/pygments-main/pygments/lexers/tcl.py +145 -0
- data/vendor/pygments-main/pygments/lexers/templates.py +282 -90
- data/vendor/pygments-main/pygments/lexers/testing.py +207 -0
- data/vendor/pygments-main/pygments/lexers/text.py +15 -2045
- data/vendor/pygments-main/pygments/lexers/textedit.py +169 -0
- data/vendor/pygments-main/pygments/lexers/textfmts.py +297 -0
- data/vendor/pygments-main/pygments/lexers/theorem.py +458 -0
- data/vendor/pygments-main/pygments/lexers/trafficscript.py +54 -0
- data/vendor/pygments-main/pygments/lexers/typoscript.py +225 -0
- data/vendor/pygments-main/pygments/lexers/urbi.py +133 -0
- data/vendor/pygments-main/pygments/lexers/varnish.py +190 -0
- data/vendor/pygments-main/pygments/lexers/verification.py +111 -0
- data/vendor/pygments-main/pygments/lexers/web.py +13 -4499
- data/vendor/pygments-main/pygments/lexers/webmisc.py +979 -0
- data/vendor/pygments-main/pygments/lexers/whiley.py +117 -0
- data/vendor/pygments-main/pygments/lexers/x10.py +69 -0
- data/vendor/pygments-main/pygments/modeline.py +5 -2
- data/vendor/pygments-main/pygments/plugin.py +1 -1
- data/vendor/pygments-main/pygments/regexopt.py +92 -0
- data/vendor/pygments-main/pygments/scanner.py +3 -2
- data/vendor/pygments-main/pygments/sphinxext.py +11 -6
- data/vendor/pygments-main/pygments/style.py +41 -4
- data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
- data/vendor/pygments-main/pygments/styles/algol.py +63 -0
- data/vendor/pygments-main/pygments/styles/algol_nu.py +63 -0
- data/vendor/pygments-main/pygments/styles/arduino.py +98 -0
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/igor.py +1 -1
- data/vendor/pygments-main/pygments/styles/lovelace.py +97 -0
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +1 -1
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -1
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +2 -2
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/sas.py +41 -0
- data/vendor/pygments-main/pygments/styles/stata.py +37 -0
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/styles/xcode.py +1 -1
- data/vendor/pygments-main/pygments/token.py +31 -16
- data/vendor/pygments-main/pygments/unistring.py +141 -65
- data/vendor/pygments-main/pygments/util.py +129 -33
- data/vendor/pygments-main/requirements.txt +5 -0
- data/vendor/pygments-main/scripts/check_sources.py +25 -40
- data/vendor/pygments-main/scripts/debug_lexer.py +246 -0
- data/vendor/pygments-main/scripts/find_error.py +1 -0
- data/vendor/pygments-main/scripts/get_vimkw.py +35 -4
- data/vendor/pygments-main/setup.cfg +3 -0
- data/vendor/pygments-main/setup.py +17 -30
- data/vendor/pygments-main/tox.ini +7 -0
- metadata +159 -387
- data/vendor/pygments-main/ez_setup.py +0 -382
- data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +0 -73
- data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +0 -562
- data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +0 -1077
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +0 -13
- data/vendor/pygments-main/pygments/lexers/qbasic.py +0 -157
- data/vendor/pygments-main/scripts/find_codetags.py +0 -213
- data/vendor/pygments-main/scripts/find_error.py +0 -173
- data/vendor/pygments-main/tests/dtds/HTML4-f.dtd +0 -37
- data/vendor/pygments-main/tests/dtds/HTML4-s.dtd +0 -869
- data/vendor/pygments-main/tests/dtds/HTML4.dcl +0 -88
- data/vendor/pygments-main/tests/dtds/HTML4.dtd +0 -1092
- data/vendor/pygments-main/tests/dtds/HTML4.soc +0 -9
- data/vendor/pygments-main/tests/dtds/HTMLlat1.ent +0 -195
- data/vendor/pygments-main/tests/dtds/HTMLspec.ent +0 -77
- data/vendor/pygments-main/tests/dtds/HTMLsym.ent +0 -241
- data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +0 -118
- data/vendor/pygments-main/tests/examplefiles/AcidStateAdvanced.hs +0 -209
- data/vendor/pygments-main/tests/examplefiles/AlternatingGroup.mu +0 -102
- data/vendor/pygments-main/tests/examplefiles/BOM.js +0 -1
- data/vendor/pygments-main/tests/examplefiles/CPDictionary.j +0 -611
- data/vendor/pygments-main/tests/examplefiles/Config.in.cache +0 -1973
- data/vendor/pygments-main/tests/examplefiles/Constants.mo +0 -158
- data/vendor/pygments-main/tests/examplefiles/DancingSudoku.lhs +0 -411
- data/vendor/pygments-main/tests/examplefiles/Deflate.fs +0 -578
- data/vendor/pygments-main/tests/examplefiles/Error.pmod +0 -38
- data/vendor/pygments-main/tests/examplefiles/Errors.scala +0 -18
- data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +0 -360
- data/vendor/pygments-main/tests/examplefiles/Get-CommandDefinitionHtml.ps1 +0 -66
- data/vendor/pygments-main/tests/examplefiles/IPDispatchC.nc +0 -104
- data/vendor/pygments-main/tests/examplefiles/IPDispatchP.nc +0 -671
- data/vendor/pygments-main/tests/examplefiles/Intro.java +0 -1660
- data/vendor/pygments-main/tests/examplefiles/Makefile +0 -1131
- data/vendor/pygments-main/tests/examplefiles/Object.st +0 -4394
- data/vendor/pygments-main/tests/examplefiles/OrderedMap.hx +0 -584
- data/vendor/pygments-main/tests/examplefiles/RoleQ.pm6 +0 -23
- data/vendor/pygments-main/tests/examplefiles/SmallCheck.hs +0 -378
- data/vendor/pygments-main/tests/examplefiles/Sorting.mod +0 -470
- data/vendor/pygments-main/tests/examplefiles/Sudoku.lhs +0 -382
- data/vendor/pygments-main/tests/examplefiles/addressbook.proto +0 -30
- data/vendor/pygments-main/tests/examplefiles/antlr_ANTLRv3.g +0 -608
- data/vendor/pygments-main/tests/examplefiles/antlr_throws +0 -1
- data/vendor/pygments-main/tests/examplefiles/apache2.conf +0 -393
- data/vendor/pygments-main/tests/examplefiles/as3_test.as +0 -143
- data/vendor/pygments-main/tests/examplefiles/as3_test2.as +0 -46
- data/vendor/pygments-main/tests/examplefiles/as3_test3.as +0 -3
- data/vendor/pygments-main/tests/examplefiles/aspx-cs_example +0 -27
- data/vendor/pygments-main/tests/examplefiles/autoit_submit.au3 +0 -25
- data/vendor/pygments-main/tests/examplefiles/badcase.java +0 -2
- data/vendor/pygments-main/tests/examplefiles/batchfile.bat +0 -49
- data/vendor/pygments-main/tests/examplefiles/bigtest.nsi +0 -308
- data/vendor/pygments-main/tests/examplefiles/boot-9.scm +0 -1557
- data/vendor/pygments-main/tests/examplefiles/ca65_example +0 -284
- data/vendor/pygments-main/tests/examplefiles/cbmbas_example +0 -9
- data/vendor/pygments-main/tests/examplefiles/cells.ps +0 -515
- data/vendor/pygments-main/tests/examplefiles/ceval.c +0 -2604
- data/vendor/pygments-main/tests/examplefiles/cheetah_example.html +0 -13
- data/vendor/pygments-main/tests/examplefiles/classes.dylan +0 -125
- data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +0 -5
- data/vendor/pygments-main/tests/examplefiles/condensed_ruby.rb +0 -10
- data/vendor/pygments-main/tests/examplefiles/coq_RelationClasses +0 -447
- data/vendor/pygments-main/tests/examplefiles/core.cljs +0 -52
- data/vendor/pygments-main/tests/examplefiles/database.pytb +0 -20
- data/vendor/pygments-main/tests/examplefiles/de.MoinMoin.po +0 -2461
- data/vendor/pygments-main/tests/examplefiles/demo.ahk +0 -181
- data/vendor/pygments-main/tests/examplefiles/demo.cfm +0 -50
- data/vendor/pygments-main/tests/examplefiles/demo.hbs +0 -12
- data/vendor/pygments-main/tests/examplefiles/django_sample.html+django +0 -68
- data/vendor/pygments-main/tests/examplefiles/dwarf.cw +0 -17
- data/vendor/pygments-main/tests/examplefiles/ember.handlebars +0 -33
- data/vendor/pygments-main/tests/examplefiles/erl_session +0 -10
- data/vendor/pygments-main/tests/examplefiles/escape_semicolon.clj +0 -1
- data/vendor/pygments-main/tests/examplefiles/evil_regex.js +0 -48
- data/vendor/pygments-main/tests/examplefiles/example.Rd +0 -78
- data/vendor/pygments-main/tests/examplefiles/example.als +0 -217
- data/vendor/pygments-main/tests/examplefiles/example.bug +0 -54
- data/vendor/pygments-main/tests/examplefiles/example.c +0 -2080
- data/vendor/pygments-main/tests/examplefiles/example.ceylon +0 -52
- data/vendor/pygments-main/tests/examplefiles/example.chai +0 -6
- data/vendor/pygments-main/tests/examplefiles/example.clay +0 -33
- data/vendor/pygments-main/tests/examplefiles/example.cls +0 -15
- data/vendor/pygments-main/tests/examplefiles/example.cob +0 -3556
- data/vendor/pygments-main/tests/examplefiles/example.coffee +0 -27
- data/vendor/pygments-main/tests/examplefiles/example.cpp +0 -2363
- data/vendor/pygments-main/tests/examplefiles/example.e +0 -124
- data/vendor/pygments-main/tests/examplefiles/example.f90 +0 -8
- data/vendor/pygments-main/tests/examplefiles/example.feature +0 -16
- data/vendor/pygments-main/tests/examplefiles/example.gd +0 -23
- data/vendor/pygments-main/tests/examplefiles/example.gi +0 -64
- data/vendor/pygments-main/tests/examplefiles/example.groovy +0 -2
- data/vendor/pygments-main/tests/examplefiles/example.gs +0 -106
- data/vendor/pygments-main/tests/examplefiles/example.gst +0 -7
- data/vendor/pygments-main/tests/examplefiles/example.hs +0 -27
- data/vendor/pygments-main/tests/examplefiles/example.hx +0 -185
- data/vendor/pygments-main/tests/examplefiles/example.i6t +0 -32
- data/vendor/pygments-main/tests/examplefiles/example.i7x +0 -45
- data/vendor/pygments-main/tests/examplefiles/example.inf +0 -374
- data/vendor/pygments-main/tests/examplefiles/example.j +0 -564
- data/vendor/pygments-main/tests/examplefiles/example.jag +0 -48
- data/vendor/pygments-main/tests/examplefiles/example.java +0 -16
- data/vendor/pygments-main/tests/examplefiles/example.kal +0 -75
- data/vendor/pygments-main/tests/examplefiles/example.kt +0 -47
- data/vendor/pygments-main/tests/examplefiles/example.lagda +0 -19
- data/vendor/pygments-main/tests/examplefiles/example.liquid +0 -42
- data/vendor/pygments-main/tests/examplefiles/example.lua +0 -250
- data/vendor/pygments-main/tests/examplefiles/example.ma +0 -8
- data/vendor/pygments-main/tests/examplefiles/example.monkey +0 -152
- data/vendor/pygments-main/tests/examplefiles/example.moo +0 -26
- data/vendor/pygments-main/tests/examplefiles/example.moon +0 -629
- data/vendor/pygments-main/tests/examplefiles/example.mq4 +0 -187
- data/vendor/pygments-main/tests/examplefiles/example.mqh +0 -123
- data/vendor/pygments-main/tests/examplefiles/example.msc +0 -43
- data/vendor/pygments-main/tests/examplefiles/example.ni +0 -57
- data/vendor/pygments-main/tests/examplefiles/example.nim +0 -1010
- data/vendor/pygments-main/tests/examplefiles/example.nix +0 -80
- data/vendor/pygments-main/tests/examplefiles/example.ns2 +0 -69
- data/vendor/pygments-main/tests/examplefiles/example.pas +0 -2708
- data/vendor/pygments-main/tests/examplefiles/example.pp +0 -8
- data/vendor/pygments-main/tests/examplefiles/example.prg +0 -161
- data/vendor/pygments-main/tests/examplefiles/example.rb +0 -1852
- data/vendor/pygments-main/tests/examplefiles/example.red +0 -257
- data/vendor/pygments-main/tests/examplefiles/example.reds +0 -150
- data/vendor/pygments-main/tests/examplefiles/example.reg +0 -19
- data/vendor/pygments-main/tests/examplefiles/example.rexx +0 -50
- data/vendor/pygments-main/tests/examplefiles/example.rhtml +0 -561
- data/vendor/pygments-main/tests/examplefiles/example.rkt +0 -743
- data/vendor/pygments-main/tests/examplefiles/example.rpf +0 -4
- data/vendor/pygments-main/tests/examplefiles/example.sh +0 -22
- data/vendor/pygments-main/tests/examplefiles/example.sh-session +0 -19
- data/vendor/pygments-main/tests/examplefiles/example.shell-session +0 -45
- data/vendor/pygments-main/tests/examplefiles/example.slim +0 -31
- data/vendor/pygments-main/tests/examplefiles/example.sls +0 -51
- data/vendor/pygments-main/tests/examplefiles/example.sml +0 -156
- data/vendor/pygments-main/tests/examplefiles/example.snobol +0 -15
- data/vendor/pygments-main/tests/examplefiles/example.stan +0 -110
- data/vendor/pygments-main/tests/examplefiles/example.tea +0 -34
- data/vendor/pygments-main/tests/examplefiles/example.todotxt +0 -9
- data/vendor/pygments-main/tests/examplefiles/example.ts +0 -28
- data/vendor/pygments-main/tests/examplefiles/example.u +0 -548
- data/vendor/pygments-main/tests/examplefiles/example.weechatlog +0 -9
- data/vendor/pygments-main/tests/examplefiles/example.xhtml +0 -376
- data/vendor/pygments-main/tests/examplefiles/example.xtend +0 -34
- data/vendor/pygments-main/tests/examplefiles/example.yaml +0 -302
- data/vendor/pygments-main/tests/examplefiles/example2.aspx +0 -29
- data/vendor/pygments-main/tests/examplefiles/example2.msc +0 -79
- data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +0 -241
- data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +0 -18
- data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +0 -205
- data/vendor/pygments-main/tests/examplefiles/example_file.fy +0 -128
- data/vendor/pygments-main/tests/examplefiles/firefox.mak +0 -586
- data/vendor/pygments-main/tests/examplefiles/flipflop.sv +0 -19
- data/vendor/pygments-main/tests/examplefiles/foo.sce +0 -6
- data/vendor/pygments-main/tests/examplefiles/format.ml +0 -1213
- data/vendor/pygments-main/tests/examplefiles/fucked_up.rb +0 -77
- data/vendor/pygments-main/tests/examplefiles/function.mu +0 -1
- data/vendor/pygments-main/tests/examplefiles/functional.rst +0 -1472
- data/vendor/pygments-main/tests/examplefiles/garcia-wachs.kk +0 -133
- data/vendor/pygments-main/tests/examplefiles/genclass.clj +0 -510
- data/vendor/pygments-main/tests/examplefiles/genshi_example.xml+genshi +0 -193
- data/vendor/pygments-main/tests/examplefiles/genshitext_example.genshitext +0 -33
- data/vendor/pygments-main/tests/examplefiles/glsl.frag +0 -7
- data/vendor/pygments-main/tests/examplefiles/glsl.vert +0 -13
- data/vendor/pygments-main/tests/examplefiles/grammar-test.p6 +0 -22
- data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +0 -5
- data/vendor/pygments-main/tests/examplefiles/hello.at +0 -6
- data/vendor/pygments-main/tests/examplefiles/hello.golo +0 -5
- data/vendor/pygments-main/tests/examplefiles/hello.lsl +0 -12
- data/vendor/pygments-main/tests/examplefiles/hello.smali +0 -40
- data/vendor/pygments-main/tests/examplefiles/hello.sp +0 -9
- data/vendor/pygments-main/tests/examplefiles/html+php_faulty.php +0 -1
- data/vendor/pygments-main/tests/examplefiles/http_request_example +0 -15
- data/vendor/pygments-main/tests/examplefiles/http_response_example +0 -29
- data/vendor/pygments-main/tests/examplefiles/hybris_File.hy +0 -174
- data/vendor/pygments-main/tests/examplefiles/idl_sample.pro +0 -73
- data/vendor/pygments-main/tests/examplefiles/iex_example +0 -23
- data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +0 -71
- data/vendor/pygments-main/tests/examplefiles/intro.ik +0 -24
- data/vendor/pygments-main/tests/examplefiles/ints.php +0 -10
- data/vendor/pygments-main/tests/examplefiles/intsyn.fun +0 -675
- data/vendor/pygments-main/tests/examplefiles/intsyn.sig +0 -286
- data/vendor/pygments-main/tests/examplefiles/irb_heredoc +0 -8
- data/vendor/pygments-main/tests/examplefiles/irc.lsp +0 -214
- data/vendor/pygments-main/tests/examplefiles/java.properties +0 -16
- data/vendor/pygments-main/tests/examplefiles/jbst_example1.jbst +0 -28
- data/vendor/pygments-main/tests/examplefiles/jbst_example2.jbst +0 -45
- data/vendor/pygments-main/tests/examplefiles/jinjadesignerdoc.rst +0 -713
- data/vendor/pygments-main/tests/examplefiles/json.lasso +0 -301
- data/vendor/pygments-main/tests/examplefiles/json.lasso9 +0 -213
- data/vendor/pygments-main/tests/examplefiles/language.hy +0 -165
- data/vendor/pygments-main/tests/examplefiles/lighttpd_config.conf +0 -13
- data/vendor/pygments-main/tests/examplefiles/limbo.b +0 -456
- data/vendor/pygments-main/tests/examplefiles/linecontinuation.py +0 -47
- data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +0 -43
- data/vendor/pygments-main/tests/examplefiles/logos_example.xm +0 -28
- data/vendor/pygments-main/tests/examplefiles/ltmain.sh +0 -2849
- data/vendor/pygments-main/tests/examplefiles/main.cmake +0 -44
- data/vendor/pygments-main/tests/examplefiles/markdown.lsp +0 -679
- data/vendor/pygments-main/tests/examplefiles/matlab_noreturn +0 -3
- data/vendor/pygments-main/tests/examplefiles/matlab_sample +0 -30
- data/vendor/pygments-main/tests/examplefiles/matlabsession_sample.txt +0 -37
- data/vendor/pygments-main/tests/examplefiles/metagrammar.treetop +0 -455
- data/vendor/pygments-main/tests/examplefiles/minehunt.qml +0 -112
- data/vendor/pygments-main/tests/examplefiles/minimal.ns2 +0 -4
- data/vendor/pygments-main/tests/examplefiles/moin_SyntaxReference.txt +0 -340
- data/vendor/pygments-main/tests/examplefiles/multiline_regexes.rb +0 -38
- data/vendor/pygments-main/tests/examplefiles/nanomsg.intr +0 -95
- data/vendor/pygments-main/tests/examplefiles/nasm_aoutso.asm +0 -96
- data/vendor/pygments-main/tests/examplefiles/nasm_objexe.asm +0 -30
- data/vendor/pygments-main/tests/examplefiles/nemerle_sample.n +0 -87
- data/vendor/pygments-main/tests/examplefiles/nginx_nginx.conf +0 -118
- data/vendor/pygments-main/tests/examplefiles/numbers.c +0 -12
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +0 -179
- data/vendor/pygments-main/tests/examplefiles/openedge_example +0 -34
- data/vendor/pygments-main/tests/examplefiles/pawn_example +0 -25
- data/vendor/pygments-main/tests/examplefiles/perl_misc +0 -62
- data/vendor/pygments-main/tests/examplefiles/perl_perl5db +0 -998
- data/vendor/pygments-main/tests/examplefiles/perl_regex-delims +0 -120
- data/vendor/pygments-main/tests/examplefiles/perlfunc.1 +0 -856
- data/vendor/pygments-main/tests/examplefiles/phpMyAdmin.spec +0 -163
- data/vendor/pygments-main/tests/examplefiles/phpcomplete.vim +0 -567
- data/vendor/pygments-main/tests/examplefiles/pleac.in.rb +0 -1223
- data/vendor/pygments-main/tests/examplefiles/postgresql_test.txt +0 -47
- data/vendor/pygments-main/tests/examplefiles/pppoe.applescript +0 -10
- data/vendor/pygments-main/tests/examplefiles/psql_session.txt +0 -122
- data/vendor/pygments-main/tests/examplefiles/py3_test.txt +0 -2
- data/vendor/pygments-main/tests/examplefiles/py3tb_test.py3tb +0 -4
- data/vendor/pygments-main/tests/examplefiles/pycon_test.pycon +0 -14
- data/vendor/pygments-main/tests/examplefiles/pytb_test2.pytb +0 -2
- data/vendor/pygments-main/tests/examplefiles/pytb_test3.pytb +0 -4
- data/vendor/pygments-main/tests/examplefiles/python25-bsd.mak +0 -234
- data/vendor/pygments-main/tests/examplefiles/qbasic_example +0 -2
- data/vendor/pygments-main/tests/examplefiles/qsort.prolog +0 -13
- data/vendor/pygments-main/tests/examplefiles/r-console-transcript.Rout +0 -38
- data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +0 -23
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_rlscan +0 -280
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_snippet +0 -2
- data/vendor/pygments-main/tests/examplefiles/regex.js +0 -22
- data/vendor/pygments-main/tests/examplefiles/reversi.lsp +0 -427
- data/vendor/pygments-main/tests/examplefiles/robotframework_test.txt +0 -39
- data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +0 -34
- data/vendor/pygments-main/tests/examplefiles/ruby_func_def.rb +0 -11
- data/vendor/pygments-main/tests/examplefiles/rust_example.rs +0 -233
- data/vendor/pygments-main/tests/examplefiles/scilab.sci +0 -30
- data/vendor/pygments-main/tests/examplefiles/scope.cirru +0 -43
- data/vendor/pygments-main/tests/examplefiles/session.dylan-console +0 -9
- data/vendor/pygments-main/tests/examplefiles/sibling.prolog +0 -19
- data/vendor/pygments-main/tests/examplefiles/simple.md +0 -747
- data/vendor/pygments-main/tests/examplefiles/smarty_example.html +0 -209
- data/vendor/pygments-main/tests/examplefiles/source.lgt +0 -343
- data/vendor/pygments-main/tests/examplefiles/sources.list +0 -62
- data/vendor/pygments-main/tests/examplefiles/sparql.rq +0 -23
- data/vendor/pygments-main/tests/examplefiles/sphere.pov +0 -18
- data/vendor/pygments-main/tests/examplefiles/sqlite3.sqlite3-console +0 -27
- data/vendor/pygments-main/tests/examplefiles/squid.conf +0 -30
- data/vendor/pygments-main/tests/examplefiles/string.jl +0 -1031
- data/vendor/pygments-main/tests/examplefiles/string_delimiters.d +0 -21
- data/vendor/pygments-main/tests/examplefiles/stripheredoc.sh +0 -3
- data/vendor/pygments-main/tests/examplefiles/swig_java.swg +0 -1329
- data/vendor/pygments-main/tests/examplefiles/swig_std_vector.i +0 -225
- data/vendor/pygments-main/tests/examplefiles/test.R +0 -185
- data/vendor/pygments-main/tests/examplefiles/test.adb +0 -211
- data/vendor/pygments-main/tests/examplefiles/test.agda +0 -102
- data/vendor/pygments-main/tests/examplefiles/test.apl +0 -26
- data/vendor/pygments-main/tests/examplefiles/test.asy +0 -131
- data/vendor/pygments-main/tests/examplefiles/test.awk +0 -121
- data/vendor/pygments-main/tests/examplefiles/test.bb +0 -95
- data/vendor/pygments-main/tests/examplefiles/test.bmx +0 -145
- data/vendor/pygments-main/tests/examplefiles/test.boo +0 -39
- data/vendor/pygments-main/tests/examplefiles/test.bro +0 -250
- data/vendor/pygments-main/tests/examplefiles/test.cs +0 -374
- data/vendor/pygments-main/tests/examplefiles/test.css +0 -54
- data/vendor/pygments-main/tests/examplefiles/test.cu +0 -36
- data/vendor/pygments-main/tests/examplefiles/test.cyp +0 -123
- data/vendor/pygments-main/tests/examplefiles/test.d +0 -135
- data/vendor/pygments-main/tests/examplefiles/test.dart +0 -23
- data/vendor/pygments-main/tests/examplefiles/test.dtd +0 -89
- data/vendor/pygments-main/tests/examplefiles/test.ebnf +0 -31
- data/vendor/pygments-main/tests/examplefiles/test.ec +0 -605
- data/vendor/pygments-main/tests/examplefiles/test.ecl +0 -58
- data/vendor/pygments-main/tests/examplefiles/test.eh +0 -315
- data/vendor/pygments-main/tests/examplefiles/test.erl +0 -169
- data/vendor/pygments-main/tests/examplefiles/test.evoque +0 -33
- data/vendor/pygments-main/tests/examplefiles/test.fan +0 -818
- data/vendor/pygments-main/tests/examplefiles/test.flx +0 -57
- data/vendor/pygments-main/tests/examplefiles/test.gdc +0 -13
- data/vendor/pygments-main/tests/examplefiles/test.groovy +0 -97
- data/vendor/pygments-main/tests/examplefiles/test.html +0 -339
- data/vendor/pygments-main/tests/examplefiles/test.idr +0 -93
- data/vendor/pygments-main/tests/examplefiles/test.ini +0 -10
- data/vendor/pygments-main/tests/examplefiles/test.java +0 -653
- data/vendor/pygments-main/tests/examplefiles/test.jsp +0 -24
- data/vendor/pygments-main/tests/examplefiles/test.maql +0 -45
- data/vendor/pygments-main/tests/examplefiles/test.mask +0 -41
- data/vendor/pygments-main/tests/examplefiles/test.mod +0 -374
- data/vendor/pygments-main/tests/examplefiles/test.moo +0 -51
- data/vendor/pygments-main/tests/examplefiles/test.myt +0 -166
- data/vendor/pygments-main/tests/examplefiles/test.nim +0 -93
- data/vendor/pygments-main/tests/examplefiles/test.opa +0 -10
- data/vendor/pygments-main/tests/examplefiles/test.p6 +0 -252
- data/vendor/pygments-main/tests/examplefiles/test.pan +0 -54
- data/vendor/pygments-main/tests/examplefiles/test.pas +0 -743
- data/vendor/pygments-main/tests/examplefiles/test.php +0 -507
- data/vendor/pygments-main/tests/examplefiles/test.pig +0 -148
- data/vendor/pygments-main/tests/examplefiles/test.plot +0 -333
- data/vendor/pygments-main/tests/examplefiles/test.ps1 +0 -108
- data/vendor/pygments-main/tests/examplefiles/test.pwn +0 -253
- data/vendor/pygments-main/tests/examplefiles/test.pypylog +0 -1839
- data/vendor/pygments-main/tests/examplefiles/test.r3 +0 -114
- data/vendor/pygments-main/tests/examplefiles/test.rb +0 -177
- data/vendor/pygments-main/tests/examplefiles/test.rhtml +0 -43
- data/vendor/pygments-main/tests/examplefiles/test.rsl +0 -111
- data/vendor/pygments-main/tests/examplefiles/test.scaml +0 -8
- data/vendor/pygments-main/tests/examplefiles/test.ssp +0 -12
- data/vendor/pygments-main/tests/examplefiles/test.swift +0 -65
- data/vendor/pygments-main/tests/examplefiles/test.tcsh +0 -830
- data/vendor/pygments-main/tests/examplefiles/test.vb +0 -407
- data/vendor/pygments-main/tests/examplefiles/test.vhdl +0 -161
- data/vendor/pygments-main/tests/examplefiles/test.xqy +0 -138
- data/vendor/pygments-main/tests/examplefiles/test.xsl +0 -23
- data/vendor/pygments-main/tests/examplefiles/test.zep +0 -33
- data/vendor/pygments-main/tests/examplefiles/test2.pypylog +0 -120
- data/vendor/pygments-main/tests/examplefiles/truncated.pytb +0 -15
- data/vendor/pygments-main/tests/examplefiles/type.lisp +0 -1218
- data/vendor/pygments-main/tests/examplefiles/underscore.coffee +0 -603
- data/vendor/pygments-main/tests/examplefiles/unicode.applescript +0 -5
- data/vendor/pygments-main/tests/examplefiles/unicode.go +0 -10
- data/vendor/pygments-main/tests/examplefiles/unicodedoc.py +0 -11
- data/vendor/pygments-main/tests/examplefiles/unix-io.lid +0 -37
- data/vendor/pygments-main/tests/examplefiles/vbnet_test.bas +0 -29
- data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +0 -4
- data/vendor/pygments-main/tests/examplefiles/vimrc +0 -21
- data/vendor/pygments-main/tests/examplefiles/webkit-transition.css +0 -3
- data/vendor/pygments-main/tests/examplefiles/while.pov +0 -13
- data/vendor/pygments-main/tests/examplefiles/wiki.factor +0 -384
- data/vendor/pygments-main/tests/examplefiles/xml_example +0 -1897
- data/vendor/pygments-main/tests/examplefiles/zmlrpc.f90 +0 -798
- data/vendor/pygments-main/tests/run.py +0 -44
- data/vendor/pygments-main/tests/string_asserts.py +0 -22
- data/vendor/pygments-main/tests/support.py +0 -15
- data/vendor/pygments-main/tests/support/tags +0 -36
- data/vendor/pygments-main/tests/test_basic_api.py +0 -309
- data/vendor/pygments-main/tests/test_cfm.py +0 -46
- data/vendor/pygments-main/tests/test_clexer.py +0 -236
- data/vendor/pygments-main/tests/test_cmdline.py +0 -106
- data/vendor/pygments-main/tests/test_examplefiles.py +0 -110
- data/vendor/pygments-main/tests/test_html_formatter.py +0 -180
- data/vendor/pygments-main/tests/test_latex_formatter.py +0 -57
- data/vendor/pygments-main/tests/test_lexers_other.py +0 -68
- data/vendor/pygments-main/tests/test_objectiveclexer.py +0 -81
- data/vendor/pygments-main/tests/test_perllexer.py +0 -137
- data/vendor/pygments-main/tests/test_qbasiclexer.py +0 -43
- data/vendor/pygments-main/tests/test_regexlexer.py +0 -54
- data/vendor/pygments-main/tests/test_rtf_formatter.py +0 -109
- data/vendor/pygments-main/tests/test_string_asserts.py +0 -39
- data/vendor/pygments-main/tests/test_token.py +0 -46
- data/vendor/pygments-main/tests/test_using_api.py +0 -40
- data/vendor/pygments-main/tests/test_util.py +0 -135
@@ -1,179 +0,0 @@
|
|
1
|
-
// Test various types of includes
|
2
|
-
#import <Foundation/Foundation.h>
|
3
|
-
# import <AppKit/AppKit.h>
|
4
|
-
#import "stdio.h"
|
5
|
-
#\
|
6
|
-
import \
|
7
|
-
"stdlib.h"
|
8
|
-
# /*line1*/ \
|
9
|
-
import /* line 2 */ \
|
10
|
-
"stdlib.h" // line 3
|
11
|
-
|
12
|
-
// Commented out code with preprocessor
|
13
|
-
#if 0
|
14
|
-
#define MY_NUMBER 3
|
15
|
-
#endif
|
16
|
-
|
17
|
-
#\
|
18
|
-
if 1
|
19
|
-
#define TEST_NUMBER 3
|
20
|
-
#endif
|
21
|
-
|
22
|
-
// Empty preprocessor
|
23
|
-
#
|
24
|
-
|
25
|
-
// Class forward declaration
|
26
|
-
@class MyClass;
|
27
|
-
|
28
|
-
// Empty classes
|
29
|
-
@interface EmptyClass
|
30
|
-
@end
|
31
|
-
@interface EmptyClass2
|
32
|
-
{
|
33
|
-
}
|
34
|
-
@end
|
35
|
-
@interface EmptyClass3 : EmptyClass2
|
36
|
-
{
|
37
|
-
}
|
38
|
-
@end
|
39
|
-
|
40
|
-
// Custom class inheriting from built-in
|
41
|
-
@interface MyClass : NSObject
|
42
|
-
{
|
43
|
-
@public
|
44
|
-
NSString *myString;
|
45
|
-
__weak NSString *_weakString;
|
46
|
-
@protected
|
47
|
-
NSTextField *_textField;
|
48
|
-
@private
|
49
|
-
NSDate *privateDate;
|
50
|
-
}
|
51
|
-
|
52
|
-
// Various property aatributes
|
53
|
-
@property(copy, readwrite, nonatomic) NSString *myString;
|
54
|
-
@property(weak) NSString *weakString;
|
55
|
-
@property(retain, strong, atomic) IBOutlet NSTextField *textField;
|
56
|
-
|
57
|
-
// Class methods
|
58
|
-
+ (void)classMethod1:(NSString *)arg;
|
59
|
-
+ (void)classMethod2:(NSString *) arg; // Test space before arg
|
60
|
-
|
61
|
-
@end
|
62
|
-
|
63
|
-
typedef id B;
|
64
|
-
|
65
|
-
#pragma mark MyMarker
|
66
|
-
|
67
|
-
// MyClass.m
|
68
|
-
// Class extension to declare private property
|
69
|
-
@interface MyClass ()
|
70
|
-
@property(retain) NSDate *privateDate;
|
71
|
-
- (void)hiddenMethod;
|
72
|
-
@end
|
73
|
-
|
74
|
-
// Special category
|
75
|
-
@interface MyClass (Special)
|
76
|
-
@property(retain) NSDate *specialDate;
|
77
|
-
@end
|
78
|
-
|
79
|
-
@implementation MyClass
|
80
|
-
@synthesize myString;
|
81
|
-
@synthesize privateDate;
|
82
|
-
|
83
|
-
- (id)a:(B)b {
|
84
|
-
/**
|
85
|
-
* C-style comment
|
86
|
-
*/
|
87
|
-
|
88
|
-
// Selector keywords/types
|
89
|
-
SEL someMethod = @selector(hiddenMethod);
|
90
|
-
|
91
|
-
// Boolean types
|
92
|
-
Boolean b1 = FALSE;
|
93
|
-
BOOL b2 = NO;
|
94
|
-
bool b3 = true;
|
95
|
-
|
96
|
-
/**
|
97
|
-
* Number literals
|
98
|
-
*/
|
99
|
-
// Int Literal
|
100
|
-
NSNumber *n1 = @( 1 );
|
101
|
-
// Method call
|
102
|
-
NSNumber *n2 = @( [b length] );
|
103
|
-
// Define variable
|
104
|
-
NSNumber *n3 = @( TEST_NUMBER );
|
105
|
-
// Arthimetic expression
|
106
|
-
NSNumber *n4 = @(1 + 2);
|
107
|
-
// From variable
|
108
|
-
int myInt = 5;
|
109
|
-
NSNumber *n5 = @(myInt);
|
110
|
-
// Nest expression
|
111
|
-
NSNumber *n6 = @(1 + (2 + 6.0));
|
112
|
-
// Bool literal
|
113
|
-
NSNumber *n7 = @NO;
|
114
|
-
// Bool expression
|
115
|
-
NSNumber *n8 = @(YES);
|
116
|
-
// Character
|
117
|
-
NSNumber *n9 = @'a';
|
118
|
-
// int
|
119
|
-
NSNumber *n10 = @123;
|
120
|
-
// unsigned
|
121
|
-
NSNumber *n11 = @1234U;
|
122
|
-
// long
|
123
|
-
NSNumber *n12 = @1234567890L;
|
124
|
-
// float
|
125
|
-
NSNumber *n13 = @3.14F;
|
126
|
-
// double
|
127
|
-
NSNumber *n14 = @3.14F;
|
128
|
-
|
129
|
-
// Array literals
|
130
|
-
NSArray *arr = @[ @"1", @"2" ];
|
131
|
-
arr = @[ @[ @"1", @"2" ], [arr lastObject] ];
|
132
|
-
[arr lastObject];
|
133
|
-
[@[ @"1", @"2" ] lastObject];
|
134
|
-
|
135
|
-
// Dictionary literals
|
136
|
-
NSDictionary *d = @{ @"key": @"value" };
|
137
|
-
[[d allKeys] lastObject];
|
138
|
-
[[@{ @"key": @"value" } allKeys] lastObject];
|
139
|
-
d = @{ @"key": @{ @"key": @"value" } };
|
140
|
-
|
141
|
-
[self hiddenMethod];
|
142
|
-
[b length];
|
143
|
-
[privateDate class];
|
144
|
-
|
145
|
-
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
|
146
|
-
@"1", @"one", @"2", @"two", @"3", @"three", nil];
|
147
|
-
|
148
|
-
NSString *key;
|
149
|
-
for (key in dictionary) {
|
150
|
-
NSLog(@"Number: %@, Word: %@", key, [dictionary valueForKey:key]);
|
151
|
-
}
|
152
|
-
|
153
|
-
// Blocks
|
154
|
-
int (^myBlock)(int arg1, int arg2);
|
155
|
-
NSString *(^myName)(NSString *) = ^(NSString *value) {
|
156
|
-
return value;
|
157
|
-
};
|
158
|
-
|
159
|
-
return nil;
|
160
|
-
}
|
161
|
-
|
162
|
-
- (void)hiddenMethod {
|
163
|
-
// Synchronized block
|
164
|
-
@synchronized(self) {
|
165
|
-
[myString retain];
|
166
|
-
[myString release];
|
167
|
-
}
|
168
|
-
}
|
169
|
-
|
170
|
-
+ (void)classMethod1:(NSString *)arg {}
|
171
|
-
+ (void)classMethod2:(NSString *) arg
|
172
|
-
{
|
173
|
-
// Autorelease pool block
|
174
|
-
@autoreleasepool {
|
175
|
-
NSLog(@"Hello, World!");
|
176
|
-
}
|
177
|
-
}
|
178
|
-
|
179
|
-
@end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
{include.i}
|
2
|
-
{nested.i {include.i}}
|
3
|
-
|
4
|
-
&SCOPED-DEFINE MY_NAME "Abe"
|
5
|
-
|
6
|
-
DEF VAR i AS INT NO-UNDO.
|
7
|
-
i = 0xABE + 1337 / (1 * 1.00)
|
8
|
-
|
9
|
-
def var clowercasetest as char no-undo.
|
10
|
-
DEF VAR vardashtest AS DATETIME-TZ NO-UNDO.
|
11
|
-
|
12
|
-
DEFINE TEMP-TABLE ttNames NO-UNDO
|
13
|
-
FIELD cName AS CHAR
|
14
|
-
INDEX IXPK_ttNames IS PRIMARY UNIQUE cName.
|
15
|
-
|
16
|
-
/* One-line comment */
|
17
|
-
/* Two-line
|
18
|
-
Comment */
|
19
|
-
/*
|
20
|
-
Nested
|
21
|
-
/*
|
22
|
-
Multiline
|
23
|
-
/*
|
24
|
-
Comment
|
25
|
-
*/
|
26
|
-
*/
|
27
|
-
*/
|
28
|
-
|
29
|
-
CREATE ttNames.
|
30
|
-
ASSIGN ttNames.cName = {&MY_NAME}.
|
31
|
-
|
32
|
-
FOR EACH ttNames:
|
33
|
-
MESSAGE "Hello, " + ttNames.cName + '!' VIEW-AS ALERT-BOX.
|
34
|
-
END.
|
@@ -1,25 +0,0 @@
|
|
1
|
-
{include.i}
|
2
|
-
{nested.i {include.i}}
|
3
|
-
|
4
|
-
&SCOPED-DEFINE MY_NAME "Abe"
|
5
|
-
|
6
|
-
DEF VAR i AS INT NO-UNDO.
|
7
|
-
i = 0xABE + 1337 / (1 * 1.00)
|
8
|
-
|
9
|
-
def var clowercasetest as char no-undo.
|
10
|
-
DEF VAR vardashtest AS DATETIME-TZ NO-UNDO.
|
11
|
-
|
12
|
-
DEFINE TEMP-TABLE ttNames NO-UNDO
|
13
|
-
FIELD cName AS CHAR
|
14
|
-
INDEX IXPK_ttNames IS PRIMARY UNIQUE cName.
|
15
|
-
|
16
|
-
/* One-line comment */
|
17
|
-
/* Two-line
|
18
|
-
Comment */
|
19
|
-
|
20
|
-
CREATE ttNames.
|
21
|
-
ASSIGN ttNames.cName = {&MY_NAME}.
|
22
|
-
|
23
|
-
FOR EACH ttNames:
|
24
|
-
MESSAGE "Hello, " + ttNames.cName + '!' VIEW-AS ALERT-BOX.
|
25
|
-
END.
|
@@ -1,62 +0,0 @@
|
|
1
|
-
#!/usr/bin/perl
|
2
|
-
|
3
|
-
# from http://gist.github.com/485595
|
4
|
-
use strict;
|
5
|
-
use warnings;
|
6
|
-
use Time::HiRes 'usleep';
|
7
|
-
|
8
|
-
for (1..5) {
|
9
|
-
open my $in, '<', '/proc/sys/kernel/random/entropy_avail' or die;
|
10
|
-
print <$in>;
|
11
|
-
close $in;
|
12
|
-
usleep 100_000;
|
13
|
-
}
|
14
|
-
|
15
|
-
# other miscellaneous tests of numbers separated by _
|
16
|
-
#usleep 100_000;
|
17
|
-
100_000_000;
|
18
|
-
my $nichts = 0.005_006;
|
19
|
-
print "$nichts\n";
|
20
|
-
my $nichts2 = 0.005_006_007;
|
21
|
-
print 900_800_700.005_006_007, $/;
|
22
|
-
|
23
|
-
# numbers from `man 1 perlnumber`
|
24
|
-
my $n;
|
25
|
-
$n = 1234; # decimal integer
|
26
|
-
$n = 0b1110011; # binary integer
|
27
|
-
$n = 01234; # octal integer
|
28
|
-
$n = 0x1234; # hexadecimal integer
|
29
|
-
$n = 12.34e-56; # exponential notation
|
30
|
-
$n = "-12.34e56"; # number specified as a string
|
31
|
-
$n = "1234"; # number specified as a string
|
32
|
-
|
33
|
-
# other numbers
|
34
|
-
for (
|
35
|
-
-9876,
|
36
|
-
+8765,
|
37
|
-
-9876.02,
|
38
|
-
-9876.02e+10,
|
39
|
-
+765_432e30,
|
40
|
-
2002.,
|
41
|
-
.2002,
|
42
|
-
) {
|
43
|
-
print $_, "\n";
|
44
|
-
}
|
45
|
-
|
46
|
-
# operators on numbers
|
47
|
-
for (
|
48
|
-
$n + 300,
|
49
|
-
$n - 300,
|
50
|
-
$n / 300 + 10,
|
51
|
-
$n * 250 / 2.0,
|
52
|
-
$n == 100,
|
53
|
-
$n != 100,
|
54
|
-
$n > 100,
|
55
|
-
$n >= 100,
|
56
|
-
$n < 100,
|
57
|
-
$n <= 100,
|
58
|
-
$n % 2,
|
59
|
-
abs $n,
|
60
|
-
) {
|
61
|
-
print $_, "\n";
|
62
|
-
}
|
@@ -1,998 +0,0 @@
|
|
1
|
-
|
2
|
-
=head1 NAME
|
3
|
-
|
4
|
-
perl5db.pl - the perl debugger
|
5
|
-
|
6
|
-
=head1 SYNOPSIS
|
7
|
-
|
8
|
-
perl -d your_Perl_script
|
9
|
-
|
10
|
-
=head1 DESCRIPTION
|
11
|
-
|
12
|
-
After this routine is over, we don't have user code executing in the debugger's
|
13
|
-
context, so we can use C<my> freely.
|
14
|
-
|
15
|
-
=cut
|
16
|
-
|
17
|
-
############################################## Begin lexical danger zone
|
18
|
-
|
19
|
-
# 'my' variables used here could leak into (that is, be visible in)
|
20
|
-
# the context that the code being evaluated is executing in. This means that
|
21
|
-
# the code could modify the debugger's variables.
|
22
|
-
#
|
23
|
-
# Fiddling with the debugger's context could be Bad. We insulate things as
|
24
|
-
# much as we can.
|
25
|
-
|
26
|
-
sub eval {
|
27
|
-
|
28
|
-
# 'my' would make it visible from user code
|
29
|
-
# but so does local! --tchrist
|
30
|
-
# Remember: this localizes @DB::res, not @main::res.
|
31
|
-
local @res;
|
32
|
-
{
|
33
|
-
|
34
|
-
# Try to keep the user code from messing with us. Save these so that
|
35
|
-
# even if the eval'ed code changes them, we can put them back again.
|
36
|
-
# Needed because the user could refer directly to the debugger's
|
37
|
-
# package globals (and any 'my' variables in this containing scope)
|
38
|
-
# inside the eval(), and we want to try to stay safe.
|
39
|
-
local $otrace = $trace;
|
40
|
-
local $osingle = $single;
|
41
|
-
local $od = $^D;
|
42
|
-
|
43
|
-
# Untaint the incoming eval() argument.
|
44
|
-
{ ($evalarg) = $evalarg =~ /(.*)/s; }
|
45
|
-
|
46
|
-
# $usercontext built in DB::DB near the comment
|
47
|
-
# "set up the context for DB::eval ..."
|
48
|
-
# Evaluate and save any results.
|
49
|
-
@res = eval "$usercontext $evalarg;\n"; # '\n' for nice recursive debug
|
50
|
-
|
51
|
-
# Restore those old values.
|
52
|
-
$trace = $otrace;
|
53
|
-
$single = $osingle;
|
54
|
-
$^D = $od;
|
55
|
-
}
|
56
|
-
|
57
|
-
# Save the current value of $@, and preserve it in the debugger's copy
|
58
|
-
# of the saved precious globals.
|
59
|
-
my $at = $@;
|
60
|
-
|
61
|
-
# Since we're only saving $@, we only have to localize the array element
|
62
|
-
# that it will be stored in.
|
63
|
-
local $saved[0]; # Preserve the old value of $@
|
64
|
-
eval { &DB::save };
|
65
|
-
|
66
|
-
# Now see whether we need to report an error back to the user.
|
67
|
-
if ($at) {
|
68
|
-
local $\ = '';
|
69
|
-
print $OUT $at;
|
70
|
-
}
|
71
|
-
|
72
|
-
# Display as required by the caller. $onetimeDump and $onetimedumpDepth
|
73
|
-
# are package globals.
|
74
|
-
elsif ($onetimeDump) {
|
75
|
-
if ( $onetimeDump eq 'dump' ) {
|
76
|
-
local $option{dumpDepth} = $onetimedumpDepth
|
77
|
-
if defined $onetimedumpDepth;
|
78
|
-
dumpit( $OUT, \@res );
|
79
|
-
}
|
80
|
-
elsif ( $onetimeDump eq 'methods' ) {
|
81
|
-
methods( $res[0] );
|
82
|
-
}
|
83
|
-
} ## end elsif ($onetimeDump)
|
84
|
-
@res;
|
85
|
-
} ## end sub eval
|
86
|
-
|
87
|
-
############################################## End lexical danger zone
|
88
|
-
|
89
|
-
# After this point it is safe to introduce lexicals.
|
90
|
-
# The code being debugged will be executing in its own context, and
|
91
|
-
# can't see the inside of the debugger.
|
92
|
-
#
|
93
|
-
# However, one should not overdo it: leave as much control from outside as
|
94
|
-
# possible. If you make something a lexical, it's not going to be addressable
|
95
|
-
# from outside the debugger even if you know its name.
|
96
|
-
|
97
|
-
# This file is automatically included if you do perl -d.
|
98
|
-
# It's probably not useful to include this yourself.
|
99
|
-
#
|
100
|
-
# Before venturing further into these twisty passages, it is
|
101
|
-
# wise to read the perldebguts man page or risk the ire of dragons.
|
102
|
-
#
|
103
|
-
# (It should be noted that perldebguts will tell you a lot about
|
104
|
-
# the underlying mechanics of how the debugger interfaces into the
|
105
|
-
# Perl interpreter, but not a lot about the debugger itself. The new
|
106
|
-
# comments in this code try to address this problem.)
|
107
|
-
|
108
|
-
# Note that no subroutine call is possible until &DB::sub is defined
|
109
|
-
# (for subroutines defined outside of the package DB). In fact the same is
|
110
|
-
# true if $deep is not defined.
|
111
|
-
|
112
|
-
# Enhanced by ilya@math.ohio-state.edu (Ilya Zakharevich)
|
113
|
-
|
114
|
-
# modified Perl debugger, to be run from Emacs in perldb-mode
|
115
|
-
# Ray Lischner (uunet!mntgfx!lisch) as of 5 Nov 1990
|
116
|
-
# Johan Vromans -- upgrade to 4.0 pl 10
|
117
|
-
# Ilya Zakharevich -- patches after 5.001 (and some before ;-)
|
118
|
-
|
119
|
-
# (We have made efforts to clarify the comments in the change log
|
120
|
-
# in other places; some of them may seem somewhat obscure as they
|
121
|
-
# were originally written, and explaining them away from the code
|
122
|
-
# in question seems conterproductive.. -JM)
|
123
|
-
|
124
|
-
=head1 DEBUGGER INITIALIZATION
|
125
|
-
|
126
|
-
The debugger starts up in phases.
|
127
|
-
|
128
|
-
=head2 BASIC SETUP
|
129
|
-
|
130
|
-
First, it initializes the environment it wants to run in: turning off
|
131
|
-
warnings during its own compilation, defining variables which it will need
|
132
|
-
to avoid warnings later, setting itself up to not exit when the program
|
133
|
-
terminates, and defaulting to printing return values for the C<r> command.
|
134
|
-
|
135
|
-
=cut
|
136
|
-
|
137
|
-
# Needed for the statement after exec():
|
138
|
-
#
|
139
|
-
# This BEGIN block is simply used to switch off warnings during debugger
|
140
|
-
# compiliation. Probably it would be better practice to fix the warnings,
|
141
|
-
# but this is how it's done at the moment.
|
142
|
-
|
143
|
-
BEGIN {
|
144
|
-
$ini_warn = $^W;
|
145
|
-
$^W = 0;
|
146
|
-
} # Switch compilation warnings off until another BEGIN.
|
147
|
-
|
148
|
-
# test if assertions are supported and actived:
|
149
|
-
BEGIN {
|
150
|
-
$ini_assertion = eval "sub asserting_test : assertion {1}; 1";
|
151
|
-
|
152
|
-
# $ini_assertion = undef => assertions unsupported,
|
153
|
-
# " = 1 => assertions supported
|
154
|
-
# print "\$ini_assertion=$ini_assertion\n";
|
155
|
-
}
|
156
|
-
|
157
|
-
local ($^W) = 0; # Switch run-time warnings off during init.
|
158
|
-
|
159
|
-
=head2 THREADS SUPPORT
|
160
|
-
|
161
|
-
If we are running under a threaded Perl, we require threads and threads::shared
|
162
|
-
if the environment variable C<PERL5DB_THREADED> is set, to enable proper
|
163
|
-
threaded debugger control. C<-dt> can also be used to set this.
|
164
|
-
|
165
|
-
Each new thread will be announced and the debugger prompt will always inform
|
166
|
-
you of each new thread created. It will also indicate the thread id in which
|
167
|
-
we are currently running within the prompt like this:
|
168
|
-
|
169
|
-
[tid] DB<$i>
|
170
|
-
|
171
|
-
Where C<[tid]> is an integer thread id and C<$i> is the familiar debugger
|
172
|
-
command prompt. The prompt will show: C<[0]> when running under threads, but
|
173
|
-
not actually in a thread. C<[tid]> is consistent with C<gdb> usage.
|
174
|
-
|
175
|
-
While running under threads, when you set or delete a breakpoint (etc.), this
|
176
|
-
will apply to all threads, not just the currently running one. When you are
|
177
|
-
in a currently executing thread, you will stay there until it completes. With
|
178
|
-
the current implementation it is not currently possible to hop from one thread
|
179
|
-
to another.
|
180
|
-
|
181
|
-
The C<e> and C<E> commands are currently fairly minimal - see C<h e> and C<h E>.
|
182
|
-
|
183
|
-
Note that threading support was built into the debugger as of Perl version
|
184
|
-
C<5.8.6> and debugger version C<1.2.8>.
|
185
|
-
|
186
|
-
=cut
|
187
|
-
|
188
|
-
BEGIN {
|
189
|
-
# ensure we can share our non-threaded variables or no-op
|
190
|
-
if ($ENV{PERL5DB_THREADED}) {
|
191
|
-
require threads;
|
192
|
-
require threads::shared;
|
193
|
-
import threads::shared qw(share);
|
194
|
-
$DBGR;
|
195
|
-
share(\$DBGR);
|
196
|
-
lock($DBGR);
|
197
|
-
print "Threads support enabled\n";
|
198
|
-
} else {
|
199
|
-
*lock = sub(*) {};
|
200
|
-
*share = sub(*) {};
|
201
|
-
}
|
202
|
-
}
|
203
|
-
|
204
|
-
# This would probably be better done with "use vars", but that wasn't around
|
205
|
-
# when this code was originally written. (Neither was "use strict".) And on
|
206
|
-
# the principle of not fiddling with something that was working, this was
|
207
|
-
# left alone.
|
208
|
-
warn( # Do not ;-)
|
209
|
-
# These variables control the execution of 'dumpvar.pl'.
|
210
|
-
$dumpvar::hashDepth,
|
211
|
-
$dumpvar::arrayDepth,
|
212
|
-
$dumpvar::dumpDBFiles,
|
213
|
-
$dumpvar::dumpPackages,
|
214
|
-
$dumpvar::quoteHighBit,
|
215
|
-
$dumpvar::printUndef,
|
216
|
-
$dumpvar::globPrint,
|
217
|
-
$dumpvar::usageOnly,
|
218
|
-
|
219
|
-
# used to save @ARGV and extract any debugger-related flags.
|
220
|
-
@ARGS,
|
221
|
-
|
222
|
-
# used to control die() reporting in diesignal()
|
223
|
-
$Carp::CarpLevel,
|
224
|
-
|
225
|
-
# used to prevent multiple entries to diesignal()
|
226
|
-
# (if for instance diesignal() itself dies)
|
227
|
-
$panic,
|
228
|
-
|
229
|
-
# used to prevent the debugger from running nonstop
|
230
|
-
# after a restart
|
231
|
-
$second_time,
|
232
|
-
)
|
233
|
-
if 0;
|
234
|
-
|
235
|
-
foreach my $k (keys (%INC)) {
|
236
|
-
&share(\$main::{'_<'.$filename});
|
237
|
-
};
|
238
|
-
|
239
|
-
# Command-line + PERLLIB:
|
240
|
-
# Save the contents of @INC before they are modified elsewhere.
|
241
|
-
@ini_INC = @INC;
|
242
|
-
|
243
|
-
# This was an attempt to clear out the previous values of various
|
244
|
-
# trapped errors. Apparently it didn't help. XXX More info needed!
|
245
|
-
# $prevwarn = $prevdie = $prevbus = $prevsegv = ''; # Does not help?!
|
246
|
-
|
247
|
-
# We set these variables to safe values. We don't want to blindly turn
|
248
|
-
# off warnings, because other packages may still want them.
|
249
|
-
$trace = $signal = $single = 0; # Uninitialized warning suppression
|
250
|
-
# (local $^W cannot help - other packages!).
|
251
|
-
|
252
|
-
# Default to not exiting when program finishes; print the return
|
253
|
-
# value when the 'r' command is used to return from a subroutine.
|
254
|
-
$inhibit_exit = $option{PrintRet} = 1;
|
255
|
-
|
256
|
-
=head1 OPTION PROCESSING
|
257
|
-
|
258
|
-
The debugger's options are actually spread out over the debugger itself and
|
259
|
-
C<dumpvar.pl>; some of these are variables to be set, while others are
|
260
|
-
subs to be called with a value. To try to make this a little easier to
|
261
|
-
manage, the debugger uses a few data structures to define what options
|
262
|
-
are legal and how they are to be processed.
|
263
|
-
|
264
|
-
First, the C<@options> array defines the I<names> of all the options that
|
265
|
-
are to be accepted.
|
266
|
-
|
267
|
-
=cut
|
268
|
-
|
269
|
-
@options = qw(
|
270
|
-
CommandSet
|
271
|
-
hashDepth arrayDepth dumpDepth
|
272
|
-
DumpDBFiles DumpPackages DumpReused
|
273
|
-
compactDump veryCompact quote
|
274
|
-
HighBit undefPrint globPrint
|
275
|
-
PrintRet UsageOnly frame
|
276
|
-
AutoTrace TTY noTTY
|
277
|
-
ReadLine NonStop LineInfo
|
278
|
-
maxTraceLen recallCommand ShellBang
|
279
|
-
pager tkRunning ornaments
|
280
|
-
signalLevel warnLevel dieLevel
|
281
|
-
inhibit_exit ImmediateStop bareStringify
|
282
|
-
CreateTTY RemotePort windowSize
|
283
|
-
DollarCaretP OnlyAssertions WarnAssertions
|
284
|
-
);
|
285
|
-
|
286
|
-
@RememberOnROptions = qw(DollarCaretP OnlyAssertions);
|
287
|
-
|
288
|
-
=pod
|
289
|
-
|
290
|
-
Second, C<optionVars> lists the variables that each option uses to save its
|
291
|
-
state.
|
292
|
-
|
293
|
-
=cut
|
294
|
-
|
295
|
-
%optionVars = (
|
296
|
-
hashDepth => \$dumpvar::hashDepth,
|
297
|
-
arrayDepth => \$dumpvar::arrayDepth,
|
298
|
-
CommandSet => \$CommandSet,
|
299
|
-
DumpDBFiles => \$dumpvar::dumpDBFiles,
|
300
|
-
DumpPackages => \$dumpvar::dumpPackages,
|
301
|
-
DumpReused => \$dumpvar::dumpReused,
|
302
|
-
HighBit => \$dumpvar::quoteHighBit,
|
303
|
-
undefPrint => \$dumpvar::printUndef,
|
304
|
-
globPrint => \$dumpvar::globPrint,
|
305
|
-
UsageOnly => \$dumpvar::usageOnly,
|
306
|
-
CreateTTY => \$CreateTTY,
|
307
|
-
bareStringify => \$dumpvar::bareStringify,
|
308
|
-
frame => \$frame,
|
309
|
-
AutoTrace => \$trace,
|
310
|
-
inhibit_exit => \$inhibit_exit,
|
311
|
-
maxTraceLen => \$maxtrace,
|
312
|
-
ImmediateStop => \$ImmediateStop,
|
313
|
-
RemotePort => \$remoteport,
|
314
|
-
windowSize => \$window,
|
315
|
-
WarnAssertions => \$warnassertions,
|
316
|
-
);
|
317
|
-
|
318
|
-
=pod
|
319
|
-
|
320
|
-
Third, C<%optionAction> defines the subroutine to be called to process each
|
321
|
-
option.
|
322
|
-
|
323
|
-
=cut
|
324
|
-
|
325
|
-
%optionAction = (
|
326
|
-
compactDump => \&dumpvar::compactDump,
|
327
|
-
veryCompact => \&dumpvar::veryCompact,
|
328
|
-
quote => \&dumpvar::quote,
|
329
|
-
TTY => \&TTY,
|
330
|
-
noTTY => \&noTTY,
|
331
|
-
ReadLine => \&ReadLine,
|
332
|
-
NonStop => \&NonStop,
|
333
|
-
LineInfo => \&LineInfo,
|
334
|
-
recallCommand => \&recallCommand,
|
335
|
-
ShellBang => \&shellBang,
|
336
|
-
pager => \&pager,
|
337
|
-
signalLevel => \&signalLevel,
|
338
|
-
warnLevel => \&warnLevel,
|
339
|
-
dieLevel => \&dieLevel,
|
340
|
-
tkRunning => \&tkRunning,
|
341
|
-
ornaments => \&ornaments,
|
342
|
-
RemotePort => \&RemotePort,
|
343
|
-
DollarCaretP => \&DollarCaretP,
|
344
|
-
OnlyAssertions=> \&OnlyAssertions,
|
345
|
-
);
|
346
|
-
|
347
|
-
=pod
|
348
|
-
|
349
|
-
Last, the C<%optionRequire> notes modules that must be C<require>d if an
|
350
|
-
option is used.
|
351
|
-
|
352
|
-
=cut
|
353
|
-
|
354
|
-
# Note that this list is not complete: several options not listed here
|
355
|
-
# actually require that dumpvar.pl be loaded for them to work, but are
|
356
|
-
# not in the table. A subsequent patch will correct this problem; for
|
357
|
-
# the moment, we're just recommenting, and we are NOT going to change
|
358
|
-
# function.
|
359
|
-
%optionRequire = (
|
360
|
-
compactDump => 'dumpvar.pl',
|
361
|
-
veryCompact => 'dumpvar.pl',
|
362
|
-
quote => 'dumpvar.pl',
|
363
|
-
);
|
364
|
-
|
365
|
-
=pod
|
366
|
-
|
367
|
-
There are a number of initialization-related variables which can be set
|
368
|
-
by putting code to set them in a BEGIN block in the C<PERL5DB> environment
|
369
|
-
variable. These are:
|
370
|
-
|
371
|
-
=over 4
|
372
|
-
|
373
|
-
=item C<$rl> - readline control XXX needs more explanation
|
374
|
-
|
375
|
-
=item C<$warnLevel> - whether or not debugger takes over warning handling
|
376
|
-
|
377
|
-
=item C<$dieLevel> - whether or not debugger takes over die handling
|
378
|
-
|
379
|
-
=item C<$signalLevel> - whether or not debugger takes over signal handling
|
380
|
-
|
381
|
-
=item C<$pre> - preprompt actions (array reference)
|
382
|
-
|
383
|
-
=item C<$post> - postprompt actions (array reference)
|
384
|
-
|
385
|
-
=item C<$pretype>
|
386
|
-
|
387
|
-
=item C<$CreateTTY> - whether or not to create a new TTY for this debugger
|
388
|
-
|
389
|
-
=item C<$CommandSet> - which command set to use (defaults to new, documented set)
|
390
|
-
|
391
|
-
=back
|
392
|
-
|
393
|
-
=cut
|
394
|
-
|
395
|
-
# These guys may be defined in $ENV{PERL5DB} :
|
396
|
-
$rl = 1 unless defined $rl;
|
397
|
-
$warnLevel = 1 unless defined $warnLevel;
|
398
|
-
$dieLevel = 1 unless defined $dieLevel;
|
399
|
-
$signalLevel = 1 unless defined $signalLevel;
|
400
|
-
$pre = [] unless defined $pre;
|
401
|
-
$post = [] unless defined $post;
|
402
|
-
$pretype = [] unless defined $pretype;
|
403
|
-
$CreateTTY = 3 unless defined $CreateTTY;
|
404
|
-
$CommandSet = '580' unless defined $CommandSet;
|
405
|
-
|
406
|
-
share($rl);
|
407
|
-
share($warnLevel);
|
408
|
-
share($dieLevel);
|
409
|
-
share($signalLevel);
|
410
|
-
share($pre);
|
411
|
-
share($post);
|
412
|
-
share($pretype);
|
413
|
-
share($rl);
|
414
|
-
share($CreateTTY);
|
415
|
-
share($CommandSet);
|
416
|
-
|
417
|
-
=pod
|
418
|
-
|
419
|
-
The default C<die>, C<warn>, and C<signal> handlers are set up.
|
420
|
-
|
421
|
-
=cut
|
422
|
-
|
423
|
-
warnLevel($warnLevel);
|
424
|
-
dieLevel($dieLevel);
|
425
|
-
signalLevel($signalLevel);
|
426
|
-
|
427
|
-
=pod
|
428
|
-
|
429
|
-
The pager to be used is needed next. We try to get it from the
|
430
|
-
environment first. if it's not defined there, we try to find it in
|
431
|
-
the Perl C<Config.pm>. If it's not there, we default to C<more>. We
|
432
|
-
then call the C<pager()> function to save the pager name.
|
433
|
-
|
434
|
-
=cut
|
435
|
-
|
436
|
-
# This routine makes sure $pager is set up so that '|' can use it.
|
437
|
-
pager(
|
438
|
-
|
439
|
-
# If PAGER is defined in the environment, use it.
|
440
|
-
defined $ENV{PAGER}
|
441
|
-
? $ENV{PAGER}
|
442
|
-
|
443
|
-
# If not, see if Config.pm defines it.
|
444
|
-
: eval { require Config }
|
445
|
-
&& defined $Config::Config{pager}
|
446
|
-
? $Config::Config{pager}
|
447
|
-
|
448
|
-
# If not, fall back to 'more'.
|
449
|
-
: 'more'
|
450
|
-
)
|
451
|
-
unless defined $pager;
|
452
|
-
|
453
|
-
=pod
|
454
|
-
|
455
|
-
We set up the command to be used to access the man pages, the command
|
456
|
-
recall character (C<!> unless otherwise defined) and the shell escape
|
457
|
-
character (C<!> unless otherwise defined). Yes, these do conflict, and
|
458
|
-
neither works in the debugger at the moment.
|
459
|
-
|
460
|
-
=cut
|
461
|
-
|
462
|
-
setman();
|
463
|
-
|
464
|
-
# Set up defaults for command recall and shell escape (note:
|
465
|
-
# these currently don't work in linemode debugging).
|
466
|
-
&recallCommand("!") unless defined $prc;
|
467
|
-
&shellBang("!") unless defined $psh;
|
468
|
-
|
469
|
-
=pod
|
470
|
-
|
471
|
-
We then set up the gigantic string containing the debugger help.
|
472
|
-
We also set the limit on the number of arguments we'll display during a
|
473
|
-
trace.
|
474
|
-
|
475
|
-
=cut
|
476
|
-
|
477
|
-
sethelp();
|
478
|
-
|
479
|
-
# If we didn't get a default for the length of eval/stack trace args,
|
480
|
-
# set it here.
|
481
|
-
$maxtrace = 400 unless defined $maxtrace;
|
482
|
-
|
483
|
-
=head2 SETTING UP THE DEBUGGER GREETING
|
484
|
-
|
485
|
-
The debugger I<greeting> helps to inform the user how many debuggers are
|
486
|
-
running, and whether the current debugger is the primary or a child.
|
487
|
-
|
488
|
-
If we are the primary, we just hang onto our pid so we'll have it when
|
489
|
-
or if we start a child debugger. If we are a child, we'll set things up
|
490
|
-
so we'll have a unique greeting and so the parent will give us our own
|
491
|
-
TTY later.
|
492
|
-
|
493
|
-
We save the current contents of the C<PERLDB_PIDS> environment variable
|
494
|
-
because we mess around with it. We'll also need to hang onto it because
|
495
|
-
we'll need it if we restart.
|
496
|
-
|
497
|
-
Child debuggers make a label out of the current PID structure recorded in
|
498
|
-
PERLDB_PIDS plus the new PID. They also mark themselves as not having a TTY
|
499
|
-
yet so the parent will give them one later via C<resetterm()>.
|
500
|
-
|
501
|
-
=cut
|
502
|
-
|
503
|
-
# Save the current contents of the environment; we're about to
|
504
|
-
# much with it. We'll need this if we have to restart.
|
505
|
-
$ini_pids = $ENV{PERLDB_PIDS};
|
506
|
-
|
507
|
-
if ( defined $ENV{PERLDB_PIDS} ) {
|
508
|
-
|
509
|
-
# We're a child. Make us a label out of the current PID structure
|
510
|
-
# recorded in PERLDB_PIDS plus our (new) PID. Mark us as not having
|
511
|
-
# a term yet so the parent will give us one later via resetterm().
|
512
|
-
$pids = "[$ENV{PERLDB_PIDS}]";
|
513
|
-
$ENV{PERLDB_PIDS} .= "->$$";
|
514
|
-
$term_pid = -1;
|
515
|
-
} ## end if (defined $ENV{PERLDB_PIDS...
|
516
|
-
else {
|
517
|
-
|
518
|
-
# We're the parent PID. Initialize PERLDB_PID in case we end up with a
|
519
|
-
# child debugger, and mark us as the parent, so we'll know to set up
|
520
|
-
# more TTY's is we have to.
|
521
|
-
$ENV{PERLDB_PIDS} = "$$";
|
522
|
-
$pids = "{pid=$$}";
|
523
|
-
$term_pid = $$;
|
524
|
-
}
|
525
|
-
|
526
|
-
$pidprompt = '';
|
527
|
-
|
528
|
-
# Sets up $emacs as a synonym for $slave_editor.
|
529
|
-
*emacs = $slave_editor if $slave_editor; # May be used in afterinit()...
|
530
|
-
|
531
|
-
=head2 READING THE RC FILE
|
532
|
-
|
533
|
-
The debugger will read a file of initialization options if supplied. If
|
534
|
-
running interactively, this is C<.perldb>; if not, it's C<perldb.ini>.
|
535
|
-
|
536
|
-
=cut
|
537
|
-
|
538
|
-
# As noted, this test really doesn't check accurately that the debugger
|
539
|
-
# is running at a terminal or not.
|
540
|
-
|
541
|
-
if ( -e "/dev/tty" ) { # this is the wrong metric!
|
542
|
-
$rcfile = ".perldb";
|
543
|
-
}
|
544
|
-
else {
|
545
|
-
$rcfile = "perldb.ini";
|
546
|
-
}
|
547
|
-
|
548
|
-
=pod
|
549
|
-
|
550
|
-
The debugger does a safety test of the file to be read. It must be owned
|
551
|
-
either by the current user or root, and must only be writable by the owner.
|
552
|
-
|
553
|
-
=cut
|
554
|
-
|
555
|
-
# This wraps a safety test around "do" to read and evaluate the init file.
|
556
|
-
#
|
557
|
-
# This isn't really safe, because there's a race
|
558
|
-
# between checking and opening. The solution is to
|
559
|
-
# open and fstat the handle, but then you have to read and
|
560
|
-
# eval the contents. But then the silly thing gets
|
561
|
-
# your lexical scope, which is unfortunate at best.
|
562
|
-
sub safe_do {
|
563
|
-
my $file = shift;
|
564
|
-
|
565
|
-
# Just exactly what part of the word "CORE::" don't you understand?
|
566
|
-
local $SIG{__WARN__};
|
567
|
-
local $SIG{__DIE__};
|
568
|
-
|
569
|
-
unless ( is_safe_file($file) ) {
|
570
|
-
CORE::warn <<EO_GRIPE;
|
571
|
-
perldb: Must not source insecure rcfile $file.
|
572
|
-
You or the superuser must be the owner, and it must not
|
573
|
-
be writable by anyone but its owner.
|
574
|
-
EO_GRIPE
|
575
|
-
return;
|
576
|
-
} ## end unless (is_safe_file($file...
|
577
|
-
|
578
|
-
do $file;
|
579
|
-
CORE::warn("perldb: couldn't parse $file: $@") if $@;
|
580
|
-
} ## end sub safe_do
|
581
|
-
|
582
|
-
# This is the safety test itself.
|
583
|
-
#
|
584
|
-
# Verifies that owner is either real user or superuser and that no
|
585
|
-
# one but owner may write to it. This function is of limited use
|
586
|
-
# when called on a path instead of upon a handle, because there are
|
587
|
-
# no guarantees that filename (by dirent) whose file (by ino) is
|
588
|
-
# eventually accessed is the same as the one tested.
|
589
|
-
# Assumes that the file's existence is not in doubt.
|
590
|
-
sub is_safe_file {
|
591
|
-
my $path = shift;
|
592
|
-
stat($path) || return; # mysteriously vaporized
|
593
|
-
my ( $dev, $ino, $mode, $nlink, $uid, $gid ) = stat(_);
|
594
|
-
|
595
|
-
return 0 if $uid != 0 && $uid != $<;
|
596
|
-
return 0 if $mode & 022;
|
597
|
-
return 1;
|
598
|
-
} ## end sub is_safe_file
|
599
|
-
|
600
|
-
# If the rcfile (whichever one we decided was the right one to read)
|
601
|
-
# exists, we safely do it.
|
602
|
-
if ( -f $rcfile ) {
|
603
|
-
safe_do("./$rcfile");
|
604
|
-
}
|
605
|
-
|
606
|
-
# If there isn't one here, try the user's home directory.
|
607
|
-
elsif ( defined $ENV{HOME} && -f "$ENV{HOME}/$rcfile" ) {
|
608
|
-
safe_do("$ENV{HOME}/$rcfile");
|
609
|
-
}
|
610
|
-
|
611
|
-
# Else try the login directory.
|
612
|
-
elsif ( defined $ENV{LOGDIR} && -f "$ENV{LOGDIR}/$rcfile" ) {
|
613
|
-
safe_do("$ENV{LOGDIR}/$rcfile");
|
614
|
-
}
|
615
|
-
|
616
|
-
# If the PERLDB_OPTS variable has options in it, parse those out next.
|
617
|
-
if ( defined $ENV{PERLDB_OPTS} ) {
|
618
|
-
parse_options( $ENV{PERLDB_OPTS} );
|
619
|
-
}
|
620
|
-
|
621
|
-
=pod
|
622
|
-
|
623
|
-
The last thing we do during initialization is determine which subroutine is
|
624
|
-
to be used to obtain a new terminal when a new debugger is started. Right now,
|
625
|
-
the debugger only handles X Windows and OS/2.
|
626
|
-
|
627
|
-
=cut
|
628
|
-
|
629
|
-
# Set up the get_fork_TTY subroutine to be aliased to the proper routine.
|
630
|
-
# Works if you're running an xterm or xterm-like window, or you're on
|
631
|
-
# OS/2. This may need some expansion: for instance, this doesn't handle
|
632
|
-
# OS X Terminal windows.
|
633
|
-
|
634
|
-
if (
|
635
|
-
not defined &get_fork_TTY # no routine exists,
|
636
|
-
and defined $ENV{TERM} # and we know what kind
|
637
|
-
# of terminal this is,
|
638
|
-
and $ENV{TERM} eq 'xterm' # and it's an xterm,
|
639
|
-
# and defined $ENV{WINDOWID} # and we know what window this is, <- wrong metric
|
640
|
-
and defined $ENV{DISPLAY} # and what display it's on,
|
641
|
-
)
|
642
|
-
{
|
643
|
-
*get_fork_TTY = \&xterm_get_fork_TTY; # use the xterm version
|
644
|
-
} ## end if (not defined &get_fork_TTY...
|
645
|
-
elsif ( $^O eq 'os2' ) { # If this is OS/2,
|
646
|
-
*get_fork_TTY = \&os2_get_fork_TTY; # use the OS/2 version
|
647
|
-
}
|
648
|
-
|
649
|
-
# untaint $^O, which may have been tainted by the last statement.
|
650
|
-
# see bug [perl #24674]
|
651
|
-
$^O =~ m/^(.*)\z/;
|
652
|
-
$^O = $1;
|
653
|
-
|
654
|
-
# Here begin the unreadable code. It needs fixing.
|
655
|
-
|
656
|
-
=head2 RESTART PROCESSING
|
657
|
-
|
658
|
-
This section handles the restart command. When the C<R> command is invoked, it
|
659
|
-
tries to capture all of the state it can into environment variables, and
|
660
|
-
then sets C<PERLDB_RESTART>. When we start executing again, we check to see
|
661
|
-
if C<PERLDB_RESTART> is there; if so, we reload all the information that
|
662
|
-
the R command stuffed into the environment variables.
|
663
|
-
|
664
|
-
PERLDB_RESTART - flag only, contains no restart data itself.
|
665
|
-
PERLDB_HIST - command history, if it's available
|
666
|
-
PERLDB_ON_LOAD - breakpoints set by the rc file
|
667
|
-
PERLDB_POSTPONE - subs that have been loaded/not executed, and have actions
|
668
|
-
PERLDB_VISITED - files that had breakpoints
|
669
|
-
PERLDB_FILE_... - breakpoints for a file
|
670
|
-
PERLDB_OPT - active options
|
671
|
-
PERLDB_INC - the original @INC
|
672
|
-
PERLDB_PRETYPE - preprompt debugger actions
|
673
|
-
PERLDB_PRE - preprompt Perl code
|
674
|
-
PERLDB_POST - post-prompt Perl code
|
675
|
-
PERLDB_TYPEAHEAD - typeahead captured by readline()
|
676
|
-
|
677
|
-
We chug through all these variables and plug the values saved in them
|
678
|
-
back into the appropriate spots in the debugger.
|
679
|
-
|
680
|
-
=cut
|
681
|
-
|
682
|
-
if ( exists $ENV{PERLDB_RESTART} ) {
|
683
|
-
|
684
|
-
# We're restarting, so we don't need the flag that says to restart anymore.
|
685
|
-
delete $ENV{PERLDB_RESTART};
|
686
|
-
|
687
|
-
# $restart = 1;
|
688
|
-
@hist = get_list('PERLDB_HIST');
|
689
|
-
%break_on_load = get_list("PERLDB_ON_LOAD");
|
690
|
-
%postponed = get_list("PERLDB_POSTPONE");
|
691
|
-
|
692
|
-
share(@hist);
|
693
|
-
share(@truehist);
|
694
|
-
share(%break_on_load);
|
695
|
-
share(%postponed);
|
696
|
-
|
697
|
-
# restore breakpoints/actions
|
698
|
-
my @had_breakpoints = get_list("PERLDB_VISITED");
|
699
|
-
for ( 0 .. $#had_breakpoints ) {
|
700
|
-
my %pf = get_list("PERLDB_FILE_$_");
|
701
|
-
$postponed_file{ $had_breakpoints[$_] } = \%pf if %pf;
|
702
|
-
}
|
703
|
-
|
704
|
-
# restore options
|
705
|
-
my %opt = get_list("PERLDB_OPT");
|
706
|
-
my ( $opt, $val );
|
707
|
-
while ( ( $opt, $val ) = each %opt ) {
|
708
|
-
$val =~ s/[\\\']/\\$1/g;
|
709
|
-
parse_options("$opt'$val'");
|
710
|
-
}
|
711
|
-
|
712
|
-
# restore original @INC
|
713
|
-
@INC = get_list("PERLDB_INC");
|
714
|
-
@ini_INC = @INC;
|
715
|
-
|
716
|
-
# return pre/postprompt actions and typeahead buffer
|
717
|
-
$pretype = [ get_list("PERLDB_PRETYPE") ];
|
718
|
-
$pre = [ get_list("PERLDB_PRE") ];
|
719
|
-
$post = [ get_list("PERLDB_POST") ];
|
720
|
-
@typeahead = get_list( "PERLDB_TYPEAHEAD", @typeahead );
|
721
|
-
} ## end if (exists $ENV{PERLDB_RESTART...
|
722
|
-
|
723
|
-
=head2 SETTING UP THE TERMINAL
|
724
|
-
|
725
|
-
Now, we'll decide how the debugger is going to interact with the user.
|
726
|
-
If there's no TTY, we set the debugger to run non-stop; there's not going
|
727
|
-
to be anyone there to enter commands.
|
728
|
-
|
729
|
-
=cut
|
730
|
-
|
731
|
-
if ($notty) {
|
732
|
-
$runnonstop = 1;
|
733
|
-
share($runnonstop);
|
734
|
-
}
|
735
|
-
|
736
|
-
=pod
|
737
|
-
|
738
|
-
If there is a TTY, we have to determine who it belongs to before we can
|
739
|
-
proceed. If this is a slave editor or graphical debugger (denoted by
|
740
|
-
the first command-line switch being '-emacs'), we shift this off and
|
741
|
-
set C<$rl> to 0 (XXX ostensibly to do straight reads).
|
742
|
-
|
743
|
-
=cut
|
744
|
-
|
745
|
-
else {
|
746
|
-
|
747
|
-
# Is Perl being run from a slave editor or graphical debugger?
|
748
|
-
# If so, don't use readline, and set $slave_editor = 1.
|
749
|
-
$slave_editor =
|
750
|
-
( ( defined $main::ARGV[0] ) and ( $main::ARGV[0] eq '-emacs' ) );
|
751
|
-
$rl = 0, shift(@main::ARGV) if $slave_editor;
|
752
|
-
|
753
|
-
#require Term::ReadLine;
|
754
|
-
|
755
|
-
=pod
|
756
|
-
|
757
|
-
We then determine what the console should be on various systems:
|
758
|
-
|
759
|
-
=over 4
|
760
|
-
|
761
|
-
=item * Cygwin - We use C<stdin> instead of a separate device.
|
762
|
-
|
763
|
-
=cut
|
764
|
-
|
765
|
-
if ( $^O eq 'cygwin' ) {
|
766
|
-
|
767
|
-
# /dev/tty is binary. use stdin for textmode
|
768
|
-
undef $console;
|
769
|
-
}
|
770
|
-
|
771
|
-
=item * Unix - use C</dev/tty>.
|
772
|
-
|
773
|
-
=cut
|
774
|
-
|
775
|
-
elsif ( -e "/dev/tty" ) {
|
776
|
-
$console = "/dev/tty";
|
777
|
-
}
|
778
|
-
|
779
|
-
=item * Windows or MSDOS - use C<con>.
|
780
|
-
|
781
|
-
=cut
|
782
|
-
|
783
|
-
elsif ( $^O eq 'dos' or -e "con" or $^O eq 'MSWin32' ) {
|
784
|
-
$console = "con";
|
785
|
-
}
|
786
|
-
|
787
|
-
=item * MacOS - use C<Dev:Console:Perl Debug> if this is the MPW version; C<Dev:
|
788
|
-
Console> if not.
|
789
|
-
|
790
|
-
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.
|
791
|
-
|
792
|
-
=cut
|
793
|
-
|
794
|
-
elsif ( $^O eq 'MacOS' ) {
|
795
|
-
if ( $MacPerl::Version !~ /MPW/ ) {
|
796
|
-
$console =
|
797
|
-
"Dev:Console:Perl Debug"; # Separate window for application
|
798
|
-
}
|
799
|
-
else {
|
800
|
-
$console = "Dev:Console";
|
801
|
-
}
|
802
|
-
} ## end elsif ($^O eq 'MacOS')
|
803
|
-
|
804
|
-
=item * VMS - use C<sys$command>.
|
805
|
-
|
806
|
-
=cut
|
807
|
-
|
808
|
-
else {
|
809
|
-
|
810
|
-
# everything else is ...
|
811
|
-
$console = "sys\$command";
|
812
|
-
}
|
813
|
-
|
814
|
-
=pod
|
815
|
-
|
816
|
-
=back
|
817
|
-
|
818
|
-
Several other systems don't use a specific console. We C<undef $console>
|
819
|
-
for those (Windows using a slave editor/graphical debugger, NetWare, OS/2
|
820
|
-
with a slave editor, Epoc).
|
821
|
-
|
822
|
-
=cut
|
823
|
-
|
824
|
-
if ( ( $^O eq 'MSWin32' ) and ( $slave_editor or defined $ENV{EMACS} ) ) {
|
825
|
-
|
826
|
-
# /dev/tty is binary. use stdin for textmode
|
827
|
-
$console = undef;
|
828
|
-
}
|
829
|
-
|
830
|
-
if ( $^O eq 'NetWare' ) {
|
831
|
-
|
832
|
-
# /dev/tty is binary. use stdin for textmode
|
833
|
-
$console = undef;
|
834
|
-
}
|
835
|
-
|
836
|
-
# In OS/2, we need to use STDIN to get textmode too, even though
|
837
|
-
# it pretty much looks like Unix otherwise.
|
838
|
-
if ( defined $ENV{OS2_SHELL} and ( $slave_editor or $ENV{WINDOWID} ) )
|
839
|
-
{ # In OS/2
|
840
|
-
$console = undef;
|
841
|
-
}
|
842
|
-
|
843
|
-
# EPOC also falls into the 'got to use STDIN' camp.
|
844
|
-
if ( $^O eq 'epoc' ) {
|
845
|
-
$console = undef;
|
846
|
-
}
|
847
|
-
|
848
|
-
=pod
|
849
|
-
|
850
|
-
If there is a TTY hanging around from a parent, we use that as the console.
|
851
|
-
|
852
|
-
=cut
|
853
|
-
|
854
|
-
$console = $tty if defined $tty;
|
855
|
-
|
856
|
-
=head2 SOCKET HANDLING
|
857
|
-
|
858
|
-
The debugger is capable of opening a socket and carrying out a debugging
|
859
|
-
session over the socket.
|
860
|
-
|
861
|
-
If C<RemotePort> was defined in the options, the debugger assumes that it
|
862
|
-
should try to start a debugging session on that port. It builds the socket
|
863
|
-
and then tries to connect the input and output filehandles to it.
|
864
|
-
|
865
|
-
=cut
|
866
|
-
|
867
|
-
# Handle socket stuff.
|
868
|
-
|
869
|
-
if ( defined $remoteport ) {
|
870
|
-
|
871
|
-
# If RemotePort was defined in the options, connect input and output
|
872
|
-
# to the socket.
|
873
|
-
require IO::Socket;
|
874
|
-
$OUT = new IO::Socket::INET(
|
875
|
-
Timeout => '10',
|
876
|
-
PeerAddr => $remoteport,
|
877
|
-
Proto => 'tcp',
|
878
|
-
);
|
879
|
-
if ( !$OUT ) { die "Unable to connect to remote host: $remoteport\n"; }
|
880
|
-
$IN = $OUT;
|
881
|
-
} ## end if (defined $remoteport)
|
882
|
-
|
883
|
-
=pod
|
884
|
-
|
885
|
-
If no C<RemotePort> was defined, and we want to create a TTY on startup,
|
886
|
-
this is probably a situation where multiple debuggers are running (for example,
|
887
|
-
a backticked command that starts up another debugger). We create a new IN and
|
888
|
-
OUT filehandle, and do the necessary mojo to create a new TTY if we know how
|
889
|
-
and if we can.
|
890
|
-
|
891
|
-
=cut
|
892
|
-
|
893
|
-
# Non-socket.
|
894
|
-
else {
|
895
|
-
|
896
|
-
# Two debuggers running (probably a system or a backtick that invokes
|
897
|
-
# the debugger itself under the running one). create a new IN and OUT
|
898
|
-
# filehandle, and do the necessary mojo to create a new tty if we
|
899
|
-
# know how, and we can.
|
900
|
-
create_IN_OUT(4) if $CreateTTY & 4;
|
901
|
-
if ($console) {
|
902
|
-
|
903
|
-
# If we have a console, check to see if there are separate ins and
|
904
|
-
# outs to open. (They are assumed identiical if not.)
|
905
|
-
|
906
|
-
my ( $i, $o ) = split /,/, $console;
|
907
|
-
$o = $i unless defined $o;
|
908
|
-
|
909
|
-
# read/write on in, or just read, or read on STDIN.
|
910
|
-
open( IN, "+<$i" )
|
911
|
-
|| open( IN, "<$i" )
|
912
|
-
|| open( IN, "<&STDIN" );
|
913
|
-
|
914
|
-
# read/write/create/clobber out, or write/create/clobber out,
|
915
|
-
# or merge with STDERR, or merge with STDOUT.
|
916
|
-
open( OUT, "+>$o" )
|
917
|
-
|| open( OUT, ">$o" )
|
918
|
-
|| open( OUT, ">&STDERR" )
|
919
|
-
|| open( OUT, ">&STDOUT" ); # so we don't dongle stdout
|
920
|
-
|
921
|
-
} ## end if ($console)
|
922
|
-
elsif ( not defined $console ) {
|
923
|
-
|
924
|
-
# No console. Open STDIN.
|
925
|
-
open( IN, "<&STDIN" );
|
926
|
-
|
927
|
-
# merge with STDERR, or with STDOUT.
|
928
|
-
open( OUT, ">&STDERR" )
|
929
|
-
|| open( OUT, ">&STDOUT" ); # so we don't dongle stdout
|
930
|
-
$console = 'STDIN/OUT';
|
931
|
-
} ## end elsif (not defined $console)
|
932
|
-
|
933
|
-
# Keep copies of the filehandles so that when the pager runs, it
|
934
|
-
# can close standard input without clobbering ours.
|
935
|
-
$IN = \*IN, $OUT = \*OUT if $console or not defined $console;
|
936
|
-
} ## end elsif (from if(defined $remoteport))
|
937
|
-
|
938
|
-
# Unbuffer DB::OUT. We need to see responses right away.
|
939
|
-
my $previous = select($OUT);
|
940
|
-
$| = 1; # for DB::OUT
|
941
|
-
select($previous);
|
942
|
-
|
943
|
-
# Line info goes to debugger output unless pointed elsewhere.
|
944
|
-
# Pointing elsewhere makes it possible for slave editors to
|
945
|
-
# keep track of file and position. We have both a filehandle
|
946
|
-
# and a I/O description to keep track of.
|
947
|
-
$LINEINFO = $OUT unless defined $LINEINFO;
|
948
|
-
$lineinfo = $console unless defined $lineinfo;
|
949
|
-
# share($LINEINFO); # <- unable to share globs
|
950
|
-
share($lineinfo); #
|
951
|
-
|
952
|
-
=pod
|
953
|
-
|
954
|
-
To finish initialization, we show the debugger greeting,
|
955
|
-
and then call the C<afterinit()> subroutine if there is one.
|
956
|
-
|
957
|
-
=cut
|
958
|
-
|
959
|
-
# Show the debugger greeting.
|
960
|
-
$header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
|
961
|
-
unless ($runnonstop) {
|
962
|
-
local $\ = '';
|
963
|
-
local $, = '';
|
964
|
-
if ( $term_pid eq '-1' ) {
|
965
|
-
print $OUT "\nDaughter DB session started...\n";
|
966
|
-
}
|
967
|
-
else {
|
968
|
-
print $OUT "\nLoading DB routines from $header\n";
|
969
|
-
print $OUT (
|
970
|
-
"Editor support ",
|
971
|
-
$slave_editor ? "enabled" : "available", ".\n"
|
972
|
-
);
|
973
|
-
print $OUT
|
974
|
-
"\nEnter h or `h h' for help, or `$doccmd perldebug' for more help.\n\n";
|
975
|
-
} ## end else [ if ($term_pid eq '-1')
|
976
|
-
} ## end unless ($runnonstop)
|
977
|
-
} ## end else [ if ($notty)
|
978
|
-
|
979
|
-
# XXX This looks like a bug to me.
|
980
|
-
# Why copy to @ARGS and then futz with @args?
|
981
|
-
@ARGS = @ARGV;
|
982
|
-
for (@args) {
|
983
|
-
# Make sure backslashes before single quotes are stripped out, and
|
984
|
-
# keep args unless they are numeric (XXX why?)
|
985
|
-
# s/\'/\\\'/g; # removed while not justified understandably
|
986
|
-
# s/(.*)/'$1'/ unless /^-?[\d.]+$/; # ditto
|
987
|
-
}
|
988
|
-
|
989
|
-
# If there was an afterinit() sub defined, call it. It will get
|
990
|
-
# executed in our scope, so it can fiddle with debugger globals.
|
991
|
-
if ( defined &afterinit ) { # May be defined in $rcfile
|
992
|
-
&afterinit();
|
993
|
-
}
|
994
|
-
|
995
|
-
# Inform us about "Stack dump during die enabled ..." in dieLevel().
|
996
|
-
$I_m_init = 1;
|
997
|
-
|
998
|
-
|